.upv-pdf {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 60vh;
	min-height: 420px;
	max-height: 1000px;
	overflow: hidden;
	background: #525659;
	border-radius: 6px;
	box-shadow: 0 1px 6px rgba( 0, 0, 0, 0.25 );
}

/* True fullscreen fills the screen. */
.upv-pdf.is-fs,
.upv-pdf:fullscreen,
.upv-pdf:-webkit-full-screen {
	height: 100vh;
	max-height: none;
	border-radius: 0;
}

/* --- Control bar --------------------------------------------------------- */
.upv-pdf__bar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
	padding: 6px 10px;
	background: #333638;
	color: #fff;
	font-size: 13px;
	line-height: 1;
}

.upv-pdf__nav {
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.upv-pdf__page-input {
	box-sizing: border-box;
	width: 34px;
	height: 26px;
	padding: 0 3px;
	border: 1px solid rgba( 255, 255, 255, 0.35 );
	border-radius: 4px;
	background: #fff !important;
	color: #000 !important;
	font-size: 14px;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

.upv-pdf__page-input:focus {
	outline: none;
	border-color: #1e73be;
	box-shadow: 0 0 0 2px rgba( 30, 115, 190, 0.4 );
}

/* Kill Chrome's yellow autofill tint on the page field. */
.upv-pdf__page-input:-webkit-autofill,
.upv-pdf__page-input:-webkit-autofill:hover,
.upv-pdf__page-input:-webkit-autofill:focus,
.upv-pdf__page-input:-webkit-autofill:active {
	-webkit-box-shadow: 0 0 0 1000px #fff inset !important;
	box-shadow: 0 0 0 1000px #fff inset !important;
	-webkit-text-fill-color: #000 !important;
	caret-color: #000 !important;
	transition: background-color 0s !important;
}

.upv-pdf__total {
	opacity: 0.85;
	font-size: 14px;
}

.upv-pdf__tools {
	display: flex;
	align-items: center;
	gap: 4px;
	/* Always hug the right edge, even when the page counter is disabled. */
	margin-left: auto;
}

.upv-pdf__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	min-width: 30px;
	height: 30px;
	margin: 0;
	padding: 0 8px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: #fff;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.12s ease;
}

/* Hover follows the custom override → theme color (UIC) → neutral fallback.
   !important overrides the theme's global button:hover (#ffb20e in skin.css). */
.upv-pdf__btn:hover,
.upv-pdf__btn:focus-visible {
	background: var( --upv-accent, var( --uic-page-top-bg, rgba( 255, 255, 255, 0.18 ) ) ) !important;
	color: #fff !important;
	outline: none;
}

.upv-pdf__btn svg {
	display: block;
	width: 18px;
	height: 18px;
}

.upv-pdf__btn--zoom {
	min-width: 48px;
	font-size: 14px;
	opacity: 0.9;
}

/* --- Scroll area + pages ------------------------------------------------- */
.upv-pdf__scroll {
	flex: 1 1 auto;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	cursor: grab;
}

.upv-pdf__scroll.is-panning {
	cursor: grabbing;
	user-select: none;
}

.upv-pdf__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #fff;
	font-size: 15px;
	opacity: 0.85;
}

.upv-pdf__pages {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin: 0 auto;
	padding: 14px;
	box-sizing: border-box;
}

.upv-pdf__page {
	display: block;
	max-width: 100%;
	background: #fff;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.4 );
	/* Small deterrent against right-click "Save as" — NOT real protection;
	   the file is still fetched over HTTP. */
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
}
