/* Announced, not shown: the 360 room tells a screen reader which marker the
   keyboard is on. Clipped rather than display:none, which would silence it. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
/* Colours, type, radii and the focus ring come from css/tokens.css, which every
   page loads first. Light is the default; body.player (the rooms) and the other
   dark surfaces get the dark values of the same names there. */
:root{box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
*,*::before,*::after{box-sizing:inherit}
html,body{margin:0;background:var(--bg);color:var(--fg);font-family:var(--font-sans);line-height:var(--lh-body)}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
/* One focus ring for the whole site: the accent of the surface it is on. */
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,
textarea:focus-visible,iframe:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:var(--focus-w) solid var(--focus);outline-offset:var(--focus-offset)}
a{color:var(--link)}
a:hover{color:var(--link-hover)}
/* ---- The button family. Same font, weight, radius and size on both surfaces;
   the colour comes from the surface. Padding is the OUTER size, so a 2px dark
   outline and a 1px light one give the same button. */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;
  background:var(--accent);color:var(--accent-fg);border:var(--control-bw) solid var(--accent);border-radius:var(--r-control);
  padding:calc(var(--btn-py) - var(--control-bw)) calc(var(--btn-px) - var(--control-bw));
  font-family:var(--font-sans);font-weight:var(--fw-bold);font-size:var(--fs-btn);line-height:var(--lh-control);
  text-decoration:none;box-shadow:none}
.btn:hover:not(:disabled){background:var(--accent-hover);border-color:var(--accent-hover);color:var(--accent-fg)}
.btn.ghost{background:transparent;color:var(--fg);border-color:var(--line-strong)}
.btn.ghost:hover:not(:disabled){background:var(--ghost-hover);border-color:var(--accent);color:var(--fg)}
.btn.small{font-size:var(--fs-ui);padding:calc(8px - var(--control-bw)) calc(13px - var(--control-bw))}
.btn.big{font-size:var(--fs-body);padding:calc(14px - var(--control-bw)) calc(21px - var(--control-bw))}
.btn:disabled{opacity:.45;cursor:default}
/* Status badges: a tint with strong text, on either surface. */
.rag{display:inline-block;border-radius:var(--r-pill);padding:3px 9px;font-weight:var(--fw-bold);font-size:var(--fs-xs);white-space:nowrap;background:var(--neutral-soft);color:var(--neutral-strong)}
.rag.g{background:var(--ok-soft);color:var(--ok-strong)}.rag.a{background:var(--amber-soft);color:var(--amber-strong)}.rag.r{background:var(--bad-soft);color:var(--bad-strong)}.rag.n{background:var(--neutral-soft);color:var(--neutral-strong)}
.muted{color:var(--soft)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ---------- hub + teacher ---------- */
.page{max-width:1120px;margin:0 auto;padding:24px 20px 60px}
.top{display:flex;align-items:center;gap:16px;flex-wrap:wrap;justify-content:space-between;margin-bottom:22px}
.brand{display:flex;align-items:center;gap:14px}
.brand h1,.brand .site-name{display:block;margin:0;font-size:24px}
.brand p{margin:0;color:var(--soft);font-size:14px}
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);padding:20px}
.signin{max-width:460px;margin:40px auto}
.signin h2{margin:0 0 6px}
.field{display:grid;gap:6px;margin:14px 0}
.field label{font-weight:600;font-size:14px}
.field input,.field select{background:var(--field-bg);color:var(--fg);border:var(--control-bw) solid var(--line-strong);border-radius:var(--r-control);padding:calc(11px - var(--control-bw)) calc(13px - var(--control-bw));width:100%}
.field input:focus,.field select:focus{border-color:var(--accent)}
.err{color:var(--bad);font-size:14px;min-height:20px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px}
.exp{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);overflow:hidden;display:flex;flex-direction:column}
.exp .thumb{height:136px;background-size:100% 100%;background-position:50% 50%;background-repeat:no-repeat;position:relative}
.exp .thumb span{position:absolute;left:12px;top:12px;background:rgba(10,16,30,.85);border-radius:var(--r-pill);padding:3px 10px;font-size:var(--fs-sm);font-weight:700;color:var(--c-cobalt-200)}
.exp .body{padding:14px 16px 16px;display:flex;flex-direction:column;gap:8px;flex:1}
.exp h3{margin:0;font-size:18px}
.exp p{margin:0;color:var(--soft);font-size:14px;flex:1}
.bar{height:8px;border-radius:99px;background:var(--bg2);overflow:hidden}
.bar i{display:block;height:100%;background:var(--ok);border-radius:99px}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.row.end{justify-content:flex-end}
.weak{display:grid;gap:8px}
.weak a{display:flex;justify-content:space-between;gap:10px;align-items:center;background:var(--bg2);border:1px solid var(--line);border-radius:var(--r-card);padding:10px 14px;color:var(--fg);text-decoration:none}
.weak a:hover{border-color:var(--accent)}
section{margin-top:28px}
section>h2{font-size:19px;margin:0 0 12px}
.sync{font-size:13px;color:var(--soft)}
table.t{width:100%;border-collapse:collapse;font-size:14px}
table.t th,table.t td{padding:8px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}
table.t th{color:var(--soft);font-weight:600;position:sticky;top:0;background:var(--panel)}
.scroll{overflow-x:auto;border:1px solid var(--line);border-radius:var(--r-card);background:var(--panel)}
.cell{display:inline-block;min-width:64px;text-align:center;border-radius:var(--r-control);padding:3px 6px;font-weight:700;color:var(--c-ink)}
button.link{background:none;border:0;color:var(--info);text-decoration:underline;padding:0}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}
.stat{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);padding:12px 14px}
.stat b{display:block;font-size:26px;color:var(--accent)}
.hbar{display:grid;grid-template-columns:minmax(160px,260px) 1fr 60px;gap:10px;align-items:center;font-size:14px;margin:6px 0}

/* ---------- player ---------- */
body.player{height:100%;overflow:hidden}
html:has(body.player){height:100%}
#v{position:fixed;inset:0;cursor:grab;touch-action:none}
.hudbar{position:fixed;top:calc(10px + env(safe-area-inset-top,0px));left:10px;right:10px;display:flex;justify-content:space-between;gap:10px;pointer-events:none;align-items:flex-start}
.hudbar>*{pointer-events:auto}
.pill{background:var(--glass);border:1px solid var(--line);border-radius:var(--r-card);padding:6px}
.nav{display:flex;gap:6px;flex-wrap:wrap;max-width:62vw}
.nav button{background:transparent;color:var(--soft);border:1px solid transparent;border-radius:var(--r-control);padding:7px 10px;font-size:14px}
.nav button[aria-pressed="true"]{border-color:var(--accent);color:var(--accent)}
.nav .tick{color:var(--ok)}
.hud{margin-left:auto;text-align:right;font-size:13px;line-height:1.4;padding:8px 12px}
.hud b{font-size:20px;color:var(--highlight-text)}
.tools{position:fixed;bottom:calc(12px + env(safe-area-inset-bottom,0px));left:50%;transform:translateX(-50%);display:flex;gap:6px;flex-wrap:wrap;justify-content:center;max-width:96vw}
body.player .tools{width:max-content}
.webgl-fallback{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:min(420px,calc(100% - 32px));padding:22px 24px;text-align:center;background:rgba(10,16,30,.92);border:1px solid #667996;border-radius:var(--r-card);color:#fff;cursor:default}
.webgl-fallback h1{margin:0 0 8px;font-size:22px}
.webgl-fallback p{margin:0 0 15px;font-size:14px;line-height:1.5;color:#D4DFEE}
.tools a{background:var(--glass);color:var(--fg);border:1px solid var(--line);border-radius:var(--r-control);padding:8px 12px;font-size:14px;text-decoration:none}
.tools button{background:var(--glass);color:var(--fg);border:1px solid var(--line);border-radius:var(--r-control);padding:8px 12px;font-size:14px}
.tools button[aria-pressed="true"]{border-color:var(--accent);color:var(--accent)}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(64px + env(safe-area-inset-bottom,0px));background:var(--glass);border:1px solid var(--line);border-radius:var(--r-card);padding:8px 14px;font-size:14px;color:var(--soft);max-width:92vw;text-align:center}
/* info drawer: non-modal, the scene stays usable */
.drawer{position:fixed;top:calc(150px + env(safe-area-inset-top,0px));right:10px;width:min(380px,calc(100vw - 20px));max-height:calc(100% - 220px);overflow:auto;background:rgba(20,32,56,.97);border:2px solid var(--info);border-radius:var(--r-window);padding:14px 16px;box-shadow:var(--shadow-pop);transform:translateX(calc(100% + 20px));transition:transform .2s ease;visibility:hidden}
.drawer.open{transform:none;visibility:visible}
.drawer h2{margin:0 30px 8px 0;font-size:18px;color:var(--info)}
.drawer p{margin:0;font-size:15px}
.drawer .x{position:absolute;right:10px;top:8px;background:none;border:0;color:var(--fg);font-size:24px;line-height:1}
.drawer .count{margin-top:10px;font-size:13px;color:var(--soft)}
.drawer.progress{border-color:var(--highlight)}
.drawer.progress h2{color:var(--highlight-text)}
@media (max-width:640px){.drawer{top:auto;bottom:calc(60px + env(safe-area-inset-bottom,0px));right:10px;max-height:45%;transform:translateY(calc(100% + 80px))}}
@media (prefers-reduced-motion: reduce){.drawer{transition:none}}
/* question modal */
/* With a window open the 360 scene behind it is just noise, so it is pushed out
   of focus. backdrop-filter blurs what is behind the overlay in one composited
   pass, rather than filtering the WebGL canvas itself, which would have to be
   redone every animated frame. Where it is not supported the overlay simply
   goes darker. */
#modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;padding:16px;
  background:rgba(6,11,24,.58);backdrop-filter:blur(14px) saturate(.7);-webkit-backdrop-filter:blur(14px) saturate(.7)}
@supports not ((backdrop-filter:blur(2px)) or (-webkit-backdrop-filter:blur(2px))){
  #modal{background:rgba(6,11,24,.9)}
}
#modal.open{display:flex}
.head button{min-width:36px;min-height:36px}
.box{position:relative;background:var(--panel);border:3px solid var(--c,var(--highlight));border-radius:var(--r-window);max-width:660px;width:100%;max-height:90%;overflow:auto;box-shadow:var(--shadow-pop)}
.head{background:var(--c,var(--highlight));color:var(--highlight-fg);padding:14px 20px;font-weight:700;font-size:19px;display:flex;justify-content:space-between;align-items:center;border-radius:calc(var(--r-window) - 3px) calc(var(--r-window) - 3px) 0 0;position:sticky;top:0;z-index:1}
.head button{background:none;border:0;font-size:26px;color:var(--highlight-fg);line-height:1;border-radius:var(--r-control)}
/* The window's head is a bright station colour: the ring there is ink, not accent. */
.head button:focus-visible{outline-color:var(--c-ink)}
.mbody{padding:18px 20px 22px}
.qn{color:var(--soft);font-size:15px;margin:0 0 8px}
.qn{display:flex;justify-content:space-between;gap:12px}.qmarks{font-weight:700;color:var(--fg,#e8eef8);white-space:nowrap;margin-left:auto}.qtot{color:var(--soft);font-size:14px;margin:-4px 0 10px}.pystage-head .qmarks{font-size:14px;align-self:center}
.q{font-size:22px;font-weight:600;margin:0 0 16px;line-height:1.35}
.opts{display:grid;gap:10px}
.opt{text-align:left;background:var(--bg2);color:var(--fg);border:2px solid var(--line);border-radius:var(--r-card);padding:14px 18px;font-size:18px;line-height:1.35}
.opt:hover:not(:disabled){border-color:var(--c)}
.opt:disabled{cursor:default}
.right{border-color:var(--ok)!important;background:var(--ok-soft)!important}
.wrong{border-color:var(--bad)!important;background:var(--bad-soft)!important}
.fb{margin-top:14px;padding:14px 18px;border-radius:var(--r-card);font-size:17px;line-height:1.45;display:none}
.fb.show{display:block}
.fb.ok{background:var(--ok-soft);border:1px solid var(--ok)}
.fb.no{background:var(--bad-soft);border:1px solid var(--bad)}
.fb strong{display:block;font-size:17px;margin-bottom:4px}
.mrow{display:flex;gap:10px;justify-content:flex-end;margin-top:14px;flex-wrap:wrap}
/* A list of things to sort or match. Past five of them one column is taller
   than a laptop screen, so they go two abreast where there is width for it. */
.items{display:grid;gap:0}
@media (min-width:880px){.items.many{grid-template-columns:1fr 1fr;column-gap:12px}}
.item{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;background:var(--bg2);border:2px solid var(--line);border-radius:var(--r-card);padding:10px 12px;margin-bottom:8px;font-size:15px}
.item.stack{grid-template-columns:1fr}
.seg{display:flex;gap:6px}
.seg button{background:var(--panel);color:var(--fg);border:2px solid var(--line);border-radius:var(--r-control);padding:8px 14px;font-size:15px}
.seg button[aria-pressed="true"]{border-color:var(--accent);color:var(--accent)}
.mbody select{width:100%;background:var(--field-bg);color:var(--fg);border:2px solid var(--line-strong);border-radius:var(--r-control);padding:9px;font-size:15px}
.fix{font-size:13px;color:var(--ok);margin-top:4px}
.big:not(.btn){font-size:52px;font-weight:800;color:var(--highlight-text);text-align:center;margin:4px 0}
.center{text-align:center}
.diag{width:100%;border-radius:var(--r-card);border:1px solid var(--line);margin:0 0 12px;display:block}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{background:var(--bg2);color:var(--fg);border:2px solid var(--line);border-radius:var(--r-pill);padding:10px 18px;font-size:17px}
.chip[aria-pressed="true"]{border-color:var(--accent);color:var(--accent)}
.olist{counter-reset:o;list-style:none;padding:0;margin:0 0 12px;display:grid;gap:8px}
.olist li{background:var(--bg2);border:2px solid var(--line);border-radius:var(--r-card);padding:10px 12px 10px 48px;position:relative;font-size:15px;min-height:44px}
.olist li::before{counter-increment:o;content:counter(o);position:absolute;left:12px;top:9px;width:26px;height:26px;border-radius:50%;background:var(--accent);color:var(--accent-fg);font-weight:700;text-align:center;line-height:26px}
.olist li.empty{border-style:dashed;color:var(--soft)}
.pool{display:grid;gap:8px}
/* Building an order: the slots on one side, the steps to drop in on the other */
.orderwrap{display:grid;gap:14px}
@media (min-width:880px){.orderwrap{grid-template-columns:1fr 1fr;column-gap:20px;align-items:start}
  .orderwrap .olist{margin-bottom:0}.orderwrap .qn{margin-top:0}}
table.bd{width:100%;border-collapse:collapse;font-size:15px;margin:8px 0}
table.bd td{padding:7px 8px;border-bottom:1px solid var(--line)}
table.bd td:last-child{text-align:right;white-space:nowrap}
.review-note{background:var(--c-amber-950);border:1px solid var(--highlight);border-radius:var(--r-card);padding:8px 12px;font-size:14px;margin-bottom:12px}

.crumb{display:inline-flex;align-items:center;gap:6px;color:var(--soft);text-decoration:none;font-size:14px;margin-bottom:6px}
.crumb:hover{color:var(--fg)}
.topics{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}
.topic{display:flex;flex-direction:column;gap:8px;background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);padding:16px 18px;color:var(--fg);text-decoration:none;min-height:170px}
a.topic:hover{border-color:var(--accent)}
.topic .code{font-weight:800;color:var(--accent);font-size:14px}
.topic h3{margin:0;font-size:17px}
.topic p{margin:0;color:var(--soft);font-size:14px;flex:1}
.topic.soon{opacity:.55}
.topic .meta{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:13px;color:var(--soft)}
h2.group{font-size:16px;color:var(--soft);font-weight:600;margin:26px 0 12px}

.tools button.vr{background:var(--accent);color:var(--accent-fg);border-color:var(--accent);font-weight:700}
.vrnote{display:flex;gap:10px;align-items:center;background:var(--c-amber-950);border:1px solid var(--highlight);border-radius:var(--r-card);padding:10px 14px;font-size:14px;margin-bottom:16px}
.vrnote[hidden]{display:none}

.exp .thumb.ws{background:linear-gradient(135deg,#1c2c4a,#2a2410);display:grid;place-items:center}
.exp .thumb.ws b{font-size:54px}

.box.wide{max-width:920px}

/* A diagram or a 3D model is the whole point of the window it opens in, so it
   gets the screen: the thing itself fills the left, and what you can do with it
   - the steps, or the parts - sits down the right. A diagram is scaled to fit
   its box, so a bigger box is bigger text: at the old 420px height a 14-unit
   caption landed at about 10px on screen. */
.box.huge{max-width:1680px;width:97vw;max-height:96vh;display:flex;flex-direction:column}
.box.huge .mbody{flex:1;min-height:0;padding:14px 16px 18px;overflow:auto;display:flex;flex-direction:column}
/* A four-option question does not want to be 1680px wide, so the content
   sits in a column; a board gets more room because it has more to show. */
.box.huge.plain{max-width:1040px}
/* A board is capped by height, so a 1680px frame around an 850px board is
   mostly margin. The frame follows the board instead. */
.box.huge.hasboard{max-width:1240px}
.taskwrap{max-width:880px;margin:0 auto}
.taskwrap.board{max-width:1320px}
.vwrap{display:flex;gap:16px;height:100%;min-height:0;flex:1 1 auto}
.vstage{flex:1 1 auto;min-width:0;background:#0e1628;border-radius:var(--r-card);border:1px solid var(--line);display:flex}
.vstage.model{background:radial-gradient(circle,#243656,#0e1628)}
.vhint{margin:0;font-size:14px;color:var(--soft);line-height:1.4}
.vstage canvas{flex:1;min-width:0}
.vside{flex:0 0 310px;display:flex;flex-direction:column;gap:12px;overflow:auto}
.vside h3{margin:0;font-size:15px;color:var(--soft);font-weight:700;letter-spacing:.02em}
.vnow{background:var(--raise);border:2px solid var(--c,#40c4ff);border-radius:var(--r-card);padding:14px 16px}
.vnow b{display:block;font-size:20px;margin-bottom:6px;color:var(--c,#40c4ff)}
.vnow span{font-size:17px;line-height:1.45;color:var(--fg)}
.vlist{display:flex;flex-direction:column;gap:6px}
.vlist button{text-align:left;background:var(--bg2);color:var(--fg);border:2px solid var(--line);border-radius:var(--r-card);padding:11px 14px;font-size:16px;font-weight:600}
.vlist button[aria-pressed=true]{border-color:var(--c,#40c4ff);background:var(--raise);color:var(--c,#40c4ff)}
.vrow{display:flex;gap:8px;flex-wrap:wrap}
.vrow .btn{font-size:16px;padding:calc(10px - var(--control-bw)) calc(16px - var(--control-bw))}
@media (max-width:900px){
  .vwrap{flex-direction:column}
  .vside{flex:0 0 auto}
  .vstage{min-height:46vh}
}
.lboard{margin:6px 0 4px}

.sprinthud{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:8px}.sprinthud span{background:var(--raise);border:1px solid var(--line);border-radius:var(--r-control);padding:6px 12px}.sprinthud b{color:var(--highlight-text);font-size:18px}
.box .score{font-size:64px;font-weight:800;color:var(--highlight-text);text-align:center;margin:8px 0}

footer.site{max-width:1100px;margin:40px auto 24px;padding:18px 20px;border-top:1px solid var(--line);color:var(--soft);font-size:13px;line-height:1.6}
footer.site p{margin:4px 0}
footer.site a{color:var(--link)}
.tguide{max-width:900px;margin:0 auto;padding:0 18px 40px}
.tguide h2{margin:28px 0 8px}
.tguide section{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);padding:18px 22px;margin-bottom:16px}
.tguide li{margin:6px 0}

/* ---- site navigation ---- */
.nav{position:relative;display:flex;align-items:center}
.nav ul{display:flex;gap:4px;list-style:none;margin:0;padding:0;flex-wrap:wrap}
.nav a{display:inline-block;padding:8px 12px;border-radius:var(--r-control);color:var(--soft);text-decoration:none;font-size:14px;font-weight:600;white-space:nowrap}
.nav a:hover{background:var(--raise);color:var(--fg)}
.nav a.on{color:var(--fg);background:var(--raise)}
.nav a.cta{background:var(--accent);color:var(--accent-fg)}
.nav a.cta:hover{background:var(--accent-hover);color:var(--accent-fg)}
.nav a.me{border:1px solid var(--line);color:var(--fg)}
.navbtn{display:none;background:var(--raise);color:var(--fg);border:1px solid var(--line);border-radius:var(--r-control);padding:8px 12px;font-size:18px;cursor:pointer}
@media (max-width:860px){
  .navbtn{display:block}
  .nav ul{display:none;position:absolute;right:0;top:46px;z-index:40;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);padding:8px;min-width:200px;box-shadow:var(--shadow-pop)}
  .nav ul.open{display:flex}
  .nav a{display:block;padding:10px 12px}
}
/* ---- information pages ---- */
.page{max-width:1000px;margin:0 auto;padding:0 18px 48px}
.hero{padding:44px 0 10px}
.hero h1{font-size:clamp(30px,5vw,46px);line-height:1.1;margin:0 0 12px}
.hero p.lead{font-size:clamp(16px,2.2vw,20px);color:var(--soft);max-width:62ch;line-height:1.6}
.hero .row{margin-top:22px;gap:10px;flex-wrap:wrap}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin:18px 0}
.cards .c{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);padding:18px 20px}
.cards .c h3{margin:0 0 8px;font-size:18px}
.cards .c p{margin:0;color:var(--soft);font-size:14px;line-height:1.6}
.cards .c .ico{font-size:26px;display:block;margin-bottom:6px}
.steps{counter-reset:s;list-style:none;padding:0;margin:14px 0}
.steps li{counter-increment:s;position:relative;padding:14px 16px 14px 62px;background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);margin-bottom:10px;line-height:1.6}
.steps li::before{content:counter(s);position:absolute;left:16px;top:14px;width:30px;height:30px;border-radius:50%;background:var(--accent);color:var(--accent-fg);font-weight:800;display:grid;place-items:center}
.faq details{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);padding:12px 16px;margin-bottom:10px}
.faq summary{cursor:pointer;font-weight:700}
.faq p{color:var(--soft);line-height:1.6}
.callout{border-left:4px solid var(--accent);background:var(--raise);border-radius:0 var(--r-card) var(--r-card) 0;padding:14px 18px;margin:18px 0;line-height:1.6}
.page h2{margin:34px 0 10px;font-size:24px}
.page p{line-height:1.7}
.page ul{line-height:1.7}
table.info{width:100%;border-collapse:collapse;margin:12px 0;font-size:14px}
table.info th,table.info td{border:1px solid var(--line);padding:10px 12px;text-align:left;vertical-align:top}
table.info th{background:var(--raise)}

header.top{position:relative}
header.top .nav{margin-left:auto}
header.top .nav ul{justify-content:flex-end}
@media (max-width:860px){header.top .nav ul{top:52px}}

.footnav{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:18px;margin:0 0 18px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.footnav h4{margin:0 0 8px;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--fg)}
.footnav ul{list-style:none;margin:0;padding:0}
.footnav li{margin:5px 0}
.footnav a{color:var(--soft);text-decoration:none;font-size:13px}
.footnav a:hover{color:var(--accent);text-decoration:underline}

/* ---- admin ---- */
.admin table{width:100%;border-collapse:collapse;font-size:14px;margin:10px 0}
.admin th,.admin td{border:1px solid var(--line);padding:8px 10px;text-align:left;vertical-align:top}
.admin th{background:var(--raise)}
.admin .new{color:var(--accent);font-weight:700}
.admin code.key{display:inline-block;background:var(--sunk);border:1px solid var(--line);border-radius:var(--r-control);font-family:var(--font-mono);padding:6px 10px;font-size:13px;word-break:break-all}

.rosterwrap{margin-top:34px;border-top:1px solid var(--line);padding-top:18px}
table.roster{width:100%;border-collapse:collapse;font-size:14px;margin:6px 0 16px}
table.roster th,table.roster td{border:1px solid var(--line);padding:7px 10px;text-align:left}
table.roster th{background:var(--raise)}
table.roster code{background:var(--sunk);border:1px solid var(--line);border-radius:var(--r-sm);font-family:var(--font-mono);padding:2px 8px;letter-spacing:2px}
textarea{width:100%;background:var(--field-bg);color:var(--fg);border:var(--control-bw) solid var(--line-strong);border-radius:var(--r-control);padding:10px;font:inherit}

/* ---- home page ---- */
.hero.home{padding:56px 0 18px;max-width:820px}
.eyebrow{color:var(--info);font-family:var(--font-mono);font-weight:600;letter-spacing:.075em;text-transform:uppercase;font-size:var(--fs-xs);margin:0 0 10px}
.hero.home h1{font-size:clamp(34px,6vw,60px);margin:0 0 16px}
.muted.small{font-size:13px;margin-top:14px}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin:26px 0 8px}
.stats div{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);padding:16px 18px;text-align:center}
.stats b{display:block;font-size:30px;color:var(--accent)}
.stats span{color:var(--soft);font-size:13px}
.cta{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card);padding:26px 28px;margin:34px 0 10px;text-align:center}
.cta h2{margin:0 0 8px}
.cta .row{justify-content:center;flex-wrap:wrap;gap:10px;margin-top:16px}



/* ---------- Python editor ---------- */
.pyed{display:flex;background:var(--sunk);border:2px solid var(--line);border-radius:var(--r-card);overflow:hidden;font-family:var(--font-mono)}
.pygut{flex:0 0 auto;padding:12px 10px 12px 14px;text-align:right;color:#4a5a78;background:#0a1120;
  font-size:15px;line-height:1.55;white-space:pre;overflow:hidden;user-select:none}
.pywrap{position:relative;flex:1;min-width:0}
.pyhl,.pysrc{margin:0;padding:12px 14px;font:inherit;font-size:15px;line-height:1.55;
  white-space:pre;overflow:auto;tab-size:4}
.pyhl{position:absolute;inset:0;pointer-events:none;color:var(--fg)}
.pysrc{position:relative;width:100%;height:100%;background:transparent;color:transparent;
  caret-color:var(--accent);border:0;resize:none;outline:none;display:block}
.pysrc:focus-visible{outline:none}
.pyed:focus-within{border-color:var(--accent)}
/* The token colours are in css/pytok.css, which experience.html loads after
 * this file. They are not repeated here: one table, read by the editor, the
 * instructions, the headset and the printed worksheets alike. */
.pyout{margin:0;background:#0a1120;border:2px solid var(--line);border-radius:var(--r-card);padding:12px 14px;
  font-family:var(--font-mono);font-size:15px;line-height:1.5;white-space:pre-wrap;
  color:var(--soft);min-height:76px;max-height:26vh;overflow:auto}
.pystage .pyout{flex:1 1 42%;min-height:96px;max-height:40vh;overflow:auto}
.pystage #pyed{flex:1 1 0;min-height:120px}
.pyout .err{color:#ff9a9a}
.pyout .muted{color:#4a5a78}
.pybar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0}
.pyfixed .pybar .btn{padding:calc(9px - var(--control-bw)) calc(14px - var(--control-bw));font-size:15px}
.pybar .grow{flex:1}
.pystate{font-size:14px;color:var(--soft)}
.pytests{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.pytest{display:flex;gap:10px;align-items:flex-start;background:var(--raise);border:2px solid var(--line);
  border-radius:var(--r-card);padding:10px 14px;font-size:15px}
.pytest.pass{border-color:var(--ok)}
.pytest.fail{border-color:var(--bad)}
.pytest b{flex:0 0 auto;font-family:var(--font-mono)}
.pytest .why{color:var(--soft)}
.pybrief{margin:0 0 12px;padding-left:22px}
.pybrief li{margin:3px 0;font-size:16px;line-height:1.4}
/* The worked example above the task: how the technique looks, on other data */
.pyteach{background:#122a3d;border-left:5px solid var(--info);border-radius:var(--r-control);
  padding:8px 12px;margin:0 0 10px}
.pyteach p{margin:0 0 5px;font-size:16px;line-height:1.4}
.pyeg{margin:5px 0;padding:7px 10px;background:var(--c-navy-950);border-radius:var(--r-control);text-align:left;
  font:14px/1.45 var(--font-mono);color:#cfe3ff;white-space:pre-wrap}
.pyegout{display:flex;gap:8px;align-items:baseline;margin:0;font-size:16px;color:var(--soft)}
.pyegout span{font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:var(--info)}
/* The editor's own bar, between the program and its output */
.pyidebar{display:flex;gap:10px;align-items:center;flex:0 0 auto;
  padding:8px 12px;background:#101c31;border:1px solid var(--line);border-radius:var(--r-card)}
.pyidebar .btn{padding:calc(8px - var(--control-bw)) calc(14px - var(--control-bw));font-size:15px}
.pyidebar .pystate{margin-left:4px}
.pykeys{margin-left:auto;font-size:13px;color:var(--soft)}
@media (max-width:1400px){.pykeys{display:none}}
/* A narrow laptop keeps two columns, with the reading side giving up the room:
   a cramped editor is worse than a cramped task. */
@media (max-width:1200px){.codewrap>.pyside{flex:1 1 44%}.codewrap>.pystage{flex:1 1 56%}
  .pysteps li,.pybrief li{font-size:16px}.pyeg{font-size:14px}}
/* A code question is half reading and half writing, so the window is half and
   half: a long task never squeezes the editor, a long program never hides the
   task. The left half scrolls what there is to read; the marking sits under it
   with room to be read; the right half is the editor, its Run bar, the output
   and the two buttons that end an attempt. */
.box.huge.codewin{height:96vh}
.box.huge.codewin .mbody{display:flex;flex-direction:row;gap:16px;overflow:hidden}
.codewrap{display:contents}
.codewrap>.pyside{flex:1 1 54%;min-width:0;min-height:0;max-height:100%}
.codewrap>.pystage{flex:1 1 46%;min-width:0;min-height:0;max-height:100%}
.pyside{display:flex;flex-direction:column;min-height:0;overflow:hidden;gap:10px}
/* The editor and the output share the right half. The output gets a real share
   of it rather than a strip at the bottom: on a short program the thing a pupil
   is looking for is what it displayed, not the empty space under their code. */
.pystage{display:flex;flex-direction:column;background:none;border:0;gap:10px;min-height:0}
/* The expected run sits in the editor column now, right above the output it
   is to be compared with. It takes its own height and the editor gives it. */
/* The expected run gives way first when the window is short: it is reference
   data, so a few lines of it behind a scrollbar is a far better trade than the
   Check button sliding off the bottom of a 720px screen. */
.pystage>.pyrun{flex:0 0 auto;margin:0;max-height:26%;overflow:auto}
/* A short screen - a 1366x768 classroom monitor, a 720p laptop - has barely
   two thirds the height these windows were laid out on. It gets back what
   spacing can give and nothing else: the type stays the size it is, because a
   task a pupil scrolls is a smaller problem than a task they cannot read, and
   this course is built for pupils with weak reading. */
@media (max-height:820px){
  .pysteps{gap:6px}
  .pybrief li{margin:2px 0}
  .pytask{padding:10px 12px;margin:0 0 8px}
  .pytaskhead{margin-bottom:6px}
  .pyteach{padding:7px 11px;margin:0 0 8px}
  .pystage-head,.pydots{margin-bottom:7px}
  .pyrun{padding:7px 11px;margin:0 0 8px}
  /* A program to read steps down one more notch here, as it already does for
     a long one. It is code in a fixed-width face, not prose. */
  .pyeg.big{font-size:15px}
  .pyeg.big.long{font-size:14px}
  .pyeg.big.tiny{font-size:13px}
}
@media (max-height:780px){
  .pystage>#pyed{min-height:104px}
  .pystage .pyout{min-height:72px}
  .pyidebar{padding:6px 10px}
  .pyidebar .btn{padding:calc(7px - var(--control-bw)) calc(12px - var(--control-bw));font-size:14px}
  .pystage>.pyrun{max-height:22%}
}
.pystage>#pyed{flex:1 1 58%;min-height:140px}
/* On the handful of the longest tasks there is still a little more to read than
   there is room for, so this column keeps a scrollbar that is always visible
   rather than one that appears on hover: a pupil must never be able to think
   they have read the whole task when they have not. */
.pyscroll{flex:1 1 0;min-height:0;overflow-y:scroll;padding-right:8px;
  scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.pyscroll::-webkit-scrollbar{width:10px}
.pyscroll::-webkit-scrollbar-thumb{background:var(--line);border-radius:6px}
.pyscroll::-webkit-scrollbar-track{background:transparent}
.pyresult{flex:0 0 auto;max-height:56%;display:flex;flex-direction:column;gap:8px;
  padding-top:10px;border-top:2px solid var(--line)}
.pyresult .pytests{flex:1 1 auto;min-height:0;overflow:auto;margin-top:0}
/* The buttons that end an attempt, bottom right under the output */
.pyact{flex:0 0 auto;display:flex;gap:10px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
/* The row that ends an attempt holds Hint, Check and, once it is marked, the way
   on. They are one row of buttons and have to read as one: the general .mrow
   carries a top margin for the windows where it sits under the answer, and
   inside this row that margin pushed Next question several pixels below the two
   beside it. */
.pyact .mrow{display:flex;gap:10px;margin-top:0;align-items:center}
/* The task, boxed and stepped */
.pytask{border:2px solid var(--line);border-radius:var(--r-card);background:var(--raise);padding:12px 14px;margin:0 0 10px}
.pytaskhead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.pytaskhead h3{margin:0;font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent)}
.pysteps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.pysteps li{display:flex;gap:10px;align-items:flex-start;font-size:17px;line-height:1.45}
.stepn{flex:0 0 28px;height:28px;border-radius:50%;background:var(--accent);color:var(--accent-fg);
  font:700 15px/28px var(--font-sans);text-align:center}
.pytask .pybrief{margin:10px 0 0;padding-left:20px;border-top:1px solid var(--line);padding-top:8px}
/* Where you are in this station */
.pydots{list-style:none;display:flex;gap:7px;flex-wrap:wrap;margin:0 0 9px;padding:0}
.pydots li{width:27px;height:27px;border-radius:50%;border:2px solid var(--line);color:var(--soft);
  font:700 13px/23px var(--font-sans);text-align:center;background:#101c31}
.pydots li.done{border-color:var(--ok);color:var(--ok)}
.pydots li.now{border-color:var(--accent);background:var(--accent);color:var(--accent-fg)}
/* Which stage of the release this activity is, said in words. The labels name
   the action - Try it, Predict, Change it - and never how able the pupil is. */
.pystage-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 9px}
.pychip{flex:0 0 auto;padding:5px 13px;border-radius:var(--r-pill);font:700 14px/1.2 var(--font-sans);
  letter-spacing:.03em;background:#1b2b4a;border:2px solid var(--highlight);color:var(--highlight-text)}
.pychip.try,.pychip.predict{border-color:var(--info);color:#8fd4ff}
.pychip.change,.pychip.complete{border-color:#b89aff;color:#cdb8ff}
.pychip.debug{border-color:#ffb36b;color:#ffc48c}
.pychip.opt{border-color:var(--ok);color:var(--ok)}
.pywhere{flex:0 0 auto;font-size:15px;font-weight:600;color:var(--soft)}
.pysays{flex:1 1 220px;min-width:0;font-size:15px;line-height:1.4;color:var(--soft)}
/* The worked example, line by line, folded away until it is wanted */
.pylines{margin:8px 0 0;font-size:15px}
.pylines summary{cursor:pointer;color:var(--info);padding:4px 0;font-weight:600}
.pylines summary:focus-visible{outline:var(--focus-w) solid var(--focus);outline-offset:var(--focus-offset)}
.pylines ol{margin:8px 0 0;padding-left:26px}
.pylines li{margin:6px 0;line-height:1.45}
.pylines li code{display:block;font:15px/1.5 var(--font-mono)}
.pylines li span{color:var(--soft)}
/* The output, named so a pupil never has to guess what a console is */
.pyouth{flex:0 0 auto;margin:0;font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent)}
/* Below a laptop there is not enough width for two columns, so the window stops
   being a fixed-height pane and becomes one scrolling page: the task, then the
   editor, then the output, then the buttons - the same order as across, only
   down. Both halves have to give up max-height here, or in a column each one is
   allowed the full height of the window and they overlap. */
@media (max-width:980px){
  .box.huge.codewin{height:auto;max-height:96vh}
  .box.huge.codewin .mbody{flex-direction:column;overflow:auto}
  .codewrap>.pyside,.codewrap>.pystage{flex:0 0 auto;max-height:none}
  .pyside{overflow:visible}.pyscroll{overflow:visible;flex:0 0 auto}
  .pyresult{max-height:none}.pyresult .pytests{overflow:visible}
  .pystage{min-height:0}
  .pystage>#pyed{flex:0 0 auto;min-height:34vh}
  .pystage .pyout{flex:0 0 auto;max-height:none;min-height:110px}
  .pyact{justify-content:flex-start}
}
/* Tablet and phone. The window gives up the fixed height and simply scrolls as
   one page: the task, then the editor, then the output, then the buttons - the
   same order as on a desktop, stacked. The editor keeps a usable height rather
   than collapsing to a few lines, and every control stays a 44px target. */
@media (max-width:820px){
  .box.huge.codewin .mbody{gap:14px}
  .pysteps li{font-size:17px}
  .pyidebar{flex-wrap:wrap}
  .pyact .btn,.pyidebar .btn{min-height:44px}
}
@media (max-width:520px){
  .box.huge.codewin{max-height:100vh}
  .pystage>#pyed{min-height:30vh}
  .pyact{flex-direction:column;align-items:stretch}
  .pyact .btn,.pyact .mrow .btn{width:100%}
  .pyact .mrow{flex-direction:column}
  .pystage-head{gap:8px}
  .pysays{flex-basis:100%}
  .pytask{padding:12px}
  .pydots li{width:34px;height:34px;line-height:30px}
}
/* One real run of the program: what is typed in, and what must be printed */
.pyrun{border:2px solid var(--line);border-radius:var(--r-card);padding:8px 12px;margin:0 0 10px;background:#101c31}
.pyrunh{margin:0 0 6px;font-size:13px;letter-spacing:.07em;text-transform:uppercase;color:var(--accent)}
.pyrunrow{display:flex;gap:12px;align-items:flex-start;margin:3px 0}
.pyrunrow span{flex:0 0 104px;font-size:13px;text-transform:uppercase;letter-spacing:.05em;color:var(--soft);padding-top:3px}
.pyrunrow code{flex:1;white-space:pre-wrap;font:15px/1.45 var(--font-mono);color:#cfe3ff}
/* What the user types and what the program displays are the two things pupils
   confuse most, so they do not merely sit in different rows - they are a
   different colour, a different weight and labelled in full words. */
.pyrunrow.in code{color:#ffd98a}
.pyrunrow.out code{color:var(--ok);font-weight:600}
.pyrunrow span{font-weight:600}
/* The syntax reference, looked up while working */
.refpane .reflist{flex:1;min-height:0;overflow:auto;padding-right:6px}
.reflist section{margin:0 0 18px}
.reflist h3{margin:0 0 8px;font-size:15px;letter-spacing:.06em;text-transform:uppercase;color:var(--accent)}
.refit{border-left:3px solid var(--line);padding:0 0 0 12px;margin:0 0 12px}
.refit code{display:inline-block;font:17px/1.5 var(--font-mono)}
.refit p{margin:2px 0 4px;font-size:16px;line-height:1.45}
@media (min-width:1100px){.reflist{column-count:2;column-gap:28px}.reflist section{break-inside:avoid}}
/* The line under the buttons that says where the pupil is up to across attempts */
.pytry{margin:0 0 8px;font-size:15px;color:var(--soft);min-height:1.2em}
/* After two failed checks the Hint button asks to be noticed, once */
@keyframes hintpulse{0%,100%{box-shadow:0 0 0 0 rgba(255,208,70,0)}50%{box-shadow:0 0 0 6px rgba(255,208,70,.28)}}
.btn.nudge{border-color:var(--highlight);color:var(--highlight-text);animation:hintpulse 1.6s ease-in-out 3}
@media (prefers-reduced-motion:reduce){.btn.nudge{animation:none}}
/* The hint sits over the code window, so the program is still there behind it */
.hintpane{position:absolute;inset:0;z-index:5;background:var(--c-navy-950);border-radius:inherit;
  display:flex;flex-direction:column;padding:18px 20px 20px;gap:12px;overflow:auto}
.hinthead{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
.hinthead b{font-size:20px;color:var(--highlight-text)}
.hinthead span{flex:1;min-width:200px;font-size:15px;color:var(--soft)}
.hintpane .vwrap{flex:1;min-height:0}
/* The hint ladder: one rung at a time, each asked for */
.hintladder{flex:1 1 auto;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:14px;padding-right:6px}
.hrung{border-left:4px solid var(--info);padding:0 0 0 14px}
.hrung h4{margin:0 0 6px;font-size:14px;letter-spacing:.06em;text-transform:uppercase;color:var(--accent)}
.hrung .hsay{margin:0;font-size:18px;line-height:1.5}
.hwalk{margin:0;padding-left:24px}
.hwalk li{margin:6px 0;font-size:17px;line-height:1.5}
/* The animated rung needs a real height of its own. It sits inside a rung of a
   scrolling ladder rather than filling the pane as the old single-panel hint
   did, so height:100% would resolve against an auto-height parent and the
   canvas would come out at nothing. */
.hintpane .hintdiag{flex:0 0 auto;height:clamp(260px,44vh,440px)}
.hintfoot{flex:0 0 auto;display:flex;gap:14px;align-items:center;flex-wrap:wrap;
  padding-top:12px;border-top:2px solid var(--line)}
@media (max-width:520px){.hintfoot .btn{width:100%}.hintdiag{min-height:240px}}
/* Reading a program before writing one. The program is on the left and the
   answers on the right, because a pupil deciding between three multi-line
   outputs has to be able to look from one to the other without scrolling. */
.box.huge.predwin{max-width:1180px}
.predwrap{display:flex;flex-direction:row;gap:20px;align-items:stretch}
.predwrap>.predside,.predwrap>.predask{flex:1 1 50%;min-width:0;min-height:0;overflow:auto}
.predask{display:flex;flex-direction:column}
.predask .q{margin-top:0}
.predask .opts{flex:0 0 auto}
@media (max-width:860px){
  .box.huge.predwin{max-height:94vh}
  .predwrap{flex-direction:column;gap:14px}
  .predwrap>.predside,.predwrap>.predask{flex:0 0 auto;overflow:visible}
}
/* A program to read is set at a comfortable size, and steps down rather than
   scrolling when there is a lot of it: a pupil comparing three outputs against
   twenty lines of code needs all twenty on the screen at once. */
.pyeg.big{font-size:17px;padding:14px 16px;margin:0 0 14px}
.pyeg.big.long{font-size:15px;line-height:1.45}
.pyeg.big.tiny{font-size:14px;line-height:1.4;padding:12px 14px}
.opt.mono{font-family:var(--font-mono);white-space:pre-wrap;text-align:left}
.fb .predans{display:block;margin:6px 0;font:17px/1.5 var(--font-mono);color:var(--ok);white-space:pre-wrap}
.fb.done strong{color:var(--ok)}
/* On a phone the example run stacks: a label row of its own, then the values.
   This has to sit after the rules it overrides - the label's width is a flex
   basis, which becomes a height the moment the row turns into a column, and
   a stray 104px of nothing opened up between every label and its values. */
@media (max-width:520px){
  .pyrunrow{flex-direction:column;gap:2px}
  .pyrunrow span,.pyrunrow code{flex:0 0 auto}
  .pyegout{flex-direction:column;gap:2px}
}

/* The two unit downloads on the teacher dashboard, and the single documents
 * behind them. These are teacher materials: they are on this page and nowhere a
 * pupil goes. */
.packs{margin-top:22px}
.packsay{background:var(--panel);border:2px solid var(--line);border-radius:var(--r-card);
  padding:10px 14px;margin:0 0 14px;font-size:15px}
.packgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}
.packcard{background:var(--panel);border:2px solid var(--line);border-radius:var(--r-card);padding:16px}
.packcard h3{margin:0 0 6px;font-size:18px}
.packcard p{margin:0 0 12px;color:var(--soft);font-size:15px}
.packlist{margin-top:14px}
.packlist summary{cursor:pointer;color:var(--info);font-weight:600;padding:6px 0}
.packdocs{list-style:none;margin:8px 0 0;padding:0;columns:2;column-gap:20px}
.packdocs li{margin:0 0 6px;break-inside:avoid}
.packdocs a{color:var(--fg)}
.packnote{font-size:14px;margin-top:10px}
@media (max-width:640px){.packdocs{columns:1}}

/* ---- built for learning ------------------------------------------------ */
.built-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px;margin-top:18px}
.built-grid article{background:var(--panel);border:2px solid var(--line);border-radius:var(--r-card);padding:16px 18px}
.built-grid h3{margin:0 0 6px;font-size:18px;color:var(--accent)}
.built-grid p{margin:0;color:var(--soft);font-size:15px;line-height:1.55}

.teacher-actions{display:grid;gap:10px;align-content:start;justify-items:start;min-width:230px}
.teacher-actions .btn{white-space:nowrap}



/* ---------------- Explain ----------------
   The teaching behind a slab: the visual on the left, the step on the right, the
   pupil's own pace. Sized so a step fits without scrolling on a laptop; a long
   step scrolls inside its own column rather than the window. */
.box.huge.explain{max-width:1500px;height:min(860px,96vh)}
.box.huge.explain .mbody{overflow:hidden}
.xwrap{gap:18px}
.xwrap .xload{margin:auto;color:var(--soft);font-size:18px}
.xstage{flex:1 1 58%;flex-direction:column;position:relative;overflow:hidden}
.xstage .xvis{flex:1 1 auto;min-height:0;display:flex}
.xstage .xvis canvas{flex:1;min-width:0}
.xcap{flex:0 0 auto;padding:10px 14px;border-top:1px solid var(--line);font-size:15px;line-height:1.45;color:var(--soft);display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.xcap b{color:var(--info)}
.xvnav{margin-left:auto;display:inline-flex;gap:6px}
.xvnav .btn{min-width:40px;min-height:36px}
.xstage.xexwrap{overflow:auto;align-items:stretch}
.xexample{margin:auto;padding:26px 30px;max-width:640px;width:100%;box-sizing:border-box}
.xexample .xextitle{display:block;color:var(--highlight-text);font-size:15px;letter-spacing:.06em;text-transform:uppercase;margin-bottom:10px}
.xexample .xsetup{font-size:18px;margin:0 0 12px}
.xexample ol{margin:0 0 14px;padding-left:26px;font-size:18px;line-height:1.5}
.xexample li{margin:0 0 8px}
.xexample .xanswer{font-size:19px;background:var(--raise);border:2px solid var(--ok);border-radius:var(--r-card);padding:10px 14px;margin:0 0 10px}
.xexample .xanswer b{color:var(--ok);margin-right:6px}
.xexample .xmistake{font-size:16px;color:var(--soft);border-left:4px solid var(--bad);padding-left:12px;margin:0}
.xexample .xmistake b{color:var(--bad);margin-right:6px}
.xside{flex:0 0 440px;gap:10px;overflow:hidden}
.xmeta{display:flex;justify-content:space-between;gap:10px;font-size:14px;color:var(--soft);font-weight:600}
.xdots{display:flex;gap:6px;margin:0;padding:0;list-style:none}
.xdots li{flex:1;height:6px;border-radius:3px;background:var(--line)}
.xdots li.done{background:var(--c-navy-400)}.xdots li.on{background:var(--accent)}
.xstep{flex:1 1 auto;min-height:0;overflow:auto;padding-right:4px}
.xstep h3{margin:2px 0 10px;font-size:23px;line-height:1.3;color:var(--fg)}
.xstep h3:focus{outline:none}
.xstep p{margin:0 0 10px;font-size:17.5px;line-height:1.55}
.xstep ul{margin:0 0 10px;padding-left:22px;font-size:17px;line-height:1.5}
.xstep li{margin:0 0 6px}
.xstep .xchain{list-style:none;margin:2px 0 8px;padding:0;font-size:16.5px;line-height:1.35}
.xstep .xchain li{position:relative;margin:0 0 17px;padding:6px 12px;border:1.6px solid var(--line);border-left:5px solid var(--highlight);border-radius:var(--r-control);background:rgba(255,255,255,.04)}
.xstep .xchain li:last-child{margin-bottom:0}
.xstep .xchain li + li::before{content:"\2193";position:absolute;left:16px;top:-17px;font-size:15px;line-height:1;color:var(--highlight-text);font-weight:800}
.xkind{margin:0 0 4px !important;font-size:13px !important;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--info)}
.xkind.mixup{color:var(--bad)}.xkind.check{color:var(--ok)}.xkind.example{color:var(--highlight-text)}
.xmix{border-left:4px solid var(--bad);background:#2a1a24;border-radius:0 var(--r-card) var(--r-card) 0;padding:10px 14px 2px}
.xcheck .xq{font-weight:700;font-size:18px}
.xopts{display:grid;gap:8px;margin:0 0 10px}
.xopt{text-align:left;background:var(--bg2);color:var(--fg);border:2px solid var(--line);border-radius:var(--r-card);padding:11px 14px;font-size:16.5px;line-height:1.35;min-height:44px}
.xopt:hover:not(:disabled){border-color:var(--accent)}
.xopt.right{border-color:var(--ok);background:var(--ok-soft)}.xopt.wrong{border-color:var(--bad);background:var(--bad-soft)}
.xopt:disabled{opacity:1;cursor:default}
.xfb .ok b{color:var(--ok)}.xfb .no b{color:var(--bad)}
.xaudio{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:14px;background:var(--raise);border:1px solid var(--line);border-radius:var(--r-card);padding:8px 10px}
.xaudio .xatitle{font-weight:700;color:var(--soft);margin-right:auto}
.xaudio .xtrans{flex-basis:100%;font-size:14px}
.xaudio[hidden]{display:none}
.xside [hidden]{display:none !important}
.xnav .btn{flex:1;min-height:44px}
.xend{justify-content:space-between}
.xend .btn{min-height:44px}
.xwrap.textonly .xstage{display:none}
.xwrap.textonly .xside{flex:1 1 auto;max-width:760px;margin:0 auto}
.drawer.remediate{border-color:var(--highlight)}
.drawer.remediate h2{color:var(--highlight-text)}
@media (max-width:900px){
  .box.huge.explain{height:96vh}
  .xside{flex:1 1 auto;min-height:0}
  .xstage{flex:0 0 40vh;min-height:0}
  /* a long part caption scrolls rather than squeezing the picture */
  .xstage .xvis{min-height:150px}
  .xcap{flex:0 1 auto;min-height:0;overflow:auto;padding:8px 12px;font-size:14px}
}

/* A knowledge check moving on by itself (js/quizflow.js): the Next button fills
 * from left to right over the wait, so a pupil can see how long they have.
 * With reduced motion asked for it does not animate; the wait is the same. */
.btn.autonext{position:relative;overflow:hidden}
.btn.autonext::after{content:"";position:absolute;left:0;bottom:0;height:4px;width:100%;background:currentColor;opacity:.55;transform-origin:left;animation:autonext var(--wait,3000ms) linear forwards}
@keyframes autonext{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media (prefers-reduced-motion: reduce){.btn.autonext::after{animation:none;transform:scaleX(1);opacity:.25}}
.drawer ul.cornerkey{margin:6px 0 0 18px;padding:0}
.drawer ul.cornerkey li{margin-top:4px}

/* Key words: recall, then the definition, then a rating (js/keywords.js).
   Used in the room's drawer and on keywords.html. */
.drawer.kw{width:min(420px,calc(100vw - 20px))}
.kwcheck,.kwlist{display:flex;flex-direction:column;gap:10px}
.kwkicker{margin:0;font:600 12px/1.2 var(--mono, monospace);letter-spacing:.08em;text-transform:uppercase;color:var(--soft)}
.kwterm{margin:0 30px 0 0;font-size:26px;line-height:1.15;color:var(--fg)}
.drawer .kwterm{color:var(--fg)}
.kwprev{font-size:13px;color:var(--soft)}
.kwask{font-size:15px;font-weight:600;color:var(--fg)}
.kwcheck textarea{width:100%;min-height:76px;resize:vertical;background:var(--field-bg);color:var(--fg);border:var(--control-bw) solid var(--line-strong);border-radius:var(--r-control);padding:10px 12px;font:inherit;font-size:15px}
.kwcheck textarea:focus{border-color:var(--accent);outline:none}
.kwcheck input[type=text]{width:100%;background:var(--field-bg);color:var(--fg);border:var(--control-bw) solid var(--line-strong);border-radius:var(--r-control);padding:10px 12px;font:inherit;font-size:16px}
.kwcheck input[type=text]:focus{border-color:var(--accent);outline:none}
.kwcheck input[type=text]:disabled{opacity:.8}
.kwmine,.kwdef,.kwctx{border-left:4px solid var(--line-strong);padding:4px 0 4px 12px}
.kwdef{border-left-color:var(--accent)}
.kwctx{border-left-color:var(--highlight)}
.kwmine b,.kwdef b,.kwctx b{display:block;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--soft);margin-bottom:2px}
.kwdef p{font-size:16px;line-height:1.45}
.kwmine p,.kwctx p{font-size:15px;line-height:1.45}
.kwrate{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.kwrate .kwr{display:flex;flex-direction:column;align-items:center;gap:2px;padding:10px 6px;text-align:center;min-height:56px}
.kwrate .kwr span{font-size:12px;font-weight:400;color:var(--soft)}
.kwrate .kwr.on{border-color:var(--accent);background:var(--ghost-hover)}
.kwrate .kw-got.on{border-color:#2fae72}.kwrate .kw-partly.on{border-color:#e0a020}.kwrate .kw-not.on{border-color:#e05050}
.kwsaved{font-size:14px;color:var(--soft)}
.kwafter{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.kwafter .kwsaved,.kwafter .kwctx{flex-basis:100%}
.kwintro{font-size:14px;color:var(--soft)}
.kwlist ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.kwitem{display:flex;justify-content:space-between;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px 12px;background:var(--bg2, transparent);color:var(--fg);border:1px solid var(--line-strong);border-radius:var(--r-control);font:inherit;font-size:15px;text-align:left;cursor:pointer}
.kwitem:hover,.kwitem:focus-visible{border-color:var(--accent)}
.kwbadge{font-size:12px;padding:2px 8px;border-radius:999px;border:1px solid var(--line-strong);color:var(--soft);white-space:nowrap}
.kwbadge.kw-got{border-color:#2fae72;color:#7fdcae}
.kwbadge.kw-partly{border-color:#e0a020;color:#f0c870}
.kwbadge.kw-not{border-color:#e05050;color:#f39a9a}
.drawer h2.kwterm{font-size:26px;color:var(--fg);margin-right:30px}
.drawer .kwlist h2{font-size:18px}
.kwrate .kwr.on:disabled{opacity:1}
/* a written answer on a slab's CHECK (js/writeq.js) */
.wcmd{color:var(--soft);font-size:14px;margin:-4px 0 10px}
#wsw{margin:0 0 10px}
.wbox{display:block;margin:0 0 10px}
.wprompt{display:block;font-weight:600;font-size:14px;margin:0 0 4px;color:var(--fg,#e8eef8)}
.wta{width:100%;box-sizing:border-box;min-height:64px;resize:vertical;border-radius:10px;border:1px solid var(--line,#3c5a87);background:rgba(8,14,28,.55);color:var(--fg,#f0f4fa);font:16px/1.45 inherit;padding:10px 12px}
.wta:focus{outline:2px solid var(--focus,#7ab4ff);outline-offset:1px}
.wta[readonly]{opacity:.85}
#wone{min-height:130px}
.wmodel{margin-top:10px;padding-top:10px;border-top:1px solid rgba(255,255,255,.15)}
.wmodel ol{margin:6px 0 6px 18px;padding:0}.wmodel li{margin:0 0 6px}.wmodel .wprompt{display:inline;font-size:13px;color:var(--soft)}
.tnote{border:1px solid #6fb4ff;background:rgba(60,120,220,.16);border-radius:10px;padding:10px 12px;margin:0 0 12px}
.tnote p{margin:4px 0}.tnote-h{font-weight:700}
.tnew{background:#ffd046;color:#152033;border:0;border-radius:999px;padding:4px 10px;font:600 13px/1.3 inherit;cursor:pointer;margin-top:4px}
/* the teacher's written answers list (js/teacher.js) */
.witem{margin:10px 0}.witem p{margin:4px 0}.wq{font-weight:600}
.wans{background:rgba(120,135,160,.14);border-radius:8px;padding:8px 10px 8px 28px;margin:6px 0;white-space:pre-wrap}
p.wans{padding-left:10px}
.wans .wprompt{display:block;font-size:12px;color:var(--soft);font-weight:600}
.flag{display:inline-block;font-size:12px;border-radius:999px;padding:2px 8px;margin:2px 4px 2px 0;font-weight:600}
.flag.scaf{background:#3c5a87;color:#f0f4fa}.flag.unsure{background:#ffd046;color:#152033}
.wset{gap:16px;align-items:center;margin:6px 0}.wset input{width:64px;margin-left:6px}
.wcl{display:block;font-size:14px;margin:6px 0}.wcl textarea{display:block;width:100%;box-sizing:border-box;margin-top:4px}
.wscheme summary{cursor:pointer;color:var(--soft);font-size:14px}

/* Student preview (portal Stage F): a teacher in a lesson, nothing saved */
body.player .preview-band { position:fixed;left:12px;top:12px;z-index:60;background:var(--amber,#ffd046);color:#152033;font:700 14px/1.3 var(--font-ui,inherit);padding:8px 16px;border-radius:14px;display:flex;gap:12px;align-items:center;box-shadow:0 4px 18px rgba(0,0,0,.35);max-width:min(360px,calc(100vw - 24px));flex-wrap:wrap;justify-content:flex-start; }
body.player .preview-band a { color:#152033!important;text-decoration:underline; }

/* ---------------- Key facts ----------------
   A slab's key facts, large: what "Show facts" on the slab's Check stage opens
   (js/player.js openFacts). One readable column, a numbered fact a line, the key
   term in bold. */
.factswin{padding:6px 6px 0}
.flist{list-style:none;counter-reset:f;margin:6px 0 18px;padding:0;display:grid;gap:14px}
.flist li{counter-increment:f;position:relative;padding:14px 18px 14px 66px;background:var(--raise);border:2px solid var(--line);border-radius:var(--r-card);font-size:24px;line-height:1.45}
.flist li::before{content:counter(f);position:absolute;left:16px;top:13px;width:36px;height:36px;border-radius:50%;background:var(--c,var(--accent));color:#0e1628;font-weight:800;font-size:20px;display:flex;align-items:center;justify-content:center}
.flist li b{color:var(--info)}
.fstem{font-size:19px;color:var(--soft);margin:0 0 4px}
.fstem b{color:var(--fg)}
.factswin .mrow .btn{min-height:48px;font-size:17px}
@media (max-width:640px){.flist li{font-size:19px;padding:12px 14px 12px 56px}.flist li::before{left:12px;width:32px;height:32px;font-size:17px}}

/* ---------------- Explain, as a video ----------------
   An explainer made into a video (video/index.json): the video as large as the
   window allows at 16:9, and under it the way to the stepped explainer and back
   to the slab. */
.xwrap.xvidwrap{flex-direction:column;gap:12px;align-items:stretch}
.xvid{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;background:#0b1322;border-radius:var(--r-card);overflow:hidden}
.xvid video{display:block;width:100%;height:100%;max-height:100%;object-fit:contain;background:#0b1322}
.xvid video:focus-visible{outline:3px solid var(--accent);outline-offset:-3px}
.xvidrow{display:flex;gap:10px;justify-content:flex-end;flex:0 0 auto}
.xvidrow .btn{min-height:48px}
