:root {
  color-scheme: light;
  --ink: #202e2b;
  --muted: #64716d;
  --line: #dce3df;
  --paper: #fff;
  --green: #087f72;
  --pink: #b04e75;
  --gold: #a76613;
  color: var(--ink);
  background: #f6f8f6;
  font-family: 'Trebuchet MS', sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background-image: linear-gradient(180deg, #f1f5f2 0, #f9faf8 440px); }
main { flex: 1; }
a { color: var(--green); text-underline-offset: 4px; }
button, input, select { font: inherit; }
button, select, input[type='range'], input[type='checkbox'] { cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #e2b24f; outline-offset: 3px; }
.site-header, main, .site-footer { width: 100%; margin: auto; }
.site-header { position: sticky; top: 0; z-index: 20; min-height: 42px; display: flex; align-items: center; gap: 16px; padding: 6px 16px; border-bottom: 1px solid #c8d4cd; background: #e9efeb; }
.wordmark { font: bold 19px Georgia, serif; text-decoration: none; color: var(--ink); }
.wordmark-dot { color: var(--green); }
.site-header h1 { font: 600 13px 'Trebuchet MS', sans-serif; margin: 0; padding-left: 16px; border-left: 1px solid #bac9bf; }
.header-title { font: 600 13px 'Trebuchet MS', sans-serif; margin: 0; padding-left: 16px; border-left: 1px solid #bac9bf; min-width: 0; }
.reference-link { margin-left: auto; font-size: 12px; }
.page-navigation { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 12px; }
.navigation-menu { position: relative; }
.panel-toggle { border: 0; padding: 5px 20px 5px 6px; color: var(--green); background: transparent; }
.panel-toggle::after { content: ''; position: absolute; right: 5px; top: 50%; width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-70%) rotate(45deg); }
.panel-toggle[aria-expanded='true']::after { transform: translateY(-30%) rotate(225deg); }
.chapter-header-toggle { max-width: min(52vw, 560px); padding-left: 0; color: var(--ink); font-weight: 600; text-align: left; }
.header-title .navigation-panel { right: auto; left: 0; }
.navigation-panel { position: absolute; top: calc(100% + 9px); right: 0; display: grid; grid-template-columns: minmax(0, 1fr); width: min(380px, calc(100vw - 24px)); max-height: min(72vh, 680px); overflow: auto; padding: 14px; border: 1px solid #c8d4cd; border-radius: 7px; background: var(--paper); box-shadow: 0 10px 30px rgb(32 46 43 / 18%); }
.navigation-panel[hidden] { display: none; }
.navigation-panel nav + nav { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
.panel-heading { margin: 0 0 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.panel-part-list, .panel-chapter-list, .chapter-toc ol { list-style: none; margin: 0; padding: 0; }
.panel-part + .panel-part { margin-top: 12px; }
.panel-part-heading { display: flex; gap: 7px; margin: 0 5px 3px; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.35; }
.panel-part-heading > span { flex-shrink: 0; color: var(--green); letter-spacing: 0.05em; text-transform: uppercase; }
.panel-chapter-list a { display: grid; grid-template-columns: 2em 1fr; gap: 6px; padding: 3px 5px; border-radius: 3px; color: var(--ink); text-decoration: none; }
.panel-chapter-list a:hover, .panel-chapter-list a[aria-current='page'] { background: #eaf2ed; color: var(--green); }
.panel-chapter-list a > span { color: var(--muted); font-family: Georgia, serif; font-variant-numeric: tabular-nums; }
.chapter-toc a { display: block; padding: 3px 5px; border-radius: 3px; color: var(--ink); text-decoration: none; line-height: 1.35; }
.chapter-toc a:hover { background: #eaf2ed; color: var(--green); }
.chapter-toc ol ol { margin: 1px 0 4px 13px; font-size: 11px; }
.citation-popover { position: fixed; z-index: 30; width: min(430px, calc(100vw - 24px)); max-height: min(50vh, 360px); overflow: auto; padding: 16px 38px 16px 18px; border: 1px solid #c8d4cd; border-radius: 7px; color: var(--ink); background: var(--paper); box-shadow: 0 10px 30px rgb(32 46 43 / 22%); font: 14px/1.55 Georgia, serif; }
.citation-popover[hidden] { display: none; }
.citation-popover li { list-style: none; margin: 0; }
.citation-popover p { margin: 0; }
.citation-close { position: absolute; top: 5px; right: 7px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 22px; line-height: 1; }
.citation-close:hover { color: var(--ink); background: #eef3f0; }
.site-header h1 { min-width: 0; overflow-wrap: anywhere; }
.lesson-title { display: inline-block; margin-left: 16px; color: var(--muted); font-weight: normal; }
.lesson-title:empty { display: none; }
.wordmark, .page-navigation { flex-shrink: 0; }
.book-contents { max-width: 1120px; padding: 26px 28px 40px; margin: auto; }
.book-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; padding-bottom: 18px; }
.book-title { font: normal 34px/1.1 Georgia, serif; margin: 0; color: var(--ink); }
.book-subtitle { color: var(--muted); font-size: 13px; margin: 0; }
.book-formats { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; margin: 0 0 0 auto; }
.contents-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.contents-heading h2 { font: normal 21px Georgia, serif; margin: 0; }
.contents-heading > span { color: var(--muted); font-size: 12px; }
.contents-parts { columns: 300px 3; column-gap: 40px; }
.contents-part { break-inside: avoid; margin: 0 0 20px; }
.part-heading { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font: 600 11px 'Trebuchet MS', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.part-heading .part-label { color: var(--green); }
.chapter-list { list-style: none; padding: 0; margin: 0; }
.chapter-row { display: grid; grid-template-columns: 1.8em minmax(0, 1fr) auto; gap: 6px; align-items: baseline; padding: 3px 6px; border-radius: 4px; text-decoration: none; color: var(--ink); }
.chapter-number { color: var(--muted); font: 12px Georgia, serif; font-variant-numeric: tabular-nums; }
.chapter-title { font: 15px/1.35 Georgia, serif; overflow-wrap: anywhere; }
.chapter-status { color: var(--muted); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.chapter-link .chapter-title { color: var(--green); }
.chapter-link:hover { background: #eaf2ed; }
.chapter-link:hover .chapter-title { text-decoration: underline; text-underline-offset: 4px; }
.chapter-pagination { display: flex; justify-content: space-between; gap: 24px; padding: 16px 20px; border-top: 1px solid var(--line); font-size: 12px; }
.chapter-pagination a { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.chapter-pagination svg { flex-shrink: 0; }
.sect1 { border-top: 1px solid var(--line); margin-top: 0; padding: 18px 20px; }
.sect1 > h2 { font: 600 15px 'Trebuchet MS', sans-serif; margin: 0 0 16px; }
.sect1 > .sectionbody { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.sect2 h3 { margin: 0 0 10px; font-size: 13px; }
.sect2 p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }
@media (max-width: 640px) {
  .book-contents { padding: 20px 14px 32px; }
  .book-title { font-size: 28px; }
  .book-formats { margin-left: 0; }
  .chapter-row { padding: 5px 4px; }
  .page-navigation { gap: 8px; }
  .site-header { padding-inline: 10px; gap: 10px; }
  .site-header h1 { padding-left: 10px; }
  .header-title { padding-left: 10px; }
  .chapter-header-toggle { max-width: 48vw; }
  .lesson-title { display: block; margin-left: 0; margin-top: 3px; }
  .wordmark { font-size: 17px; }
  .navigation-panel { position: fixed; top: 50px; right: 8px; left: 8px; grid-template-columns: 1fr; width: auto; max-width: none; max-height: calc(100vh - 62px); }
  .navigation-panel nav + nav { margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .sect1 > .sectionbody { grid-template-columns: 1fr; gap: 16px; }
  .site-footer { font-size: 10px; }
}
.site-notice { padding: 5px 16px; border-bottom: 1px solid #ecdcb0; background: #fbf3df; color: #5b4a1c; font-size: 12px; line-height: 1.45; text-align: center; }
.site-notice p { margin: 0; }
.site-notice a { color: #7a5a0c; }
.print-only { display: none; }

@media print {
  :root, body { background: #fff; }
  html body, html body:has(.notebook-frame) { display: block; min-height: 0; height: auto; overflow: visible; background-image: none; }
  html body:has(.notebook-frame) main { display: block; }
  .site-header, .site-footer, .chapter-pagination, .edition-bar, .book-formats, .chapter-links, .notebook-frame, .notebook-links { display: none !important; }
  main :is(input, select, button, canvas, iframe) { display: none !important; }
  main :is([data-calculus], [data-trigonometry], [data-linear-algebra], .foundation-tools, .foundation-topic-picker, .foundation-nav) { display: none !important; }
  .print-only { display: block; }
  .site-notice { border: 1px solid #c8c8c8; background: none; text-align: left; margin-bottom: 12px; }
  .book-edition .site-notice { display: none !important; }
  a { color: inherit; }
  :is(.stemblock, .imageblock, .admonitionblock, .sidebarblock, .exercise, tr, figure, .chapter-opener) { break-inside: avoid; }
  .longform-chapter .listingblock { break-inside: avoid; }
  :is(h1, h2, h3, h4, h5, .title) { break-after: avoid; }
  p { orphans: 3; widows: 3; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .longform-content .stemblock, .longform-content .katex-display { overflow: visible; }
  .longform-chapter, .book-chapter { break-before: page; }
  .title-page, .book-toc { break-after: page; }
  .part-opener { break-before: page; break-after: page; }
}
