.document-viewer-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 145px 20px 60px;
}

/* ─── Error state ───────────────────────────────────────────────────────────── */

.document-viewer-error {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 40px 0;
  color: var(--blue-100);
}

/* ─── Wrap ──────────────────────────────────────────────────────────────────── */

.document-viewer-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #d0ccc6;
  margin: 50px auto 45px;
  max-height: 904px;
  display: flex;
  flex-direction: column;
}

/* ─── Toolbar ───────────────────────────────────────────────────────────────── */

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  height: 48px;
  flex-shrink: 0;
  background: #f5f2ee;
  border-bottom: 1px solid #d0ccc6;
  color: var(--blue-100);
  user-select: none;
}

.pdf-toolbar-left,
.pdf-toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pdf-toolbar-center {
  flex: 1;
  text-align: center;
  overflow: hidden;
}

.pdf-toolbar-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--blue-100);
  display: block;
}

/* ─── Toolbar buttons ───────────────────────────────────────────────────────── */

.pdf-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--blue-100);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  padding: 0;
}

.pdf-toolbar-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.07);
}

.pdf-toolbar-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ─── Page navigation ───────────────────────────────────────────────────────── */

.pdf-page-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px;
}

.pdf-page-input {
  width: 44px;
  height: 28px;
  padding: 0 6px;
  background: #fff;
  border: 1px solid #c0bbb4;
  border-radius: 4px;
  color: var(--blue-100);
  font-family: var(--font-primary);
  font-size: 13px;
  text-align: center;
  -moz-appearance: textfield;
}

.pdf-page-input::-webkit-outer-spin-button,
.pdf-page-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pdf-page-input:focus {
  outline: none;
  border-color: var(--orange-100);
}

.pdf-page-sep,
.pdf-page-total {
  font-size: 13px;
  color: #888;
}

/* ─── Zoom select ───────────────────────────────────────────────────────────── */

.pdf-zoom-select {
  height: 28px;
  padding: 0 24px 0 8px;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E")
    no-repeat right 8px center;
  border: 1px solid #c0bbb4;
  border-radius: 4px;
  color: var(--blue-100);
  font-family: var(--font-primary);
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin: 0 4px;
}

.pdf-zoom-select:focus {
  outline: none;
  border-color: var(--orange-100);
}

/* ─── Divider ───────────────────────────────────────────────────────────────── */

.pdf-toolbar-divider {
  width: 1px;
  height: 24px;
  background: #d0ccc6;
  margin: 0 4px;
}

/* ─── Canvas area ───────────────────────────────────────────────────────────── */

.pdf-canvas-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
  background: #e8e4df;
  flex: 1;
  overflow-y: auto;
}

.pdf-canvas-container {
  position: relative;
  display: inline-block;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  max-width: 100%;
}

#pdf-canvas {
  max-width: 100%;
  background: #fff;
  display: block;
}

.pdf-annotation-layer {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
}

.pdf-annotation-layer a {
  position: absolute;
  display: block;
  pointer-events: all;
  cursor: pointer;
}

.pdf-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #666;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.document-viewer-purchase-link {
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--blue-100);
  margin-top: 50px;
}

.document-viewer-purchase-link a {
  color: var(--orange-100);
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .pdf-toolbar-center {
    display: none;
  }

  .pdf-toolbar {
    justify-content: space-between;
    padding: 0 8px;
  }

  .pdf-canvas-wrap {
    padding: 12px;
  }
}
