:root{color-scheme:dark;--bg:#0b1318;--panel:#121e26;--line:#293942;--muted:#80949f;--text:#dae5e9;--accent:#7be0b4;--gold:#e3b66f;font-family:system-ui,'Malgun Gothic',sans-serif;font-size:13px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}button,input,select{font:inherit;color:inherit;background:#192730;border:1px solid var(--line);border-radius:5px;min-height:32px}button{padding:5px 12px;cursor:pointer;white-space:nowrap}button:hover{background:#253a45;border-color:#60747c}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}button.active{background:#31483c;color:#b4f8d5;border-color:#669479}.primary{background:#7be0b4;color:#10251c;border-color:#7be0b4;font-weight:700}.primary:hover{background:#a5f5cf}input{padding:5px 9px;min-width:0}select{padding:4px 8px}header{height:78px;display:flex;align-items:center;justify-content:space-between;padding:0 25px;border-bottom:1px solid var(--line);gap:20px}.brand{display:flex;align-items:center;gap:12px}.cube{font-size:38px;color:var(--accent)}.brand strong{font-size:23px;letter-spacing:-.7px;white-space:nowrap}.brand em{font-style:normal;font-size:10px;color:var(--accent);padding:3px 6px;border:1px solid #39664f;border-radius:3px;vertical-align:middle;margin-left:8px}.brand small{display:block;color:var(--muted);font-size:8px;letter-spacing:1.8px;margin-top:5px}nav{display:flex;gap:7px}.notice{height:32px;background:#14221f;color:#a0b7ab;padding:7px 25px;font-size:11px}.dot{display:inline-block;width:6px;height:6px;background:var(--accent);border-radius:50%;margin-right:7px}.notice-right{float:right;color:#738f82}main{display:grid;grid-template-columns:minmax(620px,1fr) minmax(340px,30%);height:calc(100vh - 110px);min-height:650px;padding:16px;gap:16px}.workspace{display:flex;flex-direction:column;min-width:0;min-height:0}.toolbar{display:flex;align-items:center;gap:8px;padding-bottom:12px;flex-wrap:wrap}.segmented{display:flex;gap:3px}.level{display:flex;align-items:center;gap:4px;margin-left:auto;font-size:11px;color:var(--muted)}.level input{width:55px;text-align:center;color:var(--text);-moz-appearance:textfield}.level input::-webkit-inner-spin-button{appearance:none}.level button{padding:3px 10px}.viewport{position:relative;flex:1;min-height:260px;overflow:hidden;border:1px solid var(--line);border-radius:7px;background:#0e151b}canvas{display:block;width:100%;height:100%;touch-action:none;outline:none}.viewport-label{position:absolute;top:15px;left:16px;font-size:9px;letter-spacing:1.5px;color:#8eaaad;pointer-events:none}.viewport-label span{margin-left:9px;padding:3px 6px;background:#253333;border-radius:3px;letter-spacing:0}.hud{position:absolute;right:15px;top:14px;text-align:right;pointer-events:none;color:var(--gold);line-height:1.8;font-size:11px;white-space:pre-line}.hint{position:absolute;bottom:12px;right:13px;font-size:10px;color:#7c989d;pointer-events:none}.axes{position:absolute;left:18px;bottom:14px;pointer-events:none;font-size:12px}.axes b{margin-right:12px}.x{color:#e78275}.y{color:#a0d980}.z{color:#80b4e7}.axes small{display:block;color:#849aa2;font-size:10px;margin-top:8px}.draft{display:flex;gap:7px;padding:10px 0}.draft code{background:#101b22;border:1px solid var(--line);border-radius:4px;padding:9px 12px;flex:1;min-width:0;overflow-wrap:anywhere;font-size:12px;color:#a5c5cc}.palette-head{display:flex;gap:8px;align-items:center;padding:3px 0 10px}.palette-head strong{white-space:nowrap;font-size:12px}.palette-head small{color:var(--muted);font-weight:400}.palette-head input{flex:1;width:100px}.palette-actions{white-space:nowrap;font-size:10px;color:var(--muted)}.palette-actions button{padding:3px 8px}.palette-area{display:flex;gap:14px;min-height:190px}.library{flex:1;min-width:0}.palette{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}.tile{padding:3px 2px;height:72px;display:flex;align-items:center;flex-direction:column;justify-content:center;background:#15222c;overflow:hidden;user-select:none;touch-action:none;position:relative}.tile:hover{background:#23363f}.tile.selected{border-color:var(--gold);background:#383329}.tile .icon{display:block;flex-shrink:0;width:48px;height:48px;background-repeat:no-repeat;background-size:768px auto;image-rendering:pixelated;pointer-events:none}.tile .label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;pointer-events:none}.tile.drop{outline:2px solid var(--accent);background:#305546}.custom{width:335px;flex-shrink:0;border-left:1px solid var(--line);padding-left:13px}.custom-title{font-size:11px;color:#b3c5ce;margin-bottom:7px}.custom-title span{float:right;color:#6e8894;font-size:10px}.custom-body{display:flex;gap:7px}.slots{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;flex:1}.slots .tile{height:72px}.banks{display:flex;flex-direction:column;gap:3px}.banks button{padding:0;width:26px;min-height:26px;height:26px;font-size:11px}.paging{display:flex;align-items:center;gap:10px;margin-top:6px;color:var(--muted);font-size:10px}.paging button{min-height:22px;padding:0 8px}.paging span:last-child{margin-left:auto}footer{display:flex;justify-content:space-between;gap:15px;color:#7f9ba5;font-size:10px;padding-top:8px}.editor{border:1px solid var(--line);border-radius:7px;background:#101a22;display:flex;flex-direction:column;overflow:hidden;min-height:0}.editor-head{display:flex;align-items:center;padding:18px 16px;gap:6px;border-bottom:1px solid var(--line)}.editor-head div{flex:1;min-width:0}.editor-head small{display:block;font-size:8px;letter-spacing:1.5px;color:var(--muted);margin-bottom:7px}.editor-head strong{font-size:15px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.editor-head button{padding:3px 9px}.editor-info{display:flex;justify-content:space-between;padding:9px 16px;color:#7b939f;font-size:10px;background:#14212b}.code-wrap{position:relative;flex:1;min-height:220px;background:#0d171e}#highlight,#code{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:16px;white-space:pre;overflow:auto;border:none;font:12px/1.9 ui-monospace,Consolas,monospace;tab-size:2;background:transparent;border-radius:0}#highlight{pointer-events:none;color:#d1dfe4;scrollbar-width:none}#code{resize:none;color:transparent;caret-color:white;outline:none}#code::selection{background:#487c8d77;color:transparent}.comment{color:#6f9580}.skip{color:#e4ac66}.error{color:#ff7c79}.editor-status{display:flex;gap:12px;align-items:center;border-top:1px solid var(--line);padding:9px 13px;font-size:9px;color:var(--muted)}.editor-status i{display:inline-block;width:5px;height:5px;border-radius:50%;margin-right:4px}.editor-status .ok{background:var(--accent)}.editor-status .warn{background:#e4ac66}.editor-status .err{background:#ff7c79}.editor-status button{margin-left:auto;min-height:25px;font-size:10px;padding:2px 8px}.diagnostics{max-height:76px;overflow:auto;padding:0 12px;font-size:10px}.diagnostics button{display:block;text-align:left;min-height:23px;background:transparent;border:none;padding:3px 0;width:100%;overflow:hidden;text-overflow:ellipsis}.editor-bottom{padding:15px;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:8px}.editor-bottom strong{font-size:11px;font-weight:500;color:var(--accent)}.editor-bottom small{font-size:9px;color:#728d98;line-height:1.7;text-align:right}dialog{background:#17252e;color:var(--text);border:1px solid #41606a;border-radius:12px;max-width:620px;width:90%;padding:22px;box-shadow:0 30px 100px #0008}dialog::backdrop{background:#02080bb8}.dialog-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.dialog-head h2{margin:0;font-size:19px}.dialog-head button{font-size:20px;padding:0 10px}#dialog-body{line-height:1.9;color:#b4c8cf}#dialog-body label{display:flex;justify-content:space-between;align-items:center;margin:8px 0;gap:20px}#dialog-body select{min-width:180px}#dialog-body code{display:block;overflow-wrap:anywhere;background:#0b171e;padding:10px;margin:12px 0;color:var(--accent)}#dialog-body button.primary{margin-top:12px;width:100%}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);padding:12px 20px;background:#2c4743;border:1px solid #5c9e87;color:#d3fce8;border-radius:7px;box-shadow:0 10px 30px #0006;z-index:30;display:none;max-width:80%}#drag-ghost{position:fixed;pointer-events:none;z-index:100;opacity:.7;width:68px;height:68px;transform:translate(-30%,-30%);background:#56857755;border:1px solid #98e3b4;border-radius:7px}#drag-ghost .icon{display:block;width:64px;height:64px;background-size:1024px auto;image-rendering:pixelated}.empty{color:#526874}.muted{color:var(--muted)}@media(min-width:1500px){.palette{grid-template-columns:repeat(8,minmax(0,1fr))}.custom{width:370px}}@media(max-width:1150px){header{padding:0 15px}.brand strong{font-size:19px}nav{gap:4px}nav button{padding:5px 8px}main{grid-template-columns:minmax(520px,1fr) minmax(290px,31%);gap:10px;padding:10px}.custom{width:285px}.palette-head{flex-wrap:wrap}.palette{grid-template-columns:repeat(4,minmax(0,1fr))}.tile{height:58px}.tile .icon{transform:scale(.85);margin:-3px}.palette-area{min-height:210px}.hint{font-size:8px}.level{margin-left:0}}@media(max-width:860px){header{height:auto;padding:15px;flex-wrap:wrap}.notice{height:auto;min-height:30px}.notice-right{display:none}main{display:flex;flex-direction:column;height:auto;min-height:0}.workspace{height:800px}.editor{height:520px}.custom{width:310px}.palette{grid-template-columns:repeat(5,minmax(0,1fr))}.palette-area{min-height:220px}.palette-actions{display:none}}@media(max-width:580px){.palette-area{flex-direction:column}.custom{width:100%;border:0;padding:0}.workspace{height:1100px}.palette{grid-template-columns:repeat(6,minmax(0,1fr))}.palette-area{min-height:420px}.hint{display:none}.brand small{letter-spacing:1px}.palette-head strong{width:100%}}
