/* vitalite-ui.css — shared design-system layer. LOAD THIS LAST in <head>. No
   markup; delete the <link> and the site reverts. Separate file because pages
   carry 50-134KB inline <style> (guide.html is 1.1MB): this wins by source
   order, so it is additive and reversible. Fixed (all measured, full data in
   DESIGN-NOTES.md): depth (home had 2 bg tones, 1 border, one 5%-black shadow
   invisible on navy); button heights 21-44px with three under the 40px tap
   floor; form fields 32/37/40px with no single rule; no ::selection /
   focus-visible / scrollbar anywhere. Left alone on purpose: font stacks (Optima
   vs Georgia is a small-caps choice); --accent and the blue/gold split (shell
   blue, IB gold); .lin-search-input (40px floor would grow the fixed 48px bar);
   input[type=range] (infirmary #vxPain is 8px because it is a slider). */

/* ═══ 1 · Tokens ═══════════════════════════════════════════════════════════
   Added alongside the existing palette rather than replacing it: every token
   below reads FROM the live theme, so this layer follows whatever skin is active
   instead of hard-coding a second palette that could drift. */
:root {
  /* vertical rhythm. 56/24 is the file's stated target; the page-level values are
   untouched, these are here for anything new to use. */
  --space-section: 56px;
  --space-block: 24px;
  --space-tight: 12px;

  /* ELEVATION — rationale: elevation scale (DESIGN-NOTES 5e) */
  --elev-0: var(--bg);            /* canvas */
  --elev-1: var(--surface);       /* cards, panels */
  --elev-2: var(--surface3);      /* raised: hover, popovers, sticky chrome */
  --elev-sunken: var(--surface2); /* wells: inputs, code, stripes */

  /* The theme's --shadow is a 4px hard offset (print-poster look) and reads as a
   smudge on navy, so elevation gets soft blue-tinted shadows. */
  --elev-shadow-1: 0 1px 2px rgba(4, 10, 20, .38);
  --elev-shadow-2: 0 4px 16px rgba(4, 10, 20, .42), 0 1px 3px rgba(4, 10, 20, .34);
  --elev-shadow-3: 0 14px 38px rgba(4, 10, 20, .50), 0 3px 10px rgba(4, 10, 20, .36);

/* ── Apply the scale ──────────────────────────────────────────────────── Card
   classes actually in use (measured). One step of lift + a matching edge so a
   card reads as an object on the canvas, not a rectangle painted on it. */
.cr,
.stat-card,
.dash-card,
.feature-card,
.fork-card,
.qo-card,
.res-card,
.acc-item,
.plan-card,
.quiz-card,
.vt-plan,
.kn-card,
.hmx-card,
.ch-plan,
.g10-card {
  background: var(--elev-1);
  border: 1px solid var(--elev-border, var(--border));
  box-shadow: var(--elev-shadow-1);
}
/* Hover lifts one step. Costs a transition the button group already declares. */
.cr:hover,
.stat-card:hover,
.dash-card:hover,
.feature-card:hover,
.fork-card:hover,
.res-card:hover,
.hmx-card:hover,
.kn-card:hover {
  background: var(--elev-2);
  border-color: var(--elev-border-strong, var(--border2));
  box-shadow: var(--elev-shadow-2);
}
/* Floating chrome takes the top step. */
.lin-topbar,
.sb-mark,
.lin-search,
.log-menu,
.qna-widget .qna-panel {
  background: var(--elev-2);
  box-shadow: var(--elev-shadow-2);
}
/* Wells go DOWN, not up. */
input:not([type]),
select,
textarea {
  background: var(--elev-sunken);
}

  /* one motion vocabulary, matching the rail's existing easing */
  --motion-fast: .14s;
  --motion-base: .18s;
  --motion-slow: .5s;
  --motion-ease: cubic-bezier(.16, 1, .3, 1);

  /* the single tap-target floor the project already uses */
  --tap: 40px;

  /* one focus ring, used by every :focus-visible below */
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

/* Steps widened for dark, where elevation has to do the work. In light mode the
   palette already separates and a heavier shadow would only muddy it. */
body.dark {
  --elev-1: #13253f;
  --elev-2: #1b3050;
  --elev-sunken: #101d33;
  --elev-border: rgba(141, 182, 226, .16);
  --elev-border-strong: rgba(141, 182, 226, .26);
}

/* ═══ 2 · Selection, focus, scrollbar ════════════════════════════════════ Zero
   visual cost until used, so this is the cheapest quality win on the whole site. */
::selection {
  background: var(--accent);
  color: var(--surface);
}
/* Only for keyboard users: a mouse click on a <div> must not draw a ring. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}
/* Firefox */
* { scrollbar-color: var(--border2) transparent; scrollbar-width: thin; }
/* WebKit. Thin, rounded, and it follows the theme's border colour. */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--text3); background-clip: content-box; }

/* ═══ 3 · Tap targets ═════════════════════════════════════════════════════ Two
   techniques. Compact controls keep their painted size and get a 40px ::before
   overlay (AGENTS.md §3) because growing them overflows the container. Isolated
   controls (.btn-icon 34px, .qo-btn 36px) are simply raised to 40px.
   .sidebar-link is left alone on purpose: 32px desktop / 40px phone (the mobile
   pass covers it) and WCAG 2.5.8 exempts non-intersecting centres - 40px rail
   rows would trade working density for a rule that does not apply to a mouse. */
.tut-replay,
.vx-kb-ask,
.for-cat {
  position: relative;
}
.tut-replay::before,
.vx-kb-ask::before,
.for-cat::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--tap);
  transform: translateY(-50%);
  /* the overlay must not eat clicks meant for the control underneath */
  pointer-events: none;
}
body .btn-icon { min-width: 40px; min-height: 40px; }
body .qo-btn { min-height: 40px; }

/* ═══ 4 · Form fields ═════════════════════════════════════════════════════ One
   height, one radius, one focus ring. The :not() list is load-bearing.
   input[type=range] is 8px tall on infirmary.html because that is what a range
   looks like; checkbox / radio / color / file must never be given a 40px box
   either. */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input:not([type]),
select {
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  /* vitalite-skin already sets a border; this only makes sure one exists */
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .95rem;
  padding-inline: .7rem;
  transition: border-color var(--motion-fast) var(--motion-ease),
              box-shadow var(--motion-fast) var(--motion-ease);
}
/* the top-bar field is deliberately shorter — see the header note */
.lin-search-input {
  min-height: 0;
  border: 0;
  background: transparent;
  padding-inline: 0;
  border-radius: 0;
  font-size: .88rem;
}
input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input:not([type]):focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
textarea {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .95rem;
  padding: .7rem;
  transition: border-color var(--motion-fast) var(--motion-ease),
              box-shadow var(--motion-fast) var(--motion-ease);
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
::placeholder { color: var(--text3); opacity: 1; }

/* Button rhythm — rationale: button rhythm (DESIGN-NOTES) */
button,
.qo-btn,
.btn,
.btn-login,
.btn-icon,
.lin-study-btn,
.adm-btn,
.aq-btn,
.tab-btn,
.reveal-btn,
.chat-sug-btn,
.habit-chip {
  transition:
    transform var(--motion-base) var(--motion-ease),
    box-shadow var(--motion-base) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
}
/* A 2px lift on the things that read as cards or primary actions. Deliberately
   NOT applied to .btn-icon or anything inside the top bar: the bar is 48px and a
   lift there reads as the whole bar jumping. */
.qo-btn:hover,
.btn:hover,
.adm-btn:hover,
.chat-sug-btn:hover {
  transform: translateY(-2px);
}
.qo-btn:active,
.btn:hover:active,
.adm-btn:active {
  transform: translateY(0);
}

/* ═══ 6 · Card surface ════════════════════════════════════════════════════ One
   radius and one border for anything that is visually a card. The list is the
   measured set of card classes, not a guess. */
.vt-plan,
.stat-card,
.feature-card,
.fork-card,
.ch-card,
.qo-card,
.res-card,
.dash-card,
.for-topic,
.acc-item,
.chat-window,
.plan-card,
.quiz-card,
.vx-card,
.kn-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Pricing tiers — rationale: pricing row bug (DESIGN-NOTES) */
@media (min-width: 900px) {
  .vt-plans {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* stretch, not start: three tiers of different copy length must not end at three
   different heights. Measured before: 504 / 476 / 496px. */
    align-items: stretch;
  }
  .vt-plan { display: flex; flex-direction: column; }

  /* The Free card carries a 21px "Your current plan" badge and the other two carry
   an EMPTY .vt-current that measures 0px. That 21px pushed every line on card 1
   down by 21px, so the three price lines — the single most important thing on a
   pricing page — did not sit on one baseline. Reserving the row on all three is
   what aligns them; nothing moves on the card that actually has the badge. */
  .vt-current { min-height: 21px; }

  /* push each CTA to the bottom of its (now equal-height) card */
  .vt-plan ul { flex: 1 1 auto; }
  .vt-plan .qo-btn { margin-top: auto; }
}

/* Long lists — rationale: taste-skill §4.9 audit */
@media (min-width: 720px) {
  #vtFreeList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem 2.2rem;
    max-width: none;
    list-style: none;
    padding-left: 0;
  }
  #vtFreeList li {
    position: relative;
    padding-left: 1.15rem;
    line-height: 1.6;
  }
  #vtFreeList li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .58em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
  }
}

/* Footer — rationale: footer (DESIGN-NOTES) */
body > footer:not([class]),
footer:not([class]) {
  border-top: 1px solid var(--border);
  padding-top: var(--space-block);
  color: var(--text3);
  font-size: .85rem;
  line-height: 1.6;
}
footer a { color: var(--text2); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* Reduced motion — rationale: why these 13 classes (DESIGN-NOTES) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  .for-cat,
  .for-tag-chip,
  .fc-chip,
  .guide-chip,
  .guide-tab,
  .btn-login,
  .tut-replay,
  .lin-study-btn,
  .fc-nav button,
  .capture-btn,
  .acc-btn,
  .plan-btn,
  .pl-btn,
  .qo-btn,
  .log-menu {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .qo-btn:hover,
  .btn:hover,
  .adm-btn:hover,
  .chat-sug-btn:hover {
    transform: none !important;
  }
}

/* TYPE LADDER — rationale: type ladder, measured on home/exam/cn-cert (DESIGN-NOTES 5e) */
body h2 { font-weight: 700; letter-spacing: -.012em; }
body h3 { font-weight: 700; }
body h4 { font-weight: 700; }
/* big headings track tighter; 12-14px ones need looser or they clump */
body h1 { letter-spacing: -.018em; }
body h4, body h5, body h6 { letter-spacing: .004em; }


/* ═══ 8 · Design pass 2026-10-23 ═══════════════════════════════════════════
   Every rule below answers a MEASURED defect, not a preference. Numbers come
   from a headless-Chrome probe run over 10 pages at 1440 and 390 (harness:
   geometry + computed contrast), not from eyeballing screenshots. Delete this
   block and the site returns to the previous state; nothing here is required
   by markup. */

/* ── 8a · The section pills blew out the header below 950px ───────────────
   sections.css hides .sec-switcher under body.lin-v2 only. ib-sehs-learn.html
   does not carry that class, so its four injected pills stayed visible on a
   390px viewport: measured document scrollWidth 548 vs clientWidth 390, i.e.
   a 158px horizontal scrollbar, with .header-actions and .lin-study-wrap
   both running to right=548. Hiding the switcher for everyone below the same
   cut-off removes the band; the sidebar still carries every section link at
   that width, so nothing becomes unreachable. */
@media (max-width:950px){
  .header-actions .sec-switcher{display:none}
}
/* Belt and braces: a header cluster must never be the thing that widens the
   page, whatever a page-level inline style says about display:flex. */
.header-actions{min-width:0;max-width:100%}
.header-actions > *{flex:0 1 auto}

/* ── 8b · Sidebar group headers failed contrast, in three different colours ──
   Measured on 8 pages: .part-toggle carried #b3323a (Condition, 3.02:1),
   #3a78c2 (Knowledge, 4.09:1) and #5e6b7b (Developer Tools, 3.4:1) against
   the navy canvas — all under the 4.5:1 floor. They were also three ad-hoc
   hues outside the token set, which is the "several designers" tell the taste
   guide bans (A-4/A-5). Section identity is already carried by the active
   pill in the top bar, so the group header goes typographic: --text2 reads at
   about 8.5:1 on both themes, and the CURRENT section keeps an accent tint so
   the rail still tells you where you are. */
/* The <button> carries a per-section colour (red / blue / cream / slate) and
   the .part-name span INSIDE it inherits that colour, because nothing sets a
   colour on the span itself. Measured against the rail's #0F141C:
     Condition  #B3323A  3.02:1   FAIL
     Developer  #5E6B7B  3.40:1   FAIL
     Knowledge  #E8C87A 11.41:1   ok
     Social     #8DB6E2  8.73:1   ok
     Classroom  #ECE5D3 14.72:1   ok
   Inheritance is the weakest part of the cascade, so a plain declaration on
   the span wins without !important: every label goes to --text2 (8.5:1), and
   the section you are currently in keeps an accent label, which is the one
   hue that is a token rather than an ad-hoc colour (taste guide A-4). */
.sidebar .part-toggle .part-name{color:var(--text2)}
body.sec-infirmary .sidebar .sidebar-group.part[data-part="vitalite-infirmary"] > .part-toggle .part-name,
body.sec-knowledge .sidebar .sidebar-group.part[data-part="vitalite-knowledge"] > .part-toggle .part-name,
body.sec-social    .sidebar .sidebar-group.part[data-part="vitalite-social"]    > .part-toggle .part-name,
body.sec-classroom .sidebar .sidebar-group.part[data-part="vitalite-classroom"] > .part-toggle .part-name{
  color:var(--accent,var(--text))
}
/* The tutorial replay chip measured 4.26:1. journal.css sets it with
   !important at (0,2,1), so this needs a higher important specificity —
   html body .lin-topbar .tut-replay is (0,2,2) and wins the tie-break. */
html body .lin-topbar .tut-replay{color:var(--text2)!important}
/* Root cause on .jr pages: the muted ink token itself is below the floor —
   #7F7969 on the dark canvas is 4.26:1, and #857D6F on the light one is
   3.6:1. Raising the token fixes every consumer, not just the replay chip. */
body.jr{--jr-ink3:#6A6152}
html.jr-dk body.jr,body.jr.jr-dk{--jr-ink3:#9C9484}

/* ── 8c · Tap targets under the site's own 40px floor ─────────────────────
   --tap is 40px and the rail/header already hold it. The controls that did
   not: .tut-replay (30px), .btn-login (30px on the pages that ship their own
   inline header CSS), .sec-pill (26px icon-only below 1280). Padded to the
   floor without changing their type size, so nothing reflows. */
.tut-replay,
.btn-login{min-height:var(--tap)}
.sec-pill{min-height:var(--tap);min-width:var(--tap)}
/* Keep the icon optically centred once the box grows. */
.sec-pill{align-items:center}

/* ── 8d · The search field was only styled on body.lin-v2 ──────────────────
   linear-theme.css styles .lin-search-input under `body.lin-v2` only. Every
   other page therefore rendered a bare <input type=search> with the UA's
   default underline: a ~340px line of nothing floating between the toggles
   and the nav, which reads as a missing element rather than a control. These
   rules give the cluster the same contained, sunken-field treatment the shell
   pages already have. `body.lin-v2` rules are more specific, so they still
   win where they exist — this only fills the gap. */
.lin-search-cluster{min-width:0}
.lin-search{
  display:flex;align-items:center;gap:.4rem;
  width:min(240px,32vw);min-height:var(--tap);
  padding:0 .55rem;
  background:var(--elev-sunken);
  border:1px solid var(--elev-border,var(--border));
  border-radius:var(--radius-sm);
  transition:border-color var(--motion-fast) var(--motion-ease),
             box-shadow var(--motion-fast) var(--motion-ease);
}
.lin-search:focus-within{
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-bg);
}
.lin-search-input{
  flex:1 1 auto;min-width:0;
  background:transparent;border:0;outline:none;
  color:var(--text);font:inherit;font-size:.82rem;
  padding:.4rem 0;
}
.lin-search-input::placeholder{color:var(--text2);opacity:1}
.lin-search-kbd{
  flex:none;font:inherit;font-size:.62rem;letter-spacing:.02em;
  color:var(--text2);background:transparent;border:0;
  padding:.1rem .2rem;
}

/* ── 8e · Figure viewer (figure-zoom.js) ───────────────────────────────────
   The textbook's 14 illustrations render at max 640px in the prose column,
   which is too small to read the labelled diagrams (nephron, sarcomere, lever
   classes). Clicking one now opens it at up to 92vw with its caption and its
   licence line. The scrim is deliberately dark in BOTH themes — an image
   viewer is a light-table, and a white scrim would wash out the pale OpenStax
   line art — so the ink inside it is hard-coded light rather than tokenised. */
html.fz-locked{overflow:hidden}
.fz-scrim{
  position:fixed;inset:0;
  /* 9000 sat BELOW the lesson reader (course-hub.css puts .ch-lesson at
     2147482400), so clicking a figure inside the reader opened the viewer
     behind it and looked like nothing happened. Between the reader and the
     onboarding spotlight at 2147483000+. */
  z-index:2147482600;
  display:grid;place-items:center;
  padding:clamp(12px,3vw,40px);
  background:rgba(4,10,20,.94);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  animation:fz-in .18s cubic-bezier(.16,1,.3,1) both;
}
@keyframes fz-in{from{opacity:0}to{opacity:1}}
.fz-scrim[hidden]{display:none}
.fz-frame{
  position:relative;display:flex;flex-direction:column;align-items:center;
  max-width:min(94vw,1200px);
  animation:fz-rise .22s cubic-bezier(.16,1,.3,1) both;
}
@keyframes fz-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.fz-instant .fz-frame,.fz-instant .fz-scrim{animation:none}
.fz-img{
  display:block;
  max-width:min(94vw,1200px);
  max-height:76vh;width:auto;height:auto;
  border-radius:var(--radius);
  border:1px solid rgba(141,182,226,.22);
  background:#fff;
  box-shadow:0 24px 70px rgba(0,0,0,.55);
}
.fz-fade{animation:fz-swap .18s ease both}
@keyframes fz-swap{from{opacity:.35}to{opacity:1}}
.fz-meta{
  max-width:min(94vw,1200px);
  margin-top:14px;text-align:left;
  display:flex;flex-direction:column;gap:4px;
}
.fz-cap{
  margin:0;color:#F1E9D0;
  font-family:var(--font-heading,Georgia);
  font-style:italic;font-size:.98rem;line-height:1.5;
}
.fz-src{
  margin:0;color:#B7AF9F;
  font-family:var(--font-ui,inherit);
  font-size:.73rem;line-height:1.5;letter-spacing:.01em;
}
.fz-count{
  margin:2px 0 0;color:#8C99A8;
  font-family:var(--font-ui,inherit);
  font-size:.68rem;letter-spacing:.1em;text-transform:uppercase;
}
.fz-x,.fz-nav{
  position:absolute;
  display:grid;place-items:center;
  width:44px;height:44px;
  border-radius:999px;
  border:1px solid rgba(141,182,226,.3);
  background:rgba(15,34,56,.92);color:#F1E9D0;
  cursor:pointer;
  transition:background .14s ease,color .14s ease,border-color .14s ease;
}
.fz-x:hover,.fz-nav:hover{background:var(--accent);color:#101a28;border-color:var(--accent)}
.fz-x:focus-visible,.fz-nav:focus-visible{
  outline:none;box-shadow:0 0 0 2px rgba(4,10,20,.9),0 0 0 4px var(--accent);
}
.fz-x{top:-6px;right:-6px;z-index:2}
.fz-nav{top:50%;transform:translateY(-50%)}
.fz-prev{left:-58px}
.fz-next{right:-58px}
.fz-nav[hidden]{display:none}
/* Below the width where side arrows fit outside the frame, drop them inside
   and shrink so they never cover the diagram's own labels. */
@media (max-width:900px){
  .fz-prev{left:6px}
  .fz-next{right:6px}
  .fz-nav{width:38px;height:38px;opacity:.9}
}
/* The affordance on the figure itself. */
.topic-img-wrap img.topic-img,
img[data-zoom]{cursor:zoom-in}
.topic-img-wrap img.topic-img:focus-visible,
img[data-zoom]:focus-visible{
  outline:none;
  box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--accent);
}
@media (prefers-reduced-motion:reduce){
  .fz-scrim,.fz-frame,.fz-fade{animation:none!important}
}

/* ── 8f · Condition plate strip ───────────────────────────────────────────
   The Condition section had zero photography — measured imgs:1 / photos:0 —
   while its four tools are all about tissue, gait, load and taping. This is a
   four-up strip of illustrations that ALREADY ship in img/ with licences
   recorded in data/image-credits.md; nothing new was downloaded and no stock
   site was touched.

   Deliberately not a card grid: images sit edge to edge with a hairline gap
   and a caption line beneath, so it reads as a plate of figures rather than
   four more boxes. The only interactive affordance is the hover that returns
   the image to full saturation plus a click through to the figure viewer —
   no scale or rotation, per the taste guide's motion rule (M-3). */
.cp-plates{
  display:grid;grid-template-columns:repeat(4,1fr);
  gap:clamp(6px,1vw,12px);
  margin:var(--space-block) 0 0;
}
@media (max-width:900px){.cp-plates{grid-template-columns:repeat(2,1fr)}}
.cp-fig{margin:0;min-width:0}
.cp-fig img{
  display:block;width:100%;height:auto;aspect-ratio:4/3;
  object-fit:cover;
  border-radius:var(--radius-sm,var(--radius,12px));
  border:1px solid var(--elev-border,var(--border,rgba(20,40,65,.16)));
  background:var(--elev-sunken,var(--surface2,transparent));
  filter:saturate(.72) contrast(1.02);
  transition:filter var(--motion-base) var(--motion-ease),
             border-color var(--motion-base) var(--motion-ease);
}
.cp-fig:hover img,
.cp-fig:focus-within img{
  filter:saturate(1) contrast(1.04);
  border-color:var(--accent);
}
.cp-cap{
  margin:8px 0 0;
  font-family:var(--font-ui,inherit);
  font-size:.72rem;line-height:1.45;
  color:var(--text2,#465b73);
}
.cp-cap b{
  display:block;
  color:var(--text,inherit);
  font-weight:600;font-size:.78rem;
  letter-spacing:-.005em;
}
/* The licence line is real and stays visible — CC BY-SA requires attribution
   wherever the work is shown, not only inside the viewer. */
.cp-fig .topic-img-src{
  margin-top:3px;
  font-family:var(--font-ui,inherit);
  font-size:.62rem;line-height:1.4;
  color:var(--text3,var(--text2,#465b73));
  opacity:.9;
}

/* ── Brand mark in the app chrome ─────────────────────────────────────────
   The stored mark was a 20px favicon sitting alone at the left of every top
   bar, which is unreadable as a brand — the wordmark only existed on the
   landing page and in the slide-out sidebar. This puts the real mark in the
   bar, and drops it again below 720px where the header is already at its
   width budget. */
.sb-mark{display:inline-flex;align-items:center;gap:.5rem;text-decoration:none;flex:none}
.sb-word{font-family:var(--font-heading,"Newsreader",Georgia,serif);font-size:1.02rem;line-height:1;letter-spacing:.005em;color:var(--text,#EDF1EE);white-space:nowrap}
.sb-word em{font-style:italic;color:var(--accent,#D9A93F)}
@media (max-width:720px){.sb-word{display:none}}
.lin-brand{font-family:var(--font-heading,"Newsreader",Georgia,serif);font-size:1.05rem;line-height:1;
  letter-spacing:.005em;color:var(--text,#EDF1EE);text-decoration:none;white-space:nowrap;flex:none;
  margin-right:.15rem}
.lin-brand em{font-style:italic;color:var(--accent,#D9A93F)}
@media (max-width:860px){.lin-brand{display:none}}

/* The header's Log In was a filled, bordered box — the single loudest element
   on every page, for a site whose teaching material now opens with no account
   at all. Quiet it down to a text link that firms up on hover, so reading
   stays the primary action. */
.header-actions .btn-login,#headerActions .btn-login,.header-inner .btn-login{
  background:transparent;border-color:transparent;color:var(--text2,var(--text));font-weight:500;
  padding:.42rem .6rem;border-radius:8px;
}
.header-actions .btn-login:hover,#headerActions .btn-login:hover,.header-inner .btn-login:hover{
  border-color:var(--line-strong,var(--border));background:var(--surface2,var(--surface));color:var(--text);
}
