.typstmate-pdf-viewer-container {
  padding: 0;
}

.typstmate-pdf-viewer-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--background-primary);
}

.typstmate-pdf-controls {
  display: flex;
  gap: 8px;
  padding: 8px;
  background-color: var(--background-secondary);
  border-bottom: 1px solid var(--background-modifier-border);
  align-items: center;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.typstmate-pdf-controls button {
  padding: 4px 8px;
  border: 1px solid var(--background-modifier-border);
  background-color: var(--background-primary);
  color: var(--text-normal);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  min-width: 32px;
}

.typstmate-pdf-controls button:hover {
  background-color: var(--background-modifier-hover);
}

.typstmate-pdf-controls span {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 80px;
  text-align: center;
}

.typstmate-pdf-viewer-area {
  flex: 1;
  overflow: auto;
  position: relative;
  background-color: var(--background-primary);
}

.typstmate-pdf-page-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px;
  gap: 20px;
}

.typstmate-pdf-page-container canvas {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--background-modifier-border);
}

.typstmate-pdf-text-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  transform-origin: 0 0;
}

:root {
  --typst-pdf-text-offset: calc(var(--typst-pdf-default-font-size, 12px) / 2);
  --typst-pdf-default-font-size: 12px;
  --typst-pdf-text-font-size: 12px;
  --typst-pdf-text-line-height: 1;
  --typst-pdf-text-font-family: inherit;
  --typst-pdf-text-transform-origin: 0 0;
}

.typstmate-pdf-text-layer span {
  position: absolute;
  color: transparent;
  pointer-events: auto;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  white-space: pre;
  font-size: var(--typst-pdf-text-font-size);
  line-height: var(--typst-pdf-text-line-height);
  font-family: var(--typst-pdf-text-font-family);
  transform-origin: var(--typst-pdf-text-transform-origin);
}

.typstmate-pdf-text-layer span::selection {
  background-color: rgba(0, 119, 255, 0.3);
  color: transparent;
}

.typstmate-pdf-text-layer span::-moz-selection {
  background-color: rgba(0, 119, 255, 0.3);
  color: transparent;
}

.typstmate-pdf-page {
  transform-origin: 0 0;
}

.typstmate-pdf-page {
  margin-bottom: 20px;
  position: relative;
}

.typstmate-pdf-page canvas {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--background-modifier-border);
}
