.pdffb {
	--pdffb-bg: transparent;
	--pdffb-full-bg: #fff;
	--pdffb-accent: #e8b04a;
	--pdffb-fg: #2a2a2a;
	--pdffb-glass: rgba(0,0,0,.06);
	position: relative; max-width: 100%; margin: 2em auto; outline: none;
	background: var(--pdffb-bg); color: var(--pdffb-fg);
	padding: 8px 0;
}
.pdffb.is-dark { --pdffb-bg: #1d2027; --pdffb-full-bg: #1d2027; --pdffb-fg: #f3f1ec; --pdffb-glass: rgba(255,255,255,.08); border-radius: 14px; padding: 28px 16px 16px; }
.pdffb:fullscreen, .pdffb.is-pseudo-full { background: var(--pdffb-full-bg); }
.pdffb:fullscreen, .pdffb.is-pseudo-full { border-radius: 0; margin: 0; display: flex; flex-direction: column; justify-content: center; padding: 3vh 4vw 2vh; }
.pdffb.is-pseudo-full { position: fixed; inset: 0; z-index: 99999; }
.pdffb:fullscreen .pdffb-bookwrap, .pdffb.is-pseudo-full .pdffb-bookwrap { max-width: calc(82vh * 1.42); }

/* Laden */
.pdffb-loader { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 80px 0; opacity: .9; }
.pdffb-spinner { width: 54px; height: 70px; position: relative; perspective: 200px; }
.pdffb-spinner::before, .pdffb-spinner::after { content: ""; position: absolute; inset: 0 0 0 50%; background: var(--pdffb-fg); border-radius: 0 4px 4px 0; transform-origin: left center; opacity: .85; }
.pdffb-spinner::before { inset: 0 50% 0 0; border-radius: 4px 0 0 4px; opacity: .35; }
.pdffb-spinner::after { animation: pdffb-turn 1.1s cubic-bezier(.6,0,.4,1) infinite; }
@keyframes pdffb-turn { 0% { transform: rotateY(0); } 50%,100% { transform: rotateY(-180deg); opacity: .35; } }
.pdffb-loader-text { font-size: .9rem; letter-spacing: .04em; }
.pdffb-loader-bar { width: 160px; height: 3px; background: var(--pdffb-glass); border-radius: 3px; overflow: hidden; }
.pdffb-loader-bar span { display: block; height: 100%; width: 0; background: var(--pdffb-accent); transition: width .2s; }

/* Podium + boek */
.pdffb-stage { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pdffb-bookwrap { flex: 1; min-width: 0; max-width: 1100px; transition: opacity .6s; opacity: 0; }
.pdffb.is-ready .pdffb-bookwrap { opacity: 1; }
.pdffb.is-zoomed .pdffb-stage { overflow: hidden; }
.pdffb.is-zoomed .pdffb-bookwrap { transform: scale(2.2); cursor: zoom-out; transition: transform .4s ease; }
.pdffb.is-zoomed .pdffb-side { opacity: 0; pointer-events: none; }
.pdffb-page { background: #fff; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.pdffb-page canvas { display: block; width: 100%; height: 100%; }
.pdffb-gloss { position: absolute; inset: 0; pointer-events: none; }
.pdffb-page.is-left .pdffb-gloss { background: linear-gradient(to left, rgba(0,0,0,.08), transparent 5%); }
.pdffb-page.is-right .pdffb-gloss { background: linear-gradient(to right, rgba(0,0,0,.08), transparent 5%); }
.pdffb-page[data-density="hard"] .pdffb-gloss { display: none; }

/* Zijpijlen */
.pdffb-side { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--pdffb-glass); color: var(--pdffb-fg); cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(6px); transition: background .2s, transform .2s, opacity .2s; padding: 0; }
.pdffb-side:hover:not(:disabled) { background: var(--pdffb-accent); color: #1d2027; transform: scale(1.08); }
.pdffb-side:disabled { opacity: .2; cursor: default; }
.pdffb-side svg { width: 24px; height: 24px; }

/* Voortgang + toolbar */
.pdffb-progress { height: 3px; margin: 20px auto 0; max-width: 1100px; background: var(--pdffb-glass); border-radius: 3px; overflow: hidden; }
.pdffb-progress span { display: block; height: 100%; width: 0; background: var(--pdffb-accent); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.pdffb-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; max-width: 1100px; margin: 12px auto 0; }
.pdffb-group { display: flex; align-items: center; gap: 4px; background: var(--pdffb-glass); border-radius: 999px; padding: 4px; }
.pdffb-btn { appearance: none; border: 0; background: transparent; color: var(--pdffb-fg); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0; text-decoration: none; transition: background .15s, color .15s; }
.pdffb-btn:hover:not(:disabled) { background: var(--pdffb-glass); color: var(--pdffb-fg); }
.pdffb-btn.is-active { background: var(--pdffb-accent); color: #1d2027; }
.pdffb-btn:disabled { opacity: .3; cursor: default; }
.pdffb-btn:focus-visible, .pdffb-side:focus-visible, .pdffb-thumb:focus-visible { outline: 2px solid var(--pdffb-accent); outline-offset: 2px; }
.pdffb-count { display: flex; white-space: nowrap; align-items: center; gap: 4px; padding: 0 6px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.pdffb-pageinput { width: 3.2em; background: transparent; border: 0; border-bottom: 1px solid currentColor; color: inherit; text-align: center; font: inherit; padding: 2px; -moz-appearance: textfield; }
.pdffb-pageinput::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Thumbnails */
.pdffb-thumbs { position: absolute; inset: 0; z-index: 5; background: rgba(255,255,255,.95); backdrop-filter: blur(10px); overflow-y: auto; padding: 20px; animation: pdffb-fade .25s; }
.pdffb.is-dark .pdffb-thumbs { background: rgba(20,22,28,.92); }
.pdffb-thumbs[hidden] { display: none; }
.pdffb-thumbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 32px 18px; padding-bottom: 24px; }
.pdffb-thumb { position: relative; border: 0; padding: 0; background: #fff; cursor: pointer; border-radius: 3px; box-shadow: 0 2px 10px rgba(0,0,0,.15); transition: transform .2s, box-shadow .2s; }
.pdffb-thumb:hover { transform: translateY(-4px); }
.pdffb-thumb.is-current { box-shadow: 0 0 0 3px var(--pdffb-accent), 0 2px 10px rgba(0,0,0,.15); }
.pdffb-thumb canvas { display: block; width: 100%; height: 100%; border-radius: 3px; }
.pdffb-thumb span { position: absolute; top: 100%; left: 0; right: 0; padding-top: 4px; font-size: .75rem; color: var(--pdffb-fg); }

.pdffb-toast { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--pdffb-accent); color: #1d2027; padding: 8px 16px; border-radius: 999px; font-size: .85rem; animation: pdffb-fade .2s; transition: opacity .4s; }
.pdffb-toast.is-out { opacity: 0; }
@keyframes pdffb-fade { from { opacity: 0; } }

/* Mobiel */
.pdffb, .pdffb * { -webkit-tap-highlight-color: transparent; }
.pdffb-bookwrap { margin: 0 auto; }
.pdffb .stf__wrapper { min-width: 0 !important; }
.pdffb-thumbs-close { position: sticky; top: 0; float: right; z-index: 2; background: var(--pdffb-glass); margin: -8px -8px 0 0; }
html.pdffb-lock, html.pdffb-lock body { overflow: hidden; overscroll-behavior: none; }
.pdffb.is-pseudo-full { height: 100vh; height: 100dvh; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
.pdffb-hint { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.72); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: .85rem; white-space: nowrap; pointer-events: none; animation: pdffb-fade .3s; transition: opacity .4s; }
.pdffb-hint.is-out { opacity: 0; }
.pdffb-hint span { width: 18px; height: 18px; border-radius: 50%; background: #fff; animation: pdffb-swipe 1.2s ease-in-out infinite; }
@keyframes pdffb-swipe { 0% { transform: translateX(10px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(-14px); opacity: 0; } }
.pdffb.is-touch .pdffb-bookwrap { touch-action: pan-y; }
.pdffb.is-touch.is-zoomed .pdffb-bookwrap { touch-action: none; }

/* Telefoon (class wordt door JS gezet, werkt ook als het thema geen viewport-tag heeft) */
.pdffb.is-mobile.is-dark { padding: 16px 8px 10px; border-radius: 10px; }
.pdffb.is-mobile .pdffb-side, .pdffb.is-mobile .pdffb-hide-sm { display: none !important; }
/* Twee gecentreerde rijen: bladeren bovenaan, extra's eronder */
.pdffb.is-mobile .pdffb-bar { flex-direction: column; align-items: center; gap: 10px; margin-top: 14px; }
.pdffb.is-mobile .pdffb-group { gap: 6px; padding: 4px; }
.pdffb.is-mobile .pdffb-btn { width: 48px; height: 48px; }
.pdffb.is-mobile .pdffb-btn svg { width: 22px; height: 22px; }
.pdffb.is-mobile .pdffb-group:first-child .pdffb-btn { width: 56px; height: 56px; }
.pdffb.is-mobile .pdffb-group:first-child .pdffb-btn svg { width: 26px; height: 26px; }
.pdffb.is-mobile .pdffb-group:first-child .pdffb-btn:not(:disabled) { background: var(--pdffb-accent); color: #1d2027; }
.pdffb.is-mobile .pdffb-count { padding: 0 10px; font-size: 1rem; }
.pdffb.is-mobile .pdffb-pageinput { width: 2.4em; font-size: 16px; }
.pdffb.is-mobile .pdffb-progress { margin-top: 12px; }
.pdffb.is-mobile .pdffb-thumbs { position: fixed; z-index: 99999; padding: max(16px, env(safe-area-inset-top)) 16px 24px; }
.pdffb.is-mobile .pdffb-thumbgrid { grid-template-columns: repeat(3, 1fr); gap: 30px 12px; }
@media (max-width: 340px) {
	.pdffb.is-mobile .pdffb-btn { width: 42px; height: 42px; }
	.pdffb.is-mobile .pdffb-group { gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
	.pdffb-progress span { transition: none; }
}
