.pfv-viewer,
.pfv-modal {
	--pfv-accent: #1f684d;
	--pfv-accent-contrast: #ffffff;
	--pfv-surface: #ffffff;
	--pfv-text: #17211d;
	--pfv-radius: 14px;
	color: var(--pfv-text);
	font-family: inherit;
}

.pfv-viewer *,
.pfv-modal * {
	box-sizing: border-box;
}

.pfv-pages {
	display: grid;
	gap: clamp(16px, 3vw, 32px);
	justify-content: center;
}

.pfv-layout--cover .pfv-pages {
	grid-template-columns: minmax(0, 520px);
}

.pfv-layout--spread .pfv-pages {
	grid-template-columns: repeat(2, minmax(0, 520px));
}

.pfv-page {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	overflow: hidden;
	background: #f5f6f5;
	border: 1px solid rgba(23, 33, 29, 0.14);
	border-radius: var(--pfv-radius);
	box-shadow: 0 12px 30px rgba(20, 42, 32, 0.14);
	cursor: zoom-in;
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.pfv-page:hover {
	transform: translateY(-3px);
	box-shadow: 0 16px 38px rgba(20, 42, 32, 0.2);
}

.pfv-page:focus-visible,
.pfv-button:focus-visible,
.pfv-modal button:focus-visible,
.pfv-modal a:focus-visible {
	outline: 3px solid #f59a23;
	outline-offset: 3px;
}

.pfv-page--viewer-only {
	display: none;
}

.pfv-page-image {
	display: block;
	width: 100%;
	height: auto;
}

.pfv-page-badge {
	position: absolute;
	right: 12px;
	bottom: 12px;
	padding: 6px 10px;
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	background: rgba(13, 31, 23, 0.78);
	border-radius: 999px;
	backdrop-filter: blur(4px);
}

.pfv-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-top: 20px;
}

.pfv-button,
.pfv-viewer a.pfv-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	color: var(--pfv-accent-contrast);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	background: var(--pfv-accent);
	border: 2px solid var(--pfv-accent);
	border-radius: 999px;
	cursor: pointer;
}

.pfv-button--secondary,
.pfv-viewer a.pfv-button--secondary {
	color: var(--pfv-accent);
	background: transparent;
}

.pfv-button--cta,
.pfv-viewer a.pfv-button--cta {
	color: #17211d;
	background: #f6a229;
	border-color: #f6a229;
}

.pfv-modal[hidden] {
	display: none !important;
}

body.pfv-modal-open {
	overflow: hidden;
}

.pfv-modal {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 18px;
}

.pfv-modal-backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	background: rgba(4, 13, 9, 0.86);
	border: 0;
	cursor: default;
	backdrop-filter: blur(5px);
}

.pfv-dialog {
	position: relative;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: min(1180px, 100%);
	height: min(92vh, 960px);
	overflow: hidden;
	color: var(--pfv-text);
	background: var(--pfv-surface);
	border-radius: var(--pfv-radius);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.pfv-dialog-header {
	display: flex;
	gap: 18px;
	align-items: center;
	justify-content: space-between;
	min-height: 68px;
	padding: 12px 18px;
	border-bottom: 1px solid rgba(23, 33, 29, 0.12);
}

.pfv-dialog-title {
	margin: 0;
	color: inherit;
	font: inherit;
	font-size: clamp(17px, 2vw, 21px);
	font-weight: 750;
	line-height: 1.25;
}

.pfv-page-status {
	margin: 3px 0 0;
	color: rgba(23, 33, 29, 0.7);
	font-size: 13px;
}

.pfv-icon-button,
.pfv-control,
.pfv-nav {
	display: inline-grid;
	place-items: center;
	color: var(--pfv-text);
	font: inherit;
	background: #eef1ef;
	border: 0;
	cursor: pointer;
}

.pfv-icon-button,
.pfv-nav {
	min-width: 0;
	padding: 0;
}

.pfv-icon-button:hover,
.pfv-control:hover,
.pfv-nav:hover {
	background: #e0e7e3;
}

.pfv-icon-button:disabled,
.pfv-control:disabled,
.pfv-nav:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.pfv-close {
	width: 42px;
	height: 42px;
	font-size: 28px;
	line-height: 1;
	border-radius: 50%;
}

.pfv-stage {
	position: relative;
	display: grid;
	grid-template-columns: 58px minmax(0, 1fr) 58px;
	min-height: 0;
	background: #dfe5e1;
}

.pfv-image-scroll {
	display: block;
	min-width: 0;
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
	padding: 18px;
}

.pfv-modal-image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto;
	object-fit: contain;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.pfv-nav {
	position: relative;
	z-index: 1;
	width: 44px;
	height: 54px;
	align-self: center;
	margin: 7px;
	font-size: 40px;
	line-height: 1;
	border-radius: 12px;
}

.pfv-dialog-footer {
	min-width: 0;
	background: var(--pfv-surface);
	border-top: 1px solid rgba(23, 33, 29, 0.12);
}

.pfv-thumbnails {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: flex-start;
	min-height: 78px;
	overflow-x: auto;
	padding: 8px 12px;
	border-bottom: 1px solid rgba(23, 33, 29, 0.1);
	scrollbar-width: thin;
}

.pfv-thumbnail {
	position: relative;
	flex: 0 0 46px;
	width: 46px;
	min-width: 0;
	height: 60px;
	overflow: hidden;
	padding: 0;
	background: #eef1ef;
	border: 2px solid transparent;
	border-radius: 6px;
	cursor: pointer;
}

.pfv-thumbnail[aria-current="page"] {
	border-color: var(--pfv-accent);
	box-shadow: 0 0 0 1px var(--pfv-accent);
}

.pfv-thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pfv-thumbnail span {
	position: absolute;
	right: 2px;
	bottom: 2px;
	display: grid;
	place-items: center;
	min-width: 17px;
	height: 17px;
	padding: 0 3px;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	background: rgba(13, 31, 23, 0.82);
	border-radius: 999px;
}

.pfv-toolbar {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	min-height: 60px;
	padding: 9px 16px;
}

.pfv-control,
.pfv-modal a.pfv-control {
	min-width: 42px;
	min-height: 42px;
	padding: 8px 12px;
	color: var(--pfv-text);
	font: inherit;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	border-radius: 10px;
}

.pfv-zoom-value {
	min-width: 68px;
}

.pfv-control--download,
.pfv-modal a.pfv-control--download {
	margin-left: 8px;
	color: var(--pfv-accent-contrast);
	background: var(--pfv-accent);
}

.pfv-notice {
	padding: 12px 14px;
	background: #fff8e5;
	border-left: 4px solid #dba617;
}

@media (max-width: 720px) {
	.pfv-layout--spread .pfv-pages {
		grid-template-columns: minmax(0, 520px);
	}

	.pfv-modal {
		padding: 0;
	}

	.pfv-dialog {
		width: 100%;
		height: 100dvh;
		border-radius: 0;
	}

	.pfv-stage {
		grid-template-columns: 44px minmax(0, 1fr) 44px;
	}

	.pfv-nav {
		width: 36px;
		height: 48px;
		margin: 4px;
	}

	.pfv-image-scroll {
		padding: 10px;
	}

	.pfv-control--download {
		margin-left: 0;
	}

	.pfv-thumbnails {
		min-height: 68px;
		padding: 6px 8px;
	}

	.pfv-thumbnail {
		flex-basis: 40px;
		width: 40px;
		height: 52px;
	}
}

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