:root {
	color-scheme: dark;

	/* Strata brand — dark UI with a bright-purple accent. */
	--accent: #b061ff;          /* bright purple */
	--accent-strong: #9333ea;
	--accent-contrast: #ffffff;
	--accent-12: rgba( 176, 97, 255, 0.16 );
	--accent-10: rgba( 176, 97, 255, 0.14 );
	--accent-06: rgba( 176, 97, 255, 0.10 );
	--accent-50: rgba( 176, 97, 255, 0.55 );
	--accent-25: rgba( 176, 97, 255, 0.32 );

	/* The five strata layers of the mark, bottom → top. */
	--strata-blue: #5181e6;
	--strata-teal: #2fa3b7;
	--strata-green: #3aa86a;
	--strata-orange: #dd8a3c;
	--strata-red: #cf514b;

	/* App chrome — dark slate, matched to the existing dark surfaces. */
	--chrome: #111111;
	--chrome-2: #1b1b1b;
	--chrome-border: #222222;
}

[hidden] {
	display: none !important;
}

body {
	font-family: 'Roboto', Helvetica, Arial, sans-serif;
	font-size: 14px;
	margin: 0;
	overflow: hidden;
}

hr {
	border: 0;
	border-top: 1px solid #ccc;
}

.Button {
	position: relative;
}

.Input {
	vertical-align: middle;
}

	.Input[type="color"]::-webkit-color-swatch-wrapper {
		padding: 0;
	}
	.Input[type="color"]::-webkit-color-swatch {
		border: none;
	}

.TextArea {
	tab-size: 4;
	white-space: pre;
	word-wrap: normal;
}

	.TextArea.success {
		border-color: #8b8 !important;
	}

	.TextArea.fail {
		border-color: #f00 !important;
		background-color: rgba(255,0,0,0.05);
	}

.TextArea, .Input { outline: none; } /* osx */

.Panel {
	-moz-user-select: none;
	-webkit-user-select: none;
	-ms-user-select: none;

	/* No support for these yet */
	-o-user-select: none;
	user-select: none;
}

.TabbedPanel {
	-moz-user-select: none;
	-webkit-user-select: none;
	-ms-user-select: none;

	/* No support for these yet */
	-o-user-select: none;
	user-select: none;
	position: relative;
	display: block;
	width: 100%;
	min-width: 335px;
}

.TabbedPanel .Tabs {
	position: relative;
	z-index: 1; /** Above .Panels **/
	display: block;
	width: 100%;
	white-space: pre;
	overflow: hidden;
	overflow-x: auto;
}

	.TabbedPanel .Tabs::-webkit-scrollbar {
		height: 5px;
		background: #eee;
	}
	.TabbedPanel .Tabs::-webkit-scrollbar-thumb {
		background: #08f3;
	}
	.TabbedPanel .Tabs:hover::-webkit-scrollbar-thumb {
		background: #08f;
		cursor: ew-resize;
	}

	.TabbedPanel .Tabs .Tab {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		gap: 3px;
		padding: 8px 10px 6px;
		text-transform: uppercase;
		min-width: 52px;
		cursor: pointer;
		border-bottom: 3px solid transparent;
		transition: color 0.15s, background 0.15s, border-color 0.15s;
	}

	.TabbedPanel .Tabs .Tab:hover {
		color: #08f;
		background: rgba( 0, 136, 255, 0.06 );
	}

	.TabbedPanel .Tabs .Tab.selected {
		color: #08f;
		background: rgba( 0, 136, 255, 0.12 );
		border-bottom-color: #08f;
		font-weight: bold;
	}

	.TabbedPanel .Tabs .tab-icon {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.TabbedPanel .Tabs .tab-label {
		font-size: 9px;
		letter-spacing: 0.04em;
		line-height: 1;
		text-align: center;
    	display: block;
	    margin-top: 5px;
	}

	.TabbedPanel .Panels {
		position: absolute;
		top: 56px;
		display: block;
		width: 100%;
	}

/* The object-properties panel is inlined directly under the outliner tree (not
   the top-level sidebar), so its tab panels must sit in normal document flow.
   The default `position: absolute` pulled them out of flow and overlapped the
   scene-level properties (background / environment / fog / stats) below it. */
#properties > .Panels {
	position: relative;
	top: 0;
}

/* Listbox */
.Listbox {
	color: #444;
	background-color: #fff;
	padding: 0;
	width: 100%;
	min-height: 180px;
	font-size: 12px;
	cursor: default;
	overflow: auto;
}

.Listbox .ListboxItem {
	padding: 4px;
	color: #666;
	white-space: nowrap;
}

.Listbox .ListboxItem:hover {
	background-color: rgba(0, 0, 0, 0.02);
}

.Listbox .ListboxItem.active {
	background-color: rgba(0, 0, 0, 0.04);
}

/* CodeMirror */

.CodeMirror {

	position: absolute !important;
	top: 37px;
	width: 100% !important;
	height: calc(100% - 37px) !important;

}

	.CodeMirror .errorLine {

		background: rgba(255,0,0,0.25);

	}

	.CodeMirror .esprima-error {

		color: #f00;
		text-align: right;
		padding: 0 20px;

	}

/* outliner */

#outliner .opener {
	display: inline-block;
	width: 14px;
	height: 14px;
	margin: 0px 4px;
	vertical-align: top;
	text-align: center;
}

	#outliner .opener.open:after {
		content: '−';
	}

	#outliner .opener.closed:after {
		content: '+';
	}

#outliner .option {

	border: 1px solid transparent;

}

#outliner .option.drag {

	border: 1px dashed #999;

}

#outliner .option.dragTop {

	border-top: 1px dashed #999;

}

#outliner .option.dragBottom {

	border-bottom: 1px dashed #999;

}

#outliner .type {
	display: inline-block;
	width: 14px;
	height: 14px;
	color: #ddd;
	text-align: center;
}

#outliner .type:after {
	content: '●';
}

/* */

#outliner .Scene {
	color: #8888dd;
}

#outliner .Camera {
	color: #dd8888;
}

#outliner .Light {
	color: #dddd88;
}

/* */

#outliner .Object3D {
	color: #aaaaee;
}

#outliner .Mesh {
	color: #8888ee;
}

#outliner .Line {
	color: #88ee88;
}

#outliner .LineSegments {
	color: #88ee88;
}

#outliner .Points {
	color: #ee8888;
}

/* */

#outliner .Geometry {
	color: #aaeeaa;
}

#outliner .Material {
	color: #eeaaee;
}

/* */

#outliner .Script:after {
	content: '◎'
}

/*  */

.Button {
	color: #555;
	background-color: #ddd;
	border: 0px;
	margin: 0px; /* GNOME Web */
	padding: 5px 8px;
	font-size: 12px;
	text-transform: uppercase;
	cursor: pointer;
	outline: none;
}

	.Button:hover {
		background-color: #fff;
	}

	.Button.selected {
		background-color: #fff;
	}

.Input, .TextArea {
	border: 1px solid transparent;
	color: #444;
}

.Input.Number {
	color: #08f!important;
	font-size: 12px;
	border: 0px;
	padding: 2px;
}

.ViewportIconButton {
	height: 27px;
	box-sizing: border-box;
	padding: 0 8px;
	color: #666;
	background-color: #ddd;
	border: 3px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	outline: none;
	line-height: 0;
}

	.ViewportIconButton:hover {
		background-color: #fff;
	}

.Select {
	color: #666;
	background-color: #ddd;
	border: 3px solid #ddd;
	border-radius: 4px;
	text-transform: uppercase;
	cursor: pointer;
	outline: none;
}

	.Select:hover {
		background-color: #fff;
	}

/* UI */

:root {
	--sidebar-width: 350px;  /* used when docked left or right */
	--sidebar-height: 420px; /* used when docked at the bottom */
}

#resizer {
	position: absolute;
	z-index: 2; /* Above #sidebar */
	top: 36px;
	right: var( --sidebar-width );
	width: 5px;
	bottom: 0px;
	transform: translatex(2.5px);
	cursor: col-resize;
}

	#resizer:hover {
		background-color: #08f8;
		transition-property: background-color;
		transition-delay: 0.1s;
		transition-duration: 0.2s;
	}

	#resizer:active {
		background-color: #08f;
	}

#viewport {
	position: absolute;
	top: 36px;
	left: 0;
	right: var( --sidebar-width );
	bottom: 0;
}

	#viewport .Text {
		text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
		pointer-events: none;
	}

#animation {
	position: absolute;
	left: 0;
	right: var( --sidebar-width );
	bottom: 0;
	height: 36px;
	background: #eee;
	border-top: 1px solid #ccc;
	display: none;
	flex-direction: row;
}

	#animation .Panel {
		color: #888;
	}

	#animation input[type="range"] {
		accent-color: #08f;
	}

#animation-resizer {
	position: absolute;
	left: 0;
	right: var( --sidebar-width );
	bottom: 36px;
	height: 5px;
	transform: translateY(2.5px);
	cursor: row-resize;
	z-index: 2;
}

	#animation-resizer:hover {
		background-color: #08f8;
		transition-property: background-color;
		transition-delay: 0.1s;
		transition-duration: 0.2s;
	}

	#animation-resizer:active {
		background-color: #08f;
	}

#script {
	position: absolute;
	top: 36px;
	left: 0;
	right: var( --sidebar-width );
	bottom: 0;
	opacity: 0.9;
}

#player {
	position: absolute;
	top: 36px;
	left: 0;
	right: var( --sidebar-width );
	bottom: 0;
}

/* ── Present mode (#...&present=true) — viewer-only, no editing chrome ───────
   Hides the menubar (top toolbar), the floating tool palette (bottom option)
   and the sidebar, and lets #viewport/#script/#player fill the whole screen.
   #present-bar (play/pause/stop + seek) is the only chrome left, shown only
   in this mode. */
body.present-mode #menubar,
body.present-mode #toolbar,
body.present-mode #sidebar,
body.present-mode #resizer,
body.present-mode #animation,
body.present-mode #animation-resizer {
	display: none !important;
}

body.present-mode #viewport,
body.present-mode #script,
body.present-mode #player {
	top: 0;
	right: 0;
	height: auto; /* Don't reserve space for the mobile sidebar in a short embed. */
}

#present-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 44px;
	background: rgba( 20, 20, 20, 0.85 );
	display: none;
	align-items: center;
	gap: 10px;
	padding: 0 14px;
	box-sizing: border-box;
	z-index: 50;
}

body.present-mode #present-bar {
	display: flex;
}

	#present-bar [hidden] {
		display: none;
	}

	#present-bar button {
		flex-shrink: 0;
		width: 28px;
		height: 28px;
		border: none;
		border-radius: 4px;
		background: rgba( 255, 255, 255, 0.12 );
		color: #fff;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
	}

		#present-bar button:hover {
			background: rgba( 255, 255, 255, 0.24 );
		}

	#present-bar input[type="range"] {
		flex: 1;
		accent-color: #08f;
	}

	#present-bar .present-time {
		flex-shrink: 0;
		min-width: 90px;
		text-align: right;
		font: 11px/1 monospace;
		color: #ddd;
	}

	#present-bar .present-remix {
		flex-shrink: 0;
		margin-inline-start: auto;
		width: auto;
		height: 28px;
		padding: 0 14px;
		font: bold 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
		background: #08f;
	}

		#present-bar .present-remix:hover {
			background: #2a9dff;
		}

#timeline button:disabled {
	opacity: 0.35;
	cursor: default;
}

/* The Animations tab fills the sidebar below the tab strip (like #shell), so the track list and
   the code panel can share the height; #timeline is padded/bordered by its own rows instead. */
#sidebar > .Panels > #animations {
	height: 100%;
}

#sidebar > .Panels > #animations > #timeline {
	padding: 0;
	border: 0;
}

/* A hairline with a 7px hit area; it only lights up when you reach for it */
#timeline-splitter {
	position: relative;
	flex: 0 0 7px;
	margin: -3px 0;
	z-index: 2;
	background: transparent;
	cursor: row-resize;
	touch-action: none;
	outline: none;
}

#timeline-splitter::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 3px;
	height: 1px;
	background: rgba( 128, 128, 128, 0.35 );
	transition: background 0.12s, top 0.12s, height 0.12s;
}

#timeline-splitter:hover::after,
#timeline-splitter:focus-visible::after,
#timeline-splitter.dragging::after {
	top: 2px;
	height: 3px;
	background: #08f;
	opacity: 0.8;
}

/* ── Animations tab polish (Timeline.js): track colours, shot markers, mini-map, snap grid, hover card, compact toolbar ── */

/* A block's colour is its track's kind. These come before the injected rules for group / face / gaze / selected
   (same specificity, later wins), so those keep working. Only classes: the track list can hold ~1000 blocks. */
.timeline-block.k-camera { background: #7e57c2; }
.timeline-block.k-character { background: #43a047; }
.timeline-block.k-prop { background: #2196F3; }
.timeline-block.k-light { background: #e08a00; }
.timeline-block.k-group { background: #00897b; }
.timeline-block.k-other { background: #78909c; }

/* the icon in a track's label, in the same hue as its blocks */
.timeline-track-icon { flex: 0 0 auto; display: inline-flex; align-items: center; opacity: 0.95; }
.timeline-track-icon.k-camera { color: #9575cd; }
.timeline-track-icon.k-character { color: #66bb6a; }
.timeline-track-icon.k-prop { color: #42a5f5; }
.timeline-track-icon.k-light { color: #f5a623; }
.timeline-track-icon.k-group { color: #26a69a; }
.timeline-track-icon.k-other { color: #90a4ae; }
.timeline-track-icon.k-clip { color: #ba68c8; }

/* a camera shot's start: a hairline and a short name, over the lane (they never take the pointer) */
.timeline-shot { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid rgba( 255, 255, 255, 0.55 ); pointer-events: none; z-index: 1; }
.timeline-shot-label { position: absolute; top: 0; left: 2px; font-size: 8px; line-height: 9px; color: rgba( 255, 255, 255, 0.9 ); text-shadow: 0 0 2px rgba( 0, 0, 0, 0.9 ); white-space: nowrap; }

/* the overview bar above the ruler, only while zoomed */
.timeline-minimap { display: none; flex: 0 0 auto; height: 16px; align-items: stretch; border-top: 1px solid rgba( 128, 128, 128, 0.25 ); }
.timeline-minimap-label { flex: 0 0 auto; box-sizing: border-box; padding: 0 6px; font-size: 9px; line-height: 15px; opacity: 0.55; white-space: nowrap; }
.timeline-minimap-bar { position: relative; flex: 1 1 auto; min-width: 0; background: rgba( 128, 128, 128, 0.12 ); overflow: hidden; cursor: pointer; touch-action: none; }
.timeline-minimap-bins { position: absolute; left: 0; right: 0; top: 1px; bottom: 0; display: flex; align-items: flex-end; pointer-events: none; }
.timeline-minimap-bins > i { flex: 1 1 0; min-width: 0; background: rgba( 33, 150, 243, 0.65 ); }
.timeline-minimap-window { position: absolute; top: 0; bottom: 0; box-sizing: border-box; border: 1px solid rgba( 255, 87, 34, 0.95 ); background: rgba( 255, 87, 34, 0.18 ); cursor: grab; }
.timeline-minimap-window.dragging { cursor: grabbing; background: rgba( 255, 87, 34, 0.3 ); }
.timeline-minimap-head { position: absolute; top: 0; bottom: 0; width: 1px; background: #f00; pointer-events: none; }

/* snap toggle and its grid (one overlay element under the blocks) */
.timeline-toggle.on { background: #2196F3; color: #fff; border-color: #2196F3; }
.timeline-grid { position: absolute; bottom: 0; pointer-events: none; display: none; background-image: linear-gradient( to right, rgba( 128, 128, 128, 0.28 ) 1px, transparent 1px ); background-repeat: repeat-x; }

/* the hover card on a block: one shared element, never takes the pointer */
.timeline-tip { position: fixed; z-index: 10000; display: none; max-width: 260px; box-sizing: border-box; padding: 6px 9px; border-radius: 5px; background: rgba( 24, 24, 28, 0.96 ); color: #eee; border: 1px solid rgba( 255, 255, 255, 0.18 ); box-shadow: 0 3px 12px rgba( 0, 0, 0, 0.45 ); font-size: 11px; line-height: 1.45; pointer-events: none; }
.timeline-tip b { color: #fff; font-size: 12px; }
.timeline-tip .range { font-family: monospace; opacity: 0.85; }
.timeline-tip .line { opacity: 0.75; font-family: monospace; font-size: 10px; overflow-wrap: anywhere; }

/* the toolbar collapsed to one compact row */
.timeline-bar-collapsed { padding: 4px 10px !important; gap: 0 !important; }
.timeline-bar-collapsed .timeline-hide-compact { display: none !important; }
.timeline-chevron svg { transition: transform 0.15s; }
.timeline-bar-collapsed .timeline-chevron svg { transform: rotate( 180deg ); }

/* The line of the selected key in the Animations tab's code panel (Monaco decoration) */
.timeline-key-line {
	background: rgba(255, 87, 34, 0.30);
	outline: 1px solid rgba(255, 87, 34, 0.75);
	outline-offset: -1px;
}

/* The key popover is a child of <body>, so it gets the editor's control look from here */
.timeline-key-popover button { font-family: inherit; }
.timeline-key-popover button:hover { filter: brightness(1.2); }

/* ── Subtitle preview — the cue active at the playhead, over the viewport ─── */
#subtitle-preview {
	position: absolute;
	left: 0;
	right: var( --sidebar-width );
	bottom: 70px;
	display: none;
	justify-content: center;
	pointer-events: none;
	z-index: 30;
}

body.sidebar-left #subtitle-preview {
	left: var( --sidebar-width );
	right: 0;
}

body.present-mode #subtitle-preview {
	left: 0;
	right: 0;
	bottom: 60px;
}

	#subtitle-preview span {
		max-width: 80%;
		padding: 6px 14px;
		border-radius: 6px;
		background: rgba( 0, 0, 0, 0.62 );
		color: #fff;
		font: 600 20px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
		text-align: center;
		white-space: pre-line;
		text-shadow: 0 0 2px #000, 1px 2px 3px #000, 0 2px 6px rgba( 0, 0, 0, 0.9 );
	}

/* ── Render tab sub-tabs: Snapshot / Video / 360° / Subtitles ────────────────────────────────────────────
   The tabs are the sidebar's own (.TabbedPanel .Tabs .Tab: an icon with its label below); this only spreads four of them
   across the width and sizes the Font Awesome glyph like the sidebar's SVG icons. */
.render-subtabs {
	display: flex;
	margin: 0 0 10px;
	border-bottom: 1px solid rgba( 128, 128, 128, 0.35 );
}

	.render-subtabs .Tab {
		flex: 1 1 0;
		min-width: 0;
	}

	.render-subtabs .tab-icon {
		height: 22px;
		font-size: 17px;
	}

	.render-subtabs .Tab:focus-visible {
		outline: 2px solid currentColor;
		outline-offset: -2px;
	}

/* an icon before a button's label */
.Button .btn-icon {
	margin-right: 6px;
}

	.Button .btn-icon:only-child {
		margin-right: 0;
	}

/* ── Transport icons (play / pause / stop) — Font Awesome glyphs, coloured on their own, no button background.
   Used by the Timeline toolbar and the play bar. The state shows in the glyph: dimmed at rest, bright on hover,
   glowing while it is the active one. */
.transport-icon {
	width: 30px;
	height: 30px;
	padding: 0;
	border: none;
	background: none;
	box-shadow: none;
	border-radius: 0;
	font-size: 17px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	cursor: pointer;
	opacity: 0.85;
	transition: transform 0.12s, opacity 0.12s, filter 0.12s;
}

	.transport-icon:hover {
		opacity: 1;
		transform: scale( 1.15 );
	}

	.transport-icon:active {
		transform: scale( 0.95 );
	}

	.transport-icon:focus-visible {
		outline: 2px solid currentColor;
		outline-offset: 1px;
		border-radius: 4px;
	}

	.transport-icon.active {
		opacity: 1;
		filter: drop-shadow( 0 0 5px currentColor );
	}

	.transport-icon.play { color: #2ea44f; }
	.transport-icon.pause { color: #e0a000; }
	.transport-icon.stop { color: #e5484d; }

/* ── Play bar — QuickTime-style transport that replaces the menubar ──────────
   Opened by PlayBar.js when the timeline starts playing; its cancel button
   removes body.play-bar-open and the regular menubar returns. */
#play-bar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 36px;
	background: #2b2b2b;
	display: none;
	align-items: center;
	gap: 10px;
	padding: 0 12px;
	box-sizing: border-box;
	z-index: 50;
}

body.play-bar-open #play-bar {
	display: flex;
}

/* The play bar covers the menubar's menus but not the Strata logo, which stays put:
   the bar's controls start to the right of it. */
body.play-bar-open #menubar > :not(#menubar-logo) {
	display: none !important;
}

body.play-bar-open #play-bar {
	padding-left: 88px;
}

body.present-mode #play-bar {
	display: none !important;
}

	#play-bar .play-bar-button {
		flex-shrink: 0;
		cursor: pointer;
	}

	/* the close button is the one round button left on the bar */
	#play-bar .play-bar-button.cancel {
		width: 26px;
		height: 26px;
		padding: 0;
		border: none;
		border-radius: 50%;
		color: #fff;
		display: flex;
		align-items: center;
		justify-content: center;
		background: rgba( 255, 255, 255, 0.14 );
		margin-left: 4px;
		opacity: 0.85;
	}

		#play-bar .play-bar-button.cancel:hover {
			opacity: 1;
		}

	#play-bar .transport-icon {
		width: 28px;
		height: 28px;
	}

	#play-bar input[type="range"] {
		flex: 1;
		min-width: 80px;
		accent-color: #2ea44f;
	}

	#play-bar .play-bar-time {
		flex-shrink: 0;
		min-width: 96px;
		text-align: right;
		font: 12px/1 monospace;
		color: #ddd;
	}

/* ── Sidebar docking position (toggled from the menubar) ─────────────────────
   Default (no body class) keeps the sidebar on the right. */

/* Sidebar docked left */
body.sidebar-left #sidebar {
	left: 0;
	right: auto;
}

body.sidebar-left #viewport,
body.sidebar-left #script,
body.sidebar-left #player,
body.sidebar-left #animation,
body.sidebar-left #animation-resizer {
	left: var( --sidebar-width );
	right: 0;
}

body.sidebar-left #resizer {
	left: var( --sidebar-width );
	right: auto;
	transform: translateX(-2.5px);
}

body.sidebar-left #toolbar {
	left: calc(50% + var( --sidebar-width ) / 2); /* centered in the viewport area (left dock) */
}

/* Inspector hidden (close button in overlay mode) */
body.sidebar-hidden #sidebar {
	display: none;
}

/* Sidebar overlay — floats freely over the viewport; JS controls left/top/width/height */
body.sidebar-overlay #sidebar {
	right: auto;
	bottom: auto;
	z-index: 5;
	box-shadow: 0 6px 28px rgba( 0, 0, 0, 0.45 );
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-width: 280px;
	min-height: 200px;
}

/* Make the TabbedPanel fill the overlay height */
body.sidebar-overlay #sidebar .TabbedPanel {
	display: contents;
}

body.sidebar-overlay #sidebar .Tabs {
	flex-shrink: 0;
	order: 2;
}

body.sidebar-overlay #sidebar .Panels {
	position: static;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	order: 3;
}

/* Drag handle — only shown in overlay mode */
#overlay-handle {
	display: none;
}

body.sidebar-overlay #overlay-handle {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 22px;
	flex-shrink: 0;
	order: 1;
	position: relative;
	background: #d4d4d4;
	border-bottom: 1px solid #bbb;
	cursor: grab;
	user-select: none;
}

body.sidebar-overlay #overlay-handle:active {
	cursor: grabbing;
	background: #c8c8c8;
}

body.sidebar-overlay #overlay-handle::after {
	content: '';
	display: block;
	width: 36px;
	height: 4px;
	border-radius: 2px;
	background: repeating-linear-gradient(
		90deg,
		#999 0 3px,
		transparent 3px 6px
	);
}

/* Close button — only shown in overlay mode */
#overlay-close {
	display: none;
}

body.sidebar-overlay #overlay-close {
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY( -50% );
	width: 18px;
	height: 18px;
	border: none;
	background: transparent;
	color: #777;
	cursor: pointer;
	font-size: 12px;
	border-radius: 3px;
	padding: 0;
	line-height: 1;
}

body.sidebar-overlay #overlay-close:hover {
	background: rgba( 200, 0, 0, 0.15 );
	color: #c00;
}

/* Resize grip — only shown in overlay mode */
#overlay-grip {
	display: none;
}

body.sidebar-overlay #overlay-grip {
	display: block;
	position: absolute;
	bottom: 0;
	right: 0;
	width: 18px;
	height: 18px;
	cursor: nwse-resize;
	z-index: 6;
	background: linear-gradient(
		135deg,
		transparent 40%,
		#bbb 40%, transparent 50%,
		#bbb 50%, transparent 60%,
		#bbb 60%, transparent 70%,
		#bbb 70%, transparent 80%,
		#bbb 80%, transparent 90%
	);
}

body.sidebar-overlay #viewport,
body.sidebar-overlay #script,
body.sidebar-overlay #player,
body.sidebar-overlay #animation,
body.sidebar-overlay #animation-resizer {
	left: 0;
	right: 0;
}

body.sidebar-overlay #resizer {
	display: none;
}

body.sidebar-overlay #toolbar {
	left: 50%;
}


body.sidebar-bottom #sidebar {
	left: 0;
	right: 0;
	top: auto;
	bottom: 0;
	width: 100%;
	height: var( --sidebar-height );
}

body.sidebar-bottom #viewport,
body.sidebar-bottom #script,
body.sidebar-bottom #player {
	left: 0;
	right: 0;
	bottom: var( --sidebar-height );
}

body.sidebar-bottom #animation,
body.sidebar-bottom #animation-resizer {
	display: none;
}

body.sidebar-bottom #resizer {
	top: auto;
	left: 0;
	right: 0;
	width: auto;
	height: 16px;
	bottom: var( --sidebar-height );
	transform: translateY( 8px ); /* shift DOWN so the element straddles the sidebar top edge */
	cursor: row-resize;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
}

body.sidebar-bottom #resizer::after {
	content: '';
	display: block;
	width: 48px;
	height: 4px;
	border-radius: 2px;
	background: #888;
	pointer-events: none;
	transition: background 0.15s;
}

body.sidebar-bottom #resizer:hover {
	background: rgba( 0, 136, 255, 0.10 );
}

body.sidebar-bottom #resizer:hover::after,
body.sidebar-bottom #resizer:active::after {
	background: #08f;
}

body.sidebar-bottom #toolbar {
	left: 50%; /* full-width viewport */
	bottom: calc( var( --sidebar-height ) + 16px );
}

/* In bottom-dock the sidebar has a fixed height — make the panels area scrollable. */
body.sidebar-bottom .TabbedPanel .Panels {
	bottom: 0;
	overflow-y: auto;
	height: calc( var( --sidebar-height ) - 36px );
}

/* JS Shell panel */
/* Scoped under #sidebar so it outranks `#sidebar .Panel` (the Shell root is a
   UIPanel and would otherwise inherit 10px padding + a border, overflowing). */
#sidebar #shell {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	height: calc(100vh - 92px);   /* right/left dock: viewport minus menubar (36) + tab row (56) */
	margin: 0;
	padding: 0;
	border: 0;
	background: #1a1a2e;
	font-family: Consolas, 'Courier New', monospace;
	font-size: 13px;
	color: #ddd;
}

/* In bottom-dock the sidebar height is var(--sidebar-height); subtract the tab strip (36px). */
body.sidebar-bottom #sidebar #shell {
	height: calc( var( --sidebar-height ) - 56px );
}

#shell-header {
	display: flex;
	flex-wrap: nowrap;        /* everything stays on one line */
	align-items: center;
	column-gap: 8px;
	padding: 6px 10px;
	background: #111;
	border-bottom: 1px solid #333;
	flex-shrink: 0;
	font-family: 'Roboto', Helvetica, Arial, sans-serif;
	font-size: 12px;
	overflow: hidden;
}

#shell-header-title {
	color: #7ec8e3;
	font-weight: bold;
	flex: 0 0 auto;
}

/* First-run line under the header: JS works without the optional AI. */
#shell-hint {
	padding: 4px 10px;
	background: #0d0d0d;
	border-bottom: 1px solid #222;
	color: #999;
	font-size: 11px;
	line-height: 1.4;
	flex-shrink: 0;
}

#shell-ai-status {
	color: #6a9;
	font-size: 11px;
	flex: 0 1 auto;           /* shrinks first when space is tight */
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: right;
	margin-left: 8px;
	margin-right: 6px;
}

#shell-model-select {
	background: #222;
	color: #ccc;
	border: 1px solid #444;
	border-radius: 3px;
	font-size: 11px;
	padding: 2px 4px;
	flex: 1 1 60px;           /* fills the middle, shrinks as needed */
	min-width: 0;
}

#shell-load-btn {
	background: #2a4a7f;
	color: #fff;
	border: none;
	border-radius: 3px;
	font-size: 11px;
	padding: 3px 10px;
	cursor: pointer;
	flex: 0 0 auto;
	white-space: nowrap;
}

#shell-load-btn:disabled { opacity: 0.5; cursor: default; }
#shell-load-btn:hover:not(:disabled) { background: #3a6aaf; }

/* Stop = compact red stop icon only */
#shell-stop-btn {
	background: transparent;
	color: #ff5555;
	border: none;
	border-radius: 3px;
	line-height: 0;
	padding: 3px 6px;
	cursor: pointer;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

#shell-stop-btn:disabled { opacity: 0.5; cursor: default; }
#shell-stop-btn:hover:not(:disabled) { color: #ff8888; background: rgba(255,85,85,0.12); }

/* Mutable toggle — read-only (grey) vs mutable/executes-code (amber) */
#shell-mutable-wrap {
	display: flex;
	align-items: center;
	column-gap: 4px;
	flex: 0 0 auto;
	color: #888;
	font-size: 11px;
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

#shell-mutable-wrap.is-mutable { color: #e0a030; }

#shell-mutable-checkbox {
	accent-color: #e0a030;
	margin: 0;
	cursor: pointer;
}

#shell-progress-wrap {
	height: 3px;
	background: #1e2235;
	flex-shrink: 0;
}

#shell-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #7c3aed, #a78bfa);
	width: 0%;
	transition: width 0.3s;
}

#shell-output {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 12px 4px;
    user-select: text;
    -webkit-user-select: text;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

#shell-ai-row {
	display: flex;
	align-items: center;
	padding: 5px 12px;
	border-top: 1px solid #2a2a3e;
	background: #12122a;
	flex-shrink: 0;
}

#shell-ai-input {
	flex: 1;
	background: transparent;
	border: none;
	color: #c9d1d9;
	font-family: 'Roboto', Helvetica, Arial, sans-serif;
	font-size: 13px;
	outline: none;
	padding: 0;
}

#shell-ai-input::placeholder { color: #444; }
#shell-ai-input:disabled { opacity: 0.4; }

.shell-ai-label {
	color: #c9a227;
	font-family: 'Roboto', Helvetica, Arial, sans-serif;
	font-weight: bold;
	margin-right: 8px;
}

#shell-input-row {
	display: flex;
	align-items: flex-start;
	padding: 6px 12px;
	border-top: 1px solid #333;
	background: #111;
	flex-shrink: 0;
}

.shell-prompt {
	color: #7ec8e3;
	flex-shrink: 0;
	padding-top: 2px;
	margin-right: 6px;
	user-select: none;
}

#shell-input {
	flex: 1;
	background: transparent;
	border: none;
	color: #fff;
	font-family: Consolas, 'Courier New', monospace;
	font-size: 13px;
	outline: none;
	resize: none;
	line-height: 1.5;
	max-height: 120px;
	overflow-y: auto;
	padding: 0;
}

#shell-input::placeholder {
	color: #555;
}

/* ── Shell autocomplete dropdown ─────────────────────────────────────── */

#shell-input-row {
	position: relative;
}

.shell-autocomplete {
	position: absolute;
	bottom: 100%;
	left: 30px;
	right: 12px;
	max-height: 260px;
	overflow-y: auto;
	background: #1e1e1e;
	border: 1px solid #444;
	border-radius: 4px;
	box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
	z-index: 100;
	display: none;
	font-family: Consolas, 'Courier New', monospace;
	font-size: 13px;
}

.shell-autocomplete.visible {
	display: block;
}

.shell-ac-item {
	padding: 3px 10px;
	color: #ccc;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.shell-ac-item.active {
	background: #094771;
	color: #fff;
}

.shell-ac-item:hover {
	background: #2a2d2e;
}

.shell-ac-item .shell-ac-kind {
	color: #888;
	font-size: 11px;
	margin-left: 8px;
}

.shell-ac-sig {
	position: sticky;
	top: 0;
	padding: 4px 10px;
	background: #252526;
	border-bottom: 1px solid #333;
	color: #9cdcfe;
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.shell-ac-sig .shell-ac-signame {
	color: #dcdcaa;
}

.shell-ac-group {
	padding: 6px 10px 2px;
	color: #777;
	font-size: 10px;
	letter-spacing: 0.04em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.shell-ac-item .shell-ac-hint {
	color: #6a9955;
	font-size: 11px;
	margin-left: 4px;
}

.shell-line {
    display: block;
    padding: 0;
    white-space: pre-wrap;
    cursor: pointer;
    border-radius: 2px;
    min-height: 20px;
    margin-bottom: 2px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    flex: 0 0 auto;
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 5px;
}

.shell-code-block {
	width: 100%;
	height: auto;
	flex: 0 0 auto;
	overflow: hidden;
}

.shell-line:hover {
	background: rgba(255,255,255,0.05);
}

.shell-line.shell-copied {
	background: rgba(120,200,100,0.18);
}

.shell-cmd       { color: #e9e5e5;
    border-top: 1px solid rgb(51, 51, 51);
    border-bottom: 1px solid rgb(51, 51, 51);
    padding: 10px 5px !important;
    background: black;
    border-radius: 10px;
    position: relative;
    padding-right: 40px !important;
}
.shell-cmd-copy-btn {
    position: absolute;
    top: -5px;
    right: 2px;
    cursor: pointer;
    font-size: 3.1em;
    opacity: 0.7;
    user-select: none;
    transition: opacity 0.2s;
}
.shell-cmd-copy-btn:hover {
    opacity: 1;
}

#shell-unload-btn{
	background-color: #08f;
	border: 1px solid #08f;
	border-radius: 2px;
}

#shell-config-api-btn{
	background-color: #08f;
	border: 1px solid #08f;
	border-radius: 2px;
}

.shell-cmd br{
	display: block;
	height: 1px;
}
.shell-result    {     color: #79c0ff;
    overflow: visible;
    border-bottom: 1px white solid;
    padding-bottom: 10px;
    box-shadow: 0px 1px 1px black;
    margin-bottom: 10px; }
.shell-error     { color: #ff6b6b; }
.shell-info      { color: #6a737d; font-style: italic; }
.shell-ai-prompt { color: #c9a227;
    font-style: italic;
    overflow: visible;
    margin-left: -3px;
    font-size: 120%;
    margin-bottom: -5px;
}
.shell-ai-prompt::before {
    content: '[AI] ';
    font-weight: bold;
}
.shell-ai-stream { color: #7a8099; font-style: italic; white-space: pre-wrap; word-break: break-all; }

/* Cost display chips */
.shell-cost { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 0.9em; font-weight: 500; font-style: normal; cursor: pointer; transition: opacity 0.2s; }
.shell-cost:hover { opacity: 0.8; }
.shell-cost-external { background-color: rgba(255, 100, 100, 0.2); color: #ff6464; border: 1px solid #ff6464; }
.shell-cost-external:hover { background-color: rgba(255, 100, 100, 0.3); }
.shell-cost-local { background-color: rgba(100, 200, 100, 0.2); color: #64c864; border: 1px solid #64c864; }
.shell-cost-local:hover { background-color: rgba(100, 200, 100, 0.3); }

/* Toast notification */
.shell-toast { position: fixed; bottom: 20px; right: 20px; background-color: #1e1e1e; color: #fff; padding: 16px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); max-width: 400px; font-size: 0.9em; line-height: 1.5; border-left: 4px solid #ff6464; z-index: 10000; animation: slideIn 0.3s ease-out; }
.shell-toast.local { border-left-color: #64c864; }
@keyframes slideIn { from { transform: translateX(420px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(420px); opacity: 0; } }

#menubar {
	position: absolute;
	width: 100%;
	height: 36px;
	background: #eee;
	padding: 0;
	margin: 0;
	right: 0;
	top: 0;
}

	#menubar .menu {
		float: left;
		cursor: pointer;
		padding-right: 8px;
	}

	#menubar .menu.right {
		float: right;
		cursor: auto;
		padding-right: 0;
		text-align: right;
	}

		#menubar .menu .title {
			display: inline-block;
			color: #888;
			margin: 0;
			padding: 10px;
			line-height: 16px;
		}

		#menubar .menu .key {
			position: absolute;
			right: 10px;
			color: #ccc;
			border: 1px solid #ccc;
			border-radius: 4px;
			font-size: 9px;
			line-height: normal;
			padding: 2px 4px;
			right: 10px;
			pointer-events: none;
		}

		#menubar .menu .options {
			position: fixed;
			z-index: 1; /* higher than resizer */
			display: none;
			padding: 5px 0;
			background: #eee;
			min-width: 150px;
			max-height: calc(100vh - 80px);
			overflow: auto;
		}

		#menubar .menu:hover .options {
			display: block;
			box-shadow: 0 10px 10px -5px #00000033;
		}

			#menubar .menu .options hr {
				border-color: #ddd;
			}

			#menubar .menu .options .option {
				color: #666;
				background-color: transparent;
				padding: 5px 10px;
				line-height: 25px;
				margin: 0 !important;
			}

				#menubar .menu .options .option:hover {
					color: #fff;
					background-color: #08f;
				}

				#menubar .menu .options .option:not(.submenu-title):active {
					color: #666;
					background: transparent;
				}

				#menubar .menu .options .option.toggle::before {

					content: ' ';
					display: inline-block;
					width: 16px;

				}

				#menubar .menu .options .option.toggle-on::before {

					content: '✔';
					font-size: 12px;

				}

				#menubar .submenu-title::after {
					content: '⏵';
					float: right;
				}

		#menubar .menu .options .inactive {
			color: #bbb;
			background-color: transparent;
			padding: 5px 10px;
			line-height: 25px;
			margin: 0 !important;
			cursor: not-allowed;
		}

	/* Flat menubar: no expandable dropdowns — every action sits on one line */

	#menubar .menu:not(.right) .title {
		display: none;
	}

	/* Vertical separators between the File | Edit | View groups */
	#menubar .menu:not(.right) + .menu:not(.right) {
		border-left: 1px solid #ccc;
		padding-left: 8px;
	}

	#menubar .menu .options,
	#menubar .menu:hover .options {
		position: static;
		display: flex;
		flex-direction: row;
		align-items: center;
		height: 36px;
		padding: 0;
		margin: 0;
		min-width: 0;
		max-height: none;
		overflow: visible;
		background: transparent;
		box-shadow: none;
	}

		#menubar .menu .options hr,
		#menubar .menu .options .key {
			display: none;
		}

		#menubar .menu .options .option {
			cursor: pointer;
		}

		#menubar .menu .options .option,
		#menubar .menu .options .inactive {
			display: inline-flex;
			align-items: center;
			height: 36px;
			padding: 0 9px;
			line-height: normal;
			position: relative;
		}

	/* Instant CSS tooltip on hover (native title is slow/unreliable) */
	#menubar [data-tooltip] {
		position: relative;
	}

	#menubar [data-tooltip]:hover::after {
		content: attr(data-tooltip);
		position: absolute;
		top: 100%;
		left: 50%;
		transform: translateX(-50%);
		margin-top: 6px;
		padding: 4px 8px;
		background: #222;
		color: #fff;
		font-size: 11px;
		line-height: 1.3;
		white-space: nowrap;
		border-radius: 4px;
		box-shadow: 0 2px 6px #00000066;
		pointer-events: none;
		z-index: 10;
	}

	/* Keep right-aligned status tooltips from overflowing the viewport edge */
	#menubar .menu.right [data-tooltip]:hover::after {
		left: auto;
		right: 0;
		transform: none;
	}

		/* Toggles show their state by colouring the icon, not a checkmark */
		#menubar .menu .options .option.toggle::before {
			content: none;
			width: 0;
		}

		#menubar .menu .options .option.toggle-on {
			color: #08f;
		}

#sidebar {
	position: absolute;
	right: 0;
	top: 36px;
	bottom: 0;
	width: var( --sidebar-width );
	background: #eee;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

/* Keep the tab strip pinned at the top of the sidebar — only the active
   panel's own content scrolls (previously #sidebar scrolled as one unit,
   taking the tab strip along with it). */
#sidebar > .Tabs {
	flex-shrink: 0;
}

#sidebar > .Panels {
	position: static;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
}

	#sidebar .Panel {
		color: #888;
		padding: 10px;
		border-top: 1px solid #ccc;
	}

	#sidebar .Panel.collapsed {
		margin-bottom: 0;
	}

	#sidebar .Row {
		display: flex;
		align-items: center;
		min-height: 24px;
		margin-bottom: 10px;
	}

	#sidebar .Row .Label {

		width: 120px;

	}

#tabs {
	background-color: #ddd;
	border-top: 1px solid #ccc;
}

	#tabs span {
		color: #aaa;
		border-right: 1px solid #ccc;
		padding: 10px;
	}

	#tabs span.selected {
		color: #888;
		background-color: #eee;
	}

#toolbar {
	position: absolute;
	left: calc(50% - var( --sidebar-width ) / 2); /* centered in the viewport area (right dock) */
	transform: translateX(-50%);
	bottom: 6px;
	height: 32px;
	background: #eee;
	text-align: center;
	display: flex;
	align-items: center;
	gap: 2px;
	border-radius: 6px;
	border: 3px solid #eee;
	overflow: hidden;
}

	#toolbar .Button, #toolbar .Input {
		height: 32px;
		border-radius: 4px;
		display: flex;
		align-items: center;
		justify-content: center;
	}

		#toolbar .Button img {
			width: 16px;
			opacity: 0.5;
		}

.Outliner {
	color: #444;
	background-color: #fff;
	padding: 0;
	width: 100%;
	height: 180px;
	font-size: 12px;
	cursor: default;
	overflow: auto;
	resize: vertical;
	outline: none !important;
}

	.Outliner .option {
		padding: 4px;
		color: #666;
		white-space: nowrap;
	}

	.Outliner .option:hover {
		background-color: rgba(0,0,0,0.02);
	}

	.Outliner .option.active {
		background-color: rgba(0,0,0,0.04);
	}


.TabbedPanel .Tabs {
	background-color: #ddd;
	border-top: 1px solid #ccc;
}

	.TabbedPanel .Tab {
		color: #999;
		border-right: 1px solid #ccc;
	}

	.TabbedPanel .Tab.selected {
		color: #08f;
		background-color: rgba( 0, 136, 255, 0.10 );
		border-bottom-color: #08f;
	}

.Listbox {
	color: #444;
	background-color: #fff;
}

.Panel {
	color: #888;
}

/* */

@media all and ( max-width: 600px ) {

	#resizer {
		display: none;
	}

	#animation-resizer {
		display: none;
	}

	#menubar .menu .options {
		max-height: calc(100% - 80px);
	}

	#menubar .menu.right {
		display: none;
	}

	#viewport {
		left: 0;
		right: 0;
		top: 36px;
		height: calc(100% - 356px);
	}

	#script {
		left: 0;
		right: 0;
		top: 36px;
		height: calc(100% - 356px);
	}

	#player {
		left: 0;
		right: 0;
		top: 36px;
		height: calc(100% - 356px);
	}

	#sidebar {
		left: 0;
		width: 100%;
		top: calc(100% - 320px);
		bottom: 0;
	}

	#toolbar {
		left: 50%;
		transform: translateX(-50%);
		bottom: 330px;
	}

	#animation {
		display: none !important;
	}

}

/* DARK MODE — forced for all users (Strata is dark-only). */

@media all {

	.Button {
		color: #aaa;
		background-color: #222;
	}

		.Button:hover {
			color: #ccc;
			background-color: #444;
		}

		.Button.selected {
			color: #fff;
			background-color: #08f;
		}

	.Input, .TextArea {
		background-color: #222;
		border: 1px solid transparent;
		color: #888;
	}

	.Select {
		color: #aaa;
		background-color: #222;
		border-color: #222;
	}

		.Select:hover {
			color: #ccc;
			background-color: #444;
		}

	.ViewportIconButton {
		color: #aaa;
		background-color: #222;
		border-color: #222;
	}

		.ViewportIconButton:hover {
			color: #ccc;
			background-color: #444;
		}

	/* UI */

	#menubar {
		background: #111;
	}

			#menubar .menu:not(.right) + .menu:not(.right) {
				border-left-color: #333;
			}

			#menubar .menu .key {
				color: #444;
				border-color: #444;
			}

			#menubar .menu .options {
				background: #111;
			}

				#menubar .menu .options hr {
					border-color: #222;
				}

				#menubar .menu .options .option {
					color: #888;
				}

			#menubar .menu .options .inactive {
				color: #444;
			}

	#sidebar {
		background-color: #111;
	}

		#sidebar .Panel {
			border-top: 1px solid #222;
		}

		#sidebar .Panel.Material canvas {
			border: solid 1px #5A5A5A;
		}

	#animation {
		background-color: #111;
		border-top: 1px solid #222;
	}

		#animation .Panel {
			border-bottom: 1px solid #222;
		}

		#animation .timeline-container {
			background: rgba(255, 255, 255, 0.05);
		}

	#tabs {
		background-color: #1b1b1b;
		border-top: 1px solid #222;
	}

		#tabs span {
			color: #555;
			border-right: 1px solid #222;
		}

		#tabs span.selected {
			background-color: #111;
		}

	#toolbar {
		background-color: #111;
		border-color: #111;
	}

		#toolbar img {
			filter: invert(1);
		}

	.Outliner {
		background: #222;
	}

		.Outliner .option {
			color: #999;
		}

		.Outliner .option:hover {
			background-color: rgba(21,60,94,0.5);
		}

		.Outliner .option.active {
			background-color: rgba(21,60,94,1);
		}

	.TabbedPanel .Tabs {
		background-color: #1b1b1b;
		border-top: 1px solid #222;
	}

		.TabbedPanel .Tabs::-webkit-scrollbar {
			background: #111;
		}

		.TabbedPanel .Tab {
			color: #555;
			border-right: 1px solid #222;
		}

		.TabbedPanel .Tab.selected {
			color: #888;
			background-color: #111;
		}

	.Listbox {
		color: #888;
		background: #222;
	}

	.Listbox .ListboxItem:hover {
		background-color: rgba(21,60,94,0.5);
	}

	.Listbox .ListboxItem.active {
		background-color: rgba(21,60,94,1);
	}

}

/* Dialog */

.Dialog {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
}

.Dialog-background {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
}

.Dialog-content {
	position: relative;
	background: #eee;
	min-width: 300px;
	max-width: 90%;
	max-height: 90%;
	overflow: auto;
}

.Dialog-title {
	padding: 10px 15px;
	color: #666;
	text-transform: uppercase;
}

.Dialog-body {
	padding: 15px;
}

.Dialog-body .Row {
	display: flex;
	align-items: center;
	min-height: 24px;
	margin-bottom: 10px;
}

.Dialog-body .Row .Label {
	width: 120px;
	color: #888;
}

.Dialog-buttons {
	display: flex;
	justify-content: flex-end;
	margin-top: 15px;
}

.TextureParametersDialog-content {
	min-width: 480px;
}

.TextureParametersDialog-split {
	display: flex;
	gap: 20px;
}

.TextureParametersDialog-preview {
	flex: 0 0 auto;
}

.TextureParametersDialog-preview canvas {
	border: 1px solid #888;
	background: #000;
	display: block;
	max-width: 100%;
	height: auto;
}

.TextureParametersDialog-form {
	flex: 1 1 auto;
	min-width: 0;
}

@media all and ( max-width: 600px ) {

	.TextureParametersDialog-content {
		min-width: 0;
		width: 90vw;
	}

	.TextureParametersDialog-split {
		flex-direction: column;
	}

	.TextureParametersDialog-preview {
		align-self: center;
		max-width: 100%;
	}

}

.TextureParametersDialog-groupHeading {
	margin: 12px 0 6px;
	padding-bottom: 2px;
	border-bottom: 1px solid #ccc;
	font-weight: bold;
	text-transform: uppercase;
	font-size: 11px;
	color: #666;
}

.TextureParametersDialog-groupHeading:first-child {
	margin-top: 0;
}

@media all {

	.TextureParametersDialog-groupHeading {
		border-bottom-color: #444;
		color: #888;
	}

}

.TextureSettingsButton {
	padding: 0 4px;
	line-height: 16px;
}

@media all {

	.Dialog-content {
		background: #111;
	}

	.Dialog-title {
		color: #888;
	}



}

/* Temporary Chrome fix (#24794) */

[draggable="true"] {
	transform: translate(0, 0);
	z-index: 0;
}

/* ===========================================================================
   Strata brand theme
   A cohesive re-skin layered on top of the base editor styles. It rebrands the
   accent from the stock cyan-blue to the Strata blue, cools the app chrome, and
   threads the icon's five-layer "strata" gradient through the UI. Layout and
   behaviour are untouched — colour only.
   =========================================================================== */

/* --- Accent: tabs ------------------------------------------------------- */
.TabbedPanel .Tabs::-webkit-scrollbar-thumb {
	background: var( --accent-25 );
}

.TabbedPanel .Tabs:hover::-webkit-scrollbar-thumb {
	background: var( --accent );
}

.TabbedPanel .Tabs .Tab:hover {
	color: var( --accent );
	background: var( --accent-06 );
}

.TabbedPanel .Tabs .Tab.selected {
	color: var( --accent );
	background: var( --accent-12 );
	border-bottom-color: var( --accent );
}

.TabbedPanel .Tab.selected {
	color: var( --accent );
	background-color: var( --accent-10 );
	border-bottom-color: var( --accent );
}

/* --- Accent: inputs, ranges, resizers ----------------------------------- */
.Input.Number {
	color: var( --accent ) !important;
}

#animation input[type="range"] {
	accent-color: var( --accent );
}

#resizer:hover,
#animation-resizer:hover {
	background-color: var( --accent-50 );
}

#resizer:active,
#animation-resizer:active {
	background-color: var( --accent );
}

body.sidebar-bottom #resizer:hover {
	background: var( --accent-10 );
}

body.sidebar-bottom #resizer:hover::after,
body.sidebar-bottom #resizer:active::after {
	background: var( --accent );
}

/* --- Accent: menubar ---------------------------------------------------- */
#menubar .menu .options .option:hover {
	color: var( --accent-contrast );
	background-color: var( --accent );
}

#menubar .menu .options .option.toggle-on {
	color: var( --accent );
}

/* --- Accent: selections & selected buttons ------------------------------ */
.Button.selected {
	color: var( --accent-contrast );
	background-color: var( --accent );
}

.Outliner .option:hover,
.Listbox .ListboxItem:hover {
	background-color: var( --accent-12 );
}

.Outliner .option.active,
.Listbox .ListboxItem.active {
	background-color: var( --accent-25 );
	color: #ffffff;
}

/* --- Chrome: cooler neutrals -------------------------------------------- */
#menubar,
#sidebar,
#toolbar {
	background: var( --chrome );
}

#tabs,
.TabbedPanel .Tabs {
	background-color: var( --chrome-2 );
}

/* --- Menubar: strata accent + crisp edge -------------------------------- */
#menubar {
	box-shadow: inset 0 -1px 0 var( --chrome-border );
}

#menubar .menu:first-of-type {
	margin-left: 80px;
}

#menubar::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: linear-gradient( 90deg,
		var( --strata-blue ),
		var( --strata-teal ),
		var( --strata-green ),
		var( --strata-orange ),
		var( --strata-red ) );
	opacity: 0.9;
	pointer-events: none;
}

/* --- Toolbar: floating brand pill --------------------------------------- */
#toolbar {
	border-color: var( --chrome );
	box-shadow: 0 2px 12px rgba( 43, 43, 47, 0.16 );
}

/* --- Buttons: subtle brand hover ---------------------------------------- */
.Button {
	border-radius: 4px;
	transition: background-color 0.15s, color 0.15s;
}

.Button:hover {
	color: var( --accent-strong );
}

/* --- Menubar logo ----------------------------------------------------- */
#menubar-logo {
	display: block;
	width: 28px;
	height: 28px;
	margin: 4px 12px 4px 8px;
	pointer-events: auto;
	flex-shrink: 0;
	position: absolute;
    transform: scale(3) translate(8px, 7px);
    overflow: visible;
	z-index: 9999;
}

/* viewport: "hide cameras" button, lit while cameras are hidden */
.ViewportIconButton.selected {
	color: var( --accent-contrast );
	background-color: var( --accent );
	border-color: var( --accent );
}

/* ===========================================================================
   VIEWPORT FRAME GUIDES + LOOK (ViewLook.js)
   Overlay under the viewport controls (pointer-events:none) and the two popovers.
   =========================================================================== */
.vl-overlay {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	display: none;
}

.vl-overlay.vl-on {
	display: block;
}

.vl-stage {
	position: absolute;
	overflow: hidden;
	pointer-events: none;
}

.vl-stage.vl-framed {
	box-shadow: 0 0 0 4000px rgba( 0, 0, 0, 0.92 ); /* the letterbox / pillarbox bars */
}

.vl-glow {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	mix-blend-mode: screen;
	opacity: calc( var( --vl-amount, 0 ) * 0.9 );
	image-rendering: auto;
}

.vl-vignette {
	position: absolute;
	inset: 0;
	background: radial-gradient( ellipse at center, transparent calc( 70% - var( --vl-amount, 0 ) * 30% ), rgba( 0, 0, 0, calc( var( --vl-amount, 0 ) * 0.9 ) ) 100% );
}

.vl-grain {
	position: absolute;
	inset: -64px;
	mix-blend-mode: overlay;
	opacity: calc( var( --vl-amount, 0 ) * 0.7 );
	background-image: url( "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.4 -0.2'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>" );
	background-size: 160px 160px;
	animation: vl-grain-shift 0.5s steps( 5 ) infinite;
}

@keyframes vl-grain-shift {
	0% { transform: translate( 0, 0 ); }
	20% { transform: translate( -23px, 17px ); }
	40% { transform: translate( 31px, -29px ); }
	60% { transform: translate( -41px, -13px ); }
	80% { transform: translate( 19px, 37px ); }
	100% { transform: translate( 0, 0 ); }
}

@media ( prefers-reduced-motion: reduce ) {

	.vl-grain {
		animation: none;
	}

}

.vl-safe {
	position: absolute;
	box-sizing: border-box;
	border: 1px dashed rgba( 255, 255, 255, 0.65 );
	box-shadow: 0 0 0 1px rgba( 0, 0, 0, 0.35 );
}

.vl-safe::after {
	content: attr( data-label );
	position: absolute;
	left: 4px;
	top: 2px;
	font: 9px/1 sans-serif;
	color: rgba( 255, 255, 255, 0.75 );
	text-shadow: 0 0 2px rgba( 0, 0, 0, 0.9 );
}

.vl-safe-title {
	border-color: rgba( 255, 214, 102, 0.8 );
}

.vl-safe-title::after {
	left: auto;
	right: 4px;
	top: auto;
	bottom: 2px;
}

.vl-center {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	background:
		linear-gradient( rgba( 255, 255, 255, 0.7 ), rgba( 255, 255, 255, 0.7 ) ) center / 1px 100% no-repeat,
		linear-gradient( rgba( 255, 255, 255, 0.7 ), rgba( 255, 255, 255, 0.7 ) ) center / 100% 1px no-repeat;
}

.vl-controls {
	display: inline-block;
	vertical-align: top;
	margin-right: 6px;
}

.vl-controls .vl-button {
	margin-right: 6px;
}

.vl-controls .vl-button:last-of-type {
	margin-right: 0;
}

.vl-button:focus-visible,
.vl-reset:focus-visible,
.vl-select:focus-visible {
	outline: 2px solid var( --accent );
	outline-offset: 1px;
}

.vl-panel {
	position: absolute;
	right: 0;
	bottom: 36px;
	width: 250px;
	box-sizing: border-box;
	padding: 8px 10px 10px;
	background: #1b1b1b;
	color: #ccc;
	border: 1px solid #333;
	border-radius: 6px;
	box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.5 );
	font-size: 12px;
	text-align: left;
	z-index: 30;
}

.vl-heading {
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 10px;
	color: #999;
	margin-bottom: 6px;
}

.vl-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 6px 0;
}

.vl-label {
	flex: 0 0 52px;
}

.vl-check {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}

.vl-slider .vl-check {
	flex: 0 0 96px;
}

.vl-slider input[type="range"] {
	flex: 1;
	min-width: 0;
	accent-color: var( --accent );
}

.vl-panel input[type="checkbox"] {
	accent-color: var( --accent );
	margin: 0;
}

.vl-select {
	flex: 1;
	min-width: 0;
	color: inherit;
	background: #222;
	border: 1px solid #444;
	border-radius: 4px;
	padding: 3px 4px;
}

.vl-reset {
	margin-top: 4px;
	padding: 3px 10px;
	color: inherit;
	background: #2a2a2a;
	border: 1px solid #444;
	border-radius: 4px;
	cursor: pointer;
}

.vl-reset:hover {
	background: #333;
}

.vl-note {
	margin: 8px 0 0;
	font-size: 10.5px;
	line-height: 1.4;
	color: #999;
}

/* ===========================================================================
   PLAY BAR: shot chip + auto-fade (PlayBar.js)
   =========================================================================== */
#play-bar {
	transition: opacity 0.4s ease;
}

#play-bar.faded {
	opacity: 0.16;
}

#play-bar .play-bar-shot {
	flex: 0 1 auto;
	max-width: 160px;
	padding: 3px 9px;
	border-radius: 10px;
	background: rgba( 255, 255, 255, 0.12 );
	color: #eee;
	font: 600 11px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#play-bar .play-bar-shot::before {
	content: '\1F3A5\00a0'; /* movie camera */
	font-weight: 400;
}

@media ( prefers-reduced-motion: reduce ) {

	#play-bar {
		transition: none;
	}

}

/* ===========================================================================
   EMPTY-STATE HINTS (EmptyHint.js, Shell first-run examples)
   =========================================================================== */
.empty-hint {
	position: relative;
	margin: 8px 10px;
	padding: 8px 26px 8px 10px;
	box-sizing: border-box;
	border: 1px dashed var( --accent-50 );
	border-radius: 6px;
	background: var( --accent-06 );
	font-size: 11px;
	line-height: 1.45;
	text-align: left;
	white-space: normal;
}

.empty-hint-title {
	font-weight: 600;
	margin-bottom: 2px;
}

.empty-hint-text {
	opacity: 0.8;
}

.empty-hint-close {
	position: absolute;
	top: 2px;
	right: 4px;
	width: 20px;
	height: 20px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.6;
}

.empty-hint-close:hover,
.empty-hint-close:focus-visible {
	opacity: 1;
	background: var( --accent-12 );
	outline: none;
}

.empty-hint-example {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 4px 6px;
	box-sizing: border-box;
	text-align: left;
	color: inherit;
	background: rgba( 0, 0, 0, 0.25 );
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	font: inherit;
}

.empty-hint-example:hover,
.empty-hint-example:focus-visible {
	border-color: var( --accent );
	outline: none;
}

.empty-hint-example.copied {
	border-color: #3aa86a;
}

.empty-hint-example.copied::after {
	content: ' copied';
	color: #3aa86a;
}

.empty-hint-label {
	display: block;
	opacity: 0.6;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.empty-hint-example code {
	display: block;
	font: 10.5px/1.4 ui-monospace, Menlo, Consolas, monospace;
	overflow-wrap: anywhere;
}

.shell-hint-example {
	padding: 0 5px;
	color: #7ec8e3;
	background: #1b1b1b;
	border: 1px solid #333;
	border-radius: 3px;
	font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;
	cursor: pointer;
}

.shell-hint-example:hover,
.shell-hint-example:focus-visible {
	border-color: var( --accent );
	outline: none;
}

/* ===========================================================================
   LIGHT THEME (Settings > Theme > Light; Theme.js sets html[data-theme="light"])
   Auto / Dark change nothing: the dark brand look above is the default. These rules
   sit last and carry one extra attribute + type selector so they beat the dark rules.
   Not restyled on purpose: the Shell terminal, the timeline strip and code editors
   stay dark panels.
   =========================================================================== */
html[data-theme="light"] {
	color-scheme: light;
	--chrome: #f4f4f6;
	--chrome-2: #e6e6ea;
	--chrome-border: #d4d4da;
	--accent-contrast: #ffffff;
}

html[data-theme="light"] body {
	color: #333;
}

html[data-theme="light"] .Button { color: #555; background-color: #e4e4e8; }
html[data-theme="light"] .Button:hover { color: var( --accent-strong ); background-color: #d4d4da; }
html[data-theme="light"] .Button.selected { color: var( --accent-contrast ); background-color: var( --accent ); }

html[data-theme="light"] .Input,
html[data-theme="light"] .TextArea { color: #444; background-color: #fff; border: 1px solid #d0d0d6; }

html[data-theme="light"] .Select { color: #444; background-color: #e4e4e8; border-color: #e4e4e8; }
html[data-theme="light"] .Select:hover { color: #222; background-color: #d4d4da; }

html[data-theme="light"] .ViewportIconButton { color: #555; background-color: #e4e4e8; border-color: #e4e4e8; }
html[data-theme="light"] .ViewportIconButton:hover { color: #222; background-color: #d4d4da; }
html[data-theme="light"] .ViewportIconButton.selected { color: var( --accent-contrast ); background-color: var( --accent ); border-color: var( --accent ); }

html[data-theme="light"] #menubar .menu:not(.right) + .menu:not(.right) { border-left-color: #d4d4da; }
html[data-theme="light"] #menubar .menu .key { color: #888; border-color: #bbb; }
html[data-theme="light"] #menubar .menu .options { background: #fff; box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.15 ); }
html[data-theme="light"] #menubar .menu .options hr { border-color: #e2e2e6; }
html[data-theme="light"] #menubar .menu .options .option { color: #444; }
html[data-theme="light"] #menubar .menu .options .option:hover { color: var( --accent-contrast ); background-color: var( --accent ); }
html[data-theme="light"] #menubar .menu .options .option.toggle-on { color: var( --accent-strong ); }
html[data-theme="light"] #menubar .menu .options .inactive { color: #aaa; }

html[data-theme="light"] #sidebar .Panel { border-top-color: #e0e0e5; }

html[data-theme="light"] #tabs { background-color: var( --chrome-2 ); border-top-color: #d4d4da; }
html[data-theme="light"] #tabs span:not(.selected),
html[data-theme="light"] .TabbedPanel .Tab:not(.selected) { color: #666; border-right-color: #d4d4da; }
html[data-theme="light"] #tabs span.selected { background-color: var( --chrome ); }
html[data-theme="light"] .TabbedPanel .Tabs { border-top-color: #d4d4da; }
html[data-theme="light"] .TabbedPanel .Tabs::-webkit-scrollbar { background: var( --chrome ); }

html[data-theme="light"] #toolbar img { filter: none; }

html[data-theme="light"] .Outliner,
html[data-theme="light"] .Listbox { background: #fff; }
html[data-theme="light"] .Outliner .option:not(.active) { color: #444; }
html[data-theme="light"] .Outliner .option.active,
html[data-theme="light"] .Listbox .ListboxItem.active { color: #2a1050; }
html[data-theme="light"] .Listbox { color: #444; }

html[data-theme="light"] .Dialog-content { background: #fff; }
html[data-theme="light"] .Dialog-title { color: #666; }

html[data-theme="light"] .vl-panel { background: #fff; color: #333; border-color: #d4d4da; box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.18 ); }
html[data-theme="light"] .vl-heading,
html[data-theme="light"] .vl-note { color: #777; }
html[data-theme="light"] .vl-select { background: #f4f4f6; border-color: #ccc; }
html[data-theme="light"] .vl-reset { background: #eee; border-color: #ccc; }
html[data-theme="light"] .empty-hint-example { background: rgba( 0, 0, 0, 0.06 ); }

/* ── X / Y / Z colour cues (AxisColors.js): red / green / blue, as on the viewport gizmo ── */
:root {
	--axis-x: #ff4d4d;
	--axis-y: #5fe35f;
	--axis-z: #4d8dff;
}

html[data-theme="light"] {
	--axis-x: #d82b2b;
	--axis-y: #1f9d3a;
	--axis-z: #2a5ee0;
}

.Input.Number.axis-field {
	border-radius: 2px;
	padding-left: 6px;
}

.Input.Number.axis-x { color: var( --axis-x ) !important; box-shadow: inset 3px 0 0 var( --axis-x ); }
.Input.Number.axis-y { color: var( --axis-y ) !important; box-shadow: inset 3px 0 0 var( --axis-y ); }
.Input.Number.axis-z { color: var( --axis-z ) !important; box-shadow: inset 3px 0 0 var( --axis-z ); }

.Input.Number.axis-field:focus { box-shadow: inset 3px 0 0 currentColor, 0 0 0 1px currentColor; }
