/* Layout: app chrome in Meneer's electric-blue/dark-grey brand around a physical-looking whiteboard that stays white in both themes */
:root {
  --bg: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f5f7fc;
  --ink: #1a2130;
  --muted: #586378;
  --line: #d9e0ec;
  --accent: #1257ff;
  --accent-ink: #ffffff;
  --accent-soft: #e3ebff;
  --go: #19e07a;
  --go-ink: #0a7340;
  --go-soft: #dcf9ea;
  --bad: #c8233a;
  --bad-soft: #fde6e9;
  --warn-soft: #fff1e0;
  --warn-ink: #a14a00;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 8px 24px rgba(20, 30, 60, .07);

  /* The whiteboard is an object in the room: same colours in both themes */
  --board: #fdfdfb;
  --board-grid: rgba(18, 87, 255, .07);
  --board-frame: #c9ced8;
  --m-black: #1e2533;
  --m-blue: #1550e8;
  --m-red: #d7263d;
  --m-green: #11864a;
  --m-hl: rgba(25, 224, 122, .35);

  --f-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --f-body: "Poppins", "Segoe UI", system-ui, sans-serif;
  --f-marker: "Kalam", "Comic Sans MS", "Segoe Print", cursive;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d121b; --surface: #151c28; --surface-2: #1b2433; --ink: #e8edf6; --muted: #9ba7ba;
    --line: #283246; --accent: #5288ff; --accent-ink: #ffffff; --accent-soft: #1b2a4d;
    --go: #2bf08a; --go-ink: #4be39b; --go-soft: #133826; --bad: #ff6b7f; --bad-soft: #3a1820; --warn-soft: #3a2a14; --warn-ink: #ffc27a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --board-frame: #3a4558;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d121b; --surface: #151c28; --surface-2: #1b2433; --ink: #e8edf6; --muted: #9ba7ba;
  --line: #283246; --accent: #5288ff; --accent-ink: #ffffff; --accent-soft: #1b2a4d;
  --go: #2bf08a; --go-ink: #4be39b; --go-soft: #133826; --bad: #ff6b7f; --bad-soft: #3a1820; --warn-soft: #3a2a14; --warn-ink: #ffc27a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --board-frame: #3a4558;
  color-scheme: dark;
}

html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55;
  margin: 0;
}
* { box-sizing: border-box; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -.01em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 10px 16px; font-weight: 500; min-height: 44px;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.icon-btn { width: 44px; padding: 0; }

.eyebrow { font-family: var(--f-display); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* ---------- Brand mark ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 800; font-size: 20px; letter-spacing: .02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--go); border: 2px solid var(--bg); }
.brand-mark svg { width: 20px; height: 20px; }

/* ---------- Enrol + home ---------- */
.page { max-width: 1040px; margin: 0 auto; padding-inline: 20px; padding-block: 24px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }

.enrol { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
.enrol-pitch h1 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.08; margin-block: 10px 14px; }
.enrol-pitch h1 em { font-style: normal; color: var(--accent); }
.enrol-pitch p { color: var(--muted); max-width: 46ch; margin: 0 0 18px; }
.pitch-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pitch-list li { display: flex; gap: 10px; align-items: flex-start; }
.pitch-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--go); margin-top: 9px; flex: none; box-shadow: 0 0 0 3px var(--go-soft); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field > label, .field > .label { font-weight: 600; font-size: 14px; }
.field input[type="text"] { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 11px 14px; font: inherit; color: var(--ink); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { flex: 1 1 90px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: center; cursor: pointer; background: var(--surface-2); font-weight: 500; }
.seg input:checked + label { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.hint { color: var(--muted); font-size: 13px; }
.form-error { color: var(--bad); font-size: 13.5px; }

.home-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.home-head h1 { font-size: clamp(24px, 3.4vw, 34px); }
.home-head p { color: var(--muted); margin: 6px 0 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 500; min-height: 36px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.subject { margin-bottom: 30px; }
.subject h2 { font-size: 18px; margin-bottom: 12px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.subject h2 small { font-family: var(--f-body); font-weight: 400; color: var(--muted); font-size: 13.5px; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.topic { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.topic h3 { font-size: 15px; font-weight: 700; }
.topic .meta { font-size: 12.5px; color: var(--muted); }
.topic.soon { background: transparent; border-style: dashed; }
.topic.soon h3 { color: var(--muted); font-weight: 600; }
.topic.ready { border-color: var(--accent); box-shadow: var(--shadow); grid-column: span 2; padding: 18px 20px; gap: 10px; }
.topic.ready h3 { font-size: 18px; }
.badge { justify-self: start; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-radius: 6px; padding: 3px 8px; }
.badge.live { background: var(--go-soft); color: var(--go-ink); }
.badge.soon { background: var(--surface-2); color: var(--muted); }
.mini-meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.mini-meter i { display: block; height: 100%; background: var(--go); border-radius: 99px; }
.topic .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Lesson screen ---------- */
#screen-lesson { height: 100%; display: flex; flex-direction: column; }
.l-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.l-head .title { min-width: 0; flex: 1; }
.l-head h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caps-tag { font-size: 12px; color: var(--muted); }
.caps-tag b { color: var(--accent); font-weight: 600; }

.l-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.board-wrap { padding: 14px; min-height: 0; display: flex; }
.board {
  flex: 1; min-width: 0; background-color: var(--board);
  background-image: linear-gradient(var(--board-grid) 1px, transparent 1px), linear-gradient(90deg, var(--board-grid) 1px, transparent 1px);
  background-size: 28px 28px; border: 8px solid var(--board-frame); border-radius: 12px;
  box-shadow: inset 0 0 40px rgba(0,0,0,.035), var(--shadow);
  overflow-y: auto; padding: 22px 26px 60px; color: var(--m-black); position: relative; scroll-behavior: smooth;
}
.board-empty { color: #8a93a3; font-family: var(--f-marker); font-size: 22px; text-align: center; margin-top: 18%; }

.b-item { margin: 0 0 12px; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.b-h { font-family: var(--f-marker); font-weight: 700; font-size: 28px; color: var(--m-blue); line-height: 1.2; margin-top: 10px; border-bottom: 2px solid rgba(21, 80, 232, .25); padding-bottom: 4px; }
.b-line { font-family: var(--f-marker); font-size: 21px; line-height: 1.5; }
.b-line.lg { font-size: 25px; }
.b-line.sm { font-size: 17px; }
.c-blue { color: var(--m-blue); } .c-red { color: var(--m-red); } .c-green { color: var(--m-green); } .c-black { color: var(--m-black); }
.c-purple { color: #7b2cbf; } .c-orange { color: #d9480f; } .c-teal { color: #0b7285; }
.b-line.indent { padding-left: 1.6em; }
/* vertical working: = signs line up in one column */
.b-eq { display: grid; grid-template-columns: minmax(0, 40%) 2.2em max-content minmax(70px, 1fr); align-items: center; column-gap: 2px; }
.b-eq .eq-l { text-align: right; justify-self: end; }
.b-eq .eq-r { text-align: center; }
.b-eq .eq-c { justify-self: start; }
.b-eq .eq-n, .eq-n.inline { font-family: var(--f-body); font-size: 13px; color: #0b7285; padding-left: 12px; white-space: nowrap; }
.b-eq .eq-n { white-space: normal; text-align: right; min-width: 0; line-height: 1.25; }
.eq-n.inline { display: inline-block; }
.b-dist .dist { position: relative; display: inline-block; padding-top: 18px; white-space: nowrap; }
.b-dist .d-t + .d-t { margin-left: .2em; }
.b-dist .d-txt { margin: 0 .15em; }
.b-dist svg.d-arrows { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.d-arrow { fill: none; stroke: #d7263d; stroke-width: 1.8; }
.d-arrow.anim { stroke-dasharray: 160; stroke-dashoffset: 160; animation: drawArrow .6s ease-out forwards; }
@keyframes drawArrow { to { stroke-dashoffset: 0; } }
.b-reason { font-family: var(--f-marker); font-size: 17px; line-height: 1.35; padding-left: 1.6em; margin-top: -6px; opacity: .92; }
.b-reason::before { content: "↳ "; }
.w { white-space: nowrap; display: inline-block; }
.ch { display: inline-block; }
.board svg path, .board svg line { stroke-linecap: round; stroke-linejoin: round; }
.pen { position: absolute; left: 0; top: 0; width: 54px; height: 54px; pointer-events: none; z-index: 3; opacity: 0; transition: opacity .25s; color: var(--m-black); filter: drop-shadow(2px 4px 3px rgba(0,0,0,.18)); will-change: transform; }
.pen.on { opacity: 1; }
.b-line mjx-container { margin: 0 .1em !important; }
.b-line mjx-container[display="true"] { margin: .3em 0 !important; text-align: left !important; }
.b-note { font-family: var(--f-marker); font-size: 19px; background: #fff6b8; color: #3d3510; padding: 10px 14px; border-radius: 4px; transform: rotate(-.6deg); box-shadow: 2px 3px 0 rgba(0,0,0,.08); display: inline-block; max-width: 640px; }
.b-def { font-family: var(--f-body); font-size: 15.5px; border-left: 4px solid var(--m-green); padding: 6px 0 6px 14px; max-width: 68ch; color: var(--m-black); }
.b-def b { color: var(--m-green); }
.b-table { border-collapse: collapse; font-family: var(--f-marker); font-size: 19px; }
.b-table th, .b-table td { border: 2px solid rgba(30, 37, 51, .35); padding: 6px 14px; text-align: center; }
.b-table th { color: var(--m-blue); }
/* The laws of exponents card table: numbered laws, name, formula | example */
.b-table.laws { font-family: var(--f-body); font-size: 16px; border: 2px solid rgba(30, 37, 51, .25); }
.b-table.laws td { border: none; border-bottom: 1.5px solid rgba(30, 37, 51, .18); text-align: left; padding: 8px 12px; vertical-align: middle; }
.b-table.laws td:first-child { padding-right: 4px; }
.b-table.laws td:last-child { border-left: 2px solid rgba(30, 37, 51, .35); font-size: 15px; }
.law-n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #10204a; color: #fff; font-weight: 700; font-size: 14px; }
.law-name { display: block; font-weight: 700; color: #10204a; margin-bottom: 2px; }
.law-ex { display: block; font-weight: 700; font-size: 13px; color: var(--m-blue); margin-bottom: 2px; }
.b-def .law-n { width: 20px; height: 20px; font-size: 12px; margin-right: 4px; vertical-align: -3px; }
.marked { background: linear-gradient(transparent 12%, var(--m-hl) 12%, var(--m-hl) 88%, transparent 88%); border-radius: 6px; display: inline-block; padding: 0 6px; animation: hl .6s ease-out both; }
@keyframes hl { from { background-size: 0 100%; background-repeat: no-repeat; } to { background-size: 100% 100%; } }
.ink { animation: write var(--d, .9s) linear both; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 -2% 0 0); } }
.fade { animation: fadeIn .5s ease-out both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.sim { border: 2px solid rgba(30, 37, 51, .18); border-radius: 10px; background: #fff; padding: 10px; max-width: 720px; font-family: var(--f-body); color: var(--m-black); }
.sim canvas { display: block; width: 100%; }
.sim-controls { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 8px; font-size: 13.5px; }
.sim-controls label { display: flex; gap: 8px; align-items: center; flex: 1 1 180px; min-width: 0; }
.sim-controls input[type="range"] { flex: 1; min-width: 80px; accent-color: #1257ff; }
.sim-controls output { font-variant-numeric: tabular-nums; min-width: 4.5em; font-weight: 600; }
.sim-btn { border: 1px solid #c9d2e3; background: #f4f7fd; color: #1e2533; border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; min-height: 34px; }
.sim-btn[aria-pressed="true"] { background: #1257ff; border-color: #1257ff; color: #fff; }
.sim-readout { font-size: 14px; margin-top: 6px; font-variant-numeric: tabular-nums; background: #f4f7fd; border-radius: 8px; padding: 8px 12px; color: #1e2533; }
.sim-readout b { color: #1550e8; }

/* side panel */
.side { border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.side-scroll { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
.tutor { display: flex; gap: 12px; align-items: flex-start; }
.avatar { width: 46px; height: 46px; border-radius: 14px; background: var(--accent); display: grid; place-items: center; flex: none; position: relative; }
.avatar .bars { display: flex; gap: 3px; align-items: center; height: 20px; }
.avatar .bars i { width: 4px; height: 6px; background: #fff; border-radius: 2px; transition: height .15s; }
.speaking .avatar .bars i { animation: talk .9s ease-in-out infinite; }
.speaking .avatar .bars i:nth-child(2) { animation-delay: .15s; } .speaking .avatar .bars i:nth-child(3) { animation-delay: .3s; } .speaking .avatar .bars i:nth-child(4) { animation-delay: .45s; }
@keyframes talk { 0%, 100% { height: 6px; } 50% { height: 18px; } }
.avatar::after { content: ""; position: absolute; right: -3px; top: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--go); border: 2px solid var(--surface); }
.caption { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 10px 14px; font-size: 14.5px; min-height: 64px; flex: 1; min-width: 0; }
.caption .who { font-family: var(--f-display); font-weight: 700; font-size: 12px; color: var(--accent); display: block; margin-bottom: 2px; letter-spacing: .04em; }

.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.controls .grow { flex: 1; }
.confused { width: 100%; border-color: var(--go-ink); color: var(--go-ink); background: var(--go-soft); }
.speed { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.speed select { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: var(--surface); color: var(--ink); }

.mastery { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.mastery .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mastery strong { font-family: var(--f-display); font-size: 13px; }
.mastery .val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--go-ink); }
.meter { height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), var(--go)); border-radius: 99px; transition: width .6s ease; }
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; font-size: 11px; color: var(--muted); }
.levels span { text-align: center; padding: 3px 2px; border-radius: 6px; line-height: 1.25; }
.levels span.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.qpanel { border: 2px solid var(--accent); border-radius: 14px; padding: 14px; display: grid; gap: 10px; background: var(--surface); }
.qpanel .q-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.q-level { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--accent-soft); color: var(--accent); padding: 3px 8px; border-radius: 6px; }
.q-prompt { font-size: 15px; font-weight: 500; overflow-x: auto; }
.q-opts { display: grid; gap: 8px; }
.q-opt { text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 9px 12px; min-height: 44px; display: flex; gap: 10px; align-items: center; overflow-x: auto; }
.q-opt .k { font-family: var(--f-display); font-weight: 700; color: var(--muted); width: 1.2em; flex: none; }
.q-opt:hover:not(:disabled) { border-color: var(--accent); }
.q-opt.right { border-color: var(--go-ink); background: var(--go-soft); }
.q-opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.q-opt:disabled { cursor: default; }
.q-feedback { font-size: 14px; border-radius: 10px; padding: 10px 12px; }
.q-feedback.good { background: var(--go-soft); color: var(--ink); }
.q-feedback.bad { background: var(--bad-soft); color: var(--ink); }
.q-feedback b { font-family: var(--f-display); }

.done { border: 1px solid var(--go-ink); background: var(--go-soft); border-radius: 14px; padding: 16px; display: grid; gap: 10px; }
.done h2 { font-size: 18px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stat-row div { background: var(--surface); border-radius: 10px; padding: 8px 4px; font-size: 12px; color: var(--muted); }
.stat-row b { display: block; font-size: 20px; color: var(--ink); font-family: var(--f-display); font-variant-numeric: tabular-nums; }

.start-cover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(253, 253, 251, .86); z-index: 2; padding: 20px; text-align: center; }
.start-cover .inner { display: grid; gap: 12px; justify-items: center; max-width: 420px; }
.start-cover h2 { font-family: var(--f-marker); color: var(--m-blue); font-size: 30px; }
.start-cover p { color: #4b5466; margin: 0; }
.board-shell { position: relative; flex: 1; display: flex; min-width: 0; }

.foot-note { font-size: 12px; color: var(--muted); padding: 0 16px 12px; }


/* ---------- Resource bank ---------- */
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.field select, .res-filters select, .res-filters input { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font: inherit; color: var(--ink); min-height: 44px; min-width: 0; }
.field input[type="text"], .field select { width: 100%; }
.field input[type="file"] { font: inherit; font-size: 13.5px; color: var(--muted); max-width: 100%; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.field-row .field { margin-bottom: 20px; }
.form-ok { color: var(--go-ink); font-size: 13.5px; font-weight: 600; }
.res-intro { max-width: 70ch; }
.res-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
.res-form h2 { font-size: 17px; margin-bottom: 16px; }
.res-filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.res-list { display: grid; gap: 10px; }
.res-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.res-main { display: grid; gap: 2px; min-width: 0; }
.res-main b { font-weight: 600; overflow-wrap: anywhere; }
.res-main .meta { font-size: 12.5px; color: var(--muted); }
.res-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.res-actions .btn { min-height: 38px; padding: 6px 12px; font-size: 13.5px; }
.res-del { color: var(--bad); }
.read-ok { font-size: 12px; color: var(--go-ink); font-weight: 600; }
.read-no { font-size: 12px; color: var(--muted); }
.confirm-text { font-size: 13px; font-weight: 600; color: var(--bad); }
.res-type { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; border-radius: 6px; padding: 4px 8px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.res-type.t-video { background: var(--accent-soft); color: var(--accent); }
.res-type.t-paper { background: var(--go-soft); color: var(--go-ink); }
.res-type.t-memo { background: var(--bad-soft); color: var(--bad); }
.res-empty { border: 1px dashed var(--line); border-radius: 12px; padding: 24px; display: grid; gap: 6px; color: var(--muted); }
.res-empty b { color: var(--ink); }
.topic-res { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.topic-res strong { font-family: var(--f-display); font-size: 13px; }
.topic-res .res-item { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 10px; }
.topic-res .res-type { display: none; }

.viewer { position: fixed; inset: 0; background: rgba(10, 14, 22, .6); z-index: 50; display: grid; place-items: center; padding: 16px; }
.viewer-box { background: var(--surface); border-radius: 16px; width: min(960px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.viewer-head { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.viewer-head h2 { flex: 1; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-head a[hidden] { display: none; }
.viewer-body { padding: 14px; overflow: auto; display: grid; gap: 8px; }
.viewer-body video, .viewer-body img { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; object-fit: contain; }
.viewer-body iframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.viewer-text { white-space: pre-wrap; font-size: 13.5px; max-height: 70vh; overflow: auto; margin: 0; }
.viewer-link { display: grid; gap: 12px; justify-items: start; padding: 12px 0; }

/* ---------- Achievement rating ---------- */
.rating { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.rating .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rating strong { font-family: var(--f-display); font-size: 13px; }
.rating.flash { animation: flash 1s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--accent-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }
.level-badge { display: flex; align-items: baseline; gap: 10px; border-radius: 10px; padding: 8px 12px; flex-wrap: wrap; }
.level-badge b { font-family: var(--f-display); font-size: 20px; font-weight: 800; }
.level-badge span { font-size: 13.5px; font-weight: 600; }
.level-badge.l7, .level-badge.l6, .level-badge.l5 { background: var(--go-soft); color: var(--go-ink); }
.level-badge.l4, .level-badge.l3 { background: var(--warn-soft); color: var(--warn-ink); }
.level-badge.l2, .level-badge.l1 { background: var(--bad-soft); color: var(--bad); }
.scale { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.scale i { font-style: normal; text-align: center; font-size: 11px; font-weight: 700; padding: 3px 0; border-radius: 5px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.scale i.on.l7, .scale i.on.l6, .scale i.on.l5 { background: var(--go); color: #06301b; }
.scale i.on.l4, .scale i.on.l3 { background: #ffb15c; color: #3d1d00; }
.scale i.on.l2, .scale i.on.l1 { background: var(--bad); color: #fff; }
.q-rate { display: inline-block; margin-top: 4px; font-weight: 600; font-size: 12.5px; }


/* ---------- Ask Meneer ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ask { border: 2px solid var(--accent); border-radius: 14px; padding: 12px; display: grid; gap: 10px; background: var(--surface); }
.ask-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ask-head strong { font-family: var(--f-display); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }

.ask-status { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.ask-status.on { background: var(--go-soft); color: var(--go-ink); }
.ask-status:empty { display: none; }
.ask-log { display: grid; gap: 8px; max-height: 260px; overflow-y: auto; }
.ask-log:empty { display: none; }
.bubble { border-radius: 12px; padding: 8px 12px; font-size: 14px; line-height: 1.45; max-width: 92%; overflow-wrap: anywhere; }
.bubble.you { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bubble.mineer { justify-self: start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.error { border-color: var(--bad); background: var(--bad-soft); }
.bubble .check { display: block; margin-top: 6px; font-weight: 600; }
.bubble .mk { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); overflow-x: auto; }
.bubble .srcs { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.src { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; font-size: 12px; cursor: pointer; text-align: left; }
.dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.ask-form { display: grid; gap: 8px; }
.ask-form textarea { width: 100%; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 10px; padding: 9px 12px; font: inherit; resize: vertical; min-height: 48px; }
.ask-form textarea:disabled { opacity: .6; }
.ask-row { display: flex; gap: 8px; align-items: center; }
.ask-row .grow { flex: 1; }
#ask-mic.listening { background: var(--bad); color: #fff; border-color: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--bad-soft); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
#ask-hint { margin: 0; font-size: 12.5px; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.ai-box { width: min(520px, 100%); }
.ai-box .viewer-body p { margin: 0 0 4px; }
.ai-box .field input, .ai-box .field select { width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font: inherit; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .dots i, #ask-mic.listening { animation: none; } }


/* ---------- Raise hand + scan ---------- */
.ask-head { flex-wrap: wrap; }
.ask-head strong { margin-right: auto; }
.hand-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 6px 12px 6px 8px; font-weight: 600; font-size: 13px; min-height: 36px; cursor: pointer; transition: background .15s, transform .15s, box-shadow .15s; }
.hand-btn svg { width: 20px; height: 20px; color: inherit; transition: transform .2s; }
.hand-btn:hover { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px rgba(18, 87, 255, .25); transform: translateY(-1px); }
.hand-btn:hover svg { transform: rotate(-12deg); }
.hand-btn:active { transform: translateY(0); }
.hand-btn.raised { background: var(--go); border-color: var(--go); color: #06301b; }
.hand-btn.raised svg { animation: wave 1s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wave { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(12deg); } }
#ask-scan:disabled, #ask-send:disabled { cursor: not-allowed; }
.scan-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 1px dashed var(--accent); background: transparent; color: var(--accent); border-radius: 10px; padding: 9px 12px; font-weight: 600; font-size: 13.5px; min-height: 42px; cursor: pointer; }
.scan-btn:hover { background: var(--accent-soft); border-style: solid; }
.scan-btn svg { width: 18px; height: 18px; }
.scan-box { width: min(560px, 100%); }
.scan-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.scan-mode { border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: 8px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.scan-mode.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.scan-chose { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--bad-soft, #fff0f0); font-size: 14px; }
.find-mistake { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.find-mistake:hover { background: var(--accent-soft); }
.typed-work { font-family: ui-monospace, monospace; white-space: pre-wrap; margin: 6px 0 0; font-size: 13px; }
.scan-for { margin: 0; overflow-x: auto; }
.scan-tips { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--muted); display: grid; gap: 2px; }
.scan-box textarea { width: 100%; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 10px; padding: 9px 12px; font: inherit; }
.scan-drop { display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 14px; min-height: 160px; padding: 12px; cursor: pointer; background: var(--surface-2); position: relative; }
.scan-drop:hover { border-color: var(--accent); }
.scan-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.scan-drop img { max-height: 320px; max-width: 100%; border-radius: 8px; }
#scan-drop-text { display: grid; justify-items: center; gap: 4px; text-align: center; }
#scan-drop-text svg { width: 36px; height: 36px; color: var(--accent); }
.scan-drop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.b-photo { position: relative; display: inline-block; max-width: min(560px, 100%); border-radius: 6px; box-shadow: 2px 4px 10px rgba(0,0,0,.12); transform: rotate(-.5deg); background: #fff; padding: 6px; }
.b-photo img { display: block; max-width: 100%; max-height: 680px; border-radius: 3px; }
.b-photo canvas { position: absolute; left: 6px; top: 6px; pointer-events: none; }
.bubble img.thumb { display: block; max-width: 140px; max-height: 110px; border-radius: 6px; margin-bottom: 6px; }
@media (prefers-reduced-motion: reduce) { .hand-btn.raised svg { animation: none; } }


/* ---------- Grade 10 books: contents page ---------- */
.book h2 { margin-bottom: 14px; }
.exam-card { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: 1px solid var(--accent); background: linear-gradient(100deg, var(--accent-soft), var(--surface) 70%); border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; min-height: 64px; }
.exam-card:hover { box-shadow: var(--shadow); }
.exam-card b { display: block; font-family: var(--f-display); font-size: 16px; }
.exam-card small { color: var(--muted); font-size: 13px; }
.exam-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 20px; flex: none; }
.exam-card .go { margin-left: auto; font-size: 26px; color: var(--accent); }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.chap { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 4px 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; min-height: 64px; }
.chap:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.chap-num { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; color: var(--accent); }
.chap-txt b { display: block; font-family: var(--f-display); font-size: 14.5px; line-height: 1.25; }
.chap-txt small { color: var(--muted); font-size: 12px; }
.chap-prog { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.chap-prog i { display: block; height: 100%; background: var(--go); }
.chapters li.soon .chap { background: transparent; border-style: dashed; cursor: default; box-shadow: none; }
.chapters li.soon .chap-num { color: var(--muted); }
.chapters li.soon .chap-txt b { color: var(--muted); font-weight: 600; }
.chap-legacy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 4px 2px 12px; }
.refresh-link .rf-play { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; margin-right: 4px; vertical-align: middle; }
.refresh-link.rf-locked { opacity: .75; }
.refresh-link.rf-locked .rf-play { background: var(--surface-2); }
.chap-legacy small { color: var(--muted); font-size: 12px; }
.chap-legacy .btn { padding: 4px 10px; font-size: 12.5px; min-height: 0; }
.book-src { margin-top: 10px; }

/* ---------- Chapter page ---------- */
.chap-head { margin-bottom: 18px; }
.chap-head h1 { font-size: clamp(24px, 3.6vw, 34px); margin-top: 4px; }
.chap-head p { color: var(--muted); margin: 6px 0 0; }
.sections { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.sec { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.sec.soon { opacity: .6; background: transparent; border-style: dashed; }
.sec-num { font-family: var(--f-display); font-weight: 800; color: var(--accent); font-size: 15px; }
.sec-txt b { display: block; font-size: 15px; }
.sec-txt small { color: var(--muted); font-size: 12.5px; display: block; }
.sec-status { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 3px 8px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.sec-status:empty { display: none; }
.sec-status.l7, .sec-status.l6, .sec-status.l5 { background: var(--go-soft); color: var(--go-ink); }
.sec-status.l4, .sec-status.l3 { background: var(--warn-soft); color: var(--warn-ink); }
.sec-status.l2, .sec-status.l1 { background: var(--bad-soft); color: var(--bad); }
.sec-actions { display: flex; gap: 6px; }
.sec .parts { grid-column: 1 / -1; list-style: none; margin: 4px 0 0; padding: 0 0 0 52px; display: grid; gap: 6px; }
.part { width: 100%; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: inherit; font: inherit; cursor: pointer; }
.part:hover { border-color: var(--accent); }
.part-num { font-weight: 700; color: var(--accent); font-size: 13px; }
.part-txt b { display: block; font-size: 14px; }
.part-txt small { color: var(--muted); font-size: 12px; }
.part-st { font-size: 11.5px; font-weight: 700; color: var(--go-ink); white-space: nowrap; }
.part.done .part-num::after { content: ' ✓'; color: var(--go-ink); }
.sec-actions .btn { min-height: 40px; padding: 6px 14px; }
.chap-test-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-color: var(--accent); }
.chap-test-card b { font-family: var(--f-display); font-size: 16px; display: block; }

/* ---------- Exam preparation ---------- */
.sec-title { font-size: 18px; margin: 28px 0 10px; }
.mock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.mock-card h2 { font-size: 20px; margin: 4px 0 10px; }
.mock-topics { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
.mock-topics li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.mock-topics b { font-variant-numeric: tabular-nums; }
.mock-btns { display: grid; gap: 8px; margin-top: 12px; }
.res-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.res-table th, .res-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.res-table th { font-family: var(--f-display); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pp-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pp-btns .btn { min-height: 36px; padding: 5px 12px; font-size: 13px; }
.lvl { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; background: var(--surface-2); }
.lvl.l7, .lvl.l6, .lvl.l5 { background: var(--go-soft); color: var(--go-ink); }
.lvl.l4, .lvl.l3 { background: var(--warn-soft); color: var(--warn-ink); }
.lvl.l2, .lvl.l1 { background: var(--bad-soft); color: var(--bad); }
.topic-drills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* the paper */
.paper { max-width: 860px; margin: 0 auto; padding-bottom: 70px; }
.paper-cover { border: 2px solid var(--ink); border-radius: 6px; padding: 18px 22px; margin-bottom: 20px; background: var(--surface); }
.paper-cover h1 { font-size: 24px; margin: 6px 0; }
.paper-ins { margin: 10px 0 0; padding-left: 20px; font-size: 14px; color: var(--muted); display: grid; gap: 2px; }
.paper-q { margin-bottom: 22px; }
.paper-q h2 { font-size: 16px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 10px; }
.paper-q h2 small { font-family: var(--f-body); font-weight: 400; color: var(--muted); font-size: 13px; }
.paper-q .qm { margin-left: auto; font-variant-numeric: tabular-nums; }
.paper-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; display: grid; gap: 10px; }
.pi-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.pi-head > b { font-family: var(--f-display); }
.pi-q { overflow-x: auto; }
.pi-m { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pi-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 6px; padding-left: 52px; }
.pi-opt { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; cursor: pointer; background: var(--surface-2); min-height: 42px; overflow-x: auto; }
.pi-opt:hover { border-color: var(--accent); }
.pi-opt input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.pi-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pi-opt .k { font-family: var(--f-display); font-weight: 700; color: var(--muted); }
.paper-end { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.warn { color: var(--bad); }
.paper-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); color: var(--bg); display: flex; justify-content: center; gap: 24px; padding: 10px 16px; font-weight: 600; z-index: 20; font-variant-numeric: tabular-nums; }
#paper-timer.low { color: #ffb15c; }
.report-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 14px; margin-bottom: 14px; }
.report-top .card { display: grid; gap: 10px; align-content: start; }
.bar { display: block; width: 100px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; }
.bar i.ok { background: var(--go); } .bar i.mid { background: #ffb15c; } .bar i.low { background: var(--bad); }
.card.weak { margin-bottom: 14px; }
.paper-item.marked.ok { border-color: var(--go-ink); }
.paper-item.marked.bad { border-color: var(--bad); }
.memo-line { display: grid; gap: 4px; padding-left: 52px; font-size: 14px; }
.memo-line .your { color: var(--bad); }
.memo-line .right { color: var(--go-ink); font-weight: 600; }
.memo-line .why { color: var(--muted); }
.paper-item.marked .btn { justify-self: start; margin-left: 52px; }

/* figures */
.q-fig { margin-top: 8px; overflow-x: auto; }
.q-table { border-collapse: collapse; margin: 8px 0 2px; font-size: .92em; display: block; overflow-x: auto; max-width: 100%; }
.q-table th, .q-table td { border: 1px solid var(--line); padding: 4px 10px; text-align: center; white-space: nowrap; }
.q-table th { background: rgba(21, 80, 232, .06); font-weight: 600; text-align: left; }
.q-fig svg, .b-fig svg { display: block; max-width: 100%; height: auto; }
.q-fig svg { background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.b-fig { max-width: 520px; }
.b-line .q-fig { max-width: 480px; }
/* tables in board questions may use the full board width, and get tighter cells, so they are never cut off */
.b-line .q-fig:has(table) { max-width: 100%; }
.b-line .q-fig table { font-size: .9em; }
.b-line .q-fig table:has(th:nth-child(5), td:nth-child(5)) { font-size: .75em; }
.b-line .q-fig table th, .b-line .q-fig table td { padding: 4px 8px; }

@media (max-width: 900px) {
  .report-top { grid-template-columns: 1fr; }
  .sec { grid-template-columns: 44px minmax(0, 1fr); }
  .sec-status { grid-column: 2; justify-self: start; }
  .sec-actions { grid-column: 1 / -1; }
  .sec-actions .btn { flex: 1; }
  .sec .parts { padding-left: 0; }
  .pi-opts, .memo-line { padding-left: 0; }
  .paper-item.marked .btn { margin-left: 0; }
  .pi-head { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .res-layout { grid-template-columns: 1fr; }
  .res-filters { grid-template-columns: 1fr 1fr; }
  .res-filters input { grid-column: 1 / -1; }
  .res-item { grid-template-columns: minmax(0, 1fr); }
  .res-actions { justify-content: flex-start; }
}

@media (max-width: 900px) {
  .enrol { grid-template-columns: 1fr; gap: 24px; }
  .topic.ready { grid-column: auto; }
  .l-body { grid-template-columns: 1fr; grid-template-rows: minmax(300px, 58%) auto; overflow-y: auto; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .side-scroll { overflow: visible; }
  .board-wrap { padding: 8px; }
  .board { padding: 14px 14px 40px; border-width: 6px; }
  .b-h { font-size: 24px; } .b-line { font-size: 19px; } .b-line.lg { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .ink, .fade, .marked { animation: none !important; }
  .speaking .avatar .bars i { animation: none; height: 12px; }
  .board { scroll-behavior: auto; }
}

/* chapter test: the chosen option, no right/wrong shown until the end */
.q-opt.picked { border-color: #1257ff; background: #eef3ff; box-shadow: inset 0 0 0 1px #1257ff; }
.tp-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.tp-pages:empty { display: none; }
.tp-page { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface-2); }
.tp-page img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; background: #000; }
.tp-page figcaption { font-size: 12.5px; display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.tp-drop-text { display: grid; justify-items: center; gap: 4px; text-align: center; }
.tp-drop-text svg { width: 36px; height: 36px; color: var(--accent); }
.tp-marks { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-marks .btn { min-width: 52px; min-height: 44px; font-size: 18px; font-weight: 700; }

/* exam-style (past-paper) questions */
.xq-card { align-items: flex-start; }
.xq-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; }
.xq-list li { font-size: .92em; }
.xq-list small { margin-left: 4px; }
.q-ad { display: inline-block; margin: 8px 0; padding: 10px 16px; border: 2px solid var(--ink, #1f2430); border-radius: 6px; text-align: center; font-weight: 600; }
.q-data { margin: 8px 0; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.8; }
.xq-card { margin-bottom: 12px; }

/* "Refresh your memory" links to earlier lessons */
.b-note .refresh-link { margin: 6px 6px 0 0; padding: 6px 10px; font-size: .85em; min-height: 0; white-space: normal; text-align: left; }

/* calculator (laid out like the Casio fx-82ZA PLUS II) */
.cz-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cz { width: 248px; max-width: 100%; background: linear-gradient(#3a3f4a, #262a32); border-radius: 18px 18px 26px 26px; padding: 12px 12px 16px; box-shadow: 0 6px 16px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.12); font-family: Arial, Helvetica, sans-serif; user-select: none; }
.cz-top { display: flex; justify-content: space-between; align-items: center; color: #d6dae2; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; margin: 0 4px 6px; }
.cz-sol { color: #5b4a2e; background: #2b2418; border-radius: 3px; padding: 0 3px; font-size: 9px; }
.cz-lcd { background: #c9d3bd; border: 3px solid #1b1e24; border-radius: 6px; min-height: 76px; padding: 4px 8px 6px; color: #1d231a; box-shadow: inset 0 2px 4px rgba(0,0,0,.25); margin-bottom: 10px; }
.cz-ind { font-size: 9px; letter-spacing: .5px; opacity: .75; }
.cz-in { font-size: 17px; min-height: 26px; white-space: nowrap; overflow-x: auto; font-family: 'Courier New', monospace; }
.cz-out { font-size: 22px; text-align: right; font-weight: 700; min-height: 30px; font-family: 'Courier New', monospace; }
.cz-in sup, .cz-out sup { font-size: .7em; }
.cz-caret { display: inline-block; width: 2px; height: 1em; background: #1d231a; vertical-align: -2px; animation: czb 1s steps(1) infinite; }
@keyframes czb { 50% { opacity: 0; } }
.cz-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .85em; line-height: 1.05; }
.cz-frac > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 2px; }
.cz-box { border-top: 1.5px solid currentColor; }
.cz-empty { opacity: .5; }
.cz-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-bottom: 5px; }
.cz-rownum { grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 2px; }
.cz-k { border: none; border-radius: 6px; font-size: 10.5px; padding: 6px 0; cursor: pointer; color: #fff; background: #4a505c; box-shadow: 0 2px 0 #15181d; font-weight: 600; transition: transform .08s, background .15s; }
.cz-k.fn { background: #2f343d; font-size: 9px; }
.cz-k.nav { background: #8b919c; color: #1b1e24; }
.cz-k.num { background: #e9ebef; color: #1b1e24; font-size: 15px; padding: 8px 0; }
.cz-k.op { background: #e9ebef; color: #1b1e24; font-size: 16px; padding: 8px 0; }
.cz-k.del { background: #e66a2c; font-size: 12px; padding: 8px 0; }
.cz-k.eq { background: #e9ebef; color: #1b1e24; font-size: 16px; padding: 8px 0; }
.cz-k:active { transform: translateY(2px); box-shadow: none; }
.cz-k.cz-hot { background: #ffd23f !important; color: #1b1e24 !important; transform: translateY(2px) scale(1.08); box-shadow: 0 0 0 3px #ff9f1c; }
.cz-side { flex: 1 1 220px; min-width: 0; font-size: 14px; line-height: 1.45; }
.cz-say { min-height: 2.6em; margin-bottom: 8px; }
.cz-seq { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.cz-chip { border: 1.5px solid #c5ccd8; border-radius: 6px; padding: 1px 7px; font-size: 13px; font-weight: 700; color: #8a93a3; background: #fff; }
.cz-chip.on { border-color: #1257ff; color: #1257ff; background: #eef3ff; }
.cz-write { margin-bottom: 8px; }

.cz-k small { display: block; font-size: 8px; color: #f5c518; line-height: 1; margin-top: -2px; }
.cz-k.fn:first-child { color: #f5c518; }
.cz-k.cz-on { background: #f5c518; color: #1b1e24; }
.cz-ind b { font-weight: 700; } .cz-s { background: #1d231a; color: #c9d3bd; padding: 0 2px; }

/* "See it" clips: short narrated animations */
.sim.seeit { border-color: #7b2cbf; box-shadow: 0 2px 0 rgba(123, 44, 191, .15); }
.seeit-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.seeit-badge { background: #7b2cbf; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .08em; border-radius: 999px; padding: 3px 10px; }
.seeit-title { font-weight: 700; font-size: 15px; color: #1e2533; }
.seeit-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; min-height: 34px; }
.seeit-dot { display: inline-block; width: 22px; height: 6px; border-radius: 3px; background: #e3e7ef; flex: none; }
.seeit-dot.seeit-now { background: #b892e0; }
.seeit-dot.seeit-past { background: #7b2cbf; }
.seeit-replay { margin-left: auto; }
.seeit-ask { margin-top: 8px; background: #f6f0fd; border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.seeit-q { margin-bottom: 8px; }
.seeit-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.seeit-opts .sim-btn { text-align: left; }
.seeit-opts .sim-btn.right { background: #11864a; border-color: #11864a; color: #fff; }
.seeit-opts .sim-btn.wrong { background: #d7263d; border-color: #d7263d; color: #fff; }
.seeit-fb { margin-top: 8px; font-weight: 600; color: #7b2cbf; }
.seeit-why { margin-top: 6px; color: #11864a; font-weight: 600; }
.seeit-hook { margin-top: 8px; background: #fff3c4; border-left: 5px solid #c77700; border-radius: 8px; padding: 8px 12px; font-size: 15px; }

.seeit-stage { position: relative; }
.seeit-tex { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.seeit-m { position: absolute; white-space: nowrap; line-height: 1; }
.seeit-m svg { display: block; }
.seeit-tm { display: inline-block; vertical-align: middle; margin: 0 .15em; }
.seeit-tm svg { display: block; }

/* ---------- Learner accounts ---------- */
.acct-box { width: min(460px, 100%); }
.acct-form { display: grid; }
.field input[type="password"], .field input[type="email"], .field input[type="tel"], .field input[type="number"], .field select {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 11px 14px; font: inherit; color: var(--ink); }
.acct-err { color: var(--bad); font-weight: 600; font-size: 13.5px; margin: -6px 0 12px; }
.acct-ok { color: var(--go-ink); font-weight: 600; }
.acct-why { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; }
.acct-who { font-size: 15.5px; }
.acct-actions { flex-wrap: wrap; }
.acct-actions a.btn { text-decoration: none; }
.top-actions .acct-btn { white-space: nowrap; }

/* ---------- Parents' page ---------- */
.pp { max-width: 820px; margin: 0 auto; padding: 0 16px 48px; }
.pp-intro { margin: 8px 0 20px; }
.pp-intro h1 { font-family: var(--f-display); font-size: clamp(24px, 4vw, 32px); line-height: 1.2; margin: 6px 0 10px; }
.pp-card { margin-bottom: 16px; }
.pp-card h2 { font-family: var(--f-display); font-size: 17px; margin: 4px 0 14px; }
.pp-card summary { cursor: pointer; }
.pp-inner { margin-top: 16px; }
.pp-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pp-tab { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer; }
.pp-tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.pp-consent { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.pp-consent input { width: 18px; height: 18px; margin-top: 2px; }
.pp-note { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; font-weight: 500; }
.pp-note.warn { background: var(--bad-soft); color: var(--bad); }
.pp-kids { display: grid; gap: 14px; margin-bottom: 16px; }
.pp-kid-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.pp-kid h2 { margin: 0; font-family: var(--f-display); font-size: 20px; }
.pp-code { display: grid; grid-template-columns: auto auto; gap: 2px 10px; align-items: center; justify-items: start; }
.pp-code .hint { grid-column: 1 / -1; }
.pp-code b { font-family: var(--f-display); font-size: 22px; letter-spacing: .08em; }
.pp-paused { color: var(--warn-ink, #8a5a00); font-weight: 600; }
.pp-privacy ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; }
.pp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.pp-stats div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: grid; }
.pp-stats b { font-family: var(--f-display); font-size: 22px; }
.pp-stats span { font-size: 12.5px; color: var(--muted); }
.pp-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pp-row .field { flex: 1 1 120px; }
.pp-row .grow { flex: 3 1 200px; }
.pp-codes { background: var(--surface-2); border-radius: 10px; padding: 12px; max-height: 260px; overflow: auto; font-size: 14px; letter-spacing: .05em; }
@media (max-width: 560px) { .pp-code b { font-size: 19px; } }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: var(--accent-ink); }
.acct-code, .pp-code b { white-space: nowrap; }

/* ---------- Free taster ---------- */
.tag-free { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--go-ink); background: var(--go-soft, #e2f7ec); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.tag-lock { font-size: 12px; margin-left: 6px; opacity: .75; }
.taster-banner { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 20px; border-color: var(--accent); }
.taster-txt { display: grid; gap: 4px; flex: 1 1 320px; }
.taster-txt b { font-family: var(--f-display); font-size: 18px; }
.taster-go { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-why .linkish { font: inherit; font-weight: 600; }
.acct-free { margin: 4px 0 0; font-weight: 600; }
.acct-free-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.acct-free-list .linkish { text-align: left; }
.acct-h { font-family: var(--f-display); font-size: 15px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.acct-free-list .linkish { display: inline; }

/* ---------- Matric Upgrade Programme ---------- */
.up-card .exam-ico { background: #0b7285; }
.up-head h1 { font-family: var(--f-display); font-size: clamp(22px, 3.6vw, 30px); line-height: 1.2; margin: 6px 0 8px; }
.up-count { display: inline-flex; align-items: baseline; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; margin: 6px 0 12px; }
.up-count b { font-family: var(--f-display); font-size: 34px; color: var(--accent); line-height: 1; }
.up-buy { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.up-buy > div { display: grid; gap: 2px; flex: 1 1 280px; }
.up-buy b { font-family: var(--f-display); font-size: 18px; }
.up-paper h2 { font-family: var(--f-display); font-size: 19px; margin: 18px 0 10px; }
.up-paper h2 small { font-weight: 500; color: var(--muted); font-size: 13px; }
.up-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.up-topic { padding: 16px; }
.up-topic-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.up-topic-head b { font-family: var(--f-display); font-size: 15.5px; }
.up-marks { white-space: nowrap; font-weight: 700; color: var(--accent); font-size: 13.5px; }
.up-bar { height: 6px; background: var(--surface-2); border-radius: 99px; margin: 8px 0 10px; overflow: hidden; }
.up-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.up-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.up-rung { display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: start; }
.up-rung ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.up-grade { font-family: var(--f-display); font-size: 12px; font-weight: 700; border-radius: 8px; padding: 4px 0; text-align: center; color: #fff; }
.g10 .up-grade { background: #11864a; } .g11 .up-grade { background: #d9480f; } .g12 .up-grade { background: #7b2cbf; }
.up-step { display: block; width: 100%; text-align: left; font: inherit; font-size: 13.5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
button.up-step:hover { border-color: var(--accent); }
.up-step.done { border-color: var(--go-ink); color: var(--go-ink); font-weight: 600; }
.up-step.soon { cursor: default; color: var(--muted); border-style: dashed; background: transparent; }
.up-step.soon small { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.up-plan-wrap { overflow-x: auto; }
.up-plan { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 460px; }
.up-plan th, .up-plan td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.up-plan tbody th { white-space: nowrap; font-family: var(--f-display); }
.up-plan tbody th small { display: block; font-family: var(--f-body); font-weight: 400; color: var(--muted); }
.up-papers td { background: var(--accent-soft); font-weight: 500; }
.up-note { margin-top: 18px; }
@media (max-width: 600px) {
  .up-plan { min-width: 0; }
  .up-plan thead { display: none; }
  .up-plan tr { display: grid; grid-template-columns: 1fr; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .up-plan th, .up-plan td { border: 0; padding: 2px 4px; }
  .up-plan tbody th small { display: inline; margin-left: 6px; }
  .up-plan td[data-l]::before { content: attr(data-l) ': '; font-weight: 700; color: var(--accent); }
  .up-papers td { border-radius: 8px; padding: 8px; }
}

/* ---------- Teacher tools ---------- */
.teacher-card .exam-ico { background: #0b7285; }
.t-grades, .t-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.t-grades a.chip { text-decoration: none; }
.t-tab { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-weight: 600; cursor: pointer; }
.t-tab.on { background: var(--ink, #1b2333); color: #fff; border-color: transparent; }
.t-classbar { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; align-items: center; padding: 12px 14px; }
.t-ok { color: var(--go, #11864a); font-weight: 600; } .t-bad { color: #d7263d; font-weight: 600; }
.t-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.t-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.t-kpi small { display: block; color: var(--muted); font-size: 12px; } .t-kpi b { font-family: var(--f-display); font-size: 20px; }
.t-kpi b small { display: inline; font-size: 12px; }
.t-tablewrap { overflow-x: auto; }
.t-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); }
.t-table th, .t-table td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.t-table th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.t-table input[type=number] { width: 60px; } .t-table input[type=text] { width: 100%; min-width: 140px; }
.t-acts { white-space: nowrap; } .t-acts .btn { padding: 4px 9px; min-height: 0; font-size: 12.5px; }
.lvl-pill { display: inline-block; min-width: 26px; text-align: center; border-radius: 99px; padding: 1px 7px; font-weight: 700; font-size: 12px; background: #eee; }
.lvl-pill.l1, .lvl-pill.l2 { background: #fde2e4; color: #b3122a; } .lvl-pill.l3, .lvl-pill.l4 { background: #fff1cc; color: #8a5a00; }
.lvl-pill.l5, .lvl-pill.l6, .lvl-pill.l7 { background: #dcf5e6; color: #0b6b37; }
.t-weak ul { margin: 6px 0 0; padding-left: 18px; } .t-weak li { margin-bottom: 8px; }
.t-adv { color: #0b5d6b; font-size: 13.5px; }
.t-report h3 { margin-top: 16px; } .t-advice li { margin-bottom: 6px; }
.t-bars { display: flex; gap: 4px; align-items: flex-end; height: 110px; padding: 6px 0; }
.t-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.t-bar i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; } .t-bar small { font-size: 10px; color: var(--muted); }
.t-form .t-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; } .t-form .field { min-width: 140px; }
.t-check { display: flex; gap: 6px; align-items: center; font-size: 14px; padding-bottom: 10px; }
.t-secs { margin: 6px 0; } .t-secs fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; padding: 6px 10px; }
.t-secs legend { font-weight: 600; font-size: 13.5px; } .t-secs label { display: block; font-size: 13.5px; padding: 2px 0; }
.t-paper { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-top: 10px; max-height: 70vh; overflow: auto; }
.t-paper .pq { margin: 8px 0; } .t-paper .mk { float: right; color: #555; } .t-paper .memo { color: #0b5d2a; margin: 4px 0 10px 14px; }
.t-paper .nt { background: #fff6cc; border-left: 3px solid #e0b400; padding: 4px 8px; margin: 4px 0; } .t-paper .df { border-left: 3px solid #1550e8; padding: 4px 8px; margin: 4px 0; }
.t-paper table.tb { border-collapse: collapse; width: 100%; margin: 6px 0; } .t-paper table.tb th, .t-paper table.tb td { border: 1px solid #bbb; padding: 5px 7px; vertical-align: top; text-align: left; }
.t-prepsec { margin: 6px 0; } .t-prepsec .btn { padding: 4px 10px; min-height: 0; font-size: 12.5px; margin: 2px; }
.tasks-card h2 small { color: var(--muted); font-size: 13px; font-weight: 500; }
.task-list { list-style: none; margin: 8px 0 0; padding: 0; } .task-list li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.task-list li b { flex: 1; min-width: 160px; } .task-list li small { color: var(--muted); }
.task-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 6px; padding: 2px 7px; background: #e7efff; color: #1550e8; }
.task-kind.k-test { background: #fde2e4; color: #b3122a; } .task-kind.k-classwork { background: #dcf5e6; color: #0b6b37; } .task-kind.k-assignment { background: #f3e8ff; color: #7b2cbf; }
.acct-teacher { margin-top: 12px; } .acct-teacher summary { cursor: pointer; } .acct-classes { padding-left: 18px; } .acct-err-i { color: #d7263d; }
.acct-inline { margin-top: 10px; }
.tp-grades { display: flex; flex-wrap: wrap; gap: 14px; } .tp-grades label { display: flex; gap: 6px; align-items: center; }
.pp-class { margin: 6px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; } .pp-class .field { margin: 0; }

/* question tables written straight into a board line (statistics frequency tables): tighter, smaller when wide */
.b-line table.q-table th, .b-line table.q-table td { padding: 4px 7px; }
.b-line table.q-table:has(td:nth-child(5)) { font-size: .74em; }

/* refresher list: the most helpful lesson after a wrong answer, and the folded extras */
.refresh-link.rf-best { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, .25); }
.rf-more { margin-top: 6px; }
.rf-more summary { cursor: pointer; font-size: .92em; color: #1d4ed8; list-style: none; display: inline-block; padding: 4px 2px; }
.rf-more summary::-webkit-details-marker { display: none; }
.rf-more[open] summary { margin-bottom: 4px; }
.refresh-link .rf-tag { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: .8em; white-space: nowrap; }
