.bppiv-live-preview__bar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	min-height: 30px;
	margin-bottom: 8px;
}

.bppiv-live-preview__status {
	margin-right: auto;
	color: #646970;
	font-size: 12px;
}

/* In the box header, next to the title */
.bppiv-live-preview__bar.is-in-header {
	flex: 1;
	min-height: 0;
	margin: 0 8px 0 0;
}

.bppiv-live-preview__bar.is-in-header .bppiv-live-preview__status {
	overflow: hidden;
	min-width: 0;
	margin-left: 4px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bppiv-live-preview__refresh.button {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border-color: #146ef5;
	border-radius: 0;
	color: #146ef5;
}

.bppiv-live-preview__bar.is-in-header .bppiv-live-preview__refresh.button {
	min-height: 26px;
	padding: 0 8px;
	font-size: 12px;
	line-height: 24px;
}

/* An SVG, not a dashicon: it stays centred and spins around its own middle on every WordPress version. */
.bppiv-live-preview__refresh-icon {
	display: block;
	flex: none;
	width: 14px;
	height: 14px;
	transform-origin: 50% 50%;
}

#bppiv-live-preview.is-loading .bppiv-live-preview__refresh-icon {
	animation: bppiv-lp-spin 1s linear infinite;
}

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

/* The preview sits in the box with even space around it */
#bppiv-live-preview .inside {
	margin: 0;
	padding: 12px;
}

/* Note under the preview */
#bppiv-live-preview .bppiv-live-preview__note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 10px 0 0;
	padding: 9px 12px;
	border: 1px solid #dfe8f7;
	border-left: 3px solid #146ef5;
	background: #f6f9ff;
	color: #475569;
	font-size: 12px;
	line-height: 1.5;
}

.bppiv-live-preview__note .dashicons {
	flex: none;
	width: 16px;
	height: 16px;
	margin-top: 1px;
	color: #146ef5;
	font-size: 16px;
}

/* WooCommerce product: the box is as wide as the page, so the preview keeps a sensible size. */
#bppiv-live-preview .bppiv-live-preview.is-stack .bppiv-live-preview__frame,
#bppiv-live-preview .bppiv-live-preview.is-stack .bppiv-live-preview__note {
	max-width: 760px;
	margin-right: auto;
	margin-left: auto;
	box-sizing: border-box;
}

.bppiv-live-preview__refresh.button:hover,
.bppiv-live-preview__refresh.button:focus {
	border-color: #0f5ed6;
	background: #eef5ff;
	color: #0f5ed6;
}

.bppiv-live-preview__frame {
	display: block;
	width: 100%;
	height: 340px;
	border: 0;
	border-radius: 0;
	box-sizing: border-box;
	background: #fff;
	transition: opacity 0.2s ease;
}

.bppiv-live-preview.is-loading .bppiv-live-preview__frame {
	opacity: 0.55;
}

/* Panorama settings: the right column is widened to hold the preview (under the Save box). */
@media (min-width: 1500px) {
	body.bppiv-lp-wide {
		--bppiv-lp-side: clamp(340px, 28vw, 560px);
	}

	/* Contain the floated columns so the right column can stay sticky while scrolling. */
	body.bppiv-lp-wide #poststuff #post-body.columns-2 {
		display: flow-root;
		margin-right: calc(var(--bppiv-lp-side) + 20px);
	}

	body.bppiv-lp-wide #post-body.columns-2 #postbox-container-1 {
		position: sticky;
		top: 46px;
		width: var(--bppiv-lp-side);
		margin-right: calc(-1 * (var(--bppiv-lp-side) + 20px));
	}

	/* WordPress fixes the sidebar boxes at 280px. */
	body.bppiv-lp-wide #poststuff #post-body.columns-2 #side-sortables {
		width: auto;
	}

}
