/* pdf-viewer.css — встроенный просмотрщик PDF/изображений (оверлей).
   Открывает файл нативным вьюером браузера в <iframe> поверх страницы —
   не уходя на другой роут, с рабочим Ctrl+F (поиск нативного PDF-вьюера).
   Используется фармакопеями и документами (window.QPdfViewer). */

.pdfv-scrim {
    position: fixed;
    inset: 0;
    z-index: 1200;                 /* выше .mdl-scrim (1090) — поверх любых модалок */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}
.pdfv-scrim.open { opacity: 1; visibility: visible; }

.pdfv {
    display: flex;
    flex-direction: column;
    width: min(1100px, 96vw);
    height: min(94vh, 1400px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg, 0 18px 50px rgba(0, 0, 0, .35));
    overflow: hidden;
    transform: translateY(8px) scale(.99);
    transition: transform .18s ease;
}
.pdfv-scrim.open .pdfv { transform: none; }

.pdfv-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px 11px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    flex-shrink: 0;
}
.pdfv-ic { color: var(--accent-strong); font-size: 1.05rem; line-height: 1; flex-shrink: 0; }
.pdfv-ttl {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.pdfv-hint {
    font-size: var(--text-2xs);
    color: var(--ink-3);
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 4px;
}
.pdfv-hint kbd {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--ink-2);
}
.pdfv-sp { flex: 1; }
.pdfv-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink-2);
    text-decoration: none;
    cursor: pointer;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
    flex-shrink: 0;
}
.pdfv-act:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }
.pdfv-act.x:hover { color: var(--bad); border-color: var(--bad); }

.pdfv-body { flex: 1; position: relative; min-height: 0; background: #fff; }
.pdfv-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

.pdfv-load {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--ink-3);
    font-size: var(--text-sm);
    background: var(--surface);
}
.pdfv-load .spin {
    width: 26px; height: 26px;
    border: 3px solid var(--line-strong);
    border-top-color: var(--accent-strong);
    border-radius: 50%;
    animation: pdfvSpin .8s linear infinite;
}
@keyframes pdfvSpin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
    .pdfv-scrim { padding: 0; }
    .pdfv { width: 100vw; height: 100vh; border-radius: 0; border: 0; }
    .pdfv-hint { display: none; }
}
