html,
body {
	margin: 0;
	width: 100%;
	height: 100%;
	background: #000;
}

body {
	overflow: hidden;
}

.page-debug-guides {
	position: fixed;
	inset: 0;
	display: none;
	pointer-events: none;
	z-index: 1000;
}

.page-debug-guide {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 2px;
	background: rgba(255, 59, 48, 0.92);
	box-shadow: 0 0 0 1px rgba(120, 0, 0, 0.28);
}

.page-debug-guide-quarter {
	left: 25%;
	transform: translateX(-50%);
}

.page-debug-guide-center {
	left: 50%;
	transform: translateX(-50%);
}

.page-debug-guide-three-quarter {
	left: 75%;
	transform: translateX(-50%);
}

.pane-grid {
	display: grid;
	width: 100vw;
	height: 100vh;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0;
}

.pane-viewport {
	position: relative;
	overflow: hidden;
	width: 100%;
	height: 100%;
	background: #000;
	--crop-top: 0px;
	--crop-right: 0px;
	--crop-bottom: 0px;
	--crop-left: 0px;
	--effective-mask-left: var(--crop-left);
	--locked-width: 100px;
	--locked-height: 100px;
	--rendered-width: 100px;
	--rendered-height: 100px;
	--visible-rendered-width: 100px;
	--visible-rendered-start-x: 16px;
	--visible-rendered-end-x: 116px;
	--left-gutter-width: 0px;
	--right-gutter-width: 0px;
	--controls-stack-height: 0px;
	--gutter-rail-width: 92px;
	--stage-left: 16px;
	--stage-top: 0px;
	--render-offset-x: 0px;
	--scale: 1;
	--stage-offset-y: 0px;
}

.pane-stage {
	position: absolute;
	top: var(--stage-top);
	left: var(--stage-left);
	width: var(--locked-width);
	height: var(--locked-height);
	transform: scale(var(--scale));
	transform-origin: top left;
	background: #000;
}

iframe {
	position: absolute;
	inset: 0;
	width: var(--locked-width);
	height: var(--locked-height);
	border: 0;
	background: #000;
}

.pane-mask {
	position: absolute;
	background: #000;
	pointer-events: none;
}

.pane-mask-top {
	top: 0;
	left: 0;
	right: 0;
	height: var(--crop-top);
}

.pane-mask-right {
	top: 0;
	right: 0;
	bottom: 0;
	width: var(--crop-right);
}

.pane-mask-bottom {
	left: 0;
	right: 0;
	bottom: 0;
	height: var(--crop-bottom);
}

.pane-mask-left {
	top: 0;
	left: 0;
	bottom: 0;
	width: var(--effective-mask-left);
}

.pane-viewport[data-pane="pane-a"] {
	--pane-accent: #67d6ff;
	--pane-accent-strong: #9be6ff;
	--pane-accent-soft: rgba(103, 214, 255, 0.2);
}

.pane-viewport[data-pane="pane-b"] {
	--pane-accent: #f6b338;
	--pane-accent-strong: #ffd071;
	--pane-accent-soft: rgba(246, 179, 56, 0.2);
}

.pane-viewport[data-pane="pane-c"] {
	--pane-accent: #8a7dff;
	--pane-accent-strong: #b9b1ff;
	--pane-accent-soft: rgba(138, 125, 255, 0.2);
}

.pane-controls {
	position: absolute;
	z-index: 4;
	top: 8px;
	left: 8px;
	right: 8px;
	width: auto;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	color: #c8d4de;
	font-family: "Segoe UI", Inter, system-ui, sans-serif;
	user-select: none;
	-webkit-user-select: none;
}

.pane-viewport[data-pane="pane-b"] .pane-controls {
	left: 8px;
	right: 8px;
	width: auto;
}

.pane-console-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border: 1px solid rgba(200, 212, 222, 0.14);
	border-top: 2px solid var(--pane-accent);
	background: rgba(7, 10, 14, 0.9);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
	backdrop-filter: blur(10px);
}

.pane-viewport[data-pane="pane-b"] .pane-console-bar {
	border-right: 1px solid rgba(200, 212, 222, 0.14);
	border-left: 1px solid rgba(200, 212, 222, 0.14);
}

.pane-console-identity {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	flex: 1 1 auto;
}

.pane-lane-badge,
.pane-console-title,
.pane-console-device,
.pane-console-summary,
.pane-strip-chip,
.pane-quick-toggle,
.pane-quick-action,
.pane-menu-toggle,
.pane-switch-button {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pane-lane-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	height: 28px;
	padding: 0 10px;
	border: 1px solid var(--pane-accent-soft);
	background: rgba(7, 10, 14, 0.8);
	color: var(--pane-accent-strong);
	font:
		700 11px / 1 "Bahnschrift SemiCondensed",
		"Arial Narrow",
		sans-serif;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.pane-console-copy {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.pane-console-title-row {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 0;
}

.pane-console-title {
	color: #f5f9fc;
	font:
		700 11px / 1.1 "Bahnschrift SemiCondensed",
		"Arial Narrow",
		sans-serif;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.pane-console-device {
	color: rgba(200, 212, 222, 0.7);
	font:
		600 9px / 1.2 "IBM Plex Mono",
		"Cascadia Code",
		Consolas,
		monospace;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.pane-console-summary {
	display: none;
}

.pane-console-status {
	display: none;
}

.pane-strip-chip,
.pane-quick-toggle,
.pane-quick-action,
.pane-menu-toggle,
.pane-switch-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 30px;
	padding: 0 10px;
	border: 1px solid rgba(200, 212, 222, 0.14);
	background: rgba(7, 10, 14, 0.74);
	color: #dce6ed;
	font:
		600 10px / 1 "IBM Plex Mono",
		"Cascadia Code",
		Consolas,
		monospace;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.pane-console-bar .pane-menu-toggle,
.pane-console-bar .pane-strip-chip,
.pane-console-bar .pane-switch-button {
	width: auto;
}

.pane-strip-chip[data-tone="accent"],
.pane-quick-toggle[data-enabled="true"] {
	border-color: var(--pane-accent-soft);
	background: rgba(7, 10, 14, 0.9);
	color: var(--pane-accent-strong);
}

.pane-strip-chip[data-tone="attention"] {
	border-color: rgba(240, 100, 90, 0.32);
	color: #ffb1a8;
}

.pane-strip-chip[data-tone="muted"],
.pane-quick-toggle[data-hidden="true"] {
	opacity: 0.6;
}

.pane-console-actions {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}

.pane-primary-actions {
	display: none;
}

.pane-viewport[data-pane="pane-b"] .pane-primary-actions {
	left: auto;
	right: 8px;
}

.pane-player-name {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 22px;
	padding: 0 8px;
	box-sizing: border-box;
	color: var(--pane-accent-strong);
	font:
		700 10px / 1 "IBM Plex Mono",
		"Cascadia Code",
		Consolas,
		monospace;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pane-status-indicator {
	z-index: 6;
}

.pane-quick-toggles {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.pane-quick-toggle,
.pane-quick-action,
.pane-menu-toggle,
.pane-switch-button {
	cursor: pointer;
	transition:
		background 140ms ease,
		border-color 140ms ease,
		color 140ms ease;
}

.pane-quick-toggle:hover,
.pane-quick-action:hover,
.pane-menu-toggle:hover,
.pane-switch-button:hover,
.pane-action-button:hover,
.pane-action-toggle:hover {
	border-color: var(--pane-accent-soft);
	color: #f5f9fc;
}

.pane-quick-toggle:focus-visible,
.pane-quick-action:focus-visible,
.pane-menu-toggle:focus-visible,
.pane-switch-button:focus-visible,
.pane-action-button:focus-visible,
.pane-action-toggle:focus-visible {
	outline: 2px solid var(--pane-accent);
	outline-offset: 2px;
}

.pane-quick-action:disabled,
.pane-menu-toggle:disabled {
	opacity: 0.65;
	cursor: progress;
}

.pane-menu-toggle[aria-expanded="true"] {
	border-color: var(--pane-accent-soft);
	background: rgba(7, 10, 14, 0.92);
	color: var(--pane-accent-strong);
}

.pane-switch-tabs {
	display: none;
	align-items: center;
	gap: 8px;
}

.pane-mobile-quick-actions {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.pane-mobile-toggle,
.pane-mobile-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid rgba(200, 212, 222, 0.14);
	border-radius: 6px;
	background: rgba(7, 10, 14, 0.74);
	color: #6b7a85;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	filter: grayscale(1);
	opacity: 0.85;
}

.pane-mobile-toggle[data-enabled="true"] {
	border-color: var(--pane-accent-soft);
	color: var(--pane-accent-strong);
	filter: none;
	opacity: 1;
}

.pane-mobile-action {
	filter: none;
	color: #dce6ed;
}

.pane-mobile-action:active,
.pane-mobile-toggle:active {
	opacity: 0.65;
}

.pane-switch-button[aria-selected="true"] {
	border-color: var(--pane-accent-soft);
	background: rgba(7, 10, 14, 0.92);
	color: var(--pane-accent-strong);
}

.pane-action-menu {
	align-self: flex-end;
	min-width: min(240px, 100%);
	max-width: min(240px, 100%);
	padding: 8px;
	border: 1px solid rgba(200, 212, 222, 0.16);
	background: rgba(7, 10, 14, 0.94);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
	backdrop-filter: blur(14px);
}

.pane-action-button,
.pane-action-toggle {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid transparent;
	background: rgba(255, 255, 255, 0.04);
	color: #eef5fa;
	font:
		600 12px / 1.25 "Segoe UI",
		Inter,
		system-ui,
		sans-serif;
	text-align: left;
	cursor: pointer;
	user-select: none;
}

.pane-action-button:disabled {
	opacity: 0.6;
	cursor: progress;
}

.pane-dynamic-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 8px;
}

.pane-dynamic-actions:empty {
	display: none;
}

.pane-action-divider {
	height: 1px;
	margin: 2px 4px 6px;
	background: rgba(200, 212, 222, 0.12);
}

.pane-action-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.pane-action-toggle input {
	margin: 0;
}

.pane-coordinate-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	background: rgba(103, 214, 255, 0.05);
	outline: 1px dashed rgba(200, 212, 222, 0.28);
	cursor: crosshair;
	z-index: 3;
}

.pane-viewport[data-capture-active="true"] .pane-coordinate-overlay {
	pointer-events: auto;
	opacity: 1;
}

.pane-viewport[data-automation-pass-through="true"] .pane-controls,
.pane-viewport[data-automation-pass-through="true"] .pane-controls *,
.pane-viewport[data-automation-pass-through="true"] .pane-status-indicator,
.pane-viewport[data-automation-pass-through="true"] .pane-status-indicator * {
	pointer-events: none !important;
}

.pane-click-marker {
	position: absolute;
	width: 36px;
	height: 36px;
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 5;
	background: radial-gradient(
		circle at center,
		#fff 0 2px,
		rgba(214, 43, 255, 0.99) 2px 7px,
		rgba(214, 43, 255, 0.75) 7px 10px,
		transparent 10px
	);
	filter: drop-shadow(0 0 8px rgba(214, 43, 255, 0.95));
}

.pane-click-marker::before,
.pane-click-marker::after {
	content: "";
	position: absolute;
	left: 16px;
	top: 0;
	width: 4px;
	height: 36px;
	border-radius: 999px;
	background: #f0645a;
	box-shadow: 0 0 10px rgba(240, 100, 90, 0.9);
}

.pane-click-marker::before {
	transform: rotate(45deg);
}

.pane-click-marker::after {
	transform: rotate(-45deg);
}

.pane-status-indicator {
	position: absolute;
	z-index: 5;
	top: calc(8px + var(--controls-stack-height) + 6px);
	left: 8px;
	width: min(220px, calc(100% - 16px));
	box-sizing: border-box;
	padding: 8px;
	border: 1px solid rgba(200, 212, 222, 0.14);
	border-top: 2px solid var(--pane-accent);
	background: rgba(7, 10, 14, 0.84);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
	color: #eef5fa;
	font-family: "Segoe UI", Inter, system-ui, sans-serif;
	pointer-events: auto;
	user-select: none;
	-webkit-user-select: none;
}

.pane-viewport[data-pane="pane-b"] .pane-status-indicator {
	left: 8px;
	right: auto;
	width: min(220px, calc(100% - 16px));
	border-left: 1px solid rgba(200, 212, 222, 0.14);
	border-right: 1px solid rgba(200, 212, 222, 0.14);
}

.pane-viewport[data-menu-open="true"] .pane-status-indicator {
	top: calc(8px + var(--controls-stack-height) + 6px);
}

.pane-status-section {
	cursor: default;
}

.pane-status-section[data-status-toggle] {
	cursor: pointer;
	padding: 6px;
	margin: -6px;
	border: 1px solid transparent;
}

.pane-status-section[data-status-toggle][data-enabled="true"] {
	border-color: var(--pane-accent-soft);
	background: rgba(255, 255, 255, 0.02);
}

.pane-status-section[data-status-toggle]:hover {
	border-color: var(--pane-accent-soft);
	background: rgba(255, 255, 255, 0.03);
}

.pane-status-section[data-status-toggle]:focus-visible {
	outline: 2px solid var(--pane-accent);
	outline-offset: 2px;
}

.pane-status-section + .pane-status-section {
	margin-top: 22px;
	padding-top: 14px;
	border-top: 1px solid rgba(200, 212, 222, 0.12);
}

.pane-status-section-title {
	margin-bottom: 10px;
	color: var(--pane-accent-strong);
	font:
		600 10px / 1 "IBM Plex Mono",
		"Cascadia Code",
		Consolas,
		monospace;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.pane-status-grid {
	display: grid;
	gap: 8px;
}

.pane-status-line {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(200, 212, 222, 0.1);
}

.pane-status-line:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.pane-status-line--solo {
	justify-content: center;
}

.pane-status-line--solo .pane-status-label {
	display: none;
}

.pane-status-line--solo .pane-status-value {
	width: 100%;
	text-align: center;
	color: rgba(245, 249, 252, 0.86);
	letter-spacing: 0.12em;
}

.pane-status-label {
	color: rgba(200, 212, 222, 0.72);
	font:
		600 10px / 1 "IBM Plex Mono",
		"Cascadia Code",
		Consolas,
		monospace;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.pane-status-value {
	color: #f5f9fc;
	font:
		600 10px / 1 "IBM Plex Mono",
		"Cascadia Code",
		Consolas,
		monospace;
	letter-spacing: 0.04em;
	text-align: right;
}

@media (max-width: 980px) {
	.pane-grid {
		position: relative;
		display: block;
		overflow: hidden;
		touch-action: pan-y;
	}

	.pane-viewport {
		position: absolute;
		inset: 0;
		opacity: 0;
		pointer-events: none;
		transition: opacity 160ms ease;
		--stage-offset-y: -15px;
	}

	.pane-viewport[data-mobile-active="true"] {
		opacity: 1;
		pointer-events: auto;
	}

	.pane-stage {
		top: 50%;
		left: 50%;
		transform: translate(-50%, calc(-50% + var(--stage-offset-y)))
			scale(var(--scale));
		transform-origin: center;
	}

	.pane-controls,
	.pane-viewport[data-pane="pane-b"] .pane-controls,
	.pane-primary-actions,
	.pane-viewport[data-pane="pane-b"] .pane-primary-actions {
		top: calc(env(safe-area-inset-top, 0px) + 6px);
		left: 8px;
		right: auto;
		width: auto;
	}

	.pane-console-bar {
		gap: 6px;
		padding: 4px;
		background: transparent;
		box-shadow: none;
		backdrop-filter: none;
		border: 0;
	}

	.pane-console-identity {
		display: none;
	}

	.pane-console-actions {
		flex-direction: row;
		align-items: center;
	}

	.pane-console-status,
	.pane-quick-action,
	.pane-player-name {
		display: none;
	}

	.pane-mobile-quick-actions {
		display: inline-flex;
		gap: 4px;
	}

	.pane-mobile-toggle,
	.pane-mobile-action {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 32px;
		height: 32px;
		padding: 0;
		border: none;
		border-radius: 6px;
		background: transparent;
		color: #6b7a85;
		font-size: 16px;
		line-height: 1;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		touch-action: manipulation;
		filter: grayscale(1);
		opacity: 0.6;
	}

	.pane-mobile-toggle[data-enabled="true"] {
		background: transparent;
		color: var(--pane-accent-strong);
		box-shadow: none;
		filter: none;
		opacity: 1;
	}

	.pane-mobile-action {
		filter: none;
		opacity: 0.8;
		color: #dce6ed;
	}

	.pane-mobile-action:active,
	.pane-mobile-toggle:active {
		opacity: 0.5;
	}

	.pane-switch-tabs {
		display: inline-flex;
		gap: 4px;
	}

	.pane-switch-button {
		width: auto;
		min-width: 0;
		height: 24px;
		padding: 0 8px;
		font:
			600 9px / 1 "IBM Plex Mono",
			"Cascadia Code",
			Consolas,
			monospace;
		letter-spacing: 0.02em;
		text-transform: none;
		max-width: 96px;
	}

	body[data-current-tab-automation="false"] .pane-menu-toggle,
	body[data-current-tab-automation="false"] .pane-action-menu {
		display: none;
	}

	.pane-status-indicator {
		display: none !important;
		left: auto;
		right: auto;
	}
}
