/* ═══════════════════════════════════════════════════════════════════════════
   IB SEHS · Focus lesson — a full-screen, sentence-at-a-time reader.

   This page deliberately loads none of the site chrome: no sidebar, no top bar,
   no FABs, no modals. It loads the theme stylesheet only for the colour
   variables and the light/dark pair, so the lesson matches the rest of the site
   without inheriting any of its layout.

   Layout: a fixed rail (progress + controls) on top and ONE reading column,
   which is the whole screen on a desktop. The section map does not hold a
   column open — it lives in a capsule off the left edge and slides in when
   reached for (below 1040px the same markup is a full drawer).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* 73px = the site header's own measured height (a 40px control plus
     16.5px of padding top and bottom). The reader bar was 58px, so the
     frame changed height the moment you opened a lesson. */
  --rail-h: 73px;
  --rail-w: 296px;
  --lesson-w: 46rem;          /* comfortable measure for long-form reading */

  /* Shape comes from design/tokens.css. This file used to declare its own
     --r-sm/--r-md/--r-lg (8/14/22px) on :root, which silently made every
     rounded surface in the reader rounder than the same surface anywhere
     else on the site (site: 6/10/16px). One radius scale, owned by tokens. */
}

/* ── base ────────────────────────────────────────────────────────────────── */

/* The figures were drawn against --border / --accent, which the theme does not
   define under those names. */
:root { --accent: var(--gold); }

body.ib-lesson {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font, system-ui, sans-serif);
  font-size: 17px;
  line-height: 1.62;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: break-word;
  /* NO `--line` alias here.

     This block used to say `--line: var(--border, #d5e0e9)`, added because the
     reader names `--line` about forty times and it was undefined. That broke the
     moment tokens.css landed: `body.jr` sets `--border: var(--jr-rule2)` and
     `--jr-rule2: var(--line)`, so aliasing --line back to --border closed a
     cycle — and a cycle makes the name guaranteed-invalid, not merely unset.
     tokens.css declares `--line` with a literal on `:root` (#DCDDD6 / #2A3D4A)
     and at (0,1,0) it loses to this (0,1,1) body rule, so the cycle won and
     `--line` computed to the empty string on the reader only.

     Symptom: in LIGHT mode the top bar and the cover strip had no bottom
     hairline at all (`border-bottom-width` computed to 0px, since
     `1px solid <invalid>` is dropped whole) while dark mode looked correct, so
     it read as "the light theme is missing its borders" rather than as a token
     bug. --line now inherits from tokens and re-resolves in dark mode on its
     own, which is what the original comment was worried about. */
}

/* Reading is the point, so no accidental sideways scroll on a phone. */
body.ib-lesson { overflow-x: hidden; }

/* Deliberately NOT `color: inherit` here: it is (0,1,2) and it beat the
   drill blank's `color: transparent`, so the hidden key terms stayed
   readable. The two buttons that used to lean on it declare their own. */
body.ib-lesson button { font: inherit; }

.ib-lesson-shell {
  /* The rail column only exists on desktop. On a phone the reading column is
     centred with no left offset, which is why this is a plain grid here.

     The measure is capped at EVERY width, not just above 1300px. The old base
     rule was `1fr` and the cap only existed inside the min-width:1300 block,
     so between ~1000 and 1300px — i.e. a 13" laptop window, and the window
     this was reported from — the column was whatever the viewport was:
     1045px and ~124 characters per line at 1082px wide, snapping to 736px the
     moment the window crossed 1300. The cap belongs on the base rule; the
     breakpoint is only about whether the rail is a capsule or a drawer. */
  display: grid;
  grid-template-columns: minmax(0, var(--lesson-w));
  justify-content: center;
  padding: 0 1.15rem 0;
}

/* 1300px, not 1040px: the capsule is --rail-w (296px) plus its 14px inset, so
   below ~1300 it would land on top of the reading column instead of beside it.
   Under that width the map falls back to the drawer with a scrim, which is an
   overlay on purpose and therefore allowed to cover text. */
@media (min-width: 1300px) {
  /* The lesson is the whole screen, as it is in the reference reader: no
     permanent second column competing with the card you are reading. The
     section map becomes a capsule that lives off the left edge and slides in
     when you reach for it. The column width itself is set on the base rule. */
  .ib-lesson-shell {
    gap: 0;
    padding: 0 2.5rem 0;
  }
  .ib-rail {
    position: fixed;
    left: 14px;
    top: 50%;
    width: var(--rail-w);
    max-height: min(78vh, 640px);
    z-index: 60;
    padding: 1.05rem 1.15rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
            backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: 0 30px 64px -24px rgba(6, 16, 34, .55);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateY(-50%) translateX(calc(-100% - 30px));
    opacity: 0;
    transition: transform .34s cubic-bezier(.2, .85, .25, 1), opacity .22s ease;
  }
  .ib-rail.is-open { transform: translateY(-50%) translateX(0); opacity: 1; }
  .ib-rail__scrim,
  .ib-rail__close { display: none; }
}

/* The peek that opens the capsule. A pill, not a hot edge: a full-height
   hover strip would pop the map open every time the pointer crossed the left
   margin on its way to the Next button. */
.ib-peek {
  display: none;
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 59;
  width: 30px;
  height: 74px;
  margin-top: -37px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 15px 15px 0;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px -14px rgba(6, 16, 34, .5);
  color: var(--text2);
  cursor: pointer;
  transition: background .16s, color .16s, opacity .2s, transform .2s;
}
.ib-peek svg { width: 16px; height: 16px; }
.ib-peek:hover { background: var(--surface); color: var(--text); transform: translateX(2px); }
.ib-peek.is-off { opacity: 0; pointer-events: none; }
@media (min-width: 1300px) { .ib-peek { display: inline-flex; } }

/* `[hidden]` is only `display:none` in the UA stylesheet, so ANY author rule
   that sets `display` silently defeats it. `.ib-foot{display:flex}` and
   `.ib-reader{display:grid}` therefore left the reader's Back/Next footer and
   a 147px slice of the reader rendering on the hub, even with the attribute
   correctly set to true. This is the canonical remedy and it fixes every
   `el.hidden = true` in the script at once. */
[hidden] { display: none !important; }

/* ── top rail: Exit, progress, toggles ───────────────────────────────────── */

/* The progress bar, its counter and the term-blanking drill describe a lesson
   IN PROGRESS, so they only mean anything inside the reader. On the hub they
   rendered as a wide empty bar, a bare em dash and a "Test me" button that
   had nothing to test. .ib-reading is added on open and removed on exit. */
body.ib-lesson:not(.ib-reading) #ibDrill,
body.ib-lesson:not(.ib-reading) .ib-top__bar,
body.ib-lesson:not(.ib-reading) .ib-top__count { display: none; }

/* Same reasoning for the moment before the first slide exists: the resume
   prompt is the only thing on screen, so the counter would be a bare em dash,
   the drill would have nothing to blank and the footer nothing to advance. */
body.ib-resuming #ibDrill,
body.ib-resuming .ib-top__bar,
body.ib-resuming .ib-top__count,
body.ib-resuming .ib-foot { display: none; }

.ib-top {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--rail-h);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 clamp(.9rem, 3vw, 1.6rem);
  /* Opaque, not glass. At 86% the 43px lesson heading ghosted through the bar
     while scrolling, and the pinned title strip underneath is already opaque
     (it has to be, or body text reads through it) — two different glass rules
     one above the other looked like a rendering fault. */
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

/* A circle, because that is what an icon-only control is everywhere else on
   this site: the header's .btn-icon is 40x40, border 1px --line-2, radius 50%,
   transparent background. The reader's exit was a 6px-rounded box with a
   surface fill — a different family of object. */
.ib-top__exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: transparent;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text2);
  cursor: pointer;
  flex: none;
}
.ib-top__exit:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.ib-top__exit svg { width: 15px; height: 15px; display: block; }

/* Progress is a hairline that fills. Not a number: the eye reads position. */
.ib-top__bar {
  flex: 1 1 auto;
  height: 6px;
  min-width: 40px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;
}
.ib-top__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  /* one flat accent: the blue→purple gradient was the last decoration on a
     control whose only job is to report position */
  background: var(--accent);
  transition: width .32s cubic-bezier(.4, 0, .2, 1);
}
.ib-top__count {
  flex: none;
  font-size: .76rem;
  font-weight: 800;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
  min-width: 4.4em;
  text-align: right;
}

/* Text controls are typographic, not boxes: the site header sets its account
   and nav triggers in uppercase 0.72rem/600 with wide tracking and no border at
   all. The reader's were 0.78rem/800 inside a bordered pill. */
.ib-top__btn {
  flex: none;
  min-width: 0;
  height: 40px;
  padding: 0 .55rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .089em;
  text-transform: uppercase;
  color: var(--text2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ib-top__btn:hover { color: var(--text); }

/* The pressed state used --blue / --blue2, which are the *diagram* palette —
   the nerve and muscle models paint with them. A mode toggle and a homework
   answer should not share a colour name. */
.ib-top__btn[aria-pressed="true"] {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Icon-only members of the same family become circles, same as the exit. */
.ib-top__btn--icon {
  width: 40px;
  min-width: 40px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  font-size: .95rem;
  letter-spacing: 0;
}
.ib-top__btn--icon:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
/* the drawer trigger only exists where the rail is a drawer */
.ib-top__btn--rail { display: inline-flex; }
@media (min-width: 1300px) { .ib-top__btn--rail { display: none; } }

.ib-top__slot { display: none; }
@media (min-width: 1040px) { .ib-top__slot { display: block; flex: 1 1 0; } }

/* ── reading column ──────────────────────────────────────────────────────── */

.ib-read {
  min-width: 0;
  padding: clamp(1.6rem, 4vw, 3rem) 0 8rem;
  padding-left: 0;
}
@media (min-width: 1040px) { .ib-read { padding-top: 2.4rem; } }

/* Chapter cover */

.ib-cover__kicker {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue2) 11%, var(--surface));
  color: var(--blue2);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ib-cover__title {
  /* --font-heading is NOT the headline face in this codebase: design/tokens.css
     deliberately points it at the text face, because 28 legacy sheets use it
     for component titles (quiz questions, card titles, video captions). A real
     heading asks for --font-display, which is Newsreader — the same serif as
     every h1 on the site. Without this the lesson title rendered in Nunito
     Sans while the textbook's rendered in Newsreader. */
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5.5vw, 2.7rem);
  line-height: var(--lh-serif, 1.06);
  letter-spacing: var(--tr-serif, -.014em);
  margin: .9rem 0 .5rem;
}
.ib-cover__meta { color: var(--text2); font-size: .92rem; }

/* Past the first step the cover collapses to a single pinned line. A lesson
   that shows one card at a time cannot spend 140px on a heading the reader has
   already read — that space is where the card goes. */
/* The cover has two states, and until now there was only a rule for the second
   one — `.ib-read.is-past .ib-cover` — which therefore styled the hero as well.
   A background with `padding: … 0 …` draws a coloured band that begins and ends
   exactly at the text, so a 43px serif lesson title looked jammed against the
   edge of its own strip. */
.ib-cover {
  padding: .5rem 0 .55rem;
  border-bottom: 0;
  background: none;
  /* belt and braces: any future global `header` rule must not turn the title
     into a glass card. The band is a pinned-state treatment only. */
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
  box-shadow: none;
}

/* Pinned state. The strip is the reading column plus the shell gutter on each
   side — it reads as part of the bar it hangs from rather than as a floating
   label — and the negative margins keep the title optically aligned with the
   body text underneath. */
.ib-read.is-past .ib-cover {
  padding: .5rem 1.15rem .55rem;
  margin: 0 -1.15rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
}

/* The site-wide "page header is sticky" rule — `header:not(.ib-hero):not(.ch-hero)`
   — also matched this <header class="ib-cover">, and the journal theme then
   forced its background to transparent. Result: the title of the chapter you
   are reading was pinned at top:0, z-index 150, transparent, directly over the
   reader's own sticky bar, so on a phone the two printed on top of each other.
   The cover is re-pinned here BELOW the bar, and it is given its background
   back, without which it would slide over the card as an unreadable ghost. */
body.ib-lesson .ib-read .ib-cover {
  position: sticky;
  top: var(--rail-h);
  z-index: 30;
}
body.ib-lesson .ib-read:not(.is-past) .ib-cover {
  position: static;
  z-index: auto;
}
body.ib-lesson .ib-read.is-past .ib-cover {
  /* solid, not 94%: at 94% the white body text behind it read through the
     strip, so the pinned chapter name looked double-printed */
  background-color: var(--bg) !important;
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
}
@media (max-width: 620px) {
  body.ib-lesson .ib-read.is-past .ib-cover { padding: .35rem 1.15rem .4rem; }
  body.ib-lesson .ib-read.is-past .ib-cover__title { font-size: .84rem; }
}
.ib-read.is-past .ib-cover__kicker,
.ib-read.is-past .ib-cover__meta { display: none; }
.ib-read.is-past .ib-cover__title {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  line-height: 1.3;
  color: var(--text2);
}

/* section opener */
.ib-sec {
  margin: 3.2rem 0 1.4rem;
  padding-top: 1.4rem;
  border-top: 2px solid var(--line);
  scroll-margin-top: calc(var(--rail-h) + 1rem);
}
.ib-sec:first-child { border-top: 0; margin-top: 1rem; }
.ib-sec__label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent, var(--gold));
}
.ib-sec__label svg { width: 17px; height: 17px; flex: none; }
.ib-sec__title {
  font-family: var(--font-heading, Georgia, serif);
  font-size: clamp(1.3rem, 3.6vw, 1.72rem);
  line-height: 1.22;
  margin: .5rem 0 0;
  letter-spacing: -.012em;
}
.ib-sec__code {
  display: inline-block;
  margin-left: .5rem;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: .74em;
  color: var(--text3);
  font-weight: 700;
  vertical-align: .1em;
}

/* A revealed sentence. Fades and dims as later blocks land below it, so the
   newest line is always the brightest thing on screen. */
.ib-sum {
  font-size: clamp(1.02rem, 2.5vw, 1.16rem);
  line-height: 1.72;
  margin: 0 0 1.15rem;
}

.ib-sum b, .ib-card b, .ib-sec__title b { font-weight: 800; color: var(--text); }
.ib-card b, .ib-sum b { background: color-mix(in srgb, var(--gold) 15%, transparent); border-radius: 3px; padding: 0 .12em; }

/* ── cards ────────────────────────────────────────────────────────────────── */
/* Key Idea / Definition / Note / Example / Analogy all share one quadrilateral
   shell so they read as a family; only the tint and the label change. */

.ib-card {
  position: relative;
  margin: 1.35rem 0;
  padding: 1rem 1.15rem 1.05rem;
  border-radius: var(--r-md);
  border: 1px solid var(--ib-c-bd);
  border-left: 5px solid var(--ib-c-ac);
  background: var(--ib-c-bg);
  transition: opacity .3s ease;
  opacity: .62;
}


.ib-card__label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .03em;
  color: var(--ib-c-ac);
  margin-bottom: .4rem;
}
.ib-card__label svg { width: 16px; height: 16px; flex: none; }
.ib-card__title { font-weight: 800; font-size: 1.04rem; margin: 0 0 .3rem; }
.ib-card__body { font-size: .99rem; line-height: 1.66; margin: 0; }
.ib-card__body ul { margin: .5rem 0 0; padding-left: 1.15rem; }
.ib-card__body li { margin: .3rem 0; }
.ib-card__body li::marker { color: var(--ib-c-ac); font-weight: 800; }
.ib-card__note {
  margin: .55rem 0 0;
  font-size: .86rem;
  color: var(--text2);
  font-style: italic;
}

/* the five tints — values live in design/tokens.css (--tint-*), so a card and
   a "correct answer" can never drift into the same green again */
.ib-card--idea    { --ib-c-ac: var(--tint-idea);    --ib-c-bg: color-mix(in srgb, var(--tint-idea) 7%, var(--surface));  --ib-c-bd: color-mix(in srgb, var(--tint-idea) 26%, transparent); }
.ib-card--def     { --ib-c-ac: var(--tint-def);     --ib-c-bg: color-mix(in srgb, var(--tint-def) 5%, var(--surface));   --ib-c-bd: color-mix(in srgb, var(--tint-def) 22%, transparent); }
.ib-card--note    { --ib-c-ac: var(--tint-note);    --ib-c-bg: color-mix(in srgb, var(--tint-note) 7%, var(--surface));  --ib-c-bd: color-mix(in srgb, var(--tint-note) 24%, transparent); }
/* Analogy and Example are the two the brief calls out by name. */
.ib-card--analogy { --ib-c-ac: var(--tint-analogy); --ib-c-bg: color-mix(in srgb, var(--tint-analogy) 8%, var(--surface)); --ib-c-bd: color-mix(in srgb, var(--tint-analogy) 28%, transparent); }
.ib-card--example { --ib-c-ac: var(--tint-example); --ib-c-bg: color-mix(in srgb, var(--tint-example) 6%, var(--surface)); --ib-c-bd: color-mix(in srgb, var(--tint-example) 22%, transparent); }

/* Definition card gets a term + its definition, which is what feeds both the
   glossary and the flashcard deck. */
.ib-def__term { font-weight: 800; font-size: 1.06rem; margin: 0 0 .25rem; }

/* ── lesson cards: one named idea per screen ───────────────────────────────
   The unit of a lesson is a card, not a paragraph. Every card carries a number
   badge and a heading that STATES the idea ("The receptor decides, not the
   route"), so a glance at the progress bar tells you what you just covered.
   A card is never a lone sentence: if there is only one sentence to say, it
   becomes a card with a heading, and the next card is a different idea. */

.ib-xc {
  --xc-ac: var(--gold);
  --xc-bg: transparent;
  --xc-bd: transparent;
  margin: 2rem 0 2.35rem;
  padding: 0;
}

.ib-xc__head {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
}

.ib-xc__num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  margin-top: .18rem;
  border-radius: 50%;
  border: 1.5px solid var(--xc-ac);
  color: var(--xc-ac);
  font-size: .78rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ib-xc__hw { min-width: 0; }

/* The little type flag above the heading — Key idea · Note · Common mistake. */
.ib-xc__kind {
  display: inline-flex;
  align-items: center;
  gap: .34rem;
  margin-bottom: .28rem;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--xc-ac);
}
.ib-xc__kind svg { width: 14px; height: 14px; flex: none; }

.ib-xc__h {
  margin: 0;
  font-size: clamp(1.16rem, 2.7vw, 1.34rem);
  line-height: 1.34;
  font-weight: 700;
  letter-spacing: -.005em;
  color: var(--text);
}

.ib-xc__b {
  margin: .7rem 0 0 2.42rem;
  font-size: clamp(.99rem, 2.3vw, 1.06rem);
  line-height: 1.78;
  color: color-mix(in srgb, var(--text) 88%, transparent);
}
.ib-xc__b b,
.ib-xc__li b {
  font-weight: 800;
  color: var(--text);
  background: color-mix(in srgb, var(--gold) 15%, transparent);
  border-radius: 3px;
  padding: 0 .12em;
}

.ib-xc__li {
  margin: .75rem 0 0 2.42rem;
  padding-left: 1.05rem;
  font-size: clamp(.96rem, 2.2vw, 1.02rem);
  line-height: 1.7;
  color: color-mix(in srgb, var(--text) 84%, transparent);
}
.ib-xc__li li { margin: .38rem 0; }
.ib-xc__li li::marker { color: var(--xc-ac); }

/* A card that holds a figure keeps the figure flush with the body text. */
.ib-xc .ib-fig__in { margin: 1.15rem 0 0 2.42rem; }
.ib-xc .ib-tbl__in { margin: 1.15rem 0 0 2.42rem; }
.ib-xc .ib-fig__title,
.ib-xc .ib-tbl__title { margin-bottom: .55rem; }

/* Typed callouts keep the tinted shell the rest of the reader already uses,
   but now they are cards too: same badge, same heading, same rhythm. */
.ib-xc--idea,
.ib-xc--note,
.ib-xc--mistake,
.ib-xc--hint,
.ib-xc--analogy,
.ib-xc--example {
  padding: 1.05rem 1.25rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid var(--xc-bd);
  border-left: 4px solid var(--xc-ac);
  background: var(--xc-bg);
}
/* Six card types, but not six hues. The old set (purple, green, red, amber,
   teal, blue) spent the last two on colours the eye reads as the same thing at
   an 8% tint, while green also meant "correct answer" and red also meant
   "wrong answer" 400 lines below. Five values now, each carrying one meaning:
   teal = guidance (idea, hint), steel = aside, clay = analogy, red = mistake,
   quiet grey = example. The label text does the rest of the discriminating. */
.ib-xc--idea    { --xc-ac: var(--tint-idea);    --xc-bg: color-mix(in srgb, var(--tint-idea) 7%, var(--surface));  --xc-bd: color-mix(in srgb, var(--tint-idea) 24%, transparent); }
.ib-xc--note    { --xc-ac: var(--tint-note);    --xc-bg: color-mix(in srgb, var(--tint-note) 7%, var(--surface));  --xc-bd: color-mix(in srgb, var(--tint-note) 24%, transparent); }
.ib-xc--mistake { --xc-ac: var(--tint-mistake); --xc-bg: color-mix(in srgb, var(--tint-mistake) 7%, var(--surface)); --xc-bd: color-mix(in srgb, var(--tint-mistake) 28%, transparent); }
.ib-xc--hint    { --xc-ac: var(--tint-hint);    --xc-bg: color-mix(in srgb, var(--tint-hint) 6%, var(--surface));  --xc-bd: color-mix(in srgb, var(--tint-hint) 22%, transparent); }
.ib-xc--analogy { --xc-ac: var(--tint-analogy); --xc-bg: color-mix(in srgb, var(--tint-analogy) 8%, var(--surface)); --xc-bd: color-mix(in srgb, var(--tint-analogy) 26%, transparent); }
.ib-xc--example { --xc-ac: var(--tint-example); --xc-bg: color-mix(in srgb, var(--tint-example) 6%, var(--surface)); --xc-bd: color-mix(in srgb, var(--tint-example) 22%, transparent); }

/* Inside a tinted card the heading is the card's accent, not the body colour,
   so the type is legible before a single word is read. */
.ib-xc--idea .ib-xc__h,
.ib-xc--note .ib-xc__h,
.ib-xc--mistake .ib-xc__h,
.ib-xc--hint .ib-xc__h,
.ib-xc--analogy .ib-xc__h,
.ib-xc--example .ib-xc__h { color: var(--text); }

@media (max-width: 620px) {
  .ib-xc__b, .ib-xc__li,
  .ib-xc .ib-fig__in, .ib-xc .ib-tbl__in { margin-left: 0; }
  .ib-xc__head { gap: .6rem; }
  .ib-xc__num { width: 23px; height: 23px; font-size: .72rem; }
}


/* ══ INTERACTIVE CARDS ══════════════════════════════════════════════════════
   order · sort · blank. One accent colour for all three: amber means "do
   something here", not "a third kind of idea". Each exercise is additive to
   the card, so it keeps the same badge, heading and left rule as a card that
   only states an idea. */

.ib-xc--order,
.ib-xc--sort,
.ib-xc--blank {
  --xc-ac: #b26a00;
  --xc-bg: color-mix(in srgb, #d9962b 9%, var(--surface));
  --xc-bd: color-mix(in srgb, #d9962b 28%, transparent);
  padding: 1.05rem 1.25rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid var(--xc-bd);
  border-left: 4px solid var(--xc-ac);
  background: var(--xc-bg);
}
body.dark .ib-xc--order,
body.dark .ib-xc--sort,
body.dark .ib-xc--blank { --xc-ac: #e8b25a; }

/* The three controls share one shape, so the eye learns it once. */
.ib-xo__check,
.ib-so__check,
.ib-bl__check {
  margin-top: .7rem;
  padding: .5rem 1.05rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--xc-ac) 42%, transparent);
  background: color-mix(in srgb, var(--xc-ac) 13%, var(--surface));
  color: var(--text);
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.ib-xo__check:hover,
.ib-so__check:hover,
.ib-bl__check:hover { background: color-mix(in srgb, var(--xc-ac) 22%, var(--surface)); }
.ib-xo__check:disabled,
.ib-so__check:disabled,
.ib-bl__check:disabled { opacity: .45; cursor: default; }

.ib-xo__out,
.ib-so__out,
.ib-bl__out {
  margin: .62rem 0 0;
  font-size: .9rem;
  line-height: 1.62;
  color: color-mix(in srgb, var(--text) 80%, transparent);
}

/* ── order ─────────────────────────────────────────────────────────────── */

.ib-xo { margin: 1rem 0 0 2.42rem; }
.ib-xo__list { list-style: none; margin: 0; padding: 0; }

.ib-xo__row {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  position: relative;
  margin: 0 0 .45rem;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: .97rem;
  line-height: 1.5;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  /* vertical drags still scroll the page; the grip is the handle that does
     not, which is the only way to keep dragging usable inside a scroller */
  touch-action: pan-y;
  transition: transform .16s cubic-bezier(.2, .8, .2, 1), box-shadow .16s, border-color .16s, background .16s;
}
.ib-xo__row:focus-visible { outline: 2px solid var(--xc-ac); outline-offset: 2px; }
.ib-xo__row.is-lift {
  z-index: 3;
  cursor: grabbing;
  border-color: var(--xc-ac);
  box-shadow: 0 16px 32px -12px rgba(6, 16, 34, .38);
  transition: box-shadow .16s, border-color .16s;
}
.ib-xo__row.is-sel {
  border-color: var(--xc-ac);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--xc-ac) 34%, transparent);
}
.ib-xo__row.is-right { border-color: color-mix(in srgb, var(--ok) 52%, transparent); }
.ib-xo__row.is-wrong {
  border-color: color-mix(in srgb, var(--err) 52%, transparent);
  background: color-mix(in srgb, var(--err) 6%, var(--surface));
}

.ib-xo__grip {
  flex: none;
  width: 15px; height: 15px;
  margin-top: .22rem;
  color: color-mix(in srgb, var(--text) 32%, transparent);
  cursor: grab;
  touch-action: none;          /* the one place a drag must not scroll */
}
.ib-xo__grip svg { width: 15px; height: 15px; display: block; }
.ib-xo__n {
  flex: none;
  min-width: 1.15rem;
  margin-top: .08rem;
  font-size: .78rem;
  font-weight: 900;
  color: var(--xc-ac);
  font-variant-numeric: tabular-nums;
}
.ib-xo__t { min-width: 0; }
.ib-xo__t b {
  font-weight: 800;
  color: var(--text);
  background: color-mix(in srgb, var(--gold) 15%, transparent);
  border-radius: 3px;
  padding: 0 .12em;
}

/* ── sort ──────────────────────────────────────────────────────────────── */

.ib-so { margin: 1rem 0 0 2.42rem; }

.ib-so__drop {
  display: flex;
  flex-direction: column;
  gap: .38rem;
  min-height: 54px;
  padding: .4rem;
  /* the dashes have to be visible on a dark surface or an EMPTY column reads
     as a text field waiting for typing, which is not what it is */
  border: 1.5px dashed color-mix(in srgb, var(--xc-ac) 38%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 52%, transparent);
  transition: border-color .15s, background .15s;
}
.ib-so__pool { min-height: 48px; margin-bottom: .7rem; flex-direction: row; flex-wrap: wrap; gap: .5rem; }
.ib-so__drop.is-hot {
  border-color: var(--xc-ac);
  background: color-mix(in srgb, var(--xc-ac) 11%, var(--surface));
}

.ib-so__grid {
  display: grid;
  /* 112px, not 150px: a five-way sort (the body's five transport jobs) wrapped
     its last category onto a second row as a lone stranded box */
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: .55rem;
}
.ib-so__cat { display: flex; flex-direction: column; }
.ib-so__h {
  margin: 0 0 .32rem .15rem;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--xc-ac);
}

/* A chip has to look like a separate object at rest, or a full pool reads as
   one solid band and there is no clue that anything can be picked up. */
.ib-so__chip {
  display: block;
  width: 100%;
  padding: .46rem .62rem;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--text) 17%, transparent);
  border-radius: 9px;
  background: var(--surface2, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: .87rem;
  line-height: 1.45;
  cursor: grab;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}
.ib-so__pool .ib-so__chip { width: auto; }
.ib-so__chip.is-lift {
  position: relative;
  z-index: 5;
  cursor: grabbing;
  border-color: var(--xc-ac);
  box-shadow: 0 16px 30px -12px rgba(6, 16, 34, .42);
  transition: box-shadow .15s, border-color .15s;
}
.ib-so__chip.is-sel {
  border-color: var(--xc-ac);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--xc-ac) 34%, transparent);
}
.ib-so__chip.is-right { border-color: color-mix(in srgb, var(--ok) 52%, transparent); }
.ib-so__chip.is-wrong {
  border-color: color-mix(in srgb, var(--err) 52%, transparent);
  background: color-mix(in srgb, var(--err) 7%, var(--surface));
}
.ib-so.is-done .ib-so__chip { cursor: default; }

/* ── blank ─────────────────────────────────────────────────────────────── */

.ib-bl { margin: 1rem 0 0 2.42rem; }

.ib-bl__text {
  margin: 0;
  font-size: clamp(.99rem, 2.3vw, 1.06rem);
  line-height: 2.15;
  color: color-mix(in srgb, var(--text) 88%, transparent);
}
.ib-bl__text b {
  font-weight: 800;
  color: var(--text);
  background: color-mix(in srgb, var(--gold) 15%, transparent);
  border-radius: 3px;
  padding: 0 .12em;
}
/* vitalite-ui.css paints every text input as a 40px sunken field, and it loads
   *after* this file — so a bare `.ib-bl__in` loses and a gap renders as a box.
   The extra `.ib-bl` in front is load-bearing: it is what out-ranks
   `input[type="text"]` without an !important. */
.ib-bl .ib-bl__in {
  display: inline-block;
  width: auto;
  margin: 0 .2rem;
  min-height: 0;
  padding: .04rem .4rem;
  border: 0;
  border-bottom: 2px solid color-mix(in srgb, var(--xc-ac) 66%, transparent);
  border-radius: 5px 5px 0 0;
  background: color-mix(in srgb, var(--xc-ac) 9%, transparent);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  vertical-align: baseline;
  outline: none;
  box-shadow: none;
  transition: border-color .15s, background .15s;
}
.ib-bl .ib-bl__in:focus,
.ib-bl .ib-bl__in:focus-visible {
  border-bottom-color: var(--xc-ac);
  background: color-mix(in srgb, var(--xc-ac) 15%, transparent);
  box-shadow: none;
}
.ib-bl__in.is-right {
  border-bottom-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 13%, transparent);
}
.ib-bl__in.is-wrong {
  border-bottom-color: var(--err);
  background: color-mix(in srgb, var(--err) 11%, transparent);
}

.ib-bl__bank { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
/* Once every gap is right the bank is just the answers you already gave,
   sitting under the sentence and competing with it. */
.ib-bl.is-done .ib-bl__bank { display: none; }
.ib-bl__chip {
  padding: .32rem .72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ib-bl__chip:hover {
  border-color: var(--xc-ac);
  background: color-mix(in srgb, var(--xc-ac) 12%, var(--surface));
}

@media (max-width: 620px) {
  .ib-xo, .ib-so, .ib-bl { margin-left: 0; }
}


/* ── figures and tables ─────────────────────────────────────────────────── */

.ib-fig { margin: 1.6rem 0; opacity: .62; transition: opacity .3s ease; }

.ib-fig__title {
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text3);
  margin: 0 0 .5rem;
}
.ib-fig__frame {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: .85rem;
}
.ib-fig__frame svg { width: 100%; height: auto; display: block; }
.ib-fig__legend { margin: .7rem 0 0; padding: 0; list-style: none; font-size: .9rem; color: var(--text2); }
.ib-fig__legend li { position: relative; padding-left: 1rem; margin: .28rem 0; }
.ib-fig__legend li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--blue2);
}
.ib-fig__cap { margin: .6rem 0 0; font-size: .88rem; color: var(--text2); }

.ib-tbl { margin: 1.6rem 0; opacity: .62; transition: opacity .3s ease; }

.ib-tbl__wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ib-tbl table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 26rem; }
.ib-tbl th, .ib-tbl td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.ib-tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); font-weight: 900; background: color-mix(in srgb, var(--text) 3%, transparent); }
.ib-tbl tr:last-child td { border-bottom: 0; }
.ib-tbl__title { font-size: .78rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--text3); margin: 0 0 .5rem; }
.ib-tbl__note { margin: .55rem 0 0; font-size: .87rem; color: var(--text2); }

/* ── flashcard slide ────────────────────────────────────────────────────── */

.ib-flash { margin: 1.6rem 0; text-align: center; opacity: .62; transition: opacity .3s ease; }

.ib-flash__label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .76rem; font-weight: 900; letter-spacing: .04em; color: var(--tint-idea);
}
.ib-flash__label svg { width: 16px; height: 16px; }
.ib-flash__card {
  margin: .6rem auto 0;
  max-width: 30rem;
  min-height: 13rem;
  padding: 2.4rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(16, 33, 58, .05);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ib-flash__q { font-size: 1.12rem; font-weight: 800; }
.ib-flash__hint { margin: .8rem 0 0; font-size: .82rem; color: var(--text3); }
.ib-flash.is-flipped .ib-flash__q { color: var(--text2); font-weight: 700; }

/* ── MCQ slide ──────────────────────────────────────────────────────────── */

.ib-mcq { margin: 1.7rem 0; opacity: .62; transition: opacity .3s ease; }

.ib-mcq__label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .76rem; font-weight: 900; letter-spacing: .04em; color: var(--accent);
}
.ib-mcq__label svg { width: 16px; height: 16px; }
.ib-mcq__q { font-size: 1.06rem; font-weight: 800; margin: .7rem 0 1rem; }
.ib-mcq__opt {
  color: var(--text);
  display: flex; align-items: flex-start; gap: .7rem;
  width: 100%; text-align: left;
  padding: .78rem .95rem; margin: .5rem 0;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
  font-size: .97rem; line-height: 1.5;
}
.ib-mcq__opt:hover:not(:disabled) { border-color: var(--blue2); }
.ib-mcq__opt:disabled { cursor: default; }
.ib-mcq__key {
  flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center;
  font-size: .78rem; font-weight: 900; color: var(--text3);
}
.ib-mcq__opt.is-right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.ib-mcq__opt.is-right .ib-mcq__key { border-color: var(--ok); color: var(--ok); }
.ib-mcq__opt.is-wrong { border-color: var(--err); background: color-mix(in srgb, var(--err) 9%, var(--surface)); }
.ib-mcq__opt.is-wrong .ib-mcq__key { border-color: var(--err); color: var(--err); }
.ib-mcq__why { margin: .8rem 0 0; font-size: .9rem; color: var(--text2); }
.ib-mcq__hintbtn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .85rem; min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--tint-hint) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tint-hint) 12%, var(--surface));
  color: var(--tint-hint); font-size: .82rem; font-weight: 800; cursor: pointer;
}
.ib-mcq__hintbtn:hover { background: color-mix(in srgb, var(--tint-hint) 20%, var(--surface)); }

/* ── term-blanking drill ────────────────────────────────────────────────── */
/* With the drill on, every bolded key term renders as a tap-to-reveal blank.
   That is the "learn it yourself" half: the page stops reading for you. */
.ib-blank {
  display: inline-block;
  min-width: 7.5em;
  margin: 0 .1em;
  padding: 0 .5em;
  border-bottom: 2px dashed var(--blue2);
  background: color-mix(in srgb, var(--blue2) 9%, transparent);
  border-radius: 5px 5px 0 0;
  color: transparent;
  text-shadow: none;
  cursor: pointer;
  vertical-align: baseline;
  transition: background .18s ease, color .18s ease;
}
.ib-blank::before {
  content: attr(data-hint);
  color: color-mix(in srgb, var(--text3) 70%, transparent);
  font-size: .88em;
  font-style: italic;
}
.ib-blank.is-open {
  color: var(--text);
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  border-bottom-color: transparent;
  border-bottom-style: solid;
}
.ib-blank.is-open::before { content: none; }
.ib-blank:focus-visible { outline: 2px solid var(--blue2); outline-offset: 2px; }

/* ── rail: chapter map + live glossary ──────────────────────────────────── */

.ib-rail__scrim {
  position: fixed; inset: 0; z-index: 48;
  background: rgba(8, 14, 24, .5);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
/* NB: the scrim is the sibling BEFORE .ib-rail in the markup, so an adjacent
   sibling combinator could not reach it. It is toggled by class from JS. */
.ib-rail__scrim.is-open { opacity: 1; pointer-events: auto; }

.ib-rail {
  padding: 1.4rem 0 0;
}
/* `.ib-map__sec` and `.ib-rail__hub` take --r-sm from their own rules further
   down. There used to be a `border-radius:10px!important` block here whose only
   job was to undo journal.css squaring every rail control; journal.css no
   longer touches .ib-* at all, so the workaround is gone. */
@media (max-width: 1299px) {
  .ib-rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    width: min(88vw, 22rem);
    padding: calc(var(--rail-h) + .8rem) 0 2rem;
    background: var(--bg);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(8, 14, 24, .2);
    transform: translateX(-102%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .ib-rail.is-open { transform: none; }
  .ib-rail__close { display: inline-flex; }
}
.ib-rail__close {
  /* NB: hidden by default. This rule used to declare display:inline-flex
     unconditionally, and because it sits AFTER the desktop media query's
     .ib-rail__close{display:none} at equal specificity, source order let it
     win — so the drawer's close "x" floated over the desktop hub as a stray
     button next to "All topics". The drawer only exists below 1040px, so the
     button is enabled there and nowhere else. */
  display: none;
  align-items: center; justify-content: center;
  position: absolute; top: .55rem; right: .7rem;
  width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); font-size: 1.1rem; cursor: pointer;
}

.ib-rail__head {
  font-size: .72rem; font-weight: 900; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text3);
  margin: 0 0 .55rem;
}
.ib-map { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.ib-map__topic {
  font-size: .74rem; font-weight: 900; color: var(--blue2);
  margin: .85rem 0 .3rem; letter-spacing: .04em;
}
.ib-map__sec {
  display: flex; align-items: flex-start; gap: .5rem;
  width: 100%; text-align: left;
  padding: .42rem .5rem; min-height: 38px;
  border: 0; border-radius: var(--r-sm);
  background: transparent; cursor: pointer;
  font-size: .86rem; line-height: 1.4;
  color: var(--text2);
}
.ib-map__sec:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
.ib-map__sec.is-now { background: color-mix(in srgb, var(--blue2) 12%, transparent); color: var(--blue2); font-weight: 800; }
.ib-map__tick {
  flex: none; width: 1.05rem; height: 1.05rem; margin-top: .18rem;
  border: 1.5px solid var(--line); border-radius: 50%;
  display: grid; place-items: center;
  font-size: .6rem; color: transparent;
}
.ib-map__sec.is-done .ib-map__tick { background: var(--ok); border-color: var(--ok); color: #fff; }

.ib-gloss__search {
  width: 100%; padding: .5rem .65rem; min-height: 44px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: .87rem;
  margin-bottom: .5rem;
}
.ib-gloss__list { list-style: none; margin: 0; padding: 0; }
.ib-gloss__list li { padding: .45rem 0; border-bottom: 1px dotted var(--line); font-size: .85rem; line-height: 1.45; }
.ib-gloss__list b { display: block; color: var(--blue2); font-size: .86em; }
.ib-gloss__empty { font-size: .84rem; color: var(--text3); padding: .5rem 0; }

/* ── footer controls ────────────────────────────────────────────────────── */

.ib-foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem;
  padding: .7rem clamp(.9rem, 3vw, 2.5rem) calc(.7rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}
@media (min-width: 1040px) {
  /* no rail column any more, so the footer's edges are the reading column's */
  .ib-foot { padding-left: clamp(.9rem, 3vw, 2.5rem); }
}
/* Every filled button on this site is navy, square-cornered, and set in
   uppercase .74rem/600 with wide tracking. The pager was .92rem/800 on a
   rounded surface tile, which read as a different component library. */
.ib-foot__btn {
  color: var(--text);
  min-height: 44px;
  padding: 0 1.35rem;
  border-radius: 0;
  border: 1px solid var(--line-2);
  background: transparent;
  font-size: .74rem; font-weight: 600;
  letter-spacing: .089em; text-transform: uppercase;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: .45rem;
}
.ib-foot__btn:disabled { opacity: .4; cursor: default; }
.ib-foot__btn--next {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  box-shadow: none;
}
.ib-foot__btn--next:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.ib-foot__btn--next svg { width: 15px; height: 15px; }
.ib-foot__spacer { flex: 1 1 auto; }

/* ── end card ───────────────────────────────────────────────────────────── */

.ib-done { text-align: center; padding: 2rem 0 1rem; }
.ib-done__big {
  font-family: var(--font-heading, Georgia, serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 .5rem;
}
.ib-done__stats { color: var(--text2); font-size: .95rem; margin: 0 0 1.3rem; }
.ib-done__acts { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

/* ── dark ───────────────────────────────────────────────────────────────── */
/* Nothing left to override. The tints, the progress fill and the labels all
   resolve through --tint-* / --accent, which design/tokens.css already lifts
   for the dark surface — the four rules that used to live here were manual
   copies of a lift that the token does on its own. */

/* ── motion / print ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ib-sum, .ib-card, .ib-fig, .ib-tbl, .ib-flash, .ib-mcq, .ib-cover { transition: none; }
  .ib-rail, .ib-rail__scrim, .ib-top__fill { transition: none; }
}

@media print {
  .ib-top, .ib-foot, .ib-rail, .ib-rail__scrim { display: none !important; }
  .ib-sum, .ib-card, .ib-fig, .ib-tbl, .ib-flash, .ib-mcq, .ib-cover { opacity: 1 !important; }
}

/* ── generated figures ──────────────────────────────────────────────────────
   IB_VISUALS draws with CSS classes, not presentation attributes: .plate is the
   background card, .ln/.th are strokes, .lbl* are the labels. Without these rules
   the <rect class="plate"> falls back to the SVG default fill of BLACK and the
   whole figure renders as a black box — which is exactly what happens if you
   forget them, so they are copied here verbatim rather than trusted. The
   min-width keeps a 560-unit canvas legible on a phone, which is what the course
   page does with its scroll wrapper; here the frame scrolls instead. */
.vis-svg-scroll{margin:0 auto;max-width:100%}
.vis-svg{width:100%;height:auto;display:block;overflow:visible}
.vis-svg-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain}
.vis-svg{min-width:440px}
.vis-svg .ln{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.vis-svg .th{fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.vis-svg .dash{fill:none;stroke:currentColor;stroke-width:1.5;stroke-dasharray:4 4;opacity:.75}
.vis-svg .plate{fill:var(--surface2);opacity:.6}
.vis-svg .panel{fill:none;stroke:var(--border);stroke-width:1}
.vis-svg .panelHead{fill:color-mix(in srgb,var(--accent,#B8860B) 9%,transparent)}
.vis-svg .rule{stroke:var(--border);stroke-width:1;fill:none}
.vis-svg .grid{stroke:var(--border);stroke-width:1;opacity:.5;fill:none}
.vis-svg .ax{stroke:currentColor;stroke-width:2;fill:none}
.vis-svg .lblL{fill:currentColor;font:700 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace}
.vis-svg .solid{fill:currentColor;stroke:none}
.vis-svg .accFill{fill:var(--accent,#B8860B);opacity:.18}
.vis-svg .warnFill{fill:#dc2626;opacity:.15}
.vis-svg .goodFill{fill:#059669;opacity:.15}
.vis-svg .fillA{fill:currentColor;opacity:.10}
.vis-svg .fillB{fill:currentColor;opacity:.20}
.vis-svg .fillC{fill:currentColor;opacity:.32}
.vis-svg .lbl{fill:currentColor;font:600 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace}
.vis-svg .lblS{fill:currentColor;font:500 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace;opacity:.8}
.vis-svg .lblXS{fill:currentColor;font:500 8px/1 ui-monospace,SFMono-Regular,Menlo,monospace;opacity:.85}
.vis-svg .acc{fill:var(--accent,#B8860B);stroke:none}
.vis-svg .warn{fill:#dc2626;stroke:none}
.vis-svg .good{fill:#059669;stroke:none}
.ib-fig__frame .vis-svg { min-width: 0; }

/* ── recede ────────────────────────────────────────────────────────────────
   Earlier this was a bare opacity of .62 on each block type. A sentence at .62
   reads as obviously lightened, but a CARD at .62 did not, because its pale
   tint background still looked bright — so analogy and example blocks appeared
   to stay at full strength while the text around them faded. Desaturating as
   well as fading means a tinted card recedes exactly as far as a sentence, and
   the newest block is unambiguously the only thing at full colour. */
.ib-read > .ib-block {
  transition: opacity .3s ease, filter .3s ease;
}
.ib-read > .ib-now { opacity: 1; filter: none; }
.ib-read > .ib-recede:not(.ib-cover) { opacity: .42; filter: saturate(.28); }
/* .42 + desaturate works on the dark surface, where the body text is already
   the brightest thing on screen. On paper it erases the block: the card behind
   you went to a pale grey that could not be read back. */
body:not(.dark) .ib-read > .ib-recede:not(.ib-cover) { opacity: .58; filter: saturate(.55); }
/* The cover is a rendered block too, so past the first slide the reader marks
   it .ib-recede — and a 42%-opaque STICKY strip is a window: the card scrolling
   behind it showed through the chapter title and the two texts printed on top
   of each other. The pinned line must be fully opaque at all times. */
/* The cover is the one block that never recedes, and it used to say so with an
   override rule above instead of being excluded below. The override lost: the
   light-theme recede rule is `body:not(.dark) .ib-read > .ib-recede`, which is
   (0,3,1) against the override's (0,3,0), so in light mode the pinned title
   strip stayed at 58% opacity and the section heading scrolling underneath it
   read straight through the strip, on top of the pinned title. Excluding the
   cover where the fade is declared means there is nothing left to override. */
.ib-read > .ib-block[hidden] { display: none !important; }

/* sr-only: the model layer reads a section's <h3 data-en> for its title, and
   the reader has already shown that heading, so this one only has to exist. */
.ib-sr {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── resume chooser ───────────────────────────────────────────────────── */
.ib-resume {
  margin: 3rem auto 1rem;
  max-width: 34rem;
  padding: 1.6rem 1.5rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue2);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
}
.ib-resume__title { font-family: var(--font-heading); font-size: 1.4rem; margin: 0 0 .35rem; }
.ib-resume__meta { color: var(--text2); font-size: .93rem; margin: 0 0 1.2rem; }
.ib-resume__row { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

/* ── HUB ───────────────────────────────────────────────────────────────── */

.ib-hub {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 5.5rem) clamp(1.4rem, 4vw, 2.6rem) 7rem;
}

.ib-hero { margin-bottom: 1.5rem; }
.ib-hero__kicker {
  display: inline-flex; align-items: center;
  padding: .3rem .75rem; border-radius: 999px;
  background: color-mix(in srgb, var(--blue2) 11%, var(--surface));
  color: var(--blue2);
  font-size: .72rem; font-weight: 900;
  letter-spacing: .08em; text-transform: uppercase;
}
.ib-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 5.5vw, 2.6rem);
  line-height: 1.1; letter-spacing: -.02em;
  margin: .8rem 0 .4rem;
}
.ib-hero__sub { color: var(--text2); margin: 0; max-width: 46rem; }

/* the six-level legend */
.ib-legend {
  display: flex; flex-wrap: wrap; gap: .5rem 1.1rem;
  padding: .85rem 1rem; margin: 0 0 1.4rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  font-size: .8rem; color: var(--text2);
}
.ib-legend__item { display: inline-flex; align-items: center; gap: .4rem; }

/* status squares — the site's OWN palette, ordered so they read as a scale */
.ib-lev {
  flex: none; display: inline-block;
  width: 1.05rem; height: 1.05rem; border-radius: 5px;
  background: var(--line);
}
.ib-lev--mastered   { background: var(--blue); }
.ib-lev--proficient { background: var(--blue2); }
.ib-lev--familiar   { background: var(--green); }
.ib-lev--learning   { background: var(--gold); }
.ib-lev--unfamiliar { background: var(--red); }
.ib-lev--unseen     { background: transparent; border: 1.5px dashed var(--line); }

.ib-tabs {
  display: flex; gap: .4rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.3rem;
}
.ib-tab {
  min-height: 42px; padding: .5rem .95rem;
  border: 0; border-bottom: 2px solid transparent;
  background: transparent; cursor: pointer;
  font-size: .92rem; font-weight: 800; color: var(--text3);
}
.ib-tab.is-on { color: var(--blue2); border-bottom-color: var(--blue2); }

.ib-grp__title {
  font-family: var(--font-heading);
  font-size: 1.05rem; margin: 1.6rem 0 .6rem;
  padding-bottom: .35rem; border-bottom: 1px solid var(--line);
}
.ib-tlist, .ib-seclist { list-style: none; margin: 0; padding: 0; }
.ib-trow {
  display: flex; align-items: center; gap: .7rem;
  width: 100%; text-align: left;
  min-height: 46px; padding: .55rem .6rem;
  border: 0; border-radius: var(--r-sm);
  background: transparent; cursor: pointer;
}
.ib-trow:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.ib-trow__txt { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.ib-trow__txt strong { font-size: .96rem; font-weight: 700; }
.ib-trow__meta { font-size: .78rem; color: var(--text3); }
.ib-trow.is-on { background: color-mix(in srgb, var(--blue2) 10%, transparent); }

/* The row title opens the topic detail; this pill enters the lesson directly,
   so lesson mode is one click from the list instead of two. They are separate
   buttons on purpose — a button inside a button is invalid HTML. */
.ib-trowwrap { display: flex; align-items: center; gap: .5rem; }
.ib-trowwrap .ib-trow { flex: 1 1 auto; min-width: 0; }
.ib-trowgo {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: .34rem;
  min-height: 40px; padding: .34rem .8rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--text) 5%, var(--surface)); color: var(--text2);
  font-size: .78rem; font-weight: 700; letter-spacing: .01em;
  cursor: pointer; white-space: nowrap;
}
.ib-trowgo:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.ib-trowgo svg { width: 13px; height: 13px; }
.ib-trowgo--done { border-color: var(--green); color: var(--green); }
.ib-trowgo--done:hover { background: var(--green); color: #fff; }
.ib-trowwrap:hover .ib-trow { background: color-mix(in srgb, var(--text) 5%, transparent); }

/* the "where do I start" call to action at the top of the hub */
.ib-cta {
  display: flex; align-items: center; gap: .9rem;
  margin: 0 0 1.1rem; padding: 1rem 1.15rem;
  border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: var(--r-sm);
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--blue) 7%, var(--surface)), var(--surface) 62%);
}
.ib-cta__txt { display: flex; flex-direction: column; gap: .16rem; min-width: 0; flex: 1 1 auto; }
.ib-cta__eyebrow {
  font-size: .68rem; font-weight: 800; letter-spacing: .11em;
  text-transform: uppercase; color: var(--text3);
}
.ib-cta__title { font-size: 1.02rem; font-weight: 700; }
.ib-cta__sub { font-size: .8rem; color: var(--text2); }
.ib-cta__go {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem;
  min-height: 40px; padding: .5rem 1.05rem;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-size: .85rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ib-cta__go:hover { background: var(--accent-hover); filter: none; }
.ib-cta__go svg { width: 14px; height: 14px; }

.ib-crumb { display: flex; gap: .45rem; font-size: .82rem; color: var(--text3); margin-bottom: .5rem; }
.ib-crumb__sep { opacity: .5; }
.ib-dt__title {
  font-family: var(--font-heading); font-size: clamp(1.4rem, 4vw, 1.9rem);
  margin: 0 0 1rem; letter-spacing: -.015em; text-align: center;
}
.ib-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem;
  padding: .95rem 1.1rem; margin-bottom: 1.4rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
}
.ib-strip__lev { display: flex; align-items: center; gap: .5rem; }
.ib-strip__lev strong { font-size: 1rem; }
.ib-strip__next { font-size: .8rem; color: var(--text3); }
.ib-strip__stats { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-left: auto; }
.ib-stat { display: flex; flex-direction: column; line-height: 1.2; }
.ib-stat b { font-size: 1.06rem; }
.ib-stat span { font-size: .72rem; color: var(--text3); }

.ib-dt__group { margin: 0 0 1.4rem; }
.ib-dt__grouphead {
  font-size: .74rem; font-weight: 900; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text3);
  margin: 1.8rem 0 .7rem;
}
.ib-tiles { display: grid; gap: .7rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .ib-tiles { grid-template-columns: 1fr 1fr; } }
.ib-tile {
  display: flex; align-items: flex-start; gap: .8rem;
  padding: .9rem 1rem; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
}
button.ib-tile { cursor: pointer; font: inherit; color: inherit; }
button.ib-tile:hover { border-color: var(--blue2); }
.ib-tile__ico {
  flex: none; display: grid; place-items: center;
  width: 2.4rem; height: 2.4rem; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--blue2) 10%, var(--surface));
  color: var(--blue2);
}
.ib-tile__ico svg { width: 1.2rem; height: 1.2rem; }
.ib-tile__txt { display: flex; flex-direction: column; gap: .1rem; }
.ib-tile__txt strong { font-size: .98rem; }
.ib-tile__txt span { font-size: .84rem; color: var(--text2); }
.ib-tile__txt em { font-style: normal; font-size: .74rem; color: var(--text3); margin-top: .2rem; }

.ib-secrow {
  display: flex; align-items: center; gap: .7rem;
  width: 100%; text-align: left;
  min-height: 44px; padding: .5rem .6rem;
  border: 0; border-radius: var(--r-sm);
  background: transparent; cursor: pointer;
  font-size: .93rem;
}
.ib-secrow:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }

.ib-rail__hub {
  display: inline-flex; align-items: center;
  width: 100%; min-height: 40px; margin-bottom: .8rem;
  padding: .45rem .6rem;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer;
  font-size: .86rem; font-weight: 800; color: var(--blue2);
}
.ib-rail__hub:hover { border-color: var(--blue2); }

.ib-gloss__list b { display: block; color: var(--blue2); font-size: .86em; }
.ib-gloss__list span { display: block; color: var(--text2); }

/* ── the course page's per-topic content, on this page ──────────────────── */

.ib-dt__lede { color: var(--text2); margin: -.4rem 0 1rem; max-width: 44rem; }

.ib-bigq {
  margin: 1.3rem 0 1.4rem; padding: .95rem 1.1rem;
  border: 1px solid var(--line); border-left: 4px solid var(--blue2);
  border-radius: var(--r-md); background: color-mix(in srgb, var(--blue2) 5%, var(--surface));
}
.ib-bigq__tag {
  margin: 0 0 .3rem; font-size: .7rem; font-weight: 900;
  letter-spacing: .09em; text-transform: uppercase; color: var(--blue2);
}
.ib-bigq__text { margin: 0; font-family: var(--font-heading); font-size: 1.05rem; line-height: 1.45; }

.ib-seclist > li { border-bottom: 1px solid var(--line); }
.ib-secrow__n {
  margin-left: auto; font-size: .72rem; font-weight: 800;
  color: var(--text3); font-variant-numeric: tabular-nums;
}
.ib-secinfo { padding: 1rem 0 1.1rem 1.75rem; }
.ib-secinfo__focus {
  margin: 0 0 .7rem; font-size: .92rem; color: var(--text2);
}
.ib-secinfo__head {
  margin: 1.1rem 0 .45rem; font-size: .7rem; font-weight: 900;
  letter-spacing: .09em; text-transform: uppercase; color: var(--text3);
}
.ib-termlist { margin: 0; }
.ib-termlist dt { font-weight: 800; font-size: .95rem; margin-top: .75rem; }
.ib-termlist dt:first-child { margin-top: 0; }
.ib-termlist dd { margin: .3rem 0 0; font-size: .88rem; color: var(--text2); }

.ib-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.ib-chip {
  display: inline-block; padding: .18rem .55rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface2);
  font-size: .78rem; color: var(--text2); white-space: nowrap;
}
.ib-quicklist { margin: 0; padding-left: 1.1rem; font-size: .88rem; color: var(--text2); }
.ib-quicklist li { margin: .22rem 0; }

/* definitions view */
.ib-defcard {
  margin: 0 0 .6rem; padding: .7rem .9rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
}
.ib-defcard__t { font-weight: 800; font-size: .98rem; margin-bottom: .15rem; }
.ib-defcard__d { font-size: .89rem; color: var(--text2); }

/* ═══ collapsible section detail ═══
   The long tail of a section (In detail / numbers / mistakes / why) is
   collapsed by default. Nothing is deleted — the default read is shorter so a
   student is not confronted by a wall of prose, and the full detail is one
   click away. The label swaps between "Go deeper" and "Show less" through two
   spans, because a single data-en/data-zh pair cannot express both states and
   a language toggle would otherwise reset an open button to its closed label. */
.native-deep { margin: 1.1rem 0 .2rem; }
.native-deep__btn {
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 40px;
  padding: .45rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
}
.native-deep__btn::before { content: '\25BE'; font-size: .8em; opacity: .8; }
.native-deep__btn:hover { color: var(--text); border-color: var(--accent); }
.native-deep__lbl-open { display: none; }
.native-deep.is-open .native-deep__lbl-open { display: inline; }
.native-deep.is-open .native-deep__lbl-closed { display: none; }
.native-deep.is-open .native-deep__btn::before { content: '\25B4'; }
.native-deep__body { display: none; }
.native-deep.is-open .native-deep__body { display: block; }
.native-deep.is-open .native-deep__btn { margin-bottom: .6rem; }
@media (max-width: 620px) {
  .native-deep__btn { width: 100%; justify-content: center; }
}

/* ═══ unknown topic code ═══
   An unrecognised code used to render the first topic's lesson as a two-block
   stub that looked like a broken reader. It now says what happened and keeps the
   full topic list underneath so the reader can carry on. */
.ib-missing {
  margin: 0 0 1.6rem;
  padding: 1.1rem 1.25rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--red, var(--err));
  border-radius: 14px;
  background: var(--surface);
}
.ib-missing__title {
  font-family: var(--font-heading);
  font-size: 1.32rem;
  font-weight: 700;
  margin: 0 0 .5rem;
}
.ib-missing__code { font-size: .92rem; color: var(--text2); margin: 0 0 .4rem; }
.ib-missing__code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em;
  padding: .1em .42em;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.ib-missing__hint { font-size: .92rem; color: var(--text2); margin: 0 0 1rem; }
.ib-missing__row { display: flex; flex-wrap: wrap; gap: .55rem; }
.ib-missing__btn {
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  min-height: 40px;
  padding: .5rem 1.05rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}
.ib-missing__btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.ib-missing__btn:hover { filter: brightness(1.08); }
body.ib-lesson button.ib-missing__btn { font: inherit; color: #fff; }
body.ib-lesson button.ib-missing__btn--ghost { color: var(--text); }
@media (max-width: 620px) {
  .ib-missing { padding: .9rem .95rem 1rem; }
  .ib-missing__row { flex-direction: column; align-items: stretch; }
  .ib-missing__btn { width: 100%; }
}
.ib-defgrp {
  font-family: var(--font-heading); font-size: 1.02rem;
  margin: 1.4rem 0 .5rem; padding-bottom: .3rem;
  border-bottom: 1px solid var(--line);
}
button.ib-tile--toggle {
  margin: 0 0 1.2rem; width: auto; padding: .45rem .9rem;
  min-height: 38px; font-size: .84rem; font-weight: 800; color: var(--blue2);
}

/* ═══ subject page, topic tree, topic page, lessons, study guide ═════════ */

/* overall progress next to the subject title */
.ib-hero__stat {
  display: inline-flex; align-items: baseline; gap: .45rem;
  margin-top: .7rem; padding: .3rem .7rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
}
.ib-hero__stat b { font-size: 1.05rem; font-weight: 800; color: var(--blue); }
.ib-hero__stat span { font-size: .76rem; color: var(--text3); }

/* section headings inside the subject and topic pages */
.ib-rsec {
  margin: 1.7rem 0 .7rem;
  font-size: 1.24rem; font-weight: 700; letter-spacing: -.01em;
}
.ib-rgrid {
  display: grid; gap: .7rem;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.ib-rtile {
  display: flex; align-items: flex-start; gap: .8rem;
  width: 100%; min-height: 72px; padding: .95rem 1rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: inherit; text-align: left;
  font: inherit; cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.ib-rtile:hover {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
  transform: translateY(-1px);
}
.ib-rtile__ico { flex: 0 0 auto; color: var(--blue2); }
.ib-rtile__ico svg { width: 26px; height: 26px; display: block; }
.ib-rtile__txt { display: flex; flex-direction: column; gap: .16rem; min-width: 0; }
.ib-rtile__txt strong { font-size: .98rem; font-weight: 700; }
.ib-rtile__txt span { font-size: .83rem; color: var(--text2); }
.ib-rtile__txt em {
  font-size: .74rem; font-style: normal; font-weight: 700;
  color: var(--text3); letter-spacing: .02em; margin-top: .1rem;
}

/* the progress legend sits in its own card, as on the reference */
.ib-legendbox {
  padding: .9rem 1.05rem; margin-bottom: 1.2rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
}
.ib-legendbox__t { font-size: .95rem; font-weight: 700; margin-bottom: .55rem; }

/* chapter heading, then each group as a collapsible */
.ib-chhead {
  display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap;
  margin: 1.6rem 0 .5rem; padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
}
.ib-chhead__n {
  font-size: .68rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text3);
}
.ib-chhead__t { font-size: 1.16rem; font-weight: 700; }

.ib-ghead {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  min-height: 46px; padding: .55rem .3rem;
  border: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  background: transparent; color: inherit; text-align: left;
  font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.ib-ghead:hover { color: var(--blue); }
.ib-ghead__t { flex: 1 1 auto; min-width: 0; }
.ib-ghead__caret { color: var(--text3); transition: transform .18s ease; }
.ib-ghead__caret svg { width: 14px; height: 14px; display: block; }
.ib-ghead.is-open .ib-ghead__caret { transform: rotate(180deg); }
.ib-grouplist { list-style: none; margin: 0 0 .5rem; padding: 0 0 0 .35rem; }
.ib-grouplist[hidden] { display: none; }

.ib-crumb__link {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--text3); font: inherit; text-decoration: underline;
  text-underline-offset: 2px;
}
.ib-crumb__link:hover { color: var(--blue); }

/* section header that jumps to the study guide */
.ib-secgo {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  min-height: 46px; margin-top: .9rem; padding: .5rem .6rem;
  border: 0; border-top: 1px solid var(--line);
  background: transparent; color: inherit; text-align: left;
  font: inherit; font-weight: 700; cursor: pointer;
}
.ib-secgo:hover { color: var(--blue); }
.ib-secgo svg { width: 14px; height: 14px; color: var(--text3); margin-left: auto; }
.ib-secgo > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }

.ib-backpill {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 40px; margin-bottom: .8rem; padding: .4rem .85rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text2);
  font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer;
}
.ib-backpill:hover { border-color: var(--blue); color: var(--blue); }
.ib-backpill svg { width: 14px; height: 14px; }

/* the lesson list */
.ib-leshead {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin: 1.2rem 0 .7rem; padding: .7rem .95rem;
  border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
  font-size: .88rem;
}
.ib-leshead span { color: var(--text3); }
.ib-lesslist { list-style: none; margin: 0; padding: 0; }
.ib-lessrow {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  min-height: 54px; padding: .7rem .8rem;
  border: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: var(--r-sm);
  background: transparent; color: inherit; text-align: left;
  font: inherit; font-size: .95rem; cursor: pointer;
}
.ib-lessrow:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.ib-lessrow__circ {
  flex: 0 0 auto; width: 20px; height: 20px;
  border: 1.5px dashed var(--line); border-radius: 50%;
}
.ib-lessrow__t { min-width: 0; }
.ib-lesstart { margin-top: 1.2rem; }

/* the study guide reuses the course page's own content classes */
.ib-guide { margin-top: 1.2rem; }
.ib-empty {
  padding: 1.4rem; border: 1px dashed var(--line); border-radius: var(--r-md);
  color: var(--text3); font-size: .9rem;
}
.ib-defcard__g {
  margin: 1.4rem 0 .5rem; font-size: .8rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text3);
}

/* the whole content block reads a little narrower than the chrome above it */
.ib-guide .native-lesson { max-width: 74ch; }

/* ── study-guide vertical rhythm (#guide/<code> view) ──────────────────────
   The native renderer emits a mix of lead paragraphs, tables, term cards,
   formula rows, figure trays, "go deeper" accordions, quick-check trays and
   the workbook reference. Several of those blocks carried no top margin, so
   neighbours touched each other and the sections ran together. Everything
   below is scoped to .ib-guide so the course page keeps its own layout. */
.ib-guide .native-lead p { margin: .6rem 0 1rem; }
.ib-guide .deep-question { margin-top: 1rem; }
.ib-guide .deep-question p { margin: .3rem 0 0; }
.ib-guide .native-section > .native-table-wrap,
.ib-guide .native-section > .vis-figures { margin-top: 1.1rem; }
.ib-guide .native-lesson > .native-figures,
.ib-guide .native-lesson > .workbook-reference { margin-top: 1.4rem; }
.ib-guide .native-formula + .native-formula { margin-top: .5rem; }
.ib-guide .vis-figure + .vis-figure,
.ib-guide .native-figure + .native-figure { margin-top: 1.1rem; }
.ib-guide .native-terms h4, .ib-guide .native-formulas h4, .ib-guide .native-examples h4,
.ib-guide .native-focus h4, .ib-guide .native-quick-check h4, .ib-guide .native-boundary h4,
.ib-guide .native-links h4, .ib-guide .native-figures h4, .ib-guide .vis-figures h4,
.ib-guide .deep-walk h4 { margin: 0 0 .5rem; }

/* ── narrow-screen top bar ──────────────────────────────────────────────── */
/* At a 500px viewport the reader bar measured 655px wide and pushed the page
   155px sideways: Exit + rail + home + progress bar + counter + Test me + EN +
   dark simply do not fit. The counter already carries the progress, so the bar
   is the first thing to go, then the gaps and padding. Below 430px Exit
   collapses to a single ✕, which is also what the reference reader uses. */
@media (max-width: 620px) {
  :root { --rail-h: 56px; }
  .ib-top { gap: .3rem; padding: .4rem .55rem; }
  .ib-top__bar { display: none; }
  .ib-top__btn, .ib-top__exit { padding: .42rem .6rem; font-size: .8rem; min-height: 40px; }
  .ib-top__count { font-size: .78rem; }
}
@media (max-width: 430px) {
  /* font-size:0 collapses the line box, so the ::before glyph grew upward from
     a zero-height baseline and sat on the circle's top edge instead of in the
     middle. As a block it becomes a flex item and align-items centres it. */
  body.ib-lesson .ib-top__exit {
    font-size: 0; padding: 0;
    width: 40px; min-width: 40px; height: 40px;
    justify-content: center;
  }

}
/* The rail and home buttons carry their label as text, and applyLanguage
   rewrites textContent from data-en/data-zh, so below 1040px — where the rail
   button is shown — it measured 162px ("Sections & terms") and pushed the bar
   past the viewport. They are icon-only below 1040px: font-size 0 hides the
   rewritten label and ::before supplies the glyph. aria-label is unaffected. */
/* NB: body.ib-lesson button{font:inherit} is (0,1,2) and beats a bare class
   selector, so these are qualified with the body class or they do nothing. */
@media (max-width: 1039px) {
  body.ib-lesson .ib-top__btn--rail, body.ib-lesson .ib-top__btn--home {
    font-size: 0; gap: 0;
  }
  body.ib-lesson .ib-top__btn--rail::before { content: '\2630'; font-size: 1.05rem; }
  /* icon-only below this width, so it takes the same 40px circle as the ✕ */
  body.ib-lesson .ib-top__btn--rail {
    width: 40px; min-width: 40px; padding: 0;
    border: 1px solid var(--line-2); border-radius: 50%;
    background: transparent;
  }
  body.ib-lesson .ib-top__btn--home::before  { content: '\25F1'; font-size: 1.05rem; }
}

/* the breadcrumb is navigation, so it needs a real tap target */
.ib-crumb__link {
  min-height: 40px; padding: .3rem .1rem;
  display: inline-flex; align-items: center;
}

/* ── tap targets inside the study guide ──────────────────────────────────── */
/* The guide reuses the course page's own content, including the shared
   knowledge.css kit (.kv-seg, .kv-tools) and the workbook-reference controls.
   Those were sized for a mouse: the model's Concise/Full segments measured
   35px, its tool buttons 38px, the reference link 20px and its preview 32px
   on a phone. Scoped to this page so knowledge.css and the textbook are
   untouched. */
@media (max-width: 620px) {
  .ib-guide .kv-seg button,
  .ib-guide .kv-tools button { min-height: 40px; padding-block: .4rem; }
  .ib-guide .workbook-reference a,
  .ib-guide .workbook-reference-preview {
    display: inline-flex; align-items: center; min-height: 40px;
  }
}

/* ═══ IB SEHS interactive models ═════════════════════════════════════
   Copied VERBATIM from ib-sehs-learn.html's inline <style>. Every rule
   styles a shape inside .ib-model (ns-* neuron and anatomy, an-*
   anatomy, the legend swatches and the animation keyframes). Without
   them the study guide renders every model as solid black blocks —
   an SVG with no fill rule falls back to fill:black. Same failure mode
   as the .plate rules that were once missing from these pages. */
/* ═══ palette the model drawings expect ═══════════════════════════════════
   The models paint with fill:var(--gold), var(--blue2) and font-family
   var(--serif). Those came from the hand-inlined palette this page used to
   carry; since it now loads the site's real theme they resolve to NOTHING,
   and a var() with no value falls back to the SVG initial value — which is
   black. That is why hormone circles and organ outlines rendered as solid
   black shapes here while the same model is correct on the course page.
   Values are copied verbatim from ib-sehs-learn.html so the models look
   identical in both places. */
:root {
  --gold: #d7a829;
  --blue2: #2563a8;
  --accent: var(--gold);
  --border: var(--line, #d5e0e9);
  --serif: var(--font, Georgia, "Songti SC", serif);
  --d: 0s;                       /* the flow animations stagger with this */
}
body.dark {
  --gold: #efd17c;
  --blue2: #8fb7e8;
}

/* ═══ IB SEHS interactive models (ib-sehs-models.js) ══════════════════ */
.ib-model{max-width:620px;margin:.15rem auto .35rem;padding-top:.1rem}
.ib-model .ib-head{display:flex;justify-content:flex-end;margin:-.1rem 0 .5rem}
.ib-model .kv-lab{display:block;margin-top:.55rem}
.ib-model .ibm-q{display:block;font-weight:700;color:var(--text)}
.ib-model .kv-lab b{color:var(--accent);font-weight:800;margin-left:.25rem;font-variant-numeric:tabular-nums}
.ib-model .kv-lab input[type=range]{display:block;width:100%}
.ib-model .kv-svg text{font-size:13px}
.ib-model .kv-svg text.small{font-size:11px}
.ib-model .kv-svg .axis{stroke:var(--border2,#C6D1DD);stroke-width:1}
.ib-model .kv-svg .gl{stroke:var(--text3);stroke-width:1;stroke-dasharray:4 4;opacity:.5}
.ib-model .kv-svg .window{fill:var(--c1);opacity:.15}
.ib-model .kv-svg .window.red{fill:var(--c0);opacity:.13}
.ib-model .kv-svg .bar{fill:var(--c2);opacity:.35}
.ib-model .kv-svg .bar.on{fill:var(--c2);opacity:.95}
.ib-model .kv-svg .chron{fill:none;stroke:var(--text3);stroke-width:2.5;stroke-dasharray:5 4}
.ib-model .kv-svg .curve{fill:none;stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
.ib-model .kv-svg .curve.a{stroke:var(--c2)}
.ib-model .kv-svg .curve.b{stroke:var(--c0)}
.ib-model .kv-svg .curve.thin{stroke-width:2;opacity:.45}
.ib-model .kv-svg .traj{fill:none;stroke:var(--c2);stroke-width:3;stroke-linejoin:round}
.ib-model .kv-svg .apex{fill:var(--c2);stroke:var(--surface);stroke-width:2}
.ib-model .kv-svg .work{fill:var(--c1);opacity:.22}
.ib-model .kv-svg .vx{stroke:var(--c0);stroke-width:2;stroke-dasharray:5 4}
.ib-model .kv-svg .vy{stroke:var(--c1);stroke-width:2;stroke-dasharray:5 4}
.ib-model .kv-svg .plane{fill:color-mix(in srgb,var(--text) 5%,transparent);stroke:var(--border2,#C6D1DD);stroke-width:1;stroke-dasharray:5 4}
.ib-model .kv-svg .ax{stroke:var(--accent);stroke-width:2;stroke-dasharray:6 4}
.ib-model .kv-svg .sk{fill:color-mix(in srgb,var(--text) 20%,transparent);stroke:var(--text3);stroke-width:2}
.ib-model .kv-svg .body{stroke:var(--text3);stroke-width:3.5;stroke-linecap:round;fill:none}
.ib-model .kv-svg .body.on{stroke:var(--accent);stroke-width:5}
.ib-model .kv-svg .body.thin{stroke-width:2.5}
.ib-model .kv-svg .joint{fill:var(--surface2,#EEF2F7);stroke:var(--text3);stroke-width:1.5}
.ib-model .portrait{display:block;margin:0 auto;height:262px}
.ib-model .kv-gon{width:190px;max-width:100%}
.ib-model .kv-bar i.red{background:var(--red)}
.ib-model .kv-bar i.gold{background:var(--c1)}
.ib-model .kv-bar i.blue{background:var(--c2)}
.ib-model .kv-dot.red{background:var(--c0)}
.ib-model .kv-dot.gold{background:var(--c1)}
.ib-model .kv-dot.blue{background:var(--c2)}
.ibm-band{position:relative;height:16px;border-radius:99px;margin:.55rem 0 .25rem;background:color-mix(in srgb,var(--text) 10%,transparent)}
.ibm-band i{position:absolute;top:0;bottom:0;opacity:.3}
.ibm-band .z1{left:0;width:25%;background:var(--green)}
.ibm-band .z2{left:25%;width:37.5%;background:var(--amber)}
.ibm-band .z3{left:62.5%;width:37.5%;background:var(--red)}
.ibm-band u{position:absolute;top:-4px;bottom:-4px;width:3px;margin-left:-1.5px;border-radius:2px;background:var(--text);text-decoration:none}
.ibm-scale{display:flex;justify-content:space-between;font-size:.78rem;color:var(--text3)}
.ibm-key{display:flex;flex-wrap:wrap;gap:.3rem .9rem;font-size:.82rem;color:var(--text2);margin-top:.4rem}
.ibm-key span{display:inline-flex;align-items:center;gap:.35rem}
.ibm-key i{width:10px;height:10px;border-radius:3px;display:inline-block}
@media (max-width:640px){.ib-model .kv-seg button{min-height:40px}.ib-model .kv-lab input[type=range]{height:40px}.ib-model .kv-tools button{min-height:40px}.ib-model .kv-path button{min-height:44px}}

.ib-model .kv-zone.on{outline:2px solid var(--accent);outline-offset:-2px}
.ib-model .kv-ends{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:.4rem}
.ib-model .kv-ends p{margin:.25rem 0 0;color:var(--text2);font-size:.88rem}
.ib-model .kv-svg .q1{fill:color-mix(in srgb,var(--green) 11%,transparent)}
.ib-model .kv-svg .q2{fill:color-mix(in srgb,var(--c1) 12%,transparent)}
.ib-model .kv-svg .marker{fill:var(--c2);stroke:var(--surface);stroke-width:3;transition:cx .2s,cy .2s}
.ib-model .kv-svg .marker.ok{fill:var(--green)}
.ib-model .kv-svg .marker.risk{fill:var(--c0)}
.ib-model .kv-svg .perf{fill:none;stroke:var(--c0);stroke-width:2.5;stroke-dasharray:5 4}
.ib-model .kv-svg .cone{fill:var(--c2);opacity:.16;stroke:var(--c2);stroke-width:1.5;transition:opacity .25s}
.ib-model .kv-svg .cone.narrow{fill:var(--c1);stroke:var(--c1);opacity:.26}
.ib-model .kv-svg .wide{fill:var(--c2);opacity:.10;transition:opacity .25s}
.ib-model .kv-svg .goal{fill:none;stroke:var(--text3);stroke-width:2}
.ib-model .kv-svg .post{stroke:var(--text3);stroke-width:3;stroke-linecap:round}
.ib-model .kv-svg .spot{fill:var(--text3)}
.ib-model .kv-svg .joint{fill:var(--c0);transition:opacity .25s}
.ib-model .kv-svg .target{fill:none;stroke:var(--c0);stroke-width:2.5;transition:opacity .25s}
.ib-model .kv-svg .zone{fill:color-mix(in srgb,var(--text) 4%,transparent)}
.ib-model .kv-svg .target-zone{fill:var(--green);opacity:.15}
.ib-model .kv-svg .dot{fill:var(--text3);transition:fill .2s}
.ib-model .kv-svg .dot.on{fill:var(--c0)}
.ib-model .kv-svg .chosen{fill:none;stroke:var(--c0);stroke-width:2.5}
@media (max-width:640px){.ib-model .kv-ends{grid-template-columns:1fr}}

.ib-model .ib-practices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem;margin-top:.4rem}
.ib-model .ib-practices button{font:inherit;font-size:.85rem;line-height:1.3;text-align:left;padding:.55rem .7rem;border-radius:11px;cursor:pointer;
  color:var(--text);background:var(--surface);border:1px solid var(--border2,#C6D1DD);transition:background .2s,border-color .2s}
.ib-model .ib-practices button:hover{border-color:var(--accent)}
.ib-model .ib-practices button.on{background:color-mix(in srgb,var(--accent) 13%,var(--surface));border-color:var(--accent);font-weight:700}
.ib-model .kv-climate{display:grid;gap:.4rem;margin:.6rem 0 .2rem}
.ib-model .kv-cl-row{display:grid;grid-template-columns:8.5rem 1fr 3.4rem;align-items:center;gap:.7rem;font-size:.88rem}
.ib-model .kv-cl-row b{font-variant-numeric:tabular-nums;text-align:right}
.ib-model .kv-svg .eu{fill:var(--green);opacity:.16}
.ib-model .kv-svg .di{fill:var(--c0);opacity:.14}
.ib-model .kv-chain{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem;margin-top:.4rem}
.ib-model .kv-chain-i{font-size:.78rem;font-weight:700;padding:.3rem .55rem;border-radius:999px;background:color-mix(in srgb,var(--accent) 12%,var(--surface));color:var(--text)}
.ib-model .kv-chain b{color:var(--text3)}
.ib-model .ib-target{display:grid;gap:.3rem;margin-top:.4rem}
.ib-model .ib-target-row{display:grid;grid-template-columns:1.4rem 9.5rem 1fr;align-items:center;gap:.6rem}
.ib-model .ib-target-l{font-weight:900;color:var(--accent);font-size:.9rem}
.ib-model .ib-target-b{display:flex;gap:.25rem}
.ib-model .ib-target-b button{font:inherit;font-size:.76rem;font-weight:700;padding:.32rem .6rem;border-radius:8px;cursor:pointer;
  color:var(--text2);background:var(--surface);border:1px solid var(--border2,#C6D1DD)}
.ib-model .ib-target-b button.on{background:var(--green);border-color:transparent;color:#fff}
.ib-model .ib-target-r{font-size:.78rem;color:var(--text3)}
.ib-model .ib-ch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem;margin-top:.4rem}
.ib-model .ib-ch button{display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;width:100%;text-align:left;
  font:inherit;padding:.55rem .7rem;border-radius:11px;cursor:pointer;color:var(--text);
  background:var(--surface);border:1px solid var(--border2,#C6D1DD);transition:background .2s,border-color .2s}
.ib-model .ib-ch button b{font-size:.86rem}
.ib-model .ib-ch button span{font-size:.78rem;color:var(--text3);line-height:1.35}
.ib-model .ib-ch button.on{background:color-mix(in srgb,var(--accent) 13%,var(--surface));border-color:var(--accent)}
.ib-model .ib-ch button.on span{color:var(--text2)}
.ib-model .ib-cats{display:grid;gap:.4rem;margin-top:.4rem}
.ib-model .ib-cats button{display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;width:100%;text-align:left;
  font:inherit;padding:.6rem .75rem;border-radius:12px;cursor:pointer;color:var(--text);
  background:var(--surface);border:1px solid var(--border2,#C6D1DD)}
.ib-model .ib-cats button b{font-size:.88rem}
.ib-model .ib-cats button span{font-size:.8rem;color:var(--text3)}
.ib-model .ib-cats button.on{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,var(--surface))}
@media (max-width:640px){.ib-model .ib-practices,.ib-model .ib-ch{grid-template-columns:1fr}
  .ib-model .ib-ch button{min-height:40px}
  .ib-model .ib-target-row{grid-template-columns:1.2rem 1fr}
  .ib-model .ib-target-r{display:none}
  .ib-model .kv-cl-row{grid-template-columns:6.5rem 1fr 3rem}
  .ib-model .ib-practices button,.ib-model .ib-cats button,.ib-model .ib-target-b button{min-height:40px}}
/* ══ A.1.1 model ══ */
/* ══ A.1.1 Communication systems — shape-based model ═══════════════════ */
.ib-model .a11-wrap{display:grid;gap:.9rem}
.ib-model .a11-panel{border:1px solid var(--border2,#C6D1DD);border-radius:14px;padding:.7rem .8rem .8rem;background:color-mix(in srgb,var(--text) 2.5%,var(--surface))}
.ib-model .a11-hd{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5rem;margin-bottom:.45rem}
.ib-model .a11-hd b{font-size:.95rem;color:var(--accent)}
.ib-model .a11-hd span{font-size:.78rem;color:var(--text3)}
.ib-model .a11-leg{margin-top:.5rem;gap:.3rem .85rem;font-size:.8rem}
.ib-model .a11-leg i{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:.3rem;vertical-align:-1px;border:1px solid rgba(0,0,0,.18)}
.ib-model .ns-l1{background:var(--c2)}.ib-model .ns-l2{background:var(--c1)}
.ib-model .ns-l3{background:var(--c0)}.ib-model .ns-l4{background:color-mix(in srgb,var(--c0) 34%,var(--surface))}
.ib-model .ns-l5{background:var(--green)}.ib-model .ns-l6{background:color-mix(in srgb,var(--red) 40%,var(--surface))}
.ib-model .ns-l7{background:color-mix(in srgb,var(--red) 78%,var(--surface))}.ib-model .ns-l8{background:var(--gold)}
.ib-model .ns-l9{background:var(--green)}
/* ── A · nerve ── */
.ib-model .ns-term{fill:var(--c2);stroke:var(--c2);stroke-width:2;opacity:.9}
.ib-model .ns-axon{fill:var(--c2);opacity:.75}
.ib-model .ns-ves{fill:color-mix(in srgb,var(--c1) 26%,var(--surface));stroke:var(--c1);stroke-width:1.6;
  transform-box:fill-box;transform-origin:50% 50%;
  animation:ns-pulse 2.6s var(--d,0s) infinite ease-in-out}
.ib-model .ns-vesdot{fill:var(--c1)}
.ib-model .ns-cleft{fill:color-mix(in srgb,var(--text) 5%,var(--surface));stroke:var(--border2,#C6D1DD);stroke-width:1;stroke-dasharray:4 3}
.ib-model .ns-nt{fill:var(--c1);stroke:var(--surface);stroke-width:1;
  transform-box:fill-box;transform-origin:50% 50%;animation:ns-fall 1.9s var(--d,0s) infinite linear}
.ib-model .ns-fibre{fill:color-mix(in srgb,var(--c0) 20%,var(--surface));stroke:var(--c0);stroke-width:2.4}
.ib-model .ns-stria{fill:color-mix(in srgb,var(--c0) 52%,var(--surface))}
.ib-model .ns-nuc{fill:var(--surface);stroke:var(--c0);stroke-width:1.8}
.ib-model .ns-brace{fill:none;stroke:var(--text3);stroke-width:1.4}
.ib-model .ns-sub{fill:var(--c0);opacity:.85;transition:transform .3s,opacity .3s}
.ib-model .ns-sub.open{transform:translateY(-3px);opacity:1}
.ib-model .ns-pore{fill:var(--surface);stroke:var(--c0);stroke-width:1.4}
.ib-model .ns-lead{stroke:var(--text3);stroke-width:1}
.ib-model .ns-spark{stroke:var(--c2);stroke-width:3;stroke-linecap:round}
/* ── B · hormone ── */
.ib-model .ns-lumen{fill:color-mix(in srgb,var(--green) 20%,var(--surface));stroke:var(--green);stroke-width:2}
.ib-model .ns-secrecyte{fill:color-mix(in srgb,var(--green) 34%,var(--surface));stroke:var(--green);stroke-width:1.5}
.ib-model .ns-adventitia{fill:color-mix(in srgb,var(--red) 20%,var(--surface));stroke:color-mix(in srgb,var(--red) 45%,var(--surface));stroke-width:1}
.ib-model .ns-media{fill:color-mix(in srgb,var(--red) 38%,var(--surface))}
.ib-model .ns-endothelium{fill:color-mix(in srgb,var(--red) 78%,var(--surface))}
.ib-model .ns-lumen2{fill:color-mix(in srgb,var(--red) 12%,var(--surface));stroke:var(--red);stroke-width:1.2}
.ib-model .ns-rbc{fill:var(--red);transform-box:fill-box;transform-origin:50% 50%;
  animation:ns-flow 4.4s var(--d,0s) infinite linear}
.ib-model .ns-rbc-in{fill:color-mix(in srgb,var(--surface) 62%,var(--red))}
.ib-model .ns-hor{fill:var(--gold);transform-box:fill-box;transform-origin:50% 50%;
  animation:ns-flow 4.4s var(--d,0s) infinite linear}
.ib-model .ns-hor.dock{animation:none;fill:var(--gold);stroke:var(--surface);stroke-width:1.4}
.ib-model .ns-hor.drift{animation:ns-wander 3.4s var(--d,0s) infinite ease-in-out}
.ib-model .ns-cleft{fill:color-mix(in srgb,var(--text) 8%,var(--surface))}
.ib-model .ns-rbc-in{fill:color-mix(in srgb,var(--surface) 78%,var(--red))}
.ib-model .ns-key{fill:color-mix(in srgb,var(--text) 26%,var(--surface));stroke:var(--text3);stroke-width:1.4}
.ib-model .ns-key.fit{fill:var(--gold);stroke:var(--gold)}
.ib-model .ns-cell{fill:color-mix(in srgb,var(--text) 5%,var(--surface));stroke:var(--text3);stroke-width:1.6}
.ib-model .ns-cell.hit{stroke:var(--green);stroke-width:2.4;fill:color-mix(in srgb,var(--green) 12%,var(--surface))}
.ib-model .ns-cnuc{fill:color-mix(in srgb,var(--text) 20%,var(--surface))}
.ib-model .ns-lock{fill:color-mix(in srgb,var(--text) 22%,var(--surface));stroke:var(--text3);stroke-width:1.2}
.ib-model .ns-lock.fit{fill:var(--gold);stroke:var(--gold)}
/* ── arrows: the clear one the old model lacked ── */
.ib-model .ns-arrow{stroke:var(--text);stroke-width:2.6;fill:none;stroke-linecap:round}
.ib-model .ns-head{fill:var(--text)}
/* ── C · clock ── */
.ib-model .ns-ncurve{fill:none;stroke:var(--c0);stroke-width:2.6;stroke-linecap:round}
.ib-model .ns-hcurve{fill:none;stroke:var(--gold);stroke-width:2.6;stroke-linecap:round}
.ib-model .ns-ndot{fill:var(--c0);stroke:var(--surface);stroke-width:2}
.ib-model .ns-hdot{fill:var(--gold);stroke:var(--surface);stroke-width:2}
.ib-model .kv-svg .nsn-h{fill:var(--c0);font-weight:800}
.ib-model .kv-svg .nsn-n{fill:var(--gold);font-weight:800}
.ib-model .ns-nl{background:var(--c0)}
.ib-model .ns-hl{background:var(--gold)}
.ib-model .a11-bar{margin-top:.6rem}
.ib-model .a11-n{background:var(--c0)}
.ib-model .a11-h{background:var(--gold)}
@keyframes ns-fall{0%{transform:translateY(-14px);opacity:0}22%{opacity:1}100%{transform:translateY(16px);opacity:0}}
@keyframes ns-flow{0%{transform:translateX(-26px);opacity:0}12%{opacity:1}88%{opacity:1}100%{transform:translateX(26px);opacity:0}}
@keyframes ns-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.16)}}
@keyframes ns-wander{0%,100%{transform:translateX(0);opacity:.5}50%{transform:translateX(20px);opacity:1}}
@media (prefers-reduced-motion:reduce){.ib-model .ns-ves,.ib-model .ns-nt,.ib-model .ns-rbc,.ib-model .ns-hor{animation:none}}
@media (max-width:640px){.ib-model .a11-panel{padding:.55rem .5rem .65rem}.ib-model .a11-hd b{font-size:.9rem}}

/* ══ A.1.1 scannable prose + Learn it your way ══ */
/* ══ A.1.1 · scannable prose: bullets + highlighted key terms ══════════ */
.ib-model .deep-walk .deep-bullets,.native-section .deep-walk .deep-bullets{margin:.2rem 0;padding-left:1.15rem}
.native-section .deep-walk .deep-bullets li{margin:.34rem 0;line-height:1.62}
.native-section .deep-walk b.kt{color:var(--blue2);font-weight:800;background:color-mix(in srgb,var(--gold) 22%,transparent);
  padding:.05em .3em;border-radius:5px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
body.dark .native-section .deep-walk b.kt{color:var(--gold)}
/* ══ A.1.1 · Learn it your way — the textbook panel, per section ═══════ */
.ib-learn{margin:.2rem 0 .5rem;padding:.85rem .9rem .95rem;border:1px solid var(--border2,#C6D1DD);border-radius:16px;
  background:color-mix(in srgb,var(--blue2) 5%,var(--surface))}
.ib-learn-hd{display:flex;align-items:flex-start;gap:.7rem;flex-wrap:wrap}
.ib-learn-hd h4{flex:1 1 12rem;min-width:0;margin:0;font-size:1.02rem;font-family:var(--serif)}
.ib-learn-hd p{flex:1 1 100%;margin:.15rem 0 0;font-size:.8rem;color:var(--text3);line-height:1.5}
.ib-learn-prog{display:flex;align-items:center;gap:.6rem;margin:.7rem 0 .6rem}
.ib-learn-bar{flex:1;height:7px;border-radius:99px;background:var(--surface2);overflow:hidden}
.ib-learn-bar i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--blue2),var(--green));transition:width .3s}
.ib-learn-prog span{font-size:.76rem;color:var(--text3);white-space:nowrap}
.ib-learn-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.3rem;margin-bottom:.6rem}
.ib-learn-tabs button{font:inherit;font-size:.84rem;font-weight:700;padding:.5rem .4rem;border-radius:10px;cursor:pointer;
  color:var(--text2);background:var(--surface);border:1px solid var(--border2,#C6D1DD);transition:background .2s,border-color .2s}
.ib-learn-tabs button.on{background:color-mix(in srgb,var(--blue2) 12%,var(--surface));border-color:var(--blue2);color:var(--blue2)}
.ib-learn-pane[hidden]{display:none}
/* key-term chips */
.ib-kt{display:flex;flex-wrap:wrap;gap:.35rem;margin:.2rem 0 .55rem}
.ib-kt button{font:inherit;font-size:.78rem;font-weight:700;padding:.34rem .6rem;border-radius:999px;cursor:pointer;
  color:var(--text);background:color-mix(in srgb,var(--gold) 20%,var(--surface));border:1px solid color-mix(in srgb,var(--gold) 42%,transparent)}
.ib-kt button:hover{border-color:var(--gold)}
.ib-kt button.on{background:var(--gold);color:#10213a}
/* the flip card, reusing the textbook's own .kn-fc / .kn-card */
.ib-learn .kn-fc{max-width:none}
.ib-learn .kn-card{min-height:170px}
.ib-learn .kn-face{padding:1rem}
.ib-learn .kn-fc-bar{gap:.35rem;flex-wrap:wrap;justify-content:center}
.ib-learn .kv-btn{min-height:38px}
.ib-learn .kn-fc-bar{margin-top:.5rem}
.ib-qc{counter-reset:q;display:grid;gap:.5rem;margin:.2rem 0}
.ib-qc-item{padding:.6rem .7rem;border:1px solid var(--border2,#C6D1DD);border-radius:11px;background:var(--surface);font-size:.87rem;line-height:1.55}
.ib-qc-item summary{cursor:pointer;font-weight:700;color:var(--text)}
.ib-qc-item summary::marker{color:var(--accent)}
.ib-qc-item p{margin:.25rem 0}
.ib-qc-item .ib-ans{margin-top:.4rem;padding-top:.4rem;border-top:1px dashed var(--border2,#C6D1DD);color:var(--green);font-weight:700}
.ib-map{display:flex;flex-wrap:wrap;gap:.35rem}
.ib-map button{font:inherit;font-size:.76rem;font-weight:700;padding:.34rem .55rem;border-radius:9px;cursor:pointer;
  color:var(--text2);background:var(--surface);border:1px solid var(--border2,#C6D1DD)}
.ib-map button.done{background:color-mix(in srgb,var(--green) 14%,var(--surface));border-color:var(--green);color:var(--green)}
.ib-map button.on{border-color:var(--blue2);color:var(--blue2)}
@media (max-width:640px){.ib-learn{padding:.7rem .65rem .8rem}.ib-learn-tabs button{min-height:40px;font-size:.8rem}
  .ib-kt button{min-height:34px}.native-section .deep-walk .deep-bullets li{margin:.4rem 0}}

/* ══ anatomy shapes ══ */
/* ══ anatomy shapes — one library, reused by every model ═══════════════ */
.ib-model .an-white{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--text3);stroke-width:1.5}
.ib-model .an-grey{fill:color-mix(in srgb,var(--c2) 40%,var(--surface));stroke:var(--c2);stroke-width:1.2}
.ib-model .an-canal{fill:var(--surface);stroke:var(--c2);stroke-width:1.2}
.ib-model .an-cordline{stroke:var(--text3);stroke-width:7;stroke-linecap:round}
.ib-model .an-brain{fill:color-mix(in srgb,var(--c2) 30%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-fold{fill:none;stroke:var(--c2);stroke-width:1.4;opacity:.7}
.ib-model .an-stem{fill:none;stroke:var(--c2);stroke-width:5;stroke-linecap:round}
.ib-model .an-muscle{fill:color-mix(in srgb,var(--c0) 24%,var(--surface));stroke:var(--c0);stroke-width:1.8}
.ib-model .an-muscle.hot{fill:color-mix(in srgb,var(--c0) 52%,var(--surface));stroke-width:2.6}
.ib-model .an-tendon{fill:color-mix(in srgb,var(--text) 22%,var(--surface))}
.ib-model .an-cap{fill:color-mix(in srgb,var(--gold) 26%,var(--surface));stroke:var(--gold);stroke-width:1.6}
.ib-model .an-intra{stroke:var(--c0);stroke-width:2;stroke-linecap:round}
.ib-model .an-ia{fill:none;stroke:var(--gold);stroke-width:1.8;stroke-linecap:round}
.ib-model .an-axon{stroke:var(--text3);stroke-width:2.4;stroke-linecap:round}
.ib-model .an-axon.on{stroke:var(--c0);stroke-width:3.4}
.ib-model .an-axon.dim{opacity:.35}
.ib-model .an-myelin{fill:color-mix(in srgb,var(--text) 26%,var(--surface));stroke:var(--text3);stroke-width:.8}
.ib-model .an-axon.on + .an-myelin,.ib-model .an-myelin{opacity:.9}
.ib-model .an-heart{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:1.8}
.ib-model .an-heart.hot{fill:color-mix(in srgb,var(--c0) 55%,var(--surface));stroke-width:2.6}
.ib-model .an-chamber{fill:color-mix(in srgb,var(--c0) 60%,var(--surface))}
.ib-model .an-chamber.r{fill:color-mix(in srgb,var(--c2) 60%,var(--surface))}
.ib-model .an-septum{stroke:var(--c0);stroke-width:2}
.ib-model .an-aorta{fill:none;stroke:var(--c0);stroke-width:4;stroke-linecap:round}
.ib-model .an-vena{fill:none;stroke:var(--c2);stroke-width:4;stroke-linecap:round}
.ib-model .an-kidney{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:1.8}
.ib-model .an-kidney.hot{fill:color-mix(in srgb,var(--gold) 60%,var(--surface));stroke-width:2.6}
.ib-model .an-adrenal{fill:color-mix(in srgb,var(--green) 45%,var(--surface));stroke:var(--green);stroke-width:1.6}
.ib-model .an-adrenal.hot{fill:var(--green);stroke-width:2.6}
.ib-model .an-hilum,.ib-model .an-ureter,.ib-model .an-vessel{fill:none;stroke:var(--text3);stroke-width:3;stroke-linecap:round}
.ib-model .an-vessel.r{stroke:var(--c0)}.ib-model .an-vessel.b{stroke:var(--c2)}
.ib-model .an-ureter{stroke-width:2.6}
.ib-model .an-hypothal{fill:color-mix(in srgb,var(--c2) 34%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-stalk{stroke:var(--c2);stroke-width:3;stroke-linecap:round}
.ib-model .an-pituit{fill:color-mix(in srgb,var(--green) 46%,var(--surface));stroke:var(--green);stroke-width:1.6}
.ib-model .an-lungs,.ib-model .an-lung{fill:color-mix(in srgb,var(--c2) 26%,var(--surface));stroke:var(--c2);stroke-width:1.7}
.ib-model .an-trachea{fill:none;stroke:var(--c2);stroke-width:3.4;stroke-linecap:round}
.ib-model .an-liver{fill:color-mix(in srgb,var(--c0) 22%,var(--surface));stroke:var(--c0);stroke-width:1.8}
.ib-model .an-liver.hot{fill:color-mix(in srgb,var(--c0) 52%,var(--surface));stroke-width:2.6}
.ib-model .an-horm{fill:var(--gold);stroke:var(--surface);stroke-width:1.6}
.ib-model .an-epi{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:1.2}
.ib-model .an-derm{fill:color-mix(in srgb,var(--c0) 12%,var(--surface));stroke:var(--c0);stroke-width:1.2}
.ib-model .an-duct{fill:none;stroke:var(--gold);stroke-width:2.4;stroke-linecap:round}
.ib-model .an-coil{fill:none;stroke:var(--gold);stroke-width:5}
.ib-model .an-lumen2{fill:var(--surface);stroke:var(--gold);stroke-width:1.2}
.ib-model .an-cuboid{fill:color-mix(in srgb,var(--gold) 55%,var(--surface));stroke:var(--gold);stroke-width:.8}
.ib-model .an-drop{fill:var(--c2);opacity:.85}
/* flow arrows and loops */
.ib-model .an-flow{fill:none;stroke:var(--text3);stroke-width:2.4;stroke-linecap:round}
.ib-model .an-flow.good{stroke:var(--green);stroke-width:3}
.ib-model .an-flow.bad{stroke:var(--c0);stroke-width:3}
.ib-model .an-flow.neg{stroke:var(--green);stroke-width:3}
.ib-model .an-flow.pos{stroke:var(--c0);stroke-width:3}
.ib-model .an-link{fill:none;stroke:var(--text3);stroke-width:2;opacity:.3}
.ib-model .an-link.on{stroke:var(--c0);stroke-width:3;opacity:1}
.ib-model .an-dim{stroke:var(--text3);stroke-width:2;fill:none}
.ib-model .an-head{fill:var(--text3)}
.ib-model .an-head,.ib-model .an-flow.bad + marker path{fill:var(--text3)}
.ib-model .an-var{fill:color-mix(in srgb,var(--blue2,#2563a8) 20%,var(--surface));stroke:var(--blue2,#2563a8);stroke-width:2}
.ib-model .an-box{fill:color-mix(in srgb,var(--c2) 18%,var(--surface));stroke:var(--c2);stroke-width:1.8;rx:10}
.ib-model .an-effector{fill:color-mix(in srgb,var(--green) 30%,var(--surface));stroke:var(--green);stroke-width:1.8}
.ib-model .an-glass{fill:color-mix(in srgb,var(--c2) 24%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-food{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:1.6}
.ib-model .an-body{fill:color-mix(in srgb,var(--text) 12%,var(--surface));stroke:var(--text3);stroke-width:1.6}
.ib-model .an-timer{stroke:var(--c0);stroke-width:3;fill:none}
.ib-model .an-lab-neg{fill:var(--green);font-weight:800}
.ib-model .an-lab-pos{fill:var(--c0);font-weight:800}
/* legend swatches */
.ib-model .an-l-grey{background:var(--c2)}.ib-model .an-l-white{background:color-mix(in srgb,var(--text) 22%,var(--surface))}
.ib-model .an-l-muscle{background:var(--c0)}.ib-model .an-l-organ{background:var(--gold)}
.ib-model .an-l-on{background:var(--c0)}.ib-model .an-l-off{background:color-mix(in srgb,var(--text) 16%,var(--surface))}
.ib-model .an-l-ia{background:var(--gold)}.ib-model .an-l-neg{background:var(--green)}
.ib-model .an-l-pos{background:var(--c0)}.ib-model .an-l-hot{background:var(--green)}
.ib-model .an-l-good{background:var(--green)}.ib-model .an-l-bad{background:var(--c0)}
.ib-model .an-l-gland{background:var(--gold)}
.ib-model .an-b-neg{background:var(--green)}.ib-model .an-b-pos{background:var(--c0)}
.ib-model .an-b-in{background:var(--green)}.ib-model .an-b-out{background:var(--c0)}
.ib-model .an-b-vol{background:var(--c2)}.ib-model .an-b-sv{background:var(--green)}.ib-model .an-b-hr{background:var(--c0)}
.ib-model .kv-meters{display:grid;gap:.35rem;margin:.6rem 0 .2rem}
@media (prefers-reduced-motion:reduce){.ib-model .an-ia{animation:none}}

/* ══ anatomy shapes (D2) ══ */
/* ══ anatomy shapes — one library, reused by every model ═══════════════ */
.ib-model .an-white{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--text3);stroke-width:1.5}
.ib-model .an-grey{fill:color-mix(in srgb,var(--c2) 40%,var(--surface));stroke:var(--c2);stroke-width:1.2}
.ib-model .an-canal{fill:var(--surface);stroke:var(--c2);stroke-width:1.2}
.ib-model .an-cordline{stroke:var(--text3);stroke-width:7;stroke-linecap:round}
.ib-model .an-brain{fill:color-mix(in srgb,var(--c2) 30%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-fold{fill:none;stroke:var(--c2);stroke-width:1.4;opacity:.7}
.ib-model .an-stem{fill:none;stroke:var(--c2);stroke-width:5;stroke-linecap:round}
.ib-model .an-muscle{fill:color-mix(in srgb,var(--c0) 24%,var(--surface));stroke:var(--c0);stroke-width:1.8}
.ib-model .an-muscle.hot{fill:color-mix(in srgb,var(--c0) 52%,var(--surface));stroke-width:2.6}
.ib-model .an-tendon{fill:color-mix(in srgb,var(--text) 22%,var(--surface))}
.ib-model .an-cap{fill:color-mix(in srgb,var(--gold) 26%,var(--surface));stroke:var(--gold);stroke-width:1.6}
.ib-model .an-intra{stroke:var(--c0);stroke-width:2;stroke-linecap:round}
.ib-model .an-ia{fill:none;stroke:var(--gold);stroke-width:1.8;stroke-linecap:round}
.ib-model .an-axon{stroke:var(--text3);stroke-width:2.4;stroke-linecap:round}
.ib-model .an-axon.on{stroke:var(--c0);stroke-width:3.4}
.ib-model .an-axon.dim{opacity:.35}
.ib-model .an-myelin{fill:color-mix(in srgb,var(--text) 26%,var(--surface));stroke:var(--text3);stroke-width:.8}
.ib-model .an-axon.on + .an-myelin,.ib-model .an-myelin{opacity:.9}
.ib-model .an-heart{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:1.8}
.ib-model .an-heart.hot{fill:color-mix(in srgb,var(--c0) 55%,var(--surface));stroke-width:2.6}
.ib-model .an-chamber{fill:color-mix(in srgb,var(--c0) 60%,var(--surface))}
.ib-model .an-chamber.r{fill:color-mix(in srgb,var(--c2) 60%,var(--surface))}
.ib-model .an-septum{stroke:var(--c0);stroke-width:2}
.ib-model .an-aorta{fill:none;stroke:var(--c0);stroke-width:4;stroke-linecap:round}
.ib-model .an-vena{fill:none;stroke:var(--c2);stroke-width:4;stroke-linecap:round}
.ib-model .an-kidney{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:1.8}
.ib-model .an-kidney.hot{fill:color-mix(in srgb,var(--gold) 60%,var(--surface));stroke-width:2.6}
.ib-model .an-adrenal{fill:color-mix(in srgb,var(--green) 45%,var(--surface));stroke:var(--green);stroke-width:1.6}
.ib-model .an-adrenal.hot{fill:var(--green);stroke-width:2.6}
.ib-model .an-hilum,.ib-model .an-ureter,.ib-model .an-vessel{fill:none;stroke:var(--text3);stroke-width:3;stroke-linecap:round}
.ib-model .an-vessel.r{stroke:var(--c0)}.ib-model .an-vessel.b{stroke:var(--c2)}
.ib-model .an-ureter{stroke-width:2.6}
.ib-model .an-hypothal{fill:color-mix(in srgb,var(--c2) 34%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-stalk{stroke:var(--c2);stroke-width:3;stroke-linecap:round}
.ib-model .an-pituit{fill:color-mix(in srgb,var(--green) 46%,var(--surface));stroke:var(--green);stroke-width:1.6}
.ib-model .an-lungs,.ib-model .an-lung{fill:color-mix(in srgb,var(--c2) 26%,var(--surface));stroke:var(--c2);stroke-width:1.7}
.ib-model .an-trachea{fill:none;stroke:var(--c2);stroke-width:3.4;stroke-linecap:round}
.ib-model .an-liver{fill:color-mix(in srgb,var(--c0) 22%,var(--surface));stroke:var(--c0);stroke-width:1.8}
.ib-model .an-liver.hot{fill:color-mix(in srgb,var(--c0) 52%,var(--surface));stroke-width:2.6}
.ib-model .an-horm{fill:var(--gold);stroke:var(--surface);stroke-width:1.6}
.ib-model .an-epi{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:1.2}
.ib-model .an-derm{fill:color-mix(in srgb,var(--c0) 12%,var(--surface));stroke:var(--c0);stroke-width:1.2}
.ib-model .an-duct{fill:none;stroke:var(--gold);stroke-width:2.4;stroke-linecap:round}
.ib-model .an-coil{fill:none;stroke:var(--gold);stroke-width:5}
.ib-model .an-lumen2{fill:var(--surface);stroke:var(--gold);stroke-width:1.2}
.ib-model .an-cuboid{fill:color-mix(in srgb,var(--gold) 55%,var(--surface));stroke:var(--gold);stroke-width:.8}
.ib-model .an-drop{fill:var(--c2);opacity:.85}
/* flow arrows and loops */
.ib-model .an-flow{fill:none;stroke:var(--text3);stroke-width:2.4;stroke-linecap:round}
.ib-model .an-flow.good{stroke:var(--green);stroke-width:3}
.ib-model .an-flow.bad{stroke:var(--c0);stroke-width:3}
.ib-model .an-flow.neg{stroke:var(--green);stroke-width:3}
.ib-model .an-flow.pos{stroke:var(--c0);stroke-width:3}
.ib-model .an-link{fill:none;stroke:var(--text3);stroke-width:2;opacity:.3}
.ib-model .an-link.on{stroke:var(--c0);stroke-width:3;opacity:1}
.ib-model .an-dim{stroke:var(--text3);stroke-width:2;fill:none}
.ib-model .an-head{fill:var(--text3)}
.ib-model .an-head,.ib-model .an-flow.bad + marker path{fill:var(--text3)}
.ib-model .an-var{fill:color-mix(in srgb,var(--blue2,#2563a8) 20%,var(--surface));stroke:var(--blue2,#2563a8);stroke-width:2}
.ib-model .an-box{fill:color-mix(in srgb,var(--c2) 18%,var(--surface));stroke:var(--c2);stroke-width:1.8;rx:10}
.ib-model .an-effector{fill:color-mix(in srgb,var(--green) 30%,var(--surface));stroke:var(--green);stroke-width:1.8}
.ib-model .an-glass{fill:color-mix(in srgb,var(--c2) 24%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-food{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:1.6}
.ib-model .an-body{fill:color-mix(in srgb,var(--text) 12%,var(--surface));stroke:var(--text3);stroke-width:1.6}
.ib-model .an-timer{stroke:var(--c0);stroke-width:3;fill:none}
.ib-model .an-lab-neg{fill:var(--green);font-weight:800}
.ib-model .an-lab-pos{fill:var(--c0);font-weight:800}
/* legend swatches */
.ib-model .an-l-grey{background:var(--c2)}.ib-model .an-l-white{background:color-mix(in srgb,var(--text) 22%,var(--surface))}
.ib-model .an-l-muscle{background:var(--c0)}.ib-model .an-l-organ{background:var(--gold)}
.ib-model .an-l-on{background:var(--c0)}.ib-model .an-l-off{background:color-mix(in srgb,var(--text) 16%,var(--surface))}
.ib-model .an-l-ia{background:var(--gold)}.ib-model .an-l-neg{background:var(--green)}
.ib-model .an-l-pos{background:var(--c0)}.ib-model .an-l-hot{background:var(--green)}
.ib-model .an-l-good{background:var(--green)}.ib-model .an-l-bad{background:var(--c0)}
.ib-model .an-l-gland{background:var(--gold)}
.ib-model .an-b-neg{background:var(--green)}.ib-model .an-b-pos{background:var(--c0)}
.ib-model .an-b-in{background:var(--green)}.ib-model .an-b-out{background:var(--c0)}
.ib-model .an-b-vol{background:var(--c2)}.ib-model .an-b-sv{background:var(--green)}.ib-model .an-b-hr{background:var(--c0)}
.ib-model .kv-meters{display:grid;gap:.35rem;margin:.6rem 0 .2rem}
@media (prefers-reduced-motion:reduce){.ib-model .an-ia{animation:none}}
/* ══ shapes added for batch D2 (nutrition, energy, population) ═════════ */
.ib-model .an-sugar{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:2}
.ib-model .an-o{fill:var(--c2);stroke:none}
.ib-model .an-fat{fill:color-mix(in srgb,var(--c1) 45%,var(--surface));stroke:var(--c1);stroke-width:1.8}
.ib-model .an-chain{stroke:var(--c1);stroke-width:4;stroke-linecap:round}
.ib-model .an-p{fill:var(--c1)}
.ib-model .an-aa{fill:color-mix(in srgb,var(--c2) 34%,var(--surface));stroke:var(--c2);stroke-width:1.7}
.ib-model .an-bond{stroke:var(--c2);stroke-width:3;stroke-linecap:round}
.ib-model .an-gutwall{fill:none;stroke:var(--c0);stroke-width:7;stroke-linecap:round;opacity:.5}
.ib-model .an-bact{fill:var(--green)}
.ib-model .an-adenine,.ib-model .an-ribose{fill:color-mix(in srgb,var(--c2) 34%,var(--surface));stroke:var(--c2);stroke-width:1.7}
.ib-model .an-phos{fill:color-mix(in srgb,var(--c0) 32%,var(--surface));stroke:var(--c0);stroke-width:1.7}
.ib-model .an-phos.hot{fill:color-mix(in srgb,var(--c0) 62%,var(--surface));stroke-width:2.4}
.ib-model .an-plaque{fill:color-mix(in srgb,var(--c1) 70%,var(--surface));stroke:var(--c1);stroke-width:1.2}
.ib-model .an-dial{fill:color-mix(in srgb,var(--c2) 22%,var(--surface));stroke:var(--c2);stroke-width:1.8}
.ib-model .an-box2{fill:color-mix(in srgb,var(--text) 6%,var(--surface));stroke:var(--text3);stroke-width:1.6}
.ib-model .an-beam{stroke:var(--text3);stroke-width:5;stroke-linecap:round}
.ib-model .an-pan{fill:color-mix(in srgb,var(--c2) 24%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-fulcrum{fill:color-mix(in srgb,var(--text) 26%,var(--surface))}
.ib-model .an-day{fill:color-mix(in srgb,var(--text) 12%,var(--surface));stroke:var(--text3);stroke-width:1.4}
.ib-model .an-day.on{fill:color-mix(in srgb,var(--c0) 42%,var(--surface));stroke:var(--c0)}
.ib-model .an-prog{fill:none;stroke:var(--green);stroke-width:3;stroke-linecap:round}
.ib-model .an-dot2{fill:var(--green);stroke:var(--surface);stroke-width:1.5}
.ib-model .an-bar{fill:color-mix(in srgb,var(--text) 8%,var(--surface));stroke:var(--text3);stroke-width:1.2}
.ib-model .an-b0{fill:var(--c0)}.ib-model .an-b1{fill:var(--c1)}.ib-model .an-b2{fill:var(--c2)}
.ib-model .an-cursor2{stroke:var(--text);stroke-width:2;stroke-dasharray:4 3}
.ib-model .an-gauge{fill:color-mix(in srgb,var(--text) 8%,var(--surface));stroke:var(--text3);stroke-width:1.2}
.ib-model .an-gauge-f{fill:var(--green)}
.ib-model .an-thresh{stroke:var(--c0);stroke-width:2.4;stroke-dasharray:4 3}
.ib-model .an-mn{fill:color-mix(in srgb,var(--text) 8%,var(--surface));stroke:var(--text3);stroke-width:1.6}
.ib-model .an-mn.on{fill:color-mix(in srgb,var(--gold) 40%,var(--surface));stroke:var(--gold);stroke-width:2.6}
.ib-model .an-mn-t{fill:var(--text);font-weight:800}
.ib-model .an-plate{fill:color-mix(in srgb,var(--text) 8%,var(--surface));stroke:var(--text3);stroke-width:1.4}
.ib-model .an-sl-car{fill:var(--c2)}.ib-model .an-sl-fat{fill:var(--c1)}
.ib-model .an-hyp{fill:none;stroke:var(--c2);stroke-width:2.4;stroke-linejoin:round}
.ib-model .an-timeline{stroke:var(--text3);stroke-width:2.4}
.ib-model .an-tick{fill:var(--c2)}
.ib-model .an-clock{fill:color-mix(in srgb,var(--text) 6%,var(--surface));stroke:var(--text3);stroke-width:2}
.ib-model .an-hand{stroke:var(--text);stroke-width:2.4;stroke-linecap:round;fill:none}
.ib-model .an-fibrebox{fill:color-mix(in srgb,var(--c0) 16%,var(--surface));stroke:var(--c0);stroke-width:1.6}
.ib-model .an-gly{fill:color-mix(in srgb,var(--text) 12%,var(--surface));stroke:var(--text3);stroke-width:1.2}
.ib-model .an-gly.on{fill:var(--c1);stroke:var(--c1)}
.ib-model .an-lead2{stroke:var(--text3);stroke-width:1}
.ib-model .an-rbc2{fill:var(--c0)}
/* legend + bar swatches for D2 */
.ib-model .an-l-car{background:var(--c2)}.ib-model .an-l-fat{background:var(--c1)}.ib-model .an-l-prot{background:var(--c0)}
.ib-model .an-l-on{background:var(--c0)}.ib-model .an-l-off{background:color-mix(in srgb,var(--text) 14%,var(--surface))}
.ib-model .an-l-bact{background:var(--green)}.ib-model .an-l-prog{background:var(--green)}
.ib-model .an-b-car{background:var(--c2)}.ib-model .an-b-fat{background:var(--c1)}.ib-model .an-b-prot{background:var(--c0)}
.ib-model .an-b-q{background:var(--c2)}.ib-model .an-b-fit{background:var(--green)}
.ib-model .an-b-bmr{background:var(--c2)}.ib-model .an-b-need{background:var(--c0)}
.ib-model .an-b-gly{background:var(--green)}.ib-model .an-b-hrv{background:var(--green)}.ib-model .an-b-perf{background:var(--c2)}
.ib-model .an-b-fe{background:var(--c0)}.ib-model .an-b-ca{background:var(--c2)}
.ib-model .an-b-na{background:var(--c1)}.ib-model .an-b-k{background:var(--green)}
.ib-model .an-mn-fe{fill:color-mix(in srgb,var(--c0) 40%,var(--surface));stroke:var(--c0)}
.ib-model .an-mn-ca{fill:color-mix(in srgb,var(--c2) 40%,var(--surface));stroke:var(--c2)}
.ib-model .an-mn-na{fill:color-mix(in srgb,var(--c1) 50%,var(--surface));stroke:var(--c1)}
.ib-model .an-mn-k{fill:color-mix(in srgb,var(--green) 40%,var(--surface));stroke:var(--green)}

/* ══ anatomy shapes (D3) ══ */
/* ══ anatomy shapes — one library, reused by every model ═══════════════ */
.ib-model .an-white{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--text3);stroke-width:1.5}
.ib-model .an-grey{fill:color-mix(in srgb,var(--c2) 40%,var(--surface));stroke:var(--c2);stroke-width:1.2}
.ib-model .an-canal{fill:var(--surface);stroke:var(--c2);stroke-width:1.2}
.ib-model .an-cordline{stroke:var(--text3);stroke-width:7;stroke-linecap:round}
.ib-model .an-brain{fill:color-mix(in srgb,var(--c2) 30%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-fold{fill:none;stroke:var(--c2);stroke-width:1.4;opacity:.7}
.ib-model .an-stem{fill:none;stroke:var(--c2);stroke-width:5;stroke-linecap:round}
.ib-model .an-muscle{fill:color-mix(in srgb,var(--c0) 24%,var(--surface));stroke:var(--c0);stroke-width:1.8}
.ib-model .an-muscle.hot{fill:color-mix(in srgb,var(--c0) 52%,var(--surface));stroke-width:2.6}
.ib-model .an-tendon{fill:color-mix(in srgb,var(--text) 22%,var(--surface))}
.ib-model .an-cap{fill:color-mix(in srgb,var(--gold) 26%,var(--surface));stroke:var(--gold);stroke-width:1.6}
.ib-model .an-intra{stroke:var(--c0);stroke-width:2;stroke-linecap:round}
.ib-model .an-ia{fill:none;stroke:var(--gold);stroke-width:1.8;stroke-linecap:round}
.ib-model .an-axon{stroke:var(--text3);stroke-width:2.4;stroke-linecap:round}
.ib-model .an-axon.on{stroke:var(--c0);stroke-width:3.4}
.ib-model .an-axon.dim{opacity:.35}
.ib-model .an-myelin{fill:color-mix(in srgb,var(--text) 26%,var(--surface));stroke:var(--text3);stroke-width:.8}
.ib-model .an-axon.on + .an-myelin,.ib-model .an-myelin{opacity:.9}
.ib-model .an-heart{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:1.8}
.ib-model .an-heart.hot{fill:color-mix(in srgb,var(--c0) 55%,var(--surface));stroke-width:2.6}
.ib-model .an-chamber{fill:color-mix(in srgb,var(--c0) 60%,var(--surface))}
.ib-model .an-chamber.r{fill:color-mix(in srgb,var(--c2) 60%,var(--surface))}
.ib-model .an-septum{stroke:var(--c0);stroke-width:2}
.ib-model .an-aorta{fill:none;stroke:var(--c0);stroke-width:4;stroke-linecap:round}
.ib-model .an-vena{fill:none;stroke:var(--c2);stroke-width:4;stroke-linecap:round}
.ib-model .an-kidney{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:1.8}
.ib-model .an-kidney.hot{fill:color-mix(in srgb,var(--gold) 60%,var(--surface));stroke-width:2.6}
.ib-model .an-adrenal{fill:color-mix(in srgb,var(--green) 45%,var(--surface));stroke:var(--green);stroke-width:1.6}
.ib-model .an-adrenal.hot{fill:var(--green);stroke-width:2.6}
.ib-model .an-hilum,.ib-model .an-ureter,.ib-model .an-vessel{fill:none;stroke:var(--text3);stroke-width:3;stroke-linecap:round}
.ib-model .an-vessel.r{stroke:var(--c0)}.ib-model .an-vessel.b{stroke:var(--c2)}
.ib-model .an-ureter{stroke-width:2.6}
.ib-model .an-hypothal{fill:color-mix(in srgb,var(--c2) 34%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-stalk{stroke:var(--c2);stroke-width:3;stroke-linecap:round}
.ib-model .an-pituit{fill:color-mix(in srgb,var(--green) 46%,var(--surface));stroke:var(--green);stroke-width:1.6}
.ib-model .an-lungs,.ib-model .an-lung{fill:color-mix(in srgb,var(--c2) 26%,var(--surface));stroke:var(--c2);stroke-width:1.7}
.ib-model .an-trachea{fill:none;stroke:var(--c2);stroke-width:3.4;stroke-linecap:round}
.ib-model .an-liver{fill:color-mix(in srgb,var(--c0) 22%,var(--surface));stroke:var(--c0);stroke-width:1.8}
.ib-model .an-liver.hot{fill:color-mix(in srgb,var(--c0) 52%,var(--surface));stroke-width:2.6}
.ib-model .an-horm{fill:var(--gold);stroke:var(--surface);stroke-width:1.6}
.ib-model .an-epi{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:1.2}
.ib-model .an-derm{fill:color-mix(in srgb,var(--c0) 12%,var(--surface));stroke:var(--c0);stroke-width:1.2}
.ib-model .an-duct{fill:none;stroke:var(--gold);stroke-width:2.4;stroke-linecap:round}
.ib-model .an-coil{fill:none;stroke:var(--gold);stroke-width:5}
.ib-model .an-lumen2{fill:var(--surface);stroke:var(--gold);stroke-width:1.2}
.ib-model .an-cuboid{fill:color-mix(in srgb,var(--gold) 55%,var(--surface));stroke:var(--gold);stroke-width:.8}
.ib-model .an-drop{fill:var(--c2);opacity:.85}
/* flow arrows and loops */
.ib-model .an-flow{fill:none;stroke:var(--text3);stroke-width:2.4;stroke-linecap:round}
.ib-model .an-flow.good{stroke:var(--green);stroke-width:3}
.ib-model .an-flow.bad{stroke:var(--c0);stroke-width:3}
.ib-model .an-flow.neg{stroke:var(--green);stroke-width:3}
.ib-model .an-flow.pos{stroke:var(--c0);stroke-width:3}
.ib-model .an-link{fill:none;stroke:var(--text3);stroke-width:2;opacity:.3}
.ib-model .an-link.on{stroke:var(--c0);stroke-width:3;opacity:1}
.ib-model .an-dim{stroke:var(--text3);stroke-width:2;fill:none}
.ib-model .an-head{fill:var(--text3)}
.ib-model .an-head,.ib-model .an-flow.bad + marker path{fill:var(--text3)}
.ib-model .an-var{fill:color-mix(in srgb,var(--blue2,#2563a8) 20%,var(--surface));stroke:var(--blue2,#2563a8);stroke-width:2}
.ib-model .an-box{fill:color-mix(in srgb,var(--c2) 18%,var(--surface));stroke:var(--c2);stroke-width:1.8;rx:10}
.ib-model .an-effector{fill:color-mix(in srgb,var(--green) 30%,var(--surface));stroke:var(--green);stroke-width:1.8}
.ib-model .an-glass{fill:color-mix(in srgb,var(--c2) 24%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-food{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:1.6}
.ib-model .an-body{fill:color-mix(in srgb,var(--text) 12%,var(--surface));stroke:var(--text3);stroke-width:1.6}
.ib-model .an-timer{stroke:var(--c0);stroke-width:3;fill:none}
.ib-model .an-lab-neg{fill:var(--green);font-weight:800}
.ib-model .an-lab-pos{fill:var(--c0);font-weight:800}
/* legend swatches */
.ib-model .an-l-grey{background:var(--c2)}.ib-model .an-l-white{background:color-mix(in srgb,var(--text) 22%,var(--surface))}
.ib-model .an-l-muscle{background:var(--c0)}.ib-model .an-l-organ{background:var(--gold)}
.ib-model .an-l-on{background:var(--c0)}.ib-model .an-l-off{background:color-mix(in srgb,var(--text) 16%,var(--surface))}
.ib-model .an-l-ia{background:var(--gold)}.ib-model .an-l-neg{background:var(--green)}
.ib-model .an-l-pos{background:var(--c0)}.ib-model .an-l-hot{background:var(--green)}
.ib-model .an-l-good{background:var(--green)}.ib-model .an-l-bad{background:var(--c0)}
.ib-model .an-l-gland{background:var(--gold)}
.ib-model .an-b-neg{background:var(--green)}.ib-model .an-b-pos{background:var(--c0)}
.ib-model .an-b-in{background:var(--green)}.ib-model .an-b-out{background:var(--c0)}
.ib-model .an-b-vol{background:var(--c2)}.ib-model .an-b-sv{background:var(--green)}.ib-model .an-b-hr{background:var(--c0)}
.ib-model .kv-meters{display:grid;gap:.35rem;margin:.6rem 0 .2rem}
@media (prefers-reduced-motion:reduce){.ib-model .an-ia{animation:none}}
/* ══ shapes added for batch D2 (nutrition, energy, population) ═════════ */
.ib-model .an-sugar{fill:color-mix(in srgb,var(--gold) 30%,var(--surface));stroke:var(--gold);stroke-width:2}
.ib-model .an-o{fill:var(--c2);stroke:none}
.ib-model .an-fat{fill:color-mix(in srgb,var(--c1) 45%,var(--surface));stroke:var(--c1);stroke-width:1.8}
.ib-model .an-chain{stroke:var(--c1);stroke-width:4;stroke-linecap:round}
.ib-model .an-p{fill:var(--c1)}
.ib-model .an-aa{fill:color-mix(in srgb,var(--c2) 34%,var(--surface));stroke:var(--c2);stroke-width:1.7}
.ib-model .an-bond{stroke:var(--c2);stroke-width:3;stroke-linecap:round}
.ib-model .an-gutwall{fill:none;stroke:var(--c0);stroke-width:7;stroke-linecap:round;opacity:.5}
.ib-model .an-bact{fill:var(--green)}
.ib-model .an-adenine,.ib-model .an-ribose{fill:color-mix(in srgb,var(--c2) 34%,var(--surface));stroke:var(--c2);stroke-width:1.7}
.ib-model .an-phos{fill:color-mix(in srgb,var(--c0) 32%,var(--surface));stroke:var(--c0);stroke-width:1.7}
.ib-model .an-phos.hot{fill:color-mix(in srgb,var(--c0) 62%,var(--surface));stroke-width:2.4}
.ib-model .an-plaque{fill:color-mix(in srgb,var(--c1) 70%,var(--surface));stroke:var(--c1);stroke-width:1.2}
.ib-model .an-dial{fill:color-mix(in srgb,var(--c2) 22%,var(--surface));stroke:var(--c2);stroke-width:1.8}
.ib-model .an-box2{fill:color-mix(in srgb,var(--text) 6%,var(--surface));stroke:var(--text3);stroke-width:1.6}
.ib-model .an-beam{stroke:var(--text3);stroke-width:5;stroke-linecap:round}
.ib-model .an-pan{fill:color-mix(in srgb,var(--c2) 24%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-fulcrum{fill:color-mix(in srgb,var(--text) 26%,var(--surface))}
.ib-model .an-day{fill:color-mix(in srgb,var(--text) 12%,var(--surface));stroke:var(--text3);stroke-width:1.4}
.ib-model .an-day.on{fill:color-mix(in srgb,var(--c0) 42%,var(--surface));stroke:var(--c0)}
.ib-model .an-prog{fill:none;stroke:var(--green);stroke-width:3;stroke-linecap:round}
.ib-model .an-dot2{fill:var(--green);stroke:var(--surface);stroke-width:1.5}
.ib-model .an-bar{fill:color-mix(in srgb,var(--text) 8%,var(--surface));stroke:var(--text3);stroke-width:1.2}
.ib-model .an-b0{fill:var(--c0)}.ib-model .an-b1{fill:var(--c1)}.ib-model .an-b2{fill:var(--c2)}
.ib-model .an-cursor2{stroke:var(--text);stroke-width:2;stroke-dasharray:4 3}
.ib-model .an-gauge{fill:color-mix(in srgb,var(--text) 8%,var(--surface));stroke:var(--text3);stroke-width:1.2}
.ib-model .an-gauge-f{fill:var(--green)}
.ib-model .an-thresh{stroke:var(--c0);stroke-width:2.4;stroke-dasharray:4 3}
.ib-model .an-mn{fill:color-mix(in srgb,var(--text) 8%,var(--surface));stroke:var(--text3);stroke-width:1.6}
.ib-model .an-mn.on{fill:color-mix(in srgb,var(--gold) 40%,var(--surface));stroke:var(--gold);stroke-width:2.6}
.ib-model .an-mn-t{fill:var(--text);font-weight:800}
.ib-model .an-plate{fill:color-mix(in srgb,var(--text) 8%,var(--surface));stroke:var(--text3);stroke-width:1.4}
.ib-model .an-sl-car{fill:var(--c2)}.ib-model .an-sl-fat{fill:var(--c1)}
.ib-model .an-hyp{fill:none;stroke:var(--c2);stroke-width:2.4;stroke-linejoin:round}
.ib-model .an-timeline{stroke:var(--text3);stroke-width:2.4}
.ib-model .an-tick{fill:var(--c2)}
.ib-model .an-clock{fill:color-mix(in srgb,var(--text) 6%,var(--surface));stroke:var(--text3);stroke-width:2}
.ib-model .an-hand{stroke:var(--text);stroke-width:2.4;stroke-linecap:round;fill:none}
.ib-model .an-fibrebox{fill:color-mix(in srgb,var(--c0) 16%,var(--surface));stroke:var(--c0);stroke-width:1.6}
.ib-model .an-gly{fill:color-mix(in srgb,var(--text) 12%,var(--surface));stroke:var(--text3);stroke-width:1.2}
.ib-model .an-gly.on{fill:var(--c1);stroke:var(--c1)}
.ib-model .an-lead2{stroke:var(--text3);stroke-width:1}
.ib-model .an-rbc2{fill:var(--c0)}
/* legend + bar swatches for D2 */
.ib-model .an-l-car{background:var(--c2)}.ib-model .an-l-fat{background:var(--c1)}.ib-model .an-l-prot{background:var(--c0)}
.ib-model .an-l-on{background:var(--c0)}.ib-model .an-l-off{background:color-mix(in srgb,var(--text) 14%,var(--surface))}
.ib-model .an-l-bact{background:var(--green)}.ib-model .an-l-prog{background:var(--green)}
.ib-model .an-b-car{background:var(--c2)}.ib-model .an-b-fat{background:var(--c1)}.ib-model .an-b-prot{background:var(--c0)}
.ib-model .an-b-q{background:var(--c2)}.ib-model .an-b-fit{background:var(--green)}
.ib-model .an-b-bmr{background:var(--c2)}.ib-model .an-b-need{background:var(--c0)}
.ib-model .an-b-gly{background:var(--green)}.ib-model .an-b-hrv{background:var(--green)}.ib-model .an-b-perf{background:var(--c2)}
.ib-model .an-b-fe{background:var(--c0)}.ib-model .an-b-ca{background:var(--c2)}
.ib-model .an-b-na{background:var(--c1)}.ib-model .an-b-k{background:var(--green)}
.ib-model .an-mn-fe{fill:color-mix(in srgb,var(--c0) 40%,var(--surface));stroke:var(--c0)}
.ib-model .an-mn-ca{fill:color-mix(in srgb,var(--c2) 40%,var(--surface));stroke:var(--c2)}
.ib-model .an-mn-na{fill:color-mix(in srgb,var(--c1) 50%,var(--surface));stroke:var(--c1)}
.ib-model .an-mn-k{fill:color-mix(in srgb,var(--green) 40%,var(--surface));stroke:var(--green)}
/* ══ shapes added for batch D3 (skeleton, joints, muscle, levers) ═════ */
.ib-model .an-bone{fill:color-mix(in srgb,var(--gold) 34%,var(--surface));stroke:var(--gold);stroke-width:1.6}
.ib-model .an-marrow{fill:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-capsule{fill:none;stroke:var(--c2);stroke-width:3;stroke-dasharray:6 4}
.ib-model .an-cart{fill:color-mix(in srgb,var(--c2) 46%,var(--surface));stroke:var(--c2);stroke-width:1.4}
.ib-model .an-cavity{fill:color-mix(in srgb,var(--green) 26%,var(--surface));stroke:var(--green);stroke-width:1.2}
.ib-model .an-lig{stroke:var(--c0);stroke-width:3.4;stroke-linecap:round}
.ib-model .an-bursa{fill:color-mix(in srgb,var(--green) 40%,var(--surface));stroke:var(--green);stroke-width:1.4}
.ib-model .an-jc{fill:color-mix(in srgb,var(--c2) 30%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-jcball{fill:color-mix(in srgb,var(--c2) 46%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-osteo{fill:color-mix(in srgb,var(--gold) 26%,var(--surface));stroke:var(--gold);stroke-width:2}
.ib-model .an-lam{fill:none;stroke:var(--gold);stroke-width:1.6;opacity:.75}
.ib-model .an-cartbox{fill:color-mix(in srgb,var(--c2) 20%,var(--surface));stroke:var(--c2);stroke-width:1.6}
.ib-model .an-chondro{fill:color-mix(in srgb,var(--c2) 50%,var(--surface));stroke:var(--c2);stroke-width:1.4}
.ib-model .an-tendbox{fill:color-mix(in srgb,var(--c0) 18%,var(--surface));stroke:var(--c0);stroke-width:1.6}
.ib-model .an-colla{stroke:var(--c0);stroke-width:3;stroke-linecap:round}
.ib-model .an-fib-i{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:1.7}
.ib-model .an-fib-ii{fill:color-mix(in srgb,var(--c1) 40%,var(--surface));stroke:var(--c1);stroke-width:1.7}
.ib-model .an-fib-ix{fill:color-mix(in srgb,var(--c2) 38%,var(--surface));stroke:var(--c2);stroke-width:1.7}
.ib-model .an-fib-off{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--text3);stroke-width:1.4;stroke-dasharray:4 3}
.ib-model .an-mito{fill:var(--green);opacity:.9}
.ib-model .an-mito.off{fill:color-mix(in srgb,var(--text) 22%,var(--surface));opacity:.6}
.ib-model .an-actin{stroke:var(--c2);stroke-width:2;stroke-linecap:round}
.ib-model .an-myosin{fill:color-mix(in srgb,var(--c0) 50%,var(--surface));stroke:var(--c0);stroke-width:1.4}
.ib-model .an-zline{stroke:var(--text);stroke-width:2.6;stroke-linecap:round}
.ib-model .an-arm{stroke:var(--text);stroke-width:5;stroke-linecap:round}
.ib-model .an-eff{stroke:var(--c2);stroke-width:3;stroke-linecap:round;fill:none}
.ib-model .an-load{fill:color-mix(in srgb,var(--c0) 40%,var(--surface));stroke:var(--c0);stroke-width:1.4}
.ib-model .an-effdot{fill:var(--c2)}
.ib-model .an-fulcrum2{fill:color-mix(in srgb,var(--text) 26%,var(--surface));stroke:var(--text3);stroke-width:1.2}
.ib-model .an-comdot{fill:var(--c0);stroke:var(--surface);stroke-width:2}
.ib-model .an-base{fill:color-mix(in srgb,var(--text) 24%,var(--surface))}
.ib-model .an-block{fill:color-mix(in srgb,var(--c2) 34%,var(--surface));stroke:var(--c2);stroke-width:1.8}
.ib-model .an-arrow2{stroke:var(--text);stroke-width:2.6;fill:none;stroke-linecap:round}
.ib-model .an-arc{fill:none;stroke:var(--text3);stroke-width:8;stroke-linecap:round;opacity:.45}
.ib-model .an-arcused{fill:none;stroke:var(--c0);stroke-width:8;stroke-linecap:round}
.ib-model .an-meas{stroke:var(--c2);stroke-width:1.8;stroke-dasharray:4 3}
.ib-model .an-meas2{stroke:var(--text3);stroke-width:1.4;fill:none}
.ib-model .an-bench{fill:color-mix(in srgb,var(--text) 22%,var(--surface));stroke:var(--text3);stroke-width:1.4}
.ib-model .an-l-off{background:color-mix(in srgb,var(--text) 14%,var(--surface))}
.ib-model .an-b-risk{background:var(--c0)}


/* ══ shapes added for batch D4: movement — every connection carries a signal ══ */
/* ══ movement: connectors carry a visible signal ═══════════════════════ */
.ib-model .an-conn{fill:none;stroke:var(--text3);stroke-width:2.4;stroke-linecap:round;
  stroke-dasharray:7 6;animation:an-march 1.1s linear infinite}
.ib-model .an-conn.hot{stroke:var(--c0);stroke-width:3.2}
.ib-model .an-conn.off{stroke:var(--text3);opacity:.3}
.ib-model .an-sig{fill:var(--gold);stroke:var(--surface);stroke-width:1.4}
.ib-model .an-sig.hot{fill:var(--c0)}
.ib-model .an-sig.calm{fill:var(--green)}
@keyframes an-march{to{stroke-dashoffset:-26}}
/* a heart actually beats */
.ib-model .an-heart,.ib-model .an-chamber{transform-box:fill-box;transform-origin:50% 55%;
  animation:an-pulsebeat 1.05s ease-in-out infinite}
.ib-model .an-heart.hot{animation-duration:.62s}
@keyframes an-pulsebeat{0%,100%{transform:scale(1)}12%{transform:scale(1.07)}26%{transform:scale(1)}}
/* an organ that is working shows it */
.ib-model .an-liver.hot,.ib-model .an-kidney.hot{transform-box:fill-box;transform-origin:50% 50%;
  animation:an-work 2.2s ease-in-out infinite}
@keyframes an-work{0%,100%{transform:scale(1)}50%{transform:scale(1.045)}}
/* a firing synapse */
.ib-model .an-ves{transform-box:fill-box;transform-origin:50% 50%}
@media (prefers-reduced-motion:reduce){
  .ib-model .an-conn,.ib-model .an-heart,.ib-model .an-chamber,
  .ib-model .an-liver.hot,.ib-model .an-kidney.hot,.ib-model .an-sig{animation:none!important}
}
.ib-model .an-pulm{fill:none;stroke:var(--c2);stroke-width:4.4;stroke-linecap:round}
.ib-model .an-pulvein{fill:none;stroke:var(--c2);stroke-width:3.4;stroke-linecap:round;opacity:.7}
.ib-model .an-chamber.l{fill:color-mix(in srgb,var(--c0) 72%,var(--surface))}
.ib-model .an-septum{stroke:var(--surface);stroke-width:1.8;opacity:.8}
/* the one fixed point every connection leaves from */
.ib-model .an-hub{fill:var(--c0);stroke:var(--surface);stroke-width:2.2}

/* the arrowhead that ends the return leg, so its direction is unmistakable */
.ib-model .an-arrowhead{fill:var(--green);stroke:none}

/* ══ D4: the last eleven models, plus arrowheads and the circulation ══ */
.ib-model .an-arrowhead{fill:#2e9e5b;stroke:none}
.ib-model .an-circ{fill:color-mix(in srgb,var(--c2) 16%,var(--surface));stroke:var(--c2);stroke-width:1.8;stroke-dasharray:5 4}
.ib-model .an-conn.ret-neg{stroke:#2e9e5b;stroke-width:2.6}
.ib-model .an-head{fill:var(--c0);stroke:none}
.ib-model .an-head.up{fill:#2e9e5b}
.ib-model .an-head.down{fill:#c0392b}
.ib-model .an-head.hold{fill:var(--gold,#b8860b)}
.ib-model .an-head.off{fill:var(--text3);opacity:.5}
.ib-model .an-conn.up{stroke:#2e9e5b}
.ib-model .an-conn.down{stroke:#c0392b}
.ib-model .an-conn.hold{stroke:var(--gold,#b8860b)}
.ib-model .an-water{fill:color-mix(in srgb,var(--c2) 13%,var(--surface));stroke:none}
.ib-model .an-air{fill:color-mix(in srgb,var(--c1) 7%,var(--surface));stroke:none}
.ib-model .an-body{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2.2}
.ib-model .an-ball{fill:color-mix(in srgb,var(--c0) 30%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-seam{stroke:var(--c0);stroke-width:2;stroke-dasharray:4 3;fill:none}
.ib-model .an-wedge{fill:color-mix(in srgb,var(--gold,#b8860b) 34%,transparent);stroke:var(--gold,#b8860b);stroke-width:1.4}
.ib-model .an-node{fill:var(--surface);stroke:var(--text3);stroke-width:2.2;transform-box:fill-box;transform-origin:50% 50%}
.ib-model .an-node.on{fill:var(--c0);stroke:var(--c0);animation:an-node-pulse 1.4s ease-in-out infinite}
@keyframes an-node-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.ib-model .an-tier{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--surface);stroke-width:1.6}
.ib-model .an-tier.on{fill:var(--c0)}
.ib-model .an-l-up{background:#2e9e5b}
.ib-model .an-l-down{background:#c0392b}
.ib-model .an-l-hold{background:var(--gold,#b8860b)}
.ib-model .an-l-node{background:var(--surface);border:2px solid var(--text3)}
.ib-model .an-l-nodeon{background:var(--c0);border-color:var(--c0)}
.ib-model .an-l-tier{background:color-mix(in srgb,var(--text) 10%,var(--surface));border:1px solid var(--surface)}
.ib-model .an-l-tieron{background:var(--c0)}
.ib-model .an-l-ball{background:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-b-fb{background:#2e9e5b}
.ib-model .an-b-w{background:var(--c0)}
.ib-model .an-b-drag{background:var(--gold,#b8860b)}
.ib-model .an-b-str{background:var(--green)}
.ib-model .an-b-bias{background:var(--c0)}
@media (prefers-reduced-motion:reduce){.ib-model .an-node.on{animation:none}}

/* ══ D4 part B/C classes ══ */
/* ══ D4 part B/C classes ══════════════════════════════════════════════ */
.ib-model .an-rung{fill:color-mix(in srgb,var(--text) 8%,var(--surface));stroke:var(--text3);stroke-width:1.4}
.ib-model .an-rung.on{fill:color-mix(in srgb,var(--c0) 34%,var(--surface));stroke:var(--c0)}
.ib-model .an-l-rung{background:color-mix(in srgb,var(--text) 8%,var(--surface))}
.ib-model .an-l-rungon{background:var(--c0)}
.ib-model .an-barrier{fill:color-mix(in srgb,var(--c0) 12%,var(--surface));stroke:var(--c0);stroke-width:1.2;stroke-dasharray:4 3}
.ib-model .an-risk{opacity:.3}
.ib-model .an-risk.i{fill:var(--c2)}
.ib-model .an-risk.e{fill:var(--gold,#b8860b)}
.ib-model .an-overlap{fill:var(--c0);opacity:.62;transform-box:fill-box;transform-origin:50% 50%;
  animation:an-over 2.1s ease-in-out infinite}
@keyframes an-over{0%,100%{opacity:.5}50%{opacity:.78}}
.ib-model .an-l-ri{background:var(--c2)}
.ib-model .an-l-re{background:var(--gold,#b8860b)}
.ib-model .an-l-risky{background:var(--c0)}
.ib-model .an-b-risk{background:var(--c0)}
.ib-model .an-loadbar{fill:var(--c2)}
.ib-model .an-loadbar.over{fill:var(--c0)}
.ib-model .an-beat.over{fill:none;stroke:var(--c0);stroke-width:2;
  animation:an-ring 1.5s ease-out infinite}
@keyframes an-ring{0%{opacity:.9}100%{opacity:0}}
.ib-model .an-grid{stroke:var(--border);stroke-width:.8}
.ib-model .an-l-safe{background:var(--green)}
.ib-model .an-l-unsafe{background:var(--c0)}
.ib-model .an-b-over{background:var(--c0)}
.ib-model .an-tend{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-lig{fill:color-mix(in srgb,var(--c2) 40%,var(--surface));stroke:var(--c2);stroke-width:2.2}
.ib-model .an-recbar{fill:color-mix(in srgb,var(--text) 12%,var(--surface))}
.ib-model .an-recbar.on{fill:var(--c0)}
.ib-model .an-b-tol{background:var(--c0)}
.ib-model .an-b-rec{background:var(--c2)}
.ib-model .an-layer{fill:color-mix(in srgb,var(--text) 9%,var(--surface));stroke:var(--text3);stroke-width:1.2}
.ib-model .an-layer.on{fill:var(--c0);stroke:var(--c0)}
.ib-model .an-riskbar{fill:var(--border)}
.ib-model .an-riskfill{fill:var(--c0);transition:y .3s ease,height .3s ease}
.ib-model .an-b-left{background:var(--c0)}
.ib-model .an-letter{fill:color-mix(in srgb,var(--text) 9%,var(--surface));stroke:var(--text3);stroke-width:1.4}
.ib-model .an-letter.on{fill:var(--c0);stroke:var(--c0)}
.ib-model .an-phase{opacity:.55}
.ib-model .an-curve{fill:none;stroke:var(--c2);stroke-width:2.6;stroke-linecap:round}
.ib-model .an-b-str{background:var(--c2)}
.ib-model .an-step{fill:color-mix(in srgb,var(--text) 8%,var(--surface));stroke:var(--text3);stroke-width:1.4}
.ib-model .an-step.on{fill:color-mix(in srgb,var(--c0) 34%,var(--surface));stroke:var(--c0)}
.ib-model .an-gate{stroke:var(--c0);stroke-width:3.4;stroke-linecap:round}
.ib-model .an-gate.open{stroke:var(--green)}
@media (prefers-reduced-motion:reduce){.ib-model .an-overlap,.ib-model .an-beat.over{animation:none}}

/* ══ D4: the last eleven models, plus arrowheads and the circulation ══ */
.ib-model .an-arrowhead{fill:#2e9e5b;stroke:none}
.ib-model .an-circ{fill:color-mix(in srgb,var(--c2) 16%,var(--surface));stroke:var(--c2);stroke-width:1.8;stroke-dasharray:5 4}
.ib-model .an-conn.ret-neg{stroke:#2e9e5b;stroke-width:2.6}
.ib-model .an-head{fill:var(--c0);stroke:none}
.ib-model .an-head.up{fill:#2e9e5b}
.ib-model .an-head.down{fill:#c0392b}
.ib-model .an-head.hold{fill:var(--gold,#b8860b)}
.ib-model .an-head.off{fill:var(--text3);opacity:.5}
.ib-model .an-conn.up{stroke:#2e9e5b}
.ib-model .an-conn.down{stroke:#c0392b}
.ib-model .an-conn.hold{stroke:var(--gold,#b8860b)}
.ib-model .an-water{fill:color-mix(in srgb,var(--c2) 13%,var(--surface));stroke:none}
.ib-model .an-air{fill:color-mix(in srgb,var(--c1) 7%,var(--surface));stroke:none}
.ib-model .an-body{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2.2}
.ib-model .an-ball{fill:color-mix(in srgb,var(--c0) 30%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-seam{stroke:var(--c0);stroke-width:2;stroke-dasharray:4 3;fill:none}
.ib-model .an-wedge{fill:color-mix(in srgb,var(--gold,#b8860b) 34%,transparent);stroke:var(--gold,#b8860b);stroke-width:1.4}
.ib-model .an-node{fill:var(--surface);stroke:var(--text3);stroke-width:2.2;transform-box:fill-box;transform-origin:50% 50%}
.ib-model .an-node.on{fill:var(--c0);stroke:var(--c0);animation:an-node-pulse 1.4s ease-in-out infinite}
@keyframes an-node-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.ib-model .an-tier{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--surface);stroke-width:1.6}
.ib-model .an-tier.on{fill:var(--c0)}
.ib-model .an-l-up{background:#2e9e5b}
.ib-model .an-l-down{background:#c0392b}
.ib-model .an-l-hold{background:var(--gold,#b8860b)}
.ib-model .an-l-node{background:var(--surface);border:2px solid var(--text3)}
.ib-model .an-l-nodeon{background:var(--c0);border-color:var(--c0)}
.ib-model .an-l-tier{background:color-mix(in srgb,var(--text) 10%,var(--surface));border:1px solid var(--surface)}
.ib-model .an-l-tieron{background:var(--c0)}
.ib-model .an-l-ball{background:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-b-fb{background:#2e9e5b}
.ib-model .an-b-w{background:var(--c0)}
.ib-model .an-b-drag{background:var(--gold,#b8860b)}
.ib-model .an-b-str{background:var(--green)}
.ib-model .an-b-bias{background:var(--c0)}
@media (prefers-reduced-motion:reduce){.ib-model .an-node.on{animation:none}}
/* every model label gets a surface-coloured halo, so even a tight label stays
   readable where it passes a shape edge instead of dissolving into it */
.ib-model svg text{ paint-order:stroke; stroke:var(--surface); stroke-width:2.6px; stroke-linejoin:round }

/* ══ D4: the last eleven models, plus arrowheads and the circulation ══ */
.ib-model .an-arrowhead{fill:#2e9e5b;stroke:none}
.ib-model .an-circ{fill:color-mix(in srgb,var(--c2) 16%,var(--surface));stroke:var(--c2);stroke-width:1.8;stroke-dasharray:5 4}
.ib-model .an-conn.ret-neg{stroke:#2e9e5b;stroke-width:2.6}
.ib-model .an-head{fill:var(--c0);stroke:none}
.ib-model .an-head.up{fill:#2e9e5b}
.ib-model .an-head.down{fill:#c0392b}
.ib-model .an-head.hold{fill:var(--gold,#b8860b)}
.ib-model .an-head.off{fill:var(--text3);opacity:.5}
.ib-model .an-conn.up{stroke:#2e9e5b}
.ib-model .an-conn.down{stroke:#c0392b}
.ib-model .an-conn.hold{stroke:var(--gold,#b8860b)}
.ib-model .an-water{fill:color-mix(in srgb,var(--c2) 13%,var(--surface));stroke:none}
.ib-model .an-air{fill:color-mix(in srgb,var(--c1) 7%,var(--surface));stroke:none}
.ib-model .an-body{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2.2}
.ib-model .an-ball{fill:color-mix(in srgb,var(--c0) 30%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-seam{stroke:var(--c0);stroke-width:2;stroke-dasharray:4 3;fill:none}
.ib-model .an-wedge{fill:color-mix(in srgb,var(--gold,#b8860b) 34%,transparent);stroke:var(--gold,#b8860b);stroke-width:1.4}
.ib-model .an-node{fill:var(--surface);stroke:var(--text3);stroke-width:2.2;transform-box:fill-box;transform-origin:50% 50%}
.ib-model .an-node.on{fill:var(--c0);stroke:var(--c0);animation:an-node-pulse 1.4s ease-in-out infinite}
@keyframes an-node-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.ib-model .an-tier{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--surface);stroke-width:1.6}
.ib-model .an-tier.on{fill:var(--c0)}
.ib-model .an-l-up{background:#2e9e5b}
.ib-model .an-l-down{background:#c0392b}
.ib-model .an-l-hold{background:var(--gold,#b8860b)}
.ib-model .an-l-node{background:var(--surface);border:2px solid var(--text3)}
.ib-model .an-l-nodeon{background:var(--c0);border-color:var(--c0)}
.ib-model .an-l-tier{background:color-mix(in srgb,var(--text) 10%,var(--surface));border:1px solid var(--surface)}
.ib-model .an-l-tieron{background:var(--c0)}
.ib-model .an-l-ball{background:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-b-fb{background:#2e9e5b}
.ib-model .an-b-w{background:var(--c0)}
.ib-model .an-b-drag{background:var(--gold,#b8860b)}
.ib-model .an-b-str{background:var(--green)}
.ib-model .an-b-bias{background:var(--c0)}
@media (prefers-reduced-motion:reduce){.ib-model .an-node.on{animation:none}}
/* every model label gets a surface-coloured halo, so even a tight label stays
   readable where it passes a shape edge instead of dissolving into it */
.ib-model svg text{ paint-order:stroke; stroke:var(--surface); stroke-width:2.6px; stroke-linejoin:round }
/* the generic sweep: every plain connector line marches so its direction reads */
.ib-model .an-walk{fill:none;stroke-dasharray:6 6;animation:an-march 1.25s linear infinite}
.ib-model .kv-cursor{animation:an-cursor-blink 1.8s ease-in-out infinite}
@keyframes an-cursor-blink{0%,100%{opacity:1}50%{opacity:.6}}
@media (prefers-reduced-motion:reduce){.ib-model .an-walk,.ib-model .kv-cursor{animation:none}}

/* ══ D4: the last eleven models, plus arrowheads and the circulation ══ */
.ib-model .an-arrowhead{fill:#2e9e5b;stroke:none}
.ib-model .an-circ{fill:color-mix(in srgb,var(--c2) 16%,var(--surface));stroke:var(--c2);stroke-width:1.8;stroke-dasharray:5 4}
.ib-model .an-conn.ret-neg{stroke:#2e9e5b;stroke-width:2.6}
.ib-model .an-head{fill:var(--c0);stroke:none}
.ib-model .an-head.up{fill:#2e9e5b}
.ib-model .an-head.down{fill:#c0392b}
.ib-model .an-head.hold{fill:var(--gold,#b8860b)}
.ib-model .an-head.off{fill:var(--text3);opacity:.5}
.ib-model .an-conn.up{stroke:#2e9e5b}
.ib-model .an-conn.down{stroke:#c0392b}
.ib-model .an-conn.hold{stroke:var(--gold,#b8860b)}
.ib-model .an-water{fill:color-mix(in srgb,var(--c2) 13%,var(--surface));stroke:none}
.ib-model .an-air{fill:color-mix(in srgb,var(--c1) 7%,var(--surface));stroke:none}
.ib-model .an-body{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2.2}
.ib-model .an-ball{fill:color-mix(in srgb,var(--c0) 30%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-seam{stroke:var(--c0);stroke-width:2;stroke-dasharray:4 3;fill:none}
.ib-model .an-wedge{fill:color-mix(in srgb,var(--gold,#b8860b) 34%,transparent);stroke:var(--gold,#b8860b);stroke-width:1.4}
.ib-model .an-node{fill:var(--surface);stroke:var(--text3);stroke-width:2.2;transform-box:fill-box;transform-origin:50% 50%}
.ib-model .an-node.on{fill:var(--c0);stroke:var(--c0);animation:an-node-pulse 1.4s ease-in-out infinite}
@keyframes an-node-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.ib-model .an-tier{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--surface);stroke-width:1.6}
.ib-model .an-tier.on{fill:var(--c0)}
.ib-model .an-l-up{background:#2e9e5b}
.ib-model .an-l-down{background:#c0392b}
.ib-model .an-l-hold{background:var(--gold,#b8860b)}
.ib-model .an-l-node{background:var(--surface);border:2px solid var(--text3)}
.ib-model .an-l-nodeon{background:var(--c0);border-color:var(--c0)}
.ib-model .an-l-tier{background:color-mix(in srgb,var(--text) 10%,var(--surface));border:1px solid var(--surface)}
.ib-model .an-l-tieron{background:var(--c0)}
.ib-model .an-l-ball{background:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-b-fb{background:#2e9e5b}
.ib-model .an-b-w{background:var(--c0)}
.ib-model .an-b-drag{background:var(--gold,#b8860b)}
.ib-model .an-b-str{background:var(--green)}
.ib-model .an-b-bias{background:var(--c0)}
@media (prefers-reduced-motion:reduce){.ib-model .an-node.on{animation:none}}
/* every model label gets a surface-coloured halo, so even a tight label stays
   readable where it passes a shape edge instead of dissolving into it */
.ib-model svg text{ paint-order:stroke; stroke:var(--surface); stroke-width:2.6px; stroke-linejoin:round }
/* the generic sweep: every plain connector line marches so its direction reads */
.ib-model .an-walk{fill:none;stroke-dasharray:6 6;animation:an-march 1.25s linear infinite}
.ib-model .kv-cursor{animation:an-cursor-blink 1.8s ease-in-out infinite}
@keyframes an-cursor-blink{0%,100%{opacity:1}50%{opacity:.6}}
@media (prefers-reduced-motion:reduce){.ib-model .an-walk,.ib-model .kv-cursor{animation:none}}
.ib-model .an-meas2.capline{stroke:var(--c0);stroke-width:2.2;stroke-dasharray:8 5}

/* ══ D4: the last eleven models, plus arrowheads and the circulation ══ */
.ib-model .an-arrowhead{fill:#2e9e5b;stroke:none}
.ib-model .an-circ{fill:color-mix(in srgb,var(--c2) 16%,var(--surface));stroke:var(--c2);stroke-width:1.8;stroke-dasharray:5 4}
.ib-model .an-conn.ret-neg{stroke:#2e9e5b;stroke-width:2.6}
.ib-model .an-head{fill:var(--c0);stroke:none}
.ib-model .an-head.up{fill:#2e9e5b}
.ib-model .an-head.down{fill:#c0392b}
.ib-model .an-head.hold{fill:var(--gold,#b8860b)}
.ib-model .an-head.off{fill:var(--text3);opacity:.5}
.ib-model .an-conn.up{stroke:#2e9e5b}
.ib-model .an-conn.down{stroke:#c0392b}
.ib-model .an-conn.hold{stroke:var(--gold,#b8860b)}
.ib-model .an-water{fill:color-mix(in srgb,var(--c2) 13%,var(--surface));stroke:none}
.ib-model .an-air{fill:color-mix(in srgb,var(--c1) 7%,var(--surface));stroke:none}
.ib-model .an-body{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2.2}
.ib-model .an-ball{fill:color-mix(in srgb,var(--c0) 30%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-seam{stroke:var(--c0);stroke-width:2;stroke-dasharray:4 3;fill:none}
.ib-model .an-wedge{fill:color-mix(in srgb,var(--gold,#b8860b) 34%,transparent);stroke:var(--gold,#b8860b);stroke-width:1.4}
.ib-model .an-node{fill:var(--surface);stroke:var(--text3);stroke-width:2.2;transform-box:fill-box;transform-origin:50% 50%}
.ib-model .an-node.on{fill:var(--c0);stroke:var(--c0);animation:an-node-pulse 1.4s ease-in-out infinite}
@keyframes an-node-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.ib-model .an-tier{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--surface);stroke-width:1.6}
.ib-model .an-tier.on{fill:var(--c0)}
.ib-model .an-l-up{background:#2e9e5b}
.ib-model .an-l-down{background:#c0392b}
.ib-model .an-l-hold{background:var(--gold,#b8860b)}
.ib-model .an-l-node{background:var(--surface);border:2px solid var(--text3)}
.ib-model .an-l-nodeon{background:var(--c0);border-color:var(--c0)}
.ib-model .an-l-tier{background:color-mix(in srgb,var(--text) 10%,var(--surface));border:1px solid var(--surface)}
.ib-model .an-l-tieron{background:var(--c0)}
.ib-model .an-l-ball{background:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-b-fb{background:#2e9e5b}
.ib-model .an-b-w{background:var(--c0)}
.ib-model .an-b-drag{background:var(--gold,#b8860b)}
.ib-model .an-b-str{background:var(--green)}
.ib-model .an-b-bias{background:var(--c0)}
@media (prefers-reduced-motion:reduce){.ib-model .an-node.on{animation:none}}
/* every model label gets a surface-coloured halo, so even a tight label stays
   readable where it passes a shape edge instead of dissolving into it */
.ib-model svg text{ paint-order:stroke; stroke:var(--surface); stroke-width:2.6px; stroke-linejoin:round }
/* the generic sweep: every plain connector line marches so its direction reads */
.ib-model .an-walk{fill:none;stroke-dasharray:6 6;animation:an-march 1.25s linear infinite}
.ib-model .kv-cursor{animation:an-cursor-blink 1.8s ease-in-out infinite}
@keyframes an-cursor-blink{0%,100%{opacity:1}50%{opacity:.6}}
@media (prefers-reduced-motion:reduce){.ib-model .an-walk,.ib-model .kv-cursor{animation:none}}
.ib-model .an-meas2.capline{stroke:var(--c0);stroke-width:2.2;stroke-dasharray:8 5}
/* a short leader line, so a label standing off from its shape is not floating */
.ib-model .an-lead{fill:none;stroke:var(--text3);stroke-width:1.2;stroke-dasharray:2 2;opacity:.75}

/* ══ D4: the last eleven models, plus arrowheads and the circulation ══ */
.ib-model .an-arrowhead{fill:#2e9e5b;stroke:none}
.ib-model .an-circ{fill:color-mix(in srgb,var(--c2) 16%,var(--surface));stroke:var(--c2);stroke-width:1.8;stroke-dasharray:5 4}
.ib-model .an-conn.ret-neg{stroke:#2e9e5b;stroke-width:2.6}
.ib-model .an-head{fill:var(--c0);stroke:none}
.ib-model .an-head.up{fill:#2e9e5b}
.ib-model .an-head.down{fill:#c0392b}
.ib-model .an-head.hold{fill:var(--gold,#b8860b)}
.ib-model .an-head.off{fill:var(--text3);opacity:.5}
.ib-model .an-conn.up{stroke:#2e9e5b}
.ib-model .an-conn.down{stroke:#c0392b}
.ib-model .an-conn.hold{stroke:var(--gold,#b8860b)}
.ib-model .an-water{fill:color-mix(in srgb,var(--c2) 13%,var(--surface));stroke:none}
.ib-model .an-air{fill:color-mix(in srgb,var(--c1) 7%,var(--surface));stroke:none}
.ib-model .an-body{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2.2}
.ib-model .an-ball{fill:color-mix(in srgb,var(--c0) 30%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-seam{stroke:var(--c0);stroke-width:2;stroke-dasharray:4 3;fill:none}
.ib-model .an-wedge{fill:color-mix(in srgb,var(--gold,#b8860b) 34%,transparent);stroke:var(--gold,#b8860b);stroke-width:1.4}
.ib-model .an-node{fill:var(--surface);stroke:var(--text3);stroke-width:2.2;transform-box:fill-box;transform-origin:50% 50%}
.ib-model .an-node.on{fill:var(--c0);stroke:var(--c0);animation:an-node-pulse 1.4s ease-in-out infinite}
@keyframes an-node-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.ib-model .an-tier{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--surface);stroke-width:1.6}
.ib-model .an-tier.on{fill:var(--c0)}
.ib-model .an-l-up{background:#2e9e5b}
.ib-model .an-l-down{background:#c0392b}
.ib-model .an-l-hold{background:var(--gold,#b8860b)}
.ib-model .an-l-node{background:var(--surface);border:2px solid var(--text3)}
.ib-model .an-l-nodeon{background:var(--c0);border-color:var(--c0)}
.ib-model .an-l-tier{background:color-mix(in srgb,var(--text) 10%,var(--surface));border:1px solid var(--surface)}
.ib-model .an-l-tieron{background:var(--c0)}
.ib-model .an-l-ball{background:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-b-fb{background:#2e9e5b}
.ib-model .an-b-w{background:var(--c0)}
.ib-model .an-b-drag{background:var(--gold,#b8860b)}
.ib-model .an-b-str{background:var(--green)}
.ib-model .an-b-bias{background:var(--c0)}
@media (prefers-reduced-motion:reduce){.ib-model .an-node.on{animation:none}}
/* every model label gets a surface-coloured halo, so even a tight label stays
   readable where it passes a shape edge instead of dissolving into it */
.ib-model svg text{ paint-order:stroke; stroke:var(--surface); stroke-width:2.6px; stroke-linejoin:round }
/* the generic sweep: every plain connector line marches so its direction reads */
.ib-model .an-walk{fill:none;stroke-dasharray:6 6;animation:an-march 1.25s linear infinite}
.ib-model .kv-cursor{animation:an-cursor-blink 1.8s ease-in-out infinite}
@keyframes an-cursor-blink{0%,100%{opacity:1}50%{opacity:.6}}
@media (prefers-reduced-motion:reduce){.ib-model .an-walk,.ib-model .kv-cursor{animation:none}}
.ib-model .an-meas2.capline{stroke:var(--c0);stroke-width:2.2;stroke-dasharray:8 5}
/* a short leader line, so a label standing off from its shape is not floating */
.ib-model .an-lead{fill:none;stroke:var(--text3);stroke-width:1.2;stroke-dasharray:2 2;opacity:.75}
.ib-model .an-l-gold{background:var(--gold,#b8860b)}
.ib-model .an-l-red{background:var(--c0)}

/* ══ D4: the last eleven models, plus arrowheads and the circulation ══ */
.ib-model .an-arrowhead{fill:#2e9e5b;stroke:none}
.ib-model .an-circ{fill:color-mix(in srgb,var(--c2) 16%,var(--surface));stroke:var(--c2);stroke-width:1.8;stroke-dasharray:5 4}
.ib-model .an-conn.ret-neg{stroke:#2e9e5b;stroke-width:2.6}
.ib-model .an-head{fill:var(--c0);stroke:none}
.ib-model .an-head.up{fill:#2e9e5b}
.ib-model .an-head.down{fill:#c0392b}
.ib-model .an-head.hold{fill:var(--gold,#b8860b)}
.ib-model .an-head.off{fill:var(--text3);opacity:.5}
.ib-model .an-conn.up{stroke:#2e9e5b}
.ib-model .an-conn.down{stroke:#c0392b}
.ib-model .an-conn.hold{stroke:var(--gold,#b8860b)}
.ib-model .an-water{fill:color-mix(in srgb,var(--c2) 13%,var(--surface));stroke:none}
.ib-model .an-air{fill:color-mix(in srgb,var(--c1) 7%,var(--surface));stroke:none}
.ib-model .an-body{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2.2}
.ib-model .an-ball{fill:color-mix(in srgb,var(--c0) 30%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-seam{stroke:var(--c0);stroke-width:2;stroke-dasharray:4 3;fill:none}
.ib-model .an-wedge{fill:color-mix(in srgb,var(--gold,#b8860b) 34%,transparent);stroke:var(--gold,#b8860b);stroke-width:1.4}
.ib-model .an-node{fill:var(--surface);stroke:var(--text3);stroke-width:2.2;transform-box:fill-box;transform-origin:50% 50%}
.ib-model .an-node.on{fill:var(--c0);stroke:var(--c0);animation:an-node-pulse 1.4s ease-in-out infinite}
@keyframes an-node-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.ib-model .an-tier{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--surface);stroke-width:1.6}
.ib-model .an-tier.on{fill:var(--c0)}
.ib-model .an-l-up{background:#2e9e5b}
.ib-model .an-l-down{background:#c0392b}
.ib-model .an-l-hold{background:var(--gold,#b8860b)}
.ib-model .an-l-node{background:var(--surface);border:2px solid var(--text3)}
.ib-model .an-l-nodeon{background:var(--c0);border-color:var(--c0)}
.ib-model .an-l-tier{background:color-mix(in srgb,var(--text) 10%,var(--surface));border:1px solid var(--surface)}
.ib-model .an-l-tieron{background:var(--c0)}
.ib-model .an-l-ball{background:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-b-fb{background:#2e9e5b}
.ib-model .an-b-w{background:var(--c0)}
.ib-model .an-b-drag{background:var(--gold,#b8860b)}
.ib-model .an-b-str{background:var(--green)}
.ib-model .an-b-bias{background:var(--c0)}
@media (prefers-reduced-motion:reduce){.ib-model .an-node.on{animation:none}}
/* every model label gets a surface-coloured halo, so even a tight label stays
   readable where it passes a shape edge instead of dissolving into it */
.ib-model svg text{ paint-order:stroke; stroke:var(--surface); stroke-width:2.6px; stroke-linejoin:round }
/* the generic sweep: every plain connector line marches so its direction reads */
.ib-model .an-walk{fill:none;stroke-dasharray:6 6;animation:an-march 1.25s linear infinite}
.ib-model .kv-cursor{animation:an-cursor-blink 1.8s ease-in-out infinite}
@keyframes an-cursor-blink{0%,100%{opacity:1}50%{opacity:.6}}
@media (prefers-reduced-motion:reduce){.ib-model .an-walk,.ib-model .kv-cursor{animation:none}}
.ib-model .an-meas2.capline{stroke:var(--c0);stroke-width:2.2;stroke-dasharray:8 5}
/* a short leader line, so a label standing off from its shape is not floating */
.ib-model .an-lead{fill:none;stroke:var(--text3);stroke-width:1.2;stroke-dasharray:2 2;opacity:.75}
.ib-model .an-l-gold{background:var(--gold,#b8860b)}
.ib-model .an-l-red{background:var(--c0)}
/* the main shape in a drawing breathes, so a still figure still reads as alive */
.ib-model .an-livepulse{transform-box:fill-box;transform-origin:50% 50%;
  animation:an-breathe 3.4s ease-in-out infinite}
@keyframes an-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.03)}}
@media (prefers-reduced-motion:reduce){.ib-model .an-livepulse{animation:none}}

/* ══ D4: the last eleven models, plus arrowheads and the circulation ══ */
.ib-model .an-arrowhead{fill:#2e9e5b;stroke:none}
.ib-model .an-circ{fill:color-mix(in srgb,var(--c2) 16%,var(--surface));stroke:var(--c2);stroke-width:1.8;stroke-dasharray:5 4}
.ib-model .an-conn.ret-neg{stroke:#2e9e5b;stroke-width:2.6}
.ib-model .an-head{fill:var(--c0);stroke:none}
.ib-model .an-head.up{fill:#2e9e5b}
.ib-model .an-head.down{fill:#c0392b}
.ib-model .an-head.hold{fill:var(--gold,#b8860b)}
.ib-model .an-head.off{fill:var(--text3);opacity:.5}
.ib-model .an-conn.up{stroke:#2e9e5b}
.ib-model .an-conn.down{stroke:#c0392b}
.ib-model .an-conn.hold{stroke:var(--gold,#b8860b)}
.ib-model .an-water{fill:color-mix(in srgb,var(--c2) 13%,var(--surface));stroke:none}
.ib-model .an-air{fill:color-mix(in srgb,var(--c1) 7%,var(--surface));stroke:none}
.ib-model .an-body{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2.2}
.ib-model .an-ball{fill:color-mix(in srgb,var(--c0) 30%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-seam{stroke:var(--c0);stroke-width:2;stroke-dasharray:4 3;fill:none}
.ib-model .an-wedge{fill:color-mix(in srgb,var(--gold,#b8860b) 34%,transparent);stroke:var(--gold,#b8860b);stroke-width:1.4}
.ib-model .an-node{fill:var(--surface);stroke:var(--text3);stroke-width:2.2;transform-box:fill-box;transform-origin:50% 50%}
.ib-model .an-node.on{fill:var(--c0);stroke:var(--c0);animation:an-node-pulse 1.4s ease-in-out infinite}
@keyframes an-node-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.ib-model .an-tier{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--surface);stroke-width:1.6}
.ib-model .an-tier.on{fill:var(--c0)}
.ib-model .an-l-up{background:#2e9e5b}
.ib-model .an-l-down{background:#c0392b}
.ib-model .an-l-hold{background:var(--gold,#b8860b)}
.ib-model .an-l-node{background:var(--surface);border:2px solid var(--text3)}
.ib-model .an-l-nodeon{background:var(--c0);border-color:var(--c0)}
.ib-model .an-l-tier{background:color-mix(in srgb,var(--text) 10%,var(--surface));border:1px solid var(--surface)}
.ib-model .an-l-tieron{background:var(--c0)}
.ib-model .an-l-ball{background:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-b-fb{background:#2e9e5b}
.ib-model .an-b-w{background:var(--c0)}
.ib-model .an-b-drag{background:var(--gold,#b8860b)}
.ib-model .an-b-str{background:var(--green)}
.ib-model .an-b-bias{background:var(--c0)}
@media (prefers-reduced-motion:reduce){.ib-model .an-node.on{animation:none}}
/* every model label gets a surface-coloured halo, so even a tight label stays
   readable where it passes a shape edge instead of dissolving into it */
.ib-model svg text{ paint-order:stroke; stroke:var(--surface); stroke-width:2.6px; stroke-linejoin:round }
/* the generic sweep: every plain connector line marches so its direction reads */
.ib-model .an-walk{fill:none;stroke-dasharray:6 6;animation:an-march 1.25s linear infinite}
.ib-model .kv-cursor{animation:an-cursor-blink 1.8s ease-in-out infinite}
@keyframes an-cursor-blink{0%,100%{opacity:1}50%{opacity:.6}}
@media (prefers-reduced-motion:reduce){.ib-model .an-walk,.ib-model .kv-cursor{animation:none}}
.ib-model .an-meas2.capline{stroke:var(--c0);stroke-width:2.2;stroke-dasharray:8 5}
/* a short leader line, so a label standing off from its shape is not floating */
.ib-model .an-lead{fill:none;stroke:var(--text3);stroke-width:1.2;stroke-dasharray:2 2;opacity:.75}
.ib-model .an-l-gold{background:var(--gold,#b8860b)}
.ib-model .an-l-red{background:var(--c0)}
/* the main shape in a drawing breathes, so a still figure still reads as alive */
.ib-model .an-livepulse{transform-box:fill-box;transform-origin:50% 50%;
  animation:an-breathe 3.4s ease-in-out infinite}
@keyframes an-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.03)}}
@media (prefers-reduced-motion:reduce){.ib-model .an-livepulse{animation:none}}
.ib-model .an-glass{fill:color-mix(in srgb,var(--c2) 30%,var(--surface));stroke:var(--c2);stroke-width:1.8}
.ib-model .an-foodbar{fill:#d7a829;stroke:#a97f14;stroke-width:1.4}
.ib-model .an-b-in{background:var(--green)}
.ib-model .an-b-out{background:var(--c0)}
.ib-model .an-horm.off{fill:var(--text3);opacity:.4}

/* ══ D4: the last eleven models, plus arrowheads and the circulation ══ */
.ib-model .an-arrowhead{fill:#2e9e5b;stroke:none}
.ib-model .an-circ{fill:color-mix(in srgb,var(--c2) 16%,var(--surface));stroke:var(--c2);stroke-width:1.8;stroke-dasharray:5 4}
.ib-model .an-conn.ret-neg{stroke:#2e9e5b;stroke-width:2.6}
.ib-model .an-head{fill:var(--c0);stroke:none}
.ib-model .an-head.up{fill:#2e9e5b}
.ib-model .an-head.down{fill:#c0392b}
.ib-model .an-head.hold{fill:var(--gold,#b8860b)}
.ib-model .an-head.off{fill:var(--text3);opacity:.5}
.ib-model .an-conn.up{stroke:#2e9e5b}
.ib-model .an-conn.down{stroke:#c0392b}
.ib-model .an-conn.hold{stroke:var(--gold,#b8860b)}
.ib-model .an-water{fill:color-mix(in srgb,var(--c2) 13%,var(--surface));stroke:none}
.ib-model .an-air{fill:color-mix(in srgb,var(--c1) 7%,var(--surface));stroke:none}
.ib-model .an-body{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2.2}
.ib-model .an-ball{fill:color-mix(in srgb,var(--c0) 30%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-seam{stroke:var(--c0);stroke-width:2;stroke-dasharray:4 3;fill:none}
.ib-model .an-wedge{fill:color-mix(in srgb,var(--gold,#b8860b) 34%,transparent);stroke:var(--gold,#b8860b);stroke-width:1.4}
.ib-model .an-node{fill:var(--surface);stroke:var(--text3);stroke-width:2.2;transform-box:fill-box;transform-origin:50% 50%}
.ib-model .an-node.on{fill:var(--c0);stroke:var(--c0);animation:an-node-pulse 1.4s ease-in-out infinite}
@keyframes an-node-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.ib-model .an-tier{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--surface);stroke-width:1.6}
.ib-model .an-tier.on{fill:var(--c0)}
.ib-model .an-l-up{background:#2e9e5b}
.ib-model .an-l-down{background:#c0392b}
.ib-model .an-l-hold{background:var(--gold,#b8860b)}
.ib-model .an-l-node{background:var(--surface);border:2px solid var(--text3)}
.ib-model .an-l-nodeon{background:var(--c0);border-color:var(--c0)}
.ib-model .an-l-tier{background:color-mix(in srgb,var(--text) 10%,var(--surface));border:1px solid var(--surface)}
.ib-model .an-l-tieron{background:var(--c0)}
.ib-model .an-l-ball{background:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-b-fb{background:#2e9e5b}
.ib-model .an-b-w{background:var(--c0)}
.ib-model .an-b-drag{background:var(--gold,#b8860b)}
.ib-model .an-b-str{background:var(--green)}
.ib-model .an-b-bias{background:var(--c0)}
@media (prefers-reduced-motion:reduce){.ib-model .an-node.on{animation:none}}
/* every model label gets a surface-coloured halo, so even a tight label stays
   readable where it passes a shape edge instead of dissolving into it */
.ib-model svg text{ paint-order:stroke; stroke:var(--surface); stroke-width:2.6px; stroke-linejoin:round }
/* the generic sweep: every plain connector line marches so its direction reads */
.ib-model .an-walk{fill:none;stroke-dasharray:6 6;animation:an-march 1.25s linear infinite}
.ib-model .kv-cursor{animation:an-cursor-blink 1.8s ease-in-out infinite}
@keyframes an-cursor-blink{0%,100%{opacity:1}50%{opacity:.6}}
@media (prefers-reduced-motion:reduce){.ib-model .an-walk,.ib-model .kv-cursor{animation:none}}
.ib-model .an-meas2.capline{stroke:var(--c0);stroke-width:2.2;stroke-dasharray:8 5}
/* a short leader line, so a label standing off from its shape is not floating */
.ib-model .an-lead{fill:none;stroke:var(--text3);stroke-width:1.2;stroke-dasharray:2 2;opacity:.75}
.ib-model .an-l-gold{background:var(--gold,#b8860b)}
.ib-model .an-l-red{background:var(--c0)}
/* the main shape in a drawing breathes, so a still figure still reads as alive */
.ib-model .an-livepulse{transform-box:fill-box;transform-origin:50% 50%;
  animation:an-breathe 3.4s ease-in-out infinite}
@keyframes an-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.03)}}
@media (prefers-reduced-motion:reduce){.ib-model .an-livepulse{animation:none}}
.ib-model .an-glass{fill:color-mix(in srgb,var(--c2) 30%,var(--surface));stroke:var(--c2);stroke-width:1.8}
.ib-model .an-foodbar{fill:#d7a829;stroke:#a97f14;stroke-width:1.4}
.ib-model .an-b-in{background:var(--green)}
.ib-model .an-b-out{background:var(--c0)}
.ib-model .an-horm.off{fill:var(--text3);opacity:.4}
.ib-model .an-quad{stroke:none}
.ib-model .an-quad.good{fill:color-mix(in srgb,var(--green) 12%,transparent)}
.ib-model .an-quad.warn{fill:color-mix(in srgb,var(--gold,#b8860b) 10%,transparent)}
.ib-model .an-quad.bad{fill:color-mix(in srgb,var(--c0) 11%,transparent)}
.ib-model .an-lab-ok{fill:#2e9e5b}
.ib-model .an-lab-bad{fill:#c0392b}

/* ══ D4: the last eleven models, plus arrowheads and the circulation ══ */
.ib-model .an-arrowhead{fill:#2e9e5b;stroke:none}
.ib-model .an-circ{fill:color-mix(in srgb,var(--c2) 16%,var(--surface));stroke:var(--c2);stroke-width:1.8;stroke-dasharray:5 4}
.ib-model .an-conn.ret-neg{stroke:#2e9e5b;stroke-width:2.6}
.ib-model .an-head{fill:var(--c0);stroke:none}
.ib-model .an-head.up{fill:#2e9e5b}
.ib-model .an-head.down{fill:#c0392b}
.ib-model .an-head.hold{fill:var(--gold,#b8860b)}
.ib-model .an-head.off{fill:var(--text3);opacity:.5}
.ib-model .an-conn.up{stroke:#2e9e5b}
.ib-model .an-conn.down{stroke:#c0392b}
.ib-model .an-conn.hold{stroke:var(--gold,#b8860b)}
.ib-model .an-water{fill:color-mix(in srgb,var(--c2) 13%,var(--surface));stroke:none}
.ib-model .an-air{fill:color-mix(in srgb,var(--c1) 7%,var(--surface));stroke:none}
.ib-model .an-body{fill:color-mix(in srgb,var(--c0) 26%,var(--surface));stroke:var(--c0);stroke-width:2.2}
.ib-model .an-ball{fill:color-mix(in srgb,var(--c0) 30%,var(--surface));stroke:var(--c0);stroke-width:2}
.ib-model .an-seam{stroke:var(--c0);stroke-width:2;stroke-dasharray:4 3;fill:none}
.ib-model .an-wedge{fill:color-mix(in srgb,var(--gold,#b8860b) 34%,transparent);stroke:var(--gold,#b8860b);stroke-width:1.4}
.ib-model .an-node{fill:var(--surface);stroke:var(--text3);stroke-width:2.2;transform-box:fill-box;transform-origin:50% 50%}
.ib-model .an-node.on{fill:var(--c0);stroke:var(--c0);animation:an-node-pulse 1.4s ease-in-out infinite}
@keyframes an-node-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.ib-model .an-tier{fill:color-mix(in srgb,var(--text) 10%,var(--surface));stroke:var(--surface);stroke-width:1.6}
.ib-model .an-tier.on{fill:var(--c0)}
.ib-model .an-l-up{background:#2e9e5b}
.ib-model .an-l-down{background:#c0392b}
.ib-model .an-l-hold{background:var(--gold,#b8860b)}
.ib-model .an-l-node{background:var(--surface);border:2px solid var(--text3)}
.ib-model .an-l-nodeon{background:var(--c0);border-color:var(--c0)}
.ib-model .an-l-tier{background:color-mix(in srgb,var(--text) 10%,var(--surface));border:1px solid var(--surface)}
.ib-model .an-l-tieron{background:var(--c0)}
.ib-model .an-l-ball{background:color-mix(in srgb,var(--c0) 30%,var(--surface))}
.ib-model .an-b-fb{background:#2e9e5b}
.ib-model .an-b-w{background:var(--c0)}
.ib-model .an-b-drag{background:var(--gold,#b8860b)}
.ib-model .an-b-str{background:var(--green)}
.ib-model .an-b-bias{background:var(--c0)}
@media (prefers-reduced-motion:reduce){.ib-model .an-node.on{animation:none}}
/* every model label gets a surface-coloured halo, so even a tight label stays
   readable where it passes a shape edge instead of dissolving into it */
.ib-model svg text{ paint-order:stroke; stroke:var(--surface); stroke-width:2.6px; stroke-linejoin:round }
/* the generic sweep: every plain connector line marches so its direction reads */
.ib-model .an-walk{fill:none;stroke-dasharray:6 6;animation:an-march 1.25s linear infinite}
.ib-model .kv-cursor{animation:an-cursor-blink 1.8s ease-in-out infinite}
@keyframes an-cursor-blink{0%,100%{opacity:1}50%{opacity:.6}}
@media (prefers-reduced-motion:reduce){.ib-model .an-walk,.ib-model .kv-cursor{animation:none}}
.ib-model .an-meas2.capline{stroke:var(--c0);stroke-width:2.2;stroke-dasharray:8 5}
/* a short leader line, so a label standing off from its shape is not floating */
.ib-model .an-lead{fill:none;stroke:var(--text3);stroke-width:1.2;stroke-dasharray:2 2;opacity:.75}
.ib-model .an-l-gold{background:var(--gold,#b8860b)}
.ib-model .an-l-red{background:var(--c0)}
/* the main shape in a drawing breathes, so a still figure still reads as alive */
.ib-model .an-livepulse{transform-box:fill-box;transform-origin:50% 50%;
  animation:an-breathe 3.4s ease-in-out infinite}
@keyframes an-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.03)}}
@media (prefers-reduced-motion:reduce){.ib-model .an-livepulse{animation:none}}
.ib-model .an-glass{fill:color-mix(in srgb,var(--c2) 30%,var(--surface));stroke:var(--c2);stroke-width:1.8}
.ib-model .an-foodbar{fill:#d7a829;stroke:#a97f14;stroke-width:1.4}
.ib-model .an-b-in{background:var(--green)}
.ib-model .an-b-out{background:var(--c0)}
.ib-model .an-horm.off{fill:var(--text3);opacity:.4}
.ib-model .an-quad{stroke:none}
.ib-model .an-quad.good{fill:color-mix(in srgb,var(--green) 12%,transparent)}
.ib-model .an-quad.warn{fill:color-mix(in srgb,var(--gold,#b8860b) 10%,transparent)}
.ib-model .an-quad.bad{fill:color-mix(in srgb,var(--c0) 11%,transparent)}
.ib-model .an-lab-ok{fill:#2e9e5b}
.ib-model .an-lab-bad{fill:#c0392b}
.ib-model .an-sl-prot{fill:var(--c0);stroke:var(--surface);stroke-width:1.4}
.ib-model .an-sl-car,.ib-model .an-sl-fat{stroke:var(--surface);stroke-width:1.4}


/* the pane keeps a stable height so switching between the topic tree and a
   topic page does not jump the scroll position */
.ib-pane-min-height { min-height: 46vh; }

/* ═══ reader as a focused player (compact ✕, one Next) ═══════════════════ */

/* The exit control is icon-only at every width: font-size 0 hides the label
   that applyLanguage rewrites from data-en/data-zh, and ::before supplies the
   glyph. Qualified with body.ib-lesson because body.ib-lesson button{font:inherit}
   is (0,1,2) and beats a bare class selector. */
body.ib-lesson .ib-top__exit--x {
  font-size: 0; width: 40px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
/* Drawn, not typed. U+2715's ink does not sit in the middle of its em box in
   the font Chrome falls back to here, so a flex-centred glyph still rendered
   about 13px above the middle of the circle — visible as a ✕ hugging the top
   edge of the ring. Two rotated bars are exact, and identical on every
   platform and in both languages. */
body.ib-lesson .ib-top__exit--x::before {
  content: '';
  /* Absolute, not a flex item. As a flex item it laid out 12px left and 8px low
     of the ring's centre — the zero-width label node and the 40px box interact
     in a way that is not worth reverse-engineering. Pinning it to 50/50 is
     exact at every width and in every language. */
  position: absolute;
  top: 50%; left: 50%;
  width: 13px; height: 13px;
  margin: -6.5px 0 0 -6.5px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.7px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.7px 100% no-repeat;
  transform: rotate(45deg);
}

/* The progress bar is the spine of the bar now that there is no word beside it */
body.ib-lesson .ib-top .ib-top__bar { min-width: 60px; }

/* Back becomes a quiet arrow; Next carries the weight, as in the reference */
.ib-foot__btn--back {
  width: 44px; padding: 0; justify-content: center;
  font-size: 1.15rem; color: var(--text2);
  background: transparent;
  border-color: transparent;
  letter-spacing: 0;
}
.ib-foot__btn--back:hover:not(:disabled) {
  background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text);
}
.ib-foot__btn--back > span { pointer-events: none; }

.ib-foot__btn--next { gap: .45rem; padding-left: 1.15rem; padding-right: 1.05rem; }
.ib-foot__btn--next > span { pointer-events: none; }
.ib-foot__arrow { font-size: 1rem; line-height: 1; }
@media (hover: none) { .ib-foot__btn--next .ib-foot__arrow { font-size: 1.1rem; } }

/* ── Study-guide typography (redesign) ──────────────────────────────────────
   Section headings lead with a gold rule and a serif face; paragraphs breathe;
   bullets indent with coloured markers; key terms render as bordered term
   cards with the definition beside the term. Loaded after the page's inline
   styles so it wins by source order on both the course page and the lesson
   page. */
.native-section{margin-top:1.7rem;padding-top:1.2rem}
.native-section>h3{font-family:var(--serif,Georgia,serif);font-size:1.3rem;line-height:1.25;letter-spacing:-.01em;
  color:var(--blue2,#8fb7e8);margin:0 0 .65rem;padding:.1rem 0 .5rem;
  border-bottom:2px solid color-mix(in srgb,var(--blue2,#8fb7e8) 26%,transparent);
  display:flex;align-items:center;gap:.6rem}
.native-section>h3::before{content:'';width:5px;height:1.05em;border-radius:3px;background:var(--gold,#efd17c);flex:none}
.native-section p{line-height:1.78;margin:.6rem 0;max-width:70ch}
.native-lesson .native-lead p{font-size:1.05rem}
.native-bullets{margin:.65rem 0 .75rem;padding-left:1.4rem}
.native-bullets li{margin:.44rem 0;line-height:1.7;padding-left:.1rem}
.native-bullets li::marker{color:var(--blue2,#8fb7e8);font-weight:800}
.native-terms,.native-examples,.native-focus,.native-quick-check,.native-formulas,.native-links,.native-boundary{margin-top:1rem;padding:.85rem .95rem}
.native-term-list{display:grid;gap:.55rem}
.native-term{display:grid;grid-template-columns:minmax(128px,.38fr) 1fr;gap:.85rem;
  padding:.62rem .75rem;border:1px solid var(--line,#29435d);border-radius:10px;
  background:var(--surface,#11243a);align-items:baseline}
.native-term dt{font-weight:800;color:var(--blue2,#8fb7e8);line-height:1.4}
.native-term dd{margin:0;color:var(--text2,#c7cfda);line-height:1.62;font-size:.93rem}
.li-def{display:block;color:var(--text2,#c7cfda);font-size:.86rem;line-height:1.55;margin-top:.1rem}
.native-section .deep-walk b.kt,.native-section b.kt{color:var(--blue2,#8fb7e8);font-weight:800;
  background:color-mix(in srgb,var(--gold,#efd17c) 20%,transparent);padding:0 .18em;border-radius:4px}
@media (max-width: 640px){
  .native-term{grid-template-columns:1fr;gap:.3rem}
  .native-section>h3{font-size:1.16rem}
}

/* ═══ Study guide as a summary ════════════════════════════════════════
   The study guide is a bullet summary of the lesson, not the lesson itself.
   It reuses .ib-bigq / .ib-dt__grouphead / .ib-bullets so it reads as part of
   the same family as the rest of the detail views. */
.ib-guide--sum { max-width: 74ch; }
.ib-guide--sum .ib-bullets { margin: .2rem 0 .4rem; padding-left: 1.1rem; }
.ib-guide--sum .ib-bullets li { margin: .28rem 0; line-height: 1.6; }
.ib-guide--sum .ib-terms b {
  background: color-mix(in srgb, var(--gold) 15%, transparent);
  border-radius: 3px; padding: 0 .12em; font-weight: 800;
}
.ib-guide--sum .ib-dt__group { margin: 0 0 1.1rem; }
.ib-openlesson {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-top: 1.2rem; padding: .6rem 1.1rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--blue2) 8%, var(--surface));
  color: var(--text); font: inherit; font-size: .86rem; font-weight: 700;
  cursor: pointer; transition: background-color .16s ease, border-color .16s ease;
}
.ib-openlesson:hover {
  background: color-mix(in srgb, var(--blue2) 16%, var(--surface));
  border-color: var(--blue2);
}
.ib-openlesson:focus-visible { outline: 2px solid var(--accent2, #A9741E); outline-offset: 2px; }

/* ── Knowledge-based completion and active-learning review ─────────────── */
.ib-sec--inline { margin: 0 0 1rem; padding: 0 0 .75rem; }
.ib-sec--inline .ib-sec__title { font-size: 1.15rem; }
.ib-fig__in[data-panel="a"] .a11-panel:not([data-p="a"]),
.ib-fig__in[data-panel="b"] .a11-panel:not([data-p="b"]),
.ib-fig__in[data-panel="c"] .a11-panel:not([data-p="c"]) { display: none; }
.a11-panel.is-awaiting .kv-cursor,
.a11-panel.is-awaiting .ns-ndot,
.a11-panel.is-awaiting .ns-hdot,
.a11-panel.is-awaiting .ns-hcurve,
.a11-panel.is-awaiting .ns-ncurve,
.a11-panel.is-awaiting .nsn-h,
.a11-panel.is-awaiting .nsn-n,
.a11-panel.is-awaiting .kv-stack,
.a11-panel.is-awaiting .kv-legend,
.a11-panel.is-awaiting .kv-callout,
.a11-panel.is-awaiting > .kv-note { visibility: hidden; }
.a11-predict { margin: .75rem 0 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px; }
.a11-predict > p:first-child { margin: 0 0 .7rem; font-weight: 750; line-height: 1.5; }
.a11-predict-out { min-height: 1.4em; margin: .65rem 0 0; color: var(--text2); line-height: 1.5; }
.a11-predict .is-right { outline: 2px solid var(--ok); }
.a11-predict .is-wrong { outline: 2px solid var(--err); }
.ib-card__prediction { width: 100%; box-sizing: border-box; resize: vertical; margin: .7rem 0; padding: .75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; line-height: 1.5; }
.ib-card__reveal,.ib-mcq__retry { margin-top: .7rem; padding: .55rem .85rem; border: 1px solid var(--blue2); border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.ib-so__reasons { margin: .75rem 0 0; padding-left: 1.25rem; color: var(--text2); }
.ib-so__reasons li { margin: .45rem 0; line-height: 1.5; }
.ib-so__reasons b { color: var(--text); }
.ib-so__chip:disabled { opacity: .78; cursor: default; }
.ib-done__score { margin: .4rem 0; color: var(--blue2); font: 700 3rem/1 var(--serif,Georgia,serif); }
.ib-done__missed { max-width: 560px; margin: 1.5rem auto; text-align: left; }
.ib-done__missed h3 { font-size: 1rem; }
.ib-done__miss { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 1rem; margin: .45rem 0; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ib-done__miss:hover { border-color: var(--blue2); }
.ib-lev--read { background: var(--green); }
.ib-lev--mastered { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; }
.ib-trowwrap.is-next .ib-trow { border-color: var(--blue2); background: color-mix(in srgb,var(--blue2) 8%,var(--surface)); }
.ib-trowwrap.is-next .ib-trowgo { border-color: var(--blue2); background: var(--blue); color: #fff; }
.ib-topic-start { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; box-sizing: border-box; margin: 1rem 0; padding: 1rem 1.2rem; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.ib-topic-start small { font-weight: 500; opacity: .9; }
@media (max-width: 640px) {
  .ib-tbl__wrap { overflow: visible; }
  .ib-tbl__wrap table,.ib-tbl__wrap tbody { display: block; width: 100%; min-width: 0; }
  .ib-tbl__wrap tr { display: block; margin: 0 0 .8rem; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 10px; }
  .ib-tbl__wrap tr:first-child { display: none; }
  .ib-tbl__wrap td { display: grid; grid-template-columns: minmax(90px,.42fr) 1fr; gap: .65rem; padding: .55rem 0; border: 0; }
  .ib-tbl__wrap td::before { content: attr(data-label); color: var(--text2); font-size: .78rem; font-weight: 700; }
  .ib-topic-start { align-items: flex-start; flex-direction: column; }
  .native-table-wrap,.vis-table-wrap { overflow: visible; }
  .native-table,.vis-table,.native-table tbody,.vis-table tbody { display: block; width: 100%; min-width: 0; }
  .native-table thead,.vis-table thead { display: none; }
  .native-table tr,.vis-table tr { display: block; margin: 0 0 .8rem; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 10px; }
  .native-table td,.vis-table td { display: grid; grid-template-columns: minmax(90px,.42fr) 1fr; gap: .65rem; padding: .55rem 0; border: 0; }
  .native-table td::before,.vis-table td::before { content: attr(data-label); color: var(--text2); font-size: .78rem; font-weight: 700; }
}
