/* The page remains readable without JavaScript; both actions are ordinary links. */
.pdf-resource { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pdf-resource-title { font-weight: 600; overflow-wrap: anywhere; }
.pdf-resource-details { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pdf-resource-origin { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.pdf-resource-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 8px; }
.pdf-resource .btn { font-size: 14px; min-height: 44px; }
.prose > .pdf-resource { margin: 6px 0 14px; line-height: 1.65; font-size: 16px; }
.pdf-resource-origin p { margin: 0; font-size: inherit; line-height: inherit; }
.prose > .resource-article { margin-top: 15px; font-size: 15px; line-height: 1.5; }
body.pdf-overlay-open { position: fixed; width: 100%; overflow: hidden; }
.pdf-overlay { inset: 0; width: min(1200px, calc(100% - 48px)); height: calc(100% - 48px); height: calc(100dvh - 48px); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow); overflow: hidden; }
.pdf-overlay::backdrop { background: rgb(0 0 0 / .65); }
.pdf-overlay-shell { height: 100%; display: flex; flex-direction: column; }
.pdf-overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pdf-overlay-head h2 { margin: 0; font-size: 18px; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.pdf-overlay-actions { display: flex; flex-shrink: 0; gap: 8px; }
.pdf-overlay .btn { cursor: pointer; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 12px; font-size: 14px; }
.pdf-overlay button:disabled { opacity: .4; cursor: default; }
.pdf-overlay-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.pdf-overlay-group { display: flex; align-items: center; gap: 4px; }
#pdf-page { min-width: 64px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.pdf-overlay-body { position: relative; flex: 1; min-height: 0; background: var(--chip); }
.pdf-overlay-container { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pdf-overlay-container:focus-visible { outline-offset: -3px; }
.pdf-overlay .pdfViewer { padding-block: 10px; }
.image-viewer-image { display: block; width: calc(100% - 20px); max-width: none; height: auto; margin: 10px auto; }
.image-viewer-image[hidden], .pdf-overlay [hidden] { display: none; }
.pdf-overlay-status { position: absolute; inset: 20px 16px auto; max-width: 480px; width: fit-content; margin: 0 auto; padding: 12px 16px; border-radius: 8px; background: var(--surface); color: var(--fg); text-align: center; box-shadow: var(--shadow); }
@media (max-width: 600px), (max-height: 500px) {
  .pdf-resource { align-items: flex-start; flex-direction: column; }
  .pdf-resource-actions { width: 100%; }
  .pdf-resource-actions .btn { flex: 1; justify-content: center; }
  .pdf-overlay { width: 100%; height: 100%; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .pdf-overlay-head { align-items: flex-start; padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left)); }
  .pdf-overlay-head h2 { font-size: 16px; padding-top: 10px; }
  .pdf-overlay-actions { gap: 4px; }
  .pdf-overlay .btn { padding-inline: 8px; font-size: 13px; }
  .pdf-overlay-toolbar { padding: 6px max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); gap: 4px; }
  .pdf-overlay-group { gap: 2px; }
  #pdf-page { min-width: 44px; font-size: 13px; }
  #pdf-fit { padding-inline: 4px; }
  .pdf-overlay-body { margin-bottom: env(safe-area-inset-bottom); }
}
