/* Generative Modelling II — slide system, shared with Generative Modelling I.
   Visual tokens follow the ES 667 attention / CLIP lectures.
   Diffusion roles: x0 data = blue (--x) · noise = amber (--z) · noisy x_t = slate (--xt)
   denoiser / its prediction = teal (--dec) · loss / gradient = red · condition / text = purple (--enc) */

:root {
  --paper: #FAFAFB;
  --card: #FFFFFF;
  --ink: #14171F;
  --ink-2: #4A5160;
  --ink-3: #6B7280;
  --line: #D9DDE5;
  --grid: #ECEEF2;

  /* semantic roles — one colour per role, everywhere */
  --x: #245EDB;   --x-t: #E4ECFF;    /* observed data x            */
  --enc: #8B2CDE; --enc-t: #F1E5FC;  /* encoder, q_phi(z|x)        */
  --dec: #0F766E; --dec-t: #D9F2EF;  /* decoder / generator, p_theta */
  --z: #AA4E08;   --z-t: #FCEFD9;    /* latent z and noise epsilon */
  --loss: #BE123C; --loss-t: #FDE2E7;/* loss, KL, gradients        */
  --disc: #147737; --disc-t: #DDF3E4;/* discriminator D            */

  --font-ui: "Avenir Next", "Avenir", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;
  --W: 1280px;
  --H: 720px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: #1d2027; font-family: var(--font-ui); color: var(--ink); }
body.reading { background: #E9EBEF; }

/* ------------------------------------------------------------------ stage */
#deck { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden; }
.slide {
  position: absolute; left: 50%; top: 50%;
  width: var(--W); height: var(--H);
  margin-left: calc(var(--W) / -2); margin-top: calc(var(--H) / -2);
  transform: scale(var(--scale, 1));
  background: var(--paper);
  padding: 44px 64px 40px;
  display: none; flex-direction: column;
  overflow: hidden;
}
.slide.current { display: flex; }

/* ------------------------------------------------------------------ type */
.kicker { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--sec, var(--ink-3)); margin: 0 0 6px; }
.slide h2 { font-size: 40px; line-height: 1.12; font-weight: 650; margin: 0 0 20px; letter-spacing: -.01em; }
.slide h2 .sub { display: block; font-size: 24px; font-weight: 500; color: var(--ink-2); margin-top: 8px; letter-spacing: 0; }
.slide p, .slide li { font-size: 26px; line-height: 1.4; margin: 0 0 12px; }
.slide .small, .slide .small p, .slide p.small { font-size: 21px; }
.slide .tiny { font-size: 17px; color: var(--ink-3); }
.slide .cap { font-size: 18px; color: var(--ink-3); text-align: center; margin-top: 6px; line-height: 1.3; }
.slide .muted { color: var(--ink-3); }
.slide b, .slide strong { font-weight: 650; }
.slide code, .slide .mono { font-family: var(--font-mono); font-size: .86em; }
.slide ul { margin: 0; padding-left: 1.1em; }
.slide ul li { margin-bottom: 10px; }
.body { flex: 1; position: relative; min-height: 0; }

/* the one question / takeaway line at the bottom of a frame */
.q {
  margin-top: auto; padding: 4px 0 0 18px; border-left: 5px solid var(--sec, var(--x));
  font-size: 25px !important; font-weight: 600; line-height: 1.35 !important; margin-bottom: 0 !important;
}
.q.take { border-left-color: var(--ink); }
.slide .src { position: absolute; left: 64px; right: 90px; bottom: 12px; font-size: 13px; line-height: 1.3; color: var(--ink-3); margin: 0; }
.slide:has(.src) { padding-bottom: 46px; }
.src a { color: var(--ink-3); }
.pageno { position: absolute; right: 22px; bottom: 12px; font-size: 13px; color: #B3B8C2; font-variant-numeric: tabular-nums; }

/* section colours */
.sec-hook  { --sec: #245EDB; }
.sec-dist  { --sec: #AA4E08; }
.sec-ae    { --sec: #8B2CDE; }
.sec-kl    { --sec: #BE123C; }
.sec-elbo  { --sec: #0F766E; }
.sec-rep   { --sec: #AA4E08; }
.sec-vae   { --sec: #8B2CDE; }
.sec-gan   { --sec: #147737; }
.sec-end   { --sec: #245EDB; }

/* role colour helpers for text */
.cx { color: var(--x); } .cenc { color: var(--enc); } .cdec { color: var(--dec); }
.cz { color: var(--z); } .closs { color: var(--loss); } .cdisc { color: var(--disc); }

/* ------------------------------------------------------------------ builds */
[data-b], [data-hl], [data-dim] { transition: opacity .28s ease, filter .28s ease, background-color .28s, color .28s, border-color .28s; }
.hidden { opacity: 0 !important; pointer-events: none; }
.gone { display: none !important; }
.dim { opacity: .28; }
.hl { background: #FFF4C2; border-radius: 6px; box-shadow: 0 0 0 4px #FFF4C2; }

/* ------------------------------------------------------------------ layout helpers */
.row { display: flex; gap: 28px; align-items: center; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { display: flex; justify-content: center; align-items: center; }
.stack { position: relative; }
.stack > * + * { position: absolute; inset: 0; }
.fig { display: block; max-width: 100%; }
.pix { image-rendering: pixelated; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; }
.callout { border-radius: 12px; padding: 14px 18px; font-size: 22px; line-height: 1.35; }
.callout.x { background: var(--x-t); } .callout.enc { background: var(--enc-t); }
.callout.dec { background: var(--dec-t); } .callout.z { background: var(--z-t); }
.callout.loss { background: var(--loss-t); } .callout.disc { background: var(--disc-t); }
.callout.plain { background: #F0F2F5; }

.mathblock { font-size: 30px; text-align: center; margin: 10px 0; }
.mathblock.big { font-size: 36px; }
.mathblock.left { text-align: left; }

/* step-by-step equation ladder */
.ladder { display: grid; grid-template-columns: auto auto 1fr; column-gap: 14px; row-gap: 6px; align-items: center; font-size: 27px; }
.ladder .lhs { text-align: right; }
.ladder .why { font-size: 18px; color: var(--ink-3); padding-left: 18px; line-height: 1.25; }
.ladder .why b { color: var(--ink-2); }

/* Jay-Alammar-style blocks */
.node {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 12px; padding: 10px 16px; font-size: 22px; font-weight: 600; line-height: 1.15;
  border: 2px solid currentColor; background: #fff; min-width: 90px; text-align: center;
}
.node small { font-size: 15px; font-weight: 500; color: var(--ink-3); margin-top: 3px; }
.node.x { color: var(--x); background: var(--x-t); } .node.enc { color: var(--enc); background: var(--enc-t); }
.node.dec { color: var(--dec); background: var(--dec-t); } .node.z { color: var(--z); background: var(--z-t); }
.node.loss { color: var(--loss); background: var(--loss-t); } .node.disc { color: var(--disc); background: var(--disc-t); }
.node.ghost { color: #9AA1AD; background: #F3F4F6; border-style: dashed; }
.arrow { font-size: 30px; color: #9AA1AD; padding: 0 2px; }

/* vectors drawn as cells */
.vec { display: inline-flex; border-radius: 6px; overflow: hidden; border: 1.5px solid currentColor; vertical-align: middle; }
.vec span { display: inline-block; min-width: 64px; padding: 5px 8px; font-family: var(--font-mono); font-size: 19px; text-align: center; color: var(--ink); }
.vec span + span { border-left: 1.5px solid currentColor; }
.vec.z { color: var(--z); } .vec.z span { background: var(--z-t); }
.vec.enc { color: var(--enc); } .vec.enc span { background: var(--enc-t); }
.vec.x { color: var(--x); } .vec.x span { background: var(--x-t); }
.vec.dec { color: var(--dec); } .vec.dec span { background: var(--dec-t); }
.vec.loss { color: var(--loss); } .vec.loss span { background: var(--loss-t); }

/* tables of worked numbers */
table.work { border-collapse: collapse; font-size: 22px; }
table.work th { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; text-align: right; padding: 6px 14px; border-bottom: 1.5px solid var(--line); }
table.work td { padding: 8px 14px; text-align: right; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--grid); }
table.work td:first-child, table.work th:first-child { text-align: left; }
table.work tr.total td { border-top: 2px solid var(--ink); font-weight: 650; border-bottom: none; }

/* bars (probability tables) */
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; font-size: 21px; }
.bars .bar { height: 22px; border-radius: 4px; background: var(--c, var(--x)); }
.bars .lab { font-family: var(--font-mono); }
.bars .val { font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* code */
pre.code {
  margin: 0; background: #F3F4F7; border-radius: 12px; padding: 16px 20px; font-family: var(--font-mono);
  font-size: 19px; line-height: 1.5; color: #1F2430; border-left: 5px solid var(--sec, var(--ink-3)); white-space: pre;
}
pre.code .k { color: #8B2CDE; } pre.code .c { color: #6B7280; } pre.code .f { color: #245EDB; } pre.code .n { color: #AA4E08; }
pre.code .line { display: inline-block; width: 100%; border-radius: 4px; transition: background .25s, opacity .25s; }
pre.code .line.hl { background: #FFF1B8; box-shadow: none; }

/* digit image tiles */
.tiles { display: grid; gap: 6px; }
.tiles img { width: 100%; image-rendering: pixelated; border-radius: 4px; display: block; }
.tile-lab { font-size: 16px; color: var(--ink-3); text-align: center; }

/* braces under math */
.brace-wrap { display: inline-flex; flex-direction: column; align-items: center; }
.brace-lab { font-size: 18px; font-weight: 600; margin-top: 4px; }

/* interactive controls */
.ctrl { display: flex; align-items: center; gap: 12px; font-size: 20px; color: var(--ink-2); }
.ctrl input[type=range] { width: 260px; accent-color: var(--sec, var(--x)); }
.readout { font-family: var(--font-mono); font-size: 22px; font-variant-numeric: tabular-nums; }
.print .ctrl input { display: none; }
.print .ctrl[data-widget="kl"] { display: none; }

/* section opener */
.slide.opener { justify-content: center; padding-left: 96px; }
.slide.opener h2 { font-size: 56px; margin-bottom: 18px; }
.slide.opener p { font-size: 28px; color: var(--ink-2); max-width: 900px; }
.slide.opener .kicker { font-size: 16px; }

/* ------------------------------------------------------------------ notes, overview, reading */
aside.notes { display: none; }
#notes-panel {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 34vh; overflow: auto; z-index: 20;
  background: #111318ee; color: #E8EAEE; font-size: 18px; line-height: 1.45; padding: 14px 24px 18px; display: none;
}
#notes-panel.open { display: block; }
#notes-panel h4 { margin: 0 0 6px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #9AA3B2; }
#notes-panel p { margin: 0 0 8px; }
#overview { position: fixed; inset: 0; background: #F4F5F7; z-index: 30; overflow: auto; padding: 28px 40px; display: none; }
#overview.open { display: block; }
#overview ol { columns: 3; column-gap: 32px; font-size: 16px; line-height: 1.6; }
#overview a { color: var(--ink); text-decoration: none; }
#overview a:hover { text-decoration: underline; }
#overview .sec { font-weight: 700; break-after: avoid; list-style: none; margin: 10px 0 2px -18px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
#hud { position: fixed; right: 14px; bottom: 10px; color: #8A909C; font-size: 12px; z-index: 10; font-family: var(--font-ui); }

body.reading #deck { position: static; display: block; padding: 24px 0 80px; }
body.reading .slide { position: relative; left: auto; top: auto; margin: 24px auto 0; transform: none; display: flex; box-shadow: 0 2px 14px #0002; }
body.reading aside.notes { display: block; width: var(--W); margin: 0 auto; background: #fff; padding: 16px 24px; font-size: 18px; line-height: 1.5; border-top: 1px solid var(--line); }
body.reading aside.notes p { margin: 0 0 8px; }

/* print: every page is one 1280x720 frame */
@page { size: 1280px 720px; margin: 0; }
body.print { background: #fff; }
body.print #deck { position: static; display: block; }
body.print .slide { position: relative; left: auto; top: auto; margin: 0; transform: none; display: flex; page-break-after: always; break-after: page; }
body.print [data-b], body.print [data-hl], body.print [data-dim] { transition: none; }
body.print #hud, body.print #notes-panel { display: none; }

/* ------------------------------------------------------------------ slide-specific components */
.diagram { width: 100%; height: auto; display: block; overflow: visible; }
.body.center > .diagram, .body > .diagram { max-height: 470px; }
.slide.cover .body { display: flex; flex-direction: column; }

/* predict-then-reveal application grid */
.appgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 40px; margin-top: 2px; }
.app-t { font-size: 19px !important; font-weight: 650; color: var(--ink-2); margin: 0 0 6px !important; }
.app-row { display: flex; align-items: center; gap: 10px; }
.app-row > img, .app-out img { height: 150px; width: auto; border-radius: 6px; display: block; }
.app-out { width: 168px; height: 150px; }
.app-out > * { position: absolute; inset: 0; }
.qbox { border: 2px dashed #C7CCD4; border-radius: 6px; display: grid; place-items: center; font-size: 54px; font-weight: 700; color: #B3B8C2; background: #fff; }

/* the route */
ol.route { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: r; display: grid; gap: 12px; }
ol.route li { counter-increment: r; display: flex; align-items: baseline; gap: 18px; font-size: 26px; margin: 0; }
ol.route li::before { content: counter(r); width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 700; font-size: 20px; display: grid; place-items: center; flex: none; transform: translateY(6px); }
ol.route li > span:not(.katex) { font-size: 20px; color: var(--ink-3); }

/* vertical probability bars */
.vbars { display: flex; gap: 26px; align-items: flex-end; height: 260px; }
.vbars > div { width: 110px; height: calc(var(--h) * 300px); background: var(--c); border-radius: 6px 6px 0 0; position: relative; }
.vbars > div span { position: absolute; top: -32px; left: 0; right: 0; text-align: center; font-size: 22px; font-weight: 650; color: var(--ink); }
.vlabs { display: flex; gap: 26px; }
.vlabs span { width: 110px; text-align: center; font-size: 20px; color: var(--ink-2); border-top: 1.5px solid var(--ink-3); padding-top: 6px; }

/* stacked decomposition bar */
.stackbar { display: flex; height: 92px; border-radius: 10px; overflow: hidden; gap: 3px; }
.stackbar > div { border: 2px solid; border-radius: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 21px; min-width: 120px; }
.stackbar > div span { font-size: 16px; color: var(--ink-3); }

/* stat tiles */
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; width: 245px; display: flex; flex-direction: column; gap: 6px; }
.stat b { font-size: 34px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 17px; color: var(--ink-3); line-height: 1.3; }

/* number line for the ELBO gap */
.numline { position: relative; width: 1000px; height: 120px; }
.nl-track { position: absolute; left: 0; right: 0; top: 60px; height: 3px; background: #C7CCD4; border-radius: 2px; }
.nl-mark { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; display: flex; flex-direction: column; align-items: center; color: var(--c); }
.nl-mark b { font-size: 22px; }
.nl-mark span { font-size: 20px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.nl-mark::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--c); margin-top: 8px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--c); }
.nl-gap { position: absolute; top: 86px; height: 30px; border: 2.5px solid var(--loss); border-top: none; border-radius: 0 0 10px 10px; }
.nl-gap span { position: absolute; top: 34px; left: 0; right: 0; text-align: center; font-size: 19px; color: var(--loss); font-weight: 650; }

/* beta comparison */
.beta3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.beta3 .col { gap: 6px; }
.beta3 p.small { margin: 0 !important; }

/* GAN small multiples */
.film5 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 14px; }
.film5 img { width: 100%; }
.filmlabs { display: grid; grid-template-rows: repeat(8, 1fr); height: 500px; align-items: center; font-size: 17px; color: var(--ink-3); text-align: right; padding: 4px 0; }

/* vote reveal */
.tiles.vote .vt img { border: 4px solid transparent; border-radius: 6px; }
.tiles.vote .vt p { display: flex; justify-content: space-between; font-size: 16px; margin: 4px 2px 0; }
.tiles.vote .vk { font-weight: 650; }
.slide[data-build="2"] .tiles.vote .vt.real img { border-color: var(--x); }
.slide[data-build="2"] .tiles.vote .vt.fake img { border-color: var(--dec); }
.tiles.vote .vt.real .vk { color: var(--x); }
.tiles.vote .vt.fake .vk { color: var(--dec); }

/* exit questions */
ol.exitq { font-size: 25px; padding-left: 1.2em; margin: 0; }
ol.exitq li { margin-bottom: 20px; }
ol.exitq .ans { display: block; font-size: 20px; color: var(--dec); margin-top: 6px; line-height: 1.35; }

/* latent explorer */
.explorer { position: relative; display: inline-block; cursor: crosshair; }
.lens { display: none; position: absolute; right: -14px; top: -14px; width: 150px; height: 150px; border: 3px solid var(--enc); border-radius: 10px; background-repeat: no-repeat; image-rendering: pixelated; box-shadow: 0 4px 16px #0003; background-color: #fff; }

/* vocabulary table */
table.vocab td:nth-child(3) { text-align: left; color: var(--ink-2); font-size: 21px; }
table.vocab th:nth-child(3) { text-align: left; }

/* fixes after the first visual pass */
.slide.cover .body { justify-content: center; }
.chain .node { min-width: 54px; padding: 8px 12px; font-size: 22px; }
.chain .arrow { font-size: 24px; }
.film5 { grid-template-columns: repeat(3, 330px); justify-content: center; gap: 2px 18px; }
.beta3 img[src$="scatter.svg"] { width: 230px !important; }
.beta3 img.pix { width: 300px !important; }
.tiles.vote .vt p { font-size: 15px; }

/* centre each frame's content between the title and the bottom line */
.body { display: flex; flex-direction: column; justify-content: center; }
.body.center { flex-direction: row; }
.body.center.col { flex-direction: column; }

/* ================================================================== Generative Modelling II additions */
:root { --xt: #334155; --xt-t: #E2E8F0; --est: #1E40AF; }

/* section colours */
.sec-fwd   { --sec: #AA4E08; }
.sec-learn { --sec: #0F766E; }
.sec-gen   { --sec: #245EDB; }
.sec-arch  { --sec: #334155; }
.sec-cond  { --sec: #8B2CDE; }
.sec-text  { --sec: #BE123C; }
.sec-app   { --sec: #6B7280; }

/* provenance badge: one per figure, top-right of the slide or of a figure wrapper */
.badge {
  position: absolute; top: 40px; right: 56px; z-index: 3;
  font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  padding: 4px 10px 3px; border-radius: 999px; border: 1.5px solid currentColor; background: #fff; line-height: 1.2;
}
.badge small { font-weight: 500; letter-spacing: .02em; text-transform: none; font-size: 12.5px; margin-left: 4px; }
.badge.pub    { color: #475569; }
.badge.run    { color: #0F766E; background: #EAF7F5; }
.badge.toy    { color: #9A5700; background: #FFF6E6; }
.badge.sketch { color: #6B7280; border-style: dashed; }
.figwrap { position: relative; display: inline-block; }
.figwrap > .badge { top: 6px; right: 6px; }
.badge.inline { position: static; display: inline-block; vertical-align: middle; margin-left: 8px; }

/* speaker cue for the current click */
#notes-panel [data-say] { opacity: .55; }
#notes-panel [data-say].now { opacity: 1; color: #fff; border-left: 4px solid #F5C451; padding-left: 10px; }
body.reading aside.notes .say-tag { display: inline-block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #6B7280; margin-right: 8px; }

.cxt { color: var(--xt); }
.node.xt { color: var(--xt); background: var(--xt-t); }
.vec.xt { color: var(--xt); } .vec.xt span { background: var(--xt-t); }
.callout.xt { background: var(--xt-t); }

/* running-example chip */
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; color: #9A5700;
  background: #FFF6E6; border: 1.5px solid #E8C38A; border-radius: 999px; padding: 3px 12px 2px; }

/* a row of image panels with labels underneath */
.strip { display: flex; gap: 12px; align-items: flex-start; justify-content: center; }
.strip figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.strip figure img { display: block; image-rendering: pixelated; border-radius: 4px; }
.strip figcaption { font-size: 18px; color: var(--ink-2); text-align: center; line-height: 1.25; font-variant-numeric: tabular-nums; }
.strip figcaption .k { color: var(--ink-3); font-size: 15px; display: block; }
.photo img { image-rendering: auto !important; }

/* published image pair with a caption */
.pub-row { display: flex; gap: 16px; align-items: center; justify-content: center; }
.pub-row img { display: block; border-radius: 6px; }
.lbl { font-size: 18px; font-weight: 650; color: var(--ink-2); text-align: center; margin: 0 0 6px !important; }

/* arithmetic strip: one left-to-right worked calculation */
.arith { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 30px; font-variant-numeric: tabular-nums; }
.arith .box { border: 2px solid currentColor; border-radius: 10px; padding: 6px 14px; background: #fff; text-align: center; }
.arith .box small { display: block; font-size: 14px; color: var(--ink-3); font-weight: 500; margin-top: 2px; }
.arith .op { color: var(--ink-3); font-size: 26px; }

/* bigger mono readout table */
table.work.tight td { padding: 5px 12px; }
.mono-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* token chips for text diffusion */
.toks { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tok { font-size: 24px; padding: 6px 14px; border-radius: 8px; border: 2px solid #CBD5E1; background: #fff; min-width: 64px; text-align: center; }
.tok.prompt { border-color: var(--enc); background: var(--enc-t); color: #5B1D99; }
.tok.mask { border-color: #9A5700; background: #FFF6E6; color: #9A5700; border-style: dashed; font-weight: 700; }
.tok.new { border-color: var(--dec); background: var(--dec-t); color: #0B5A54; font-weight: 650; }
.tok.id { font-family: var(--font-mono); font-size: 19px; color: var(--ink-2); border-color: #E2E8F0; }

/* small multiples grid of images with row labels */
.grid-rows { display: grid; gap: 6px 10px; align-items: center; }
.grid-rows .rl { font-size: 19px; color: var(--ink-2); text-align: right; font-weight: 600; white-space: nowrap; }
.grid-rows img { width: 100%; display: block; image-rendering: pixelated; border-radius: 3px; }

/* a quiet two-column comparison table */
table.cmp { border-collapse: collapse; font-size: 21px; width: 100%; }
table.cmp th { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--line); }
table.cmp td { padding: 9px 12px; border-bottom: 1px solid var(--grid); vertical-align: top; line-height: 1.3; }
table.cmp td:first-child { color: var(--ink-3); font-size: 18px; width: 22%; }

.slide .cap.left { text-align: left; }
ol.route li span.rt { font-size: 20px; color: var(--ink-3); }
table.cmp.revisit td { padding: 5px 10px; }
table.cmp.revisit td img { height: 44px !important; }
/* ------------------------------------------------------------------ review annotations */
.anno-pin { position: absolute; z-index: 40; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; background: #E11D48; color: #fff; font: 700 13px/22px var(--font-ui); text-align: center; padding: 0;
  box-shadow: 0 2px 6px #0004; cursor: pointer; }
.anno-box, .anno-panel { position: fixed; z-index: 60; display: none; background: #fff; border-radius: 12px; box-shadow: 0 10px 40px #0005;
  font-family: var(--font-ui); color: var(--ink); }
.anno-box { width: 360px; padding: 12px; }
.anno-target { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; line-height: 1.35; max-height: 52px; overflow: hidden; }
.anno-box textarea { width: 100%; font: 15px/1.4 var(--font-ui); border: 1px solid var(--line); border-radius: 8px; padding: 8px; resize: vertical; }
.anno-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.anno-actions span { flex: 1; }
.anno-actions button { font: 600 13px var(--font-ui); border: 1px solid var(--line); background: #F3F4F6; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.anno-actions button.primary { background: #14171F; color: #fff; border-color: #14171F; }
.anno-panel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(820px, 92vw); max-height: 80vh; overflow: auto; padding: 18px 22px; }
.anno-panel h4 { margin: 0 0 8px; font-size: 16px; }
.anno-panel pre { white-space: pre-wrap; font: 14px/1.45 var(--font-mono); margin: 0; }
body.print .anno-pin, body.reading .anno-pin { display: none; }

.anno-pin.done { background: #0F766E; font-size: 14px; }
.anno-reply { font-size: 13px; color: #0F766E; background: #D9F2EF; border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; line-height: 1.35; }
.anno-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 70; background: #14171F; color: #fff;
  font: 600 14px var(--font-ui); padding: 8px 14px; border-radius: 10px; opacity: 0; transition: opacity .25s; pointer-events: none; }
.slide.break { padding-left: 80px; }
.break-grid { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: center; height: 100%; }
.slide.break h2 { font-size: 50px; margin-bottom: 18px; }
.slide.break .why { font-size: 25px; color: var(--ink-2); line-height: 1.45; }
.slide.break .why b { color: var(--ink); }
ol.route-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ol.route-mini li { display: flex; align-items: center; gap: 14px; font-size: 19px; color: #9AA1AD; margin: 0; }
ol.route-mini .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; flex: none;
  border: 2px solid #C7CCD4; color: #9AA1AD; background: #fff; }
ol.route-mini li.done { color: var(--ink-2); }
ol.route-mini li.done .dot { background: #E5E7EB; border-color: #E5E7EB; color: var(--ink-2); }
ol.route-mini li.now { color: var(--ink); font-weight: 700; font-size: 21px; }
ol.route-mini li.now .dot { background: var(--c); border-color: var(--c); color: #fff; width: 38px; height: 38px; font-size: 17px; }
.recap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.recap h3 { font-size: 18px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; font-weight: 650; }
.recap ol { margin: 0; padding-left: 1.2em; }
.recap li { font-size: 22px; line-height: 1.4; margin-bottom: 10px; }
.recap .next { background: #F0F2F5; border-radius: 14px; padding: 18px 22px; }
.katex-display { margin: .25em 0; }
.mathblock .katex-display { margin: .1em 0; }
.mathblock.left .katex-display, .mathblock.left .katex-display > .katex { text-align: left; }
.kicker .katex { text-transform: none; font-size: 1.15em; }
.lbl .katex { text-transform: none; }
.seedbtn { font: 600 15px var(--font-ui); border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.seedbtn.on { background: var(--x); color: #fff; border-color: var(--x); }
ol.route li .lt { flex: 1; min-width: 0; }
