/* Kwantum Teachers: class tools and activity makers. Same tokens as assets/style.css. */
:root {
  --bg: #F4F6F9; --surface: #FFFFFF; --ink: #0F1726; --muted: #4A5568; --line: #D9DEE6;
  --chip: #E9EDF3; --hover: #EEF2F7; --focus: #0F1726; --logo-bg: #0F1726; --logo-fg: #FFFFFF;
  --good: #1E7A4C; --warn: #B45309; --bad: #B4232A;
  --c: #0F6E6E;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B111C; --surface: #121A28; --ink: #E9EDF4; --muted: #A4AEC0; --line: #263247;
    --chip: #1B2536; --hover: #172131; --focus: #FFFFFF; --logo-bg: #E9EDF4; --logo-fg: #0B111C;
    --good: #4ADE80; --warn: #FBBF24; --bad: #F87171;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B111C; --surface: #121A28; --ink: #E9EDF4; --muted: #A4AEC0; --line: #263247;
  --chip: #1B2536; --hover: #172131; --focus: #FFFFFF; --logo-bg: #E9EDF4; --logo-fg: #0B111C;
  --good: #4ADE80; --warn: #FBBF24; --bad: #F87171;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* tool bar under the site strip */
.tbar { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.tbar-in { display: flex; align-items: center; gap: 8px; min-height: 52px; flex-wrap: wrap; padding-block: 6px; }
.tbar h1 { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.tbar h1 .sym { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; background: var(--c); color: #fff; font-size: .95rem; font-weight: 700; letter-spacing: -.03em; flex: none; }
.tbar select { min-height: 40px; width: auto; max-width: 60vw; }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.go { background: var(--c); border-color: var(--c); color: #fff; }
.btn.go:hover { filter: brightness(1.08); }
.btn.ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.sm { min-height: 36px; padding: 5px 10px; font-size: .9rem; }
.btn.big { min-height: 56px; font-size: 1.15rem; padding: 10px 22px; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn svg { width: 1.1em; height: 1.1em; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span, .lab { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
input[type="text"], input[type="number"], select, textarea {
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 8px 10px; min-height: 44px; width: 100%; }
textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
input[type="number"] { width: 5.5em; }
input[type="range"] { width: 100%; accent-color: var(--c); }
.chk { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.chk input { width: 20px; height: 20px; accent-color: var(--c); }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--r); overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--surface); padding: 8px 12px; min-height: 40px; cursor: pointer; font-weight: 600; }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.note { font-size: .88rem; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .grid2 { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); align-items: start; } }
.side { display: flex; flex-direction: column; gap: 14px; }
main.wrap { padding-top: 18px; padding-bottom: 48px; }
.h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }

/* home grid of tools */
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin: 22px 0 12px; }
.sec-head h2 { font-size: 1.25rem; }
.sec-head p { color: var(--muted); font-size: .95rem; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; } }
.el { display: flex; flex-direction: column; gap: 6px; aspect-ratio: 1 / 1; padding: 12px 14px; background: var(--c); color: #fff; border-radius: var(--r); text-decoration: none; transition: transform .18s, box-shadow .18s; }
.el:hover { transform: translateY(-3px); box-shadow: 0 10px 0 -4px color-mix(in srgb, var(--c) 35%, transparent); }
.el-sym { margin-top: auto; font-weight: 700; font-size: clamp(2.2rem, 8vw, 3.4rem); line-height: 1; letter-spacing: -.04em; }
.el-name { font-weight: 600; font-size: .95rem; line-height: 1.2; }
.el-desc { font-family: var(--mono); font-size: .68rem; line-height: 1.35; opacity: .9; }

/* class picker */
.classbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.classbar .field { flex: 1 1 180px; }
.privacy { display: flex; gap: 8px; align-items: flex-start; font-size: .85rem; color: var(--muted); }
.privacy svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 11px; min-height: 34px; cursor: pointer; font-size: .9rem; }
.chips button.off { text-decoration: line-through; opacity: .5; }
.chips button.done { background: var(--chip); color: var(--muted); }

/* stage = the part shown on the board */
.stage { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-height: 360px; display: flex; flex-direction: column; gap: 14px; }
.stage-tools { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.stage:fullscreen { border: 0; border-radius: 0; padding: 3vh 3vw; overflow: auto; background: var(--bg); }
.stage:-webkit-full-screen { border: 0; border-radius: 0; padding: 3vh 3vw; overflow: auto; background: var(--bg); }
.stage.fs-fake { position: fixed; inset: 0; z-index: 50; border: 0; border-radius: 0; padding: 3vh 3vw; overflow: auto; background: var(--bg); }

/* name picker */
.pick { flex: 1; display: grid; place-items: center; text-align: center; min-height: 220px; }
.pick-name { font-size: clamp(2.6rem, 9vw, 7rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; overflow-wrap: anywhere; }
.pick-name.spin { color: var(--muted); }
.pick-name.land { animation: land .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes land { from { transform: scale(.6); opacity: .2; } to { transform: none; opacity: 1; } }
.stage:fullscreen .pick-name, .stage.fs-fake .pick-name { font-size: min(14vw, 22vh); }
.pick-sub { font-family: var(--mono); color: var(--muted); font-size: .9rem; }

/* seating */
.room { display: flex; flex-direction: column; gap: 14px; }
.front { text-align: center; font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; padding: 6px; border-radius: var(--r); background: var(--chip); color: var(--muted); }
.desks { display: grid; gap: clamp(6px, 1.6vw, 22px); width: 100%; }
.desk { display: grid; gap: 3px; min-width: 0; padding: 5px; border-radius: 8px; background: color-mix(in srgb, var(--c) 18%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--c) 45%, transparent); }
.seat { min-width: 0; min-height: 52px; width: 100%; display: grid; place-items: center; text-align: center; padding: 4px 5px; border-radius: 5px; border: 0; background: var(--surface); cursor: pointer; font-weight: 600; font-size: clamp(.78rem, 1.3vw, 1.05rem); line-height: 1.15; overflow-wrap: anywhere; position: relative; }
.seat.empty { color: var(--muted); font-weight: 400; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.seat.sel { outline: 3px solid var(--ink); outline-offset: -3px; }
.seat.locked::after { content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 2px; background: var(--warn); }
.seat.off { visibility: hidden; }
.stage:fullscreen .seat, .stage.fs-fake .seat { font-size: clamp(.9rem, 1.6vw, 1.5rem); min-height: 7vh; }
.clash { color: var(--bad); font-weight: 600; }

/* groups */
.groups { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.group { border-radius: var(--r); background: color-mix(in srgb, var(--gc, var(--c)) 14%, var(--surface)); border-top: 6px solid var(--gc, var(--c)); padding: 10px 12px; }
.group h3 { font-size: 1.05rem; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 6px; }
.group li { padding: 3px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed color-mix(in srgb, var(--ink) 14%, transparent); }
.group li:last-child { border: 0; }
.group li i { font-style: normal; font-family: var(--mono); font-size: .72rem; font-weight: 500; color: var(--muted); align-self: center; text-align: right; }
.stage:fullscreen .groups, .stage.fs-fake .groups { grid-template-columns: repeat(auto-fit, minmax(min(22vw, 300px), 1fr)); }
.stage:fullscreen .group, .stage.fs-fake .group { font-size: clamp(1rem, 1.8vw, 1.6rem); }

/* timer */
.clock { flex: 1; display: grid; place-items: center; text-align: center; gap: 10px; }
.digits { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; font-size: clamp(4rem, 18vw, 12rem); line-height: 1; letter-spacing: -.04em; }
.stage:fullscreen .digits, .stage.fs-fake .digits { font-size: min(26vw, 48vh); }
.digits.low { color: var(--warn); }
.digits.done { color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.bar { height: 14px; border-radius: 99px; background: var(--chip); overflow: hidden; width: min(100%, 900px); }
.bar > i { display: block; height: 100%; width: 100%; background: var(--c); transition: width .25s linear; }
.clock-label { font-size: clamp(1.2rem, 3vw, 2.2rem); font-weight: 700; }

/* noise meter */
.meter { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: center; }
.gauge { position: relative; height: clamp(90px, 22vh, 260px); border-radius: 12px; background: linear-gradient(90deg, #1E7A4C 0 40%, #C98A00 40% 70%, #B4232A 70%); overflow: hidden; }
.gauge .cover { position: absolute; top: 0; right: 0; bottom: 0; background: var(--chip); transition: width .12s linear; }
.gauge .limit { position: absolute; top: -4px; bottom: -4px; width: 5px; background: var(--ink); border-radius: 3px; }
.zone { font-size: clamp(2rem, 7vw, 5.5rem); font-weight: 800; text-align: center; letter-spacing: -.03em; }
.zone.loud { color: var(--bad); animation: pulse .8s infinite; }

/* board text for activity makers */
.board-q { font-size: clamp(1.6rem, 4.2vw, 3.6rem); font-weight: 700; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.stage:fullscreen .board-q, .stage.fs-fake .board-q { font-size: min(6vw, 9vh); }
.board-a { font-size: clamp(1.3rem, 3vw, 2.6rem); text-align: center; color: var(--good); font-weight: 700; }
.kick { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: center; }
.phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.phases button { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 6px; min-height: 56px; cursor: pointer; font-weight: 700; font-size: clamp(1rem, 2.2vw, 1.6rem); }
.phases button[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.phases small { display: block; font-family: var(--mono); font-weight: 500; font-size: .7rem; opacity: .85; }
.count321 { font-size: clamp(5rem, 22vw, 16rem); font-weight: 800; text-align: center; line-height: 1; color: var(--c); }

/* co-op */
.coop-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.coop-card { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.coop-card:hover { border-color: var(--c); }
.coop-card b { font-size: 1.02rem; }
.coop-card span { font-size: .86rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tags i { font-style: normal; font-family: var(--mono); font-size: .68rem; padding: 2px 6px; border-radius: 4px; background: var(--chip); color: var(--muted); }
.steps { counter-reset: s; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: clamp(1.05rem, 2vw, 1.7rem); line-height: 1.3; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 4px; background: var(--c); color: #fff; font-weight: 700; font-size: .85em; }
.steps li.now { font-weight: 700; }
.steps li.past { opacity: .45; }
.tip { border-left: 4px solid var(--c); padding: 8px 12px; background: var(--chip); border-radius: 0 var(--r) var(--r) 0; font-size: .95rem; }

/* card sort */
.cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.card { border: 2px solid var(--line); background: var(--surface); border-radius: 8px; padding: 12px; min-height: 84px; display: grid; place-items: center; text-align: center; cursor: pointer; font-weight: 600; font-size: clamp(.95rem, 1.6vw, 1.35rem); line-height: 1.25; overflow-wrap: anywhere; }
.card.t { border-color: var(--c); }
.card.sel { outline: 4px solid var(--ink); outline-offset: -2px; }
.card.ok { background: color-mix(in srgb, var(--good) 18%, var(--surface)); border-color: var(--good); cursor: default; }
.card.no { animation: shake .35s; border-color: var(--bad); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.cat-cols { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cat-col { border: 2px dashed var(--line); border-radius: 8px; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.cat-col h3 { font-size: 1.05rem; text-align: center; }
.cat-col .card { min-height: 52px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sortlist { display: flex; flex-direction: column; gap: 5px; max-height: min(52vh, 460px); overflow-y: auto; padding: 2px 4px 2px 0; overscroll-behavior: contain; }
.sl-area { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 8px 0 1px; }
.sl-area:first-child { margin-top: 0; }
.sortlist button { flex-shrink: 0; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-height: 40px; }
.sortlist button:hover { border-color: var(--c); }
.sortlist button b { font-weight: 600; font-size: .95rem; line-height: 1.25; }
.sortlist button i { font-style: normal; font-family: var(--mono); font-size: .68rem; color: var(--muted); white-space: nowrap; }
.sortlist button[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); box-shadow: inset 4px 0 0 var(--c); }
.cs-title { font-size: clamp(1.2rem, 2.4vw, 2rem); font-weight: 800; text-align: center; line-height: 1.15; letter-spacing: -0.02em; }
.cs-note { text-align: center; font-weight: 600; color: var(--muted); }
.ord { display: grid; gap: 6px; }
.ord li { display: grid; grid-template-columns: 2.2em 1fr; gap: 8px; align-items: center; border: 2px dashed var(--line); border-radius: 8px; padding: 4px; min-height: 48px; }
.ord li > span { display: grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 4px; background: var(--chip); color: var(--muted); font-weight: 700; }
.ord li.on { border-style: solid; border-color: var(--good); }
.ord li.on > span { background: var(--good); color: var(--surface); }
.ord li .card { min-height: 40px; padding: 6px 10px; justify-items: start; text-align: left; }

/* retrieval grid */
.rgrid { display: grid; gap: 8px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.rhead { text-align: center; font-weight: 700; padding: 6px; border-radius: var(--r); background: var(--c); color: #fff; font-size: clamp(.8rem, 1.4vw, 1.2rem); line-height: 1.2; }
.rhead small { display: block; font-family: var(--mono); font-weight: 500; font-size: .75em; opacity: .9; }
.rcell { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px; min-height: 90px; cursor: pointer; text-align: left; font-size: clamp(.85rem, 1.4vw, 1.3rem); line-height: 1.3; display: flex; flex-direction: column; gap: 6px; }
.rcell .ans { color: var(--good); font-weight: 700; }
.stage:fullscreen .rcell, .stage.fs-fake .rcell { min-height: 16vh; }
@media (max-width: 640px) { .rgrid { grid-template-columns: minmax(0, 1fr); } .rhead { display: none; } .rcell::before { content: attr(data-age); font-family: var(--mono); font-size: .7rem; color: var(--muted); } }

/* exit tickets */
.ticket { border: 2px solid var(--ink); border-radius: 10px; padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.ticket h3 { font-size: 1.2rem; }
.ticket .q { font-weight: 600; }
.ticket .lines { display: grid; gap: 14px; margin-top: 4px; }
.ticket .lines i { display: block; border-bottom: 1px solid #999; height: 14px; }
.ticket .faces { display: flex; gap: 12px; font-family: var(--mono); font-size: .85rem; }
.ticket .faces span { border: 1.5px solid var(--ink); border-radius: 99px; padding: 2px 10px; }
.stage:fullscreen .ticket, .stage.fs-fake .ticket { font-size: clamp(1rem, 2.2vw, 2rem); }

/* class editor */
.classes { display: grid; gap: 10px; }
.cls { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.cls b { margin-right: auto; }

/* print */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; color: #000; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  .pcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
  .pcard { border: 1px dashed #777; min-height: 38mm; display: grid; place-items: center; text-align: center; padding: 4mm; font: 600 13pt/1.25 var(--font); break-inside: avoid; }
  .pcard.t { font-weight: 800; }
  .ptickets { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
  .ptickets.one { grid-template-columns: 1fr; }
  .ptickets .ticket { break-inside: avoid; border-color: #000; }
  .pgrid { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); border: 1px solid #000; }
  .pgrid > div { border: 1px solid #000; padding: 3mm; min-height: 34mm; font-size: 10.5pt; }
  .pgrid > .ph { min-height: 0; font-weight: 800; text-align: center; background: #eee; }
  .pseats { zoom: .8; }
  .pseats .seat { border: 1px solid #000; }
  .pseats .desk { background: #f2f2f2; border-color: #000; }
  .pgroups .group { border: 1px solid #000; break-inside: avoid; }
  h2.ptitle { font: 800 16pt var(--font); margin: 0 0 6mm; }
  ol.pord { list-style: decimal; padding-left: 8mm; } ol.pord li { margin: 0 0 2mm; }
}
@media (prefers-reduced-motion: reduce) { .pick-name.land, .digits.done, .zone.loud { animation: none; } .el { transition: none; } }

/* show-me board quiz */
.showme { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: .6em; font-size: 40px; line-height: 1.22; text-align: center; min-height: 240px; }
.sm-q { font-weight: 700; overflow-wrap: anywhere; letter-spacing: -.01em; }
.sm-q sub, .sm-q sup, .sm-opts sub, .sm-opts sup { line-height: 0; }
.sm-opts { display: grid; gap: .3em; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12em), 1fr)); text-align: left; font-size: .82em; }
.sm-opts:empty { display: none; }
.sm-opts p { display: flex; gap: .5em; align-items: baseline; padding: .25em .5em; border-radius: 8px; background: var(--chip); }
.sm-opts b { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; border-radius: 6px; background: var(--c); color: #fff; flex: none; }
.showme .count321 { font-size: 2.6em; }
.sm-a { color: var(--good); font-weight: 700; font-size: .9em; }
.sm-why { color: var(--muted); font-weight: 500; font-size: .6em; margin-top: .4em; }
.topic-list { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
.topic-list summary { cursor: pointer; padding: 4px 0; }
.chk.sm { min-height: 32px; font-size: .92rem; }
.chk.sm input { width: 18px; height: 18px; }
.sm-in { display: flex; flex-direction: column; gap: .6em; }

/* ---------- Maths banks: formulas (pre-rendered HTML from the Maths lessons) ---------- */
:root { --math: "STIX Two Text", "Cambria Math", "Times New Roman", serif; }
.fm { font-family: var(--math); font-size: 1.1em; white-space: nowrap; letter-spacing: 0; }
.fm i { font-style: italic; }
.fm sub, .fm sup { font-size: 0.68em; font-style: normal; }
.fm sub { vertical-align: -0.3em; } .fm sup { vertical-align: 0.55em; line-height: 0; }
.fm .eq { margin: 0 0.28em; }
.fm .ft { font-family: var(--font); font-size: 0.85em; font-style: normal; }
.fm .ovl { text-decoration: overline; text-decoration-thickness: 1px; }
.fm .rt-i { font-size: .6em; margin-right: -.35em; vertical-align: .9em; font-style: normal; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 0.15em; }
.frac > span { padding: 0 0.2em; line-height: 1.25; }
.frac > span:first-child { border-bottom: 1.2px solid currentColor; }
.sqrt { display: inline-flex; align-items: stretch; vertical-align: middle; margin: 0 0.1em; }
.sqrt .sq-r { display: block; width: 0.62em; flex: none; position: relative; }
.sqrt .sq-r svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sqrt .sq-in { border-top: 1.3px solid currentColor; padding: 0.12em 0.15em 0.02em 0.1em; display: block; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.colv { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; padding: 1px 6px; margin: 0 2px; border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; border-radius: 6px; line-height: 1.15; }
.colv > span { display: block; }
.vb { font-weight: 700; font-style: normal; text-decoration: underline; text-underline-offset: 3px; }
.fm .int, .int { display: inline-flex; align-items: center; font-size: 1.35em; font-style: normal; line-height: 1; margin-right: .05em; }
.fm .int-l, .int-l { display: inline-flex; flex-direction: column; justify-content: space-between; font-size: .5em; margin-left: .1em; line-height: 1; height: 2.1em; }
.fm .sum { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1; margin: 0 .1em; font-style: normal; }
.fm .sum > span:not(.sg) { font-size: .62em; min-height: .8em; }
.fm .sum .sg { font-size: 1.45em; line-height: .95; }
.fm .binom { display: inline-flex; align-items: center; font-style: normal; }
.fm .binom > .bp { font-size: 2em; font-weight: 300; line-height: 1; }
.frac.nb > span:first-child { border-bottom: 0 !important; }
.mat { display: inline-grid; vertical-align: middle; column-gap: .7em; row-gap: .05em; padding: 1px 6px; margin: 0 2px; border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; border-radius: 7px; line-height: 1.2; font-size: .95em; text-align: center; }
.mat.det { border-radius: 0; }
.mat > .aug { border-left: 1px solid currentColor; padding-left: .5em; }

/* data tables inside question text (Biology past-paper style questions) */
table.dt { border-collapse: collapse; margin: .5em 0; font-size: .92em; max-width: 100%; display: block; overflow-x: auto; }
table.dt th, table.dt td { border: 1px solid currentColor; padding: .25em .6em; text-align: center; }
table.dt th { font-weight: 600; }
table.dt tr > :first-child { text-align: left; }
@media print { table.dt { display: table; } }
