#chapter-reader-app{display:grid;grid-template-columns:270px minmax(0,1fr);min-height:100svh;padding-bottom:var(--player)}
#chapter-sidebar .brand{margin-bottom:34px}#chapter-sidebar .brand strong{font-size:22px}#chapter-sidebar .brand small{color:var(--muted)}
#chapter-index{display:grid;gap:11px}.chapter-toc-section>a,.chapter-subsections a{display:block;border:1px solid transparent;border-radius:7px;padding:8px 9px;font-weight:650;font-size:13px;line-height:1.35}.chapter-subsections{border-left:1px solid #cbd8cb;margin:4px 0 4px 10px;padding-left:5px}.chapter-subsections a{font-size:12px;font-weight:500}.chapter-toc-section[data-current]>a{color:var(--deep)}#chapter-index a[aria-current]{background:#dce8dc;border-color:#ccdccc}#chapter-index a:hover{background:#e2eae0}
#lesson-reader.chapter-workspace{width:min(100%,1110px);padding:38px clamp(20px,4vw,60px) 28px}.chapter-heading{padding-bottom:20px;margin-bottom:23px;border-bottom:1px solid var(--line)}.chapter-parent{color:var(--muted);font-size:13px;margin-bottom:6px}.chapter-heading h1{font:500 clamp(33px,4.25vw,55px)/1.05 var(--serif);letter-spacing:-.04em}.chapter-flow{display:grid;grid-template-columns:minmax(0,650px);gap:22px}.chapter-flow[data-refs]{grid-template-columns:minmax(0,650px) minmax(145px,214px)}#reading-panel{min-width:0}.chapter-passage.transcript{font:clamp(18px,2vw,22px)/1.63 var(--serif);margin:0;overflow-wrap:anywhere}.chapter-passage .text-reference{color:#235b43;text-decoration:underline;text-underline-offset:3px}#paragraph-references{display:grid;gap:10px;align-content:start}.reference-link{color:#235b43;text-decoration:underline;width:fit-content}
.book-crop{margin:14px auto;max-width:100%;width:fit-content}.book-crop:first-child{margin-top:0}.book-crop:last-child{margin-bottom:0}.book-crop[data-supplementary]{margin:0}.figure-trigger{position:relative;max-width:100%;height:auto;border-color:var(--line);background:white;display:block;overflow:hidden;padding:6px;text-align:left}.figure-trigger img{width:auto;max-width:100%;max-height:490px;object-fit:contain}.figure-expand-icon{position:absolute;right:5px;bottom:5px;padding:3px;border:1px solid var(--line);border-radius:5px;background:#fffdf8}.figure-expand-icon svg{width:14px;height:14px}.book-figure .figure-trigger:hover,.book-note .figure-trigger:hover,.book-box .figure-trigger:hover{border-color:#759783;background:white}
#figure-dialog .chapter-close{display:flex;justify-content:end}#figure-dialog #enlarged-figure{width:auto;max-width:100%;max-height:calc(100dvh - 120px);object-fit:contain;margin:4px auto 0}
#chapter-pagination{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;margin-top:25px;padding-top:14px;border-top:1px solid var(--line)}#passage-count{color:var(--muted);font-size:12px;font-variant-numeric:tabular-nums}.chapter-pager-group{justify-self:end;display:flex;align-items:center;gap:8px}.confused-band{font-size:13px;font-weight:650;padding:7px 12px;border:1px dashed #b08a3e;background:#fdf7e8;color:var(--deep)}.confused-band:hover{background:#f7eccd}.chapter-pager{border:1px solid var(--line);width:fit-content;padding:7px 12px;border-radius:7px;font-size:13px;font-weight:650}.chapter-pager:hover{background:#e2eae0}#next-passage{justify-self:end}
@media(max-width:990px){#chapter-reader-app{grid-template-columns:210px minmax(0,1fr)}.chapter-flow[data-refs]{grid-template-columns:minmax(0,1fr) minmax(125px,165px)}}
@media(max-width:740px){#chapter-reader-app{display:block}#chapter-sidebar{position:static;height:auto;overflow:visible;display:block;padding:12px 15px;border-right:0;border-bottom:1px solid var(--line)}#chapter-sidebar .brand{margin:0 0 7px}#chapter-index{gap:4px;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.chapter-toc-section{display:contents}.chapter-toc-section:nth-child(-n+2)>a{grid-row:1}.chapter-toc-section:nth-child(n+3)>a{grid-row:2}.chapter-subsections{grid-column:1/-1;grid-row:3;display:flex;overflow:auto;margin:0;padding:0;gap:4px;border-left:0}.chapter-subsections a{min-width:135px}.chapter-flow[data-refs]{grid-template-columns:minmax(0,1fr)}#paragraph-references{display:flex;flex-wrap:wrap}#paragraph-references>figure{max-width:175px}#lesson-reader.chapter-workspace{padding-top:23px}}
@media(max-width:370px){.chapter-subsections a{min-width:117px}}
#chapter-reader-app .player{grid-template-columns:minmax(0,var(--sidebar)) auto minmax(0,1fr) auto auto}.player-autoplay{display:flex;align-items:center;gap:5px;white-space:nowrap;font-size:12px}.player-autoplay input{accent-color:var(--deep);margin:0}.spoken-heading [data-spoken]{background:var(--gold);color:#21231c;border-radius:3px}
@media(max-width:650px){#chapter-reader-app .player{grid-template-columns:minmax(0,1fr) auto auto auto;row-gap:5px}#chapter-reader-app .player-timeline{grid-row:2;grid-column:1/-1}#chapter-reader-app .audio-symbol{display:none}}
#chapter-reader-app #term-card{width:min(340px,calc(100% - 20px))}#term-card-example{border-top:1px solid var(--line);margin-top:8px;padding-top:4px}#term-card-example p+p{margin-top:7px}
.guidance{font:clamp(17px,2vw,20px)/1.55 var(--serif)}.prediction{font-family:var(--sans);font-size:14px;line-height:1.5;background:#fdf7e8;border-left:3px solid #b08a3e;border-radius:7px;padding:10px 14px;margin:0 0 12px;color:var(--deep)}.guidance h2,.guidance dt{font:700 14px/1.45 var(--sans);color:var(--deep)}.guidance dl{display:grid;grid-template-columns:150px 1fr;gap:13px 16px;margin:0 0 24px;padding:16px 20px;background:#eef2e9;border:1px solid var(--line);border-radius:9px}.guidance dd{margin:0}.guidance ol{padding-left:25px;margin:9px 0}.guidance li{padding:5px 3px}.guidance li a{color:var(--green);text-decoration:underline;text-underline-offset:3px}.practice-question+.practice-question{margin-top:20px;padding-top:17px;border-top:1px solid var(--line)}.practice-prompt{margin:5px 0 11px}.practice-question details{font-size:.92em}.practice-question summary{width:fit-content;padding:6px 12px;border:1px solid #9db7a8;border-radius:7px;color:var(--deep);font:650 13px/1.5 var(--sans);cursor:pointer}.practice-question details[open]{background:#edf2e9;border:1px solid var(--line);border-radius:9px;padding:12px}.practice-question details[open] summary{margin-bottom:9px}.practice-question .reference-link{display:inline-block;font:650 12px/1.5 var(--sans);margin-top:8px}.practice-question details .book-crop{margin:10px auto}.practice-question details .figure-trigger img{max-height:220px}
@media(max-width:540px){.guidance dl{grid-template-columns:1fr;gap:3px;padding:12px}.guidance dt:not(:first-child){margin-top:9px}}
.explainer-trigger { margin-top: 14px; color: var(--deep); border-color: #9db7a8; }
#orbital-explainer { position: fixed; inset: 0; margin: auto; width: min(820px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: #fffdf8; color: var(--ink); box-shadow: 0 20px 70px #142d2a33; }
#orbital-explainer::backdrop { background: #17282491; }
.explainer-header, .explainer-stage, .explainer-caption { padding: 12px clamp(14px, 3vw, 25px); }
.explainer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.explainer-header h2 { font: 600 clamp(20px, 4vw, 29px)/1.2 var(--serif); }
.explainer-eyebrow { font: 650 12px/1.4 var(--sans); color: var(--muted); margin-bottom: 3px; }
.explainer-stage { background: #eef2ed; }
#explainer-scene-title { font: 650 17px/1.35 var(--sans); margin-bottom: 8px; }
#explainer-art[src] { display: block; width: 100%; max-height: 34dvh; object-fit: contain; background: white; border-radius: 10px; }
#explainer-art:not([src]) { display: none; }
.explainer-caption { border-top: 1px solid var(--line); }
#explainer-audio { width: 100%; height: 38px; margin-bottom: 7px; }
.explainer-navigation { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; }
.explainer-navigation button { min-height: 34px; color: var(--deep); border-color: #9db7a8; }
#explainer-status { margin-bottom: 8px; color: var(--muted); }
#explainer-transcript { font: clamp(17px, 2.4vw, 21px)/1.5 var(--sans); min-height: 4.5em; }
.explainer-spoken { background: var(--gold); color: #21231c; border-radius: 3px; box-shadow: 0 0 0 2px var(--gold); }

#chapter-reader-app { --chat-width: clamp(365px, 34vw, 485px); }
#chapter-reader-app { --chat-header-top: 5px; --chat-header-right: 20px; }
.uk-btn.pi-chat-trigger { position: fixed; z-index: 6; top: var(--chat-header-top); right: var(--chat-header-right);
  height: 36px; padding: 0 12px; background: #fffdf8; color: var(--deep); border-color: #9db7a8; }
.uk-btn.pi-chat-trigger:hover { background: #e6ecdf; }
#chapter-reader-app:has(#pi-chat[open]) .pi-chat-trigger { visibility: hidden; }
#pi-chat[open] { display: flex; flex-direction: column; }
#pi-chat { position: fixed; inset: 0 0 0 auto; z-index: 20; margin: 0; padding: 0; width: min(100%, var(--chat-width)); max-width: none; height: 100dvh; max-height: none; overflow: hidden; border: 0; border-left: 1px solid var(--line); background: #fffdf8; color: var(--ink); box-shadow: -12px 0 44px #142d2a20; }
#pi-chat::backdrop { background: #17282466; }
:root:has(#pi-chat:modal) { overflow: hidden; }
.pi-chat-dismiss { flex: none; margin-left: auto; }
#pi-chat-status { padding: 7px 20px; background: #edf2e9; color: var(--muted); font: 500 13px/1.4 var(--sans); }
#pi-chat-status:empty { display: none; }
#pi-chat-pair { margin: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
#pi-chat-pair h3 { margin-bottom: 6px; font-weight: 700; }
#pi-chat-pair button { margin-top: 12px; }
#pi-chat label { display: block; margin: 8px 0 5px; font-size: 13px; font-weight: 650; }
#pi-chat input, #pi-chat textarea { display: block; width: 100%; padding: 9px 10px; border: 1px solid #9db7a8; border-radius: 7px; background: white; color: var(--ink); font: 400 15px/1.45 var(--sans); }
#pi-chat-input { resize: vertical; min-height: 3.25rem; max-height: 24dvh; border-color: var(--line); }
#pi-chat-input:focus { outline: none; box-shadow: none; }
@media (forced-colors: active) { #pi-chat-input:focus-visible { outline: 1px solid Highlight; outline-offset: 1px; } }
#pi-chat-history { flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain; overflow-anchor: none; padding: 8px 16px; }
#pi-chat-history article { margin: 8px 0 12px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; }
#pi-chat-history article[data-role=user] { background: #edf3e9; margin-left: 12%; }
#pi-chat-history article > strong { display: block; color: var(--deep); margin-bottom: 4px; font-size: 12px; }
.pi-chat-plain, .pi-chat-markdown { line-height: 1.55; overflow-wrap: anywhere; }
.pi-chat-plain { white-space: pre-wrap; }
.pi-chat-markdown > * + * { margin-top: .65em; }
.pi-chat-markdown :is(h1,h2,h3,h4,h5,h6) { font-weight: 700; line-height: 1.25; }
.pi-chat-markdown :is(h1,h2) { font-size: 1.15em; }
.pi-chat-markdown :is(ul,ol) { padding-inline-start: 1.45em; }
.pi-chat-markdown ul { list-style: disc; }
.pi-chat-markdown ol { list-style: decimal; }
.pi-chat-markdown li + li { margin-top: .25em; }
.pi-chat-markdown a { color: var(--deep); text-decoration: underline; text-underline-offset: .15em; }
.pi-chat-markdown blockquote { border-inline-start: 3px solid #9db7a8; padding-inline-start: .75em; color: var(--muted); }
.pi-chat-markdown code, #pi-chat-pair code { padding: .1em .3em; border-radius: 4px; background: #edf2e9; font-size: .9em; }
.pi-chat-markdown pre { padding: .6em .75em; background: #edf2e9; border-radius: 6px; overflow: auto; overflow-wrap: normal; }
.pi-chat-markdown pre code { padding: 0; background: transparent; }
.pi-chat-table-scroll { overflow-x: auto; container-type: inline-size; }
.pi-chat-markdown table { width: 100%; border-collapse: collapse; }
.pi-chat-markdown :is(th,td) { min-width: 10ch; border: 1px solid var(--line); padding: 8px 10px;
  text-align: left; vertical-align: top; overflow-wrap: break-word; }
.pi-chat-markdown th { background: #edf2e9; }
.pi-chat-table-prose table { table-layout: fixed; }
.pi-chat-table-prose :is(th,td) { min-width: 0; }
.pi-chat-table-prose th:first-child { width: 34%; }
@container (max-width: 390px) {
  .pi-chat-table-prose :is(table,tbody,tr,td) { display: block; }
  .pi-chat-table-prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pi-chat-table-prose tbody tr { padding: 9px 0; border-top: 1px solid var(--line); }
  .pi-chat-table-prose tbody tr:last-child { border-bottom: 1px solid var(--line); }
  .pi-chat-table-prose tbody td { border: 0; padding: 0; }
  .pi-chat-table-prose tbody td:first-child { margin-bottom: 3px; font-weight: 650; }
}
#pi-chat-compose { padding: 4px 20px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fffdf8; }
.pi-chat-actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 9px; }
#pi-chat-compose button[type="submit"] { min-height: 40px; padding: 8px 18px; line-height: 1.25; }
#pi-chat-resize { display: none; }
@media (min-width: 1120px) {
  #chapter-reader-app { --chat-min: 365px; --chat-max: min(66vw, calc(100vw - 540px));
    --chat-width: clamp(var(--chat-min), var(--chat-preferred, clamp(365px, 34vw, 485px)), var(--chat-max)); }
  #pi-chat-resize { display: grid; place-items: center; position: absolute; inset: 0 auto 0 0;
    z-index: 1; width: 16px; cursor: ew-resize; touch-action: none; }
  #pi-chat-resize::before { content: ''; width: 3px; height: 34px; border-radius: 3px; background: #9db7a8; }
  #pi-chat-resize:is(:hover, :focus-visible, [data-dragging])::before { background: var(--deep); }
  #pi-chat-resize:focus-visible { outline-offset: -3px; }
  html:has(#pi-chat-resize[data-dragging]) * { cursor: ew-resize; user-select: none; }
  #chapter-reader-app:has(#pi-chat[open]) { padding-right: var(--chat-width); grid-template-columns: 185px minmax(0, 1fr); }
  #chapter-reader-app:has(#pi-chat[open]) .player { right: var(--chat-width); }
  #chapter-reader-app:has(#pi-chat[open]) .chapter-flow[data-refs] { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) { #pi-chat { width: 100%; } }
@media (prefers-reduced-motion: no-preference) {
  #pi-chat[open] { animation: pi-chat-in .18s ease-out; }
  @keyframes pi-chat-in { from { transform: translateX(100%); } }
}
.pi-chat-controls { display:flex; align-items:center; gap:8px; flex:none;
  padding:var(--chat-header-top) var(--chat-header-right) 2px 12px; font-size:13px; }
#pi-chat-lock { height:32px; padding-inline:9px; }
#pi-chat-lock[hidden] { display:none; }
#pi-chat-photo-context:not([hidden]) { padding:4px 16px; max-height:30%; overflow:auto; flex:none; font-size:13px; }
#pi-chat-photo-context img { max-height:90px; max-width:100%; }
#pi-chat-photo-context p { white-space:pre-wrap; }
#pi-chat .pi-chat-controls label { display:flex; align-items:center; gap:5px; margin:0; }
#pi-chat .pi-chat-controls input { width:auto; }
.passage-photos { margin-top:12px; font:13px var(--sans); }
.photo-actions label:not([hidden]) { display:inline-block; color:var(--deep); }
.photo-target select { display:block; max-width:min(100%, 34rem); margin:4px 0 8px; }
.photo-actions input, .photo-actions textarea { display:block; margin:8px 0; max-width:100%; }
.photo-actions .page-answer:not([hidden]) { display:block; }
.photo-actions textarea { width:100%; padding:8px; border:1px solid var(--line); border-radius:6px; background:#fffdf8; }
.pi-chat-plain img { display:block; max-width:100%; max-height:220px; object-fit:contain; }
.pi-chat-plain a[download], .photo-list a[download] { color:var(--deep); text-decoration:underline; }
.photo-preview:not([hidden]), .photo-list img { display:block; max-width:100%; max-height:220px; object-fit:contain; }
.photo-list article { margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.photo-list p { white-space:pre-wrap; margin:6px 0; }
.photo-error:not(:empty) { color:#9b302b; margin:8px 0; }

/* Compact practice submission controls, shown only on questions accepting input. */
.photo-actions .page-answer:not([hidden]) { font-weight:650; }
.photo-actions textarea { margin:6px 0 12px; min-height:76px; border-color:#9db7a8; font:400 15px/1.45 var(--sans); resize:vertical; }
.attachment-picker[hidden], .attachment-choice[hidden], .attachment-selected[hidden] { display:none; }
.attachment-buttons { display:flex; flex-wrap:wrap; gap:8px; }
.photo-actions .attachment-choice:not([hidden]) { position:relative; display:inline-flex; align-items:center; min-height:38px; padding:7px 12px; border:1px solid #9db7a8; border-radius:7px; background:#fffdf8; color:var(--deep); font-weight:650; cursor:pointer; }
.attachment-choice:hover { background:#e6ecdf !important; }
.attachment-choice:focus-within { outline:2px solid var(--deep); outline-offset:2px; }
.photo-actions .attachment-choice input { position:absolute; width:1px; height:1px; margin:0; opacity:0; }
.attachment-selected:not([hidden]) { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:10px; padding:8px; border:1px solid var(--line); border-radius:7px; background:#fffdf8; }
.attachment-selected .photo-preview:not([hidden]) { max-width:100px; max-height:75px; border-radius:4px; }
.attachment-name { flex:1 1 130px; overflow-wrap:anywhere; }
.attachment-remove { color:var(--deep); border:1px solid #9db7a8; border-radius:7px; padding:6px 9px; background:#fffdf8; }
.photo-submit.uk-btn { min-height:40px; padding:8px 15px; margin-top:12px; }

.photo-submit[hidden], [data-answer][hidden] { display:none !important; }

.curated-video{display:block;width:100%;aspect-ratio:16/9;border:0;border-radius:8px;margin-bottom:12px}.session-actions{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}.question-diagrams{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:12px;margin-top:16px}.question-diagrams img{max-width:100%;height:auto;align-self:start;background:white}.chapter-passage.transcript+.chapter-passage.transcript{margin-top:1em}#chapter-reader-app:has([data-page-kind="assessment"]) .pi-chat-trigger{display:none}

.book-figure figcaption{font:13px/1.45 var(--sans);margin-top:6px;color:var(--muted)}
.math-ready .math-original{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.math-ready[data-display]{display:block;max-width:100%;overflow-x:auto}
.math-ready:not([data-display]):has([data-spoken]) .math-typeset,.math-ready[data-display]:has([data-spoken]) .katex{background:var(--gold);color:#21231c;border-radius:3px}

.key-word{font-weight:700;background:color-mix(in srgb,var(--deep) 12%,transparent);border-radius:.12em}
#starting-task{margin-top:18px}.source-credit{display:block;margin-top:18px;font:12px/1.5 var(--sans);color:var(--muted)}
.contents-link{display:block;margin:16px 0;font:600 14px/1.4 var(--sans)}
.part-link{display:block;font-weight:600;line-height:1.45}
.part-pages{margin:10px 0 4px;padding-left:20px;font:13px/1.5 var(--sans)}
.part-pages li{margin:7px 0}.part-pages a[aria-current="page"]{font-weight:700;text-decoration:underline}
#lesson-contents{margin-top:28px}#lesson-contents>ol{list-style:none;padding:0}
#lesson-contents li{padding:14px 0;border-bottom:1px solid #deddd4}
#lesson-contents li>a{font:600 18px/1.5 var(--sans)}
#lesson-contents li>p{font:15px/1.55 var(--sans);margin:6px 0 0;color:var(--muted)}
@media(max-width:740px){
  #chapter-index{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  #chapter-index .chapter-toc-section{display:block}
  #chapter-index .part-pages{display:none}
  #chapter-index .part-link{font-size:12px;padding:7px}
  #chapter-sidebar .brand strong{font-size:19px}
  .contents-link{margin:9px 0}
}
