.pop-bp {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.78);
}

.pop-bp[hidden] {
	display: none;
}

.pop-bp__panel {
	display: flex;
	flex-direction: column;
	width: min(1100px, 96vw);
	height: min(92vh, 1200px);
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

/* Fills the space left over by the toolbar, at any viewport size. */
.pop-bp__stage {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: auto;
	padding: 12px;
	background: #f4f4f5;
	-webkit-overflow-scrolling: touch;
}

/* Zoomed pages can be larger than the stage: switch to scroll, not centring. */
.pop-bp__stage.is-zoomed {
	align-items: flex-start;
	justify-content: flex-start;
}

.pop-bp__canvas {
	display: block;
	margin: auto;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	background: #fff;
}

.pop-bp__msg {
	position: absolute;
	margin: 0;
	padding: 10px 16px;
	font-size: 14px;
	color: #444;
}

.pop-bp__msg[hidden] {
	display: none;
}

.pop-bp__bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	padding: 8px 12px;
	border-top: 1px solid #e6e6e6;
	background: #fff;
}

.pop-bp__group {
	display: flex;
	align-items: center;
	gap: 6px;
}

.pop-bp__btn {
	min-width: 38px;
	padding: 7px 10px;
	border: 1px solid #d4d4d8;
	border-radius: 6px;
	background: #fafafa;
	color: #18181b;
	font: inherit;
	font-size: 15px;
	line-height: 1.2;
	cursor: pointer;
}

.pop-bp__btn--wide {
	min-width: auto;
	font-size: 14px;
}

.pop-bp__btn:hover:not(:disabled) {
	background: #efefef;
}

.pop-bp__btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.pop-bp__pages {
	min-width: 74px;
	text-align: center;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

body.pop-bp-open-body {
	overflow: hidden;
}

@media (max-width: 640px) {
	.pop-bp {
		padding: 0;
	}

	.pop-bp__panel {
		width: 100vw;
		height: 100dvh;
		border-radius: 0;
	}

	.pop-bp__bar {
		justify-content: center;
	}
}
