/* OKayBrood · PLU-trainer — mobile first */

:root {
  color-scheme: light dark;
  --bg: #fbf6ee;
  --surface: #ffffff;
  --surface-2: #f4ecdf;
  --ink: #2a1f16;
  --ink-2: #6e5d4c;
  --ink-3: #9a8774;
  --line: #e7dccc;
  --brand: #b45309;
  --brand-2: #92400e;
  --brand-soft: #fdebd2;
  --on-brand: #ffffff;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --busy: #d97706;
  --focus: #2563eb;
  --photo-bg: #ffffff;

  --c-wit: #1d4ed8;   --c-wit-bg: #dbeafe;
  --c-grof: #854d0e;  --c-grof-bg: #fef08a;
  --c-spec: #be185d;  --c-spec-bg: #fce7f3;
  --c-stok: #166534;  --c-stok-bg: #dcfce7;
  --c-vien: #6d28d9;  --c-vien-bg: #ede9fe;
  --c-pist: #0f766e;  --c-pist-bg: #ccfbf1;
  --c-donut: #c2410c; --c-donut-bg: #ffedd5;
  --c-snack: #334155; --c-snack-bg: #e2e8f0;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(60 40 20 / 6%), 0 6px 20px rgb(60 40 20 / 7%);
  --shadow-lg: 0 10px 40px rgb(40 25 10 / 18%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16110c;
    --surface: #211912;
    --surface-2: #2c2219;
    --ink: #f5ede3;
    --ink-2: #c8b6a2;
    --ink-3: #94806c;
    --line: #3a2e23;
    --brand: #f59e0b;
    --brand-2: #fbbf24;
    --brand-soft: #3d2b12;
    --on-brand: #1b1206;
    --ok: #4ade80;
    --ok-soft: #12301d;
    --bad: #f87171;
    --bad-soft: #3b1818;
    --busy: #fbbf24;
    --focus: #93c5fd;
    --photo-bg: #fbf8f4;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);

    --c-wit: #93c5fd;   --c-wit-bg: rgb(59 130 246 / 20%);
    --c-grof: #fde047;  --c-grof-bg: rgb(234 179 8 / 18%);
    --c-spec: #f9a8d4;  --c-spec-bg: rgb(236 72 153 / 18%);
    --c-stok: #86efac;  --c-stok-bg: rgb(34 197 94 / 16%);
    --c-vien: #c4b5fd;  --c-vien-bg: rgb(139 92 246 / 20%);
    --c-pist: #5eead4;  --c-pist-bg: rgb(20 184 166 / 18%);
    --c-donut: #fdba74; --c-donut-bg: rgb(249 115 22 / 18%);
    --c-snack: #cbd5e1; --c-snack-bg: rgb(148 163 184 / 18%);
  }
}

/* ── Basis ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
h2 { font-size: 1.25rem; line-height: 1.25; font-weight: 800; }
.h3 { font-size: 1rem; font-weight: 800; margin: 0 0 10px; }
.lead { font-size: 1.05rem; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 0.85rem; }
b, strong { font-weight: 750; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.ico { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px;
}
.skip:focus { top: 12px; }

main {
  display: block;
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-left)) 32px max(16px, env(safe-area-inset-right));
  outline: none;
}
main > * + * { margin-top: 16px; }

/* ── Topbar & navigatie ────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 56px;
  padding: 0 max(16px, env(safe-area-inset-left));
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  /* geen backdrop-filter op gsm: die maakt van de topbar het kader voor de vaste tabbalk */
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand b { color: var(--brand); }
.user-chip {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  text-decoration: none; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); max-width: 46vw;
}
.user-chip[aria-current] { border-color: var(--brand); }
.user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; font-size: 0.95rem; }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); font-weight: 800; font-size: 0.8rem;
}
.avatar--sm { width: 24px; height: 24px; font-size: 0.65rem; }

/* Op gsm: tabbalk onderaan */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.nav a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ink-3); font-size: 0.7rem; font-weight: 650;
}
.nav a .ico { width: 24px; height: 24px; }
.nav a[aria-current] { color: var(--brand); }
.nav a[aria-current]::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--brand);
}
.nav .badge { position: absolute; top: 6px; left: calc(50% + 6px); }

.badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--bad); color: #fff;
  font: 800 0.7rem/1 var(--font); font-style: normal;
}

body.no-user .nav, body.no-user .user-chip { display: none; }
body.no-user { padding-bottom: 0; }
body.playing .topbar, body.playing .nav, body.playing .footer { display: none; }
body.playing { padding-bottom: 0; }

.footer { max-width: 1000px; margin: 0 auto; padding: 8px 16px 24px; text-align: center; font-size: 0.8rem; color: var(--ink-3); }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .topbar {
    padding: 0 24px; gap: 20px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
  }
  .nav {
    position: static; display: flex; gap: 4px; height: auto; padding: 0;
    background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .nav a {
    flex-direction: row; gap: 8px; padding: 8px 12px; border-radius: 12px;
    font-size: 0.95rem; color: var(--ink-2);
  }
  .nav a .ico { width: 20px; height: 20px; }
  .nav a:hover { background: var(--surface-2); color: var(--ink); }
  .nav a[aria-current] { background: var(--brand-soft); color: var(--brand-2); }
  .nav a[aria-current]::before { display: none; }
  .nav .badge { position: static; }
  main { padding: 28px 24px 40px; }
  main > * + * { margin-top: 20px; }
}

/* ── Bouwstenen ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.page-head { display: grid; gap: 6px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head h1 .ico { color: var(--brand); width: 0.9em; height: 0.9em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid transparent; border-radius: 14px;
  font-weight: 750; text-decoration: none; line-height: 1.2;
  transition: transform 0.08s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; }
.btn--lg { min-height: 52px; font-size: 1.05rem; padding: 12px 22px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn--primary:hover:not(:disabled) { background: var(--brand-2); }
.btn--soft { background: var(--brand-soft); color: var(--brand-2); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { color: var(--bad); }
.btn--ok { background: var(--ok-soft); color: var(--ok); }
.btn--bad { background: var(--bad-soft); color: var(--bad); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink);
}
.icon-btn .ico { width: 22px; height: 22px; }
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-2); font-weight: 700; text-decoration: none; margin-top: 12px; }
.link:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions--center { justify-content: center; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 7px;
  font: 800 0.68rem/1.5 var(--font); letter-spacing: 0.04em; vertical-align: 0.15em;
  color: var(--c, var(--ink-2)); background: var(--c-bg, var(--surface-2));
}
[data-cat="wit"] { --c: var(--c-wit); --c-bg: var(--c-wit-bg); }
[data-cat="grof"] { --c: var(--c-grof); --c-bg: var(--c-grof-bg); }
[data-cat="spec"] { --c: var(--c-spec); --c-bg: var(--c-spec-bg); }
[data-cat="stok"] { --c: var(--c-stok); --c-bg: var(--c-stok-bg); }
[data-cat="vien"] { --c: var(--c-vien); --c-bg: var(--c-vien-bg); }
[data-cat="pist"] { --c: var(--c-pist); --c-bg: var(--c-pist-bg); }
[data-cat="donut"] { --c: var(--c-donut); --c-bg: var(--c-donut-bg); }
[data-cat="snack"] { --c: var(--c-snack); --c-bg: var(--c-snack-bg); }
@media (prefers-color-scheme: light) { [data-cat="grof"] .tag, .tag[data-cat="grof"] { color: #713f12; } }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-weight: 750; font-size: 0.8rem;
}
.pill--dark { background: var(--ink); color: var(--bg); }
.pill--brand { background: var(--brand-soft); color: var(--brand-2); }

.plu {
  display: inline-flex; align-items: stretch; overflow: hidden;
  border-radius: 9px; border: 1px solid var(--ink); font-size: 0.85rem; line-height: 1;
}
.plu-lbl { padding: 6px 7px; background: var(--ink); color: var(--bg); font-weight: 600; white-space: nowrap; }
.plu-code { padding: 6px 8px; font: 800 0.95rem/1 var(--mono); letter-spacing: 0.04em; background: var(--surface); }
.plu--hl { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.plu--hl .plu-lbl { background: var(--brand); color: var(--on-brand); }
.plus { display: flex; flex-wrap: wrap; gap: 6px; }
.plus--lg .plu { font-size: 1rem; }
.plus--lg .plu-code { font-size: 1.25rem; padding: 8px 10px; }
.plus--lg .plu-lbl { padding: 8px 9px; }

.ph {
  position: relative; overflow: hidden; aspect-ratio: 4 / 3;
  background: var(--photo-bg); border-radius: var(--radius-sm);
}
.ph img { width: 100%; height: 100%; object-fit: contain; }
.ph--none { display: grid; place-items: center; background: var(--c-bg, var(--surface-2)); font-size: 2.6rem; }
.ph--thumb { width: 72px; flex: none; border-radius: 10px; border: 1px solid var(--line); }
.ph--thumb.ph--none { font-size: 1.6rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips + .chips { margin-top: 8px; }
.chips--scroll {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px;
}
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 40px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-size: 0.92rem;
  touch-action: manipulation; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip--preset[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface-2); gap: 4px; }
.seg button {
  min-height: 40px; min-width: 64px; padding: 6px 16px; border: 0; border-radius: 10px;
  background: transparent; font-weight: 750; color: var(--ink-2);
}
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin-inline: -16px; padding: 0 16px; border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 12px 10px; text-decoration: none; font-weight: 750; color: var(--ink-2);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab[aria-current] { color: var(--brand-2); border-bottom-color: var(--brand); }
@media (min-width: 760px) {
  .tabs, .chips--scroll { margin-inline: 0; padding-inline: 0; }
}
.learn-body > * + * { margin-top: 16px; }

.search {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; min-height: 48px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.search .ico { color: var(--ink-3); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 1rem; padding: 12px 0; }
.filters { display: grid; gap: 12px; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--line); }
.dot--ok { background: var(--ok); }
.dot--busy { background: var(--busy); }
.dot--rem { background: var(--bad); }
.dot--new { background: var(--line); box-shadow: inset 0 0 0 1px var(--ink-3); }

.ring { display: block; flex: none; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--brand); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.ring-num { font: 800 26px/1 var(--font); fill: var(--ink); text-anchor: middle; }
.ring-lbl { font: 650 12px/1 var(--font); fill: var(--ink-2); text-anchor: middle; }

.stack { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.stack i { display: block; height: 100%; }
.stack-ok { background: var(--ok); }
.stack-busy { background: var(--busy); }
.stack-rem { background: var(--bad); }

.hints { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hints li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); font-size: 0.95rem;
}
.hints .ico { color: var(--brand-2); margin-top: 2px; }

.empty { color: var(--ink-2); text-align: center; padding: 24px 0; }
.empty-state { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 28px 20px; }
.empty-emoji { font-size: 3rem; line-height: 1; }

/* ── Welkom ────────────────────────────────────────────── */
.welcome { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 560px; margin: 0 auto; text-align: center; }
.welcome .lead { margin-top: -6px; }
.welcome-art { display: flex; justify-content: center; margin: 12px 0 4px; overflow-x: clip; padding: 6px 0; }
.welcome-art .ph {
  width: 34%; max-width: 170px; aspect-ratio: 1; border-radius: 50%;
  border: 4px solid var(--bg); box-shadow: var(--shadow);
}
.welcome-art .ph img { object-fit: cover; transform: scale(1.25); }
.welcome-art .ph:nth-child(1) { transform: rotate(-8deg) translateX(18%); }
.welcome-art .ph:nth-child(2) { z-index: 1; transform: translateY(-8%) scale(1.1); }
.welcome-art .ph:nth-child(3) { transform: rotate(8deg) translateX(-18%); }
.name-form { text-align: left; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.name-form label { margin: 0; }
.name-row { display: flex; gap: 8px; }
.name-row input {
  flex: 1; min-width: 0; min-height: 52px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg); font-size: 1.1rem;
}
.name-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.name-row input[aria-invalid="true"] { border-color: var(--bad); }
.welcome .chips { justify-content: center; }
.chip--user { padding-left: 6px; }
.steps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; text-align: left; }
.steps li {
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center;
  padding: 14px; border-radius: var(--radius); background: var(--surface-2);
}
.steps .step-ico { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface); color: var(--brand); }
.steps span:last-child { color: var(--ink-2); font-size: 0.92rem; }

/* ── Start ─────────────────────────────────────────────── */
.hero { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, var(--brand-soft), var(--surface) 70%); }
.hero-text { display: grid; gap: 8px; justify-items: start; flex: 1; }
.hero-text .btn { margin-top: 6px; }
.kicker { font-weight: 750; color: var(--brand-2); }
.hero-ring { flex: none; text-decoration: none; }
@media (max-width: 480px) {
  .hero { flex-direction: column-reverse; align-items: stretch; text-align: left; }
  .hero-ring { align-self: center; }
  .hero-text .btn { width: 100%; }
}
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative; display: grid; gap: 4px; align-content: start;
  padding: 16px; min-height: 132px; border-radius: var(--radius);
  text-decoration: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.tile:active { transform: scale(0.98); }
.tile b { font-size: 1.08rem; }
.tile span:last-of-type { color: var(--ink-2); font-size: 0.88rem; line-height: 1.35; }
.tile-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; margin-bottom: 6px; }
.tile-ico .ico { width: 24px; height: 24px; }
.tile--learn .tile-ico { background: var(--c-wit-bg); color: var(--c-wit); }
.tile--practice .tile-ico { background: var(--brand-soft); color: var(--brand-2); }
.tile--rem .tile-ico { background: var(--bad-soft); color: var(--bad); }
.tile--test .tile-ico { background: var(--ok-soft); color: var(--ok); }
.tile .badge { position: absolute; top: 14px; right: 14px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, 1fr); } .tile:hover { transform: translateY(-2px); } }
.home-cols { display: grid; gap: 16px; }
@media (min-width: 760px) { .home-cols { grid-template-columns: 1fr 1fr; } }
.tip { display: grid; gap: 6px; align-content: start; }
.tip-head { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--brand-2); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.tip-title { font-weight: 800; font-size: 1.1rem; }
.prog-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.prog-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.prog-row .stack { grid-column: 1 / -1; }
.prog-label { font-weight: 650; }
.prog-pct { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── Leren: kaarten ────────────────────────────────────── */
.group + .group { margin-top: 24px; }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin-bottom: 12px; }
.group-title small { color: var(--ink-3); font-weight: 650; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pcard {
  display: grid; text-align: left; padding: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.pcard:active { transform: scale(0.98); }
.pcard .ph { border-radius: 0; }
.pcard-body { display: grid; gap: 8px; padding: 10px 12px 12px; }
.pcard-name { font-weight: 750; line-height: 1.25; }
.pcard .plu { font-size: 0.72rem; }
.pcard .plu-code { font-size: 0.82rem; padding: 5px 6px; }
.pcard .plu-lbl { padding: 5px 6px; }
.rows { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
@media (min-width: 640px) { .rows { grid-template-columns: 1fr 1fr; } }
.prow {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 52px; padding: 8px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.prow-code { font: 800 1rem/1 var(--mono); letter-spacing: 0.04em; padding: 6px 8px; border-radius: 8px; background: var(--c-bg); color: var(--c); }
.prow { --c: var(--ink); --c-bg: var(--surface-2); }
.prow-name { flex: 1; font-weight: 650; }

/* Detail-sheet */
.dialog {
  padding: 0; border: 0; background: transparent; color: var(--ink);
  width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0;
}
.dialog::backdrop { background: rgb(20 12 4 / 50%); backdrop-filter: blur(2px); }
.dialog[open] { animation: sheet-in 0.22s ease-out; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 640px) { .dialog { margin: auto; } }
.sheet {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 16px calc(20px + var(--safe-b));
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .sheet { border-radius: 22px; padding: 20px; } }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 2; background: color-mix(in srgb, var(--surface) 85%, transparent); }
.sheet-photos { display: grid; gap: 8px; }
.sheet-photos.is-multi { grid-template-columns: 1fr 1fr; }
.sheet-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 1.4rem; padding-right: 48px; }
.sheet-codes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sheet-codes li { display: flex; align-items: center; gap: 10px; }
.sheet-codes .plu { font-size: 1rem; }
.sheet-codes .plu-code { font-size: 1.2rem; padding: 8px 10px; }
.sheet-codes .plu-lbl { padding: 8px 9px; }
.look { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 0.95rem; }
.note { padding: 10px 12px; border-radius: 12px; background: var(--c-wit-bg); color: var(--c-wit); font-size: 0.9rem; }

/* Flitskaarten */
.flash-area { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 520px; margin-inline: auto; }
.flash-top { display: flex; align-items: center; gap: 12px; }
.flash-count { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.mini-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width 0.3s ease; }
.flash { perspective: 1400px; cursor: pointer; border-radius: var(--radius); }
.flash-inner { display: grid; transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); transform-style: preserve-3d; }
.flash.is-flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  grid-area: 1 / 1; display: grid; gap: 12px; align-content: center; justify-items: center; text-align: center;
  padding: 16px; min-height: 340px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flash-front .ph { width: 100%; }
.flash-back { transform: rotateY(180deg); background: linear-gradient(160deg, var(--brand-soft), var(--surface) 60%); }
.flash-big { display: grid; place-items: center; width: 120px; height: 120px; border-radius: 50%; font-size: 4rem; background: var(--c-bg); }
.flash-name { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.flash-q { color: var(--ink-2); font-weight: 650; }
.flash-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ink-3); }
.flash-back .plus { justify-content: center; }
.flash-tip { display: flex; gap: 8px; text-align: left; font-size: 0.92rem; color: var(--ink-2); }
.flash-tip .ico { color: var(--brand-2); margin-top: 2px; }
.flash-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }

/* Ezelsbruggetjes */
.patterns { display: grid; gap: 14px; }
@media (min-width: 760px) { .patterns { grid-template-columns: 1fr 1fr; } }
.pattern { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; }
.pattern-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.pattern-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); font-size: 1.3rem; flex: none; }
.pattern--fact { background: var(--surface-2); box-shadow: none; }
.pattern--fact .pattern-ico { background: var(--surface); }
.ex { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ex li { display: flex; align-items: baseline; gap: 12px; }
.ex-code { font: 700 1.05rem/1.3 var(--mono); letter-spacing: 0.06em; min-width: 5.2ch; color: var(--ink-2); }
.ex-code b { color: var(--brand); font-weight: 800; background: var(--brand-soft); border-radius: 4px; padding: 0 1px; }
.ex-name small { color: var(--ink-3); font-weight: 650; }
.ex-label { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bad); margin-top: 4px; }
.ex--except .ex-code { color: var(--bad); }

/* Lijst */
.pdf-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pdf-card p { font-size: 0.9rem; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.codes { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.codes th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding: 10px 12px; background: var(--surface-2); }
.codes td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.codes tr[data-id] { cursor: pointer; }
.codes tr[data-id]:hover td { background: var(--surface-2); }
.codes .mono { font: 800 1rem/1 var(--mono); letter-spacing: 0.04em; white-space: nowrap; }
.codes td:last-child { white-space: nowrap; font-size: 0.85rem; }
.cell-name { font-weight: 650; margin-right: 4px; }
@media (max-width: 420px) { .codes td, .codes th { padding: 9px 8px; } .codes .tag { display: none; } }

/* ── Herhalen: instellingen ────────────────────────────── */
.setup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.setup .h3 { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.setup .h3:first-child { margin-top: 0; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 0.8rem; }
/* Niveaus */
.levels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.level-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 1rem; margin-top: 8px; }
.level-group small { font-weight: 650; color: var(--ink-3); font-size: 0.85rem; }
.level-group--extra { color: var(--ink-2); }
.level-list { display: grid; gap: 10px; }
@media (min-width: 640px) { .level-list { grid-template-columns: 1fr 1fr; } }
.level {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px; border-radius: var(--radius);
  border: 2px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.level:active { transform: scale(0.98); }
@media (hover: hover) { .level:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); } }
.level[aria-pressed="true"] { border-color: var(--brand); background: linear-gradient(135deg, var(--brand-soft), var(--surface) 75%); }
.level-badge {
  display: grid; place-items: center; flex: none; min-width: 48px; height: 48px; padding: 0 8px;
  border-radius: 14px; background: var(--surface-2); color: var(--ink); font-weight: 850; font-size: 1.05rem;
}
.level[aria-pressed="true"] .level-badge { background: var(--brand); color: var(--on-brand); }
.level[data-level="BO"] .level-badge { font-size: 0.8rem; }
.level-txt { flex: 1; min-width: 0; display: grid; gap: 4px; }
.level-txt b { font-size: 1.05rem; }
.level-txt small { color: var(--ink-2); font-size: 0.86rem; line-height: 1.35; }
.level-mode { font-weight: 800; color: var(--brand-2); }
.level-txt .stack { height: 6px; margin-top: 4px; }
.level-pct { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 0.9rem; }
.chip small { font-weight: 700; opacity: 0.6; }
.setup-info { margin: 14px 0 8px; color: var(--ink-2); font-size: 0.92rem; }

/* ── Speelscherm ───────────────────────────────────────── */
.play { max-width: 620px; margin: 0 auto; }
.play-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  margin: -16px -16px 0; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
}
@media (min-width: 760px) { .play-top { margin: -28px 0 0; padding: 18px 0 12px; } }
.play-bar { flex: 1; height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.play-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #f59e0b); transition: width 0.35s ease; }
.play-count { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 3.5ch; text-align: right; }
.play-body { padding-top: 6px; }

.q { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.q-prompt { display: grid; gap: 8px; justify-items: center; text-align: center; }
.q-photo { width: 100%; max-height: 36dvh; aspect-ratio: 4 / 3; box-shadow: var(--shadow); border: 1px solid var(--line); }
.q-photo img { max-height: 36dvh; }
.q-photo--sm { width: 62%; max-width: 280px; }
.q--foto-plu .q-photo, .q--foto-plu .q-photo img { max-height: 30dvh; }
.q-kicker { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.q-title { font-size: 1.3rem; line-height: 1.3; font-weight: 750; }
.q-title b { font-weight: 850; }
.q-code { font: 800 2.4rem/1 var(--mono); letter-spacing: 0.1em; padding: 14px 22px; border-radius: 16px; background: var(--ink); color: var(--bg); }

.opts { display: grid; gap: 10px; }
.opts--codes { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .opts:not(.opts--photos) { grid-template-columns: 1fr 1fr; } }
.opt {
  position: relative; display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 58px; padding: 10px 14px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--surface); font-weight: 700; font-size: 1.02rem;
  box-shadow: 0 2px 0 var(--line);
  transition: transform 0.08s ease, border-color 0.15s ease, background-color 0.15s ease;
  touch-action: manipulation;
}
.opt:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
@media (hover: hover) { .opt:hover:not(:disabled) { border-color: var(--brand); } }
.opt-key {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px;
  background: var(--surface-2); color: var(--ink-3); font-size: 0.8rem; font-weight: 800;
}
.opt--mono { justify-content: center; }
.opt--mono .opt-lbl { font: 800 1.35rem/1 var(--mono); letter-spacing: 0.08em; }
.opt--mono .opt-key { position: absolute; left: 10px; }
.opts--photos { grid-template-columns: 1fr 1fr; }
.opt--photo { padding: 0; overflow: hidden; background: var(--photo-bg); aspect-ratio: 4 / 3; }
.opt--photo img { width: 100%; height: 100%; object-fit: contain; }
.opt--photo .opt-key { position: absolute; top: 8px; left: 8px; background: rgb(255 255 255 / 85%); color: #6e5d4c; }
.opt.is-correct { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 2px 0 var(--ok); }
.opt.is-correct .opt-key { background: var(--ok); color: #fff; }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 2px 0 var(--bad); animation: shake 0.35s; }
.opt.is-wrong .opt-key { background: var(--bad); color: #fff; }
.opt.is-chosen { border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.opt.is-dim { opacity: 0.5; }
.opt--photo.is-correct, .opt--photo.is-wrong { box-shadow: 0 0 0 3px var(--ok) inset; }
.opt--photo.is-wrong { box-shadow: 0 0 0 3px var(--bad) inset; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Naam typen */
.name-answer { display: grid; gap: 10px; max-width: 460px; width: 100%; margin: 0 auto; }
.text-answer {
  width: 100%; min-height: 58px; padding: 0 18px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--surface);
  font-size: 1.25rem; font-weight: 700; text-align: center;
}
.text-answer:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); }
.name-answer-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.name-answer.is-correct .text-answer { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.name-answer.is-wrong .text-answer { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); text-decoration: line-through; animation: shake 0.35s; }
.name-answer.is-chosen .text-answer { border-color: var(--ink); }
.name-answer.is-locked .name-answer-actions { display: none; }
.q-product { font-size: 1.6rem; font-weight: 850; line-height: 1.2; padding: 18px 12px; }

/* Kassaklavier */
.numpad { display: grid; gap: 10px; max-width: 360px; width: 100%; margin: 0 auto; }
.np-display {
  display: flex; align-items: center; gap: 10px;
  min-height: 64px; padding: 0 16px; border-radius: 14px;
  background: #13261b; color: #7cf29a; border: 3px solid #0c1a12;
  box-shadow: inset 0 2px 8px rgb(0 0 0 / 50%);
}
.np-label { font: 800 0.7rem/1 var(--font); letter-spacing: 0.1em; color: #4fae69; }
.np-digits { flex: 1; text-align: right; font: 700 2.1rem/1 var(--mono); letter-spacing: 0.18em; }
.np-caret { width: 3px; height: 30px; background: currentColor; animation: blink 1s steps(1) infinite; }
.numpad.is-locked .np-caret { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.numpad.is-correct .np-display { background: var(--ok); color: #fff; border-color: color-mix(in srgb, var(--ok) 70%, #000); }
.numpad.is-correct .np-label { color: #e6ffe9; }
.numpad.is-wrong .np-display { background: var(--bad); color: #fff; border-color: color-mix(in srgb, var(--bad) 70%, #000); animation: shake 0.35s; }
.numpad.is-wrong .np-label { color: #ffe1e1; }
.numpad.is-wrong .np-digits { text-decoration: line-through; text-decoration-thickness: 3px; }
.numpad.is-chosen .np-display { background: var(--ink); color: var(--bg); }
.np-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.np-key {
  min-height: 58px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font: 750 1.5rem/1 var(--font);
  box-shadow: 0 3px 0 var(--line);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.np-key:active:not(:disabled) { transform: translateY(3px); box-shadow: none; background: var(--surface-2); }
.np-key--fn { display: grid; place-items: center; background: var(--surface-2); }
.np-key--fn .ico { width: 26px; height: 26px; }
.np-key--ok { background: var(--ok); color: #fff; border-color: transparent; box-shadow: 0 3px 0 color-mix(in srgb, var(--ok) 60%, #000); font-size: 1.15rem; font-weight: 800; }
.np-key:disabled { opacity: 0.45; }
.numpad.is-locked .np-keys { display: none; }
@media (max-height: 700px) {
  .np-key { min-height: 48px; }
  .np-display { min-height: 54px; }
  .q-photo, .q-photo img { max-height: 26dvh; }
  .q--foto-plu .q-photo, .q--foto-plu .q-photo img { max-height: 22dvh; }
}

/* Feedback */
.q-foot:empty { display: none; }
.q-foot { position: sticky; bottom: 0; z-index: 4; padding-bottom: max(12px, var(--safe-b)); margin-inline: -16px; padding-inline: 16px; background: linear-gradient(to top, var(--bg) 80%, transparent); padding-top: 8px; }
@media (min-width: 760px) { .q-foot { margin-inline: 0; padding-inline: 0; } }
.fb {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; border-radius: var(--radius);
  border: 2px solid; animation: fb-in 0.2s ease-out;
}
@keyframes fb-in { from { transform: translateY(12px); opacity: 0; } }
.fb--ok { background: var(--ok-soft); border-color: var(--ok); }
.fb--bad { background: var(--bad-soft); border-color: var(--bad); }
.fb-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 1.15rem; }
.fb-head .ico { width: 26px; height: 26px; padding: 4px; border-radius: 50%; color: #fff; }
.fb--ok .fb-head { color: var(--ok); }
.fb--ok .fb-head .ico { background: var(--ok); }
.fb--bad .fb-head { color: var(--bad); }
.fb--bad .fb-head .ico { background: var(--bad); }
.fb-extra { font-size: 0.9rem; font-weight: 650; color: var(--ink-2); }
.fb-note { font-size: 0.95rem; }
.fb-answer { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface); }
.fb-answer > div:last-child { display: grid; gap: 6px; justify-items: start; }
.fb-name { font-weight: 800; }
.fb-yours { font-size: 0.88rem; color: var(--ink-2); }
.fb-yours s { color: var(--bad); font-weight: 700; }
.fb .hints li { background: var(--surface); }
.fb .btn--primary { box-shadow: none; }

/* Remediëren */
.remlist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.remlist li { display: flex; align-items: center; gap: 12px; }
.remlist .ph--thumb { width: 60px; }
.remlist-txt { flex: 1; display: grid; line-height: 1.3; }
.remlist-txt small { color: var(--ink-2); }
.streak { display: flex; gap: 4px; }
.streak i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ok); }
.streak i.on { background: var(--ok); }
.lesson { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; justify-items: center; text-align: center; }
.lesson-photos { display: grid; gap: 8px; width: 100%; grid-auto-flow: column; grid-auto-columns: 1fr; }
.lesson-photos .ph, .lesson-photo { width: 100%; max-height: 34dvh; border: 1px solid var(--line); }
.lesson-photos .ph img { max-height: 34dvh; }
.lesson-name { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 1.5rem; }
.lesson .plus { justify-content: center; }
.lesson .hints { width: 100%; text-align: left; }

/* Resultaat & certificaat */
.result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 640px; margin: 0 auto; }
.result-head { display: flex; align-items: center; gap: 18px; }
@media (max-width: 480px) { .result-head { flex-direction: column; text-align: center; } .result .actions .btn { flex: 1 1 100%; } }
.split { list-style: none; padding: 0; margin: 8px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.split li { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.mistakes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mistakes .fb-answer { background: var(--surface-2); }
.cert {
  position: relative; display: grid; gap: 6px; justify-items: center; text-align: center;
  padding: 36px 20px 28px; border-radius: 22px;
  background: radial-gradient(circle at 50% 0%, #fff7e6, #fdebd2 70%);
  color: #3b2a17;
  border: 3px double #b45309; box-shadow: var(--shadow-lg), inset 0 0 0 8px #fff7e6, inset 0 0 0 9px #e9c58f;
}
.cert-seal { font-size: 3.4rem; line-height: 1; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 20%)); }
.cert-kicker { font: 800 0.8rem/1 var(--font); letter-spacing: 0.3em; text-transform: uppercase; color: #b45309; }
.cert-line { color: #6e5d4c; }
.cert-name { font: 800 clamp(1.8rem, 7vw, 2.6rem)/1.1 Georgia, "Times New Roman", serif; font-style: italic; color: #2a1f16; padding: 4px 16px 8px; border-bottom: 2px solid #e9c58f; margin-bottom: 4px; }
.cert-score { font: 800 1.4rem/1 var(--mono); margin-top: 8px; color: #15803d; }
.cert-date { font-size: 0.85rem; color: #9a8774; }

.scopes { display: grid; gap: 12px; }
@media (min-width: 760px) { .scopes { grid-template-columns: repeat(3, 1fr); } }
.scope { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; text-align: left; transition: transform 0.12s ease; }
.scope:active { transform: scale(0.98); }
@media (hover: hover) { .scope:hover { border-color: var(--brand); } }
.scope-emoji { grid-row: span 2; font-size: 2.2rem; }
.scope-txt { display: grid; }
.scope-txt b { font-size: 1.15rem; }
.scope-txt small { color: var(--ink-2); }
.scope-best { grid-column: 2; justify-self: start; font-size: 0.8rem; font-weight: 750; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.scope-best.is-pass { background: var(--ok-soft); color: var(--ok); }
.history { list-style: none; padding: 0; margin: 0; display: grid; }
.history li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.history .muted { font-size: 0.85rem; grid-row: 2; }
.history b { grid-row: span 2; align-self: center; font-variant-numeric: tabular-nums; }
.history .pass { color: var(--ok); }
.history .fail { color: var(--bad); }

/* Voortgang */
.prog-hero { display: flex; align-items: center; gap: 18px; }
.prog-hero > div { display: grid; gap: 8px; }
.prog-name { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 800; }
.legend { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 0.92rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
@media (max-width: 480px) { .prog-hero { flex-direction: column; align-items: stretch; } .prog-hero .ring { align-self: center; } }

/* Toast & confetti */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: var(--shadow-lg);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 760px) { .toast { bottom: 24px; } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }
.noscript { padding: 24px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Printen: enkel het certificaat */
@media print {
  body { background: #fff; padding: 0; }
  .topbar, .nav, .footer, .actions, .card, .toast { display: none !important; }
  .result > :not(.cert) { display: none !important; }
  .cert { box-shadow: none; margin: 40px auto; max-width: 600px; }
}
.level-badge--sm { display: inline-grid; min-width: 34px; height: 24px; border-radius: 8px; font-size: 0.75rem; margin-right: 4px; vertical-align: 1px; }
