.fh-pdf-catalog {
	--fhpc-bg: #25272b;
	--fhpc-toolbar: #17181b;
	--fhpc-accent: #fff;
	position: relative;
	overflow: hidden;
	background: var(--fhpc-bg);
	color: var(--fhpc-accent);
	font: 500 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fh-pdf-catalog:focus-visible {
	outline: 2px solid var(--fhpc-accent);
	outline-offset: 3px;
}

.fh-pdf-catalog__stage {
	position: relative;
	display: grid;
	place-items: center;
	height: 720px;
	min-height: 320px;
	padding: clamp(14px, 3vw, 36px);
	overflow: hidden;
}

.fh-pdf-catalog__book {
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity .25s ease;
}

.fh-pdf-catalog.is-ready .fh-pdf-catalog__book {
	opacity: 1;
}

.fh-pdf-catalog__page {
	position: relative;
	overflow: hidden;
	background: #fff;
	box-shadow: inset 0 0 18px rgba(0, 0, 0, .08);
}

.fh-pdf-catalog__page[data-density="hard"] {
	background: #f7f7f7;
}

.fh-pdf-catalog__page img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #fff;
	user-select: none;
	-webkit-user-drag: none;
}

.fh-pdf-catalog__page-loading {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: #777;
	font-size: 12px;
}

.fh-pdf-catalog__loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	z-index: 3;
}

.fh-pdf-catalog.is-ready .fh-pdf-catalog__loading {
	display: none;
}

.fh-pdf-catalog.is-error .fh-pdf-catalog__loading {
	padding: 24px;
	text-align: center;
	color: #fff;
}

.fh-pdf-catalog__spinner {
	width: 22px;
	height: 22px;
	border: 2px solid rgba(255, 255, 255, .28);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: fhpc-spin .75s linear infinite;
}

.fh-pdf-catalog.is-error .fh-pdf-catalog__spinner {
	display: none;
}

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

.fh-pdf-catalog__toolbar {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 54px;
	padding: 8px clamp(10px, 2vw, 18px);
	background: var(--fhpc-toolbar);
}

.fh-pdf-catalog__toolbar-spacer {
	flex: 1;
}

.fh-pdf-catalog .fh-pdf-catalog__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 38px;
	width: 38px;
	min-width: 38px;
	height: 38px;
	padding: 8px;
	margin: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font-size: 0;
	line-height: 0;
	text-decoration: none;
	box-sizing: border-box;
	cursor: pointer;
	transition: background-color .18s ease, opacity .18s ease;
}

.fh-pdf-catalog .fh-pdf-catalog__button:hover,
.fh-pdf-catalog .fh-pdf-catalog__button:focus-visible {
	background: rgba(255, 255, 255, .12);
	color: inherit;
}

.fh-pdf-catalog .fh-pdf-catalog__button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.fh-pdf-catalog .fh-pdf-catalog__button:disabled {
	opacity: .35;
	cursor: default;
}

.fh-pdf-catalog .fh-pdf-catalog__button svg {
	display: block;
	position: static;
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transform: none;
}

.fh-pdf-catalog__counter {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
}

.fh-pdf-catalog__counter input {
	width: 52px;
	height: 34px;
	padding: 4px 6px;
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 4px;
	background: rgba(0, 0, 0, .18);
	color: inherit;
	font: inherit;
	text-align: center;
	-moz-appearance: textfield;
}

.fh-pdf-catalog__counter input::-webkit-inner-spin-button,
.fh-pdf-catalog__counter input::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.fh-pdf-catalog__hint {
	margin: 0;
	padding: 8px 14px 10px;
	background: var(--fhpc-toolbar);
	color: inherit;
	opacity: .7;
	font-size: 12px;
	text-align: center;
}

.fh-pdf-catalog__editor-notice {
	padding: 28px;
	border: 1px dashed #a4afb7;
	background: #f5f7f8;
	color: #4b5563;
	text-align: center;
}

.fh-pdf-catalog:fullscreen {
	display: flex;
	flex-direction: column;
	width: 100vw;
	height: 100vh;
	border-radius: 0 !important;
}

.fh-pdf-catalog:fullscreen .fh-pdf-catalog__stage {
	flex: 1;
	height: auto !important;
}

@media (max-width: 767px) {
	.fh-pdf-catalog__stage {
		height: 520px;
		padding: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fh-pdf-catalog__book,
	.fh-pdf-catalog__button {
		transition: none;
	}
}
