/* v170: scoped entirely to the library PDF reading page. */
.pdf-reader-page {
  width: 100%;
  min-width: 0;
  padding: 0 1rem 1rem;
}
.pdf-reader-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
}
.pdf-reader-title {
  flex: 1 1 280px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pdf-reader-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.pdf-reader-viewport {
  position: relative;
  width: 100%;
  height: max(320px, calc(100svh - 190px)); /* JavaScript refines this using the actual top offset. */
  min-height: 280px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .13);
  border-radius: .45rem;
  background: #eee;
}
.pdf-reader-object,
.pdf-reader-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.pdf-reader-loading[hidden],
.pdf-reader-loading-slow[hidden] { display: none !important; }
.pdf-reader-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: 1rem;
  color: #24282d;
  background: rgba(251, 250, 247, .96);
  text-align: left;
  pointer-events: none;
}
.pdf-reader-loading-copy {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  max-width: 32rem;
  font-size: .95rem;
}
.pdf-reader-loading-hint,
.pdf-reader-loading-slow { font-size: .85rem; font-weight: 400; }
.pdf-reader-spinner {
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border: .2rem solid rgba(33, 37, 41, .2);
  border-top-color: #313d45;
  border-radius: 50%;
  animation: pdf-reader-spin .85s linear infinite;
}
/* Long loads must not obscure the PDF toolbar or the document indefinitely. */
.pdf-reader-loading.is-slow {
  inset: auto .75rem .75rem .75rem;
  min-height: auto;
  justify-content: flex-start;
  padding: .7rem .9rem;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: .45rem;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}
@keyframes pdf-reader-spin { to { transform: rotate(360deg); } }
@media (max-width: 575.98px) {
  .pdf-reader-page { padding-inline: .5rem; }
  .pdf-reader-title { font-size: clamp(1.2rem, 5vw, 1.65rem); }
  .pdf-reader-actions { width: 100%; }
  .pdf-reader-loading { flex-direction: column; text-align: center; }
  .pdf-reader-loading.is-slow { flex-direction: row; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .pdf-reader-spinner { animation: none; border-top-color: rgba(33, 37, 41, .75); }
}
