.book-viewer {
  color-scheme: dark;
}

.book-viewer,
.book-viewer * {
  box-sizing: border-box;
}

.book-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  background: #171716;
  color: #eee9df;
  font-family: system-ui, sans-serif;
}

.book-stage {
  display: grid;
  width: min(100%, 92rem);
  height: min(82vh, 52rem);
  min-height: 18rem;
  place-items: center;
}

.book-embed {
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.book-embed .stf__wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  padding-bottom: 0 !important;
}

.book-embed .page {
  overflow: hidden;
  background: #f7f2e8;
}

.book-embed .page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.book-controls {
  display: flex;
  width: min(100%, 34rem);
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.book-controls button {
  border: 1px solid #8d897f;
  border-radius: .35rem;
  padding: .65rem 1rem;
  background: #282725;
  color: inherit;
  cursor: pointer;
}

.book-controls button:hover,
.book-controls button:focus-visible {
  background: #3a3834;
  outline: 2px solid #d6bd82;
  outline-offset: 2px;
}

.book-controls button:disabled {
  cursor: default;
  opacity: .55;
}

@media print {
  .book-viewer {
    display: none !important;
  }
}

@media (max-width: 40rem) {
  .book-shell {
    padding: .75rem;
  }

  .book-stage {
    height: min(84svh, 46rem);
  }
}
