/* Layout: ruitjespapier als ondergrond, lesstof links, GR-speler als vaste kolom rechts (op telefoon een onderblad).
   Kleuren uit de GR zelf: Y1-blauw is het accent, Y2-rood voor waarschuwingen, markeergeel voor de toets die je moet indrukken. */
:root {
  --paper: #f2f4f7;
  --grid: rgba(31, 79, 224, .06);
  --surface: #ffffff;
  --surface2: #e9edf3;
  --ink: #161c2b;
  --muted: #59627a;
  --line: #d3d9e3;
  --y1: #1f4fe0;
  --y1-soft: #e3e9fc;
  --y2: #c8262b;
  --y2-soft: #fbe6e6;
  --good: #1b7f45;
  --good-soft: #e1f3e8;
  --marker: #ffd84d;
  --marker-ink: #2b2300;
  --calc: #23262d;
  --calc-key: #34383f;
  --calc-num: #eceef2;
  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10141c; --grid: rgba(120, 150, 255, .05); --surface: #181e2a; --surface2: #212839; --ink: #e9edf5; --muted: #9aa5bd; --line: #2d3548;
    --y1: #7d9bff; --y1-soft: #1d2747; --y2: #ff7a7a; --y2-soft: #3a1d20; --good: #5ccf8a; --good-soft: #15301f;
    --marker: #ffd84d; --marker-ink: #2b2300; --calc: #0b0d11; --calc-key: #2a2e36; --calc-num: #d9dce2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10141c; --grid: rgba(120, 150, 255, .05); --surface: #181e2a; --surface2: #212839; --ink: #e9edf5; --muted: #9aa5bd; --line: #2d3548;
  --y1: #7d9bff; --y1-soft: #1d2747; --y2: #ff7a7a; --y2-soft: #3a1d20; --good: #5ccf8a; --good-soft: #15301f;
  --marker: #ffd84d; --marker-ink: #2b2300; --calc: #0b0d11; --calc-key: #2a2e36; --calc-num: #d9dce2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 80px; }
body {
  margin: 0; font: 17px/1.55 var(--f-body); color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
img { max-width: 100%; height: auto; }
a { color: var(--y1); }
:focus-visible { outline: 3px solid var(--y1); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--surface); padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3, h4 { font-family: var(--f-display); text-wrap: balance; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 800; font-stretch: 85%; letter-spacing: -.01em; }
h3 { font-size: 1.3rem; font-weight: 700; font-stretch: 92%; }
h4 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0; }
sup, sub { line-height: 0; }

/* ---------- kopbalk ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 800 1.05rem/1 var(--f-display); font-stretch: 90%; }
.logo-mark { font: 600 .9rem/1 var(--f-mono); background: var(--calc); color: #fff; padding: 6px 7px; border-radius: 6px; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; min-width: 0; }
.nav a { text-decoration: none; color: var(--muted); padding: 7px 11px; border-radius: 8px; font-weight: 700; font-size: .95rem; }
.nav a:hover { color: var(--ink); background: var(--surface2); }
.nav a[aria-current="page"] { color: var(--y1); background: var(--y1-soft); }
.meta { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); }
.cd { font: 600 .85rem/1 var(--f-mono); background: var(--marker); color: var(--marker-ink); padding: 6px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.prog { width: 80px; height: 7px; border-radius: 9px; background: var(--surface2); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--good); width: 0; transition: width .4s; }

/* ---------- indeling ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; max-width: 1440px; margin: 0 auto; padding-inline: 24px; padding-block: 28px 80px; }
main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
main:focus { outline: none; }
.phead { display: flex; flex-direction: column; gap: 12px; padding-block: 6px 4px; }
.eyebrow { font: 600 .8rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--y1); }
.lede { font-size: 1.1rem; max-width: 66ch; color: var(--muted); }
.goals { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.goals li { font-size: .9rem; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.sh { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; font-stretch: 100%; color: var(--muted); display: flex; align-items: baseline; gap: 12px; margin-top: 10px; }
.sh .count { font: 600 .8rem var(--f-mono); color: var(--good); text-transform: none; letter-spacing: 0; }

.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.block p, .block li { max-width: 72ch; }
.block ul, .block ol { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }
.block.example { border-left: 5px solid var(--y1); }
.tag { font: 600 .74rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--y1); }
.formula { font-family: var(--f-mono); font-weight: 600; font-size: .95em; background: var(--y1-soft); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.tip { border-left: 3px solid var(--y1); padding: 6px 12px; background: var(--y1-soft); border-radius: 0 6px 6px 0; }
.warn { border-left: 3px solid var(--y2); padding: 6px 12px; background: var(--y2-soft); border-radius: 0 6px 6px 0; }
.def { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.def dt { font: 600 1.05rem var(--f-mono); color: var(--y1); }
.def dd { margin: 0; }
.steps.big li { padding-block: 2px; }
.steps em { color: var(--y2); font-style: normal; font-size: .9em; font-weight: 700; }
.calc-work { font-family: var(--f-mono); display: flex; flex-direction: column; gap: 2px; background: var(--surface2); padding: 12px 16px; border-radius: 8px; width: fit-content; max-width: 100%; }
.calc-work .op { color: var(--muted); font-size: .82rem; }
.pct-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pct-grid div { background: var(--surface2); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.pct-grid span { font-family: var(--f-mono); font-weight: 600; }
.pct-grid small { color: var(--muted); }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; }
.flow span { background: var(--surface2); padding: 6px 10px; border-radius: 6px; }
.flow i { font-style: normal; color: var(--y1); font-weight: 700; }
.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.two > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card-lite { background: var(--surface2); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
figure img { border-radius: 6px; border: 1px solid var(--line); background: #fff; }
figcaption { font-size: .85rem; color: var(--muted); }
table.mini { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.mini th, table.mini td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
table.mini th { font-family: var(--f-display); }
.q { display: flex; flex-direction: column; gap: 10px; }
details { border-top: 1px dashed var(--line); padding-top: 10px; }
summary { cursor: pointer; font-weight: 700; color: var(--y1); }
details .a { padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- knoppen ---------- */
.btn { font: 700 .95rem var(--f-body); border: 0; border-radius: 8px; padding: 9px 14px; background: var(--y1); color: #fff; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .4; cursor: default; filter: none; }
.btn.ghost { background: var(--surface2); color: var(--ink); }
.grrow, .qgr { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-gr { display: inline-flex; align-items: center; gap: 8px; font: 700 .9rem var(--f-body); color: var(--ink); background: var(--marker); border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; text-align: left; }
.btn-gr:hover { filter: brightness(1.05); }
.gi { width: 14px; height: 18px; border-radius: 3px; background: var(--calc); flex: none; position: relative; }
.gi::after { content: ""; position: absolute; left: 2px; right: 2px; top: 2px; height: 5px; background: #cfe0c8; border-radius: 1px; }

/* ---------- videospeler ---------- */
.player { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 12px; background: var(--calc); border-radius: var(--r); padding: 12px; }
.screen { aspect-ratio: 16 / 9; max-width: 100%; border-radius: 6px; overflow: hidden; background: #000; }
.screen iframe { width: 100%; height: 100%; border: 0; display: block; }
.poster { all: unset; cursor: pointer; display: block; width: 100%; height: 100%; position: relative; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; }
.playbtn { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: var(--marker); }
.playbtn::after { content: ""; position: absolute; left: 29px; top: 22px; border-left: 22px solid var(--marker-ink); border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.poster:hover .playbtn { transform: scale(1.06); }
.ptitle { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); color: #fff; font: 700 1.1rem var(--f-display); display: flex; flex-direction: column; }
.ptitle small { font: 400 .85rem var(--f-body); opacity: .85; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 330px; overflow-y: auto; }
.plist button { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; padding: 6px; border-radius: 6px; color: #e8eaef; }
.plist button:hover { background: rgba(255, 255, 255, .07); }
.plist button.on { background: rgba(255, 216, 77, .16); box-shadow: inset 3px 0 0 var(--marker); }
.plist button:focus-visible { outline: 2px solid var(--marker); }
.plist img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.plist b { font-size: .88rem; line-height: 1.25; display: block; }
.plist small { font-size: .76rem; color: #a7adba; }
.seen { color: var(--marker); font-style: normal; }

/* ---------- quiz ---------- */
.quiz { display: flex; flex-direction: column; gap: 10px; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.qcard.ok { border-color: var(--good); }
.qq { display: flex; gap: 12px; align-items: baseline; font-weight: 700; }
.qn { font: 600 .8rem var(--f-mono); background: var(--surface2); border-radius: 6px; padding: 3px 7px; flex: none; }
.qcard.ok .qn { background: var(--good); color: #fff; }
.pts { font: 600 .78rem var(--f-mono); color: var(--y2); flex: none; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt { font: 1rem var(--f-body); text-align: left; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.opt:hover { border-color: var(--y1); }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--y2); background: var(--y2-soft); }
.numform { display: flex; gap: 8px; flex-wrap: wrap; }
.numform input { font: 600 1rem var(--f-mono); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); width: 180px; max-width: 100%; }
.fb { padding: 10px 12px; border-radius: 8px; }
.fb.good { background: var(--good-soft); }
.fb.bad { background: var(--y2-soft); }

/* ---------- start ---------- */
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 18ch; }
.countdown { display: flex; gap: 10px; }
.countdown span { background: var(--calc); color: #fff; border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; font-size: .8rem; min-width: 84px; }
.countdown b { font: 600 2rem/1.1 var(--f-mono); color: var(--marker); font-variant-numeric: tabular-nums; }
.topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tcard { text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.tcard:hover { border-color: var(--y1); }
.tcard b { font: 700 1.1rem var(--f-display); }
.tch { font: 600 .78rem var(--f-mono); color: var(--y1); }
.tcard.exam .tch { color: var(--y2); }
.tprog { height: 6px; background: var(--surface2); border-radius: 9px; overflow: hidden; }
.tprog i { display: block; height: 100%; width: 0; background: var(--good); transition: width .4s; }
.tcard small { color: var(--muted); font-size: .82rem; }
.chk { list-style: none; padding-left: 0 !important; }
.chk li { padding-left: 24px; position: relative; }
.chk li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 11px; height: 11px; border: 2px solid var(--y1); border-radius: 3px; }
.rules .chk li::before { border-color: var(--y2); }
.planlist { list-style: none; padding: 0 !important; gap: 0 !important; }
.planlist li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); max-width: none; }
.planlist li:last-child { border-bottom: 0; }
.when { font: 600 .85rem var(--f-mono); color: var(--y1); }

/* ---------- examen ---------- */
.scorebox { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; background: var(--calc); color: #fff; border-radius: var(--r); padding: 14px 18px; width: fit-content; max-width: 100%; }
.scorebox b { font: 600 2.2rem/1 var(--f-mono); color: var(--marker); }
.scorebox .btn { margin-left: 10px; }
.block.exam .ctx { display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
.block.exam .ctx figure { max-width: 620px; }
.eq { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.draft { font: 1rem var(--f-body); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); resize: vertical; width: 100%; }
.selfscore { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 6px; }
.selfscore button { font: 600 .95rem var(--f-mono); width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.selfscore button[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }

/* ---------- GR-lab ---------- */
.lab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 22px; align-items: start; }
.lab-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lab-h { font-size: 1rem; color: var(--muted); margin-top: 6px; }
.lab-list { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-item { font: .9rem var(--f-body); border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 7px 10px; cursor: pointer; text-align: left; }
.lab-item:hover { border-color: var(--y1); }
.lab-steps ol { list-style: none; padding: 0 !important; counter-reset: s; gap: 0 !important; }
.lab-steps li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); max-width: none; }
.lab-steps li::before { content: counter(s); font: 600 .8rem var(--f-mono); background: var(--surface2); border-radius: 6px; text-align: center; padding: 2px 0; height: fit-content; grid-row: span 2; }
.lab-steps li.done { opacity: .55; }
.lab-steps li.now::before { background: var(--marker); color: var(--marker-ink); }
.lab-steps .chips { display: flex; flex-wrap: wrap; gap: 4px; }
#lab-write h4 { margin-top: 8px; }
#lab-write ol { padding-left: 1.3em !important; list-style: decimal; }
.lab-right { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 76px; min-width: 0; }
.emu-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.emu-frame { height: 720px; overflow: hidden; border-radius: var(--r); border: 1px solid var(--line); background: #fff; position: relative; }
.emu-frame iframe { position: absolute; left: 0; top: var(--emu-top, -150px); width: 100%; height: 1500px; border: 0; }
.note-s { font-size: .85rem; color: var(--muted); }
.lab-right .player { grid-template-columns: 1fr; }

/* ---------- spiekbrief ---------- */
.cheat { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cheat section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.cheat section.gr { grid-column: 1 / -1; }
.keyseq { padding-left: 1.3em; margin: 0; display: flex; flex-direction: column; gap: 6px; }

/* ---------- toetschips ---------- */
.chip { display: inline-flex; align-items: baseline; gap: 4px; font: 600 .8rem/1 var(--f-mono); background: var(--calc-key); color: #fff; border-radius: 5px; padding: 5px 7px; margin: 0 3px 3px 0; white-space: nowrap; }
.chip.cn { background: var(--calc-num); color: #111; }
.chip.c2 b { color: #7cc4f5; }
.chip small { font-size: .7rem; color: #7cc4f5; }

/* ---------- widgets ---------- */
.widget { margin-top: 4px; }
.w-omreken { background: var(--surface2); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.w-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.w-row label { font-weight: 700; min-width: 130px; }
.w-row input { font: 600 1rem var(--f-mono); width: 92px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.w-out { display: flex; flex-direction: column; gap: 4px; font-family: var(--f-mono); font-size: .92rem; }
.w-out .gr-line code { background: var(--calc); color: #fff; padding: 2px 6px; border-radius: 4px; }
.w-toename { display: flex; flex-direction: column; gap: 10px; }
.w-toename canvas { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: .88rem var(--f-body); border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 99px; padding: 6px 12px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--y1); border-color: var(--y1); color: #fff; }
.w-cap { font-weight: 700; }

/* ---------- GR-speler (dock) ---------- */
.dock { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; scrollbar-width: thin; }
.dock-head { display: flex; justify-content: space-between; align-items: center; }
.dock-label { font: 600 .78rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--y1); }
.dock-close { display: none; font: 700 .9rem var(--f-body); background: var(--surface2); color: var(--ink); border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
#sc-select { font: .92rem var(--f-body); padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; }
.runner { display: flex; flex-direction: column; gap: 8px; }
.sc-title { font: 700 1.02rem var(--f-display); }
.sc-progress { height: 5px; background: var(--surface2); border-radius: 9px; overflow: hidden; }
.sc-progress i { display: block; height: 100%; background: var(--marker); width: 0; transition: width .3s; }
.sc-count { font: 600 .78rem var(--f-mono); color: var(--muted); }
.sc-text { min-height: 3em; }
.sc-keys { min-height: 26px; }
.sc-warn { color: var(--y2); font-size: .88rem; font-weight: 700; }
.sc-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 6px; }
.sc-write { background: var(--good-soft); border-radius: 8px; padding: 10px 12px; font-size: .92rem; }
.sc-write ol { margin: 6px 0 0; padding-left: 1.2em; }
.dock-fab { display: none; }

/* ---------- de rekenmachine ---------- */
.gr-host { container-type: inline-size; }
.calc { background: linear-gradient(180deg, #2b2f37, var(--calc) 30%); border-radius: 22px 22px 34px 34px; padding: 14px 14px 22px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 2px 0 #0006, inset 0 1px 0 #ffffff1a; position: relative; user-select: none; -webkit-user-select: none; }
.brand { display: flex; justify-content: space-between; align-items: baseline; color: #d7dae0; font: 600 .78rem var(--f-body); padding: 0 4px; }
.brand b { font-family: var(--f-display); font-stretch: 85%; letter-spacing: .02em; }
.brand span { color: #f4c84a; font-style: italic; }
.lcd-wrap { background: #0d0f13; border-radius: 10px; padding: 9px; }
.lcd { aspect-ratio: 4 / 3; max-width: 100%; background: #fff; border-radius: 3px; overflow: hidden; display: flex; flex-direction: column; color: #000; position: relative; }
.status { flex: none; display: flex; justify-content: space-between; align-items: center; background: #d9dce1; color: #3c4048; font: 600 2.4cqw/1 var(--f-mono); padding: 1.1cqw 1.6cqw; }
.status .ind { min-width: 4ch; text-align: right; }
.status .ind.on2 { background: #4aa3df; color: #fff; padding: 1px 4px; border-radius: 3px; }
.status .ind.ona { background: #6cc06c; color: #fff; padding: 1px 4px; border-radius: 3px; }
.scr { flex: 1; min-height: 0; overflow-y: auto; font: 500 4.1cqw/1.28 var(--f-mono); padding: 1.2cqw 1.8cqw; scrollbar-width: none; }
.scr::-webkit-scrollbar { display: none; }
#gr-cv { flex: 1; min-height: 0; width: 100%; height: 100%; display: block; }
.cur { display: inline-block; width: .62em; background: #000; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.home { display: flex; flex-direction: column; }
.hin { word-break: break-all; }
.hout { text-align: right; }
.hdr { display: flex; gap: 3cqw; margin-bottom: .6cqw; }
.hdr span, .inv { background: #000; color: #fff; padding: 0 .6cqw; }
.hdr span { background: transparent; color: #000; }
.hdr .inv { background: #000; color: #fff; }
.yrow { display: flex; align-items: baseline; gap: 1cqw; word-break: break-all; }
.yrow .sw { width: 2.2cqw; height: 2.2cqw; flex: none; border-radius: 1px; align-self: center; }
.yn { flex: none; }
.yn.on { background: #000; color: #fff; }
.yrow.sel { background: #eef2ff; }
.title { font-weight: 600; }
.frow-s.sel { background: #eef2ff; }
.mi { display: flex; gap: .4cqw; }
.mi.sel { background: #eef2ff; }
.mn.inv { background: #000; color: #fff; }
.modes { display: flex; flex-direction: column; gap: .4cqw; }
.note { font: 400 3.1cqw/1.3 var(--f-body); color: #444; margin-top: 1.4cqw; }
.err { display: flex; flex-direction: column; gap: .8cqw; }
.tbl { display: grid; grid-template-columns: repeat(var(--cols), 1fr); border-left: 1px solid #999; border-top: 1px solid #999; font-size: 3.7cqw; }
.th, .td { border-right: 1px solid #999; border-bottom: 1px solid #999; padding: 0 .8cqw; text-align: right; white-space: nowrap; overflow: hidden; }
.th { text-align: center; background: #eef0f3; font-weight: 600; }
.td.sel { background: #000; color: #fff; }
.tfoot { margin-top: .8cqw; }
.toast { position: absolute; left: 22px; right: 22px; top: 44%; background: #ffd84d; color: #2b2300; font: 700 .85rem/1.35 var(--f-body); padding: 10px 12px; border-radius: 8px; z-index: 5; box-shadow: 0 6px 18px #0006; }

.frow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding-top: 2px; }
.frow .key { height: 7.5cqw; border-radius: 4px 4px 9px 9px; font-size: 3.2cqw; background: #e7e9ee; color: #111; }
.mid { display: grid; grid-template-columns: 3fr 2fr; gap: 6px; align-items: center; }
.mid-left { display: flex; flex-direction: column; gap: 4px; }
.r3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 6px; }
.kc { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.klab { display: flex; justify-content: space-between; font: 600 2.3cqw/1 var(--f-mono); height: 2.9cqw; padding: 0 1px; white-space: nowrap; overflow: hidden; }
.l2 { color: #7cc4f5; }
.la { color: #8fd48f; }
.key { font: 600 3.3cqw/1 var(--f-body); height: 8.4cqw; border: 0; border-radius: 6px; background: var(--calc-key); color: #fff; cursor: pointer; box-shadow: 0 2px 0 #000a, inset 0 1px 0 #ffffff1f; padding: 0; transition: transform .06s, background .12s; }
.key:active, .key.hit { transform: translateY(2px); box-shadow: 0 0 0 #000; background: var(--marker) !important; color: var(--marker-ink) !important; }
.key.k-num { background: var(--calc-num); color: #111; font-size: 4.1cqw; }
.key.k-op { background: #c9ccd3; color: #111; font-size: 4.1cqw; }
.key.k-2nd { background: #4aa3df; color: #fff; }
.key.k-2nd.armed { box-shadow: 0 0 0 3px #fff; }
.key.k-alpha { background: #6cc06c; color: #fff; }
.key.next { outline: 3px solid var(--marker); outline-offset: 2px; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { outline-color: transparent; } }
.pad { display: grid; grid-template-areas: ". up ." "left . right" ". down ."; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; width: 25cqw; height: 22cqw; justify-self: center; background: #1a1c21; border-radius: 50%; padding: 1.5cqw; }
.arrow { border: 0; background: #3b3f47; color: #fff; font-size: 2.6cqw; cursor: pointer; border-radius: 6px; padding: 0; }
.arrow.up { grid-area: up; } .arrow.down { grid-area: down; } .arrow.left { grid-area: left; } .arrow.right { grid-area: right; }
.arrow.hit { background: var(--marker); color: var(--marker-ink); }
.arrow.next { outline: 3px solid var(--marker); animation: pulse 1.1s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .key.next, .arrow.next, .cur { animation: none; }
  .prog i, .tprog i, .sc-progress i { transition: none; }
}

/* ---------- smaller ---------- */
@media (max-width: 1180px) {
  .lab { grid-template-columns: 1fr; }
  .lab-right { position: static; }
}
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-inline: 16px; }
  .dock { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; max-height: 88vh; border-radius: 16px 16px 0 0; transform: translateY(105%); transition: transform .25s; box-shadow: 0 -10px 40px #0005; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  body.dock-open .dock { transform: none; }
  .dock-close { display: inline-block; }
  .gr-host { max-width: 400px; width: 100%; margin: 0 auto; }
  .dock-fab { display: inline-flex; align-items: center; gap: 8px; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 35; font: 800 1rem var(--f-display); background: var(--marker); color: var(--marker-ink); border: 0; border-radius: 99px; padding: 12px 18px; box-shadow: 0 6px 20px #0004; cursor: pointer; }
  body.dock-open .dock-fab { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .top { padding: 8px 16px; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
  .meta .prog, .meta .prog-txt { display: none; }
  .player { grid-template-columns: 1fr; }
  .plist { max-height: 240px; }
  .two, .two-cols, .pct-grid, .opts { grid-template-columns: 1fr; }
  .block { padding: 16px; }
  .planlist li { grid-template-columns: 1fr; gap: 2px; }
  .countdown span { min-width: 0; flex: 1; }
  .emu-frame { height: 640px; }
}

/* ---------- controleer je echte GR (USB) ---------- */
.usb-panel { display: flex; flex-direction: column; gap: 8px; border: 2px dashed var(--line); border-radius: var(--r); padding: 12px 14px; }
.usb-note { font-size: .88rem; color: var(--muted); }
.usb-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.usb-status { font-weight: 700; font-size: .92rem; min-height: 1.2em; }
.usb-res { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.usb-res li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; font-size: .9rem; padding: 8px 10px; border-radius: 8px; background: var(--surface2); }
.usb-res .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: .3em; background: var(--muted); }
.usb-res .is-ok { background: var(--good-soft); } .usb-res .is-ok .dot { background: var(--good); }
.usb-res .is-warn .dot { background: var(--marker); box-shadow: 0 0 0 2px var(--marker-ink) inset; }
.usb-res .is-bad { background: var(--y2-soft); } .usb-res .is-bad .dot { background: var(--y2); }
.usb-shot canvas { width: 100%; max-width: 320px; aspect-ratio: 4 / 3; image-rendering: pixelated; border-radius: 4px; border: 6px solid var(--calc); background: #fff; }
.usb-log pre { white-space: pre-wrap; word-break: break-all; font: .72rem/1.4 var(--f-mono); max-height: 220px; overflow: auto; background: var(--surface2); padding: 8px; border-radius: 6px; }
.usb-live { display: flex; flex-direction: column; gap: 8px; }
.usb-sw { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; align-items: center; cursor: pointer; padding: 8px 10px; border-radius: 8px; background: var(--surface2); }
.usb-sw input { width: 20px; height: 20px; accent-color: var(--y1); grid-row: span 2; margin: 0; }
.usb-sw span { font-weight: 700; font-size: .92rem; }
.usb-sw small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.usb-sw:has(input:checked) { background: var(--y1-soft); }
.mp-note { display: block; margin-top: 4px; font-size: .82rem; color: var(--muted); }
body.gr-forward .calc { box-shadow: 0 0 0 3px var(--marker), 0 2px 0 #0006; }
.usb-sw.usb-sub { margin-left: 22px; }
.usb-group { font: 600 .74rem var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.btn-done { grid-column: 1 / -1; background: var(--good); }
.btn-done kbd { font: 600 .72rem var(--f-mono); background: rgba(255,255,255,.22); border-radius: 4px; padding: 1px 5px; margin-left: 6px; }
body.gr-follow .calc { box-shadow: 0 0 0 3px var(--good), 0 2px 0 #0006; }
#usb-live-slot .usb-shot { margin: 4px 0; }
#usb-live-slot .usb-shot canvas { max-width: 100%; width: 100%; }
#usb-live-slot figcaption { font-size: .78rem; color: var(--muted); }
