/* Live preview box on the player edit screen */
.h5vp-lp__bar {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.h5vp-lp__bar.is-in-header {
	flex: 1;
	margin: 0 8px 0 0;
}

.h5vp-lp__status {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	color: #646970;
	font-size: 12px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.h5vp-lp__open.button,
.h5vp-lp__refresh.button {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 26px;
	padding: 0 8px;
	border-color: #2271b1;
	color: #2271b1;
	font-size: 12px;
	line-height: 24px;
}

.h5vp-lp__open.button .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
}

.h5vp-lp__refresh-icon {
	display: block;
	flex: none;
	transform-origin: 50% 50%;
}

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

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

#h5vp-live-preview .inside {
	margin: 0;
	padding: 12px;
}

.h5vp-lp__stage {
	position: relative;
	width: 100%;
	overflow: hidden;
	border: 1px solid #dcdcde;
	background: #f6f7f7;
}

.h5vp-lp__frame {
	display: block;
	width: 100%;
	height: 200px;
	border: 0;
	background: #fff;
	transform-origin: 0 0;
	transition: opacity 0.2s ease;
}

.h5vp-lp.is-loading .h5vp-lp__frame {
	opacity: 0.55;
}

.h5vp-lp__note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 10px 0 0;
	padding: 9px 12px;
	border: 1px solid #dfe8f7;
	border-left: 3px solid #2271b1;
	background: #f6f9ff;
	color: #475569;
	font-size: 12px;
	line-height: 1.5;
}

.h5vp-lp__note .dashicons {
	flex: none;
	width: 16px;
	height: 16px;
	margin-top: 1px;
	color: #2271b1;
	font-size: 16px;
}

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

	body.h5vp-lp-wide #poststuff #post-body.columns-2 {
		display: flow-root;
		margin-right: calc(var(--h5vp-lp-side) + 20px);
	}

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

	body.h5vp-lp-wide #poststuff #post-body.columns-2 #side-sortables {
		width: auto;
	}
}

/* The "Test on devices" window */
body.h5vp-lpm-open {
	overflow: hidden;
}

.h5vp-lpm[hidden] {
	display: none;
}

.h5vp-lpm {
	position: fixed;
	inset: 0;
	z-index: 100100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.6);
}

.h5vp-lpm__dialog {
	display: flex;
	flex-direction: column;
	width: min(1280px, 100%);
	height: min(900px, 100%);
	overflow: hidden;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.h5vp-lpm__head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	padding: 10px 16px;
	border-bottom: 1px solid #dcdcde;
}

.h5vp-lpm__title {
	margin-right: auto;
	font-size: 15px;
}

.h5vp-lpm__devices {
	display: inline-flex;
	padding: 3px;
	border-radius: 6px;
	background: #f0f0f1;
}

.h5vp-lpm__device {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 12px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: #50575e;
	font-size: 13px;
	cursor: pointer;
}

.h5vp-lpm__device:hover {
	background: #dcdcde;
}

.h5vp-lpm__device.is-active {
	background: #fff;
	color: #2271b1;
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.h5vp-lpm__size {
	min-width: 150px;
	color: #50575e;
	font-size: 12px;
	font-weight: 600;
}

.h5vp-lpm__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #50575e;
	cursor: pointer;
}

.h5vp-lpm__close:hover {
	background: #f0f0f1;
	color: #d63638;
}

.h5vp-lpm__body {
	position: relative;
	display: flex;
	flex: 1;
	align-items: flex-start;
	justify-content: center;
	min-height: 0;
	overflow: auto;
	padding: 28px;
	background: #eef0f3;
}

/* The screen: a browser window on desktop, a device on tablet and phone. */
.h5vp-lpm__screen {
	position: relative;
	flex: none;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
	transition: width 0.2s ease;
}

.h5vp-lpm__frame {
	display: block;
	width: 100%;
	border: 0;
	background: #fff;
	transition: opacity 0.2s ease;
}

.h5vp-lpm__chrome {
	display: none;
}

.h5vp-lpm__body[data-device="desktop"] .h5vp-lpm__screen {
	border-radius: 8px;
	border: 1px solid #d5d9df;
}

.h5vp-lpm__body[data-device="desktop"] .h5vp-lpm__chrome {
	display: block;
	height: 34px;
	border-bottom: 1px solid #e3e6ea;
	background:
		radial-gradient(circle at 16px 17px, #ff5f57 0 5px, transparent 5.5px),
		radial-gradient(circle at 36px 17px, #febc2e 0 5px, transparent 5.5px),
		radial-gradient(circle at 56px 17px, #28c840 0 5px, transparent 5.5px),
		linear-gradient(#f6f7f9, #eceef1);
}

.h5vp-lpm__body[data-device="tablet"] .h5vp-lpm__screen,
.h5vp-lpm__body[data-device="mobile"] .h5vp-lpm__screen {
	box-sizing: content-box;
	border: 12px solid #1d2327;
	box-shadow: 0 14px 36px rgba(15, 23, 42, 0.35), inset 0 0 0 1px #3c434a;
}

.h5vp-lpm__body[data-device="tablet"] .h5vp-lpm__screen {
	border-radius: 22px;
}

.h5vp-lpm__body[data-device="mobile"] .h5vp-lpm__screen {
	border-width: 12px 10px;
	border-radius: 34px;
}

/* The phone's camera notch */
.h5vp-lpm__body[data-device="mobile"] .h5vp-lpm__chrome {
	position: absolute;
	top: 8px;
	left: 50%;
	z-index: 2;
	display: block;
	width: 78px;
	height: 20px;
	border-radius: 12px;
	background: #1d2327;
	transform: translateX(-50%);
}

.h5vp-lpm.is-loading .h5vp-lpm__frame {
	opacity: 0.55;
}

.h5vp-lpm__foot {
	margin: 0;
	padding: 9px 16px;
	border-top: 1px solid #dcdcde;
	color: #646970;
	font-size: 12px;
}

/* Icons are inline SVG, so a theme or another plugin cannot change how they sit in the buttons. */
.h5vp-lp__icon {
	display: block;
	flex: none;
}
