/* AI at work: design system and slide layout ("Industry" look, 2026-11-02).
   Owned by the slide engine. Variable names are a contract (docs/FORMAT.md). */

/* ---------- Fonts (vendored, SIL Open Font Licence, see assets/fonts/OFL-Barlow.txt) ---------- */

@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/barlow-condensed-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/barlow-condensed-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/barlow-condensed-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/barlow-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/barlow-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/barlow-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/barlow-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/barlow-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/barlow-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/barlow-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/barlow-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  /* Contract names (docs/FORMAT.md), used by the widgets */
  --bg: #f2f2f3;              /* page */
  --surface: #e9e9ea;         /* rarely used: code, inputs */
  --ink: #1d1f20;
  --ink-soft: #5d5d60;        /* neutral 700: meta text */
  --line: rgba(29, 31, 32, 0.16); /* hairline */
  --accent: #416180;          /* accent 700: links, accent text, filled ticks, primary buttons */
  --accent-ink: #ffffff;
  --good: #416180;            /* no red or green: right answers use the accent */
  --bad: #5d5d60;             /* wrong answers use neutral 700 */

  /* Chart and token colours. --ink text stays readable on each of them. */
  --data-1: #94bce3;
  --data-2: #8fc2b5;
  --data-3: #e0b85a;
  --data-4: #e3a296;
  --data-5: #b5a8e0;

  --font-body: "Barlow", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, Menlo, "Liberation Mono", monospace;

  --radius: 0;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;

  /* Internal to the engine (not part of the contract) */
  --steel: #5980a6;           /* accent 500: focus ring, large type only */
  --accent-100: #eef6ff;      /* tint: selected layer, right answer */
  --accent-800: #2c455d;      /* accent small text on tints */
  --n200: #e7e7ea;            /* row rules */
  --n300: #d4d4d7;            /* empty progress segment */
  --n400: #b7b7ba;            /* empty tick box, quote rule */
  --n800: #424244;            /* secondary body, "Instead of" */
  --corner: rgba(29, 31, 32, 0.55);
  --hover: rgba(29, 31, 32, 0.07);
  --column: 760px;
  --gutter: 24px;
}

/* Dark: the ground becomes accent 900 with paper-coloured text */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #1d2d3d;
    --surface: #24384b;
    --ink: #f2f2f3;
    --ink-soft: #b3bfcb;
    --line: rgba(242, 242, 243, 0.2);
    --accent: #94bce3;
    --accent-ink: #1d2d3d;
    --good: #94bce3;
    --bad: #b3bfcb;

    --data-1: #3c5c9c;
    --data-2: #276f64;
    --data-3: #835d12;
    --data-4: #94434c;
    --data-5: #5d4c99;

    --steel: #94bce3;
    --accent-100: #2c455d;
    --accent-800: #d6ebff;
    --n200: rgba(242, 242, 243, 0.12);
    --n300: rgba(242, 242, 243, 0.22);
    --n400: rgba(242, 242, 243, 0.4);
    --n800: #dcdde0;
    --corner: rgba(242, 242, 243, 0.55);
    --hover: rgba(242, 242, 243, 0.08);
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }
svg { flex: none; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }
::selection { background: rgba(89, 128, 166, 0.3); }

button { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 50;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px;
}
.skip:focus { top: 8px; }

/* ---------- Type ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--ink);
}
h1 { font-size: 42px; line-height: 1.05; margin: 0 0 18px; }
h2 { font-size: 32px; line-height: 1.12; margin: 0 0 18px; }
h3, h4 { font-size: 20px; line-height: 1.2; letter-spacing: 0; margin: 18px 0 6px; }

p, ul, ol, blockquote, figure, table, pre, details, dl { margin: 0 0 18px; }
p, li { text-wrap: pretty; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 0.35em; }
li::marker { color: var(--ink-soft); }
strong, b { font-weight: 700; }

code, pre, kbd { font-family: var(--font-mono); font-size: 0.86em; }
:not(pre) > code {
  background: var(--surface);
  padding: 0.05em 0.3em;
  overflow-wrap: anywhere;
}
pre {
  background: var(--surface);
  padding: 14px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
  max-width: 100%;
}

/* Quotes: italic, with a rule on the left */
blockquote {
  margin-left: 0; margin-right: 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--n400);
  font-size: 20px;
  line-height: 1.5;
  font-style: italic;
  color: var(--n800);
}
blockquote p { margin: 0 0 6px; }
blockquote > :last-child { margin-bottom: 0; }
blockquote cite, blockquote footer {
  display: block; margin-top: 6px;
  font-size: 13px; font-style: normal; color: var(--ink-soft);
}
figure { margin-left: 0; margin-right: 0; }
figure img { display: block; border: 1px solid var(--line); }
figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
figure.quote blockquote { margin: 0; }
figure.quote figcaption { margin-top: 6px; padding-left: 20px; }

details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
details + details { border-top: 0; }
summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 500;
  list-style: none;
  display: flex; gap: 0.6em; align-items: baseline;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; font-family: var(--font-mono); color: var(--accent); width: 1em; flex: none; }
details[open] > summary::before { content: "\2212"; }
details > :not(summary) { margin-left: 1.6em; }
details > :last-child { padding-bottom: 10px; }

table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td {
  text-align: left; vertical-align: top;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--n200);
  overflow-wrap: break-word;
  hyphens: auto;
}
th:last-child, td:last-child { padding-right: 0; }
th {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
td.num, th.num { text-align: right; white-space: nowrap; }
td code { overflow-wrap: normal; white-space: nowrap; }
/* A table still too wide scrolls inside its own box, with a shade at the edge that has more,
   and a line of text saying so (added by course.js). */
.table-wrap {
  --edge: rgba(29, 31, 32, 0.22);
  overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--bg) 30%, transparent) left / 2rem 100% no-repeat local,
    linear-gradient(to left, var(--bg) 30%, transparent) right / 2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--edge), transparent) left / 0.9rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--edge), transparent) right / 0.9rem 100% no-repeat scroll;
}
@media (prefers-color-scheme: dark) { .table-wrap { --edge: rgba(0, 0, 0, 0.6); } }
.table-wrap > table { margin: 0; }
.table-hint { font-size: 13px; color: var(--ink-soft); }

/* ---------- Corner marks ("blueprint" frame), drawn with one pseudo-element ---------- */

.frame, .dodont > .do, .dodont > .dont, .cards > .card { position: relative; }
.frame::after, .dodont > .do::after, .dodont > .dont::after, .cards > .card::after {
  --cl: linear-gradient(var(--corner), var(--corner));
  content: "";
  position: absolute; inset: -6px;
  pointer-events: none;
  background:
    var(--cl) left 5px top 0 / 1px 11px no-repeat,
    var(--cl) left 0 top 5px / 11px 1px no-repeat,
    var(--cl) right 5px top 0 / 1px 11px no-repeat,
    var(--cl) right 0 top 5px / 11px 1px no-repeat,
    var(--cl) left 5px bottom 0 / 1px 11px no-repeat,
    var(--cl) left 0 bottom 5px / 11px 1px no-repeat,
    var(--cl) right 5px bottom 0 / 1px 11px no-repeat,
    var(--cl) right 0 bottom 5px / 11px 1px no-repeat;
}

/* ---------- Content classes ---------- */

.kicker {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.lead { font-size: 19px; line-height: 1.5; }

.note {
  font-size: 14px;
  color: var(--ink-soft);
  border-left: 2px solid var(--n400);
  padding: 2px 0 2px 14px;
}
.note > :last-child { margin-bottom: 0; }

.big {
  font-family: var(--font-display);
  font-size: clamp(34px, 26px + 2.5vw, 52px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--accent);
  text-wrap: balance;
}

.example { border: 1px solid var(--line); padding: 16px; }
.example > :last-child { margin-bottom: 0; }
.example > p { font-size: 15px; color: var(--ink-soft); margin-bottom: 10px; }
.example pre { background: transparent; padding: 0; font-size: 0.86em; color: var(--ink); margin: 0; }
.copyable { position: relative; }
.copyable:not(:last-child) { margin-bottom: 18px; }
.copyable__bar { display: flex; justify-content: flex-end; margin: -6px -6px 6px 0; }

/* Running-message marker: an 8px accent square and a small label */
.thread {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; line-height: 1.3;
  color: var(--accent-800);
}
.thread::before { content: ""; flex: none; width: 8px; height: 8px; background: var(--accent); }
span.thread { display: inline-flex; }

/* Do / instead of: framed boxes with a tick or a cross. Do comes first when stacked. */
.dodont {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 18px;
  margin: 4px 0 18px;
}
.do, .dont {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  font-size: 16px;
  margin: 0 0 18px;
}
.dodont > .do, .dodont > .dont { margin: 0; }
.do { order: -1; border-color: var(--accent); }
.dont { color: var(--n800); }
.do > *, .dont > * { margin: 0; }
.dodont__label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 16px; line-height: 1.2;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.do .dodont__label { color: var(--accent-800); }
.dont .dodont__label { color: var(--n800); }
.dodont__mark { width: 24px; height: 24px; flex: none; display: grid; place-items: center; }
.do .dodont__mark { background: var(--accent); color: var(--accent-ink); }
.dont .dodont__mark { border: 1px solid var(--ink-soft); color: var(--n800); }
/* Without the engine the labels are written by CSS */
html:not(.aic-on) .do::before, html:not(.aic-on) .dont::before {
  font-family: var(--font-display); font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase;
}
html:not(.aic-on) .do::before { content: "Do"; color: var(--accent-800); }
html:not(.aic-on) .dont::before { content: "Instead of"; }

/* Tick and cross list */
.checklist { list-style: none; padding: 0; display: flex; flex-direction: column; }
.checklist > li {
  position: relative;
  margin: 0;
  padding: 12px 0 12px 40px;
  border-bottom: 1px solid var(--n200);
  min-height: 50px;
}
.checklist > li:last-child { border-bottom: 0; }
.checklist > li::before, .checklist > li::after { content: ""; position: absolute; left: 0; top: 13px; width: 24px; height: 24px; }
.checklist > li.yes::before { background: var(--accent); }
.checklist > li.no::before { border: 1px solid var(--ink-soft); }
.checklist > li::after {
  -webkit-mask: var(--mark) center / 15px 15px no-repeat;
  mask: var(--mark) center / 15px 15px no-repeat;
}
.checklist > li.yes::after {
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background: var(--accent-ink);
}
.checklist > li.no::after {
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
  background: var(--n800);
}
.checklist > li:not(.yes):not(.no) { padding-left: 0; }
.checklist > li:not(.yes):not(.no)::before, .checklist > li:not(.yes):not(.no)::after { display: none; }

/* Two framed columns */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
  margin: 4px 0 18px;
}
.card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
}
.card > * { margin: 0; }
.card h3, .card h4 { font-size: 20px; }
.card p, .card li { font-size: 15px; }

/* External links say they leave the site */
a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: 0.75em; height: 0.75em;
  margin-left: 0.25em;
  vertical-align: -0.02em;
  background: currentColor;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M7 7h10v10'/%3E%3C/svg%3E");
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
}

/* "Learn more": hairline rows like the step list */
.links { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.links > li {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--n200);
  color: var(--n800);
}
.links a { font-weight: 500; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-800); border-color: var(--accent-800); }
@media (prefers-color-scheme: dark) {
  .btn--primary:hover { background: #b5d9fd; border-color: #b5d9fd; }
}
.btn--ghost { border-color: transparent; color: var(--accent); padding-left: 6px; padding-right: 8px; }
.btn--ghost:hover { background: rgba(89, 128, 166, 0.12); }
.btn--quiet { border-color: var(--line); color: var(--ink); }
.btn--small { min-height: 36px; padding: 6px 12px; font-size: 15px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn--primary[disabled]:hover { background: var(--accent); border-color: var(--accent); }
.btn:not(.btn--primary)[disabled]:hover { background: transparent; }

/* ---------- Widget container ---------- */

.widget {
  border: 1px solid var(--line);
  padding: 16px;
  max-width: 100%;
  min-height: 6rem;
  overflow-x: auto;
  font-size: 16px;
}
.widget[data-widget="prompt-stack"] { border: 0; padding: 0; overflow: visible; }
@media (max-width: 30rem) {
  .widget { padding: 12px; }
}
.widget[data-state="loading"]::before {
  content: "Loading the interactive part\2026";
  color: var(--ink-soft);
  font-size: 14px;
}
.widget__error { color: var(--ink); font-size: 15px; margin: 0; }

/* ---------- Quiz ---------- */

.quiz { margin: 0 0 32px; }
.quiz:last-child { margin-bottom: 0; }
.quiz__q { font-weight: 500; margin: 0 0 14px; }
.quiz > button[data-opt] {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%;
  min-height: 44px;
  text-align: left;
  margin: 0 0 8px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
  touch-action: manipulation;
}
.quiz > button[data-opt]:hover { border-color: var(--accent); }
.quiz__mark {
  flex: none;
  width: 22px; height: 22px;
  border: 1px solid var(--line);
  display: inline-grid; place-items: center;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1;
}
.quiz__label { flex: 1; min-width: 0; }
.quiz__tag { flex: none; align-self: center; font-size: 13px; color: var(--ink-soft); }
.quiz.is-answered > button[data-opt] { cursor: default; }
.quiz.is-answered > button[data-opt]:hover { border-color: var(--line); }
.quiz > button[data-opt].is-right,
.quiz.is-answered > button[data-opt].is-right:hover { border-color: var(--accent); background: var(--accent-100); }
.quiz > button[data-opt].is-right .quiz__mark { color: var(--accent-800); border-color: var(--accent); }
.quiz > button[data-opt].is-right .quiz__tag { color: var(--accent-800); }
.quiz > button[data-opt].is-wrong,
.quiz.is-answered > button[data-opt].is-wrong:hover { border-color: var(--ink-soft); }
.quiz > button[data-opt].is-wrong .quiz__mark { border-color: var(--ink-soft); }
.quiz__result {
  font-weight: 700;
  font-size: 16px;
  margin: 10px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.quiz__result:empty { display: none; }
.quiz__explain { font-size: 16px; }
.quiz__explain > :last-child { margin-bottom: 0; }
.aic-on .quiz:not(.is-answered) .quiz__explain { display: none; }
.quiz__reset { margin-top: 12px; }

/* ---------- Slides: without JavaScript, stacked as a long page ---------- */

.deck { display: block; }
.slide {
  max-width: var(--column);
  margin: 0 auto;
  padding: 36px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.slide > :last-child { margin-bottom: 0; }

/* ---------- Lesson page with the engine running ---------- */

body.is-lesson {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}
.is-lesson .deck {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 36px var(--gutter) 48px;
}
.aic-on .slide {
  max-width: none;
  padding: 0;
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  outline: none;
}
.aic-on .slide > * { margin: 0; }
.aic-on .slide[hidden] { display: none; }
.aic-on .slide.is-entering { animation: slide-in 180ms ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.slide--title h1 { margin: 0; }
.slide--title .lead { margin: 0; }

/* End slide made by the engine */
.slide--end h2 { margin: 0; }
.end__score { font-size: 15px; color: var(--ink-soft); }
.end__coming { display: flex; flex-direction: column; gap: 10px; margin-top: 6px !important; }
.end__coming > * { margin: 0; }
.end__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 8px !important; }
.end__next {
  white-space: normal;
  text-align: left;
  justify-content: flex-start;
  line-height: 1.25;
  max-width: 100%;
}

/* Top bar: back to the course, where you are, and the slide segments */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.bar__row {
  max-width: var(--column);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 12px;
}
.bar__home { min-height: 40px; margin-left: -6px; }
.bar__where { margin-left: auto; font-size: 13px; color: var(--ink-soft); text-align: right; line-height: 1.3; }
.progress {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 var(--gutter) 10px;
  display: flex; gap: 4px;
}
.progress__seg { flex: 1; height: 3px; background: var(--n300); }
.progress__seg.is-on { background: var(--accent); }

/* Bottom bar: Previous, "3 / 8", Next */
.pager {
  position: sticky; bottom: 0; z-index: 20;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.pager__inner {
  max-width: var(--column);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 12px;
}
.pager .btn { min-height: 44px; min-width: 110px; flex: none; }
.pager__count { flex: 1; text-align: center; font-size: 13px; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Click the left or right margin to move, on desktops */
.edge { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 64rem) {
  .edge {
    display: block;
    position: fixed;
    top: 0; bottom: 0;
    width: calc((100vw - var(--column)) / 2 - 8px);
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 10;
    padding: 0;
  }
  .edge--prev { left: 0; cursor: w-resize; }
  .edge--next { right: 0; cursor: e-resize; }
  .edge::after {
    content: "";
    position: absolute; top: 50%;
    width: 0.9rem; height: 0.9rem;
    border: solid var(--ink-soft);
    border-width: 0 0 1.5px 1.5px;
    opacity: 0;
    transition: opacity 120ms;
  }
  .edge--prev::after { right: 2.5rem; transform: rotate(45deg); }
  .edge--next::after { left: 2.5rem; transform: rotate(-135deg); }
  .edge:hover::after { opacity: 0.7; }
  .edge[disabled] { cursor: default; }
  .edge[disabled]::after { display: none; }
}

/* ---------- Home page ---------- */

.home {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 var(--gutter) 64px;
  display: flex; flex-direction: column; gap: 40px;
}
.home__top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.home__top p { margin: 0; }
.home__name { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.2; }
.home__count { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.home__main { display: flex; flex-direction: column; gap: 40px; }
.home__parts { display: contents; }

.home__intro { display: flex; flex-direction: column; gap: 14px; }
.home__intro > * { margin: 0; }
.home__intro h1 { font-size: 46px; line-height: 1.02; letter-spacing: -0.015em; }
.home__intro > p { font-size: 17px; max-width: 600px; }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px !important; }
.cta:empty { display: none; }
.btn--cta { font-size: 17px; padding: 12px 20px; gap: 8px; max-width: none; }
.btn--cta.is-wrapping { white-space: normal; text-align: left; max-width: 100%; }
.cta__meta { font-size: 14px; color: var(--ink-soft); }

.part { display: flex; flex-direction: column; gap: 10px; }
.part__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.part__head h2 { font-size: 24px; line-height: 1.15; margin: 0; }
.part__time { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }

.steps { list-style: none; padding: 0; margin: 0; }
.steps > li { margin: 0; border-bottom: 1px solid var(--n200); }
.steps__row {
  display: grid;
  grid-template-columns: 28px 26px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.steps__tick {
  width: 22px; height: 22px; margin-top: 2px;
  display: grid; place-items: center;
  border: 1px solid var(--n400);
}
.steps__tick.is-next { border-color: var(--accent); }
.steps__tick.is-done { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.steps__num { font-family: var(--font-display); font-size: 20px; line-height: 1.2; color: var(--accent); }
.steps__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.steps__title { font-size: 17px; font-weight: 500; line-height: 1.35; text-wrap: pretty; }
.steps__meta { font-size: 13px; color: var(--ink-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.steps__go { align-self: center; }
.steps__row:hover .steps__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.steps__row:hover .steps__go { background: var(--hover); }

.home__extras { display: flex; flex-direction: column; gap: 12px; }
html:not(.aic-on) .home__extras { display: none; } /* filled by the engine */
.extras {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}
.extras > li { margin: 0; display: flex; }
.extra {
  flex: 1;
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.extra:hover { background: var(--hover); }
.extra__kicker {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
}
.extra__title { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.2; }
.extra__sum { font-size: 14px; color: var(--n800); }

.home__foot { font-size: 13px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 4px; }
.home__foot p { margin: 0; }
.home__foot .btn { margin-top: 10px; }

/* ---------- Phones ---------- */

@media (max-width: 40rem) {
  .home__intro h1 { font-size: 34px; }
  h1, .slide--title h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .is-lesson .deck { padding-top: 28px; }
}

/* ---------- Motion ---------- */

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

/* ---------- Print: stacked, no chrome ---------- */

@media print {
  .bar, .pager, .edge, .copyable__bar, .skip { display: none !important; }
  .aic-on .slide[hidden] { display: flex; }
  .aic-on .slide { break-inside: avoid; padding: 24px 0; }
}
