:root {
  color-scheme: light;
  --paper: #f8f8f3;
  --card: #fffefa;
  --ink: #162e2a;
  --secondary: #53635c;
  --line: #dce2d8;
  --wash: #edf1e7;
  --deep: #153832;
  --bright: #e4ef97;
  --serif: "Instrument Serif", "Noto Serif SC", "Songti SC", STSong, SimSun, serif;
  --sans: "Instrument Sans", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 1.4rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.65 var(--sans); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
figure, h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #276c58; outline-offset: 4px; }
.shell { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.sr-only, .skip-nav:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-nav:focus { position: absolute; z-index: 5; margin: 10px; padding: 8px 16px; background: var(--card); }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; justify-content: space-between; align-items: center; min-height: 74px; gap: 18px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; font: 750 19px/1.05 var(--sans); letter-spacing: -.035em; }
.wordmark small { display: block; margin-top: 6px; color: var(--secondary); font: 500 11px/1 var(--sans); letter-spacing: .14em; }
.mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--deep); color: var(--bright); font: italic 700 23px/.9 Georgia, serif; }
.masthead nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 38px); font-size: 14px; font-weight: 650; }
.masthead nav a:hover, .text-link:hover, .breadcrumbs a:hover { color: #27705a; }
.masthead nav [aria-current="page"] { color: #225645; text-decoration: underline; text-underline-offset: 5px; }
.nav-search { display: inline-flex; align-items: center; gap: 9px; }
.nav-search span { width: 12px; height: 12px; border: 1.5px solid; border-radius: 50%; position: relative; margin-right: 3px; }
.nav-search span::after { content: ""; width: 5px; height: 1.5px; background: currentColor; position: absolute; right: -4px; bottom: -2px; transform: rotate(48deg); }

.hero { display: grid; grid-template-columns: 1fr minmax(0, .94fr); gap: clamp(30px, 6vw, 82px); align-items: center; padding: 58px 0 55px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #3d5d51; font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.eyebrow > span { width: 8px; height: 8px; border-radius: 50%; background: #648769; flex: 0 0 8px; }
.hero h1 { margin-top: 15px; font: 800 clamp(47px, 5.9vw, 84px)/1.08 var(--serif); letter-spacing: -.075em; }
.hero h1 span { display: block; color: #376453; }
.hero-description { margin: 23px 0; color: var(--secondary); line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 15px 24px; }
.button, .text-link { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; }
.button.primary { border-radius: 7px; padding: 10px 17px; background: var(--deep); color: #f8f9ef; }
.button.primary:hover { background: #265349; }
.button.primary span { color: var(--bright); }
.text-link { padding: 7px 0; }
.text-link span { color: #427461; }

.hero-figure { background: #143831; color: #f3f7e7; border-radius: 15px; padding: 19px clamp(17px, 2.5vw, 30px) 16px; }
.figure-top, .hero-figure figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.figure-top { color: #e0eadc; font-size: 13px; font-weight: 600; }
.figure-top span + span { color: #aabfb1; font: italic 16px Georgia, serif; }
#function-graph { display: block; width: 100%; height: clamp(158px, 22vw, 264px); margin: 7px 0 2px; }
.hero-figure figcaption { border-top: 1px solid #3f5f52; padding-top: 10px; }
.hero-formula { font-size: 19px; color: #e6efad; }
.hero-figure a { color: #e0eadc; font-size: 12px; white-space: nowrap; }
.hero-figure a:hover { color: var(--bright); text-decoration: underline; }
.hero-figure :focus-visible { outline-color: var(--bright); }

.library { border-top: 1px solid var(--line); padding: 31px 0 68px; }
.library-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.library-intro h2 { font: 800 32px/1.23 var(--serif); letter-spacing: -.045em; }
.library-intro p { margin-top: 5px; color: var(--secondary); font-size: 14px; }
.search { display: flex; width: min(100%, 350px); gap: 5px; padding: 4px; background: var(--card); border: 1px solid #cfd9cc; border-radius: 8px; }
.search:focus-within { border-color: #568470; }
.search input { width: 100%; min-width: 0; padding: 6px 8px; border: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search input::placeholder { color: #66766b; }
.search button { border: 0; padding: 4px 13px; border-radius: 5px; background: var(--wash); color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.search button:hover { background: #dde9d8; }
.curriculum { margin-top: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.curriculum summary { padding: 9px 14px; cursor: pointer; color: #295e4d; font-size: 14px; font-weight: 700; }
.curriculum-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); gap: 18px; border-top: 1px solid var(--line); padding: 13px 14px 4px; }
.curriculum h3 { font-size: 16px; }
.curriculum dl, .curriculum dd, .curriculum ul { margin: 0; }
.curriculum dl > div { margin-top: 8px; }
.curriculum dt { color: var(--secondary); font-size: 12px; font-weight: 700; }
.curriculum ul { list-style: none; padding: 0; font-size: 13px; }
.curriculum a { color: #295e4d; text-decoration: underline; text-underline-offset: 2px; }
.curriculum > p { padding: 6px 14px 12px; font-size: 12px; color: var(--secondary); }
.chapter-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 19px; }
.chapter-jumps a, .inline-toc a { padding: 4px 11px; border: 1px solid var(--line); border-radius: 99px; color: #426152; font-size: 13px; }
.chapter-jumps a:hover, .inline-toc a:hover { border-color: #85a290; background: var(--wash); }
.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.chapter-card { background: var(--card); border: 1px solid var(--line); border-radius: 11px; min-width: 0; }
.chapter-card:target { border-color: #65927f; box-shadow: 0 0 0 2px #d9e9da; }
.chapter-card header { padding: 16px 17px 13px; }
.chapter-card h3 { font-size: 19px; line-height: 1.35; font-weight: 750; }
.chapter-card header p { color: var(--secondary); font-size: 13px; margin-top: 5px; }
.chapter-symbol { display: inline-flex; align-items: center; min-width: 40px; min-height: 32px; padding: 2px 7px; margin-bottom: 9px; border-radius: 6px; background: var(--wash); color: #386354; font-size: 15px; }
.chapter-card ul, .side-nav ul, .side-nav ol, .search-results ul { list-style: none; padding: 0; margin: 0; }
.chapter-card li a { position: relative; display: grid; padding: 10px 36px 11px 17px; gap: 2px; border-top: 1px solid var(--line); }
.chapter-card li a:hover { color: #255e4e; background: #f0f5eb; }
.chapter-card li:last-child a { border-radius: 0 0 10px 10px; }
.chapter-card li strong { font-size: 14px; }
.lesson-item-title { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag-advanced, .tag-mastery { display: inline-block; padding: 1px 6px; border-radius: 4px; font: 700 11px/1.45 var(--sans); font-style: normal; vertical-align: middle; }
.tag-advanced { background: #f4ead6; color: #7e4b14; border: 1px solid #e4cfa7; }
.tag-mastery[data-state="done"] { background: #e3f0e5; color: #1f5c43; }
.tag-mastery[data-state="review"] { background: #f9ebe2; color: #8c3d19; }

.quick-terms { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 7px; margin-top: 12px; font-size: 12px; color: var(--secondary); }
.quick-terms button { padding: 2px 9px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: #36574b; font-size: 12px; cursor: pointer; }
.quick-terms button:hover { border-color: #85a290; background: var(--wash); color: var(--ink); }

.study-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 16px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.study-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.study-filters button { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: #3e5b4e; font-size: 13px; font-weight: 650; cursor: pointer; }
.study-filters button:hover { background: var(--wash); }
.study-filters button.is-active { border-color: var(--deep); background: var(--deep); color: #f6f8ed; }
.study-filters button em { font-style: normal; margin-left: 3px; opacity: .82; }
.study-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--secondary); }
.progress-track { width: 96px; height: 7px; border-radius: 99px; background: var(--wash); overflow: hidden; }
.progress-track b { display: block; height: 100%; width: 0; background: #2d6f59; border-radius: 99px; transition: width .2s ease; }

.bookmark-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.text-button { border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; background: var(--wash); color: #2b5949; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.text-button:hover { background: #dde9d8; }
.bookmark-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bookmark-row a { flex: 1; min-width: 0; }
.bookmark-remove { border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px; background: var(--card); color: var(--secondary); font-size: 12px; cursor: pointer; white-space: nowrap; }
.bookmark-remove:hover { background: #f8ebe6; color: #8c3d19; border-color: #ddb8a9; }
.filter-empty, .formula-empty { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--secondary); font-size: 14px; }
.chapter-card li span { color: var(--secondary); font-size: 12px; }
.chapter-card li b { position: absolute; right: 15px; top: 10px; color: #4f7563; font-weight: 500; }

.search-results { margin-top: 15px; padding: 14px 16px; border: 1px solid #cddbcf; border-radius: 9px; background: var(--card); }
.search-results h3 { font-size: 16px; }
.search-results p { font-size: 13px; color: var(--secondary); margin: 2px 0 4px; }
.search-results li + li { border-top: 1px solid var(--line); }
.search-results li a { display: grid; padding: 7px 6px; border-radius: 4px; }
.search-results li a:hover { background: var(--wash); }
.search-results li small { color: var(--secondary); }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 21px 0; color: var(--secondary); font-size: 13px; }
.reading-layout { display: grid; grid-template-columns: minmax(170px, 205px) minmax(0, 780px); gap: clamp(22px, 7vw, 90px); padding-bottom: 68px; }
.lesson-aside { position: sticky; top: 20px; align-self: start; margin-top: 8px; }
.side-nav { margin-bottom: 18px; }
.side-nav h2 { margin-bottom: 7px; font-size: 13px; color: var(--secondary); }
.side-nav a { display: block; padding: 6px 9px; border-radius: 5px; font-size: 13px; }
.side-nav a[aria-current], .side-nav a:hover, .page-toc a.is-active { background: var(--wash); color: #225645; }
.side-nav a[aria-current], .page-toc a.is-active { font-weight: 700; }
.page-toc { border-top: 1px solid var(--line); padding-top: 14px; }
.page-toc a { padding-left: 8px; }
.lesson-header { border-bottom: 1px solid var(--line); padding: 8px 0 20px; }
.lesson-header h1 { margin: 9px 0 10px; font: 800 clamp(32px, 4.4vw, 59px)/1.2 var(--serif); letter-spacing: -.055em; }
.lesson-header > p:last-of-type { color: var(--secondary); }
.lesson-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 14px; }
.mastery-group { display: flex; flex-wrap: wrap; gap: 7px; }
.tool-chip { padding: 5px 11px; border: 1px solid #c9d8ca; border-radius: 99px; background: var(--card); color: #295a4a; font-size: 13px; font-weight: 650; cursor: pointer; }
.tool-chip:hover { background: var(--wash); }
.tool-chip.is-active[data-mastery="done"] { border-color: #215e46; background: #215e46; color: #f6f8ed; }
.tool-chip.is-active[data-mastery="review"] { border-color: #9b5122; background: #9b5122; color: #fffaf5; }
.mobile-chapter-nav { display: none; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.mobile-chapter-nav summary { padding: 8px 12px; color: #295e4d; font-size: 13px; font-weight: 700; cursor: pointer; }
.mobile-chapter-nav ul { list-style: none; margin: 0; padding: 4px 8px 8px; border-top: 1px solid var(--line); }
.mobile-chapter-nav a { display: block; padding: 5px 8px; border-radius: 5px; font-size: 13px; }
.mobile-chapter-nav a[aria-current] { background: var(--wash); color: #225645; font-weight: 700; }
.inline-toc { display: none; }
.inline-toc ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.inline-toc a { display: block; }
.lesson-section { padding: 21px 0; }
.lesson-section + .lesson-section { border-top: 1px solid var(--line); }
.lesson-section h2 { font: 800 26px/1.28 var(--serif); }
.lesson-section h3 { margin: 16px 0 4px; font-size: 17px; }
.lesson-section p { margin-top: 9px; }
.lesson-section ul, .lesson-section ol { margin: 9px 0; padding-left: 1.45em; }
.lesson-section li { padding-block: 2px; }
.lesson-section li p { margin: 0; }
.lesson-section blockquote { background: var(--wash); margin: 12px 0; padding: 8px 14px; border-left: 3px solid #789d86; border-radius: 2px 5px 5px 2px; }
.lesson-section blockquote p { margin: 0; }
.derivation-figure { max-width: 640px; margin: 14px auto; border: 1px solid var(--line); border-radius: 9px; background: var(--card); overflow: hidden; }
.derivation-figure img { display: block; width: 100%; height: auto; }
.derivation-figure figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 13px; flex-wrap: wrap; padding: 9px 12px; border-top: 1px solid var(--line); color: var(--secondary); font-size: 13px; }
.derivation-figure figcaption span { flex: 1 1 200px; }
.derivation-figure figcaption a { color: #295e4d; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.math-lab { min-width: 0; margin: 17px 0; padding: 14px; border: 1px solid #d3dfd1; border-radius: 9px; background: var(--card); }
.math-lab h3 { margin: 0 0 5px; }
.math-lab-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); align-items: end; gap: 10px 16px; margin: 12px 0; }
.math-lab-control { display: grid; min-width: 0; gap: 4px; }
.math-lab-control label, .math-lab label.math-lab-control { font-size: 13px; color: var(--ink); font-weight: 700; }
.math-lab input[type="range"] { width: 100%; min-width: 0; min-height: 28px; margin: 0; accent-color: #286850; cursor: pointer; }
.math-lab input[type="checkbox"] { accent-color: #286850; }
.math-lab select, .math-lab button { min-height: 35px; padding: 4px 8px; border: 1px solid #c6d5c8; border-radius: 6px; color: #245645; background: var(--card); font: inherit; font-size: 13px; }
.math-lab button { cursor: pointer; }
.math-lab button:hover { background: var(--wash); }
.math-lab-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.math-lab-plot { display: block; min-width: 0; max-width: 100%; }
.math-lab canvas.math-lab-plot { width: 100%; height: auto; }
.math-lab canvas[data-amgm-plot] { aspect-ratio: 2.2; min-height: 145px; max-height: 290px; }
.math-lab-output { margin-top: 10px; padding: 8px 10px; border-radius: 6px; background: var(--wash); color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.math-lab-output p:first-child { margin-top: 0; }
.math-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; color: #173b31; background: #eef3e9; padding: 5px 13px; margin: 12px 0; border-radius: 7px; }
.math-display .katex-display { margin: .45em 0 .55em; min-width: max-content; }
.math-inline { display: inline; }
.lesson-section .katex { font-size: 1.08em; }
.lesson-table-scroll { max-width: 100%; overflow-x: auto; }
.lesson-section table { max-width: 100%; margin: 12px 0; border-collapse: collapse; }
.lesson-section th, .lesson-section td { border: 1px solid var(--line); padding: 4px 10px; text-align: left; }
.lesson-section th { background: var(--wash); }
.problem { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 14px; margin-top: 12px; }
.problem-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.problem h3 { margin: 0; }
.bookmark-toggle { flex: 0 0 auto; padding: 2px 9px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); color: var(--secondary); font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.bookmark-toggle:hover { border-color: #85a290; color: var(--ink); background: var(--wash); }
.bookmark-toggle.is-bookmarked { border-color: #c88d48; background: #fbf1de; color: #7e4b14; }
.problem details { margin-top: 11px; border-top: 1px solid var(--line); }

.formula-hub { padding-bottom: 68px; }
.formula-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 18px; }
.formula-search { width: min(100%, 420px); }
.formula-count { color: var(--secondary); font-size: 13px; }
.formula-chapter { margin-top: 26px; }
.formula-chapter-title { font: 800 25px/1.28 var(--serif); padding-bottom: 8px; border-bottom: 2px solid #2b6150; margin-bottom: 12px; }
.formula-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.formula-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.formula-card-head h3 { font-size: 16px; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.formula-card-head h3 a:hover { color: #27705a; text-decoration: underline; text-underline-offset: 3px; }
.formula-card-body { padding: 8px 0 0; }
.formula-card-body > :first-child { margin-top: 0; }

.back-to-top { position: fixed; right: 20px; bottom: 22px; z-index: 4; padding: 7px 12px; border: 1px solid #b6c8bc; border-radius: 99px; background: var(--card); color: var(--deep); font-size: 13px; font-weight: 700; box-shadow: 0 3px 10px rgba(21, 56, 50, .12); cursor: pointer; }
.back-to-top:hover { background: var(--wash); }
.problem summary { cursor: pointer; padding: 8px 0 2px; color: #295e4d; font-size: 14px; font-weight: 700; }
.problem summary span { margin-left: 4px; }
.solution { padding: 0 0 3px; }
.practice-hub { padding-block: 24px 68px; }
.practice-hub .chapter-card h2 { font: 800 21px/1.3 var(--serif); }
.practice-hub .chapter-card li a { font-size: 14px; }
.chapter-card .practice-quiz a { background: var(--wash); color: #225645; }
.chapter-card .practice-quiz a:hover { background: #e1ebdc; }
.worksheet { max-width: 760px; margin-inline: auto; padding-bottom: 52px; }
.worksheet-summary { color: var(--secondary); }
.worksheet-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 13px; }
.worksheet-actions button { border: 0; cursor: pointer; }
.worksheet-actions small { color: var(--secondary); }
.assessment-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.assessment-timer, .assessment-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.assessment-clock { min-width: 5.2ch; font: 750 19px/1.2 var(--sans); font-variant-numeric: tabular-nums; color: var(--deep); }
.assessment-timer-msg, .assessment-score-total { color: var(--secondary); font-size: 13px; }
.problem-score { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--secondary); }
.problem-score-label { font-weight: 650; }
.score-chip { padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); color: #36574b; font-size: 12px; font-weight: 650; cursor: pointer; }
.score-chip:hover { border-color: #85a290; background: var(--wash); }
.score-chip.is-active { border-color: var(--deep); background: var(--deep); color: #f6f8ed; }
.score-input { width: 4.5em; padding: 2px 6px; border: 1px solid #c6d5c8; border-radius: 5px; background: var(--paper); color: var(--ink); font-size: 13px; text-align: center; }
.worksheet .problem:first-child { margin-top: 0; }
.classroom-grid { margin-top: 20px; }
.classroom-grid .chapter-card h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.classroom-shell { max-width: 1020px; padding-bottom: 44px; }
.classroom-page .masthead, .classroom-page .footer { display: none; }
.classroom .lesson-section { font-size: clamp(17px, 2.2vw, 23px); }
.classroom .classroom-question { padding-inline: clamp(12px, 3vw, 26px); background: var(--card); border: 1px solid var(--line); border-radius: 9px; margin-top: 15px; }
.classroom-link a { padding-block: 3px; color: #295e4d; }
.classroom-actions { position: sticky; z-index: 2; top: 0; display: flex; gap: 10px; flex-wrap: wrap; padding-block: 8px 12px; background: var(--paper); }
.classroom-actions button { min-height: 42px; border: 0; cursor: pointer; }
.classroom-actions button:disabled { cursor: default; opacity: .65; }
.classroom-reset { padding: 8px 14px; border-radius: 7px; color: var(--deep); background: var(--wash); }
.classroom-step { margin-top: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); scroll-margin-top: 58px; }
.classroom-step > summary { padding: 10px 15px; color: #225645; font-size: 17px; font-weight: 750; cursor: pointer; }
.classroom-step[open] > summary { background: var(--wash); border-radius: 7px 7px 0 0; }
.classroom-step-body { padding: 2px clamp(12px, 3vw, 22px) 16px; }
.sequence { border-top: 1px solid var(--line); padding-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sequence a { display: grid; gap: 3px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; }
.sequence a:hover { background: var(--wash); }
.sequence span { color: var(--secondary); font-size: 12px; }
.sequence strong { font-size: 14px; }
.footer { border-top: 1px solid var(--line); color: var(--secondary); font-size: 13px; }
.footer .shell { display: flex; justify-content: space-between; gap: 12px; padding-block: 19px; }
.footer a:hover { text-decoration: underline; }
.footer b { color: #427461; font-weight: 400; }
.not-found { max-width: 720px; padding-block: clamp(44px, 8vw, 92px); }
.not-found h1 { margin: 12px 0 14px; font: 800 clamp(34px, 5vw, 56px)/1.18 var(--serif); letter-spacing: -.045em; }
.not-found > p:not(.eyebrow) { color: var(--secondary); line-height: 1.85; }
.not-found-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 24px; }

@media (max-width: 960px) {
  .shell { width: min(1160px, calc(100% - 52px)); }
  .hero { gap: 28px; padding-block: 44px; }
  .hero h1 { font-size: clamp(44px, 6.6vw, 68px); }
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 690px) {
  .shell { width: calc(100% - 32px); }
  .masthead-inner { min-height: 61px; }
  .wordmark { font-size: 16px; gap: 8px; }
  .wordmark small { font-size: 9px; }
  .mark { width: 33px; height: 33px; border-radius: 7px; font-size: 20px; }
  .masthead nav { gap: 12px; font-size: 13px; }
  .nav-search span { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 28px 0 25px; gap: 22px; }
  .hero h1 { font-size: clamp(42px, 8.9vw, 58px); margin-top: 10px; }
  .hero-description { margin: 14px 0; font-size: 15px; }
  .hero-actions { gap: 10px 17px; }
  .desktop-break { display: none; }
  .hero-figure { padding: 12px 14px 11px; border-radius: 10px; }
  #function-graph { height: 155px; }
  .library { padding: 22px 0 45px; }
  .library-intro { align-items: stretch; flex-direction: column; gap: 10px; }
  .library-intro h2 { font-size: 28px; }
  .search { width: 100%; }
  .search input { font-size: 16px; }
  .chapter-jumps { gap: 6px; margin: 12px 0 14px; }
  .chapter-jumps a { padding: 3px 8px; }
  .chapter-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .breadcrumbs { margin: 14px 0; }
  .reading-layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 36px; }
  .lesson-aside { display: none; }
  .mobile-chapter-nav { display: block; }
  .inline-toc { display: block; margin-top: 12px; }
  .math-display { padding-inline: 7px; }
  .back-to-top { right: 12px; bottom: 14px; }
}

@media print {
  body { background: white; color: black; }
  .masthead, .footer, .lesson-aside, .inline-toc, .mobile-chapter-nav, .lesson-toolbar, .bookmark-toggle, .back-to-top, .formula-toolbar, .chapter-jumps, .sequence, .breadcrumbs, .skip-nav { display: none !important; }
  .shell { width: 100%; }
  .reading-layout { display: block; padding: 0; }
  .problem, .formula-card { break-inside: avoid; }
  .derivation-figure { break-inside: avoid; }
  .derivation-figure a { display: none; }
  .math-lab { break-inside: avoid; }
  .math-lab-controls { display: none; }
  .worksheet-actions, .assessment-tools, .problem-score, .worksheet .problem details, .worksheet-link, .classroom-actions, .classroom-link { display: none; }
  .worksheet { max-width: none; padding-bottom: 0; font-size: 11pt; }
  .worksheet .lesson-header { padding: 0 0 12pt; }
  .worksheet h1 { font-size: 20pt; }
  .worksheet .lesson-section { padding-block: 6pt; }
  .worksheet .problem { background: white; border: 0; border-radius: 0; padding: 10pt 0; }
  .worksheet .problem h3 { font-size: 12pt; }
}

@media (max-width: 520px) {
  .masthead-inner { flex-wrap: wrap; padding-block: 9px; gap: 8px 12px; }
  .masthead nav { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 6px 12px; font-size: 12.5px; }
  .masthead nav a { white-space: nowrap; }
}
