.chapter-hero{padding:14px 0 30px;border-bottom:1px solid var(--line);margin-bottom:28px}.chapter-hero h1{margin-top:18px}.chapter-hero .hero-actions{flex-wrap:wrap}.chapter-article{min-width:0}.chapter-article>p{font-size:16px;line-height:1.95;color:#334155}.chapter-article .lesson{padding:30px 0}.chapter-article h3{margin-top:28px}.chapter-scope{margin:24px 0;padding:16px 20px;border-left:3px solid #1d4ed8;background:#edf3ff;border-radius:0 7px 7px 0}.chapter-scope p{font-size:14px;line-height:1.9;color:#334155;margin:0}.chapter-list{padding-left:24px;color:#334155;font-size:15px;line-height:1.95}.chapter-list li{padding:6px 0}.chapter-article .inline-source{font-size:inherit;overflow-wrap:anywhere}.chapter-article .source-code{white-space:pre;overflow-x:auto;max-width:100%;font-size:13px}.chapter-article .comparison-table th,.chapter-article .comparison-table td{min-width:95px;vertical-align:top}.chapter-article .comparison-table{max-width:100%}.chapter-article code{overflow-wrap:anywhere}.chapter-nav a{font-size:13px;padding:8px 10px}.chapter-next{display:flex;flex-wrap:wrap;gap:14px;justify-content:space-between;border-top:1px solid #cbd5e1;margin-top:30px;padding-top:24px;color:#1d4ed8;font-size:14px;line-height:1.8}.chapter-article .spec-lab{margin:30px 0}@media(max-width:560px){.chapter-hero{padding-top:4px}.chapter-hero h1{font-size:32px}.chapter-scope{padding:14px}.chapter-article>p{font-size:15px}.chapter-article h2{font-size:24px}.chapter-article .source-code{font-size:12px}.chapter-article .comparison-table td{font-size:13px}.chapter-article .hero-actions{gap:16px}.chapter-next{font-size:13px}}

.raster-figure{background:#f8fafc}.raster-figure figcaption{background:#fff}.raster-figure img{min-width:700px}

/* Every chapter uses the same navigation; the current chapter owns its local outline. */
.wiki-chapters{gap:6px;flex-shrink:0}
.wiki-chapters>.wiki-chapter-link,.wiki-chapter-current>summary{display:grid;grid-template-columns:minmax(0,1fr) 12px;align-items:start;gap:8px;padding:11px 10px;border-radius:7px;color:#475569;font-size:14px;line-height:1.65;letter-spacing:0}
.wiki-chapter-link::after,.wiki-chapter-current>summary::after{content:'›';font-size:20px;line-height:1.1;text-align:center;color:#64748b}
.wiki-chapters>.wiki-chapter-link:hover{color:#1d4ed8;background:#f1f5fb}
.wiki-chapter-current{min-width:0;border:0;margin:0;padding:0;background:none}
.wiki-chapter-current>summary{list-style:none;cursor:pointer;color:#1e40af;background:#e8efff;font-weight:650}
.wiki-chapter-current>summary::-webkit-details-marker{display:none}
.wiki-chapter-current[open]>summary::after{transform:rotate(90deg)}
.wiki-chapter-current>.chapter-nav{margin:7px 0 8px 20px;padding:0 0 0 9px;border-left:1px solid #c7d8f3;gap:2px}
.wiki-chapter-current>.chapter-nav a{font-size:12px;line-height:1.65;padding:7px 9px;gap:7px;overflow-wrap:anywhere}
.wiki-chapter-current>.chapter-nav a.active{background:#edf3ff;color:#1e40af;font-weight:600}
.wiki-chapter-current>summary:focus-visible,.wiki-chapters a:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.sidebar:has(.wiki-chapters){overscroll-behavior-y:contain}

.technical-figure.compact-figure img {
  display: block;
  width: min(100%, 430px);
  min-width: 0;
  height: auto;
  margin-inline: auto;
}
.compact-figure figcaption { min-width: 0; }

.chapter-article .execution-source-details {
  margin: 20px 0;
  padding: 14px 18px;
  border: 1px solid #d9e1eb;
  border-radius: 7px;
  background: #fff;
}
.chapter-article .execution-source-details > summary {
  cursor: pointer;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.8;
}
.chapter-article .execution-source-details[open] > summary { margin-bottom: 16px; }
.chapter-article .execution-source-details > summary:focus-visible { outline: 2px solid #2563eb; outline-offset: 4px; }

.hero-copy > .hero-lead + .hero-lead { margin-top: 12px; }
.learning-path a > span { line-height: 1.6; }
.breadcrumb > a { flex: none; white-space: nowrap; }

.diagram-figure:has(> .diagram-expand) { overflow: hidden; }
.diagram-figure > .diagram-expand { overflow-x: auto; }
.diagram-figure figcaption { min-width: 0; }
.diagram-figure > .diagram-expand:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }

.reading-routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 24px 0;
}
.reading-routes li {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.65;
}
.reading-routes strong { display: block; font-size: 16px; }
.reading-routes li > div { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; }
.reading-routes a { color: #1d4ed8; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }

.chapter-hero + .article-layout > .page-toc {
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-top: 8px;
}
