/* Course player, "Margin" design.
   The interface is greys only. Colour appears only where it carries meaning:
   right answers (sage, with an ink edge) and premium colours in content. Wrong answers stay grey,
   struck through, with an icon and words: colour is never the only signal.
   Fonts: Source Serif, Source Sans, and Share Tech Mono, SIL Open Font License 1.1, self-hosted in fonts/. */

@font-face { font-family: "Source Serif"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/SourceSerifPro-Regular.woff2) format("woff2"); }
@font-face { font-family: "Source Serif"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/SourceSerifPro-Semibold.woff2) format("woff2"); }
@font-face { font-family: "Source Serif"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/SourceSerifPro-RegularIt.woff2) format("woff2"); }
@font-face { font-family: "Source Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/SourceSansPro-Regular.woff2) format("woff2"); }
@font-face { font-family: "Source Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/SourceSansPro-Semibold.woff2) format("woff2"); }
@font-face { font-family: "Share Tech Mono"; font-weight: 400; font-style: normal; font-display: optional; src: url(fonts/ShareTechMono-Regular.woff2) format("woff2"); }

:root {
  /* greys */
  --ground: #ECEDEE;    /* page and sidebar */
  --night: #1E1F21;     /* the page before the course */
  --night-text: #ECEDEE;
  --sheet: #FFFFFF;     /* lesson sheet, password card, dialog */
  --quiet: #F1F2F3;     /* tiles: options, zones, key idea, secondary pill */
  --quiet-2: #E4E5E7;   /* hover, selected fill, progress track */
  --line: #DFE0E2;
  --outline: #7C7E83;   /* control outlines that must be seen (3:1) */
  --text: #303236;
  --text-2: #5F6166;
  --action: #4A4D52;    /* primary pill, selection, progress, switch thumb */
  --action-2: #35373B;
  --video: #222326;
  /* meaning */
  --ok: #6F8A77; --ok-bg: #F1F5F2;   /* gentle sage: tick dot and wash of a right answer (never text: words stay ink) */
  --ok-edge: #4A4D52;                 /* graphite edge around a right answer: reads without colour */
  --bad: #A2A5AA; --bad-text: #6B6E73; --bad-bg: var(--quiet); /* a wrong answer is pale grey, never a colour; its words stay dark enough to read */
  /* type */
  --serif: "Source Serif", Georgia, "Times New Roman", serif;
  --ui: "Source Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --term: "Share Tech Mono", "Courier New", Courier, monospace; /* the lock screen: the line and the prompt */
  /* grid and shape */
  --gutter: 0px; --measure: 660px;
  --r-s: 14px; --r: 22px; --r-l: 32px; --btn-h: 50px;
  --shadow: 0 1px 2px rgba(34,36,40,.04), 0 12px 32px rgba(34,36,40,.06);
  --shadow-2: 0 2px 4px rgba(34,36,40,.05), 0 24px 56px rgba(34,36,40,.12);
  --t: 240ms; --ease: cubic-bezier(.25,.1,.25,1);
  --ease-out: cubic-bezier(.22,.61,.36,1); /* things that appear: quick start, soft landing */
  --ico-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%235F6166' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E");
  --ico-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.3 5 8.8 9.6 3.6'/%3E%3C/svg%3E");
  --ico-bad: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m3.2 3.2 5.6 5.6m0-5.6-5.6 5.6'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #1E1F21; -webkit-text-size-adjust: 100%; scroll-padding-bottom: 96px; } /* night from the first pixel; the course sheet covers it */
a { color: var(--text); }
::selection { background: #C9CBCF; color: var(--text); }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 16px/1.5 var(--ui); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: rgba(48,50,54,.12); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
/* no double-tap zoom or tap delay on controls (iOS Safari); text fields stay at 16 px or more so Safari never zooms in on focus */
button, label.option, summary, .zone { touch-action: manipulation; }
.lock-card input, .textin, .comment-dialog input, .comment-dialog textarea { -webkit-appearance: none; appearance: none; }
button:disabled { cursor: default; opacity: .45; }
b, strong { font-weight: 600; }
/* a very long word (or title) breaks instead of pushing the page wider */
.lesson, .nav, .comment-dialog { overflow-wrap: break-word; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* == pills == */
.btn, .lock-card button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 0 28px;
  border: 0; border-radius: 999px; background: var(--action); color: #fff; font: 600 16.5px/1.15 var(--ui); text-align: center;
  transition: background var(--t) var(--ease), transform var(--t) var(--ease);
}
.btn:hover, .lock-card button[type="submit"]:hover { background: var(--action-2); }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled:hover { background: var(--action); }
/* secondary pill: Cancel, Previous, Start over, Retry, Place here */
.btn.ghost, button.option { background: var(--quiet); color: var(--text); }
.btn.ghost:hover, button.option:hover { background: var(--quiet-2); }
button.option {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  border: 0; border-radius: 999px; font: 600 15.5px/1.2 var(--ui); transition: background var(--t) var(--ease);
}
button.option:disabled:hover { background: var(--quiet); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* == language: one quiet word, the name of the other language == */
.lang-switch { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font: 500 15px/1 var(--ui); color: var(--text-2); cursor: pointer; transition: color var(--t) var(--ease), background var(--t) var(--ease); }
.lang-switch:hover { color: var(--text); background: var(--quiet-2); }
.lang-switch:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* == password screen: night, the logo, one line; no words == */
.resuming #lock { visibility: hidden; } /* reload while unlocked: the course comes back without showing this screen */
.lock { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 72px 16px; background: var(--night); }
.lock-card { position: relative; width: min(360px, 100%); text-align: center; } /* the message sits out of the flow: pressing Enter moves nothing */
.lock-top { display: none; } /* the language can be changed inside the course */
.lock-card .logo { position: relative; display: block; width: 144px; height: 144px; margin: 0 auto 32px; }
.lock-card .logo .logo-tri,
.lock-card .logo .slip img { display: block; width: 100%; height: 100%; }
.lock-card .logo .slip { position: absolute; inset: 0; display: block; overflow: hidden; pointer-events: none; }
.lock-card .logo .slip img { position: absolute; inset: 0; }
.lock-card .logo .retrace { position: absolute; left: -4px; right: -4px; height: 1px; z-index: 1; pointer-events: none; background: #ECEDEE; }
.lock-card .orb { position: absolute; left: 39%; top: 49.4%; width: 22%; height: 22%; z-index: 2; pointer-events: none; } /* disc still at cx 50, cy 60.4, r 5.5; the spare room is a small red glow */
.lock-card h1, .lock-card label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* named for screen readers */
.pw-line { position: relative; display: block; width: 240px; max-width: 100%; margin: 0 auto; }
.lock-card input {
  display: block; width: 100%; min-height: 48px; padding: 0 8px; border: 0; border-radius: 0; background: transparent;
  color: transparent; caret-color: transparent; font: 400 20px/1 var(--ui); text-align: center; /* typed text is transparent; only the stars show */
}
.lock-card input::selection { background: transparent; color: transparent; }
.lock-card input:focus-visible { outline: 0; }
.stars { position: absolute; left: 0; right: 0; bottom: 11px; display: flex; justify-content: center; align-items: center; pointer-events: none; font: 400 19px/1 var(--term); letter-spacing: .3em; color: var(--night-text); text-shadow: 0 0 6px rgba(236,237,238,.45); }
/* an old terminal: "> ***" and a block cursor, one group always centred (the prompt slides left as stars come) */
.stars::before { content: ">"; margin-right: .5em; letter-spacing: 0; color: var(--outline); text-shadow: none; }
.stars::after { content: ""; display: inline-block; width: 10px; height: 19px; margin-left: 1px; background: var(--night-text); box-shadow: 0 0 6px rgba(236,237,238,.45); animation: caret 1.05s steps(1) infinite; }
/* the glass: soft scan lines (no moiré at any zoom), darker corners, a little grain, and a faint band rolling down */
.lock::after { content: ""; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 72% 78% at 50% 47%, rgba(0,0,0,0) 0, rgba(0,0,0,0) 62%, rgba(0,0,0,.135) 80%, rgba(0,0,0,.36) 96%, rgba(0,0,0,.5) 120%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0) 0, rgba(255,255,255,.03) 1.5px, rgba(255,255,255,0) 3px, rgba(255,255,255,0) 4px); }
.lock::before { content: ""; position: fixed; left: 0; right: 0; top: -120px; height: 120px; pointer-events: none; background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.02), rgba(255,255,255,0)); animation: roll 6s linear infinite; }
@keyframes roll { to { transform: translateY(calc(100vh + 120px)); } }
.grain { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .018; image-rendering: pixelated; }
.lock-card .logo .logo-tri,
.lock-card .logo .slip img { filter: drop-shadow(.5px 0 0 rgba(255,60,60,.14)) drop-shadow(-.5px 0 0 rgba(60,160,255,.14)) blur(.45px) drop-shadow(0 0 3px rgba(236,237,238,.4)) drop-shadow(0 0 10px rgba(236,237,238,.22)); } /* on the triangle only: a filter over the ball would freeze it */
#unlock { position: absolute; width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); opacity: 0; } /* Enter opens; the button stays for assistive tools */
#unlock:focus-visible { opacity: 1; margin: 0; clip: auto; position: static; width: auto; height: auto; clip-path: none; margin-top: 22px; padding: 0 20px; min-height: 40px; background: none; color: var(--night-text); box-shadow: inset 0 0 0 1.5px var(--outline); }
#lock-msg { position: absolute; left: 0; right: 0; top: 100%; min-height: 1.5em; margin: 18px 0 0; font: 400 15px/1.5 var(--ui); color: var(--night-text); }
#lock-msg:is([data-kind="wrong"], [data-kind="opening"]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.lock:has(#lock-msg[data-kind="opening"]) .logo { animation: breathe 1.2s ease-in-out infinite; } /* while the key is computed */
@keyframes breathe { 50% { opacity: .55; } }
.curtain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 100; pointer-events: none; }
/* offline and a file opened from the computer read as a soft tile. A wrong key stays in the live region only: the disc turns red. */
#lock-msg:is([data-kind="offline"], [data-kind="fileUrl"]) {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 14px 18px; border-radius: var(--r-s);
  background: var(--quiet); color: var(--text); font-size: 15px;
}
#lock-msg:is([data-kind="offline"], [data-kind="fileUrl"])::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%; margin-top: 0; background: var(--action) var(--ico-bad) center / 12px no-repeat;
}
#lock-msg[data-kind="fileUrl"]::before, #lock-msg[data-kind="offline"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 2.5v4M6 9.4v.1'/%3E%3C/svg%3E");
}

/* == shell: the sidebar lies flat on the ground, the lesson is one sheet == */
/* the sheet is centred on the whole page; the sidebar lives in the left margin (equal margins both sides when there is room) */
.app { display: grid; grid-template-columns: minmax(296px, 1fr) minmax(0, calc(var(--measure) + 144px)) minmax(0, 1fr); gap: 8px; min-height: 100vh; min-height: 100dvh; padding: 24px 12px; align-items: start; }
.app > .nav { width: 296px; }
.nav { position: sticky; top: 24px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 16px 0 24px; }
.nav-head { padding: 0 20px 18px; }
.nav-top { margin: 0 0 22px -4px; }
.nav .nav-title { margin: 0; font: 600 25px/1.18 var(--serif); letter-spacing: -.02em; }
.nav button[data-id] {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) 18px; gap: 6px; align-items: baseline; width: 100%; margin: 0;
  text-align: left; background: none; border: 0; border-radius: 999px; padding: 10px 16px 10px 20px;
  font: 400 16px/1.3 var(--ui); color: var(--text-2); transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.nav button[data-id]:hover { background: #E2E3E5; color: var(--text); }
.nav button[data-id] .num { font: 400 15px/1.3 var(--serif); }
/* The tick is drawn, not typed: the fonts have no check-mark glyph. The text stays for assistive technology and tests.
   While a module is underway, the same spot is a circle that fills with the pages already completed. */
.nav button[data-id] .tick { align-self: center; font-size: 0; color: var(--text-2); }
.nav button[data-id] .tick:not(:empty)::before { content: ""; display: inline-block; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.nav button[data-id] .tick.ring {
  width: 14px; height: 14px; border-radius: 50%;
  background: conic-gradient(currentColor calc(var(--p) * 1turn), transparent 0);
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.nav button[data-id][aria-current="page"] { background: var(--sheet); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(34,36,40,.06); border-radius: 22px; }
.nav button[data-id][aria-current="page"] .num { font-weight: 600; }

.lesson { background: var(--sheet); border-radius: var(--r-l); padding: 56px 72px 40px; max-width: calc(var(--measure) + 144px); width: 100%; outline: none; min-width: 0; }

/* == lesson header: the title, and, on a module, its number in small grey above == */
.lesson-head { margin-bottom: 40px; }
.lesson h1 { margin: 0; font: 600 36px/1.15 var(--serif); letter-spacing: -.015em; text-wrap: balance; }
.lesson h1:focus { outline: none; }
.lesson h1 .kicker { display: block; margin: 0 0 8px; font: 600 14px/1.2 var(--ui); letter-spacing: .01em; color: var(--text-2); }

/* == the grid: labels in the margin, content on the measure == */
.block { position: relative; margin: 0 0 52px var(--gutter); max-width: var(--measure); }
.block-video { margin-bottom: 28px; } /* a capsule is mostly its video: the block below can sit closer */
/* the line that stays visible sits on the accordion, not a block away from it */
.block-text:has(+ .block-accordion) { margin-bottom: 10px; }
.block p { margin: 0; }
.label { font: 600 14px/1.3 var(--ui); color: var(--text-2); }
/* question number: a bare numeral hanging in the left padding, level with the prompt */
.block > .label, .question legend .label { position: absolute; left: -40px; width: 28px; top: 6px; text-align: right; font: 400 18px/1.32 var(--serif); }
.block-quiz .question { position: relative; }
.block-quiz .question + .question { margin-top: 44px; }
.block-text p { font: 400 19px/1.7 var(--ui); }
.block-heading { margin-bottom: 20px; }
.block-heading h2 { margin: 12px 0 0; font: 600 26px/1.25 var(--serif); letter-spacing: -.005em; }
/* a module opens on two shapes: the objective in its own rectangle, the outcome as a left-rule quote */
.block-objective { margin-bottom: 22px; }
.objective { border: 1.5px solid var(--outline); border-radius: 4px; padding: 16px 22px 18px; }
.objective h2 { margin: 0 0 8px; font: 600 14px/1.3 var(--ui); color: var(--text-2); }
.objective p { font: 400 19px/1.7 var(--ui); }
.block-outcome { margin-bottom: 44px; }
.outcome { margin: 0; padding: 2px 0 2px 20px; box-shadow: inset 3px 0 0 var(--outline); }
.outcome h2 { margin: 0 0 8px; font: 600 14px/1.3 var(--ui); color: var(--text-2); }
.outcome p { font: italic 400 22px/1.45 var(--serif); }
.block-list ul { margin: 0; padding-left: 1.2em; font: 400 19px/1.7 var(--ui); }
.block-list li + li { margin-top: 4px; }
/* a programme of capsules: the section name in the course face, the person in ink, the length still quiet */
.block-list ul:has(> li.cap) { list-style: none; padding-left: 0; }
.block-list li.cap { padding: 10px 0 11px; border-top: 1px solid var(--line); }
.block-list li.cap:last-child { border-bottom: 1px solid var(--line); }
.block-list li.cap + li { margin-top: 0; }
.block-list li.cap .cap-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 18px; row-gap: 2px; }
.block-list li.cap .cap-lead { display: flex; align-items: baseline; min-width: 0; }
.block-list li.cap .cap-title { font-family: var(--serif); letter-spacing: -.012em; min-width: 0; }
/* one grey mark at a beat: the films, each capsule, the line that hands the module to the quiz. Not .mark: that class is an answer. */
.beat { display: inline-block; margin-right: .4em; color: var(--text-2); font-weight: 400; font-style: normal; font-variant-emoji: text; line-height: 1; vertical-align: .05em; filter: grayscale(1); }
.block-heading .beat { font-size: .64em; }
.cap-lead .beat { font-size: .68em; margin-right: .46em; flex: none; }
.block-text .beat { font-size: .95em; vertical-align: 0; }
.block-list li.cap .cap-who { margin-left: auto; color: var(--text-2); }
.block-list li.cap .cap-name { color: var(--text); }
.hint, figcaption { font: 400 14.5px/1.45 var(--ui); color: var(--text-2); }
.block .hint { margin-top: 10px; }
.btn.continue { display: flex; margin: 0 0 52px var(--gutter); }

/* key idea: a left rule at the size of the lesson, with no fill */
.callout { margin: 0; padding: 2px 0 2px 18px; background: none; border-radius: 0; box-shadow: inset 3px 0 0 var(--line); font: 400 19px/1.6 var(--serif); }
.callout.bad { background: var(--quiet-2); color: var(--text); font: 400 17px/1.5 var(--ui); padding: 16px 22px; box-shadow: none; border-radius: var(--r); } /* a notice, not a wrong answer: grey */
.callout.bad a { color: var(--text); font-weight: 600; }
/* A network problem is not a wrong answer: neutral tile. */
.callout.notice { background: var(--quiet-2); color: var(--text); font: 400 17px/1.5 var(--ui); padding: 22px 26px; box-shadow: none; border-radius: var(--r); }
.callout.notice a { color: var(--text); font-weight: 600; }

/* quote */
.quote { margin: 0; }
.quote blockquote { margin: 0; padding: 2px 0 2px 22px; box-shadow: inset 3px 0 0 var(--line); font: italic 400 24px/1.4 var(--serif); }
.quote figcaption { padding-left: 22px; }

/* figures */
figure { margin: 0; }
figure img { display: block; max-width: 100%; height: auto; border-radius: var(--r-s); background: #fff; }
figcaption { margin-top: 12px; }
audio { display: block; width: 100%; }

/* video */
.player { position: relative; border-radius: var(--r); overflow: hidden; background: var(--video); color: #fff; aspect-ratio: 16 / 9; } /* keeps its room while the video downloads */
.player video, .player iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }
.player .poster { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; pointer-events: none; border-radius: 0; background: none; }
.block-video .video-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 8px; }
.block-video figcaption { margin: 0; }
.block-video .video-meta .btn { margin-left: auto; max-width: 100%; }
.block-video > .callout { background: var(--quiet); border-radius: var(--r); padding: 16px 22px; box-shadow: none; font: 400 17px/1.5 var(--ui); }
/* native captions: readable on the video, in the page and in full screen */
video::cue { background: rgba(0,0,0,.76); color: #fff; font-family: var(--ui); }

/* accordion, tabs, cards, process, timeline, table */
.acc { background: var(--quiet); border-radius: var(--r); margin: 0 0 8px; transition: background var(--t) var(--ease); }
.acc:hover { background: #EBECEE; }
.acc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none;
  padding: 14px 16px 14px 22px; font: 600 17px/1.35 var(--ui); border-radius: var(--r);
}
.acc summary::-webkit-details-marker { display: none; }
/* soft round chevron instead of the browser triangle; it turns when the panel opens */
.acc summary::after {
  content: ""; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--sheet) var(--ico-chev) center / 12px no-repeat;
  transition: transform var(--t) var(--ease);
}
.acc[open] summary::after { transform: rotate(180deg); }
.acc.closing summary::after { transform: none; }
.acc > :not(summary) { transition: opacity 200ms ease-out; }
.acc.closing > :not(summary) { opacity: 0; }
.acc summary::after { transition: transform 220ms cubic-bezier(.25,.1,.25,1); }
.block .acc p { padding: 0 22px 14px; font: 400 17px/1.55 var(--ui); }
.block .acc ul { margin: 0; padding: 0 22px 14px 42px; font: 400 16px/1.5 var(--ui); }
.block .acc p:last-child, .block .acc ul:last-child { padding-bottom: 18px; }
.block .acc li { margin: 0 0 8px; }
.block .acc li:last-child { margin: 0; }
.tablist { display: flex; align-items: flex-end; gap: 6px; }
/* every tab keeps the same box; only the shape behind the word changes: a rounded pill, or the folder tab joined to the sheet */
.tablist [role="tab"] {
  position: relative; flex: 1 1 auto; min-width: 0; height: 50px; margin: 0; padding: 0 14px 8px; border: 0; background: none;
  font: 600 15px/1.2 var(--ui); color: var(--text-2); cursor: pointer; transition: color 260ms var(--ease);
}
.tablist [role="tab"]::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; bottom: 8px; border-radius: 14px; background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: bottom 260ms var(--ease), border-radius 260ms var(--ease), background 260ms var(--ease), box-shadow 260ms var(--ease);
}
.tablist [role="tab"]:hover { color: var(--text); }
.tablist [role="tab"]:hover::before { background: var(--quiet); }
.tablist [role="tab"][aria-selected="true"] { color: var(--text); }
.tablist [role="tab"][aria-selected="true"]::before { bottom: 0; border-radius: 16px 16px 0 0; background: var(--quiet); box-shadow: none; }
/* the ring follows the shape behind the word, so a square outline does not hang off the sheet */
.tablist [role="tab"]:focus-visible { outline: none; }
.tablist [role="tab"]:focus-visible::before { box-shadow: inset 0 0 0 2px var(--text); }
.tablist [role="tab"][aria-selected="true"]:focus-visible::before { box-shadow: inset 2px 0 0 var(--text), inset -2px 0 0 var(--text), inset 0 2px 0 var(--text); }
.tablist { isolation: isolate; }
.tabpanels { background: var(--quiet); border-radius: var(--r); } /* the grey sheet stays; only its text changes */
.tabpanel { margin-top: 0; padding: 20px 22px; font: 400 17px/1.55 var(--ui); }
.first-on .tabpanels { border-top-left-radius: 0; } /* the first tab sits flush on the corner */
.last-on .tabpanels { border-top-right-radius: 0; } /* the last tab sits flush on the other corner */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 10px; }
.card {
  min-width: 0; min-height: 150px; background: var(--quiet); border: 0; border-radius: var(--r); padding: 18px; display: flex; flex-direction: column;
  justify-content: center; gap: 8px; text-align: center; font: 400 17px/1.45 var(--ui); box-shadow: inset 0 0 0 1.5px var(--outline);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.card:hover { background: var(--quiet-2); }
.card[aria-pressed="true"] { background: var(--action); color: #fff; box-shadow: none; }
.card-side { font: 600 12.5px/1 var(--ui); text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.step-sheet { background: var(--quiet); border-radius: var(--r); } /* the grey sheet stays still; only its text changes */
.step { padding: 18px 24px 22px; min-height: 140px; }
.block .step .hint { margin: 0; }
.step h3 { margin: 6px 0; font: 600 21px/1.3 var(--serif); }
.step p:last-child { font: 400 17px/1.55 var(--ui); }
.tl-track { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0 0 18px; }
.tl-track::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: var(--line); }
.tl-dot { position: relative; display: grid; justify-items: center; gap: 10px; padding: 0 0 4px; border: 0; background: none; font: 600 16px/1.2 var(--serif); color: var(--text-2); cursor: pointer; }
.tl-dot::before { content: ""; width: 24px; height: 24px; border-radius: 50%; background: var(--sheet); box-shadow: inset 0 0 0 2px var(--outline); transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.tl-dot:hover::before { box-shadow: inset 0 0 0 2px var(--text); }
.tl-dot.seen::before { background: var(--quiet-2); }
.tl-dot[aria-pressed="true"] { color: var(--text); }
.tl-dot[aria-pressed="true"]::before { background: var(--text); box-shadow: none; }
.tl-dot:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 10px; }
.block-timeline .tl-dot:not(.seen)::before { animation: invite 1.8s var(--ease) 3; }
.tl-panel { padding: 18px 22px; border-radius: var(--r); background: var(--quiet); font: 400 17px/1.55 var(--ui); }
.tl-panel strong { font: 600 18px/1.3 var(--serif); }
.block .tl-panel p { margin-top: 4px; }
.table-wrap { overflow: hidden; border-radius: var(--r-s); box-shadow: inset 0 0 0 1px var(--line); } /* clips the header corners; the table itself does not scroll */
/* the grid stays inside the lesson: columns share the width and words wrap */
table { border-collapse: collapse; width: 100%; overflow-wrap: normal; font: 400 16px/1.45 var(--ui); }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.block-table table { table-layout: fixed; font: 400 14px/1.3 var(--ui); }
.block-table th, .block-table td { padding: 8px 6px; overflow: hidden; overflow-wrap: anywhere; min-width: 0; }
.block-table math { display: block; max-width: 100%; font-size: 12.5px; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { background: var(--quiet-2); font-weight: 600; }
tbody th { font-weight: 600; }
/* a phone cannot hold six columns, so each row becomes a small record. The header stays for screen readers. */
@media (max-width: 760px) {
  .block math { font-size: 0.96em; }
  .block-table .table-wrap { position: relative; overflow: visible; box-shadow: none; }
  .block-table table, .block-table tbody { display: block; width: 100%; table-layout: auto; font: 400 15.5px/1.35 var(--ui); }
  .block-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .block-table tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px;
    margin: 0 0 10px; padding: 12px 14px 8px; background: var(--quiet); border-radius: 16px;
  }
  .block-table td, .block-table tbody th { display: block; min-width: 0; border: 0; padding: 5px 0 7px; font-weight: 400; }
  .block-table tbody th { grid-column: 1 / -1; font-weight: 600; }
  .block-table :is(td, tbody th)[data-label]::before {
    content: attr(data-label) ": "; display: block; margin-bottom: 1px;
    font: 600 12.5px/1.25 var(--ui); color: var(--text-2);
  }
}

/* the five-family slide stays one grid, including on a phone: nothing stacks, nothing scrolls sideways */
.block-spectrum .hint { margin: 0 0 12px; }
.block-spectrum .spec-table { width: 100%; table-layout: fixed; border-collapse: collapse; font: 600 13px/1.25 var(--ui); }
.block-spectrum col.rowcol { width: 23%; }
.block-spectrum th, .block-spectrum td { padding: 0; text-align: center; vertical-align: middle; overflow-wrap: break-word; }
.block-spectrum thead th { background: var(--quiet-2); }
.block-spectrum tbody th { background: var(--quiet); }
.block-spectrum .corner { background: var(--quiet-2); }
.block-spectrum button.head {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin: 0; padding: 6px 2px; border: 0; border-radius: 8px;
  background: none; font: inherit; text-align: inherit; cursor: pointer; hyphens: manual; overflow-wrap: break-word;
}
.block-spectrum button.head:hover { background: var(--sheet); }
.block-spectrum button.head:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--text); }
.block-spectrum button.head[aria-pressed="true"] { background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--outline); }
.block-spectrum button.head.chosen { box-shadow: inset 0 0 0 1.5px var(--ok-edge); }
.block-spectrum button.head[aria-pressed="true"]:focus-visible,
.block-spectrum button.head.chosen:focus-visible { box-shadow: inset 0 0 0 2px var(--text); }
.block-spectrum td.armed { background: var(--quiet); }
.block-spectrum td.chosen { box-shadow: inset 0 -2px 0 var(--ok-edge); }
.block-spectrum .spec-mark { display: inline-grid; font: 600 16px/1 var(--ui); color: var(--text); }
.block-spectrum tr.marks td { text-align: center; }
.block-spectrum math { font-size: 12px; }
.block-spectrum .spec-note { margin-top: 14px; padding: 16px 18px; border-radius: var(--r); background: var(--quiet); font: 400 17px/1.55 var(--ui); }
.block-spectrum .stack + .hint { margin-top: 14px; }
.block-spectrum .spec-note strong { font: 600 18px/1.3 var(--serif); }
.block-spectrum .instruction { margin-top: 18px; }
@media (max-width: 760px) {
  .block-spectrum col.rowcol { width: 22%; }
  .block-spectrum .spec-table { font-size: 11px; }
  .block-spectrum button.head { padding: 5px 1px; }
  .block-spectrum math { font-size: 10px; }
  .block-spectrum .spec-note { font-size: 16px; }
}

/* labeled graphic and hotspot */
.graphic { position: relative; }
.graphic img { display: block; width: 100%; height: auto; border-radius: var(--r-s); box-shadow: 0 0 0 1px var(--line); }
.marker {
  position: absolute; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; padding: 0;
  background: var(--action); color: #fff; font: 600 15px/1 var(--ui); box-shadow: 0 1px 6px rgba(34,36,40,.35); transition: background var(--t) var(--ease);
}
.marker:hover, .marker[aria-current="true"] { background: var(--text); }
.marker[aria-current="true"] { box-shadow: 0 0 0 3px var(--quiet-2), 0 1px 6px rgba(34,36,40,.35); }
.region { position: absolute; background: transparent; border: 2px dashed transparent; border-radius: 8px; padding: 0; cursor: pointer; transition: background var(--t) var(--ease), border-color var(--t) var(--ease); }
.block-labeled .region { border-color: var(--outline); }
.block-labeled .region[aria-current="true"] { background: rgba(255,255,255,.28); border-color: var(--text); box-shadow: 0 0 0 2px #fff; }
/* the white halo keeps the dashed outline readable on any picture */
.region:hover, .region:focus-visible { background: rgba(255,255,255,.28); border-color: var(--text); box-shadow: 0 0 0 2px #fff; }
.region.is-correct { border: 3px solid var(--ok-edge); background: color-mix(in srgb, var(--ok-bg) 45%, transparent); box-shadow: 0 0 0 2px #fff; }
.region.is-wrong { border: 3px solid var(--bad); background: color-mix(in srgb, var(--bad-bg) 45%, transparent); box-shadow: 0 0 0 2px #fff; }

/* == questions == */
fieldset.question { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.question legend { float: left; width: 100%; padding: 0; }
fieldset.question legend + * { clear: both; }
.question legend, .block .qlabel, .block .instruction { display: block; margin: 0 0 20px; font: 600 23px/1.32 var(--serif); letter-spacing: -.005em; color: var(--text); }
.block .instruction { margin-bottom: 20px; }
/* every option as tall as the tallest one */
.options { display: grid; grid-auto-rows: 1fr; gap: 8px; }
.options > label.option { margin: 0; }
label.option {
  position: relative; display: grid; grid-template-columns: 20px 1fr auto; gap: 14px; align-items: center; width: 100%; margin: 0 0 8px;
  background: var(--quiet); border-radius: var(--r); padding: 14px 22px 14px 14px; font: 400 17.5px/1.4 var(--ui); color: var(--text);
  cursor: pointer; transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
/* the native radio or checkbox covers the whole tile: keyboard, screen readers and clicks work as usual */
label.option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
label.option input:disabled { cursor: default; }
label.option:hover { background: var(--quiet-2); }
/* after submitting, tiles are locked: no hover change, no pointer */
label.option:has(input:disabled) { cursor: default; }
label.option:has(input:disabled):not(.is-correct):not(.is-wrong):hover { background: var(--quiet); }
label.option:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 3px; }
.key {
  width: 20px; height: 20px; border-radius: 50%; background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--outline);
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.option.multi .key { border-radius: 5px; }
label.option:has(input:checked) { background: var(--quiet-2); }
label.option:has(input:checked) .key { background: radial-gradient(circle, #fff 0 3.5px, var(--action) 4.5px); box-shadow: none; }
label.option.multi:has(input:checked) .key { background: var(--action) var(--ico-ok) center / 13px no-repeat; box-shadow: none; }
/* the one memorable touch: the chosen dot fills like a drop of ink (off with reduced motion) */
label.option:has(input:checked) .key { animation: ink 520ms var(--ease-out) both; }
@keyframes ink { 0% { transform: scale(.55); box-shadow: 0 0 0 0 rgba(48,50,54,.28); } 55% { transform: scale(1.12); } 100% { transform: scale(1); box-shadow: 0 0 0 9px rgba(48,50,54,0); } }
/* once checked, right and wrong win over the selected look (the :has selectors match its weight) */
label.option.is-correct, label.option.is-correct:has(input:checked) { background: var(--ok-bg); box-shadow: inset 0 0 0 2px var(--ok-edge); }
label.option.is-wrong, label.option.is-wrong:has(input:checked) { background: var(--bad-bg); box-shadow: none; }
/* the wrong pick fades back and is struck through */
label.option.is-wrong > span:not(.key):not(.mark) { color: var(--text-2); text-decoration: line-through; text-decoration-thickness: 1px; }
label.option.is-correct .key, label.option.is-correct:has(input:checked) .key { background: var(--ok) var(--ico-ok) center / 13px no-repeat; box-shadow: none; }
label.option.is-wrong .key, label.option.is-wrong:has(input:checked) .key { background: var(--bad) var(--ico-bad) center / 13px no-repeat; box-shadow: none; }
.mark { display: inline-grid; justify-items: start; font: 600 14px/1.2 var(--ui); white-space: nowrap; }
.mark > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 6px; visibility: hidden; opacity: 0; transition: opacity 200ms ease-out, visibility 200ms; }
.mark[data-show="ok"] > .m-ok, .mark[data-show="bad"] > .m-bad, .mark[data-show="miss"] > .m-miss { opacity: 1; }
.mark[data-show="ok"] > .m-ok, .mark[data-show="bad"] > .m-bad { visibility: visible; animation: soft-in var(--t) var(--ease-out) both; }
.m-ok { color: var(--text); }
.m-bad { color: var(--bad-text); }
.mark > span::before { content: ""; display: inline-block; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.nav button[data-id] .tick, .m-ok { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.3 5 8.8 9.6 3.6'/%3E%3C/svg%3E"); }
.m-bad { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m3.2 3.2 5.6 5.6m0-5.6-5.6 5.6'/%3E%3C/svg%3E"); }

.feedback { position: relative; margin: 12px 0 0; padding: 16px 22px; border-radius: var(--r); background: var(--quiet); font: 400 17px/1.5 var(--ui); }
.block .feedback { margin-top: 12px; }
.feedback.ok, .feedback.bad, .feedback.done, .result.ok, .result.bad { padding-left: 56px; }
.feedback.ok, .result.ok { background: var(--ok-bg); }
.feedback.bad, .result.bad { background: var(--bad-bg); }
.feedback.ok::before, .feedback.bad::before, .feedback.done::before, .result.ok::before, .result.bad::before {
  content: ""; position: absolute; left: 22px; top: 18px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ok) var(--ico-ok) center / 13px no-repeat;
}
.feedback.bad::before, .result.bad::before { background: var(--bad) var(--ico-bad) center / 13px no-repeat; }
/* end of course: neutral, it is not an answer */
.feedback.done::before { background: var(--action) var(--ico-ok) center / 13px no-repeat; }
.result { position: relative; margin-top: 16px; padding: 16px 22px; border-radius: var(--r); background: var(--quiet); font: 600 17px/1.5 var(--ui); }

.textin {
  display: block; width: 100%; max-width: 420px; min-height: 50px; padding: 0 22px; background: var(--quiet-2); border: 1.5px solid var(--outline);
  border-radius: 999px; font: 400 17px/1 var(--ui); transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.textin:hover { background: #DCDDE0; }
.textin:focus-visible { outline: 0; background: var(--sheet); border-color: var(--action); box-shadow: 0 0 0 4px var(--quiet-2); }
.textin.is-correct { border-color: var(--ok-edge); box-shadow: inset 0 0 0 1px var(--ok-edge); }
.textin[aria-invalid="true"] { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }

/* matching and sorting */
.bank { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 60px; margin: 0 0 10px; padding: 8px; border-radius: var(--r); background: var(--quiet); transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.chip {
  display: inline-flex; align-items: center; background: var(--sheet); border: 0; border-radius: 999px; padding: 10px 18px;
  font: 600 16.5px/1.2 var(--ui); color: var(--text); text-align: left; box-shadow: inset 0 0 0 1.5px var(--outline);
  transition: box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}
.chip[aria-pressed="true"] { background: var(--quiet-2); box-shadow: inset 0 0 0 2.5px var(--action); }
.zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.zone {
  background: var(--quiet); border-radius: var(--r); padding: 16px 20px; min-height: 116px; width: 100%; text-align: left;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; cursor: pointer; transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.slot { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; min-height: 42px; } /* room for one chip: a box does not grow when its first chip lands */


/* end of lesson */
.lesson-end { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin: 0 0 0 var(--gutter); max-width: var(--measure); }
.lesson-end .feedback { flex: 0 0 100%; }
.lesson-end.with-actions { justify-content: space-between; align-items: center; }
.lesson-end.with-actions > .actions { margin: 0; }
/* the credit: a line, a solid Suivant, and the next title in small */
.lesson-end.credit { flex-direction: column; align-items: center; justify-content: center; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 26px; }
.lesson-end.credit .feedback { flex: none; width: 100%; text-align: center; }
.credit-go { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; }
.lesson-end .next-title { margin: 0; max-width: 28em; font: 400 14.5px/1.4 var(--ui); color: var(--text-2); text-align: center; text-wrap: balance; }
.lesson-end.with-actions.credit { flex-direction: row; align-items: flex-end; }
.lesson-end.credit .btn { flex: none; }

/* == keyboard: the skip link shows only when reached with Tab == */
.skip { position: fixed; left: 16px; top: 12px; z-index: 20; padding: 10px 18px; border-radius: 999px; background: var(--action); color: #fff; font: 600 15px/1 var(--ui); }
.skip:not(:focus) { position: absolute; left: -9999px; top: auto; }
.skip:focus { outline: 2px solid var(--text); outline-offset: 3px; }

/* == course title: a link to the course home == */
.nav a.nav-title { display: block; color: inherit; text-decoration: none; border-radius: 10px; }
/* hover: a small patch of crackling black pixels behind the logo, which turns bright white (drawn by app.js) */
.logo-wrap { position: relative; flex: none; display: grid; place-items: center; }
.logo-wrap .logo { position: relative; }
.logo-wrap::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; } /* the hover zone: the logo and a thin ring around it */
.logo-fx { position: absolute; left: -10px; top: -10px; width: calc(100% + 20px); height: calc(100% + 20px); pointer-events: none; image-rendering: pixelated; }
.nav a.nav-title:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }

/* logo: the circle, the triangle of the trilemma, and an empty place at the centre */
.nav a.nav-title { display: flex; align-items: center; gap: 12px; }
.nav a.nav-title .logo { flex: none; width: 44px; height: 44px; }
@media (max-width: 900px) { .nav a.nav-title .logo { width: 30px; height: 30px; } }

@media (min-width: 901px) { .nav-top { position: fixed; top: 58px; right: 12px; z-index: 6; margin: 0; } }

/* Zoomed, or a window with no right margin: sign-out, language and comment
   leave the corners and sit on the ground at the bottom. The lesson scrolls above them. */
.page-tools { display: none; }
html.parked, html.parked body { height: 100%; overflow: hidden; }
html.parked body { display: flex; flex-direction: column; }
html.parked .app { flex: 1 1 auto; min-height: 0; height: auto; overflow: auto; }
html.parked .page-tools {
  display: flex; flex: none; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 4px 12px; padding: 8px 12px; background: var(--ground);
  box-shadow: inset 0 1px 0 var(--line);
}
html.parked .nav-top { position: static; top: auto; right: auto; margin: 0; transform: none; }
html.parked .logout { position: static; top: auto; right: auto; }
html.parked .comment-btn { position: static; right: auto; bottom: auto; }

/* == course home: the table of contents, one level per indent == */
.home-intro { margin: 0 0 36px; font: 400 19px/1.6 var(--ui); color: var(--text-2); max-width: var(--measure); }
.home-h2 { margin: 0 0 8px; font: 600 14px/1.3 var(--ui); color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; }
.home-list, .toc-sub { margin: 0; padding: 0; list-style: none; }
.home-list { margin-bottom: 36px; }
.home-list > li { border-top: 1px solid var(--line); padding: 4px 0 2px; }
.home-list > li:first-child { border-top: 0; }
.toc-row { display: flex; align-items: baseline; gap: 10px; }
.home-list a { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px 18px; min-width: 0; margin: 2px -12px; padding: 10px 12px; border-radius: 14px; color: var(--text); text-decoration: none; transition: background var(--t) var(--ease); }
.home-list > li > .toc-row a { margin: 8px -12px; padding: 12px; font: 600 21px/1.25 var(--serif); letter-spacing: -.012em; }
.home-list > li:has(.toc-sub) > .toc-row a { margin-bottom: 0; }
.toc-name { flex: 1; min-width: 0; }
.toc-sub { margin: 2px 0 8px 10px; padding: 0 0 4px 18px; }
.toc-sub a { font: 400 16.5px/1.4 var(--ui); }
.home-list a:hover { background: var(--quiet); }
.home-meta { flex: none; font: 400 14.5px/1.3 var(--ui); color: var(--text-2); }
.home-list a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
.home-list .tick { flex: none; color: var(--text-2); font-size: 15px; }
@media (max-width: 760px) {
  .home-list > li > .toc-row a { font-size: 18px; }
  .toc-sub { margin-left: 4px; padding-left: 12px; }
}

/* == under a video: slides and transcript == */
.video-extras { display: grid; gap: 6px; justify-items: start; margin-top: 8px; }
.video-extras .transcript { width: 100%; margin: 0; border-radius: var(--r-s); }
.video-extras .transcript summary { padding: 7px 10px 7px 14px; font-size: 15px; border-radius: var(--r-s); }
.video-extras .transcript summary::after { width: 22px; height: 22px; background-size: 10px; }
.video-extras .transcript p { padding: 0 14px 14px; font: 400 16.5px/1.6 var(--ui); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 14px; flex: none; max-width: 100%; }

/* == speech bubble: someone in the activity speaks (a colleague, the committee) == */
.bubble { margin: 0 12% 18px 0; padding: 16px 22px; border-radius: 26px 26px 26px 8px; background: var(--quiet); font: 400 21px/1.45 var(--serif); color: var(--text); }
.bubble-who { display: block; margin: 0 0 6px; font: 600 14px/1.3 var(--ui); color: var(--text-2); }

/* replies, like text messages: set in from the left, the sharp corner at the bottom right.
   A question with no one speaking stays flush with the prompt. */
.block-mcq:has(.bubble) label.option,
.block-scenario label.option { width: auto; margin-left: 12%; border-radius: var(--r) var(--r) 8px var(--r); }
@media (max-width: 760px) {
  .tablist { flex-wrap: wrap; overflow: visible; }
  .tablist [role="tab"] { flex: 1 1 42%; height: auto; min-height: 48px; white-space: normal; font-size: 14px; padding: 8px 10px 14px; }
  .tablist [role="tab"][aria-selected="true"]::before { bottom: 8px; border-radius: 14px; } /* a wrapped tab stays a pill, not a folder floating above the sheet */
  .tablist [role="tab"][aria-selected="true"]:focus-visible::before { box-shadow: inset 0 0 0 2px var(--text); }
  .first-on .tabpanels, .last-on .tabpanels { border-top-left-radius: var(--r); border-top-right-radius: var(--r); }
  .bubble { margin-right: 8%; }
  .block-mcq:has(.bubble) label.option,
  .block-scenario label.option { margin-left: 8%; }
}

/* the click cue, everywhere the same: a soft breathing ring until the first use */
@keyframes invite { 50% { box-shadow: inset 0 0 0 2px var(--text), 0 0 0 6px var(--quiet-2); } }
.block-labeled:not(.touched) .marker { animation: invite 1.8s var(--ease) 3; }
.block-labeled:not(.touched) .region { animation: dash-blink 1.4s steps(1) 2; }
.card { position: relative; cursor: pointer; }
/* the same glow, around the whole card, until the first card is turned */

/* the same glow at the key places: the circles of the figure until a first pick, the next empty row of an ordering */
.block-hotspot .graphic:not(:has(.region[aria-pressed="true"])) .region { animation: dash-blink 1.4s steps(1) 2; } /* the invitation: the dashed outlines blink briefly, then rest */
@keyframes dash-blink { 0%, 50% { border-color: var(--outline); } 25%, 75% { border-color: transparent; } }
.block-sequence .seq-empty[data-next] { animation: invite 1.8s var(--ease) 3; }

/* sign out: a quiet word at the bottom left, like the language word at the top */
.logout { position: fixed; right: 12px; top: 16px; z-index: 5; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font: 500 15px/1 var(--ui); color: var(--text-2); cursor: pointer; transition: color var(--t) var(--ease), background var(--t) var(--ease); }
.logout:hover { color: var(--text); background: var(--quiet-2); }
.logout:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* == comments == */
.comment-btn {
  position: fixed; right: 24px; bottom: 24px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  background: var(--quiet); border: 0; border-radius: 999px; font: 600 14.5px/1 var(--ui); color: var(--text-2);
  box-shadow: 0 1px 2px rgba(34,36,40,.06), 0 6px 18px rgba(34,36,40,.08); transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.comment-btn::before {
  content: ""; width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%235F6166' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M1.5 2.5h9v6h-5l-2.5 2v-2h-1.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.comment-btn:hover { background: var(--quiet-2); color: var(--text); }
.comment-dialog { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: var(--r-l); background: var(--sheet); color: var(--text); box-shadow: var(--shadow-2); padding: 32px 32px 28px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; } /* stays reachable when the iPhone keyboard is up */
.comment-dialog::backdrop { background: rgba(48,50,54,.35); }
.comment-dialog h2 { margin: 0 0 20px; font: 600 23px/1.3 var(--serif); }
.comment-dialog label { display: block; font: 600 14.5px/1.3 var(--ui); margin: 16px 0 8px; }
.comment-dialog textarea, .comment-dialog input {
  display: block; width: 100%; border: 1.5px solid var(--outline); background: var(--quiet); padding: 12px 18px; font: 400 17px/1.5 var(--ui);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.comment-dialog input { min-height: 48px; border-radius: 999px; padding: 0 20px; }
.comment-dialog textarea { border-radius: 20px; resize: vertical; }
.comment-dialog textarea:focus-visible, .comment-dialog input:focus-visible { outline: 0; background: var(--sheet); border-color: var(--action); box-shadow: 0 0 0 4px var(--quiet-2); }
.consent { font: 400 14px/1.5 var(--ui); color: var(--text-2); margin: 16px 0 0; }
.comment-dialog .hint { margin: 16px 0 0; font-weight: 600; }
.comment-dialog .hint:empty { display: none; }
.comment-dialog .hint.ok, .comment-dialog .hint.bad { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--r-s); }
.comment-dialog .hint.ok { background: var(--ok-bg); color: var(--text); }
.comment-dialog .hint.bad { background: var(--bad-bg); color: var(--bad-text); }
.comment-dialog .hint.ok::before, .comment-dialog .hint.bad::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px; background: center / contain no-repeat; }
.comment-dialog .hint.ok::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236F8A77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E"); }
.comment-dialog .hint.bad::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236B6E73' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 4l8 8M12 4l-8 8'/%3E%3C/svg%3E"); }
.comment-dialog .actions { margin-top: 20px; }

/* == narrower screens: labels move above the blocks == */
@media (max-width: 1140px) {
  :root { --gutter: 0px; }
  .lesson { padding: 48px 44px 40px; }
  .block > .label > [aria-hidden] { display: none; } /* narrow: no room in the margin; screen readers still get the number */
  .question legend .label { position: static; display: inline-block; width: auto; margin-right: .45em; color: var(--text-2); }
}

/* == tablet and phone: the sidebar becomes a compact header above the lesson ==
   Kept as a sidebar, it would leave the lesson column about 430 px wide at 768 px. */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px 12px 12px; }
  .app > .nav { width: auto; }
  .lesson { max-width: none; }
  .nav { position: static; max-height: none; overflow: visible; padding: 12px 4px 8px; display: flex; flex-wrap: wrap; gap: 6px; }
  /* many lessons: one strip that scrolls sideways, not a wall of pills */
  .nav-list { flex: 0 0 100%; display: flex; gap: 6px; overflow-x: auto; padding: 5px 5px 8px; margin: -5px; scrollbar-width: thin; }
  .nav-head { flex: 0 0 100%; padding: 0 4px 6px; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: start; }
  .nav-top { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .nav .nav-title { grid-column: 1; padding-top: 4px; font-size: 19px; }
  .nav button[data-id] { position: relative; flex: 1 0 52px; width: auto; margin: 0; display: flex; justify-content: center; padding: 10px 0; background: #E2E3E5; border-radius: 999px; }
  .nav button[data-id] .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav button[data-id] .tick { display: none; }
  .nav button[data-id].done .num { color: var(--text); font-weight: 600; }
  .nav button[data-id][aria-current="page"] { background: var(--action); box-shadow: none; }
  .nav button[data-id][aria-current="page"] .num { color: #fff; }
}

/* == phone == */
@media (max-width: 760px) {
  .lock { padding: 40px 16px; }
  .lock-card { padding: 18px 22px 24px; }
  .lock-top { margin-right: -4px; }
  .lesson { padding: 28px 20px 72px; border-radius: 26px; }
  .lesson-head { margin-bottom: 26px; }
  .lesson h1 { font-size: 28px; }
  .lesson h1 .kicker { font-size: 13px; }
  .block-objective { margin-bottom: 16px; }
  .objective { padding: 14px 16px 16px; }
  .block-outcome { margin-bottom: 32px; }
  .outcome { padding: 2px 0 2px 16px; }
  .objective p, .outcome p { font-size: 18px; }
  .block { margin-bottom: 36px; }
  .block-video { margin-bottom: 22px; }
  .block-video .video-meta { flex-wrap: wrap; column-gap: 8px; }
  .btn.small, .video-extras .transcript summary { min-height: 44px; }
  .block-text p, .block-list ul { font-size: 18px; }
  .callout { padding: 2px 0 2px 16px; font-size: 18px; }
  .question legend, .block .qlabel, .block .instruction { font-size: 21px; }
  label.option { grid-template-columns: 20px 1fr; padding: 12px 16px 12px 12px; }
  label.option { row-gap: 2px; }
  label.option .mark { grid-column: 2; }
  label.option .key { grid-row: 1 / span 2; align-self: start; margin-top: 2px; }
  .zones { grid-template-columns: minmax(0, 1fr); }
  .btn.continue { width: 100%; }
  .lesson-end .btn { flex: 1 1 auto; }
  .comment-btn { right: 16px; bottom: 16px; }
  .logout { position: static; justify-self: center; margin: 4px auto 72px; } /* on a phone: at the very end of the page */
  .comment-dialog { padding: 24px 20px 22px; }
  /* touch targets: at least 44 px on a phone */
  .lang-switch { min-height: 44px; }
  .nav button[data-id] { min-height: 44px; }
  .tablist [role="tab"], .chip { min-height: 44px; }
  .marker { width: 44px; height: 44px; }
  .region::after { content: ""; position: absolute; inset: -10px; }
}

/* == Windows high-contrast mode: fills and box-shadow rings disappear there, so give every control and tile a real border == */
@media (forced-colors: active) {
  .btn, .player, .lock-card button[type="submit"], button.option, .tablist [role="tab"], .comment-btn, .chip, .card, .lang-switch,
  label.option, .acc, .zone, .bank, .feedback, .result, .callout, .step, .tabpanel { border: 1px solid ButtonText; }
  .key { border: 1px solid ButtonText; }
  .nav button[data-id][aria-current="page"] { border: 1px solid ButtonText; }
  /* the selected or pressed state is a thicker border, never colour alone */
  label.option:has(input:checked), .chip[aria-pressed="true"], .card[aria-pressed="true"], .tablist [role="tab"][aria-selected="true"] { border: 3px solid Highlight; }
  .tablist [role="tab"]:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
  .marker { forced-color-adjust: none; background: Highlight; }
  .table-wrap, .block-table tr, .block-spectrum button.head, .block-spectrum .spec-note, .objective { border: 1px solid ButtonText; }
  .outcome { border-left: 3px solid ButtonText; }
  .block-spectrum button.head[aria-pressed="true"], .block-spectrum button.head.chosen { border: 3px solid Highlight; }
  .lock { forced-color-adjust: none; } /* the night picture and the pale triangle stay visible on a light theme */
  .nav button[data-id] .tick.ring { forced-color-adjust: none; color: ButtonText; }
  .feedback::before, .result::before { forced-color-adjust: none; }
  .beat { filter: none; color: ButtonText; }
}

/* == appearing things: a soft fade, never a jump == */
@keyframes soft-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.lesson > *, .feedback:not([hidden]), .result:not([hidden]), .tabpanel:not([hidden]), .card > span, .acc[open] > :not(summary), .comment-dialog[open], .comment-dialog[open]::backdrop {
  animation: soft-in var(--t) var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* text for screen readers only */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* == no jumps: a stack lays its children in one cell, the tallest sets the height;
   phantoms are invisible copies that only hold the room == */
.stack { display: grid; }
.stack > * { grid-area: 1 / 1; min-width: 0; }
.stack > .phantom { display: block; visibility: hidden; }
.stack > [role="tabpanel"] { transition: opacity 160ms ease-out, visibility 160ms; }
.stack > [role="tabpanel"][hidden] { display: block !important; visibility: hidden; opacity: 0; }
.stack > .feedback, .stack > .result { align-self: start; }
.stack > .phantom.slot, .stack > .phantom.bank { display: flex; }

/* blank to fill in: one solid line */
.blank { display: inline-block; width: 4.6em; height: 1em; margin: 0 .12em; border-bottom: 2px solid currentColor; vertical-align: -.12em; }

/* formulas (MathML) */
math { font-size: 1.08em; }
math[display="block"] { margin: 12px 0; }

/* == activity: mcq == */
.block-mcq q:lang(fr) { quotes: "«\00a0" "\00a0»"; }
@media (max-width: 760px) { .block-mcq label.option { align-content: start; align-items: start; } }
/* . */

/* == activity: mrq == */
.block-mrq .options { grid-auto-rows: auto; }
.block-mrq .mrq-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0 20px; align-items: center; }
.block-mrq .note { margin: 0; font-size: 16px; line-height: 1.4; visibility: hidden; opacity: 0; transition: opacity var(--t) var(--ease), visibility var(--t) var(--ease); }
.block-mrq .shown .note { visibility: visible; opacity: 1; }
/* a right option the learner left unticked: empty box, sage dashed outline, the word Missed */
.block-mrq label.missed { background: var(--sheet); outline: 2px dashed var(--ok); outline-offset: -2px; }
.block-mrq .m-miss { color: var(--text); }
.block-mrq .m-miss::before { background: none; border: 1.5px dashed currentColor; border-radius: 3px; -webkit-mask: none; mask: none; }
.block-mrq .mark[data-show="miss"] > .m-miss { visibility: visible; animation: soft-in var(--t) var(--ease-out) both; }
@media (max-width: 760px) {
  .block-mrq .mrq-row { grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 8px; }
  .block-mrq .note { margin-left: 22px; padding-left: 14px; border-left: 2px solid var(--outline); }
}
/* . */

/* == activity: fillin == */
.block-fillin .actions { display: flex; align-items: flex-start; gap: 14px; }
@media (max-width: 640px) { .block-fillin .actions { flex-wrap: wrap; } .block-fillin .actions > .stack { flex-basis: 100%; } }
.block-fillin .actions > .stack { flex: 1; min-width: 0; }
.block-fillin .actions .feedback { margin: 0; }
.block-fillin .blankwrap { position: relative; display: inline-block; margin: 0 .05em 0 .25em; vertical-align: baseline; }
.block-fillin .blankin { width: 8.5em; max-width: 60vw; padding: 0 .3em 2px; border: 0; border-bottom: 2px solid var(--text); border-radius: 0; background: transparent; font: inherit; color: var(--text); text-align: center; outline: none; -webkit-appearance: none; appearance: none; }
.block-fillin .blankin:focus { border-bottom: 2px solid var(--action); } /* writing keeps the sentence as it is: only the line darkens */
/* the invitation: a blinking cursor on the empty line, gone as soon as the learner clicks or writes */
.block-fillin .blankwrap:has(.blankin:placeholder-shown):not(:focus-within)::after { content: ""; position: absolute; left: 50%; bottom: 7px; width: 2px; height: 1.05em; background: var(--text); animation: caret 1.05s steps(1) infinite; pointer-events: none; }
@keyframes caret { 50% { opacity: 0; } }
.block-fillin .blankin.is-correct { border-bottom-color: var(--ok); border-radius: 10px 10px 0 0; background: var(--ok-bg); color: var(--text); font-weight: 600; }
.block-fillin .blankin.shown { border-bottom-style: dashed; border-bottom-color: var(--outline); color: var(--text-2); }
.block-fillin .blankin[aria-invalid="true"] { border-bottom-color: var(--bad); }
/* . */

/* == activity: slider == */
.block-slider .sl-out { position: absolute; top: -60px; left: 0; white-space: nowrap; font: 400 40px/1.1 var(--serif); }
.block-slider .sl-wrap { position: relative; margin-top: 74px; }
.block-slider input { position: relative; z-index: 1; display: block; width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.block-slider input::-webkit-slider-runnable-track { height: 12px; background: transparent; }
.block-slider input::-moz-range-track { height: 12px; background: transparent; }
.block-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -9px; border-radius: 50%; background: var(--sheet); box-shadow: 0 0 0 2px var(--text), 0 2px 8px rgba(34,36,40,.15); }
.block-slider input::-moz-range-thumb { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--sheet); box-shadow: 0 0 0 2px var(--text), 0 2px 8px rgba(34,36,40,.15); }
.block-slider input:focus-visible { outline: none; }
.block-slider input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--text), 0 0 0 6px var(--quiet-2); }
/* the rail is the track, inset by half a thumb so that a percentage along it is where the thumb centre sits */
.block-slider .sl-rail { position: absolute; left: 15px; right: 15px; top: 16px; height: 12px; margin: 0 -15px; padding: 0 15px; border-radius: 999px; background: var(--quiet-2); overflow: hidden; }
.block-slider .sl-band { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--text); opacity: 0; transition: opacity var(--t) var(--ease); }
.block-slider .sl-band.ok { background: var(--ok); }
.block-slider .reveal .sl-band, .block-slider .reveal .sl-target { opacity: 1; }
.block-slider .sl-ends { display: flex; gap: 12px; margin-top: 4px; font: 400 14px/1.2 var(--ui); color: var(--text-2); }
.block-slider .sl-target { margin-left: auto; font-weight: 600; color: var(--text); opacity: 0; transition: opacity var(--t) var(--ease); }
/* . */

/* == activity: match == */
.block-match .chip { border: 1.5px solid transparent; padding: 8.5px 16px; gap: 2px 12px; flex-wrap: wrap; }
.block-match .bank .chip .mark, .block-match .bank .chip .why { display: none; }
.block-match .chip .why { flex: 0 0 100%; min-height: 0; font: 400 13.5px/1.3 var(--ui); color: var(--text-2); }
.block-match .chip[aria-pressed="true"] { background: var(--quiet-2); border-color: var(--text); box-shadow: inset 0 0 0 .5px var(--text); }
.block-match .col { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.block-match .col .chip { width: 100%; min-height: 52px; }
/* the invitation: each item on the left carries the white starting point of its thread; it breathes until the first tap, fills when picked */
.block-match .col .chip { position: relative; padding-right: 40px; cursor: pointer; }
.block-match .col .chip::after { content: ""; position: absolute; right: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--sheet); box-shadow: inset 0 0 0 2px var(--outline); transition: background var(--t) var(--ease); }
.block-match .col .chip:hover::after { box-shadow: inset 0 0 0 2px var(--text); }
.block-match .col .chip[aria-pressed="true"]::after { background: var(--text); box-shadow: none; }
.block-match:not(.touched) .col .chip::after { animation: invite 1.8s var(--ease) 3; }

.block-match .chip[draggable="true"] { -webkit-user-drag: element; }
.block-match .board { position: relative; display: grid; grid-template-columns: 1fr 1.5fr; column-gap: 80px; }
.block-match .threads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.block-match .threads g { color: var(--action); }
.block-match .threads path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.block-match .threads circle { fill: currentColor; }
.block-match .threads .ok { color: var(--ok); }
.block-match .threads .bad { color: var(--bad); }
.block-match .threads .bad path { stroke-dasharray: 7 6; }
.block-match .tgt { display: block; width: 100%; min-height: 76px; padding: 14px 20px; border: 0; border-radius: var(--r); background: var(--quiet); text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.block-match .tgt .tl { display: block; font: 600 16.5px/1.3 var(--ui); }
.block-match .tgt .occ { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; min-height: 22px; margin-top: 4px; font: italic 400 15px/1.45 var(--serif); color: var(--text-2); }
.block-match.armed .tgt { box-shadow: inset 0 0 0 1.5px var(--outline); }
.block-match .tgt.is-correct { background: var(--ok-bg); box-shadow: inset 0 0 0 2px var(--ok-edge); }
.block-match .tgt.is-wrong { background: var(--bad-bg); box-shadow: inset 0 0 0 2px var(--bad); }
.block-match .zone .head { padding: 0; border: 0; background: none; font: 600 14px/1.3 var(--ui); color: var(--text); text-align: left; cursor: pointer; }
.block-match .zone .stack { width: 100%; }
.block-match.armed .zone { box-shadow: inset 0 0 0 1.5px var(--outline); }
.block-match .bank { cursor: pointer; }
.block-match .bank { position: relative; }
.block-match .spot > .phantom.chip { display: inline-flex; }
.block-match .bank .none { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font: italic 400 15px/1.4 var(--serif); color: var(--text-2); text-align: center; }
/* sorting: two pieces per row in a folder; a piece is pencilled (dashed) until Check */
.block-match .stack > .slot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.block-match .zone .chip { flex-direction: column; align-items: flex-start; flex-wrap: nowrap; border-radius: 26px; width: 100%; background: transparent; border-style: dashed; border-color: var(--outline); box-shadow: none; }
.block-match .zone .chip.is-correct { background: var(--ok-bg); border: 1.5px solid var(--ok-edge); }
.block-match .zone .chip.is-wrong { background: var(--bad-bg); border: 1.5px solid var(--bad); }
.block-match .zone .chip[aria-pressed="true"] { background: var(--quiet-2); border: 1.5px solid var(--text); }
@media (max-width: 760px) {
  .block-match .board { display: block; }
  .block-match .threads { display: none; }
  .block-match .col + .col { margin-top: 24px; }
  .block-match .stack > .slot { grid-template-columns: minmax(0, 1fr); }
  .block-match .zone .chip { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .block-match .zone .chip .mark { margin-left: auto; }
}
/* . */

/* == activity: sequence == */
.block-sequence .seq { list-style: none; margin: 0; padding: 0; counter-reset: seq; }
.block-sequence .seq > li { counter-increment: seq; position: relative; padding: 0 0 8px 40px; }
.block-sequence .seq > li.placed::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.block-sequence .seq > li::after {
  content: counter(seq); position: absolute; left: 0; top: 18px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--outline); font: 600 13px/1 var(--ui); color: var(--text-2);
}
.block-sequence .seq > li.is-wrong::after { background: var(--bad); box-shadow: none; color: var(--sheet); }
.block-sequence .seq > li.is-correct::after { background: var(--ok-bg); box-shadow: inset 0 0 0 2px var(--ok); color: var(--text); }
.block-sequence .seq > li:not(.placed)::after { box-shadow: inset 0 0 0 1.5px var(--line); color: var(--outline); }
.block-sequence .seq-empty { display: flex; align-items: center; min-height: 64px; padding: 0 20px; border-radius: var(--r); box-shadow: inset 0 0 0 1.5px var(--line); background: repeating-linear-gradient(-45deg, transparent 0 8px, var(--quiet) 8px 9px); font: 400 italic 17px/1.4 var(--serif); color: var(--text-2); }
.block-sequence .seq-empty:focus { outline: none; }
.block-sequence .seq-empty[data-next] { box-shadow: inset 0 0 0 1.5px var(--outline); background: var(--sheet); }
.block-sequence .seq-pool { display: grid; gap: 8px; align-content: start; margin: 22px 0 0 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.block-sequence .seq-zone { margin: 22px 0 0 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.block-sequence .seq-zone > * { align-self: start; }
.block-sequence .seq-zone > .stack { pointer-events: none; } /* the message's reserved room must not cover the steps */
.block-sequence .seq-zone .feedback:not(.phantom) { pointer-events: auto; }
.block-sequence .seq-zone .seq-pool { margin: 0; padding: 0; border: 0; }
.block-sequence .seq-zone .feedback { margin: 0; }
.block-sequence .seq-pill { transition: opacity 240ms ease-out, visibility 240ms, background var(--t) var(--ease); }
.block-sequence .seq-pill.used { visibility: hidden; opacity: 0; }
.block-sequence .seq-slot, .block-sequence .seq-pill {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px 10px 20px; border: 0; border-radius: var(--r);
  font: 400 17px/1.4 var(--serif); text-align: left; color: var(--text);
}
.block-sequence .seq-slot { background: var(--quiet); }
.block-sequence .seq-pill { padding-left: 16px; background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--line); transition: background var(--t) var(--ease); }
.block-sequence .seq-pill:hover { background: var(--quiet-2); }
.block-sequence .seq-txt { flex: 1; min-width: 0; }
.block-sequence .mark { display: grid; margin-top: 4px; }
.block-sequence .seq-ctl { display: flex; flex: none; gap: 6px; width: 94px; justify-content: flex-end; }
.block-sequence .seq-ctl button.option { width: 44px; padding: 0; background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--outline); font-size: 17px; }
.block-sequence .seq > li.is-wrong .seq-slot { background: var(--bad-bg); box-shadow: inset 0 0 0 2px var(--bad); }
.block-sequence .seq > li.is-correct .seq-slot { background: var(--ok-bg); box-shadow: inset 0 0 0 2px var(--ok-edge); }
.block-sequence .seq > li.is-correct .seq-ctl { visibility: hidden; }
.block-sequence .actions { margin-left: 40px; }
.block-sequence .feedback p { margin: 0 0 8px; }
.block-sequence .seq-head { font-weight: 600; }
.block-sequence .feedback button.option { background: var(--sheet); margin-top: 4px; }
@media (max-width: 640px) {
  .block-sequence .seq > li { padding-left: 34px; }
  .block-sequence .seq > li.placed::before { left: 10px; }
  .block-sequence .seq > li::after { width: 24px; height: 24px; font-size: 12px; }
  .block-sequence .seq-ctl { flex-direction: column; width: 44px; }
  .block-sequence .seq-slot, .block-sequence .seq-pill { padding: 8px 8px 8px 14px; }
  .block-sequence .actions, .block-sequence .seq-zone { margin-left: 0; }
}
/* . */

/* == activity: hotspot == */
.block-hotspot .graphic svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: var(--action); }
.block-hotspot .graphic line { stroke: currentColor; stroke-width: 5; stroke-linecap: round; marker-end: url(#hs-head); stroke-dasharray: 1; animation: hs-draw 600ms var(--ease-out) both; }
.block-hotspot .graphic line.in { stroke-dasharray: .07 .05; stroke-width: 4; animation: none; } /* arrows that arrive: dashed */
@keyframes hs-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
/* the white circle invites a selection; it becomes the verdict badge */
.block-hotspot .region { border-radius: 28px; }
.block-hotspot .region.is-correct, .block-hotspot .region.is-wrong { background: transparent; } /* keep the label at full contrast */
.block-hotspot .region.is-correct::before, .block-hotspot .region.is-wrong::before { content: ""; position: absolute; top: -11px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--ok) var(--ico-ok) center / 12px no-repeat; box-shadow: 0 0 0 3px var(--sheet); }
.block-hotspot .region.is-wrong::before { background: var(--bad) var(--ico-bad) center / 12px no-repeat; }
@media (max-width: 560px) { .block-hotspot .region.is-correct::before, .block-hotspot .region.is-wrong::before { top: -9px; right: -9px; width: 16px; height: 16px; background-size: 9px; box-shadow: 0 0 0 2px var(--sheet); } }
@media (prefers-reduced-motion: reduce) { .block-hotspot .graphic line { animation: none; } }
/* . */

/* == activity: scenario == */
.block-scenario .leaf { display: flex; flex-direction: column; }
.block-scenario .stack > .phantom.leaf { display: flex; }
.block-scenario h3 { margin: 0 0 12px; font: 600 14.5px/1.2 var(--ui); color: var(--text-2); outline: none; }
.block-scenario .react { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 16px; }
.block-scenario .feedback { margin: 0; }
.block-scenario .feedback.ok, .block-scenario .feedback.bad { align-self: stretch; }
.block-scenario .feedback strong, .block-scenario .why { display: block; }
.block-scenario .feedback.done { margin: 14px 0; }
.block-scenario .react .bubble { margin: 0; }
.block-scenario .say-row { display: flex; align-items: flex-end; gap: 10px; margin: 0 12% 18px 0; }
.block-scenario .say-row .bubble { flex: 1; margin: 0; border-radius: 26px 26px 26px 8px; }
.block-scenario .face { flex: none; display: block; color: var(--text-2); margin-bottom: 2px; }
.block-scenario .react .say-row { margin: 0; align-self: stretch; }
.block-scenario .sc-ask { margin: 0 0 8px 12%; font: 400 14px/1.3 var(--ui); color: var(--text-2); }
.block-scenario .reply-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; }
.block-scenario .reply-row .options { padding-right: 12px; border-right: 1.5px solid var(--line); }
.block-scenario .you { align-self: end; padding: 4px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--outline); font: 600 12.5px/1.2 var(--ui); color: var(--text-2); }
.block-scenario .sc-nav { display: flex; align-items: center; gap: 4px; margin: 0 0 12px -10px; }
.block-scenario .sc-where { font: 600 14.5px/1.2 var(--ui); color: var(--text-2); padding: 0 4px; }
.block-scenario .sc-go { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; font: 400 22px/1 var(--serif); color: var(--text); cursor: pointer; transition: background var(--t) var(--ease), opacity var(--t) var(--ease); }
.block-scenario .sc-go:hover:not(:disabled) { background: var(--quiet-2); }
.block-scenario .sc-go:disabled { opacity: 0; cursor: default; } /* no way there yet: the arrow simply is not shown */
.block-scenario .sc-go:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.block-scenario .leaf > h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* the toggle shows where we are */
/* . */

/* == activity: quiz == */
.block-quiz .statement td .mark:not([data-show]) { display: none; }
.block-quiz .statement td .mark[data-show] ~ .pend { display: none; }
.block-quiz .statement .pend { font: 400 14px/1.2 var(--ui); color: var(--text-2); }
.block-quiz .statement tfoot td { padding-top: 10px; font: 600 14.5px/1.3 var(--ui); color: var(--text); }
.block-quiz .question + .question { margin-top: 44px; }
.block-quiz .statement { width: 100%; margin-top: 44px; border-collapse: collapse; }
.block-quiz .statement th, .block-quiz .statement td { padding: 10px 0; text-align: left; font-weight: 400; border-top: 1px solid var(--line); }
.block-quiz .result { font-weight: 400; }
.block-quiz .actions { display: grid; justify-items: start; }
.block-quiz .actions > * { grid-area: 1 / 1; }
.block-quiz .actions > [hidden] { display: inline-flex !important; visibility: hidden; }
/* . */
/* sign out at the top right, the language just below; the sidebar scrolls with the wheel or a finger, no visible bar */
.nav { scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
/* the one line of words on the lock screen: small, grey, typewriter */
.lock-line { white-space: nowrap; margin: 0 0 6px; /* like a terminal: the message, then the prompt */ font: 400 15px/1.45 var(--term); letter-spacing: .03em; color: #9A9DA2; text-shadow: 0 0 4px rgba(236,237,238,.18); }
/* No motion: the glass is already still. A sharp mark, and no glow on the letters.
   The wait is told in place. A refused key writes nothing: the point goes red. */
@media (prefers-reduced-motion: reduce) {
  .lock-card .logo .logo-tri,
  .lock-card .logo .slip img { filter: drop-shadow(0 0 2px rgba(236,237,238,.45)); }
  .lock .grain { display: none; }
  .lock-line, .stars { text-shadow: none; }
  .stars::after { box-shadow: none; }
  #lock-msg[data-kind="opening"] {
    width: auto; height: auto; min-height: 0; overflow: visible; clip-path: none;
    color: #9A9DA2; font: 400 15px/1.45 var(--term); letter-spacing: .03em;
  }
  .lock:has(#lock-msg[data-kind="opening"]) .logo { opacity: .72; }
}
