/* Engineering Mechanics course: light theme only (docs/visual-spec.md).
   Text sits in a ~68ch column; widgets break out wider so drawings have room.
   Colours for drawings come from design/tokens.css (loaded first). The k-* rules here are
   zero-specificity fallbacks (:where) so the designer's tokens always win. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --fg: #1d2330;
  --muted: #5a6372;
  --rule: #e2e5ea;
  --link: #1458a8;
  --link-visited: #5b3a99;
  --focus: #1458a8;
  --notice-bg: #fff4d6;
  --notice-fg: #5c4400;
  --error: #b42318;
  --error-bg: #fef3f2;
  --right: #1b6b3a;
  --right-bg: #ecf7ef;
  --wrong: #b42318;
  --wrong-bg: #fef3f2;

  /* Drawing colours (--c-*), --font-ui and --font-math come from design/tokens.css only. */
  --font-text: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-num: KaTeX_Main, "Times New Roman", serif;

  --measure: 68ch;
  --wide: 1000px;
  --radius: 10px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* top/left pin it to its containing block, so a hidden label inside a scrolled table can't widen the page. */
.visually-hidden {
  position: absolute !important;
  top: 0;
  left: 0;
  margin: -1px;
  padding: 0;
  border: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 1rem;
  top: 0.5rem;
  z-index: 20;
  background: var(--bg);
  padding: 0.25rem 0.5rem;
}

/* ---------- Page frame ---------- */

main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1rem 5rem;
}
main > *,
article > *,
.prose > * {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}
main > article,
article > .prose,
.prose > .widget,
.prose > .table-wrap,
.prose > .big-idea {
  max-width: var(--wide);
}

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(6px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-ui);
  font-size: 0.875rem;
}
.crumbs {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.55rem 1rem 0.35rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Sticky chapter strip: where you are, every section one tap away, reading progress. */
.chapter-nav {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1rem 0.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.25rem 1rem;
  position: relative;
}
.cp-menu {
  position: relative;
}
.cp-menu > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  white-space: nowrap;
  padding: 0.2rem 0;
}
.cp-menu > summary::-webkit-details-marker {
  display: none;
}
.cp-menu > summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.8em;
}
.cp-chapter {
  font-weight: 600;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-where {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cp-menu > ol {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 11;
  margin: 0.3rem 0 0;
  padding: 0.4rem;
  list-style: none;
  min-width: min(22rem, calc(100vw - 2rem));
  max-height: 70vh;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20, 30, 50, 0.12);
}
.cp-menu > ol a {
  display: flex;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
}
.cp-menu > ol a:hover {
  background: var(--bg-soft);
}
.cp-menu > ol a[aria-current] {
  background: var(--bg-soft);
  font-weight: 600;
}
.cp-num {
  color: var(--muted);
  min-width: 1.4em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cp-done .cp-num::before {
  content: "✓ ";
}
.cp-track {
  display: flex;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.cp-track li {
  flex: 1;
  min-width: 0;
}
.cp-seg {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--rule);
  position: relative;
}
.cp-seg::after {
  /* a taller invisible hit area for touch */
  content: "";
  position: absolute;
  inset: -10px 0;
}
.cp-seg.cp-done {
  background: #9cc0e6;
}
.cp-seg.cp-current {
  background: var(--link);
}
.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
}
.read-progress > span {
  display: block;
  height: 100%;
  background: var(--link);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}
a:visited {
  color: var(--link-visited);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-ui);
  line-height: 1.25;
  margin: 2em auto 0.6em;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 2.1rem;
  margin-top: 2rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.2rem;
}
h4 {
  font-size: 1.05rem;
}

.page-head {
  margin-bottom: 2rem;
}
.page-head h1 {
  margin-bottom: 0.3rem;
}
.summary {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 0.3rem;
}

p,
ul,
ol {
  margin-top: 0;
  margin-bottom: 1em;
}
li + li {
  margin-top: 0.3em;
}

code,
kbd,
pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.86em;
}
:not(pre) > code {
  background: var(--bg-soft);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}
pre {
  background: var(--bg-soft);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border-radius: 8px;
  line-height: 1.45;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem auto;
}

.prose svg.figure-svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.75rem auto;
}
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.75rem auto;
  color: var(--fg);
  font-size: 0.9rem;
  font-family: var(--font-ui);
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.25em;
}
table {
  border-collapse: collapse;
  font-size: 0.95em;
  margin: 0 auto;
  font-variant-numeric: tabular-nums;
}
th,
td {
  border: 1px solid var(--rule);
  padding: 0.35em 0.7em;
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--bg-soft);
  font-family: var(--font-ui);
  font-size: 0.92em;
}

/* ---------- Math ---------- */

.katex {
  font-size: 1.08em;
}
.math-display,
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}
.math-display {
  margin-top: 1em;
  margin-bottom: 1em;
}
.math-display > .katex-display {
  margin: 0;
  padding: 0.25em 0;
}
.math-inline-wide {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
  padding: 0.1em 0;
}
.katex-error,
.math-error {
  color: var(--error) !important;
  background: var(--error-bg);
  border-bottom: 1px dashed var(--error);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  white-space: pre-wrap;
}

/* ---------- Callouts: cards ---------- */

blockquote {
  margin: 1.5em auto;
  padding: 0.1em 1em;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}
blockquote.callout {
  --accent: var(--c-distance);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.9em 1.2em 1em;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.04);
}
blockquote.callout > :last-child {
  margin-bottom: 0;
}
.callout-label {
  display: block;
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
blockquote.callout-example {
  --accent: #1458a8;
}
blockquote.callout-try-it {
  --accent: #1b6b3a;
}
blockquote.callout-common-mistake {
  --accent: #b42318;
}
blockquote.callout-why-it-matters {
  --accent: #8a5a00;
}
blockquote.callout-key-idea {
  --accent: #5b3a99;
}
blockquote.callout-predict {
  --accent: #0e6e7a;
}
blockquote.callout-real-world {
  --accent: #5a6372;
}
blockquote.callout-challenge {
  --accent: #8a2f6b;
}

/* The page shape's four parts (playbook page-shape.md). */
/* The question: the page's one question, set as a lead line, not a box. */
blockquote.callout-question {
  border: 0;
  border-left: 3px solid var(--c-ink, #1b1f24);
  border-radius: 0;
  padding: 0.1rem 0 0.1rem 1rem;
  background: none;
  font-size: 1.2rem;
  line-height: 1.45;
}
blockquote.callout-question .callout-label {
  font-size: 0.75rem;
}
/* You need: what to know first; quiet, so it doesn't compete with the question. */
blockquote.callout-you-need {
  --accent: var(--c-ink-muted, #50575f);
  background: var(--bg-soft);
  border-top-width: 1px;
}
/* New letters, old meanings: a symbol's first appearance. */
blockquote.callout-new-letters {
  --accent: var(--c-distance, #0a6cc4);
}
/* Close: summary, recap, and the Wonder paragraph. */
blockquote.callout-close {
  --accent: var(--c-ink, #1b1f24);
}
blockquote.callout-close p > strong:first-child {
  font-family: var(--font-ui);
}

/* The page's first Key idea is its Big idea: a full-width banner holding the hero diagram. */
blockquote.big-idea {
  max-width: var(--wide);
  border: 0;
  border-left: 0;
  border-radius: 14px;
  background: #f4f1fa;
  padding: 1.3rem 1.5rem 1.4rem;
  font-size: 1.2rem;
  line-height: 1.5;
}
blockquote.big-idea .callout-label {
  font-size: 0.8rem;
}
blockquote.big-idea img {
  margin: 1rem auto 0;
  background: #fff;
  border-radius: 10px;
  padding: 0.75rem;
}

details.challenge-answer {
  margin-top: 0.75rem;
  border-top: 1px dashed var(--rule);
  padding-top: 0.6rem;
}
details.challenge-answer > summary,
.quiz-reveal > summary,
.block-error summary {
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--link);
}

.notice {
  background: var(--notice-bg);
  color: var(--notice-fg);
  padding: 0.6em 0.9em;
  border-radius: 8px;
  font-size: 0.95em;
}

/* ---------- Controls: .k-button, .k-slider, .k-control are in design/tokens.css ---------- */

.ctl-num {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.ctl-num input {
  width: 7ch;
  min-height: 40px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--c-construction, #848c96);
  border-radius: 6px;
}
.ctl-num input[aria-invalid="true"] {
  border-color: var(--error);
  background: var(--error-bg);
}

/* ---------- Widgets: the drawing sits on the page (no card), see design/tokens.css .k-widget ---------- */

.prose > figure.widget {
  max-width: var(--widget-max, 720px);
}
.widget-fallback {
  padding: 1.25rem 1.4rem;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 0.95rem;
}
.widget-fallback p {
  margin: 0;
}
.widget-fallback-title {
  font-weight: 700;
  margin-bottom: 0.25rem !important;
}
.js .widget-fallback {
  min-height: 300px;
}
.widget-drawing {
  position: relative;
  line-height: 0;
}
.stage-cell {
  min-width: 0;
  line-height: 0;
}
.stage-cell > svg {
  display: block;
  max-width: 100%;
  height: auto;
}
/* Lines of action run "to infinity"; keep them inside the drawing. */
.k-widget .widget-drawing svg {
  overflow: hidden;
}
.widget-panel {
  display: grid;
  /* minmax(0, 1fr): a long equation scrolls inside its box instead of widening the panel. */
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.widget-plots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.25rem 1.25rem;
}
.widget-plots:empty {
  display: none;
}
.widget-stage {
  position: relative;
}
/* Reset: quiet text in the drawing's top-right corner (design/README.md rule 9). */
.widget-reset {
  position: absolute;
  top: -10px;
  right: 0;
  z-index: 1;
  background: transparent;
  border: 0;
}
.widget-controls:empty {
  display: none;
}
/* Drawing and plot side by side (resolve), the equation under both; stacked on phones. */
.widget-stage.is-side {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  grid-template-areas: "draw plot" "eq eq";
  column-gap: 0.5rem;
  align-items: center;
}
.is-side > .widget-panel {
  display: contents;
}
.is-side .widget-drawing {
  grid-area: draw;
}
.is-side .widget-plots {
  grid-area: plot;
  grid-template-columns: minmax(0, 1fr);
}
.is-side .widget-eq {
  grid-area: eq;
  margin-top: 0.5rem;
}
@media (max-width: 560px) {
  .widget-stage.is-side {
    display: block;
  }
  .is-side > .widget-panel {
    display: grid;
  }
  .is-side .widget-drawing,
  .is-side .widget-plots,
  .is-side .widget-eq {
    grid-area: auto;
  }
  .is-side .widget-plots {
    order: -1;
  }
}
/* An equation that may wrap after its substitution on a narrow screen. */
.eq-line.eq-wrap {
  white-space: normal;
}
.eq-seg {
  white-space: nowrap;
}
/* Same size as the first line (designer, T7704 1b): 20 px, 17 px on a phone, from .k-eq. */
.eq-line.eq-sub {
  color: var(--c-ink-muted, #5d636b);
}
/* "This slides": chevrons either side of a handle, on hover (and while dragging) only. */
.k-handle-g .k-cue {
  opacity: 0;
  transition: opacity var(--dur-fast, 120ms);
  pointer-events: none;
}
.k-handle-g:hover .k-cue,
.k-handle-g.is-dragging .k-cue,
/* A handle shows its own focus ring (.k-handle-focus), not a box around the group. */
.k-handle-g:focus,
.k-handle-g:focus-visible {
  outline: none;
}
.k-handle-g:focus-visible .k-cue {
  opacity: 1;
}
/* Notes on plots: UI words with maths italic variables. */
.k-note .k-var {
  font-family: var(--font-math);
  font-style: italic;
}
.k-cue {
  fill: none;
  stroke: var(--c-construction, #848c96);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.k-qsign {
  font-family: var(--font-ui);
  font-size: 12px;
  fill: var(--c-ink-muted, #50575f);
  font-variant-numeric: tabular-nums;
}
.k-qsign.is-on {
  fill: var(--c-ink, #1b1f24);
  font-weight: 600;
}
.widget-error,
.widget-pending {
  margin: 0;
  padding: 2rem 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
  background: var(--bg-soft);
  border-radius: 8px;
}
.widget-error {
  color: var(--error);
}
.ctl-seg {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--fs-caption, 14px);
}
.ctl-seg .ctl-label {
  margin-right: 0.6rem;
  color: var(--muted);
}
.ctl-seg .k-button {
  border-radius: 0;
  margin-left: -1px;
}
.ctl-seg .k-button:first-of-type {
  border-radius: 6px 0 0 6px;
}
.ctl-seg .k-button:last-of-type {
  border-radius: 0 6px 6px 0;
}
.ctl-seg .k-button[aria-checked="true"] {
  background: var(--c-surface-sunk, #f4f6f8);
  border-color: var(--c-ink, #1b1f24);
  position: relative;
}
.k-button {
  min-height: 44px;
}
.ctl-quiet {
  border-color: transparent !important;
  color: var(--link) !important;
}

/* Live equations: .k-eq in design/tokens.css; layout helpers here. */
.widget-eq {
  display: grid;
  gap: 0.2rem;
  overflow-x: auto;
}
.eq-line {
  white-space: nowrap;
}
.eq-num {
  font-variant-numeric: tabular-nums;
}
.eq-fn {
  margin: 0 0.12em 0 0.1em;
}
.eq-rel {
  padding: 0 0.32em !important;
}
.eq-abs {
  white-space: nowrap;
}
.k-var sub {
  font-size: 0.7em;
}
.eq-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  font-size: 0.92em;
}
.eq-frac-num {
  border-bottom: 1px solid currentColor;
  padding: 0 0.2em;
}
.eq-sqrt-body {
  border-top: 1px solid currentColor;
  padding: 0 0.15em;
}
/* Over a fraction the body is a box, so the root's bar runs above the numerator, not through it. */
.eq-sqrt-body:has(.eq-frac) {
  display: inline-block;
  padding-top: 0.08em;
}
/* A note under the equations: one line sits centred under them; text that wraps is left-aligned
   (designer, T7704 item 12). fit-content keeps a short note centred as a block. */
.eq-note,
.widget-eq p {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--c-ink-muted);
  white-space: normal;
  text-align: left;
  width: fit-content;
  max-width: min(100%, 62ch);
  margin: 0.2rem auto 0;
}

/* ---------- Drawing extras (everything else is in design/tokens.css) ---------- */

.k-quadrant {
  fill: var(--c-surface-sunk, #f4f6f8);
  stroke: none;
}
.stage text {
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- Worked examples (steps) ---------- */

section.steps,
section.quiz {
  margin: 2rem auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1.1rem;
  background: var(--bg);
}
.steps-kicker,
.quiz-kicker {
  margin: 0 0 0.2rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.steps-title {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
}
.steps-given,
.steps-answer {
  margin: 0 0 0.8rem;
}
.steps-label {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 0.35rem;
  color: var(--muted);
}
.steps-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 0.8rem;
}
.steps-list > .step {
  counter-increment: step;
  position: relative;
  padding: 0.55rem 0 0.55rem 2.4rem;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.steps-list > .step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  font: 700 0.85rem/1.6rem var(--font-ui);
  text-align: center;
}
.steps-list > .step[hidden] {
  display: none;
}
.steps-list > .step:focus {
  outline: none;
}
.step-in {
  animation: step-in 300ms ease-out;
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.steps-answer {
  background: var(--right-bg);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
.steps-answer[hidden] {
  display: none;
}
.steps-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
}
.steps-progress {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

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

.quiz-q {
  margin-bottom: 0.7rem;
  font-weight: 600;
}
.quiz-choices {
  list-style: none;
  padding: 0;
  margin: 0 0 0.6rem;
  display: grid;
  gap: 0.45rem;
}
.quiz-choices li {
  margin: 0;
}
/* A long word or formula in a choice wraps or scrolls inside the choice, never widens the page. */
.quiz-choices,
.quiz-choices > li {
  min-width: 0;
  max-width: 100%;
}
.quiz-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  overflow-x: auto;
}
.quiz-choice {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
  font: inherit;
  font-size: 1rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid #c9ced6;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  min-height: 44px;
  cursor: pointer;
}
.quiz-choice:disabled {
  cursor: default;
}
:not(.is-live) > .quiz-choices .quiz-choice {
  opacity: 0.85;
}
.quiz-choice:not(:disabled):hover {
  border-color: var(--link);
}
.quiz-letter {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--bg-soft);
  font: 700 0.8rem/1.6rem var(--font-ui);
  text-align: center;
}
.quiz-choice[data-state="right"] {
  border-color: var(--right);
  background: var(--right-bg);
}
.quiz-choice[data-state="right"] .quiz-letter {
  background: var(--right);
  color: #fff;
}
.quiz-choice[data-state="wrong"] {
  border-color: var(--wrong);
  background: var(--wrong-bg);
  text-decoration: line-through;
  text-decoration-color: rgba(180, 35, 24, 0.5);
}
.quiz-number {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.quiz-number input {
  font: inherit;
  width: 9ch;
  min-height: 44px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #c9ced6;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.quiz-number input[aria-invalid="true"] {
  border-color: var(--wrong);
}
.quiz-number button {
  font: 600 0.9rem var(--font-ui);
  min-height: 44px;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--link);
  background: var(--link);
  color: #fff;
  cursor: pointer;
}
.quiz-number button:disabled {
  opacity: 0.6;
  cursor: default;
}
.quiz-unit {
  font-family: var(--font-num);
}
.quiz-feedback {
  min-height: 1.4em;
  margin: 0 0 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
}
.quiz-feedback[data-state="right"] {
  color: var(--right);
}
.quiz-feedback[data-state="wrong"] {
  color: var(--wrong);
}
.quiz-reveal > div {
  padding-top: 0.5rem;
}
.quiz-explain {
  color: var(--fg);
}

/* ---------- A block that could not be shown ---------- */

.block-error {
  margin: 1.5rem auto;
  border: 1px solid #f3b7b1;
  border-left: 4px solid var(--error);
  background: var(--error-bg);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: #7a1a12;
}
.block-error p {
  margin: 0 0 0.3rem;
}
.block-error pre {
  margin: 0.5rem 0 0;
  background: #fff;
  max-height: 16rem;
}

/* ---------- Contents and pager ---------- */

.toc {
  padding-left: 1.4em;
}
.toc li {
  margin-bottom: 0.8em;
}
.toc .toc-title {
  font-weight: 600;
}
.toc p {
  margin: 0.15em 0 0;
  color: var(--muted);
  font-size: 0.95em;
}
.chapter-toc {
  margin-top: 3rem;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-ui);
}
.pager a {
  display: block;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  min-width: 0;
}
.pager a:hover {
  border-color: var(--link);
}
.pager-next {
  text-align: right;
  grid-column: 2;
}
.pager-dir {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}
.pager-title {
  display: block;
  color: var(--link);
}

@media (max-width: 560px) {
  body {
    font-size: 1.0625rem;
  }
  main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  h1 {
    font-size: 1.65rem;
  }
  h2 {
    font-size: 1.3rem;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager-next {
    grid-column: 1;
  }
  blockquote.callout,
  section.steps,
  section.quiz {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
  .widget-panel {
    padding: 0.75rem;
  }
  .widget-eq {
    font-size: 1.02rem;
  }
  .widget-reset {
    margin-left: 0;
  }
  .cp-chapter {
    max-width: 12ch;
  }
  .crumbs {
    display: none;
  }
  .chapter-nav {
    padding-top: 0.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  header.site,
  .pager,
  .widget-controls {
    display: none;
  }
}


/* Styles for the generic widgets (packs/core). learnkit adds this sheet to every course. */

/* Shared controls (src/lib/controls.ts): choices, presets, readouts, challenges. */
.gen-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); font-size: var(--fs-caption); }
.gen-choices .ctl-label { margin-right: var(--sp-1); }
.gen-presets { display: flex; flex-wrap: wrap; gap: var(--sp-2); width: 100%; }
.gen-readouts { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: var(--sp-3); row-gap: var(--sp-1); margin: 0; width: 100%; font-size: var(--fs-caption); }
.gen-readouts dt { color: var(--c-ink-muted); }
.gen-readouts dd { margin: 0; font-family: var(--font-math-upright); font-size: var(--fs-readout); font-variant-numeric: tabular-nums; }
.gen-challenge { width: 100%; font-size: var(--fs-caption); }
.gen-challenges { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.gen-challenges .is-done { color: var(--c-ink-muted); }
.gen-challenges .is-now { color: var(--c-ink); }
.gen-challenge-kicker { font-weight: 650; margin-right: 0.3em; }
.gen-hint { margin: var(--sp-1) 0 0; color: var(--c-ink-muted); }
.gen-hint-btn { min-height: 44px; }
.gen-preset { font-size: var(--fs-caption); }

/* annotated-text (packs/core): a text whose phrases are tapped, highlighted by role, or hunted for.
   A role is told by its underline style as well as its colour; right and wrong are ✓ / ✗ with an ink outline. */

.at-wrap { line-height: 1.5; color: var(--c-ink); }
.at-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-5); padding-right: 64px; min-height: 44px; }
.at-tabs .k-button[aria-pressed="true"] { text-decoration-color: var(--c-ink); text-decoration-thickness: 2px; }
.at-show { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); }
.at-show[hidden], .at-ask[hidden] { display: none; }
.at-show-label { font-size: var(--fs-value); color: var(--c-ink-muted); margin-right: var(--sp-1); }
.at-show-btn { display: inline-flex; align-items: center; gap: 6px; }
.at-show-btn[aria-pressed="true"] { text-decoration-color: var(--c-ink); text-decoration-thickness: 2px; }
.at-swatch { display: inline-block; width: 18px; height: 0; border-bottom: 2.5px solid currentColor; vertical-align: middle; }
.at-swatch.at-line1 { border-bottom-style: dashed; }
.at-swatch.at-line2 { border-bottom-style: dotted; border-bottom-width: 3px; }
.at-swatch.at-line3 { border-bottom-style: double; border-bottom-width: 4px; }
.at-swatch.at-line4 { border-bottom-style: dashed; border-bottom-width: 1.5px; }
.at-swatch:not([class*="k-"]) { color: var(--c-ink); }
.at-ask { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); margin: var(--sp-2) 0 0; font-size: var(--fs-readout); }
.at-score { font-size: var(--fs-value); color: var(--c-ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The text: room between lines so each phrase is a comfortable target. */
.at-text { margin: var(--sp-3) 0 var(--sp-2); font-size: 1.08rem; line-height: 2.25; }
.at-text p { margin: 0 0 var(--sp-2); }
.at-verse { white-space: pre-line; }
.at-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92rem; line-height: 2.1; white-space: pre;
  overflow-x: auto; padding: var(--sp-2) var(--sp-3); background: var(--c-surface-sunk); border-radius: 6px; }
.at-ph, .at-w { border-radius: 3px; padding: 9px 1px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast) var(--ease-out); outline: none; }
.at-ph { text-decoration-line: none; text-underline-offset: 5px; text-decoration-thickness: 2px; text-decoration-skip-ink: none; }
/* A lit phrase: its role's colour and line. Roles without a colour stay ink. */
.at-ph.is-lit { text-decoration-line: underline; text-decoration-color: currentColor; }
.at-ph.is-lit:not([class*=" k-"]) { color: var(--c-ink); text-decoration-color: var(--c-ink-muted); }
.at-line1 { text-decoration-style: dashed; }
.at-line2 { text-decoration-style: dotted; text-decoration-thickness: 3px; }
.at-line3 { text-decoration-style: double; }
.at-line4 { text-decoration-style: wavy; text-decoration-thickness: 1.5px; }
.at-ph:hover > .at-in, .at-w:hover > .at-in { background: color-mix(in srgb, var(--c-rule) 55%, transparent); }
.at-in { border-radius: 3px; padding: 1px 0; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.at-ph.is-sel > .at-in { background: color-mix(in srgb, currentColor 14%, transparent); }
.at-ph:focus-visible, .at-w:focus-visible { outline: none; }
.at-ph:focus-visible > .at-in, .at-w:focus-visible > .at-in { outline: 2px solid var(--c-focus); outline-offset: 2px; }
/* Find mode: nothing gives the answer away until it is found. */
.is-find .at-ph:not(.is-lit) { text-decoration-line: none; }
.is-find .at-w, .is-find .at-ph { padding: 9px 0; }
.at-ph.is-right > .at-in, .at-w.is-wrong > .at-in, .at-ph.is-wrong > .at-in { box-shadow: 0 0 0 1.5px var(--c-ink); padding: 1px 2px; }
.at-ph.is-right::after { content: "\2009✓"; color: var(--c-ink); font-weight: 650; }
.at-w.is-wrong::after, .at-ph.is-wrong::after { content: "\2009✗"; color: var(--c-ink); font-weight: 650; }

.at-panel { min-height: 3em; font-size: var(--fs-readout); }
.at-panel p { margin: 0 0 var(--sp-1); }
.at-head { font-weight: 600; }
.at-role { font-weight: 650; text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.at-role:not([class*=" k-"]) { color: var(--c-ink); }
.at-quote { font-weight: 400; }
.at-muted { color: var(--c-ink-muted); }
.at-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
@media (max-width: 559px) { .at-text { font-size: 1rem; } .at-code { font-size: 0.85rem; } }

/* chance (CATALOG.md, "chance"): words on the drawing, the roll buttons laid over it, the
   last-pair outline and the histogram's hit areas. Colours come from the kit's classes only. */

.k-widget[data-widget="chance"] .widget-drawing { position: relative; }
.ch-buttons { position: absolute; left: 4px; display: flex; flex-wrap: wrap; gap: 8px; line-height: normal; }
.ch-buttons .k-choice { padding: 0 14px; white-space: nowrap; }
.ch-count { flex-basis: 100%; margin: 0; font-size: var(--fs-value); color: var(--c-ink-muted); font-variant-numeric: tabular-nums; }

.ch-muted { font-family: var(--font-ui); font-size: var(--fs-value); fill: var(--c-ink-muted); font-variant-numeric: tabular-nums; }
.ch-result { font-family: var(--font-ui); font-size: var(--fs-readout); font-weight: 650; fill: currentColor; font-variant-numeric: tabular-nums; }
.ch-title { font-family: var(--font-ui); font-size: var(--fs-caption); font-weight: 600; fill: var(--c-ink); }
.ch-ui { font-family: var(--font-ui); font-size: var(--fs-caption); fill: var(--c-ink); }
.k-plabel.ch-ink { fill: var(--c-ink); }

/* The die and coins before the first roll: an empty, dashed outline. */
.ch-blank .k-hole { stroke-dasharray: 3 3; }
.ch-small .k-heading { font-size: 11px; }

/* The outcome grid takes the watched event's hue (the kit draws it blue). */
.ch-grid:not(.k-blue) .k-blue { color: inherit; }
.ch-grid .k-celltext.is-sel { fill: var(--c-ink); }
/* The last roll's pair in the grid, and the sample's mean: ink, never a concept colour. */
.ch-lastcell { fill: none; stroke: var(--c-ink); stroke-width: 2px; pointer-events: none; }
.ch-meanbar { fill: none; stroke: currentColor; stroke-width: 2px; }
.ch-pop { fill: none; stroke: currentColor; stroke-width: 1px; }

/* Bars and the running share take the watched event's hue. */
.ch-bars:not(.k-blue) .k-blue, .ch-share:not(.k-blue) .k-blue { color: inherit; }

/* Tap a bar to watch it; the histogram is one keyboard stop. */
.ch-hit { fill: transparent; cursor: pointer; }
.ch-hits { outline: none; }
.ch-focus { fill: none; stroke: none; pointer-events: none; }
.ch-hits:focus-visible .ch-focus { stroke: var(--c-focus); stroke-width: 2px; }

/* classify (CATALOG.md, "classify"): the tray, the bins (a list or a grid with two named axes)
   and the chips. Right and wrong are words with ✓ / ✗ and an ink outline, never a colour. */

.cl { display: grid; gap: var(--sp-4); line-height: 1.35; padding-top: var(--sp-6); }
.cl-tray { border-radius: 8px; background: var(--c-surface-sunk); padding: var(--sp-3); min-height: 72px; }
.cl-tray-label { margin: 0 0 var(--sp-2); font-size: var(--fs-caption); font-weight: 600; color: var(--c-ink); }
.cl-tray.is-empty .cl-tray-label::after { content: " (empty)"; font-weight: 400; color: var(--c-ink-muted); }
.cl-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: flex-start; min-height: 44px; }

.cl-bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--sp-3); }
.cl-bin { cursor: default; }
.cl-bin .k-bin-label { margin-top: 0; }
.cl.has-picked .cl-bin, .cl.is-dragging .cl-bin { border-color: var(--c-ink-muted); cursor: pointer; }
.cl.has-picked .cl-tray, .cl.is-dragging .cl-tray { outline: 1.5px dashed var(--c-ink-muted); outline-offset: -1.5px; cursor: pointer; }
.cl-tray.is-over { outline: 1.5px solid var(--c-ink); outline-offset: -1.5px; }
.cl-bin:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }

/* The 2 × 2 grid: the x question across the top, the y question in the corner over the row answers. */
.cl-grid { display: grid; gap: var(--sp-2); align-items: stretch; grid-template-columns: minmax(0, 9em) repeat(var(--cl-cols, 2), minmax(0, 1fr)); }
.cl-bin .k-bin-label { overflow-wrap: normal; word-break: normal; }
.cl-axis-x { font-size: var(--fs-caption); font-weight: 600; color: var(--c-ink); text-align: center; align-self: end; }
.cl-corner { grid-row: span 2; align-self: end; font-size: var(--fs-value); font-weight: 600; color: var(--c-ink); padding-right: var(--sp-2); }
.cl-corner2 { display: none; }
.cl-xbin { text-align: center; font-size: var(--fs-caption); color: var(--c-ink-muted); align-self: end; }
.cl-ybin { display: flex; align-items: center; justify-content: flex-end; padding-right: var(--sp-2); font-size: var(--fs-caption); color: var(--c-ink-muted); }

/* Chips: the item, then its verdict on its own line once checked. */
.cl-chip { flex-wrap: wrap; max-width: 100%; padding: var(--sp-2) var(--sp-3); gap: 2px var(--sp-2); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; position: relative; }
.cl-chip.is-dragging { z-index: 5; box-shadow: none; }
.cl-chip.is-picked { outline: 2px dashed var(--c-ink); outline-offset: 2px; }
.cl-chip.is-right, .cl-chip.is-wrong { border: 2px solid var(--c-ink); }
.cl-chip.is-locked { cursor: default; background: var(--c-surface); }
.cl-verdict { flex-basis: 100%; font-size: var(--fs-caption); color: var(--c-ink); }
.cl-verdict b { font-weight: 650; }
.cl-mark { font-weight: 700; }
.cl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.cl-score { margin: 0; font-size: var(--fs-readout); color: var(--c-ink); }
.cl-arrive { animation: cl-arrive var(--dur-base) var(--ease-out); }
@keyframes cl-arrive { from { transform: scale(0.96); } to { transform: none; } }

@media (max-width: 559px) {
  .cl-grid { grid-template-columns: minmax(0, 6em) repeat(var(--cl-cols, 2), minmax(0, 1fr)); }
  .cl-corner { font-size: 12px; }
  .cl-bin { padding: var(--sp-2); min-height: 72px; }
}
@media (prefers-reduced-motion: reduce) { .cl-arrive { animation: none; } }

/* compare (packs/core): versions wiped, flipped or side by side. What differs takes the hue and a
   note on the drawing; what stays the same stays grey. */

.cmp-top, .cmp-wrap { line-height: 1.5; }
.cmp-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-4); padding-right: 64px; min-height: 44px; }
.cmp-top.is-empty { min-height: 30px; }
.cmp-seg .k-button[aria-pressed="true"] { text-decoration-color: var(--c-ink); text-decoration-thickness: 2px; }

.cmp-fig * { vector-effect: non-scaling-stroke; }
.cmp-fig .is-diff [class] { color: inherit; }
.cmp-fig .is-diff :is(rect, circle, ellipse, path, polygon, polyline):not(.k-pip),
.cmp-fig :is(rect, circle, ellipse, path, polygon, polyline).is-diff:not(.k-pip) {
  fill: currentColor; fill-opacity: 0.14; stroke: currentColor; stroke-width: 2px; stroke-opacity: 1;
}
.cmp-fig .is-diff .k-pip { fill: currentColor; fill-opacity: 0.8; }
.cmp-vname { font-size: var(--fs-caption); }
.cmp-pname { font-weight: 700; }
.cmp-note.is-same .k-plabel { fill: var(--c-ink-muted); }
/* The wipe's grip is the kit's; the handle only adds the 44 px target and the focus ring. */
.cmp-wipe-h .k-handle { opacity: 0; }
.cmp-wipe-h { cursor: ew-resize; }
.cmp-stage { cursor: default; }
.cmp-fade { animation: cmp-in var(--dur-base) var(--ease-out); }
@keyframes cmp-in { from { opacity: 0; } to { opacity: 1; } }

/* Text versions. */
.cmp-texts { margin: var(--sp-2) 0; }
.cmp-texts.is-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-3) var(--sp-5); }
.cmp-vlabel { margin: 0; font-size: var(--fs-value); font-weight: 600; color: var(--c-ink-muted); }
.cmp-text { margin: var(--sp-1) 0 0; font-size: 1.12rem; line-height: 1.9; color: var(--c-ink); }
.cmp-ph { text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; border-radius: 3px; padding: 1px 0; }
.cmp-ph.is-diff { background: color-mix(in srgb, currentColor 12%, transparent); }
.cmp-line1 { text-decoration-style: dashed; }
.cmp-line2 { text-decoration-style: dotted; text-decoration-thickness: 3px; }
.cmp-line3 { text-decoration-style: double; }
.cmp-line4 { text-decoration-style: wavy; text-decoration-thickness: 1.5px; }
.cmp-ph.is-same { color: var(--c-ink); text-decoration-style: dashed; text-decoration-color: var(--c-construction); }
.cmp-notes { list-style: none; margin: var(--sp-3) 0 0; padding: 0; font-size: var(--fs-readout); color: var(--c-ink); }
.cmp-notes li { margin: 0 0 var(--sp-2); }
.cmp-notes li.is-same { color: var(--c-ink-muted); }
.cmp-notes .cmp-ph { font-weight: 600; margin-right: 0.3em; }

/* concept-map (packs/core/src/widgets/concept-map.ts). Colours only through the kit's tokens and k-* classes. */

.cm-svg { user-select: none; -webkit-user-select: none; }
.cm-build .cm-node { touch-action: none; }
.cm-svg.is-drawing { cursor: crosshair; }

/* Ideas: the kit's concept node, with a hit area and a focus ring. */
.cm-node { cursor: pointer; outline: none; }
.cm-hit { fill: transparent; stroke: none; pointer-events: all; }
.cm-node:focus-visible .cm-hit { stroke: var(--c-focus); stroke-width: 2px; }
.cm-node .k-nodetext { pointer-events: none; }
/* The chosen idea is tinted; what it needs is outlined solid, what needs it dashed; the rest grey. */
.cm-sel .k-nodebox { fill: currentColor; fill-opacity: 0.14; stroke: currentColor; stroke-width: 2px; }
.cm-sel .k-nodetext { font-weight: 650; }
.cm-up .k-nodebox { stroke: currentColor; stroke-width: 2px; }
.cm-down .k-nodebox { stroke: currentColor; stroke-width: 2px; stroke-dasharray: 5 3; }
.cm-loop .k-nodebox { stroke-dasharray: none; }
.cm-dim .k-nodebox { stroke: var(--c-rule); }
.cm-dim .k-nodetext { fill: var(--c-ink-muted); }
.cm-from .k-nodebox { stroke: var(--c-ink); stroke-width: 2.5px; }

/* Links: grey 1.25 px with an open chevron; the lit chain in the strong colour. */
.cm-edge .k-flow { stroke-width: 1.25px; }
.cm-on .k-flow { stroke-width: 2px; }
.cm-elab { font-size: var(--fs-value); font-style: italic; }
.is-sel .cm-elab { fill: currentColor; font-weight: 600; }
.cm-wrong .k-flow { stroke-width: 1.5px; }
.cm-x { fill: var(--c-surface); stroke: currentColor; stroke-width: 1.5px; }
.cm-xt { font-family: var(--font-ui); font-size: 12px; fill: currentColor; }
.cm-band .k-flow { stroke-width: 1.5px; }
.cm-target { fill: none; stroke: var(--c-ink); stroke-width: 1.5px; stroke-dasharray: 4 3; pointer-events: none; }

/* The words under the map. */
.cm-panel { line-height: 1.45; font-family: var(--font-ui); font-size: var(--fs-caption); margin-top: 0.75rem; min-height: 4.5em; }
.cm-panel p { margin: 0; }
.cm-title { font-size: 15px; font-weight: 650; }
.cm-open { font-weight: 400; margin-left: 0.75rem; }
.cm-hint, .cm-none, .cm-further, .cm-how { color: var(--c-ink-muted); }
.cm-how { font-style: italic; }
.cm-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.9rem; margin-top: 0.25rem; }
.cm-rel-h { font-weight: 600; color: var(--c-ink); min-width: 6em; }
.cm-item { white-space: nowrap; }
.cm-rel .k-button, .cm-actions .k-button { background: transparent; border: 0; padding-left: 0; padding-right: 0; text-decoration: underline; text-decoration-color: var(--c-construction); text-underline-offset: 4px; }
.cm-progress { font-size: var(--fs-readout); color: var(--c-ink); }
.cm-feedback { color: var(--c-ink); }

/* data-explorer (CATALOG.md, "data-explorer"): the toolbar, the shaded part to draw a guess on,
   the source line, the trend, the stats and the small table. Colours only through kit classes. */

.dx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-5); margin-bottom: var(--sp-1); line-height: normal; }
.dx-toolbar .ctl-seg, .dx-trend .ctl-seg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-1); }
.dx-toolbar .ctl-label, .dx-trend .ctl-label { font-size: var(--fs-caption); color: var(--c-ink-muted); margin-right: var(--sp-1); }
.dx-toolbar .k-button[aria-checked="true"], .dx-trend .k-button[aria-checked="true"] { color: var(--c-ink); font-weight: 600; text-decoration-color: var(--c-ink); text-decoration-thickness: 2px; }
.dx-pick { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-caption); color: var(--c-ink-muted); }
.dx-pick select { font: inherit; color: var(--c-ink); min-height: 44px; border: 1.5px solid var(--c-construction); border-radius: 6px; background: var(--c-surface); padding: 0 var(--sp-2); }

.dx-shade { fill: var(--c-surface-sunk); stroke: var(--c-construction); stroke-width: 1px; stroke-dasharray: 3 3; }
.dx-draw { fill: transparent; cursor: crosshair; touch-action: none; }
.dx-hit { fill: transparent; cursor: pointer; }
.dx-ink.k-plabel, .dx-note.k-plabel { fill: var(--c-ink); }
.dx-guessline .k-plotline { stroke-width: 2.5px; }

.dx-source { margin: var(--sp-1) 0 0; font-size: var(--fs-value); color: var(--c-ink-muted); line-height: 1.35; }
.dx-guess { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); line-height: 1.4; }
.dx-guess p { margin: 0; flex: 1 1 18em; font-size: var(--fs-readout); color: var(--c-ink); }
.dx-hint { color: var(--c-ink-muted); font-size: var(--fs-caption); }
.dx-trend { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-4); margin-top: var(--sp-2); line-height: 1.4; }
.dx-trend[hidden] { display: none; }
.dx-eq { margin: 0; font-size: var(--fs-caption); color: var(--c-ink); flex: 1 1 20em; }
.dx-stats { margin: var(--sp-2) 0; font-size: var(--fs-caption); color: var(--c-ink); line-height: 1.4; }

.dx-tablewrap { max-height: 200px; overflow: auto; border-top: 1px solid var(--c-rule); border-bottom: 1px solid var(--c-rule); line-height: 1.3; }
.dx-tablewrap:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.dx-table { border-collapse: collapse; width: 100%; font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.dx-table th { position: sticky; top: 0; background: var(--c-surface); text-align: right; font-weight: 600; color: var(--c-ink); padding: 6px var(--sp-3); border-bottom: 1px solid var(--c-rule); }
.dx-table td { text-align: right; padding: 4px var(--sp-3); color: var(--c-ink); cursor: pointer; }
.dx-table th:first-child, .dx-table td:first-child { text-align: left; }
.dx-table tr.is-hl td { font-weight: 650; box-shadow: inset 0 1px 0 var(--c-ink), inset 0 -1px 0 var(--c-ink); }

/* formula (packs/core/src/widgets/formula.ts): the live equation above the plot, the plot's
   labels, and the shared generic chrome (readouts, presets, challenges) inside this widget. */

/* The equation: the symbol line, then today's numbers. Centred on a desktop, left on a phone. */
.gen-formula .gen-formula-eq { line-height: normal; padding-top: 1.1rem; margin-bottom: 0.25rem; text-align: center; overflow-x: auto; overflow-y: hidden; }
.gen-formula .gen-formula-eq .katex-display { margin: 0; padding: 0.1em 0; overflow: visible; }
.gen-formula .gen-eq-sym .katex { font-size: 1.16em; }
.gen-formula .gen-eq-val { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 0.3em; }
.gen-formula .gen-eq-val .katex-display { display: inline-block; }
.gen-formula .gen-eq-val .katex { font-size: 1.16em; }
.gen-formula .gen-eq-result { font-weight: 700; }
.gen-formula .gen-eq-result .mord, .gen-formula .gen-eq-result { font-family: KaTeX_Main, var(--font-math-upright); }
/* Hover-linking inside KaTeX: the hot term gets a soft tint of its own colour. */
.gen-formula .gen-formula-eq [data-term] { border-radius: 2px; transition: background-color var(--dur-fast) var(--ease-out); }
.gen-formula .gen-formula-eq [data-term].is-hot { background: color-mix(in srgb, currentColor 14%, transparent); }
@media (max-width: 559px) {
  .gen-formula .gen-formula-eq { text-align: left; padding-top: 1.6rem; }
  .gen-formula .gen-eq-sym .katex-display > .katex, .gen-formula .gen-eq-val .katex-display > .katex { text-align: left; }
  .gen-formula .gen-eq-val { flex-direction: column; align-items: flex-start; padding-left: 0.75rem; }
  .gen-formula .gen-eq-sym .katex, .gen-formula .gen-eq-val .katex { font-size: 1.02em; }
}

/* Plot text: variables in the maths italic, brace labels in ink. */
.gen-formula .gen-formula-plot .k-var { font-family: var(--font-math); font-style: italic; font-size: 1.12em; }
.gen-formula .gen-formula-plot .k-sub, .gen-formula .gen-formula-plot .k-sup { font-size: 75%; }
.gen-formula .gen-formula-plot .k-plabel.gen-ink { fill: var(--c-ink); }
.gen-formula .gen-formula-plot .k-handle-g { touch-action: none; }

/* Controls: sliders and choices first, then presets, readouts and the challenge. */
.gen-formula .widget-controls { row-gap: var(--sp-2); }
.gen-formula .gen-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); font-size: var(--fs-caption); }
.gen-formula .gen-choices .ctl-label { margin-right: var(--sp-1); }
.gen-formula .gen-presets { display: flex; flex-wrap: wrap; gap: var(--sp-2); width: 100%; }
.gen-formula .gen-readouts { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: var(--sp-3); row-gap: var(--sp-1); margin: 0; width: 100%; font-size: var(--fs-caption); }
.gen-formula .gen-readouts dt { color: var(--c-ink-muted); }
.gen-formula .gen-readouts dd { margin: 0; font-family: var(--font-math-upright); font-size: var(--fs-readout); font-variant-numeric: tabular-nums; }
.gen-formula .gen-challenge { width: 100%; font-size: var(--fs-caption); }
.gen-formula .gen-challenges { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.gen-formula .gen-challenges .is-done { color: var(--c-ink-muted); }
.gen-formula .gen-challenges .is-now { color: var(--c-ink); }
.gen-formula .gen-challenge-kicker { font-weight: 650; margin-right: 0.3em; }
.gen-formula .gen-hint { margin: var(--sp-1) 0 0; color: var(--c-ink-muted); }
.gen-formula .gen-hint-btn { min-height: 44px; }

/* Sliders: the label stays on one line; on a phone the track takes what is left. */
.gen-formula .k-control label { white-space: nowrap; }
@media (max-width: 559px) {
  .gen-formula .k-control { grid-template-columns: auto minmax(96px, 1fr); width: 100%; }
}

/* A long label (even one long word) never widens the page: it ends in an ellipsis on a wide
   screen and wraps on a phone. Readouts, choices and challenges wrap anywhere they must. */
.gen-formula .widget-controls { min-width: 0; max-width: 100%; }
.gen-formula .k-control { max-width: 100%; min-width: 0; }
.gen-formula .k-control label { overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
.gen-formula .gen-readouts { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
.gen-formula .gen-readouts dt, .gen-formula .gen-readouts dd, .gen-formula .gen-choices, .gen-formula .gen-challenge, .gen-formula .gen-presets { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 559px) {
  .gen-formula .k-control { grid-template-columns: minmax(0, max-content) minmax(96px, 1fr); }
  .gen-formula .k-control label { white-space: normal; overflow-wrap: anywhere; }
}

/* geometry (packs/core/src/widgets/geometry.ts). Colours come from the k-* classes only. */

/* Lines, circles and measured sides: the kit's geometry and component weights, in the group's colour. */
[data-widget="geometry"] .gen-geo-line {
  fill: none;
  stroke: currentColor;
  stroke-width: var(--sw-geometry);
  stroke-linecap: round;
}
[data-widget="geometry"] .gen-geo-line.gen-geo-dashed {
  stroke-dasharray: var(--dash-construction);
}
[data-widget="geometry"] .gen-geo-measured {
  stroke-width: var(--sw-component);
}
[data-widget="geometry"] .is-hot .gen-geo-measured {
  stroke-width: calc(var(--sw-component) + 1.5px);
}

/* Labels over lines get the kit's white halo; variables in maths italic. */
[data-widget="geometry"] .gen-geo-label,
[data-widget="geometry"] .gen-geo-pname {
  paint-order: stroke;
  stroke: var(--c-surface);
  stroke-width: 4px;
  stroke-linejoin: round;
}
[data-widget="geometry"] .gen-geo-label .k-var {
  font-family: var(--font-math);
  font-style: italic;
  font-size: 1.12em;
}
[data-widget="geometry"] .gen-geo-label .k-sup,
[data-widget="geometry"] .gen-geo-label .k-sub {
  font-size: 0.72em;
}

/* Construction steps: progress dots, the step's words, Back (quiet) and Next (a choice). */
[data-widget="geometry"] .gen-geo-steps {
  display: grid;
  gap: var(--sp-2, 8px);
  width: 100%;
}
[data-widget="geometry"] .gen-geo-stephead {
  display: flex;
  align-items: center;
  gap: var(--sp-2, 8px);
  font-size: var(--fs-caption);
  color: var(--c-ink-muted);
}
[data-widget="geometry"] .gen-geo-say {
  margin: 0;
  font-size: var(--fs-readout);
  color: var(--c-ink);
  min-height: 2.6em;
}
[data-widget="geometry"] .gen-geo-stepbtns {
  display: flex;
  gap: var(--sp-3, 12px);
  align-items: center;
}
[data-widget="geometry"] .gen-geo-verdict {
  font-family: var(--font-ui);
}
[data-widget="geometry"] svg.gen-geo-dots {
  display: block;
  flex: none;
  width: auto;
  height: 16px;
}

/* labelled-diagram (packs/core): the author's figure with labels, selection, flows, knockout and a quiz.
   Colours come only from the k-* classes; the selected part takes its hue, right and wrong are ink. */

.ld-top, .ld-knock, .ld-ask, .ld-panel, .ld-index, .ld-hint { line-height: 1.5; }
.ld-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-5); padding-right: 64px; min-height: 44px; }
.ld-tabs .k-button { padding: 0 var(--sp-1); }
.ld-tabs .k-button[aria-pressed="true"] { text-decoration-color: var(--c-ink); text-decoration-thickness: 2px; }
.ld-short { display: none; }
@media (max-width: 559px) {
  .ld-long { display: none; }
  .ld-short { display: inline; }
  .ld-top { gap: 0 var(--sp-3); }
}
.ld-knock { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-1) 0 var(--sp-3); }
.ld-knock[hidden], .ld-index[hidden], .ld-ask[hidden], .ld-hint[hidden], .ld-flows-btn[hidden] { display: none; }
.ld-ask { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-readout); color: var(--c-ink); }
.ld-score { font-size: var(--fs-value); color: var(--c-ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ld-panel { margin-top: var(--sp-2); font-size: var(--fs-readout); color: var(--c-ink); }
.ld-panel p { margin: 0 0 var(--sp-1); }
.ld-head { font-weight: 650; }
.ld-muted { color: var(--c-ink-muted); }
.ld-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.ld-index { margin-top: var(--sp-3); }
.ld-index-head { margin: 0 0 var(--sp-2); font-size: var(--fs-caption); font-weight: 600; color: var(--c-ink); }
.ld-index-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ld-index-list .k-choice { padding: 0 var(--sp-3); }
.ld-hint { margin: var(--sp-2) 0 0; font-size: var(--fs-value); color: var(--c-ink-muted); }

/* The figure: strokes keep their width at any scale. */
.ld-fig * { vector-effect: non-scaling-stroke; }
.ld-stage.is-pointing { cursor: pointer; }
/* Selected (in its hue), switched off (dashed), or the quiz's tapped part (ink): a 14 % tint and a 2 px outline. */
.ld-fig .is-sel [class] { color: inherit; }
.ld-fig .is-sel :is(rect, circle, ellipse, path, polygon, polyline):not(.k-pip),
.ld-fig :is(rect, circle, ellipse, path, polygon, polyline).is-sel:not(.k-pip) {
  fill: currentColor; fill-opacity: 0.14; stroke: currentColor; stroke-width: 2px; stroke-opacity: 1;
}
.ld-fig .is-sel .k-pip { fill: currentColor; fill-opacity: 0.8; }
.ld-fig .is-off :is(rect, circle, ellipse, path, polygon, polyline):not(.k-pip),
.ld-fig :is(rect, circle, ellipse, path, polygon, polyline).is-off:not(.k-pip) {
  fill: var(--c-surface-sunk); fill-opacity: 1; stroke-dasharray: 4 3;
}
.ld-fig .is-hover :is(rect, circle, ellipse, path, polygon, polyline):not(.k-pip),
.ld-fig :is(rect, circle, ellipse, path, polygon, polyline).is-hover:not(.k-pip) {
  stroke: var(--c-ink); stroke-opacity: 1; stroke-width: 1.75px;
}
.ld-fig [data-part] { transition: fill-opacity var(--dur-fast) var(--ease-out); }

/* Keyboard focus on a part: a ring round its leader dot. The rings never take the pointer. */
.ld-focus { outline: none; pointer-events: none; }
.ld-focus-ring { fill: none; stroke: none; }
.ld-focus:focus-visible .ld-focus-ring, .ld-focus:focus .ld-focus-ring { stroke: var(--c-focus); stroke-width: 2px; }
.ld-flow.is-stopped .k-flow { stroke-width: 1.5px; }

/* number-line (packs/core/src/widgets/number-line.ts). Colours come from the k-* classes only. */

/* Labels over lines get the kit's white halo; variables in maths italic. */
[data-widget="number-line"] .gen-nl-label {
  paint-order: stroke;
  stroke: var(--c-surface);
  stroke-width: 4px;
  stroke-linejoin: round;
}
[data-widget="number-line"] .gen-nl-label .k-var {
  font-family: var(--font-math);
  font-style: italic;
  font-size: 1.12em;
}
[data-widget="number-line"] .gen-nl-num {
  font-family: var(--font-math-upright);
  font-variant-numeric: tabular-nums;
}

/* A point that is included (or a closed interval end) is a filled ring; an excluded one is hollow. */
[data-widget="number-line"] .gen-nl-filled .k-handle {
  fill: currentColor;
}

[data-widget="number-line"] .gen-nl-hopctl {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-3, 12px);
}
[data-widget="number-line"] .gen-nl-eq {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.6em;
}
[data-widget="number-line"] .gen-nl-sep {
  color: var(--c-ink-muted);
}
[data-widget="number-line"] .gen-nl-total {
  font-weight: 650;
}
[data-widget="number-line"] .gen-nl-hint {
  font-family: var(--font-ui);
  font-size: var(--fs-caption);
  color: var(--c-ink-muted);
}

/* order (CATALOG.md, "order"): numbered rows with a chip each, the drop line while dragging,
   and the verdicts. Right and wrong are words with ✓ / ✗ and an ink outline, never a colour. */

.or { line-height: 1.35; padding-top: var(--sp-6); }
.or-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); position: relative; }
.or-row { display: grid; grid-template-columns: 2em minmax(0, 1fr); align-items: start; gap: var(--sp-2); min-height: 44px; }
.or-num { font-family: var(--font-math-upright); font-size: var(--fs-readout); color: var(--c-ink-muted); text-align: right; padding-top: 11px; font-variant-numeric: tabular-nums; }
.or-row.is-locked .or-num { color: var(--c-ink); font-weight: 650; }
.or-chip { flex-wrap: wrap; padding: var(--sp-2) var(--sp-3); gap: 2px var(--sp-2); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; position: relative; }
.or-chip.is-dragging { z-index: 5; }
.or-chip.is-picked { outline: 2px dashed var(--c-ink); outline-offset: 2px; }
.or-chip.is-right, .or-chip.is-wrong { border: 2px solid var(--c-ink); }
.or-chip.is-locked { cursor: default; }
.or.has-picked .or-chip:not(.is-locked):not(.is-picked) { cursor: pointer; border-color: var(--c-ink-muted); }
.or-verdict { flex-basis: 100%; font-size: var(--fs-caption); color: var(--c-ink); }
.or-verdict b { font-weight: 650; }
.or-mark { font-weight: 700; }
/* Where a dragged item will land: a 2 px ink line between rows. */
.or-gap { position: absolute; left: 2.5em; right: 0; height: 2px; background: var(--c-ink); pointer-events: none; }
.or-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); line-height: 1.35; }
.or-note { margin: 0; font-size: var(--fs-readout); color: var(--c-ink); flex: 1 1 16em; }
/* The scale form: a checked item's value, upright, after its name. */
.or-val { font-family: var(--font-math-upright); font-weight: 400; fill: var(--c-ink-muted); }
.or-judged .k-plabel { fill: var(--c-ink); }

/* plot (packs/core/src/widgets/plot.ts): the curve grab targets, labels on the plot, and the
   shared generic chrome (readouts, presets, challenges, toggles) inside this widget. */

/* A wide invisible stroke over a draggable curve: grab the curve itself, not only its handle. */
.gen-plot .gen-plot-hit { fill: none; stroke: transparent; stroke-width: 24px; stroke-linecap: round; pointer-events: stroke; cursor: grab; touch-action: none; }
.gen-plot .is-dragging .gen-plot-hit { cursor: grabbing; }
.gen-plot .gen-plot-stage .k-var { font-family: var(--font-math); font-style: italic; font-size: 1.12em; }
.gen-plot .gen-plot-stage .k-sub, .gen-plot .gen-plot-stage .k-sup { font-size: 75%; }
.gen-plot .gen-plot-stage .k-handle-g { touch-action: none; }
.gen-plot .gen-tangent { stroke-width: 1.75px; }

/* Controls. */
.gen-plot .widget-controls { row-gap: var(--sp-2); }
.gen-plot .k-control label { white-space: nowrap; }
.gen-plot .gen-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); font-size: var(--fs-caption); }
.gen-plot .gen-plot-toggles { display: flex; flex-wrap: wrap; gap: 0 var(--sp-3); width: 100%; }
.gen-plot .gen-plot-toggles .k-button::before { content: "☐ "; text-decoration: none; display: inline-block; margin-right: 0.15em; }
.gen-plot .gen-plot-toggles .k-button[aria-pressed="true"]::before { content: "☑ "; }
.gen-plot .gen-presets { display: flex; flex-wrap: wrap; gap: var(--sp-2); width: 100%; }
.gen-plot .gen-readouts { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: var(--sp-3); row-gap: var(--sp-1); margin: 0; width: 100%; font-size: var(--fs-caption); }
.gen-plot .gen-readouts dt { color: var(--c-ink-muted); }
.gen-plot .gen-readouts dd { margin: 0; font-family: var(--font-math-upright); font-size: var(--fs-readout); font-variant-numeric: tabular-nums; }
.gen-plot .gen-challenge { width: 100%; font-size: var(--fs-caption); }
.gen-plot .gen-challenges { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.gen-plot .gen-challenges .is-done { color: var(--c-ink-muted); }
.gen-plot .gen-challenge-kicker { font-weight: 650; margin-right: 0.3em; }
.gen-plot .gen-hint { margin: var(--sp-1) 0 0; color: var(--c-ink-muted); }
@media (max-width: 559px) {
  .gen-plot .k-control { grid-template-columns: auto minmax(96px, 1fr); width: 100%; }
}

/* A long label (even one long word) never widens the page: it ends in an ellipsis on a wide
   screen and wraps on a phone. Readouts, choices and challenges wrap anywhere they must. */
.gen-plot .widget-controls { min-width: 0; max-width: 100%; }
.gen-plot .k-control { max-width: 100%; min-width: 0; }
.gen-plot .k-control label { overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
.gen-plot .gen-readouts { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
.gen-plot .gen-readouts dt, .gen-plot .gen-readouts dd, .gen-plot .gen-choices, .gen-plot .gen-challenge, .gen-plot .gen-presets { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 559px) {
  .gen-plot .k-control { grid-template-columns: minmax(0, max-content) minmax(96px, 1fr); }
  .gen-plot .k-control label { white-space: normal; overflow-wrap: anywhere; }
}

/* simulate (packs/core/src/widgets/simulate.ts). Everything is scoped to .sim. Light theme only. */

.sim { font-family: var(--font-ui); color: var(--c-ink); line-height: 1.4; }
.sim-tanks { outline: none; padding-right: 0; }
.sim-tanks:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 4px; border-radius: 2px; }
.k-widget .sim svg { overflow: visible; }
.sim-name { font-weight: 600; fill: var(--c-ink); }
.sim-amount { font-size: var(--fs-readout); }
.sim-flowname { fill: currentColor; font-weight: 600; }
.sim-rate { fill: var(--c-ink-muted); }

.sim-time { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 4px; }
.sim-clock { margin: 0 auto 0 0; min-width: 9em; font-size: var(--fs-caption); font-weight: 600; font-variant-numeric: tabular-nums; }
.sim-play { min-width: 88px; }
.sim-time .k-button:disabled { opacity: 0.45; cursor: default; text-decoration: none; }
.sim-note { margin: 2px 0 6px; min-height: 1.4em; font-size: var(--fs-value); color: var(--c-ink-muted); }

.sim-readouts { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: 16px; row-gap: 4px; margin: 6px 0 0; font-size: var(--fs-caption); }
.sim-readouts[hidden] { display: none; }
.sim-readouts dt { color: var(--c-ink-muted); }
.sim-readouts dd { margin: 0; font-family: var(--font-math-upright); font-size: var(--fs-readout); font-variant-numeric: tabular-nums; }

@media (max-width: 479px) {
  .sim-clock { min-width: 0; flex-basis: 100%; }
  .sim-readouts { grid-template-columns: minmax(0, 1fr) auto; }
}

/* stepper (packs/core/src/widgets/stepper.ts). Everything is scoped to .stp. Light theme only. */

.stp { font-family: var(--font-ui); color: var(--c-ink); line-height: 1.4; }
.stp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 36px; padding-right: 64px; }
.stp-input-label { font-size: var(--fs-caption); }
.stp-field { font: inherit; font-size: var(--fs-caption); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--c-ink);
  background: var(--c-surface-sunk); border: 1px solid var(--c-construction); border-radius: 3px; height: 32px; padding: 0 8px; }
input.stp-field { width: 4em; text-align: center; }
.stp-fixed { display: inline-flex; align-items: center; min-width: 40px; justify-content: center; }
.stp-select { padding-right: 4px; min-width: 56px; }
.stp-field:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.stp-field[aria-invalid="true"] { border: 2px solid var(--c-ink); border-style: dashed; }
.stp-count { font-size: var(--fs-value); color: var(--c-ink-muted); font-variant-numeric: tabular-nums; }
.stp-say { font-size: var(--fs-readout); margin: 10px 0 6px; min-height: 1.4em; }
.stp-scene { position: relative; outline: none; }
.stp-scene:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 4px; border-radius: 2px; }
.k-widget .stp-scene svg { overflow: visible; }

/* SVG text in the scene and the track. */
.stp-ui { font-family: var(--font-ui); font-size: var(--fs-caption); fill: var(--c-ink); font-variant-numeric: tabular-nums; }
.stp-muted { font-family: var(--font-ui); font-size: var(--fs-value); fill: var(--c-ink-muted); font-variant-numeric: tabular-nums; }
.stp-eq { font-family: var(--font-math-upright); font-size: 20px; fill: currentColor; font-variant-numeric: tabular-nums; }
.stp-eq tspan { fill: currentColor; }
.stp-eq .k-it { font-size: 1.04em; }
.stp-ptr { font-size: 16px; }
.stp-colvar { font-size: 17px; fill: var(--c-ink); }
.stp-colhead { font-weight: 600; }
.stp-tcell { font-size: var(--fs-readout); }
.stp-mark { stroke: var(--c-ink); stroke-width: 2px; }
.stp-done { fill: none; stroke: var(--c-ink); stroke-width: 2px; }
.stp-bar-edge { fill: none; stroke: var(--c-context); stroke-width: var(--sw-geometry); }
.stp-slot { fill: none; stroke: var(--c-rule); stroke-width: 1px; stroke-dasharray: 3 3; }
.stp-future { fill: none; stroke: var(--c-construction); stroke-opacity: 0.8; stroke-width: 1px; stroke-dasharray: 1.5 3; }
.stp-waiting { stroke: var(--c-ink); stroke-dasharray: 3 3; }
.stp-tree .k-flow { stroke-width: 2px !important; }
.stp-seg { fill: none; stroke: var(--c-ink); stroke-width: 1.5px; stroke-linecap: round; }
.stp-seg-on { fill: none; stroke: currentColor; stroke-width: 2.5px; stroke-linecap: round; }
.stp-circle-on { fill: none; stroke: currentColor; stroke-width: 2px; }
.stp-prog { fill: none; stroke: var(--c-construction); stroke-width: 2px; }
.stp-prog-on { fill: none; stroke: var(--c-ink); stroke-width: 2px; }

/* Diagram: the figure fills the width; flows sit on an overlay in screen px. */
.stp-fig { position: relative; line-height: 0; }
.stp-fig > svg:first-child { display: block; width: 100%; height: auto; }
.stp-overlay { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.stp-fig .stp-hl :is(rect, circle, ellipse, path, polygon):not(.k-flow) { fill: currentColor; fill-opacity: 0.14; stroke: currentColor; stroke-width: 2px; }
.stp-fig .k-dim { opacity: 0.55; }
@media (prefers-reduced-motion: no-preference) {
  .stp-overlay .k-flowg { animation: stp-in var(--dur-base) var(--ease-out); }
}
@keyframes stp-in { from { opacity: 0; } to { opacity: 1; } }

/* Text: numbered lines, the live ones tinted in the strong hue with an outline bar. */
.stp-lines { margin: 4px 0; padding-left: 2.4em; font-size: var(--fs-readout); }
.stp-lines li { padding: 3px 8px; border-left: 3px solid transparent; }
.stp-lines li::marker { color: var(--c-ink-muted); font-size: var(--fs-tick); }
.stp-lines li.stp-hl { background: color-mix(in srgb, currentColor 12%, transparent); border-left-color: currentColor; }
.stp-line { color: var(--c-ink); white-space: pre-wrap; }

.stp-tex { text-align: center; margin: 4px 0 8px; overflow-x: auto; }
.stp-tex[hidden] { display: none; }

/* Prediction beside the track on wide screens; stacked on phones. */
.stp-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); gap: 12px 24px; align-items: start; margin-top: 8px; }
.stp-lower.is-solo { grid-template-columns: minmax(0, 1fr); }
.stp-lower.is-solo .stp-track { display: none; }
.stp-ask { min-height: 1px; padding-left: 40px; }
.stp-qtext { font-size: var(--fs-caption); font-weight: 600; margin: 8px 0 10px; }
.stp-choices { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.stp-choices .k-choice:disabled[aria-pressed="true"] { border-style: solid; border-color: var(--c-ink); color: var(--c-ink); }
.stp-numrow { display: flex; align-items: center; gap: 8px; }
.stp-num { width: 7em; height: 40px; font-size: var(--fs-readout); }
.stp-unit { font-size: var(--fs-caption); color: var(--c-ink-muted); }
.stp-then { font-size: var(--fs-value); color: var(--c-ink-muted); margin: 10px 0 0; min-height: 1.4em; }
.stp-verdict { font-size: var(--fs-caption); margin: 6px 0 4px; padding: 4px 0 4px 10px; border-left: 2px solid var(--c-ink); color: var(--c-ink); }
span.stp-verdict { display: inline-block; margin: 0; }
.stp-score { font-size: var(--fs-caption); margin: 10px 0 0; }
.stp-track { min-width: 0; }

.stp-nav { display: flex; align-items: center; gap: 8px 16px; margin-top: 14px; flex-wrap: wrap; }
.stp-nav .k-button:disabled { opacity: 0.45; cursor: default; text-decoration: none; }
.k-widget svg.stp-dots { display: block; flex: none; height: 20px; overflow: visible; }
.stp-next { min-width: 88px; }
.stp-next:disabled { border-style: dashed; color: var(--c-ink-muted); cursor: default; }
.stp-spacer { flex: 1 1 0; }
.stp-short { display: none; }
.stp-keys { font-size: var(--fs-value); color: var(--c-ink-muted); margin: 4px 0 0; }
.stp-sizes { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-caption); }

@media (max-width: 559px) {
  .stp-lower { grid-template-columns: minmax(0, 1fr); }
  .stp-ask { padding-left: 0; }
  .stp-eq { font-size: 17px; }
  .stp-long { display: none; }
  .stp-short { display: inline; }
}

/* Touch: every target at least 44 px. */
.stp-choices .k-choice { min-width: 44px; }
.stp-num { height: 44px; }
@media (pointer: coarse) { .stp-field { height: 44px; } }
.stp-fielderr { margin: 4px 0 0; padding-left: 10px; border-left: 2px solid var(--c-ink); font-size: var(--fs-value); color: var(--c-ink); }
.stp-fielderr[hidden] { display: none; }

/* timeline (packs/core/src/widgets/timeline.ts). Colours only through the kit's tokens and k-* classes. */

/* Quiet chrome on the drawing's top row, left of Reset ("Show every link"). */
.widget-drawing > .tl-top { position: absolute; top: -10px; right: 56px; line-height: normal; z-index: 1; }
.widget-drawing > .tl-top .k-button { background: transparent; border: 0; }

/* Lane names: the zoomed lanes in ink, the overview's in muted grey. */
.tl-lane { font-family: var(--font-ui); font-size: var(--fs-caption); fill: var(--c-ink); }
.tl-olane { font-family: var(--font-ui); font-size: var(--fs-value); fill: var(--c-ink-muted); }
.tl-era { font-style: italic; }
.tl-erasep { stroke: var(--c-surface); stroke-width: 2px; }

/* An open chevron where an era or range runs on past the edge. */
.tl-chev { fill: none; stroke: currentColor; stroke-width: 1.5px; stroke-linecap: round; stroke-linejoin: round; }

/* Events: a hit area over the dot and its label; a ring for keyboard focus. */
.tl-ev { cursor: pointer; outline: none; }
.tl-hit { fill: transparent; stroke: none; pointer-events: all; }
.tl-ev:focus-visible .tl-hit { stroke: var(--c-focus); stroke-width: 2px; }
.tl-ev:hover .k-plabel { text-decoration: underline; text-decoration-color: var(--c-construction); }
/* The chain: ranges tinted in the strong colour; labels in it, bold only for the selected event. */
.tl-on .k-range { fill: currentColor; fill-opacity: 0.28; stroke: currentColor; }
.tl-chain .k-plabel { font-weight: 400; }
.tl-ring { fill: none; stroke: currentColor; stroke-width: 2px; }
.tl-link .k-flow { stroke-width: 1.75px; }
.tl-faint .k-flow { stroke-width: 1.25px; }
.tl-linklab { font-size: var(--fs-value); font-style: italic; fill: currentColor; }

/* The zoom window's handles: the body is the window itself; the edges are small grips. */
.tl-win-h .k-handle, .tl-edge-h .k-handle { display: none; }
.tl-body-hit { cursor: grab; }
.tl-body-focus { fill: none; stroke: var(--c-focus); stroke-width: 2px; visibility: hidden; pointer-events: none; }
.tl-win-h:focus-visible .tl-body-focus { visibility: visible; }
.tl-win-h:focus-visible .k-handle-focus { visibility: hidden; }
.tl-grip { fill: var(--c-surface); stroke: var(--c-ink); stroke-width: 1.5px; }
.tl-edge-h { cursor: ew-resize; }
.tl-edge-h:hover .tl-grip, .tl-edge-h.is-dragging .tl-grip { fill: var(--c-ink); }
.tl-svg.is-panning { cursor: grabbing; }
.tl-svg { touch-action: pan-y; user-select: none; -webkit-user-select: none; }

/* Place mode: a track per event, the guess's date beside its handle, right and wrong in words. */
.tl-track { fill: none; stroke: var(--c-rule); stroke-width: 2px; }
.tl-ptitle { fill: var(--c-ink); }
.is-sel .tl-ptitle { fill: var(--c-ink); }
.tl-guess { fill: var(--c-ink); }
.tl-wrong { fill: none; stroke: currentColor; stroke-width: 2px; }
.tl-truth { fill: var(--c-surface); stroke: currentColor; stroke-width: 2px; }
.tl-truthlab { fill: var(--c-ink); }

/* The selected event, in words, under the drawing. */
.tl-detail { line-height: 1.45; font-family: var(--font-ui); margin-top: 0.75rem; }
.tl-detail p { margin: 0; }
.tl-when { font-size: var(--fs-value); color: var(--c-ink-muted); }
.tl-title { font-size: 15px; font-weight: 650; margin-top: 0.15rem !important; }
.tl-about { font-size: 15px; color: var(--c-ink); max-width: 62ch; margin-top: 0.3rem !important; }
.tl-hint { font-size: var(--fs-caption); color: var(--c-ink-muted); }
.tl-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; margin-top: 0.4rem; font-size: var(--fs-caption); }
.tl-rel-h { font-weight: 600; color: var(--c-ink); min-width: 5.5em; }
.tl-rel .k-button { background: transparent; border: 0; padding-left: 0; padding-right: 0; text-decoration: underline; text-decoration-color: var(--c-construction); text-underline-offset: 4px; }
.tl-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.tl-actions .k-button { background: transparent; border: 0; }
.tl-actions .k-button:disabled { color: var(--c-construction); cursor: default; }
.tl-result { font-size: var(--fs-readout); color: var(--c-ink); margin-top: 0.4rem !important; min-height: 1.45em; }

/* Styles for the mechanics pack's widgets. learnkit adds this sheet to a course that lists the pack in course.yml. */

/* ---------- widget: force-arrow, transmissibility, varignon, couple ---------- */
.eq-text {
  font-family: var(--font-ui);
  font-size: 0.86em;
  margin: 0 0.4em;
}
.eq-line > .eq-text:first-child {
  margin-left: 0;
  display: inline-block;
  min-width: 10.5em;
}
.eq-text:not([class*="k-"]) {
  color: var(--muted);
}
/* Notes wrap to the panel's width rather than the widest equation line. */
figure[data-widget="force-arrow"] .widget-eq,
figure[data-widget="transmissibility"] .widget-eq,
figure[data-widget="varignon"] .widget-eq,
figure[data-widget="couple"] .widget-eq {
  grid-template-columns: minmax(0, 1fr);
}
/* Text drawn by these widgets (notes, positions) is muted ink, never construction grey. */
.k-muted {
  color: var(--c-ink-muted, #50575f);
}
.fa-ghost .k-obj {
  fill: none;
  stroke: var(--c-construction, #848c96);
  stroke-dasharray: 5 4;
}
.k-bar {
  fill: currentColor;
  fill-opacity: 0.22;
  stroke: currentColor;
  stroke-width: 2px;
}
.k-bar-part {
  fill-opacity: 0.1;
  stroke-dasharray: 5 3;
}
.k-ref {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25px;
  stroke-dasharray: 2 3;
}
.tr-strain {
  fill: currentColor;
  fill-opacity: 0.16;
  stroke: none;
}
@media (max-width: 560px) {
  .eq-line > .eq-text:first-child {
    display: block;
    min-width: 0;
    margin-top: 0.3rem;
  }
}

/* ---------- widget: vector-add, resultant-concurrent, resultant-plate, force-couple ---------- */
:is([data-widget="vector-add"], [data-widget="resultant-concurrent"], [data-widget="resultant-plate"], [data-widget="force-couple"]) .ctl-seg {
  flex-wrap: wrap;
  row-gap: 0.4rem;
}
.af-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.af-name {
  font-family: var(--font-math);
  font-size: 1.1rem;
  min-width: 1.6em;
}
.af-name sub {
  font-size: 0.7em;
}
/* The equation box may scroll sideways on a phone; without this its grid column grows instead. */
:is([data-widget="vector-add"], [data-widget="resultant-concurrent"], [data-widget="resultant-plate"], [data-widget="force-couple"]) .widget-panel {
  grid-template-columns: minmax(0, 1fr);
}
.af-table-wrap {
  position: relative; /* hidden input labels are absolutely positioned: keep them inside the scroll box */
  flex-basis: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}
.af-table {
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: var(--fs-caption, 14px);
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.af-table th,
.af-table td {
  padding: 0.2rem 0.45rem;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--c-rule, #e3e6ea);
}
.af-table thead th {
  font-weight: 600;
  color: var(--c-ink-muted, #5d636b);
}
.af-table th.af-name,
.af-table tfoot th {
  text-align: left;
}
.af-table tfoot th,
.af-table tfoot td {
  font-weight: 700;
  border-bottom: 0;
  border-top: 2px solid var(--c-ink, #1b1f24);
}
.af-table .ctl-num input {
  width: calc(var(--af-ch, 5) * 1ch + 1.1rem);
  min-height: 40px;
}
.af-table .af-num {
  min-width: 6ch;
}
.af-del {
  min-width: 40px;
  padding: 0 0.6rem;
}
.af-table td,
.af-table th {
  vertical-align: middle;
}
/* Units sit under each column's name, so the headers are no wider than the numbers. */
.af-table .af-u {
  display: block;
  font-weight: 400;
  font-size: 0.85em;
}
.af-table thead th {
  vertical-align: bottom;
}
/* On a phone the whole table fits the column (316 px at a 340 px screen): tighter cells,
   narrower inputs, a compact remove button. */
@media (max-width: 560px) {
  .af-table {
    font-size: 13px;
  }
  .af-table th,
  .af-table td {
    padding: 0.15rem 0.2rem;
  }
  .af-table .ctl-num input {
    width: calc(var(--af-ch, 5) * 1ch + 0.6rem);
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  .af-table .af-num {
    min-width: 0;
  }
  .af-del {
    min-width: 32px;
    padding: 0 0.3rem;
  }
  .af-name {
    font-size: 1rem;
    min-width: 1.3em;
  }
}

/* ---------- widget: weight-calc ---------- */
/* The everyday objects are scaled pictures; keep their outlines at the kit's stroke width. */
.wc-obj * {
  vector-effect: non-scaling-stroke;
}
.wc-obj .k-value {
  font-size: 10px;
}

/* ---------- widget: newton-cart ---------- */
/* Acceleration is not a force: ink, 1.5 px, open chevron head (designer's ruling, T7704). */
.nc-accel-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5px;
  stroke-linejoin: miter;
  stroke-linecap: butt;
}
.nc-accel.is-hot .nc-accel-line {
  stroke-width: 3px;
}
.eq-note-inline {
  font-family: var(--font-ui);
  font-size: 0.85em;
  color: var(--c-ink-muted);
}

/* ---------- widget: force-system-sorter ---------- */
.sorter-panel,
.fbd-panel {
  text-align: left;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.55;
  white-space: normal;
}
.sorter-panel p,
.fbd-panel p {
  margin: 0 0 0.6rem;
}
.sorter-progress {
  color: var(--c-ink-muted, #50575f);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.sorter-question {
  font-weight: 600;
}
.sorter-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.sorter-choices[hidden],
.sorter-actions [hidden] {
  display: none;
}
.sorter-choice {
  border: 1px solid var(--c-rule, #d5dae0);
  border-radius: 6px;
  text-decoration: none;
  color: var(--c-ink, #1b1f24);
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.35rem;
  justify-items: start;
  text-align: left;
  min-height: 56px;
  padding: 0.45rem 0.7rem;
}
.sorter-mark {
  grid-row: span 2;
  align-self: center;
  font-weight: 700;
  min-width: 0.9em;
}
.sorter-name {
  font-weight: 600;
}
.sorter-hint {
  font-size: 0.82rem;
  color: var(--c-ink-muted, #50575f);
}
.sorter-choice:disabled {
  opacity: 1;
  cursor: default;
}
.sorter-choice[data-state="right"] {
  border-color: var(--c-resultant, #0d7c4d);
  box-shadow: inset 0 0 0 1px var(--c-resultant, #0d7c4d);
}
.sorter-choice[data-state="right"] .sorter-mark {
  color: var(--c-resultant, #0d7c4d);
}
.sorter-choice[data-state="wrong"] {
  border-color: var(--c-force, #9e1218);
  box-shadow: inset 0 0 0 1px var(--c-force, #9e1218);
}
.sorter-choice[data-state="wrong"] .sorter-mark {
  color: var(--c-force, #9e1218);
}
.sorter-choice[data-state=""]:disabled {
  color: var(--c-ink-muted, #50575f);
}
.sorter-verdict[data-state="right"] strong {
  color: var(--c-resultant, #0d7c4d);
}
.sorter-verdict[data-state="wrong"] strong {
  color: var(--c-force, #9e1218);
}
.sorter-feedback .k-var,
.fbd-panel .k-var {
  font-family: var(--font-math);
  font-style: italic;
}
.sorter-feedback .k-var.is-hot {
  background: var(--c-surface-sunk, #f4f6f8);
  outline: 1px solid currentColor;
  border-radius: 2px;
}
.sorter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sorter-rope {
  stroke-width: 3;
}

/* ---------- widget: fbd-builder ---------- */
.fbd-site {
  cursor: pointer;
  outline: none;
}
.fbd-site-hit {
  fill: transparent;
}
figure[data-widget="fbd-builder"] [data-layer="forces"],
figure[data-widget="fbd-builder"] [data-layer="results"] {
  pointer-events: none;
}
.fbd-site-ring {
  fill: var(--c-surface, #fff);
  fill-opacity: 0.6;
  stroke: var(--c-ink, #1b1f24);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}
.fbd-site-plus {
  stroke: var(--c-ink, #1b1f24);
  stroke-width: 1.75;
  stroke-linecap: round;
}
.fbd-site.has-force .fbd-site-ring {
  fill: none;
}
.fbd-site.has-force .fbd-site-plus {
  display: none;
}
.fbd-site.has-force:hover .fbd-site-plus,
.fbd-site.has-force:focus-visible .fbd-site-plus {
  display: inline;
}
.fbd-site:hover .fbd-site-ring,
.fbd-site.is-hot .fbd-site-ring {
  stroke-dasharray: none;
  stroke-width: 2;
}
.fbd-site:focus-visible .fbd-site-ring {
  stroke-dasharray: none;
  stroke-width: 3;
}
.fbd-ghost {
  opacity: 0.75;
}
.fbd-removing {
  opacity: 0.4;
}
.fbd-step-n {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0 0.4rem;
  border: 1px solid var(--c-rule, #d5dae0);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-ink-muted, #50575f);
}
.fbd-assume {
  font-size: 0.9rem;
  color: var(--c-ink-muted, #50575f);
}
.fbd-results {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  outline: none;
}
.fbd-results li {
  padding: 0.35rem 0.5rem 0.35rem 1.6rem;
  text-indent: -1.1rem;
  border-radius: 4px;
}
.fbd-results li.is-hot {
  background: var(--c-surface-sunk, #f4f6f8);
}
.fbd-mark {
  display: inline-block;
  width: 1.1rem;
  text-indent: 0;
  font-weight: 700;
}
.fbd-results li[data-state="right"] .fbd-mark {
  color: var(--c-resultant, #0d7c4d);
}
.fbd-results li:not([data-state="right"]) .fbd-mark {
  color: var(--c-force, #9e1218);
}
.k-button.fbd-primary,
.k-button.sorter-next {
  min-height: 44px;
  color: var(--c-ink, #1b1f24);
  font-weight: 600;
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}
.k-button[hidden] {
  display: none;
}

/* ---------- widget: concept-map ---------- */
/* Ideas are real links (HTML, so labels wrap and keyboard focus is native) over an SVG of arrows. */
.cm {
  position: relative;
}
.cm-nodes {
  position: absolute;
  inset: 0 0 auto 0;
}
.cm-node {
  position: absolute;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  padding: 6px 9px;
  border: 1.5px solid var(--c-rule, #d5dae0);
  border-radius: 6px;
  background: var(--c-surface, #fff);
  color: var(--c-ink, #1b1f24);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  hyphens: auto;
  overflow-wrap: break-word;
  transition: color var(--dur-fast, 120ms), border-color var(--dur-fast, 120ms), background-color var(--dur-fast, 120ms);
}
a.cm-node:hover {
  text-decoration: underline;
}
.cm-node:focus-visible {
  outline: 2px solid var(--c-focus, #1b1f24);
  outline-offset: 2px;
}
.cm-node.is-need {
  border-color: var(--c-ink, #1b1f24);
}
.cm-node.is-active {
  border: 2.5px solid var(--c-ink, #1b1f24);
  background: var(--c-surface-sunk, #f4f6f8);
  font-weight: 600;
}
.cm-node.is-faded {
  color: var(--c-ink-muted, #50575f);
  border-color: var(--c-rule, #d5dae0);
}
.cm-node.is-here {
  border-style: double;
  border-width: 3px;
}
.cm-node.is-here::before {
  content: "This page";
  position: absolute;
  top: -1.5em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 400;
  color: var(--c-ink-muted, #50575f);
  white-space: nowrap;
}
.cm-link,
.cm-head {
  fill: none;
  stroke: currentColor;
  stroke-width: var(--sw-construction, 1.25px);
}
.cm-head {
  stroke-linejoin: miter;
}
.cm-edge.is-need .cm-link,
.cm-edge.is-need .cm-head {
  stroke-width: var(--sw-component, 2px);
}
/* Nothing to reset: the map has no state. */
figure[data-widget="concept-map"] .widget-reset {
  display: none;
}
.cm-edge.is-faded {
  opacity: 0.45;
}
.cm-readout {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-readout, 15px);
  min-height: 3em;
}
@media (max-width: 560px) {
  .cm-node {
    font-size: 11.5px;
    padding: 5px 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cm-node {
    transition: none;
  }
}

/* ---------- widget: scale-zoom ---------- */
/* The particle is drawn as a kit point; its handle is an open ring round it, not a disc over it. */
.sz-point-handle .k-handle {
  fill: none;
  r: 10px;
}

