.sfsb-stage {
	background: var(--sfsb-background, transparent);
	overflow: hidden;
	pointer-events: none;
}

.sfsb-block {
	width: 100%;
}

.sfsb-stage--inline {
	position: relative;
	display: block;
	width: 100%;
	height: var(--sfsb-height, 480px);
}

.sfsb-stage--row {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	padding: 0 !important;
	transform: none !important;
}

.sfsb-position-context {
	position: relative !important;
}

.sfsb-generic-background-host {
	isolation: isolate;
}

.sfsb-generic-background-host > .sfsb-stage--row {
	z-index: 1;
}

.sfsb-has-background.sfsb-has-min-height {
	min-height: var(--sfsb-background-min-height);
}

.sfsb-content-layer {
	position: relative;
	z-index: 2;
}

.sfsb-canvas,
.sfsb-poster {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

.sfsb-poster-picture {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.sfsb-canvas {
	z-index: 1;
	opacity: 0;
	transition: opacity 120ms linear;
}

.sfsb-stage--ready .sfsb-canvas {
	opacity: 1;
}

.sfsb-poster {
	z-index: 0;
	object-fit: var(--sfsb-fit, cover);
	object-position: var(--sfsb-position, center center);
}

/* Salient's `.main-content img { height:auto; }` is more specific than the
 * base poster selector. Keep the fallback poster pinned to the full stage so
 * the first visual is complete before the canvas buffer becomes ready. */
.sfsb-stage > img.sfsb-poster,
.sfsb-stage > picture.sfsb-poster-picture > img.sfsb-poster {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
}

.sfsb-stage--ready .sfsb-poster {
	opacity: 0;
}

.sfsb-debug {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 3;
	display: block;
	padding: 5px 7px;
	border-radius: 3px;
	background: rgba(0, 0, 0, .72);
	color: #fff;
	font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	white-space: pre;
}

.sfsb-ui {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.sfsb-stage--inline > .sfsb-ui {
	z-index: 3;
}

.sfsb-control {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 58px;
	height: 58px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .7);
	border-radius: 999px;
	background: rgba(0, 0, 0, .58);
	box-shadow: 0 8px 30px rgba(0, 0, 0, .24);
	color: #fff;
	font: 700 20px/1 sans-serif;
	text-align: center;
	cursor: pointer;
	pointer-events: auto;
	-webkit-appearance: none;
	appearance: none;
	transition: transform 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

.sfsb-control:hover,
.sfsb-control:focus-visible {
	background: rgba(0, 0, 0, .82);
	transform: scale(1.06);
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.sfsb-ui--autoplay .sfsb-control,
.sfsb-ui--controls .sfsb-control {
	position: absolute;
	right: 18px;
	bottom: 18px;
	width: 44px;
	height: 44px;
	font-size: 15px;
}

.sfsb-loading {
	position: absolute;
	left: 50%;
	bottom: 20px;
	width: min(240px, calc(100% - 40px));
	padding: 8px 10px;
	border-radius: 5px;
	background: rgba(0, 0, 0, .64);
	color: #fff;
	font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	transform: translateX(-50%);
}

.sfsb-loading[hidden] {
	display: none;
}

.sfsb-loading__label,
.sfsb-loading__track,
.sfsb-loading__bar {
	display: block;
}

.sfsb-loading__track {
	height: 3px;
	margin-top: 5px;
	overflow: hidden;
	border-radius: 3px;
	background: rgba(255, 255, 255, .25);
}

.sfsb-loading__bar {
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: #fff;
	transition: width 100ms linear;
}

.sfsb-ui[data-sfsb-state="error"] .sfsb-control {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.sfsb-control,
	.sfsb-loading__bar { transition: none; }
}

.sfsb-editor-warning {
	padding: 8px 10px;
	border-left: 3px solid #d63638;
	background: #fff;
	color: #1d2327;
}
