:root {
  --wave-pdf-bg: #121820;
  --wave-pdf-bar: #1a2330;
  --wave-pdf-ink: #f3f6fa;
  --wave-pdf-muted: #9aa8b8;
  --wave-pdf-brand: #2a5aad;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.wave-pdf-page {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--wave-pdf-bg);
  color: var(--wave-pdf-ink);
  touch-action: none;
}

.wave-pdf-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  min-height: 56px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  padding-top: calc(6px + env(safe-area-inset-top));
  background: rgba(26, 35, 48, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.wave-pdf-toolbar__title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wave-pdf-toolbar__title strong {
  font-size: 0.92rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wave-pdf-toolbar__title span {
  font-size: 0.75rem;
  color: var(--wave-pdf-muted);
}

.wave-pdf-toolbar__actions {
  display: inline-flex;
  gap: 4px;
}

.wave-pdf-toolbar__btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--wave-pdf-ink);
  text-decoration: none;
  cursor: pointer;
}

.wave-pdf-toolbar__btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.wave-pdf-main {
  position: relative;
  height: 100%;
  padding-top: calc(56px + env(safe-area-inset-top));
}

.wave-pdf-hint {
  position: absolute;
  top: calc(64px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.78rem;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.wave-pdf-hint.is-hidden {
  opacity: 0;
}

.wave-pdf-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(42, 90, 173, 0.18), transparent 60%),
    var(--wave-pdf-bg);
}

.wave-pdf-viewport.is-dragging {
  cursor: grabbing;
}

.wave-pdf-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transform-origin: 0 0;
  will-change: transform;
}

.wave-pdf-pages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  width: min(920px, 100%);
}

.wave-pdf-page-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.wave-pdf-loading,
.wave-pdf-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--wave-pdf-muted);
}

.wave-pdf-error {
  color: #ffb4b4;
}

.wave-pdf-loading.is-hidden {
  display: none;
}

@media (min-width: 768px) {
  .wave-pdf-hint {
    display: none;
  }
}
