.pfs-viewer { position: relative; width: 100%; margin: 1.5em 0; color: inherit; outline: none; box-sizing: border-box; }
.pfs-viewer *, .pfs-viewer *::before, .pfs-viewer *::after { box-sizing: border-box; }

.pfs-wrap { position: relative; width: 100%; }
.pfs-stage { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 160px; padding: 6px 0; overflow: hidden; touch-action: pan-y; }
.pfs-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; opacity: .7; text-align: center; padding: 1em; }

/* Pages : aucun cadre, aucune ombre autour */
.pfs-book { position: relative; margin: 0 auto; }
.pfs-page { background: #fff; overflow: hidden; }
.pfs-page canvas, .pfs-holder canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.pfs-canfs .pfs-page, .pfs-canfs .pfs-holder { cursor: zoom-in; }
.pfs-isfs .pfs-page, .pfs-isfs .pfs-holder { cursor: default; }

/* Mode simple (carrousel) */
.pfs-track { display: flex; width: 100%; transition: transform .45s cubic-bezier(.22, .7, .2, 1); will-change: transform; }
.pfs-track.pfs-dragging { transition: none; }
.pfs-slide { flex: 0 0 100%; display: flex; justify-content: center; align-items: center; }
.pfs-holder { background: #fff; overflow: hidden; }

/* Barre sous le livre : flèches et compteur dans la typo du site */
.pfs-bar { display: flex; align-items: center; justify-content: center; gap: .6em; padding: .3em 0 0; font: inherit; color: inherit; }
.pfs-count { min-width: 6em; text-align: center; font: inherit; font-size: .95em; font-variant-numeric: tabular-nums; }
.pfs-nav, .pfs-close { all: unset; display: inline-block; box-sizing: border-box; cursor: pointer; font: inherit; font-size: 1.7em; line-height: 1; padding: .1em .45em; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.pfs-nav:hover, .pfs-close:hover { opacity: .6; }
.pfs-nav[disabled] { opacity: .25; cursor: default; }
.pfs-nav:focus-visible, .pfs-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Croix de fermeture (plein écran uniquement) */
.pfs-close { display: none; position: absolute; top: 10px; right: 14px; z-index: 10; font-size: 2.2em; }
.pfs-isfs .pfs-close { display: block; }

/* Plein écran (natif ou de secours sur iPhone) */
.pfs-viewer:fullscreen { display: flex; flex-direction: column; margin: 0; padding: 12px; background: var(--pfs-bg, #fff); overflow: hidden; }
.pfs-viewer.pfs-fake { position: fixed; inset: 0; z-index: 999999; display: flex; flex-direction: column; margin: 0; padding: 12px; background: var(--pfs-bg, #fff); overflow: hidden; }
.pfs-viewer:fullscreen .pfs-wrap, .pfs-viewer.pfs-fake .pfs-wrap { flex: 1; display: flex; }
.pfs-viewer:fullscreen .pfs-stage, .pfs-viewer.pfs-fake .pfs-stage { flex: 1; }

@media (prefers-reduced-motion: reduce) { .pfs-track { transition: none; } }
