:root {
  --ink:#17243d;
  --blue:#002676;
  --muted:#40516b;
  --line:#c7d3e3;
  --paper:#fff;
  --tint:#f1f5fb;
  --gold:#fdb515;
  --measure:44em;
  --font:'Noto Sans SC',-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif;
  color:var(--ink);
  background:var(--paper);
  font-family:var(--font);
  font-synthesis:none;
  scrollbar-color:#a8b8cc #fff;
  scroll-padding-top:28px;
}
* {
  box-sizing:border-box;
}
body {
  max-width:1200px;
  margin:0 auto;
  padding:48px 44px 88px;
  font-size:18px;
  line-height:1.85;
}
h1,h2,h3,h4 {
  color:var(--blue);
  font-weight:600;
  line-height:1.4;
  text-wrap:balance;
  overflow-wrap:break-word;
}
h1 {
  font-size:40px;
  letter-spacing:-.025em;
  max-width:23em;
  margin:0 0 24px;
}
h2 {
  font-size:28px;
  margin:44px 0 18px;
}
h3 {
  font-size:23px;
  margin:32px 0 14px;
}
h4 {
  font-size:20px;
  margin:26px 0 12px;
}
p {
  max-width:var(--measure);
  margin:14px 0 20px;
  overflow-wrap:break-word;
}
a {
  color:var(--blue);
  text-underline-offset:.22em;
  text-decoration-thickness:1px;
}
a:hover {
  text-decoration-thickness:2px;
}
nav {
  display:flex;
  flex-wrap:wrap;
  gap:10px 24px;
  align-items:baseline;
  margin:20px 0;
  font-size:16px;
}
nav a {
  line-height:1.65;
}
ul,ol {
  max-width:var(--measure);
  padding-left:1.5em;
  margin:16px 0 24px;
}
li {
  margin:7px 0;
}
li>p {
  margin:6px 0;
}
blockquote {
  margin:24px 0;
  padding:2px 0 2px 22px;
  border-left:1px solid var(--line);
  color:var(--muted);
}
img,video {
  max-width:100%;
  height:auto;
}
figure {
  margin:28px 0;
  overflow-x:auto;
  overscroll-behavior-x:contain;
}
figure img {
  display:block;
  margin:0 auto;
}
figure svg {
  display:block;
  width:100%;
  height:auto;
  min-width:680px;
}
figcaption,small {
  font-size:15px;
  color:var(--muted);
  line-height:1.6;
}
figcaption {
  margin-top:12px;
}
pre {
  background:var(--tint);
  padding:20px 24px;
  margin:20px 0;
  overflow:auto;
  max-width:100%;
  font:15px/1.7 'IBM Plex Mono',ui-monospace,monospace;
  tab-size:4;
  font-variant-numeric:tabular-nums;
  border-radius:4px;
}
code {
  font-family:'IBM Plex Mono',ui-monospace,monospace;
  font-size:.9em;
  overflow-wrap:anywhere;
}
pre code {
  font-size:inherit;
  overflow-wrap:normal;
}
table {
  border-collapse:collapse;
  width:100%;
  display:block;
  overflow-x:auto;
  font-size:16px;
  line-height:1.7;
  margin:24px 0;
  font-variant-numeric:tabular-nums;
}
td,th {
  text-align:left;
  vertical-align:top;
  padding:12px 16px;
  border-bottom:1px solid var(--line);
  min-width:96px;
}
th {
  font-weight:600;
  color:var(--blue);
  border-bottom-color:var(--blue);
}
td:first-child,th:first-child {
  padding-left:0;
}
td:last-child,th:last-child {
  padding-right:0;
}
details {
  margin:22px 0;
}
summary {
  cursor:pointer;
  color:var(--blue);
  font-size:16px;
  line-height:1.7;
  padding:10px 0;
}
summary:hover {
  text-decoration:underline;
  text-underline-offset:4px;
}
details[open]>summary {
  margin-bottom:14px;
}
textarea {
  width:100%;
  font:inherit;
  min-height:100px;
  padding:12px;
  border:1px solid var(--line);
  caret-color:var(--blue);
}
:focus-visible {
  outline:3px solid var(--gold);
  outline-offset:4px;
}
::selection {
  background:#ffe69b;
  color:var(--ink);
}
.katex-display {
  overflow-x:auto;
  overflow-y:hidden;
  padding:8px 0;
  margin:20px 0;
}
.katex {
  font-size:1.08em;
}
.page-header {
  padding-bottom:30px;
  margin-bottom:34px;
  border-bottom:1px solid var(--line);
}
.page-header p {
  color:var(--muted);
  font-size:20px;
  line-height:1.7;
}
.page-header nav {
  margin-bottom:0;
}
.primary-link {
  display:inline-block;
  background:var(--blue);
  color:white;
  text-decoration:none;
  padding:10px 18px;
  border-radius:4px;
}
.primary-link:hover {
  background:#143f86;
}
.document-nav {
  margin:0 0 32px;
  padding-bottom:20px;
  border-bottom:1px solid var(--line);
}
.reading-body {
  max-width:var(--measure);
}
.reading-body figure,.reading-body table,.reading-body pre {
  max-width:100%;
}
.course-intro {
  padding:0 0 30px;
  margin-bottom:36px;
  border-bottom:1px solid var(--line);
}
.course-intro h2 {
  margin-top:0;
}
.material-columns {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:32px 64px;
  margin:24px 0;
}
.material-column h3 {
  font-size:19px;
  margin:0 0 12px;
}
.material-list {
  list-style:none;
  padding:0;
  margin:0;
  max-width:none;
}
.material-list li {
  margin:0 0 12px;
}
.material-list a {
  display:block;
  line-height:1.6;
}
.material-use {
  display:block;
  font-size:15px;
  color:var(--muted);
  line-height:1.65;
  margin-top:3px;
}
.material-status {
  font-size:14px;
  color:var(--muted);
  font-weight:400;
}
.support-note {
  font-size:16px;
  color:var(--muted);
  line-height:1.8;
  margin-top:24px;
}
.chapter-index {
  display:block;
  padding:26px 0 32px;
  border-bottom:1px solid var(--line);
  margin-bottom:8px;
}
.chapter-index h2 {
  margin-top:0;
}
.chapter-index ol {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px 42px;
  list-style:none;
  padding:0;
  max-width:none;
  margin-bottom:0;
}
.chapter-index li {
  margin:0;
}
.chapter {
  padding:36px 0;
  border-bottom:1px solid var(--line);
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr);
  gap:36px;
}
.chapter h2 {
  font-size:26px;
  margin:0 0 14px;
}
.chapter-intro p {
  font-size:17px;
  line-height:1.8;
  color:var(--muted);
}
.chapter-intro .chapter-question {
  font-size:18px;
  color:var(--ink);
}
.chapter-material h3 {
  font-size:17px;
  margin:4px 0 15px;
}
.chapter-material .material-list {
  font-size:16px;
}
.chapter-sequence {
  font-size:16px;
}
.chapter-sequence ol {
  margin-bottom:0;
}
.lecture-toc {
  display:block;
  border-bottom:1px solid var(--line);
  padding-bottom:24px;
  margin-bottom:48px;
}
.lecture-toc ol {
  columns:2;
  column-gap:48px;
  max-width:none;
  list-style:none;
  padding:0;
}
.lecture-toc li {
  break-inside:avoid;
  margin:0 0 10px;
}
.lecture-section-head {
  padding:30px 0 10px;
}
.lecture-section-head h2 {
  margin-top:0;
}
.lecture-article {
  padding:36px 0 42px;
  border-top:1px solid var(--line);
  scroll-margin-top:28px;
}
.lecture-article h3 {
  font-size:28px;
  max-width:30em;
  margin-top:0;
}
.lecture-article .slide-lead {
  font-size:19px;
  color:var(--muted);
}
.lecture-article .lecture-figure {
  margin:28px 0 32px;
}
.lecture-article .speaker-prose {
  max-width:var(--measure);
}
.lecture-article .article-links {
  border-top:1px solid var(--line);
  padding-top:18px;
  font-size:15px;
}
.lecture-article details {
  max-width:var(--measure);
}
.lecture-article details a {
  overflow-wrap:anywhere;
}
.lecture-question {
  font-size:18px;
  margin-top:24px;
}
.notebook-header {
  margin-bottom:24px;
}
.notebook-header h1 {
  max-width:24em;
  font-size:36px;
}
.notebook-header p {
  font-size:17px;
}
.notebook-toc {
  border-bottom:1px solid var(--line);
  padding-bottom:18px;
  margin:0 0 32px;
}
.notebook-toc ol {
  columns:2;
  column-gap:40px;
  font-size:15px;
  max-width:none;
}
.notebook-toc li {
  break-inside:avoid;
  margin:0 0 10px;
}
.notebook-cell {
  padding:6px 0;
  scroll-margin-top:24px;
}
.notebook-cell>h2:first-child {
  padding-top:22px;
  border-top:1px solid var(--line);
  margin-top:30px;
}
.notebook-cell>svg {
  max-width:100%;
  height:auto;
}
.notebook-cell>p,.notebook-cell>ul,.notebook-cell>ol,.notebook-cell>blockquote {
  max-width:var(--measure);
}
.notebook-cell p:has(>img:only-child) {
  max-width:none;
  margin:28px 0;
}
.notebook-cell p>img:only-child {
  display:block;
  margin:auto;
  max-height:760px;
  object-fit:contain;
}
.notebook-cell .code-disclosure {
  border-block:1px solid var(--line);
  margin:18px 0;
}
.code-disclosure>summary {
  padding:12px 0;
}
.code-disclosure pre {
  margin:0 0 16px;
}
.saved-output {
  font-size:14px;
  background:#f6f8fc;
  border:1px solid #e1e7ef;
  max-height:500px;
  white-space:pre;
  overflow:auto;
}
.output-label {
  font-size:14px;
  color:var(--muted);
  margin:16px 0 8px;
}
.notebook-output {
  margin:12px 0 30px;
}
.notebook-output img {
  max-height:800px;
  object-fit:contain;
}
.notebook-return {
  border-top:1px solid var(--line);
  padding-top:24px;
  margin-top:40px;
}
.notebook-return h2 {
  font-size:24px;
  margin-top:0;
}
.notebook-return nav {
  max-width:var(--measure);
  font-size:16px;
}
.current-location {
  padding:20px 0;
  border-block:1px solid var(--line);
  margin:24px 0;
  font-size:17px;
}
.current-location h2 {
  font-size:22px;
  margin:0 0 10px;
}
.current-location p {
  margin-bottom:12px;
}
.page-footer {
  border-top:1px solid var(--line);
  padding-top:24px;
  margin-top:40px;
  font-size:15px;
  color:var(--muted);
}
@media(max-width:980px) {
  body {
    padding:36px 30px 72px;
  }
  .chapter {
    grid-template-columns:1fr 1fr;
    gap:20px 32px;
  }
  .chapter-intro {
    grid-column:1/-1;
  }
  .chapter-intro p {
    max-width:44em;
  }
  .chapter-intro h2 {
    font-size:25px;
  }
  .material-columns {
    gap:30px;
  }
  .notebook-toc ol {
    columns:1;
  }
}
@media(max-width:640px) {
  body {
    padding:26px 20px 60px;
    font-size:17px;
    line-height:1.85;
  }
  h1 {
    font-size:29px;
    line-height:1.4;
    margin-bottom:18px;
  }
  h2 {
    font-size:24px;
    margin-top:34px;
  }
  h3 {
    font-size:21px;
  }
  nav {
    gap:12px 18px;
    font-size:15px;
  }
  .page-header {
    padding-bottom:24px;
    margin-bottom:28px;
  }
  .page-header p {
    font-size:18px;
  }
  .material-columns,.chapter {
    grid-template-columns:1fr;
    gap:24px;
  }
  .chapter-index ol {
    grid-template-columns:1fr;
  }
  .chapter-intro {
    grid-column:auto;
  }
  .chapter {
    padding:28px 0;
  }
  .chapter-material h3 {
    margin-top:0;
  }
  .chapter-sequence {
    margin-bottom:0;
  }
  .lecture-toc ol {
    columns:1;
  }
  .lecture-article {
    padding:28px 0;
  }
  .lecture-article h3 {
    font-size:23px;
  }
  .lecture-article .slide-lead {
    font-size:17px;
  }
  .lecture-article figure svg {
    min-width:680px;
  }
  .notebook-header h1 {
    font-size:28px;
  }
  .notebook-toc {
    margin-bottom:20px;
  }
  .notebook-return h2 {
    font-size:22px;
  }
  pre {
    padding:16px;
    font-size:13px;
  }
  table {
    font-size:14px;
  }
  td,th {
    padding:10px 12px;
  }
  figure {
    margin:22px 0;
  }
  .saved-output {
    font-size:12px;
    max-height:380px;
  }
  .katex {
    font-size:1em;
  }
  .document-nav {
    margin-bottom:24px;
  }
  .current-location {
    font-size:16px;
  }
}
@media print {
  body {
    max-width:none;
    padding:0;
    font-size:11pt;
  }
  nav,.document-nav,.notebook-toc,.lecture-toc,.chapter-index,.page-footer {
    display:none;
  }
  h1 {
    font-size:24pt;
  }
  h2 {
    font-size:18pt;
  }
  h3 {
    font-size:15pt;
  }
  p {
    max-width:none;
  }
  .chapter,.material-columns {
    display:block;
  }
  .lecture-article {
    break-before:page;
  }
  .lecture-article:first-child {
    break-before:auto;
  }
  figure {
    overflow:visible;
    break-inside:avoid;
  }
  figure svg {
    min-width:0;
  }
  pre,.saved-output {
    max-height:none;
    white-space:pre-wrap;
    overflow:visible;
    font-size:8pt;
  }
  table {
    display:table;
    font-size:9pt;
  }
  .notebook-cell {
    break-inside:auto;
  }
  .notebook-cell>h2 {
    break-after:avoid;
  }
  .primary-link {
    color:var(--blue);
    background:none;
    padding:0;
  }
}
.material-column,.chapter-intro,.chapter-material {
  min-width:0;
}
.notebook-cell:empty {
  display:none;
}

/* Shared cleanup guide: the same reading hierarchy as the course. */
.cleanup-item { padding:8px 0 24px; border-bottom:1px solid var(--line); }
.cleanup-item h3 { margin-bottom:12px; }
.cleanup-use { display:grid; grid-template-columns:1fr 1fr; gap:48px; }
.cleanup-use section { min-width:0; }
.cleanup-table { overflow-x:auto; }
.cleanup-table table { min-width:680px; }
.cleanup-table td details { font-size:14px; margin-top:8px; }
.cleanup-table td code { overflow-wrap:anywhere; }
.cleanup-note { padding:20px 24px; background:var(--tint); }
@media(max-width:700px) { .cleanup-use { grid-template-columns:1fr; gap:8px; } }
