/* ==========================================================================
   /learn: the hub (Signal Path diagram, seven tracks), node pages and the
   processor chooser. Loaded only on /learn pages, after main.css, and built
   from its tokens, so each ground's redefinitions (--text-strong, --copper,
   --navy-card ...) apply without a rule per ground.

   Sections alternate grounds on purpose: night hero, cotton diagram, navy
   tracks, cotton footnote. Each change of ground marks a new kind of content,
   which is what the eyebrows used to do with more words.
   Markup comes from tools/build-learn.py.
   ========================================================================== */

/* ---------------- Shared ---------------- */

.learn-h2 {
  font-size: clamp(1.7rem, 1.1rem + 2vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--text-strong);
  margin-bottom: 0.75rem;
}

.learn-h3 {
  font-size: clamp(1.1rem, 1vw + 0.8rem, 1.3rem);
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.75rem;
}

.learn-lede {
  font-size: clamp(1rem, 0.6vw + 0.85rem, 1.15rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 44rem;
}

.text-center .learn-lede { margin-left: auto; margin-right: auto; }

.section-head { margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }

.learn-meta { margin-top: 1.25rem; }

.learn-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.muted { color: var(--text-muted); }

/* Level tags: one hue at three weights, so they read as a scale. */
.lv {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--navy-border-glow);
  color: var(--copper-light);
  white-space: nowrap;
}
.lv-core { background: var(--copper-glow); }
.lv-deep { background: var(--copper-ground); border-color: var(--copper-ground); color: #fff; }

/* ---------------- Signal Path, on cotton ---------------- */

.sp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}

.sp-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: var(--radius-full);
  background: rgba(14, 22, 63, 0.06);
}

.sp-tab {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}
.sp-tab:hover { color: var(--text-strong); }
.sp-tab:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 2px; }
.sp-tab[aria-pressed="true"] { background: var(--brand-navy); color: #fff; box-shadow: 0 2px 8px rgba(14, 22, 63, 0.2); }

.sp-questions { flex-basis: 100%; }
.sp-question { color: var(--text-soft); font-size: 0.92rem; font-style: italic; margin: 0; }

/* The internet switch: a real on/off, so the local-first point can be seen
   rather than read. */
.sp-internet {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(14, 22, 63, 0.25);
  background: #fff;
  color: var(--text-strong);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.sp-internet:hover { border-color: var(--copper-dark); }
.sp-internet:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 2px; }
.sp-internet-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #2E7D4F; box-shadow: 0 0 0 3px rgba(46, 125, 79, 0.18); }
.sp-internet[aria-pressed="true"] { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.sp-internet[aria-pressed="true"] .sp-internet-dot { background: #B3392B; box-shadow: 0 0 0 3px rgba(179, 57, 43, 0.3); }

.sp-offline-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid #2E7D4F;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(46, 125, 79, 0.08);
  color: var(--text-strong);
  font-size: 0.92rem;
  line-height: 1.6;
}

.sp-layout { display: grid; gap: 1rem; }
.sp-tap-hint { display: none; margin: 0.6rem 0 1.25rem; font-size: 0.82rem; color: var(--text-muted); }

.sp-scroll {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--navy-border);
  background: #fff;
  box-shadow: 0 2px 14px rgba(14, 22, 63, 0.07);
}
.sp-scroll:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 2px; }

.sp-svg { display: block; width: 100%; height: auto; min-width: 900px; font-family: var(--font-main); }

/* Zones: tinted areas with a solid label pill on the top edge. The device is
   the warmest, because it is what the rest of /learn is about. */
.sp-zone-bg { fill: rgba(14, 22, 63, 0.035); stroke: rgba(14, 22, 63, 0.16); stroke-width: 1.2; }
.sp-zone-device .sp-zone-bg { fill: rgba(187, 110, 52, 0.07); stroke: rgba(143, 78, 28, 0.3); }
.sp-zone-pill { fill: var(--brand-navy); }
.sp-zone-device .sp-zone-pill { fill: var(--copper-ground); }
.sp-zone text { fill: #fff; font-size: 13.5px; font-weight: 700; letter-spacing: 0.1em; }

/* Remote is optional, so it is drawn as optional: dashed, outlined, grey. */
.sp-zone-remote .sp-zone-bg { fill: transparent; stroke: rgba(14, 22, 63, 0.35); stroke-dasharray: 6 5; }
.sp-zone-remote .sp-zone-pill { fill: #5C6173; }
.sp-zone .sp-zone-sub { fill: #5C6173; font-size: 12px; font-weight: 500; font-style: italic; letter-spacing: 0; }
.sp-block[data-zone="remote"] rect { fill: #fff; stroke: var(--brand-navy); stroke-dasharray: 5 4; }
.sp-block[data-zone="remote"] text { fill: var(--brand-navy); }
.sp-block[data-zone="remote"].is-selected rect { fill: var(--copper-ground); stroke: var(--copper-dark); stroke-dasharray: none; }
.sp-block[data-zone="remote"].is-selected text { fill: #fff; }
.sp-edge-optional path { stroke-dasharray: 6 5; }

/* Internet off: everything remote fades, everything local stays as it was. */
.is-offline :is(.sp-zone-remote, .sp-block[data-zone="remote"], .sp-edge[data-remote]) { opacity: 0.18; transition: opacity 0.3s; }
.is-offline :is(.flow-zone-remote, .flow-links li[data-remote]) { opacity: 0.35; }

.sp-block { cursor: pointer; outline: none; }
.sp-block rect { fill: var(--brand-navy); stroke: var(--brand-navy); stroke-width: 1.5; transition: fill 0.2s, stroke 0.2s, opacity 0.2s; }
.sp-block text { fill: #fff; font-size: 13.5px; font-weight: 500; pointer-events: none; transition: opacity 0.2s; }
.sp-block:hover rect { stroke: var(--copper); stroke-width: 3; }
.sp-block:focus-visible rect { stroke: var(--copper); stroke-width: 3; }
.sp-block.is-selected rect { fill: var(--copper-ground); stroke: var(--copper-dark); stroke-width: 2; }

.sp-edge path { fill: none; stroke: var(--copper); stroke-width: 1.8; }
.sp-edge text { fill: #3F4459; font-size: 11.5px; font-weight: 500; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.sp-head { fill: var(--copper); }

/* One layer at a time. The page ships with data-layer="data" on the section,
   so without script the data view is what is drawn. */
.sp-edge { display: none; }
[data-view="data"] .sp-edge[data-layer="data"],
[data-view="bus"] .sp-edge[data-layer="bus"],
[data-view="power"] .sp-edge[data-layer="power"],
[data-view="attack"] .sp-edge[data-layer="attack"] { display: inline; }

/* Blocks with nothing to say in the current view fade back. */
[data-view="data"] .sp-block:not([data-has~="data"]) rect,
[data-view="bus"] .sp-block:not([data-has~="bus"]) rect,
[data-view="power"] .sp-block:not([data-has~="power"]) rect,
[data-view="attack"] .sp-block:not([data-has~="attack"]) rect { fill: #fff; stroke: rgba(14, 22, 63, 0.18); stroke-width: 1; }
[data-view="data"] .sp-block:not([data-has~="data"]) text,
[data-view="bus"] .sp-block:not([data-has~="bus"]) text,
[data-view="power"] .sp-block:not([data-has~="power"]) text,
[data-view="attack"] .sp-block:not([data-has~="attack"]) text { fill: #8A8FA3; }

[data-view="attack"] .sp-edge path { stroke: #B3392B; stroke-dasharray: 5 4; }
[data-view="attack"] .sp-head { fill: #B3392B; }

.sp-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 0.5rem 2rem;
  align-items: start;
  padding: 1.25rem 1.5rem;
  min-height: 7.5rem;
}
.sp-panel:hover { transform: none; }
.sp-panel h3 { font-size: 1.2rem; font-weight: 600; color: var(--text-strong); margin-bottom: 0.35rem; }
.sp-panel p { font-size: 0.93rem; line-height: 1.65; color: var(--text-soft); }
.sp-panel .sp-panel-note { border-left: 3px solid var(--copper); padding-left: 1rem; }
.sp-panel .sp-note-layer { display: block; font-size: 0.78rem; font-weight: 600; color: var(--copper-dark); margin-bottom: 0.2rem; }
.sp-panel a { display: inline-block; margin-top: 0.6rem; font-size: 0.92rem; }
.sp-panel-hint { color: var(--text-muted); grid-column: 1 / -1; }

.sp-list-wrap { margin-top: 1.25rem; }
.sp-list-wrap summary { cursor: pointer; color: var(--copper-dark); font-size: 0.9rem; font-weight: 500; }
.sp-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 0.75rem; margin-top: 1rem; }
.sp-item { background: var(--cotton-raised); border: 1px solid var(--navy-border); border-radius: var(--radius-md); padding: 1rem 1.1rem; }
.sp-item h3 { font-size: 1rem; font-weight: 600; color: var(--text-strong); margin-bottom: 0.3rem; }
.sp-item p, .sp-notes li { font-size: 0.85rem; line-height: 1.6; color: var(--text-soft); }
.sp-notes { list-style: none; margin: 0.5rem 0; display: grid; gap: 0.35rem; }
.sp-note-layer { font-weight: 600; color: var(--copper-dark); margin-right: 0.25rem; }
.sp-item a { font-size: 0.85rem; }

/* Mobile flow: the diagram as a vertical list, grouped by zone. Hidden on
   wider screens, where the diagram itself is shown. */
.sp-flow { display: none; }

.flow-zone + .flow-zone { margin-top: 1.25rem; }
.flow-zone-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand-navy);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 0.6rem 1rem;
}
.flow-zone-title span { font-size: 0.78rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: rgba(255, 255, 255, 0.72); }
.flow-zone-device .flow-zone-title { background: var(--copper-ground); }
.flow-zone-remote .flow-zone-title { background: #5C6173; }
.flow-zone-remote .flow-blocks { border-style: dashed; border-color: rgba(14, 22, 63, 0.35); }

.flow-blocks {
  list-style: none;
  display: grid;
  gap: 0;
  border: 1px solid var(--navy-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: #fff;
  overflow: hidden;
}
.flow-block { padding: 0.9rem 1rem; position: relative; }
.flow-block + .flow-block { border-top: 1px solid rgba(14, 22, 63, 0.08); }
.flow-block h4 { font-size: 1rem; font-weight: 600; color: var(--text-strong); }
.flow-sum { font-size: 0.86rem; line-height: 1.55; color: var(--text-soft); margin-top: 0.15rem; }
.flow-note { display: none; font-size: 0.88rem; line-height: 1.55; color: var(--text-strong); margin-top: 0.55rem; padding-left: 0.75rem; border-left: 3px solid var(--copper); }
.flow-links { list-style: none; display: grid; gap: 0.3rem; margin-top: 0.55rem; }
.flow-links li { display: none; font-size: 0.82rem; font-weight: 500; color: var(--text-strong); }
.flow-arrow { color: var(--copper); font-weight: 700; margin-right: 0.15rem; }
.flow-edge { font-weight: 400; color: var(--text-muted); margin-left: 0.4rem; }
.flow-edge::before { content: "· "; }
.flow-read { display: inline-block; margin-top: 0.5rem; font-size: 0.84rem; }

[data-view="data"] .flow-note[data-layer="data"],
[data-view="bus"] .flow-note[data-layer="bus"],
[data-view="power"] .flow-note[data-layer="power"],
[data-view="attack"] .flow-note[data-layer="attack"] { display: block; }
[data-view="data"] .flow-links li[data-layer="data"],
[data-view="bus"] .flow-links li[data-layer="bus"],
[data-view="power"] .flow-links li[data-layer="power"],
[data-view="attack"] .flow-links li[data-layer="attack"] { display: block; }
[data-view="attack"] .flow-note { border-left-color: #B3392B; }
[data-view="attack"] .flow-arrow { color: #B3392B; }

/* Blocks with nothing to say in this view shrink to their name. */
[data-view="data"] .flow-block:not([data-has~="data"]),
[data-view="bus"] .flow-block:not([data-has~="bus"]),
[data-view="power"] .flow-block:not([data-has~="power"]),
[data-view="attack"] .flow-block:not([data-has~="attack"]) { padding-top: 0.55rem; padding-bottom: 0.55rem; background: rgba(14, 22, 63, 0.02); }
[data-view="data"] .flow-block:not([data-has~="data"]) :is(.flow-sum, .flow-read),
[data-view="bus"] .flow-block:not([data-has~="bus"]) :is(.flow-sum, .flow-read),
[data-view="power"] .flow-block:not([data-has~="power"]) :is(.flow-sum, .flow-read),
[data-view="attack"] .flow-block:not([data-has~="attack"]) :is(.flow-sum, .flow-read) { display: none; }
[data-view="data"] .flow-block:not([data-has~="data"]) h4,
[data-view="bus"] .flow-block:not([data-has~="bus"]) h4,
[data-view="power"] .flow-block:not([data-has~="power"]) h4,
[data-view="attack"] .flow-block:not([data-has~="attack"]) h4 { font-size: 0.88rem; font-weight: 500; color: #8A8FA3; }

/* ---------------- Seven tracks, on navy ---------------- */


.tracks { display: grid; gap: 0.75rem; }

.track {
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  background: var(--navy-card);
  transition: border-color var(--transition-normal), background var(--transition-normal);
}
.track:hover, .track[open] { border-color: var(--navy-border-glow); }
.track[open] { background: rgba(19, 29, 79, 0.85); }

.track summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.15rem 1.5rem;
  cursor: pointer;
  list-style: none;
}
.track summary::-webkit-details-marker { display: none; }
.track summary:focus-visible { outline: 2px solid var(--copper-light); outline-offset: -2px; border-radius: var(--radius-lg); }

.track-num {
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem);
  font-weight: 600;
  line-height: 1;
  color: var(--copper-light);
  min-width: 2.6ch;
  font-variant-numeric: tabular-nums;
}
.track-text { display: grid; gap: 0.15rem; }
.track-title { font-size: 1.25rem; font-weight: 600; color: var(--text-strong); }
.track-q { font-size: 0.93rem; color: var(--text-soft); line-height: 1.5; }
.track-count { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }
.track-chev {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--navy-border);
  position: relative;
  transition: transform var(--transition-normal), border-color var(--transition-fast), background var(--transition-fast);
}
.track-chev::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--copper-light);
  border-bottom: 2px solid var(--copper-light);
  transform: translateY(-2px) rotate(45deg);
}
.track summary:hover .track-chev { border-color: var(--copper-light); background: var(--copper-glow); }
.track[open] .track-chev { transform: rotate(180deg); }

.topics {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 0.6rem;
  padding: 0 1.5rem 1.5rem calc(1.5rem + 2.6ch + 1.25rem);
}

.topic {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 0.75rem;
  align-content: start;
  height: 100%;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--navy-border);
  background: rgba(9, 14, 44, 0.55);
  text-decoration: none;
  transition: border-color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}
.topic:hover, .topic:focus-visible { border-color: var(--copper-light); background: rgba(9, 14, 44, 0.85); transform: translateY(-2px); }
.topic-title { font-size: 0.98rem; font-weight: 600; color: var(--text-strong); line-height: 1.35; }
.topic .lv { grid-column: 2; grid-row: 1; align-self: start; }
.topic-sum { grid-column: 1 / -1; font-size: 0.84rem; line-height: 1.55; color: var(--text-soft); }

/* ---------------- How this is checked ---------------- */

.checked p { color: var(--text-soft); line-height: 1.7; max-width: 46rem; }
.checked .checked-date { margin-top: 0.75rem; font-size: 0.85rem; line-height: 1.6; color: var(--text-muted); }
.checked .checked-date .text-link { color: var(--copper-dark); }

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

/* ---------------- Share row ----------------
   Plain links to LinkedIn, X and WhatsApp, plus Copy link. Where the browser
   offers the device share sheet (most phones), a Share button leads. */
.share { margin: 1.75rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--navy-border); }
.share-lead { margin: 0 0 0.7rem; font-size: 0.85rem; font-weight: 600; color: var(--text-strong); }
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.share-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share-native[hidden], .share-copy[hidden] { display: none; }
.share-native { display: inline-flex; align-items: center; gap: 0.45rem; }
.share-native svg { width: 1rem; height: 1rem; fill: currentColor; }
.share-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  color: var(--cotton-ink);
  background: #fff;
  border: 1px solid rgba(14, 22, 63, 0.18);
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}
.share-link svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; fill: currentColor; }
.share-link:hover { border-color: var(--copper-dark); color: var(--copper-dark); }
.share-link:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 2px; }
.share-linkedin svg { fill: #0A66C2; }
.share-whatsapp svg { fill: #1FA855; }
.share-copy.is-done { border-color: #2E7D4F; color: #2E7D4F; }
.share-status { margin: 0.5rem 0 0; min-height: 1.2em; font-size: 0.82rem; font-weight: 500; color: #2E7D4F; }
.share-status:empty { min-height: 0; margin: 0; }
.checked .share { max-width: 46rem; }

/* ---------------- Feedback strip ----------------
   One line and a button that opens the site's contact form, pre-filled with
   the page or class it was pressed on. */
.feedback-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.25rem;
  margin: 1.5rem 0;
  padding: 0.85rem 1.1rem;
  border: 1px dashed rgba(14, 22, 63, 0.25);
  border-radius: var(--radius-md);
}
.feedback-strip p { margin: 0; font-size: 0.92rem; color: var(--text-soft); }
.class-body .feedback-strip { margin: 1.25rem 0 0; }
.checked .feedback-strip { max-width: 46rem; margin-top: 1.25rem; }

/* ---------------- Node pages ---------------- */

.crumbs { font-size: 0.85rem; letter-spacing: 0.03em; margin-bottom: 1rem; color: var(--text-muted); }
.crumbs a { color: var(--text-soft); }
.crumbs a:hover { color: var(--copper-light); }

.node-before { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.node-before > span { font-size: 0.85rem; font-weight: 600; color: var(--text-strong); margin-right: 0.25rem; }
.chip-link {
  font-size: 0.85rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--navy-border);
  background: var(--navy-card);
  color: var(--text-strong);
  text-decoration: none;
}
.chip-link:hover { border-color: var(--copper); color: var(--copper); }

.node-card { margin-bottom: 1.5rem; }
.node-card:hover { transform: none; }

.fact-list { padding-left: 1.4rem; display: grid; gap: 1rem; }
.fact-list li { color: var(--text-soft); line-height: 1.7; font-size: clamp(0.95rem, 0.5vw + 0.82rem, 1.05rem); padding-left: 0.3rem; }
.fact-list li::marker { color: var(--copper); font-weight: 600; }

.fns { margin-left: 0.15rem; white-space: nowrap; }
.fn {
  display: inline-block;
  min-width: 1.15rem;
  padding: 0 0.25rem;
  margin-left: 0.15rem;
  border-radius: 4px;
  font-size: 0.68rem;
  line-height: 1.25rem;
  text-align: center;
  text-decoration: none;
  background: var(--copper-glow);
  color: var(--copper);
}
.fn:hover { background: var(--copper); color: #fff; }

.as-of {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.72rem;
  padding: 0.05rem 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--navy-border);
  color: var(--text-muted);
  white-space: nowrap;
}

.node-pitfalls ul { padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.node-pitfalls li { color: var(--text-soft); line-height: 1.65; }

.node-more { margin: 2rem 0 0.5rem; }
.node-more ul { list-style: none; display: grid; gap: 0.6rem; }
.node-more .muted { font-size: 0.85rem; }

.node-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.75rem 0 2.5rem; }
.node-pager a {
  display: block;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  background: var(--navy-card);
  color: var(--text-strong);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
}
.node-pager a span { display: block; font-size: 0.78rem; font-weight: 400; color: var(--text-muted); margin-bottom: 0.15rem; }
.node-pager a:hover { border-color: var(--copper); }
.node-pager .next { text-align: right; }

.node-sources { border-top: 1px solid var(--navy-border); padding-top: 1.5rem; }
.node-sources ol { padding-left: 1.4rem; display: grid; gap: 0.55rem; }
.node-sources li { font-size: 0.85rem; line-height: 1.55; color: var(--text-soft); scroll-margin-top: 7rem; }
.node-sources li:target { background: var(--copper-glow); border-radius: 4px; }
.node-sources a { color: var(--copper-dark); text-decoration: underline; text-underline-offset: 0.18em; overflow-wrap: anywhere; }

/* ---------------- Topic diagrams ----------------
   One SVG per topic, inlined above the key points. The SVGs carry no colours
   or fonts of their own (check-learn.py rejects them); they draw only with the
   d-* classes below, so all 33 share one visual language with the end-to-end
   diagram on the hub. Text sizes are in SVG units on a 720-wide canvas. */

.node-figure { margin: 0 0 1.5rem; }
.fig-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 10px rgba(14, 22, 63, 0.06);
}
.fig-scroll:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 2px; }
.fig-svg { display: block; width: 100%; height: auto; font-family: var(--font-main); }
/* "View full size", added by learn.js on a row just below every diagram. */
.fig-tools { display: flex; justify-content: flex-end; margin-top: 0.45rem; }
.sp-layout .fig-tools { margin-top: -0.5rem; }
.fig-expand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(14, 22, 63, 0.25);
  background: #fff;
  color: var(--cotton-ink);
  cursor: pointer;
}
.fig-expand:hover { border-color: var(--copper-dark); color: var(--copper-dark); }
.fig-expand:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 2px; }
.fig-expand span { font-size: 0.95rem; line-height: 1; }

/* The full-size viewer. */
html.lb-open, html.lb-open body { overflow: hidden; }
.lb[hidden] { display: none; }
.lb {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem;
  background: rgba(6, 9, 30, 0.96);
  font-family: var(--font-main);
}
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.lb-title { margin: 0; color: #fff; font-size: 0.95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-tools { display: flex; gap: 0.4rem; flex-shrink: 0; }
.lb-btn {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.7rem;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.lb-btn.lb-fit { font-size: 0.85rem; }
.lb-btn.lb-close { background: var(--copper-ground); border-color: var(--copper-ground); font-size: 1.4rem; }
.lb-btn:hover { background: rgba(255, 255, 255, 0.16); }
.lb-btn.lb-close:hover { background: var(--copper-dark); }
.lb-btn:focus-visible, .lb-view:focus-visible { outline: 2px solid var(--copper-light); outline-offset: 2px; }
.lb-views[hidden] { display: none; }
.lb-views { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.lb-view {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}
.lb-view[aria-pressed="true"] { background: #fff; color: var(--brand-navy); border-color: #fff; }
.lb-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius-md);
  touch-action: none;
  cursor: grab;
}
.lb-stage:active { cursor: grabbing; }
.lb-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.lb-hint { margin: 0; text-align: center; font-size: 0.78rem; color: rgba(255, 255, 255, 0.65); }

/* Details card for a tapped block, sliding up over the bottom of the diagram. */
.lb-sheet[hidden] { display: none; }
.lb-sheet {
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.6rem;
  max-height: 46%;
  overflow: auto;
  padding: 1rem 2.75rem 1rem 1.1rem;
  background: #fff;
  border: 1px solid rgba(14, 22, 63, 0.15);
  border-radius: var(--radius-md);
  box-shadow: 0 -6px 24px rgba(14, 22, 63, 0.18);
  cursor: auto;
  touch-action: auto;
  animation: lb-sheet-in 0.18s ease-out;
}
@keyframes lb-sheet-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.lb-sheet h3 { margin: 0 0 0.25rem; font-size: 1.05rem; font-weight: 600; color: var(--cotton-ink); }
.lb-sheet p { margin: 0; font-size: 0.9rem; line-height: 1.55; color: #3F4459; }
.lb-sheet-note { margin-top: 0.7rem; padding-left: 0.8rem; border-left: 3px solid var(--copper); }
.lb-sheet-note span { display: block; font-size: 0.75rem; font-weight: 600; color: var(--copper-dark); margin-bottom: 0.15rem; }
.lb-sheet .text-link { display: inline-block; margin-top: 0.7rem; font-size: 0.88rem; color: var(--copper-dark); }
.lb-sheet-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--cotton-ink);
  background: rgba(14, 22, 63, 0.06);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.lb-sheet-close:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .lb-sheet { animation: none; } }
.node-figure figcaption { margin-top: 0.6rem; font-size: 0.85rem; line-height: 1.5; color: var(--text-muted); }

/* Shapes */
.d-box { fill: var(--brand-navy); stroke: var(--brand-navy); stroke-width: 1.5; }
.d-soft { fill: #fff; stroke: var(--brand-navy); stroke-width: 1.4; }
.d-accent { fill: var(--copper-ground); stroke: var(--copper-dark); stroke-width: 1.5; }
.d-tint { fill: rgba(187, 110, 52, 0.08); stroke: rgba(143, 78, 28, 0.35); stroke-width: 1.2; }
.d-zone { fill: rgba(14, 22, 63, 0.035); stroke: rgba(14, 22, 63, 0.2); stroke-width: 1.2; stroke-dasharray: 5 4; }
.d-muted { fill: rgba(14, 22, 63, 0.06); stroke: rgba(14, 22, 63, 0.18); stroke-width: 1; }
.d-grid { fill: none; stroke: rgba(14, 22, 63, 0.12); stroke-width: 1; }
.d-axis { fill: none; stroke: #5C6173; stroke-width: 1.2; }

/* Lines and arrowheads */
.d-line { fill: none; stroke: var(--copper); stroke-width: 2; }
.d-line-navy { fill: none; stroke: var(--brand-navy); stroke-width: 1.8; }
.d-line-muted { fill: none; stroke: #8A8FA3; stroke-width: 1.5; stroke-dasharray: 5 4; }
.d-line-good { fill: none; stroke: #2E7D4F; stroke-width: 2; }
.d-line-bad { fill: none; stroke: #B3392B; stroke-width: 2; stroke-dasharray: 5 4; }
.d-head { fill: var(--copper); }
.d-head-navy { fill: var(--brand-navy); }
.d-head-good { fill: #2E7D4F; }
.d-head-bad { fill: #B3392B; }
.d-dot { fill: var(--copper); }
.d-dot-navy { fill: var(--brand-navy); }

/* Text */
.d-text { fill: var(--brand-navy); font-size: 14px; }
.d-strong { fill: var(--brand-navy); font-size: 14.5px; font-weight: 600; }
.d-title { fill: var(--brand-navy); font-size: 16px; font-weight: 700; }
.d-on-dark { fill: #fff; font-size: 14px; font-weight: 500; }
.d-on-dark-small { fill: rgba(255, 255, 255, 0.82); font-size: 12px; }
.d-small { fill: #3F4459; font-size: 12.5px; }
.d-note { fill: #5C6173; font-size: 12px; font-style: italic; }
.d-label { fill: var(--copper-dark); font-size: 12.5px; font-weight: 600; }
.d-good { fill: #2E7D4F; font-size: 13px; font-weight: 600; }
.d-bad { fill: #B3392B; font-size: 13px; font-weight: 600; }
.d-mono { fill: var(--brand-navy); font-family: var(--font-mono); font-size: 12.5px; }

/* ---------------- Chooser ---------------- */

/* On its own page the chooser is the hero: a short dark band, and the card
   rises into it so it is the first thing on screen. */
.chooser-hero { padding-bottom: clamp(5.5rem, 9vw, 7rem); }
.chooser-hero .crumbs { margin-bottom: 0.75rem; }
.chooser-page { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.chooser-page .chooser { margin-top: calc(-1 * clamp(4rem, 7vw, 5.25rem)); }
.before-title { margin: 2.5rem 0 1.25rem; font-size: clamp(1.4rem, 1rem + 1.4vw, 1.9rem); }
.chooser-after { max-width: 74rem; }
.chooser-after > * { max-width: 46rem; }

.chooser { max-width: 74rem; margin-bottom: 1rem; scroll-margin-top: calc(var(--header-height, 80px) + 1rem); }
.chooser-card {
  margin-bottom: 3rem;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  box-shadow: 0 18px 50px rgba(14, 22, 63, 0.16), 0 2px 8px rgba(14, 22, 63, 0.06);
}
.chooser-card:hover { transform: none; box-shadow: 0 18px 50px rgba(14, 22, 63, 0.16), 0 2px 8px rgba(14, 22, 63, 0.06); }

.chooser-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--navy-border);
}
.chooser-title { font-size: clamp(1.35rem, 1rem + 1.1vw, 1.75rem); font-weight: 600; color: var(--text-strong); margin-bottom: 0.2rem; }
.chooser-head .muted { font-size: 0.92rem; }
.chooser-status { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0.45rem 1rem; min-width: 15rem; }
.chooser-count { font-size: 0.85rem; color: var(--text-soft); margin: 0; }
.chooser-count strong { color: var(--text-strong); font-weight: 700; }
.chooser-bar { grid-column: 1; height: 6px; border-radius: 3px; background: rgba(14, 22, 63, 0.1); overflow: hidden; }
.chooser-bar span { display: block; height: 100%; width: 0; background: var(--copper-dark); border-radius: 3px; transition: width var(--transition-normal); }
.chooser-reset { grid-column: 2; grid-row: 1 / span 2; }
/* .btn sets a display value, which would otherwise beat the hidden attribute. */
.chooser-reset[hidden], .sp-internet[hidden] { display: none; }

/* Questions: three across, and each row shares its title, helper and option
   tracks (subgrid), so the options in one row all start at the same height. */
.chooser-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 1.5rem;
  margin-top: 1.5rem;
}
.q {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  row-gap: 0.35rem;
  margin-bottom: 1.75rem;
  min-width: 0;
}
.q-title { display: flex; align-items: flex-start; gap: 0.6rem; font-weight: 600; color: var(--text-strong); font-size: 0.98rem; line-height: 1.4; margin: 0; }
.q-num {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: -0.05rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--copper-dark);
  border: 1.5px solid rgba(143, 78, 28, 0.45);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.q.is-answered .q-num { background: var(--copper-dark); border-color: var(--copper-dark); color: #fff; }
.q-help { font-size: 0.8rem; line-height: 1.5; color: var(--text-muted); margin: 0 0 0.35rem 2.2rem; }
.opts { display: grid; gap: 0.4rem; align-content: start; }
.opt {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.65rem;
  align-items: start;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.opt:hover { border-color: var(--copper); }
.opt:has(input:checked) { border-color: var(--copper-dark); background: rgba(187, 110, 52, 0.07); box-shadow: inset 3px 0 0 var(--copper-dark); }

/* Drawn rather than native: the site declares a dark colour scheme, which
   renders native radios as dark discs on this light card. */
.opt input {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  margin: 0.2rem 0 0;
  border-radius: 50%;
  border: 1.5px solid rgba(14, 22, 63, 0.45);
  background: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.opt input::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--copper-dark); transform: scale(0); transition: transform 0.12s ease; }
.opt input:checked { border-color: var(--copper-dark); }
.opt input:checked::before { transform: scale(1); }
.opt input:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 2px; }
.opt-label { font-size: 0.9rem; color: var(--text-strong); }
.opt-hint { grid-column: 2; font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }

/* Result: empty, it is a quiet dashed placeholder; filled, a solid panel
   with a copper edge. */
.chooser-result { margin-top: 0.25rem; }
.result-empty {
  margin: 0;
  padding: 1.1rem 1.25rem;
  border: 1.5px dashed rgba(14, 22, 63, 0.2);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.result-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1rem 2rem;
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid rgba(143, 78, 28, 0.35);
  box-shadow: inset 4px 0 0 var(--copper-dark);
}
.result-lead { font-size: 0.88rem; color: var(--text-muted); margin: 0; }
.result-name { font-size: clamp(1.4rem, 1rem + 1.2vw, 1.85rem); font-weight: 600; color: var(--text-strong); margin: 0.1rem 0 0.4rem; line-height: 1.2; }
.result-why { color: var(--text-soft); font-size: 0.98rem; line-height: 1.65; margin: 0; }
.result-flags { list-style: none; display: grid; gap: 0.6rem; margin: 0; align-content: start; }
.result-flags li { font-size: 0.88rem; line-height: 1.6; color: var(--text-soft); padding: 0.65rem 0.85rem; border-left: 3px solid var(--copper); background: var(--copper-glow); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.result-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; padding-top: 0.25rem; }

/* "Copy this as a prompt": under the result, and at the end of each class card. */
.prompt-box[hidden] { display: none; }
.prompt-box-result {
  margin-top: 1.25rem;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(14, 22, 63, 0.035);
  border: 1px solid var(--navy-border);
}
.prompt-box-class { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--navy-border); }
.prompt-title { font-size: 1.05rem; font-weight: 600; color: var(--text-strong); margin: 0 0 0.25rem; }
.prompt-box-class h4 { margin-top: 0; }
.prompt-lead { font-size: 0.9rem; color: var(--text-soft); margin: 0 0 0.85rem; max-width: 52rem; }
.prompt-project { display: grid; gap: 0.35rem; margin-bottom: 0.85rem; max-width: 52rem; }
.prompt-project span { font-size: 0.85rem; font-weight: 600; color: var(--text-strong); }
.prompt-project em { font-weight: 400; font-style: normal; color: var(--text-muted); }
.prompt-project textarea {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(14, 22, 63, 0.25);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--cotton-ink);
  resize: vertical;
  color-scheme: light;
}
.prompt-project textarea:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 1px; }
/* Copy button and "See the prompt" share one line; the prompt opens below,
   full width. On phones they stack (see the small-screen rules). */
.prompt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; }
.prompt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--copper-dark);
  background: none;
  border: none;
  padding: 0.35rem 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
.prompt-toggle::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--transition-fast);
}
.prompt-toggle[aria-expanded="true"]::before { transform: rotate(45deg) translate(-1px, -1px); }
.prompt-toggle:hover { color: var(--cotton-ink); }
.prompt-toggle:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 2px; border-radius: 3px; }
.copy-status { font-size: 0.85rem; color: #2E7D4F; font-weight: 500; }
.copy-status:empty { display: none; }
.prompt-text[hidden] { display: none; }
.prompt-text {
  margin: 0.85rem 0 0;
  padding: 0.9rem 1rem;
  max-height: 22rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--cotton-ink);
  background: #fff;
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
}
.prompt-caution { margin: 0.85rem 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--text-muted); max-width: 52rem; }

/* The six classes */
.classes-title { margin-bottom: 0.4rem; }
.classes-note { font-size: 0.88rem; color: var(--text-muted); max-width: 52rem; margin-bottom: 0.75rem; }
.classes-before { color: var(--text-soft); margin-bottom: 1.75rem; }
.classes-before strong { color: var(--text-strong); font-weight: 600; }
.class-figure { margin-top: 1.25rem; max-width: 50rem; box-shadow: none; }

.class-group + .class-group { margin-top: 2.25rem; }
.group-title { font-size: 1.2rem; font-weight: 600; color: var(--text-strong); }
.group-blurb { font-size: 0.9rem; color: var(--text-soft); margin: 0.2rem 0 0.9rem; }

.class-card {
  background: var(--cotton-raised);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 10px rgba(14, 22, 63, 0.06);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.class-card:hover { border-color: rgba(143, 78, 28, 0.4); }
.class-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1.5rem;
  align-items: center;
  padding: 1.1rem 1.4rem;
  cursor: pointer;
  list-style: none;
}
.class-card summary::-webkit-details-marker { display: none; }
.class-card summary:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: -2px; border-radius: var(--radius-lg); }
.class-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; grid-column: 1; }
.class-name { font-size: 1.15rem; font-weight: 600; color: var(--text-strong); }
.class-one { grid-column: 1; font-size: 0.92rem; color: var(--text-soft); line-height: 1.55; }
.class-toggle {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--copper-dark);
  white-space: nowrap;
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(143, 78, 28, 0.35);
  border-radius: var(--radius-full);
}
.class-card summary:hover .class-toggle { background: rgba(143, 78, 28, 0.08); }
.class-toggle .when-open { display: none; }
.class-card[open] .class-toggle .when-open { display: inline; }
.class-card[open] .class-toggle .when-closed { display: none; }

.match-badge {
  display: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--copper-ground);
  color: #fff;
}
.class-card.is-match { border-color: var(--copper-dark); box-shadow: 0 0 0 3px rgba(143, 78, 28, 0.16), 0 10px 28px rgba(14, 22, 63, 0.1); }
.class-card.is-match .match-badge { display: inline-block; }

.class-body { padding: 0 1.4rem 1.4rem; border-top: 1px solid var(--navy-border); }
.class-body h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-strong); margin: 1.25rem 0 0.6rem; }
.h4-note { font-weight: 400; font-size: 0.82rem; color: var(--text-muted); margin-left: 0.4rem; }

/* At a glance: a two-column spec table, label then value. */
.spec-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--navy-border); border-radius: var(--radius-md); overflow: hidden; background: #fff; }
.spec-table th { width: 9.5rem; text-align: left; vertical-align: top; font-size: 0.85rem; font-weight: 700; color: var(--text-strong); padding: 0.55rem 0.9rem; background: rgba(14, 22, 63, 0.04); border-right: 1px solid var(--navy-border); }
.spec-table td { font-size: 0.88rem; line-height: 1.5; color: var(--text-soft); padding: 0.55rem 0.9rem; }
.spec-table tr + tr th, .spec-table tr + tr td { border-top: 1px solid rgba(14, 22, 63, 0.07); }

/* Good for / Wrong for, as two columns of one table. */
.fit-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1rem; border: 1px solid var(--navy-border); border-radius: var(--radius-md); overflow: hidden; background: #fff; table-layout: fixed; }
.fit-table th { text-align: left; font-size: 0.85rem; font-weight: 700; color: var(--text-strong); padding: 0.6rem 0.9rem; background: rgba(14, 22, 63, 0.04); border-bottom: 1px solid var(--navy-border); }
.fit-table th + th, .fit-table td + td { border-left: 1px solid var(--navy-border); }
.fit-table td { font-size: 0.88rem; line-height: 1.5; color: var(--text-soft); padding: 0.5rem 0.9rem 0.5rem 2rem; position: relative; vertical-align: top; }
.fit-table tbody tr + tr td { border-top: 1px solid rgba(14, 22, 63, 0.06); }
.fit-table td:not(:empty)::before { position: absolute; left: 0.85rem; top: 0.5rem; font-weight: 700; }
.fit-table td:first-child:not(:empty)::before { content: "✓"; color: #2E7D4F; }
.fit-table td:last-child:not(:empty)::before { content: "✕"; color: #B3392B; }

/* Example parts */
.table-scroll { overflow-x: auto; border: 1px solid var(--navy-border); border-radius: var(--radius-md); background: #fff; }
.table-scroll:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 2px; }
.parts { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 0.84rem; }
.parts th { text-align: left; font-weight: 700; font-size: 0.8rem; color: var(--text-strong); padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--navy-border); background: rgba(14, 22, 63, 0.04); white-space: nowrap; }
.parts td { padding: 0.65rem 0.75rem; border-bottom: 1px solid rgba(14, 22, 63, 0.08); vertical-align: top; color: var(--text-soft); line-height: 1.45; }
.parts tbody tr:nth-child(even) td { background: rgba(14, 22, 63, 0.018); }
.parts tr:last-child td { border-bottom: none; }
.parts td strong { color: var(--text-strong); font-weight: 600; }
.parts .c-vendor { width: 8.5rem; color: var(--text-strong); }
.parts .c-part { min-width: 11rem; }
.parts .c-cores { min-width: 13rem; }
.parts .c-price { min-width: 10.5rem; }
.part-note { display: block; font-size: 0.76rem; color: var(--text-muted); margin-top: 0.2rem; }
.kind { display: inline-block; font-size: 0.72rem; font-weight: 500; padding: 0.1rem 0.5rem; border-radius: var(--radius-full); border: 1px solid var(--navy-border); white-space: nowrap; color: var(--text-soft); }
.kind-board, .kind-som { background: var(--copper-glow); border-color: transparent; color: var(--copper-dark); }
.price { display: block; font-weight: 700; color: var(--text-strong); white-space: nowrap; }
.price-src { display: block; font-size: 0.76rem; color: var(--copper-dark); }
.price-note { display: block; font-size: 0.72rem; }
.price-flag { font-size: 0.68rem; padding: 0.05rem 0.4rem; border-radius: var(--radius-full); background: rgba(179, 57, 43, 0.1); color: #9a3326; }

/* ---------------- Small screens ---------------- */

@media (max-width: 900px) {
  /* Below this width the diagram would need sideways scrolling, so the flow
     replaces it, its panel and its list. */
  .sp-flow { display: block; margin-top: 1.25rem; }
  .sp-list-wrap, .sp-panel { display: none; }
  .sp-svg { min-width: 0; }
  /* With the full-size viewer running, the diagram and its tap-for-details
     card replace the text version; without script, the text version stays. */
  .has-viewer .sp-flow { display: none; }
  .has-viewer .sp-tap-hint { display: block; }
  .fig-scroll, .sp-scroll { cursor: zoom-in; }
  .sp-toolbar {
    position: sticky;
    top: var(--header-height, 64px);
    z-index: 5;
    margin: 0 -1.25rem 1rem;
    padding: 0.6rem 1.25rem 0.7rem;
    background: rgba(239, 231, 220, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--navy-border);
  }
  .sp-tabs { display: grid; grid-template-columns: repeat(4, auto); width: 100%; border-radius: var(--radius-md); }
  .sp-internet { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
  .sp-tab { padding: 0.5rem 0.4rem; font-size: 0.82rem; border-radius: var(--radius-sm); }
  .sp-question { font-size: 0.82rem; }
}

@media (max-width: 1024px) {
  .chooser-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .chooser-form { grid-template-columns: 1fr; }
  .chooser-head { flex-direction: column; align-items: stretch; }
  .chooser-status { min-width: 0; }
  .result-panel { grid-template-columns: 1fr; padding: 1.2rem; }
  .track summary { grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.9rem; padding: 1rem 1.1rem; }
  .track-count { display: none; }
  .topics { padding: 0 1.1rem 1.1rem; }
  .class-card summary { grid-template-columns: 1fr; padding: 1rem 1.1rem; }
  .class-toggle { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 0.4rem; }
  .class-body { padding: 0 1.1rem 1.1rem; }
}

@media (max-width: 640px) {
  /* Phones: the share sheet leads, full width; the platform links share a row. */
  .share-actions { flex-direction: column; align-items: stretch; }
  .share-native { justify-content: center; width: 100%; min-height: 2.75rem; }
  .share-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .share-link { justify-content: center; min-height: 2.75rem; }
  .prompt-actions { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .prompt-actions .btn { width: 100%; justify-content: center; }
  .prompt-toggle { align-self: flex-start; }
  .node-pager { grid-template-columns: 1fr; }
  .node-pager .next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .sp-block rect, .sp-block text, .sp-tab, .track-chev, .topic { transition: none; }
  .topic:hover, .topic:focus-visible { transform: none; }
}
