.editor{height:100dvh;min-height:460px;display:grid;grid-template-rows:auto minmax(0,1fr);background:#181a1e}
.editor button{color:inherit;background:#272a30;border:1px solid #41454e;border-radius:7px;padding:7px 12px}
.editor button:hover:not(:disabled){background:#343841}
.editor button:disabled{opacity:.4;cursor:default}
.editor-bar{display:flex;align-items:center;gap:10px;padding:10px 16px;min-height:62px;border-bottom:1px solid #383b43;background:#181a1e}
.editor-back{display:flex;align-items:center;gap:10px;white-space:nowrap;color:#c6c9d0;font-size:13px}
.editor-name{color:var(--ink);background:#202329;border:1px solid #3c414a;border-radius:7px;padding:7px 9px;flex:1 1 0;min-width:80px;max-width:300px}
.editor-modes{display:flex;flex:none;flex-wrap:wrap;justify-content:center;gap:3px;margin-inline:auto;padding:3px;border:1px solid #383c44;border-radius:9px;background:#111318}
.editor .editor-modes button{background:none;border-color:transparent}
.editor .editor-modes button[aria-pressed="true"]{background:#3b301c;color:#ffd376}
.editor-actions{display:flex;gap:6px}
.editor button.editor-primary{background:#ffb01b;color:#171410;border-color:#ffb01b;font-weight:650}
.editor button.editor-primary:hover{background:#ffbf40}
.editor .editor-square{font-size:20px;padding:0;width:35px;line-height:1}
.editor .editor-sound{display:grid;place-items:center}
.editor-sound .icon{width:17px;height:17px}
.editor-sound[aria-pressed="false"] .sound-waves,.editor-sound[aria-pressed="true"] .sound-muted{display:none}
.editor-workspace{position:relative;min-height:0;isolation:isolate}
.editor-overlay{position:absolute;inset:14px;display:grid;gap:10px;grid-template-rows:minmax(0,1fr) auto;pointer-events:none}
.editor-panel-layer{position:relative;min-width:0;min-height:0}
.editor-panel-layer .editor-panel[data-custom-width]{width:var(--editor-panel-width);max-width:100%}
.editor-panel-layer .editor-panel[data-custom-height]:not(:has(.editor-panel-body[hidden])){height:var(--editor-panel-height);max-height:100%}
.editor-panel{position:absolute;top:0;display:flex;flex-direction:column;width:min(218px,100%);max-height:100%;background:#1b1d22;border:1px solid #41454e;border-radius:10px;box-shadow:0 8px 24px #0006;pointer-events:auto;overflow:hidden}
.editor-catalog{left:0;width:min(342px,100%);height:min(100%,590px)}
.editor-catalog:has(.editor-library-body[hidden]){height:auto}
.editor-inspector{right:0}
.editor-panel[data-front]{z-index:1}
.editor-panel:is([data-dragging],[data-resizing]){border-color:#ad8642}
.editor-panel-header{display:flex;flex:none;align-items:stretch;background:#202329}
.editor-panel-header h2{display:flex;flex:1;align-items:center;gap:9px;min-width:0;margin:0;padding:9px 10px;font-size:13px;font-weight:680;cursor:grab;touch-action:none;user-select:none}
.editor-panel-header h2::before{content:"";width:9px;height:13px;flex:none;background:radial-gradient(circle,#949aa5 1px,transparent 1.3px) 0 0/4px 4px}
.editor-panel-header h2:focus-visible{outline-offset:-3px}
.editor-panel[data-dragging] h2{cursor:grabbing}
.editor .editor-panel-header button{flex:none;align-self:center;width:29px;height:27px;margin:4px 5px 4px 0;padding:0;border-color:transparent;background:transparent;font-size:17px;line-height:1}
.editor-panel-body{min-height:0;padding:10px;border-top:1px solid #343840;overflow:auto;overscroll-behavior:contain}
.editor .editor-panel-resizer{position:absolute;bottom:0;right:0;display:grid;place-items:center;width:23px;height:23px;padding:0;border:0;border-radius:4px;color:#b7c1d1;background:#202329;cursor:nwse-resize;touch-action:none}
.editor .editor-panel-resizer::before{content:"";width:10px;height:10px;background:linear-gradient(135deg,transparent 48%,currentColor 49% 57%,transparent 58% 71%,currentColor 72% 80%,transparent 81%)}
.editor .editor-panel-resizer:is(:hover,:focus-visible){color:#ffd376}
.editor [data-resize-left]>.editor-panel-resizer{left:0;right:auto;cursor:nesw-resize}
.editor [data-resize-top]>.editor-panel-resizer{top:0;bottom:auto;cursor:nesw-resize}
.editor [data-resize-left][data-resize-top]>.editor-panel-resizer{cursor:nwse-resize}
.editor [data-resize-left]>.editor-panel-resizer::before{scale:-1 1}
.editor [data-resize-top]>.editor-panel-resizer::before{scale:1 -1}
.editor [data-resize-left][data-resize-top]>.editor-panel-resizer::before{scale:-1 -1}
.editor [data-resize-top]:not([data-resize-left]):has(>.editor-panel-resizer:not([hidden]))>.editor-panel-header{padding-right:23px}
.editor [data-resize-left][data-resize-top]:has(>.editor-panel-resizer:not([hidden]))>.editor-panel-header{padding-left:23px}
.editor-library-body{display:flex;flex:1;flex-direction:column;min-height:0;padding:0;overflow:hidden}
.editor-library-controls{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:7px;padding:11px;border-bottom:1px solid #343840;background:#202329}
.editor-library-controls input,.editor-library-controls select{width:100%;min-width:0;background:#15181d;border:1px solid #424650;border-radius:7px;padding:8px;color:#e6e8ec;font-size:12px}
.editor-library-controls input{grid-column:1/-1;grid-row:1}
.editor-library-count{grid-column:1/-1;color:#aeb5c0;font-size:11px;font-variant-numeric:tabular-nums}
.editor-library-scroll{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;padding:10px;scrollbar-gutter:stable}
.editor-parts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.editor .editor-part-card{display:flex;min-width:0;flex-direction:column;padding:0;overflow:hidden;text-align:left;background:#242830;border-color:#393f4b}
.editor .editor-part-card:hover:not(:disabled){background:#292f39;border-color:#707b8b}
.editor .editor-part-card[aria-pressed="true"],.editor .editor-part-card[data-loading]{background:#32291d;border-color:#d59d43}
.editor-part-preview{position:relative;width:100%;aspect-ratio:144/92;background-color:#161a21;background-size:600% 600%;background-repeat:no-repeat;border-bottom:1px solid #343943}
.editor-part-preview::after{position:absolute;inset:0;content:'';box-shadow:inset 0 0 20px #252e3b45;pointer-events:none}
.editor-part-details{display:grid;grid-template-rows:1fr auto;align-content:start;flex:1;gap:7px;width:100%;padding:7px 8px 8px}
.editor-part-name{display:-webkit-box;min-height:2.6em;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:12px;font-weight:620;line-height:1.3;overflow-wrap:anywhere}
.editor-part-meta{display:flex;justify-content:space-between;align-items:center;gap:3px;min-height:16px}
.editor-part-id{color:#aab3c2;font:10px/1.2 ui-monospace,monospace}
.editor-part-mechanics{color:#ffc768;font-size:10px;line-height:1.2}
.editor-library-empty{color:#adb4c0;font-size:13px;text-align:center;margin:24px 0}
.editor .editor-library-more{display:block;width:100%;margin-top:10px;font-size:12px}
.editor-viewport{position:absolute;inset:0;min-width:0;min-height:0;overflow:hidden;background:#16191f}
.editor-viewport canvas{display:block;width:100%;height:100%;touch-action:none}
.editor-empty,.editor-coordinates{position:absolute}
.editor-dock{position:relative;grid-row:2;justify-self:center;z-index:2;max-width:100%}
.editor-hint,.editor-load-notice{width:max-content;max-width:min(calc(100vw - 28px),42rem);padding:7px 10px;border:1px solid #494d56;border-radius:8px;background:#1b1d22f5;color:#d9dde4;box-shadow:0 4px 14px #0005;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.editor-hint{position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);margin:0;text-align:center}
.editor-hint:empty{padding:0;border:0;box-shadow:none}
.editor-load-notice{position:absolute;z-index:3;top:14px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:8px;color:#ffcf76}
.editor .editor-load-notice button{flex:none;padding:0;width:26px;height:26px;font-size:18px;line-height:1}
.editor-viewport-tools,.editor-paint-tools{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:5px;padding:5px;border:1px solid #494d56;border-radius:10px;background:#1b1d22;box-shadow:0 8px 28px #0008;pointer-events:auto}
.editor-viewport-tools[data-view-only]>:not([data-el="frame"]){display:none}
.editor .editor-viewport-tools button,.editor-connection-tools>summary{display:flex;align-items:center;justify-content:center;gap:5px;min-width:34px;min-height:34px;padding:4px 8px;font-size:12px}
.editor-viewport-tools .icon{width:17px;height:17px;flex:none}
.editor-viewport-tools [data-el="pivotMode"]{max-width:100%;padding:7px 4px;color:inherit;background:#272a30;border:1px solid #41454e;border-radius:7px;font:inherit;font-size:12px}
.editor-viewport-tools [data-el="rotationSnap"]{min-width:52px}
.editor .editor-viewport-tools button[aria-pressed="true"],.editor-connection-tools[data-active]>summary{background:#3b301c;color:#ffd376;border-color:#826631}
.editor .editor-dock-snap-all{background:#ffb01b;color:#171410;border-color:#ffb01b;font-weight:700;padding-inline:10px}
.editor .editor-dock-snap-all:hover:not(:disabled){background:#ffbf40}
.editor-connection-tools>summary{cursor:pointer;list-style:none;background:#272a30;border:1px solid #41454e;border-radius:7px}
.editor-connection-tools>summary::-webkit-details-marker{display:none}
.editor-connection-tools>summary:hover{background:#343841}
.editor-connection-tools .editor-dock-chevron{width:11px;height:11px}
.editor-connection-tools[open] .editor-dock-chevron{transform:rotate(180deg)}
.editor-connection-menu{position:absolute;bottom:calc(100% + 5px);left:50%;transform:translateX(-50%);display:grid;gap:4px;min-width:120px;padding:5px;border:1px solid #494d56;border-radius:8px;background:#1b1d22;box-shadow:0 8px 24px #0008}
.editor-connection-tools:not([open])>.editor-connection-menu{display:none}
.editor .editor-connection-menu button{justify-content:flex-start}
.editor-viewport:is([data-painting],[data-box-select]) canvas{cursor:crosshair}
.editor-selection-frame{position:absolute;z-index:1;pointer-events:none;border:1px dashed #ffcb64;background:#ffb01b24}
.editor-paint-tools{gap:8px 12px;padding:7px;font-size:13px}
.editor-paint-swatches{display:flex;flex-wrap:wrap;gap:5px}
.editor .editor-paint-swatches button,.editor .editor-paint-swatches button:hover{width:30px;height:32px;padding:0;border:1px solid #ffffff45;border-radius:6px;background:var(--paint-swatch)}
.editor .editor-paint-swatches button[aria-pressed="true"]{border:2px solid #fff;box-shadow:inset 0 0 0 2px #0009}
.editor-paint-custom{display:flex;align-items:center;gap:7px;cursor:pointer}
.editor-paint-custom input{width:32px;height:32px;padding:3px;border:1px solid #41454e;border-radius:6px;background:#272a30;cursor:pointer}
.editor-viewport canvas:focus-visible{outline-offset:-3px}
.editor-empty{left:50%;top:42%;transform:translateX(-50%);text-align:center;pointer-events:none;color:#c2c7d1;font-size:14px;background:#181a20df;border:1px solid #3f4652;border-radius:8px;padding:8px 12px}
.editor-coordinates{right:14px;bottom:14px;display:flex;gap:8px;font-size:11px;font-weight:700;pointer-events:none}
.editor-coordinates span:nth-child(1){color:#f07770}
.editor-coordinates span:nth-child(2){color:#77bc72}
.editor-coordinates span:nth-child(3){color:#76a7f1}
.editor-inspector p{font-size:13px;color:#b9bec8;margin:8px 0 12px}
.editor-part-actions,.editor-motion,.editor-insertion{display:grid;gap:8px;font-size:13px}
.editor-part-actions label{display:flex;align-items:center;justify-content:space-between}
.editor-part-actions input{background:none;border:0}
.editor .editor-danger{color:#ff9e9e}
.editor-insertion div{display:flex;align-items:center;gap:8px;justify-content:space-between}
.editor-insertion small{color:#a7adb8}
.editor-motion input{display:block;width:100%;accent-color:#ffb01b}
.editor-belt-panel:not([hidden]){display:grid;gap:8px}
.editor-belt-panel label{display:grid;gap:4px;font-size:12px}
.editor-belt-panel select{width:100%;min-width:0;padding:6px;color:#e6e8ec;background:#15181d;border:1px solid #424650;border-radius:6px}
.editor-belt-panel [data-belt="status"]{margin:0}
.editor-track-panel [data-track="status"]{margin:0}
.editor-track-panel input[type="number"]{width:100%;min-width:0;padding:6px;color:#e6e8ec;background:#15181d;border:1px solid #424650;border-radius:6px}
.editor-track-panel .editor-track-adjust{grid-template-columns:auto 1fr;align-items:center}
.editor-belt-panel [data-belt="list"]>div{display:grid;gap:5px;margin-top:8px;padding-top:8px;border-top:1px solid #41454e}
.editor-loading{display:grid;place-content:center;justify-items:center;gap:16px;text-align:center;padding:20px;color:var(--muted)}
.editor-loading a{color:var(--gold)}
body:has(.editor:not([hidden])){overflow:hidden}
@media(max-width:1200px){
  .editor-bar{flex-wrap:wrap}
  .editor-name{max-width:none}
  .editor-modes{order:4;width:100%;margin:0}
}
@media(max-width:1050px){
  .editor-panel{width:min(192px,100%)}
  .editor-catalog{width:min(310px,100%)}
  .editor-back span{display:none}
}
@media(max-width:720px){
  .editor-bar{padding:7px;gap:5px}
  .editor-actions button{padding:5px 7px;font-size:12px}
  .editor-actions .editor-square{width:25px;font-size:17px}
  .editor-modes button{font-size:12px}
  .editor-overlay{inset:7px;gap:6px}
  .editor-panel{width:min(177px,calc((100% - 6px)/2));max-height:min(100%,45dvh)}
  .editor-panel-header h2{gap:4px;padding:7px 4px;font-size:12px}
  .editor-panel-body{padding:7px}
  .editor-catalog{width:min(260px,calc((100% - 6px)*.56));height:min(100%,53dvh);max-height:100%}
  .editor-library-controls,.editor-library-scroll{padding:6px}
  .editor-library-controls{gap:4px;grid-template-columns:minmax(0,1fr)}
  .editor-library-controls input,.editor-library-controls select{padding:4px 5px;font-size:11px}
  .editor-library-count{font-size:10px}
  .editor-parts{gap:4px}
  .editor-part-details{padding:4px;gap:3px}
  .editor-part-name{font-size:10px}
  .editor-part-meta{flex-wrap:wrap;min-height:0}
  .editor-part-id,.editor-part-mechanics{font-size:9px}
  .editor-inspector button{padding:5px;font-size:11px}
}
.editor-axle-handles{position:absolute;inset:0;pointer-events:none}
.editor .editor-axle-end{position:absolute;pointer-events:auto;touch-action:none;transform:translate(-50%,-50%);width:32px;height:32px;display:grid;place-items:center;padding:0;border:1px solid #ffbc3a;border-radius:50%;background:#3a2e19;color:#ffcf65;font-size:18px;cursor:grab}
.editor .editor-axle-end:active{cursor:grabbing}
.editor .editor-axle-end:hover{background:#60471b}
.editor .editor-test-drive[hidden]{display:none}
.editor-test-drive{position:absolute;z-index:2;top:14px;right:14px;width:min(285px,calc(100% - 28px));max-height:calc(100% - 28px);overflow:auto;background:#1b1d22;border:1px solid #41454e;border-radius:10px;box-shadow:0 8px 24px #0006;color:#e6e8ec;font-size:13px}
.editor-test-drive header{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;background:#202329;font-weight:650}
.editor-test-drive small,.editor-test-drive p{color:#b9c0ca}
.editor-test-drive [data-drive="setup"],.editor-test-drive [data-drive="run"]{padding:12px;display:grid;gap:9px}
.editor-test-drive .drive-scale{padding:10px 12px 0}
.editor-test-drive .drive-scale output{float:right;color:#ffd376}
.editor-test-drive [hidden]{display:none!important}
.editor-test-drive label{display:block}
.editor-test-drive select,.editor-test-drive input[type="range"]{display:block;width:100%;margin-top:5px;accent-color:#ffb01b}
.editor-test-drive select{color:inherit;background:#15181d;border:1px solid #424650;padding:6px;border-radius:6px}
.editor-test-drive p{margin:0 0 5px;line-height:1.4}
.editor-test-drive button[aria-pressed="true"]{border-color:#d59d43;color:#ffd376}
.editor-test-drive [data-drive="telemetry"]{color:#ffd376;font-variant-numeric:tabular-nums}
.drive-controls,.drive-actions{display:flex;flex-wrap:wrap;gap:5px}
.drive-controls button{touch-action:none;min-width:36px;user-select:none}
@media(max-width:720px){.editor-test-drive{top:7px;right:7px;width:min(230px,calc(100% - 14px));max-height:calc(100% - 14px)}}

.editor-scene-parts{top:auto;right:0;bottom:0;width:min(286px,100%);max-height:min(44%,350px)}
.editor-scene-parts-body{display:flex;flex-direction:column;min-height:0;padding:0;overflow:hidden}
.editor-scene-count{flex:none;margin:0;padding:5px 8px;border-bottom:1px solid #343840;color:#b9bec8;font-size:11px;font-variant-numeric:tabular-nums}
.editor-layers-toolbar{display:flex;align-items:center;gap:4px;padding:5px;border-bottom:1px solid #343840}
.editor-layers-list{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:4px}
.editor-layers-list[inert]{opacity:.65}
.editor-layers-empty{margin:12px 7px;color:#b9bec8;font-size:12px}
.editor-layer-row{display:flex;align-items:center;gap:1px;min-width:0;min-height:28px;border-radius:5px}
.editor-layer-row:hover{background:#242830}
.editor-layer-group{background:#242730;margin-top:2px}
.editor-layer-child{padding-inline-start:18px}
.editor-layer-row[data-layer-selected]{background:#3b301f;box-shadow:inset 2px 0 #e4a942}
.editor-layer-row[data-layer-hidden] :is([data-layer-action="selectPart"],[data-layer-action="selectGroup"]){color:#9c9fa8}
.editor .editor-layer-row button,.editor .editor-layers-toolbar button{display:grid;place-items:center;flex:none;min-height:26px;min-width:24px;padding:3px;border-color:transparent;background:transparent;border-radius:4px}
.editor .editor-layers-toolbar button{border-color:#41454e;background:#272a30}
.editor .editor-layers-toolbar button[aria-pressed="true"]{background:#3b301c;border-color:#826631;color:#ffd376}
.editor .editor-layer-row :is([data-layer-action="selectPart"],[data-layer-action="selectGroup"]){display:flex;flex:1;gap:5px;min-width:0;text-align:left;font-size:12px}
.editor-layer-row :is(span,small){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.editor-layer-row small{margin-inline-start:auto;max-width:45px;color:#aab3c2;font:10px ui-monospace,monospace}
.editor-layer-row svg,.editor-layers-toolbar svg{width:15px;height:15px;flex:none}
.editor-layer-row i{width:9px;height:9px;flex:none;border:1px solid #ffffff38;border-radius:3px}
.editor-layer-row input{flex:1;min-width:0;border:1px solid #826631;border-radius:4px;padding:3px;background:#15181d;color:inherit;font-size:12px}
.editor .editor-layer-row :is([data-layer-action="deleteGroup"],[data-layer-action="deletePart"]):hover{color:#ff9e9e}
@media(max-width:720px){
  .editor-scene-parts{width:min(272px,100%);max-height:min(46%,300px)}
}
.editor-motor-panel label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
  font-size: 13px;
}
.editor-motor-panel select,
.editor-motor-panel input[type="number"] {
  max-width: 100%;
  min-width: 0;
}
.editor-motor-panel small {
  display: block;
  line-height: 1.5;
  opacity: .75;
}
.editor-motor-panel input[type="range"] {
  width: 100%;
  accent-color: #ffb01b;
}
.editor-motor-panel select,
.editor-motor-panel input[type="number"] {
  color: inherit;
  background: #20242b;
  border: 1px solid #424853;
  border-radius: 5px;
  padding: 5px;
}

.editor button[data-el="wires"][aria-pressed="true"] {
  color: #ffd376;
  border-color: #a17a39;
}
.editor-motor-panel fieldset {
  border: 1px solid #424853;
  border-radius: 6px;
  margin: 10px 0;
}
.editor-motor-panel fieldset label {
  flex-wrap: nowrap;
}

.editor .cable-route-panel { left: 50%; right: auto; transform: translateX(-50%); z-index: 6; }

.part-context {
  position: fixed;
  z-index: 100;
  display: grid;
  min-width: 190px;
  padding: 5px;
  gap: 2px;
  border: 1px solid #555b66;
  border-radius: 11px;
  background: #22252c;
  box-shadow: 0 10px 32px #0007, inset 0 1px #ffffff0d;
}
.part-context[hidden], .part-context [hidden] { display: none; }
.editor .part-context button { border: 0; background: transparent; }
.editor .part-context > button {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; font-size: 13px;
}
.part-context svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linejoin: round; stroke-linecap: round; }
.part-context .context-chevron { margin-left: auto; color: #bbbfc8; }
.part-context [aria-expanded="true"] .context-chevron { transform: rotate(90deg); }
.editor .part-context button:hover, .editor .part-context button:focus-visible { background: #373c45; }
.editor .part-context button:focus-visible { outline: 1px solid #edb04c; outline-offset: -1px; }
.editor .part-context [data-action="delete"] { color: #ffa6a8; border-top: 1px solid #3b404a; margin-top: 2px; }
.part-context [data-el="mirrorAxes"]:not([hidden]) { display: flex; gap: 4px; padding: 0 7px 5px 34px; }
.editor .part-context [data-axis] { flex: 1; padding: 4px; background: #30343d; font-weight: 650; }
.part-context [data-axis="0"] { color: #ffaaae; }
.part-context [data-axis="1"] { color: #a5dbaf; }
.part-context [data-axis="2"] { color: #9dc5ff; }
