/* Shared book typography. Load after every page-specific stylesheet. */
:root {
  --reading-serif: Georgia, 'Times New Roman', serif;
  --reading-sans: 'Segoe UI', Arial, sans-serif;
  --reading-mono: Consolas, 'Cascadia Mono', monospace;
  --ink: #283039;
  --muted: #52606c;
  --line: #d8dee2;
  --wash: #f6f7f7;
  --table-head: #f1f4f5;
  --table-stripe: #fafbfb;
  font-size: 18px;
}
body {
  background: #fff;
  color: var(--ink);
  font: 1.0556rem/1.72 var(--reading-serif);
}
/* A text column may be narrower than a figure or a data table. */
body main#main:is(.book-main, .home-main, .course-utility, .laboratory-main, .study-page, .study-index) {
  width: 100%;
  max-width: 940px;
  min-width: 0;
  margin-inline: auto;
  padding: 42px 48px 80px;
  background: #fff;
  box-shadow: none;
  overflow-wrap: break-word;
  hyphens: auto;
}
body main#main.micro-reference { max-width: 1320px; }
body main#main :is(p, ul, ol, dl) { max-width: 64ch; }
body main#main p { margin: 0 0 1em; }
body main#main :is(ul, ol) { margin-block: 1em 1.4em; padding-left: 1.5em; }
body main#main li { margin-block: .45em; }
body main#main li > :is(ul, ol) { margin-block: .4em .7em; }
body main#main li > p:last-child { margin-bottom: 0; }
body main#main :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--reading-serif);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: normal;
  text-wrap: pretty;
  overflow-wrap: break-word;
  hyphens: none;
  break-after: avoid;
}
body main#main h1, body .home-main .textbook-title h1 {
  font-size: clamp(1.75rem, 3.1vw, 2.25rem);
  line-height: 1.24;
  margin: .2em 0 .8em;
  max-width: 32ch;
  text-wrap: balance;
}
body main#main h2 {
  font-size: 1.5rem;
  line-height: 1.35;
  margin: 2.2em 0 .8em;
  padding-bottom: .35em;
  border-bottom: 1px solid var(--line);
}
body main#main h3 { font-size: 1.18rem; line-height: 1.4; margin: 1.7em 0 .65em; }
body main#main h4 { font-size: 1.0556rem; line-height: 1.45; margin: 1.5em 0 .6em; }
body main#main :is(h5, h6) { font-size: 1rem; line-height: 1.5; margin: 1.3em 0 .6em; }
body main#main :is(h2, h3, h4) + :is(h3, h4, h5) { margin-top: 1em; }
body main#main .lead { font-size: 1.0556rem; line-height: 1.72; max-width: 64ch; color: var(--ink); }
body main#main :is(.note, .result, .applicability, .engineering-notice, .manual-math-context) {
  font-size: 1rem;
  line-height: 1.7;
  margin-block: 1.3em;
  padding: 16px 20px;
  border-radius: 0;
}
body main#main :is(.note, .result, .applicability, .engineering-notice, .manual-math-context) p:last-child { margin-bottom: 0; }
body main#main :is(.note, .result, .applicability) { max-width: 64ch; }
body main#main.course-utility article {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 24px 0 0;
  margin-block: 28px;
  box-shadow: none;
}
body main#main article > :is(h2, h3):first-child { margin-top: 0; }
body main#main :is(.micro-finder, .course-search, .reference-toolbar) h2 {
  font-size: 1.18rem;
  margin: 0 0 .7em;
  border: 0;
  padding: 0;
}
body main#main :is(.micro-chapter, .engineering-panel, .widget, .mini-lab) > :is(h2, h3) { margin-top: .25em; }
/* Catalog entries keep a subordinate heading scale. */
body main#main :is(.example-card, .benchmark-grid, .micro-module-card) h2 { font-size: 1.18rem; margin-top: 0; border: 0; }
body main#main :is(.book-module, .reference-item, .femm-reference-card, .micro-module-card) :is(p, li) { font-size: 1rem; line-height: 1.65; }
body main#main .book-module h3 { font-size: 1.1rem; }
body main#main .book-module { padding-inline: 0; }
body main#main .book-module ol { max-width: none; padding: 0; margin-block: 1em; }
body main#main .textbook-parts { max-width: none; padding: 0; }
body main#main .part-heading h2 { margin-top: 1.5em; }
body main#main .part-heading p { font-size: 1rem; }
/* Navigation and controls have a compact, consistent screen typeface. */
.book-header, .book-nav, .micro-toc, button, input, select, textarea,
main nav, .code-toolbar, .eyebrow, .course-breadcrumb, .lesson-footer,
.book-foot, .table-scroll-status, .math-scroll-hint, .engineering-controls,
.widget-controls, .widget-stats, .engineering-stats, .opt-stats,
.field-legend, .lab-sweep-controls {
  font-family: var(--reading-sans);
}
.book-nav { line-height: 1.55; background: #f7f8f8; }
body main#main :is(button, input, select, textarea) { font-family: var(--reading-sans); font-size: .9rem; }
.book-nav :is(h2, h3) { font-family: var(--reading-sans); }
.book-nav a { font-size: .85rem; line-height: 1.55; hyphens: none; }
body main#main .micro-toc h2 { font: 600 1rem/1.45 var(--reading-sans); margin-top: 0; }
body main#main .eyebrow { font-size: .78rem; line-height: 1.5; letter-spacing: .035em; margin-bottom: 1em; }
body main#main :is(.source-note, .reading-details, .references, .manual-figure-source, .manual-caption-note, .manual-table-notes) {
  font-size: .9rem;
  line-height: 1.6;
  color: var(--muted);
}
body main#main :is(.author-bibliography, .bibliography-list) { font-size: 1rem; line-height: 1.7; }
body main#main :is(.author-bibliography, .bibliography-list) li { margin-block: .75em; }
body main#main .book-foot { font-size: .78rem; line-height: 1.6; margin-top: 3rem; }
/* Equations keep their natural size. Only a long expression scrolls. */
body main#main .formula {
  margin: 1.5em 0;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-width: 0;
}
body main#main .formula:target { background: #fffaf0; }
body main#main .equation-row { gap: 16px; align-items: center; }
body main#main .math { min-width: 0; max-width: 100%; padding-block: 8px; }
body main#main .formula .katex { font-size: 1.08em; }
body main#main .formula-number { font: .9rem/1.5 var(--reading-serif); white-space: nowrap; }
body main#main .formula figcaption { padding: 8px 0 0; margin: 0; }
.katex, pre, code { hyphens: none; }
/* The same caption style serves native figures, diagrams and charts. */
body main#main figure { max-width: 100%; min-width: 0; margin: 1.6em 0; }
body main#main figure img { max-width: 100%; height: auto; }
body main#main figcaption, body main#main .mini-lab .lab-live-layout .lab-main-chart figcaption,
body main#main .native-series .plot-caption {
  font: .9rem/1.6 var(--reading-serif);
  color: var(--muted);
  text-align: left;
  margin: .65em 0 0;
  padding: 0;
  max-width: 80ch;
}
body main#main figcaption p { font: inherit; margin-bottom: .55em; }
body main#main figcaption p:last-child { margin-bottom: 0; }
body main#main .manual-figure { padding-block: 0 20px; }
body main#main .mini-lab figure { margin: 0; }
/* Tabular numbers and restrained rules; preserve the existing scroll wrapper. */
body main#main table {
  font: .9rem/1.55 var(--reading-sans);
  font-variant-numeric: lining-nums tabular-nums;
}
body main#main :is(.table-wrap, .engineering-table) { margin-block: 1.4em 1.2em; }
body main#main :is(.table-wrap, .engineering-table) > table { font-size: .9rem; }
body main#main :is(.table-wrap, .engineering-table) > table :is(th, td) { padding: 10px 14px; line-height: 1.55; }
body main#main table > caption {
  font: .9rem/1.6 var(--reading-serif);
  text-align: left;
  color: var(--ink);
  padding-bottom: .7em;
}
body main#main table :is(p, li) { font-size: inherit; }
body main#main :is(pre, code, kbd, samp) { font-family: var(--reading-mono); }
body main#main :is(pre, .code-block pre, .micro-signature) { font-size: .82rem; line-height: 1.65; tab-size: 4; }
body main#main :not(pre) > code { font-size: .88em; }
body main#main pre code { font-size: inherit; }
body main#main .code-block { margin-block: 1.4em; border-radius: 0; }
body main#main .code-toolbar { font-size: .78rem; }
body main#main :is(.formula-index, .notation-guide) { margin-block: 1.2em; }
body main#main .formula-index { background: none; border: 0; border-block: 1px solid var(--line); padding: 12px 0; }
body main#main .formula-index :is(ol, ul) { font-size: .9rem; }
@media (max-width: 1100px) {
  body main#main:is(.book-main, .home-main, .course-utility, .laboratory-main, .study-page, .study-index) { padding-inline: 30px; }
}
@media (max-width: 780px) {
  :root { font-size: 17px; }
  body { font-size: 1.0588rem; line-height: 1.68; }
  body main#main:is(.book-main, .home-main, .course-utility, .laboratory-main, .study-page, .study-index) { padding: 28px 20px 60px; }
  body main#main h1, body .home-main .textbook-title h1 { font-size: 1.75rem; }
  body main#main h2 { font-size: 1.4rem; margin-top: 1.8em; }
  body main#main h3 { font-size: 1.15rem; }
  body main#main :is(h1, h2, h3, h4, h5, h6) { hyphens: auto; }
  body main#main :is(.note, .result, .applicability, .engineering-notice, .manual-math-context) { padding: 13px 15px; }
  body main#main .equation-row { gap: 10px; }
  body main#main .formula-number { font-size: .85rem; }
  body main#main :is(.table-wrap, .engineering-table) > table :is(th, td) { padding: 9px 11px; }
  body main#main .micro-toc { font-size: .9rem; }
  body main#main :is(.lab-tabs, .reference-tabs) { font-size: .9rem; }
}
@media (max-width: 380px) {
  body main#main:is(.book-main, .home-main, .course-utility, .laboratory-main, .study-page, .study-index) { padding-inline: 16px; }
  body main#main h1, body .home-main .textbook-title h1 { font-size: 1.6rem; }
}
@media print {
  :root { font-size: 11pt; }
  body { font-size: 11pt; line-height: 1.5; color: #000; }
  body main#main:is(.book-main, .home-main, .course-utility, .laboratory-main, .study-page, .study-index) { max-width: none; padding: 0; }
  body main#main :is(p, ul, ol, dl, h1) { max-width: none; }
  body main#main h1, body .home-main .textbook-title h1 { font-size: 22pt; }
  body main#main h2 { font-size: 16pt; }
  body main#main h3 { font-size: 13pt; }
  body main#main :is(figcaption, table > caption) { font-size: 10pt; color: #222; }
  body main#main :is(table, .table-wrap > table, .engineering-table > table) { font-size: 9pt; }
  body main#main :is(pre, .code-block pre) { font-size: 8pt; white-space: pre-wrap; overflow-wrap: anywhere; }
  body main#main :is(p, li) { orphans: 3; widows: 3; }
  body main#main :is(figure, tr) { break-inside: avoid; }
  body main#main thead { display: table-header-group; }
}
