/* Physical AI theory lessons. Builds on site.css tokens (light + dark) and the .article typography.
 * Everything is prefixed th- so it cannot collide with lab styles. No inline styles, no external assets:
 * the site CSP only allows same-origin CSS. Diagrams are HTML lists drawn with CSS, so they reflow on phones
 * and stay readable by screen readers. See docs/THEORY_LESSONS.md for the component catalogue. */

/* ---------- page frame ---------- */
.th-skip { position: absolute; left: 12px; top: -48px; z-index: 60; background: var(--ink); color: var(--panel); padding: 10px 14px; border-radius: var(--r); font-weight: 600; text-decoration: none; }
.th-skip:focus { top: 10px; }
.th-wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: minmax(0, 1fr); }
.th-wrap .th-article { max-width: 760px; width: 100%; margin: 0 auto; padding: 28px 0 32px; }
.th-wrap .th-article h2 { scroll-margin-top: 16px; }
.th-article section + section { margin-top: 8px; }
.th-article code { font-family: var(--mono); font-size: .9em; background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; }
.th-article pre.math { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--rule); background: var(--panel); border-radius: 6px; overflow-x: auto; }
.th-article h3 { font-size: 18px; margin: 26px 0 8px; font-weight: 700; }
.th-article ul, .th-article ol { padding-left: 1.3em; }
.th-small { font-size: 14.5px !important; color: var(--ink-2) !important; }
.th-lead { font-size: 20px !important; font-weight: 600; }

/* table of contents: a collapsible list on phones, a sticky sidebar on wide screens */
.th-toc { margin: 18px 0 0; }
.th-toc details { border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); }
.th-toc summary { cursor: pointer; padding: 11px 14px; font-weight: 700; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.th-toc summary::-webkit-details-marker { display: none; }
.th-toc summary::after { content: "+"; font: 700 18px/1 var(--font); color: var(--ink-2); }
.th-toc details[open] summary::after { content: "–"; }
.th-toc ol { margin: 0; padding: 4px 14px 12px 34px; font-size: 14.5px; }
.th-toc li { margin: 0; }
.th-toc a { display: block; padding: 5px 0; color: var(--ink-2); text-decoration: none; }
.th-toc a:hover { color: var(--cobalt); text-decoration: underline; }
@media (min-width: 1180px) {
  .th-wrap { grid-template-columns: 252px minmax(0, 760px); column-gap: 56px; justify-content: center; align-items: start; }
  .th-toc { position: sticky; top: 16px; margin: 36px 0 0; max-height: calc(100vh - 32px); overflow: auto; }
  .th-wrap .th-article { margin: 0; }
}

/* ---------- hero ---------- */
.th-hero { padding-bottom: 6px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.th-article .th-hero h1 { font-size: clamp(30px, 4.6vw, 44px); margin-top: 6px; }
.th-article .th-hero .dek { font-size: 21px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.th-subtitle { font-size: 17px !important; color: var(--ink-2) !important; margin: 0 0 16px; }
.th-meta { list-style: none; padding: 0 !important; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.th-meta li { font-size: 13px !important; line-height: 1.2 !important; font-weight: 600; color: var(--ink-2) !important; border: 1px solid var(--rule); background: var(--panel); border-radius: 999px; padding: 6px 12px; }

/* ---------- text components ---------- */
.th-objectives { list-style: none; padding: 14px 16px !important; margin: 8px 0 16px; background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--green); border-radius: 8px; }
.th-objectives li { position: relative; padding-left: 28px; margin: 6px 0; }
.th-objectives li::before { content: "✓"; content: "✓" / ""; position: absolute; left: 4px; top: 0; font-weight: 800; color: var(--green); }
.th-anchor { margin: 18px 0 20px; padding: 20px 22px; background: var(--cobalt-2); border-left: 5px solid var(--cobalt); border-radius: 8px; }
.th-article .th-anchor p { font-size: clamp(19px, 2.6vw, 23px); line-height: 1.45; font-weight: 700; margin: 0; }
.th-terms { margin: 16px 0; display: grid; gap: 10px; }
.th-terms > div { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.th-terms dt { font-weight: 800; color: var(--cobalt); font-size: 17px; }
.th-terms dd { margin: 3px 0 0; font-size: 16.5px; line-height: 1.55; }
.th-terms dd em { display: block; margin-top: 4px; color: var(--ink-2); }
@media (min-width: 700px) { .th-terms { grid-template-columns: 1fr 1fr; } .th-terms > div:last-child { grid-column: 1 / -1; } }
.th-key { font-size: 21px !important; font-weight: 700; line-height: 1.4 !important; margin: 22px 0 !important; padding: 4px 0 4px 16px; border-left: 4px solid var(--cobalt); }
.th-task { font-size: 21px !important; font-weight: 700; text-align: center; margin: 14px 0 !important; padding: 16px; background: var(--panel); border: 1px dashed var(--ink-3); border-radius: 8px; }
.th-note-box { background: var(--cobalt-2); border-radius: 8px; padding: 4px 16px; margin: 20px 0; border: 1px solid var(--rule); }
.th-plain { padding-left: 1.2em; }
.th-plain li { margin: 5px 0; }
.th-reasons li { margin: 8px 0; }
.th-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 !important; margin: 14px 0; }
.th-chips li { font-size: 14.5px !important; line-height: 1.2 !important; font-weight: 600; padding: 7px 12px; border: 1px solid var(--cobalt); background: var(--cobalt-2); border-radius: 999px; }
.th-examples { margin: 14px 0; display: grid; gap: 8px; }
.th-examples > div { border-left: 3px solid var(--rule); padding: 2px 0 2px 12px; }
.th-examples dt { font-weight: 700; }
.th-examples dd { margin: 1px 0 0; color: var(--ink-2); font-size: 16.5px; }
.th-table { font-size: 15px; }
.th-article .th-table th { color: var(--ink-2); }
.th-table th[scope="row"] { font-weight: 700; color: var(--ink); white-space: nowrap; padding-right: 14px; }

/* "the question this layer answers" line, and a "go deeper" pointer */
.th-asks { margin: 0 0 6px !important; font-size: 16px !important; font-weight: 700; color: var(--cobalt) !important; }
.th-go { font-size: 16px !important; padding: 8px 12px; background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--cobalt); border-radius: 6px; }
@media (min-width: 640px) { .th-plain.th-two-col { columns: 2; column-gap: 32px; } .th-plain.th-two-col li { break-inside: avoid; } }

/* ---------- diagrams (HTML lists drawn with CSS) ---------- */
.th-diagram { margin: 24px 0 !important; padding: 16px; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; }
.th-diagram figcaption { font-size: 14px !important; color: var(--ink-2) !important; margin-top: 14px !important; padding-top: 10px; border-top: 1px solid var(--rule); }
.th-diagram ol, .th-diagram ul { padding: 0; margin: 0; list-style: none; }
.th-diagram li { font-size: 15px !important; line-height: 1.35 !important; }
.th-badge { display: inline-block; margin: 0 0 12px !important; font-size: 12px !important; letter-spacing: .07em; text-transform: uppercase; font-weight: 800; color: var(--cobalt) !important; border: 1px solid var(--cobalt); padding: 3px 9px; border-radius: 4px; }
.th-diagram h3 { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 10px; font-weight: 800; }
.th-diagram h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* pill chains: Input -> Computation -> Output */
.th-pills { display: flex; flex-wrap: wrap; align-items: center; }
.th-pills li { position: relative; margin: 5px 28px 5px 0; padding: 7px 12px; border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; font-weight: 600; }
.th-pills li:last-child { margin-right: 0; }
.th-pills li:not(:last-child)::after { content: "→"; content: "→" / ""; position: absolute; right: -22px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-weight: 400; }
.th-pills li.th-again { border-style: dashed; border-color: var(--orange); background: var(--orange-2); }
.th-pills li.th-again::before { content: "↺ "; content: "↺ " / ""; }
.th-pills.is-center { justify-content: center; }
.th-compare .th-row + .th-row { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--rule); }
.th-row-label { margin: 0 0 4px !important; font-size: 12.5px !important; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2) !important; }
.th-row.is-loop .th-row-label { color: var(--cobalt) !important; }

/* two side-by-side panels (stack on phones) */
.th-two { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .th-two { grid-template-columns: 1fr 1fr; } }
.th-panel { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 14px; }
.th-verdict { margin: 12px 0 0 !important; font-size: 15px !important; font-weight: 700; padding: 8px 10px; border-radius: 6px; }
.th-verdict.is-bad { background: var(--orange-2); border-left: 4px solid var(--orange); }
.th-verdict.is-good { background: var(--green-2); border-left: 4px solid var(--green); }

/* vertical list with down-arrows */
.th-vlist li { position: relative; margin: 0 0 22px; padding: 8px 12px; text-align: center; background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; font-weight: 600; }
.th-vlist li:last-child { margin-bottom: 0; }
.th-vlist li:not(:last-child)::after { content: "↓"; content: "↓" / ""; position: absolute; left: 50%; bottom: -21px; transform: translateX(-50%); color: var(--ink-2); font-weight: 400; }
.th-vlist li.is-end { background: var(--green-2); border-color: var(--green); }
.th-vlist li.is-focus { background: var(--cobalt-2); border-color: var(--cobalt); }
.th-vlist.is-bad li { border-color: var(--orange); }
.th-vlist.is-bad li.is-end { background: var(--orange-2); }

/* a block that groups a list of parts inside a node (e.g. World state: Robot, Objects, ...) */
.th-mini { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.th-diagram .th-mini li { font-size: 13px !important; line-height: 1.2 !important; padding: 3px 9px; border: 1px solid var(--rule); border-radius: 999px; background: var(--panel); font-weight: 600; }
.th-chips.is-center { justify-content: center; position: relative; padding-bottom: 24px !important; }
.th-chips.is-center::after { content: "↓"; content: "↓" / ""; position: absolute; left: 0; right: 0; bottom: 0; text-align: center; color: var(--ink-2); font-size: 18px; }
.th-pills.is-center li { padding: 6px 10px; margin-right: 24px; }
.th-pills.is-center li:last-child { margin-right: 0; }
.th-pills.is-center li:not(:last-child)::after { right: -19px; }

/* the Physical AI loop */
.th-flow li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 0 0 24px; }
.th-flow li:last-child { margin-bottom: 0; }
.th-flow li:not(:last-child)::after { content: "↓"; content: "↓" / ""; position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); color: var(--ink-2); font-size: 16px; }
.th-node { display: block; text-align: center; padding: 10px 14px; border: 2px solid var(--cobalt); background: var(--cobalt-2); border-radius: 8px; font-weight: 800; font-size: 16px; }
.th-node.is-world { border-style: dashed; border-color: var(--ink-3); background: var(--paper); }
.th-node.is-act { border-color: var(--orange); background: var(--orange-2); }
.th-node.is-focus { border-color: var(--cobalt); background: var(--cobalt-2); box-shadow: inset 0 0 0 2px var(--cobalt); }
.th-conn { display: block; text-align: center; padding: 4px 12px; border: 1px dashed var(--ink-3); border-radius: 999px; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); background: transparent; }
.th-return .th-conn { border-color: var(--orange); color: var(--ink); background: var(--orange-2); }
.th-return .th-conn::before { content: "↺ "; content: "↺ " / ""; }
.th-note { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
@media (min-width: 680px) {
  .th-flow li { grid-template-columns: 210px minmax(0, 1fr); gap: 4px 18px; align-items: center; }
  .th-flow li:not(:last-child)::after { left: 105px; }
}

/* true state -> observation -> belief */
.th-chain { display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); }
.th-n { text-align: center; padding: 10px 12px; border: 2px solid var(--rule); background: var(--paper); border-radius: 8px; }
.th-n b { display: block; font-size: 15.5px; }
.th-n span { display: block; font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.th-n.is-focus { border-color: var(--cobalt); background: var(--cobalt-2); }
.th-l { position: relative; text-align: center; font-size: 12.5px; color: var(--ink-2); }
.th-l span { display: block; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.th-l small { display: block; font-size: 12.5px; color: var(--ink-2); }
.th-l::after { content: "↓"; content: "↓" / ""; display: block; font-size: 18px; line-height: 1.1; margin-top: 2px; color: var(--ink-2); }
.th-chain > .th-n { position: relative; }
@media (min-width: 800px) {
  .th-chain { grid-template-columns: 1fr auto 1fr auto 1fr; gap: 6px; align-items: center; }
  .th-chain.is-three { grid-template-columns: 1fr auto 1fr; }
  .th-l { padding: 0 2px; max-width: 108px; }
  .th-l::after { content: "→"; content: "→" / ""; font-size: 20px; }
}

/* the conceptual stack */
.th-stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .th-stack { grid-template-columns: 1.15fr 1fr; align-items: stretch; } }
.th-col { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 14px; }
.th-col ol { display: flex; flex-direction: column; }
.th-col li { position: relative; margin: 0 0 22px; padding: 8px 12px; text-align: center; background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; font-weight: 600; }
.th-col li:last-child { margin-bottom: 0; }
.th-col li:not(:last-child)::after { content: "↓"; content: "↓" / ""; position: absolute; left: 50%; bottom: -21px; transform: translateX(-50%); color: var(--ink-2); font-weight: 400; }
.th-col li small { display: block; font-weight: 500; color: var(--ink-2); font-size: 12.5px; }
.th-col li.is-robot { border: 2px solid var(--orange); background: var(--orange-2); font-weight: 800; }
.th-col.is-sense li { border-color: var(--cobalt); background: var(--cobalt-2); }
.th-colnote { margin: 0 0 14px !important; font-size: 14.5px !important; line-height: 1.45 !important; color: var(--ink-2) !important; }
/* the sensing column reads bottom to top: reversed at every width, with up-arrows */
.th-col.is-sense { display: flex; flex-direction: column; }
.th-col.is-sense ol { margin-top: auto; flex-direction: column-reverse; gap: 22px; }
.th-col.is-sense li { margin: 0; }
.th-col.is-sense li:not(:last-child)::after { content: none; }
.th-col.is-sense li:not(:first-child)::after { content: "↑"; content: "↑" / ""; position: absolute; left: 50%; bottom: -21px; transform: translateX(-50%); color: var(--ink-2); font-weight: 400; }
.th-feedback { margin: 12px 0 0 !important; font-size: 15px !important; padding: 9px 12px; border: 1px dashed var(--orange); background: var(--orange-2); border-radius: 6px; }
.th-feedback::before { content: "↺ "; content: "↺ " / ""; }

/* belief bars: one labelled native <meter> per hypothesis (accessible, no inline styles) */
.th-bars { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 10px; }
.th-diagram .th-bars li { display: grid; grid-template-columns: minmax(84px, 38%) minmax(0, 1fr) 3.2em; gap: 10px; align-items: center; font-size: 14.5px !important; line-height: 1.25 !important; }
.th-bar-label { font-weight: 600; }
.th-bar-val { font-variant-numeric: tabular-nums; font-weight: 800; text-align: right; }
.th-bars meter { width: 100%; height: 16px; border: 0; border-radius: 8px; background: var(--rule); }
.th-bars meter::-webkit-meter-bar { background: var(--rule); border: 0; border-radius: 8px; height: 16px; }
.th-bars meter::-webkit-meter-optimum-value, .th-bars meter::-webkit-meter-suboptimum-value, .th-bars meter::-webkit-meter-even-less-good-value { background: var(--cobalt); border-radius: 8px; }
.th-bars meter::-moz-meter-bar { background: var(--cobalt); border-radius: 8px; }
/* old belief + observation = updated belief: stacked on phones, side by side on wide screens */
.th-three { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .th-three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.th-panel.is-result { border: 2px solid var(--cobalt); background: var(--cobalt-2); }
.th-obs { margin: 0 !important; font-weight: 700; font-size: 16px !important; }

/* ---------- cards ---------- */
.th-defs { display: grid; gap: 12px; margin: 16px 0; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 680px) { .th-defs { grid-template-columns: 1fr 1fr; } }
.th-def { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; }
.th-article .th-def h3 { margin: 0 0 4px; font-size: 17px; color: var(--cobalt); }
.th-def p { font-size: 16px !important; line-height: 1.5 !important; margin: 4px 0 !important; }
.th-def .th-eg { color: var(--ink-2); font-size: 15px !important; }
.th-def.is-focus { border: 2px solid var(--cobalt); background: var(--cobalt-2); }
.th-cards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin: 16px 0; }
@media (min-width: 640px) { .th-cards { grid-template-columns: 1fr 1fr; } }
.th-card { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.th-article .th-card h3 { margin: 0 0 6px; font-size: 16.5px; display: flex; align-items: center; gap: 10px; }
.th-card h3 span { flex: none; display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: var(--cobalt); color: var(--panel); font-size: 13px; font-weight: 800; }
.th-card dl { margin: 0; }
.th-card dt { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; font-weight: 800; color: var(--ink-2); margin-top: 6px; }
.th-card dd { margin: 0; font-size: 15px; line-height: 1.45; }
.th-myths { display: grid; gap: 12px; margin: 16px 0; }
.th-myth p { margin: 0 !important; padding: 10px 14px; font-size: 16.5px !important; line-height: 1.5 !important; }
.th-myth span { display: block; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; font-weight: 800; color: var(--ink-2); margin-bottom: 2px; }
.th-myth-claim { background: var(--orange-2); border-left: 4px solid var(--orange); border-radius: 8px 8px 0 0; font-weight: 700; }
.th-myth-fix { background: var(--green-2); border-left: 4px solid var(--green); border-radius: 0 0 8px 8px; }
.th-steps { list-style: none; padding: 0 !important; margin: 16px 0; counter-reset: th-step; }
.th-steps > li { position: relative; margin: 0 0 12px; padding: 4px 16px 8px 16px; background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--cobalt); border-radius: 8px; }
.th-article .th-steps h3 { margin: 10px 0 4px; font-size: 17px; }
.th-steps p { font-size: 16.5px !important; margin: 4px 0 8px !important; }
.th-plan { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0 !important; margin: 6px 0 8px !important; counter-reset: th-plan; }
.th-plan li { counter-increment: th-plan; font-size: 14.5px !important; line-height: 1.2 !important; padding: 6px 10px; border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; }
.th-plan li::before { content: counter(th-plan) ". "; font-weight: 800; color: var(--cobalt); }
.th-takeaways { list-style: none; padding: 0 !important; margin: 14px 0; counter-reset: th-take; display: grid; gap: 8px; }
.th-takeaways li { counter-increment: th-take; display: flex; gap: 14px; align-items: baseline; padding: 10px 14px; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; font-weight: 600; }
.th-takeaways li::before { content: counter(th-take); flex: none; font: 800 22px/1 var(--font); font-stretch: 75%; color: var(--cobalt); min-width: 1.4em; }

/* ---------- knowledge check (progressively enhanced by theory.js) ---------- */
.th-check { margin: 14px 0; display: grid; gap: 14px; }
.th-q { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; }
.th-article .th-q h3 { margin: 0 0 4px; font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--cobalt); }
.th-q-text { margin: 0 0 10px !important; font-weight: 600; }
.th-input label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.th-input textarea { width: 100%; min-height: 84px; resize: vertical; font: 16px/1.5 var(--font); padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); color: var(--ink); }
.th-input textarea:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 1px; }
.th-input textarea[readonly] { background: var(--panel); color: var(--ink-2); }
.th-hint { font-size: 13.5px !important; color: var(--ink-2) !important; margin: 4px 0 8px !important; }
.th-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.th-actions .btn { min-height: 44px; white-space: normal; }
.th-answer { margin-top: 12px; padding: 12px 14px; background: var(--green-2); border-left: 4px solid var(--green); border-radius: 0 8px 8px 0; }
.th-answer[hidden], .th-input [hidden] { display: none !important; }
.th-answer:focus { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.th-answer p { margin: 6px 0 !important; font-size: 16.5px !important; }
.th-answer .th-answer-label { font-size: 11.5px !important; letter-spacing: .07em; text-transform: uppercase; font-weight: 800; color: var(--ink-2) !important; margin: 0 0 2px !important; }
.th-check-status { font-weight: 700; margin: 0 !important; color: var(--ink-2) !important; font-size: 15px !important; }
.th-check-status[data-done="1"] { color: var(--ink) !important; }

/* ---------- ending ---------- */
.th-next-card { border: 1px solid var(--cobalt); background: var(--cobalt-2); border-radius: 8px; padding: 6px 18px 10px; margin: 14px 0; }
.th-next-tag { font-size: 12px !important; letter-spacing: .07em; text-transform: uppercase; font-weight: 800; color: var(--cobalt) !important; margin: 10px 0 0 !important; }
.th-article .th-next-card h3 { margin: 4px 0 6px; font-size: 20px; }
.th-lablist { list-style: none; padding: 0 !important; margin: 14px 0; display: grid; gap: 10px; }
.th-lablist > li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; }
.th-lab-no { align-self: start; text-align: center; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; padding: 4px 0; border-radius: 4px; background: var(--cobalt-2); color: var(--cobalt); border: 1px solid var(--cobalt); }
.th-lablist p { margin: 2px 0 0 !important; font-size: 15.5px !important; color: var(--ink-2) !important; }
.th-lablist em { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 8px; margin-left: 6px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.th-lablist > li:first-child em { background: var(--green-2); border-color: var(--green); color: var(--ink); }
.th-pager { display: grid; gap: 10px; margin: 28px 0 0; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .th-pager { grid-template-columns: 1fr 1fr; } }
.th-pager-link { display: block; padding: 12px 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); text-decoration: none; color: var(--ink); margin: 0 !important; }
a.th-pager-link:hover { border-color: var(--cobalt); }
.th-pager-link span { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 800; color: var(--ink-2); }
.th-pager-link strong { display: block; font-size: 16px; margin-top: 2px; }
.th-pager-link.is-disabled { border-style: dashed; background: transparent; color: var(--ink-2); }

/* ---------- the track hub page: theory section above the labs ---------- */
.th-hub { margin: 4px 0 30px; }
.th-hub-h { font-size: 22px; font-weight: 800; font-stretch: 85%; margin: 0 0 4px; }
.th-hub-sub { color: var(--ink-2); margin: 0 0 14px; max-width: 60ch; }
.th-hub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.th-hub-card { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px; background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--cobalt); border-radius: 8px; color: var(--ink); text-decoration: none; }
.th-hub-card:hover { border-color: var(--cobalt); }
.th-hub-no { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--cobalt); text-transform: uppercase; }
.th-hub-card strong { font-size: 18px; line-height: 1.25; }
.th-hub-tag { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.th-hub-desc { font-size: 14.5px; color: var(--ink-2); }
.th-hub-labs-h { font-size: 22px; font-weight: 800; font-stretch: 85%; margin: 0 0 12px; }

@media (max-width: 420px) {
  .th-wrap { padding: 0 16px; }
  .th-anchor { padding: 16px; }
  .th-lablist > li { grid-template-columns: 1fr; gap: 6px; }
  .th-lab-no { justify-self: start; padding: 4px 10px; }
  .th-takeaways li { flex-direction: column; gap: 2px; }
}

/* the shared footer's grey text is below AA contrast on the page background; lift it on lesson pages only */
.th-page .footer .inner > span { color: var(--ink-2); }

/* phones: let a 4-column table fit without sideways scrolling (it still scrolls, and is focusable, if it must) */
@media (max-width: 560px) {
  .th-article .th-table { font-size: 13.5px; }
  .th-article .th-table th, .th-article .th-table td { padding: 8px 6px 8px 0; }
  .th-table th[scope="row"] { white-space: normal; padding-right: 6px; }
}
