:root {
  color-scheme: light;
  --pdf-bg: #eef3f1;
  --pdf-page-bg: #ffffff;
  --pdf-border: #d6dde0;
  --pdf-text: #122933;
  --pdf-muted: #5d7081;
  --pdf-accent: #2b524d;
  --pdf-accent-hover: #122933;
  --pdf-shadow: 0 10px 24px rgba(18, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--pdf-bg);
  color: var(--pdf-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow: hidden;
}

.pdf-shell {
  position: relative;
  width: 100%;
  min-height: 100%;
  padding: 12px;
}

.pdf-status {
  max-width: 42rem;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid var(--pdf-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--pdf-muted);
  font-size: 0.95rem;
  text-align: center;
}

.pdf-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 24px);
  padding: 4px 8px 84px;
  overflow: hidden;
}

.pdf-pages.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
}

.pdf-page {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  border: 1px solid var(--pdf-border);
  border-radius: 10px;
  background: var(--pdf-page-bg);
  box-shadow: var(--pdf-shadow);
  overflow: hidden;
}

.pdf-page__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  background: var(--pdf-page-bg);
}

.pdf-page.is-zoomed {
  max-width: none;
  max-height: none;
}

.pdf-page.is-zoomed .pdf-page__image {
  max-width: none;
  max-height: none;
}

.pdf-toolbar {
  position: absolute;
  right: 16px;
  bottom: 12px;
  left: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 42rem;
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid rgba(214, 221, 224, 0.92);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(18, 41, 51, 0.12);
  opacity: 0;
  transform: translateY(110%);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.pdf-toolbar.is-active,
.pdf-shell:hover .pdf-toolbar,
.pdf-shell:focus-within .pdf-toolbar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pdf-toolbar__group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pdf-toolbar__count,
.pdf-toolbar__zoom {
  min-width: 74px;
  color: var(--pdf-text);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.pdf-toolbar__button {
  min-width: 44px;
  padding: 9px 12px;
  border: 1px solid var(--pdf-accent);
  border-radius: 8px;
  background: var(--pdf-accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  transition: background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.pdf-toolbar__button:hover,
.pdf-toolbar__button:focus-visible {
  background: var(--pdf-accent-hover);
  border-color: var(--pdf-accent-hover);
}

.pdf-toolbar__button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 767px) {
  .pdf-shell {
    padding: 8px;
  }

  .pdf-pages {
    height: calc(100vh - 16px);
    padding: 4px 4px 92px;
  }

  .pdf-page {
    border-radius: 8px;
  }

  .pdf-toolbar {
    right: 8px;
    bottom: 8px;
    left: 8px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
  }

  .pdf-toolbar__group {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .pdf-toolbar__count,
  .pdf-toolbar__zoom {
    min-width: 56px;
    font-size: 0.8rem;
  }

  .pdf-toolbar__group:last-child {
    display: none;
  }

  .pdf-toolbar__button {
    min-width: 36px;
    padding: 8px 9px;
    font-size: 0.78rem;
  }

  .pdf-status {
    padding: 12px;
    font-size: 0.9rem;
  }
}
