/* In-app booklet reader (js/pdf-viewer.js), v3.0.3. Full-screen layer over the current screen. */
html.pdfv-open, html.pdfv-open body { overflow: hidden; }
.pdfv { position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column; background: #5f6b74; color: var(--ink, #102f43); font-family: "Plex Arabic", system-ui, sans-serif; }
.pdfv-bar { flex: none; display: grid; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); background: var(--surface, #fffefa); border-block-end: 1px solid var(--line, #e5ded2); box-shadow: 0 2px 10px rgba(16, 47, 67, .12); }
.pdfv-row { display: flex; align-items: center; gap: 10px; min-inline-size: 0; }
.pdfv-back { flex: none; display: inline-flex; align-items: center; gap: 6px; min-block-size: 44px; padding: 8px 14px; border: 0; border-radius: 12px; background: var(--btn-bg, #123b54); color: var(--btn-fg, #fff); font: 700 15px/1.2 "Plex Arabic", system-ui, sans-serif; cursor: pointer; }
.pdfv-back:focus-visible, .pdfv-bar button:focus-visible, .pdfv-toc:focus-visible { outline: 3px solid var(--focus, #2f6fe0); outline-offset: 2px; }
.pdfv-back-ico { font-size: 18px; line-height: 1; }
.pdfv-title { display: grid; min-inline-size: 0; line-height: 1.35; }
.pdfv-title strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdfv-page { font-size: 13px; color: var(--muted, #5d6f7d); font-variant-numeric: tabular-nums; }
.pdfv-tools { flex-wrap: wrap; gap: 8px; }
.pdfv-toc-wrap { flex: 1 1 110px; min-inline-size: 0; }
.pdfv-toc { inline-size: 100%; min-block-size: 40px; padding: 6px 10px; border: 1px solid var(--line-strong, #cec3b2); border-radius: 10px; background: var(--surface, #fff); color: inherit; font: 500 14px/1.3 "Plex Arabic", system-ui, sans-serif; }
.pdfv-zoom { display: inline-flex; align-items: center; gap: 4px; }
.pdfv-zoom button, .pdfv-dl { min-block-size: 40px; min-inline-size: 40px; padding: 6px 10px; border: 1px solid var(--line-strong, #cec3b2); border-radius: 10px; background: var(--surface, #fff); color: inherit; font: 700 16px/1 "Plex Arabic", system-ui, sans-serif; cursor: pointer; }
.pdfv-dl { font-size: 14px; }
.pdfv-zoom button:disabled { opacity: .45; cursor: default; }
.pdfv-zoom-val { min-inline-size: 48px; text-align: center; font: 600 13px/1 "Plex Arabic", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.pdfv-scroll { position: relative; flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px 8px calc(16px + env(safe-area-inset-bottom)); direction: ltr; outline: none; }
.pdfv-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-inline: auto; transform-origin: 50% 0; }
.pdfv-sheet { position: relative; flex: none; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.pdfv-sheet::before { content: attr(aria-label); position: absolute; inset: 0; display: grid; place-items: center; color: #9aa6af; font: 500 14px "Plex Arabic", system-ui, sans-serif; direction: rtl; }
.pdfv-sheet.is-rendered::before { content: none; }
.pdfv-sheet canvas { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; display: block; }
.pdfv-link { position: absolute; z-index: 1; padding: 0; border: 0; background: transparent; cursor: pointer; }
.pdfv-link:focus-visible { outline: 2px solid var(--focus, #2f6fe0); }
.pdfv-status { position: absolute; inset: auto 16px 50% 16px; display: grid; justify-items: center; gap: 12px; padding: 20px; margin-inline: auto; max-inline-size: 420px; border-radius: 16px; background: var(--surface, #fff); text-align: center; font: 600 15px/1.6 "Plex Arabic", system-ui, sans-serif; transform: translateY(50%); }
.pdfv-status[hidden] { display: none; }
.pdfv-status.is-error .btn { min-block-size: 44px; inline-size: 100%; }
.pdfv .sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.dark .pdfv { background: #1d2a33; }
body.dark .pdfv-bar, body.dark .pdfv-status, body.dark .pdfv-toc, body.dark .pdfv-zoom button, body.dark .pdfv-dl { background: #182a36; color: #e5edf2; border-color: #33495a; }
body.dark .pdfv-back { background: #e5edf2; color: #102f43; }
@media (min-width: 720px) { .pdfv-bar { grid-template-columns: auto 1fr; align-items: center; } .pdfv-tools { justify-content: flex-end; } .pdfv-toc-wrap { flex: 0 1 300px; } }
@media (prefers-reduced-motion: reduce) { .pdfv-scroll { scroll-behavior: auto; } }
