/* sciencegcse.co.uk GCSE lessons: shared styles for the lesson app
   (KS3-style learning screens, checkpoints, quiz, exam questions, notes panel).
   Pair with sg-gcse-lesson.js. Lesson content and lesson-only diagram styles go in each page.
   Subject colour: biology uses green trim (the default here). A chemistry or physics page
   overrides --accent, --accent-strong, --accent-soft, --accent-ink and --trim in its own <style>. */

:root{
  --brand:#081a33; --brand-2:#0f2747; --brand-ink:#ffffff; --brand-muted:#b9c6d6; --trim:#2E7D32;
  --bg:#f3f6f4; --card:#ffffff; --text:#17201a; --muted:#56615a; --border:#d2dbd4; --line:#e5ebe6;
  --stage:#f8faf8; --btn:#ffffff; --ink:#17201a;
  --accent:#2E7D32; --accent-strong:#1f5f24; --accent-soft:#E7F3E8; --accent-ink:#ffffff;
  --good:#2E7D32; --good-soft:#E7F3E8; --bad:#B03A2E; --bad-soft:#FBECEC;
  --tip:#1F5FA8; --tip-soft:#E8F1F8; --focus:#1F5FA8;
  --shadow:0 1px 2px rgba(8,26,51,.06),0 6px 22px rgba(8,26,51,.07);
  /* biology diagram kit (blood colours: red = oxygenated, blue = low in oxygen) */
  --muscle:#E3B5A8; --muscle-2:#d39a8a; --muscle-edge:#A0503F; --oxy:#C0392B; --oxy-soft:#F6D3CE;
  --deoxy:#2F6DB5; --deoxy-soft:#D5E3F5; --spark:#C98A00; --squeeze:#7A3FB0; --hilite:#F2B705; --fat:#EBC872;
  /* cells and plants (B2 L1, L12 to L14) */
  --cell:#F4EBC9; --cell-edge:#8C7A3C; --nucleus:#9B7FC1; --chloro:#4E9A3A; --leaf:#7DB55B; --xylem:#8D6E63; --phloem:#C8A2C8;
  /* stains (micrograph-style art), food-test results (always name the colour in words too), air and gases */
  --stain-pink:#E7A1C0; --stain-purple:#6A4C93; --benedict-blue:#2F6FD0; --benedict-green:#5FA83A; --benedict-yellow:#E3C02A;
  --benedict-orange:#E07A26; --brick-red:#A8402A; --iodine-brown:#C27A2C; --iodine-black:#1E2650; --biuret-blue:#4F86D4;
  --biuret-purple:#7A3E9E; --sudan-red:#C8352B; --air:#E3EEF7; --gas-o2:#D9534F; --gas-co2:#5E6A71; --vapour:#6FA8D6;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --brand:#081a33; --brand-2:#0f2747; --brand-ink:#ffffff; --brand-muted:#b9c6d6; --trim:#2E7D32;
  --bg:#101512; --card:#19211c; --text:#ecf1ed; --muted:#a6b2aa; --border:#334039; --line:#26302a;
  --stage:#151c17; --btn:#1e2822; --ink:#ecf1ed;
  --accent:#81C784; --accent-strong:#a5d6a7; --accent-soft:#1f3322; --accent-ink:#0d1a0f;
  --good:#81C784; --good-soft:#1f3322; --bad:#F09595; --bad-soft:#3a2626;
  --tip:#8DBAF0; --tip-soft:#1f2c3b; --focus:#8DBAF0;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 6px 22px rgba(0,0,0,.25);
  --muscle:#7a5a53; --muscle-2:#6a4a44; --muscle-edge:#d29a8d; --oxy:#F08A80; --oxy-soft:#4a2321;
  --deoxy:#86B6EE; --deoxy-soft:#22364f; --spark:#F2C14E; --squeeze:#CDA8F7; --hilite:#F2C14E; --fat:#9c8445;
  --cell:#4a4330; --cell-edge:#cbb46a; --nucleus:#b9a2de; --chloro:#7cc466; --leaf:#5f8f45; --xylem:#b8968b; --phloem:#d9b8d9;
  --stain-pink:#e9a9c6; --stain-purple:#b39ddb; --benedict-blue:#7aa8ee; --benedict-green:#8fcf6a; --benedict-yellow:#f0d35a;
  --benedict-orange:#f3a05a; --brick-red:#e07a62; --iodine-brown:#e0a35e; --iodine-black:#9aa6e6; --biuret-blue:#8fb6ee;
  --biuret-purple:#c79be3; --sudan-red:#f08a80; --air:#22303a; --gas-o2:#f08a80; --gas-co2:#aab6bd; --vapour:#9cc8ec;
  color-scheme:dark}}
:root[data-theme="dark"]{
  --brand:#081a33; --brand-2:#0f2747; --brand-ink:#ffffff; --brand-muted:#b9c6d6; --trim:#2E7D32;
  --bg:#101512; --card:#19211c; --text:#ecf1ed; --muted:#a6b2aa; --border:#334039; --line:#26302a;
  --stage:#151c17; --btn:#1e2822; --ink:#ecf1ed;
  --accent:#81C784; --accent-strong:#a5d6a7; --accent-soft:#1f3322; --accent-ink:#0d1a0f;
  --good:#81C784; --good-soft:#1f3322; --bad:#F09595; --bad-soft:#3a2626;
  --tip:#8DBAF0; --tip-soft:#1f2c3b; --focus:#8DBAF0;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 6px 22px rgba(0,0,0,.25);
  --muscle:#7a5a53; --muscle-2:#6a4a44; --muscle-edge:#d29a8d; --oxy:#F08A80; --oxy-soft:#4a2321;
  --deoxy:#86B6EE; --deoxy-soft:#22364f; --spark:#F2C14E; --squeeze:#CDA8F7; --hilite:#F2C14E; --fat:#9c8445;
  --cell:#4a4330; --cell-edge:#cbb46a; --nucleus:#b9a2de; --chloro:#7cc466; --leaf:#5f8f45; --xylem:#b8968b; --phloem:#d9b8d9;
  --stain-pink:#e9a9c6; --stain-purple:#b39ddb; --benedict-blue:#7aa8ee; --benedict-green:#8fcf6a; --benedict-yellow:#f0d35a;
  --benedict-orange:#f3a05a; --brick-red:#e07a62; --iodine-brown:#e0a35e; --iodine-black:#9aa6e6; --biuret-blue:#8fb6ee;
  --biuret-purple:#c79be3; --sudan-red:#f08a80; --air:#22303a; --gas-o2:#f08a80; --gas-co2:#aab6bd; --vapour:#9cc8ec;
  color-scheme:dark}

/* ---------- base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{scroll-padding-top:12px;-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;font-size:17px;line-height:1.55}
img,svg{max-width:100%}
a{color:var(--tip)}
p{margin:0 0 10px}
h1,h2,h3{text-wrap:balance}
sub,sup{line-height:0}
button,input,textarea,select{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px;border-radius:6px}
[hidden]{display:none!important}
.gl-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.gl-skip{position:absolute;left:12px;top:-60px;z-index:100;background:var(--card);color:var(--text);padding:10px 14px;border-radius:10px;font-weight:700;box-shadow:var(--shadow)}
.gl-skip:focus{top:10px}
.gl-wrap{max-width:1480px;margin:0 auto;padding:0 20px}

/* ---------- header ---------- */
.gl-header{background:var(--brand);color:var(--brand-ink);border-bottom:4px solid var(--trim)}
.gl-header .gl-wrap{display:flex;align-items:center;flex-wrap:wrap;gap:6px 18px;min-height:52px;padding-top:6px;padding-bottom:6px}
.gl-logo{color:var(--brand-ink);font-weight:800;font-size:19px;letter-spacing:.1px;text-decoration:none;display:inline-flex;align-items:center;gap:9px}
.gl-logo svg{width:22px;height:22px;flex:none}
.gl-topnav{display:flex;flex-wrap:wrap;gap:2px;margin-left:auto;align-items:center}
.gl-topnav a,.gl-theme{color:var(--brand-muted);text-decoration:none;font-weight:600;font-size:14.5px;padding:8px 11px;border-radius:9px;line-height:1.2;min-height:36px;display:inline-flex;align-items:center}
.gl-topnav a:hover,.gl-theme:hover{color:#fff;background:rgba(255,255,255,.09)}
.gl-theme{background:none;border:1px solid rgba(255,255,255,.18);cursor:pointer;gap:6px}
.gl-theme svg{width:16px;height:16px}

/* ---------- title area ---------- */
.gl-hero{padding-top:10px;padding-bottom:12px}
.gl-crumbs{font-size:13.5px;color:var(--muted);margin:0 0 6px}
.gl-crumbs a{color:var(--muted)}
.gl-crumbs span[aria-hidden]{margin:0 5px}
.gl-labels{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 4px}
.gl-code{display:inline-flex;align-items:center;font-weight:800;font-size:13.5px;letter-spacing:.3px;background:var(--accent);color:var(--accent-ink);border-radius:99px;padding:3px 11px;line-height:1.3}
.gl-tag{font-size:12.5px;font-weight:600;color:var(--text);background:var(--accent-soft);border-radius:99px;padding:3px 10px;line-height:1.3}
.gl-hero h1{font-size:clamp(25px,3.4vw,31px);line-height:1.15;margin:2px 0 4px}
/* the lesson code in front of the title, e.g. "B2 L6", in the subject colour */
.gl-h1code{color:var(--accent);margin-right:.32em;white-space:nowrap}
.gl-intro{font-size:16.5px;color:var(--muted);margin:0;max-width:80ch}
@media (min-width:1000px){
  .gl-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"crumbs labels" "title title" "intro intro";column-gap:16px;align-items:center}
  .gl-crumbs{grid-area:crumbs;margin:0}
  .gl-labels{grid-area:labels;margin:0;justify-content:flex-end}
  .gl-hero h1{grid-area:title;margin:4px 0 3px}
  .gl-intro{grid-area:intro;max-width:none}
}
/* short laptop screens (1366x657, 1536x730, 1280x649): a compact title area, so the whole lesson card fits on load */
@media (min-width:1000px) and (max-height:820px){
  .gl-hero{padding-top:4px;padding-bottom:6px}
  .gl-hero h1{font-size:24px;margin:0}
  .gl-intro{font-size:15px}
  .gl-crumbs{font-size:13px}
}

/* ---------- lesson area: card + notes side by side on desktop ---------- */
.gl-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
.gl-main{min-width:0}
@media (min-width:1000px){
  .gl-layout{grid-template-columns:minmax(0,1fr) clamp(320px,25vw,370px)}
  .gl-layout.notes-hidden{grid-template-columns:minmax(0,1fr) 46px}
}

/* ---------- the lesson card ---------- */
.gl-card{background:var(--card);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);display:flex;flex-direction:column;position:relative;scroll-margin-top:10px}
.gl-top{display:flex;align-items:center;gap:12px;padding:12px 18px 8px}
.gl-progress{display:flex;align-items:center;gap:4px;flex:1;min-width:0;margin:0;padding:0;list-style:none}
.gl-progress li{flex:1;min-width:0;display:flex}
.gl-progress li.cp{flex:0 0 auto}
.gl-progress li.qz{flex:0 0 auto;margin-left:4px}
.gl-seg{flex:1;min-width:0;height:28px;padding:0;border:0;background:none;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:6px}
.gl-seg .bar{display:block;width:100%;height:8px;border-radius:99px;background:var(--line);transition:background .25s}
.gl-seg.visited .bar{background:var(--accent)}
.gl-seg.current .bar{background:var(--accent);box-shadow:0 0 0 2px var(--card),0 0 0 4px var(--accent)}
.gl-seg.flag{width:28px;flex:none}
.gl-seg.flag .ic{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:var(--card);border:2px solid var(--border);color:var(--muted);transition:all .25s}
.gl-seg.flag .ic svg{width:13px;height:13px}
.gl-seg.flag.visited .ic{border-color:var(--accent);color:var(--accent)}
.gl-seg.flag.done .ic{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.gl-seg.flag.current .ic{box-shadow:0 0 0 2px var(--card),0 0 0 4px var(--accent)}
.gl-seg.quiz{width:auto;padding:0 10px;height:28px;border-radius:99px;border:2px solid var(--border);font-size:12.5px;font-weight:700;color:var(--muted);background:var(--card)}
.gl-seg.quiz.visited{border-color:var(--accent);color:var(--accent)}
.gl-seg.quiz.current{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.gl-count{margin:0;font-size:14px;font-weight:700;color:var(--muted);white-space:nowrap}
.gl-count:empty{display:none}

.gl-welcome{margin:2px 18px 6px;padding:8px 10px 8px 14px;border-radius:12px;background:var(--accent-soft);display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;font-size:15px;font-weight:600}
.gl-welcome p{margin:0;flex:1;min-width:12em}
.gl-welcome .gl-x{background:none;border:0;color:var(--muted);cursor:pointer;font-size:20px;line-height:1;width:36px;height:36px;border-radius:8px}

.gl-screens{flex:1 1 auto;min-height:0;padding:4px 18px 8px}
.gl-screen{outline:none}
.js .gl-screen:not(.is-active){display:none}
.gl-shead{display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 12px;margin:2px 0 8px}
.gl-kicker{margin:0;font-size:12.5px;font-weight:800;letter-spacing:.7px;text-transform:uppercase;color:var(--accent);display:inline-flex;align-items:center;gap:6px}
.gl-kicker svg{width:15px;height:15px}
.gl-shead h2{margin:0;font-size:clamp(21px,2.2vw,25px);line-height:1.2;outline:none}
.gl-shead h2 .cp-flag{width:.82em;height:.82em;margin-right:8px;vertical-align:-.06em;color:var(--accent)}
.gl-lines{margin:0 0 10px;padding:0;list-style:none;font-size:16.5px}
.gl-lines li{position:relative;padding-left:20px;margin:0 0 7px;max-width:62ch}
.gl-lines li::before{content:"";position:absolute;left:3px;top:.62em;width:8px;height:8px;border-radius:50%;background:var(--accent)}
.gl-sbody{display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:"lines" "vis" "ctrl";gap:4px 0}
.gl-text{grid-area:lines;min-width:0}
.gl-ctrl{grid-area:ctrl;min-width:0}
.gl-vis{grid-area:vis;min-width:0;display:flex;flex-direction:column;align-items:stretch;margin:0}
.gl-stage{background:var(--stage);border:1px solid var(--border);border-radius:14px;padding:8px;display:flex;align-items:center;justify-content:center;min-height:0;position:relative;overflow:hidden}
.gl-stage>svg{display:block;width:100%;height:auto}
.gl-cap{font-size:14.5px;color:var(--muted);margin:6px 2px 0}
.gl-legend{display:flex;flex-wrap:wrap;gap:4px 16px;font-size:14px;color:var(--muted);margin:6px 2px 0}
.gl-legend span{display:inline-flex;align-items:center;gap:6px}
.lg-o,.lg-d{width:12px;height:12px;border-radius:50%;display:inline-block;flex:none}
.lg-o{background:var(--oxy)}.lg-d{background:var(--deoxy)}

/* desktop app mode: JS adds .is-wide (card at least 640px wide on a computer screen or a phone held sideways:
   text beside the picture), .is-mid (a wide card under 820px, e.g. iPad landscape or a laptop at 125% zoom)
   and .is-fit (card sized to the window) */
.gl-card.is-wide .gl-sbody{grid-template-columns:minmax(280px,.6fr) minmax(0,1fr);grid-template-rows:auto 1fr;grid-template-areas:"lines vis" "ctrl vis";gap:0 22px}
.gl-card.is-wide .gl-sbody.wide-vis{grid-template-columns:minmax(230px,.3fr) minmax(0,1fr)}
.gl-card.is-wide .gl-sbody.wide-text{grid-template-columns:minmax(300px,.8fr) minmax(0,1fr)}
.gl-card.is-wide .gl-sbody.vis-first{grid-template-columns:minmax(0,1fr) minmax(250px,.37fr);grid-template-areas:"vis lines" "vis ctrl"}
.gl-card.is-wide .gl-lines{font-size:17px}
.gl-card.is-mid .gl-sbody{grid-template-columns:minmax(210px,.55fr) minmax(0,1fr);gap:0 16px}
.gl-card.is-mid .gl-sbody.wide-vis{grid-template-columns:minmax(190px,.3fr) minmax(0,1fr)}
.gl-card.is-mid .gl-sbody.wide-text{grid-template-columns:minmax(220px,.62fr) minmax(0,1fr)}
.gl-card.is-mid .gl-lines{font-size:16px}
.gl-card.is-mid .gl-lines li{padding-left:17px}
/* a fitted mid-width card keeps a step-through on one row of buttons (the step name shows which step it is) */
.gl-card.is-mid.is-fit .gl-stepbar .gl-dots{display:none}
.gl-card.is-mid.is-fit .gl-sbody.steps{grid-template-columns:minmax(240px,.8fr) minmax(0,1fr)}
/* short windows (laptops): a step-through gets a wider text column, so its caption fits under the buttons */
@media (max-height:700px){.gl-card.is-fit:not(.is-mid) .gl-sbody.steps{grid-template-columns:minmax(300px,.85fr) minmax(0,1fr)}}
.gl-card.is-mid .gl-screens{padding-left:14px;padding-right:14px}
.gl-card.is-mid .gl-top{padding-left:14px;padding-right:14px}
@media (max-height:860px){.gl-card.is-fit .gl-lines{font-size:16px;margin-bottom:4px}.gl-card.is-fit .gl-lines li{margin-bottom:5px}.gl-card.is-fit .gl-stepcap{font-size:15px;min-height:0;padding:8px 11px}.gl-card.is-fit .gl-callout{font-size:14.5px;padding:7px 10px;margin:6px 0 2px;line-height:1.45}.gl-card.is-fit .gl-legend{font-size:13px;gap:2px 12px;margin-top:4px}.gl-card.is-fit .gl-cap{font-size:13.5px;margin-top:4px}
  .gl-card.is-fit .gl-cp-intro{margin-bottom:6px;font-size:15.5px}
  .gl-card.is-fit .gl-cq{padding:9px 10px}
  .gl-card.is-fit .gl-cq .q{font-size:15.5px;margin-bottom:6px;line-height:1.35}
  .gl-card.is-fit .gl-opts{gap:5px}
  .gl-card.is-fit .gl-opt{min-height:40px;padding:6px 10px;font-size:15px;line-height:1.3}
  .gl-card.is-fit .gl-fb{margin-top:6px;font-size:14.5px;line-height:1.4}
  .gl-card.is-fit .gl-cp-sum{margin-top:8px;padding:6px 12px;font-size:15px}
  .gl-card.is-fit .gl-qq .q{font-size:17px;margin-bottom:8px}
  .gl-card.is-fit .gl-qq .gl-opt{min-height:44px;font-size:15.5px}
  .gl-card.is-fit .gl-qq .gl-fb{padding:8px 11px;margin-top:8px;font-size:15px}
  .gl-card.is-fit .gl-qend .big{font-size:26px}
}
.gl-card.is-fit{height:var(--gl-fit-h,640px)}
/* fitted: the lines take what they need (and scroll if the window is very short); the controls below them always
   keep at least 96px. On any wide card, a step-through's buttons come straight under the step name, before the caption */
.gl-card.is-fit .gl-screens{overflow:auto;display:flex;flex-direction:column}
.gl-card.is-fit .gl-screen.is-active{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.gl-card.is-fit .gl-sbody{flex:1 1 auto;min-height:0;grid-template-rows:minmax(0,auto) minmax(96px,1fr)}
.gl-card.is-wide .gl-steps{display:flex;flex-direction:column}
.gl-card.is-wide .gl-steptag{order:1}
.gl-card.is-wide .gl-stepbar{order:2}
.gl-card.is-wide .gl-stepcap{order:3;margin:8px 0 0}
.gl-card.is-fit .gl-vis{min-height:0;height:100%}
.gl-card.is-fit .gl-vis .gl-stage{flex:1 1 0;min-height:180px}
.gl-card.is-fit .gl-stage>svg,.gl-card.is-fit .gl-stage>.gl-media{position:absolute;left:8px;top:8px;width:calc(100% - 16px);height:calc(100% - 16px)}
.gl-card.is-fit .gl-text,.gl-card.is-fit .gl-ctrl{overflow:auto}
.gl-card.is-fit .gl-text.more,.gl-card.is-fit .gl-ctrl.more{-webkit-mask-image:linear-gradient(#000 calc(100% - 30px),transparent);mask-image:linear-gradient(#000 calc(100% - 30px),transparent)}
/* a wide card that is not fitted (a phone held sideways): picture and text side by side, both above the bottom bar */
.gl-card.is-wide:not(.is-fit) .gl-stage>svg{max-height:68vh;max-height:calc(100vh - 170px);max-height:calc(100svh - 170px)}
@media (max-height:560px){.gl-card.is-wide:not(.is-fit) .gl-lines{font-size:15px}.gl-card.is-wide:not(.is-fit) .gl-lines li{margin-bottom:4px}}
/* one column (phones, tablets held upright): keep each picture short enough to see its buttons with it */
.gl-card:not(.is-wide) .gl-stage>svg{max-height:55vh;max-height:55svh}
.gl-media{display:flex;align-items:center;justify-content:center}
.gl-media img{display:block;max-width:100%;max-height:100%;width:auto;height:auto}

/* bottom navigation */
.gl-nav{display:flex;align-items:center;gap:10px;padding:10px 18px 14px;border-top:1px solid var(--line);background:var(--card);border-radius:0 0 18px 18px}
/* whenever the card is not fitted to the window, its Back / Next bar stays on screen at the bottom */
.gl-card:not(.is-fit) .gl-nav{position:sticky;bottom:0;z-index:5;box-shadow:0 -6px 16px rgba(0,0,0,.06)}
.gl-nav .gl-spacer{flex:1}
/* "Notes" in the bottom bar: only on phones and tablets (on a computer the notes sit beside the card) */
.gl-nav .gl-navnotes{display:none}
.gl-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:9px 18px;border-radius:12px;border:1px solid var(--border);background:var(--btn);color:var(--text);font-weight:650;font-size:16px;cursor:pointer;text-decoration:none;line-height:1.2;transition:background .15s,border-color .15s,transform .1s}
.gl-btn:active{transform:translateY(1px)}
.gl-btn[disabled]{opacity:.45;cursor:not-allowed;transform:none}
.gl-btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.gl-btn.soft{background:var(--accent-soft);border-color:transparent;color:var(--text)}
.gl-btn.link{background:none;border-color:transparent;color:var(--muted);text-decoration:underline;text-underline-offset:3px;padding-left:10px;padding-right:10px}
/* hover only where there is a real pointer: on touch screens :hover sticks after a tap */
@media (hover:hover){
  .gl-btn:hover{border-color:var(--accent)}
  .gl-btn.primary:hover{background:var(--accent-strong);border-color:var(--accent-strong)}
  .gl-btn.soft:hover{border-color:var(--accent)}
  .gl-btn.link:hover{color:var(--text);border-color:transparent}
}
.gl-btn.small{min-height:40px;padding:7px 13px;font-size:15px}
.gl-btn svg{width:18px;height:18px;flex:none}
.gl-nav .is-invisible{visibility:hidden}

/* switches and chips */
.gl-switch{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:15px;font-weight:600;color:var(--muted);margin:4px 0}
.gl-switch .seg{display:inline-flex;border:1px solid var(--border);border-radius:99px;padding:3px;background:var(--btn)}
.gl-switch button{border:0;background:none;border-radius:99px;min-height:38px;min-width:58px;padding:5px 14px;font-weight:700;font-size:15px;color:var(--muted);cursor:pointer}
.gl-switch button[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink)}
.gl-chips{display:flex;flex-wrap:wrap;gap:7px;margin:6px 0}
.gl-chip{display:inline-flex;align-items:center;gap:7px;min-height:42px;padding:6px 13px 6px 7px;border-radius:99px;border:1px solid var(--border);background:var(--btn);font-weight:650;font-size:15px;cursor:pointer;color:var(--text);line-height:1.2}
.gl-chip .n{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:var(--accent-soft);color:var(--text);font-size:14px;font-weight:800;flex:none}
.gl-chip.no-n{padding-left:13px}
@media (hover:hover){.gl-chip:hover{border-color:var(--accent)}}
.gl-chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.gl-chip[aria-pressed="true"] .n{background:var(--accent-ink);color:var(--accent)}
.gl-callout{border-left:4px solid var(--accent);background:var(--accent-soft);border-radius:0 12px 12px 0;padding:9px 12px;margin:8px 0 4px;font-size:15.5px;display:flex;gap:10px;align-items:flex-start;min-height:3.2em}
.gl-callout p{margin:0}
.gl-callout .n{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:var(--accent-ink);font-size:14px;font-weight:800;flex:none;margin-top:1px}
.gl-callout.empty{color:var(--muted)}

/* step-through animations */
.gl-steps{margin:6px 0 0}
.gl-steptag{display:flex;align-items:center;gap:8px;margin:0 0 6px;font-weight:750;font-size:15px}
.gl-steptag .n{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:var(--accent-ink);font-size:14px;font-weight:800;flex:none}
.gl-stepcap{font-size:16px;line-height:1.5;margin:0 0 10px;min-height:4.5em;padding:10px 12px;background:var(--stage);border:1px solid var(--line);border-radius:12px}
.gl-stepbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.gl-stepbar .gl-btn{min-height:42px}
.gl-iconbtn{width:44px;padding:0}
.gl-dots{display:flex;gap:2px;margin-left:auto;flex-wrap:wrap}
.gl-dots button{width:22px;height:30px;border:0;background:none;padding:0;cursor:pointer;display:grid;place-items:center;border-radius:6px}
.gl-dots button::before{content:"";width:9px;height:9px;border-radius:50%;background:var(--border);transition:all .2s}
.gl-dots button[aria-current="step"]::before{background:var(--accent);width:11px;height:11px}
.gl-dots button.seen::before{background:var(--accent);opacity:.45}
.gl-dots button[aria-current="step"].seen::before{opacity:1}

/* ---------- checkpoints ---------- */
.gl-cp-intro{margin:0 0 10px;font-size:16px}
.gl-cp-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.gl-card.is-wide .gl-cp-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.gl-cq{border:1px solid var(--border);border-radius:14px;padding:12px;background:var(--stage)}
.gl-cq .q{font-weight:700;margin:0 0 8px;font-size:16px}
.gl-cq .q .num{color:var(--accent);margin-right:4px}
.gl-opts{display:flex;flex-direction:column;gap:7px;margin:0;padding:0;list-style:none}
.gl-opt{width:100%;display:flex;align-items:flex-start;gap:10px;text-align:left;min-height:46px;padding:9px 11px;border-radius:11px;border:1.5px solid var(--border);background:var(--card);cursor:pointer;font-size:15.5px;line-height:1.35;color:var(--text)}
@media (hover:hover){.gl-opt:hover:not(.done):not([disabled]){border-color:var(--accent)}}
.gl-opt .l{width:24px;height:24px;border-radius:50%;flex:none;display:grid;place-items:center;font-weight:800;font-size:13.5px;background:var(--line);color:var(--text);margin-top:-1px}
.gl-opt .t{flex:1}
.gl-opt .m{font-weight:900;font-size:17px;line-height:1;margin-top:2px}
.gl-opt[disabled]{cursor:default}
.gl-opt.right{border-color:var(--good);background:var(--good-soft)}
.gl-opt.right .l{background:var(--good);color:var(--card)}
.gl-opt.right .m{color:var(--good)}
.gl-opt.wrong,.gl-opt.wrong:hover{border-color:var(--bad);border-width:2px;background:var(--bad-soft)}
.gl-opt.right:hover{border-color:var(--good)}
.gl-opt.wrong .l{background:var(--bad);color:var(--card)}
.gl-opt.wrong .m{color:var(--bad)}
.gl-opt.dim{opacity:.62}
.gl-fb{margin:8px 0 0;font-size:15px;line-height:1.45}
.gl-fb:empty{display:none}
.gl-fb.ok b{color:var(--good)}
.gl-fb.no b{color:var(--bad)}
.gl-cp-sum{margin:12px 0 0;padding:10px 14px;border-radius:12px;background:var(--accent-soft);display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;font-size:16px}
.gl-cp-sum p{margin:0;flex:1;min-width:14em}
.gl-cp-sum b{font-size:17px}

/* ---------- quiz ---------- */
.gl-quiz-body{max-width:760px;margin:0 auto;width:100%}
.gl-qhead{display:flex;align-items:center;gap:10px;margin:0 0 8px;font-weight:700;color:var(--muted);font-size:14.5px}
.gl-qbar{flex:1;height:6px;border-radius:99px;background:var(--line);overflow:hidden}
.gl-qbar i{display:block;height:100%;background:var(--accent);border-radius:99px;transition:width .3s}
.gl-qq .q{font-size:18px;font-weight:700;margin:0 0 12px;line-height:1.4}
.gl-qq .gl-opt{font-size:16px;min-height:50px}
.gl-qq .gl-fb{font-size:16px;padding:10px 12px;border-radius:12px;background:var(--stage);border:1px solid var(--line);margin-top:10px}
.gl-qend{text-align:left}
.gl-qend .big{font-size:30px;font-weight:800;margin:4px 0 2px}
.gl-qend .best{font-weight:700;color:var(--accent);margin:0 0 8px}
.gl-qend ul{padding-left:20px;margin:6px 0 12px}
.gl-qend li{margin:3px 0}
.gl-qend .look{line-height:1.6}
.gl-qend .row{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}
.gl-reset{background:none;border:0;padding:6px 0;color:var(--muted);text-decoration:underline;cursor:pointer;font-size:14px}

/* ---------- notes panel ---------- */
.gl-notes{background:var(--card);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);min-width:0}
.gl-notes-head{display:flex;align-items:center;gap:8px;padding:10px 10px 8px 16px;border-bottom:1px solid var(--line)}
.gl-notes-head h2{margin:0;font-size:17px;flex:1;outline:none}
.gl-notes-head h2 .gl-code{font-size:12px;margin-right:6px;vertical-align:1px}
.gl-notes-body{padding:12px 16px 14px;font-size:15px;line-height:1.5}
.gl-notes-body h3{font-size:15.5px;margin:14px 0 4px;color:var(--accent)}
.gl-notes-body h3:first-child{margin-top:0}
.gl-notes-body ul{padding-left:18px;margin:4px 0 8px}
.gl-notes-body li{margin:3px 0}
.gl-notes-body p{margin:0 0 6px}
.gl-notes-body .mini{display:block;width:100%;max-width:300px;height:auto;margin:6px auto 8px}
.gl-notes-foot{border-top:1px solid var(--line);padding:10px 16px 14px;font-size:14.5px;display:flex;flex-direction:column;gap:8px}
.gl-notes-tab{display:none}
.gl-notes-bar,.gl-notes-close-end,.gl-notes-x{display:none}
@media (min-width:1000px){
  .gl-notes{position:sticky;top:12px;max-height:calc(100vh - 24px);display:flex;flex-direction:column}
  .gl-notes.fit{height:var(--gl-notes-h,auto)}
  .gl-notes-scroll{overflow:auto;flex:1 1 auto;min-height:0;overscroll-behavior:contain}
  /* JS adds .more while there is more to scroll: a soft fade at the bottom says the notes go on */
  .gl-notes-scroll.more{-webkit-mask-image:linear-gradient(#000 calc(100% - 34px),transparent);mask-image:linear-gradient(#000 calc(100% - 34px),transparent)}
  .notes-hidden .gl-notes{background:none;border:0;box-shadow:none}
  .notes-hidden .gl-notes-head,.notes-hidden .gl-notes-scroll{display:none}
  .notes-hidden .gl-notes-tab{display:flex}
  .gl-notes-tab{flex-direction:column;align-items:center;gap:8px;width:46px;padding:14px 0;border-radius:14px;border:1px solid var(--border);background:var(--card);box-shadow:var(--shadow);cursor:pointer;color:var(--text);font-weight:700;font-size:14.5px}
  .gl-notes-tab span{writing-mode:vertical-rl;transform:rotate(180deg);letter-spacing:.3px}
  .gl-notes-tab svg{width:18px;height:18px;color:var(--accent)}
  .gl-notes-tab:hover{border-color:var(--accent)}
}
@media (max-width:999.98px){
  .gl-layout>.gl-notes{order:-1}
  .gl-notes{border-radius:14px;box-shadow:none}
  .gl-notes-head{display:none}
  .gl-notes-bar{display:flex;width:100%;align-items:center;gap:10px;min-height:48px;padding:8px 14px;border:0;background:none;cursor:pointer;font-weight:700;font-size:16px;color:var(--text);text-align:left;border-radius:14px}
  .gl-notes-bar .chev{margin-left:auto;transition:transform .2s;width:20px;height:20px}
  .gl-notes-bar[aria-expanded="true"] .chev{transform:rotate(180deg)}
  .gl-notes-bar svg.ic{width:20px;height:20px;color:var(--accent)}
  .gl-notes:not(.is-open):not(.is-sheet) .gl-notes-scroll{display:none}
  .gl-notes.is-open .gl-notes-bar{border-bottom:1px solid var(--line);border-radius:14px 14px 0 0}
  .gl-notes.is-open .gl-notes-close-end,.gl-notes.is-sheet .gl-notes-close-end{display:inline-flex}
  /* the Notes button sits in the lesson's bottom bar (it opens the notes as a full-height sheet) */
  .gl-nav .gl-navnotes{display:inline-flex;padding-left:12px;padding-right:12px}
  .gl-navnotes svg{color:var(--accent)}
  .gl-notes.is-sheet{position:fixed;inset:0;z-index:60;border-radius:0;border:0;overflow:auto;overscroll-behavior:contain;display:block}
  .gl-notes.is-sheet .gl-notes-bar{display:none}
  .gl-notes.is-sheet .gl-notes-head{display:flex;position:sticky;top:0;background:var(--card);z-index:1}
  .gl-notes.is-sheet .gl-notes-x{display:inline-flex}
  .gl-notes.is-sheet .gl-notes-hide{display:none}
  .gl-sheet-open{overflow:hidden}
  .gl-notes-hide{display:none}
}

/* ---------- sections below the card ---------- */
.gl-section{margin:22px 0 0;background:var(--card);border:1px solid var(--border);border-radius:18px;padding:18px 20px 20px;box-shadow:var(--shadow)}
.gl-section>h2{margin:0 0 4px;font-size:24px;outline:none}
.gl-section .sub{color:var(--muted);margin:0 0 4px}

/* exam questions */
.gl-exam{border-top:1px solid var(--line);padding:16px 0 4px;margin-top:14px}
.gl-exam .stem{margin:0 0 8px}
.gl-qno{display:inline-block;font-weight:800;color:var(--accent);margin-right:8px;font-variant-numeric:tabular-nums}
.gl-exam h3{font-size:18px;margin:0 0 8px;display:flex;align-items:baseline;gap:4px}
.gl-part{margin:12px 0 4px}
.gl-qtext{display:flex;gap:10px;align-items:flex-start;justify-content:space-between}
.gl-qtext>div{flex:1;min-width:0}
.gl-qtext p{margin:0 0 4px}
.gl-marks{font-weight:700;white-space:nowrap;font-size:15px;color:var(--muted)}
.gl-exam textarea,.gl-exam input[type=text]{width:100%;border:1px solid var(--border);border-radius:10px;background:var(--stage);padding:9px 11px;font-size:16px;line-height:1.5;margin:6px 0 0;resize:vertical}
.gl-exam textarea:focus,.gl-exam input[type=text]:focus{border-color:var(--accent);outline:2px solid var(--accent);outline-offset:0}
.gl-ans{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;margin:8px 0 0}
.gl-ans label{font-weight:650}
.gl-ans input[type=text]{width:9em;margin:0}
.gl-ans .unit{color:var(--muted)}
.gl-wordbox{display:flex;flex-wrap:wrap;gap:6px 18px;border:1.5px solid var(--ink);border-radius:4px;padding:8px 14px;margin:8px 0;max-width:640px;justify-content:center;font-size:16px}
.gl-labelins{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px;max-width:640px;margin:6px 0}
.gl-labelins label{display:flex;align-items:center;gap:8px}
.gl-labelins .bx{width:26px;height:26px;border:1.5px solid var(--ink);display:grid;place-items:center;font-weight:800;font-size:14px;flex:none}
.gl-labelins input[type=text]{margin:0}
.gl-figure{margin:10px 0;max-width:560px}
.gl-figure figcaption{font-weight:700;font-size:15px;text-align:center;margin:0 0 4px}
.gl-figure svg{display:block;width:100%;height:auto}
.gl-tick{margin:8px 0 0;border:0;padding:0}
.gl-tick legend{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.gl-tick label{display:flex;align-items:center;gap:10px;min-height:44px;padding:6px 10px;border:1px solid var(--border);border-radius:10px;margin:0 0 6px;cursor:pointer;max-width:560px;background:var(--card)}
@media (hover:hover){.gl-tick label:hover{border-color:var(--accent)}}
.gl-tick input{width:20px;height:20px;accent-color:var(--accent);flex:none}
.gl-tick label.right{border-color:var(--good);background:var(--good-soft)}
.gl-tick label.wrong{border-color:var(--bad);background:var(--bad-soft)}
.gl-tick .mk{margin-left:auto;font-weight:900}
.gl-tick label.right .mk{color:var(--good)}
.gl-tick label.wrong .mk{color:var(--bad)}
.gl-tickrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.gl-tickres{margin:0;font-size:15px;font-weight:600}
table.gl-table{border-collapse:collapse;margin:8px 0;font-size:16px;min-width:280px}
table.gl-table caption{font-weight:700;text-align:left;margin:0 0 4px}
table.gl-table th,table.gl-table td{border:1.5px solid var(--ink);padding:6px 12px;text-align:center}
table.gl-table th{font-weight:700;background:var(--stage)}
.gl-tablewrap{overflow-x:auto}
.gl-exam details{margin:12px 0 0;border:1px solid var(--border);border-radius:12px;background:var(--stage)}
.gl-exam summary{cursor:pointer;padding:11px 14px;font-weight:750;min-height:44px;display:flex;align-items:center;gap:8px;list-style:none}
.gl-exam summary::-webkit-details-marker{display:none}
.gl-exam summary::before{content:"";width:9px;height:9px;border-right:2.5px solid var(--accent);border-bottom:2.5px solid var(--accent);transform:rotate(-45deg);transition:transform .2s;margin-right:4px}
.gl-exam details[open] summary::before{transform:rotate(45deg)}
.gl-exam .reveal{padding:0 14px 14px}
.gl-ms{list-style:none;margin:4px 0 8px;padding:0}
.gl-ms li{display:flex;gap:10px;align-items:flex-start;padding:6px 0;border-bottom:1px dashed var(--line)}
.gl-ms input{width:20px;height:20px;margin-top:2px;accent-color:var(--accent);flex:none}
.gl-ms label{flex:1;cursor:pointer}
.gl-ms .m{font-weight:800;color:var(--muted);white-space:nowrap}
.gl-exam .accept{font-size:14.5px;color:var(--muted);margin:6px 0}
.gl-exam .score{font-weight:800;margin:8px 0;color:var(--accent)}
.gl-exam .model{font-size:15px;margin:8px 0 0;padding:10px 12px;border-radius:10px;background:var(--card);border:1px solid var(--line)}
.gl-exam .model b:first-child{display:block;font-size:13px;letter-spacing:.4px;text-transform:uppercase;color:var(--muted);margin-bottom:2px}
.gl-levels{width:100%;border-collapse:collapse;font-size:14.5px;margin:6px 0}
.gl-levels th,.gl-levels td{border:1px solid var(--border);padding:6px 8px;text-align:left;vertical-align:top}
.gl-levels th{background:var(--card)}
.gl-picker{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.gl-picker button{width:44px;height:44px;border-radius:10px;border:1px solid var(--border);background:var(--card);font-weight:800;cursor:pointer}
.gl-picker button[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.gl-total{margin:16px 0 0;padding:12px 16px;border-radius:12px;background:var(--accent-soft);font-size:18px;font-weight:800}
.gl-print{margin:12px 0 0;color:var(--muted);font-size:15px}

/* downloads */
.gl-downloads{list-style:none;margin:10px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:10px}
.gl-downloads a{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid var(--border);border-radius:14px;text-decoration:none;color:var(--text);background:var(--stage);height:100%}
@media (hover:hover){.gl-downloads a:hover{border-color:var(--accent)}}
.gl-ftype{flex:none;font-size:12px;font-weight:850;letter-spacing:.4px;padding:4px 7px;border-radius:7px;background:var(--accent);color:var(--accent-ink);margin-top:2px}
.gl-ftype.pptx{background:var(--brand);color:#fff}
.gl-downloads b{display:block;font-size:16px}
.gl-downloads span.d{font-size:14.5px;color:var(--muted)}
.gl-more{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}
.gl-more a{display:inline-flex;align-items:center;min-height:42px;padding:8px 14px;border-radius:99px;border:1px solid var(--border);text-decoration:none;color:var(--text);font-weight:600;font-size:15px;background:var(--card)}
@media (hover:hover){.gl-more a:hover{border-color:var(--accent)}}

/* unit pager + footer */
.gl-pager{display:grid;grid-template-columns:1fr auto 1fr;gap:10px;margin:22px 0 0;align-items:stretch}
.gl-pager a{display:flex;flex-direction:column;justify-content:center;padding:12px 16px;border:1px solid var(--border);border-radius:14px;background:var(--card);text-decoration:none;color:var(--text);font-weight:700;min-height:56px}
@media (hover:hover){.gl-pager a:hover{border-color:var(--accent)}}
.gl-pager small{font-weight:600;color:var(--muted);font-size:13px}
.gl-pager .next{text-align:right}
.gl-pager .mid{text-align:center}
.gl-footer{margin:28px 0 0;padding:18px 0 34px;border-top:4px solid var(--trim);background:var(--brand);color:var(--brand-muted);font-size:14px}
.gl-footer p{margin:0 0 6px;max-width:none}
.gl-footer b{color:#fff}
.gl-footer a{color:#cfe3ff}

/* ---------- phones and tablets ---------- */
@media (max-width:999.98px){
  .gl-nav{position:sticky;bottom:0;z-index:5;box-shadow:0 -6px 16px rgba(0,0,0,.06)}
  .gl-main{display:contents}
  .gl-layout{display:flex;flex-direction:column;gap:12px;align-items:stretch}
}
@media (max-width:640px){
  .gl-wrap{padding:0 12px}
  .gl-header .gl-wrap{padding-top:8px;padding-bottom:4px}
  .gl-topnav{margin-left:-11px;width:calc(100% + 22px);gap:0}
  .gl-topnav a,.gl-theme{font-size:14px;padding:8px 10px;min-height:40px}
  .gl-theme span{display:none}
  .gl-hero{padding-top:8px;padding-bottom:10px}
  .gl-intro{font-size:16px}
  .gl-lesson-wrap{padding:0}
  .gl-card{border-radius:0;border-left:0;border-right:0;box-shadow:none}
  .gl-notes{margin:0 12px}
  .gl-top{padding:10px 12px 6px;gap:8px;flex-wrap:wrap}
  .gl-count{font-size:13px;order:-1;width:100%}
  .gl-screens{padding:2px 12px 6px}
  .gl-welcome{margin:2px 12px 6px}
  .gl-stage{margin:0 -12px;border-left:0;border-right:0;border-radius:0;padding:6px 2px}
  .gl-nav{padding:8px 12px calc(10px + env(safe-area-inset-bottom));gap:6px;border-radius:0}
  .gl-nav .gl-btn{padding:9px 13px}
  .gl-nav [data-go="skip"]{padding-left:6px;padding-right:6px;font-size:15px}
  .gl-section{border-radius:0;border-left:0;border-right:0;padding:16px 14px}
  .gl-lesson-wrap .gl-pager,.gl-lesson-wrap .gl-more{margin-left:12px;margin-right:12px}
  .gl-stepcap{font-size:15.5px}
  .gl-pager{grid-template-columns:1fr 1fr}
  .gl-pager .mid{grid-column:1/-1;grid-row:2}
  .gl-qtext{flex-direction:column;gap:2px}
  .gl-marks{align-self:flex-end}
}
@media (max-width:440px){
  /* narrow phones: Back shows its arrow only (the word stays for screen readers) */
  .gl-nav [data-go="back"]{width:46px;padding:0}
  .gl-nav [data-go="back"] .lbl{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .gl-nav .gl-btn{padding-left:11px;padding-right:11px}
}
@media (max-width:380px){
  .gl-nav [data-go="skip"] .full{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .gl-nav [data-go="skip"] .short{display:inline}
  .gl-chip{font-size:14.5px;padding-right:11px}
}
.gl-nav [data-go="skip"] .short{display:none}

/* ---------- one column (phones, tablets held upright): the order inside a screen ----------
   Step-through animations (.gl-sbody.steps): the lines, then the step buttons, then the picture, then the step
   caption, so the buttons that drive the animation are on screen with it.
   Pictures with chips (.gl-sbody.chips): the lines, the picture, the chips, then the sentence a chip shows. */
.gl-card:not(.is-wide) .gl-sbody.steps,.gl-card:not(.is-wide) .gl-sbody.chips{display:flex;flex-direction:column;gap:0}
.gl-card:not(.is-wide) .gl-sbody.steps>.gl-ctrl,.gl-card:not(.is-wide) .gl-sbody.steps .gl-steps,
.gl-card:not(.is-wide) .gl-sbody.steps>.gl-vis,.gl-card:not(.is-wide) .gl-sbody.chips>.gl-vis{display:contents}
.gl-card:not(.is-wide) .gl-sbody.steps>*,.gl-card:not(.is-wide) .gl-sbody.steps .gl-vis>*,.gl-card:not(.is-wide) .gl-sbody.chips .gl-vis>*{order:6}
.gl-card:not(.is-wide) .gl-sbody.steps>.gl-text,.gl-card:not(.is-wide) .gl-sbody.chips>.gl-text{order:1}
.gl-card:not(.is-wide) .gl-sbody.steps .gl-stepbar{order:2;margin:0 0 8px}
.gl-card:not(.is-wide) .gl-sbody.steps .gl-vis>.gl-stage{order:3}
.gl-card:not(.is-wide) .gl-sbody.steps .gl-steptag{order:4;margin:10px 0 4px}
.gl-card:not(.is-wide) .gl-sbody.steps .gl-stepcap{order:5;margin:4px 0 0;min-height:0}
.gl-card:not(.is-wide) .gl-sbody.chips .gl-vis>.gl-stage{order:2}
.gl-card:not(.is-wide) .gl-sbody.chips .gl-vis>.gl-chips{order:3}
.gl-card:not(.is-wide) .gl-sbody.chips>.gl-ctrl{order:4}
.gl-callout{scroll-margin-bottom:96px}

/* ---------- real thing and diagram side by side, with numbered differences (added for the B2 kit; SGL.compare) ----------
   <div class="gl-stage gl-cmp-stage"><div class="gl-cmp" data-cmp> two or more .gl-cmp-col, each
   <div class="gl-cmp-pic" style="--ar:W/H"><img or svg><svg class="gl-cmp-ov" viewBox data-rings='{"1":[[x,y,r]]}'></svg></div>
   <p class="gl-cmp-name">A real heart</p> <p class="gl-cmp-side">shown with "Same in both"</p></div></div>
   then <div class="gl-chips" data-cmp-chips> chips with data-d, data-head and data-text, and a .gl-callout[data-cmp-callout]. */
.gl-cmp-stage{flex-direction:column;justify-content:center;padding:10px 8px}
.gl-cmp{display:flex;justify-content:center;align-items:flex-start;gap:12px;width:100%}
.gl-cmp-col{display:flex;flex-direction:column;align-items:center;min-width:0}
.gl-cmp-pic{position:relative;flex:none;width:calc(var(--h,240px)*var(--ar,1));height:var(--h,240px)}
.gl-cmp-pic>img,.gl-cmp-pic>svg{position:absolute;inset:0;width:100%;height:100%;display:block}
.gl-cmp-pic>img{object-fit:contain}
.gl-cmp-ov{overflow:visible;pointer-events:none}
.gl-cmp-name{margin:6px 0 0;font-weight:750;font-size:15px;text-align:center}
.gl-cmp-side{margin:4px 0 0;font-size:14px;font-weight:700;color:var(--accent);background:var(--accent-soft);border-radius:99px;padding:2px 10px;white-space:nowrap;visibility:hidden}
.gl-cmp.same .gl-cmp-side{visibility:visible}
.gl-cmp-ring{opacity:0;transition:opacity .25s}
.gl-cmp-ring.on{opacity:1}
.gl-cmp-ring circle{fill:none;vector-effect:non-scaling-stroke}
.gl-cmp-ring .halo{stroke:var(--card);stroke-width:8px;opacity:.85}
.gl-cmp-ring .rg{stroke:var(--accent);stroke-width:3.5px;fill:var(--accent);fill-opacity:.1}
.gl-cmp-ring .rp{stroke:var(--accent);stroke-width:3px;transform-box:fill-box;transform-origin:center}
.gl-screen.is-active .gl-cmp-ring.on .rp{animation:gl-cring 1.6s ease-out infinite}
.gl-cmp-ring .rp.r2{animation-delay:.8s}
@keyframes gl-cring{0%{transform:scale(1);opacity:.95}100%{transform:scale(1.75);opacity:0}}
/* painted art with dark labels sits on a light plate in dark mode: add class "plate" to the .gl-cmp-pic */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .gl-cmp-pic.plate{background:#ece7df;border-radius:10px}}
:root[data-theme="dark"] .gl-cmp-pic.plate{background:#ece7df;border-radius:10px}

/* ---------- motion ---------- */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}

/* ---------- print: everything in order, no app chrome ---------- */
@media print{
  .gl-header,.gl-nav,.gl-top,.gl-notes-bar,.gl-notes-tab,.gl-welcome,.gl-stepbar,.gl-skip,.gl-theme{display:none!important}
  .js .gl-screen:not(.is-active){display:block}
  .gl-card,.gl-section,.gl-notes{box-shadow:none;height:auto!important}
  .gl-notes{position:static!important;max-height:none!important}
  .gl-layout{display:block}
}

/* Site wordmark: the logo returns home. */
.gl-logo .gcse{color:#ffd84d}
.gl-logo>span{white-space:nowrap}
