:root {
  color-scheme: light;
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #202f28;
  --green: #294e3e;
  --accent: #a7472c;
  --muted: #586258;
  --line: #d2d4c7;
  --pale: #edeee3;
  --tint: var(--tint);
  --hover: var(--hover);
  --tab-hover: var(--tab-hover);
  --line-strong: var(--line-strong);
  --dim: var(--dim);
  --code-bg: #24372e;
  --code-fg: #ebeee3;
  --prose: #29372e;
  --syn-num: #7d5d20;
  --syn-errline: rgba(194, 64, 31, 0.12);
  --serif:
    "Baskervville", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
  /* Real rendered height of .site-head (the sticky platform bar + mast
     unit, see layout.mjs) at this breakpoint. Drives html's scroll-padding-
     top and the reader outline's sticky offset below, so both stay
     calibrated to the sticky header's actual height instead of a guess.
     Overridden at 760px, where the platform bar hides and only the mast
     remains sticky. Measured with Playwright against the built site. */
  --head-h: 120px;
  font: 16px/1.55 var(--sans);
  background: var(--paper);
  color: var(--ink);
}

/* Themes. Day is the default token set in :root above; Dark is the same
   tokens with dark values — components never hard-code theme colors, so
   overriding the tokens restyles the whole site. data-theme is set on <html>
   before first paint by the inline script in layout.mjs (values "light" /
   "dark"); no attribute means "system", which follows the OS preference via
   the media block below. The two blocks are intentionally identical. */
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121713;
  --surface: #1a211b;
  --ink: #e4e8e0;
  --green: #a9c8ad;
  --accent: #e89a7c;
  --muted: #9ba79a;
  --line: #2d362e;
  --pale: #212a22;
  --tint: #28402f;
  --hover: #202b21;
  --tab-hover: #ffffff12;
  --line-strong: #4e5f4f;
  --dim: #76816f;
  --code-bg: #0f1511;
  --code-fg: #d9e0d4;
  --prose: #ced6ca;
  --syn-num: #cfb069;
  --syn-errline: rgba(229, 137, 120, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --paper: #121713;
  --surface: #1a211b;
  --ink: #e4e8e0;
  --green: #a9c8ad;
  --accent: #e89a7c;
  --muted: #9ba79a;
  --line: #2d362e;
  --pale: #212a22;
  --tint: #28402f;
  --hover: #202b21;
  --tab-hover: #ffffff12;
  --line-strong: #4e5f4f;
  --dim: #76816f;
  --code-bg: #0f1511;
  --code-fg: #d9e0d4;
  --prose: #ced6ca;
  --syn-num: #cfb069;
  --syn-errline: rgba(229, 137, 120, 0.18);
  }
}
html {
  /* Clears .site-head on every in-page jump (outline links, #practice,
     breadcrumb fragments, quiz links) so the target heading lands fully
     visible below the sticky bar+mast, not hidden underneath it. */
  scroll-padding-top: calc(var(--head-h) + 16px);
}
* {
  box-sizing: border-box;
}
body,
figure,
h1,
h2,
h3,
p {
  margin: 0;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
summary,
select,
label:has(input[type="radio"]) {
  cursor: pointer;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
}
button:disabled {
  cursor: default;
}
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #a24c30;
  outline-offset: 4px;
}
::selection {
  background: #f0c3a9;
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.037em;
}
h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.6rem);
}
h2 {
  font-size: clamp(2rem, 3.2vw, 2.85rem);
}
h3 {
  font-size: 1.8rem;
}
.icon {
  display: inline-block;
  vertical-align: middle;
  width: 1.15em;
  height: 1.15em;
  flex: none;
}
.wrap,
.mast-inner,
.atlas-bar-inner {
  width: min(1800px, calc(100% - clamp(32px, 3vw, 80px)));
  margin-inline: auto;
}
.sr,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  background: var(--surface);
  padding: 10px 16px;
  z-index: 50;
}
.site-head {
  /* Wraps .atlas-bar + .mast into one sticky unit (see layout.mjs) so the
     platform tab bar and this guide's own header stay visible together
     while the page scrolls. z-index 10 clears the tallest in-page z-index
     (the mobile outline bar's 2) while staying under the skip link's 50. */
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
}
.mast {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: relative;
  z-index: 5;
}
.mast-inner {
  display: flex;
  align-items: center;
  /* Matches the System Design guide's mast height. */
  min-height: 78px;
  gap: clamp(18px, 4vw, 64px);
}
.brand {
  font: 600 24px/1 var(--serif);
  letter-spacing: -1.1px;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  white-space: nowrap;
}
.brand-mark {
  position: relative;
  width: 29px;
  height: 32px;
  display: inline-block;
  flex: none;
}
.brand-mark i {
  position: absolute;
  width: 21px;
  height: 14px;
  transform: rotate(-29deg) skewX(28deg);
  border: 1.4px solid var(--ink);
  left: 4px;
  top: 15px;
  background: #8da68d;
}
.brand-mark i:nth-child(2) {
  background: #f1ddbb;
  top: 10px;
}
.brand-mark i:nth-child(3) {
  background: #cd825d;
  top: 5px;
}
/* Mast navigation: kept rule-for-rule in step with the System Design
   guide's style.css so the two publications' headers look and respond
   identically (same pill current-tab, same wrap-to-second-row behavior). */
.main-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}
.main-nav a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0 clamp(8px, 0.95vw, 16px);
  min-height: 44px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 550;
  white-space: nowrap;
}
.main-nav a:hover {
  background: var(--hover);
  color: var(--green);
}
.main-nav a[aria-current] {
  color: var(--green);
  background: var(--tint);
  box-shadow: inset 0 -3px var(--green);
  font-weight: 650;
}
.mast :is(a, button):focus-visible {
  outline-offset: -3px;
}
.search-tool {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--green);
  min-height: 34px;
  padding: 0 8px;
  font: 550 0.8rem/1.25 var(--sans);
  white-space: nowrap;
  width: clamp(252px, 24vw, 378px);
}
.search-tool:hover {
  border-color: var(--line-strong);
  background: var(--pale);
}
.search-tool kbd {
  padding: 0 5px;
  line-height: 17px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  border-radius: 3px;
  font: 11px/16px var(--mono);
  margin-left: auto;
}
.mobile-menu {
  display: none;
}
/* Hero: one full-width cover card, same treatment as the System Design hub —
   copy panel on the dark green cover, blueprint panel to its right behind a
   divider. The cover colors are fixed (not theme vars): it is dark in both
   themes, exactly like the blueprint plate always was. */
.hero {
  --cover: #193d32;
  --cover-text: #fff9ea;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  align-items: stretch;
  margin-top: clamp(18px, 2.2vw, 32px);
  overflow: hidden;
  background: var(--cover);
  color: var(--cover-text);
  border-radius: 12px;
}
.hero-copy {
  align-self: center;
  padding: clamp(28px, 3.25vw, 50px);
}
.eyebrow,
.mono,
.count,
.index-num,
.topic-num,
.filter-summary,
.drawing-head,
figcaption,
.resource-row small {
  font-family: var(--mono);
}
.eyebrow {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.135em;
  line-height: 1.65;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 10px;
}
.accent-line {
  width: 24px;
  height: 2px;
  background: var(--accent);
}
.hero .eyebrow {
  color: #c9deca;
  margin-bottom: 21px;
}
.hero h1 {
  font-size: clamp(3.15rem, 5.8vw, 5.45rem);
  line-height: 0.99;
  letter-spacing: -0.055em;
}
.hero h1 em {
  color: #f6bd91;
  font-weight: 400;
}
.intro {
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.6;
  max-width: 457px;
  color: var(--muted);
  margin: 23px 0 26px;
}
.hero .intro {
  color: #e0e9dc;
}
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.button {
  border: 1px solid transparent;
  border-radius: 5px;
  min-height: 45px;
  padding: 10px 17px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font: 600 0.88rem/1.45 var(--sans);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.button.primary {
  background: var(--green);
  color: #fffef6;
  border-color: var(--green);
}
.button.primary:hover {
  background: #1b3b2e;
}
.button.secondary {
  border-color: #acb3a5;
  background: transparent;
}
.button.secondary:hover,
.button.secondary[aria-pressed="true"] {
  background: var(--pale);
  border-color: #839382;
}
.button.primary[aria-pressed="true"] {
  background: var(--pale);
  color: var(--green);
}
/* The hero sits on the dark cover, so both buttons swap palette there. */
.hero .button.primary {
  background: var(--cover-text);
  color: var(--cover);
  border-color: var(--cover-text);
}
.hero .button.primary:hover {
  background: #f6dbc2;
  border-color: #f6dbc2;
}
.hero .button.secondary {
  border-color: #799783;
  color: var(--cover-text);
}
.hero .button.secondary:hover {
  background: #2a5242;
  border-color: #9eb4a3;
}
.hero a:focus-visible {
  outline-color: #ffd09e;
}
.hero .resume-destination {
  color: #ccdbce;
}
.blueprint {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: clamp(20px, 2.5vw, 38px);
  border-left: 1px solid #446456;
  background-color: #234b3c;
  background-image:
    linear-gradient(#c9e1bc0c 1px, transparent 1px),
    linear-gradient(90deg, #c9e1bc0c 1px, transparent 1px),
    radial-gradient(ellipse at center, #375b43, transparent 72%);
  background-size:
    24px 24px,
    24px 24px,
    100% 100%;
  color: #f3f1db;
}
.plate-drawing {
  width: min(100%, 440px);
}
.drawing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #77917e;
  margin-bottom: 8px;
  color: #ccdbc2;
  font: 500 0.66rem/1.4 var(--mono);
  letter-spacing: 0.1em;
}
.drawing-head span:first-child {
  border-left: 14px solid #cd9169;
  padding-left: 7px;
  line-height: 0.78;
}
.blueprint picture {
  display: block;
}
.blueprint img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
}
.blueprint figcaption {
  width: min(100%, 440px);
  border-top: 1px solid #77917e;
}
.blueprint figcaption a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 49px;
  padding: 10px 0 0;
  font: 550 0.95rem/1.3 var(--sans);
}
.blueprint figcaption a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.blueprint figcaption small {
  display: inline-block;
  margin-right: 12px;
  padding-right: 12px;
  border-right: 1px solid #799780;
  color: #d2dec9;
  font: 0.68rem/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.075em;
}
.blueprint figcaption .icon {
  box-sizing: content-box;
  width: 15px;
  height: 15px;
  padding: 7px;
  border: 1px solid #799783;
  border-radius: 50%;
}
.blueprint figcaption a:hover .icon {
  background: var(--cover-text);
  color: var(--cover);
}
.resume-destination {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 19px 0;
  border-block: 1px solid #aeb7a6;
}
.stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  font-size: 0.84rem;
  color: var(--muted);
  border-left: 1px solid var(--line);
  min-height: 26px;
}
.stat:first-child {
  border-left: 0;
}
.stat > .icon {
  color: var(--green);
  width: 21px;
  height: 21px;
}
.stat b {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
  margin-right: 2px;
}
.stat:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.home-section {
  margin: 43px 0 54px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 21px;
}
.section-heading h2 {
  font-size: clamp(2.05rem, 3vw, 2.7rem);
}
.section-heading p,
.page-heading > p:last-child:not(.eyebrow) {
  color: var(--muted);
  margin-top: 8px;
}
.text-link,
.card-link,
.lesson-end > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 650;
  font-size: 0.85rem;
}
.text-link:hover,
.lesson-end > a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.section-heading > .text-link {
  white-space: nowrap;
  min-height: 32px;
}
.track-cards,
.catalog-grid,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}
.core {
  --tint: #e3eddf;
  --tint-ink: #3a634c;
  --plate-rule: #a8bfaa;
}
.senior {
  --tint: #f4e5d7;
  --tint-ink: #8d4d32;
  --plate-rule: #d0b398;
}
.specialist {
  --tint: #e1eaec;
  --tint-ink: #3d6370;
  --plate-rule: #a6bfc4;
}
.track-card {
  --edge: clamp(16px, 1.65vw, 24px);
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #c4caba;
  border-radius: 8px;
  background: var(--surface);
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
.track-card:hover {
  border-color: var(--tint-ink);
  box-shadow: 0 4px 12px #1a352313;
  transform: translateY(-2px);
}
.project-card:hover,
.resource-row:hover {
  background: var(--pale);
  border-color: #99a28f;
}
.track-figure,
.collection-plate {
  position: relative;
  isolation: isolate;
  background-color: var(--tint);
  background-image: radial-gradient(var(--plate-rule) 0.8px, transparent 0.8px);
  background-size: 10px 10px;
}
.track-figure {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 99px;
  border-bottom: 1px solid var(--line);
  padding: 14px var(--edge);
}
.track-figure img {
  position: absolute;
  right: 4%;
  top: 0;
  width: 51%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px #27443416);
}
.count {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  color: var(--tint-ink);
  background: var(--tint);
  border: 1px solid var(--plate-rule);
  padding: 3px 7px;
  border-radius: 3px;
  font: 550 0.68rem/1.4 var(--mono);
}
.track-copy {
  padding: 17px var(--edge) 0;
}
.track-card h3 {
  font-size: clamp(1.6rem, 2.3vw, 2.1rem);
}
.track-card p,
.project-card > p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 7px 0 15px;
}
.track-foot {
  margin: auto var(--edge) 0;
  border-top: 1px solid var(--line);
  padding: 11px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.card-link {
  color: var(--tint-ink);
}
.card-link .icon,
.text-link .icon {
  width: 16px;
}
.current-track {
  color: var(--green);
  font: 0.7rem/1.4 var(--mono);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.track-card:hover .card-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.learning-tracks {
  scroll-margin-top: 20px;
  border-top: 1px solid #acb6a5;
  padding-top: 28px;
  margin-top: 0;
}
footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
}
footer > .wrap.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px 56px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 0.8rem;
  color: var(--muted);
}
footer .brand {
  font-size: 19px;
  color: var(--ink);
}
footer .brand-mark {
  transform: scale(0.78);
  margin-right: -4px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-right: auto;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.footer-col strong {
  color: var(--ink);
  font: 600 0.8rem var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
footer a:hover {
  text-decoration: underline;
}
.page-heading {
  max-width: 830px;
  margin: 52px 0 29px;
}
.page-heading .eyebrow,
.reader-head .eyebrow {
  margin-bottom: 13px;
  color: var(--accent);
}
.page-heading > p:last-child:not(.eyebrow) {
  font-size: 1.04rem;
  max-width: 920px;
  line-height: 1.65;
  margin-top: 17px;
}
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  margin: 24px 0 19px;
}
.crumb .icon {
  width: 13px;
}
.crumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.crumb + .page-heading,
.detail-layout .page-heading {
  margin-top: 28px;
}
.track-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border: 0;
  padding: 4px;
  border-radius: 6px;
  background: var(--pale);
  width: fit-content;
  margin: 26px 0 12px;
}
.track-filter legend {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}
.track-filter label {
  position: relative;
}
.track-filter input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.track-filter span {
  display: block;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--muted);
}
.track-filter input:checked + span {
  background: var(--surface);
  border-color: #bec6b7;
  color: var(--ink);
  box-shadow: 0 1px 2px #24392612;
}
.track-filter input:focus-visible + span {
  outline: 3px solid var(--accent);
}
.filter-summary {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 14px 0 20px;
}
.part-list {
  border-top: 1px solid var(--line);
}
.part-row,
.topic-row {
  display: flex;
  align-items: center;
  gap: 21px;
  border-bottom: 1px solid var(--line);
  padding: 21px 8px;
}
.part-row:hover,
.topic-row:hover {
  background: var(--pale);
}
.index-num,
.topic-num {
  color: var(--accent);
  font-size: 0.85rem;
}
.row-main {
  display: grid;
  gap: 4px;
  flex: 1;
}
.row-main > strong {
  font-size: 1.1rem;
  font-weight: 600;
}
.row-main > span,
.row-count {
  color: var(--muted);
  font-size: 0.88rem;
}
.row-count {
  white-space: nowrap;
}
.row-count b {
  font-weight: 500;
}
.part-row > .icon,
.topic-row > .icon {
  width: 15px;
  color: var(--muted);
}
.prereq,
.project-meta {
  background: var(--pale);
  border-left: 3px solid #91a78e;
  padding: 13px 16px;
  font-size: 0.91rem;
  max-width: 780px;
}
.prereq b,
.project-meta b {
  margin-right: 10px;
}
.prereq a,
.project-meta a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.chapter-block,
.part-end {
  margin: 35px 0;
}
.chapter-block h2,
.part-end h2,
.list-heading,
.plan-progress h2 {
  font-size: 2rem;
}
.chapter-block h2 .mono {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0;
  vertical-align: middle;
}
/* Stage header: title and a one-line note on the left, the learned counter
   and a rotating chevron on the right. list-style:none replaces the default
   details marker, which rendered as a stray triangle above the title. */
.chapter-block > summary {
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}
.chapter-block > summary::-webkit-details-marker {
  display: none;
}
.chapter-block .stage-head {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.chapter-block .stage-head h2 {
  margin: 0;
}
.stage-note {
  color: var(--muted);
  font-size: 0.9rem;
}
.stage-progress {
  color: var(--green);
  font: 500 0.78rem/1 var(--mono);
  white-space: nowrap;
}
.chapter-block > summary > .icon {
  width: 17px;
  color: var(--muted);
  flex: none;
}
.chapter-block:not([open]) > summary > .icon {
  transform: rotate(-90deg);
}
.chapter-block > summary:hover > .icon {
  color: var(--green);
}
.index-num.project {
  color: var(--accent);
}
.outcomes {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 12px 0;
}
.outcomes summary {
  width: fit-content;
  padding: 6px 0;
  color: var(--green);
  font-weight: 550;
}
.outcomes .prose {
  margin: 8px 0;
  background: var(--hover);
  padding: 12px 20px;
}
.topic-row {
  padding: 13px 5px;
  gap: 15px;
}
.topic-row strong {
  font-weight: 500;
  flex: 1;
}
.tag {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 3px 9px;
  white-space: nowrap;
  color: var(--muted);
  background: var(--paper);
  font: 500 0.7rem/1.5 var(--sans);
}
.list-heading {
  margin: 31px 0 17px;
}
.part-end .resource-grid {
  margin-top: 20px;
}
.reader-grid {
  display: grid;
  grid-template-columns: fit-content(230px) minmax(0, 920px);
  gap: clamp(35px, 6vw, 95px);
  align-items: start;
  justify-content: center;
  margin: 35px 0;
}
.reader-grid article,
.detail-layout article {
  min-width: 0;
}
.outline {
  position: sticky;
  /* Docks just below the sticky .site-head instead of at the bare viewport
     top, keeping the original 20px breathing room beneath it. */
  top: calc(var(--head-h) + 20px);
  align-self: start;
}
.outline > div {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}
.outline .eyebrow {
  margin: 3px 0 10px;
}
.outline nav {
  display: grid;
}
.outline nav a {
  color: var(--muted);
  font-size: 0.86rem;
  padding: 6px 0;
}
.outline nav a:hover,
.outline nav a[aria-current] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.outline details {
  display: none;
}
.reader-head {
  border-bottom: 1px solid var(--line);
  padding: 0 0 26px;
  margin-bottom: 24px;
}
.reader-head h1,
.reader-grid .page-heading h1,
.detail-layout h1 {
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  overflow-wrap: break-word;
}
.reader-head p:not(.eyebrow) {
  color: var(--muted);
  margin: 12px 0 18px;
}
.reader-head .eyebrow span {
  color: var(--dim);
}
.reader-grid .page-heading {
  margin: 0 0 26px;
}
.prose {
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: break-word;
  color: var(--prose);
}
.prose section {
  scroll-margin-top: 14px;
}
.prose h2 {
  font-size: 2rem;
  margin: 1.25em 0 0.42em;
}
.prose h3 {
  font-size: 1.58rem;
  margin: 1.1em 0 0.4em;
}
.prose p,
.prose ul,
.prose ol,
.prose .table-scroll,
.prose pre {
  margin: 0 0 1em;
}
.prose ul,
.prose ol {
  padding-left: 1.5em;
}
.prose li {
  padding-left: 0.12em;
  margin: 0.35em 0;
}
.prose code {
  font: 0.85em/1.6 var(--mono);
  background: var(--pale);
  border-radius: 3px;
  padding: 1px 4px;
  overflow-wrap: anywhere;
}
.prose pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 6px;
  padding: 18px;
  overflow-x: auto;
  line-height: 1.5;
}
.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.84rem;
}
.prose a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.55;
}
th,
td {
  padding: 10px 13px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--pale);
}
tr:last-child td {
  border-bottom: 0;
}
td {
  min-width: 95px;
}
.prose blockquote {
  margin: 1em 0;
  padding-left: 18px;
  border-left: 3px solid var(--line);
}
.lesson-end,
.project-tools {
  border-block: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 25px 0;
}
.detail-layout {
  max-width: 800px;
  margin: 0 auto;
}
.detail-layout .actions {
  margin: 22px 0;
}
.project-tools select {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  background: var(--surface);
  font-size: 0.9rem;
}
.project-tools label {
  font-size: 0.85rem;
  color: var(--muted);
}
.project-card,
.resource-row,
.plan-progress {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px;
}
.project-card {
  display: flex;
  flex-direction: column;
}
.project-card .eyebrow {
  color: var(--accent);
  margin-bottom: 14px;
}
.project-card h2 {
  font-size: 1.75rem;
}
.project-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: auto;
  font-size: 0.79rem;
  color: var(--green);
  font-weight: 550;
}
.resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.resource-row small {
  color: var(--accent);
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.resource-row strong {
  font-size: 1rem;
  font-weight: 580;
}
.plan-progress {
  max-width: 780px;
  background: var(--pale);
}
.plan-progress h2 {
  margin: 10px 0 5px;
}
.plan-progress progress {
  display: block;
  width: min(400px, 100%);
  height: 8px;
  border: 0;
  background: #d0d8c8;
  accent-color: var(--green);
  border-radius: 4px;
  overflow: hidden;
  margin: 14px 0 18px;
}
progress::-webkit-progress-bar {
  background: #d0d8c8;
}
progress::-webkit-progress-value {
  background: var(--green);
}
.saved-row {
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.saved-row a {
  flex: 1;
}
.saved-row small,
.result small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}
.saved-row button {
  font-size: 0.8rem;
  text-decoration: underline;
  min-height: 40px;
}
.empty-state {
  background: var(--hover);
  border: 1px dashed #bfc8b7;
  border-radius: 5px;
  padding: 20px;
}
.empty-state a {
  text-decoration: underline;
}
dialog {
  border: 1px solid #b5bfad;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: 23px;
  width: min(560px, calc(100% - 28px));
  max-height: 80dvh;
  box-shadow: 0 20px 90px #10271a33;
}
dialog::backdrop {
  background: #202c2678;
}
.dialog-head,
.search-input {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dialog-head {
  justify-content: space-between;
  margin-bottom: 15px;
}
.dialog-head h2 {
  font-size: 1.9rem;
}
.dialog-head button {
  width: 38px;
  height: 38px;
}
.search-input {
  border: 1px solid #879782;
  background: var(--surface);
  border-radius: 5px;
  padding: 0 12px;
}
.search-input input {
  border: 0;
  background: none;
  flex: 1;
  min-width: 0;
  line-height: 46px;
  outline: 0;
}
.search-input:focus-within {
  outline: 2px solid var(--green);
}
#result-count {
  font: 0.77rem/1.5 var(--mono);
  color: var(--muted);
  margin: 13px 0 7px;
}
.result {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 11px 7px;
}
.result:hover,
.result:focus-visible {
  background: var(--pale);
}
.result:focus-visible {
  /* Rows sit flush; the global +4px outline-offset ring would be painted
     over by the next sibling, so draw the ring inside the row instead. */
  outline-offset: -3px;
}
.result strong {
  font-size: 0.94rem;
  font-weight: 550;
}
@media (min-width: 1500px) {
  .hero h1 {
    font-size: 5.6rem;
  }
}
/* 1199px, not 1150px: with six main-nav tabs (Practice joined the nav) the
   longest brand ("Forward Deployed Engineer (FDE)") overflowed the mast by
   ~37px in the 1151-1199px band; the tightened gap clears it (measured). */
@media (max-width: 1199px) {
  .mast-inner {
    gap: 25px;
  }
  .search-tool kbd {
    display: none;
  }
}
@media (max-width: 970px) {
  .reader-grid {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 30px;
  }
  .catalog-grid,
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  :root {
    /* Below 980px the main nav wraps onto its own row (below), making the
       mast itself taller — same two-step sticky-height ladder as the
       System Design guide. */
    --head-h: 148px;
  }
  .mast-inner {
    flex-wrap: wrap;
    gap: 0 6px;
    padding-top: 6px;
  }
  .mast .brand {
    gap: 9px;
    font-size: 21px;
  }
  .search-tool {
    width: auto;
    margin-left: auto;
  }
  .main-nav {
    flex-basis: 100%;
    flex-wrap: wrap;
    align-self: stretch;
    margin: 5px 0 0;
    padding: 3px 0;
    border-top: 1px solid var(--line);
  }
  .main-nav a {
    flex: 1 1 auto;
    padding-inline: 7px;
  }
}
@media (max-width: 580px) {
  .main-nav {
    gap: 0;
  }
  .main-nav a {
    font-size: 0.83rem;
    padding-inline: 4px;
  }
  .main-nav a .icon {
    display: none;
  }
  .search-tool {
    padding-inline: 8px;
  }
}
@media (max-width: 420px) {
  .mast .brand {
    font-size: clamp(17px, 4.9vw, 20px);
    gap: 6px;
  }
  .search-tool .icon {
    display: none;
  }
  .search-tool {
    padding-inline: 6px;
    font-size: 0.8rem;
    gap: 4px;
  }
  .main-nav a {
    padding-inline: 2px;
    font-size: 0.8rem;
  }
}
@media (max-width: 760px) {
  :root {
    /* The platform bar hides below this width (see .atlas-bar's own
       760px rule) — .site-head's sticky height drops to the (still
       2-row, see the 980px step above) mast alone. */
    --head-h: 107px;
  }
  .mobile-menu {
    display: block;
    position: relative;
  }
  .mobile-menu summary {
    width: 40px;
    height: 44px;
    display: grid;
    place-content: center;
    list-style: none;
  }
  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }
  .mobile-menu nav {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 6px 20px #27352b18;
    border-radius: 6px;
    padding: 6px;
    display: grid;
  }
  .mobile-menu nav a {
    display: flex;
    align-items: center;
    padding: 9px 13px;
    min-height: 44px;
    border-radius: 4px;
    font-size: 0.9rem;
  }
  .mobile-menu nav a:hover {
    background: var(--hover);
    color: var(--green);
  }
  .wrap,
  .mast-inner {
    width: calc(100% - 40px);
  }
  .hero {
    grid-template-columns: 1.02fr 1fr;
  }
  .hero-copy {
    padding: 24px;
  }
  .hero h1 {
    font-size: clamp(2.9rem, 7vw, 4rem);
  }
  .hero .eyebrow {
    font-size: 0.6rem;
    margin-bottom: 15px;
  }
  .intro {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 16px 0 18px;
  }
  .hero .actions {
    gap: 7px;
  }
  .hero .button {
    font-size: 0.79rem;
    padding: 9px 10px;
  }
  .stat {
    gap: 6px;
    font-size: 0.77rem;
  }
  .stat > .icon {
    width: 17px;
  }
  .stats {
    padding: 14px 0;
  }
  .track-cards {
    gap: 10px;
  }
  .home-section {
    margin: 32px 0 36px;
  }
  .section-heading {
    align-items: start;
  }
  .section-heading p {
    font-size: 0.94rem;
  }
  .reader-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin-top: 17px;
  }
  .outline {
    position: static;
  }
  .outline > div {
    display: none;
  }
  .outline details {
    display: block;
    border-block: 1px solid var(--line);
    padding: 4px 0;
  }
  .outline summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 42px;
  }
  .outline details[open] summary > .icon {
    transform: rotate(180deg);
  }
  .outline nav a {
    padding: 10px 6px;
  }
  .page-heading {
    margin-top: 34px;
  }
  .prose h2 {
    font-size: 1.75rem;
  }
  .reader-head {
    padding-bottom: 20px;
  }
  footer .wrap > span {
    display: none;
  }
}
@media (max-width: 580px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .blueprint {
    border-left: 0;
    border-top: 1px solid #446456;
  }
  .hero h1 {
    font-size: clamp(2.8rem, 12.9vw, 4.7rem);
  }
  .hero .eyebrow {
    font-size: 0.64rem;
    margin-bottom: 16px;
  }
  .intro {
    max-width: 37ch;
    font-size: 1rem;
    margin-top: 17px;
  }
  .hero .button {
    font-size: 0.85rem;
    padding: 10px 14px;
  }
  .drawing-head {
    font-size: 0.55rem;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    padding: 0;
  }
  .stat {
    justify-content: start;
    padding: 12px 7px;
    gap: 9px;
    font-size: 0.8rem;
  }
  .stat:nth-child(odd) {
    border-left: 0;
  }
  .stat:nth-child(even) {
    padding-left: 14px;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .section-heading {
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
  }
  .section-heading > .text-link {
    min-height: 36px;
  }
  .track-cards,
  .catalog-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }
  .section-heading h2 {
    font-size: 2rem;
  }
  .track-filter {
    gap: 0;
    max-width: 100%;
  }
  .track-filter span {
    padding: 10px 9px;
    font-size: 0.78rem;
  }
  .index-num {
    font-size: 0.75rem;
  }
  .part-row {
    gap: 12px;
    padding: 15px 0;
  }
  .row-main > strong {
    font-size: 1rem;
  }
  .row-main > span {
    font-size: 0.83rem;
  }
  .row-count {
    font-size: 0.71rem;
  }
  .part-row > .icon {
    display: none;
  }
  .topic-row {
    gap: 8px;
    align-items: start;
  }
  .topic-row strong {
    font-size: 0.92rem;
  }
  .topic-row > .icon {
    display: none;
  }
  .tag {
    font-size: 0.65rem;
  }
  .chapter-block h2,
  .part-end h2 {
    font-size: 1.8rem;
  }
  .resource-grid {
    gap: 10px;
  }
  .project-card,
  .resource-row {
    padding: 17px;
  }
  .crumb {
    margin: 18px 0;
  }
  .prose {
    font-size: 1rem;
  }
  .project-tools {
    align-items: start;
  }
  .page-heading h1 {
    font-size: 2.7rem;
  }
  .lesson-end {
    gap: 17px;
  }
  .brand {
    gap: 9px;
  }
  .mast-inner {
    gap: 10px;
  }
  footer .wrap {
    gap: 10px;
    justify-content: space-between;
  }
  footer a:last-child {
    font-size: 0.72rem;
  }
  .saved-row button {
    min-height: 44px;
  }
}
@media (max-width: 350px) {
  .wrap,
  .mast-inner {
    width: calc(100% - 28px);
  }
  .hero h1 {
    font-size: clamp(2.7rem, 13vw, 3rem);
  }
  .track-filter span {
    padding: 10px 7px;
  }
  .track-filter {
    flex-wrap: wrap;
  }
  .brand {
    font-size: 20px;
  }
  .row-count {
    white-space: normal;
    max-width: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 760px) {
  .empty-outline {
    display: none;
  }
}

.prose section:is(#practice, #takeaway) {
  background: #eef0e5;
  border-left: 3px solid #93a68f;
  padding: 1px 18px 12px;
  margin: 22px 0;
}
.prose section:is(#practice, #takeaway) h2 {
  margin-top: 16px;
}
.prose section:is(#practice, #takeaway) > :last-child {
  margin-bottom: 0;
}

/* Reader navigation and search */
.outline nav a[aria-current="location"] {
  font-weight: 650;
}
.outline summary {
  gap: 10px;
}
.outline [data-current-section] {
  margin-left: auto;
  font-weight: 500;
  color: var(--accent);
  text-align: end;
}
#search-dialog[open] {
  display: flex;
  flex-direction: column;
  max-height: min(78dvh, 43rem);
}
.dialog-head,
.search-input,
#result-count {
  flex-shrink: 0;
}
.search-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  margin: -4px;
}
#more-results {
  width: 100%;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .reader-grid {
    display: block;
  }
  .reader-grid .outline {
    position: sticky;
    /* Docks below the sticky .site-head (mast only at this width — the
       platform bar is hidden) instead of at the bare viewport top. */
    top: var(--head-h);
    z-index: 2;
    margin-bottom: 18px;
    background: var(--paper);
  }
  .outline details[open] nav {
    max-height: min(50dvh, 22rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    /* The crop should land between items, not on a text baseline. */
    padding-bottom: 6px;
  }
  .reader-grid article :is(section[id], h2[id]) {
    /* Unchanged: still just the mobile outline bar's own clearance — it
       stacks with html's scroll-padding-top (which now covers the sticky
       mast) rather than duplicating it. */
    scroll-margin-top: 72px;
  }
}

.collection-heading {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 29%);
  align-items: stretch;
  background: var(--tint);
  border: 1px solid var(--plate-rule);
  border-radius: 8px;
  margin: 36px 0 26px;
  overflow: hidden;
}
.collection-heading .page-heading {
  margin: 0;
  max-width: unset;
  padding: clamp(24px, 3.2vw, 47px);
}
.collection-heading .page-heading .eyebrow {
  color: var(--tint-ink);
}
.collection-heading .page-heading > p:last-child {
  max-width: 57ch;
}
.collection-plate {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--plate-rule);
}
.collection-plate img {
  display: block;
  width: 95%;
  max-width: 360px;
  height: auto;
}
.part-row .index-num {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  background: #eef0e6;
  border: 1px solid #ccd2c1;
  border-radius: 5px;
  font: 500 0.76rem/1 var(--mono);
  color: var(--green);
}
.reader-grid .prose {
  font-size: 1.08rem;
  line-height: 1.72;
}
.reader-grid .prose :is(p, ul, ol) {
  max-width: none;
}
.reader-grid .prose table p {
  max-width: none;
}
.prose h2 {
  letter-spacing: -0.035em;
}
.plan-progress {
  background-color: var(--tint);
  background-image:
    linear-gradient(95deg, #e7eee0 42%, transparent 87%),
    radial-gradient(#afc1a7 0.8px, transparent 0.8px);
  background-size:
    auto,
    9px 9px;
  border-left: 4px solid #476b50;
}
@media (min-width: 761px) {
  .track-foot {
    min-height: 48px;
  }
}
@media (max-width: 760px) {
  .collection-heading {
    grid-template-columns: minmax(0, 1fr) 24%;
    margin: 24px 0;
  }
  .hero .resume-destination {
    font-size: 0.74rem;
  }
  .track-copy {
    padding-top: 13px;
  }
  .track-card {
    --edge: 13px;
  }
  .track-figure {
    min-height: 78px;
    padding: 10px;
  }
  .track-figure img {
    right: 0;
    width: 57%;
  }
  .track-card p {
    font-size: 0.9rem;
  }
  .track-foot {
    font-size: 0.78rem;
  }
  .reader-grid .prose {
    font-size: 1rem;
  }
}
@media (max-width: 580px) {
  .blueprint img {
    max-height: 166px;
  }
  .blueprint figcaption a {
    min-height: 42px;
    padding: 8px 0 0;
    font-size: 0.86rem;
  }
  .blueprint figcaption small {
    font-size: 0.65rem;
  }
  .drawing-head {
    font-size: 0.58rem;
  }
  .learning-tracks {
    margin-top: 0;
    padding-top: 22px;
  }
  .track-card {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
  }
  .track-figure {
    grid-row: span 2;
    align-self: stretch;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding: 12px 3px;
  }
  .track-figure img {
    right: -8%;
    top: 28px;
    width: 116%;
    height: calc(100% - 44px);
    max-height: 94px;
  }
  .track-copy {
    padding: 12px 14px 0;
  }
  .track-card h3 {
    font-size: 1.55rem;
  }
  .track-card p {
    font-size: 0.88rem;
    line-height: 1.48;
    margin: 5px 0 9px;
  }
  .track-foot {
    margin: 0 14px;
    padding: 7px 0;
  }
  .card-link {
    font-size: 0.76rem;
  }
  .current-track {
    font-size: 0.65rem;
  }
  .section-heading > .text-link {
    min-height: 32px;
  }
  .collection-heading {
    display: block;
    margin: 21px 0;
  }
  .collection-heading .page-heading {
    padding: 22px;
  }
  .collection-heading .collection-plate {
    display: none;
  }
  .part-row .index-num {
    width: 29px;
    height: 29px;
  }
}
@media (max-width: 350px) {
  .track-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }
}

.practice-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 4px;
  color: var(--green);
  font-size: 0.85rem;
}
.practice-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lesson-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.lesson-pager a {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.lesson-pager a:last-child {
  background: #e9eee2;
}
.lesson-pager small {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--muted);
  font: 0.72rem/1.45 var(--mono);
}
.lesson-pager strong {
  font: 550 1rem/1.5 var(--sans);
}
.lesson-pager a:hover {
  border-color: var(--green);
}
@media (max-width: 580px) {
  .lesson-pager {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .lesson-pager a {
    padding: 12px 14px;
  }
}

.subject-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
}
.subject-back:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.main-nav a {
  white-space: nowrap;
}
.subject-section {
  margin-block: 26px 38px;
}
.subject-section > h2 {
  font-size: 1.65rem;
  margin-bottom: 14px;
}
.subject-guide {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 14px;
}
.subject-guide-copy {
  flex: 1;
  padding: clamp(22px, 3.5vw, 44px);
}
.subject-guide-copy h3 {
  font-size: clamp(2rem, 3.5vw, 3rem);
}
.subject-guide-copy p {
  max-width: 51ch;
  margin-top: 12px;
  color: var(--muted);
}
.subject-guide-copy a {
  margin-top: 20px;
}
.subject-art {
  flex: 0 0 35%;
  display: grid;
  place-items: center;
  background-color: #203e34;
  background-image:
    linear-gradient(#a3bd9c18 1px, transparent 1px),
    linear-gradient(90deg, #a3bd9c18 1px, transparent 1px);
  background-size: 20px 20px;
}
.subject-art img {
  width: min(100%, 350px);
  height: auto;
}
.planned-subjects {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.planned-subjects li {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  padding: 16px 20px;
  border-radius: 6px;
  color: var(--ink);
  font: 500 1.35rem/1.25 var(--serif);
}
.planned-subjects .icon {
  color: var(--muted);
  width: 20px;
  height: 20px;
}
.planned-subjects li:target {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 580px) {
  .subject-art {
    display: none;
  }
  .planned-subjects {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .planned-subjects li {
    padding: 13px 15px;
  }
}

/* Practice workbench (in-lesson playground) */
.workbench {
  margin: 2rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.workbench summary {
  cursor: pointer;
  padding: 0.8rem 1rem;
  font: 600 0.95rem var(--sans);
  color: var(--green);
}
.workbench[open] summary { border-bottom: 1px solid var(--line); }
/* Inline practice boxes (opened by an example's "Practice" chip) carry a
   plain header row with a Close chip instead of a <summary>. */
.workbench.inline {
  margin: 1rem 0 2rem;
}
.workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0.8rem 1rem;
  font: 600 0.95rem var(--sans);
  color: var(--green);
  border-bottom: 1px solid var(--line);
}
/* .code-chip's base colors suit a dark code block; the head's Close chip
   sits on the light panel instead. */
.workbench-head .code-chip {
  border-color: var(--line);
  background: var(--paper);
  color: var(--muted);
}
.workbench-head .code-chip:hover {
  border-color: var(--line-strong);
  color: var(--green);
}
.workbench-note {
  margin: 0.75rem 1rem 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.workbench textarea {
  display: block;
  width: calc(100% - 2rem);
  margin: 0.75rem 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pale);
  color: var(--ink);
  font: 0.85rem/1.55 var(--mono);
  resize: vertical;
}
.workbench-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 1rem 0.75rem;
}
.workbench-status { font-size: 0.85rem; color: var(--muted); }
.workbench-out {
  margin: 0 1rem 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-fg);
  font: 0.85rem/1.55 var(--mono);
  overflow-x: auto;
}

/* Layered code editor: a highlight layer sits behind the textarea. The
   textarea keeps the caret and all input, with transparent text so the
   colored layer shows through; font, padding and (no-)wrapping must match
   exactly between the two, or the caret drifts off the glyphs. */
.code-editor {
  position: relative;
  margin: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pale);
  overflow: hidden;
}
.code-editor textarea,
.code-editor-hl {
  margin: 0;
  padding: 0.75rem;
  font: 0.85rem/1.55 var(--mono);
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 4;
}
.code-editor textarea {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  caret-color: var(--ink);
  resize: vertical;
  overflow: auto;
}
.code-editor textarea:focus-visible { outline-offset: -2px; }
.code-editor-hl {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--ink);
}
.code-editor-hl code { display: block; font: inherit; }
.code-editor-hl .syn-kw,
pre code .syn-kw { color: var(--green); font-weight: 600; }
.code-editor-hl .syn-def,
pre code .syn-def { font-weight: 600; }
.code-editor-hl .syn-str,
pre code .syn-str { color: var(--accent); }
.code-editor-hl .syn-num,
pre code .syn-num { color: var(--syn-num); }
.code-editor-hl .syn-com,
pre code .syn-com { color: var(--muted); font-style: italic; }
.code-editor-hl .syn-errline {
  display: inline-block;
  width: 100%;
  background: var(--syn-errline);
}
/* Run output sits on the dark code background in both themes, so a single
   error red reads well everywhere; stdout keeps the normal output color. */
.workbench-out .syn-err,
.block-out .syn-err { color: #ffa38f; }

/* Practice dock: the scratchpad that follows the reader between pages. The
   edge tab sits above the sticky header (10) and under the skip link (50). */
.dock-tab {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 30;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  padding: 0.75rem 0.45rem;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: var(--surface);
  color: var(--green);
  font: 600 0.8rem/1 var(--sans);
  letter-spacing: 0.05em;
  cursor: pointer;
}
.dock-tab:hover { background: var(--pale); }
.dock {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: min(30rem, 92vw);
  display: flex;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 28px rgba(32, 47, 40, 0.12);
  overflow: hidden;
}
/* The grip owns the panel's inner edge; the body scrolls so the grip stays
   full-height and reachable whatever the output length. */
.dock-grip {
  flex: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.dock-grip::before {
  content: "";
  width: 2px;
  height: 28px;
  border-radius: 1px;
  background: var(--line);
}
.dock-grip:hover::before,
.dock-grip:focus-visible::before { background: var(--green); }
.dock-grip:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.dock-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.dock .code-editor { flex-shrink: 0; }
.dock .code-editor textarea::placeholder { color: var(--muted); }
.dock .workbench-out { flex-shrink: 0; }
/* Notes-dock variant (courses without an in-browser runtime — see app.js):
   the same right-edge Practice tab and panel, but an honest scratchpad with
   no Run button. */
.dock-note {
  margin: 0.75rem 1rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}
.dock .dock-pad {
  flex: 1;
  min-height: 12rem;
  width: calc(100% - 2rem);
  margin: 0.75rem 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pale);
  color: var(--ink);
  font: 0.85rem/1.55 var(--mono);
  resize: none;
}
.dock .dock-pad::placeholder { color: var(--muted); }
.dock-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 1rem 1rem;
}
@media (max-width: 760px) {
  .dock-tab,
  .dock {
    display: none;
  }
}

/* Diagram visualizations */
figure.viz {
  margin: 1.25rem 0;
  padding: 0.5rem 0.5rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
figure.viz { overflow-x: auto; }
figure.viz svg { display: block; width: 100%; min-width: 430px; height: auto; }
figure.viz figcaption {
  padding: 0.75rem 0.75rem 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink);
}
.viz-text { margin: 0.75rem 0 1.25rem; }
.viz-text summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Inline exercise solutions (Practice section) — collapsed by default so
   learners try first; .prose pre/code above already styles the code block
   inside, this just adds the muted, bordered <details> chrome around it. */
.solution {
  margin: 0.9em 0 1.4em;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
}
.solution summary {
  cursor: pointer;
  padding: 12px 0;
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--muted);
  list-style: none;
}
.solution summary:hover {
  color: var(--ink);
}
.solution[open] summary {
  color: var(--green);
}
.solution pre {
  margin: 0 0 16px;
}

/* Platform bar: sits above the guide's own header (.mast) on every page of
   every System Atlas publication, inside the sticky .site-head (see
   layout.mjs and .site-head above). Byte-identical in both guides'
   style.css so the platform feels like one product. Left: the "System
   Atlas" wordmark (brand-mark glyph + small-caps label — a platform-level
   identity distinct from the guide tabs), a hairline divider, then one tab
   per live guide (.guide-tabs), the current guide marked
   aria-current="true". Right: "All subjects", quieter than the tabs, with
   a chevron for affordance. Hidden at the same width the mobile nav takes
   over at — below that, the guide's own nav carries cross-guide access
   instead. */
.atlas-bar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}
.atlas-bar-inner {
  display: flex;
  align-items: stretch;
  gap: clamp(10px, 2.4vw, 22px);
  min-height: 40px;
}
.atlas-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 650 0.74rem var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  white-space: nowrap;
}
.atlas-wordmark .brand-mark {
  transform: scale(0.62);
  margin-right: -7px;
}
.atlas-wordmark:hover {
  color: var(--ink);
}
.guide-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
}
.guide-tabs::before {
  content: "";
  align-self: center;
  width: 1px;
  height: 20px;
  margin-right: clamp(10px, 2.4vw, 22px);
  background: var(--line);
}
.guide-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
}
.guide-tabs a:hover {
  color: var(--ink);
  background: var(--tab-hover);
}
.guide-tabs a[aria-current="true"] {
  color: var(--ink);
  font-weight: 650;
}
.guide-tabs a[aria-current="true"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--accent);
}
.guide-tabs a.planned {
  color: var(--muted);
  opacity: 0.75;
}
.guide-tabs a.planned small {
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 0.58rem/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Roadmap and "soon" tabs are secondary; with three of them the bar only
   fits from ~1130px (measured on /system-design/subjects/), so free it up
   below that. Below this same width only the live tabs remain (six of them
   once Java joined Python/SQL/AI/FDE as a live guide), so their padding
   tightens a little too — otherwise six live tabs plus the wordmark and
   "All subjects" no longer fit down to the 760px floor where the whole bar
   hides in favor of the mobile menu. Nine live tabs (Next.js joined
   Kotlin/React) no longer fit this band's original 10px padding either
   (overflowed just above the 899px band below, at 900-901px) — tightened
   to 7px to clear that gap too, then 6px: the bolder current-page "All
   subjects" on /system-design/subjects/ still overflowed ~3px at 900px. */
@media (max-width: 1151px) {
  .guide-tabs a.planned,
  .guide-tabs a.roadmap {
    display: none;
  }
  .guide-tabs a {
    padding: 0 6px;
  }
}
/* Eight live tabs (Kotlin and React joined Java as live guides) no longer
   fit the ~81px narrower box around 768px even with the 1151px tightening
   above, measured on /system-design/subjects/ — so this narrower band
   tightens further still: smaller tab padding and a tighter gap between
   the wordmark / tabs / "All subjects" / theme toggle. Scoped below 900px,
   where the wider breakpoint already fits with room to spare. Nine live
   tabs (Next.js joined Kotlin/React as a live guide) overflowed again at
   768px with the previous values (measured the same way), so the padding,
   gap, and the tab-row's own separator margin are tightened a second time
   here rather than adding yet another breakpoint band. */
@media (max-width: 899px) {
  .atlas-bar-inner {
    gap: clamp(3px, 0.6vw, 8px);
  }
  .guide-tabs::before {
    margin-right: clamp(4px, 1vw, 10px);
  }
  .guide-tabs a {
    padding: 0 3px;
  }
}
.atlas-all-subjects {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--muted);
  white-space: nowrap;
}
.atlas-all-subjects .icon {
  width: 13px;
  height: 13px;
}
.atlas-all-subjects:hover,
.atlas-all-subjects[aria-current="page"] {
  color: var(--ink);
}
.atlas-all-subjects[aria-current="page"] {
  font-weight: 650;
}
.atlas-bar a:focus-visible {
  outline-offset: -3px;
}
@media (max-width: 760px) {
  .atlas-bar {
    display: none;
  }
}

/* "Save to plan" sits top-right of any lesson/project heading that carries
   an actions block (same pattern on both publications). :has() scopes the
   grid to exactly those headings; below 980px the button drops back under
   the title, where there is no spare column for it. */
.reader-head:has(> .actions),
.page-heading:has(> .actions) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 24px;
}
.reader-head > .actions,
.page-heading > .actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
@media (max-width: 980px) {
  .reader-head:has(> .actions),
  .page-heading:has(> .actions) {
    display: block;
  }
  .reader-head > .actions,
  .page-heading > .actions {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
}

/* Course map: lesson and project pages carry a left-most column listing
   every stage with its parts and project, so any lesson is one click away.
   :has() scopes the three-column grid to exactly those pages — library and
   track readers keep the plain two-column grid above. ≤1150px the
   on-this-page outline collapses into its dropdown above the article;
   ≤980px the map itself goes away (small screens keep the dropdown, the
   pager, and the curriculum page). */
.reader-grid:has(> .course-nav) {
  grid-template-columns: fit-content(240px) minmax(0, 920px) fit-content(200px);
  gap: clamp(28px, 3vw, 60px);
  /* Pin the course map to the page's left edge and "On this page" to its
     right edge; the lesson keeps the centered middle column. (Overrides the
     base .reader-grid's justify-content: center.) */
  justify-content: space-between;
}
.reader-grid:has(> .course-nav) > .course-nav {
  grid-column: 1;
  grid-row: 1;
}
.reader-grid:has(> .course-nav) > article {
  grid-column: 2;
  grid-row: 1;
}
.reader-grid:has(> .course-nav) > .outline {
  grid-column: 3;
  grid-row: 1;
}
.course-nav {
  position: sticky;
  top: calc(var(--head-h) + 20px);
  align-self: start;
  max-height: calc(100dvh - var(--head-h) - 40px);
  overflow-y: auto;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}
.course-nav .eyebrow {
  margin: 3px 0 4px;
}
.course-nav details + details {
  border-top: 1px solid var(--line);
}
.course-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--green);
  cursor: pointer;
}
.course-nav summary .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
  flex: none;
}
.course-nav details[open] summary .icon {
  transform: rotate(180deg);
}
.course-nav nav {
  display: grid;
  padding-bottom: 12px;
}
.course-nav nav a {
  display: flex;
  gap: 9px;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 5px 0;
}
.course-nav nav a small {
  font: 600 0.7rem/1.5 var(--mono);
  color: var(--dim);
  min-width: 17px;
  flex: none;
}
.course-nav nav a:hover {
  color: var(--green);
}
.course-nav nav a[aria-current="page"],
.course-nav nav a[aria-current="page"] small {
  color: var(--accent);
  font-weight: 600;
}
/* Each part row folds out its topic subpages (Part 18 folds out the four
   track briefs): the row link opens the hub, the chevron toggles the fold,
   and only the current part starts open. */
.course-nav .map-part > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}
.course-nav .map-part > summary::-webkit-details-marker {
  display: none;
}
.course-nav .map-part > summary a {
  flex: 1;
  min-width: 0;
}
.course-nav .map-part > summary > .icon {
  width: 13px;
  height: 13px;
  color: var(--dim);
  flex: none;
}
.course-nav .map-part:not([open]) > summary > .icon {
  transform: rotate(-90deg);
}
.course-nav .map-topics {
  display: grid;
  margin: 1px 0 7px 14px;
  padding-left: 11px;
  border-left: 1px solid var(--line);
}
.course-nav .map-topics a {
  font-size: 0.8rem;
  padding: 4px 0;
}
@media (max-width: 1150px) {
  .reader-grid:has(> .course-nav) {
    grid-template-columns: fit-content(220px) minmax(0, 1fr);
  }
  .course-nav[open] {
    width: 220px;
  }
  .reader-grid:has(> .course-nav) > .course-nav {
    grid-row: 1 / span 2;
  }
  .reader-grid:has(> .course-nav) > .outline {
    grid-column: 2;
    grid-row: 1;
    position: static;
  }
  .reader-grid:has(> .course-nav) > article {
    grid-column: 2;
    grid-row: 2;
  }
  /* Same dropdown dress as the ≤760px outline rules below; repeated here
     because on course-map pages the dropdown arrives at 1150px already. */
  .reader-grid:has(> .course-nav) > .outline > div {
    display: none;
  }
  .reader-grid:has(> .course-nav) > .outline details {
    display: block;
    border-block: 1px solid var(--line);
    padding: 4px 0;
  }
  .reader-grid:has(> .course-nav) > .outline summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 42px;
  }
  .reader-grid:has(> .course-nav) > .outline details[open] summary > .icon {
    transform: rotate(180deg);
  }
  .reader-grid:has(> .course-nav) > .outline nav a {
    padding: 10px 6px;
  }
}
@media (max-width: 980px) {
  .course-nav {
    display: none;
  }
  .reader-grid:has(> .course-nav) {
    grid-template-columns: minmax(0, 1fr);
  }
  .reader-grid:has(> .course-nav) > .outline {
    grid-column: 1;
    grid-row: 1;
  }
  .reader-grid:has(> .course-nav) > article {
    grid-column: 1;
    grid-row: 2;
  }
}

/* Expand/collapse blocks written in lesson markdown (OS install steps,
   quick-quiz answers, predict-the-output spoilers): the same quiet hairline
   card as .solution above, minus its exercise-specific summary dressing.
   :not(.solution) keeps the two from stacking borders. */
.prose details:not(.solution) {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 14px;
  margin: 14px 0;
}
.prose details:not(.solution) summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--green);
  padding: 10px 0;
}
.prose details:not(.solution)[open] {
  padding-bottom: 12px;
}

/* One-click copy on lesson code blocks (added by app.js; the dark block gets
   a translucent chip, visible on hover and always on touch screens). */
.prose pre {
  position: relative;
}
.code-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 120ms;
}
.code-chip {
  border: 1px solid #ffffff2e;
  border-radius: 5px;
  background: #ffffff14;
  /* Chips sit on the pinned-dark code panel, so the text uses the pinned
     code foreground — var(--paper) would flip dark-on-dark in dark mode. */
  color: var(--code-fg);
  font: 550 0.72rem/1 var(--sans);
  padding: 6px 9px;
  cursor: pointer;
}
.prose pre:hover .code-tools,
.code-tools:focus-within {
  opacity: 1;
}
@media (pointer: coarse) {
  .code-tools {
    opacity: 1;
  }
}
/* Output of a lesson example's Run button: hugs the block it came from. */
.block-out {
  margin: -0.6em 0 1em;
  padding: 0.75em 1em;
  border-radius: 0 0 8px 8px;
  /* Pinned dark like the code block it hangs from (ink/paper would invert
     in dark mode and leave a light slab under a dark block). */
  background: var(--code-bg);
  color: var(--code-fg);
  border-top: 1px solid #ffffff24;
  font: 0.85rem/1.55 var(--mono);
  overflow-x: auto;
}

/* Collapsible side panels: the course map and the on-this-page outline are
   <details> whose title row is the toggle. The course map closes toward the
   left edge and the outline toward the right (each summary carries a
   panel-close and a panel-open icon; CSS shows the one for the current
   state). A closed panel collapses into a slim vertical rail — icon on top,
   title turned vertical — and the fit-content() grid columns above hand the
   freed width back to the article. */
.course-nav > summary,
.outline details.panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  min-height: 34px;
}
.course-nav > summary .eyebrow,
.outline details.panel > summary .eyebrow {
  margin: 0;
}
.course-nav > summary .icon,
.outline details.panel > summary .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: none;
}
.course-nav > summary:hover .icon,
.outline details.panel > summary:hover .icon {
  color: var(--green);
}
/* Each summary holds two icons — panel-close then panel-open; show the one
   matching the state (the eyebrow is a span, so the svgs are of-type 1–2). */
.course-nav[open] > summary .icon:nth-of-type(2),
.course-nav:not([open]) > summary .icon:nth-of-type(1),
.outline details.panel[open] > summary .icon:nth-of-type(2),
.outline details.panel:not([open]) > summary .icon:nth-of-type(1) {
  display: none;
}
/* Closed state: a slim vertical rail that reopens on click. */
.course-nav:not([open]) > summary,
.outline details.panel:not([open]) > summary {
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  min-height: 0;
  padding-top: 5px;
}
.course-nav:not([open]) > summary .eyebrow,
.outline details.panel:not([open]) > summary .eyebrow {
  writing-mode: vertical-rl;
}
.course-nav:not([open]) {
  padding-right: 12px;
}
/* Beats the base ".outline details { display: none }" (mobile-dropdown rule)
   so the desktop panel shows; the media blocks that hide ".outline > div"
   on small screens still hide this with it. */
.outline > div details.panel {
  display: block;
}
.course-nav[open] {
  width: 240px;
}
.reader-grid > .outline details.panel[open] {
  width: 230px;
}
.reader-grid:has(> .course-nav) > .outline details.panel[open] {
  width: 200px;
}

/* Theme toggle: one button cycling Day -> Dark -> System. CSS shows the
   icon for the active mode (html[data-theme] is set before paint; no
   attribute means "system"). Hidden without JavaScript via .js. It renders
   twice — top-right corner of the platform bar, and in the mast — and the
   rules after this block show exactly one of the two at any width. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--pale);
  color: var(--green);
}
.theme-toggle .icon {
  display: none;
  width: 17px;
  height: 17px;
}
html:not([data-theme]) .theme-toggle .icon:nth-of-type(3) {
  display: block;
}
[data-theme="light"] .theme-toggle .icon:nth-of-type(1) {
  display: block;
}
[data-theme="dark"] .theme-toggle .icon:nth-of-type(2) {
  display: block;
}
/* The platform-bar copy sits in the page's top-right corner as a quiet
   icon-only button; the mast copy exists for below 760px, where the bar
   itself is hidden (see .atlas-bar's 760px rule). */
.atlas-bar .theme-toggle {
  align-self: center;
  width: 30px;
  height: 30px;
  min-height: 0;
  border: 0;
  background: none;
  border-radius: 5px;
}
.atlas-bar .theme-toggle:hover {
  background: var(--tab-hover);
  color: var(--ink);
}
@media (min-width: 761px) {
  .mast .theme-toggle {
    display: none;
  }
}

/* The SQL editor indents by two spaces, matching the course code style. */
.code-editor textarea,
.code-editor-hl {
  tab-size: 2;
}

/* ---- SQL course: honest "planned" rows ---------------------------------
   Later stages' parts are published as unlinked rows until their lessons
   exist; the course map lists them as quiet labels under the stage. */
span.part-row.planned-part {
  cursor: default;
  color: var(--ink-soft);
}
span.part-row.planned-part strong {
  color: var(--ink-soft);
}
/* Planned "Covers" lines carry long slash-joined keyword runs
   (ROW_NUMBER/RANK/DENSE_RANK/...) that have no natural break points. */
span.part-row.planned-part .row-meta {
  overflow-wrap: anywhere;
}
span.part-row.planned-part:hover {
  background: none;
  border-color: var(--line);
}
.course-nav .map-planned {
  display: block;
  padding: 3px 9px 3px 31px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
