@import url("./layer-palette.css");

/* Display face for prominent headings; compact UI text uses Montserrat. */
@font-face {
  font-family: "Archivo Black";
  src: url("../../fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Lazy Sunday Archivo Black";
  src: url("../../fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

:root{
  --viewport-widget-height:42px;
  --viewport-widget-border:#343a44;
  --font:"Montserrat",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --font-display:"Archivo Black",sans-serif;
  --mono:var(--font);
  --bg:#0b0d12;
  --panel:#101521;
  --panel2:#0f1320;
  --line:rgba(255,255,255,.10);
  --line2:rgba(255,255,255,.06);
  --text:rgba(255,255,255,.88);
  --muted:rgba(255,255,255,.62);
  --accent:rgba(120,180,255,.95);
  --good:rgba(120,255,180,.85);
  --bad:rgba(255,120,160,.85);
  --gold:rgba(255,200,100,.85);
  --project-launcher-width:min(1420px, 96vw);
}
html,body{margin:0;padding:0;width:100%;height:100%;background:var(--bg);color:var(--text);font-family:var(--font);overflow:hidden;}
button,input,select,textarea{font-family:inherit;}
#app{height:100%;display:flex;flex-direction:column;}
#viewportWrap{
  position:relative;
  flex: 0 0 48vh;
  min-height: 280px;
  border-bottom: 1px solid var(--line);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: strict;
  isolation: isolate;
}
#canvasContainer{
  position: relative;
  background: #000;
}
/* Both surfaces receive keyboard focus: the container for selection, and the
   canvas for WASD/pointer lock. Keep the rendered frame free of native focus
   rings in the editor and fullscreen; toolbar controls retain their own rings. */
#canvasContainer,
#webgpuCanvas{
  outline: none;
}
#canvasContainer.scene-catalog-drop-active{
  box-shadow: inset 0 0 0 2px rgba(120,180,255,.58), inset 0 0 58px rgba(65,142,235,.12);
}
.no-camera-viewport-notice{
  position:absolute;
  inset:0;
  z-index:29;
  display:grid;
  place-items:center;
  background:#000;
  color:rgba(255,255,255,.42);
  font-size:13px;
  letter-spacing:.04em;
  pointer-events:auto;
}
.no-camera-viewport-notice[hidden]{display:none;}
.viewport-camera-selector{
  position:absolute;
  left:14px;
  bottom:14px;
  z-index:30;
  display:flex;
  align-items:center;
  gap:8px;
  max-width:calc(100% - 28px);
  box-sizing:border-box;
  padding:5px 9px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:8px;
  background:rgba(15,20,31,.9);
  box-shadow:0 6px 20px rgba(0,0,0,.3);
  backdrop-filter:blur(12px);
  color:var(--muted);
}
.viewport-camera-selector[hidden],body.play-mode .viewport-camera-selector{display:none!important;}
/* Reveal the camera control with the first completed frame, after Preview clears. */
.first-frame-loading:not([hidden]) ~ .viewport-camera-selector{display:none!important;}
.viewport-camera-selector svg{flex-shrink:0;}
.viewport-camera-selector select{
  min-width:0;
  max-width:240px;
  height:26px;
  border:0;
  border-radius:4px;
  background:transparent;
  color:var(--text);
  font-size:11px;
  cursor:pointer;
  text-overflow:ellipsis;
  color-scheme:dark;
}
.viewport-camera-selector select:focus{outline:none;}
.viewport-camera-selector:has(select:focus-visible){
  outline:1px solid rgba(160,185,215,.55);
  outline-offset:1px;
}
.viewport-camera-selector option{background:var(--panel);color:var(--text);}
.scene-catalog-drop-indicator{
  position:absolute;
  z-index:28;
  display:grid;
  grid-template-columns:28px auto;
  grid-template-rows:auto auto;
  column-gap:9px;
  min-width:118px;
  padding:8px 11px 8px 8px;
  border:1px solid rgba(135,196,255,.62);
  border-radius:10px;
  background:rgba(11,17,29,.88);
  box-shadow:0 12px 34px rgba(0,0,0,.45),0 0 30px rgba(83,161,255,.18);
  color:var(--text);
  opacity:0;
  pointer-events:none;
  transform:translate(13px,13px) scale(.96);
  transition:opacity 90ms ease,transform 90ms ease;
  backdrop-filter:blur(12px);
}
.scene-catalog-drop-indicator.is-visible{opacity:1;transform:translate(13px,13px) scale(1);}
.scene-catalog-drop-indicator > span{
  grid-row:1 / 3;
  position:relative;
  width:26px;
  height:26px;
  align-self:center;
  border:1px solid rgba(137,201,255,.9);
  border-radius:50%;
  box-shadow:0 0 0 5px rgba(100,177,255,.1),0 0 18px rgba(100,177,255,.35);
}
.scene-catalog-drop-indicator > span::before,
.scene-catalog-drop-indicator > span::after{
  content:"";
  position:absolute;
  inset:50% 4px auto;
  height:1px;
  background:rgba(158,213,255,.9);
}
.scene-catalog-drop-indicator > span::after{transform:rotate(90deg);}
.scene-catalog-drop-indicator strong{font-size:10px;line-height:1.2;align-self:end;}
.scene-catalog-drop-indicator small{color:var(--muted);font-size:8px;line-height:1.2;align-self:start;}

.settings-fixed-value {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
#canvasContainer.dof-focus-picking,
#canvasContainer.dof-focus-picking canvas{
  cursor: crosshair!important;
}
#canvasContainer.physics-interaction-active,
#canvasContainer.physics-interaction-active canvas{
  cursor:none!important;
}
.physics-interaction-cursor{
  position:absolute;
  left:0;
  top:0;
  z-index:35;
  width:38px;
  height:38px;
  pointer-events:none;
  transform:translate(-50%,-50%);
  filter:drop-shadow(0 3px 10px rgba(0,0,0,.5));
}
.physics-interaction-cursor[hidden]{display:none;}
.physics-interaction-cursor-ring{
  position:absolute;
  inset:3px;
  border:1.5px solid rgba(184,224,255,.98);
  border-radius:50%;
  background:radial-gradient(circle,rgba(150,211,255,.96) 0 2px,rgba(70,154,229,.16) 3px 10px,transparent 11px);
  box-shadow:0 0 0 4px rgba(83,164,235,.13),inset 0 0 12px rgba(105,188,255,.2),0 0 18px rgba(82,172,255,.34);
  transition:transform 100ms ease,border-color 100ms ease,box-shadow 100ms ease;
}
.physics-interaction-cursor-ring::before,
.physics-interaction-cursor-ring::after{
  content:"";
  position:absolute;
  inset:50% -4px auto;
  height:1px;
  background:linear-gradient(90deg,rgba(184,224,255,.85) 0 4px,transparent 4px calc(100% - 4px),rgba(184,224,255,.85) calc(100% - 4px));
}
.physics-interaction-cursor-ring::after{transform:rotate(90deg);}
.physics-interaction-cursor.is-armed .physics-interaction-cursor-ring{
  transform:scale(.9);
  border-color:#fff;
  box-shadow:0 0 0 6px rgba(83,164,235,.17),inset 0 0 12px rgba(155,219,255,.28),0 0 22px rgba(82,172,255,.44);
}
.physics-interaction-cursor.is-grabbing .physics-interaction-cursor-ring{
  transform:scale(.76);
  border-color:#fff;
  background:radial-gradient(circle,#fff 0 3px,rgba(105,188,255,.34) 4px 11px,transparent 12px);
  box-shadow:0 0 0 7px rgba(83,164,235,.18),inset 0 0 12px rgba(155,219,255,.32),0 0 24px rgba(82,172,255,.5);
}
#imageOverlayCanvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}
#webgpuTransitionCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: opacity, transform;
}
#webgpuTransitionCanvas[hidden] {
  display: none;
}
#webgpuTransitionCanvas.is-visible {
  opacity: 1;
}
#editorOverlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 2;
}
.viewport-selection-hud{
  position:absolute;
  left:50%;
  bottom:14px;
  z-index:24;
  transform:translateX(-50%);
  padding:5px 9px;
  border:1px solid rgba(126,200,255,.42);
  border-radius:999px;
  background:rgba(9,15,25,.78);
  color:#cfeaff;
  font-size:10px;
  letter-spacing:.03em;
  pointer-events:none;
  backdrop-filter:blur(8px);
}
.viewport-selection-marquee{
  position:absolute;
  z-index:26;
  border:1px solid rgba(126,200,255,.95);
  background:rgba(80,160,255,.12);
  box-shadow:0 0 0 1px rgba(4,10,18,.55),inset 0 0 18px rgba(80,160,255,.08);
  pointer-events:none;
}
.viewport-selection-marquee[data-direction="intersect"]{
  border-style:dashed;
  background:rgba(79,225,182,.1);
  border-color:rgba(79,225,182,.95);
}
#webgpuCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto;
  z-index: 0;
}
#webgpuCanvas.camera-explore-enabled{
  cursor:crosshair;
}
.camera-explore-hud{
  position:absolute;
  left:50%;
  bottom:16px;
  z-index:35;
  display:flex;
  align-items:center;
  gap:8px;
  max-width:calc(100% - 32px);
  box-sizing:border-box;
  padding:8px 12px;
  border:1px solid rgba(120,180,255,.32);
  border-radius:999px;
  background:rgba(10,15,25,.84);
  box-shadow:0 10px 30px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.05);
  color:rgba(255,255,255,.8);
  font-size:10px;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  pointer-events:none;
  user-select:none;
  transform:translateX(-50%);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  animation:camera-explore-hud-fade .4s ease 2s forwards;
}
.camera-explore-hud[hidden]{display:none!important;}
@keyframes camera-explore-hud-fade{
  from{opacity:1;visibility:visible;}
  to{opacity:0;visibility:hidden;}
}
@media (prefers-reduced-motion:reduce){
  .camera-explore-hud{animation-duration:.01ms;}
}
.camera-explore-hud-dot{
  flex:0 0 auto;
  width:7px;
  height:7px;
  border-radius:50%;
  background:rgba(120,180,255,.85);
  box-shadow:0 0 10px rgba(120,180,255,.55);
}
.camera-explore-hud.is-locked{
  border-color:rgba(112,244,194,.42);
}
.camera-explore-hud.is-temporary{
  border-color:rgba(112,244,194,.55);
  color:rgba(224,255,244,.96);
  box-shadow:0 10px 30px rgba(0,0,0,.4),0 0 24px rgba(80,220,170,.14),inset 0 1px 0 rgba(255,255,255,.07);
}
.camera-explore-hud.is-temporary .camera-explore-hud-dot{
  background:rgba(112,244,194,.98);
  box-shadow:0 0 12px rgba(112,244,194,.78);
}
.camera-explore-hud.is-locked .camera-explore-hud-dot{
  background:rgba(112,244,194,.95);
  box-shadow:0 0 12px rgba(112,244,194,.72);
}
.viewport-fps-meter{
  position:absolute;
  top:14px;
  right:14px;
  z-index:30;
  min-width:112px;
  min-height:44px;
  box-sizing:border-box;
  display:grid;
  grid-template-columns:8px auto;
  grid-template-rows:1fr 1fr;
  align-items:center;
  column-gap:8px;
  padding:7px 11px;
  border:1px solid rgba(112,244,194,.28);
  border-radius:10px;
  background:rgba(10,15,25,.86);
  box-shadow:0 10px 30px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.05);
  color:rgba(255,255,255,.78);
  font-size:9px;
  line-height:1;
  pointer-events:auto;
  cursor:pointer;
  user-select:none;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.viewport-fps-meter[hidden]{display:none!important;}
.viewport-fps-meter strong{
  align-self:end;
  color:rgba(220,255,241,.96);
  font-size:11px;
  letter-spacing:.02em;
}
.viewport-fps-meter [data-frame-ms],
.viewport-fps-meter [data-stall-value]{
  grid-column:2;
  align-self:start;
  color:rgba(255,255,255,.5);
}
.viewport-fps-meter [data-stall-value]{
  color:rgba(255,200,100,.9);
  padding-top:3px;
}
.viewport-fps-meter.has-stall{border-color:rgba(255,200,100,.4);}
.viewport-fps-dot{
  grid-row:1 / 3;
  width:7px;
  height:7px;
  border-radius:50%;
  background:rgba(112,244,194,.95);
  box-shadow:0 0 10px rgba(112,244,194,.62);
}
.viewport-fps-meter.is-warning{border-color:rgba(255,200,100,.34);}
.viewport-fps-meter.is-warning .viewport-fps-dot{
  background:rgba(255,200,100,.96);
  box-shadow:0 0 10px rgba(255,200,100,.58);
}
.viewport-fps-meter.is-slow{border-color:rgba(255,120,160,.4);}
.viewport-fps-meter.is-slow .viewport-fps-dot{
  background:rgba(255,120,160,.96);
  box-shadow:0 0 10px rgba(255,120,160,.62);
}
.viewport-adaptive-resolution{
  position:absolute;
  right:14px;
  bottom:14px;
  z-index:30;
  min-width:204px;
  min-height:48px;
  box-sizing:border-box;
  display:grid;
  grid-template-columns:8px minmax(0,1fr) auto;
  align-items:center;
  gap:9px;
  padding:8px 9px 8px 11px;
  border:1px solid rgba(120,180,255,.34);
  border-radius:11px;
  background:rgba(10,15,25,.88);
  box-shadow:0 10px 30px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.05);
  color:rgba(255,255,255,.74);
  font-size:9px;
  line-height:1.15;
  pointer-events:auto;
  user-select:none;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.viewport-adaptive-resolution[hidden]{display:none!important;}
.viewport-adaptive-copy{
  display:grid;
  gap:4px;
  min-width:0;
}
.viewport-adaptive-copy strong{
  color:rgba(220,238,255,.97);
  font-size:10px;
  letter-spacing:.055em;
  white-space:nowrap;
}
.viewport-adaptive-copy [data-adaptive-status]{color:rgba(112,244,194,.96);}
.viewport-adaptive-copy [data-adaptive-detail]{
  color:rgba(255,255,255,.56);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.viewport-adaptive-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:rgba(112,244,194,.95);
  box-shadow:0 0 10px rgba(112,244,194,.62);
}
.viewport-adaptive-resolution.is-standby{
  border-color:rgba(255,200,100,.34);
}
.viewport-adaptive-resolution.is-standby .viewport-adaptive-dot{
  background:rgba(255,200,100,.96);
  box-shadow:0 0 10px rgba(255,200,100,.58);
}
.viewport-adaptive-resolution.is-standby [data-adaptive-status]{color:rgba(255,200,100,.96);}
.viewport-adaptive-resolution.is-disabled{
  border-color:rgba(255,255,255,.17);
}
.viewport-adaptive-resolution.is-disabled .viewport-adaptive-dot{
  background:rgba(255,255,255,.38);
  box-shadow:none;
}
.viewport-adaptive-resolution.is-disabled [data-adaptive-status]{color:rgba(255,255,255,.52);}
.viewport-adaptive-toggle{
  position:relative;
  width:31px;
  height:18px;
  padding:0;
  border:1px solid rgba(112,244,194,.38);
  border-radius:999px;
  background:rgba(112,244,194,.22);
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease;
}
.viewport-adaptive-toggle span{
  position:absolute;
  top:3px;
  left:16px;
  width:10px;
  height:10px;
  border-radius:50%;
  background:rgba(226,255,244,.98);
  box-shadow:0 1px 5px rgba(0,0,0,.5);
  transition:left .16s ease,background .16s ease;
}
.viewport-adaptive-resolution.is-disabled .viewport-adaptive-toggle{
  border-color:rgba(255,255,255,.2);
  background:rgba(255,255,255,.08);
}
.viewport-adaptive-resolution.is-disabled .viewport-adaptive-toggle span{
  left:3px;
  background:rgba(255,255,255,.58);
}
.viewport-adaptive-toggle:focus-visible{
  outline:2px solid rgba(120,180,255,.9);
  outline-offset:2px;
}
.performance-inspector-overlay{
  position:fixed;
  inset:0;
  z-index:1200;
  display:none;
  place-items:center;
  min-width:0;
  min-height:0;
  box-sizing:border-box;
  padding:16px;
  overflow:hidden;
  background:rgba(3,6,12,.72);
  backdrop-filter:blur(12px);
}
.performance-inspector-overlay.show{display:grid;}
.performance-inspector-panel{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  width:min(1100px,calc(100vw - 32px));
  height:min(820px,calc(100vh - 32px));
  height:min(820px,calc(100dvh - 32px));
  min-width:0;
  min-height:0;
  box-sizing:border-box;
  overflow:hidden;
  border:1px solid rgba(126,180,255,.3);
  border-radius:14px;
  background:#0d131f;
  box-shadow:0 30px 90px rgba(0,0,0,.64);
}
.performance-inspector-panel>header,
.performance-inspector-panel>footer{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  padding:15px 18px;
  border-bottom:1px solid var(--line);
}
.performance-inspector-panel>header{justify-content:space-between;}
.performance-inspector-panel>footer{justify-content:flex-end;border-top:1px solid var(--line);border-bottom:0;}
.performance-inspector-panel>footer>span{margin-right:auto;color:var(--muted);font-size:10px;}
.performance-inspector-panel h2{margin:2px 0 0;font:700 17px/1.2 var(--mono);}
.performance-inspector-kicker{color:var(--accent);font:700 9px/1 var(--mono);letter-spacing:.12em;text-transform:uppercase;}
.performance-inspector-body{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:18px;}
.performance-inspector-summary{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 16px;padding:12px 14px;border:1px solid rgba(112,244,194,.28);border-radius:9px;background:rgba(112,244,194,.07);}
.performance-inspector-summary[data-status="over-budget"]{border-color:rgba(255,120,160,.4);background:rgba(255,120,160,.08);}
.performance-inspector-summary strong{text-transform:capitalize;}.performance-inspector-summary span{color:var(--muted);}
.performance-inspector-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px;}
.performance-inspector-body section{min-width:0;margin-top:14px;padding:13px;border:1px solid var(--line);border-radius:9px;background:rgba(255,255,255,.018);}
.performance-inspector-body h3{margin:0 0 10px;color:#a7ccff;font:700 11px/1.2 var(--mono);text-transform:uppercase;letter-spacing:.06em;}
.performance-inspector-body dl{margin:0}.performance-inspector-body dl>div{display:flex;justify-content:space-between;gap:18px;padding:5px 0;border-bottom:1px solid var(--line2);}
.performance-inspector-body dt{color:var(--muted)}.performance-inspector-body dd{margin:0;font-family:var(--mono);}
.performance-inspector-body p{color:var(--muted);font:11px/1.55 var(--mono);margin:8px 0;}
.performance-inspector-body td{overflow-wrap:anywhere;}
.performance-inspector-body section{overflow-x:auto;}
.performance-inspector-body table{width:100%;border-collapse:collapse;font:10px/1.4 var(--mono);}
.performance-inspector-body th,.performance-inspector-body td{padding:7px 8px;border-bottom:1px solid var(--line2);text-align:right;}
.performance-inspector-body th:first-child,.performance-inspector-body td:first-child{text-align:left;}
.performance-resource-list{display:grid;grid-template-columns:repeat(3,1fr);gap:0 16px;}
@media(max-width:700px){.performance-inspector-grid{grid-template-columns:1fr}.performance-resource-list{grid-template-columns:1fr 1fr}.performance-inspector-panel>footer>span{flex:1 0 100%;}}
body.play-mode .camera-explore-hud,
body.fullscreen-mode .camera-explore-hud:not(.is-temporary){
  display:none!important;
}
body.fullscreen-mode #webgpuCanvas.camera-explore-enabled{
  cursor:crosshair;
}
body.fullscreen-mode .camera-explore-hud.is-temporary{
  bottom:72px;
}
.camera-explore-capture{
  width:100%;
  min-height:58px;
  margin-top:10px;
  padding:9px 10px;
  display:grid;
  grid-template-columns:38px minmax(0,1fr) 28px;
  align-items:center;
  gap:10px;
  color:var(--text);
  background:linear-gradient(135deg,rgba(73,151,229,.13),rgba(24,31,43,.78));
  border:1px solid rgba(100,172,244,.4);
  border-radius:9px;
  text-align:left;
  cursor:pointer;
  transition:border-color .15s ease,background .15s ease,transform .15s ease,opacity .15s ease;
}
.camera-explore-capture:hover:not(:disabled){
  background:linear-gradient(135deg,rgba(73,151,229,.22),rgba(30,40,55,.88));
  border-color:rgba(118,188,255,.72);
  transform:translateY(-1px);
}
.camera-explore-capture:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}
.camera-explore-capture:disabled{
  opacity:.42;
  cursor:not-allowed;
}
.camera-explore-capture img{
  width:36px;
  height:36px;
  object-fit:contain;
}
.camera-explore-capture span:not(.camera-explore-capture-action){
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.camera-explore-capture strong{
  color:#dcecff;
  font:700 12px/1.2 var(--mono);
}
.camera-explore-capture small{
  overflow:hidden;
  color:var(--muted);
  font:500 10px/1.25 var(--font);
  text-overflow:ellipsis;
  white-space:nowrap;
}
.camera-explore-capture-action{
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  color:#9ed2ff;
  background:rgba(79,159,238,.14);
  border:1px solid rgba(105,178,247,.36);
  border-radius:7px;
  font:700 17px/1 var(--mono);
}
.camera-explore-capture.is-recording{
  background:linear-gradient(135deg,rgba(223,65,91,.24),rgba(42,25,34,.9));
  border-color:rgba(255,105,132,.78);
  box-shadow:0 0 0 1px rgba(255,105,132,.12),0 0 18px rgba(208,47,78,.16);
}
.camera-explore-capture.is-recording .camera-explore-capture-action{
  color:#fff0f3;
  background:rgba(224,54,86,.34);
  border-color:rgba(255,122,146,.7);
  animation:first-person-record-pulse 1.1s ease-in-out infinite;
}
@keyframes first-person-record-pulse{
  0%,100%{opacity:.64;transform:scale(.88)}
  50%{opacity:1;transform:scale(1)}
}

.physics-spawn-row{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.physics-spawn-row .physics-go-to-spawn{
  min-height:28px;
  padding-inline:10px;
  white-space:nowrap;
}
.physics-spawn-row .physics-go-to-spawn:disabled,
.physics-spawn-row .physics-go-to-spawn:disabled:hover{
  opacity:.34;
  color:var(--muted);
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.1);
  cursor:default;
  transform:none;
}
.physics-spawn-controls{
  min-width:0;
  margin:0;
  padding:0;
  border:0!important;
  outline:0!important;
  background:transparent;
  transition:opacity .15s ease;
}
.physics-spawn-controls.is-locked{
  opacity:.38;
  pointer-events:none;
}

body.play-mode #editorOverlayCanvas {
  display: none !important;
}
#splitter{
  flex: 0 0 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.0));
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.35);
  cursor: row-resize;
  position: relative;
  user-select: none;
}
#splitter::after{
  content:"";
  position:absolute;
  left:50%; top:50%;
  width: 64px; height: 3px;
  transform: translate(-50%,-50%);
  border-radius:999px;
  background: rgba(255,255,255,0.25);
}
#splitter:hover{ background: rgba(120,180,255,0.10); }
#splitter.dragging{ background: rgba(120,180,255,0.14); }
.object-transform-toolbar,
.viewport-display-toolbar{
  box-sizing:border-box;
  height:var(--viewport-widget-height);
  position:absolute;
  top:14px;
  z-index:30;
  display:flex;
  align-items:center;
  padding:4px;
  gap:4px;
  border:1px solid var(--viewport-widget-border);
  border-radius:10px;
  background:rgba(15,20,31,.9);
  box-shadow:0 10px 30px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  user-select:none;
}
.object-transform-toolbar{
  left:50%;
  transform:translateX(-50%);
}
.object-transform-toolbar[hidden]{display:none!important;}
.object-transform-toolbar.is-locked{
  border-color:rgba(170,176,186,.24);
  background:rgba(24,27,33,.88);
}
.object-transform-toolbar.is-locked::after{
  content:"Physics locked";
  position:absolute;
  top:calc(100% + 6px);
  left:50%;
  transform:translateX(-50%);
  padding:3px 7px;
  border:1px solid rgba(170,176,186,.2);
  border-radius:999px;
  background:rgba(13,16,21,.82);
  color:rgba(205,210,218,.68);
  font-size:8px;
  white-space:nowrap;
  pointer-events:none;
}
.viewport-display-toolbar{
  left:14px;
}
.viewport-display-toolbar[hidden]{display:none!important;}
.viewport-tool-button{
  box-sizing:border-box;
  width:36px;
  min-width:36px;
  height:32px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid transparent;
  border-radius:7px;
  background:transparent;
  color:rgba(255,255,255,.66);
  font:inherit;
  font-size:10px;
  cursor:pointer;
  transition:background .12s ease,border-color .12s ease,color .12s ease;
}
.viewport-tool-button svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.viewport-display-toolbar .btn-small{
  border-color:transparent;
  background:transparent;
}
.viewport-tool-button:hover{
  color:rgba(255,255,255,.94);
  border-color:rgba(255,255,255,.12);
  background:rgba(255,255,255,.07);
}
.viewport-display-toolbar .btn-small.is-active,
.viewport-display-toolbar .btn-small[aria-pressed="true"],
.object-transform-tool.active{
  color:#fff;
  border-color:rgba(120,180,255,.42);
  background:linear-gradient(180deg,rgba(120,180,255,.24),rgba(120,180,255,.12));
}
.object-transform-tool{
  appearance:none;
}
.object-transform-tool:disabled{
  color:rgba(255,255,255,.2);
  background:transparent;
  cursor:not-allowed;
  opacity:.52;
}
.object-transform-tool:disabled:hover{background:transparent;color:rgba(255,255,255,.2);}
.object-transform-tool svg{
  width:16px;
  height:16px;
}
body.play-mode #objectTransformToolbar,
body.play-mode #viewportDisplayToolbar{
  display:none!important;
}
/* Top navigation bar */
#topNav{
  --top-nav-control-height: 40px;
  --top-nav-control-radius: 10px;
  display:flex;
  align-items:center;
  height: 52px;
  padding: 0 16px;
  box-sizing: border-box;
  background: linear-gradient(rgba(255,255,255,.03), rgba(255,255,255,.03)), rgba(16,21,33,1);
  border-bottom:1px solid var(--line);
  user-select:none;
  flex-shrink: 0;
}
#topNav .nav-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
#topNav .brand-icon{
  height: 24px;
  width: auto;
}
#topNav .brand-title{
  font-family:var(--font-brand);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1;
  white-space: nowrap;
  text-transform: lowercase;
  color: #fff;
}
#topNav button.brand-title{
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  cursor: pointer;
  transition: opacity .15s ease;
}
#topNav button.brand-title:hover{
  opacity: .78;
}
#topNav button.brand-title:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
#topNav .nav-divider{
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 16px;
  flex-shrink: 0;
}
#topNav .nav-center{
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}
.nav-btn-solo{
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  transition: background 0.15s, color 0.15s;
}
.nav-btn-solo:hover{
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.share-menu-item:disabled{
  opacity: .5;
  cursor: wait;
}
#btnSaveSnapshot{
  display: flex;
  align-items: center;
}
.share-menu-shortcut{
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(0,0,0,.18);
  font-size: 9px;
  line-height: 1.2;
}
#topNav .nav-right{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
/* Nav button group (similar to mode-toggle) */
.nav-btn-group{
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.nav-btn{
  padding: 6px 12px;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
}
.nav-btn:last-child{
  border-right: none;
}
.nav-btn:hover{
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.nav-btn.user-menu-btn{
  border-right: none;
}
/* User menu adjustments */
#topNav .user-menu{
  position: relative;
}
#topNav .user-menu-dropdown{
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 120px;
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
#topNav .user-menu.open .user-menu-dropdown{
  display: block;
}
/* Project name input */
#demoNameInput{
  width: 202px;
  height: var(--top-nav-control-height);
  box-sizing: border-box;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--top-nav-control-radius);
  padding: 5px 10px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: text;
  transition: background .15s, border-color .15s;
}
#demoNameInput:hover{
  border-color: var(--line);
  background: rgba(255,255,255,.05);
}
#demoNameInput:focus{
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,.08);
}
/* Save status indicator */
#saveStatus{
  font-size: 12px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
}
#saveStatus.saving{
  color: var(--gold);
  animation: spin 1s linear infinite;
}
#saveStatus.saved{
  color: var(--good);
}
#saveStatus.error{
  color: var(--bad);
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* User menu */
.user-menu{
  position: relative;
}
.user-menu-btn{
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  box-sizing: border-box;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}
#topNav .user-menu-btn{
  height: var(--top-nav-control-height);
  min-height: var(--top-nav-control-height);
  border-radius: var(--top-nav-control-radius);
}
.user-menu-btn:hover{ background: rgba(255,255,255,.10); color: var(--text); }
.user-menu-dropdown{
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 150px;
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.user-menu.open .user-menu-dropdown{ display: block; }
.user-menu-item{
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}
.user-menu-item:hover{ background: rgba(255,255,255,.08); }
.user-menu-item:first-child{ border-radius: 7px 7px 0 0; }
.user-menu-item:last-child{ border-radius: 0 0 7px 7px; }
.user-menu-divider{
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.user-menu-section-label{
  padding: 8px 14px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  opacity: 0.7;
}
.user-menu-item .icon{
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  margin-right: 4px;
  vertical-align: middle;
}
.user-menu-item .icon img,
.entity-icon-inline {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
  vertical-align: middle;
}

/* Project and account menu */
#topNav #userMenu .account-menu-trigger {
  min-height: var(--top-nav-control-height);
  gap: 8px;
  padding: 6px 11px 6px 7px;
  border-radius: 10px;
  color: var(--text);
}
.account-menu-trigger-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(126, 184, 235, .25);
  border-radius: 7px;
  color: #a8d2f7;
  background: rgba(75, 145, 205, .12);
}
.account-menu-trigger-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-menu-caret {
  width: 13px;
  height: 13px;
  fill: currentColor;
  opacity: .7;
  transition: transform .16s ease;
}
#userMenu.open .account-menu-caret { transform: rotate(180deg); }
#topNav #userMenu .account-menu-dropdown {
  width: 244px;
  min-width: 244px;
  padding: 8px;
  border-color: rgba(127, 177, 221, .22);
  border-radius: 12px;
  background: rgba(15, 22, 34, .98);
  box-shadow: 0 18px 52px rgba(0, 0, 0, .55), 0 0 0 1px rgba(8, 13, 22, .55);
}
#userMenu .account-menu-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 9px;
  border-radius: 8px;
  color: #e4eaf2;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color .14s ease, background .14s ease, transform .14s ease;
}
#userMenu .account-menu-item:hover {
  color: #fff;
  background: rgba(112, 169, 219, .11);
  transform: translateX(1px);
}
#userMenu .account-menu-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(120, 178, 228, .18);
  border-radius: 8px;
  color: #9dcaef;
  background: rgba(72, 137, 193, .1);
}
#userMenu .account-menu-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#userMenu .account-menu-item-new .account-menu-icon {
  color: #b9ddff;
  background: rgba(80, 155, 220, .16);
}
#userMenu .account-menu-item-ai .account-menu-icon {
  color: #ceb9ff;
  border-color: rgba(174, 139, 255, .2);
  background: rgba(142, 104, 221, .12);
}
#userMenu .account-menu-arrow,
#userMenu .account-menu-external {
  width: 15px;
  height: 15px;
  justify-self: end;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .55;
}
#userMenu .account-menu-divider {
  margin: 7px 2px;
  background: rgba(125, 164, 200, .17);
}
#userMenu .account-menu-item-logout {
  color: #b8c0cb;
}
#userMenu .account-menu-item-logout .account-menu-icon {
  color: #aab4c1;
  border-color: rgba(170, 180, 193, .14);
  background: rgba(155, 166, 180, .07);
}
#userMenu .account-menu-item-logout:hover {
  color: #ffd7d7;
  background: rgba(255, 104, 104, .09);
}
#userMenu .account-menu-item-logout:hover .account-menu-icon {
  color: #ffaaaa;
  border-color: rgba(255, 122, 122, .2);
  background: rgba(255, 104, 104, .08);
}
/* Auth loading overlay */
#authLoading{
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-size: 1.2rem;
  color: var(--muted);
}
#authLoading.hidden{ display: none; }

/* Demo Management Modals */
.demo-modal-overlay{
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  padding: 16px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}
.demo-modal-overlay.show{
  opacity: 1;
  visibility: visible;
}
.demo-modal{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 400px;
  max-width: 500px;
  max-height: min(80vh, calc(100dvh - 32px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.2s;
}
.demo-modal-overlay.show .demo-modal{
  transform: scale(1);
}
.demo-modal-header{
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}
.demo-modal-header h2{
  font-family: var(--font-display);
  font-synthesis-weight: none;
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0;
}
.demo-modal-close{
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1.2rem;
  line-height: 1;
}
.demo-modal-close:hover{ color: var(--text); }
.demo-modal-body{
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
}
.demo-modal-footer{
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}
.save-snapshot-modal{
  width: min(520px, calc(100vw - 32px));
  min-width: 0;
  max-width: 520px;
  margin: 0;
  border-color: rgba(117, 171, 235, .25);
  background: linear-gradient(145deg, rgba(20, 27, 40, .99), rgba(9, 13, 21, .99));
}
.save-snapshot-body{
  display: grid;
  gap: 18px;
}
.save-snapshot-preview{
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(130, 176, 229, .2);
  border-radius: 9px;
  background: radial-gradient(circle at 50% 38%, rgba(61, 119, 181, .24), transparent 38%), #070b12;
}
.save-snapshot-preview img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05070b;
}
.save-snapshot-preview img[hidden],
.save-snapshot-preview-loading[hidden]{ display: none; }
.save-snapshot-preview-loading{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
}
.save-snapshot-preview-loading > span{
  width: 18px;
  height: 18px;
  border: 2px solid rgba(117, 183, 255, .16);
  border-top-color: #78baff;
  border-radius: 50%;
  animation: project-browser-spin .7s linear infinite;
}
.save-snapshot-name-field{
  margin: 0;
}
.save-snapshot-name-field label{
  color: var(--text);
  font-weight: 600;
}
.save-snapshot-status{
  min-height: 15px;
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 9px;
}
.save-snapshot-status[hidden]{ display: none; }
.save-snapshot-status[data-kind="error"]{ color: var(--bad); }
.save-snapshot-footer{
  align-items: center;
}
.save-snapshot-footer .btn{
  min-width: 112px;
  border-radius: 7px;
}
.demo-modal-close:disabled{
  opacity: .35;
  cursor: wait;
}

/* Chunk explosion-machine selector */
.chunk-exploder-modal { width: min(760px, calc(100vw - 32px)); max-width: 760px; }
.chunk-exploder-eyebrow { display:block; margin-bottom:3px; color:var(--accent); font-size:9px; font-weight:800; letter-spacing:.16em; }
.chunk-exploder-search { display:flex; align-items:center; gap:10px; margin:16px 20px 8px; padding:0 12px; min-height:44px; border:1px solid var(--line); border-radius:8px; background:rgba(2,7,14,.65); }
.chunk-exploder-search:focus-within { border-color:var(--accent); box-shadow:0 0 0 2px rgba(103,174,255,.12); }
.chunk-exploder-search > span { color:var(--muted); font-size:22px; }
.chunk-exploder-search input { flex:1; min-width:0; border:0; outline:0; background:transparent; color:var(--text); font:inherit; }
.chunk-exploder-search button { border:0; background:transparent; color:var(--muted); cursor:pointer; font-size:18px; }
.chunk-exploder-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:8px 20px 20px; overflow:auto; }
.chunk-exploder-card { position:relative; display:grid; grid-template-columns:72px 1fr auto; align-items:center; gap:12px; min-height:92px; padding:10px; border:1px solid var(--line); border-radius:9px; background:rgba(8,14,25,.66); color:var(--text); text-align:left; cursor:pointer; }
.chunk-exploder-card:hover { border-color:rgba(125,184,255,.55); background:rgba(25,45,70,.46); }
.chunk-exploder-card.is-selected { border-color:var(--accent); background:linear-gradient(110deg,rgba(45,105,165,.34),rgba(11,20,34,.8)); box-shadow:inset 3px 0 0 var(--exploder-accent,var(--accent)); }
.chunk-exploder-preview { position:relative; display:block; width:70px; height:70px; overflow:hidden; border:1px solid rgba(130,180,230,.18); border-radius:8px; background:radial-gradient(circle, color-mix(in srgb,var(--exploder-accent) 28%,transparent) 0 8%,rgba(4,9,17,.95) 54%); }
.chunk-exploder-preview::before { content:""; position:absolute; left:31px; top:31px; width:8px; height:8px; border-radius:2px; background:var(--exploder-accent); box-shadow:0 0 13px var(--exploder-accent); }
.chunk-exploder-preview i { position:absolute; left:33px; top:33px; width:5px; height:5px; border-radius:1px; background:var(--exploder-accent); opacity:.82; transform:rotate(calc(var(--i)*58deg)) translateX(calc(14px + var(--i)*2px)) rotate(calc(var(--i)*-42deg)); animation:chunk-exploder-piece 1.8s cubic-bezier(.2,.72,.25,1) infinite; animation-delay:calc(var(--i)*-90ms); }
.chunk-exploder-preview i:nth-child(1){--i:1}.chunk-exploder-preview i:nth-child(2){--i:2}.chunk-exploder-preview i:nth-child(3){--i:3}.chunk-exploder-preview i:nth-child(4){--i:4}.chunk-exploder-preview i:nth-child(5){--i:5}.chunk-exploder-preview i:nth-child(6){--i:6}
@keyframes chunk-exploder-piece {
  0%,16% { opacity:.18; transform:rotate(calc(var(--i)*58deg)) translateX(3px) scale(.65); }
  55% { opacity:.94; }
  82%,100% { opacity:0; transform:rotate(calc(var(--i)*58deg + 22deg)) translateX(calc(22px + var(--i)*3px)) rotate(calc(var(--i)*-42deg)) scale(.9); }
}
@media (prefers-reduced-motion:reduce){.chunk-exploder-preview i{animation:none}}
.chunk-exploder-copy { min-width:0; }
.chunk-exploder-copy strong,.chunk-exploder-copy small { display:block; }
.chunk-exploder-copy strong { margin-bottom:5px; font-size:14px; }
.chunk-exploder-copy small { color:var(--muted); font-size:11px; line-height:1.35; }
.chunk-exploder-speed { align-self:start; padding:3px 5px; border-radius:4px; background:rgba(0,0,0,.25); color:var(--muted); font-size:9px; }
.chunk-exploder-footer { align-items:center; }
.chunk-exploder-footer > span { margin-right:auto; color:var(--muted); font-size:10px; }
.chunk-exploder-footer kbd { padding:2px 5px; border:1px solid var(--line); border-radius:4px; background:rgba(0,0,0,.25); }
.chunk-exploder-picker { display:grid; grid-template-columns:9px 1fr auto; align-items:center; gap:8px; width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:7px; background:rgba(7,13,23,.72); color:var(--text); cursor:pointer; text-align:left; }
.chunk-exploder-picker:hover { border-color:var(--accent); }
.chunk-exploder-picker > span { width:8px; height:26px; border-radius:4px; background:var(--exploder-accent); box-shadow:0 0 12px color-mix(in srgb,var(--exploder-accent) 55%,transparent); }
.chunk-exploder-picker small { color:var(--accent); }
.chunk-trigger-control { display:grid; grid-template-columns:minmax(72px,1fr) auto; gap:6px; }
.chunk-trigger-control button { padding:0 10px; border:1px solid rgba(105,175,255,.4); border-radius:6px; background:rgba(40,100,165,.16); color:var(--accent); cursor:pointer; white-space:nowrap; }
@media (max-width:700px){.chunk-exploder-grid{grid-template-columns:1fr}.chunk-exploder-footer>span{display:none}}

/* Shader and post-effect source editor — Sublime Text / Monokai palette. */
.shader-source-editor-overlay { z-index: 2300; padding: 24px; }
.shader-source-editor-modal {
  width: min(1180px, calc(100vw - 48px));
  max-width: none;
  height: min(820px, calc(100dvh - 48px));
  max-height: none;
  min-width: 0;
  border-color: rgba(132, 185, 236, .28);
  background: #171a20;
}
.shader-source-editor-header { min-height: 78px; gap: 20px; }
.shader-source-editor-heading { display: grid; min-width: 0; gap: 3px; }
.shader-source-editor-heading h2 {
  overflow: hidden;
  color: #f4f5f2;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shader-source-editor-kind {
  color: #66d9ef;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.shader-source-editor-path {
  overflow: hidden;
  color: #82847d;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shader-source-editor-header-actions { display: flex; align-items: center; gap: 12px; }
.shader-source-editor-access {
  padding: 5px 8px;
  border: 1px solid rgba(230, 219, 116, .24);
  border-radius: 5px;
  color: #e6db74;
  background: rgba(230, 219, 116, .07);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.shader-source-editor-access.can-edit {
  border-color: rgba(166, 226, 46, .24);
  color: #a6e22e;
  background: rgba(166, 226, 46, .07);
}
.shader-source-editor-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 0;
  background: #272822;
}
.shader-source-editor-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #75715e;
  font-size: 12px;
}
.shader-source-editor-loading[hidden] { display: none; }
.shader-source-editor-workspace {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
.shader-source-editor-workspace[hidden] { display: none; }
.shader-source-line-numbers,
.shader-source-highlight,
.shader-source-input {
  box-sizing: border-box;
  margin: 0;
  border: 0;
  font: 12px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  tab-size: 2;
  white-space: pre;
}
.shader-source-line-numbers {
  height: 100%;
  padding: 18px 13px 34px 0;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.055);
  color: #60615c;
  background: #23241f;
  text-align: right;
  user-select: none;
}
.shader-source-code-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.shader-source-highlight,
.shader-source-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 18px 22px 34px;
  overflow: auto;
}
.shader-source-highlight {
  pointer-events: none;
  color: #f8f8f2;
  background: transparent;
}
.shader-source-input {
  z-index: 1;
  resize: none;
  outline: 0;
  color: transparent;
  caret-color: #f8f8f2;
  -webkit-text-fill-color: transparent;
  background: transparent;
  overscroll-behavior: contain;
}
.shader-source-input::selection { background: rgba(73, 151, 217, .42); }
.shader-source-input[readonly] { cursor: text; }
.shader-token-comment { color: #75715e; font-style: italic; }
.shader-token-meta,
.shader-token-number { color: #ae81ff; }
.shader-token-string { color: #e6db74; }
.shader-token-keyword { color: #f92672; }
.shader-token-type,
.shader-token-builtin { color: #66d9ef; font-style: italic; }
.shader-token-function { color: #a6e22e; }
.shader-token-operator { color: #f92672; }
.shader-source-editor-footer {
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 10px;
  background: #171a20;
}
.shader-source-editor-feedback {
  display: flex;
  min-width: 0;
  gap: 14px;
  color: #82847d;
  font-size: 10px;
}
#shaderSourceEditorStatus.is-error { color: #f92672; }
#shaderSourceEditorStatus.is-saved { color: #a6e22e; }
#shaderSourceEditorSave[hidden] { display: none; }
.asset-action-btn.source {
  width: auto;
  min-width: 31px;
  padding: 0 5px;
  color: #66d9ef;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: -.04em;
}
.asset-action-btn.source:hover { background: rgba(102, 217, 239, .13); color: #b8f4ff; }

@media (max-width: 760px) {
  .shader-source-editor-overlay { padding: 8px; }
  .shader-source-editor-modal { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
  .shader-source-editor-header { min-height: 66px; padding: 12px 14px; }
  .shader-source-editor-path { display: none; }
  .shader-source-editor-workspace { grid-template-columns: 44px minmax(0, 1fr); }
  .shader-source-line-numbers { padding-right: 9px; }
  .shader-source-highlight, .shader-source-input { padding-left: 14px; }
}

/* AI workspace and provider connections */
.nav-ai-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  white-space:nowrap;
}
.nav-ai-status-light{
  width:7px;
  height:7px;
  flex:0 0 7px;
  border-radius:50%;
  background:#555b65;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
}
.nav-ai-button.is-connected .nav-ai-status-light{
  background:#86dfac;
  box-shadow:0 0 7px rgba(134,223,172,.45);
}
.ai-dialog-kicker{
  margin-bottom:3px;
  color:var(--accent);
  font-size:10px;
  font-weight:700;
  letter-spacing:.13em;
}
.ai-connections-dialog{ width:min(720px,calc(100vw - 32px)); min-width:0; max-width:720px; font-size:12px; line-height:1.5; }
.ai-connections-dialog .btn{ font-size:11px; white-space:nowrap; }
.ai-connections-dialog [hidden]{ display:none; }
.ai-connections-dialog :is(button,a,summary,textarea):focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }
.ai-connections-section-title{ margin:0 0 5px; font-size:13px; font-weight:600; }
.ai-connections-intro{
  margin:0 0 14px;
  color:var(--muted);
  font-size:12px;
  line-height:1.55;
}
.ai-connections-banner{
  margin:-4px 0 14px;
  padding:10px 12px;
  color:#f2ce88;
  border:1px solid rgba(226,168,70,.28);
  border-radius:8px;
  background:rgba(118,76,20,.16);
  font-size:10px;
  line-height:1.45;
}
.ai-connections-banner[hidden]{ display:none; }
.ai-provider-cards{ display:grid; border:1px solid var(--line); border-radius:9px; overflow:hidden; }
.ai-provider-card{
  display:grid;
  grid-template-columns:145px minmax(0,1fr) 96px;
  align-items:center;
  gap:12px;
  padding:14px;
  background:rgba(5,9,16,.42);
}
.ai-provider-card + .ai-provider-card{ border-top:1px solid var(--line); }
.ai-provider-card > div{ min-width:0; }
.ai-provider-name{ font-size:13px; font-weight:650; }
.ai-provider-model{ margin-top:3px; color:var(--muted); font-size:10px; overflow-wrap:anywhere; }
.ai-provider-status{ display:flex; align-items:center; gap:7px; margin-top:7px; color:var(--muted); font-size:10px; }
.ai-provider-status::before{ content:""; width:6px; height:6px; flex:0 0 6px; border-radius:50%; background:#59606c; }
.ai-provider-card.connected .ai-provider-status{ color:#82d7ae; }
.ai-provider-card.connected .ai-provider-status::before{ background:#55d497; }
.ai-provider-credential{ min-width:0; }
.ai-provider-key-row{ display:flex; min-width:0; }
.ai-provider-key{
  min-width:0;
  width:100%;
  box-sizing:border-box;
  padding:9px 11px;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:7px;
  outline:none;
  background:#090d14;
  font:inherit;
}
.ai-provider-key-row .ai-provider-key{ border-radius:7px 0 0 7px; }
.ai-provider-key:focus{ position:relative; z-index:1; border-color:var(--accent); box-shadow:0 0 0 2px rgba(111,180,255,.12); }
.ai-provider-reveal{
  flex:0 0 56px;
  margin-left:-1px;
  padding:0 9px;
  color:#9eabbc;
  border:1px solid var(--line);
  border-radius:0 7px 7px 0;
  background:#111824;
  font:inherit;
  font-size:9px;
  cursor:pointer;
}
.ai-provider-reveal:hover{ color:#dceaff; border-color:rgba(111,180,255,.45); }
.ai-provider-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; min-height:18px; margin-top:5px; }
.ai-provider-help{ color:#83bfff; font-size:9px; text-decoration:none; }
.ai-provider-help:hover{ color:#b9dcff; text-decoration:underline; }
.ai-provider-feedback{ min-width:0; color:var(--muted); font-size:10px; overflow-wrap:anywhere; }
.ai-provider-feedback.error{ color:#ff9c9c; }
.ai-provider-feedback.success{ color:#82d7ae; }
.ai-provider-actions{ display:flex; flex-direction:column; align-self:start; gap:6px; }
.ai-connections-note{ margin:10px 0 0; color:var(--muted); font-size:10px; }
.ai-agent-access{ margin-top:24px; padding-top:20px; border-top:1px solid var(--line); }
.ai-agent-access-row{ display:flex; align-items:center; justify-content:space-between; gap:16px; }
#localAgentStatus{ margin:0; color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
.ai-agent-access[data-connection-state="connected"] #localAgentStatus,
.ai-agent-access[data-connection-state="saved"] #localAgentStatus{ color:#82d7ae; }
.ai-agent-access-actions{ flex-shrink:0; }
.ai-agent-setup{ margin-top:16px; color:var(--muted); font-size:11px; }
.ai-agent-setup summary{ width:fit-content; cursor:pointer; }
.ai-agent-setup summary:hover{ color:var(--text); }
.ai-agent-setup p{ margin:12px 0; }
.ai-agent-setup a{ color:var(--accent); }
.ai-agent-setup label{ display:block; margin-top:14px; color:var(--text); }
#localAgentConfig{ display:block; width:100%; box-sizing:border-box; margin:8px 0 12px; padding:10px; resize:vertical; border:1px solid var(--line); border-radius:7px; background:#090d14; color:var(--text); font:inherit; }
.ai-agent-guide{ margin-top:14px; }
.ai-agent-guide iframe{ display:block; width:100%; height:420px; box-sizing:border-box; border:1px solid var(--line); border-radius:7px; }
.ai-workspace-dialog{
  width:min(920px,calc(100vw - 32px));
  max-width:920px;
  height:min(760px,calc(100dvh - 32px));
  max-height:760px;
}
.ai-workspace-header-actions{ display:flex; align-items:center; gap:8px; }
.ai-workspace-header-actions select{
  min-width:150px;
  padding:7px 28px 7px 10px;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel2);
}
.ai-workspace-body{ display:flex; flex-direction:column; gap:12px; padding:0; background:#080c12; }
.ai-workspace-messages{ flex:1; overflow-y:auto; padding:22px; display:flex; flex-direction:column; gap:10px; }
.ai-message{ max-width:82%; padding:11px 13px; border-radius:10px; font-size:12px; line-height:1.55; white-space:pre-wrap; }
.ai-message-user{ align-self:flex-end; color:#eef6ff; background:#204b78; border-bottom-right-radius:3px; }
.ai-message-agent{ align-self:flex-start; background:#151c27; border:1px solid #27364a; border-bottom-left-radius:3px; }
.ai-message-system{ align-self:center; max-width:660px; color:var(--muted); text-align:center; background:transparent; }
.ai-message-error{ align-self:center; color:#ffc0c0; background:rgba(140,40,40,.18); border:1px solid rgba(255,102,102,.25); }
.ai-activity-panel{ flex:0 0 auto; border-top:1px solid var(--line); background:#0c1119; }
.ai-activity-panel summary{ cursor:pointer; padding:10px 18px; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.09em; }
.ai-activity-panel summary span{ display:inline-grid; place-items:center; min-width:18px; height:18px; margin-left:5px; border-radius:9px; background:#1b2a3d; color:#9ccaff; }
.ai-activity-log{ max-height:130px; overflow:auto; padding:0 18px 12px; color:#aab4c3; font-size:10px; line-height:1.55; }
.ai-activity-item{ padding:5px 0; border-top:1px solid rgba(255,255,255,.04); }
.ai-prompt-composer{ display:grid; grid-template-columns:1fr auto; gap:10px; padding:14px; border-top:1px solid var(--line); background:var(--panel); }
.ai-prompt-composer textarea{ min-height:68px; max-height:180px; resize:vertical; box-sizing:border-box; padding:11px 12px; color:var(--text); border:1px solid var(--line); border-radius:9px; outline:none; background:#090d14; font:inherit; line-height:1.45; }
.ai-prompt-composer textarea:focus{ border-color:var(--accent); box-shadow:0 0 0 2px rgba(111,180,255,.12); }
.ai-prompt-send{ min-width:86px; align-self:stretch; }
.ai-prompt-send[disabled]{ opacity:.48; cursor:wait; }
@media (max-width:720px){
  .ai-provider-card{ grid-template-columns:minmax(0,1fr) auto; }
  .ai-provider-credential{ grid-column:1 / -1; grid-row:2; }
  .ai-provider-actions{ grid-column:2; grid-row:1; }
  .ai-agent-access-row{ align-items:flex-start; }
  .ai-workspace-header-actions select{ min-width:110px; }
  .ai-workspace-header-actions .btn{ display:none; }
}
/* Add Object Modal Buttons */
.add-object-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}
.add-object-btn:hover {
  background: rgba(120,180,255,0.1);
  border-color: rgba(120,180,255,0.4);
  transform: translateY(-2px);
}
.add-object-btn:active {
  transform: translateY(0);
}
.add-obj-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
}
.add-obj-icon img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}
.add-obj-label {
  font-size: 11px;
  color: var(--muted);
}
.add-object-btn:hover .add-obj-label {
  color: var(--text);
}
.add-scene-section {
  margin-bottom: 20px;
}
.add-scene-section-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.add-object-btn.add-text3d-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 26px;
  width: 100%;
  padding: 12px 14px;
  border-color: rgba(132, 172, 255, 0.26);
  background: linear-gradient(135deg, rgba(71, 126, 211, 0.16), rgba(128, 83, 195, 0.09));
  text-align: left;
}
.add-object-btn.add-text3d-card:hover {
  border-color: rgba(142, 195, 255, 0.72);
  background: linear-gradient(135deg, rgba(71, 137, 226, 0.24), rgba(139, 85, 210, 0.15));
}
.add-text3d-icon {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(137, 191, 255, 0.36);
  border-radius: 10px;
  background: rgba(5, 12, 24, 0.56);
  color: #9dc8ff;
}
.add-text3d-icon svg {
  width: 38px;
  height: 38px;
}
.add-text3d-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.add-text3d-copy strong {
  color: #edf5ff;
  font-size: 13px;
}
.add-text3d-copy small {
  color: rgba(218, 230, 246, 0.52);
  font-size: 10px;
}
.add-text3d-arrow {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(144, 193, 255, 0.3);
  border-radius: 50%;
  color: #9dc8ff;
  font-size: 16px;
}
.scene-text-intro {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(120, 180, 255, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(74, 130, 207, 0.11), rgba(124, 79, 184, 0.06));
}
.scene-text-intro-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(132, 188, 255, 0.28);
  border-radius: 7px;
  background: rgba(5, 12, 23, 0.48);
  color: #9dc8ff;
  font-size: 20px;
  font-weight: 800;
  text-shadow: 2px 2px 0 rgba(137, 92, 216, 0.42);
}
.scene-text-intro strong,
.scene-text-intro small {
  display: block;
}
.scene-text-intro strong {
  margin-bottom: 2px;
  color: var(--text);
  font-size: 11px;
}
.scene-text-intro small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.scene-text-input {
  width: 100%;
  min-height: 58px;
  box-sizing: border-box;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: rgba(0, 0, 0, 0.26);
  color: var(--text);
  font: 650 13px/1.35 inherit;
}
.scene-text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.1);
}
.scene-text-bevel-controls {
  transition: opacity 0.15s;
}
.scene-text-bevel-controls.is-disabled {
  opacity: 0.38;
}
.add-scene-systems-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.add-object-btn.add-system-card {
  min-height: 74px;
  flex-direction: row;
  justify-content: flex-start;
  padding: 12px 14px;
  text-align: left;
  background: linear-gradient(135deg, rgba(81, 149, 255, 0.11), rgba(133, 92, 255, 0.07));
}
.add-system-card .add-obj-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(112, 181, 255, 0.35);
  border-radius: 10px;
  color: #86c7ff;
  background: rgba(70, 130, 220, 0.12);
}
.track-type-icon {
  display: block;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(139, 199, 255, .2);
  border-radius: 9px;
  object-fit: cover;
}
.timeline-layer-picker-modal {
  width: min(590px, calc(100vw - 32px));
  min-width: 0;
  max-width: 590px;
  max-height: min(680px, calc(100dvh - 32px));
}
.timeline-layer-picker-body { padding: 16px 18px 18px; }
.timeline-layer-picker-search { width: 100%; margin-bottom: 12px; }
.timeline-layer-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.track-type-btn {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid rgba(142, 162, 194, .2);
  border-radius: 9px;
  outline: none;
  background: linear-gradient(145deg, rgba(27, 34, 47, .8), rgba(12, 17, 27, .9));
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease, box-shadow 130ms ease, transform 130ms ease;
}
.track-type-btn[hidden] { display: none; }
.track-type-btn:hover {
  border-color: rgba(106, 171, 251, .5);
  background: linear-gradient(145deg, rgba(35, 48, 68, .9), rgba(14, 22, 35, .95));
  transform: translateY(-1px);
}
.track-type-btn:focus-visible { box-shadow: 0 0 0 3px rgba(76, 145, 230, .14); }
.track-type-btn.selected {
  border-color: rgba(103, 177, 255, .92);
  background: linear-gradient(145deg, rgba(39, 75, 117, .62), rgba(16, 33, 54, .94));
  box-shadow: inset 3px 0 0 var(--accent);
}
.track-type-btn > span { display: grid; min-width: 0; gap: 4px; }
.track-type-btn strong { font-size: 13px; font-weight: 700; }
.track-type-btn small { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.timeline-layer-picker-empty { margin: 24px 0 8px; color: var(--muted); font-size: 12px; text-align: center; }
.timeline-layer-picker-footer { align-items: center; padding: 12px 18px; }
.timeline-layer-picker-meta { display: flex; align-items: center; margin-right: auto; gap: 14px; color: var(--muted); font-size: 10px; }
.timeline-layer-picker-meta > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.timeline-layer-picker-meta kbd { padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.04); color: var(--text); }
@media (max-width: 560px) {
  .timeline-layer-options { grid-template-columns: 1fr; }
  .timeline-layer-picker-footer { flex-wrap: wrap; }
  .timeline-layer-picker-meta { width: 100%; margin: 0 0 2px; }
}
.add-system-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.add-system-copy .add-obj-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}
.add-system-copy small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}
.add-object-btn:disabled {
  cursor: default;
  opacity: 0.42;
  filter: saturate(0.45);
}
.add-object-btn:disabled:hover {
  transform: none;
  border-color: var(--line);
}
.modular-system-tree .modular-system-root {
  margin-top: 6px;
  background: linear-gradient(90deg, rgba(78, 152, 255, 0.11), rgba(78, 152, 255, 0.025));
}
.modular-system-tree .modular-system-module {
  min-height: 36px;
  margin-left: 18px;
  padding-left: 12px;
  width: calc(100% - 18px);
  background: rgba(255, 255, 255, 0.018);
}
.modular-system-mark {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border: 2px solid #72b6ff;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(83, 166, 255, 0.3);
}
.modular-system-mark[data-family="particles"] {
  border-color: #e67cd7;
  border-radius: 50%;
}
.modular-module-rail {
  align-self: stretch;
  width: 1px;
  flex: 0 0 1px;
  margin: -4px 3px -4px 1px;
  background: linear-gradient(180deg, rgba(114, 182, 255, 0.6), rgba(114, 182, 255, 0.08));
}
.modular-system-kind {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.modular-component-stack {
  display: grid;
  gap: 7px;
}
.modular-component-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 120ms ease, background 120ms ease, opacity 120ms ease, transform 120ms ease;
}
.modular-component-card.is-dragging { opacity: .42; }
.modular-component-card[draggable="true"] .modular-component-select { cursor: grab; }
.modular-component-card[draggable="true"].is-dragging .modular-component-select { cursor: grabbing; }
.modular-component-card.drop-before::after,
.modular-component-card.drop-after::after {
  position: absolute;
  z-index: 4;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: rgb(var(--layer-component-rgb, 114, 182, 255));
  box-shadow: 0 0 0 1px rgba(2, 10, 19, .74), 0 0 8px rgba(var(--layer-component-rgb, 114, 182, 255), .68);
  pointer-events: none;
  content: '';
}
.modular-component-card.drop-before::after { top: 0; }
.modular-component-card.drop-after::after { bottom: 0; }
.modular-component-card.is-selected {
  border-color: rgba(114, 182, 255, .72);
  background: linear-gradient(90deg, rgba(74, 152, 238, .16), rgba(74, 152, 238, .045));
  box-shadow: inset 3px 0 0 #72b6ff;
}
.modular-component-root {
  border-color: rgba(114, 182, 255, .24);
  background: linear-gradient(90deg, rgba(74, 152, 238, .075), rgba(255, 255, 255, .018));
}
.modular-component-root .modular-component-order {
  color: rgba(116, 184, 255, .78);
}
.modular-component-select {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.modular-component-select:hover { background: rgba(112, 181, 255, 0.07); }
.modular-component-order {
  display: grid;
  width: 100%;
  place-items: center;
  color: #74b8ff;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.modular-component-copy { display: grid; min-width: 0; gap: 3px; }
.modular-component-copy strong { font-size: 11px; font-weight: 650; }
.modular-component-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modular-component-role {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.modular-component-card:not(.modular-component-add-card) .modular-component-copy strong {
  font-size: 12px;
}
.modular-component-card:not(.modular-component-add-card) .modular-component-copy small,
.modular-component-card:not(.modular-component-add-card) .modular-component-role {
  display: none;
}
.modular-component-actions { display: flex; border-left: 1px solid var(--line); }
.modular-component-actions button {
  width: 26px;
  min-width: 26px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modular-component-actions button .ui-icon { width: 14px; height: 14px; }
.modular-component-actions button.material-restore-action {
  width: 32px;
  min-width: 32px;
}
.modular-component-actions button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}
.modular-component-actions button.component-visibility-action {
  color: color-mix(in srgb, rgb(var(--layer-component-rgb, 126, 186, 236)) 72%, white);
}
.modular-component-actions button.is-hidden { opacity: .58; }
.modular-component-actions button:hover:not(:disabled) { color: var(--text); background: rgba(255,255,255,.06); }
.modular-component-actions button:disabled { opacity: .2; cursor: default; }
.modular-component-actions button.material-cycle-action {
  width: 24px;
  min-width: 24px;
  color: #b9ddff;
  font: 700 13px/1 var(--mono, monospace);
}
.modular-component-actions button.material-cycle-action[aria-busy="true"] {
  color: rgba(185, 221, 255, .42);
}
.renderer-component-section { margin-top: 2px; }

.mask-library-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(2,5,11,.78);
  backdrop-filter: blur(10px);
}
.mask-library {
  width: min(1120px, calc(100vw - 56px));
  max-height: min(820px, calc(100vh - 56px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid rgba(114,182,255,.28);
  border-radius: 14px;
  background: #101621;
  box-shadow: 0 28px 90px rgba(0,0,0,.56);
}
.mask-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.mask-library-header h2 { margin: 0; font: 700 18px var(--mono); }
.mask-library-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}
.mask-library-search { margin: 16px 22px 0; }
.mask-library-scroll { overflow: auto; padding: 20px 22px 24px; }
.mask-library-category { margin: 0 0 22px; }
.mask-library-category h3 {
  margin: 0 0 9px;
  color: #74b8ff;
  font: 700 10px var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.mask-library-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.mask-preset-card {
  display: grid;
  grid-template-columns: 76px minmax(0,1fr);
  gap: 11px;
  align-items: center;
  min-height: 82px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.mask-preset-card:hover, .mask-preset-card:focus-visible {
  border-color: #72b6ff;
  background: rgba(74,152,238,.11);
  outline: none;
}
.mask-preset-preview {
  position: relative;
  width: 76px;
  height: 62px;
  overflow: hidden;
  border-radius: 6px;
  background: #090b10;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.mask-preset-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #fff 0 48%, #111 52%);
  animation: mask-preview-shift 2.4s ease-in-out infinite alternate;
}
.mask-preset-card[data-motion="loop"] .mask-preset-preview::after {
  background: repeating-linear-gradient(115deg, #fff 0 8px, #111 9px 17px);
  animation: mask-preview-loop 2s linear infinite;
}
.mask-preset-preview[data-preset="wipe-right"]::after { animation-direction: alternate-reverse; }
.mask-preset-preview[data-preset="wipe-up"]::after,
.mask-preset-preview[data-preset="wipe-down"]::after {
  background: linear-gradient(0deg, #fff 0 48%, #111 52%);
  animation-name: mask-preview-shift-y;
}
.mask-preset-preview[data-preset="wipe-down"]::after { animation-direction: alternate-reverse; }
.mask-preset-preview[data-preset="diagonal-wipe"]::after {
  background: linear-gradient(135deg, #fff 0 47%, #111 53%);
}
.mask-preset-preview[data-preset="iris"]::after {
  inset: 13px 20px;
  border-radius: 50%;
  background: #fff;
  animation: mask-preview-pulse 2.4s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="diamond"]::after {
  inset: 12px 23px;
  background: #fff;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: mask-preview-pulse 2.4s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="venetian-blinds"]::after {
  background: repeating-linear-gradient(0deg, #fff 0 5px, #111 6px 11px);
}
.mask-preset-preview[data-preset="checkerboard"]::after {
  background: conic-gradient(#fff 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / 18px 18px;
}
.mask-preset-preview[data-preset="noise-dissolve"]::after {
  background: repeating-conic-gradient(from 32deg, #fff 0 7%, #111 8% 15%) 0 0 / 17px 15px;
}
.mask-preset-preview[data-preset="cloud-dissolve"]::after,
.mask-preset-preview[data-preset="liquid-edge"]::after {
  background: radial-gradient(circle at 25% 40%, #fff 0 18%, transparent 32%),
    radial-gradient(circle at 66% 62%, #fff 0 26%, #111 43%);
}
.mask-preset-preview[data-preset="ink-bloom"]::after {
  inset: 6% 12%;
  border-radius: 42% 58% 63% 37% / 53% 35% 65% 47%;
  background:
    radial-gradient(circle at 30% 36%, #fff 0 22%, transparent 24%),
    radial-gradient(circle at 62% 58%, #fff 0 36%, transparent 39%),
    radial-gradient(circle at 46% 48%, #fff 0 48%, #111 51%);
  animation: mask-preview-organic-pulse 2.8s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="dripping-paint"]::after {
  background:
    radial-gradient(ellipse at 16% 20%, #fff 0 8%, transparent 9%),
    radial-gradient(ellipse at 44% 34%, #fff 0 11%, transparent 12%),
    radial-gradient(ellipse at 76% 16%, #fff 0 7%, transparent 8%),
    linear-gradient(#fff 0 35%, transparent 37%);
  background-size: 100% 180%;
  animation: mask-preview-drip 2.5s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="cellular-growth"]::after {
  background:
    radial-gradient(circle at 18% 24%, #fff 0 7%, transparent 9%),
    radial-gradient(circle at 42% 64%, #fff 0 12%, transparent 15%),
    radial-gradient(circle at 73% 31%, #fff 0 10%, transparent 13%),
    radial-gradient(circle at 86% 76%, #fff 0 8%, #111 11%);
  animation: mask-preview-organic-pulse 2.2s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="rising-bubbles"]::after {
  background:
    radial-gradient(circle at 18% 72%, transparent 0 8%, #fff 9% 11%, transparent 12%),
    radial-gradient(circle at 48% 34%, transparent 0 12%, #fff 13% 15%, transparent 16%),
    radial-gradient(circle at 78% 64%, transparent 0 7%, #fff 8% 10%, transparent 11%),
    #111;
  background-size: 100% 120%;
  animation: mask-preview-bubbles 2.8s linear infinite;
}
.mask-preset-preview[data-preset="bubble-cluster"]::after,
.mask-preset-preview[data-preset="mercury-droplets"]::after {
  background:
    radial-gradient(circle at 25% 58%, #fff 0 16%, transparent 17%),
    radial-gradient(circle at 48% 35%, #fff 0 25%, transparent 26%),
    radial-gradient(circle at 72% 60%, #fff 0 18%, transparent 19%),
    radial-gradient(circle at 52% 78%, #fff 0 11%, #111 12%);
  animation: mask-preview-organic-pulse 1.9s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="oil-cells"]::after,
.mask-preset-preview[data-preset="foam-lace"]::after {
  background:
    radial-gradient(circle at 18% 30%, transparent 0 15%, #fff 16% 19%, transparent 20%),
    radial-gradient(circle at 58% 26%, transparent 0 23%, #fff 24% 27%, transparent 28%),
    radial-gradient(circle at 75% 75%, transparent 0 19%, #fff 20% 23%, transparent 24%),
    radial-gradient(circle at 30% 80%, transparent 0 17%, #fff 18% 21%, #111 22%);
  animation: mask-preview-cell-drift 3.4s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="liquid-veins"]::after,
.mask-preset-preview[data-preset="slime-web"]::after {
  background:
    repeating-radial-gradient(ellipse at 10% 120%, transparent 0 8px, #fff 9px 11px, transparent 12px 18px),
    repeating-radial-gradient(ellipse at 90% -20%, transparent 0 10px, #fff 11px 13px, #111 14px 22px);
  animation: mask-preview-cell-drift 3s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="amoeba-membrane"]::after {
  inset: 13% 20%;
  border: 5px solid #fff;
  border-radius: 43% 57% 38% 62% / 60% 39% 61% 40%;
  background: #111;
  animation: mask-preview-amoeba 2.3s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="spline-ribbons"]::after,
.mask-preset-preview[data-preset="tendril-crawl"]::after {
  background:
    repeating-radial-gradient(ellipse at -10% 50%, transparent 0 8px, #fff 9px 12px, transparent 13px 22px),
    #111;
  animation: mask-preview-spline 2.6s linear infinite;
}
.mask-preset-preview[data-preset="fluid-vortex"]::after {
  inset: -28%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, #fff 0 8deg, #111 13deg 28deg);
  -webkit-mask: radial-gradient(circle, transparent 0 8%, #000 10% 65%, transparent 68%);
  animation: mask-preview-spin 3.6s linear infinite;
}
.mask-preset-preview[data-preset="marbled-flow"]::after {
  background:
    repeating-radial-gradient(ellipse at 0 50%, #111 0 7px, #fff 9px 13px, #111 15px 24px);
  animation: mask-preview-marble 3.2s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="reaction-diffusion"]::after {
  background:
    repeating-radial-gradient(ellipse at 16% 22%, #111 0 5px, #fff 6px 9px, #111 11px 17px),
    repeating-radial-gradient(ellipse at 82% 76%, transparent 0 7px, #fff 8px 10px, #111 12px 19px);
  animation: mask-preview-reaction 3.8s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="game-of-life"]::after {
  background:
    conic-gradient(from 90deg at 75% 75%, #fff 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / 14px 14px;
  animation: mask-preview-life 1.5s steps(4, end) infinite;
}
.mask-preset-preview[data-preset="living-flame"]::after,
.mask-preset-preview[data-preset="ember-front"]::after {
  inset: 10% 2% 0;
  background:
    radial-gradient(ellipse at 18% 100%, #fff 0 18%, transparent 20%),
    radial-gradient(ellipse at 47% 100%, #fff 0 32%, transparent 34%),
    radial-gradient(ellipse at 76% 100%, #fff 0 22%, transparent 24%),
    linear-gradient(transparent 18%, #fff 100%);
  filter: blur(1px);
  animation: mask-preview-flame 1.15s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="plasma-filaments"]::after {
  background:
    repeating-radial-gradient(ellipse at 15% 50%, transparent 0 5px, #fff 6px 8px, transparent 9px 17px),
    repeating-radial-gradient(ellipse at 85% 50%, transparent 0 7px, #fff 8px 10px, #111 11px 19px);
  animation: mask-preview-plasma 2.2s linear infinite;
}
.mask-preset-preview[data-preset="mycelium-growth"]::after {
  background:
    repeating-radial-gradient(ellipse at -20% 110%, transparent 0 8px, #fff 9px 10px, transparent 11px 19px),
    repeating-radial-gradient(ellipse at 110% -10%, transparent 0 11px, #fff 12px 13px, #111 14px 23px);
  animation: mask-preview-mycelium 3.1s ease-out infinite alternate;
}
.mask-preset-preview[data-preset="lava-lamp"]::after {
  background:
    radial-gradient(ellipse at 26% 76%, #fff 0 15%, transparent 17%),
    radial-gradient(ellipse at 54% 38%, #fff 0 24%, transparent 26%),
    radial-gradient(ellipse at 78% 70%, #fff 0 18%, #111 20%);
  animation: mask-preview-lava 2.8s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="electric-organism"]::after {
  background:
    repeating-radial-gradient(circle at 50% 50%, #fff 0 3px, #111 5px 10px, #fff 12px 13px, transparent 15px 22px),
    repeating-conic-gradient(from 18deg, transparent 0 10deg, #fff 11deg 13deg, transparent 14deg 34deg),
    #111;
  animation: mask-preview-electric 1.35s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="coral-automata"]::after {
  background:
    radial-gradient(circle at 20% 75%, #fff 0 7%, transparent 8%),
    radial-gradient(circle at 36% 55%, #fff 0 10%, transparent 11%),
    radial-gradient(circle at 55% 37%, #fff 0 13%, transparent 14%),
    radial-gradient(circle at 76% 22%, #fff 0 9%, #111 10%);
  filter: contrast(2);
  animation: mask-preview-coral 2.5s steps(5, end) infinite alternate;
}
.mask-preset-preview[data-preset="bioluminescent-pulse"]::after {
  inset: -10%;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #fff 0 3px, #111 5px 11px, #fff 13px 15px, #111 18px 25px);
  -webkit-mask: radial-gradient(ellipse, #000 0 65%, transparent 70%);
  animation: mask-preview-bio 2s ease-out infinite;
}
.mask-preset-preview[data-preset="radar-sweep"]::after {
  background: conic-gradient(from 0deg at 50% 50%, #fff 0 9%, #111 12% 100%);
  animation: mask-preview-spin 1.8s linear infinite;
}
.mask-preset-preview[data-preset="cellular-pulse"]::after {
  background: radial-gradient(circle, #fff 0 22%, #111 28% 46%, #fff 50% 58%, #111 64%);
  animation: mask-preview-pulse 1.4s ease-in-out infinite alternate;
}
.mask-preset-preview[data-preset="audio-gate"]::after {
  inset: 10px 8px;
  background: repeating-linear-gradient(90deg, #fff 0 4px, transparent 4px 8px);
  clip-path: polygon(0 64%, 10% 35%, 20% 78%, 30% 20%, 40% 60%, 50% 8%, 60% 68%, 70% 30%, 80% 74%, 90% 42%, 100% 64%, 100% 100%, 0 100%);
  animation: mask-preview-audio .65s ease-in-out infinite alternate;
}
.mask-preset-card strong { display: block; font: 650 11px var(--mono); }
.mask-preset-card small { color: var(--muted); font: 9px/1.35 var(--mono); }
@keyframes mask-preview-shift { from { transform: translateX(-48%); } to { transform: translateX(48%); } }
@keyframes mask-preview-shift-y { from { transform: translateY(-48%); } to { transform: translateY(48%); } }
@keyframes mask-preview-loop { to { transform: translateX(24px); } }
@keyframes mask-preview-pulse { from { transform: scale(.2); } to { transform: scale(1.65); } }
@keyframes mask-preview-spin { to { transform: rotate(360deg); } }
@keyframes mask-preview-audio { from { transform: scaleY(.32); } to { transform: scaleY(1); } }
@keyframes mask-preview-organic-pulse {
  from { transform: scale(.72) rotate(-5deg); filter: blur(.2px); }
  to { transform: scale(1.18) rotate(6deg); filter: blur(1.2px); }
}
@keyframes mask-preview-drip { from { transform: translateY(-28%); } to { transform: translateY(18%); } }
@keyframes mask-preview-bubbles { from { background-position: 0 30px; } to { background-position: 0 -44px; } }
@keyframes mask-preview-cell-drift { from { transform: translate(-5%, 3%) scale(1.05); } to { transform: translate(6%, -4%) scale(1.18); } }
@keyframes mask-preview-amoeba { from { transform: rotate(-7deg) scale(.86, 1.08); } to { transform: rotate(8deg) scale(1.14, .88); } }
@keyframes mask-preview-spline { to { background-position: 34px 0; } }
@keyframes mask-preview-marble { from { transform: translateX(-8%) scale(1.05); } to { transform: translateX(8%) scale(1.18); } }
@keyframes mask-preview-reaction { from { transform: scale(.9) rotate(-3deg); } to { transform: scale(1.16) rotate(4deg); } }
@keyframes mask-preview-life { 25% { background-position: 7px 0; } 50% { background-position: 7px 7px; } 75% { background-position: 0 7px; } }
@keyframes mask-preview-flame { from { transform: scale(1.05, .76) skewX(-5deg); } to { transform: scale(.94, 1.18) skewX(6deg); } }
@keyframes mask-preview-plasma { to { background-position: 29px -17px, -23px 19px; } }
@keyframes mask-preview-mycelium { from { transform: scale(.78); opacity: .65; } to { transform: scale(1.2); opacity: 1; } }
@keyframes mask-preview-lava { from { transform: translateY(10%) scale(.92, 1.08); } to { transform: translateY(-10%) scale(1.08, .9); } }
@keyframes mask-preview-electric { from { transform: scale(.82) rotate(-3deg); filter: blur(.2px); } to { transform: scale(1.16) rotate(3deg); filter: blur(1px); } }
@keyframes mask-preview-coral { from { transform: scale(.72); } to { transform: scale(1.16); } }
@keyframes mask-preview-bio { from { transform: scale(.42); opacity: 1; } to { transform: scale(1.2); opacity: .35; } }
@media (max-width: 900px) { .mask-library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }

/* Masks use the same spacious, inspect-before-commit browser pattern as LUTs
   and post effects. The animated monochrome pattern is previewed over artwork
   so its reveal behaviour is legible before it reaches the timeline. */
.mask-library {
  width: min(1480px, calc(100vw - 56px));
  height: min(860px, calc(100vh - 56px));
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.mask-library-body {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(300px, 34%) minmax(0, 1fr);
}
.mask-library-sidebar {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
}
.mask-library-search { margin: 16px; }
.mask-library-scroll { padding: 0 16px 20px; }
.mask-library-list { display: grid; gap: 7px; }
.mask-preset-card { min-height: 72px; }
.mask-preset-card.is-selected {
  border-color: rgb(var(--family-mask-rgb));
  background: linear-gradient(90deg, rgba(var(--family-mask-rgb),.17), rgba(80,146,236,.08));
  box-shadow: inset 3px 0 0 rgb(var(--family-mask-rgb));
}
.mask-library-preview-pane {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 18px 20px 16px;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
}
.mask-library-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  font: 700 14px var(--mono);
}
.mask-library-preview-header span {
  color: rgb(var(--family-mask-rgb));
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.mask-live-preview-stage {
  display: grid;
  min-height: 320px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25% 75%, rgba(255,255,255,.035) 75%) 0 0 / 24px 24px,
    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25% 75%, rgba(255,255,255,.035) 75%) 12px 12px / 24px 24px,
    #080c13;
}
.mask-live-preview-art {
  position: relative;
  width: min(92%, 920px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 68% 35%, #fff0bd 0 3%, transparent 4%),
    radial-gradient(circle at 56% 58%, #ff5fa8 0 6%, transparent 7%),
    linear-gradient(135deg, #07172b, #263d7e 42%, #e7528d 72%, #ffd471);
  box-shadow: 0 20px 55px rgba(0,0,0,.48);
}
.mask-preset-preview--large {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  opacity: .92;
  mix-blend-mode: multiply;
}
.mask-preset-preview--large::after { background-color: #fff; }
.mask-library-preview-pane > p {
  margin: 0;
  color: var(--muted);
  font: 11px/1.5 var(--mono);
}
.mask-library-key-help { color: var(--muted); font: 9px var(--mono); }
.mask-library-key-help kbd { color: var(--text); }
.mask-library-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.mask-layer-target-hint {
  margin: 12px 2px 0;
  color: var(--muted);
  font: 10px/1.45 var(--mono);
}
@media (max-width: 800px) {
  .mask-library-body { grid-template-columns: 1fr; }
  .mask-library-preview-pane { display: none; }
  .mask-library-sidebar { border-right: 0; }
}
.renderer-component-card.is-disabled .scene-workspace-component-icon,
.renderer-component-card.is-disabled .modular-component-copy { opacity: .58; }
.renderer-component-actions {
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.renderer-component-actions .renderer-component-toggle {
  display: grid;
  width: 52px;
  min-width: 52px;
  padding: 0;
  place-items: center;
  border-left: 0;
}
.renderer-component-toggle-track {
  position: relative;
  display: block;
  width: 32px;
  height: 18px;
  box-sizing: border-box;
  border: 1px solid rgba(185,199,219,.3);
  border-radius: 10px;
  background: #272e38;
  transition: background .14s ease, border-color .14s ease;
}
.renderer-component-toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #aebaca;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .14s ease, background .14s ease;
}
.renderer-component-toggle[aria-checked="true"] .renderer-component-toggle-track {
  background: #397fbd;
  border-color: #78baff;
}
.renderer-component-toggle[aria-checked="true"] .renderer-component-toggle-thumb {
  transform: translateX(14px);
  background: #edf7ff;
}
.renderer-component-actions .renderer-component-toggle:focus-visible { outline: none; }
.renderer-component-toggle:focus-visible .renderer-component-toggle-track { outline: 2px solid #a5d1ff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .renderer-component-toggle-track, .renderer-component-toggle-thumb { transition: none; }
}
.renderer-component-base {
  padding: 0 11px;
  color: #7ebcff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.scene-workspace-component-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
}
.scene-workspace-component-icon img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}
.scene-object-component-stack .modular-component-select {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}
.modular-component-actions [data-material-component-replace],
.modular-component-actions [data-material-shader-replace],
.modular-component-actions [data-system-material-replace],
.modular-component-actions [data-character-animation-change],
.modular-component-actions [data-text-reveal-library],
.modular-component-actions [data-scene-hierarchy-skysphere-library] {
  width: auto;
  min-width: 58px;
  flex: 0 0 auto;
  padding: 0 10px;
  color: #8cc5ff;
  font: 680 9px/1 var(--mono, monospace);
  letter-spacing: .03em;
  white-space: nowrap;
}
.modular-component-add-card {
  border-style: dashed;
  background: rgba(114, 182, 255, .025);
}
.modular-component-add-card .modular-component-select { cursor: default; }
.modular-component-add-card .modular-component-select:hover { background: transparent; }
.modular-component-add-card .modular-component-actions .modular-component-add-button {
  width: 46px;
  min-width: 46px;
  padding: 0 10px;
  color: #8cc5ff;
  font: inherit;
  line-height: 1;
  text-align: center;
}
.modular-component-add-card:hover {
  border-color: rgba(114, 182, 255, .42);
  background: rgba(114, 182, 255, .045);
}
.modular-component-add {
  position: relative;
  display: grid;
  gap: 7px;
  margin-top: 9px;
}
.modular-component-add > .btn { width: 100%; }
/* Equal attachment cells keep icons, labels and add marks aligned. */
.layer-component-add-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.layer-component-add-control { margin-top: 0; }
.btn.layer-component-add-button {
  width: auto;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid #ffffff1f;
  border-radius: 7px;
  background: #ffffff05;
  color: #b9c6d4;
  font-family: inherit;
  font-size: 11px;
  font-weight: 550;
  line-height: 16px;
  letter-spacing: 0;
  text-align: center;
}
.layer-component-add-actions > .layer-component-add-button { flex: 0 1 auto; }
.btn.layer-component-add-button:hover:not(:disabled) {
  border-color: #ffffff40;
  background: #ffffff0d;
  color: #eef2f7;
}
.btn.layer-component-add-button:disabled { opacity: .38; }
.btn.layer-attachment-button {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px;
  border-radius: 9px;
  text-align: left;
  font-weight: 550;
  transition: background-color .15s, border-color .15s, color .15s;
}
.attachment-action-icon { display: block; width: 22px; height: 22px; color: var(--component-action-accent, currentColor); }
.attachment-action-label { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
.attachment-action-plus { display: block; width: 12px; height: 12px; opacity: .7; }
@media (prefers-reduced-motion: reduce) { .btn.layer-attachment-button { transition: none; } }
.component-choice-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  min-width: 0;
  padding: 10px;
  background: rgba(4, 8, 14, .78);
  backdrop-filter: blur(5px);
}
.component-choice-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(119, 181, 239, .34);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(16, 25, 38, .99), rgba(7, 12, 20, .99));
  box-shadow: 0 18px 48px rgba(0, 0, 0, .48);
}
.component-choice-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 0;
}
.component-choice-close {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}
.component-choice-close:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, .06);
  color: #fff;
}
.parameter-search.component-choice-search {
  margin: 0;
}
.component-choice-categories {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}
.component-choice-categories[hidden] { display: none; }
.component-choice-category {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 60px;
  padding: 9px 12px;
  border: 1px solid rgba(131, 196, 255, .18);
  border-radius: 9px;
  background: rgba(55, 115, 172, .055);
  color: rgba(207, 226, 242, .76);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.component-choice-category:hover,
.component-choice-category:focus-visible {
  border-color: rgba(126, 192, 255, .55);
  background: rgba(74, 152, 238, .1);
  color: #f1f8ff;
  outline: none;
}
.component-choice-category-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(131, 196, 255, .18);
  border-radius: 7px;
  background: rgba(73, 145, 211, .08);
}
.component-choice-category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
}
.component-choice-category-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.component-choice-category-copy strong {
  min-width: 0;
  font: 680 11px/1.25 var(--mono, monospace);
  letter-spacing: .02em;
}
.component-choice-category-copy small {
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(167, 207, 241, .08);
  color: rgba(188, 214, 236, .66);
  font: 650 8px/1 var(--mono, monospace);
}
.component-choice-back {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid rgba(126, 192, 255, .34);
  border-radius: 9px;
  background: rgba(55, 115, 172, .08);
  color: #dceeff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.component-choice-back[hidden] { display: none; }
.component-choice-back:hover,
.component-choice-back:focus-visible {
  border-color: rgba(126, 192, 255, .68);
  background: rgba(74, 152, 238, .14);
  color: #fff;
  outline: none;
}
.component-choice-back > span {
  font-size: 16px;
  line-height: 1;
}
.component-choice-back strong {
  font: 680 10px/1.2 var(--mono, monospace);
  letter-spacing: .025em;
}
.component-choice-search-empty[hidden] {
  display: none;
}
.component-choice-browser {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.component-choice-list {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}
.component-choice-list[hidden] { display: none; }
.component-choice-group {
  display: grid;
  min-width: 0;
}
.component-choice-group[hidden] {
  display: none;
}
.component-choice-card-icon {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(131, 196, 255, .2);
  background: rgba(73, 145, 211, .09);
}
.component-choice-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
}
.component-choice-group-grid {
  display: grid;
  gap: 6px;
}
.component-choice-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 9px;
  background: rgba(255, 255, 255, .025);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.component-choice-card[hidden] {
  display: none;
}
.component-choice-card:hover,
.component-choice-card:focus-visible,
.component-choice-card.is-keyboard-selected {
  border-color: rgba(126, 192, 255, .72);
  background: rgba(74, 152, 238, .13);
  outline: none;
}
.component-choice-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: rgba(205, 229, 247, .82);
  font: 700 11px/1 var(--mono, monospace);
}
.component-choice-card-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.component-choice-card strong { font-size: 11px; line-height: 1.3; }
.component-choice-card-badge {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid rgba(126, 192, 255, .28);
  border-radius: 999px;
  background: rgba(74, 152, 238, .09);
  color: rgba(190, 224, 255, .86);
  font: 650 7px/1.2 var(--mono, monospace);
  font-style: normal;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.component-choice-card-badge[data-simulation-tier="stylized"] {
  border-color: rgba(255, 193, 105, .3);
  background: rgba(255, 166, 64, .08);
  color: rgba(255, 214, 158, .88);
}
.modular-component-palette {
  display: grid;
  gap: 6px;
  max-height: 310px;
  padding: 7px;
  overflow: auto;
  border: 1px solid rgba(114, 182, 255, .28);
  border-radius: 9px;
  background: rgba(8, 13, 22, .96);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .32);
}
.modular-component-palette[hidden] { display: none; }
.modular-component-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .025);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.modular-component-choice:hover,
.modular-component-choice:focus-visible {
  border-color: rgba(114, 182, 255, .55);
  background: rgba(74, 152, 238, .1);
  outline: none;
}
.modular-component-choice strong {
  justify-self: start;
  font-size: 11px;
}
.modular-component-choice small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
}
.modular-component-back {
  margin: 2px 0 10px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #79baff;
  font: inherit;
  cursor: pointer;
}
.modular-component-description { margin: 0 0 10px; }
.modular-module-footer { display: flex; gap: 7px; flex-wrap: wrap; }
.modular-module-footer .delete-action-btn { margin-left: auto; }

.param-row-colour-ramp {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  align-items: stretch;
}
.param-row-colour-ramp > .param-label {
  color: #8dbef2;
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.param-row-colour-ramp > .param-value { min-width: 0; }
.particle-colour-ramp-editor {
  display: grid;
  gap: 9px;
  min-width: 0;
}
.particle-colour-ramp-preview {
  position: relative;
  height: 38px;
  overflow: hidden;
  border: 1px solid rgba(144, 190, 235, .28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--particle-colour-ramp)),
    repeating-conic-gradient(rgba(255,255,255,.08) 0 25%, transparent 0 50%) 0 / 12px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11), 0 7px 18px rgba(0,0,0,.2);
}
.particle-colour-ramp-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.22);
  pointer-events: none;
}
.particle-colour-ramp-stops {
  display: grid;
  gap: 6px;
}
.particle-colour-stop {
  display: grid;
  grid-template-columns: 22px 34px minmax(0, 1fr) 28px;
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(130, 174, 220, .14);
  border-radius: 7px;
  background: rgba(255,255,255,.022);
}
.particle-colour-stop-field:last-of-type { grid-column: 3 / 4; }
.particle-colour-stop-index {
  color: #74b8ff;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.particle-colour-stop-swatch {
  width: 34px;
  height: 34px;
  padding: 2px;
  border-radius: 7px;
  cursor: pointer;
}
.particle-colour-stop-field {
  display: grid;
  grid-template-columns: minmax(34px, 1fr) 52px;
  gap: 3px 6px;
  min-width: 0;
}
.particle-colour-stop-field > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.particle-colour-stop-field input[type="range"] { min-width: 34px; width: 100%; }
.particle-colour-stop-field input[type="number"] {
  width: 52px;
  min-width: 0;
  padding: 4px;
  font-size: 9px;
}
.particle-colour-stop-field input:disabled { opacity: .32; }
.particle-colour-stop-remove {
  grid-column: 4;
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.particle-colour-stop-remove:hover:not(:disabled) {
  border-color: rgba(255, 105, 125, .3);
  background: rgba(255, 105, 125, .08);
  color: #ff879a;
}
.particle-colour-stop-remove:disabled { opacity: .2; }
.particle-colour-ramp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}
.particle-colour-ramp-footer .btn { min-height: 29px; padding: 5px 10px; }

.scene-workspace {
  display: grid;
  gap: 18px;
  padding: 4px 0 16px;
}
.entity-identity {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  isolation: isolate;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--entity-identity-accent, rgba(var(--layer-component-rgb, 126, 186, 236), .62));
  border-radius: 10px;
  background: var(
    --entity-identity-background,
    linear-gradient(180deg, rgba(var(--layer-component-rgb, 126, 186, 236), .38), rgba(var(--layer-component-rgb, 126, 186, 236), .2)) #101a26
  );
  box-shadow:
    inset 0 1px 0 rgba(235, 249, 255, .2),
    0 8px 22px rgba(0, 0, 0, .18);
}
.entity-identity.is-compact { grid-template-columns: 56px minmax(0, 1fr); }
.entity-identity-icon {
  display: block;
  width: 72px;
  height: 72px;
  border: 1px solid var(--entity-identity-accent, rgba(var(--layer-component-rgb, 139, 199, 255), .48));
  border-radius: 12px;
  background: rgba(3, 16, 28, .46);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(255, 255, 255, .04);
  object-fit: cover;
  mix-blend-mode: screen;
  user-select: none;
}
.entity-identity-artwork {
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  mix-blend-mode: normal;
  background: #0c1016;
}
.entity-identity-artwork img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.entity-identity-artwork.is-tinted img { filter: grayscale(1); }
.entity-identity-artwork.is-tinted::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--entity-identity-accent, rgb(var(--layer-component-rgb)));
  mix-blend-mode: color;
}
.entity-identity.is-compact .entity-identity-icon { width: 56px; height: 56px; border-radius: 10px; }
.entity-identity-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.entity-identity-copy strong {
  overflow: hidden;
  color: #f0f8ff;
  font-size: 14px;
  font-weight: 680;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 8, 18, .48);
}
.entity-identity-copy small {
  overflow: hidden;
  color: rgba(226, 241, 252, .7);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.obj-group > .entity-identity { margin-bottom: 12px; }
.scene-workspace-intro {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid rgba(114, 182, 255, .2);
  border-radius: 10px;
  background:
    radial-gradient(circle at 100% 0, rgba(78, 152, 255, .13), transparent 45%),
    rgba(255, 255, 255, .022);
}
.scene-workspace-intro.is-compact { padding: 13px 14px; }
.scene-workspace-intro strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
}
.scene-workspace-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.scene-workspace-kicker,
.scene-workspace-section h3 {
  color: #78baff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.scene-workspace-section { display: grid; gap: 8px; }
.scene-workspace-section h3 { margin: 0; }
.layer-component-groups {
  display: grid;
  gap: 18px;
}
.layer-component-group {
  position: relative;
  gap: 9px;
}
.layer-component-group + .layer-component-group {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.layer-component-group-installed h3 { color: #d8e9fb; }
.layer-component-group-available h3 { color: #78baff; }
.layer-component-group-installed .layer-component-list {
  gap: 0;
}
.layer-component-group-installed .layer-component-list > .modular-component-stack {
  display: contents;
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) {
  height: 44px;
  isolation: isolate;
  border-top-width: 0;
  border-radius: 0;
  border-color: rgba(var(--layer-component-rgb, 126, 186, 236), .52);
  background:
    linear-gradient(180deg, rgba(var(--layer-component-rgb, 126, 186, 236), .34), rgba(var(--layer-component-rgb, 126, 186, 236), .17)),
    #101a26;
  box-shadow:
    inset 0 1px 0 rgba(224, 244, 255, .18);
}
.layer-component-group-installed .layer-component-list > .modular-component-card:not(.modular-component-add-card):first-child,
.layer-component-group-installed .layer-component-list > .modular-component-stack:first-child > .modular-component-card:not(.modular-component-add-card):first-child {
  border-top-width: 1px;
  border-start-start-radius: 8px;
  border-start-end-radius: 8px;
}
.layer-component-group-installed .layer-component-list > .modular-component-card:not(.modular-component-add-card):last-child,
.layer-component-group-installed .layer-component-list > .modular-component-stack:last-child > .modular-component-card:not(.modular-component-add-card):last-child {
  border-end-start-radius: 8px;
  border-end-end-radius: 8px;
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-select {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 100%;
  padding: 7px 9px;
  column-gap: 14px;
}
.scene-component-folder { overflow: hidden; border: 1px solid rgba(var(--layer-component-rgb), .32); border-radius: 8px; margin: 0; }
.scene-component-folder-toggle { display: grid; grid-template-columns: 16px 28px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; width: 100%; height: 42px; padding: 6px 10px; border: 0; border-radius: 0; background: rgba(var(--layer-component-rgb), .16); box-shadow: inset 3px 0 0 rgb(var(--layer-component-rgb)); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.scene-component-folder-toggle:hover { background: rgba(var(--layer-component-rgb), .17); }
.scene-component-folder-toggle strong { font-size: 12px; font-weight: 600; }
.scene-component-folder-chevron { width: 16px; font-size: 22px; text-align: center; line-height: 1; transform: rotate(0deg); color: var(--muted); }
.scene-component-folder-toggle[aria-expanded="true"] .scene-component-folder-chevron { transform: rotate(90deg); }
.scene-component-folder-count { grid-column: 5; min-width: 28px; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, .2); color: #c3d2df; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.scene-component-folder-toggle:focus-visible { outline: 2px solid #b6ddff; outline-offset: -3px; }
.scene-component-folder-content { border-top: 1px solid rgba(var(--layer-component-rgb), .25); }

.scene-hierarchy-component-card {
  width: calc(100% - var(--scene-hierarchy-indent, 0px));
  margin-left: var(--scene-hierarchy-indent, 0px);
}
.scene-hierarchy-component-card .modular-component-select {
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 14px;
}
.scene-hierarchy-component-card .modular-component-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-component-swatch-frame {
  width: 28px;
  height: 28px;
  padding: 2px;
  border-radius: 50%;
  background: rgba(3, 17, 29, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.material-component-swatch-frame .material-component-swatch {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card):hover {
  border-color: rgba(var(--layer-component-rgb, 151, 207, 252), .74);
  background:
    linear-gradient(180deg, rgba(var(--layer-component-rgb, 126, 187, 235), .43), rgba(var(--layer-component-rgb, 126, 187, 235), .23)),
    #13202e;
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card).is-selected {
  border-color: rgba(var(--layer-component-rgb, 151, 211, 255), .95);
  background:
    linear-gradient(180deg, rgba(var(--layer-component-rgb, 117, 187, 244), .56), rgba(var(--layer-component-rgb, 117, 187, 244), .3)),
    #142334;
  box-shadow:
    inset 3px 0 0 rgb(var(--layer-component-rgb, 155, 211, 255)),
    inset 0 1px 0 rgba(235, 249, 255, .25);
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-select {
  color: #edf8ff;
  text-shadow: 0 1px 1px rgba(0, 8, 18, .45);
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-select:hover {
  background: rgba(216, 240, 255, .055);
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-order {
  color: rgba(var(--layer-component-rgb, 191, 227, 255), 1);
}
.layer-component-group-installed .scene-workspace-component-icon > img {
  background: transparent;
  filter: saturate(.82) brightness(1.08);
  mix-blend-mode: screen;
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions {
  border-left-color: rgba(4, 24, 41, .48);
  box-shadow: inset 1px 0 0 rgba(222, 243, 255, .08);
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions button {
  border-left-color: rgba(4, 24, 41, .48);
  background: rgba(3, 20, 35, .12);
  color: rgba(226, 243, 255, .8);
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions button:hover:not(:disabled) {
  background: rgba(218, 241, 255, .11);
  color: #fff;
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions button.component-visibility-action {
  color: color-mix(in srgb, rgb(var(--layer-component-rgb, 151, 207, 252)) 72%, white);
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions button.component-visibility-action.is-hidden {
  color: rgba(var(--layer-component-rgb, 151, 207, 252), .52);
  opacity: .62;
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card).is-disabled .modular-component-select {
  opacity: .56;
}
/* Every layer retains its own family colour, including children of mixed
   folders. Selection adds emphasis without replacing that family identity. */
.scene-hierarchy-component-section .scene-hierarchy-component-list {
  display: grid;
  gap: 6px;
}
.scene-hierarchy-component-section.layer-component-group-installed .scene-hierarchy-component-card {
  box-sizing: border-box;
  height: 44px;
  overflow: hidden;
  border: 1px solid rgba(var(--layer-component-rgb), .32);
  border-radius: 8px;
  background: rgba(var(--layer-component-rgb), .18);
  box-shadow: inset 3px 0 0 rgb(var(--layer-component-rgb));
}
.scene-hierarchy-component-section.layer-component-group-installed .scene-hierarchy-component-card .modular-component-select {
  grid-template-columns: 16px 28px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px 10px;
  text-shadow: none;
}
.scene-hierarchy-component-section .scene-hierarchy-component-card .modular-component-copy strong { font-size: 12px; font-weight: 600; }
.scene-hierarchy-component-section .scene-component-folder-content > .scene-hierarchy-component-card {
  border-width: 0 0 1px;
  border-color: rgba(var(--layer-component-rgb), .18);
  border-radius: 0;
  background: rgba(var(--layer-component-rgb), .18);
}
.scene-hierarchy-component-section .scene-component-folder-content > .scene-hierarchy-component-card:last-child { border-bottom: 0; }
.scene-hierarchy-component-section .scene-component-folder-content .scene-hierarchy-component-card .modular-component-select { padding-left: 28px; }
.scene-hierarchy-component-section .scene-workspace-component-icon {
  border-radius: 5px;
  background: rgba(var(--layer-component-rgb), .2);
  box-shadow: inset 0 0 0 1px rgba(var(--layer-component-rgb), .5);
}
.scene-hierarchy-component-section.layer-component-group-installed .scene-hierarchy-component-card:hover { background: rgba(var(--layer-component-rgb), .28); }
.scene-hierarchy-component-section.layer-component-group-installed .scene-hierarchy-component-card.is-selected,
.scene-hierarchy-component-section .scene-component-folder.has-selection {
  border-color: rgb(var(--layer-component-rgb));
  background: rgba(var(--layer-component-rgb), .36);
  box-shadow: inset 3px 0 0 rgb(var(--layer-component-rgb)), inset 0 0 0 1px rgba(var(--layer-component-rgb), .7);
}
.scene-hierarchy-component-section .scene-hierarchy-component-card.is-selected .modular-component-copy strong { color: #fff; font-weight: 700; }
.scene-hierarchy-component-section .scene-hierarchy-component-card .modular-component-select:focus-visible { outline: 2px solid #b6ddff; outline-offset: -3px; }
.layer-component-group-installed .modular-component-card.is-unavailable {
  border-style: dashed;
  background: rgba(255, 255, 255, .012);
}
.layer-component-group-installed .modular-component-card.is-unavailable .modular-component-select:disabled {
  grid-template-columns: 28px minmax(0, 1fr);
  opacity: 1;
  cursor: default;
}
.layer-component-group-installed .modular-component-card.is-unavailable .material-component-swatch-frame {
  opacity: .52;
  filter: grayscale(.55);
}
.layer-component-group-installed .modular-component-card.is-unavailable .modular-component-copy strong {
  color: rgba(232, 241, 249, .74);
}
.layer-component-group-installed .modular-component-card.is-unavailable .modular-component-copy small {
  display: block;
  overflow: hidden;
  color: rgba(191, 205, 218, .62);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-component-unavailable {
  display: grid;
  gap: 8px;
}
.material-component-unavailable strong { color: var(--text); }
.material-component-unavailable span { font-size: 10px; line-height: 1.5; }
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions button.is-required-action:disabled {
  color: rgba(205, 220, 233, .46);
  opacity: .48;
}
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions [data-material-component-replace],
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions [data-material-shader-replace],
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions [data-system-material-replace],
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions [data-character-animation-change],
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions [data-text-reveal-library],
.layer-component-group-installed .modular-component-card:not(.modular-component-add-card) .modular-component-actions [data-scene-hierarchy-skysphere-library] {
  color: #d7efff;
}
.layer-component-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.scene-object-layer-components .scene-object-component-stack,
.text-layer-components .modular-component-stack { margin: 0; }
.layer-component-group-installed .material-shader-child {
  position: relative;
  box-sizing: border-box;
  overflow: visible;
  width: calc(100% - 24px);
  margin-left: 24px;
}
.material-shader-child::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 0;
  width: 13px;
  height: 22px;
  border-left: 1px solid rgba(var(--layer-component-rgb), .5);
  border-bottom: 1px solid rgba(var(--layer-component-rgb), .5);
  border-bottom-left-radius: 5px;
  pointer-events: none;
}
.material-shader-child .modular-component-select:focus-visible {
  outline: 2px solid #b6ddff;
  outline-offset: -3px;
}
.layer-component-group-installed .material-shader-child .modular-component-role {
  display: block;
}
.material-shader-child .modular-component-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modular-component-installed-section + .modular-component-add {
  margin-top: 0;
}
.scene-workspace-search { margin: -2px 0 0; }
#sceneWorkspaceCatalogResults {
  display: grid;
  gap: 18px;
}
.scene-workspace-search-empty {
  margin-top: -8px;
  padding: 17px 12px;
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}
.scene-workspace-search-empty[hidden],
.scene-workspace-section[hidden],
.scene-workspace-add-card[hidden],
.scene-workspace-library-card[hidden] { display: none; }
.scene-workspace-add-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.scene-workspace-add-grid.is-wide { grid-template-columns: 1fr; }
.scene-workspace-add-card,
.scene-workspace-library-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .025);
  color: var(--text);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.scene-workspace-add-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 9px;
  text-align: left;
}
.scene-workspace-add-card[data-scene-add],
.scene-workspace-library-card[data-scene-add]{cursor:grab;touch-action:none;}
.scene-workspace-add-card[data-scene-add]:active,
.scene-workspace-library-card[data-scene-add]:active{cursor:grabbing;}
body.scene-catalog-pointer-dragging,
body.scene-catalog-pointer-dragging *{
  cursor:grabbing!important;
  user-select:none!important;
}
.scene-workspace-add-card.is-dragging,
.scene-workspace-library-card.is-dragging{
  opacity:.48;
  border-color:rgba(120,180,255,.65);
  background:rgba(74,152,238,.12);
  transform:scale(.985);
}
.scene-workspace-add-card.is-system { padding: 12px 11px; }
.scene-workspace-add-card:hover,
.scene-workspace-library-card:hover {
  border-color: rgba(114, 182, 255, .52);
  background: rgba(74, 152, 238, .09);
  transform: translateY(-1px);
}
.scene-workspace-add-card.is-keyboard-selected,
.scene-workspace-library-card.is-keyboard-selected {
  border-color: rgba(126, 191, 255, .9);
  background: rgba(74, 152, 238, .16);
  box-shadow: 0 0 0 2px rgba(74, 152, 238, .22);
  transform: translateY(-1px);
}
.scene-workspace-add-card > span:last-child,
.scene-workspace-library-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.scene-workspace-add-card strong,
.scene-workspace-library-card strong { font-size: 10px; font-weight: 650; }
.scene-workspace-add-card small,
.scene-workspace-library-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scene-workspace-add-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(114, 182, 255, .28);
  border-radius: 7px;
  background: rgba(74, 152, 238, .08);
  color: #8ac5ff;
  line-height: 1;
  overflow: hidden;
}
.scene-workspace-add-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}
.scene-workspace-add-mark.is-light {
  border-color: rgba(255, 192, 82, .27);
  background: rgba(255, 176, 42, .07);
  color: #ffc76a;
}
.scene-workspace-library-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 11px;
  text-align: left;
}
.scene-workspace-library-card > span:last-child { color: #78baff; }
.scene-workspace-library-card.is-text3d {
  border-color: rgba(132, 172, 255, 0.28);
  background: linear-gradient(135deg, rgba(71, 126, 211, 0.16), rgba(128, 83, 195, 0.09));
}
.scene-workspace-library-card.is-text3d:hover,
.scene-workspace-library-card.is-text3d.is-keyboard-selected {
  border-color: rgba(142, 195, 255, 0.72);
  background: linear-gradient(135deg, rgba(71, 137, 226, 0.24), rgba(139, 85, 210, 0.15));
}
.scene-workspace-library-card.is-text3d .scene-workspace-add-mark {
  border-color: rgba(137, 191, 255, 0.38);
  background: rgba(5, 12, 24, 0.5);
}
.scene-workspace-back,
.scene-workspace-text-action {
  width: max-content;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #79baff;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.scene-workspace-text-action { color: var(--muted); }
.scene-workspace-back:hover,
.scene-workspace-text-action:hover { color: var(--text); }
.scene-workspace-root-back {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(121, 186, 255, .34);
  border-radius: 7px;
  background: rgba(52, 118, 184, .1);
}
.scene-workspace-root-back:hover {
  border-color: rgba(121, 186, 255, .68);
  background: rgba(52, 118, 184, .2);
}
.scene-workspace-components .modular-component-add { margin-top: -4px; }

.scene-object-deformer-stack { margin-top: 10px; }
.deformer-component-palette {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: min(48vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.deformer-component-palette .modular-component-choice {
  min-height: 88px;
  align-content: start;
}
.form-group{
  margin-bottom: 16px;
}
.form-group label{
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}
.form-group input[type="text"]{
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font: inherit;
}
.form-group input[type="text"]:focus{
  outline: none;
  border-color: var(--accent);
}
.toggle-group{
  display: flex;
  gap: 8px;
}
.toggle-btn{
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  transition: all 0.15s;
}
.toggle-btn:hover{
  background: rgba(255,255,255,0.06);
}
.toggle-btn.active{
  background: rgba(120,180,255,0.15);
  border-color: var(--accent);
  color: var(--accent);
}
/* Screenshot-led project browser. */
.project-browser-modal {
  width: var(--project-launcher-width);
  max-width: none;
  min-width: 0;
  height: min(780px, calc(100dvh - 40px));
  max-height: none;
  border-color: rgba(117, 171, 235, .24);
  background: linear-gradient(145deg, rgba(20, 27, 40, .99), rgba(9, 13, 21, .99));
  box-shadow: 0 32px 100px rgba(0, 0, 0, .68), 0 0 0 1px rgba(118, 183, 255, .045);
}
.project-browser-header { min-height: 116px; box-sizing: border-box; align-items: flex-start; gap: 24px; padding: 26px; }
.project-browser-heading { min-width: 0; }
.project-browser-close { margin-left: auto; }
.project-browser-body { display: flex; flex-direction: column; padding: 18px 20px 20px; overflow: hidden; }
.project-browser-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; align-items: center; }
.project-browser-search input { height: 42px; font-size: 11px; }
.project-browser-filters { display: flex; gap: 5px; padding: 4px; border: 1px solid rgba(137, 166, 211, .15); border-radius: 9px; background: rgba(3, 7, 13, .36); }
.project-browser-filter {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}
.project-browser-filter:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
.project-browser-filter.active { border-color: rgba(111, 178, 249, .38); color: #acd7ff; background: rgba(70, 137, 207, .18); }
.project-browser-filter span { display: inline-grid; min-width: 18px; margin-left: 4px; padding: 1px 4px; place-items: center; border-radius: 8px; background: rgba(3, 7, 13, .4); font-size: 8px; }
.project-browser-summary { display: flex; justify-content: space-between; padding: 11px 2px 9px; color: rgba(174, 190, 213, .52); font-size: 8px; letter-spacing: .035em; }
.demos-list.project-browser-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: max-content;
  gap: 12px;
  min-height: 0;
  max-height: none;
  padding: 2px 5px 12px 2px;
  overflow-y: auto;
  align-content: start;
  overscroll-behavior: contain;
}
.project-card {
  min-width: 0;
  border: 1px solid rgba(140, 160, 192, .17);
  border-radius: 10px;
  outline: none;
  overflow: hidden;
  background: linear-gradient(155deg, rgba(25, 33, 47, .94), rgba(12, 17, 27, .96));
  cursor: pointer;
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease, box-shadow 130ms ease;
}
.project-card:hover { transform: translateY(-2px); border-color: rgba(111, 175, 242, .42); background: linear-gradient(155deg, rgba(31, 43, 61, .98), rgba(13, 20, 32, .98)); }
.project-card.selected { border-color: rgba(111, 181, 255, .9); box-shadow: 0 0 0 2px rgba(74, 152, 238, .17), 0 16px 34px rgba(0, 0, 0, .25); }
.project-card-thumbnail { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #070b12; }
.project-card-thumbnail::after { content: ''; position: absolute; inset: auto 0 0; height: 42%; background: linear-gradient(transparent, rgba(5, 8, 14, .42)); pointer-events: none; }
.project-card-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.01); transition: opacity 180ms ease, transform 220ms ease; }
.project-card-thumbnail.has-image .project-card-image { opacity: 1; }
.project-card:hover .project-card-image { transform: scale(1.035); }
.project-card-fallback { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: rgba(137, 194, 255, .35); background: radial-gradient(circle at 50% 38%, rgba(61, 119, 181, .28), transparent 37%), linear-gradient(135deg, #101a2a, #090e17); text-transform: uppercase; letter-spacing: .15em; font-size: 7px; }
.project-card-fallback::before, .project-card-fallback::after { content: ''; position: absolute; inset: 0; opacity: .2; background: linear-gradient(90deg, transparent 49.7%, rgba(129, 185, 247, .3) 50%, transparent 50.3%); }
.project-card-fallback::after { transform: rotate(90deg); }
.project-card-fallback svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.project-card-visibility, .project-card-current { position: absolute; z-index: 2; top: 9px; display: inline-flex; align-items: center; gap: 5px; min-height: 21px; box-sizing: border-box; padding: 4px 7px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 6px; backdrop-filter: blur(8px); font-size: 7px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.project-card-visibility { left: 9px; color: #b1bfce; background: rgba(7, 11, 18, .7); }
.project-card-visibility.public { color: #82ecc2; border-color: rgba(91, 229, 170, .26); background: rgba(8, 40, 32, .75); }
.project-card-visibility svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.project-card-current { top: 43px; right: 9px; color: #a7d4ff; border-color: rgba(99, 169, 241, .3); background: rgba(17, 55, 94, .76); }
.project-card-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 12px; }
.project-card-name { overflow: hidden; margin: 0; color: #edf2f9; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.project-card-meta { margin: 0; color: var(--muted); font-size: 8px; }
.project-card-action { display: inline-flex; min-width: 0; min-height: 27px; padding: 5px 8px; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgba(180, 197, 220, .24); border-radius: 6px; background: rgba(7, 11, 18, .78); color: rgba(220, 230, 243, .72); font: inherit; font-size: 8px; cursor: pointer; backdrop-filter: blur(8px); }
.project-card-thumbnail-action { position: absolute; z-index: 3; top: 9px; right: 9px; }
.project-card-action svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.project-card-action:hover { color: var(--text); border-color: rgba(137, 180, 235, .5); background: rgba(15, 24, 38, .92); }
.project-card-action.delete:hover { color: #ff8bac; border-color: rgba(255, 104, 147, .32); background: rgba(255, 83, 131, .08); }
.project-card-action.unpublish:hover { color: #ffc36c; border-color: rgba(240, 160, 64, .32); background: rgba(240, 160, 64, .08); }
.project-card-action:disabled { opacity: .45; cursor: wait; }
.project-browser-loading, .project-browser-empty { grid-column: 1 / -1; display: grid; min-height: 260px; place-content: center; justify-items: center; gap: 9px; color: var(--muted); text-align: center; }
.project-browser-loading > span { width: 22px; height: 22px; border: 2px solid rgba(117, 183, 255, .16); border-top-color: #78baff; border-radius: 50%; animation: project-browser-spin .7s linear infinite; }
.project-browser-empty svg { width: 38px; height: 38px; margin-bottom: 3px; fill: none; stroke: rgba(121, 186, 255, .48); stroke-width: 1.2; }
.project-browser-empty strong { color: var(--text); font-size: 12px; }
.project-browser-empty span { max-width: 320px; font-size: 9px; line-height: 1.5; }
.project-browser-footer { align-items: center; justify-content: space-between; min-height: 74px; box-sizing: border-box; padding: 16px 20px; }
.project-browser-destinations { display: flex; align-items: center; gap: 10px; }
.project-browser-footer-actions { display: flex; align-items: center; gap: 9px; }
@keyframes project-browser-spin { to { transform: rotate(360deg); } }
@media (max-width: 780px) {
  .project-browser-modal { width: calc(100vw - 24px); height: calc(100dvh - 24px); }
  .project-browser-toolbar { grid-template-columns: 1fr; }
  .project-browser-filters { justify-content: stretch; }
  .project-browser-filter { flex: 1; }
  .demos-list.project-browser-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-browser-footer { flex-direction: column; align-items: stretch; justify-content: flex-end; }
  .project-browser-destinations { width: 100%; }
  .project-browser-footer-actions { width: 100%; }
  .project-browser-destinations > *, .project-browser-new, .project-browser-import, .project-browser-open { flex: 1; justify-content: center; }
}
@media (max-width: 520px) {
  .demos-list.project-browser-grid { grid-template-columns: 1fr; }
  .project-browser-summary span:last-child { display: none; }
}
.empty-state{
  text-align: center;
  padding: 32px;
  color: var(--muted);
}
.model-source-credit {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(28, 170, 217, .24);
  border-radius: 7px;
  background: rgba(28, 170, 217, .06);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.model-source-credit strong { color: var(--text); }
.model-source-credit a { width: fit-content; color: #1caad9; text-decoration: none; }
.model-source-credit a:hover { text-decoration: underline; }
/* Asset Browser Modal */
.asset-browser-modal{
  min-width: 700px;
  max-width: 900px;
  max-height: 85vh;
}

.text-reveal-library-modal {
  width: min(1260px, calc(100vw - 48px));
  max-width: none;
  height: min(760px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
}
.text-reveal-library-body { display:flex; gap:18px; min-height:0; overflow:hidden; }
.text-reveal-library-list { width:470px; min-width:390px; display:flex; flex-direction:column; min-height:0; }
.text-reveal-search { margin-bottom:10px; }
.text-reveal-search input { width:100%; }
.text-reveal-categories { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.text-reveal-category {
  padding:6px 9px; border:1px solid var(--line); border-radius:5px; background:rgba(255,255,255,.025);
  color:var(--muted); font:inherit; font-size:9px; text-transform:none; letter-spacing:normal; cursor:pointer;
}
.text-reveal-category.active { border-color:rgba(120,180,255,.7); color:var(--accent); background:rgba(120,180,255,.11); }
.text-reveal-preset-grid { flex:1; min-height:0; overflow:auto; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:start; gap:8px; padding:2px; }
.text-reveal-preset-card {
  min-height:92px; padding:11px; border:1px solid var(--line); border-radius:7px;
  background:linear-gradient(145deg,rgba(29,37,52,.88),rgba(10,14,22,.92)); color:var(--text); text-align:left; cursor:pointer;
}
.text-reveal-preset-card:hover { border-color:rgba(120,180,255,.58); }
.text-reveal-preset-card.selected { border-color:var(--good); box-shadow:inset 3px 0 0 var(--good); background:linear-gradient(145deg,rgba(29,67,70,.55),rgba(10,28,32,.82)); }
.text-reveal-preset-card strong { display:block; font-size:12px; margin-bottom:5px; }
.text-reveal-preset-card span { color:var(--accent); font-size:8px; text-transform:uppercase; letter-spacing:.08em; }
.text-reveal-preset-card p { margin:7px 0 0; color:var(--muted); font-size:9px; line-height:1.4; }
.text-reveal-preview-panel { flex:1; min-width:0; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:#05070c; }
.text-reveal-preview-panel > header { min-height:52px; padding:0 16px; display:flex; align-items:center; justify-content:space-between; gap:14px; border-bottom:1px solid var(--line); }
.text-reveal-preview-heading { min-width:0; display:flex; align-items:baseline; gap:10px; }
.text-reveal-preview-panel > header strong { font-size:13px; }
.text-reveal-preview-panel > header span { color:var(--accent); font-size:9px; text-transform:uppercase; letter-spacing:.08em; }
.text-reveal-both-badge { padding:6px 10px; border:1px solid rgba(120,180,255,.42); border-radius:999px; background:rgba(80,135,205,.14); color:#cfe7ff!important; font-weight:750; white-space:nowrap; }
.text-reveal-preview-stage { flex:1; min-height:0; display:flex; align-items:center; justify-content:center; background:radial-gradient(circle at 50% 45%,#1a2435,#070a10 68%); overflow:hidden; }
.text-reveal-preview-stage canvas { display:block; width:100%; height:100%; }
.text-reveal-preview-panel > p { min-height:34px; margin:0; padding:13px 16px; color:var(--muted); font-size:10px; line-height:1.5; border-top:1px solid var(--line); }
@media (max-width: 850px) {
  .text-reveal-library-body { flex-direction:column; overflow:auto; }
  .text-reveal-library-list { width:100%; min-width:0; min-height:320px; }
  .text-reveal-preview-panel { min-height:330px; }
}
.asset-browser-header{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.asset-filter-tabs{
  display: flex;
  gap: 4px;
}
.asset-filter-tab{
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}
.asset-filter-tab:hover{ background: rgba(255,255,255,0.05); }
.asset-filter-tab.active{
  background: rgba(120,180,255,0.15);
  border-color: var(--accent);
  color: var(--accent);
}
.asset-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}
.asset-item{
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  background: rgba(0,0,0,0.3);
}
.asset-item:hover{
  border-color: var(--accent);
  transform: scale(1.02);
}
.asset-item.selected{
  border-color: var(--good);
  box-shadow: 0 0 0 2px rgba(120,255,180,0.3);
}
.asset-item img,
.asset-item video{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-item-overlay{
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-item-icon{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2.5rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}
.asset-item-type{
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  background: rgba(0,0,0,0.6);
}

/* List-style asset browser for audio, shaders, post-fx */
.asset-grid.list-view{
  display: flex;
  flex-direction: column;
  gap: 4px;
  grid-template-columns: none;
}
.asset-grid.list-view .asset-item{
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  height: auto;
}
.asset-grid.list-view .asset-item:hover{
  transform: none;
  background: rgba(120,180,255,0.08);
}
.asset-grid.list-view .asset-item-icon{
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 1.4rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
}
.asset-grid.list-view .asset-item-name{
  flex: 1;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-grid.list-view .asset-item-type{
  position: static;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
}
.asset-grid.list-view .asset-item-overlay{
  display: none;
}
.asset-grid.list-view .asset-item.selected{
  background: rgba(120,255,180,0.1);
  border-color: var(--good);
}
.asset-grid.list-view .asset-item.selected .asset-item-name{
  color: var(--good);
}
.asset-grid.list-view .asset-item.selected .asset-item-icon{
  background: rgba(120,255,180,0.15);
}

/* Readable rows for visual preset libraries: names remain visible instead of
   being sacrificed to badges and owner actions. */
.asset-grid.list-view[data-mode="postfx"] .asset-item,
.asset-grid.list-view[data-mode="shader"] .asset-item,
.asset-grid.list-view[data-mode="scenes"] .asset-item,
.asset-grid.list-view[data-mode="scene"] .asset-item,
.asset-grid.list-view[data-mode="lut"] .asset-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name actions"
    "badges actions";
  gap: 5px 12px;
  min-height: 46px;
  box-sizing: border-box;
  padding: 9px 12px;
  border-width: 1px;
  background: linear-gradient(90deg, rgba(24,31,44,.72), rgba(11,16,25,.52));
}
.asset-grid.list-view[data-mode="postfx"] .asset-item:hover,
.asset-grid.list-view[data-mode="shader"] .asset-item:hover,
.asset-grid.list-view[data-mode="scenes"] .asset-item:hover,
.asset-grid.list-view[data-mode="scene"] .asset-item:hover,
.asset-grid.list-view[data-mode="lut"] .asset-item:hover {
  background: linear-gradient(90deg, rgba(36,49,69,.86), rgba(15,23,36,.7));
}
.asset-grid.list-view[data-mode="postfx"] .asset-item.selected,
.asset-grid.list-view[data-mode="shader"] .asset-item.selected,
.asset-grid.list-view[data-mode="scenes"] .asset-item.selected,
.asset-grid.list-view[data-mode="scene"] .asset-item.selected,
.asset-grid.list-view[data-mode="lut"] .asset-item.selected {
  background: linear-gradient(90deg, rgba(43,92,92,.42), rgba(20,45,50,.35));
  box-shadow: inset 3px 0 0 var(--good), 0 0 0 1px rgba(120,255,180,.12);
}
.asset-grid.list-view[data-mode="postfx"] .asset-item-name,
.asset-grid.list-view[data-mode="shader"] .asset-item-name,
.asset-grid.list-view[data-mode="scenes"] .asset-item-name,
.asset-grid.list-view[data-mode="scene"] .asset-item-name,
.asset-grid.list-view[data-mode="lut"] .asset-item-name {
  grid-area: name;
  min-width: 0;
  align-self: center;
  overflow: visible;
  color: rgba(239,244,252,.92);
  font-size: 12px;
  font-weight: 520;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}
.asset-grid.list-view[data-mode="postfx"] .asset-badges-inline,
.asset-grid.list-view[data-mode="shader"] .asset-badges-inline,
.asset-grid.list-view[data-mode="scenes"] .asset-badges-inline,
.asset-grid.list-view[data-mode="scene"] .asset-badges-inline,
.asset-grid.list-view[data-mode="lut"] .asset-badges-inline {
  grid-area: badges;
  justify-self: start;
  gap: 5px;
  margin-left: 0;
}
.asset-grid.list-view[data-mode="postfx"] .asset-badges-inline .asset-badge,
.asset-grid.list-view[data-mode="shader"] .asset-badges-inline .asset-badge,
.asset-grid.list-view[data-mode="scenes"] .asset-badges-inline .asset-badge,
.asset-grid.list-view[data-mode="scene"] .asset-badges-inline .asset-badge,
.asset-grid.list-view[data-mode="lut"] .asset-badges-inline .asset-badge { margin-left: 0; }
.asset-grid.list-view[data-mode="postfx"] .asset-actions,
.asset-grid.list-view[data-mode="shader"] .asset-actions,
.asset-grid.list-view[data-mode="scenes"] .asset-actions,
.asset-grid.list-view[data-mode="scene"] .asset-actions,
.asset-grid.list-view[data-mode="lut"] .asset-actions {
  grid-area: actions;
  align-self: center;
  margin-left: 0;
}
/* Different icon colors for different asset types */
.asset-grid.list-view[data-mode="audio"] .asset-item-icon{
  background: rgba(255,100,150,0.1);
}
.asset-grid.list-view[data-mode="shader"] .asset-item-icon{
  background: rgba(180,100,255,0.1);
}
.asset-grid.list-view[data-mode="postfx"] .asset-item-icon{
  background: rgba(255,200,100,0.1);
  border-radius: 4px;
  font-size: 0.65rem;
  text-transform: uppercase;
}
/* Cleaner postfx list items without icon */
.asset-grid.list-view[data-mode="postfx"] .asset-item {
  padding: 10px 14px;
}
.asset-grid.list-view[data-mode="postfx"] .asset-item-name {
  flex: 1;
}

/* Asset Preview Modal - Two column layout (Post FX, Shader, Scene) */
.asset-browser-modal.postfx-preview-mode,
.asset-browser-modal.media-preview-mode,
.asset-browser-modal.shader-preview-mode,
.asset-browser-modal.scene-preview-mode,
.asset-browser-modal.audio-preview-mode,
.asset-browser-modal.lut-preview-mode,
.asset-browser-modal.material-preview-mode,
.asset-browser-modal.skysphere-preview-mode,
.asset-browser-modal.surface-map-preview-mode {
  width: min(1480px, calc(100vw - 48px));
  min-width: 0;
  max-width: none;
  height: min(880px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  border-color: rgba(132, 166, 220, 0.22);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.66),
    0 0 0 1px rgba(128, 170, 238, 0.04) inset;
}
.asset-browser-modal.postfx-preview-mode > .demo-modal-body,
.asset-browser-modal.media-preview-mode > .demo-modal-body,
.asset-browser-modal.shader-preview-mode > .demo-modal-body,
.asset-browser-modal.scene-preview-mode > .demo-modal-body,
.asset-browser-modal.audio-preview-mode > .demo-modal-body,
.asset-browser-modal.lut-preview-mode > .demo-modal-body {
  display: flex;
  overflow: hidden;
  padding: 24px;
}
.asset-browser-modal.postfx-preview-mode > .demo-modal-footer,
.asset-browser-modal.shader-preview-mode > .demo-modal-footer,
.asset-browser-modal.scene-preview-mode > .demo-modal-footer,
.asset-browser-modal.audio-preview-mode > .demo-modal-footer,
.asset-browser-modal.lut-preview-mode > .demo-modal-footer {
  padding: 13px 20px;
  background: rgba(5, 9, 16, 0.24);
}
.asset-browser-modal.postfx-preview-mode > .demo-modal-footer .nav-btn,
.asset-browser-modal.shader-preview-mode > .demo-modal-footer .nav-btn,
.asset-browser-modal.scene-preview-mode > .demo-modal-footer .nav-btn,
.asset-browser-modal.audio-preview-mode > .demo-modal-footer .nav-btn,
.asset-browser-modal.lut-preview-mode > .demo-modal-footer .nav-btn {
  min-height: 34px;
  padding-inline: 16px;
}

/* Material library: compact swatch balls plus a single high-quality live preview. */
.asset-browser-modal.material-preview-mode > .demo-modal-body,
.asset-browser-modal.media-preview-mode > .demo-modal-body,
.asset-browser-modal.skysphere-preview-mode > .demo-modal-body,
.asset-browser-modal.surface-map-preview-mode > .demo-modal-body { display:flex; overflow:hidden; }
.material-preview-container { flex:1 1 auto; width:100%; min-width:0; min-height:0; display:flex; gap:18px; }
.media-preview-container { flex:1 1 auto; width:100%; min-width:0; min-height:0; display:flex; gap:18px; }
.media-library-panel { width:500px; min-width:500px; min-height:0; display:flex; flex-direction:column; }
.media-library-tabs { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:7px; margin-bottom:10px; }
.media-library-tabs .asset-filter-tab { min-height:38px; padding:8px 12px; font-size:11px; }
.media-browser-toolbar { gap:8px; }
.media-browser-toolbar .asset-preview-search { flex:1; min-width:0; }
.media-browser-toolbar .asset-preview-search input { width:100%; }
.media-asset-grid { flex:1 1 auto; min-height:0; display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); align-content:start; gap:10px; overflow-y:auto; overscroll-behavior:contain; padding:3px 5px 10px 3px; }
.media-asset-card { position:relative; min-width:0; min-height:180px; aspect-ratio:auto; padding:7px; border:1px solid rgba(255,255,255,.09); border-radius:8px; background:linear-gradient(155deg, rgba(28,35,50,.92), rgba(10,14,22,.96)); cursor:pointer; transition:border-color 120ms ease, transform 120ms ease, background 120ms ease; overflow:hidden; }
.media-asset-card:hover { transform:translateY(-1px); border-color:rgba(119,180,255,.58); background:linear-gradient(155deg, rgba(36,46,65,.96), rgba(12,17,27,.98)); }
.media-asset-card.selected { border-color:var(--good); box-shadow:0 0 0 1px rgba(120,255,180,.22), 0 10px 24px rgba(0,0,0,.24); }
.media-asset-thumb { display:block; width:100%; aspect-ratio:1; object-fit:cover; border-radius:5px; background:#05080d; box-shadow:inset 0 0 0 1px rgba(255,255,255,.055); }
.media-card-name { display:block; margin-top:7px; color:var(--text); font-size:10px; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.media-card-kind { display:block; margin-top:2px; color:var(--muted); font-size:8px; text-transform:uppercase; letter-spacing:.08em; }
.media-asset-card .asset-actions { top:7px; right:7px; }
.media-preview-panel { flex:1; min-width:0; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:#05070c; }
.media-preview-stage { position:relative; flex:1; min-height:0; display:flex; align-items:center; justify-content:center; overflow:hidden; background:linear-gradient(45deg,#0b1019 25%,transparent 25%),linear-gradient(-45deg,#0b1019 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#0b1019 75%),linear-gradient(-45deg,transparent 75%,#0b1019 75%),#111827; background-size:24px 24px; background-position:0 0,0 12px,12px -12px,-12px 0; }
.media-preview-stage img,.media-preview-stage video { display:block; width:100%; height:100%; object-fit:contain; background:rgba(0,0,0,.28); }
.media-preview-stage [hidden] { display:none; }
.media-preview-placeholder { color:var(--muted); font-size:12px; }
.media-preview-copy { display:flex; justify-content:space-between; gap:16px; min-height:22px; padding:8px 13px; border-top:1px solid var(--line2); color:var(--muted); font-size:10px; }
#mediaPreviewMeta { color:#86a9d2; text-align:right; }
.material-library-panel { width:430px; min-width:430px; min-height:0; display:flex; flex-direction:column; }
.material-browser-toolbar { position:relative; z-index:2; flex:0 0 auto; margin-bottom:10px; }
.material-browser-toolbar input { width:100%; padding:8px 11px; border:1px solid var(--line); border-radius:6px; background:rgba(0,0,0,.32); color:var(--text); font:inherit; font-size:12px; }
.material-browser-toolbar:has(.specialized-media-button) { display:flex; align-items:center; gap:8px; }
.material-browser-toolbar:has(.specialized-media-button) input { min-width:0; }
.specialized-media-button { flex:0 0 auto; white-space:nowrap; min-height:34px; }
.material-asset-grid { flex:1 1 auto; min-height:0; display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); align-content:start; gap:9px; overflow-y:auto; overscroll-behavior:contain; padding:3px 5px 10px 3px; }
.material-pagination { flex:0 0 auto; margin:7px 4px 0 3px; padding:8px 0 0; }
.material-pagination[hidden] { display:none; }
.material-pagination .page-info { min-width:150px; }
.material-asset-card { position:relative; min-height:142px; padding:8px 7px 9px; border:1px solid rgba(255,255,255,.09); border-radius:8px; background:linear-gradient(155deg, rgba(28,35,50,.92), rgba(10,14,22,.96)); cursor:pointer; transition:border-color 120ms ease, transform 120ms ease, background 120ms ease; overflow:hidden; }
.material-asset-card:hover { transform:translateY(-1px); border-color:rgba(119,180,255,.58); background:linear-gradient(155deg, rgba(36,46,65,.96), rgba(12,17,27,.98)); }
.material-asset-card.selected { border-color:var(--good); box-shadow:0 0 0 1px rgba(120,255,180,.22), 0 10px 24px rgba(0,0,0,.24); }
.material-thumbnail-wrap { position:relative; display:flex; align-items:center; justify-content:center; width:96px; height:96px; margin:0 auto 5px; border-radius:8px; overflow:hidden; background:radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--material-thumb-bg, #111723) 72%, #314260), var(--material-thumb-bg, #111723) 72%); box-shadow:inset 0 0 0 1px rgba(255,255,255,.055), 0 8px 18px rgba(0,0,0,.32); }
.material-thumbnail-sphere { position:relative; display:block; width:72px; height:72px; overflow:hidden; border-radius:50%; background:var(--material-thumb-color, #7ab8ff); box-shadow:inset -14px -17px 22px rgba(0,0,0,.58), inset 6px 7px 12px rgba(255,255,255,.12), 0 10px 15px rgba(0,0,0,.48); }
.material-thumbnail { position:absolute; inset:0; width:100%; height:100%; display:block; object-fit:cover; opacity:.82; }
.material-thumbnail-sphere::before { content:""; position:absolute; z-index:1; inset:0; border-radius:inherit; background:radial-gradient(circle at 34% 25%, rgba(255,255,255,.72) 0 3%, rgba(255,255,255,.18) 10%, transparent 31%), radial-gradient(circle at 64% 70%, transparent 42%, rgba(0,0,0,.42) 78%); pointer-events:none; }
.material-thumbnail-sphere::after { content:""; position:absolute; z-index:2; inset:0; border-radius:inherit; box-shadow:inset 0 0 0 1px rgba(255,255,255,.17); pointer-events:none; }
.material-card-name { display:block; color:var(--text); font-size:10px; line-height:1.2; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.material-card-kind { display:block; margin-top:3px; color:var(--muted); font-size:8px; text-transform:uppercase; letter-spacing:.08em; text-align:center; }
.material-asset-card .asset-actions { top:5px; right:5px; }
.material-asset-card .asset-badges { top:5px; left:5px; right:auto; }
.material-preview-panel { flex:1; min-width:0; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:#090d15; }
.material-preview-canvas-wrap { flex:1; min-height:0; display:flex; align-items:center; justify-content:center; background:radial-gradient(circle at 50% 44%, #182237 0, #090d15 62%, #06080d 100%); overflow:hidden; }
#materialPreviewCanvas { width:100%; height:100%; object-fit:contain; cursor:grab; touch-action:none; }
#materialPreviewCanvas.is-dragging { cursor:grabbing; }
.material-preview-copy { display:flex; justify-content:space-between; gap:16px; min-height:22px; padding:8px 13px; border-top:1px solid var(--line2); color:var(--muted); font-size:10px; }
#materialPreviewTags { color:#86a9d2; text-align:right; }
.procedural-material-root-link { padding:0; border:0; background:none; color:var(--accent); font:inherit; text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
.procedural-material-root-link:hover { color:var(--text); }

/* Skyspheres: panoramic swatches with an interactive spherical seam preview. */
.skysphere-preview-container { flex:1 1 auto; width:100%; min-width:0; min-height:0; display:flex; gap:18px; }
.skysphere-library-panel { width:440px; min-width:440px; min-height:0; display:flex; flex-direction:column; }
.skysphere-asset-grid { flex:1 1 auto; min-height:0; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); align-content:start; gap:10px; overflow-y:auto; overscroll-behavior:contain; padding:3px 5px 10px 3px; }
.skysphere-asset-card { position:relative; min-height:124px; padding:7px; border:1px solid rgba(255,255,255,.09); border-radius:8px; background:linear-gradient(155deg, rgba(28,35,50,.92), rgba(10,14,22,.96)); cursor:pointer; transition:border-color 120ms ease, transform 120ms ease, background 120ms ease; overflow:hidden; }
.skysphere-asset-card:hover { transform:translateY(-1px); border-color:rgba(119,180,255,.58); }
.skysphere-asset-card.selected { border-color:var(--good); box-shadow:0 0 0 1px rgba(120,255,180,.22), 0 10px 24px rgba(0,0,0,.24); }
.skysphere-thumbnail { display:block; width:100%; aspect-ratio:2 / 1; object-fit:cover; border-radius:5px; background:#05080d; box-shadow:inset 0 0 0 1px rgba(255,255,255,.055); }
.skysphere-card-name { display:block; margin-top:7px; color:var(--text); font-size:10px; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.skysphere-card-kind { display:block; margin-top:2px; color:var(--muted); font-size:8px; text-transform:uppercase; letter-spacing:.08em; }
.skysphere-asset-card .asset-actions { top:7px; right:7px; }
.skysphere-preview-panel { flex:1; min-width:0; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:#05070c; }
.skysphere-preview-canvas-wrap { position:relative; flex:1; width:100%; min-width:0; min-height:180px; overflow:hidden; contain:layout size paint; background:radial-gradient(circle at 50% 46%, #1a2538 0, #080c14 64%, #04060a 100%); }
#skyspherePreviewCanvas { position:absolute; inset:0; display:block; width:100%; height:100%; min-width:0; min-height:0; max-width:none; max-height:none; cursor:grab; touch-action:none; }
#skyspherePreviewCanvas.is-dragging { cursor:grabbing; }
.skysphere-preview-copy { display:flex; justify-content:space-between; gap:16px; min-height:22px; padding:8px 13px; border-top:1px solid var(--line2); color:var(--muted); font-size:10px; }
#skyspherePreviewTags { color:#86a9d2; text-align:right; }

/* Surface maps: purpose-built square swatches and an interactive relief preview. */
.surface-map-preview-container { flex:1 1 auto; width:100%; min-width:0; min-height:0; display:flex; gap:18px; }
.surface-map-library-panel { width:440px; min-width:440px; min-height:0; display:flex; flex-direction:column; }
.surface-map-asset-grid { flex:1 1 auto; min-height:0; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); align-content:start; gap:10px; overflow-y:auto; overscroll-behavior:contain; padding:3px 5px 10px 3px; }
.surface-map-asset-card { position:relative; min-height:188px; padding:7px; border:1px solid rgba(255,255,255,.09); border-radius:8px; background:linear-gradient(155deg, rgba(28,35,50,.92), rgba(10,14,22,.96)); cursor:pointer; transition:border-color 120ms ease, transform 120ms ease, background 120ms ease; overflow:hidden; }
.surface-map-asset-card:hover { transform:translateY(-1px); border-color:rgba(119,180,255,.58); }
.surface-map-asset-card.selected { border-color:var(--good); box-shadow:0 0 0 1px rgba(120,255,180,.22), 0 10px 24px rgba(0,0,0,.24); }
.surface-map-thumbnail { display:block; width:100%; aspect-ratio:1; object-fit:cover; border-radius:5px; background:#101522; box-shadow:inset 0 0 0 1px rgba(255,255,255,.055); }
.surface-map-card-name { display:block; margin-top:7px; color:var(--text); font-size:10px; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.surface-map-card-kind { display:block; margin-top:2px; color:var(--muted); font-size:8px; text-transform:uppercase; letter-spacing:.08em; }
.surface-map-asset-card .asset-actions { top:7px; right:7px; }
.surface-map-preview-panel { flex:1; min-width:0; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:#05070c; }
.surface-map-preview-canvas-wrap { position:relative; flex:1; width:100%; min-width:0; min-height:180px; overflow:hidden; contain:layout size paint; background:radial-gradient(circle at 50% 45%, #1b263b 0, #090d16 62%, #04060a 100%); }
#surfaceMapPreviewCanvas { position:absolute; inset:0; display:block; width:100%; height:100%; min-width:0; min-height:0; max-width:none; max-height:none; cursor:grab; touch-action:none; }
#surfaceMapPreviewCanvas.is-dragging { cursor:grabbing; }
.surface-map-preview-copy { display:flex; justify-content:space-between; gap:16px; min-height:22px; padding:8px 13px; border-top:1px solid var(--line2); color:var(--muted); font-size:10px; }
#surfaceMapPreviewTags { color:#86a9d2; text-align:right; }
.asset-preview-container {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  gap: 24px;
}
.asset-preview-list-panel {
  width: clamp(420px, 32vw, 480px);
  min-width: clamp(420px, 32vw, 480px);
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.asset-preview-list-panel .asset-grid {
  flex: 1;
  max-height: none;
  overflow-y: auto;
}
.asset-preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.asset-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  box-sizing: border-box;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(25,32,47,.78), rgba(8,12,20,.76));
  border-bottom: 1px solid var(--line);
}
.asset-preview-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.asset-preview-name {
  font-size: 14px;
  color: var(--accent);
  font-weight: 650;
}
.asset-preview-source-button {
  flex: 0 0 auto;
  min-height: 29px;
  padding: 5px 10px;
  color: #9edff0;
  border-color: rgba(102, 217, 239, .22);
}
.asset-preview-canvas-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(rgba(255,255,255,0.03) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}
.asset-preview-canvas {
  display: block;
}
.visual-asset-preview-canvas {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
  background: #000;
}
.visual-asset-preview-video {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}
.visual-asset-preview-video[hidden],
.visual-asset-preview-canvas[hidden] { display: none; }
.asset-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: var(--muted);
  font-size: 13px;
}
.asset-preview-loading.hidden { display: none; }
.asset-preview-hint {
  min-height: 42px;
  box-sizing: border-box;
  padding: 10px 16px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Spacious, consistent toolbars for all visual asset pickers. */
.asset-preview-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
}
.asset-preview-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.asset-preview-search svg {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: rgba(190, 205, 228, .62);
  stroke-width: 1.7;
  stroke-linecap: round;
  pointer-events: none;
}
.asset-preview-search input {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  padding: 8px 36px 8px 39px;
  border: 1px solid rgba(137, 166, 211, .2);
  border-radius: 8px;
  outline: none;
  background: rgba(3, 7, 13, .54);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  transition: border-color 130ms ease, background 130ms ease, box-shadow 130ms ease;
}
.asset-preview-search input::placeholder { color: rgba(180, 195, 218, .42); }
.asset-preview-search input:focus {
  border-color: rgba(101, 166, 245, .72);
  background: rgba(4, 9, 17, .76);
  box-shadow: 0 0 0 3px rgba(76, 145, 230, .12);
}
.editor-search-field {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}
.editor-search-field > input {
  box-sizing: border-box;
  width: 100%;
  padding-right: 38px !important;
}
.editor-search-field > input[type="search"]::-webkit-search-cancel-button {
  appearance: none;
}
.editor-search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(185, 199, 220, .58);
  font: 500 18px/1 sans-serif;
  cursor: pointer;
  opacity: 1;
  transform: translateY(-50%);
  transition: opacity 120ms ease, color 120ms ease, background-color 120ms ease;
}
.editor-search-clear:hover,
.editor-search-clear:focus-visible {
  outline: none;
  background: rgba(255,255,255,.075);
  color: var(--text);
}
.editor-search-field:has(> input:placeholder-shown) > .editor-search-clear {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}
.asset-folder-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.asset-folder-button {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(137, 166, 211, .16);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(25, 32, 46, .64), rgba(11, 16, 25, .58));
  color: rgba(221, 229, 241, .72);
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.asset-folder-button:hover {
  border-color: rgba(112, 172, 238, .4);
  background: linear-gradient(180deg, rgba(35, 48, 68, .78), rgba(15, 23, 36, .7));
  color: var(--text);
}
.asset-folder-button.active {
  border-color: rgba(103, 174, 246, .65);
  background: linear-gradient(180deg, rgba(40, 88, 132, .46), rgba(19, 47, 73, .42));
  color: #a9d4ff;
  box-shadow: inset 2px 0 0 #73b8ff;
}
.asset-folder-icon {
  position: relative;
  width: 15px;
  height: 11px;
  box-sizing: border-box;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: .72;
}
.asset-folder-icon::before {
  content: '';
  position: absolute;
  left: 1px;
  top: -4px;
  width: 7px;
  height: 4px;
  box-sizing: border-box;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background: inherit;
}
.asset-folder-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-folder-count {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .28);
  color: rgba(190, 205, 227, .58);
  font-size: 8px;
  text-align: center;
}
.asset-folder-button.active .asset-folder-count { color: #badafa; }
.asset-preview-toolbar-actions {
  display: flex;
  min-height: 28px;
  justify-content: flex-start;
}
.asset-preview-toolbar-actions .nav-btn { min-height: 29px; padding-inline: 11px; }
.preview-selected-asset-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: .015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-preview-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  font-family: inherit;
  font-size: 10px;
  margin: 0 2px;
}
/* Legacy class names for backwards compatibility */
.postfx-preview-container { display:flex; flex:1; min-width:0; min-height:0; gap:24px; }
.postfx-list-panel { width:clamp(420px, 32vw, 480px); min-width:clamp(420px, 32vw, 480px); min-height:0; display:flex; flex-direction:column; }
.postfx-list-panel .asset-grid { flex: 1; max-height: none; overflow-y: auto; }
.postfx-preview-panel { flex:1; min-width:0; display:flex; flex-direction:column; background:rgba(0,0,0,0.4); border-radius:10px; overflow:hidden; border:1px solid var(--line); }
.postfx-preview-header { display:flex; align-items:center; min-height:50px; box-sizing:border-box; padding:12px 16px; background:linear-gradient(180deg, rgba(25,32,47,.78), rgba(8,12,20,.76)); border-bottom:1px solid var(--line); }
.postfx-preview-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.postfx-preview-effect-name { font-size:14px; color:var(--text); font-weight:650; }
.postfx-preview-canvas-wrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(rgba(255,255,255,0.03) 0% 25%, transparent 0% 50%) 50% / 20px 20px; }
#postfxPreviewCanvas { display:block; }
.postfx-preview-gpu-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.postfx-preview-loading { z-index: 2; }
.postfx-preview-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); color: var(--muted); font-size: 13px; }
.postfx-preview-loading.hidden { display: none; }
.postfx-preview-hint { min-height:42px; box-sizing:border-box; padding:10px 16px; background:rgba(0,0,0,0.3); border-top:1px solid var(--line); font-size:11px; color:var(--muted); display:flex; align-items:center; gap:16px; }
.postfx-preview-hint kbd { display: inline-block; padding: 2px 6px; background: rgba(255,255,255,0.1); border-radius: 3px; font-family: inherit; font-size: 10px; margin: 0 2px; }
/* LUT Preview Modal */
.lut-preview-container { display:flex; flex:1; min-width:0; min-height:0; gap:24px; }
.lut-list-panel { width:clamp(420px, 32vw, 480px); min-width:clamp(420px, 32vw, 480px); min-height:0; display:flex; flex-direction:column; }
.lut-list-panel .asset-grid { flex: 1; max-height: none; overflow-y: auto; }
.lut-preview-panel { flex:1; min-width:0; display:flex; flex-direction:column; background:rgba(0,0,0,0.4); border-radius:10px; overflow:hidden; border:1px solid var(--line); }
.lut-preview-header { display:flex; align-items:center; min-height:50px; box-sizing:border-box; padding:12px 16px; background:linear-gradient(180deg, rgba(25,32,47,.78), rgba(8,12,20,.76)); border-bottom:1px solid var(--line); }
.lut-preview-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.lut-preview-name { font-size:14px; color:var(--text); font-weight:650; }
.lut-preview-canvas-wrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(rgba(255,255,255,0.03) 0% 25%, transparent 0% 50%) 50% / 20px 20px; }
#lutPreviewCanvas { display:block; }
.lut-preview-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); color: var(--muted); font-size: 13px; }
.lut-preview-loading.hidden { display: none; }
.lut-preview-hint { min-height:42px; box-sizing:border-box; padding:10px 16px; background:rgba(0,0,0,0.3); border-top:1px solid var(--line); font-size:11px; color:var(--muted); display:flex; align-items:center; gap:16px; }
.lut-preview-hint kbd { display: inline-block; padding: 2px 6px; background: rgba(255,255,255,0.1); border-radius: 3px; font-family: inherit; font-size: 10px; margin: 0 2px; }

@media (max-width: 1180px) {
  .asset-browser-modal.postfx-preview-mode,
  .asset-browser-modal.shader-preview-mode,
  .asset-browser-modal.scene-preview-mode,
  .asset-browser-modal.audio-preview-mode,
  .asset-browser-modal.lut-preview-mode {
    width: calc(100vw - 28px);
    height: calc(100dvh - 28px);
    max-height: calc(100dvh - 28px);
  }
  .asset-browser-modal.postfx-preview-mode > .demo-modal-body,
  .asset-browser-modal.shader-preview-mode > .demo-modal-body,
  .asset-browser-modal.scene-preview-mode > .demo-modal-body,
  .asset-browser-modal.audio-preview-mode > .demo-modal-body,
  .asset-browser-modal.lut-preview-mode > .demo-modal-body { padding: 16px; }
  .asset-preview-container,
  .postfx-preview-container,
  .lut-preview-container { gap: 16px; }
  .asset-preview-list-panel,
  .postfx-list-panel,
  .lut-list-panel {
    width: 390px;
    min-width: 390px;
  }
}

@media (max-width: 820px) {
  .asset-browser-modal.postfx-preview-mode > .demo-modal-body,
  .asset-browser-modal.shader-preview-mode > .demo-modal-body,
  .asset-browser-modal.scene-preview-mode > .demo-modal-body,
  .asset-browser-modal.audio-preview-mode > .demo-modal-body,
  .asset-browser-modal.lut-preview-mode > .demo-modal-body { overflow-y: auto; }
  .asset-preview-container,
  .postfx-preview-container,
  .lut-preview-container {
    flex-direction: column;
    overflow: visible;
  }
  .asset-preview-list-panel,
  .postfx-list-panel,
  .lut-list-panel {
    width: 100%;
    min-width: 0;
    min-height: 300px;
    flex: 0 0 46%;
  }
  .asset-preview-panel,
  .audio-preview-panel,
  .postfx-preview-panel,
  .lut-preview-panel { min-height: 300px; }
}
.asset-grid.list-view[data-mode="lut"] .asset-item { padding: 8px 12px; }
.asset-grid.list-view[data-mode="lut"] .asset-item-icon { display: none; }
.asset-grid.list-view[data-mode="lut"] .asset-item-name { flex: 1; }
/* Shader/Scene/Audio list item styles */
.asset-grid.list-view[data-mode="shader"] .asset-item,
.asset-grid.list-view[data-mode="scene"] .asset-item,
.asset-grid.list-view[data-mode="audio"] .asset-item {
  padding: 8px 12px;
}
.asset-grid.list-view[data-mode="shader"] .asset-item-icon,
.asset-grid.list-view[data-mode="scene"] .asset-item-icon,
.asset-grid.list-view[data-mode="audio"] .asset-item-icon {
  display: none;
}
.asset-grid.list-view[data-mode="shader"] .asset-item-name,
.asset-grid.list-view[data-mode="scene"] .asset-item-name,
.asset-grid.list-view[data-mode="audio"] .asset-item-name {
  flex: 1;
}
/* Highlight selected item in list for keyboard nav */
.asset-grid.list-view .asset-item.keyboard-focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Audio Preview Modal */
.asset-browser-modal.audio-preview-mode {
  width: min(1480px, calc(100vw - 48px));
  min-width: 0;
  max-width: none;
  height: min(880px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
}
.audio-preview-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at center, #0a0a15 0%, #050508 100%);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.audio-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid var(--line);
}
.audio-preview-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.audio-preview-name {
  font-size: 13px;
  color: #ff6b9d;
  font-weight: 500;
}
.audio-preview-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#audioPreviewCanvas {
  display: block;
  width: 100%;
  height: 100%;
}
.audio-preview-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: rgba(0,0,0,0.5);
  border-top: 1px solid var(--line);
}
.audio-preview-play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #ff6b9d;
  background: rgba(255, 107, 157, 0.1);
  color: #ff6b9d;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.audio-preview-play-btn:hover {
  background: rgba(255, 107, 157, 0.3);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 107, 157, 0.4);
}
.audio-preview-play-btn:active {
  transform: scale(0.95);
}
.audio-preview-play-btn.playing {
  border-color: #6bffb8;
  color: #6bffb8;
  background: rgba(107, 255, 184, 0.1);
  animation: audio-pulse 1s ease-in-out infinite;
}
.audio-preview-play-btn.playing:hover {
  background: rgba(107, 255, 184, 0.3);
  box-shadow: 0 0 20px rgba(107, 255, 184, 0.4);
}
@keyframes audio-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(107, 255, 184, 0.3); }
  50% { box-shadow: 0 0 25px rgba(107, 255, 184, 0.6); }
}
.audio-preview-time {
  font-size: 12px;
  color: var(--muted);
  font-family: monospace;
  min-width: 80px;
}
.audio-preview-hint {
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 16px;
}
.audio-preview-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  font-family: inherit;
  font-size: 10px;
  margin: 0 2px;
}

/* AI Generation spinner and status */
@keyframes ai-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes ai-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
@keyframes ai-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(100,150,255,0.2); }
  50% { box-shadow: 0 0 25px rgba(100,150,255,0.4); }
}
.ai-status-container{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 13px;
  background: linear-gradient(135deg, rgba(60,80,140,0.15), rgba(80,60,140,0.15));
  border: 1px solid rgba(100,150,255,0.3);
  animation: ai-glow 2s ease-in-out infinite;
}
.ai-status-container.error{
  background: linear-gradient(135deg, rgba(140,60,60,0.15), rgba(140,80,60,0.15));
  border-color: rgba(255,100,100,0.35);
  animation: none;
}
.ai-status-container.success{
  background: linear-gradient(135deg, rgba(60,140,80,0.15), rgba(60,140,100,0.15));
  border-color: rgba(100,255,150,0.35);
  animation: none;
}
.ai-status-row{
  display: none; /* Hidden - status shown in textarea instead */
}
/* Textarea generating state */
textarea.ai-generating {
  opacity: 0.5;
  pointer-events: none;
  color: var(--muted) !important;
}
.ai-spinner{
  width: 18px;
  height: 18px;
  border: 2px solid rgba(100,150,255,0.2);
  border-top-color: rgba(100,180,255,1);
  border-radius: 50%;
  animation: ai-spinner 0.8s linear infinite;
  flex-shrink: 0;
}
.ai-status-container.error .ai-spinner{ display: none; }
.ai-status-container.success .ai-spinner{ display: none; }
.ai-status-text{
  flex: 0 0 auto;
  color: #93c5fd;
  font-weight: 500;
  font-size: 12px;
  animation: ai-pulse 1.5s ease-in-out infinite;
}
.ai-status-container.error .ai-status-text{
  color: #fca5a5;
  animation: none;
}
.ai-status-container.success .ai-status-text{
  color: #86efac;
  animation: none;
}
.ai-status-icon{
  font-size: 14px;
  flex-shrink: 0;
}
.ai-streaming-text{
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  max-height: 100px;
  overflow-y: auto;
  padding: 12px 14px;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Prominent AI Generate Button */
.ai-generate-btn {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%) !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 12px 24px !important;
  border-radius: 8px !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all 0.2s ease !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.ai-generate-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c7ff7 0%, #9d6ff8 50%, #b76ef9 100%) !important;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.ai-generate-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.ai-generate-btn:disabled {
  background: linear-gradient(135deg, #4b4d7a 0%, #5b4d7a 50%, #6b4d7a 100%) !important;
  color: rgba(255,255,255,0.5) !important;
  box-shadow: none;
  cursor: not-allowed;
}
.ai-generate-btn .btn-icon {
  margin-right: 6px;
}
/* Keyboard hint for prompt */
.ai-prompt-hint {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  opacity: 0.7;
  line-height: 1.5;
}
.ai-progress-bar{
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.ai-progress-fill{
  height: 100%;
  background: linear-gradient(90deg, rgba(100,150,255,0.9), rgba(180,100,255,0.9));
  border-radius: 2px;
  transition: width 0.3s ease-out;
}

/* Asset management buttons (delete, rename, default) */
.asset-actions{
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 7px;
  background: rgba(5,9,15,.28);
  opacity: 0;
  transition: opacity 0.15s;
}
.asset-item:hover .asset-actions,
.asset-item.selected .asset-actions{
  opacity: 1;
}
.asset-action-btn{
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.asset-action-btn:hover{
  background: rgba(255,255,255,0.15);
  color: var(--text);
}
.asset-action-btn.delete:hover{
  background: rgba(255,100,100,0.2);
  color: #f88;
}
.asset-action-btn.default{
  font-size: 14px;
}
.asset-action-btn.default.active{
  background: rgba(255,200,80,0.25);
  color: #fc8;
}
.asset-action-btn.rename .ui-icon{
  width: 15px;
  height: 15px;
}
.asset-badge{
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
}
.asset-badge.owner{
  background: rgba(120,180,255,0.2);
  color: rgba(120,180,255,0.9);
}
.asset-badge.default-badge{
  background: rgba(255,200,80,0.2);
  color: rgba(255,200,80,0.9);
}
.asset-badges-inline{
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}
/* Grid view asset actions */
.asset-grid:not(.list-view) .asset-actions{
  position: absolute;
  top: 4px;
  left: 4px;
  right: auto;
  z-index: 5;
}
.asset-grid:not(.list-view) .asset-badges{
  position: absolute;
  bottom: 28px;
  left: 4px;
  display: flex;
  gap: 2px;
}

/* Asset browser pagination */
.asset-pagination{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.asset-pagination[hidden]{
  display: none;
}
.asset-pagination button{
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  transition: all 0.15s;
}
.asset-pagination button:hover:not(:disabled){
  background: rgba(255,255,255,0.1);
  border-color: var(--accent);
}
.asset-pagination button:disabled{
  opacity: 0.3;
  cursor: not-allowed;
}
.asset-pagination .page-info{
  font-size: 11px;
  color: var(--muted);
  min-width: 80px;
  text-align: center;
}

.btn{
  appearance:none;border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
  font: inherit;
}
.btn:hover{background: rgba(255,255,255,.10);}
.btn:active{transform: translateY(1px);}
.btn:disabled{opacity:0.35; cursor:not-allowed;}
.btn.primary{border-color: rgba(120,180,255,.35); background: rgba(120,180,255,.10);}
.btn.primary:hover{background: rgba(120,180,255,.16);}
/* Use an opaque fill so playback buttons match on the toolbar and clip header. */
#btnPlayPause.is-playing,
.clip-look-column.playing .clip-launch{
  background: color-mix(in srgb, #78b4ff 33%, var(--panel));
  color: var(--accent);
}
/* Rebuild button style - matches nav-btn-solo */
.rebuild-btn{
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rebuild-btn:hover{
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
/* Rebuild required section */
.rebuild-required-group{
  background: rgba(255,140,0,0.05);
  border-radius: 8px;
}
.rebuild-required-group .param-group-title{
  color: #ff9933;
}
.rebuild-required-group > .param-group-title:not(.param-disclosure-trigger){
  padding-bottom: 8px;
  margin-bottom: 8px;
}
/* Compact number input for rebuild sections */
.rebuild-input{
  width: 80px !important;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 4px 8px;
  font-size: 11px;
}
.rebuild-input:focus{
  border-color: var(--accent);
  outline: none;
}
/* Dropdown styling for rebuild sections */
.rebuild-select{
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 4px 8px;
  font-size: 11px;
  width: 100%;
  cursor: pointer;
}
.rebuild-select:focus{
  border-color: var(--accent);
  outline: none;
}
.btn.icon-btn{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 36px;
  min-width: 36px;
  box-sizing: border-box;
}
.btn.icon-btn svg{
  flex-shrink: 0;
}
.btn.icon-btn.loop-active{
  background: linear-gradient(135deg, rgba(255,170,100,0.25), rgba(255,130,80,0.15));
  border-color: rgba(255,150,80,0.5);
  color: rgba(255,180,120,1);
}
.btn.icon-btn.loop-active:hover{
  background: linear-gradient(135deg, rgba(255,170,100,0.35), rgba(255,130,80,0.25));
}
.btn-divider{
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}
.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 36px;
  box-sizing: border-box;
  border:1px solid var(--line);
  border-radius:12px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size:12px;
  white-space:nowrap;
}
.spacer{flex:1;}

/* Sharing a presentation is separate from saving its complete editor session. */
.share-target-picker { display:flex; margin:8px; padding:3px; border:1px solid var(--line); border-radius:8px; gap:3px; }
.share-target-picker button { flex:1; border:0; border-radius:5px; padding:8px 12px; color:var(--muted); background:transparent; font:inherit; cursor:pointer; }
.share-target-picker button[aria-pressed="true"] { color:var(--text); background:rgba(110,168,254,.16); }
.share-target-picker button:disabled { opacity:.4; cursor:default; }
.share-target-summary { max-width:310px; padding:2px 16px 12px; font-size:12px; line-height:1.5; color:var(--muted); overflow-wrap:anywhere; }
.share-session-label { margin-top:8px; padding:12px 16px 4px; border-top:1px solid var(--line); font-size:11px; color:var(--muted); }
#exportLookDurationRow[hidden] { display:none; }
#publishSuccessLink { display:inline-flex; align-items:center; text-decoration:none; }

/* Authored groups share the compact component row rhythm. */
.scene-group-actions button { font:inherit; font-size:11px; color:var(--text-primary,#d7e5f0); border:1px solid #34485a; border-radius:6px; background:#15212c; padding:6px 9px; cursor:pointer; }
.scene-authored-group { border:1px solid rgba(var(--layer-component-rgb), .45); border-radius:8px; overflow:hidden; }
.scene-authored-group-heading { display:flex; align-items:stretch; position:relative; background:rgba(var(--layer-component-rgb), .12); }
.scene-authored-group-heading > .modular-component-card { flex:1; min-width:0; border:0; border-radius:0; margin:0; }
.scene-authored-group-heading .scene-component-disclosure-spacer { display:none; }
.scene-authored-group-toggle { flex:0 0 28px; padding:0; border:0; background:transparent; color:#c1d0e1; cursor:pointer; }
.scene-authored-group-toggle[aria-expanded="true"] .scene-component-folder-chevron { display:inline-block; transform:rotate(90deg); }
.scene-authored-group-count { align-self:center; padding:0 8px; font-size:11px; color:#9aaabb; }
.scene-authored-group-children { display:flex; flex-direction:column; gap:6px; padding:6px 6px 6px 18px; border-top:1px solid #344252; }
.scene-authored-group.has-selection { border-color:rgb(var(--layer-component-rgb)); }
.scene-group-actions { display:flex; gap:6px; margin-top:8px; }
.scene-group-shared input[type="number"] { width:100%; min-width:0; }
.scene-group-membership select { width:100%; }
.scene-hierarchy-component-section.layer-component-group-installed .scene-authored-group-heading .scene-hierarchy-component-card {
  width:auto; margin:0; border:0; border-radius:0;
}
.scene-hierarchy-component-section.layer-component-group-installed .scene-authored-group-heading .modular-component-select {
  grid-template-columns:28px minmax(0,1fr) auto;
  padding:6px 6px 6px 0;
}
.scene-authored-group-toggle:focus-visible { outline:2px solid #b6ddff; outline-offset:-3px; }
#scene_group_name,
.scene-group-membership select,
.scene-group-shared input[type="number"] {
  box-sizing:border-box; width:100%; min-height:28px; padding:5px 8px;
  border:1px solid #344252; border-radius:6px; background:#101720;
  color:#d7e5f0; font:inherit; font-size:12px;
}
.scene-group-shared input[type="color"] { width:36px; height:28px; padding:2px; border:1px solid #344252; border-radius:6px; background:#101720; }

/* Quiet, reusable guidance inside parameter panels. */
.param-info-box {
  margin: 8px 0 16px;
  padding: 9px 11px;
  border: 1px solid rgba(120,180,255,.12);
  border-radius: 6px;
  background: rgba(120,180,255,.045);
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.param-info-box[hidden] { display:none; }
.renderer-quality-panel select { max-width:100%; }
.renderer-quality-panel .param-info-box:last-child { margin-bottom:0; }
