/* 由 pdf-translate-view.html 内联 <style> 移入，确保 Vite/iframe 内通过 JS import 稳定生效 */
.pdf-trans-view.ah-theme-bg,
.pdf-trans-view {
  --pdf-theme-bg: var(--ah-page-bg, #f8fafc);
  --pdf-theme-text: var(--ah-page-text, #0f172a);
  --pdf-theme-accent: var(--ah-accent, #0d9488);
  --pdf-theme-surface: color-mix(in srgb, var(--pdf-theme-bg) 88%, white);
  --pdf-theme-surface-soft: color-mix(in srgb, var(--pdf-theme-bg) 96%, var(--pdf-theme-text));
  --pdf-theme-muted: color-mix(in srgb, var(--pdf-theme-text) 66%, transparent);
  --pdf-theme-border: color-mix(in srgb, var(--pdf-theme-text) 18%, transparent);
  --pdf-theme-canvas: color-mix(in srgb, var(--pdf-theme-bg) 74%, var(--pdf-theme-text));
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  color: var(--pdf-theme-text);
  background: var(--pdf-theme-bg);
}

/* 侧栏 + 主工作区 横向 flex（避免在 iframe 中高度未解析时退化为纵向堆叠） */
.pdf-trans-body {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.pdf-trans-header {
  padding: 10px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
  border-bottom: 1px solid var(--ah-border-subtle, rgba(0, 0, 0, 0.1));
  flex-shrink: 0;
  overflow: visible;
  color: var(--pdf-theme-text);
  background: color-mix(in srgb, var(--pdf-theme-bg) 90%, transparent);
  backdrop-filter: blur(12px);
}

.pdf-trans-header--with-page-title {
  grid-template-columns: auto auto minmax(0, 1fr);
}

.pdf-trans-header .sp-back-bar {
  min-width: max-content;
  padding: 0 8px 0 0;
  gap: 3px;
  flex-wrap: nowrap;
  border: 0;
  border-right: 1px solid var(--pdf-theme-border);
  background: transparent;
}

.pdf-trans-header .sp-back-bar__title {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}

.pdf-trans-header .sp-back-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
}

.pdf-trans-header .sp-back-btn:hover {
  color: var(--pdf-theme-accent);
  background: color-mix(in srgb, var(--pdf-theme-accent) 9%, transparent);
}

.pdf-trans-header__primary {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
}

.pdf-file-info {
  font-size: 14px;
  color: var(--ah-text-secondary, #666);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pdf-file-info .file-name {
  max-width: min(240px, 40vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#pdf-clear-btn {
  display: none;
  padding: 2px;
  color: #f87171;
  flex-shrink: 0;
}

#pdf-open-btn {
  cursor: pointer;
  min-height: 32px;
  padding: 6px 13px;
  border-radius: 9px;
  font-size: 13px;
}

#pdf-toggle-sidebar {
  margin-right: 12px;
}

.pdf-controls {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 12px;
  min-width: 0;
}

.pdf-pane-toggle,
.pdf-chat-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 9px;
  white-space: nowrap;
}

.pdf-pane-toggle.is-active,
.pdf-chat-toggle.is-active {
  color: var(--ah-accent, #b58900);
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 9%, transparent);
}

.pdf-separator {
  width: 1px;
  height: 24px;
  background: var(--ah-border-subtle, rgba(0, 0, 0, 0.1));
  margin: 0 4px;
  flex-shrink: 0;
}

.pdf-separator--short {
  height: 16px;
}

.pdf-separator--wide {
  margin: 0 8px;
}

/* --- Toggle Slider Component --- */
.pdf-trans-view .modern-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ah-text-secondary, #666);
  flex: 0 0 auto;
  white-space: nowrap;
}

.pdf-trans-view .toggle-container {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 18px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.pdf-trans-view .toggle-input {
  display: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  margin: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}

.pdf-trans-view .toggle-slider {
  box-sizing: border-box;
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: color-mix(in srgb, var(--pdf-theme-text) 24%, transparent);
  transition: background-color 0.3s;
  border-radius: 18px;
}

.pdf-trans-view .toggle-knob {
  box-sizing: border-box;
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  margin: 0;
  padding: 0;
  border: none;
}

.pdf-trans-view .modern-toggle input:checked ~ .toggle-slider {
  background-color: var(--pdf-theme-accent) !important;
}
.pdf-trans-view .modern-toggle input:checked ~ .toggle-knob {
  transform: translateX(12px) !important;
}
.pdf-trans-view .modern-toggle:hover .toggle-slider {
  filter: brightness(0.95);
}
.pdf-trans-view .toggle-slider::before,
.pdf-trans-view .toggle-slider::after,
.pdf-trans-view .toggle-knob::before,
.pdf-trans-view .toggle-knob::after {
  display: none !important;
  content: none !important;
}

/* --- Lang, page, and zoom controls --- */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.lang-selector span {
  color: var(--ah-text-muted, #999);
}

#pdf-target-lang {
  padding: 4px 8px;
  border-radius: 4px;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  white-space: nowrap;
}

#pdf-scale-display {
  width: 40px;
  text-align: center;
  font-size: 12px;
}

#pdf-export-btn {
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  inline-size: max-content;
  white-space: nowrap;
}

#pdf-export-btn > * {
  flex: 0 0 auto;
  white-space: nowrap;
}

.pdf-background-translation-status {
  max-width: 250px;
  overflow: hidden;
  color: var(--ah-text-muted, #777);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 250px;
}

.pdf-background-translation-status[data-state='ready'] {
  color: #2e7d32;
}

.pdf-background-translation-status[data-state='repairing'] {
  color: #9a6700;
}

.pdf-background-translation-status[data-state='rate-limited'] {
  color: #b45309;
}

.page-shell {
  overflow: hidden;
  border: 1px solid var(--pdf-theme-border);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--pdf-theme-text) 16%, transparent);
}

.pdf-page-status {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 28px;
  color: var(--pdf-theme-text);
  background:
    radial-gradient(
      circle at 50% 42%,
      color-mix(in srgb, var(--pdf-theme-accent) 10%, transparent),
      transparent 32%
    ),
    var(--pdf-theme-surface);
  text-align: left;
}

.page-shell[data-side='left'] .pdf-page-status {
  background: var(--pdf-theme-surface);
}

.pdf-page-status__spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, var(--pdf-theme-accent) 20%, transparent);
  border-top-color: var(--pdf-theme-accent);
  border-radius: 50%;
  animation: pdf-page-status-spin 0.8s linear infinite;
}

.pdf-page-status__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.pdf-page-status__title {
  color: var(--pdf-theme-text);
  font-size: 14px;
  font-weight: 600;
}

.pdf-page-status__detail {
  color: var(--pdf-theme-muted);
  font-size: 12px;
  line-height: 1.45;
}

.pdf-page-status[data-state='error'] {
  background: #fff7f7;
}

.pdf-page-status[data-state='rate-limited'] {
  background: #fffbeb;
}

.pdf-page-status[data-state='rate-limited'] .pdf-page-status__spinner {
  border-color: rgba(180, 83, 9, 0.2);
  border-top-color: #b45309;
}

.pdf-page-status[data-state='rate-limited'] .pdf-page-status__title,
.pdf-page-status[data-state='rate-limited'] .pdf-page-status__detail {
  color: #92400e;
}

.pdf-page-status[data-state='error'] .pdf-page-status__spinner {
  border-color: #ef4444;
  animation: none;
}

.pdf-page-status[data-state='error'] .pdf-page-status__title,
.pdf-page-status[data-state='error'] .pdf-page-status__detail {
  color: #b91c1c;
}

@keyframes pdf-page-status-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- History Sidebar --- */
#pdf-history-sidebar {
  width: 260px;
  border-right: 1px solid var(--ah-border-subtle, rgba(0, 0, 0, 0.1));
  display: none;
  flex-direction: column;
  background: var(--pdf-theme-surface);
  transition: width 0.2s ease;
  flex-shrink: 0;
}

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

.pdf-sidebar-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

#pdf-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.pdf-history-empty {
  padding: 20px;
  text-align: center;
  color: var(--ah-text-muted, #999);
  font-size: 13px;
}

/* --- Workspace & empty state --- */
.pdf-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--pdf-theme-canvas);
  position: relative;
}

.pdf-workspace.pdf-source-hidden #pdf-viewer-left,
.pdf-workspace.pdf-translation-hidden #pdf-viewer-right {
  display: none;
}

.pdf-workspace.pdf-source-hidden #pdf-viewer-right,
.pdf-workspace.pdf-translation-hidden #pdf-viewer-left {
  flex-basis: 100%;
}

#pdf-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--pdf-theme-text);
  background:
    radial-gradient(
      circle at 50% 42%,
      color-mix(in srgb, var(--pdf-theme-accent) 9%, transparent),
      transparent 34%
    ),
    var(--pdf-theme-bg);
  z-index: 10;
}

.pdf-empty-box {
  padding: 40px;
  text-align: center;
  border: 2px dashed var(--ah-border-med, #ccc);
  border-radius: 12px;
  cursor: pointer;
  background: color-mix(in srgb, var(--pdf-theme-surface) 76%, transparent);
}

.pdf-empty-box svg {
  margin-bottom: 16px;
}

.pdf-empty-title {
  font-size: 16px;
  color: var(--ah-text-primary, #333);
  margin-bottom: 8px;
}

.pdf-empty-subtitle {
  font-size: 13px;
  color: var(--ah-text-muted, #999);
}

.pdf-viewer-pane {
  flex: 1;
  overflow: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pdf-viewer-pane.pdf-native-preview-active {
  overflow: hidden;
}

#pdf-viewer-left {
  border-right: 1px solid var(--pdf-theme-border);
}

.pdf-native-first-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  background: #fff;
  z-index: 20;
}

/* --- PDF reference chat assistant --- */
.pdf-chat-panel {
  width: clamp(380px, 33vw, 520px);
  min-width: 360px;
  max-width: 48vw;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  border-left: 1px solid var(--ah-border-subtle, rgba(0, 0, 0, 0.12));
  background: var(--pdf-theme-surface);
  color: var(--pdf-theme-text);
}

.pdf-chat-panel[hidden] {
  display: none;
}

.pdf-chat-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--ah-border-subtle, rgba(0, 0, 0, 0.1));
}

.pdf-chat-panel__header h3 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 650;
}

.pdf-chat-panel__document {
  max-width: 240px;
  overflow: hidden;
  color: var(--ah-text-muted, #7b8794);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-chat-panel__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pdf-chat-reference-status {
  padding: 7px 14px;
  color: var(--pdf-theme-accent);
  background: color-mix(in srgb, var(--pdf-theme-accent) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--pdf-theme-accent) 14%, transparent);
  font-size: 11px;
}

.pdf-chat-messages {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: var(--pdf-theme-surface-soft);
}

.pdf-chat-welcome {
  padding: 26px 10px;
  text-align: center;
}

.pdf-chat-welcome__icon {
  width: 38px;
  height: 38px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(
    135deg,
    var(--pdf-theme-accent),
    color-mix(in srgb, var(--pdf-theme-accent) 72%, white)
  );
  border-radius: 12px;
  font-size: 20px;
}

.pdf-chat-welcome h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.pdf-chat-welcome p {
  margin: 0 auto 15px;
  max-width: 260px;
  color: var(--ah-text-muted, #7b8794);
  font-size: 12px;
  line-height: 1.55;
}

.pdf-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.pdf-chat-suggestions button {
  padding: 6px 9px;
  color: inherit;
  background: var(--pdf-theme-surface);
  border: 1px solid var(--pdf-theme-border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
}

.pdf-chat-suggestions button:hover {
  border-color: var(--ah-accent, #b58900);
}

.pdf-chat-message {
  max-width: 92%;
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 1px solid var(--ah-border-subtle, rgba(0, 0, 0, 0.08));
  border-radius: 10px;
  background: var(--pdf-theme-surface);
}

.pdf-chat-message--user {
  margin-left: auto;
  color: #fff;
  background: var(--pdf-theme-accent);
  border-color: var(--pdf-theme-accent);
}

.pdf-chat-message--assistant {
  margin-right: auto;
}

.pdf-chat-message--error {
  color: #b42318;
  background: #fff5f5;
  border-color: #fecaca;
}

.pdf-chat-message__label {
  margin-bottom: 4px;
  opacity: 0.72;
  font-size: 10px;
  font-weight: 700;
}

.pdf-chat-message__content {
  font-size: 13px;
  line-height: 1.58;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.pdf-chat-compose {
  position: relative;
  padding: 11px 12px;
  border-top: 1px solid var(--ah-border-subtle, rgba(0, 0, 0, 0.1));
}

#pdf-chat-input {
  width: 100%;
  min-height: 104px;
  max-height: 260px;
  resize: vertical;
  padding: 9px 50px 9px 10px;
  color: inherit;
  background: var(--pdf-theme-surface);
  border: 1px solid var(--pdf-theme-border);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}

#pdf-chat-input:focus {
  outline: 2px solid color-mix(in srgb, var(--ah-accent, #b58900) 25%, transparent);
  border-color: var(--ah-accent, #b58900);
}

.pdf-chat-send {
  position: absolute;
  right: 20px;
  bottom: 19px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: var(--pdf-theme-accent);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.pdf-chat-send:hover:not(:disabled) {
  background: color-mix(in srgb, var(--pdf-theme-accent) 84%, black);
}

.pdf-chat-send:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ah-accent, #b58900) 45%, transparent);
  outline-offset: 2px;
}

.pdf-chat-panel[data-busy='true'] .pdf-chat-send {
  opacity: 0.62;
  cursor: wait;
}

@media (max-width: 2000px) {
  .pdf-trans-header {
    padding: 8px 10px;
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pdf-trans-header__primary {
    grid-column: 1;
  }

  .pdf-controls {
    grid-column: 2;
  }

  .pdf-trans-header--with-page-title {
    grid-template-columns: auto minmax(150px, auto) minmax(0, 1fr);
  }

  .pdf-trans-header--with-page-title .sp-back-bar {
    grid-column: 1;
  }

  .pdf-trans-header--with-page-title .pdf-trans-header__primary {
    grid-column: 2;
  }

  .pdf-trans-header--with-page-title .pdf-controls {
    grid-column: 3;
  }

  .pdf-trans-header__primary,
  .pdf-controls {
    gap: 6px;
  }

  .pdf-controls {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .pdf-file-info .file-name {
    max-width: 155px;
  }

  .pdf-controls .modern-toggle > span,
  .pdf-controls .lang-selector > span,
  .pdf-controls .pdf-separator,
  .pdf-pane-toggle > span {
    display: none;
  }

  .pdf-pane-toggle,
  .pdf-chat-toggle,
  #pdf-export-btn {
    min-height: 30px;
    padding: 5px 8px;
  }

  .pdf-background-translation-status {
    max-width: min(180px, 18vw);
    flex: 0 1 180px;
  }
}

@media (max-width: 1100px) {
  .pdf-trans-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .pdf-trans-header__primary,
  .pdf-controls {
    grid-column: 1;
  }

  .pdf-trans-header--with-page-title {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pdf-trans-header--with-page-title .sp-back-bar {
    grid-column: 1;
  }

  .pdf-trans-header--with-page-title .pdf-trans-header__primary {
    grid-column: 2;
  }

  .pdf-trans-header--with-page-title .pdf-controls {
    grid-column: 1 / -1;
  }

  .pdf-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .pdf-trans-header__primary {
    flex-wrap: wrap;
  }

  .pdf-file-info {
    flex: 1 1 180px;
  }

  .pdf-file-info .file-name {
    max-width: 100%;
  }
}

.pdf-container-page-wrap {
  position: relative;
  margin: 0 0 20px;
  padding: 0;
  min-height: 100%;
}

.pdf-trans-view .ah-icon-btn {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdf-trans-view .ah-icon-btn:hover {
  color: var(--pdf-theme-accent);
  background: color-mix(in srgb, var(--pdf-theme-accent) 9%, transparent);
}
.pdf-trans-view .ah-icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pdf-trans-view .ah-btn-primary {
  background: var(--pdf-theme-accent);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--pdf-theme-accent) 24%, transparent);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}
.pdf-trans-view .ah-btn-primary:hover {
  transform: translateY(-1px);
  filter: saturate(1.08) brightness(0.97);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--pdf-theme-accent) 30%, transparent);
}
.pdf-trans-view .ah-btn-outline {
  min-height: 30px;
  border: 1px solid var(--pdf-theme-border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--pdf-theme-surface) 84%, transparent);
  color: inherit;
  cursor: pointer;
  transition:
    color 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}
.pdf-trans-view .ah-btn-outline:hover {
  color: var(--pdf-theme-accent);
  border-color: color-mix(in srgb, var(--pdf-theme-accent) 42%, var(--pdf-theme-border));
  background: color-mix(in srgb, var(--pdf-theme-accent) 8%, var(--pdf-theme-surface));
  transform: translateY(-1px);
}

.page {
  direction: ltr;
  margin: 0 auto;
  margin-bottom: 24px;
  position: relative;
  overflow: visible;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: white;
}
.canvasWrapper {
  overflow: hidden;
}
.textLayer {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  opacity: 1;
  line-height: 1;
}
.textLayer > span {
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}
.textLayer > br {
  display: none;
}

#pdf-container-left .textLayer > span {
  color: transparent !important;
}

#pdf-container-right .textLayer > span {
  color: var(--pdf-theme-accent) !important;
  background: rgba(255, 255, 255, 0.95);
}
.pdf-scroll-pane {
  scrollbar-width: thin;
}

#pdf-file-input {
  display: none !important;
}

/* Modal Dialog Styles */
#pdf-export-dialog {
  padding: 0;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  width: 380px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: var(--pdf-theme-surface);
  color: var(--pdf-theme-text);
}

.pdf-dialog-header {
  padding: 20px;
  border-bottom: 1px solid var(--pdf-theme-border);
}

.pdf-dialog-title {
  margin: 0;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pdf-dialog-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pdf-dialog-label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--pdf-theme-muted);
}

.pdf-dialog-select {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--pdf-theme-border);
  background-color: var(--pdf-theme-surface);
  color: var(--pdf-theme-text);
}

.pdf-dialog-footer {
  padding: 16px 20px;
  background: var(--pdf-theme-surface-soft);
  border-top: 1px solid var(--pdf-theme-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.pdf-dialog-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.pdf-dialog-btn-outline {
  border: 1px solid var(--pdf-theme-border);
  background: var(--pdf-theme-surface);
  color: var(--pdf-theme-text);
}

.pdf-dialog-btn-outline:hover {
  background: var(--pdf-theme-surface-soft);
}

.pdf-dialog-btn-primary {
  background: var(--ah-accent, #b58900);
  color: #fff;
  border: none;
}

.pdf-dialog-btn-primary:hover {
  filter: brightness(0.95);
}

/* Notice Dialog Styles */
#pdf-notice-dialog {
  padding: 0;
  border: none;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  width: min(440px, calc(100vw - 32px));
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: var(--pdf-theme-surface);
  color: var(--pdf-theme-text);
}

.pdf-notice-header {
  padding: 18px 20px 10px;
  border-bottom: 1px solid var(--pdf-theme-border);
}

.pdf-notice-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

#pdf-notice-message {
  padding: 18px 20px 8px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--pdf-theme-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.pdf-notice-footer {
  padding: 16px 20px 20px;
  display: flex;
  justify-content: flex-end;
}

.pdf-notice-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--ah-accent, #b58900);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

.pdf-notice-btn:hover {
  filter: brightness(0.95);
}
