/**
 * PDF FlipBook — front-end styles.
 */

.pdf-flipbook {
	--pfb-bg: #e8edf5;
	--pfb-accent: #2563eb;
	--pfb-toolbar-bg: #111827;
	--pfb-toolbar-fg: #e5e7eb;
	--pfb-radius: 14px;

	margin: 1.25em 0;
	font-family: inherit;
}

.pdf-flipbook *,
.pdf-flipbook *::before,
.pdf-flipbook *::after {
	box-sizing: border-box;
}

.pfb-frame {
	display: flex;
	flex-direction: column;
	border-radius: var(--pfb-radius);
	overflow: hidden;
	background: #ffffff;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* ---------------------------------------------------------------- */
/* Toolbar                                                          */
/* ---------------------------------------------------------------- */

.pfb-toolbar {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	padding: 8px 12px;
	background: var(--pfb-toolbar-bg);
	color: var(--pfb-toolbar-fg);
	direction: ltr; /* toolbar layout itself stays stable; icons are flipped in RTL */
}

.pfb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--pfb-toolbar-fg);
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.pfb-btn:hover,
.pfb-btn:focus-visible {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.3);
	color: #fff;
	outline: none;
}

.pfb-btn:active {
	transform: translateY(1px);
}

.pfb-btn svg {
	display: block;
}

.pfb-gap {
	flex: 1 1 auto;
}

.pfb-pager {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.06);
	font-size: 14px;
	line-height: 1;
	white-space: nowrap;
}

.pfb-cur {
	width: 3.2em;
	height: 24px;
	padding: 0 4px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.25);
	color: #fff;
	font: inherit;
	font-size: 13px;
	text-align: center;
}

.pfb-cur:focus {
	outline: 2px solid var(--pfb-accent);
	outline-offset: 1px;
}

.pfb-of,
.pfb-total {
	opacity: 0.85;
}

/* RTL toolbar: mirror the layout AND the flip icons so it feels like a
   Persian PDF reader ("previous" on the right, pointing right). */
.pfb-rtl .pfb-toolbar {
	direction: rtl;
}

.pfb-rtl .pfb-btn[data-act="prev"] svg,
.pfb-rtl .pfb-btn[data-act="next"] svg {
	transform: scaleX(-1);
}

/* ---------------------------------------------------------------- */
/* Book area                                                        */
/* ---------------------------------------------------------------- */

.pfb-box {
	position: relative;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 30px 16px 40px;
	background:
		radial-gradient(1200px 420px at 50% -60px, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 70%),
		var(--pfb-bg);
	overflow: hidden;
	transition: min-height 0.2s ease;
}

.pfb-frame:fullscreen {
	background: #0b1220;
	border-radius: 0;
}

.pfb-frame:fullscreen .pfb-box {
	flex: 1 1 auto;
	padding-top: 4vh;
	background:
		radial-gradient(1200px 480px at 50% -60px, rgba(59, 130, 246, 0.16), rgba(0, 0, 0, 0) 70%),
		#0b1220;
}

.pfb-frame:-webkit-full-screen {
	background: #0b1220;
	border-radius: 0;
}

.pfb-frame:-webkit-full-screen .pfb-box {
	flex: 1 1 auto;
	padding-top: 4vh;
	background: #0b1220;
}

.pfb-book {
	position: relative;
	outline: none;
}

.pfb-book:focus-visible {
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
	border-radius: 6px;
}

/* Pages (our elements receive .stf__item from StPageFlip) */
.pfb-page {
	background: #ffffff;
}

.pfb-page-inner {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #ffffff;
}

.pfb-page-inner canvas {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
}

/* Page placeholder while the PDF page is being rendered */
.pfb-ph {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	font-weight: 600;
	color: #c3cad6;
	background: linear-gradient(110deg, #f1f4f9 32%, #e6ebf3 46%, #f1f4f9 60%);
	background-size: 220% 100%;
	animation: pfb-shimmer 1.5s infinite linear;
}

.is-loaded .pfb-ph {
	display: none;
}

@keyframes pfb-shimmer {
	from { background-position: 170% 0; }
	to   { background-position: -70% 0; }
}

/* ---------------------------------------------------------------- */
/* Loader & error                                                   */
/* ---------------------------------------------------------------- */

.pfb-loader {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: rgba(255, 255, 255, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

.pfb-loader[hidden] {
	display: none;
}

.pfb-spin {
	width: 38px;
	height: 38px;
	border: 4px solid rgba(17, 24, 39, 0.12);
	border-top-color: var(--pfb-accent);
	border-radius: 50%;
	animation: pfb-spin 0.9s infinite linear;
}

@keyframes pfb-spin {
	to { transform: rotate(360deg); }
}

.pfb-loading {
	font-size: 14px;
	color: #334155;
}

.pfb-pct {
	font-variant-numeric: tabular-nums;
}

.pfb-error {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 24px;
	text-align: center;
	background: #fff;
}

.pfb-error[hidden] {
	display: none;
}

.pfb-error p {
	margin: 0;
	color: #7f1d1d;
	font-weight: 600;
}

.pfb-open {
	display: inline-block;
	padding: 9px 18px;
	border-radius: 9px;
	background: var(--pfb-accent);
	color: #fff !important;
	text-decoration: none;
	font-weight: 600;
}

.pfb-open:hover {
	filter: brightness(1.08);
}

/* Editor/admin notice */
.pfb-admin-notice {
	padding: 12px 16px;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	background: #f8fafc;
	color: #334155;
}

/* ---------------------------------------------------------------- */
/* RTL (book geometry is mirrored; page content is mirrored back)   */
/* ---------------------------------------------------------------- */

.pfb-rtl .pfb-book.stf__parent {
	transform: scaleX(-1);
}

/* Only inside book mode! The counter-mirror lives on the book element;
   scroll-mode pages must stay unmirrored. */
.pfb-rtl.pfb-mode-book .pfb-page-inner {
	transform: scaleX(-1);
}

/* ---------------------------------------------------------------- */
/* Small screens                                                    */
/* ---------------------------------------------------------------- */

@media (max-width: 600px) {
	.pfb-box {
		padding: 18px 8px 26px;
	}

	.pfb-toolbar {
		gap: 4px;
		padding: 6px 8px;
	}

	.pfb-btn {
		min-width: 32px;
		height: 32px;
	}

	.pfb-pager {
		height: 32px;
		font-size: 13px;
	}
}

@media print {
	.pdf-flipbook {
		display: none;
	}
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
	.pfb-ph {
		animation: none;
	}

	.pfb-spin {
		animation-duration: 1.6s;
	}
}

/* ---------------------------------------------------------------- */
/* Toolbar active state                                             */
/* ---------------------------------------------------------------- */

.pfb-btn.is-active {
	background: var(--pfb-accent);
	border-color: rgba(255, 255, 255, 0.25);
	color: #fff;
}

.pfb-btn.is-active:hover,
.pfb-btn.is-active:focus-visible {
	background: var(--pfb-accent);
}

/* ---------------------------------------------------------------- */
/* Thumbnail panel (table of pages)                                 */
/* ---------------------------------------------------------------- */

.pfb-thumbs {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 7;
	width: min(240px, 80%);
	display: flex;
	flex-direction: column;
	background: #f8fafc;
	border-right: 1px solid #e2e8f0;
	box-shadow: 14px 0 34px rgba(15, 23, 42, 0.16);
	transform: translateX(-112%);
	transition: transform 0.28s ease;
}

.pfb-thumbs.is-open {
	transform: translateX(0);
}

.pfb-rtl .pfb-thumbs {
	left: auto;
	right: 0;
	border-right: 0;
	border-left: 1px solid #e2e8f0;
	box-shadow: -14px 0 34px rgba(15, 23, 42, 0.16);
	transform: translateX(112%);
}

.pfb-rtl .pfb-thumbs.is-open {
	transform: translateX(0);
}

.pfb-thumbs-list {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px 12px 18px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	scrollbar-width: thin;
	scrollbar-color: #b6c2d4 transparent;
}

.pfb-thumbs-list::-webkit-scrollbar {
	width: 9px;
}

.pfb-thumbs-list::-webkit-scrollbar-thumb {
	background: #b6c2d4;
	border-radius: 8px;
	border: 2px solid #f8fafc;
}

.pfb-thumb {
	position: relative;
	display: block;
	width: 134px;
	padding: 0 0 2px;
	border: 2px solid #dbe3ee;
	border-radius: 9px;
	background: #ffffff;
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.pfb-thumb:hover {
	border-color: #a9bada;
	transform: translateY(-1px);
}

.pfb-thumb.is-current {
	border-color: var(--pfb-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.pfb-thumb-cv {
	display: block;
	width: 100%;
	height: auto;
}

.pfb-thumb-ph {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 168px;
	font-size: 15px;
	font-weight: 600;
	color: #c3cad6;
	background: linear-gradient(110deg, #f1f4f9 32%, #e6ebf3 46%, #f1f4f9 60%);
	background-size: 220% 100%;
	animation: pfb-shimmer 1.5s infinite linear;
}

.pfb-thumb-num {
	display: block;
	padding: 4px 0 5px;
	text-align: center;
	font-size: 12px;
	color: #64748b;
}

/* ---------------------------------------------------------------- */
/* Continuous scroll mode                                           */
/* ---------------------------------------------------------------- */

.pfb-scroll {
	display: none;
	position: relative;
	z-index: 1;
	width: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 20px 12px 28px;
	scroll-behavior: smooth;
	scrollbar-width: thin;
	scrollbar-color: #94a3b8 transparent;
	outline: none;
}

.pfb-scroll::-webkit-scrollbar {
	width: 10px;
}

.pfb-scroll::-webkit-scrollbar-thumb {
	background: #94a3b8;
	border-radius: 8px;
	border: 2px solid transparent;
	background-clip: padding-box;
}

.pfb-mode-scroll .pfb-scroll {
	display: block;
}

.pfb-mode-scroll .pfb-book {
	display: none !important;
}

.pfb-spage {
	position: relative;
	margin: 0 auto 20px;
	background: #ffffff;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.13), 0 1px 3px rgba(15, 23, 42, 0.1);
	overflow: hidden;
}

.pfb-spage .pfb-page-inner {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #ffffff;
}

.pfb-frame:fullscreen .pfb-scroll {
	background: transparent;
}

/* ---------------------------------------------------------------- */
/* Pretty frame (v1.2): a soft "mat" around the whole widget         */
/* ---------------------------------------------------------------- */

.pdf-flipbook.pfb {
	padding: 10px;
	background: linear-gradient(140deg, #d9e2ee 0%, #f8fafd 42%, #e3e9f2 78%, #cfdae8 100%);
	border-radius: 22px;
	box-shadow:
		0 30px 60px -22px rgba(15, 23, 42, 0.30),
		0 10px 24px -14px rgba(15, 23, 42, 0.20),
		inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.pfb-frame {
	box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* ---------------------------------------------------------------- */
/* Title & description header                                       */
/* ---------------------------------------------------------------- */

.pfb-head {
	padding: 14px 18px 12px;
	background: linear-gradient(180deg, #fbfcfe, #f3f6fa);
	border-bottom: 1px solid #e6ebf2;
	position: relative;
	overflow: hidden;
}

.pfb-head::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--pfb-accent), rgba(37, 99, 235, 0.15));
}

.pfb-head[hidden] {
	display: none;
}

.pfb-title {
	margin: 0;
	font-size: 16.5px;
	font-weight: 700;
	line-height: 1.5;
	color: #0f172a;
}

.pfb-desc {
	margin: 4px 0 0;
	font-size: 13.5px;
	line-height: 1.9;
	color: #5b6779;
}

.pfb-title:empty,
.pfb-desc:empty {
	display: none;
}

.pfb-rtl .pfb-head {
	direction: rtl;
	text-align: right;
}

.pfb-rtl .pfb-head::after {
	background: linear-gradient(270deg, var(--pfb-accent), rgba(37, 99, 235, 0.15));
}

/* ---------------------------------------------------------------- */
/* Disabled controls (until the PDF is fully loaded)                */
/* ---------------------------------------------------------------- */

.pfb-toolbar button[disabled],
.pfb-toolbar .pfb-cur[disabled] {
	opacity: 0.38;
	pointer-events: none;
}

.pfb-btn.pfb-is-disabled {
	opacity: 0.38;
	pointer-events: none;
}

/* ---------------------------------------------------------------- */
/* Page stack behind the book (part of the frame decoration)        */
/* ---------------------------------------------------------------- */

.pfb-bookwrap {
	position: relative;
	display: inline-block;
}

.pfb-bookwrap::before {
	content: '';
	position: absolute;
	top: 8px;
	bottom: -14px;
	left: -12px;
	right: -12px;
	z-index: 0;
	border-radius: 10px;
	background: linear-gradient(#fdfdfe, #eef1f6);
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
	transform: rotate(-0.5deg);
}

.pfb-bookwrap::after {
	content: '';
	position: absolute;
	left: 6%;
	right: 6%;
	bottom: -24px;
	height: 20px;
	z-index: 0;
	background: radial-gradient(50% 100% at 50% 0, rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0) 72%);
}

.pfb-book {
	position: relative;
	z-index: 1;
}

.pfb-mode-scroll .pfb-bookwrap {
	display: none;
}

/* ---------------------------------------------------------------- */
/* Bottom filmstrip                                                 */
/* ---------------------------------------------------------------- */

.pfb-strip {
	border-top: 1px solid #e5eaf1;
	background: linear-gradient(180deg, #f8fafc, #eef2f7);
	padding: 10px 10px 8px;
	direction: ltr;
}

.pfb-strip[hidden] {
	display: none;
}

.pfb-rtl .pfb-strip {
	direction: rtl;
}

.pfb-strip-list {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 2px 4px 6px;
	scrollbar-width: thin;
	scrollbar-color: #a9b7c9 transparent;
}

.pfb-strip-list::-webkit-scrollbar {
	height: 8px;
}

.pfb-strip-list::-webkit-scrollbar-thumb {
	background: #a9b7c9;
	border-radius: 8px;
}

.pfb-strip-item {
	position: relative;
	flex: 0 0 auto;
	width: 64px;
	padding: 0;
	border: 2px solid #d5dde9;
	border-radius: 8px;
	background: #ffffff;
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.pfb-strip-item:hover {
	border-color: #9fb4d2;
	transform: translateY(-2px);
}

.pfb-strip-item.is-current {
	border-color: var(--pfb-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.pfb-strip-item canvas {
	display: block;
	width: 100%;
	height: auto;
}

.pfb-strip-ph {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 88px;
	font-size: 12px;
	font-weight: 600;
	color: #bcc6d6;
	background: linear-gradient(110deg, #f1f4f9 32%, #e6ebf3 46%, #f1f4f9 60%);
	background-size: 220% 100%;
	animation: pfb-shimmer 1.5s infinite linear;
}

.pfb-frame:fullscreen .pfb-strip {
	background: #0d1526;
	border-top-color: #1e2c44;
}

.pfb-frame:fullscreen .pfb-strip-item {
	border-color: #2b3b57;
	background: #101a2c;
}

.pfb-frame:fullscreen .pfb-strip-ph {
	background: #16223a;
	color: #46587a;
	animation: none;
}

/* ---------------------------------------------------------------- */
/* Search panel                                                     */
/* ---------------------------------------------------------------- */

.pfb-btn-dark {
	border-color: rgba(15, 23, 42, 0.14);
	background: #ffffff;
	color: #334155;
}

.pfb-btn-dark:hover,
.pfb-btn-dark:focus-visible {
	background: #eef2f7;
	border-color: rgba(15, 23, 42, 0.25);
	color: #0f172a;
}

.pfb-search {
	position: absolute;
	top: 14px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 8;
	width: min(680px, 92%);
	max-height: calc(100% - 28px);
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-radius: 14px;
	box-shadow: 0 20px 55px rgba(15, 23, 42, 0.30), 0 0 0 1px rgba(15, 23, 42, 0.05);
	overflow: hidden;
	direction: ltr;
}

.pfb-search[hidden] {
	display: none !important;
}

.pfb-rtl .pfb-search {
	direction: rtl;
}

.pfb-search-bar {
	display: flex;
	gap: 6px;
	padding: 10px;
	background: #f8fafc;
	border-bottom: 1px solid #edf1f7;
}

.pfb-search-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	padding: 0 14px;
	border: 1px solid #d7dfeb;
	border-radius: 10px;
	background: #ffffff;
	color: #0f172a;
	font: inherit;
	font-size: 15px;
}

.pfb-search-input:focus {
	outline: 2px solid var(--pfb-accent);
	outline-offset: 1px;
	border-color: transparent;
}

.pfb-search-status {
	padding: 8px 14px;
	font-size: 12.5px;
	color: #64748b;
	border-bottom: 1px solid #f1f5f9;
	min-height: 33px;
}

.pfb-search-status:empty {
	display: none;
}

.pfb-search-results {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	overflow-y: auto;
	padding: 8px;
	scrollbar-width: thin;
}

.pfb-search-hit {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	padding: 9px 10px;
	border: 0;
	border-radius: 9px;
	background: none;
	cursor: pointer;
	font: inherit;
	text-align: start;
}

.pfb-search-hit:hover,
.pfb-search-hit:focus-visible {
	background: #f1f5f9;
	outline: none;
}

.pfb-search-page {
	flex: 0 0 auto;
	padding: 2px 8px;
	border-radius: 6px;
	background: var(--pfb-accent);
	color: #ffffff;
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1.6;
}

.pfb-search-snip {
	font-size: 13px;
	line-height: 1.8;
	color: #334155;
	word-break: break-word;
}

.pfb-rtl .pfb-search-snip {
	direction: rtl;
	text-align: right;
}

.pfb-search mark {
	background: #ffe58a;
	color: inherit;
	border-radius: 3px;
	padding: 0 1px;
}

/* ---------------------------------------------------------------- */
/* Text layer (search highlights on the page)                       */
/* ---------------------------------------------------------------- */

.pfb-textlayer {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 2;
}

.pfb-textlayer span {
	position: absolute;
	white-space: pre;
	color: transparent;
	transform-origin: 0 0;
	line-height: 1;
}

.pfb-textlayer span.pfb-hit {
	background: rgba(255, 196, 0, 0.55);
	border-radius: 2px;
	box-shadow: 0 0 0 2px rgba(255, 184, 0, 0.35);
}

/* ---------------------------------------------------------------- */
/* Toast                                                            */
/* ---------------------------------------------------------------- */

.pfb-toast {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 9;
	padding: 9px 18px;
	border-radius: 999px;
	background: #111827;
	color: #ffffff;
	font-size: 13px;
	box-shadow: 0 10px 26px rgba(15, 23, 42, 0.35);
	animation: pfb-toast 2.3s ease forwards;
	pointer-events: none;
}

@keyframes pfb-toast {
	0%   { opacity: 0; transform: translateX(-50%) translateY(8px); }
	10%  { opacity: 1; transform: translateX(-50%) translateY(0); }
	82%  { opacity: 1; }
	100% { opacity: 0; transform: translateX(-50%) translateY(6px); }
}

/* ---------------------------------------------------------------- */
/* FlowPaper-inspired skin (v1.3)                                   */
/* Floating pill toolbar at the bottom + side arrows + zoom         */
/* ---------------------------------------------------------------- */

.pfb-frame {
	position: relative;
}

/* The book area becomes the stage; scrolling with overflow for zoom */
.pfb-mode-book .pfb-box {
	overflow: auto;
}

.pfb-box {
	padding: 22px 14px 92px;
}

.pfb-bookwrap {
	margin: auto; /* safe centering: stays reachable when zoomed > 100% */
}

.pfb-frame:fullscreen .pfb-box {
	padding: 18px 14px 92px;
}

/* --- floating bottom toolbar ------------------------------------ */

.pfb-toolbar {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 7;
	max-width: calc(100% - 20px);
	gap: 2px;
	padding: 6px 8px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(24, 28, 35, 0.92);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.pfb-toolbar::-webkit-scrollbar {
	display: none;
}

.pfb-toolbar .pfb-btn {
	border: 0;
	background: transparent;
	border-radius: 999px;
	min-width: 34px;
	height: 34px;
	padding: 0 6px;
}

.pfb-toolbar .pfb-btn:hover,
.pfb-toolbar .pfb-btn:focus-visible {
	background: rgba(255, 255, 255, 0.14);
	border: 0;
	color: #fff;
}

.pfb-toolbar .pfb-btn:active {
	transform: none;
}

.pfb-tb-sep {
	flex: 0 0 auto;
	width: 1px;
	height: 20px;
	margin: 0 5px;
	background: rgba(255, 255, 255, 0.16);
}

.pfb-zoom {
	flex: 0 0 auto;
	min-width: 42px;
	text-align: center;
	font-size: 11.5px;
	color: #d7dde6;
	font-variant-numeric: tabular-nums;
	user-select: none;
}

/* --- big prev/next arrows at the book's sides --------------------- */

.pfb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(24, 28, 35, 0.55);
	color: #ffffff;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s ease, background-color 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.pfb-box:hover .pfb-nav:not([disabled]),
.pfb-nav:focus-visible {
	opacity: 0.92;
}

.pfb-nav:hover {
	background: rgba(24, 28, 35, 0.82);
}

.pfb-nav[disabled] {
	opacity: 0 !important;
	pointer-events: none;
}

.pfb-nav-prev {
	left: 12px;
}

.pfb-nav-next {
	right: 12px;
}

.pfb-rtl .pfb-nav-prev {
	left: auto;
	right: 12px;
}

.pfb-rtl .pfb-nav-next {
	right: auto;
	left: 12px;
}

.pfb-rtl .pfb-nav svg {
	transform: scaleX(-1);
}

.pfb-frame:fullscreen .pfb-nav {
	opacity: 0.9;
}

/* --- small screens ------------------------------------------------ */

@media (max-width: 640px) {
	.pfb-nav {
		display: none;
	}

	.pfb-toolbar {
		bottom: 10px;
	}

	.pfb-box {
		padding-bottom: 84px;
	}
}

/* Keep the floating toolbar (and toast) above the docked filmstrip so they
   never overlap it. :has() degrades gracefully on very old browsers. */
.pfb-frame:has(.pfb-strip:not([hidden])) .pfb-toolbar {
	bottom: 132px;
}

.pfb-frame:has(.pfb-strip:not([hidden])) .pfb-toast {
	bottom: 150px;
}

@media (max-width: 640px) {
	.pfb-frame:has(.pfb-strip:not([hidden])) .pfb-toolbar {
		bottom: 126px;
	}
}

/* The pill toolbar must stay on a single row (scrolls horizontally). */
.pfb-toolbar {
	flex-wrap: nowrap;
	flex-direction: row;
	align-items: center;
}

/* ---------------------------------------------------------------- */
/* Mobile toolbar: wrap into tidy rows so every icon (share, print, */
/* download, ...) stays visible — no hidden horizontal scrolling.    */
/* ---------------------------------------------------------------- */

@media (max-width: 640px) {
	.pfb-toolbar {
		flex-wrap: wrap;
		justify-content: center;
		overflow: visible;
		width: calc(100% - 14px);
		max-width: none;
		gap: 2px 3px;
		padding: 6px;
		border-radius: 18px;
		bottom: 10px;
	}

	.pfb-toolbar .pfb-btn {
		min-width: 30px;
		height: 30px;
		padding: 0 4px;
	}

	.pfb-toolbar .pfb-btn svg {
		width: 17px;
		height: 17px;
	}

	.pfb-toolbar .pfb-prev,
	.pfb-toolbar .pfb-next {
		min-width: 30px;
	}

	.pfb-pager {
		height: 30px;
		padding: 0 7px;
		font-size: 12.5px;
	}

	.pfb-toolbar .pfb-cur {
		width: 2.4em;
		height: 22px;
		font-size: 12px;
	}

	.pfb-zoom,
	.pfb-tb-sep {
		display: none;
	}

	.pfb-box {
		padding-bottom: 132px;
	}

	.pfb-frame:fullscreen .pfb-box {
		padding-bottom: 132px;
	}

	/* keep some breathing room above the docked filmstrip */
	.pfb-frame:has(.pfb-strip:not([hidden])) .pfb-toolbar {
		bottom: 118px;
	}
}


/* ---------------------------------------------------------------- */
/* Floating fullscreen button on the book (v1.4)                    */
/* ---------------------------------------------------------------- */

.pfb-fsbtn {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 6;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(24, 28, 35, 0.55);
	color: #ffffff;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s ease, background-color 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.pfb-box:hover .pfb-fsbtn:not([disabled]),
.pfb-fsbtn:focus-visible {
	opacity: 0.92;
}

.pfb-fsbtn:hover {
	background: rgba(24, 28, 35, 0.82);
}

.pfb-fsbtn[disabled] {
	opacity: 0 !important;
	pointer-events: none;
}

.pfb-rtl .pfb-fsbtn {
	right: auto;
	left: 12px;
}

.pfb-frame:fullscreen .pfb-fsbtn {
	opacity: 0.9;
}

@media (hover: none) {
	.pfb-fsbtn:not([disabled]) {
		opacity: 0.92;
	}
}

/* ---------------------------------------------------------------- */
/* User highlights (mark a section of a page)                        */
/* ---------------------------------------------------------------- */

.pfb-hl {
	position: absolute;
	z-index: 3;
	background: rgba(255, 208, 0, 0.42);
	box-shadow: 0 0 0 1px rgba(255, 179, 0, 0.55);
	border-radius: 2px;
	mix-blend-mode: multiply;
	pointer-events: none;
}

.pfb-hl-on .pfb-hl {
	pointer-events: auto;
	cursor: pointer;
}

.pfb-hl-live {
	background: rgba(255, 208, 0, 0.22);
	outline: 1.5px dashed rgba(255, 171, 0, 0.95);
	box-shadow: none;
}

.pfb-hl-on .pfb-page-inner {
	cursor: crosshair;
	touch-action: none;
}

/* Hidden iframe used to build the printable document (1px + opacity, NOT
   display:none — some browsers refuse to print display:none frames). */
.pfb-print-frame {
	position: fixed;
	right: 0;
	bottom: 0;
	width: 1px;
	height: 1px;
	opacity: 0;
	border: 0;
	pointer-events: none;
}

/* ---------------------------------------------------------------- */
/* Search panel sizing (v1.4.3) — panel lives on the frame now and   */
/* always fits inside the card; results area flexes.                 */
/* ---------------------------------------------------------------- */

.pfb-search-bar {
	padding: 10px 12px;
	gap: 8px;
}

.pfb-search-bar .pfb-btn {
	min-width: 44px;
	height: 44px;
}

.pfb-search-status {
	padding: 9px 16px;
	font-size: 13px;
	flex: 0 0 auto;
}

.pfb-search-bar {
	flex: 0 0 auto;
}

.pfb-search-hit {
	padding: 10px 12px;
}

.pfb-search-snip {
	font-size: 13.5px;
}

/* Small screens: keep the panel compact. */
@media (max-width: 640px) {
	.pfb-search {
		width: 94%;
	}

	.pfb-search-input {
		height: 38px;
		font-size: 14px;
	}

	.pfb-search-bar .pfb-btn {
		min-width: 38px;
		height: 38px;
	}
}

/* ---------------------------------------------------------------- */
/* Page-jump input (the "type a page number" box): big, comfortable */
/* and theme-proof — many WP themes force white/oversized inputs,   */
/* which pushed this box out of the toolbar pill. (v1.4.4)          */
/* ---------------------------------------------------------------- */

.pfb-toolbar .pfb-pager {
	height: 40px;
	padding: 0 12px;
	gap: 8px;
	font-size: 14px;
}

.pdf-flipbook .pfb-toolbar input.pfb-cur {
	box-sizing: border-box !important;
	width: 4.5em !important;
	height: 30px !important;
	min-height: 0 !important;
	max-height: none !important;
	padding: 0 6px !important;
	margin: 0 !important;
	border: 1px solid rgba(255, 255, 255, 0.28) !important;
	border-radius: 8px !important;
	background: rgba(0, 0, 0, 0.32) !important;
	color: #ffffff !important;
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 28px !important;
	text-align: center !important;
	box-shadow: none !important;
	outline-offset: 1px !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: textfield !important;
	vertical-align: middle !important;
	float: none !important;
	position: static !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	bottom: auto !important;
	transform: none !important;
}

.pdf-flipbook .pfb-toolbar input.pfb-cur:focus {
	background: rgba(0, 0, 0, 0.45) !important;
}

.pdf-flipbook .pfb-toolbar .pfb-of,
.pdf-flipbook .pfb-toolbar .pfb-total {
	font-size: 14px !important;
	line-height: 1 !important;
}

/* Extra guard so a themed input can never poke out of the pill. */
.pfb-toolbar .pfb-pager {
	overflow: hidden;
}
