:root {
  color: #f5f5f4;
  background: #303332;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; }

body { overflow: hidden; background: #303332; }

.pdf-viewer { position: relative; width: 100%; height: 100%; }

.pdf-pages {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 0 16px 100px;
  overscroll-behavior: contain;
  scrollbar-color: #898989 transparent;
}

.pdf-page {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 28%);
}

.pdf-page:last-child { margin-bottom: 0; }

.pdf-page canvas { display: block; background: #fff; }

.text-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  line-height: 1;
  text-align: initial;
  text-size-adjust: none;
  transform-origin: 0 0;
  z-index: 1;
}

.text-layer :is(span, br) {
  position: absolute;
  color: transparent;
  white-space: pre;
  cursor: text;
  transform-origin: 0 0;
}

.text-layer ::selection { background: rgb(72 122 189 / 38%); }

.pdf-toolbar {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 17px;
  display: flex;
  align-items: center;
  min-height: 37px;
  padding: 3px 6px 3px 12px;
  color: #f5f5f4;
  background: #404241;
  border: 1px solid #4c4e4d;
  border-radius: 22px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 38%);
  transform: translateX(-50%);
  backdrop-filter: blur(5px);
}

.page-field { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }

.page-field input {
  width: 31px;
  padding: 2px 0;
  color: inherit;
  font: inherit;
  text-align: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: none;
  appearance: textfield;
}

.page-field input:focus-visible { border-bottom-color: #d6d6d6; }
.page-field input::-webkit-inner-spin-button { appearance: none; }
.page-count { min-width: 26px; font-size: 12px; white-space: nowrap; }
.toolbar-rule { width: 1px; height: 19px; margin: 0 5px; background: #777978; }

.pdf-toolbar button {
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  color: #f5f5f4;
  font: 21px/1 Arial, sans-serif;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.pdf-toolbar button:hover:not(:disabled), .pdf-toolbar button:focus-visible { background: #5b5d5c; outline: none; }
.pdf-toolbar button:disabled { color: #858787; cursor: default; }
.pdf-toolbar svg, .open-document svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.open-document {
  position: absolute;
  z-index: 4;
  top: 11px;
  right: 14px;
  display: grid;
  width: 40px;
  height: 40px;
  color: #e4e4e2;
  place-items: center;
  background: #4a4c4b;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.open-document:hover, .open-document:focus-visible { color: #fff; background: #5a5c5b; outline: 2px solid #fff; outline-offset: 2px; }
.open-document[aria-disabled="true"] { pointer-events: none; opacity: .5; }

.viewer-status {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  max-width: calc(100% - 32px);
  margin: 0;
  color: #f5f5f4;
  font-size: 13px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.viewer-status[hidden] { display: none; }

@media (max-width: 480px) {
  .pdf-pages { padding-right: 12px; padding-left: 12px; }
  .pdf-toolbar { bottom: 12px; min-height: 35px; padding-left: 9px; }
  .pdf-toolbar button { width: 25px; height: 25px; }
  .open-document { top: 9px; right: 9px; }
}
