/* The main screen. Neutral chrome and one lime accent, so the effect is the only saturated thing on screen.
   The stage runs edge to edge, and at 1280 x 720 and larger the page itself never scrolls. */
:root {
  --n-950: #0b0b0b; --n-900: #131313; --n-850: #1a1a1a; --n-800: #222; --n-700: #333; --n-600: #4d4d4d;
  --n-400: #8f8f8f; --n-300: #b4b4b4; --n-200: #d0d0d0; --n-50: #f4f4f4;
  --signal: #d9ff4a; --signal-ink: #141a00;
  --ctl: 30px; --r: 3px; --gap: 8px;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --console-h: 196px;
  --tune-w: 380px;
}
html, body { height: 100%; }
body { background: var(--n-950); }
body[data-renderer="elegant"] { overflow: hidden; }
#parked, [hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ---------- layout ---------- */
.studio {
  height: 100vh; height: 100dvh; overflow: hidden; display: grid; font: 400 13px/1.3 var(--sans); color: var(--n-50);
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto var(--console-h);
  grid-template-areas: "stage tune" "transport tune" "console console";
}
.st-stage { grid-area: stage; position: relative; overflow: hidden; background: #080808; min-height: 0; min-width: 0; }
.st-fill { position: absolute; inset: 0; }
.st-transport { grid-area: transport; background: var(--n-900); border-top: 1px solid var(--n-700); min-width: 0; }
.tune { grid-area: tune; min-height: 0; }
.st-console { grid-area: console; display: grid; grid-template-columns: 262px minmax(0, 1fr) 264px; background: var(--n-900); border-top: 1px solid var(--n-700); min-height: 0; }
.st-col { padding: 10px 14px; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 7px; }
.st-col + .st-col { border-left: 1px solid var(--n-700); }

/* ---------- controls ---------- */
.studio button, .studio select, .studio input[type=number], .studio input[type=text] { font: inherit; }
.studio .btn, .pop-wrap .btn, .classic .btn, #parked .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ctl); padding: 0 10px;
  border: 1px solid var(--n-600); border-radius: var(--r); background: var(--n-850); color: var(--n-50);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background-color .12s, border-color .12s;
}
.studio .btn:hover, .classic .btn:hover { background: var(--n-700); border-color: var(--n-600); }
.studio .btn:disabled, .classic .btn:disabled { color: var(--n-400); background: var(--n-850); cursor: default; opacity: 1; }
.studio .btn svg, .classic .btn svg { width: 14px; height: 14px; flex: none; }
.studio .btn.icon, .classic .btn.icon { width: var(--ctl); padding: 0; }
.studio .btn.ghost { background: transparent; border-color: transparent; color: var(--n-200); }
.studio .btn.ghost:hover { background: var(--n-700); color: var(--n-50); }
.studio .btn.white { background: var(--n-50); border-color: var(--n-50); color: #0b0b0b; font-weight: 600; }
.studio .btn.white:hover { background: #fff; border-color: #fff; }
.studio .btn.signal, .classic .btn.signal { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-weight: 600; }
.studio .btn.signal:hover, .classic .btn.signal:hover { background: #e6ff7c; border-color: #e6ff7c; }
.studio .btn.wide { width: 100%; }
.studio .btn em { margin-left: auto; font: 400 12px var(--mono); font-style: normal; opacity: .8; }
.studio select, .studio input[type=number], .studio input[type=text] {
  height: var(--ctl); width: 100%; padding: 0 8px; border: 1px solid var(--n-600); border-radius: var(--r); background-color: var(--n-850); color: var(--n-50); font-size: 13px;
}
.studio select {
  appearance: none; padding-right: 22px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--n-300) 50%), linear-gradient(-45deg, transparent 50%, var(--n-300) 50%);
  background-size: 5px 5px; background-position: right 12px center, right 7px center; background-repeat: no-repeat;
}
.studio select:hover, .studio input:hover { background-color: var(--n-700); border-color: var(--n-600); }
.studio input[type=number] { appearance: textfield; font-family: var(--mono); font-size: 12px; }
.studio input[type=number]::-webkit-inner-spin-button { appearance: none; margin: 0; }
.studio input[type=range] { accent-color: var(--signal); height: 16px; }
.studio input[type=checkbox] { accent-color: var(--signal); width: 14px; height: 14px; margin: 0; }
.seg { display: inline-flex; flex: none; border: 1px solid var(--n-600); border-radius: var(--r); overflow: hidden; background: var(--n-900); }
.studio .seg button { height: calc(var(--ctl) - 2px); padding: 0 10px; background: none; border: 0; border-left: 1px solid var(--n-600); border-radius: 0; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--n-200); }
.studio .seg button:first-child { border-left: 0; }
.studio .seg button:hover:not(:disabled) { background: var(--n-700); }
.studio .seg button[aria-pressed=true] { background: var(--n-600); color: #fff; }
.studio .seg button:disabled { color: var(--n-400); cursor: not-allowed; opacity: 1; background: none; }
.studio .seg button:focus-visible { outline-offset: -3px; }
h2 { text-transform: none; letter-spacing: 0; }
.studio h2, .studio h3 { font-size: 13px; font-weight: 600; margin: 0; color: var(--n-50); text-transform: none; letter-spacing: 0; }

/* ---------- on the stage ---------- */
.st-stage .stage { position: absolute; inset: 0; height: auto; border: 0; border-radius: 0; background: #080808; }
.st-stage .stage canvas.preview3d-canvas { background: #080808; }
.st-stage .stage-label, .st-stage .stage-note, .st-stage .stage-corner, .st-stage .preview3d-note, .st-stage .preview3d-height { display: none; }
.st-stage .stage > #preview { visibility: hidden; }
.hud { position: absolute; left: 14px; right: 14px; display: flex; align-items: center; justify-content: space-between; gap: var(--gap); pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top { top: 12px; }
.hud-bottom { bottom: 12px; }
.hud-group, .hud-actions { display: flex; align-items: center; gap: var(--gap); min-width: 0; }
.hud-group:empty { display: none; }
.hud-actions { margin-left: auto; flex: none; }
.hud .btn, .hud .seg, .hud select { background-color: #141414; }
.hud .btn:hover { background-color: var(--n-700); }
.hudlab { font-size: 12px; color: var(--n-200); text-shadow: 0 1px 3px #000; white-space: nowrap; }
.st-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; padding-right: 4px; flex: none; text-shadow: 0 1px 3px #000; }
.st-brand svg { width: 18px; height: 18px; }
.st-title { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; border-left: 1px solid var(--n-600); padding-left: 12px; max-width: 480px; }
.st-title .effect-name { display: block; width: 100%; height: 26px; margin: 0; padding: 0; background: none; border: 0; border-bottom: 1px solid transparent; border-radius: 0; color: var(--n-50); font: 600 20px/26px var(--sans); letter-spacing: -.01em; text-shadow: 0 1px 3px #000; text-overflow: ellipsis; }
.st-title .effect-name:hover { background: none; border-bottom-color: var(--n-600); }
.st-title .subtext { margin: 0; font: 400 12px/16px var(--mono); color: var(--n-200); text-shadow: 0 1px 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-history { display: flex; gap: 4px; }
.st-error { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; max-width: 460px; padding: 14px 18px; background: var(--n-900); border: 1px solid var(--n-600); border-radius: var(--r); color: var(--n-50); text-align: center; font-size: 14px; line-height: 1.45; }
.tune-toggle[aria-expanded=true] { border-color: var(--signal) !important; color: var(--signal) !important; }

/* Cast controls, once they live in the screen rather than over a stage. */
.cast-inline { position: static; display: flex; align-items: center; gap: var(--gap); padding: 0; flex-direction: row; font-size: 13px; pointer-events: auto; }
.cast-inline .cast-lab { font-size: 12px; white-space: nowrap; }
.studio .cast-inline .cast-seg button { height: calc(var(--ctl) - 2px); padding: 0 10px; font-size: 13px; }
.studio .cast-inline .cast-seg button:disabled { color: #8a8a8a; cursor: not-allowed; background: none; opacity: 1; }
.studio .cast-seg button[hidden] { display: none !important; }
#castMenu .cast-inline { flex-direction: column; align-items: stretch; gap: 2px; }
#castMenu .cast-toggle { display: flex; justify-content: flex-start; height: auto; padding: 4px 0; background: none; border: 0; font-weight: 400; font-size: 13px; }
#stageOptionsSlot { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--n-700); }

/* ---------- transport ---------- */
.st-transport .cast-ui, .st-transport .transport { height: 48px; padding: 0 14px; display: flex; align-items: center; gap: 10px; margin: 0; }
.st-transport .cast-ui { position: static; pointer-events: auto; font-size: 13px; }
.st-transport .cast-row { flex: 1; gap: 10px; width: 100%; }
.st-transport .cast-btn { height: var(--ctl); }
.st-transport .cast-primary { font-size: 13px; }
.st-transport .cast-icon { width: var(--ctl); }
.st-transport .cast-track { height: var(--ctl); }
.st-transport .cast-beat { font-size: 12px; }
.st-transport .cast-clock { font-size: 13px; }
body.cast-on .st-transport .transport { display: none; }
.st-transport .transport button { width: var(--ctl); height: var(--ctl); padding: 0; background: var(--n-850); border: 1px solid var(--n-600); border-radius: var(--r); color: var(--n-50); }
.st-transport .transport button:hover { background: var(--n-700); }
.st-transport .transport input[type=range] { flex: 1; min-width: 40px; }
.st-transport .transport output { float: none; font: 500 13px var(--mono); color: var(--n-50); min-width: 100px; text-align: right; }
.st-transport .check { font-size: 13px; color: var(--n-200); }

/* ---------- console: generate ---------- */
.st-gen #genPanel { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.st-gen .section-head { display: none; }
.gen-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr); gap: 5px 8px; }
.studio .label { display: block; margin: 0; font-size: 12px; line-height: 15px; color: var(--n-300); }
.studio .label select { display: block; margin-top: 2px; }
.studio .gen-seed > label { display: block; }
.studio .gen-seed .layer-tools { display: grid; grid-template-columns: minmax(0, 1fr) var(--ctl); gap: 4px; margin: 2px 0 0; }
.studio #genSeed { padding: 0 5px; }
.gen-material { display: none; }
#genPanel[data-kind="elegant"] .gen-material { display: block; }
#genPanel:not([data-kind="elegant"]) .gen-style-row { grid-template-columns: 1fr; }
.gen-style-row select { min-width: 0; width: 100%; }
.studio .gen-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.studio #genHint { display: none; }

/* ---------- console: pick ---------- */
.st-cands { gap: 6px; }
.stripbar { display: flex; align-items: center; gap: 8px; min-height: var(--ctl); }
.stripbar h2 { white-space: nowrap; flex: none; }
.strip-sub { font-weight: 400; color: var(--n-300); margin-left: 8px; font-size: 12px; }
.parts { display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
.parts-lab { font-size: 12px; color: var(--n-300); }
.parts-list { display: flex; gap: 4px; min-width: 0; }
.studio .part { display: inline-flex; align-items: center; gap: 4px; height: var(--ctl); padding: 0 8px; background: var(--n-850); border: 1px solid var(--n-600); border-radius: var(--r); font-size: 12px; font-weight: 500; color: var(--n-200); white-space: nowrap; cursor: pointer; }
.studio .part svg { width: 12px; height: 12px; }
.studio .part:hover { background: var(--n-700); border-color: var(--n-600); }
.studio .part[aria-pressed=true], .studio .part[aria-pressed=mixed] { border-color: var(--signal); color: var(--signal); }
.strip-slot { flex: 1; min-height: 0; }
.studio .candidates { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 100%; }
.tile { position: relative; min-width: 0; min-height: 0; }
.studio .candidate { position: absolute; inset: 0; display: block; padding: 0; margin: 0; background: #050505; border: 1px solid var(--n-700); border-radius: var(--r); cursor: pointer; overflow: hidden; color: var(--n-300); }
.studio .candidate:hover { border-color: var(--n-300); background: #050505; }
.studio .candidate.active { border: 2px solid var(--n-50); }
.studio .tile.locked .candidate { border-color: var(--signal); }
.studio .candidate canvas { position: absolute; inset: 0 0 18px 0; width: 100%; height: calc(100% - 18px); aspect-ratio: auto; object-fit: cover; background: #050505; }
.studio .candidate .candidate-num { display: none; }
.studio .candidate .candidate-meta { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; padding: 0 3px; border: 0; background: var(--n-900); font: 400 12px/18px var(--sans); color: var(--n-300); text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.studio .candidate.active .candidate-meta { color: var(--n-50); }
.studio .candidate strong { display: none; }
.studio .candidate small { display: inline; font-size: 12px; color: inherit; margin: 0; }
.studio .tile-lock { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; background: #0b0b0bd9; border: 1px solid var(--n-600); border-radius: 2px; color: var(--n-200); cursor: pointer; opacity: 0; transition: opacity .12s; }
.studio .tile-lock svg { width: 12px; height: 12px; }
.studio .tile:hover .tile-lock, .studio .tile-lock:focus-visible, .studio .tile-lock[aria-pressed=true] { opacity: 1; }
.studio .tile-lock:hover { background: var(--n-700); }
.studio .tile-lock[aria-pressed=true] { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
@media (hover: none) { .studio .tile-lock { opacity: 1; } }

/* ---------- console: export ---------- */
.st-export-head { display: flex; align-items: center; justify-content: space-between; height: 24px; }
.st-export-head .btn { height: 24px; padding: 0 6px; font-size: 12px; }
#slotExportActions { display: flex; flex: 1; min-height: 0; }
.studio #exportActions { display: flex; flex-direction: column; gap: 6px; flex: 1; position: relative; }
.studio #exportActions > .btn { width: 100%; justify-content: flex-start; }
.exprow { display: flex; align-items: center; gap: 8px; margin-top: auto; min-width: 0; }
.studio .exprow .seg button { padding: 0 7px; font-size: 12px; }
.expinfo { font: 400 12px/1.25 var(--mono); color: var(--n-300); min-width: 0; white-space: pre-line; }
.studio .export-progress { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr; align-content: center; gap: 8px; background: var(--n-900); font-size: 13px; color: var(--n-50); z-index: 2; }
.studio .export-progress progress { width: 100%; height: 8px; accent-color: var(--signal); }
.studio #exportOptions .hint, .studio #exportOptions .check, .studio #exportOptions summary { font-size: 12px; color: var(--n-300); }
.studio #exportOptions .hint { line-height: 1.45; margin: 8px 0 0; }
.studio #exportOptions .label { margin-bottom: 8px; }
.studio #exportOptions .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.studio #exportOptions .two-col button { font-size: 13px; }
.studio .bake-check { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.studio .bake-warning { margin: 8px 0; padding: 6px 8px; border: 1px solid var(--n-600); border-radius: var(--r); color: var(--n-50); font-size: 12px; line-height: 1.4; }
.studio .text-button { padding: 0; background: none; border: 0; color: var(--n-50); text-decoration: underline; cursor: pointer; font-size: 12px; }
.bake-angle { display: none; }
body[data-renderer="elegant"] .bake-angle { display: block; }

/* ---------- popovers ---------- */
.pop-wrap { position: relative; }
.pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 300px; padding: 12px; background: var(--n-900); border: 1px solid var(--n-600); border-radius: 4px; box-shadow: 0 16px 44px #000a; color: var(--n-50); font-size: 13px; animation: pop-in .14s cubic-bezier(.16, 1, .3, 1); }
.pop-up { top: auto; bottom: calc(100% + 6px); }
.pop-right { right: 0; }
@keyframes pop-in { from { opacity: 0; transform: translateY(3px); } }
.pop h3 { margin: 0 0 8px; }
.pop-list { display: flex; flex-direction: column; gap: 6px; }
.pop-list:empty { display: none; }
#fileBlock { display: contents; }
.pop-list .btn { width: 100%; justify-content: flex-start; }
.pop-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--n-700); }
.pop-note { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--n-300); }
.pop-note:empty { display: none; }
.pop-export { width: 340px; max-height: calc(100dvh - 240px); overflow-y: auto; }
.pop-share { width: 340px; }
.share-field { display: block; margin-top: 10px; font-size: 12px; color: var(--n-300); }
.share-field input { display: block; margin-top: 3px; font-size: 12px; }
#shareUrl { font-family: var(--mono); }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 4px; }
#popRecipes .collection-item { display: flex; gap: 4px; margin: 4px 0; }
#popRecipes .collection-item button { height: 28px; padding: 0 8px; background: var(--n-850); border: 1px solid var(--n-600); border-radius: var(--r); color: var(--n-50); font-size: 12px; }
#popRecipes .collection-item button:hover { background: var(--n-700); }
#popRecipes .open-kept { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#popRecipes .empty { margin: 0; font-size: 12px; color: var(--n-300); }
#popStage .inspector-control, #popStage label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--n-200); }
#popStage select { width: 110px; }
#popStage .text-button { align-self: flex-start; margin-top: 4px; font-size: 13px; }
#popStage { width: 240px; }

/* ---------- Tune and edit ---------- */
.tune { width: var(--tune-w); display: flex; flex-direction: column; background: var(--n-900); border-left: 1px solid var(--n-700); animation: tune-in .18s cubic-bezier(.16, 1, .3, 1); }
.tune[data-tab="timeline"] { --tune-w: 560px; }
@keyframes tune-in { from { transform: translateX(24px); opacity: 0; } }
.tune-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--n-700); }
.tune-head h2 { flex: 1; }
.tune-head h2:focus { outline: 0; }
.tune-macros { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 8px 14px 10px; border-bottom: 1px solid var(--n-700); }
.tune-macros .inspector-control { margin: 0; }
.tune-macros .inspector-control label { margin: 0; font-size: 12px; color: var(--n-200); }
.tune-macros input[type=range] { display: block; margin: 2px 0 0; width: 100%; }
.tune-macros output { font-size: 12px; color: var(--n-50); }
.tune-tabs { display: flex; gap: 2px; padding: 6px 14px 0; border-bottom: 1px solid var(--n-700); }
.studio .tune-tabs button { padding: 5px 10px 6px; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--n-300); font-size: 13px; font-weight: 500; cursor: pointer; }
.studio .tune-tabs button:hover { color: var(--n-50); background: none; }
.studio .tune-tabs button[aria-selected=true] { color: var(--n-50); border-bottom-color: var(--signal); }
.tune-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px 14px; scrollbar-width: thin; scrollbar-color: var(--n-600) transparent; }
.studio #elTools .el-add { display: flex; gap: 4px; margin: 0 0 6px; }
.studio #elTools .el-add select { flex: 1; min-width: 0; }
.studio #elTools .el-add button, .studio #elTools .el-actions button { height: var(--ctl); padding: 0 8px; background: var(--n-850); border: 1px solid var(--n-600); border-radius: var(--r); color: var(--n-50); font-size: 13px; font-weight: 500; }
.studio #elTools .el-add button { background: var(--n-50); border-color: var(--n-50); color: #0b0b0b; font-weight: 600; }
.studio #elTools .el-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 0 0 10px; }
.studio #elTools .el-actions button:hover { background: var(--n-700); }
.studio #elEffect { margin: 0 0 10px; padding: 0 0 10px; border-bottom: 1px solid var(--n-700); }
.studio #elEffect .inspector-control { margin: 8px 0 0; }
.studio #elEffect .hint { margin: 0; font-size: 12px; line-height: 1.4; color: var(--n-300); }
.studio #elEffect .el-genes { margin: 8px 0 0; padding: 0; border: 0; }
.studio .inspector-control { margin: 10px 0 0; }
.studio .inspector-control label { margin-bottom: 2px; font-size: 12px; color: var(--n-200); display: flex; justify-content: space-between; align-items: baseline; }
.studio .inspector-control output { float: none; font: 400 12px var(--mono); color: var(--n-50); }
.studio .inspector-section { margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--n-700); }
.studio summary { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--n-50); cursor: pointer; }
.studio .el-list { display: flex; flex-direction: column; gap: 2px; }
.studio .el-row { display: flex; align-items: center; gap: 1px; min-height: 32px; padding: 0 2px 0 4px; background: var(--n-850); border: 1px solid transparent; border-radius: var(--r); }
.studio .el-row.selected { background: var(--n-800); border-color: var(--n-400); }
.studio .el-row.off .el-pick, .studio .el-row.off .el-swatch { opacity: .55; }
.studio .el-swatch { width: 5px; height: 22px; border-radius: 2px; background: var(--n-700); flex: none; }
.studio .el-pick { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; padding: 6px 6px; background: none; border: 0; text-align: left; color: var(--n-50); cursor: pointer; }
.studio .el-pick:hover { background: none; }
.studio .el-pick strong { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.studio .el-pick small { font-size: 12px; color: var(--n-300); margin: 0; flex: none; }
.studio .el-icon { display: grid; place-items: center; width: 24px; height: 24px; min-width: 0; padding: 0; background: none; border: 0; border-radius: 2px; color: var(--n-300); font-size: 12px; font-weight: 600; flex: none; cursor: pointer; }
.studio .el-icon svg { width: 14px; height: 14px; }
.studio .el-icon:hover { background: var(--n-700); color: var(--n-50); }
.studio .el-icon[aria-pressed=true] { color: var(--n-50); }
.studio .el-lock[aria-pressed=true], .studio .el-solo[aria-pressed=true] { color: var(--signal); }
.studio .el-inspector { padding: 8px 2px 12px 8px; margin-left: 2px; border-left: 2px solid var(--n-600); }
.studio .el-empty { margin: 8px 0; font-size: 12px; line-height: 1.45; color: var(--n-300); }
.studio .layer-title { display: block; width: 100%; margin: 0 0 6px !important; font-weight: 600; }
.studio .inspector-actions { display: grid; grid-template-columns: 1fr 26px 26px 1fr 26px; gap: 4px; margin: 0 0 4px; }
.studio .inspector-actions button { height: 26px; padding: 0; background: var(--n-850); border: 1px solid var(--n-600); border-radius: var(--r); color: var(--n-50); font-size: 12px; flex: none; }
.studio .inspector-actions button:hover:not(:disabled) { background: var(--n-700); }
.studio .inspector-actions button:disabled, .studio #elTools button:disabled { color: var(--n-400); opacity: 1; }
.studio .el-inspector .hint { font-size: 12px; line-height: 1.4; color: var(--n-300); margin: 6px 0; }
.studio .el-inspector .colors { display: flex; gap: 12px; margin-top: 8px; }
.studio .el-inspector .colors label, .studio .el-colour { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--n-200); }
.studio input[type=color] { width: 30px; height: 24px; padding: 1px; background: var(--n-850); border: 1px solid var(--n-600); border-radius: var(--r); cursor: pointer; }
.studio .el-ramp { height: 14px; margin-top: 8px; border: 1px solid var(--n-600); border-radius: 2px; }
.studio .el-materials { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin-top: 8px; }
.studio .el-material { height: 14px; padding: 0; min-width: 0; border: 1px solid var(--n-600); border-radius: 2px; cursor: pointer; }
.studio .el-material:hover:not(:disabled) { border-color: var(--n-50); }
.studio .el-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }

/* ---------- timeline ---------- */
.studio .tl { --name: 104px; padding: 4px 4px 6px; background: var(--n-950); border: 1px solid var(--n-700); border-radius: var(--r); }
.studio .tl-rows { max-height: none; }
.studio .tl-name { font-size: 12px; color: var(--n-300); padding: 2px; }
.studio button.tl-name:hover { background: var(--n-850); color: var(--n-50); }
.studio .tl-title { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--n-50); }
.studio .tl-row.selected .tl-name { color: var(--n-50); font-weight: 600; }
.studio .tl-ruler { border-bottom-color: var(--n-700); }
.studio .tl-tick { font: 11px var(--mono); color: var(--n-300); border-left-color: var(--n-700); }
.studio .tl-hit { height: 15px; padding: 0 5px; font-size: 11px; line-height: 13px; letter-spacing: 0; color: var(--signal-ink); background: var(--signal); border: 1px solid var(--signal); border-radius: 2px; cursor: ew-resize; }
.studio .tl-hit:hover { background: #e6ff7c; }
.studio .tl-track { background: var(--n-900); }
.studio .tl-bar:focus-visible { outline-color: var(--signal); }
.studio .tl-row.selected .tl-bar { box-shadow: inset 0 0 0 1px var(--n-50); }
.studio .tl-playhead { background: var(--signal); }

/* ---------- messages ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--console-h) + 60px); transform: translateX(-50%); max-width: min(560px, 90vw); padding: 9px 14px; background: var(--n-50); color: #0b0b0b; border-radius: var(--r); font: 500 13px/1.35 var(--sans); box-shadow: 0 8px 28px #000a; z-index: 40; }
body[data-screen="classic"] #toast { bottom: 23px; }

/* The status line for screen readers must not add a pixel to the page. */
#liveStatus { position: fixed; top: 0; left: 0; }

/* Labels on the stage give way before the controls do, when the panel narrows it. */
.st-stage { container: stage / inline-size; }
@container stage (max-width: 1040px) {
  .hudlab, .cast-inline #castCamLab, .cast-inline #castBackLab { display: none; }
}
@container stage (max-width: 800px) {
  .st-brand span, .st-title .subtext { display: none; }
  .st-stage .seg button, .st-stage .cast-seg button { padding: 0 7px !important; }
}

/* The Classic editor: its generator, in its own column. */
.classic .gen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 9px; }
.classic .gen-seed { grid-column: 1 / -1; }
.classic .gen-seed > label { display: block; font-size: 11px; color: #b0b8c0; margin-bottom: 8px; }
.classic .gen-seed .layer-tools { margin: 0; }
.classic #genSeed { flex: 1; }
.classic .gen-seed .btn { flex: none; height: 37px; }
.classic .gen-actions .btn { font-size: 12px; height: 34px; }
.classic .gen-actions { margin-top: 8px; }
.classic .header-actions { flex-wrap: wrap; justify-content: flex-end; }
.classic #exportActions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.classic #exportActions > .btn { width: 100%; justify-content: flex-start; }
.classic #exportActions > .btn svg { width: 14px; height: 14px; }
.classic #exportActions > .btn em { margin-left: auto; font: 400 12px ui-monospace, monospace; font-style: normal; opacity: .8; }
.classic #exportGodot { background: var(--n-50); border-color: var(--n-50); color: #0b0b0b; font-weight: 600; }
.classic #exportActions .exprow { display: flex; align-items: center; gap: 8px; }
.classic #exportActions .seg button { background: none; border: 0; border-left: 1px solid var(--n-600); border-radius: 0; padding: 6px 8px; font-size: 12px; }
.classic #exportActions .seg button:first-child { border-left: 0; }
.classic #exportActions .seg button[aria-pressed=true] { background: var(--n-600); color: #fff; }
.classic #exportActions .expinfo { white-space: pre-line; }

/* ---------- short and narrow ---------- */
@media (max-height: 800px), (max-width: 1380px) {
  :root { --console-h: 164px; --ctl: 28px; --tune-w: 360px; }
  .st-console { grid-template-columns: 232px minmax(0, 1fr) 232px; }
  .st-col { padding: 7px 10px; gap: 5px; }
  .st-transport .cast-ui, .st-transport .transport { height: 42px; }
  .gen-grid { gap: 3px 6px; }
  .studio .label { font-size: 11px; line-height: 13px; }
  .st-title .effect-name { font-size: 18px; }
  .strip-sub { display: none; }
  .studio .candidate canvas { inset: 0; height: 100%; }
  .studio .candidate .candidate-meta { display: none; }
  .studio #exportActions { gap: 4px; }
  .expinfo { font-size: 11px; }
  .st-export-head { height: 20px; }
  .st-export-head .btn { height: 20px; }
}
@media (max-width: 1180px) {
  .hudlab, .cast-inline .cast-lab, .st-title .subtext { display: none; }
  .parts-lab { display: none; }
  .st-brand span { display: none; }
}
@media (max-width: 1100px), (max-height: 620px) {
  body[data-renderer="elegant"] { overflow: auto; }
  .studio { height: auto; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(360px, 62vh) auto auto auto; grid-template-areas: "stage" "transport" "tune" "console"; }
  .tune { width: 100%; border-left: 0; border-top: 1px solid var(--n-700); }
  .st-console { grid-template-columns: 1fr 1fr; }
  .st-cands { grid-column: 1 / -1; grid-row: 1; height: 150px; border-left: 0; border-bottom: 1px solid var(--n-700); }
  .studio .candidates { grid-template-columns: repeat(12, 88px); overflow-x: auto; }
  .st-gen { border-left: 0; }
  .parts { display: none; }
  .hud { flex-wrap: wrap; }
  .hud-bottom { row-gap: 6px; }
  #toast { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
