/* Offline proof notebook. All typography uses fonts already on the reader's system. */
:root {
  color-scheme: light;
  --paper: #f8f7f2;
  --surface: #fffefa;
  --sidebar: #eeeee6;
  --ink: #1d2c2c;
  --muted: #657371;
  --teal: #175e58;
  --teal-dark: #10463f;
  --teal-soft: #e3eeea;
  --amber: #a36820;
  --amber-soft: #f6eddc;
  --rule: #d9ded5;
  --code-bg: #182d2d;
  --code-ink: #e7eee6;
  --sidebar-width: 240px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: #cce2d5; color: #123b36; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: .19em; }
a:hover { color: var(--teal-dark); }
button, input, select { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #b88439; outline-offset: 4px; }
[hidden] { display: none !important; }
img, svg, video { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); margin: 0 0 .8em; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.035em; }
h1 { font-size: clamp(2.3rem, 4.2vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 2.4vw, 2.35rem); }
h3 { font-size: 1.12rem; letter-spacing: -.014em; }
h4 { font-size: 1rem; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.45em; }
li + li { margin-top: .36em; }
hr { height: 1px; border: 0; background: var(--rule); margin: 2.8rem 0; }
small, .small { font-size: .8rem; }
.muted { color: var(--muted); }
.site-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-width); padding: 34px 20px 24px; overflow-y: auto; background: var(--sidebar); border-right: 1px solid var(--rule); display: flex; flex-direction: column; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 6px 38px; color: var(--ink); text-decoration: none; font-weight: 650; font-size: 1rem; line-height: 1.25; letter-spacing: -.02em; }
.brand:hover { color: var(--teal); }
.brand-mark { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; color: var(--paper); background: var(--teal); font: 24px/1 var(--serif); border-radius: 10px 10px 10px 2px; }
.brand small, .brand .small { display: block; font-size: .67rem; font-weight: 400; color: var(--muted); letter-spacing: .03em; margin-top: 4px; }
.nav-section { margin: 24px 12px 10px; font: 600 .64rem/1.5 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.sidebar nav > .nav-section:first-child { margin-top: 0; }
.nav-link { position: relative; display: flex; align-items: baseline; gap: 9px; padding: 8px 12px; margin: 2px 0; color: #53645f; font-size: .81rem; line-height: 1.45; text-decoration: none; border-radius: 5px; overflow-wrap: anywhere; }
.nav-link:hover { background: #e5e9df; color: var(--ink); }
.nav-link.active, .nav-link[aria-current="page"] { background: var(--surface); color: var(--teal-dark); font-weight: 600; box-shadow: 0 1px 3px #213b2a08; }
.nav-link.active::before, .nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -3px; top: 9px; bottom: 9px; width: 3px; background: var(--teal); border-radius: 2px; }
.sidebar-footer { margin-top: auto; padding: 24px 12px 0; border-top: 1px solid var(--rule); color: var(--muted); font-size: .71rem; line-height: 1.6; }
.sidebar-footer a { color: inherit; }
.main-shell { margin-left: var(--sidebar-width); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 77px; padding: 15px clamp(24px, 4vw, 64px); background: #f8f7f2f2; border-bottom: 1px solid var(--rule); backdrop-filter: blur(12px); }
.topbar > .small, .topbar > .muted { font-size: .73rem; }
.search-wrap { position: relative; width: min(100%, 390px); margin-left: auto; }
.search-wrap::before { content: ""; position: absolute; left: 14px; top: 13px; width: 11px; height: 11px; border: 1.5px solid #7b8b81; border-radius: 50%; pointer-events: none; }
.search-wrap::after { content: ""; position: absolute; left: 24px; top: 25px; width: 6px; border-top: 1.5px solid #7b8b81; transform: rotate(45deg); pointer-events: none; }
#site-search { width: 100%; min-height: 41px; padding: 8px 43px 8px 37px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: .81rem; outline-offset: 2px; }
#site-search::placeholder { color: #77827b; }
.search-results { position: absolute; top: calc(100% + 9px); right: 0; width: min(560px, calc(100vw - 32px)); max-height: min(68vh, 580px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--rule); border-radius: 9px; box-shadow: 0 14px 42px #16302a24; padding: 6px; }
.search-result { display: block; padding: 12px 13px; border-radius: 5px; color: var(--ink); text-decoration: none; font-size: .85rem; line-height: 1.45; overflow-wrap: anywhere; }
.search-result + .search-result { border-top: 1px solid #e9ece4; }
.search-result:hover, .search-result[aria-selected="true"] { background: var(--teal-soft); color: var(--teal-dark); }
.search-result-title { display: block; font-weight: 600; margin-bottom: 3px; }
.search-result-kind { font-size: .62rem; color: var(--teal); text-transform: uppercase; letter-spacing: .09em; margin-left: 8px; font-weight: 500; }
.search-result-subtitle, .search-result-excerpt { display: block; color: var(--muted); font-size: .74rem; line-height: 1.5; margin-top: 3px; }
.search-result mark { background: #ecddb0; color: inherit; border-radius: 2px; }
.search-empty { padding: 15px; color: var(--muted); font-size: .82rem; }
#nav-toggle { display: none; border: 1px solid var(--rule); background: var(--surface); border-radius: 5px; padding: 7px 11px; color: var(--ink); font-size: .79rem; }
.content { width: 100%; max-width: 1288px; margin: 0 auto; padding: 54px clamp(24px, 4vw, 64px) 36px; }
.eyebrow { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; color: var(--teal); font-size: .67rem; font-weight: 650; line-height: 1.5; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.hero { margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--rule); }
.hero h1 { max-width: 950px; margin-bottom: 22px; overflow-wrap: anywhere; }
.lead { max-width: 750px; color: #53615d; font-size: clamp(1rem, 1.35vw, 1.13rem); line-height: 1.8; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 25px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 17px; border: 1px solid var(--teal); border-radius: 5px; background: var(--teal); color: #fffefa; font-size: .78rem; font-weight: 550; line-height: 1.4; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.button:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: white; }
.button.secondary, .button.secondary:hover { background: transparent; color: var(--teal); }
.button.secondary:hover { background: var(--teal-soft); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 30px 0 42px; border-block: 1px solid var(--rule); }
.stat { padding: 22px 24px; border-right: 1px solid var(--rule); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; }
.stat-value { display: block; font: 500 2.15rem/1.15 var(--serif); color: var(--teal-dark); letter-spacing: -.035em; }
.stat-label { display: block; margin-top: 8px; font-size: .71rem; color: var(--muted); line-height: 1.5; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 36px 0 19px; }
.section-heading h2 { font-size: 1.65rem; margin: 0; }
.section-heading a { font-size: .77rem; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0 36px; }
.card { position: relative; display: block; min-width: 0; padding: 25px 26px 26px; border: 1px solid var(--rule); border-radius: 7px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .16s ease, box-shadow .16s ease; }
a.card:hover { border-color: #81a59a; box-shadow: 0 5px 18px #24423908; color: var(--ink); }
.card-index { display: block; margin-bottom: 19px; color: var(--teal); font: .7rem/1.4 var(--mono); letter-spacing: .08em; }
.card h2, .card h3 { font: 500 1.45rem/1.3 var(--serif); margin-bottom: 11px; letter-spacing: -.025em; }
.card p { margin-bottom: 0; color: var(--muted); font-size: .84rem; line-height: 1.7; }
.card-arrow { display: block; position: static; margin-top: 20px; color: var(--teal); font-size: .76rem; font-weight: 550; line-height: 1.5; text-decoration: none; }
a.card:hover .card-arrow, a.card-arrow:hover { text-decoration: underline; text-underline-offset: .2em; }
.cards > .result-card { margin: 0; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 205px; gap: clamp(30px, 4vw, 65px); align-items: start; }
.split-layout > *, .prose { min-width: 0; }
.prose { font-size: .95rem; line-height: 1.85; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin-top: 2.5rem; font-size: 1.9rem; }
.prose h3 { margin-top: 2rem; }
.prose p, .prose li { max-width: 82ch; }
.prose blockquote { margin: 1.7rem 0; padding: 8px 0 8px 22px; border-left: 3px solid #aac5b7; color: #51665c; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.6rem 0; font-size: .82rem; }
.prose th { background: #ebefe6; font-weight: 600; text-align: left; }
.prose th, .prose td { padding: 11px 14px; border: 1px solid var(--rule); vertical-align: top; min-width: 105px; }
.prose code, :not(pre) > code { font-family: var(--mono); font-size: .84em; background: #e9ede5; color: #254f43; padding: .12em .28em; border-radius: 3px; overflow-wrap: anywhere; }
.prose pre code { background: transparent; color: inherit; padding: 0; border: 0; }
.toc { position: sticky; top: 106px; border-left: 1px solid var(--rule); padding: 4px 0 4px 19px; font-size: .74rem; line-height: 1.6; max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: thin; }
.toc h2, .toc h3, .toc > p { margin: 0 0 13px; font: 600 .65rem/1.5 var(--sans); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.toc ul, .toc ol { padding: 0; margin: 0; list-style: none; }
.toc li + li { margin-top: 9px; }
.toc a { display: block; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; padding: 3px 0; }
.toc a:hover, .toc a.active, .toc a[aria-current="location"] { color: var(--teal); }
.toc a.active, .toc a[aria-current="location"] { font-weight: 600; }
.callout, .notice { margin: 23px 0; border-left: 3px solid var(--amber); padding: 17px 21px; background: var(--amber-soft); color: #685329; font-size: .86rem; line-height: 1.75; border-radius: 0 5px 5px 0; }
.callout.info, .notice.info { border-left-color: var(--teal); background: var(--teal-soft); color: #31574c; }
.callout > :last-child, .notice > :last-child { margin-bottom: 0; }
.result-card { margin: 16px 0; padding: 24px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); scroll-margin-top: 104px; }
.result-card h2, .result-card h3 { font: 500 1.45rem/1.3 var(--serif); margin: 0 0 12px; overflow-wrap: anywhere; }
.result-card p { color: #59675f; font-size: .87rem; }
.badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.badge { display: inline-block; padding: 3px 8px; background: var(--teal-soft); color: #315e50; border: 1px solid #cdded2; border-radius: 4px; font-size: .64rem; font-weight: 600; line-height: 1.4; letter-spacing: .025em; }
.badge.secondary, .badge.neutral { background: #f0f0e8; color: #6d786b; border-color: #dcdfd3; }
.badge.warning, .badge.assumption { background: var(--amber-soft); color: #8c6328; border-color: #e8d6b4; }
#result-filter { display: block; width: 100%; min-height: 44px; border: 1px solid #cdd6cb; background: var(--surface); border-radius: 5px; padding: 10px 13px; color: var(--ink); font-size: .86rem; margin: 22px 0; }
.declaration { min-width: 0; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); margin: 22px 0; overflow: hidden; scroll-margin-top: 104px; }
.declaration-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; background: #ecf0e7; font: .73rem/1.5 var(--mono); overflow-wrap: anywhere; }
.declaration-header > :first-child { min-width: 0; }
.declaration-header h2, .declaration-header h3 { margin: 0; font: inherit; }
.declaration-header button, [data-copy-target] { flex-shrink: 0; padding: 4px 9px; border: 1px solid #c8d4c7; border-radius: 4px; background: #ffffff91; color: var(--teal); font: 500 .65rem/1.6 var(--sans); }
.declaration-header button:hover, [data-copy-target]:hover { background: white; }
.declaration > p { padding: 15px 18px; margin: 0; font-size: .81rem; }
.code-wrap { position: relative; min-width: 0; margin: 20px 0; border-radius: 6px; overflow: hidden; background: var(--code-bg); }
.declaration .code-wrap { margin: 0; border-radius: 0; }
.code-wrap > [data-copy-target] { position: absolute; right: 12px; top: 10px; z-index: 1; opacity: .95; }
.code-block, pre { display: block; min-width: 0; max-width: 100%; margin: 0; padding: 20px 23px; background: var(--code-bg); color: var(--code-ink); font: .76rem/1.85 var(--mono); tab-size: 2; white-space: pre; overflow-x: auto; overflow-wrap: normal; scrollbar-width: thin; scrollbar-color: #61756a transparent; }
pre code, .code-block code { color: inherit; background: transparent; font: inherit; padding: 0; white-space: inherit; }
.source-lines { display: block; white-space: normal; max-width: 100%; overflow-x: auto; padding: 16px 0; color: var(--code-ink); background: var(--code-bg); font: .74rem/1.85 var(--mono); scrollbar-width: thin; }
.source-lines > code { display: block; white-space: normal; }
.source-line { display: grid; grid-template-columns: 4rem minmax(max-content, 1fr); min-width: 100%; width: max-content; }
.source-line:target { background: #365448; }
.line-no { display: block; padding: 0 14px 0 8px; border-right: 1px solid #385049; text-align: right; color: #819c8d; user-select: none; text-decoration: none; font-variant-numeric: tabular-nums; }
a.line-no:hover { color: #fff; background: #2c4840; }
.line-code { display: block; padding: 0 20px; white-space: pre; overflow-wrap: normal; }
.math-display { display: block; max-width: 100%; margin: 1.8rem 0; padding: 10px 2px; overflow-x: auto; overflow-y: hidden; text-align: center; line-height: 1.8; scrollbar-width: thin; }
.math-display math { min-width: max-content; font-size: 1.1rem; }
[data-tex]:not(.math-display) { max-width: 100%; }
.katex-error { color: #86542c !important; font: .86em/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.step { position: relative; padding: 0 0 28px 49px; border-left: 1px solid var(--rule); margin-left: 15px; }
.step:last-child { border-left-color: transparent; }
.step-number { position: absolute; left: -16px; top: -1px; display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #b3cabe; border-radius: 50%; background: var(--paper); color: var(--teal); font: .69rem/1 var(--mono); }
.step h3, .step > h2 { padding-top: 4px; }
.prose .step > h2 { margin-top: 0; }
.prose .callout > h2:first-child { margin-top: 0; }
.prose .declaration > p { max-width: none; }
.chapter-prevnext { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-top: 29px; margin-top: 45px; border-top: 1px solid var(--rule); }
.chapter-prevnext a { display: block; padding: 13px 0; text-decoration: none; font-size: .85rem; line-height: 1.6; }
.chapter-prevnext a:last-child { text-align: right; }
.chapter-prevnext a small { display: block; margin-bottom: 4px; color: var(--muted); font-size: .63rem; letter-spacing: .08em; text-transform: uppercase; }
.footer { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; border-top: 1px solid var(--rule); padding: 22px 0 3px; margin-top: 50px; color: var(--muted); font-size: .7rem; }
.footer a { color: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 14px; top: 12px; z-index: 100; padding: 10px 16px; transform: translateY(-180%); background: var(--surface); color: var(--teal-dark); border: 2px solid var(--teal); border-radius: 5px; font-size: .84rem; font-weight: 600; text-decoration: none; }
.skip-link:focus { transform: translateY(0); }
#main:focus { outline: none; }
.source-title { font-size: clamp(2rem, 3.4vw, 3.15rem); line-height: 1.2; overflow-wrap: anywhere; }
.content > .actions { margin-bottom: 23px; align-items: center; }
.content > .actions > a:not(.button) { font-size: .81rem; }
.filter-label { display: block; margin: 26px 0 7px; color: var(--ink); font-size: .76rem; font-weight: 600; }
.filter-label + #result-filter { margin-top: 0; margin-bottom: 27px; max-width: 620px; }
.table-wrap { max-width: 100%; margin: 24px 0 34px; overflow-x: auto; border: 1px solid var(--rule); border-radius: 5px; scrollbar-width: thin; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .82rem; line-height: 1.65; text-align: left; }
th { background: #eaf0e5; color: #3d594d; font-weight: 600; text-align: left; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f6f8f0; }
tbody tr:hover { background: #edf3e9; }
td:first-child { min-width: 145px; }
.table-wrap .prose table, .prose .table-wrap table { display: table; margin: 0; }
.table-wrap code { font-size: .9em; }
.paper-correspondence { min-width: 0; max-width: 100%; margin: 24px 0 28px; padding: 21px 23px; border: 1px solid #ccdace; border-left: 3px solid var(--teal); border-radius: 0 6px 6px 0; background: #eef2e8; overflow-wrap: anywhere; }
.paper-correspondence > h2, .prose .paper-correspondence > h2 { margin: 0 0 13px; font: 500 1.45rem/1.35 var(--serif); letter-spacing: -.02em; }
.paper-correspondence p { margin: 0 0 12px; color: #4f645a; font-size: .86rem; line-height: 1.75; }
.paper-correspondence > :last-child { margin-bottom: 0; }
.paper-correspondence a { max-width: 100%; overflow-wrap: anywhere; }
.paper-location-list { display: grid; gap: 9px; margin: 14px 0; padding: 0; list-style: none; }
.paper-location-list > li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 10px; min-width: 0; margin: 0; font-size: .86rem; line-height: 1.6; }
.paper-location-list > li > a { min-width: 0; max-width: 100%; }
.paper-location, .paper-location-list > li > .badge { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 24px; padding: 3px 8px; border: 1px solid #c2d6c9; border-radius: 4px; background: var(--surface); color: var(--teal-dark); font: 600 .7rem/1.45 var(--sans); letter-spacing: .015em; }
.paper-step-location { max-width: 100%; margin: 9px 0 15px; color: var(--muted); font-size: .77rem; line-height: 1.7; overflow-wrap: anywhere; }
.paper-step-location .paper-location { margin: 0 6px 3px 0; vertical-align: baseline; font-size: .65rem; min-height: 21px; }
.paper-step-location a { overflow-wrap: anywhere; }
.paper-guide-table { min-width: 0; max-width: 100%; margin: 24px 0 32px; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); scrollbar-width: thin; scrollbar-color: #9aafa4 transparent; }
.paper-guide-table:focus-visible { outline: 3px solid #b88439; outline-offset: 4px; }
.paper-guide-table table, .prose .paper-guide-table table { display: table; width: 100%; min-width: 620px; margin: 0; border-collapse: collapse; table-layout: fixed; font-size: .82rem; line-height: 1.65; }
.paper-guide-table th, .paper-guide-table td, .prose .paper-guide-table th, .prose .paper-guide-table td { min-width: 0; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--rule); vertical-align: top; white-space: normal; overflow-wrap: anywhere; }
.paper-guide-table th { color: #3d594d; font-size: .75rem; font-weight: 600; }
.paper-guide-table td:first-child { min-width: 0; }
.paper-guide-table tr:last-child td { border-bottom: 0; }
.paper-guide-table td > a { display: inline-block; max-width: 100%; }
.paper-guide-table ul { margin: 0; padding: 0; list-style: none; }
.paper-guide-table li + li { margin-top: 9px; }
.paper-guide-table .paper-location-list { margin: 0; gap: 8px; }
.paper-guide-table .paper-location-list > li { font-size: .8rem; }
.paper-guide-table .paper-location { font-size: .64rem; }
.module-declarations { display: grid; gap: 0; margin: 10px 0 0; }
.module-declarations > a { display: flex; align-items: baseline; gap: 9px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: .8rem; text-decoration: none; min-width: 0; }
.module-declarations > a:hover { color: var(--teal-dark); }
.module-declarations .badge { flex: 0 0 auto; }
.module-declarations code { min-width: 0; overflow-wrap: anywhere; }
details { margin: 21px 0; border: 1px solid var(--rule); border-radius: 5px; padding: 13px 17px; background: var(--surface); }
summary { cursor: pointer; color: var(--teal); font-size: .8rem; font-weight: 550; line-height: 1.6; }
summary::marker { color: #7d9c83; }
details[open] > summary { margin-bottom: 15px; }
.declaration details { padding: 12px 0 0; border: 0; margin: 0; background: transparent; }
.declaration details > summary { margin: 0 18px 13px; }
.declaration details .code-wrap { margin: 0; }
.manuscript-excerpt .code-block { border-radius: 4px; margin-bottom: 16px; }
.manuscript-excerpt > a { font-size: .8rem; }
.toc > .nav-section { margin: 0 0 12px; }
.toc > a + a { margin-top: 8px; }
.main-shell > .footer { display: block; max-width: 1288px; margin: 16px auto 0; padding: 25px clamp(24px, 4vw, 64px) 30px; line-height: 1.85; }
.main-shell > .footer a { display: inline-block; margin-left: 7px; white-space: nowrap; }
@media (max-width: 560px) {
  .main-shell > .footer { padding-inline: 20px; }
  th, td { padding: 10px 12px; }
  .module-declarations > a { display: block; }
  .module-declarations .badge { margin-right: 7px; }
  .step { margin-left: 12px; padding-left: 28px; }
  .step-number { left: -13px; width: 25px; height: 25px; font-size: .62rem; }
  .prose .step > h2 { padding-top: 1px; }
}
@media (min-width: 1600px) { .content { padding-top: 65px; } }
@media (max-width: 1180px) {
  .split-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .toc { position: static; grid-row: 1; max-height: none; padding: 15px 18px; border: 1px solid var(--rule); border-radius: 5px; }
  .toc ul, .toc ol { display: flex; flex-wrap: wrap; gap: 4px 20px; }
  .toc li + li { margin-top: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 18px 22px; }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .stat:nth-child(2n+1) { padding-left: 0; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 10px 0 35px #142b2720; }
  .main-shell { margin-left: 0; }
  .topbar { min-height: 67px; padding: 12px 20px; gap: 15px; }
  .topbar > .small, .topbar > .muted { display: none; }
  #nav-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 41px; }
  .mobile-nav-open .sidebar { transform: translateX(0); }
  .mobile-nav-open::after { content: ""; position: fixed; inset: 0; z-index: 35; background: #152c2850; }
  body.mobile-nav-open { overflow: hidden; }
  .content { padding-top: 36px; }
  .search-wrap { width: min(100%, 390px); }
  .search-results { width: min(560px, calc(100vw - 40px)); }
  h1 { font-size: clamp(2.2rem, 6vw, 3.3rem); }
}
@media (max-width: 560px) {
  .content { padding-inline: 20px; }
  .topbar { padding-inline: 16px; gap: 10px; }
  .hero { margin-bottom: 27px; padding-bottom: 25px; }
  .hero h1 { margin-bottom: 18px; }
  .eyebrow { font-size: .61rem; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .card { padding: 22px; }
  .card-index { margin-bottom: 15px; }
  .lead { font-size: 1rem; }
  .stat-value { font-size: 1.8rem; }
  .stat-label { font-size: .67rem; }
  .section-heading { display: block; }
  .section-heading a { display: inline-block; margin-top: 8px; }
  .prose { font-size: .91rem; }
  .prose h2 { font-size: 1.65rem; }
  .result-card { padding: 19px; }
  .declaration-header { padding: 12px; }
  .code-block, pre { padding: 17px; font-size: .7rem; }
  .source-line { grid-template-columns: 3.2rem minmax(max-content, 1fr); }
  .line-code { padding-inline: 13px; }
  .chapter-prevnext { gap: 20px; }
  .chapter-prevnext a { font-size: .78rem; }
  #result-filter { font-size: 16px; }
  #site-search { padding-right: 12px; font-size: 16px; }
  .search-results { right: 0; width: calc(100vw - 32px); }
  .callout, .notice { padding: 15px 17px; }
  .paper-correspondence { padding: 17px; margin: 20px 0 24px; }
  .paper-correspondence > h2, .prose .paper-correspondence > h2 { font-size: 1.3rem; }
  .paper-correspondence p, .paper-location-list > li { font-size: .82rem; }
  .paper-location-list { gap: 10px; }
  .paper-step-location { font-size: .75rem; }
  .paper-guide-table th, .paper-guide-table td, .prose .paper-guide-table th, .prose .paper-guide-table td { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  body { font-size: 10pt; background: white; color: black; }
  .sidebar, .topbar, .toc, [data-copy-target], .actions, .chapter-prevnext { display: none !important; }
  .main-shell { margin-left: 0; }
  .content { max-width: none; padding: 0; }
  .hero { margin-bottom: 18pt; }
  h1 { font-size: 27pt; }
  h2 { font-size: 19pt; }
  .split-layout { display: block; }
  .card, .declaration, .result-card, .callout, .step { break-inside: avoid; }
  pre, .code-block, .source-lines { background: #f4f4f0; color: black; overflow: visible; white-space: pre-wrap; }
  .source-line { width: 100%; grid-template-columns: 2.5rem minmax(0, 1fr); }
  .line-code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .math-display { overflow: visible; }
  a { color: #184f44; }
  .footer { margin-top: 22pt; }
  .paper-correspondence { break-inside: avoid; background: #f4f6ee; }
  .paper-guide-table { overflow: visible; }
  .paper-guide-table table, .prose .paper-guide-table table { min-width: 0; }
}
