/* Purpose: Style the responsive PDF page-preview dialog. */
.reader {
  width: min(900px, calc(100% - 28px));
  max-width: none;
  max-height: none;
  height: min(850px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 80px #16142561;
  overflow: hidden;
}
.reader[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.reader::backdrop {
  background: #15121c9c;
}
.reader-header,
.reader-controls {
  padding: 12px 16px;
}
.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reader-header h2 {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.24rem);
}
.icon-button {
  appearance: none;
  background: #f2f2f5;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 1.6rem;
}
.reader-body {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  background: #ecedf0;
}
.page-image {
  display: block;
  width: min(100%, 720px);
  margin: 0 auto;
  min-height: 1px;
  background: #fff;
}
.page-number {
  min-width: 90px;
  text-align: center;
  font-size: 0.87rem;
  color: var(--muted);
}
.reader-controls .primary {
  margin-left: auto;
}
@media (max-width: 440px) {
  .reader-controls {
    justify-content: center;
  }
  .reader-controls .primary {
    margin-left: 0;
  }
}
