/* Shared by all imported textbook pages; manuscripts remain unchanged. */
.stage-a .dark-reader .a-main{color:var(--text)}
.textbook-page-picker{display:flex;align-items:center;gap:12px}.textbook-page-picker label{flex:none}.textbook-page-picker select{min-width:0;max-width:100%;flex:1}
.textbook-article{overflow-wrap:break-word}.textbook-article ul,.textbook-article ol{padding-left:1.6em}
.textbook-article .katex-display{max-width:100%;overflow-x:auto;overflow-y:hidden}.textbook-article .katex svg{max-width:none}.textbook-article .katex svg path{fill:currentColor}
.textbook-article svg:not(.katex svg){max-width:100%;height:auto}.textbook-article [data-graph]{min-width:0}.textbook-article input[type=range]{min-width:0;padding:0;min-height:32px}
.textbook-article .table-scroll{max-width:100%}.textbook-article a{text-decoration:underline}.textbook-article .katex-error{color:inherit!important;font-family:monospace;white-space:pre-wrap}
@media(max-width:500px){.textbook-page-picker select{width:100%}.textbook-article [data-graph] label{flex-wrap:wrap}.textbook-article [data-graph] input[type=range]{flex-basis:100px!important}}
.textbook-reading .a-header h1{font-size:20px;font-weight:600}
.textbook-reading .a-content[data-page=reader]{padding:24px max(32px,calc((100% - 856px)/2)) 32px}
.textbook-reading .reader-meta{max-width:856px;margin:0 auto 16px}
.textbook-reading .reading-path{font-size:12px;line-height:1.7;margin:0 0 10px;color:var(--muted)}
.textbook-reading .reader-meta-row{display:flex;justify-content:space-between;align-items:center;gap:20px}
.textbook-reading .textbook-page-picker{margin:0;flex:1;gap:12px;min-width:0;max-width:580px}
.textbook-reading .textbook-page-picker label{font-size:13px;color:var(--muted);margin:0}
.textbook-reading .textbook-page-picker select{font-size:14px;min-height:44px;padding:9px 12px;border-color:var(--line)}
.textbook-reading .reader-tools{margin:0;flex:none;gap:8px}.textbook-reading .reader-tools .btn{font-weight:500;min-height:44px}
.textbook-reading .textbook-article{max-width:856px;margin:0 auto;padding:28px 32px;background:var(--surface);border:1px solid var(--line);border-radius:14px;font-size:16px;line-height:1.85;color:var(--text);--color-paper-border:var(--line);--color-paper-text:var(--text)}
.textbook-reading .textbook-body h1{font-size:25px;font-weight:600;line-height:1.5;letter-spacing:0;margin:0 0 20px}
.textbook-reading .textbook-body h2{font-size:20px;font-weight:600;line-height:1.5;margin:26px 0 14px}
.textbook-reading .textbook-body h3{font-size:17px;font-weight:600;line-height:1.6;margin:24px 0 10px}
.textbook-reading .textbook-body h4{font-size:16px;font-weight:600;line-height:1.6;margin:22px 0 10px}
.textbook-reading .textbook-body> :first-child{margin-top:0}.textbook-reading .textbook-body> :last-child{margin-bottom:0}
.textbook-reading .textbook-body p{font-size:16px;line-height:1.85;margin:0 0 14px;overflow-wrap:break-word;overflow-x:auto}
.textbook-reading .textbook-body strong{font-weight:600}
.textbook-reading .textbook-body blockquote{margin:18px 0;padding:14px 18px;border:0;border-left:3px solid #8595df;border-radius:0 8px 8px 0;background:#f4f6fd;color:var(--text)}
.textbook-reading .textbook-body blockquote p:last-child{margin-bottom:0}
.textbook-reading .textbook-body pre{font-size:16px;line-height:1.75;margin:16px 0;padding:14px 18px;border:1px solid #e5eaf4;border-radius:9px;background:#f7f9fd;white-space:pre;overflow:auto}
.textbook-reading .textbook-body code{font-family:ui-monospace,"SFMono-Regular",Menlo,monospace;font-size:.94em}
.textbook-reading .textbook-body pre code{font-size:1em}
.textbook-reading .textbook-body .katex-display{margin:16px 0;padding:12px 8px;color:var(--text)}
.textbook-reading .textbook-body .katex{font-size:1.08em}
/* Long inline expressions stay complete without widening the reading card. */
.textbook-reading .textbook-body :not(.katex-display)>.katex{display:inline-block;max-width:100%;overflow-x:auto;overflow-y:hidden;vertical-align:middle;padding:2px 0}
.textbook-reading .textbook-body hr{border:0;border-top:1px solid var(--line);margin:24px 0}
.textbook-reading .textbook-body>hr:last-child{display:none}
.textbook-reading .table-scroll{margin:18px 0;border:1px solid var(--line);border-radius:10px;overflow:auto}
.textbook-reading .textbook-body table{font-size:14px;line-height:1.7;width:100%;min-width:480px;margin:0;border:0;border-collapse:collapse}
.textbook-reading .textbook-body th,.textbook-reading .textbook-body td{border:0;border-bottom:1px solid var(--line);padding:10px 14px;text-align:left;min-width:100px}
.textbook-reading .textbook-body th{font-weight:600;background:#f3f6fc;color:#52617c;white-space:nowrap}
.textbook-reading .textbook-body tr:last-child td{border-bottom:0}
.textbook-reading .textbook-body li{margin:.4em 0;line-height:1.85}
.textbook-reading .textbook-body a{color:var(--accent)}
.textbook-reading .textbook-answer{border:1px solid var(--line);border-radius:10px;margin-top:22px;background:var(--surface);padding:0 18px}
.textbook-reading .textbook-answer>summary{font-size:15px;font-weight:500;color:var(--accent);padding:14px 0;min-height:52px}
.textbook-reading .textbook-answer[open]>summary{border-bottom:1px solid var(--line)}
.textbook-reading .textbook-answer[open]>summary .icon{transform:rotate(90deg)}
.textbook-reading .textbook-answer>.textbook-body{padding:20px 0 18px}
.textbook-reading .textbook-article [data-graph]{margin:20px auto;max-width:540px}
.textbook-reading .textbook-article [data-graph]>div{margin-inline:auto;border-color:var(--line)!important;background:#f8faff!important;border-radius:10px!important}
.textbook-reading .pagination{max-width:856px;margin:16px auto 0;font-size:13px;color:var(--muted)}
.textbook-reading .pagination .btn{font-weight:500}
.textbook-reading .textbook-group-intro{padding-bottom:16px;margin-bottom:20px;border-bottom:1px solid var(--line)}
.textbook-reading .textbook-group-intro h2{font-size:17px;margin:0 0 8px}
.textbook-reading .textbook-group-intro h3{font-size:15px;margin:8px 0 0}
.textbook-reading .textbook-group-intro p{font-size:14px;color:var(--muted);margin:8px 0 0}
.textbook-reading .pagination.chapter-transition>.btn:last-child{white-space:normal;overflow-wrap:anywhere;line-height:1.6}
@media(max-width:599px){.textbook-reading .pagination.chapter-transition{display:grid;grid-template-columns:auto 1fr}.textbook-reading .pagination.chapter-transition>span{text-align:right}.textbook-reading .pagination.chapter-transition>.btn:last-child{grid-column:1/-1;width:100%}}
.textbook-reading.dark-reader .textbook-body blockquote{background:#2c3650;border-color:#8e9de5}
.textbook-reading.dark-reader .desktop-brand strong{color:var(--text)}
.textbook-reading.dark-reader .textbook-body pre,.textbook-reading.dark-reader .textbook-body th{background:#2a354b;border-color:var(--line);color:var(--text)}
.textbook-reading.dark-reader .textbook-article [data-graph]>div{background:#263249!important}
@media(max-width:959px){.textbook-reading .a-content[data-page=reader]{padding:16px 12px 24px}.textbook-reading .reader-meta{margin-bottom:14px}.textbook-reading .reader-meta-row{gap:10px;align-items:flex-end}.textbook-reading .textbook-page-picker{flex-direction:column;align-items:stretch;gap:4px}.textbook-reading .textbook-page-picker label{font-size:12px}.textbook-reading .reader-tools{gap:6px;flex-wrap:nowrap}.textbook-reading .reader-tools .btn{font-size:13px;padding:9px 11px}.textbook-reading .textbook-article{padding:20px 18px;border-radius:12px}.textbook-reading .textbook-body h1{font-size:22px;line-height:1.55;margin-bottom:16px}.textbook-reading .textbook-body h2{font-size:19px}.textbook-reading .textbook-body h3{font-size:16px}.textbook-reading .textbook-body blockquote{padding:12px 14px}.textbook-reading .textbook-body pre{padding:12px 14px}.textbook-reading .textbook-answer{padding:0 12px}.textbook-reading .textbook-body th,.textbook-reading .textbook-body td{padding:9px 12px}.textbook-reading .textbook-article [data-graph]>div{padding:10px!important}.textbook-reading .pagination{gap:8px;margin-top:14px}}

/* The build prepends the adopted A textbook stylesheet; this file connects the real catalog and page controls. */
*{box-sizing:border-box}[hidden]{display:none!important}html:has(.reading){background:#f5f7fb}
body.reading{--surface:white;--color-paper-border:var(--line);--color-paper-surface:var(--surface);--color-paper-text:var(--text);--color-paper-muted:var(--muted);--color-accent-soft:var(--soft);min-height:100dvh}
.reading.dark-reading{--surface:#222c40;--text:#eff2fa;--line:#405069;--bg:#192132;--muted:#c1ccde;--accent:#adbcff;--soft:#34415e;color-scheme:dark}
.reading main{padding:0 0 32px;max-width:none}
.reading .reading-header{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:12px;min-height:var(--page-head-height);padding:12px var(--page-head-gutter);background:var(--surface);border-bottom:1px solid var(--line)}
.reading .reading-header h1{font-size:var(--page-title-size)}
.reading h1{font-size:21px}.reading button,.reading select,.reading input{font:inherit;color:var(--text);background:var(--surface);min-height:44px;border:1px solid var(--line);padding:8px 12px}
.reading button,.reading select,.reading summary{cursor:pointer}.reading button:disabled{cursor:default}
.reading .secondary,.reading .app-nav{background:var(--surface)}.reading #back,.reading #book-picker,.reading #topic-search{display:flex;align-items:center;gap:7px}
.reading #back{color:var(--muted);border:0;background:transparent}
#topic-search{width:min(40%,440px);margin:0 auto;background:var(--bg);border:1px solid var(--line);padding:0 10px;border-radius:10px;color:var(--muted)}
#topic-search input{background:transparent;width:100%;min-width:0;border:0;padding-inline:0}.reading-header .icon{width:18px}
#book-picker{min-height:44px;position:relative;border-radius:10px;padding:8px 12px;color:var(--accent);background:var(--soft);font-size:14px;font-weight:600}
#book-picker select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
#book-picker:focus-within,#topic-search:focus-within{outline:3px solid #a6b5ff}
.reading #catalog,.reading main>#notice:not(:empty),.reading main>#retry{width:min(980px,calc(100% - 64px));margin:24px auto}
.reading #notice:empty{display:none}.reading #retry{display:block}.reading #catalog{padding:0}
.subject-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 16px;padding:9px 0}.subject-heading h2{margin:0}.subject-heading small,#matches,#recent small{font-size:13px;color:var(--muted)}
#recent:not(:empty){display:flex;gap:12px;align-items:center;justify-content:space-between;padding:10px 0}#recent button{flex:none}
#entries>details{background:var(--surface);border:1px solid var(--line);border-radius:14px;margin:12px 0;overflow:hidden}
#entries summary{display:flex;align-items:center;gap:14px;min-height:52px;padding:10px 12px;list-style:none}
#entries summary::-webkit-details-marker{display:none}#entries summary::after{content:'›';margin-left:auto;color:var(--muted);font-size:22px}
#entries details[open]>summary::after{transform:rotate(90deg)}#entries details[open]>summary{color:var(--accent);background:var(--soft)}
#entries>details>summary{padding:16px;min-height:85px}#entries summary strong,#entries summary small,#entries button small{display:block}#entries summary strong{font-size:17px}#entries small{font-size:12px;color:var(--muted)}
#entries details details{margin:0 16px;border-bottom:1px solid var(--line)}
#entries button{display:block;width:calc(100% - 14px);margin-left:14px;text-align:left;border:0;border-radius:0;border-left:2px solid var(--line);border-top:1px solid var(--line);color:var(--text)}
.reading #reader{max-width:856px;width:calc(100% - 64px);margin:24px auto 0}
.reading .reader-tools,.reading .pagination{display:flex;align-items:center;gap:8px}.reading .pagination{justify-content:space-between}
.reading .textbook-page-picker select{width:100%}.reading .textbook-article .group-intro,.reading .formula-note{border-left:3px solid var(--accent);padding-left:12px}
.reading #article table{display:block;min-width:0;max-width:100%;overflow-x:auto}.reading .formula-note pre{white-space:pre-wrap}
.reading #article .textbook-body>div>h1:first-child{margin-top:0}
.reading.dark-reading #reader .secondary,.reading.dark-reading #back{color:var(--text)}
@media(max-width:959px){
 .reading .reading-header{min-height:64px;padding:8px 17px;flex-wrap:wrap;gap:6px}
 .reading .reading-header:has(#topic-search:not([hidden])){min-height:119px}.reading .reading-header h1{font-size:19px;flex:1}
 .subject-heading{padding:6px 0}
 #topic-search{order:2;width:100%;margin:0 0 4px}.reading #catalog,.reading main>#notice:not(:empty),.reading main>#retry{width:calc(100% - 34px);margin:18px auto}
 .reading #reader{width:calc(100% - 24px);margin:16px auto 0}.reading .textbook-page-picker{min-width:0}.reading #turn .next-chapter{white-space:normal}
}
@media(max-width:959px){.reading-header:has(#topic-search:not([hidden])) #back{padding:6px}.reading-header:has(#topic-search:not([hidden])) #back span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}}
