:root {
  color-scheme: light;
  --bg: #faf9f6;
  --surface: #fff;
  --soft: #f0edf6;
  --ink: #211c2b;
  --muted: #61596c;
  --line: #dfdae5;
  --accent: #59419c;
  --on-accent: #fff;
  --body: 'Golos Text', 'Segoe UI', sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
}
.hero .approved-jacket {
  aspect-ratio:2/3;
  padding:0;
  border:0;
  background:none;
}
.approved-jacket img { display:block; width:100%; height:auto; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #18161d;
  --surface: #211e29;
  --soft: #2d2540;
  --ink: #f1edf6;
  --muted: #c1b6cd;
  --line: #453b50;
  --accent: #c5b0fc;
  --on-accent: #241742;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.62 var(--body); }
a { color: var(--accent); text-decoration: none; text-underline-offset: .22em; }
a:hover, a:focus-visible { text-decoration: underline; }
button, input, select, textarea { color: inherit; font: inherit; }
button, summary { cursor: pointer; }
button, .button { border: 1px solid var(--line); background: var(--surface); padding: calc(.46rem + 1px) .8rem calc(.46rem - 1px); border-radius: .45rem; }
.skip-link { position: absolute; inset: .5rem auto auto .5rem; translate: 0 -200%; z-index: 2; background: var(--surface); padding: .5rem; }
.skip-link:focus { translate: 0; }
.site-header { position: sticky; top: 0; z-index: 1; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner, #reading, .site-footer { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }
.header-inner, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: .7rem 1.3rem; flex-wrap: wrap; }
.header-inner { display: grid; grid-template-columns: auto minmax(0,1fr) auto; min-height: 67px; padding-block: .65rem; }
.header-inner nav { display: flex; align-items: center; justify-content: flex-end; gap: .8rem; flex-wrap: wrap; font-size: .88rem; }
.header-inner nav a { padding-block: .28em; }
.header-tools { display: flex; gap: .45rem; align-items: center; font-size: .88rem; }
.tool-row button { padding-block: calc(.46rem + .25px) calc(.46rem - .25px); }
.header-tools button { padding-block: calc(.46rem + .7px) calc(.46rem - .7px); }
.chapter-aside .tool-row button { padding-block: calc(.46rem + .5px) calc(.46rem - .5px); }
.compact-label { display: none; }
.brand { color: var(--ink); font-weight: 700; text-decoration: none; }
.brand span { margin-inline-start: .6rem; color: var(--muted); font-size: .87em; font-weight: 400; }
#reading { margin-block: 0 clamp(3rem, 8vw, 6rem); min-height: 70vh; }
.site-footer { padding-block: 1rem 1.6rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .9rem; }
h1, h2, h3 { margin: 0; line-height: 1.14; }
:is(h1,h2,h3)[tabindex="-1"]:focus { outline: none; }
h1, h2 { font-family: var(--serif); }
h1 { font-size: clamp(2.55rem, 7vw, 5.6rem); letter-spacing: -.045em; font-weight: 500; overflow-wrap: break-word; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 500; }
h3 { font-size: 1rem; }
p, ul, ol { margin-block: .7em; }
ul, ol { padding-inline-start: 1.5em; }
li + li { margin-block-start: .35em; }
.eyebrow { color: var(--accent); font-size: .79rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero .chemical-figure { align-self: stretch; background: var(--soft); border: 0; padding: 1.5rem; color: var(--accent); }
.hero .chemical-figure svg { min-width: min(100%, 9rem); }
.contents { padding-block-start: 2rem; }
.contents-intro { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-block-end: 1.2rem; }
.contents-intro p { color: var(--muted); margin-block-end: 0; }
.search { width: min(100%, 24rem); }
.search label { display: block; font-size: .88rem; font-weight: 700; }
.search input { width: 100%; margin-block-start: .35rem; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--surface); }
.toc-controls { display:flex; align-items:end; flex-wrap:wrap; gap:.65rem 1rem; margin-bottom:.9rem; }
.toc-controls .search { flex:1 1 min(100%,20rem); }
.toc-control { display:grid; gap:.35rem; font-size:.88rem; font-weight:650; }
.toc-filter { display:flex; align-items:center; gap:.35rem; min-height:2.7rem; font-size:.9rem; }
.toc-entries { display:grid; gap:.45rem; }
.part { margin:0; background:var(--surface); border:1px solid var(--line); border-radius:.5rem; padding-inline:.85rem; min-width:0; }
.part > summary { display:grid; grid-template-columns:.8rem minmax(0,1fr); align-items:start; gap:.5rem; }
.part > summary::before { content:''; width:0; height:0; margin-top:.52em; border:.28em solid transparent; border-left:.42em solid currentColor; border-right:0; }
.part[open] > summary::before { transform:rotate(90deg); }
.toc-chapter { margin:0; border:0; border-radius:0; padding:0; }
.toc-chapter + .toc-chapter { border-top:1px solid var(--line); }
.toc-chapter summary, .toc-chapter[open] > summary { display:grid; grid-template-columns:.8rem 2.2ch minmax(0,1fr); align-items:baseline; gap:.5rem; border:0; min-width:0; font-weight:400; }
.toc-chapter summary::before { content:''; width:.42rem; height:.42rem; border-right:1px solid var(--muted); border-bottom:1px solid var(--muted); transform:rotate(-45deg); align-self:start; margin-top:.55em; }
.toc-chapter[open] > summary::before { transform:rotate(45deg); }
.toc-chapter ul { margin:.15rem 0 .65rem 2rem; padding-inline-start:1rem; font-size:.91em; }
.toc-title { min-width:0; overflow-wrap:anywhere; }
.toc-title [aria-current] { font-weight:700; }
.toc-sequence { border:1px solid var(--line); background:var(--surface); border-radius:.5rem; padding-inline:.85rem; }
.neutral-lock { position:relative; display:inline-block; width:.65em; height:.49em; border:1px solid currentColor; border-radius:.08em; margin-inline-start:.55em; color:var(--muted); vertical-align:.08em; }
.neutral-lock::before { position:absolute; content:''; width:.38em; height:.34em; border:1px solid currentColor; border-bottom:0; border-radius:.25em .25em 0 0; bottom:100%; left:50%; transform:translateX(-50%); }
.gift-mark { font-size:.78em; color:var(--muted); margin-inline-start:.55em; }
.gift-card { margin-block:.8rem 1rem; background:var(--soft); }
.gift-card ul { columns:2; }
.gift-card li { break-inside:avoid; }
.chapter-number { min-width: 2ch; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85em; }
.pending { color: var(--muted); }
.chapter { display:grid; grid-template-columns:minmax(0,1fr); grid-template-areas:'tools' 'toc' 'aside' 'head' 'content'; }
.chapter-tools { grid-area:tools; position:sticky; top:var(--masthead-height,67px); z-index:1; padding-block:.45rem; border-bottom:1px solid var(--line); background:var(--bg); font-size:.9rem; }
.chapter-tools button { padding-block:calc(.46rem + .5px) calc(.46rem - .5px); }
.chapter-toc { grid-area:toc; }
.chapter-toc,.chapter-aside { min-width:0; align-self:start; }
.chapter-toc { background:var(--surface); border:1px solid var(--line); border-radius:.5rem; padding:.8rem; margin-block-start:.85rem; }
.chapter-toc .minor-title { margin-bottom:.6rem; }
.chapter-toc .toc-entries { gap:.3rem; }
.chapter-toc .part { padding-inline:.45rem; }
.chapter-toc .part > summary { font-size:.87em; gap:.3rem; }
.chapter-toc .toc-chapter { font-size:.85em; }
.chapter-toc .toc-chapter summary { gap:.3rem; }
.chapter-toc .toc-chapter summary::before { margin-top:.48em; }
.chapter-toc .contains-current { border-color:var(--accent); }
.chapter-head { grid-area: head; padding-block: clamp(1.8rem, 4vw, 3.7rem) 1.5rem; }
.chapter-head h1 { max-width: 17ch; font-size: clamp(2.5rem, 6vw, 4.5rem); }
.chapter-head p { max-width: 45rem; }
.chapter-head > p:not(.eyebrow), .chapter-head > ul, .chapter-preview p, .chapter-preview li { font-size: calc(1rem * var(--reading-scale, 1)); }
.epigraph { border-inline-start: 2px solid var(--accent); margin: 1.2rem 0; padding-inline-start: .85rem; color: var(--muted); font: italic 1.14rem/1.5 var(--serif); }
.epigraph small { display: block; margin-block-start: .25rem; font: .77rem/1.5 var(--body); }
.chapter-body { grid-area: content; min-width: 0; font-size: calc(1rem * var(--reading-scale, 1)); }
.chapter-body, .chapter-head, .chapter-preview { width:100%; max-width:var(--reading-measure,46rem); margin-inline:auto; line-height:var(--reading-leading,1.68); }
[data-reading-face="serif"] :is(.chapter-body,.chapter-head,.chapter-preview) { font-family:var(--serif); }
[data-reading-leading="compact"] { --reading-leading:1.5; }
[data-reading-leading="relaxed"] { --reading-leading:1.85; }
[data-reading-width="narrow"] { --reading-measure:37rem; }
[data-reading-width="wide"] { --reading-measure:56rem; }
.chapter-body > section, .reading-page > section, #exam-results > section { padding-block: 1.95rem 1.2rem; border-top: 1px solid var(--line); }
.chapter-body > section h2 + .passage > .theory > p:first-child, .chapter-body h2 + p, .reading-page h2 + p, #exam-results h3 + ul { margin-block-start: .36em; }
.chapter-body strong { font-weight: 650; }
.chapter-aside { grid-area:aside; margin-block-start:.85rem; padding:.8rem; border:1px solid var(--line); border-radius:.5rem; background:var(--surface); }
.chapter-aside ul { padding-inline-start: 0; list-style: none; }
.chapter-aside a { font-size: .9rem; }
.chemical-figure { display: grid; place-content: center; justify-items: center; gap: .55rem; min-width: 0; margin: 1rem 0; padding: .9rem; border: 1px solid var(--line); border-radius: .45rem; }
.structure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: .7rem; }
[data-formulas="condensed"] .structure-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); }
.structure-grid .chemical-figure { margin: .2rem 0; }
.drawing { display: grid; place-items: center; min-height: 2.2rem; min-width: 0; }
.drawing svg { display: block; max-width: 100%; height: auto !important; }
.drawing .ring .rb { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.drawing .ring .rt { fill: currentColor; font: 600 15px var(--body); }
figcaption { text-align: center; color: var(--muted); font-size: .86rem; }
.formula, .equation-arrow { display: inline-block; white-space: nowrap; }
.equation { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .25rem .5rem; margin-block: 1.05rem; padding: .75rem; border-block: 1px solid var(--line); text-align: center; }
.callout { margin-block: 1.05rem; padding: .8rem 1rem; background: var(--soft); border-inline-start: 3px solid var(--accent); border-radius: 0 .35rem .35rem 0; }
.callout p:last-child { margin-block-end: 0; }
.example { border-inline-start: 2px solid var(--line); margin-block: 1rem; padding-inline-start: .9rem; }
.example p:last-child { margin-block-end: 0; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: .4rem; padding-inline: .85rem; margin-block: .65rem; }
summary { padding-block: calc(.65rem + 1px) calc(.65rem - 1px); font-weight: 600; }
.part > summary, .toc-chapter > summary { padding-block:calc(.65rem + .25px) calc(.65rem - .25px); }
.chapter-body summary { padding-block: calc(.65rem + .4px) calc(.65rem - .4px); }
details[open] > summary { border-bottom: 1px solid var(--line); }
details p:last-child { margin-block-end: .9rem; }
.table-wrap { max-width: 100%; overflow-x: auto; margin-block: 1rem; }
table { border-collapse: collapse; width: 100%; font-size: .91rem; }
th, td { padding: .56rem .65rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
tr > th { background: var(--soft); }
.chapter-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .85rem; margin-block-start: 1.2rem; }
:target { scroll-margin-top: 1.25rem; }
.muted { color: var(--muted); }
.edition-links { display: flex; flex-wrap: wrap; gap: .35rem 1.15rem; margin-block-start: 1rem; font-size: .92rem !important; }
.reading-page { width: min(100%, 46rem); margin-inline: auto; padding-block-start: clamp(1.6rem, 4vw, 3.75rem); }
.reading-page h1 { font-size: clamp(2.15rem, 5.8vw, 4rem); padding-block-end: .2em; }
.reading-page > section:first-of-type { margin-block-start: 1.3rem; }
.chapter-preview .callout { padding: 1.1rem 1rem; }
.chapter-preview .callout h2 { font-size: 1.45rem; }
.minor-title { font: 650 1rem/1.4 var(--body); }
.tool-row { display: flex; align-items: center; gap: .45rem .65rem; flex-wrap: wrap; }
.tool-row button, .tool-row .button, .tool-row select, .paragraph-tools { font-size: .87rem; }
.paragraph-tools { margin-top: 1rem; }
.paragraph-tools button { background: transparent; color: var(--accent); border-color: transparent; padding-inline: .38rem; }
button[aria-pressed="true"] { background: var(--soft); border-color: var(--accent); color: var(--accent); }
.reading-settings { margin-block-start: .75rem; font-size: .86rem; }
select, textarea { max-width: 100%; padding: .38em .55em; border-radius: .4rem; border: 1px solid var(--line); background: var(--surface); }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.updates { font-size: .88rem; }
.exam-picker { border: 1px solid var(--line); border-radius: .5rem; padding: .75rem; margin: 1.75rem 0 1rem; }
.exam-picker legend { padding-inline: .35rem; }
.exam-picker label { display: block; padding-block: .34rem; }
.exam-picker details { margin-block: .35rem; }
#exam-results section h3 { margin-block-start: 1.1rem; }
.saved-list li { margin-block: .65rem; }
.notes-list { display: grid; gap: .85rem; margin-top: 1.4rem; }
.note { border: 1px solid var(--line); border-radius: .5rem; padding: 1rem; background: var(--surface); }
.note h2 { font-size: 1.45rem; }
.note-comment { white-space: pre-wrap; overflow-wrap: anywhere; }
dialog { max-width: min(36rem,calc(100% - 2rem)); max-height: 85dvh; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); color: var(--ink); padding: 1.1rem 1.3rem; }
dialog::backdrop { background: #19132288; }
dialog h2 { font-size: 1.75rem; }
dialog label { display: block; margin-block: .7rem .25rem; }
dialog textarea { width: 100%; resize: vertical; }
dialog .tool-row { justify-content: flex-end; }
.loading { padding-top: 1.2rem; color: var(--muted); }
#reading:has(.textbook-initial-status) + .site-footer { visibility: hidden; }
.energy-diagram { margin: 1rem 0; padding: .8rem; background: var(--soft); border-radius: .55rem; }
.energy-diagram svg { width: min(100%,25rem); display: block; margin-inline: auto; }
.energy-diagram text { font: 13px var(--body); fill: var(--ink); }
.energy-diagram path { fill: none; stroke: var(--muted); stroke-width: 1.25; }
.energy-diagram path.diagram-curve { stroke: var(--accent); stroke-width: 2.6; }
.energy-diagram circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.energy-diagram .active { fill: var(--accent); }
.chemical-explorer { display: grid; grid-template-columns: minmax(9rem,1fr) minmax(0,1.6fr); align-items: center; gap: 1rem; margin: 1.35rem 0; }
.chemical-explorer figure { margin: 0; min-width: 0; }
.interactive-structure svg { display: block; max-width: 100%; height: auto !important; margin-inline: auto; }
.chemical-explorer h3, #interactive h3 { margin-block: .6rem .4rem; }
.zoom-button { color:var(--accent); background:transparent; border-color:transparent; padding:calc(.18em + 1px) .5em calc(.18em - 1px); font-size:.78rem; }
.energy-diagram .zoom-button,.chemical-explorer .zoom-button { display:block; margin-inline:auto; }
.zoom-dialog { width:min(47rem,calc(100% - 2rem)); max-width:calc(100% - 2rem); }
.zoom-picture { padding:1.2rem .25rem; color:var(--ink); text-align:center; font-size:1.55rem; }
.zoom-picture svg:not(.chem-triple) { display:block; width:min(100%,32rem)!important; height:auto!important; margin-inline:auto; }
.zoom-picture > svg { min-width:0; }
.zoom-picture .ring .rb { fill:none; stroke:currentColor; stroke-width:1.6; stroke-linejoin:round; }
.zoom-picture .ring .rt { fill:currentColor; font:600 15px var(--body); }
.zoom-picture .diagram-axis,.zoom-picture .diagram-curve { fill:none; stroke:currentColor; stroke-width:1.6; }
.zoom-picture .diagram-curve { stroke:var(--accent); }
.zoom-picture svg text { fill:currentColor; }
.zoom-picture > svg text { font:13px var(--body); }
.preference-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem 1rem; margin-block:1rem; }
.preference-fields label { display:grid; gap:.35rem; margin:0; font-size:.86rem; }
.preference-fields .focus-preference { display:flex; align-items:center; grid-column:1/-1; }
#offline-picker fieldset { border:1px solid var(--line); border-radius:.45rem; margin-block:1rem .7rem; }
.offline-entry { display:grid; grid-template-columns:1rem minmax(0,1fr) auto; align-items:baseline; gap:.5rem; padding:.35rem .25rem; }
.offline-entry input { margin:0; }
.auto-offline { display:block; }
[data-focus="true"] .site-header nav { visibility: hidden; }
[data-focus="true"] .brand span { display: none; }
[data-focus="true"] .chapter-tools > :is(a,[data-panel]) { display:none; }
[data-focus="true"] .chapter-tools:not(:has([data-return]:not([hidden]))) { display:none; }
[hidden] { display: none !important; }
.notebooks h1 { overflow-wrap:anywhere; font-size:clamp(2.35rem,6vw,4rem); }
.notebooks input:not([type="checkbox"]) { max-width:100%; border:1px solid var(--line); border-radius:.42rem; padding:.35rem .5rem; background:var(--surface); }
.notebooks button:disabled { color:var(--muted); opacity:.65; }
.notebook-list { list-style:none; padding:0; }
.notebook-list li { display:flex; flex-wrap:wrap; align-items:center; gap:.55rem 1rem; justify-content:space-between; border-top:1px solid var(--line); padding:.72rem 0; }
.notebook-list li > span { overflow-wrap:anywhere; }
.notebook-choice { display:block; }
.notebook-editor { max-width:52rem; margin-inline:auto; }
.notebook-editor [data-save-status] { font-size:.85rem; color:var(--muted); }
.notebook-block { border:0; border-block-start:1px solid var(--line); overflow-wrap:anywhere; }
.notebook-block textarea { display:block; width:100%; min-height:3.5rem; resize:vertical; field-sizing:content; max-height:52vh; margin:.3rem 0; }
.notebook-block:not(:focus-within) textarea { background:transparent; }
.notebook-type { color:var(--muted); font-size:.88rem; }
.notebook-type textarea { color:var(--ink); font-size:1rem; }
.notebook-credit,.notebook-actions,.notebook-insert { font-size:.84rem; }
.notebook-prose { white-space:pre-wrap; overflow-wrap:anywhere; }
.notebook-insert,.notebook-actions { border:0; margin:.1rem 0; padding:0; background:transparent; }
.notebook-insert summary,.notebook-actions summary { padding:.35rem 0; color:var(--accent); }
.notebook-capture { color:var(--accent); font-size:.8rem; padding:calc(.22rem + .75px) .45rem calc(.22rem - .75px); margin:.2rem 0 .45rem; }
.selection-tools { position:fixed; z-index:3; display:flex; gap:.3rem; }
.selection-tools[hidden], .selection-tools button[hidden] { display:none; }
.chapter-head > [data-report] { padding-block:calc(.46rem + .45px) calc(.46rem - .45px); font-size:.9rem; }
:root[data-theme="dark"],.desk-preview[data-theme="dark"] { color-scheme:dark; --bg:#18161e; --ink:#f6f0fc; --surface:#211c2c; --muted:#c5b9d4; --accent:#d0b4ff; --soft:#2d2740; --line:#4f4560; }
.desk-preview[data-theme="light"] { color-scheme:light; --bg:#fbf9f5; --ink:#211c2b; --surface:#fff; --muted:#61596c; --accent:#59419c; --soft:#f4eff9; --line:#ded8e7; }
.notebook-block .formula { white-space:normal; }
.term-link { font-size:.83rem; color:var(--accent); padding:calc(.25rem + .8px) .48rem calc(.25rem - .8px); margin:.42rem .3rem .32rem 0; }
.term-inline { font:inherit; border:0; background:transparent; border-radius:0; padding:0; margin:0; display:inline; color:var(--accent); }
.term-inline:is(:hover,:focus-visible) { text-decoration:underline; }
.chapter-review { border-inline-start:2px solid var(--line); padding-inline:.8rem; margin-block:1.25rem; }
.chapter-review h3 { margin:0; }
.chapter-review p { margin:.35rem 0; }
.optional-exercise { margin-block:1rem; }
.model-controls { margin-block:.8rem 1rem; }
.model-controls label { min-width:0; max-width:100%; }
.model-controls input[type="range"] { max-width:100%; accent-color:var(--accent); }
.model-viewport { overflow:auto; border:1px solid var(--line); border-radius:.5rem; background:var(--surface); }
.model-stage { width:calc(100% * var(--model-zoom,1)); min-height:1px; display:grid; place-items:center; }
.model-stage:empty,.model-viewport:has(.model-stage:empty) { display:none; }
.model-stage svg { width:min(100%,calc(24rem * var(--model-zoom,1))); height:auto; color:var(--ink); margin:auto; }
.model-stage svg line { stroke:currentColor; stroke-width:2; }
.model-stage .diagram-curve { fill:none; stroke:var(--accent); stroke-width:2.2; }
.model-stage svg text { fill:currentColor; font:12px var(--body); }
.model-stage svg .model-back { color:var(--accent); }
.model-origin,.model-nucleus { fill:var(--ink); }
.model-ring { fill:none; stroke:var(--accent); stroke-width:2; }
.phase-positive { fill:var(--soft); stroke:var(--accent); }
.phase-negative { fill:var(--surface); stroke:var(--accent); }
.equilibrium-scale { height:.36rem; width:min(75%,21rem); background:var(--line); position:relative; margin:1.6rem auto; }
.equilibrium-scale span { position:absolute; width:.78rem; height:.78rem; border-radius:50%; inset-block-start:-.21rem; transform:translateX(-50%); background:var(--accent); }
.model-caption { display:block; margin-top:.55rem; }
.model-controls button { padding-block:calc(.46rem + .5px) calc(.46rem - .5px); }
.plan-topic { border:1px solid var(--line); margin:.4rem 0; min-width:0; }
.plan-topic:not(:has(input[name="topic"]:checked)) > div { display:none; }
.plan-days li { margin-block:.4rem; }
.term-definition h2 { margin:0; }
.training input:not([type="checkbox"]) { max-width:100%; border:1px solid var(--line); border-radius:.42rem; padding:.35rem .5rem; background:var(--surface); }
.training textarea { display:block; width:100%; max-width:100%; }
.training select[name="question"] { max-width:min(100%,24rem); }
.training .tool-row label { min-width:0; max-width:100%; }
.plan-rest { display:flex; flex-wrap:wrap; gap:.4rem .8rem; }
@media (min-width:64rem) {
  .chapter { grid-template-areas:'tools' 'head' 'content'; column-gap:1.65rem; }
  .chapter[data-left="true"] { grid-template-columns:14rem minmax(0,1fr); grid-template-areas:'tools tools' 'toc head' 'toc content'; }
  .chapter[data-right="true"] { grid-template-columns:minmax(0,1fr) 13rem; grid-template-areas:'tools tools' 'head aside' 'content aside'; }
  .chapter[data-left="true"][data-right="true"] { grid-template-columns:14rem minmax(0,1fr) 13rem; grid-template-areas:'tools tools tools' 'toc head aside' 'toc content aside'; }
  .chapter-toc,.chapter-aside { position:sticky; top:calc(var(--masthead-height,67px) + 4.3rem); max-height:calc(100dvh - var(--masthead-height,67px) - 5rem); overflow:auto; }
}
@media (max-width:58rem) {
  .header-inner { grid-template-columns:minmax(0,1fr) auto; gap:.25rem .7rem; }
  .header-inner nav { grid-area:2 / 1 / 3 / -1; justify-content:flex-start; }
}
@media (max-width: 39rem) {
  .hero, .parts, .chemical-explorer { grid-template-columns: minmax(0, 1fr); }
  .hero .chemical-figure { display: none; }
  .header-inner nav { justify-content: space-between; gap: .25rem .45rem; font-size: .8rem; }
  .header-tools { font-size: .8rem; }
  .header-tools button { padding-block: calc(.46rem + .25px) calc(.46rem - .25px); }
  .wide-label { display: none; }
  .compact-label { display: inline; }
  .brand span { display:none; }
  .gift-card ul { columns:1; }
  [data-focus="true"] .site-header nav { display: none; }
}
@media (max-width: 27rem) { .header-inner { gap: .3rem .9rem; } .header-inner, #reading, .site-footer { width: calc(100% - 2rem); } }
@media (max-width: 28rem) {
  .table-wrap thead th { border-width:0; clip-path:inset(50%); position:absolute; white-space:nowrap; }
  .table-wrap table,.table-wrap tbody,.table-wrap tr,.table-wrap th,.table-wrap td { display:block; }
  .table-wrap th[scope="row"] { padding:.42rem .5rem; }
  .table-wrap td { padding:.38rem .5rem; }
  .table-wrap td::before { content:attr(data-column); display:block; font-size:.79em; font-weight:650; color:var(--muted); }
  .table-wrap tbody tr + tr { margin-block-start:.7rem; }
}

h1,h2,h3,h4 { color:var(--ink); font-family:var(--serif); }
:is(h1,h2,h3,h4) > a { color:inherit; }
button:not(.term-link), .button, select { min-height:var(--control); }
button.primary { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.site-header { z-index:4; transition:transform var(--motion) ease; }
.header-inner { border-bottom:0; }
.book-tools .hero-shortcuts { display:inline-flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem; padding:0; border:0; }
.contents-about { max-width:42rem; }
.toc-chapter > summary, .toc-chapter[open] > summary { grid-template-columns:.8rem 2.2ch minmax(0,1fr) 1rem; }
.toc-chapter > summary > [data-progress] { align-self:start; margin-top:.22em; }
.check-ring { display:block; width:1rem; height:1rem; fill:none; stroke:var(--muted); stroke-width:1.35; }
.check-ring .progress-fill { stroke:var(--accent); stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
.check-question { display:grid; grid-template-columns:2.7rem minmax(0,1fr); align-items:start; gap:.3rem; border-top:1px solid var(--line); }
.check-question:last-of-type { border-bottom:1px solid var(--line); }
.check-question details { margin:0; border:0; background:transparent; padding-inline:0; }
.check-question summary { min-height:44px; }
.check-mark { display:grid; place-items:center; padding:0; border-color:transparent; background:transparent; }
.check-mark svg { margin-top:0; }
.check-mark[aria-pressed="true"] { background:var(--soft); }
.check-status { color:var(--muted); font-size:.9em; font-variant-numeric:tabular-nums; }
.chapter-head { padding-bottom:2rem; background-image:linear-gradient(90deg,var(--gold),transparent 48%); background-size:100% 1px; background-repeat:no-repeat; background-position:bottom; }
.chapter-head h1 { max-width:18ch; }
.chapter-body { line-height:var(--reading-leading,1.58); }
.chapter-body > section { position:relative; }
.chapter-body > section:first-child { border-top:0; }
.chapter-body h3 { margin-block:1.2em .32em; }
.section-number { display:inline; font-variant-numeric:tabular-nums; font-size:.78em; }
[data-reading-align="justify"] .theory > p { text-align:justify; hyphens:auto; text-indent:1.1em; }
[data-reading-align="left"] .theory > p { text-align:start; }
.theory > p { margin-block:.4em .65em; }
.theory-reference { color:inherit; border-bottom:1px dotted var(--accent); }
.chapter-review { border-inline-start:1px solid var(--line); background:none; }
.academic-table h3,.reaction-frame h3 { margin:0; }
.reaction-frame,.academic-table { border:1px solid var(--line); padding:.65rem; margin-block:1rem; overflow-x:auto; }
.reaction-frame .equation { margin:0; border:0; width:max-content; min-width:100%; flex-wrap:nowrap; }
.chapter-body .structure-grid .chemical-figure { grid-row:span 3; grid-template-rows:subgrid; align-content:start; justify-content:stretch; overflow-x:auto; }
.chemical-figure .drawing { align-self:center; }
.chemical-figure figcaption { align-self:start; }
.figure-tools { display:flex; flex-wrap:wrap; align-content:start; justify-content:center; align-items:center; gap:.3rem; }
.figure-tools .notebook-capture { margin:0; }
.capture-heading {display:flex;align-items:center;justify-content:space-between;gap:.45rem;flex-wrap:wrap}
.capture-heading .notebook-capture,.capture-table .notebook-capture,.capture-details .notebook-capture {margin:0}
.capture-details {display:grid;grid-template-columns:minmax(0,1fr) max-content;gap:.4rem;align-items:start;margin-block:.6rem}
.capture-details > details {min-width:0;margin:0}
.capture-table > .table-wrap {margin-block-start:.25rem}
.capture-table {text-align:end}
.capture-table .table-wrap {text-align:start}
.chapter-model:fullscreen { max-width:none; padding:clamp(.8rem,3vw,2rem); background:var(--bg); color:var(--ink); overflow:auto; }
.chapter-model:fullscreen .model-stage { min-height:min(48vh,28rem); }
.chapter-body .example { padding:.15rem .9rem; border:1px solid var(--line); background:transparent; }
.chapter-body .callout { background:transparent; border-inline-start-width:2px; }
.derivation { border-block:1px solid var(--line); padding:.75rem 0; margin-block:1rem; }
.chapter-body .derivation h3 { margin:0; }
.math-equation { text-align:center; font-variant-numeric:lining-nums; font-size:1.18em; overflow-wrap:anywhere; }
.derivation summary { display:grid; grid-template-columns:1.2rem minmax(0,1fr) .65rem; align-items:center; gap:.55rem; list-style:none; min-height:44px; }
.derivation summary::after { content:''; width:.48rem; height:.48rem; border-inline-end:1px solid; border-block-end:1px solid; transform:rotate(-45deg); }
.derivation details[open] summary::after { transform:translateY(-1px) rotate(45deg); }
.derivation-symbol { font:1.15em/1 var(--serif); translate:0 -.5px; }
.formula { text-indent:0; }
.margin-notes { font:.87rem/1.5 var(--body); }
.margin-notes summary svg,.selection-tools svg,.empty-reading svg { display:inline-block; width:1.2rem; height:1.2rem; vertical-align:middle; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linejoin:round; stroke-linecap:round; }
.empty-reading svg { width:1.65rem; height:1.65rem; color:var(--muted); }
.empty-reading { margin-block:.8rem; }
[data-comments="false"] .margin-notes { display:none; }
.selection-tools { z-index:7; border:1px solid var(--line); padding:.18rem; background:var(--surface); border-radius:.35rem; box-shadow:0 4px 12px #211c2b24; }
.selection-tools button { display:grid; place-items:center; min-width:var(--control); border:0; padding:0; }
.selection-tools button:hover,.selection-tools button:focus-visible { background:var(--soft); }
#preferences { position:fixed; margin:auto 0 auto auto; inset-block:0; inset-inline:auto 0; width:min(25rem,100%); max-height:100dvh; }
#preferences .tool-row, dialog .tool-row:has([data-close]) { justify-content:flex-end; }
.chapter-body .tool-row button { padding-block:calc(.46rem + 1px) calc(.46rem - 1px); }
#start-tour { padding-block:calc(.46rem + .15px) calc(.46rem - .15px); }
.glossary-popover { position:fixed; inset:var(--definition-y) auto auto var(--definition-x); margin:0; width:min(24rem,calc(100% - 1rem)); max-height:48dvh; }
.pdf-layout { display:grid; grid-template-columns:minmax(10rem,.6fr) minmax(0,1.4fr); gap:1rem; }
.pdf-options { display:grid; align-content:start; justify-items:stretch; gap:.55rem; }
.pdf-options label { display:grid; gap:.2rem; }
.pdf-layout iframe { border:1px solid var(--line); width:100%; height:min(70vh,40rem); }
.term-bookmarks { display:block; margin-top:.65rem; }
.bookmark-dot { display:inline-block; width:.75rem; height:.75rem; border-radius:50%; background:#a482d1; vertical-align:-.04em; }
.bookmark-dot[data-color="sand"] { background:#bb9657; }
.bookmark-dot[data-color="rose"] { background:#bd7492; }
.bookmark-dot[data-color="blue"] { background:#769fca; }
.notebook-editor [data-editor-blocks] { padding:.65rem; background-color:var(--surface); border:1px solid var(--line); }
.notebook-editor[data-paper="dots"] [data-editor-blocks] { background-image:radial-gradient(var(--line) .85px, transparent 1px); background-size:14px 14px; }
.notebook-editor[data-paper="lined"] [data-editor-blocks] { background-image:repeating-linear-gradient(transparent 0 27px,var(--line) 27px 28px); }
.notebook-editor[data-paper="blocks"] .notebook-block { border:1px solid var(--line); background:var(--bg); padding:.7rem; }
.notebook-editor :is(input,textarea,select) { scroll-margin-block:min(25vh,8rem); }
.notebook-own-image { display:block; max-width:100%; max-height:24rem; object-fit:contain; }
@media (min-width:76rem) {
  .chapter:not(:has(#reading-outline:not([hidden]))) .margin-notes { position:absolute; inset-inline-start:calc(100% + 1rem); inset-block-start:1.8rem; width:10.5rem; }
  [data-focus="true"] .chapter .margin-notes { position:static; width:auto; }
}
@media (max-width:760px) {
  .hero { grid-template-columns:minmax(0,1fr) minmax(0,.68fr); gap:1rem; }
  .hero h1 { font-size:clamp(2rem,8.1vw,3.5rem); }
  .hero p:not(.eyebrow):not(.book-subtitle):not(.edition-links) { display:none; }
  .book-jacket { padding:.38rem; }
  .chapter-head h1 { font-size:clamp(2.25rem,9vw,3.2rem); }
  .pdf-layout { grid-template-columns:1fr; }
  .selection-tools { inset:auto .5rem max(.5rem,env(safe-area-inset-bottom)) !important; justify-content:center; }
  .glossary-popover,#preferences { inset:auto 0 0; margin:0; width:100%; max-width:none; max-height:75dvh; border-radius:.8rem .8rem 0 0; }
  [data-reading-align="justify"] .theory > p { text-align:start; }
  .table-wrap :is(table,tbody,tr,th,td) { display:revert; }
  .table-wrap thead th { position:static; clip-path:none; white-space:normal; }
  .table-wrap td::before { display:none; }
  .table-wrap table { min-width:min(100%,22rem); }
  .table-wrap table:has(thead th:nth-child(4)) { min-width:30rem; }
  .table-wrap table:has(thead th:nth-child(4)) :is(th:first-child,td:first-child) { position:sticky; left:0; width:7rem; background:var(--surface); }
}
@media (max-width:380px) {
  .header-inner,#reading,.site-footer { width:calc(100% - 1.2rem); }
  .hero-actions,.edition-links { gap:.45rem; }
}
@media (max-width:500px) {
  .hero { grid-template-columns:minmax(0,1fr); gap:1.4rem; }
  .hero h1 { max-width:none; font-size:clamp(2.2rem,10vw,3.4rem); }
  .hero .book-subtitle { max-width:28ch; }
  .hero .book-jacket { width:min(100%,12rem); justify-self:start; }
  .jacket-rule { gap:3.5cqw; }
}
.site-header nav a:hover,.book-tools a:hover,.toc-title a:hover,.chapter-nav a:hover,.hero-actions a:hover {text-decoration:none}
.site-header nav a[aria-current],.toc-title a[aria-current] {background:var(--soft);border-radius:.32rem}
.gift-card .gift-choices {list-style:none;padding:0;columns:auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));gap:.5rem}
.gift-card .gift-option {display:flex;align-items:center;gap:.65rem;min-height:3.2rem;padding:.5rem .7rem;border:1px solid var(--line);border-radius:.45rem;background:var(--surface);cursor:pointer}
.gift-card .gift-option:has(input:checked) {border-color:var(--accent)}
.gift-card .gift-option input {flex:none;accent-color:var(--accent)}
.gift-card .gift-choices li {margin:0}
.gift-card [data-gift-actions] {margin-block-start:.75rem}
.gift-card [data-gift-actions][hidden] {display:none}
.chapter-tools > [data-panel=left] {margin-inline-end:auto}
.chapter-tools > [data-panel=right] {margin-inline-start:auto;order:4}
.chapter :is(.chapter-toc,.chapter-aside,.chapter-toc .part) {border:0;background:transparent}
.chapter :is(.chapter-toc,.chapter-aside) {border-radius:0;padding-inline:.5rem}
.chapter-toc .toc-chapter + .toc-chapter,.chapter-toc .part summary {border:0}
.chapter-toc a[aria-current] {background:var(--soft);border-radius:.3rem}
.chapter :is(.chapter-toc,.chapter-aside) a:hover {text-decoration:none}
@media (min-width:64rem) {
  .chapter-toc,.chapter-aside {top:calc(var(--masthead-height,67px) + 3.8rem)}
}
