.llm-pdf-document {
  min-width: max-content;
}

.llm-pdf-page-shell {
  max-width: none;
  overflow: hidden;
}

/* The document-point anchor owns reflow; native pixel anchoring can fight it. */
/* Reserve the scrollbar width even when every page fits. Otherwise fitting
   pages can toggle the scrollbar and repeatedly resize/rasterize the PDF. */
.llm-pdf-viewer { overflow-anchor: none; scrollbar-gutter: stable; }

.llm-pdf-page {
  border: 0;
}

.llm-pdf-page canvas {
  max-width: none;
}

/* PDF.js 5.5 text geometry; React-PDF 10's bundled CSS still targets 5.4.
   Keep selection ranges aligned with the rendered glyphs at every zoom.
   Based on pdfjs-dist/web/pdf_viewer.css (Apache-2.0). */
.llm-pdf-page .textLayer {
  --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));
}
.llm-pdf-page .textLayer > :not(.markedContent),
.llm-pdf-page .textLayer .markedContent span:not(.markedContent) {
  --font-height: 0;
  --scale-x: 1;
  --rotate: 0deg;
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}

.llm-pdf-page .react-pdf__Page__textContent ::selection,
.llm-pdf-page ::highlight(coursepilot-context-selection),
.llm-pdf-page ::highlight(coursepilot-reference-focus) {
  color: transparent;
  text-shadow: none;
}

/* Keep the section navigation compact enough for the current question on phones. */
@container(max-width:480px){
 :root .pilot-exam .pilot-section-bar>.pilot-tabs{flex-wrap:nowrap;overflow-x:auto;max-width:100%;min-width:0;scrollbar-width:thin}
 :root .pilot-exam .pilot-section-bar>.pilot-tabs button{flex-shrink:0;min-height:44px;padding-inline:8px}
}
