* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: #3b3b3b;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: #3b3b3b;
  overflow: hidden;
}

.viewer {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 18px 12px 96px;
}

.stage {
  width: 100%;
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.stage.is-centered {
  align-items: center;
}

#pageCanvas {
  display: block;
  width: auto;
  max-width: min(100%, 420px);
  height: auto;
  background: #f8f8f8;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3b3b3b;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.loading[hidden] {
  display: none;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(255, 255, 255, 0.22);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 18px;
  background: rgba(59, 59, 59, 0.96);
  z-index: 10;
}

.nav-button {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  color: #ffffff;
  background: #4a2716;
  -webkit-tap-highlight-color: transparent;
}

.nav-button:disabled {
  background: #b7b1aa;
  color: #ffffff;
  cursor: not-allowed;
}

.pdf-fallback {
  width: 100%;
  height: 100dvh;
  border: 0;
  background: #ffffff;
}