/* Просмотр PDF: окно, панель, страницы, карточки. */
#pdf-sheet { position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column; background: var(--bg); animation: fade .15s ease-out; }
.pdf-viewer { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pdf-bar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--card); }
.pdf-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 6px; font-size: 14px; }
.pdf-pager { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-right: 6px; }
.pdf-page-input { width: 52px; text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.pdf-level { min-width: 44px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pdf-scroll { flex: 1; min-height: 0; overflow: auto; padding: 12px; background: #8a8f98; outline: none; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
:root[data-theme="dark"] .pdf-scroll { background: #2a2b2e; }
.pdf-pages { display: flex; flex-direction: column; align-items: flex-start; width: max-content; min-width: 100%; }
.pdf-holder { position: relative; flex: none; margin: 0 auto 12px; background: #fff; border-radius: 3px; box-shadow: 0 2px 10px #0004; }
.pdf-wait { position: absolute; inset: 0; display: grid; place-content: center; color: #bbb; font-size: 22px; }
.pdf-canvas { display: block; border-radius: 3px; }
.pdf-text { position: absolute; inset: 0; overflow: hidden; line-height: 1; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; user-select: text; -webkit-user-select: text; }
.pdf-text :is(span, br) { position: absolute; color: transparent; white-space: pre; cursor: text; transform-origin: 0 0; }
.pdf-text span.markedContent { top: 0; height: 0; }
.pdf-text ::selection { background: #1e96eb55; }
.pdf-loading { margin: auto; padding: 24px; text-align: center; color: var(--muted); }

.pdf-card { display: flex; flex-direction: column; margin: 8px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); max-width: 460px; }
.pdf-card.clickable { cursor: pointer; }
.pdf-card.clickable:hover { border-color: var(--accent); }
.pdf-thumb-box { background: #8a8f98; padding: 10px 10px 0; text-align: center; max-height: 340px; overflow: hidden; }
.pdf-thumb { display: inline-block; vertical-align: top; width: 100%; max-width: 300px; height: auto; min-height: 120px; background: #fff; border-radius: 3px; box-shadow: 0 2px 8px #0005; }
.pdf-caption { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; }
.pdf-caption strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-meta { color: var(--muted); white-space: nowrap; }
.pdf-open { padding: 4px 12px; font-size: 13px; }
.board-node .pdf-card { margin: 4px 0; max-width: none; }
.board-node .pdf-thumb-box { max-height: 220px; }
@media (max-width: 760px) { .pdf-bar .pdf-title { display: none; } .pdf-scroll { padding: 6px; } }
