/* ---------------------------------------------------------------------------
   Tokens. Every colour on the site is one of these roles; dark mode swaps the
   values here and nowhere else. Group colours were checked for colour-blind
   separation (see README).
   --------------------------------------------------------------------------- */
:root {
  color-scheme: light;
  /* "Deep sky" (November 2026): one flat pale sky blue behind the page, white cards held by
     hairlines (no drop shadows), greys that lean blue, a deep azure accent used sparingly and
     ink-navy primary buttons. Hierarchy comes from size and colour: no weight above 600, no
     capitals with wide tracking. */
  --page: #e4f0fa;
  --surface: #ffffff;
  --surface-2: #edf4fb;
  --ink: #081421;
  --ink-2: #3a4c60;
  --ink-muted: #516376;
  --grid: #dfe9f2;
  --axis: #aebfd0;
  --border: rgba(10, 40, 80, 0.13);
  --card-shadow: none;

  --series-1: #1f63c9;
  --series-2: #e0602f;
  --series-3: #17a273;

  /* inference is drawn in ink, data in colour */
  --signal: #334150;
  --noise: #ccd7e1;
  --pop-fill: rgba(11, 40, 70, 0.07);
  --null-fill: rgba(11, 40, 70, 0.07);
  --tail-fill: rgba(11, 22, 34, 0.55);
  --pop-key: #d6e0e9;              /* legend swatches for the two pale washes */
  --null-key: #d6e0e9;
  --band-key: #f6cdbb;
  --band-opacity: 0.16;            /* the confidence band is the fitted line's colour at this strength */
  --flash: rgba(15, 95, 194, 0.15);    /* a control that a preset has just moved */
  --hist-fill: #ccd7e1;            /* histogram columns that are not highlighted (highlighted ones are ink) */
  --faint-line: rgba(11, 40, 70, 0.17);   /* one participant's line behind the means (spaghetti plot) */
  --jitter-opacity: 0.45;          /* individual dots behind the means, in their series colour */

  --shadow: rgba(12, 50, 86, 0.18);   /* floating panels: tooltips, the settings menu, the tour card */
  --tour-dim: rgba(8, 26, 44, 0.45);   /* the rest of the page while the tour lights up one part */

  --accent: #0f5fc2;               /* deep azure: hover borders, sliders, the brand mark */
  --link: #0a4a9a;
  --focus: #0f5fc2;
  --radius: 8px;

  /* the primary button: ink navy with white text; the result of a ratio
     (signal ÷ noise = t): ink in light mode, softer in dark mode, where a near-white block
     would glare */
  --primary-bg: #0c2440;
  --primary-ink: #ffffff;
  --primary-hover: #17365c;
  --result-bg: var(--ink);
  --result-ink: var(--surface);
  --result-line: transparent;

  /* The type scale: every font size is one of these eight steps. --fs-min is for numerals and
     capitals only (chart ticks, the small uppercase tags): 12px, and 13px in Chinese, Japanese
     and Korean, where nothing is set smaller than 13px. */
  --fs-min: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-22: 22px;
  --fs-26: 26px;
  --fs-36: 36px;
  /* System fonts only. After the Latin ones come Chinese (PingFang SC on macOS, Microsoft YaHei
     on Windows, Noto Sans CJK elsewhere) and Korean ones (Apple SD Gothic Neo, Malgun Gothic,
     Noto Sans KR), so any of these scripts shows in a matching sans-serif; a page whose lang
     is zh or ko puts its own script's fonts first (below). */
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Noto Sans SC", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR",
    "Noto Sans CJK KR", sans-serif;
}
:root:lang(zh) {
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    "Noto Sans SC", "Segoe UI", sans-serif;
}
:root:lang(ko) {
  --font: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR",
    "Segoe UI", sans-serif;
}
:root:is(:lang(zh), :lang(ja), :lang(ko)) { --fs-min: 13px; }
/* Korean is spaced by words: keep them whole, and break a word only if it cannot fit at all */
:root:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
/* Chinese (and Japanese) may break a line between any two characters, which in a narrow box
   splits a word ("噪/声", "交互/作用"). In the word formulas of "The idea in one picture" a
   line breaks only at a space (the one before an operator: write "A =\u00a0B +\u00a0C") or
   after punctuation, and a word only if it cannot fit at all; put \u00a0 between a number and
   its unit there ("8\u00a0小时") to keep them together. Short labels (box titles, concept-map
   boxes, topic cards) are balanced, so a label that needs two lines does not leave one or
   two characters alone on the second. Running text keeps the usual CJK line breaking. */
:root:is(:lang(zh), :lang(ja)) :is(.logic-math, .tile-label) { word-break: keep-all; overflow-wrap: anywhere; }
:root:is(:lang(zh), :lang(ja)) :is(.logic-title, .cmap-label, .cmap-link-label, .topic h3, .way-body h3, .case-title, .tile-label) { text-wrap: balance; }
/* Small running text in narrow boxes: the last line of a paragraph never holds a single
   character or the tail of a word ("比/例。", "误差范/围。", "8 小/时。"), the line breaking
   looks a few lines ahead instead. */
:root:is(:lang(zh), :lang(ja)) :is(.logic-text, .tile-note, .tiles-note, .control-hint,
  .glossary dd, .say-list li > span, .myth-claim > span, .myth-fix, .case-facts dd, .case-result) { text-wrap: pretty; }
/* Two- and three-line texts where "pretty" still left one or two characters alone on the last
   line (the catalogue cards, the ledes, the captions of the idea boxes) are balanced instead. */
:root:is(:lang(zh), :lang(ja)) :is(.logic-text, .topic p, .lede) { text-wrap: balance; }
/* In every language: a short label that takes two lines is split evenly, not "Main effects and
   the / interaction". */
:is(.logic-title, .ratio-label, .tile-label, .myth-claim) { text-wrap: balance; }
/* Letter-spacing is tuned for Latin type and looks wrong on Chinese characters, which are
   already set on a square grid: headings are not tightened, and the small labels that are
   capitals with wide tracking in English ("THE TRUTH") get almost none ("真相"). */
:root:is(:lang(zh), :lang(ja), :lang(ko)) :is(h1, h2, .home-hero h1, .guide-title) { letter-spacing: 0; }
:root:is(:lang(zh), :lang(ja)) :is(h4, .settings-title, .eyebrow, .eyebrow-link, .when-card h2, .logic-head h2, .control-group legend,
  .task-tag, .myth-tag, .case-tag, .case-facts dt, .cmap-band-title) { letter-spacing: 0.02em; }
/* Chinese has no italic: a slanted character is a distorted one. Emphasis (<em>) is set
   upright in a heavier weight; statistical symbols (<i>t</i>, <i>p</i>) stay italic. */
:root:is(:lang(zh), :lang(ja), :lang(ko)) em { font-style: normal; font-weight: 600; }

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #08131e;
    --surface: #111e2b;
    --surface-2: #1a2a3a;
    --ink: #eaf2f9;
    --ink-2: #b7c6d4;
    --ink-muted: #8ea1b3;
    --grid: #213141;
    --axis: #3d5063;
    --border: rgba(150, 200, 240, 0.15);
    --card-shadow: none;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --signal: #d3dde6;
    --noise: #435465;
    --pop-fill: rgba(190, 220, 245, 0.10);
    --null-fill: rgba(190, 220, 245, 0.10);
    --tail-fill: rgba(234, 242, 249, 0.38);   /* pale enough for the light labels written on it (power: "detected") */
    --pop-key: #344555;
    --null-key: #344555;
    --band-key: #6b3521;
    --band-opacity: 0.34;
    --flash: rgba(90, 180, 240, 0.24);
    --hist-fill: #435465;
    --faint-line: rgba(200, 225, 245, 0.20);
    --jitter-opacity: 0.55;
    --shadow: rgba(0, 0, 0, 0.5);
    --tour-dim: rgba(0, 0, 0, 0.62);
    --accent: #4fb3ee;
    --link: #8ccdf7;
    --focus: #4fb3ee;
    --primary-bg: #6fbdee;
    --primary-ink: #06121c;
    --primary-hover: #93cff5;
    --result-bg: var(--surface-2);
    --result-ink: var(--ink);
    --result-line: var(--ink-2);
  }
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* optional parts of a page stay hidden even where a class sets display */

html { -webkit-text-size-adjust: 100%; background: var(--page); }

body {
  margin: 0;
  min-width: 1040px;               /* desktop-only by design */
  color: var(--ink);
  font: 16px/1.6 var(--font);
  /* header, main and footer in a column at least as tall as the window: on a page shorter
     than the window (the not-found page; the big picture on a large screen) the footer stays
     at the bottom instead of floating in the middle */
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh;
}
main { flex: 1 0 auto; }
/* no line holding a subscript or superscript is taller than its neighbours */
sub, sup { line-height: 0; }


h1, h2, h3, h4, p, ol, ul { margin: 0; }
h1 { font-size: var(--fs-36); line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-22); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-18); line-height: 1.35; font-weight: 600; }
h4 { font-size: var(--fs-13); font-weight: 600; color: var(--ink); }
h4 i, legend i, .eyebrow i, .when-card h2 i, .task-tag i, .myth-tag i { text-transform: none; }

a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1180px, 100% - 64px); margin-inline: auto; }

/* "Skip to content": off-screen until it receives keyboard focus */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 30; padding: 8px 14px; border-radius: 8px;
  font-size: var(--fs-14); font-weight: 600; text-decoration: none;
  color: var(--surface); background: var(--ink);
}
.skip-link:focus { top: 10px; }
main:focus { outline: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.section { margin-top: 56px; }
.section > h2 { margin-bottom: 18px; }

/* ---------------------------------------------------------------------------
   Header and footer
   --------------------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.brand-mark { display: grid; place-items: center; color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 20px; font-size: var(--fs-14); }
/* the current item is bolder; every item keeps room for its bold form (the hidden copy of its
   text below it), so the others do not shift a few pixels from page to page */
.site-nav a { display: inline-flex; flex-direction: column; align-items: center; color: var(--ink-2); text-decoration: none; }
.site-nav a::after { content: attr(data-text); height: 0; overflow: hidden; visibility: hidden; font-weight: 600; pointer-events: none; user-select: none; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* the language: with two languages, one button named after the other one */
.lang-switch {
  padding: 4px 12px; font: inherit; font-size: var(--fs-13); line-height: 1.4; cursor: pointer;
  color: var(--ink-2); background: transparent; border: 1px solid var(--axis); border-radius: 999px;
}
.lang-switch:hover { color: var(--ink); border-color: var(--ink-2); background: var(--surface); }
/* the settings menu: a gear button and, under it, a small panel of settings (core.js) */
.settings { position: relative; }
.settings-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  color: var(--ink-2); background: transparent; border: 1px solid transparent;
}
.settings-btn:hover, .settings-btn[aria-expanded="true"] { color: var(--ink); background: var(--surface-2); border-color: var(--border); }
.settings-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: max-content; min-width: 200px; max-width: 320px;
  padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
}
.settings-title { font-size: var(--fs-min); font-weight: 600; color: var(--ink-muted); margin-bottom: 8px; }
.settings-item + .settings-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--grid); }
.settings-head { font-size: var(--fs-14); font-weight: 600; margin-bottom: 4px; }
.settings-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.settings-option {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px 6px 8px; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: var(--fs-14); text-align: start; color: var(--ink); background: transparent; border: 0;
}
.settings-option:hover { background: var(--surface-2); }
.settings-check { flex: none; width: 14px; height: 14px; position: relative; }
.settings-option[aria-current="true"] .settings-check::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 9px; height: 5px;
  border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg);
}
.settings-option[aria-current="true"] { font-weight: 600; }
.site-footer { margin-top: 80px; padding: 28px 0 40px; border-top: 1px solid var(--border); color: var(--ink-muted); font-size: var(--fs-14); }
.site-credit { margin-top: 8px; }
.site-credit a { color: inherit; }

/* ---------------------------------------------------------------------------
   Home
   --------------------------------------------------------------------------- */
/* The home page (home.js) is one screen: the site's name, its slogan, one line on who the
   site is for and "Start" stand large in the middle of the screen; behind them one picture
   (the results of repeated studies landing around the truth) fills the screen from its
   bottom edge. The plain .home-hero is the 404 page's: a heading and a line. */
.home-hero { padding: 48px 0 20px; }
.home-hero > * { max-width: 780px; }
.home-hero h1 { font-size: 46px; letter-spacing: -0.025em; }
.home-hero-bg {
  position: relative; overflow: hidden; display: grid; place-items: center;
  min-height: calc(100vh - 57px); min-height: calc(100svh - 57px); padding: 0; text-align: center;
}
.home-hero-bg > * { max-width: none; }
/* the words: the bottom padding is the header's height more than the top one, which puts
   them in the middle of the screen, not of the space under the header */
.home-hero-text { position: relative; z-index: 1; padding: 40px 0 97px; }
.home-hero-bg h1 { font-size: clamp(76px, 9.6vw, 140px); line-height: 1; letter-spacing: -0.04em; }
.home-slogan { margin-top: 24px; font-size: clamp(28px, 3.1vw, 44px); line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
:root:lang(zh) .home-slogan { letter-spacing: 0.02em; }
.home-who { margin-top: 14px; font-size: clamp(18px, 1.55vw, 22px); line-height: 1.4; color: var(--ink-2); }
/* (two classes: the button's own size comes later in this file, with .btn) */
.home-hero-bg .home-start { display: inline-block; margin-top: 44px; padding: 20px 68px; font-size: 22px; border-radius: 12px; text-decoration: none; }
/* The picture stands on the screen's bottom edge, as wide as the screen but never taller
   than it (1.62 is a little under its width : height). Pale, and paler towards the top (the
   mask), so the words in front of it stay easy to read. */
.home-hero-bg .hero-fig {
  position: absolute; left: 50%; bottom: 0; z-index: 0; margin: 0; transform: translateX(-50%); pointer-events: none;
  width: min(100%, (100vh - 57px) * 1.62); width: min(100%, (100svh - 57px) * 1.62);
  -webkit-mask-image: linear-gradient(to top, #000 0, #000 18%, rgba(0, 0, 0, 0.3) 62%);
  mask-image: linear-gradient(to top, #000 0, #000 18%, rgba(0, 0, 0, 0.3) 62%);
}
.hero-viz { display: block; width: 100%; height: auto; overflow: visible; }
.hv-dots { opacity: 0.3; }
/* a dot starts above the picture (its transform, set in home.js) and falls to its place */
.hv-dot { fill: var(--series-1); transition: transform 420ms cubic-bezier(0.35, 0, 0.75, 0.6), opacity 120ms linear; }
.hv-dot.is-up { opacity: 0; }

/* The About band under the first screen (#about): white, edge to edge, one short row. At the
   left the name, one line and the links; at the right the questions, each a
   fold that opens its answer. */
.home-about { padding: 26px 0 28px; background: var(--surface); border-top: 1px solid var(--border); }
.home-about-inner { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; gap: 56px; }
.about-who { min-width: 0; padding-top: 6px; }
.about-name { font-size: var(--fs-16); font-weight: 600; line-height: 1.35; }
.about-tagline { color: var(--ink-2); font-size: var(--fs-15); line-height: 1.45; text-wrap: pretty; }
.about-links { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 2px; font-size: var(--fs-14); }
.about-links a { font-weight: 600; }
.about-mail { color: var(--ink-muted); }
.about-q { border-top: 1px solid var(--grid); scroll-margin-top: 16px; }
.about-q:first-child { border-top: 0; }
.about-q > summary { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: var(--fs-15); font-weight: 600; cursor: pointer; list-style: none; }
.about-q > summary::-webkit-details-marker { display: none; }
.about-q > summary::before {
  content: ""; flex: none; width: 6px; height: 6px; margin: 0 3px 0 1px;
  border-right: 1.6px solid var(--ink-2); border-bottom: 1.6px solid var(--ink-2); transform: rotate(-45deg); transition: transform 0.15s;
}
.about-q[open] > summary::before { transform: rotate(45deg); }
.about-q > summary:hover { color: var(--link); }
.about-q > p { margin: 0 0 10px 18px; color: var(--ink-2); font-size: var(--fs-15); line-height: 1.5; }
body[data-page="home"] .site-footer { margin-top: 0; }

/* ---------------------------------------------------------------------------
   All topics (topics.js): the title, the rows of cards on their stage, the map over them
   --------------------------------------------------------------------------- */
.topics-head { display: flex; align-items: baseline; gap: 18px; padding: 34px 0 0; }
.topics-head h1 { font-size: var(--fs-36); line-height: 1.15; letter-spacing: -0.02em; }
.topics-head p { color: var(--ink-2); font-size: var(--fs-15); }
.tmap-open {
  margin-left: auto; padding: 4px 0; font: inherit; font-size: var(--fs-14); font-weight: 600; cursor: pointer;
  color: var(--link); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px;
}
/* the stage: the rows of cards, and over them the map while it is open (the cards are then
   out of sight, and out of reach: the tour makes the page inert) */
.tstage { position: relative; min-height: 480px; }
.tstage > .module:first-child { margin-top: 22px; }
.tstage.is-map .module-head, .tstage.is-map .topic { opacity: 0; }
.tstage.is-revealing .module-head { transition: opacity 420ms linear 380ms; }
.tmap { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.tmap > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* a branch draws itself from its start to its end; one not yet drawn leaves no dot where it
   starts (its round cap) */
.tmap-edge {
  fill: none; stroke: var(--ink-muted); stroke-width: 1.4; stroke-linecap: round; opacity: 0.7;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 330ms ease-out; visibility: hidden;
}
.tmap-edge.on { stroke-dashoffset: 0; visibility: visible; }
/* the rail the five foundations sit on */
.tmap-band { fill: var(--surface); fill-opacity: 0.5; stroke: var(--border); opacity: 0; transition: opacity 320ms linear; }
.tmap-band.on { opacity: 1; }
.tmap-label {
  position: absolute; white-space: nowrap; font-size: var(--fs-13); font-weight: 600; color: var(--ink-muted);
  opacity: 0; transition: opacity 320ms linear;
}
.tmap-label.on { opacity: 1; }
/* a topic on the map: its glyph and its name in a pill */
.tmap-node {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 9px; white-space: nowrap;
  font-size: var(--fs-14); font-weight: 600; line-height: 1.3; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  opacity: 0; transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 200ms linear, transform 280ms cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
.tmap-node.on { opacity: 1; transform: translate(-50%, -50%); }
.tmap-node .topic-glyph { width: 22px; height: 22px; }
.tmap-node .topic-n { margin: 0 -4px 0 0; }
.tmap.is-settling :is(.tmap-edge, .tmap-band, .tmap-label) { opacity: 0; transition: opacity 220ms linear; }
/* what the tour lights up: a still box around one part of the map */
.tmap-zone { position: absolute; pointer-events: none; }

.module { scroll-margin-top: 16px; }
/* a number in a ring: the place of a card on the beginner path */
.start-n {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; vertical-align: 2px;
  border-radius: 50%; font-size: var(--fs-14); font-weight: 600; color: var(--ink); border: 1.5px solid var(--ink);
}

/* "Find your way around": the guide and the big picture, one compact row under the
   catalogue (the header links to both from every page) */
.way { display: flex; align-items: center; gap: 16px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--border); }
.way > h2 { flex: none; font-size: var(--fs-15); font-weight: 600; letter-spacing: 0; color: var(--ink-2); }
.way-grid { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.way-card {
  display: flex; align-items: stretch; overflow: hidden; color: inherit; text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.way-thumb-box { flex: none; width: 70px; display: grid; place-items: center; background: var(--surface-2); border-right: 1px solid var(--border); }
.way-thumb { display: block; width: 70px; height: auto; }
.way-thumb * { vector-effect: non-scaling-stroke; }
.way-thumb .frame { fill: var(--surface); stroke: var(--axis); stroke-width: 1; }
.way-thumb .page { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1; }
.way-thumb .ink { fill: var(--ink-2); }
.way-thumb .edge { fill: none; stroke: var(--ink-muted); stroke-width: 1; }
.way-thumb .s1 { fill: var(--series-1); }
.way-thumb .s2 { fill: var(--series-2); }
.way-thumb .s3 { fill: var(--series-3); }
.way-body { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 8px 14px; min-width: 0; }
.way-body h3 { font-size: var(--fs-16); }
.way-body p { color: var(--ink-2); font-size: var(--fs-14); line-height: 1.4; }

.module { margin-top: 40px; }
.module-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.module-head p { color: var(--ink-2); font-size: var(--fs-15); }
.topic-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.topic {
  display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 14px 16px;
  color: inherit; text-decoration: none;
}
.topic h3 { font-size: var(--fs-16); text-wrap: balance; }
.topic p { color: var(--ink-2); font-size: var(--fs-14); line-height: 1.45; }
.topic .topic-status { margin-top: auto; font-size: var(--fs-13); font-weight: 600; letter-spacing: 0.03em; color: var(--ink-muted); }
/* the top of a topic card: a glyph of the method (home.js, GLYPHS), in one colour so it
   follows the theme, and the number of a page on the beginner path */
.topic-top { display: flex; align-items: flex-start; justify-content: space-between; min-height: 32px; margin-bottom: 2px; }
.topic-glyph { display: block; width: 32px; height: 32px; color: var(--ink-2); transition: color 0.15s; }
.topic-glyph svg { display: block; width: 100%; height: 100%; overflow: visible; }
.topic-glyph .ln, .topic-glyph .ax { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topic-glyph .pale { opacity: 0.45; }
.topic-glyph .ax { stroke-width: 1.3; opacity: 0.35; }
.topic-glyph .dash { stroke-dasharray: 2.4 2.8; }
.topic-glyph .dot, .topic-glyph .ink { fill: currentColor; }
.topic-glyph .wash { fill: currentColor; fill-opacity: 0.13; }
.topic-glyph .plane { fill: currentColor; fill-opacity: 0.24; }
.topic-glyph .node { fill: var(--surface); stroke: currentColor; stroke-width: 1.8; }
a.topic:hover .topic-glyph { color: var(--accent); }
.topic-soon .topic-glyph { color: var(--ink-muted); opacity: 0.6; }
.topic-n { width: 20px; height: 20px; margin: 0 0 0 auto; font-size: var(--fs-min); vertical-align: 0; }
a.topic { transition: border-color 0.15s, transform 0.15s; }
.topic-soon { background: transparent; border-style: dashed; }
.topic-soon h3, .topic-soon p { color: var(--ink-muted); }
/* every card is one link: it lifts on hover, and its title takes the link colour */
:is(a.topic, .way-card):hover { border-color: var(--accent); transform: translateY(-2px); }
:is(a.topic, .way-card):hover h3 { color: var(--link); }
:is(a.topic, .way-card):focus-visible { outline-offset: 3px; border-radius: var(--radius); }

/* ---------------------------------------------------------------------------
   Method page: hero
   --------------------------------------------------------------------------- */
.hero { padding: 28px 0 4px; }
.eyebrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
  font-size: var(--fs-13); font-weight: 600; color: var(--ink-muted);
}
/* on a method page the module's name leads to its section of the home page */
.eyebrow-link { color: inherit; text-decoration: none; }
.eyebrow-link:hover { color: var(--link); text-decoration: underline; }
/* the beginner path: a page's place on it beside the module name ("2 / 3"), and the number of
   a stop (the pager card that leads to it; the same look as the step cards' circles) */
.path-badge {
  padding: 0 8px; border-radius: 999px; border: 1px solid var(--axis); text-decoration: none;
  font-size: var(--fs-min); line-height: 18px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; color: var(--ink-2);
  text-transform: none; font-weight: 500;
}
.path-badge:hover { color: var(--link); border-color: var(--accent); }
.path-n {
  flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  font-size: var(--fs-min); font-weight: 600; line-height: 1; color: var(--surface); background: var(--ink);
}
.lede { font-size: var(--fs-18); line-height: 1.5; color: var(--ink-2); max-width: 820px; margin-top: 10px; }
/* Small windows (short, or narrow): the first screen should still reach step 1. The lede may
   use the whole width, and the text of a logic box is cut to three lines; core.js then shows
   the whole text in the box's popover. At 1320 wide and 900 high nothing is cut. */
@media (max-height: 840px), (max-width: 1180px) {
  #hero > .lede { max-width: none; }
  .logic-box > .logic-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
}

/* The title row: the title and, at its right, "Take the tour" and the button that opens the
   folded "When to use it · This page's example" (a title too long for that leaves the two
   buttons a line of their own). The fold itself comes after the lede: two cards side by side. */
.hero-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; }
.hero-top h1 { min-width: 0; }
.hero-actions { display: flex; align-items: center; gap: 14px; }
/* a button that opens a fold elsewhere on the page: the look of a small fold's summary */
.fold-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 9px 3px 5px; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: var(--fs-14); font-weight: 600; color: var(--ink-2); background: transparent; border: 0;
}
.fold-btn::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 0 1px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s;
}
.fold-btn[aria-expanded="true"]::before { transform: rotate(45deg) translate(-2px, -1px); }
.fold-btn:hover { color: var(--link); background: var(--surface-2); }
.when { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 12px; }
.when-card { padding: 4px 0 4px 18px; border-left: 3px solid var(--axis); }
.when-card h2 { font-size: var(--fs-13); color: var(--ink-2); margin-bottom: 6px; }
.when-card p { font-size: var(--fs-16); }
.tour-btn { display: inline-flex; align-items: center; gap: 8px; }
.tour-btn-icon { flex: none; position: relative; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid currentColor; }
.tour-btn-icon::after {
  content: ""; position: absolute; left: 4.5px; top: 3px; width: 0; height: 0;
  border-left: 5px solid currentColor; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent;
}
.tour-close {
  flex: none; width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  font: inherit; font-size: var(--fs-18); line-height: 1; color: var(--ink-2); background: transparent; border: 0;
}
.tour-close:hover { color: var(--ink); background: var(--border); }

/* ---------------------------------------------------------------------------
   Folded parts: "When to use it", the term list of the result, the data table under a chart,
   the big picture's list (small folds), and "In real research", the misunderstandings, the
   formulas (the sections at the end). One look for all: a chevron before the summary, which
   turns down when the part is open; on hover the summary takes the link colour on a quiet
   surface. Opening by hand slides open in about 150 ms (core.js; not under reduced motion).
   --------------------------------------------------------------------------- */
.fold > summary, .data-table > summary, .cmap-details > summary {
  display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%;
  list-style: none; cursor: pointer; border-radius: 6px;
}
.fold > summary::-webkit-details-marker, .data-table > summary::-webkit-details-marker, .cmap-details > summary::-webkit-details-marker { display: none; }
.fold > summary::before, .data-table > summary::before, .cmap-details > summary::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 0 1px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s;
}
.fold[open] > summary::before, .data-table[open] > summary::before, .cmap-details[open] > summary::before { transform: rotate(45deg) translate(-2px, -1px); }
details:is(.fold, .data-table, .cmap-details) > summary:hover { color: var(--link); background: var(--surface-2); }
.fold > summary:hover :is(h2, h3) { color: var(--link); }
/* the small folds, inside a part of the page */
details:is(.fold-small, .data-table, .cmap-details) > summary {
  gap: 8px; padding: 3px 9px 3px 5px; margin-left: -5px;
  font-size: var(--fs-14); font-weight: 600; color: var(--ink-2);
}
/* the folded sections at the end of a method page: one block, a rule between them */
.fold-section { margin-top: 0; }
:not(.fold-section) + .fold-section { margin-top: 56px; }
.fold-section > .fold { border-top: 1px solid var(--border); }
.fold-section:not(:has(+ .fold-section)) > .fold { border-bottom: 1px solid var(--border); }
.fold-section > .fold > summary { width: calc(100% + 20px); max-width: none; margin: 0 -10px; padding: 14px 10px; border-radius: 8px; }
.fold-section > .fold > summary::before { width: 8px; height: 8px; margin-right: 4px; color: var(--ink-2); }
.fold-section > .fold > summary :is(h2, h3) { font-size: var(--fs-18); line-height: 1.3; font-weight: 600; letter-spacing: 0; }
.fold-section > .fold[open] { padding-bottom: 26px; }

/* ---------------------------------------------------------------------------
   Method page: "The idea in one picture" (PSV.ui.logicFigure)
   A small label, then the boxes: they share one row and grow downwards with their text (a
   longer translation wraps, never spills); the formulas sit at the foot of each box, so they
   line up across the row. Under them one row, "Reading the result": each term with, under it,
   what it tells you (in print: readers do not find text that only shows on hover). No arrow
   leads into that row: one from the last box landed on the row's last term, while the row's
   title stands at its left, so readers could not tell which way the row reads.
   --------------------------------------------------------------------------- */
.logic { margin-top: 20px; }
.logic-head { margin-bottom: 6px; }
.logic-head h2 { font-size: var(--fs-13); line-height: 1.4; font-weight: 600; color: var(--ink-muted); }
.logic-figure { --logic-gap: 24px; }
.logic-flow { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: var(--logic-gap); }
.logic-box {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px;
  padding: 8px 12px 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow-wrap: break-word;
}
/* A box that links to a step carries that step's number in its corner: the step cards' circle,
   small and quiet at rest. On hover or focus the box lifts a little and takes the accent
   border, and the badge turns to full ink. A box that is not a link has no badge. */
.logic-box.has-link { transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.logic-box.has-link .logic-top { padding-right: 76px; }   /* the badge is up to 75px wide and stands 9px in from the box (3px outside this padding): a title ends at least 4px before it */
.logic-step-n {
  position: absolute; top: 8px; right: 9px; display: grid; place-items: center; height: 18px; padding: 0 7px; border-radius: 999px;
  font-size: var(--fs-min); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--surface); background: var(--ink-muted); transition: background 0.15s;
}
.logic-box.has-link:is(:hover, :has(.logic-link:focus-visible)) { border-color: var(--accent); box-shadow: 0 4px 14px var(--shadow); transform: translateY(-1px); }
.logic-box.has-link:is(:hover, :has(.logic-link:focus-visible)) .logic-step-n { background: var(--ink); }
.logic-box.has-link:hover .logic-link { color: var(--link); }
.logic-title { font-size: var(--fs-16); line-height: 1.3; }
.logic-link { color: var(--ink); text-decoration: none; }
/* the whole box is the link's click target */
.logic-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.logic-link:focus-visible { outline: none; }
/* the ring goes round the whole box: drawn on the link's own layer over it, which also works
   in browsers without :has() (Firefox before 121) */
.logic-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 3px; }
.logic-text { font-size: var(--fs-14); line-height: 1.42; color: var(--ink-2); }
.logic-math {
  margin-top: auto; padding: 4px 8px; border-radius: 6px; background: var(--surface-2);
  font-size: var(--fs-15); line-height: 1.38; text-align: center; color: var(--ink); overflow-wrap: anywhere;
}
.logic-math sub, .logic-math sup, .logic-read-items sub, .logic-read-items sup { line-height: 0; }
/* the arrow to the next box, in the gap between them */
.logic-arrow { position: absolute; left: 100%; top: 50%; width: var(--logic-gap); height: 12px; margin-top: -6px; pointer-events: none; }
.logic-arrow::before { content: ""; position: absolute; left: 5px; right: 8px; top: 5px; height: 2px; background: var(--ink-muted); }
.logic-arrow::after {
  content: ""; position: absolute; right: 7px; top: 2px; width: 7px; height: 7px;
  border-top: 2px solid var(--ink-muted); border-right: 2px solid var(--ink-muted); transform: rotate(45deg);
}
/* "Reading the result": the title, then one column per term: the term and, under it, what it
   tells you. The terms stand side by side with a hairline between them: they are readings
   of one result, not steps in an order. A click on a term goes to the tile (or the step) it
   names. */
.logic-read {
  position: relative; margin-top: 12px; padding: 8px 14px 9px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 22px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.logic-read-title { font-size: var(--fs-14); }
.logic-read-items {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--read-n, 3), minmax(0, 1fr)); gap: 6px 33px;
  font-size: var(--fs-14); line-height: 1.4;
}
.logic-read-items li { position: relative; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
/* the hairline, in the middle of the gap */
.logic-read-items li + li::before { content: ""; position: absolute; left: -17px; top: 1px; bottom: 1px; width: 1px; background: var(--border); }
.logic-read-link { align-self: flex-start; font-weight: 600; text-decoration: none; color: var(--ink); }
a.logic-read-link:is(:hover, :focus-visible) { color: var(--link); text-decoration: underline; }
.logic-read-text { font-size: var(--fs-13); line-height: 1.42; color: var(--ink-2); text-wrap: pretty; }

/* the part of the page a box points at lights up once the page has scrolled there: the
   light holds for about 1.6 s, then fades */
.is-spot { animation: spot 2.1s ease-out; }
.is-spot:not(.card) { border-radius: 6px; }
@keyframes spot {
  0%, 76% { box-shadow: 0 0 0 4px var(--focus); }
  100% { box-shadow: 0 0 0 4px transparent; }
}
.card.step, .card.result { scroll-margin-top: 16px; }   /* scrolled to from a box: a little room above */
.card.step:focus, .card.result:focus { outline: none; }
.card.step:focus-visible, .card.result:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .is-spot { animation-timing-function: step-end; } }

/* ---------------------------------------------------------------------------
   Method page: controls + stage
   --------------------------------------------------------------------------- */
.explore { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 24px; }
/* after "Set this up" jumps here, keep the same breathing room as the sticky panel */
.explore { scroll-margin-top: 16px; }

/* The panel is a column: the sliders (which scroll inside it when the window is short)
   and, below them, a footer of constant height. The footer is a normal flex child, so
   it can never lie on top of a control. */
.controls {
  position: sticky; top: 16px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.controls-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 18px 0; }
.control-group { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.control-group legend { padding: 0; font-size: var(--fs-13); font-weight: 600; color: var(--ink); }
.control-group legend + .control, .control-group legend + .visually-hidden + .control { margin-top: 6px; }
/* under a group's heading, in print: the one thing to know about it */
.control-brief { margin: 1px 0 0; font-size: var(--fs-min); line-height: 1.35; color: var(--ink-muted); }
.control-brief + .control { margin-top: 8px; }
/* A name that explains itself in a popover (PSV.ui.popover: a group heading's note, a slider's
   hint, a legend entry's meaning): a dotted underline says so, quietly (a screen holds many of
   them: they are hints, not links), and turns to the link colour under the mouse and while
   its slider has keyboard focus. */
.has-tip { cursor: help; }
legend .has-tip, .has-tip .control-name, .legend-item.has-tip .legend-name {
  text-decoration: underline dotted var(--axis); text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
legend .has-tip:hover, .has-tip .control-name:hover, .control:has(:is(input, .segmented button):focus-visible) .has-tip .control-name,
.legend-item.has-tip:is(:hover, :focus-visible) .legend-name { color: var(--link); text-decoration-color: var(--link); }
/* a control with two positions: its name and, beside it, the two options (.segmented) */
.control-choice .control-head { align-items: center; }
.control { margin-top: 10px; }
.control-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: var(--fs-14); }
.control-head label .key { margin-right: 7px; }
.control-head output { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A thin track coloured up to the thumb, and a ring for a thumb. WebKit and Blink have no
   "filled part" of their own: the track is a two-colour gradient that changes at --fill, the
   slider's position in percent, which the scripts set whenever a slider shows its value
   (PSV.rangeFill in core.js). Firefox colours the filled part itself. */
.control input[type="range"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 16px; margin: 6px 0 0;
  background: transparent; cursor: pointer; accent-color: var(--accent);
}
.control input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--axis) var(--fill, 50%));
}
.control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6.5px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
.control input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--axis); }
.control input[type="range"]::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--accent); }
.control input[type="range"]::-moz-range-thumb {
  box-sizing: border-box; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
.control input[type="range"]:active::-webkit-slider-thumb { background: var(--accent); }
.control input[type="range"]:active::-moz-range-thumb { background: var(--accent); }
/* small print (step notes that page scripts write) */
.control-hint { font-size: var(--fs-13); line-height: 1.4; color: var(--ink-muted); margin-top: 3px; }
/* a small heading over a run of related sliders (ANOVA: the true mean of each group) */
.control-sub { margin-top: 10px; }
.control-subhead { font-size: var(--fs-13); font-weight: 600; color: var(--ink-2); }
.control-sub .control { margin-top: 6px; }

/* a control that a "Set this up" button has just moved lights up for a moment (under reduced
   motion the light goes out at once instead of fading) */
.control, .toggle { border-radius: 6px; }
.is-flash { animation: flash 1.5s ease-out; }
@keyframes flash {
  0%, 35% { background: var(--flash); box-shadow: 0 0 0 5px var(--flash); }
  100% { background: transparent; box-shadow: 0 0 0 5px transparent; }
}
@media (prefers-reduced-motion: reduce) { .is-flash { animation-timing-function: step-end; } }

/* Footer: the buttons in one row (the primary one, the other draw button, Reset), then the
   current result, the running count with the share as a clear number, and the last 30
   samples as dots. Every row has a fixed height, so nothing shifts while samples are drawn. */
.control-actions { flex: none; position: relative; padding: 12px 18px 12px; border-top: 1px solid var(--border); }
/* shown only while more sliders are hidden below the fold of the scrolling region */
.control-actions::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% + 1px); height: 26px;
  background: linear-gradient(to bottom, transparent, var(--surface)); pointer-events: none;
  opacity: 0; transition: opacity 0.15s;
}
.controls.has-more .control-actions::before { opacity: 1; }
.action-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
/* a label too long for its button (a longer translation) wraps inside it rather than spilling out */
.action-row .btn { text-wrap: balance; overflow-wrap: break-word; }
/* Reset, the quiet third button: an icon and its word. When the three do not fit on one line
   the word goes (is-compact; it is the button's name and in its popover), then the two draw
   buttons take smaller type (is-tight). core.js measures and sets both. */
.btn.btn-quiet { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 32px; min-height: 32px; padding: 8px 8px; font-size: var(--fs-13); color: var(--ink-2); background: transparent; border-color: transparent; }
.btn.btn-quiet:hover { color: var(--ink); background: var(--surface-2); border-color: var(--border); }
.btn-icon { display: grid; place-items: center; }
.action-row.is-compact .btn-word { display: none; }
/* icon only: a 32px target, set apart from the draw buttons (it reaches a little into the panel's padding) */
.action-row.is-compact .btn.btn-quiet { padding: 8px 7px; margin-left: 6px; margin-right: -6px; }
.action-row.is-tight { gap: 4px; }
.action-row.is-tight .btn:not(.btn-quiet) { font-size: var(--fs-13); padding: 8px 7px; }
.tally { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; margin-top: 10px; }
.tally-now, .tally-count { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tally-now { font-size: var(--fs-14); line-height: 20px; font-weight: 600; }
/* the count so far on a line of its own; under it the dots and, beside them, the share of
   filled ones so far as a number of its own (.tally-line only groups the count and the share
   in the markup: both are placed on the tally's grid) */
.tally-line { display: contents; }
.tally-count { font-size: var(--fs-13); line-height: 19px; color: var(--ink-2); margin-top: 2px; }
.tally-count strong { color: var(--ink); }
.tally-share {
  grid-column: 2; grid-row: 3; align-self: center; min-height: 26px; margin-top: 5px;
  font-size: var(--fs-22); line-height: 26px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--ink);
}
/* under the number, in a word or two, what it is a share of (the count line's own words) */
.tally-share-label { grid-column: 1 / -1; grid-row: 4; justify-self: end; min-height: 15px; font-size: var(--fs-min); line-height: 15px; white-space: nowrap; color: var(--ink-muted); }
/* 30 dots in two rows of 15; the room for both rows is reserved from the start. What a filled
   dot means is their popover (hover or focus), not a line of print. */
.tally-dots {
  grid-column: 1; grid-row: 3; align-self: center; margin-top: 5px;
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 3px; width: 177px; height: 21px; border-radius: 4px; cursor: help;
}
.tally-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink-2); }
.tally-dot.is-hit { background: var(--ink); border-color: var(--ink); }
.btn {
  font: inherit; font-size: var(--fs-14); font-weight: 600; padding: 8px 12px; border-radius: 8px; cursor: pointer;
  color: var(--ink); background: var(--surface); border: 1px solid var(--axis);
}
.btn:hover { background: var(--surface-2); }
.btn-primary { color: var(--primary-ink); background: var(--primary-bg); border-color: var(--primary-bg); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
/* while a long batch of studies runs, both buttons wait (they read "Running…" and "40/100") */
.btn:disabled { cursor: progress; }
.btn:disabled:hover { background: var(--surface); }
.btn-primary:disabled, .btn-primary:disabled:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.action-row .btn:disabled { font-variant-numeric: tabular-nums; }
.btn-small { font-size: var(--fs-13); padding: 5px 10px; }

.stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }

/* above step 1: the "Try this" item that was just set up; empty, it is taken out of the
   stage's grid (no row, no gap) but stays rendered as a live region */
.task { font-size: var(--fs-15); line-height: 1.5; color: var(--ink-2); }
.task:not(.is-task) { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.task.is-task {
  display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 9px 8px 9px 14px;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--ink); border-radius: var(--radius);
  /* it stays in view while the reader scrolls through the steps, level with the panel */
  position: sticky; top: 16px; z-index: 6; box-shadow: 0 6px 18px var(--shadow);
}
/* a card scrolled to from a link stops below the banner (core.js keeps --task-h) */
.stage.has-task > .card { scroll-margin-top: calc(var(--task-h, 0px) + 28px); }
/* the tour lights parts of the page up one by one: the banner keeps its place in the flow meanwhile */
.is-touring .task.is-task { position: static; box-shadow: none; }
.task-body { flex: 1; min-width: 0; }
/* the tag, the task in bold, then what it shows and where to look: running text, as many
   lines as it needs */
.task-see { color: var(--ink-2); }
.task-tag {
  display: inline-block; margin-right: 9px; vertical-align: 1px;
  font-size: var(--fs-min); font-weight: 600;
  padding: 1px 7px; border-radius: 4px; color: var(--surface); background: var(--ink);
}
.task-close {
  flex: none; width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: var(--fs-22); line-height: 1; color: var(--ink-2); background: transparent; border: 0;
}
.task-close:hover { color: var(--ink); background: var(--border); }

/* the switches for optional layers of the first chart */
.show-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  font-size: var(--fs-13); color: var(--ink-2); margin-bottom: 10px;
}
/* The "Show:" switches and the legend share a line when both fit; otherwise the legend
   moves, whole, to the line below. */
.step-body.has-show { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 32px; }
.step-body.has-show > * { flex: 0 0 100%; min-width: 0; }
.step-body.has-show > .show-row { flex: 0 1 auto; }
.step-body.has-show > .legend-slot { flex: 1 1 auto; width: auto; }
.show-label { font-weight: 600; color: var(--ink); }
/* a switch that is a choice of two (toggles: kind 'segmented'): two buttons in one frame, the
   one in force raised; its row keeps a line to itself, apart from the legend */
.step-body.has-show > .show-row.has-segmented { flex: 0 0 100%; }
.segmented { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button {
  font: inherit; font-size: var(--fs-13); line-height: 1.4; padding: 3px 12px; border-radius: 6px; cursor: pointer;
  color: var(--ink-2); background: transparent; border: 1px solid transparent;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-checked="true"] { font-weight: 600; color: var(--ink); background: var(--surface); border-color: var(--border); box-shadow: 0 1px 2px var(--shadow); }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 1px 4px 1px 2px; }
.toggle input { margin: 0; accent-color: var(--accent); }
.step { padding: 16px 20px 14px; }
.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.step-head p { color: var(--ink-2); font-size: var(--fs-15); line-height: 1.5; margin-top: 2px; max-width: 780px; }
.step-n {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: var(--fs-14); font-weight: 600; color: var(--ink); border: 1.5px solid var(--ink);
}

/* Short windows: tighter spacing. Where the sliders still scroll, the scrollbar's room is
   reserved with a narrower right padding, so it never makes a label wrap. */
@media (max-height: 720px) {
  .controls-scroll { padding: 12px 6px 0 18px; scrollbar-gutter: stable; }
  .control-group { margin-bottom: 10px; }
  .control { margin-top: 6px; }
  .control input[type="range"] { margin-top: 3px; }
  .control-actions { padding-top: 10px; padding-bottom: 10px; }
  .tally { margin-top: 8px; }
}

/* ---------------------------------------------------------------------------
   Charts
   --------------------------------------------------------------------------- */
.chart-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart-svg text { font-family: var(--font); fill: var(--ink-2); }
.chart-svg .tick { font-size: var(--fs-min); fill: var(--ink-muted); font-variant-numeric: tabular-nums; }
.chart-svg .axis-title { font-size: var(--fs-13); fill: var(--ink-2); }
.chart-svg .group-name { font-size: var(--fs-14); font-weight: 600; fill: var(--ink); }
.chart-svg .group-sub { font-size: var(--fs-13); fill: var(--ink-muted); }
/* labels on the plot carry a halo, so a line passing behind one never makes it unreadable */
.chart-svg .mark-label {
  font-size: var(--fs-13); fill: var(--ink-2); font-variant-numeric: tabular-nums;
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}
.chart-svg .mark-label.strong { font-size: var(--fs-14); font-weight: 600; fill: var(--ink); }
.chart-svg .mark-label.muted { fill: var(--ink-muted); }
.chart-svg .cat-label { font-size: var(--fs-13); fill: var(--ink-2); }   /* category names under a means plot */
.chart-svg .empty-note { font-size: var(--fs-14); fill: var(--ink-muted); }

.legend { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px 20px; font-size: var(--fs-13); line-height: 1.6; color: var(--ink-2); margin-bottom: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; border-radius: 4px; }
.key { display: inline-block; flex: none; background: var(--key); }
.key-dot { width: 9px; height: 9px; border-radius: 50%; }
.key-line { width: 18px; height: 3px; border-radius: 2px; }
.key-thin { width: 18px; height: 1.5px; }
.key-dash { width: 26px; height: 1.5px; background: repeating-linear-gradient(90deg, var(--key) 0 6px, transparent 6px 10px); }
.key-vline { width: 1.5px; height: 13px; margin: 0 4px; }
.key-wash { width: 18px; height: 11px; border-radius: 3px; }
.key-bar { width: 12px; height: 12px; border-radius: 3px; }
.key-ci { width: 22px; height: 4px; border-radius: 2px; position: relative; }
.key-ci::after { content: ""; position: absolute; left: 6px; top: -3.5px; width: 10px; height: 10px; border-radius: 50%; background: var(--key); border: 2px solid var(--surface); box-sizing: border-box; }

.tip {
  position: absolute; z-index: 20; display: none; pointer-events: none; width: max-content; max-width: 280px;
  padding: 8px 10px; border-radius: 8px; font-size: var(--fs-13); line-height: 1.4;
  color: var(--ink); background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 6px 20px var(--shadow);
}
.tip-lead { font-weight: 600; font-size: var(--fs-14); }
.tip-line { color: var(--ink-2); }
/* The site's popover (PSV.ui.popover): the same box, beside the name it explains. It is placed
   in window coordinates, above everything (the tour too), and can itself be hovered. */
.pop { position: fixed; z-index: 60; pointer-events: auto; max-width: 300px; color: var(--ink-2); }
.pop.is-open { display: block; }
.pop p + p { margin-top: 4px; }
.pop strong, .pop-lead { font-weight: 600; color: var(--ink); }

/* signal ÷ noise */
.ratio { display: flex; align-items: stretch; gap: 12px; }
.ratio-box { flex: 1; padding: 10px 14px; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.ratio-label { font-size: var(--fs-13); color: var(--ink-2); line-height: 1.35; }
.ratio-value { font-size: var(--fs-26); font-weight: 600; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ratio-note { font-size: var(--fs-13); line-height: 1.4; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ratio-note span { display: block; font-size: var(--fs-13); color: var(--ink-muted); }
.ratio-result { flex: 0.62; background: var(--result-bg); box-shadow: inset 0 0 0 1.5px var(--result-line); }   /* a short label: the other two get the room */
.ratio-result .ratio-label { color: var(--result-ink); opacity: 0.75; }
.ratio-result .ratio-value { color: var(--result-ink); }
.ratio-op { display: grid; place-items: center; font-size: var(--fs-22); color: var(--ink-muted); }
/* Each box spans three rows of the row's own grid (label, value, note), as the result tiles do,
   so the big numbers stand on one line even when one label takes two. .ratio-eq is the row
   "a ÷ b = result" (charts.js); without it the boxes share the width equally. Browsers without
   subgrid keep the flex row above. */
@supports (grid-template-rows: subgrid) {
  .ratio { display: grid; grid-template-rows: auto auto auto; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0 12px; }
  .ratio.ratio-eq { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 0.62fr); }
  .ratio-box { grid-row: span 3; display: grid; grid-template-rows: subgrid; align-content: start; }
  .ratio-op { grid-row: span 3; }
}

.partition { margin-bottom: 16px; }
.partition-title { font-size: var(--fs-13); color: var(--ink-2); margin-bottom: 8px; }
.partition-bar { display: flex; gap: 2px; height: 28px; margin-bottom: 10px; }
.partition-seg {
  flex-basis: 0; min-width: 2px; border-radius: 4px; padding: 0 9px; overflow: visible; white-space: nowrap;
  display: flex; align-items: center; font-size: var(--fs-13); font-weight: 600; font-variant-numeric: tabular-nums;
}
.partition-signal { background: var(--signal); color: var(--surface); }
.partition-noise { background: var(--noise); color: var(--ink); }
.partition .legend { margin-bottom: 0; }

/* a step that makes two separate points */
.sub-block + .sub-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--grid); }
.sub-title { margin-bottom: 10px; }
/* the subheadings inside a step are page text that may hold symbols (multiple regression:
   "How sure can we be about b₁?"), so they keep their case instead of being set in capitals */
h4.sub-title { font-size: var(--fs-14); text-transform: none; letter-spacing: 0; }
/* regression: the question and the caption of its bar share one line */
.sub-block-fit { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 14px; }
.sub-block-fit > * { flex: 0 0 100%; min-width: 0; }
.sub-block-fit > .sub-title, .sub-block-fit > .partition-title { flex: 0 1 auto; margin-bottom: 8px; }
.sub-block .partition { margin-bottom: 0; }
.sub-block .partition + .ratio { margin-top: 12px; }

/* ---------------------------------------------------------------------------
   Result card
   --------------------------------------------------------------------------- */
.result { padding: 20px 22px 22px; }
.tiles { display: grid; grid-template-columns: repeat(var(--tile-cols, 4), minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
/* Each tile spans three rows of the row's own grid (label, value, note), so every value starts
   at the same height even when one label wraps to two lines (moderation: "ΔR² (added by the
   interaction)"). A tile with more parts should group them into three children. */
.tile {
  min-width: 0; padding: 12px; border-radius: 8px; background: var(--surface-2);
  display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start;
}
/* subscripts and superscripts (d_z, b₃, U₃) never make their line taller, so a label or value
   holding one sits on the same baseline as its neighbours */
.tile sub, .tile sup, .tiles-note sub, .tiles-note sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
.tile sub, .tiles-note sub { bottom: -0.25em; }
.tile sup, .tiles-note sup { top: -0.5em; }
.tile-wide { grid-column: span 2; }                 /* intervals need the room of two tiles */
.tile-label { font-size: var(--fs-13); color: var(--ink-2); }
.tile-value { font-size: var(--fs-22); font-weight: 600; line-height: 1.3; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-note { font-size: var(--fs-13); color: var(--ink-muted); }
/* small print under the whole row of tiles (ctx.setTiles(list, { note })) */
.tiles-note { margin-top: 8px; font-size: var(--fs-13); line-height: 1.5; color: var(--ink-muted); }

/* the term list, folded under "What do these numbers mean?": the terms' column is as wide as
   the longest of them, one grid for all rows */
.glossary-fold { margin-top: 14px; }
.glossary { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 4px 14px; margin: 10px 0 0; font-size: var(--fs-13); line-height: 1.5; color: var(--ink-2); }
.glossary div { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
.glossary dt { font-weight: 600; color: var(--ink); max-width: 240px; }   /* one long term does not take half the width from the definitions */
.glossary dd { margin: 0; }
.result-extra { margin-top: 14px; }
/* "In plain words" and, under it, "How you would report it": one above the other, so a short
   write-up leaves no empty half-card beside a long text; both keep to a readable line length */
.result-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 46em; margin-top: 22px; }
.result-cols h4 { margin-bottom: 8px; }
.plain { font-size: var(--fs-16); }
.plain-para { display: block; margin-top: 8px; }
/* the write-up: no orphaned last word, and a line that begins with a full-width bracket does not look indented */
.apa { padding: 12px 14px; border-radius: 8px; background: var(--surface-2); font-size: var(--fs-15); text-wrap: pretty; text-spacing-trim: trim-start; }

table { border-collapse: collapse; width: 100%; font-size: var(--fs-14); font-variant-numeric: tabular-nums; }
th, td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--grid); }
th { font-weight: 600; color: var(--ink-2); font-size: var(--fs-13); }
th:first-child, td:first-child { text-align: left; }
.stat-table td:first-child { font-weight: 600; }
/* numbers never break across lines ("< .001", "[0.08, 1.28]", "2,&nbsp;22") */
.stat-table td:not(:first-child) { white-space: nowrap; }

.data-table { font-size: var(--fs-14); }
/* under a chart: the link that opens the data as a table */
.table-slot { position: relative; margin-top: 6px; }
.data-note { margin-top: 8px; color: var(--ink-muted); }
.data-scroll { max-height: 252px; overflow: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; }
/* the scrolling box takes keyboard focus (charts.js), so the arrow keys scroll it */
.data-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.data-scroll th { position: sticky; top: 0; background: var(--surface-2); }

/* ---------------------------------------------------------------------------
   Try this, misunderstandings, formulas, pager
   --------------------------------------------------------------------------- */
/* "Try this": a row of cards at the full width of the page, numbered. A card shows what to
   do and "Set this up"; what happens appears once it has been set up (core.js). */
.try-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; counter-reset: try; }
.try-list > li { display: flex; flex-direction: column; gap: 8px; min-width: 0; counter-increment: try; }
.try-card { padding: 14px 16px; }
.try-do { font-weight: 600; }
.try-card .try-do::before { content: counter(try); margin-right: 8px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.try-see { font-size: var(--fs-15); line-height: 1.5; color: var(--ink-2); }
.try-list li span { color: var(--ink-2); }
.try-action { margin-top: auto; padding-top: 2px; }

/* three equal columns from 1180px; narrower, two, and an odd card out closes the grid at full width.
   Each card is a <details>: the claim is on show, a click opens what is wrong with it.
   align-items: start so that an opened card grows alone; the closed cards of a row are made
   equally tall by PSV.ui.myths (a min-height on each claim), so their lower edges line up. */
.myths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.myth { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.myth > summary { padding: 14px 16px; list-style: none; cursor: pointer; border-radius: var(--radius); }
.myth > summary::-webkit-details-marker { display: none; }
.myth > summary::after {
  content: ""; flex: none; align-self: center; margin-left: auto; width: 7px; height: 7px;
  border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: rotate(-45deg); transition: transform 0.15s;
}
.myth[open] > summary::after { transform: rotate(45deg) translate(-2px, -1px); }
/* opened, a claim is only as tall as its own words (over the height PSV.ui.myths gave it), so the answer follows it directly */
.myth[open] > summary { min-height: 0 !important; }
.myth > summary:hover { color: var(--link); }
.myth > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 1179px) {
  .myths { grid-template-columns: 1fr 1fr; }
  .myth:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.myth-claim { font-weight: 600; display: flex; gap: 10px; align-items: baseline; }
.myth-tag {
  flex: none; font-size: var(--fs-min); font-weight: 600;
  padding: 2px 7px; border-radius: 4px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border);
}
.myth-fix { color: var(--ink-2); margin: 0; padding: 0 16px 14px; font-size: var(--fs-15); }

/* "In real research" (PSV.ui.practice): one card per illustrative study */
.practice-cases { display: grid; gap: 16px; }
/* A practice case in two rows. The study: its name, then the question and the design beside
   the result as it might be reported. Under it, "You can say" beside "You cannot say" (the
   study beside both lists left one side up to 180px shorter than the other). */
.case { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 20px 22px; }
.case-main {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start;
  grid-template-areas: "tag tag" "title title" "facts sub" "facts result"; grid-template-rows: auto auto auto 1fr;
}
.case-tag { grid-area: tag; justify-self: start; }
.case-title { grid-area: title; }
.case-facts { grid-area: facts; }
.case-main > .case-sub { grid-area: sub; }
.case-result { grid-area: result; }
.case-tag {
  display: inline-block; margin-bottom: 10px; padding: 2px 7px; border-radius: 4px;
  font-size: var(--fs-min); font-weight: 600;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border);
}
.case-title { font-size: var(--fs-18); margin-bottom: 12px; }
.case-facts { display: grid; gap: 10px; margin: 0; font-size: var(--fs-15); }
.case-facts dt { font-size: var(--fs-13); font-weight: 600; color: var(--ink-2); }
.case-facts dd { margin: 2px 0 0; }
.case-sub { margin-bottom: 8px; }
.case-result { font-size: var(--fs-15); }
.case-say { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; padding-top: 16px; border-top: 1px solid var(--grid); }
.say-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: var(--fs-15); line-height: 1.5; }
.say-list li { display: flex; gap: 10px; align-items: flex-start; }
.say-mark { flex: none; position: relative; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; }
.is-yes .say-mark { background: var(--ink); }
.is-yes .say-mark::after {
  content: ""; position: absolute; left: 4.5px; top: 5px; width: 8px; height: 4px;
  border-left: 2px solid var(--surface); border-bottom: 2px solid var(--surface); transform: rotate(-45deg);
}
.is-no .say-mark { border: 1.5px solid var(--ink-2); }
.is-no .say-mark::before, .is-no .say-mark::after {
  content: ""; position: absolute; left: 3.5px; top: 6.75px; width: 8px; height: 1.5px; background: var(--ink-2);
  transform: rotate(45deg);
}
.is-no .say-mark::after { transform: rotate(-45deg); }

/* One list, one formula per row: the formula at the left, what it says at the right, hairlines
   between the rows (two columns of cards left the shorter cards half empty). A formula too
   long for its column (core.js measures it) gets the row's whole width, its caption under it. */
.formula-list { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.formula { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); align-items: center; gap: 10px 36px; padding: 16px 22px; }
.formula + .formula { border-top: 1px solid var(--grid); }
.formula.is-wide { grid-template-columns: minmax(0, 1fr); }
.formula-math { font-size: var(--fs-18); text-align: center; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
/* a font with mathematical layout tables, so roots, sums and accents are drawn properly;
   all of these ship with the operating system, nothing is downloaded */
math { font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", math; }
.formula p { color: var(--ink-2); font-size: var(--fs-15); }

/* "This page helped" (PSV.ui.like, with config.likes): one quiet button on a line of its own,
   centred between the folded sections and previous / next. It is there but not shown until
   the count has arrived, so nothing moves when it appears. Liked: the heart is filled. */
.like { display: flex; justify-content: center; margin-top: 48px; }
.like + .pager { margin-top: 40px; }
.like-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 12px; color: var(--ink-2); visibility: hidden; }
.like.is-ready .like-btn { visibility: visible; }
.like-btn:hover, .like-btn[aria-pressed="true"] { color: var(--ink); }
.like-heart { display: grid; }
.like-heart path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.like-btn[aria-pressed="true"] .like-heart { color: var(--series-2); }
.like-btn[aria-pressed="true"] .like-heart path { fill: currentColor; }
.like-n { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.like-n::before { content: "\00b7"; margin-right: 8px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; }
/* the links that lead on: the next stop of the beginner path first (its number in a badge), then "Next" */
.pager-fwd { display: flex; gap: 16px; margin-left: auto; }
.pager-dir { display: flex; align-items: center; gap: 7px; }
.pager-next .pager-dir { justify-content: flex-end; }
.pager-link { display: grid; gap: 2px; padding: 14px 18px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 240px; font-weight: 600; }
.pager-link:hover { border-color: var(--accent); }
/* the next stop of the beginner path outranks the plain "Next": accent border, a light tint */
.pager-path { border-color: var(--accent); background: linear-gradient(var(--flash), var(--flash)), var(--surface); }
.pager-path .pager-dir { color: var(--ink-2); }
.pager-next { text-align: right; }
.pager-dir { font-size: var(--fs-13); font-weight: 500; color: var(--ink-muted); }

/* ---------------------------------------------------------------------------
   How to use this site (pages/guide.js): text, numbered callouts, and small working
   copies of the page parts, built from the same classes as the real ones
   --------------------------------------------------------------------------- */
.guide-hero { padding-bottom: 0; }
/* a number that ties a part of the sketch to its line and to its working copy */
.guide-n {
  flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: var(--fs-13); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
  color: var(--primary-ink); background: var(--primary-bg);
}
/* the spine: the sketch of a method page, and one line per part */
.guide-spine { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 40px; align-items: center; margin-top: 22px; }
.guide-sketch { display: grid; gap: 7px; padding: 10px 32px 12px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.guide-sk {
  position: relative; display: block; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--grid);
  transition: border-color 0.15s, background 0.15s;
}
.guide-sk > .guide-n { position: absolute; right: -27px; top: 50%; margin-top: -11px; box-shadow: 0 0 0 2px var(--surface); }
.guide-sk:hover, .guide-sk.is-on { border-color: var(--accent); background: var(--flash); }
.guide-sk-bar { height: 9px; border-radius: 3px; background: var(--grid); }
.guide-sk-line { display: block; height: 6px; width: 64%; border-radius: 3px; background: var(--axis); }
.guide-sk-line.is-title { height: 10px; width: 44%; background: var(--ink-2); }
.guide-sk-hero { display: grid; gap: 6px; padding: 9px 8px; border-style: dashed; background: transparent; }
.guide-sk-logic, .guide-sk-try { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; height: 36px; padding: 5px; }
.guide-sk-try { grid-template-columns: repeat(3, 1fr); height: 30px; }
.guide-sk-steps { display: grid; gap: 5px; padding: 5px; }
.guide-sk-steps > span:not(.guide-n) { height: 20px; }
.guide-sk-logic > span:not(.guide-n), .guide-sk-try > span:not(.guide-n), .guide-sk-steps > span:not(.guide-n) {
  border-radius: 3px; background: var(--surface); border: 1px solid var(--axis);
}
.guide-sk-explore { display: grid; grid-template-columns: 30% minmax(0, 1fr); gap: 7px; }
.guide-sk-panel { display: grid; align-content: start; gap: 9px; padding: 10px 8px; }
.guide-sk-panel > .guide-sk-line { width: 100%; height: 4px; }
.guide-sk-panel > .guide-n { right: auto; left: 50%; margin-left: -11px; box-shadow: 0 0 0 2px var(--surface-2); }
.guide-sk-stage { display: grid; gap: 7px; }
.guide-sk-result { height: 38px; }
.guide-sk-fold { height: 16px; }   /* the folded sections: one line each, far enough apart for their numbers */
.guide-parts { display: grid; grid-template-columns: max-content minmax(0, 1fr); row-gap: 1px; margin: 0; padding: 0; list-style: none; }
.guide-parts li {
  grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; column-gap: 20px; align-items: start;
  padding: 7px 12px; border-radius: 8px; transition: background 0.15s;
}
.guide-parts li.is-on { background: var(--surface-2); }
.guide-parts a { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; line-height: 22px; color: var(--ink); text-decoration: none; }
.guide-parts a:hover, .guide-parts li.is-on a { color: var(--link); }
.guide-parts p { font-size: var(--fs-15); line-height: 22px; color: var(--ink-2); }
/* the working copy: a method page in a frame, the same numbers in its margins */
.guide-page { position: relative; margin-top: 32px; padding: 0 32px 36px 44px; border: 1px solid var(--axis); border-radius: 14px; }
.guide-part { position: relative; scroll-margin-top: 16px; }
.guide-part:focus:not(:focus-visible) { outline: none; }
.guide-part > .guide-n { position: absolute; left: -33px; top: 0; }
.guide-top { padding: 28px 0 4px; }
.guide-top > .guide-n { top: 58px; }
.guide-title { font-size: var(--fs-36); line-height: 1.15; letter-spacing: -0.02em; }
.guide-top .tour-btn { text-decoration: none; }
.logic.guide-logic { margin-top: 20px; }
.explore.guide-explore { margin-top: 24px; column-gap: 44px; }   /* room for the numbers of the steps and the result */
/* the panel stays in view beside the steps, as on a method page (the wrapper is the sticky one) */
.guide-panel { position: sticky; top: 16px; }
.guide-panel > .controls { position: static; max-height: none; }
.guide-panel > .guide-n { top: 14px; }
.guide-steps { display: grid; gap: 12px; }
.guide-steps > .guide-n, .guide-result > .guide-n { top: 16px; }
/* where the model page's charts are drawn but not shown (guide.js) */
.guide-offstage { position: absolute; left: -9999px; top: 0; width: 760px; visibility: hidden; pointer-events: none; }
.guide-try { margin-top: 40px; }
.guide-try > h2 { margin-bottom: 14px; }
.guide-try > .guide-n { top: 3px; }
.guide-folds { margin-top: 40px; }
.guide-folds .guide-n { top: 17px; }
/* the misunderstandings stand between two folds: the same air as on a method page */
.guide-myths { margin-top: 56px; margin-bottom: 56px; }
.guide-myths > h2 { margin-bottom: 18px; }
.guide-folds .guide-myths > .guide-n { top: 3px; }
.guide-start { margin-top: 32px; text-align: center; }
.guide-start .btn { padding: 10px 22px; font-size: var(--fs-16); text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .guide-sk, .guide-parts li { transition: none; } }

/* ---------------------------------------------------------------------------
   The big picture: the concept map (pages/big-picture.js, data in concepts.js)
   Bands are framed groups; inside each, a grid of boxes (columns = tiers). The arrows are
   one SVG laid over the whole map, drawn from the boxes' measured positions.
   --------------------------------------------------------------------------- */
/* a short hero and tight gaps: at 1320 x 900 the whole map is on the first screen */
.map-hero { padding: 28px 0 0; }
.map-hero h1 { font-size: var(--fs-36); }
.map-hero .lede { max-width: 820px; margin-top: 8px; font-size: var(--fs-18); }
.cmap-section { margin-top: 18px; }
.cmap-legend { display: flex; flex-wrap: wrap; gap: 6px 24px; list-style: none; margin: 0 0 12px; padding: 0; font-size: var(--fs-14); color: var(--ink-2); }
.cmap-legend li { display: inline-flex; align-items: center; gap: 8px; }
.cmap-key { flex: none; display: inline-block; width: 22px; height: 14px; border-radius: 4px; }
.cmap-key.is-page { background: var(--surface); border: 1.5px solid var(--ink-2); }
.cmap-key.is-idea { background: var(--surface-2); border: 1.5px dashed var(--ink-muted); }
.cmap-key.is-arrow { position: relative; height: 10px; border-radius: 0; }
.cmap-key.is-arrow::before { content: ""; position: absolute; left: 0; right: 5px; top: 4px; height: 1.5px; background: var(--ink-muted); }
.cmap-key.is-arrow::after {
  content: ""; position: absolute; right: 0; top: 1px; width: 0; height: 0;
  border-left: 7px solid var(--ink-muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}
/* a two-way arrow (drawn as a small SVG by big-picture.js) */
.cmap-key.is-both { width: 26px; height: 10px; border-radius: 0; }
.cmap-key.is-both svg { display: block; }
/* the beginner path (config.featured): its pages carry their number, on the map and in the key */
.cmap-step {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  font-size: var(--fs-min); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; color: var(--surface); background: var(--ink);
}
.cmap-node > .cmap-step { position: absolute; left: -8px; top: -8px; box-shadow: 0 0 0 2px var(--surface-2); }
.cmap-key.is-path { display: inline-flex; gap: 3px; width: auto; height: auto; }
.cmap { position: relative; }
.cmap-edges { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; overflow: visible; }   /* over the bands' backgrounds, under the boxes */
.cmap-row { position: relative; display: flex; gap: 20px; align-items: stretch; }
.cmap-band {
  min-width: 0; padding: 14px 16px 18px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.cmap-band-title { font-size: var(--fs-13); font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
.cmap-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: 30px; row-gap: 22px; align-items: center; }
.cmap-node {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 7px 10px; border-radius: 8px; text-align: center; text-decoration: none; overflow-wrap: break-word;
  font-size: var(--fs-14); line-height: 1.3; color: var(--ink);
  transition: opacity 0.15s, border-color 0.15s, background 0.15s;
}
.cmap-label { text-wrap: balance; }
.cmap-node.is-page { font-weight: 600; background: var(--surface); border: 1.5px solid var(--ink-2); }
.cmap-node.is-idea { background: var(--surface); border: 1.5px dashed var(--ink-muted); color: var(--ink-2); }
a.cmap-node:hover, .cmap-node.is-active { border-color: var(--accent); border-style: solid; color: var(--ink); }
.cmap-node.is-active { box-shadow: 0 0 0 3px var(--flash); }
.cmap.is-focus .cmap-node:not(.is-active):not(.is-near) { opacity: 0.38; }
.cmap-edge path { fill: none; stroke: var(--ink-muted); stroke-width: 1.5; transition: opacity 0.15s; }
.cmap-edge.is-band path { stroke-dasharray: 5 4; }
.cmap-edge.is-on path { stroke: var(--ink); stroke-width: 2.25; }
.cmap.is-focus .cmap-edge:not(.is-on) { opacity: 0.22; }
.cmap-edge-label {
  font-family: var(--font); font-size: var(--fs-13); fill: var(--ink-muted);
  paint-order: stroke; stroke: var(--surface-2); stroke-width: 4px; stroke-linejoin: round;
}
.cmap-edge.is-on .cmap-edge-label { fill: var(--ink); }
/* between two rows of bands: the words of the links that join them */
.cmap-link { display: flex; justify-content: center; padding: 16px 0 22px; }
.cmap-link-label {
  position: relative; z-index: 2; max-width: 660px; padding: 6px 14px; border-radius: 8px; text-align: center;
  font-size: var(--fs-14); line-height: 1.45; color: var(--ink-2); background: var(--page); border: 1px dashed var(--axis);
}
/* what the box in focus is: a small floating box next to it (the look of the site's popover),
   placed by big-picture.js under the box, or over it when the window has no room below */
.cmap-tip {
  position: absolute; z-index: 5; left: 0; top: 0; width: max-content; max-width: 300px; padding: 8px 10px; border-radius: 8px;
  font-size: var(--fs-13); line-height: 1.4; text-align: left; color: var(--ink-2); background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 6px 20px var(--shadow); pointer-events: none; visibility: hidden; opacity: 0; transition: opacity 0.12s;
}
.cmap-tip.is-on { visibility: visible; opacity: 1; }
.cmap-tip strong { font-weight: 600; color: var(--ink); }
.cmap-tip-see { margin-top: 4px; color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) { .cmap-tip { transition: none; } }
/* big-picture.js measures labels with this (off-screen, never shown) */
.cmap-measure { position: absolute; left: -9999px; top: 0; white-space: nowrap; visibility: hidden; font-size: var(--fs-14); font-weight: 600; line-height: 1.3; }
/* narrower windows: tighter gaps and boxes, so long names still fit in two lines */
@media (max-width: 1180px) {
  .cmap-band { padding: 12px 12px 16px; }
  .cmap-grid { column-gap: 20px; }
  .cmap-node { padding: 7px 7px; }
  .cmap-row { gap: 16px; }
}
.cmap-details > summary { color: var(--link); font-weight: 600; gap: 8px; }
.cmap-list { margin: 14px 0 0; padding-left: 0; list-style: none; display: grid; gap: 18px; max-width: 900px; }
.cmap-list h3 { margin-bottom: 4px; }
.cmap-list ul { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 6px; font-size: var(--fs-15); }
.cmap-list-rel { color: var(--ink-muted); }
.cmap-more { margin-top: 28px; }

/* text for screen readers only */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   The tour (PSV.ui.tour): a light on one part of the page, the rest dimmed, and a card
   --------------------------------------------------------------------------- */
.tour { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
/* the dimmed page takes the clicks while the tour runs, and does nothing with them */
.tour-backdrop { position: fixed; inset: 0; pointer-events: auto; background: transparent; }
.tour-spot {
  position: fixed; border-radius: 12px; box-shadow: 0 0 0 4000px var(--tour-dim);
  outline: 2px solid var(--focus); transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.tour.no-motion .tour-spot { transition: none; }
.tour-card {
  position: fixed; left: 0; top: 0; width: 300px; padding: 14px 16px; pointer-events: auto;
  color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
}
.tour-card:focus { outline: none; }
.tour-card .tour-close { position: absolute; top: 8px; right: 8px; }
/* progress: one dot per stop, the current one in ink ("n of N" is there for screen readers) */
.tour-count { display: flex; align-items: center; height: 16px; }
.tour-dots { display: inline-flex; align-items: center; gap: 5px; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--axis); }
.tour-dot.is-done { background: var(--ink-muted); }
.tour-dot.is-on { width: 8px; height: 8px; background: var(--ink); }
.tour-title { font-size: var(--fs-18); line-height: 1.3; margin: 2px 26px 6px 0; }
.tour-text { font-size: var(--fs-15); line-height: 1.5; color: var(--ink-2); }
.tour-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.tour-actions .btn:disabled { opacity: 0.45; cursor: default; }
.tour-next { color: var(--primary-ink); background: var(--primary-bg); border-color: var(--primary-bg); }
.tour-next:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* ---------------------------------------------------------------------------
   Reduced motion: nothing slides, lifts or fades (the lights of .is-spot and .is-flash go out
   at once, see there; folds open at once and the tour's light jumps, core.js)
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  :is(a.topic, .way-card, .logic-box.has-link, .cmap-node, .logic-step-n, .hv-dot, .tmap-node, .tmap-edge, .tmap-band, .tmap-label, .about-q > summary::before) { transition: none; }
  :is(a.topic, .way-card, .logic-box.has-link):is(:hover, :focus-visible, :has(:focus-visible)) { transform: none; }
  :is(.fold, .data-table, .cmap-details) > summary::before, .fold-btn::before { transition: none; }
  .tour-spot { transition: none; }
}

noscript p { width: min(1180px, 100% - 64px); margin: 40px auto; }

/* A page whose scripts did not arrive (a dropped connection, a blocked file) would stay blank
   without a word: after four seconds with nothing in <main>, it says what to do. Written here
   because the texts themselves may be what failed to load. A page that builds never shows it. */
main:empty::after {
  content: "This page did not load completely. Please reload it.  \9875\9762\6CA1\6709\52A0\8F7D\5B8C\6574\FF0C\8BF7\5237\65B0\91CD\8BD5\3002";
  display: block; width: min(1180px, 100% - 64px); margin: 40px auto; color: var(--ink-2);
  opacity: 0; animation: psv-late 0.01s linear 4s forwards;
}
@keyframes psv-late { to { opacity: 1; } }
@media (scripting: none) { main:empty::after { content: none; } }
