.pdf-viewer-container {
  /* Define this variable here and not in :root to avoid to reflow all the UI
     when scaling (see #15929). */
  --scale-factor: 1;
  --page-bg-color: unset;
  --pdf-dark-bg: #38383d;
  --pdf-dark-bg-secondary: #2a2a2e;
  --pdf-dark-border: #3a3a3e;
  --pdf-dark-text: #f9f9fa;
  --pdf-dark-text-secondary: #b1b1b3;
  --pdf-dark-hover: rgba(255, 255, 255, 0.1);
  --pdf-dark-active: rgba(255, 255, 255, 0.15);
  --pdf-dark-separator: rgba(255, 255, 255, 0.2);
  --pdf-dark-input-bg: #4a4a4f;
  --pdf-dark-input-border: #5a5a5f;
  --pdf-accent: #0060df;
  --pdf-accent-hover: #0250bb;
  --pdf-cursor-freehighlight: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='19' fill='none' viewBox='0 0 18 19'%3E%3Cpath fill='%23fbfbfe' fill-rule='evenodd' d='M12.2 3.09c.08-.08.23-.09.23-.09.05 0 .15.02.23.1l1.79 1.79c.13.13.13.33 0 .46l-2.679 2.679-2.255-2.255zm1.066 2.03L11.77 6.614l-.84-.84 1.494-1.495zM5.98 9.32l2.25 2.25 2.48-2.48-2.254-2.256L5.98 9.31zm2.25.836 1.066-1.067-.84-.84-1.067 1.066z' clip-rule='evenodd'/%3E%3Cpath fill='%23fbfbfe' fill-rule='evenodd' d='m10.153 13.182 6.06-6.06a2.78 2.78 0 0 0 .837-2.002c0-.75-.292-1.47-.837-2.002l-1.781-1.78A2.78 2.78 0 0 0 12.43.5c-.766 0-1.477.313-1.997.833l-6.75 6.75a1.755 1.755 0 0 0-.11 2.353l-2.281 2.288a1 1 0 0 0-.291.745L1 14.5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h15a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-5.767c-.397 0-.833-.565-.08-1.318M4.39 9.85l.59.59-2.582 2.591h4.24l.467-.466.466.466H8.89l6.62-6.621c.35-.34.54-.8.54-1.29s-.19-.95-.54-1.29l-1.79-1.79c-.34-.35-.8-.54-1.29-.54s-.95.2-1.29.54L4.39 8.79c-.29.29-.29.77 0 1.06M16 17.5v-2H1v2z' clip-rule='evenodd'/%3E%3Cpath stroke='%2315141a' d='m15.162 6.051-.006.005-6.75 6.75a.25.25 0 0 1-.352 0l-.595-.594-.354-.354-.354.353-.718.719H3.205l2.13-2.136.352-.354-.353-.353-.59-.59a.255.255 0 0 1 0-.353l6.75-6.75c.25-.25.584-.394.936-.394.358 0 .688.138.931.388l.005.006 1.79 1.79.006.005c.25.243.388.573.388.931s-.138.688-.388.931Zm-7.286 5.873.354.353.354-.353 2.48-2.481.354-.354-.354-.353L8.81 6.48l-.353-.354-.354.354-2.476 2.475-.146.147v.424l.146.147zm3.542-3.542.353.354.354-.354 2.679-2.678a.82.82 0 0 0 0-1.168l-1.79-1.79a.84.84 0 0 0-.584-.246h-.017l-.016.001.033.499-.034-.499h-.009l-.014.002a1 1 0 0 0-.155.028.8.8 0 0 0-.372.205L9.163 5.42l-.354.354.354.353zM1.5 16h14v1h-14z'/%3E%3C/svg%3E");
  --pdf-cursor-texthighlight: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='32' fill='none' viewBox='0 0 29 32'%3E%3Cpath fill='%23000' stroke='%23fbfbfe' stroke-linejoin='round' d='M28 16.75a.5.5 0 0 0 .5-.5V15a.5.5 0 0 0-.5-.5h-1.642c-.446 0-.88.126-1.258.36l-.001.001-1.099.687-1.1-.687a2.4 2.4 0 0 0-1.258-.361H20a.5.5 0 0 0-.5.5v1.25a.5.5 0 0 0 .5.5h1.642a.13.13 0 0 1 .068.02l1.107.691a.12.12 0 0 1 .059.106v10.116a.12.12 0 0 1-.059.106l-1.108.691a.13.13 0 0 1-.068.02H20a.5.5 0 0 0-.5.5v1.25a.5.5 0 0 0 .5.5h1.642c.446 0 .88-.126 1.258-.36l1.1-.687 1.1.687c.378.235.813.361 1.259.361H28a.5.5 0 0 0 .5-.5v-1.25a.5.5 0 0 0-.5-.5h-1.642a.13.13 0 0 1-.068-.02l-1.107-.691a.12.12 0 0 1-.058-.106V17.567c0-.044.021-.083.059-.106l1.105-.691a.13.13 0 0 1 .069-.02z'/%3E%3Cpath fill='%23000' d='M24.625 17.567c0-.217.11-.415.293-.53l1.108-.692a.63.63 0 0 1 .332-.095H28V15h-1.642a1.9 1.9 0 0 0-.994.285l-1.108.693c-.095.059-.175.135-.256.209-.082-.074-.161-.15-.256-.209l-1.109-.693a1.9 1.9 0 0 0-.993-.285H20v1.25h1.642a.63.63 0 0 1 .332.095l1.108.692a.62.62 0 0 1 .294.53v10.116c0 .217-.11.415-.294.53l-1.109.692a.63.63 0 0 1-.332.095H20v1.25h1.642c.352 0 .695-.099.994-.285l1.108-.692c.096-.06.175-.136.256-.209.081.073.161.149.256.209l1.109.693c.299.186.642.285.994.285H28v-1.25h-1.642a.63.63 0 0 1-.332-.095l-1.108-.692a.62.62 0 0 1-.293-.53z'/%3E%3Cpath fill='%23fbfbfe' fill-rule='evenodd' d='M12.2 2.59c.08-.08.23-.09.23-.09.05 0 .15.02.23.1l1.79 1.79c.13.13.13.33 0 .46l-2.679 2.679-2.255-2.255zm1.066 2.03L11.77 6.114l-.84-.84 1.494-1.495zM5.98 8.82l2.25 2.25 2.48-2.48-2.254-2.256L5.98 8.81zm2.25.836 1.066-1.067-.84-.84-1.067 1.066z' clip-rule='evenodd'/%3E%3Cpath fill='%23fbfbfe' fill-rule='evenodd' d='m10.153 12.682 6.06-6.06a2.78 2.78 0 0 0 .837-2.002c0-.75-.292-1.47-.837-2.002L14.432.838A2.78 2.78 0 0 0 12.43 0c-.766 0-1.477.313-1.997.833l-6.75 6.75a1.755 1.755 0 0 0-.11 2.353l-2.281 2.288a1 1 0 0 0-.291.745L1 14a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h15a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-5.767c-.397 0-.833-.565-.08-1.318M4.39 9.35l.59.59-2.582 2.591h4.24l.467-.466.466.466H8.89l6.62-6.621c.35-.34.54-.8.54-1.29s-.19-.95-.54-1.29l-1.79-1.79c-.34-.35-.8-.54-1.29-.54s-.95.2-1.29.54L4.39 8.29c-.29.29-.29.77 0 1.06M16 17v-2H1v2z' clip-rule='evenodd'/%3E%3Cpath stroke='%2315141a' d='m15.162 5.551-.006.005-6.75 6.75a.25.25 0 0 1-.352 0l-.595-.594-.354-.354-.354.353-.718.719H3.205l2.13-2.136.352-.354-.353-.353-.59-.59a.255.255 0 0 1 0-.353l6.75-6.75c.25-.25.584-.394.936-.394.358 0 .688.138.931.388l.005.006 1.79 1.79.006.005c.25.243.388.573.388.931s-.138.688-.388.931ZM5.48 8.82v.207l.146.147 2.25 2.25.354.353.354-.353 2.48-2.481.354-.354-.354-.353L8.81 5.98l-.353-.354-.354.354-2.476 2.475-.146.147v.217Zm5.938-.938.353.354.354-.354 2.679-2.678a.82.82 0 0 0 0-1.168l-1.79-1.79A.84.84 0 0 0 12.43 2h-.017l-.016.001.033.499-.034-.499h-.009l-.014.002a1 1 0 0 0-.155.028.8.8 0 0 0-.372.205L9.163 4.92l-.354.354.354.353zM1.5 16.5v-1h14v1z'/%3E%3C/svg%3E");
  --pdf-cursor-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='m.019 13.665.594-3.201c.075-.41.272-.784.568-1.082l8.801-8.8a1.99 1.99 0 0 1 2.81 0L14.42 2.21a1.99 1.99 0 0 1 0 2.81l-8.804 8.803c-.296.295-.67.49-1.078.566l-3.202.594Q1.232 15 1.13 15a1.13 1.13 0 0 1-1.111-1.336'/%3E%3Cpath fill='%23000' d='m.019 13.665.594-3.201c.075-.41.272-.784.568-1.082l8.801-8.8a1.99 1.99 0 0 1 2.81 0L14.42 2.21a1.99 1.99 0 0 1 0 2.81l-8.804 8.803c-.296.295-.67.49-1.078.566l-3.202.594Q1.232 15 1.13 15a1.13 1.13 0 0 1-1.111-1.336m12.453-8.468 1.16-1.16-.001-.848-1.82-1.822-.848.002-1.16 1.16zm-8.161 7.962a.8.8 0 0 0 .423-.225l6.853-6.852-2.668-2.668-6.853 6.852a.8.8 0 0 0-.225.425l-.474 2.557.385.386z'/%3E%3C/svg%3E");
  --pdf-cursor-note: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' stroke='%23fff' d='M2 1a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h3l3 3 3-3h3a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z'/%3E%3Cpath fill='%23000' d='M2 2h12v9h-3.5L8 13.5 5.5 11H2z'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' d='M4 5h8M4 7.5h6'/%3E%3C/svg%3E");
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #525659;
}
.pdf-viewer-container .hidden {
  display: none !important;
}

.pdf-toolbar {
  --toolbar-bg: var(--pdf-dark-bg);
  --toolbar-border: var(--pdf-dark-bg-secondary);
  --toolbar-text: var(--pdf-dark-text);
  --toolbar-text-secondary: var(--pdf-dark-text-secondary);
  --toolbar-hover: var(--pdf-dark-hover);
  --toolbar-active: var(--pdf-dark-active);
  --toolbar-accent: var(--pdf-accent);
  --toolbar-accent-hover: var(--pdf-accent-hover);
  --toolbar-separator: var(--pdf-dark-separator);
  --toolbar-input-bg: var(--pdf-dark-input-bg);
  --toolbar-input-border: var(--pdf-dark-input-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background-color: var(--toolbar-bg);
  border-bottom: 1px solid var(--toolbar-border);
  min-height: 40px;
  gap: 8px;
}

.pdf-toolbar-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-toolbar-left {
  flex: 0 0 auto;
  justify-content: flex-start;
}

.pdf-toolbar-right {
  flex: 1;
  justify-content: flex-end;
}

.pdf-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pdf-toolbar-separator {
  width: 1px;
  height: 20px;
  background-color: var(--toolbar-separator);
  margin: 0 6px;
}

.pdf-toolbar-nav {
  gap: 4px;
}

.pdf-page-input-container {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--toolbar-text);
}

.pdf-page-input {
  width: 40px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--toolbar-input-border);
  border-radius: 4px;
  background: var(--toolbar-input-bg);
  color: var(--toolbar-text);
  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(--toolbar-accent);
  box-shadow: 0 0 0 1px var(--toolbar-accent);
}

.pdf-page-separator {
  color: var(--toolbar-text-secondary);
}

.pdf-page-count {
  min-width: 20px;
  color: var(--toolbar-text-secondary);
}

.pdf-toolbar-zoom {
  gap: 4px;
}

.pdf-zoom-select {
  height: 26px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--toolbar-input-border);
  border-radius: 4px;
  background: var(--toolbar-input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f9f9fa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center;
  background-size: 12px;
  color: var(--toolbar-text);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
}
.pdf-zoom-select:hover {
  border-color: #6a6a6f;
  background-color: #5a5a5f;
}
.pdf-zoom-select:focus {
  outline: none;
  border-color: var(--toolbar-accent);
}

.pdf-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--toolbar-text);
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.pdf-toolbar-btn:hover:not(:disabled) {
  background-color: var(--toolbar-hover);
}
.pdf-toolbar-btn:active:not(:disabled) {
  background-color: var(--toolbar-active);
}
.pdf-toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pdf-toolbar-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pdf-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--toolbar-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.pdf-tool-btn:hover:not(:disabled) {
  background-color: var(--toolbar-hover);
  border-color: var(--toolbar-separator);
}
.pdf-tool-btn:active:not(:disabled) {
  background-color: var(--toolbar-active);
}
.pdf-tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pdf-tool-btn.active {
  background-color: rgba(255, 255, 255, 0.95);
  border-color: #333;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.pdf-tool-btn.active svg {
  stroke: #333;
}
.pdf-tool-btn.active:hover {
  background-color: #fff;
}
.pdf-tool-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.pdf-tool-btn span {
  line-height: 1;
}

.pdf-toolbar-tools {
  gap: 4px;
}

.pdf-viewer-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.pdf-sidebar {
  --sidebar-bg: var(--pdf-dark-bg-secondary);
  --sidebar-border: var(--pdf-dark-border);
  --sidebar-text: var(--pdf-dark-text);
  --sidebar-text-secondary: var(--pdf-dark-text-secondary);
  --sidebar-accent: var(--pdf-accent);
  position: relative;
  width: 0;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s ease, visibility 0s ease 0.2s;
  visibility: hidden;
}
.pdf-sidebar.open {
  width: var(--sidebar-width);
  visibility: visible;
  transition: width 0.2s ease, visibility 0s linear 0s;
}
.pdf-sidebar.resizing {
  transition: none;
}
.pdf-sidebar.is-left {
  border-right: 1px solid var(--sidebar-border);
}
.pdf-sidebar.is-right {
  border-left: 1px solid var(--sidebar-border);
}

.pdf-thumbnail-sidebar {
  --sidebar-width: 200px;
  --thumbnail-bg: #525659;
  --thumbnail-border: #6a6a6f;
  --thumbnail-active-border: #0060df;
}

.pdf-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.pdf-sidebar-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-text);
}

.pdf-sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--sidebar-text-secondary);
  cursor: pointer;
}
.pdf-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text);
}
.pdf-sidebar-close svg {
  width: 14px;
  height: 14px;
}

.pdf-sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pdf-sidebar-resizer {
  position: absolute;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  z-index: 5;
}
.pdf-sidebar.is-left .pdf-sidebar-resizer {
  right: -3px;
}
.pdf-sidebar.is-right .pdf-sidebar-resizer {
  left: -3px;
}
.pdf-sidebar-resizer:hover, .pdf-sidebar.resizing .pdf-sidebar-resizer {
  background: var(--sidebar-accent, var(--toolbar-accent, #0060df));
}

.thumbnail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-radius: 4px;
  padding: 4px;
  transition: background-color 0.15s ease;
}
.thumbnail:hover {
  background: rgba(255, 255, 255, 0.05);
}
.thumbnail:focus {
  outline: 2px solid var(--thumbnail-active-border);
  outline-offset: 2px;
}
.thumbnail.active .thumbnail-image {
  box-shadow: 0 0 0 2px var(--thumbnail-active-border);
}
.thumbnail.active .thumbnail-label {
  color: var(--sidebar-text);
  font-weight: 600;
}

.thumbnail-image {
  background: var(--thumbnail-bg);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.15s ease;
}
.thumbnail:hover .thumbnail-image {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.thumbnail-canvas {
  display: block;
}

.thumbnail-label {
  font-size: 12px;
  color: var(--sidebar-text-secondary);
  transition: color 0.15s ease;
}

.pdf-pages-container {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  gap: 1rem;
  position: relative;
}

.pdf-page {
  --page-width: 612px;
  --page-height: 792px;
  --user-unit: 1;
  --scale-factor: var(--display-scale, 1);
  --total-scale-factor: var(--display-scale, 1);
  position: relative;
  flex-shrink: 0;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin: 0 auto;
  isolation: isolate;
  width: calc(var(--page-width) * var(--display-scale, 1));
  height: calc(var(--page-height) * var(--display-scale, 1));
}
.pdf-page canvas.pdf-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}
.pdf-page .ios-selection-highlight {
  background-color: rgba(0, 100, 255, 0.3);
  border-radius: 2px;
}

.textLayer {
  position: absolute;
  text-align: initial;
  top: 0;
  left: 0;
  width: calc(var(--page-width) * var(--display-scale, 1));
  height: calc(var(--page-height) * var(--display-scale, 1));
  overflow: hidden;
  overflow: clip;
  opacity: 1;
  line-height: 1;
  text-size-adjust: none;
  forced-color-adjust: none;
  caret-color: CanvasText;
  z-index: 0;
}
.textLayer :is(span, br) {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}
.textLayer {
  /* We multiply the font size by --min-font-size, and then scale the text
   * elements by 1/--min-font-size. This allows us to effectively ignore the
   * minimum font size enforced by the browser, so that the text layer <span>s
   * can always match the size of the text in the canvas. */
  --min-font-size: 1;
  --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
  --min-font-size-inv: calc(1 / var(--min-font-size));
}
.textLayer > :not(.markedContent),
.textLayer .markedContent span:not(.markedContent) {
  z-index: 1;
  --font-height: 0; /* set by PDF.js TextLayer */
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  --scale-x: 1;
  --rotate: 0deg;
  transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}
.textLayer .markedContent {
  display: contents;
}
.textLayer span[role=img] {
  user-select: none;
  cursor: default;
}
.textLayer .highlight {
  --highlight-bg-color: rgb(180 0 170 / 0.25);
  --highlight-selected-bg-color: rgb(0 100 0 / 0.25);
  --highlight-backdrop-filter: none;
  --highlight-selected-backdrop-filter: none;
}
@media screen and (forced-colors: active) {
  .textLayer .highlight {
    --highlight-bg-color: transparent;
    --highlight-selected-bg-color: transparent;
    --highlight-backdrop-filter: var(--hcm-highlight-filter);
    --highlight-selected-backdrop-filter: var(
      --hcm-highlight-selected-filter
    );
  }
}
.textLayer .highlight {
  margin: -1px;
  padding: 1px;
  background-color: var(--highlight-bg-color);
  backdrop-filter: var(--highlight-backdrop-filter);
  border-radius: 4px;
}
.textLayer .highlight.appended {
  position: initial;
}
.textLayer .highlight.begin {
  border-radius: 4px 0 0 4px;
}
.textLayer .highlight.end {
  border-radius: 0 4px 4px 0;
}
.textLayer .highlight.middle {
  border-radius: 0;
}
.textLayer .highlight.selected {
  background-color: var(--highlight-selected-bg-color);
  backdrop-filter: var(--highlight-selected-backdrop-filter);
}
.textLayer ::selection {
  background: var(--selection-highlight-color, rgba(0, 100, 255, 0.3));
}
.textLayer {
  /* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */
  /*#if !MOZCENTRAL*/
}
.textLayer br::selection {
  background: transparent;
}
.textLayer {
  /*#endif*/
}
.textLayer .endOfContent {
  display: block;
  position: absolute;
  inset: 100% 0 0;
  z-index: 0;
  cursor: default;
  user-select: none;
}
.textLayer.selecting .endOfContent {
  top: 0;
}

.highlight-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: multiply;
  overflow: visible;
}

.underline-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.annotation-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--page-width) * var(--display-scale, 1));
  height: calc(var(--page-height) * var(--display-scale, 1));
  pointer-events: none;
}

.annotation {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  --outline-width: 2px;
  --outline-color: #0060df;
  --outline-around-width: 1px;
  --outline-around-color: #f0f0f4;
  --hover-outline-color: #8f8f9d;
}
.annotation:hover:not(.selected) {
  box-shadow: 0 0 0 var(--outline-width) var(--hover-outline-color);
  border-radius: 2px;
}
.annotation.selected {
  box-shadow: 0 0 0 var(--outline-width) var(--outline-color), 0 0 0 calc(var(--outline-width) + var(--outline-around-width)) var(--outline-around-color);
  border-radius: 2px;
  z-index: 100 !important;
}

.annotation-highlight {
  background: transparent;
  cursor: pointer;
}

.annotation-edit-toolbar {
  --toolbar-bg: #f0f0f4;
  --toolbar-border: #8f8f9d;
  --toolbar-shadow: 0 2px 6px rgba(58, 57, 68, 0.2);
  --toolbar-height: 28px;
  --toolbar-offset: 6px;
  --toolbar-fg: #2e2e56;
  --toolbar-hover-bg: #e0e0e6;
  --toolbar-focus-color: #0060df;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: top center;
  margin-top: var(--toolbar-offset);
}
.annotation-edit-toolbar.flipped {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: var(--toolbar-offset);
  transform-origin: bottom center;
}
.annotation-edit-toolbar {
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--toolbar-bg);
  border: 1px solid var(--toolbar-border);
  border-radius: 6px;
  box-shadow: var(--toolbar-shadow);
  z-index: 1000;
  pointer-events: auto;
  cursor: default;
}
.annotation-edit-toolbar .toolbar-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  height: var(--toolbar-height);
  padding: 2px;
}
.annotation-edit-toolbar .toolbar-annotation-content {
  min-width: 200px;
  max-width: 320px;
  margin: 4px;
  margin-top: 0;
  padding: 8px 10px;
  background: white;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--toolbar-fg);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 100px;
  overflow-y: auto;
}
.annotation-edit-toolbar .toolbar-divider {
  width: 0;
  height: calc(var(--toolbar-height) - 4px);
  border-left: 1px solid var(--toolbar-border);
  margin: 0 2px;
}
.annotation-edit-toolbar .toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--toolbar-height);
  height: var(--toolbar-height);
  padding: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--toolbar-fg);
  cursor: pointer !important;
}
.annotation-edit-toolbar .toolbar-btn:hover {
  background: var(--toolbar-hover-bg);
}
.annotation-edit-toolbar .toolbar-btn:focus-visible {
  outline: 2px solid var(--toolbar-focus-color);
  outline-offset: -2px;
}
.annotation-edit-toolbar .toolbar-btn svg {
  width: 16px;
  height: 16px;
}
.annotation-edit-toolbar .color-picker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 6px 0 8px;
  height: var(--toolbar-height);
  border: none;
  border-radius: 2px;
  background: transparent;
  cursor: pointer !important;
}
.annotation-edit-toolbar .color-picker-btn:hover {
  background: var(--toolbar-hover-bg);
}
.annotation-edit-toolbar .color-picker-btn .color-swatch {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.annotation-edit-toolbar .color-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 8px;
  background: var(--toolbar-bg);
  border: 1px solid var(--toolbar-border);
  border-radius: 6px;
  box-shadow: var(--toolbar-shadow);
  white-space: nowrap;
}
.flipped .annotation-edit-toolbar .color-dropdown {
  top: auto;
  bottom: calc(100% + 4px);
}
.annotation-edit-toolbar .color-dropdown .color-option {
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  justify-content: center;
}
.annotation-edit-toolbar .color-dropdown .color-option .color-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  outline-offset: 2px;
}
.annotation-edit-toolbar .color-dropdown .color-option:hover .color-swatch, .annotation-edit-toolbar .color-dropdown .color-option:focus .color-swatch {
  outline: 2px solid var(--toolbar-focus-color);
}
.annotation-edit-toolbar .color-dropdown .color-option[aria-selected=true] .color-swatch {
  outline: 2px solid var(--toolbar-focus-color);
}

.annotation-note {
  cursor: pointer;
}
.annotation-note svg {
  width: 100%;
  height: 100%;
  display: block;
}
.annotation-note:hover:not(.selected), .annotation-note.selected {
  border-radius: 6px;
}

.annotation-ink .ink-canvas {
  pointer-events: none;
}

.ink-drawing-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.pdf-watermark-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 100;
}

.annotation-popup {
  position: fixed;
  z-index: 1000;
  min-width: 200px;
  max-width: 300px;
  background: rgba(50, 50, 50, 0.85);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.annotation-popup-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  cursor: move;
}

.annotation-popup-date {
  flex: 1;
  color: #666;
  font-size: 12px;
}

.annotation-popup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #666;
  cursor: pointer;
}
.annotation-popup-btn:hover {
  background-color: #e0e0e0;
  color: #333;
}
.annotation-popup-btn.delete:hover {
  background-color: #ffebee;
  color: #c62828;
}

.annotation-popup-content {
  padding: 0.75rem;
  color: #333;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.pdf-undo-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(50, 50, 50, 0.85);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  opacity: 1;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pdf-undo-bar.hidden {
  display: flex !important;
  opacity: 0;
  pointer-events: none;
}

.pdf-undo-bar-message {
  color: #fff;
}

.pdf-undo-bar-btn {
  padding: 0.25rem 0.75rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #64b5f6;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-transform: uppercase;
}
.pdf-undo-bar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pdf-undo-bar-dismiss {
  padding: 0.25rem;
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  line-height: 1;
}
.pdf-undo-bar-dismiss:hover {
  color: #fff;
}

.color-picker {
  position: relative;
}

.color-picker-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--toolbar-input-border, #5a5a5f);
  border-radius: 4px;
  background: var(--toolbar-input-bg, #4a4a4f);
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.color-picker-toggle:hover {
  border-color: #6a6a6f;
  background-color: #5a5a5f;
}
.color-picker-toggle svg {
  color: var(--toolbar-text, #f9f9fa);
  opacity: 0.7;
}

.color-picker-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.color-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  padding: 6px;
  display: flex;
  gap: 4px;
  background: var(--toolbar-bg, #38383d);
  border: 1px solid var(--toolbar-border, #2a2a2e);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}
@media (max-width: 600px) {
  .color-picker-dropdown {
    left: auto;
    right: 0;
  }
}

.color-picker-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.color-picker-option:hover {
  transform: scale(1.1);
}
.color-picker-option.selected {
  border-color: var(--toolbar-accent, #0060df);
}
.color-picker-option .color-picker-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.pdf-color-picker {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pdf-color-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.pdf-color-btn:hover {
  transform: scale(1.15);
}
.pdf-color-btn.active {
  border-color: #333;
  box-shadow: 0 0 0 2px white;
}

.note-dialog {
  min-width: 280px;
  max-width: 350px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  font-size: 14px;
  overflow: hidden;
}

.note-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 500;
}

.note-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #666;
  cursor: pointer;
}
.note-dialog-close:hover {
  background-color: #e0e0e0;
}

.note-dialog-input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
}
.note-dialog-input:focus {
  outline: none;
  background-color: #fafafa;
}

.note-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}

.note-dialog-save {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  background: #0060df;
  color: white;
}
.note-dialog-save:hover {
  background: #0050bf;
}

.pdf-viewer-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 2rem;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  border-radius: 8px;
  color: #c62828;
  text-align: center;
  font-size: 16px;
}

.pdf-viewer-toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  top: 60px;
  max-width: 90%;
  padding: 12px 20px;
  background: #323232;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.pdf-viewer-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pdf-page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: #f5f5f5;
  color: #666;
}

.pdf-pages-container.is-selecting-text .annotation {
  pointer-events: none !important;
}

.pdf-pages-container.highlight-mode .pdf-page {
  cursor: var(--pdf-cursor-freehighlight) 0 16, crosshair;
}
.pdf-pages-container.highlight-mode .textLayer :is(span, br) {
  cursor: var(--pdf-cursor-texthighlight) 0 16, text;
}
.pdf-pages-container.highlight-mode.is-drawing, .pdf-pages-container.highlight-mode.is-drawing * {
  cursor: var(--pdf-cursor-freehighlight) 0 16, crosshair !important;
}

.pdf-pages-container.underline-mode .pdf-page {
  cursor: var(--pdf-cursor-texthighlight) 0 16, text;
}
.pdf-pages-container.underline-mode .textLayer :is(span, br) {
  cursor: var(--pdf-cursor-texthighlight) 0 16, text;
}

.pdf-pages-container.ink-mode .pdf-page {
  cursor: var(--pdf-cursor-ink) 1 14, crosshair;
}
.pdf-pages-container.ink-mode.is-drawing, .pdf-pages-container.ink-mode.is-drawing * {
  cursor: var(--pdf-cursor-ink) 1 14, crosshair !important;
}

.pdf-pages-container.note-mode .pdf-page,
.pdf-pages-container.note-mode .textLayer,
.pdf-pages-container.note-mode .textLayer * {
  cursor: var(--pdf-cursor-note) 1 1, crosshair;
}

.pdf-pages-container.freehand-mode {
  cursor: crosshair;
}

.freehand-preview,
.freehand-preview-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
  mix-blend-mode: multiply;
}

@media (max-width: 1100px) {
  .pdf-tool-btn span {
    display: none;
  }
  .pdf-tool-btn {
    padding: 8px;
  }
}
@media (max-width: 900px) {
  .pdf-toolbar {
    flex-wrap: wrap;
    padding: 6px 8px;
  }
  .pdf-toolbar-section {
    flex: 0 0 auto;
  }
  .pdf-toolbar-left {
    order: 1;
  }
  .pdf-toolbar-right {
    order: 2;
  }
  .pdf-zoom-select {
    display: none;
  }
}
@media (max-width: 600px) {
  .pdf-toolbar {
    flex-wrap: nowrap;
    padding: 6px 8px;
    gap: 4px;
    justify-content: space-between;
  }
  .pdf-toolbar-section {
    gap: 4px;
  }
  .pdf-toolbar-left {
    flex: 0 0 auto;
  }
  .pdf-toolbar-left .pdf-toolbar-nav {
    display: none;
  }
  .pdf-toolbar-left .pdf-toolbar-zoom {
    display: flex;
  }
  .pdf-toolbar-left .pdf-toolbar-separator {
    display: none;
  }
  .pdf-toolbar-right {
    flex: 1;
    justify-content: flex-end;
    gap: 4px;
  }
  .pdf-toolbar-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  .pdf-tool-btn {
    padding: 8px;
    flex-shrink: 0;
  }
  .pdf-tool-btn span {
    display: none;
  }
  .pdf-tool-btn svg {
    width: 22px;
    height: 22px;
  }
  .pdf-toolbar-separator {
    display: none;
  }
  .pdf-toolbar-tools {
    display: flex;
    gap: 2px;
  }
  .pdf-toolbar-tools .pdf-tool-btn[data-tool=underline],
  .pdf-toolbar-tools .pdf-tool-btn[data-tool=ink] {
    display: none;
  }
  .pdf-toolbar-colors {
    display: flex;
    flex-shrink: 0;
  }
  .pdf-toolbar-actions {
    gap: 2px;
    flex-shrink: 0;
  }
  .pdf-toolbar-actions > .pdf-toolbar-btn:not([data-action*=toggleAnnotationSidebar]),
  .pdf-toolbar-actions > .pdf-tool-btn {
    display: none;
  }
  .pdf-toolbar-actions > .pdf-toolbar-btn[data-action*=toggleAnnotationSidebar] {
    display: flex;
  }
  .pdf-toolbar-overflow-btn {
    display: flex !important;
    flex-shrink: 0;
  }
  .annotation-popup {
    max-width: 90vw;
  }
  .note-dialog {
    max-width: 90vw;
    left: 5vw !important;
  }
}
.pdf-toolbar-overflow-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--toolbar-text);
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.pdf-toolbar-overflow-btn:hover {
  background-color: var(--toolbar-hover);
}
.pdf-toolbar-overflow-btn.active {
  background-color: var(--toolbar-active);
}
.pdf-toolbar-overflow-btn svg {
  width: 20px;
  height: 20px;
}

.pdf-toolbar-overflow-menu {
  display: none;
  position: fixed;
  top: auto;
  right: 8px;
  margin-top: 4px;
  padding: 8px;
  min-width: 200px;
  background: var(--toolbar-bg, #38383d);
  border: 1px solid var(--toolbar-border, #2a2a2e);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}
.pdf-toolbar-overflow-menu.open {
  display: block;
}

.pdf-overflow-section:not(:last-child) {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--toolbar-separator, rgba(255, 255, 255, 0.2));
}

.pdf-overflow-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--toolbar-text-secondary, #b1b1b3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 4px 8px;
}

.pdf-overflow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pdf-overflow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--toolbar-text, #f9f9fa);
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.pdf-overflow-btn:hover {
  background-color: var(--toolbar-hover, rgba(255, 255, 255, 0.1));
}
.pdf-overflow-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pdf-overflow-btn svg {
  width: 20px;
  height: 20px;
}

.pdf-overflow-page-display {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--toolbar-text, #f9f9fa);
  min-width: 50px;
  justify-content: center;
}

.pdf-overflow-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pdf-overflow-tool-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--toolbar-text, #f9f9fa);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
}
.pdf-overflow-tool-btn:hover {
  background-color: var(--toolbar-hover, rgba(255, 255, 255, 0.1));
  border-color: var(--toolbar-separator, rgba(255, 255, 255, 0.2));
}
.pdf-overflow-tool-btn.active {
  background-color: rgba(255, 255, 255, 0.95);
  border-color: #333;
  color: #333;
}
.pdf-overflow-tool-btn.active svg {
  stroke: #333;
}
.pdf-overflow-tool-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.pdf-overflow-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pdf-overflow-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--toolbar-text, #f9f9fa);
  cursor: pointer;
  transition: background-color 0.1s ease;
  font-size: 14px;
  text-align: left;
}
.pdf-overflow-action-btn:hover {
  background-color: var(--toolbar-hover, rgba(255, 255, 255, 0.1));
}
.pdf-overflow-action-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.pdf-overflow-colors {
  display: flex;
  gap: 6px;
  padding: 4px 8px;
}

.pdf-find-bar {
  --find-bar-bg: var(--pdf-dark-bg);
  --find-bar-border: var(--pdf-dark-bg-secondary);
  --find-bar-text: var(--pdf-dark-text);
  --find-bar-text-secondary: var(--pdf-dark-text-secondary);
  --find-bar-input-bg: var(--pdf-dark-input-bg);
  --find-bar-input-border: var(--pdf-dark-input-border);
  --find-bar-accent: var(--pdf-accent);
  --find-bar-hover: var(--pdf-dark-hover);
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  background-color: var(--find-bar-bg);
  border-bottom: 1px solid var(--find-bar-border);
}

.find-bar-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.find-input-container {
  position: relative;
  flex: 1;
  max-width: 300px;
  display: flex;
  align-items: center;
}

.find-input {
  width: 100%;
  height: 28px;
  padding: 0 70px 0 10px;
  border: 1px solid var(--find-bar-input-border);
  border-radius: 4px;
  background: var(--find-bar-input-bg);
  color: var(--find-bar-text);
  font-size: 13px;
}
.find-input::placeholder {
  color: var(--find-bar-text-secondary);
}
.find-input:focus {
  outline: none;
  border-color: var(--find-bar-accent);
  box-shadow: 0 0 0 1px var(--find-bar-accent);
}

.find-results {
  position: absolute;
  right: 10px;
  font-size: 12px;
  color: var(--find-bar-text-secondary);
  pointer-events: none;
  white-space: nowrap;
}
.find-results.not-found {
  color: #ff6b6b;
}

.find-buttons {
  display: flex;
  gap: 2px;
}

.find-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--find-bar-text);
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.find-btn:hover:not(:disabled) {
  background-color: var(--find-bar-hover);
}
.find-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.find-btn svg {
  width: 16px;
  height: 16px;
}

.find-separator {
  width: 1px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
}

.find-options {
  display: flex;
  gap: 4px;
}

.find-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--find-bar-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
}
.find-option input[type=checkbox] {
  display: none;
}
.find-option:hover {
  background-color: var(--find-bar-hover);
  color: var(--find-bar-text);
}
.find-option:has(input:checked) {
  background-color: var(--find-bar-accent);
  color: white;
  border-color: var(--find-bar-accent);
}

.find-message {
  padding: 4px 0 0;
  font-size: 12px;
  color: var(--find-bar-text-secondary);
}

.textLayer .search-highlight {
  background-color: rgba(0, 100, 255, 0.3);
  border-radius: 2px;
  color: transparent;
}
.textLayer .search-highlight.selected {
  background-color: rgba(0, 100, 255, 0.5);
}

@media (max-width: 600px) {
  .find-input-container {
    max-width: none;
  }
  .find-options {
    display: none;
  }
  .find-separator:nth-of-type(2) {
    display: none;
  }
}
.pdf-annotation-sidebar {
  --sidebar-width: 280px;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active: rgba(255, 255, 255, 0.1);
}

.pdf-sidebar-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.annotation-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.annotation-controls-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  gap: 8px;
}

.annotation-sort-controls {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 2px;
}
.annotation-sort-controls .sort-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--sidebar-text-secondary, #b1b1b3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.annotation-sort-controls .sort-btn:hover {
  color: var(--sidebar-text, #f9f9fa);
}
.annotation-sort-controls .sort-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--sidebar-text, #f9f9fa);
}

.annotation-filter-controls .annotation-filter-select {
  height: 26px;
  padding: 0 24px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b1b1b3' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center;
  background-size: 12px;
  color: var(--sidebar-text-secondary, #b1b1b3);
  font-size: 12px;
  cursor: pointer;
  appearance: none;
}
.annotation-filter-controls .annotation-filter-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--sidebar-text, #f9f9fa);
}
.annotation-filter-controls .annotation-filter-select:focus {
  outline: none;
  border-color: var(--sidebar-accent, #0060df);
}

.annotation-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
}
.annotation-list.empty {
  display: none;
}

.annotation-empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  color: var(--sidebar-text-secondary, #b1b1b3);
}
.annotation-empty-state.visible {
  display: flex;
  flex: 1;
}
.annotation-empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.annotation-empty-state p {
  margin: 0;
  font-size: 14px;
}
.annotation-empty-state p.hint {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.7;
}

.annotation-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  position: relative;
  width: 100%;
}
.annotation-list-item:hover {
  background: var(--sidebar-hover, rgba(255, 255, 255, 0.05));
}
.annotation-list-item:hover .annotation-item-hover {
  opacity: 1;
}
.annotation-list-item:focus {
  outline: 2px solid var(--sidebar-accent, #0060df);
  outline-offset: -2px;
}
.annotation-list-item.selected {
  background: var(--sidebar-active, rgba(255, 255, 255, 0.1));
}
.annotation-list-item.selected .annotation-item-label {
  color: var(--sidebar-text, #f9f9fa);
}
.annotation-list-item + .annotation-list-item {
  margin-top: 2px;
}

.annotation-item-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}
.annotation-item-icon svg {
  width: 100%;
  height: 100%;
}

.annotation-item-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.annotation-item-label {
  font-size: 13px;
  color: var(--sidebar-text-secondary, #b1b1b3);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.annotation-item-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(177, 177, 179, 0.7);
}

.annotation-item-separator {
  opacity: 0.5;
}

.annotation-item-type {
  font-weight: 500;
}

.annotation-item-hover {
  display: flex;
  align-items: center;
  gap: 2px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  background: var(--sidebar-accent, #0060df);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: white;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.annotation-item-hover svg {
  width: 12px;
  height: 12px;
}

@keyframes annotation-flash {
  0%, 100% {
    box-shadow: 0 0 0 2px var(--outline-color, #0060df), 0 0 0 3px var(--outline-around-color, #f0f0f4);
  }
  50% {
    box-shadow: 0 0 0 4px var(--outline-color, #0060df), 0 0 0 6px var(--outline-around-color, #f0f0f4), 0 0 20px 4px rgba(0, 96, 223, 0.4);
  }
}
.annotation.flashing {
  animation: annotation-flash 0.5s ease-in-out 3;
  z-index: 100 !important;
}

@media (max-width: 900px) {
  .pdf-annotation-sidebar {
    --sidebar-width: 240px;
  }
  .annotation-controls-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .annotation-sort-controls {
    justify-content: center;
  }
  .annotation-filter-controls .annotation-filter-select {
    width: 100%;
  }
}
@media (max-width: 600px) {
  .pdf-annotation-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.3);
  }
}
.pdf-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  z-index: 100;
  transition: opacity 0.3s ease;
}
.pdf-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.pdf-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0e0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: pdf-spin 0.8s linear infinite;
}

.pdf-loading-text {
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

@keyframes pdf-spin {
  to {
    transform: rotate(360deg);
  }
}
.pdf-viewer-announcer {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (forced-colors: active) {
  .pdf-toolbar-btn,
  .pdf-tool-btn {
    border: 2px solid ButtonText;
    background: Canvas;
    color: CanvasText;
  }
  .pdf-toolbar-btn:hover:not(:disabled),
  .pdf-tool-btn:hover:not(:disabled) {
    border-color: Highlight;
  }
  .pdf-toolbar-btn:focus,
  .pdf-tool-btn:focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
  .pdf-toolbar-btn:disabled,
  .pdf-tool-btn:disabled {
    border-color: GrayText;
    color: GrayText;
  }
  .pdf-tool-btn.active {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
    border: 2px solid HighlightText;
    box-shadow: none;
  }
  .pdf-tool-btn.active svg {
    stroke: HighlightText;
  }
  .pdf-tool-btn.active:hover {
    background: Highlight;
    color: HighlightText;
    border-color: Canvas;
  }
  .pdf-tool-btn.active:hover svg {
    stroke: HighlightText;
  }
  .pdf-page-input,
  .pdf-zoom-select,
  .find-input,
  .annotation-filter-select {
    border: 1px solid ButtonText;
    background: Canvas;
    color: CanvasText;
  }
  .pdf-page-input:focus,
  .pdf-zoom-select:focus,
  .find-input:focus,
  .annotation-filter-select:focus {
    outline: 2px solid Highlight;
    outline-offset: 0;
  }
  .pdf-sidebar-close,
  .find-btn {
    border: 1px solid ButtonText;
  }
  .pdf-sidebar-close:hover,
  .find-btn:hover {
    border-color: Highlight;
  }
  .pdf-sidebar-close:focus,
  .find-btn:focus {
    outline: 2px solid Highlight;
  }
  .thumbnail {
    border: 1px solid transparent;
  }
  .thumbnail:focus {
    outline: 2px solid Highlight;
  }
  .thumbnail.active {
    border-color: Highlight;
  }
  .thumbnail-image {
    border: 1px solid ButtonText;
  }
  .annotation {
    outline: 1px solid CanvasText;
  }
  .annotation:hover:not(.selected) {
    outline: 2px solid Highlight;
    box-shadow: none;
  }
  .annotation.selected {
    outline: 2px solid Highlight;
    box-shadow: none;
  }
  .annotation-edit-toolbar {
    border: 1px solid CanvasText;
  }
  .annotation-edit-toolbar .toolbar-btn {
    border: 1px solid ButtonText;
  }
  .annotation-edit-toolbar .toolbar-btn:hover {
    border-color: Highlight;
  }
  .annotation-edit-toolbar .toolbar-btn:focus-visible {
    outline: 2px solid Highlight;
  }
  .annotation-edit-toolbar .color-picker-btn {
    border: 1px solid ButtonText;
  }
  .annotation-edit-toolbar .color-picker-btn:hover {
    border-color: Highlight;
  }
  .annotation-edit-toolbar .color-picker-btn .color-swatch {
    forced-color-adjust: none;
  }
  .annotation-edit-toolbar .color-dropdown {
    border: 1px solid CanvasText;
  }
  .annotation-edit-toolbar .color-dropdown .color-option {
    border: 2px solid ButtonText;
  }
  .annotation-edit-toolbar .color-dropdown .color-option:hover, .annotation-edit-toolbar .color-dropdown .color-option:focus, .annotation-edit-toolbar .color-dropdown .color-option[aria-selected=true] {
    border-color: Highlight;
  }
  .annotation-edit-toolbar .color-dropdown .color-option .color-swatch {
    forced-color-adjust: none;
  }
  .color-picker-toggle {
    border: 1px solid ButtonText;
  }
  .color-picker-toggle:hover {
    border-color: Highlight;
  }
  .color-picker-toggle .color-picker-swatch {
    forced-color-adjust: none;
  }
  .color-picker-toggle svg {
    stroke: CanvasText;
  }
  .color-picker-option {
    border: 2px solid ButtonText;
  }
  .color-picker-option:hover, .color-picker-option.selected {
    border-color: Highlight;
  }
  .color-picker-option .color-picker-swatch {
    forced-color-adjust: none;
  }
  .annotation-popup {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
  .annotation-popup .annotation-popup-header {
    border-bottom: 1px solid CanvasText;
  }
  .annotation-popup .annotation-popup-btn {
    border: 1px solid ButtonText;
  }
  .annotation-popup .annotation-popup-btn:hover {
    border-color: Highlight;
  }
  .note-dialog {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
  .note-dialog .note-dialog-header {
    border-bottom: 1px solid CanvasText;
  }
  .note-dialog .note-dialog-input {
    border: 1px solid ButtonText;
    background: Canvas;
    color: CanvasText;
  }
  .note-dialog .note-dialog-input:focus {
    outline: 2px solid Highlight;
  }
  .note-dialog .note-dialog-save {
    border: 1px solid ButtonText;
  }
  .note-dialog .note-dialog-save:hover {
    border-color: Highlight;
  }
  .pdf-undo-bar {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
  .pdf-undo-bar .pdf-undo-bar-btn {
    border: 1px solid ButtonText;
  }
  .pdf-undo-bar .pdf-undo-bar-btn:hover {
    border-color: Highlight;
  }
  .pdf-undo-bar .pdf-undo-bar-dismiss {
    border: 1px solid ButtonText;
  }
  .pdf-undo-bar .pdf-undo-bar-dismiss:hover {
    border-color: Highlight;
  }
  .pdf-find-bar {
    border-bottom: 1px solid CanvasText;
  }
  .pdf-find-bar .find-results.not-found {
    color: CanvasText;
    text-decoration: underline;
  }
  .find-option {
    border: 1px solid ButtonText;
  }
  .find-option:has(input:checked) {
    background: Highlight;
    color: HighlightText;
    border-color: Highlight;
  }
  .pdf-annotation-sidebar,
  .pdf-thumbnail-sidebar {
    border-color: CanvasText;
  }
  .pdf-annotation-sidebar .pdf-sidebar-header,
  .pdf-thumbnail-sidebar .pdf-sidebar-header {
    border-bottom: 1px solid CanvasText;
  }
  .annotation-list-item {
    border: 2px solid transparent;
    background: Canvas;
    color: CanvasText;
  }
  .annotation-list-item:hover {
    border-color: Highlight;
  }
  .annotation-list-item:focus {
    outline: 2px solid Highlight;
  }
  .annotation-list-item.selected {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
    border-color: HighlightText;
  }
  .annotation-list-item.selected .annotation-item-label,
  .annotation-list-item.selected .annotation-item-meta,
  .annotation-list-item.selected .annotation-item-type,
  .annotation-list-item.selected .annotation-item-separator {
    color: HighlightText;
  }
  .annotation-list-item.selected:hover {
    background: Highlight;
    color: HighlightText;
    border-color: Canvas;
  }
  .annotation-sort-controls .sort-btn {
    border: 2px solid ButtonText;
    background: Canvas;
    color: CanvasText;
  }
  .annotation-sort-controls .sort-btn.active {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
    border-color: HighlightText;
  }
  .annotation-sort-controls .sort-btn.active:hover {
    background: Highlight;
    color: HighlightText;
    border-color: Canvas;
  }
  .pdf-loading-overlay {
    background: Canvas;
    color: CanvasText;
  }
  .pdf-loading-spinner {
    border-color: GrayText;
    border-top-color: Highlight;
  }
  .pdf-viewer-error {
    border: 2px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
  .pdf-viewer-toast {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
}
