/* Kwantum lessons: Teach mode (full-screen class view with an ink layer). Load after fresh.css. */
.ltabs a.ltab-teach { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px !important; border: 0 !important; border-radius: 999px; background: var(--acc-strong); color: #fff !important; font-weight: 600; text-decoration: none; }
.ltab-teach::before { content: ""; width: 14px; height: 10px; border: 2px solid currentColor; border-radius: 2px; box-sizing: border-box; }
.lmeta .teach-l { font-size: 0.82rem; color: var(--acc-ink); font-weight: 600; text-decoration: none; white-space: nowrap; }

html.teaching, html.teaching body { overflow: hidden; height: 100%; overscroll-behavior: none; }
html.teaching .gpop { z-index: 1000; position: fixed; }
.teach { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; background: var(--t-stage, #E4E8EE); color: var(--ink); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; font-family: var(--serif); padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
:root[data-theme="dark"] .teach { --t-stage: #05080F; }
.teach .kwb-fs { display: none !important; } /* the site-wide Full screen pen button is not needed: Teach mode has its own pen */
.teach .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top strip and dock */
.t-top { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 10px; flex: none; }
.t-top-t { flex: 1; margin: 0; display: flex; gap: 12px; align-items: baseline; min-width: 0; font-size: 0.95rem; }
.t-top-t b { font-family: var(--display); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-count { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.t-top-r, .t-ctx { display: flex; gap: 4px; }
.t-ctx .tb-i { background: var(--card); box-shadow: var(--shadow); height: 36px; }
.t-ctx .tb-i[aria-pressed="true"] { background: var(--acc-strong); }
.t-dock { flex: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; padding: 8px 10px 10px; }
.t-grp { display: flex; align-items: center; gap: 4px; padding: 4px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); }
.t-grp[hidden] { display: none; }
.tb-i { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: 600 0.82rem var(--font); cursor: pointer; touch-action: manipulation; }
.t-top .tb-i { min-width: 40px; height: 40px; }
.tb-i svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tb-i:hover { background: var(--soft); }
.tb-i[aria-pressed="true"] { background: var(--acc-strong); color: #fff; }
.tb-i:disabled { opacity: .35; cursor: default; }
.tb-i[hidden] { display: none; }
.tb-i.big { min-width: 56px; }
.tb-i.primary { background: var(--acc-strong); color: #fff; }
.tb-i.sure { background: var(--no); color: #fff; }
.tb-i:focus-visible, .sw:focus-visible, .sz:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.sw { width: 34px; height: 34px; margin: 0 2px; border-radius: 50%; border: 3px solid var(--card); background: var(--c); box-shadow: 0 0 0 1px var(--rule); cursor: pointer; padding: 0; touch-action: manipulation; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.sz { width: 40px; height: 40px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; }
.sz i { display: block; width: 22px; border-radius: 4px; background: var(--ink); }
.tb-mini { margin-left: auto; border: 1px solid var(--rule); background: var(--card); color: var(--ink); border-radius: 999px; padding: 4px 14px; font: 600 0.8rem var(--font); cursor: pointer; }

/* the stage: a fixed-size slide scaled to fit, so ink always lines up */
.t-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.t-frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: var(--card); border-radius: 6px; box-shadow: 0 2px 6px rgba(10, 20, 40, .08), 0 18px 50px -20px rgba(10, 20, 40, .35); overflow: hidden; }
.t-slide { position: absolute; inset: 0; overflow: hidden; }
.t-in { width: 960px; padding: 34px 44px 30px; box-sizing: border-box; transform-origin: 0 0; font-size: 19px; line-height: 1.5; }
.t-ink, .t-live { position: absolute; left: 0; top: 0; width: 960px; height: 600px; pointer-events: none; }
.teach:not([data-tool="hand"]) .t-frame { cursor: crosshair; }
.teach[data-tool="er"] .t-frame { cursor: cell; }

/* reveal: hidden blocks keep their space, so the slide never jumps under your ink */
.tr { transition: opacity .25s ease; }
.tr.tr-hide { opacity: 0; pointer-events: none; }
.tr.tr-hide.tr-ans { opacity: 1; pointer-events: auto; position: relative; cursor: pointer; }
.tr.tr-hide.tr-ans > * { visibility: hidden; }
.tr.tr-hide.tr-ans::after { content: "Tap to reveal"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--rule); border-radius: 10px; background: repeating-linear-gradient(135deg, var(--soft) 0 10px, transparent 10px 20px); color: var(--muted); font: 600 0.8rem var(--font); letter-spacing: .08em; text-transform: uppercase; min-height: 38px; }
@media (prefers-reduced-motion: reduce) { .tr { transition: none; } }

/* slide headings */
.ts-h { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.ts-h h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: -0.02em; line-height: 1.1; }
.ts-n { font: 800 18px var(--display); color: #fff; background: var(--acc-strong); border-radius: 8px; padding: 4px 11px; }
.ts-cont { font: 500 13px var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.ts-idea { margin: -4px 0 16px; padding: 10px 16px; border-radius: 10px; background: var(--acc-soft); font-size: 20px; font-weight: 500; display: flex; gap: 12px; align-items: baseline; }
.ts-idea span:first-child { font: 700 12px var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--acc-ink); white-space: nowrap; }
:root[data-theme="dark"] .ts-idea { background: var(--soft); }

/* content */
.t-body > .tr + .tr, .t-col > .tr + .tr { margin-top: 14px; }
.t-in p, .t-in li { max-width: none; }
.t-in .blk p { margin: 0; }
.t-in .blk-p p { font-size: 21px; line-height: 1.5; }
.t-in .bul li, .t-in .num li { font-size: 20px; margin: 4px 0; }
.t-in .key { font-size: 20px; }
.t-in .fbox { margin: 0; }
.t-in .fbig { font-size: 40px; }
.t-in .vars td { font-size: 18px; padding: 4px 10px; }
.t-in table.info { font-size: 17px; }
.t-in .fig, .t-in figure { margin: 0; }
.t-in figure svg, .t-in .fig svg { max-width: 100%; height: auto; max-height: 380px; display: block; margin: 0 auto; }
.t-in figcaption { font-size: 15px; margin-top: 6px; }
.t-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; }
.t-vis figure svg { max-height: 400px; }
.t-why { border-left: 4px solid var(--acc); padding: 6px 0 6px 14px; }
.t-why-q { font-size: 20px; font-weight: 500; margin: 0 0 8px; }
.t-why-a { font-size: 19px; }
.t-why-a p { margin: 0; }

/* sims */
.t-sim .bench { margin: 0; }
.t-sim .bench-screen svg { max-height: 300px; }
.t-sim .bench-note { font-size: 15px; }
.hide-read .bench-read .rd-v b, .hide-read .bench-read .rd-v i { visibility: hidden; }
.hide-read .bench-read .rd-v { position: relative; }
.hide-read .meter-read { visibility: hidden; }
.hide-read .bench-read .rd-v::after { content: "?"; position: absolute; left: 0; top: 50%; transform: translateY(-50%); font: 800 26px var(--display); color: var(--amber, #F4B13C); }
.t-frame.frozen .bench { box-shadow: inset 0 0 0 3px var(--amber, #F4B13C); }
.t-frame.frozen .bench-top::after { content: "Paused"; margin-left: auto; font: 700 11px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--amber, #F4B13C); }

/* worked example */
.t-ex-h { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.t-ex-t { font: 700 20px var(--display); }
.t-ex-top.has-fig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 20px; align-items: start; }
.t-ex-top .qfig svg { max-height: 210px; }
.t-ex-q { font-size: 21px; font-weight: 500; padding: 12px 16px; background: var(--acc-tint, var(--soft)); border-radius: 10px; }
:root[data-theme="dark"] .t-ex-top.has-fig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 20px; align-items: start; }
.t-ex-top .qfig svg { max-height: 210px; }
.t-ex-q { background: var(--soft); }
.t-ex-g { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; margin-top: 14px; }
.t-ex-steps { list-style: none; margin: 0; padding: 0; }
.t-ex-steps li { margin-bottom: 10px; }
.t-ask { margin: 0 0 4px; font-size: 19px; font-weight: 500; display: flex; gap: 10px; align-items: baseline; }
.t-sn { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--acc-strong); color: #fff; font: 700 14px var(--font); display: inline-flex; align-items: center; justify-content: center; }
.t-a { padding: 6px 12px 6px 36px; font-size: 18px; color: var(--ok); min-height: 30px; }
.t-a p { margin: 0; }
.t-note { display: block; color: var(--muted); font-size: 16px; }
.t-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 36px; margin: 4px 0; }
.t-chip { border: 1px solid var(--rule); border-radius: 999px; padding: 3px 14px; font-size: 18px; background: var(--card); }
.t-chip.right, .t-opt.right, .rowpick tr.right, .t-pick span.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); font-weight: 600; }
.t-ex-work { border: 2px solid var(--rule); border-radius: 12px; padding: 10px 16px; min-height: 200px; }
.t-ex-work .working { font-size: 20px; }
.t-wk { opacity: 0; }
.t-wk.on { opacity: 1; }

/* questions as a class sees them */
.t-qh { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.t-qlab { font: 800 14px var(--font); text-transform: uppercase; letter-spacing: .12em; color: #fff; background: var(--acc-strong); padding: 4px 12px; border-radius: 6px; }
.t-qm { font: 500 14px var(--mono); color: var(--muted); }
.t-qstem { font-size: 22px; font-weight: 500; line-height: 1.45; }
.t-qstem table.info { font-size: 18px; margin: 8px 0; }
.t-qg { margin-top: 14px; }
.t-qg.has-fig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.t-qg .qfig svg { max-height: 300px; }
.t-opts { display: flex; flex-direction: column; gap: 8px; }
.t-opts.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.t-opt { display: flex; gap: 12px; align-items: center; border: 1px solid var(--rule); border-radius: 10px; padding: 7px 14px; font-size: 20px; background: var(--card); }
.t-opt .ol, .t-order .ol { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--soft); font: 700 16px var(--font); display: inline-flex; align-items: center; justify-content: center; }
.t-opt.right .ol { background: var(--ok); color: #fff; }
.t-opt .ot svg { max-height: 110px; width: auto; }
.t-ansbox { margin-top: 14px; }
.t-ans { padding: 12px 16px; border-radius: 10px; background: var(--ok-soft); border-left: 4px solid var(--ok); font-size: 19px; }
.t-ans p { margin: 0 0 6px; }
.t-ans .working { font-size: 19px; }
.t-ansline { font-weight: 600; font-size: 21px; }
.t-exp { color: var(--ink); }
.t-blankans { font-size: 22px; display: flex; gap: 12px; align-items: baseline; margin: 0; }
.t-line { display: inline-block; width: 240px; border-bottom: 2px solid var(--ink); }
.t-gaptext { font-size: 22px; line-height: 2; }
.t-pick { white-space: nowrap; }
.t-pick span { padding: 1px 6px; border-radius: 6px; border: 1px solid transparent; }
.t-gap { display: inline-block; min-width: 140px; border-bottom: 2px solid var(--ink); text-align: center; }
.t-gapa { visibility: hidden; color: var(--ok); font-weight: 600; }
.t-q:has(.t-ansbox:not(.tr-hide)) .t-gapa { visibility: visible; }
.t-q.show-gaps .t-gapa { visibility: visible; }
.t-order { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.t-order li { display: flex; gap: 12px; align-items: center; font-size: 19px; border: 1px solid var(--rule); border-radius: 10px; padding: 6px 12px; }
.t-match { display: flex; flex-direction: column; gap: 10px; }
.t-mrow { display: flex; gap: 16px; align-items: baseline; font-size: 20px; }
.t-choices { color: var(--muted); font-size: 17px; }
.t-lines { height: calc(var(--rows) * 44px); background: repeating-linear-gradient(to bottom, transparent 0 43px, var(--rule) 43px 44px); }
.t-points { margin: 4px 0 6px; padding-left: 22px; }
.t-points li { font-size: 19px; }
.t-model { font-style: italic; }
.t-rej { color: var(--no); font-size: 16px; }
.rowpick { font-size: 18px; }
.t-hint { color: var(--muted); font-size: 16px; margin: 10px 0 0; }

/* predictions */
.t-pred .pred-l { display: inline-block; font: 800 13px var(--font); text-transform: uppercase; letter-spacing: .12em; color: #fff; background: var(--acc-strong); padding: 4px 12px; border-radius: 6px; }
.t-pred-q { font-size: 25px; font-weight: 500; margin: 12px 0 16px; }

/* tips */
.t-tips-h { font: 700 14px var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 10px; }
.t-tips .tr + .tr { margin-top: 12px; }
.t-tips .tip { margin: 0; font-size: 19px; }

/* title, middle and end slides */
.t-title { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 30px; align-items: center; min-height: calc(var(--fill, 600px) - 70px); }
.t-title h1, .t-mid h1 { font: 800 56px/1.02 var(--display); letter-spacing: -0.03em; margin: 6px 0 16px; }
.t-eyebrow { font: 700 14px var(--font); text-transform: uppercase; letter-spacing: .14em; color: var(--acc-ink); margin: 0; }
.t-hook { font-size: 21px; margin: 0 0 18px; padding-left: 14px; border-left: 4px solid var(--acc); }
.t-out { background: var(--acc-soft); border-radius: 12px; padding: 12px 18px; }
:root[data-theme="dark"] .t-out { background: var(--soft); }
.t-out-h { font: 700 13px var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--acc-ink); margin: 0 0 4px; }
.t-out ul { margin: 0; padding-left: 20px; }
.t-out li { font-size: 17px; margin: 3px 0; }
.t-title-art svg { width: 100%; height: auto; }
.t-mid { min-height: calc(var(--fill, 600px) - 70px); display: flex; flex-direction: column; justify-content: center; max-width: 720px; }
.t-endbtns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.tb-big { display: inline-flex; align-items: center; padding: 12px 20px; border-radius: 12px; border: 0; background: var(--acc-strong); color: #fff; font: 600 17px var(--font); text-decoration: none; cursor: pointer; }
.tb-big.ghost { background: var(--soft); color: var(--ink); }
.t-recap { font-size: 21px; padding-left: 26px; }
.t-recap li { margin: 8px 0; }
.t-recap .hide.shown span { visibility: visible; }

/* whiteboard pages */
.k-board .t-in { height: 600px; padding: 14px 18px; }
.t-board-lab { font: 700 11px var(--font); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.k-board.bg-squares .t-slide { background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 32px 32px; background-position: -1px -1px; }
.k-board.bg-lines .t-slide { background-image: linear-gradient(transparent 47px, var(--rule) 47px); background-size: 100% 48px; }
.k-board.bg-graph .t-slide { background-image: linear-gradient(90deg, transparent 99px, var(--ink) 99px, var(--ink) 101px, transparent 101px), linear-gradient(transparent 519px, var(--ink) 519px, var(--ink) 521px, transparent 521px), linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 24px 24px, 24px 24px; background-position: 0 0, 0 0, 4px 17px, 4px 17px; }

/* timer, toast, menu and slide list */
.t-timer { position: absolute; right: 18px; top: 14px; padding: 8px 18px; border-radius: 12px; background: var(--ink); color: var(--paper); font: 800 34px var(--mono); pointer-events: none; }
.t-timer.done { background: var(--ok); color: #fff; font-family: var(--display); }
.t-toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 10px; font-size: 0.92rem; max-width: 90vw; text-align: center; z-index: 5; }
.t-toast[hidden] { display: none; }
.t-menu { position: absolute; right: 10px; top: 50px; width: min(360px, calc(100vw - 20px)); max-height: calc(100% - 140px); overflow: auto; background: var(--card); border-radius: 14px; box-shadow: 0 16px 40px rgba(10, 20, 40, .3); padding: 8px 16px 16px; z-index: 4; touch-action: pan-y; }
.t-menu[hidden], .t-over[hidden] { display: none; }
.m-h { font: 700 11px var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 14px 0 6px; }
.m-note { font-size: 0.85rem; color: var(--muted); margin: 0 0 8px; line-height: 1.45; }
.m-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.m-b { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 8px 12px; font: 500 0.88rem var(--font); cursor: pointer; }
.m-b[aria-pressed="true"] { background: var(--acc-strong); color: #fff; border-color: transparent; }
.m-b.wide { display: block; width: 100%; text-align: left; }
.m-b.warn { color: var(--no); }
.m-tog { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; padding: 4px 0; cursor: pointer; }
.m-tog input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--acc-strong); }
.t-over { position: absolute; inset: 46px 0 0; background: var(--paper); z-index: 6; overflow: auto; padding: 10px 18px 30px; touch-action: pan-y; }
.ov-h { display: flex; align-items: center; justify-content: space-between; }
.ov-h h2 { font: 800 1.4rem var(--display); margin: 6px 0; }
.ov-l { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ov-b { width: 100%; min-height: 84px; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); color: var(--ink); font: 500 0.92rem var(--font); cursor: pointer; position: relative; }
.ov-b.cur { box-shadow: 0 0 0 3px var(--acc); }
.ov-b.wb { border-style: dashed; }
.ov-n { font: 600 0.75rem var(--mono); color: var(--muted); }
.ov-k { font-size: 0.75rem; color: var(--acc-ink); font-weight: 600; }
.ov-ink { position: absolute; right: 8px; top: 8px; color: var(--acc-ink); }
.ov-ink svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* narrow screens (iPad portrait, phones): smaller dock */
@media (max-width: 820px) {
  .t-dock { gap: 6px; padding: 6px; }
  .tb-i { min-width: 40px; height: 40px; padding: 0 6px; }
  .tb-l { display: none; }
  .sw { width: 28px; height: 28px; }
}
@media (max-width: 560px) { .t-top-t b { display: none; } }

/* questions: leave room between the question and the answer for working on the board */
.k-quick .t-in, .k-check .t-in { min-height: var(--fill, 600px); display: flex; flex-direction: column; }
.k-quick .t-q, .k-check .t-q { flex: 1; display: flex; flex-direction: column; }
.t-q .t-ansbox { margin-top: auto; padding-top: 16px; }

/* tips sharing a content slide; "more quick checks" button */
.t-tips-in { margin-top: 18px; }
.t-more { margin: 10px 0 0; text-align: right; }

/* shapes picker (shapes, ruler and protractor come from assets/kwdraw.js) */
.t-shapes { position: fixed; z-index: 30; display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; width: min(392px, calc(100vw - 16px)); max-height: calc(100vh - 120px); overflow: auto; padding: 8px 10px 10px; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 16px 40px rgba(10, 20, 40, .3); touch-action: pan-y; font-family: var(--font); }
.t-shapes[hidden] { display: none; }
.t-shapes .h { grid-column: 1 / -1; margin: 6px 2px 0; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #667085); }
.t-shapes button { display: grid; place-items: center; min-height: 44px; border: 0; border-radius: 10px; background: var(--soft); color: inherit; cursor: pointer; }
.t-shapes button[aria-pressed="true"] { background: var(--acc-strong); color: #fff; }
.t-shapes svg { width: 26px; height: 26px; }
