:root {
  color-scheme: light;
  --ink: #163444;
  --muted: #536c78;
  --accent: #086b63;
  --rule: #d8e4e6;
  --paper: #fbfcfb;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #e49c30; outline-offset: 4px; border-radius: 3px; }
.skip { position: absolute; top: -80px; left: 20px; padding: 12px 20px; background: white; z-index: 10; }
.skip:focus { top: 16px; }
.masthead { background: #102c3b; color: #f5faf8; padding: 28px 28px 40px; }
.masthead-inner { max-width: 1160px; margin: auto; }
.back { display: inline-block; font-size: .86rem; color: #baede2; text-decoration: none; margin-bottom: 29px; }
.eyebrow { color: #a7d9cb; font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; margin: 0 0 9px; }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; font-weight: 730; letter-spacing: -.045em; margin: 0; }
.subtitle { color: #c1d4da; max-width: 730px; margin: 17px 0 23px; font-size: 1.02rem; }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-links a { color: #e9faf5; text-decoration: none; border: 1px solid #50737c; border-radius: 100px; padding: 6px 14px; font-size: .8rem; }
.quick-links a:hover { background: #1f4656; }
.page { max-width: 1216px; margin: auto; display: grid; grid-template-columns: 238px minmax(0, 1fr); gap: 44px; padding: 38px 28px 70px; }
.toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; font-size: .77rem; padding-right: 7px; }
.toc summary { color: var(--ink); cursor: pointer; font-weight: 750; font-size: .84rem; }
.toc ol { list-style: none; padding: 0; margin: 12px 0 22px; }
.toc li { margin: 0; line-height: 1.45; }
.toc li a { display: block; border-left: 2px solid var(--rule); padding: 7px 0 7px 13px; text-decoration: none; color: #385862; }
.toc li a:hover, .toc li a:focus-visible { border-color: var(--accent); color: var(--accent); background: #edf5f1; }
.toc p { color: var(--muted); line-height: 1.6; font-size: .71rem; }
.source-link { font-size: .72rem; }
main { min-width: 0; }
main > p:first-child { margin-top: 0; color: var(--muted); font-size: .91rem; }
section { margin: 42px 0 0; padding-top: 23px; border-top: 1px solid var(--rule); }
section:first-of-type { margin-top: 22px; border: 1px solid #bcd8ce; border-radius: 14px; background: #f0f7f2; padding: 24px 28px 14px; }
h2, h3 { scroll-margin-top: 28px; line-height: 1.28; position: relative; }
h2 { font-size: 1.45rem; margin: 0 0 19px; letter-spacing: -.025em; }
h3 { font-size: 1.08rem; margin: 31px 0 14px; }
p { margin: 15px 0; }
strong { font-weight: 690; }
li { margin: 8px 0; }
ul, ol { padding-left: 25px; }
.anchor { font-size: .8em; color: #7d969e; text-decoration: none; padding-left: 9px; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.equation { background: #fff; border: 1px solid var(--rule); border-left: 3px solid #77ab9c; border-radius: 6px; overflow-x: auto; padding: 16px 23px; margin: 20px 0; }
.equation .katex-display { margin: 0; padding: 2px; }
.katex { font-size: 1.04em; position: relative; }
.katex-display > .katex { white-space: nowrap; min-width: min-content; }
.katex-display > .katex > .katex-html { padding: 4px 0; }
.table-scroll { overflow-x: auto; width: 100%; margin: 23px 0; border: 1px solid var(--rule); border-radius: 9px; background: white; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; line-height: 1.5; }
th { text-align: left; background: #e9f0ed; color: #284d50; font-weight: 700; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f8fbf9; }
.number { text-align: right; white-space: nowrap; }
code { border-radius: 4px; background: #edf1f1; padding: 2px 5px; font-size: .9em; }
footer { display: flex; justify-content: space-between; gap: 15px; flex-wrap: wrap; max-width: 1216px; margin: auto; padding: 20px 28px 30px; border-top: 1px solid var(--rule); font-size: .73rem; color: var(--muted); }
@media (max-width: 900px) {
  .page { display: block; max-width: 800px; padding: 24px 22px 40px; }
  .toc { position: static; max-height: none; padding: 15px 18px; margin-bottom: 25px; background: #edf3f0; border-radius: 8px; }
  .toc nav { max-height: 45vh; overflow-y: auto; }
  .toc p, .source-link { display: none; }
  .toc summary { font-size: .9rem; }
  .masthead { padding: 23px 22px 30px; }
  .anchor { opacity: 1; }
  section:first-of-type { padding: 22px 19px 12px; }
  .equation { padding: 15px 17px; }
}
@media (max-width: 480px) {
  :root { font-size: 16px; }
  .page { padding: 20px 16px 34px; }
  .masthead { padding: 20px 20px 28px; }
  .back { margin-bottom: 25px; }
  h2 { font-size: 1.33rem; }
  .quick-links { gap: 8px; }
  .quick-links a { font-size: .75rem; padding: 5px 10px; }
  .equation { margin-left: -4px; margin-right: -4px; padding: 15px 13px; }
  th, td { padding: 11px 12px; }
  section:first-of-type { padding: 20px 15px 12px; }
  footer { padding: 18px 20px; }
}
@media print {
  :root { font-size: 11pt; background: white; color: black; }
  .masthead { background: white; color: black; padding: 0 0 20px; border-bottom: 1px solid #999; }
  .back, .quick-links, .toc, .anchor, footer { display: none; }
  .eyebrow, .subtitle { color: #333; }
  .page { display: block; padding: 20px 0; max-width: none; }
  section { break-inside: auto; }
  h2, h3 { break-after: avoid; }
  .equation, .table-scroll { break-inside: avoid; }
  .equation { font-size: 90%; overflow: visible; }
}
