@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-400.woff2?v=20261122-r2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-500.woff2?v=20261122-r2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-600.woff2?v=20261122-r2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-700.woff2?v=20261122-r2") format("woff2");
}
:root {
  --ink: #20263c;
  --muted: #7b8499;
  --violet: #6554d9;
  --violet-light: #f0edff;
  --line: #e8eaf1;
  --surface: #f7f8fc;
  --dark: #2b3151;
  --radius: 13px;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font:
    14px/1.55 Inter,
    "Segoe UI",
    Arial,
    sans-serif;
  background: var(--surface);
  color: var(--ink);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid #b9adfa;
  outline-offset: 3px;
}
button,
a {
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled),
a:hover {
  color: var(--violet);
}
[hidden] {
  display: none !important;
}
.skip-link {
  position: fixed;
  top: -90px;
  left: 16px;
  background: white;
  padding: 12px;
  z-index: 100;
}
.skip-link:focus {
  top: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.reader-header {
  height: 80px;
  padding: 0 34px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 30px;
  position: relative;
  z-index: 20;
}
.back-link {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6e7790;
}
.back-link span {
  font-size: 18px;
  font-weight: 400;
}
.reader-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.25;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.brand-icon {
  height: 35px;
  width: 35px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--violet);
  color: white;
  font-weight: 750;
  font-size: 20px;
  box-shadow: 0 3px 9px #6757d921;
}
.brand-subtitle {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15px;
  color: #9aa2b2;
  margin-top: 4px;
}
.reader-label {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 1.7px;
  color: #9aa2b4;
  font-weight: 650;
}
.mobile-sources {
  display: none !important;
}
.reader-layout {
  display: flex;
  height: calc(100dvh - 80px);
  min-height: 300px;
}
.source-sidebar {
  width: 275px;
  min-width: 275px;
  background: white;
  padding: 25px 21px 17px;
  border-right: 1px solid var(--line);
  overflow: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
}
.sidebar-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
}
.sidebar-heading h2 {
  font-size: 16px;
  letter-spacing: -0.25px;
  margin: 0;
  font-weight: 650;
}
.sidebar-count {
  font-size: 9px;
  color: #929bb0;
  background: #f4f5fa;
  border-radius: 20px;
  padding: 3px 7px;
  margin-left: auto;
  white-space: nowrap;
}
.subsection-field > span {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #a0a7b7;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.subsection-field select {
  width: 100%;
  height: 39px;
  border: 1px solid #e0e4ee;
  border-radius: 8px;
  background: #fff;
  padding: 0 9px;
  font-size: 11px;
  outline-offset: 2px;
}
.section-context {
  font-size: 10px;
  color: #929bae;
  line-height: 1.6;
  margin: 10px 1px 21px;
}
.section-context strong {
  font-weight: 500;
  color: #6f7b94;
}
.source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.source-item {
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  width: 100%;
}
.source-item:hover:not(:disabled) {
  background: #f7f6ff;
}
.source-item.active {
  border-color: #ded7fb;
  background: var(--violet-light);
}
.source-item.active .source-name {
  color: #6652c3;
}
.source-icon {
  height: 33px;
  width: 31px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f0f3f8;
  color: #7d8daa;
  flex-shrink: 0;
}
.source-item.active .source-icon {
  background: #e3dcff;
  color: #6f58c8;
}
.source-item[data-source="edexcel"] .source-icon {
  background: #edf2ff;
  color: #6686cf;
}
.source-item[data-source="cgp"] .source-icon {
  background: #fff0e7;
  color: #c58e60;
}
.source-item[data-source="mgs"] .source-icon {
  background: #eaf6f2;
  color: #6f9f91;
}
.source-item[data-source="savemyexams"] .source-icon {
  background: #f3edff;
  color: #8f71bf;
}
.source-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.65;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.source-name {
  font-size: 11px;
  font-weight: 600;
  color: #52617c;
}
.source-name small {
  font-size: 9px;
  font-weight: 400;
  display: block;
  color: #9ba5b6;
  margin-top: 3px;
}
.source-arrow {
  font-size: 14px;
  color: #a9a3bf;
  margin-left: auto;
}
.source-item:disabled {
  opacity: 1;
  cursor: default;
  color: #acb3c2;
}
.source-item:disabled .source-name {
  color: #adb5c4;
}
.source-item:disabled .source-icon {
  opacity: 0.45;
}
.source-item.active .source-arrow {
  color: #6f58c8;
}
.chapter-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #eef0f5;
}
.eyebrow {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.7px;
  color: #949bb0;
}
.chapter-list {
  margin-top: 12px;
}
.chapter-item {
  width: 100%;
  text-align: left;
  padding: 11px 11px 11px 17px;
  border-left: 2px solid #e5e8f0;
  font-size: 11px;
  line-height: 1.6;
  color: #77849b;
  margin: 0 0 5px;
}
.chapter-item.active {
  border-left-color: var(--violet);
  background: #f8f6ff;
  color: #6552ba;
  border-radius: 0 8px 8px 0;
}
.chapter-item small {
  display: block;
  font-size: 9px;
  color: #9c9bb1;
  margin-top: 5px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 35px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #abb2c1;
}
.sidebar-bottom p {
  margin: 0;
  font-size: 9px;
  line-height: 1.7;
}
.sidebar-bottom small {
  display: block;
  font-size: 9px;
  color: #c0c6d1;
}
.mini-book {
  font-size: 16px;
}
.sidebar-scrim {
  position: fixed;
  inset: 80px 0 0;
  background: #21294750;
  z-index: 30;
}
.reader-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}
.document-heading {
  padding: 28px 42px 23px;
  background: white;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.heading-topline {
  display: flex;
  align-items: center;
  gap: 12px;
}
.heading-topline .eyebrow {
  color: #8c86a6;
}
.match-badge {
  font-size: 9px;
  color: #8b7a55;
  background: #f7f2e7;
  border: 1px solid #eee4cd;
  border-radius: 20px;
  padding: 2px 7px;
}
.document-heading h1 {
  font-size: 25px;
  letter-spacing: -0.65px;
  font-weight: 650;
  line-height: 1.3;
  margin: 10px 0 8px;
}
.document-description {
  font-size: 11px;
  color: #8590a5;
  margin: 0;
  line-height: 1.65;
}
.reading-context {
  font-size: 11px;
  color: #8c7a59;
  background: #fbf8f0;
  border-left: 2px solid #e1cf9e;
  padding: 8px 11px;
  border-radius: 0 6px 6px 0;
  margin: 14px 0 0;
  max-width: 850px;
}
.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  height: 58px;
  padding: 0 30px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.page-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}
.icon-button {
  height: 30px;
  width: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 20px;
  font-weight: 400;
  color: #7f8ba3;
  flex-shrink: 0;
}
.icon-button:hover:not(:disabled) {
  background: #f3f1fc;
  border-color: #e8e1fb;
  color: #6858be;
}
.page-controls .icon-button {
  font-size: 26px;
  line-height: 1;
}
.page-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #94a0b4;
}
.page-field input {
  width: 39px;
  height: 28px;
  border: 1px solid #e0e5ee;
  border-radius: 6px;
  text-align: center;
  font-size: 11px;
  background: #fff;
  appearance: textfield;
  -moz-appearance: textfield;
  padding: 0 3px;
}
.page-field input::-webkit-outer-spin-button,
.page-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.page-divider {
  color: #c2c8d3;
}
.original-page {
  font-size: 10px;
  color: #9ca6b7;
  border-left: 1px solid #e8ebf2;
  padding-left: 14px;
  margin-left: 4px;
}
.toolbar-spacer {
  flex: 1;
}
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}
.zoom-controls select {
  height: 30px;
  max-width: 90px;
  font-size: 10px;
  color: #75849d;
  background: white;
  border: 0;
  padding: 0 3px;
}
.toolbar-button {
  font-size: 10px;
  font-weight: 550;
  padding: 7px 10px;
  border: 1px solid #e5e7f0;
  background: #fff;
  color: #71809b;
  border-radius: 7px;
  white-space: nowrap;
}
.toolbar-button:hover:not(:disabled) {
  background: #f6f4ff;
  border-color: #ddd5f7;
}
.download-button {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #6955c5;
  border-color: #e4ddf9;
  background: #f8f6ff;
}
.download-button span:first-child {
  font-size: 16px;
  line-height: 1;
}
.full-book-toggle[aria-pressed="true"] {
  background: #f0edff;
  color: #6757bf;
}
.reader-stage {
  position: relative;
  flex: 1;
  min-height: 100px;
  overflow: auto;
  padding: 28px 34px 20px;
  background: #f1f3f8;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}
.page-stage {
  min-width: min-content;
  width: fit-content;
  min-height: 100%;
  margin: 0 auto;
}
.pdf-page {
  position: relative;
  display: block;
  background: white;
  box-shadow:
    0 2px 10px #1f31530b,
    0 0 0 1px #dce1ec;
  border-radius: 2px;
  margin: 0 auto;
  isolation: isolate;
  overflow: hidden;
}
.pdf-page canvas {
  display: block;
  position: relative;
  z-index: 0;
}
.page-caption {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  font-size: 9px;
  color: #a2adbf;
  line-height: 1.5;
  padding: 14px 0 0;
  max-width: 100%;
}
.text-toggle {
  color: #8c96ab;
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-text {
  background: white;
  color: #4e5e78;
  border: 1px solid #e0e6f0;
  border-radius: 9px;
  padding: 20px;
  font-size: 12px;
  line-height: 1.8;
  max-width: 900px;
  margin: 16px 0;
  white-space: pre-wrap;
}
.reader-status {
  min-height: 330px;
  max-width: 600px;
  margin: 4vh auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 35px;
  gap: 0;
}
.reader-status h2 {
  font-size: 16px;
  font-weight: 600;
  color: #65718b;
  margin: 22px 0 5px;
}
.reader-status p {
  font-size: 12px;
  line-height: 1.7;
  color: #949eb1;
  max-width: 420px;
  margin: 0;
}
.loading-ring {
  width: 29px;
  height: 29px;
  border: 2px solid #e2def4;
  border-top-color: #9280d9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.reader-status.error .loading-ring {
  border: 0;
  animation: none;
  background: #ede8fb;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  position: relative;
}
.reader-status.error .loading-ring:after {
  content: "!";
  font-size: 24px;
  color: #9581c9;
  line-height: 40px;
}
.progress-track {
  height: 3px;
  width: 150px;
  border-radius: 3px;
  background: #e4e5ef;
  margin-top: 22px;
  overflow: hidden;
}
.progress-track > div {
  height: 3px;
  background: #a89add;
  width: 4%;
  transition: width 0.2s ease;
}
.status-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}
.primary-link,
.secondary-button {
  font-size: 11px;
  border-radius: 8px;
  padding: 9px 12px;
  border: 1px solid #d9d4ec;
  background: white;
  color: #796ba7;
  font-weight: 550;
}
.primary-link {
  background: #7765c5;
  color: white;
  border-color: #7765c5;
}
.primary-link:hover {
  color: #fff;
  background: #6858b1;
}
.reader-footer {
  height: 37px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 33px;
  background: white;
  border-top: 1px solid var(--line);
  color: #9ca6b7;
  font-size: 9px;
  flex-shrink: 0;
}
.reader-footer a {
  margin-left: auto;
  color: #8b80a7;
  white-space: nowrap;
}
.no-script {
  position: fixed;
  z-index: 100;
  inset: 80px 0 0;
  background: #fff;
  padding: 40px;
  overflow: auto;
}
.no-script a {
  color: var(--violet);
}
/* Text selection layer follows PDF.js's sizing and transform contract. */
.textLayer {
  color-scheme: only light;
  position: absolute;
  text-align: initial;
  inset: 0;
  overflow: clip;
  opacity: 1;
  line-height: 1;
  letter-spacing: normal;
  word-spacing: normal;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  caret-color: CanvasText;
  z-index: 1;
  --min-font-size: 1;
  --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
  --min-font-size-inv: calc(1 / var(--min-font-size));
}
.textLayer :is(span, br) {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0 0;
  user-select: text;
  -webkit-user-select: text;
}
.textLayer > :not(.markedContent),
.textLayer .markedContent span:not(.markedContent) {
  z-index: 1;
  --font-height: 0;
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  --scale-x: 1;
  --rotate: 0deg;
  transform: rotate(var(--rotate)) scaleX(var(--scale-x))
    scale(var(--min-font-size-inv));
}
.textLayer .markedContent {
  display: contents;
}
.textLayer span[role="img"] {
  user-select: none;
  cursor: default;
}
.textLayer ::selection {
  background: #9483e570;
  color: transparent;
}
.textLayer br::selection {
  background: transparent;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
  .loading-ring {
    animation: none;
  }
}
@media (min-width: 1700px) {
  .source-sidebar {
    width: 300px;
    min-width: 300px;
    padding-left: 28px;
    padding-right: 28px;
  }
  .document-heading {
    padding-left: 55px;
  }
  .reader-toolbar {
    padding-left: 45px;
    padding-right: 45px;
  }
  .reader-stage {
    padding-top: 34px;
  }
}
@media (max-width: 1150px) {
  .source-sidebar {
    width: 245px;
    min-width: 245px;
    padding: 24px 16px;
  }
  .document-heading {
    padding: 24px 28px 20px;
  }
  .reader-toolbar {
    padding: 0 18px;
    gap: 7px;
  }
  .original-page {
    display: none;
  }
  .reader-stage {
    padding: 24px 22px 20px;
  }
  .reader-header {
    padding: 0 24px;
  }
  .reader-footer {
    padding: 0 24px;
  }
  .document-heading h1 {
    font-size: 22px;
  }
}
@media (max-width: 800px) {
  .reader-header {
    height: 65px;
    padding: 0 18px;
    gap: 20px;
  }
  .reader-layout {
    height: calc(100dvh - 65px);
  }
  .reader-brand {
    margin-left: auto;
    font-size: 14px;
  }
  .brand-subtitle {
    font-size: 8px;
  }
  .brand-icon {
    width: 30px;
    height: 31px;
    font-size: 18px;
    border-radius: 8px;
  }
  .reader-label {
    display: none;
  }
  .mobile-sources {
    display: inline-grid !important;
    margin-left: 4px;
  }
  .back-link {
    font-size: 10px;
    gap: 7px;
  }
  .source-sidebar {
    display: none;
    position: fixed;
    top: 65px;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: 280px;
    box-shadow: 10px 0 40px #20294720;
  }
  .source-sidebar.is-open {
    display: flex;
  }
  .sidebar-scrim {
    inset: 65px 0 0;
  }
  .document-heading {
    padding: 23px 22px 18px;
  }
  .document-heading h1 {
    font-size: 22px;
    line-height: 1.35;
    margin-top: 8px;
  }
  .heading-topline .eyebrow {
    font-size: 8px;
  }
  .document-description {
    font-size: 10px;
  }
  .reader-toolbar {
    padding: 0 13px;
    gap: 5px;
    height: 54px;
  }
  .zoom-controls .icon-button {
    display: none;
  }
  .zoom-controls select {
    font-size: 10px;
    max-width: 80px;
  }
  .full-book-toggle {
    font-size: 9px;
    padding: 7px;
  }
  .download-button {
    padding: 7px 8px;
    font-size: 9px;
    gap: 4px;
  }
  .fullscreen-button {
    display: none;
  }
  .reader-stage {
    padding: 20px 14px 15px;
  }
  .reader-footer {
    padding: 0 16px;
    height: 40px;
    font-size: 8px;
    gap: 12px;
  }
  .reader-footer > span {
    max-width: 65%;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .page-controls {
    gap: 2px;
  }
  .page-controls .icon-button {
    width: 26px;
  }
  .page-field {
    gap: 5px;
  }
  .page-field input {
    width: 32px;
  }
  .reading-context {
    font-size: 10px;
    margin-top: 10px;
  }
  .reader-status {
    padding: 20px 15px;
    min-height: 280px;
  }
  .reader-status h2 {
    font-size: 15px;
  }
  .reader-status p {
    font-size: 11px;
  }
  .no-script {
    inset: 65px 0 0;
    padding: 25px;
  }
}
@media (max-width: 420px) {
  .reader-brand {
    font-size: 12px;
  }
  .brand-subtitle {
    font-size: 7px;
  }
  .brand-icon {
    display: none;
  }
  .reader-header {
    gap: 8px;
    padding: 0 15px;
  }
  .back-link {
    font-size: 10px;
  }
  .document-heading {
    padding: 19px 17px 15px;
  }
  .document-heading h1 {
    font-size: 20px;
  }
  .reader-toolbar {
    padding: 0 7px;
    gap: 3px;
  }
  .full-book-toggle {
    padding: 7px 5px;
    font-size: 8px;
  }
  .download-button {
    padding: 7px 6px;
    font-size: 8px;
  }
  .zoom-controls select {
    max-width: 73px;
    font-size: 9px;
  }
  .reader-stage {
    padding: 16px 10px;
  }
  .page-caption {
    font-size: 8px;
    gap: 12px;
  }
  .text-toggle {
    font-size: 8px;
  }
  .page-count {
    font-size: 10px;
  }
  .reader-footer > span {
    max-width: 55%;
  }
}
/* Keep reading controls and navigation comfortably legible at every size. */
.source-name,
.chapter-item {
  font-size: 12px;
}
.source-name small,
.chapter-item small,
.eyebrow,
.sidebar-count,
.section-context {
  font-size: 10px;
}
.document-description,
.reading-context {
  font-size: 12px;
}
.toolbar-button,
.zoom-controls select,
.page-field {
  font-size: 11px;
}
.text-toggle,
.page-caption,
.reader-footer {
  font-size: 10px;
}
.subsection-field select {
  font-size: 12px;
}
.sidebar-bottom p,
.sidebar-bottom small {
  font-size: 10px;
}
@media (max-width: 540px) {
  .reader-toolbar {
    height: auto;
    min-height: 94px;
    flex-wrap: wrap;
    padding: 7px 12px;
    gap: 5px 8px;
  }
  .page-controls {
    width: calc(50% - 4px);
    gap: 5px;
  }
  .page-controls .icon-button {
    width: 34px;
    height: 36px;
  }
  .page-field input {
    height: 32px;
    width: 35px;
  }
  .toolbar-spacer {
    display: none;
  }
  .zoom-controls {
    width: calc(50% - 4px);
    justify-content: flex-end;
  }
  .zoom-controls select {
    max-width: none;
    width: 96px;
    height: 36px;
    font-size: 12px;
  }
  .full-book-toggle,
  .download-button {
    height: 34px;
    padding: 6px 11px;
    font-size: 11px;
  }
  .download-button {
    margin-left: auto;
  }
  .document-description {
    font-size: 11px;
  }
  .page-caption {
    font-size: 9px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .text-toggle {
    font-size: 10px;
  }
  .reader-footer {
    font-size: 9px;
  }
  .reader-footer > span {
    max-width: 55%;
  }
  .reading-context {
    font-size: 11px;
  }
  .reader-stage {
    scroll-behavior: auto;
  }
}
@media print {
  .reader-header,
  .source-sidebar,
  .document-heading,
  .reader-toolbar,
  .reader-footer,
  .text-toggle,
  .sidebar-scrim {
    display: none !important;
  }
  html,
  body,
  .reader-layout,
  .reader-main,
  .reader-stage {
    height: auto !important;
    display: block !important;
    overflow: visible !important;
    background: white !important;
    padding: 0 !important;
  }
  .reader-stage {
    padding: 0;
  }
  .page-stage {
    width: 100% !important;
    min-width: 0;
  }
  .pdf-page {
    box-shadow: none;
    max-width: 100%;
    break-inside: avoid;
  }
  .pdf-page canvas {
    width: 100% !important;
    height: auto !important;
  }
  .textLayer {
    display: none;
  }
  .page-caption {
    padding-top: 10px;
    font-size: 9pt;
    color: #333;
  }
  @page {
    margin: 12mm;
  }
}

/* Full-book contents and the in-workspace reader. */
.source-sidebar { width: 310px; min-width: 310px; padding: 20px 16px; }
.sidebar-heading { margin-bottom: 14px; }
.sidebar-heading h2 { font-size: 16px; }
.source-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.source-item { padding: 8px 6px; gap: 6px; min-height: 55px; }
.source-icon { width: 25px; height: 29px; }
.source-name { font-size: 11px; line-height: 1.35; }
.source-name small { font-size: 10px; }
.sidebar-tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); margin: 19px 0 14px; }
.sidebar-tabs button { flex: 1; padding: 9px 4px 11px; border-bottom: 2px solid transparent; font-size: 12px; color: #69748c; }
.sidebar-tabs button[aria-selected="true"] { color: var(--violet); border-bottom-color: var(--violet); font-weight: 600; }
.toc-search-field input { width: 100%; height: 36px; border: 1px solid #e0e4ee; border-radius: 8px; background: #fafbfe; padding: 7px 10px; font-size: 12px; }
.toc-tools { display: flex; align-items: center; justify-content: space-between; margin: 9px 1px; color: #67738b; font-size: 10px; }
.toc-tools button { font-size: 11px; color: var(--violet); padding: 4px 2px; }
.toc-provenance { font-size: 10px; line-height: 1.5; color: #778096; margin: 0 0 9px; }
.toc-tree, .toc-search-results { list-style: none; margin: 0; padding: 0; }
.toc-tree .toc-tree { margin-left: 12px; border-left: 1px solid #edeaf5; padding-left: 2px; }
.toc-row { display: flex; align-items: flex-start; gap: 2px; }
.toc-expander, .toc-leaf-spacer { width: 18px; flex: 0 0 18px; }
.toc-expander { min-height: 35px; padding: 8px 0; color: #788199; font-size: 12px; }
.toc-entry { flex: 1; min-width: 0; width: 100%; display: flex; align-items: baseline; gap: 7px; text-align: left; font-size: 11px; line-height: 1.45; padding: 8px 6px; border-radius: 6px; }
.toc-entry:hover { background: #f5f3fd; }
.toc-entry.active { color: #5a47b2; background: #eeebff; box-shadow: inset 2px 0 #8b76db; }
.toc-title { flex: 1; overflow-wrap: anywhere; }
.toc-page { color: #7b8195; font-variant-numeric: tabular-nums; font-size: 10px; min-width: 20px; text-align: right; }
.toc-title small { display: block; font-weight: 400; font-size: 10px; color: #8791a4; margin-top: 3px; }
.toc-search-results .toc-entry { margin-bottom: 3px; }
.toc-empty { font-size: 12px; line-height: 1.65; color: #778096; }
.external-reading { display: inline-block; font-size: 12px; color: var(--violet); padding: 12px 0; }
.sidebar-bottom { padding-top: 20px; }
.embedded-sources { display: none; }
body.is-embedded .reader-header { display: none; }
body.is-embedded .reader-layout { height: 100dvh; min-height: 0; }
body.is-embedded .document-heading { padding-top: 20px; padding-bottom: 16px; }
body.is-embedded .document-heading h1 { font-size: 21px; }
@media (min-width: 1700px) { .source-sidebar { width: 330px; min-width: 330px; } }
@media (max-width: 1150px) { .source-sidebar { width: 280px; min-width: 280px; } }
@media (max-width: 800px) {
  .source-sidebar { width: min(320px, 90vw); min-width: 0; }
  body.is-embedded .source-sidebar { top: 0; }
  body.is-embedded .sidebar-scrim { inset: 0; }
  body.is-embedded .embedded-sources { display: inline-grid; }
  body.is-embedded .reader-toolbar { flex-wrap: wrap; height: auto; min-height: 64px; padding: 7px 10px; }
  body.is-embedded .document-heading { padding: 17px 18px 12px; }
  body.is-embedded .document-heading h1 { font-size: 19px; }
  .toc-entry { font-size: 12px; min-height: 38px; }
  .toc-expander { min-height: 38px; }
}
@media (max-width: 540px) {
  body.is-embedded .page-controls { width: auto; flex: 1; }
  body.is-embedded .zoom-controls { width: auto; }
  body.is-embedded .reader-toolbar { min-height: 94px; }
  body.is-embedded .full-book-toggle { margin-left: 0; }
  .source-sidebar { padding-bottom: 24px; }
}
@media print { .embedded-sources { display: none !important; } }
.source-item[data-source="notes"] { grid-column: 1 / -1; }
.source-item[data-source="notes"] .source-icon { background: #e7efff; color: #5676b0; }
