:root{color-scheme:dark;font:14px/1.5 Arial,Helvetica,sans-serif;color:#ededed;background:#000;--accent:#ff1738;--line:#303035}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#000}body{overflow-x:hidden}button,input,select{font:inherit;color:inherit}button{cursor:pointer;background:none;border:0;padding:0}button:disabled{opacity:.3;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,[role=button]:focus-visible{outline:2px solid #eee;outline-offset:5px}button:hover:not(:disabled){color:#fff}svg{display:block}button svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}[hidden]{display:none!important}
#instrument{position:relative;margin:auto;width:min(100vw,calc((100dvh - 12px)*848/624));min-width:320px;aspect-ratio:848/624;background:#000}
.topbar{position:absolute;top:1.6%;left:2.6%;right:2.5%;height:6.4%;display:flex;align-items:center;justify-content:space-between;gap:12px;z-index:3;pointer-events:none}.topbar button,.topbar nav{pointer-events:auto}#main-tools{display:flex;align-items:center;gap:clamp(6px,2.5vw,32px)}.tool{width:34px;height:34px;display:grid;place-items:center;color:#d9d9dd;flex-shrink:0;border-radius:50%}.tool:hover{background:#ffffff10}.tool[aria-pressed=true]{color:#fff;background:#ffffff10}.top-status{display:flex;align-items:center;gap:20px}#parameter-readout{font-size:12px;white-space:nowrap}#tempo-button{font-size:15px;line-height:1.1;text-align:center;min-width:35px}#tempo-button small{display:block;font-size:8px;margin-top:3px;letter-spacing:1px;color:#aaa}#play svg{width:22px;height:22px}
#surface{position:absolute;inset:0}#stage{width:100%;height:100%;touch-action:none;user-select:none}#field-hit{cursor:crosshair}.field-edge{fill:none;stroke:#eeeeef;stroke-width:2.1;pointer-events:none}.field-edge.inner{stroke-width:.7;stroke:#a0a0a6}#transport-ring{fill:none;stroke:#ec1731;stroke-width:1.1;pointer-events:none;stroke-dasharray:1458;stroke-dashoffset:1458}.parameter-arc{fill:none;stroke:transparent;stroke-width:12;cursor:ns-resize;pointer-events:stroke}.parameter-arc:hover{stroke:#ffffff25}.origin{fill:#777;pointer-events:none}#grid{pointer-events:none;opacity:0;transition:opacity .15s}#grid.visible{opacity:1}.grid-ring{fill:none;stroke:#252528;stroke-width:.55}.grid-dot{fill:#525258}.grid-number{fill:#616169;font-size:8px}#trails{pointer-events:none}.trail{fill:none;stroke-width:1;opacity:.3}.sound-node{--flash:0;cursor:grab;touch-action:none;outline:none}.sound-node:active{cursor:grabbing}.sound-node.locked{cursor:default}.sound-node .node-disc{stroke-width:1.1;opacity:.9}.node-hot{opacity:var(--flash);pointer-events:none}.node-outline{fill:none;stroke:var(--node-color);stroke-width:1;opacity:0}.sound-node.selected .node-outline{opacity:.65;stroke-dasharray:2 4}.sound-node:focus-visible .node-outline{opacity:1;stroke:#fff}.sound-node .pupil{fill:white;pointer-events:none}.sound-node.muted{opacity:.22}.node-lock{stroke:#fff;stroke-width:1;fill:none;opacity:.7;pointer-events:none}.node-caption{font:11px Arial,sans-serif;fill:#bbb;text-anchor:middle;pointer-events:none}
.edge-tools{position:absolute;display:flex;flex-direction:column;gap:clamp(5px,2.2vw,24px);z-index:2}.edge-tools.left{left:2.5%;top:28%}.edge-tools.right{right:2.5%;top:22.5%}.edge-tools .tool[aria-pressed=true]{color:var(--accent);background:none}.arc-button{position:absolute;width:4.5%;aspect-ratio:1;min-width:26px;padding:0;border:1px solid #6d6d71;border-radius:50%;display:grid;place-items:center;transform:translate(-50%,-50%);background:#000;color:#e8e8eb;z-index:2}.arc-button svg{width:52%;height:52%;stroke-width:1.3}.arc-button.random{background:#292929;border-color:#666}.arc-button[aria-pressed=true]{border-color:var(--accent);box-shadow:0 0 6px color-mix(in srgb,var(--accent) 35%,transparent)}.arc-button:hover{background:#19191b}.arc-button.random[aria-pressed=true]{box-shadow:0 0 5px #aaa5;border-color:#ddd}.arc-button .ratio{font-size:12px}
#palette{position:absolute;left:17.8%;right:17.5%;bottom:1.5%;display:flex;justify-content:space-between;z-index:3}.channel-button{width:32px;height:32px;position:relative;display:grid;place-items:center;touch-action:none}.channel-button:before{content:'';width:11px;height:11px;border-radius:50%;background:color-mix(in srgb,var(--color) 17%,#000);border:1px solid color-mix(in srgb,var(--color) 70%,#222)}.channel-button.active:before{background:var(--color);box-shadow:0 0 8px color-mix(in srgb,var(--color) 65%,transparent)}.channel-button.muted:after{content:'';position:absolute;width:15px;height:1px;background:#aaa;transform:rotate(-45deg)}.channel-button.solo:after{content:'S';position:absolute;bottom:-6px;font-size:8px;color:var(--color)}.patterns-button{position:absolute;right:2.5%;bottom:1.5%;z-index:3}.patterns-button svg{width:22px;height:22px}.selection-button{position:absolute;left:2.7%;bottom:1.8%;font-size:11px;color:#85858b;padding:8px 0}.selection-button:hover{color:#fff}#field-message{position:absolute;top:46%;left:29%;width:42%;text-align:center;color:#777;font-size:14px;pointer-events:none}#hintbar{position:absolute;bottom:-24px;left:3%;right:3%;display:flex;justify-content:space-between;font-size:11px;color:#626267;gap:12px}#save-status{white-space:nowrap}
dialog{position:fixed;border:1px solid #34343a;border-radius:12px;background:#101013;color:#ececf0;width:min(560px,calc(100vw - 28px));max-height:calc(100dvh - 32px);padding:22px;box-shadow:0 20px 100px #000b}dialog::backdrop{background:#0009;backdrop-filter:blur(5px)}dialog>header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;gap:15px}dialog h1{font-size:18px;font-weight:500;margin:0}dialog h2{font-size:14px;font-weight:500;margin:24px 0 14px;color:#aaa}dialog p{font-size:14px;color:#a6a6af;line-height:1.7;margin:12px 0}dialog .help-list{padding-left:20px;color:#aaa;line-height:1.8}dialog .help-list li{margin-bottom:13px}dialog strong{color:#ececf0;font-weight:500}dialog a{color:#aaa}dialog .button{padding:10px 14px;border:1px solid #3b3b43;border-radius:7px;font-size:14px;background:#18181d}dialog .button:hover{background:#24242b}dialog .primary{background:#ececf0;color:#16161a;border-color:#ececf0}dialog .danger{color:#ff8294}.row{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:16px 0}.row label{font-size:14px;color:#b8b8c2}.row input:not([type=range]){width:130px}.row input[type=text]{width:65%}.row select{max-width:65%}select,input[type=number],input[type=text]{border:1px solid #38383f;border-radius:6px;background:#19191e;padding:8px 10px;font-size:14px}input[type=range]{appearance:none;height:3px;background:#393940;accent-color:var(--accent);cursor:pointer;margin:14px 0;min-width:60px}input[type=range]::-webkit-slider-thumb{appearance:none;width:13px;height:13px;border-radius:50%;background:#eee}input[type=range]::-moz-range-thumb{width:13px;height:13px;border:0;border-radius:50%;background:#eee}.range{display:block;margin:17px 0}.range>span{display:flex;justify-content:space-between;font-size:14px;color:#b8b8c2}.range output{color:#eee;font-variant-numeric:tabular-nums}.range input{width:100%}.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:22px}.actions .button{flex:1;white-space:nowrap}.checkbox{display:flex;align-items:center;gap:10px;margin:14px 0;color:#bbb}.checkbox input{accent-color:var(--accent);width:17px;height:17px}.channel-tabs{display:flex;gap:14px;justify-content:center;border-bottom:1px solid #303035;padding-bottom:17px;margin-bottom:20px}.channel-tabs button{width:23px;height:23px;border-radius:50%;border:1px solid var(--color);background:color-mix(in srgb,var(--color) 18%,transparent)}.channel-tabs button.active{background:var(--color);box-shadow:0 0 0 4px #101013,0 0 0 5px var(--color)}.mixer-row{display:grid;grid-template-columns:16px 80px 1fr 34px 30px 30px;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid #222227}.color-dot{width:10px;height:10px;border-radius:50%;background:var(--color)}.mixer-row label{font-size:13px}.mixer-row input{width:100%}.mixer-row output{font-size:12px;color:#aaa}.toggle{border:1px solid #444;border-radius:5px;height:28px;font-size:12px;color:#aaa}.toggle[aria-pressed=true]{background:var(--color);color:#000}.scene-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.scene{height:55px;border:1px solid #303038;border-radius:7px;color:#666}.scene.stored{color:#eee;background:#1d1d24}.scene.active{border-color:var(--accent);color:#fff}.scene small{display:block;font-size:10px;color:#888}.keyboard{display:flex;height:120px;margin:24px 0 16px;gap:3px}.key{flex:1;background:#ddd;border:1px solid #ddd;border-radius:0 0 5px 5px;color:#222;display:flex;align-items:flex-end;justify-content:center;padding-bottom:9px;font-size:12px;min-width:0}.key.black{background:#18181e;border-color:#444;color:#aaa;height:80px;margin:0 -11px;z-index:1;width:22px;flex:none}.key[aria-pressed=true]{background:var(--accent);color:white;border-color:var(--accent)}.keyboard-description{font-size:12px!important}.file-note{font-size:12px!important;word-break:break-word}.node-info{font-size:13px;color:#aaa;display:flex;gap:25px}.node-info b{color:var(--accent);font-weight:400}#toast{position:fixed;bottom:35px;left:50%;transform:translate(-50%,12px);max-width:90vw;width:max-content;background:#222228;border:1px solid #41414b;color:#eee;padding:11px 17px;border-radius:8px;font-size:13px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:10}#toast.visible{opacity:1;transform:translate(-50%,0)}
@media(min-aspect-ratio:848/624){#instrument{width:min(100vw,calc((100dvh - 45px)*848/624))}}
@media(max-width:620px) and (orientation:portrait){#instrument{width:100vw;aspect-ratio:auto;height:calc(100dvh - 25px);min-height:610px}#surface{top:75px;bottom:60px}#stage{position:absolute;inset:0;width:100%;height:100%}#arc-tools{display:none}.topbar{top:12px;left:10px;right:10px;height:40px;gap:5px}#main-tools{gap:1px}.tool{width:31px;height:34px}.tool svg{width:20px;height:20px}.top-status{gap:6px}#parameter-readout{display:none}#tempo-button{font-size:13px;min-width:29px}#main-tools .tool{width:30px}.edge-tools{gap:9px;top:50%!important;transform:translateY(-50%)}.edge-tools.left{left:3px}.edge-tools.right{right:3px}.edge-tools .tool{width:28px;height:34px}.edge-tools svg{width:18px;height:18px}#palette{left:12%;right:12%;bottom:-22px}.channel-button{width:32px;height:38px}.channel-button:before{width:14px;height:14px}.patterns-button{right:2px;bottom:-20px}.selection-button{left:50%;bottom:-53px;transform:translateX(-50%);font-size:12px;white-space:nowrap}#hintbar{bottom:4px;left:12px;right:12px;font-size:10px}#save-status{display:none}#hint{width:100%;text-align:center}#field-message{left:20%;width:60%;font-size:13px}dialog{padding:18px}.mixer-row{grid-template-columns:12px 62px 1fr 29px 27px 27px;gap:7px}.channel-tabs{gap:15px}.row{gap:10px}.actions .button{font-size:12px}.node-caption{font-size:14px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
#example2-button{font-size:12px;padding:6px 9px;border:1px solid #34343b;border-radius:5px;color:#999;white-space:nowrap}
#example2-button.active{color:#ededed;border-color:#696974}
#reference-audio{width:100%;height:42px;margin:5px 0 10px}
.random-strength{position:absolute;top:11%;right:2.5%;width:112px;z-index:3;color:#aaa;font-size:12px}.random-strength>span{display:flex;justify-content:space-between;gap:12px}.random-strength output{color:#eee;font-variant-numeric:tabular-nums}.random-strength input{display:block;width:100%;margin:12px 0;touch-action:none}
@media(max-width:620px) and (orientation:portrait){.random-strength{top:0;right:12px;width:116px}}
@media(max-width:620px) and (orientation:portrait){#example2-button{font-size:10px;padding:5px 6px}.top-status{gap:3px}#main-tools .tool{width:27px}.topbar{left:7px;right:7px}}
.kit-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:4px 0 18px}.kit-label{font-size:14px;color:#b8b8c2;margin-right:4px}.kit-row button{padding:8px 12px;border:1px solid #3b3b43;border-radius:6px;background:#18181d;color:#b8b8c2;font-size:13px}.kit-row button:hover{background:#24242b;color:#eee}.kit-row button.active{background:#ececf0;color:#16161a;border-color:#ececf0}.shelf-panel{margin:0 0 18px;padding:14px 0 4px;border-top:1px solid #2a2a30}
