/* The book stays light while navigation and conversation use a dark study
 * workspace. Desktop panels share a grid; below 950px the side panels become
 * independent drawers so the reading column keeps a usable width. Math and
 * long source passages scroll within their own surfaces, never the document. */
:root {
  color-scheme:dark;
  --chrome:#202421;
  --panel:#252a26;
  --panel-hover:#313832;
  --line:#384139;
  --muted:#a2ada4;
  --accent:#bad1a9;
  --paper:#fbfaf5;
  --ink:#2a3029;
  --paper-line:#e1e3d9;
  --reading-size:19px
}

* {
  box-sizing:border-box
}

html,body {
  margin:0;
  height:100%;
  overflow:hidden
}

body {
  font:13px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--chrome);
  color:#edf0e8
}

button,input,select,textarea {
  font:inherit
}

button {
  cursor:pointer
}

button:disabled {
  opacity:.35;
  cursor:default
}

button,input,select,textarea {
  outline-offset:3px
}

button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible {
  outline:2px solid var(--accent)
}

a {
  color:inherit
}

button {
  color:inherit
}

button[hidden],[hidden] {
  display:none!important
}

.workspace-header {
  height:52px;
  display:flex;
  align-items:center;
  gap:17px;
  padding:0 18px;
  border-bottom:1px solid var(--line);
  background:#1b201c
}

.brand {
  font:21px Georgia,serif;
  letter-spacing:-.5px;
  text-decoration:none;
  white-space:nowrap;
  display:flex;
  align-items:center;
  gap:7px
}

.brand-dot {
  height:5px;
  width:5px;
  border-radius:50%;
  background:var(--accent)
}

.header-divider {
  height:18px;
  width:1px;
  background:var(--line)
}

/* The current title doubles as the resource switcher. Keep the native select
 * so opening and keyboard selection work without maintaining a second menu.
 * The decorative chevron does not intercept clicks on the control beneath it. */
.resource-picker {
  position:relative;
  min-width:0;
  /* Desktop names include full authors; reserve enough width for identification
   * while allowing the native control to shrink on narrower reading windows. */
  max-width:min(760px,60vw);
  flex:0 1 auto
}

.resource-picker::after {
  content:"";
  position:absolute;
  right:15px;
  top:13px;
  width:8px;
  height:8px;
  border-right:2px solid var(--accent);
  border-bottom:2px solid var(--accent);
  transform:rotate(45deg);
  pointer-events:none
}

.book-heading {
  appearance:none;
  display:block;
  width:100%;
  max-width:100%;
  height:36px;
  padding:0 38px 0 13px;
  border:1px solid #53644d;
  border-radius:6px;
  background:#2b342c;
  color:#f0f4eb;
  font-size:15px;
  font-weight:600;
  text-overflow:ellipsis;
  cursor:pointer
}

.book-heading:hover,.book-heading:focus-visible {
  border-color:var(--accent);
  background:#354031
}

.book-heading:disabled {
  color:var(--muted);
  cursor:wait
}

.workspace-header>.brand,.workspace-header>.icon-button,.workspace-header>.text-button {
  flex-shrink:0;
  white-space:nowrap
}

.muted,.quiet {
  color:var(--muted)
}

.header-spacer {
  flex:1
}

.scope-tag {
  min-width:0;
  max-width:26vw;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:10px;
  color:var(--muted);
  letter-spacing:.3px
}

.icon-button,.text-button,.quiet-button {
  background:transparent;
  border:0;
  border-radius:4px;
  padding:5px 8px
}

.icon-button {
  font-size:17px
}

.text-button {
  font-size:11px;
  border:1px solid var(--line);
  padding:5px 10px
}

.text-button:hover,.quiet-button:hover,.icon-button:hover {
  background:var(--panel-hover)
}

.quiet-button {
  font-size:10px;
  color:var(--muted)
}

.workspace {
  height:calc(100dvh - 52px);
  display:grid;
  grid-template-columns:248px minmax(0,1fr) 354px
}

.panel {
  min-width:0;
  background:var(--panel)
}

.panel-heading {
  height:51px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:10px;
  letter-spacing:1.5px;
  padding:0 18px
}

.panel-heading .quiet {
  font-size:10px;
  letter-spacing:0
}

.navigation {
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  overflow:hidden
}

.search-wrap {
  display:flex;
  align-items:center;
  gap:6px;
  margin:0 12px 16px;
  border:1px solid #414a41;
  border-radius:5px;
  background:#202521;
  padding:6px 9px
}

.search-wrap>span {
  font-size:18px;
  color:var(--muted)
}

.search-wrap input {
  min-width:0;
  width:100%;
  color:#eef0e8;
  background:transparent;
  border:0;
  font-size:11px;
  padding:3px 0;
  outline:0
}

.search-wrap input::placeholder {
  color:#89978b
}

.tree,.search-results {
  overflow:auto;
  flex:1;
  scrollbar-width:thin;
  scrollbar-color:#4c574c transparent;
  padding:0 10px 24px
}

.tree details {
  margin:0
}

.tree summary {
  list-style:none;
  cursor:pointer;
  padding:7px 6px;
  color:#c9d2c8;
  display:flex;
  align-items:center;
  gap:7px;
  font-size:11px;
  user-select:none
}

.tree summary::-webkit-details-marker {
  display:none
}

.tree summary::before {
  content:'›';
  width:9px;
  color:#869484;
  transform:rotate(0deg);
  font-size:15px;
  line-height:1
}

.tree details[open]>summary::before {
  transform:rotate(90deg)
}

.tree .tree-children {
  margin-left:10px;
  border-left:1px solid #394136;
  padding-left:7px
}

.tree details.root>.tree-children {
  margin-left:6px
}

.tree summary:hover {
  background:#2c352d
}

.tree button,.search-results button {
  width:100%;
  text-align:left;
  background:transparent;
  border:0;
  padding:7px 8px;
  margin:1px 0;
  font-size:11px;
  display:flex;
  gap:7px;
  align-items:flex-start;
  border-radius:4px;
  color:#b4c0b3;
  line-height:1.5
}

.tree button:hover,.search-results button:hover {
  background:var(--panel-hover);
  color:white
}

.tree button.active {
  background:#3c4b38;
  color:#e5f0d9
}

.tree .leaf-page {
  font:10px ui-monospace,monospace;
  opacity:.65;
  flex-shrink:0;
  min-width:18px;
  text-align:right
}

.tree .leaf-label {
  flex:1
}

.tree .leaf-dot {
  color:#809177;
  font-size:9px;
  padding-top:2px
}

.search-results button {
  display:block;
  padding:9px 8px
}

.search-results .result-title {
  display:block;
  color:#e0e8d9;
  font-size:12px
}

.search-results .result-excerpt {
  display:block;
  margin-top:3px;
  color:#98a795;
  font-size:10px
}

.search-empty {
  color:var(--muted);
  padding:12px;
  font-size:12px
}

.nav-footer {
  border-top:1px solid var(--line);
  padding:14px 17px 17px;
  font-size:10px;
  color:#9dab99;
  flex-shrink:0
}

.nav-footer a {
  display:block;
  margin:8px 0 0 11px;
  color:#8d9f87;
  text-decoration:none
}

.nav-footer a:hover {
  text-decoration:underline
}

/* Optional help stays usable without a community destination. Location fields
   are plain, selectable metadata; long hashes cannot widen the navigation. */
.reading-help { padding:12px 17px; border-top:1px solid var(--line); color:#b9c6b4; font-size:12px; overflow:auto; flex-shrink:0; max-height:55vh }
.reading-help summary { cursor:pointer }
.reading-help a { display:block; color:#b9c6b4; margin:10px 0 }
.reading-help [hidden] { display:none }
.reading-help textarea { display:block; width:100%; box-sizing:border-box; resize:vertical; min-height:110px; background:#18211b; color:#e4ebdf; border:1px solid var(--line); padding:8px; font:11px/1.5 monospace }
.reading-help button { margin-top:8px; padding:7px 10px }
.reading-help p { line-height:1.5 }

.small-dot {
  display:inline-block;
  width:5px;
  height:5px;
  background:var(--accent);
  border-radius:50%;
  margin-right:6px
}

.small-dot.error {
  background:#dfad89
}

.center-panel {
  min-width:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:var(--paper);
  color:var(--ink);
  color-scheme:light
}

.reader-toolbar {
  height:58px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:0 25px;
  border-bottom:1px solid var(--paper-line)
}

.breadcrumbs {
  font-size:11px;
  min-width:0;
  display:flex;
  gap:9px;
  align-items:center;
  color:#75806f;
  white-space:nowrap;
  overflow:hidden
}

.breadcrumbs strong {
  font-weight:500;
  color:#475341;
  overflow:hidden;
  text-overflow:ellipsis
}

.crumb-divider {
  color:#c4ccbf
}

.mode-switch {
  display:flex;
  background:#eceee5;
  border-radius:6px;
  padding:3px;
  flex-shrink:0
}

.mode-switch button {
  border:0;
  border-radius:4px;
  background:transparent;
  font-size:11px;
  padding:5px 11px;
  color:#65705d
}

.mode-switch button[aria-pressed=true] {
  background:var(--paper);
  color:#253f25;
  box-shadow:0 1px 3px #1826161a
}

.page-toolbar {
  height:53px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 25px;
  flex-shrink:0
}

.pagination {
  display:flex;
  align-items:center;
  gap:11px;
  font-size:11px;
  color:#6d7965
}

.pagination label {
  white-space:nowrap
}

.pagination select {
  color:#263822;
  background:transparent;
  border:0;
  font-weight:600;
  padding:3px 1px;
  cursor:pointer
}

.page-arrow {
  border:0;
  background:transparent;
  color:#42583c;
  font-size:17px;
  padding:1px 4px
}

.page-position {
  font-size:10px;
  color:#8c9784
}

.size-control {
  display:flex;
  gap:8px;
  align-items:center;
  font:13px Georgia,serif;
  color:#53654a
}

.size-control input {
  width:68px;
  height:3px;
  accent-color:#627e4c
}

.reader-scroll {
  overflow:auto;
  flex:1;
  min-height:0;
  scrollbar-width:thin;
  scrollbar-color:#c4cdba transparent;
  scroll-behavior:auto
}

.formatted-page {
  max-width:790px;
  padding:25px clamp(28px,5vw,70px) 35px;
  margin:0 auto;
  font-family:Georgia,"Times New Roman",serif;
  font-size:var(--reading-size);
  line-height:1.75;
  overflow-wrap:break-word;
  min-height:62vh
}

.formatted-page h1,.formatted-page h2,.formatted-page h3 {
  font-family:system-ui,sans-serif;
  line-height:1.35;
  letter-spacing:-.6px
}

.formatted-page h1 {
  font-size:1.6em;
  font-weight:500;
  margin:.2em 0 .8em
}

.formatted-page h2 {
  font-size:1.07em;
  margin:1.8em 0 1em;
  font-weight:600;
  letter-spacing:.1px
}

.formatted-page h3 {
  font-size:1em;
  margin:1.5em 0 .7em;
  letter-spacing:0
}

.formatted-page p {
  margin:.75em 0
}

.formatted-page [data-block-id] {
  position:relative;
  scroll-margin-top:22px
}

.formatted-page [data-block-id].active-block::before {
  content:'';
  position:absolute;
  left:-20px;
  top:4px;
  bottom:4px;
  width:2px;
  background:#9eaf87;
  border-radius:2px
}

.formatted-page .katex {
  font-size:1.03em
}

.katex-display {
  overflow-x:auto;
  overflow-y:hidden;
  padding:6px 0;
  max-width:100%
}

.formatted-page ::selection {
  background:#d7e3c2
}

.continuation {
  max-width:650px;
  margin:16px auto 0;
  padding:9px 15px;
  font:11px system-ui,sans-serif;
  color:#758063;
  border-left:2px solid #b6c4a2;
  background:#f0f2e8
}

.page-end {
  max-width:650px;
  margin:0 auto;
  padding:20px 25px 35px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-top:1px solid #e5e7dd;
  font-size:11px;
  color:#909b82
}

.page-end button {
  background:transparent;
  border:0;
  color:#587045;
  padding:5px 0;
  font-size:11px
}

.reader-status {
  height:29px;
  border-top:1px solid var(--paper-line);
  padding:0 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:9px;
  color:#78876d;
  flex-shrink:0
}

.reader-status span {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.pdf-surface {
  padding:12px 24px 25px;
  min-height:65vh;
  text-align:center;
  background:#e8eae2
}

.pdf-sheet {
  position:relative;
  display:inline-block;
  box-shadow:0 4px 20px #3445291a;
  line-height:0;
  background:white;
  max-width:100%
}

.pdf-sheet canvas {
  display:block;
  max-width:100%;
  height:auto
}

.pdf-scope-overlay {
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  background:#fafbf2d9;
  border-top:1px dashed #97a784;
  color:#768367;
  font:11px/1.5 system-ui,sans-serif;
  padding:12px
}

.pdf-loading {
  padding:60px 20px;
  color:#859079;
  font-size:13px
}

.reader-error {
  margin:25px;
  padding:20px;
  border:1px solid #d8bfa1;
  border-radius:6px;
  color:#785431;
  background:#fff8ec
}

.chat-panel {
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
  border-left:1px solid var(--line)
}

.chat-model {
  display:flex;
  gap:5px;
  align-items:center;
  margin:-5px 18px 16px;
  font-size:11px
}

.chat-model .quiet {
  margin-left:auto;
  font-size:9px
}

.context-card {
  margin:0 15px 15px;
  padding:11px 13px;
  border:1px solid #44523d;
  border-radius:6px;
  background:#2d362b;
  flex-shrink:0
}

.context-eyebrow {
  font-size:8px;
  letter-spacing:1.1px;
  color:#9bb08c;
  margin-bottom:5px;
  display:flex;
  justify-content:space-between
}

.context-eyebrow span {
  letter-spacing:0;
  opacity:.6
}

.context-card strong {
  font-size:12px;
  display:block;
  font-weight:500;
  color:#e4ecd9
}

.context-card>span {
  display:block;
  color:#9cab90;
  font-size:10px;
  margin-top:2px
}

.selection-chip {
  margin-top:10px;
  display:flex;
  gap:7px;
  align-items:center;
  border-top:1px solid #4b5842;
  padding-top:8px
}

.selection-chip span {
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  font:11px/1.6 Georgia,serif;
  color:#d7e2c8
}

.selection-chip button {
  background:none;
  border:0;
  padding:2px;
  font-size:16px;
  color:#aabda0
}

.messages {
  flex:1;
  overflow:auto;
  scrollbar-width:thin;
  scrollbar-color:#4c574c transparent;
  padding:0 18px 20px;
  min-height:0
}

.chat-welcome {
  padding:25px 4px 5px
}

.companion-mark {
  font:32px Georgia,serif;
  color:#b6cba5
}

.chat-welcome h2 {
  font:22px/1.3 Georgia,serif;
  letter-spacing:-.2px;
  color:#e1e8d7;
  max-width:220px;
  font-weight:400;
  margin:18px 0 12px
}

.chat-welcome p {
  color:#98a791;
  font-size:12px;
  line-height:1.7;
  margin-bottom:24px
}

.suggestions {
  display:flex;
  flex-direction:column;
  gap:7px
}

.suggestions button {
  border:1px solid #414c3d;
  background:transparent;
  color:#bfcbb7;
  padding:9px 11px;
  text-align:left;
  font-size:11px;
  border-radius:5px;
  display:flex;
  justify-content:space-between
}

.suggestions button:hover {
  background:#34412f;
  border-color:#607554
}

.suggestions span {
  color:#8fa27f
}

.message {
  margin:16px 0 24px;
  font-size:12px;
  line-height:1.75;
  overflow-wrap:anywhere
}

.message-meta {
  font-size:9px;
  color:#98a88e;
  display:flex;
  justify-content:space-between;
  margin-bottom:6px
}

.message.user .message-body {
  padding:11px 13px;
  border-radius:7px;
  background:#35432f;
  color:#e5eddc
}

.message.assistant .message-body {
  color:#d7dfcd
}

.message.assistant .message-meta {
  color:#afc597
}

.message.assistant p {
  margin:0 0 10px
}

.message.assistant .katex {
  font-size:1.1em
}

.message.assistant ol,.message.assistant ul {
  padding-left:18px
}

.message.assistant pre {
  white-space:pre-wrap;
  background:#1b241d;
  padding:10px;
  border-radius:5px;
  font-size:11px
}

.message-context {
  border:0;
  background:none;
  color:#8ea37c;
  font-size:9px;
  padding:0;
  cursor:pointer;
  max-width:80%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.message-context:hover {
  color:#d4e5be
}

.source-citation {
  display:inline-block;
  border:1px solid #536449;
  background:#34432c;
  border-radius:4px;
  color:#c7ddb4;
  padding:0 5px;
  margin:0 2px;
  font-size:10px;
  line-height:1.7;
  white-space:nowrap;
  cursor:pointer
}

.message-error {
  padding:10px;
  border:1px solid #8c7156;
  background:#3f3328;
  border-radius:5px;
  color:#e0c3a1;
  font-size:11px
}

.retry-button {
  display:block;
  margin-top:8px;
  border:1px solid #947454;
  border-radius:4px;
  background:none;
  padding:4px 10px;
  color:#e8d1b3;
  font-size:11px
}

.message-pending {
  font-size:11px;
  color:#a7b999
}

.message-pending::after {
  content:' …';
  animation:pulse 1.2s infinite
}

@keyframes pulse {
  50% {
    opacity:.3
  }
}

.composer {
  margin:0 14px;
  border:1px solid #57664e;
  border-radius:7px;
  background:#1f281f;
  padding:10px 11px 8px;
  flex-shrink:0
}

.composer:focus-within {
  border-color:#99b27d
}

.composer textarea {
  width:100%;
  resize:none;
  border:0;
  background:transparent;
  color:#e6eddd;
  outline:0;
  line-height:1.6;
  font-size:12px;
  min-height:61px;
  max-height:150px
}

.composer textarea::placeholder {
  color:#839179
}

.composer-bottom {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px
}

.composer-bottom span {
  font-size:8px;
  color:#849377
}

.composer-bottom button {
  background:#b9ce9f;
  color:#23321d;
  border:0;
  border-radius:5px;
  width:29px;
  height:29px;
  font-size:18px;
  line-height:1
}

.composer-bottom #stop {
  font-size:10px;
  width:40px;
  background:#4d5a44;
  color:#d7e2ca
}

.chat-footnote {
  padding:9px 13px 13px;
  font-size:8px;
  text-align:center;
  color:#7a8b72
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap
}

.nav-hidden .workspace {
  grid-template-columns:minmax(0,1fr) 354px
}

.nav-hidden #navigation {
  display:none
}

.chat-hidden .workspace {
  grid-template-columns:248px minmax(0,1fr)
}

.chat-hidden #chat-panel {
  display:none
}

.nav-hidden.chat-hidden .workspace {
  grid-template-columns:minmax(0,1fr)
}

@media(min-width:1500px) {
  .workspace {
    grid-template-columns:266px minmax(0,1fr) 384px
  }
  .nav-hidden .workspace {
    grid-template-columns:minmax(0,1fr) 384px
  }
  .chat-hidden .workspace {
    grid-template-columns:266px minmax(0,1fr)
  }
}

@media(max-width:1150px) {
  .workspace {
    grid-template-columns:210px minmax(0,1fr) 306px
  }
  .panel-heading {
    padding:0 13px
  }
  .reader-toolbar {
    padding:0 17px
  }
  .breadcrumbs>span {
    display:none
  }
  .page-toolbar {
    padding:0 17px
  }
  .formatted-page {
    padding:20px 32px 30px
  }
  .nav-hidden .workspace {
    grid-template-columns:minmax(0,1fr) 306px
  }
  .chat-hidden .workspace {
    grid-template-columns:210px minmax(0,1fr)
  }
}

@media(max-width:950px) {
  .workspace,.nav-hidden .workspace,.chat-hidden .workspace,.nav-hidden.chat-hidden .workspace {
    grid-template-columns:minmax(0,1fr)
  }
  #navigation {
    position:fixed;
    top:52px;
    bottom:0;
    left:0;
    width:260px;
    z-index:10;
    box-shadow:10px 0 45px #0005
  }
  #chat-panel {
    position:fixed;
    top:52px;
    bottom:0;
    right:0;
    width:350px;
    max-width:100%;
    z-index:11;
    box-shadow:-10px 0 45px #0005
  }
  .scope-tag {
    display:none
  }
  .book-heading {
    font-size:13px
  }
  .reader-scroll {
    scrollbar-width:thin
  }
  .formatted-page {
    max-width:740px;
    padding:25px 45px 35px
  }
  .continuation {
    margin-left:25px;
    margin-right:25px
  }
}

@media(max-width:520px) {
  .workspace-header {
    gap:9px;
    padding:0 10px
  }
  .brand {
    font-size:18px
  }
  .header-divider,.header-spacer {
    display:none
  }
  .resource-picker {
    flex:1;
    max-width:none
  }
  .book-heading {
    padding-left:9px;
    padding-right:28px
  }
  .resource-picker::after {
    right:11px
  }
  .reader-toolbar {
    height:58px;
    padding:0 13px;
    gap:7px
  }
  .breadcrumbs {
    font-size:10px
  }
  .mode-switch button {
    font-size:10px;
    padding:5px 8px
  }
  .page-toolbar {
    padding:0 13px
  }
  .page-position {
    display:none
  }
  .formatted-page {
    padding:17px 27px 28px
  }
  .formatted-page [data-block-id].active-block::before {
    left:-13px
  }
  .reader-status {
    padding:0 12px;
    font-size:8px
  }
  .pdf-surface {
    padding:8px
  }
  .size-control input {
    width:55px
  }
  .pagination {
    gap:6px
  }
}

/* Continuous source pages keep layout boundaries independent of loading.
 * The reading margin is intentionally small; hierarchy belongs in the side
 * panel, not in a second large gutter inside the text column. */
.formatted-page{max-width:none;padding:0;min-height:0}
.formatted-source-page{padding:12px 18px 25px;margin:0;max-width:none;border-bottom:1px solid var(--paper-line);scroll-margin-top:0}
.source-page-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;font:10px/1.4 system-ui,sans-serif;letter-spacing:.35px;color:#7d896f;padding:8px 0 13px;user-select:none}
.source-page-continuation{padding:7px 10px;margin:0 0 14px;background:#f0f3e8;border-left:3px solid #a6b58d;color:#687657;font:11px/1.5 system-ui,sans-serif}
/* The build supplies intrinsic width/height from the figure crop. Preserve
 * that ratio before the image arrives, while fitting narrow reading columns. */
.source-figure{margin:18px 0;max-width:100%}
.source-figure img{display:block;max-width:100%;height:auto;margin:0 auto}
.source-figure figcaption{margin-top:7px;font:11px/1.5 system-ui,sans-serif;color:#687657;text-align:center}
/* Prose cells wrap naturally; matrices and unusually wide source tables may
 * scroll locally. Native table elements keep their header/cell relationships. */
.source-table-scroll{max-width:100%;overflow-x:auto;overflow-y:hidden;margin:16px 0;border:1px solid #d6ddca;border-radius:4px;scrollbar-width:thin}
.source-table-scroll:focus-visible{outline:2px solid #678149;outline-offset:3px}
.source-table-scroll table{border-collapse:collapse;width:100%;min-width:30rem;margin:0;font-size:.9em;line-height:1.6}
.source-table-scroll th,.source-table-scroll td{padding:9px 11px;border-bottom:1px solid #d6ddca;vertical-align:top;white-space:normal}
.source-table-scroll td.source-prose-cell{min-width:14rem}
.source-table-scroll th{text-align:left;background:#edf2e5;font-family:system-ui,sans-serif;font-size:.9em;font-weight:600}
.source-table-scroll tr:last-child td{border-bottom:0}
.formatted-page :not(.katex-display)>.katex{display:inline-block;max-width:100%;overflow-x:auto;overflow-y:hidden;vertical-align:middle;padding:2px 0}
.formatted-page [data-block-id]{border-radius:4px;transition:background-color .12s,box-shadow .12s}
.formatted-page [data-block-id].topic-highlight{background:#edf2e2}
.formatted-page [data-block-id].active-block{background:#edf2e2;box-shadow:inset 3px 0 #8fa56e}
.formatted-page [data-block-id].topic-target{background:#e0ebce;box-shadow:inset 4px 0 #678149,0 0 0 2px #b2c497}
.formatted-page [data-block-id].active-block::before{display:none}
.tree .exercise-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin:5px 0 10px;padding:5px 3px;border-left:0}
.tree button.exercise-number{display:flex;align-items:center;justify-content:center;margin:0;padding:6px 2px;min-height:30px;border:1px solid #46513f;background:#2b332a;font-size:11px;font-variant-numeric:tabular-nums}
.tree button.exercise-number.active{background:#c0d2a9;color:#203119;border-color:#c0d2a9;font-weight:650}
.tree button.exercise-number:hover{border-color:#829b6c;background:#465b39;color:#eff6e6}
.pdf-surface{padding:0 12px 20px;min-height:0}
.pdf-page-slot{padding:8px 0 20px;max-width:960px;margin:0 auto}
.pdf-sheet{display:block;width:100%;max-width:960px;position:relative;overflow:hidden}
.pdf-sheet canvas{position:absolute;inset:0;width:100%;height:100%;max-width:none}
.pdf-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:20px;font:12px system-ui,sans-serif}
.pdf-scope-overlay{z-index:1}
.reader-scroll{overflow-anchor:none}
.page-end{max-width:none}
.page-loading{padding:35px 15px;color:#7d896f;font:12px system-ui,sans-serif}
.source-quality{padding:8px 12px;margin:4px 0 12px;background:#fff4dc;border-left:3px solid #c2a265;font:11px/1.5 system-ui,sans-serif;color:#6d562b}
.source-quality summary{cursor:pointer}
.source-quality li{margin:6px 0}
.source-render-warning{padding:10px;background:#fff0d5;color:#70511c;font:12px/1.5 system-ui,sans-serif}
.source-unrendered{white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.6 monospace}
@media(max-width:1150px){.formatted-page{padding:0}.formatted-source-page{padding-left:16px;padding-right:16px}}
@media(max-width:950px){.formatted-page{padding:0;max-width:none}}
@media(max-width:520px){.formatted-page{padding:0}.formatted-source-page{padding:10px 14px 22px}.pdf-surface{padding:0 8px 15px}.tree .exercise-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.source-page-heading{font-size:9px}}
