*{box-sizing:border-box}body{margin:0;color:#27302d;background:#f7f8f5;font:14px -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;display:flex;height:100vh;overflow:hidden}button,input,select,textarea{font:inherit}button,a,select{cursor:pointer}button{border:1px solid #dde3da;background:#fff;border-radius:9px;padding:9px 13px;color:inherit}button:hover{background:#eff3e9}button:disabled{opacity:.5;cursor:wait}a{text-decoration:none;color:inherit}aside{width:196px;padding:29px 18px;background:#fcfcfa;border-right:1px solid #e2e7df;display:flex;flex-direction:column;gap:12px;flex-shrink:0}.brand{font-size:27px;font-weight:750;margin:0 12px 35px}.brand span{display:block;font-size:11px;color:#8a9589;font-weight:400;letter-spacing:3px;margin-top:7px}aside>a:not(.brand){padding:13px;border-radius:10px;color:#72806e}aside>a.active{color:#304c25;background:#eaf0e3;font-weight:650}.aside-bottom{margin-top:auto;font-size:20px;line-height:1.8;color:#7f8b77}.aside-bottom small{display:block;font-size:10px;margin-top:18px}main{min-width:0;flex:1;display:flex;flex-direction:column}header{height:83px;padding:17px 28px;display:flex;justify-content:space-between;align-items:center;background:#fff;border-bottom:1px solid #e3e8df}#title{border:0;font-size:20px;font-weight:650;background:none;width:250px}header small{display:block;font-size:11px;color:#919c8c;margin:6px 2px}nav{display:flex;gap:8px}.dark{background:#283929;color:white}.accent{background:#e3edce;border-color:#b9cd98;color:#304c25}.tools{display:flex;gap:9px;align-items:center;padding:15px 28px;background:#fbfcf9}.tools span{font-size:11px;color:#8b9787;margin-left:12px}#notice{padding:11px 28px;background:#fff0d7;color:#7a4d19}#stage{position:relative;flex:1;overflow:hidden;touch-action:none;background-image:radial-gradient(#ced7c9 1px,transparent 1px);background-size:22px 22px;outline:none;cursor:grab}#world{position:absolute;transform-origin:0 0;left:0;top:0}#edges{position:absolute;overflow:visible;width:1px;height:1px}#edges path{fill:none;stroke:#a6ba83;stroke-width:2.5;pointer-events:stroke;cursor:pointer}#edges path:hover{stroke:#df8654;stroke-width:5}#empty{position:absolute;top:40%;left:30%;font-size:30px;color:#96a28d;pointer-events:none}#empty small{display:block;font-size:14px;margin-top:14px}.node{position:absolute;width:320px;background:#fff;border:1px solid #dae1d4;border-radius:14px;box-shadow:0 8px 28px #3042260b;cursor:default}.node.selected{border-color:#76984b;box-shadow:0 0 0 3px #8eac6630}.node-head{height:47px;padding:12px 16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #edf0e9;cursor:grab;font-weight:650;color:#506047}.node-head button{border:0;padding:3px 6px;font-size:12px;background:none;color:#899580}.node-body{padding:14px}.node textarea{width:100%;resize:vertical;min-height:160px;border:0;outline:none;line-height:1.75;color:#46513e;background:#fbfcf9;padding:10px;border-radius:6px}.node select{width:100%;padding:8px;border:1px solid #e0e7d9;border-radius:7px;background:#fff;margin:4px 0 9px}.node label{font-size:11px;color:#7e8a74}.specs{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px}.node .hint{font-size:11px;line-height:1.6;color:#8a957f;margin:4px 0 12px}.node .run{width:100%;display:flex;justify-content:space-between;background:#293e27;color:white;border:0;margin-top:12px;padding:12px}.node img,.node video{width:100%;max-height:230px;object-fit:contain;border-radius:7px;background:#f1f3ed}.node audio{width:100%}.filename{font-size:11px;color:#7c8873;overflow-wrap:anywhere;margin-top:9px}.port{position:absolute;width:15px;height:15px;border-radius:50%;background:#f8fcf0;border:3px solid #8ca966;top:22px;padding:0}.port.out{right:-8px}.port.in{left:-8px}.port.linking{background:#2f5126}.status{font-size:12px;color:#748765;margin-top:12px;line-height:1.6;overflow-wrap:anywhere}.status.error{color:#c66546}.result{margin-top:12px}.result a{display:block;padding:11px;background:#edf3e3;text-align:center;border-radius:8px;margin-top:8px}.refs{display:flex;flex-wrap:wrap;gap:5px;margin:7px 0}.refs button{font-size:11px;padding:4px 7px;color:#648240}progress{width:100%;height:5px;accent-color:#829d54}.pulse{height:4px;background:linear-gradient(90deg,#dce8ca,#76964b,#dce8ca);background-size:200%;animation:loading 1.8s infinite;border-radius:3px;margin:9px 0}@keyframes loading{to{background-position:-200%}}footer{height:52px;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 25px;border-top:1px solid #e1e7da;font-size:11px;color:#87927d}footer div{display:flex;align-items:center;gap:12px}footer button{padding:5px 9px}#zoom{min-width:40px;text-align:center}@media(max-width:900px){aside{width:70px;padding:20px 7px}.brand{font-size:18px;margin:0 3px 20px}.brand span,.aside-bottom,aside>a:not(.brand){font-size:10px}header{padding:12px;height:105px;gap:5px;flex-wrap:wrap}#title{width:180px}nav button{padding:6px;font-size:11px}.tools{padding:9px}.tools span,footer>span:last-child{display:none}}

.port{width:24px;height:24px;top:17px;z-index:5;touch-action:none;cursor:crosshair}.port.out{right:-12px}.port.in{left:-12px}.port:hover,.port.target{background:#dceaca;box-shadow:0 0 0 5px #8ca96633}.port.linking{background:#416432}#edges .preview{stroke:#527637;stroke-width:3;stroke-dasharray:7 5;pointer-events:none}.refs button{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.node.selected{z-index:2}
/* Workflow workspace: restrained dark editing surface, clear interactive chrome. */
body{background:#18191c;color:#dedfe3}aside{background:#191a1d;border-color:#303136;width:186px;padding:25px 15px}aside>a.active{background:#31343b;color:#f4f4f6}aside>a:not(.brand){color:#b2b6c1}.brand{font-size:25px}.brand span,.aside-bottom{color:#878b96}.aside-bottom{font-size:15px}aside>button{background:transparent;text-align:left;border-color:transparent;color:#b9bcc7;padding:12px}aside>button:hover{background:#2c2e35;color:white}header{background:#202125;border-color:#33353c;height:86px;padding:16px 23px}#title{color:#e9eaf0;font-size:18px;width:220px}header small{color:#9396a2}button{background:#292b31;border-color:#3b3e47;color:#dfe1e9;border-radius:7px;font-size:12px}button:hover{background:#383b45;border-color:#727b96}button:focus-visible,a:focus-visible{outline:2px solid #a1b9ff;outline-offset:3px}button:disabled{opacity:.4;cursor:not-allowed}.accent,.dark{background:#a6baf7;color:#171e34;border-color:#a6baf7}.accent:hover,.dark:hover{background:#c4d1ff;border-color:#c4d1ff}.tools{background:#202125;border-bottom:1px solid #30323a;padding:12px 23px;flex-wrap:wrap}.tools #runWorkflow{margin-left:auto}#stage{background-color:#17181b;background-image:radial-gradient(#383a42 .9px,transparent .9px)}#notice{background:#273347;color:#d8e4ff;font-size:12px}.node{background:#24262c;border-color:#454854;border-radius:10px;box-shadow:0 12px 30px #0003}.node-head{background:#30333c;border-color:#424551;color:#dbe1f0;border-radius:9px 9px 0 0;user-select:none}.node-head button{color:#bcc2d1}.node textarea{background:#1c1e23;color:#e0e2e9;border:1px solid #373b45;resize:vertical}.node textarea:focus{border-color:#8eaaef;outline:none}.node select{background:#1d1f25;color:#e4e6ee;border-color:#414551}.node label,.node .hint,.filename{color:#a2a8b9}.node .run{background:#afc3ff;color:#172443;font-weight:600}.node.selected{border-color:#a5bbfb;box-shadow:0 0 0 2px #9fb9ff66}.port{background:#20252d;border-color:#a8bdf4}.port:hover,.port.target{background:#adc1f7;box-shadow:0 0 0 5px #8caaff33}.port.linking{background:#abc3ff}.refs button{color:#c6d6ff;background:#2d3549;border-color:#455575}#edges path{stroke:#8da7e0}#edges .preview{stroke:#d4e2ff}.status{color:#bbc7df}.result a{background:#34415d;color:#e6edff}.result>button{width:100%;margin-top:7px}.node img,.node video{background:#191b20}footer{background:#202125;border-color:#33353c;color:#a4aabc;height:52px;padding:0 20px}#empty{left:15%;top:35%;color:#a6afc2;font-size:26px}#empty small{font-size:14px;color:#787f91}#minimap{position:absolute;bottom:16px;right:16px;border:1px solid #545b6f;border-radius:8px;background:#222630e8;cursor:crosshair;z-index:8}.marquee{position:absolute;pointer-events:none;border:1px solid #aac2ff;background:#a8baff25;z-index:10}.hide-edges{visibility:hidden}dialog{background:#202228;color:#e3e5ed;border:1px solid #4b505d;border-radius:16px;width:min(1020px,92vw);max-height:85vh;padding:28px;box-shadow:0 30px 100px #0008}dialog::backdrop{background:#080a10a8}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.dialog-head h2{font-size:24px;margin:0 0 12px}.dialog-note{color:#a9b1c4;line-height:1.7}.search{width:100%;border:1px solid #454c5d;border-radius:8px;padding:12px;background:#171a21;color:white;margin:10px 0 22px}.template-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.template-card{background:#282c35;border:1px solid #434b5c;border-radius:12px;padding:22px;display:flex;flex-direction:column}.template-card small{font-size:10px;color:#adc2ff;letter-spacing:1px}.template-card h3{font-size:21px;line-height:1.5}.template-card p{color:#adb5c8;line-height:1.8;min-height:95px}.template-flow{display:flex;flex-wrap:wrap;gap:6px;min-height:70px;margin-bottom:20px}.template-flow span{padding:6px 8px;border:1px solid #596b8e;border-radius:5px;height:28px;color:#c7d7ff;font-size:11px}.template-card>button{margin-top:auto;padding:11px}.saved-list{margin-top:20px;display:grid;gap:10px}.saved-list article{border:1px solid #454d5c;border-radius:8px;padding:15px;display:flex;gap:14px;align-items:center;flex-wrap:wrap}.saved-list strong{overflow-wrap:anywhere}.saved-list small{color:#9faac0;flex:1}.context-menu{position:fixed;z-index:99;background:#252932;border:1px solid #545d72;border-radius:10px;padding:6px;box-shadow:0 8px 35px #0006;width:210px}.context-menu button{display:block;width:100%;text-align:left;border:0;background:transparent;padding:12px}.context-menu button:hover{background:#3d465c}@media(max-width:1100px){aside{width:145px}header{height:auto;min-height:100px;flex-wrap:wrap;gap:10px}.tools{gap:5px;padding:10px}nav{flex-wrap:wrap}.template-grid{grid-template-columns:1fr}.template-card p{min-height:0}.template-flow{min-height:0}footer>span:last-child{display:none}}@media(max-width:700px){aside{width:75px;padding:15px 6px}aside>button{font-size:10px;padding:10px 3px}.brand{font-size:19px;margin:0 0 18px}.aside-bottom{display:none}header{padding:10px}header nav button{padding:7px;font-size:10px}.tools button{padding:8px;font-size:10px}footer{padding:0 6px}footer div{gap:4px}footer>span{display:none}#title{width:170px}.template-grid{grid-template-columns:1fr}dialog{padding:18px}}
/* Editor workspace: restrained panels, larger media previews, scrollable tracks. */
.tools{flex-wrap:wrap;gap:8px;padding:12px 20px}.tools button{font-size:13px}.video-tools{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:12px}.video-tools button{font-size:13px;padding:9px 6px}.editing-dialog{max-width:760px}.editing-dialog video{width:100%;max-height:340px;background:#101216;border-radius:10px}.editing-dialog textarea,.script-input{width:100%;min-height:150px}.edit-field{display:flex;flex-direction:column;gap:7px;margin:12px 0;min-width:90px;font-size:14px}.edit-field input,.edit-field select,.edit-field textarea{width:100%;padding:10px;border-radius:7px;background:#181c23;border:1px solid #454e5d;color:#edf2fa}.edit-field input[type=checkbox]{width:20px;height:20px}.edit-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.edit-row>.edit-field{flex:1}.timeline-dialog{width:min(1200px,96vw);max-width:1200px}.timeline-preview{display:block;width:100%;height:240px;background:#101216;object-fit:contain;border-radius:10px}.timeline-seek{width:100%;margin:15px 0;accent-color:#8dadff}.timeline-strip{display:flex;overflow-x:auto;gap:4px;padding:12px 0;min-height:76px}.timeline-block{flex-shrink:0;min-width:100px;max-width:360px;background:#344868;border-color:#7698d7;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:grab}.timeline-row{display:flex;align-items:center;gap:12px;border-bottom:1px solid #3c424d;padding:8px 0;flex-wrap:wrap}.timeline-row strong{flex:1;min-width:150px;max-width:280px;overflow-wrap:anywhere}.timeline-row .edit-field{width:90px;min-width:70px}.timeline-rows{max-height:320px;overflow:auto}.asset-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:18px;margin-top:20px}.asset-card{padding:14px;border:1px solid #454d5c;border-radius:12px;display:flex;flex-direction:column;gap:10px;min-width:0}.asset-card img,.asset-card video{width:100%;height:160px;object-fit:contain;background:#101216}.asset-card audio{width:100%}.asset-card strong{overflow-wrap:anywhere}.download-asset{padding:8px;text-align:center}.timeline-time{font-variant-numeric:tabular-nums}.script-input{padding:14px}.node .result img{width:100%}.dialog-note{line-height:1.65}dialog button:disabled{cursor:wait}@media(max-width:800px){.tools{overflow:auto;flex-wrap:nowrap;flex-shrink:0}.tools button{white-space:nowrap}.timeline-preview{height:180px}.timeline-row{gap:8px}.timeline-row strong{flex-basis:100%;max-width:none}.timeline-dialog{padding:15px}.edit-row>.edit-field{min-width:120px}aside{overflow-y:auto}.aside-bottom{display:none}}
.media-name{display:block;width:100%;padding:9px;margin:9px 0;background:#191e26;color:#dce5f5;border:1px solid #414958;border-radius:7px;font-size:13px}.node .download-asset{display:block;margin:7px 0}.timeline-strip{background:repeating-linear-gradient(90deg,#ffffff0a 0,#ffffff0a 1px,transparent 1px,transparent 40px);border-top:1px solid #454d5c;border-bottom:1px solid #454d5c}.timeline-block:hover{background:#45608c}.editing-dialog>.accent,.timeline-dialog>.accent{padding:12px 22px;margin-top:12px}

[hidden]{display:none!important}
.patch-editor>video{display:block;width:100%;max-height:32vh;object-fit:contain;background:#111;border-radius:8px}.patch-editor textarea{width:100%;background:#181b22;color:#e0e5f0;border:1px solid #475064;border-radius:8px;padding:12px;font:inherit;line-height:1.7;resize:vertical}.patch-range{display:grid;grid-template-columns:1fr 1fr;gap:16px}.patch-range input[type=range]{width:100%;accent-color:#adc1ff}.patch-comparison{display:grid;grid-template-columns:1fr 1fr;gap:14px}.patch-comparison video{width:100%;max-height:46vh;object-fit:contain;background:#111}.patch-editor .edit-field>select{max-width:100%}@media(max-width:700px){.patch-comparison,.patch-range{grid-template-columns:1fr}.patch-comparison video{max-height:27vh}}
.node textarea{min-height:280px;font-size:15px;line-height:1.85;padding:14px;overscroll-behavior:contain;touch-action:pan-y;cursor:text}
.node .expand-prompt{display:block;width:100%;margin:0 0 9px;text-align:right;color:#c9d8ff;background:#293247;border-color:#4b5d81}
dialog.prompt-editor{width:min(960px,94vw);max-width:94vw;height:min(780px,90dvh);max-height:90dvh;padding:22px;overflow:hidden}
dialog.prompt-editor[open]{display:flex;flex-direction:column;gap:14px}
.prompt-editor .dialog-head{flex-shrink:0;margin:0}
.prompt-editor>textarea{flex:1;min-height:0;width:100%;resize:none;padding:18px;border:1px solid #526079;border-radius:10px;background:#181b22;color:#eef1f9;font:16px/1.9 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;outline:none;overscroll-behavior:contain;touch-action:pan-y}
.prompt-editor>textarea:focus{border-color:#acc1ff;box-shadow:0 0 0 2px #9eb8ff25}
.prompt-editor-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0}
#stage.panning,#stage.pan-ready,#stage.pan-ready .node-head{cursor:grabbing}
#world{will-change:transform}
@media(max-width:700px){dialog.prompt-editor{padding:14px;height:92dvh;max-height:92dvh}.prompt-editor .dialog-head h2{font-size:19px}.prompt-editor-footer{flex-wrap:wrap}footer{padding:0 8px}footer>div{gap:6px;overflow-x:auto}footer>span:first-child{display:none}}
#stage{overflow:clip}.recover-canvas{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);z-index:12;padding:13px 20px;box-shadow:0 6px 22px #0005}.recover-canvas[hidden]{display:none}

/* Names stay above media, and each reference number shares one row with its name. */
.media-head{height:auto;min-height:72px;align-items:flex-start;gap:8px;padding:11px 14px}
.media-heading{min-width:0;flex:1}.media-kind{display:block;font-size:11px;font-weight:500;color:#aab6cf;margin-bottom:5px}
.media-title{display:block;font-size:14px;line-height:1.45;overflow-wrap:anywhere;white-space:normal}
.media-head>div:last-child{display:flex;flex-shrink:0}
.refs .reference-row{display:flex;width:100%;min-width:0;align-items:center;gap:5px;background:#202735;border:1px solid #465675;border-radius:8px;padding:5px}
.refs .reference-insert{display:flex;flex:1;min-width:0;align-items:center;gap:9px;text-align:left;background:transparent;border:0;padding:0;white-space:normal}
.reference-label{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.reference-alias{font-size:12px;color:#c8d7ff}.reference-name{font-size:12px;line-height:1.4;overflow-wrap:anywhere;color:#dce2ee}
.node .reference-thumb{width:40px;height:40px;max-height:40px;flex-shrink:0;object-fit:cover;border-radius:4px}
.reference-icon{width:40px;flex-shrink:0;text-align:center;font-size:23px;color:#b5cafa}
.refs .reference-locate,.refs .reference-remove{flex-shrink:0;background:transparent;border-color:transparent;padding:5px;font-size:11px}
#stage.pan-ready,#stage.pan-ready *,#stage.panning,#stage.panning *{cursor:grabbing!important;user-select:none!important}

.reference-list{max-height:280px;overflow-y:auto;overscroll-behavior:contain;padding-right:3px;align-content:flex-start}.reference-list .reference-row{flex-shrink:0}.media-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.mention-menu{position:fixed;z-index:10000;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:6px;background:#252a35;color:#edf1fc;border:1px solid #7187b1;border-radius:10px;box-shadow:0 10px 32px #0007;font:14px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;cursor:default}
.mention-heading,.mention-empty{padding:8px 9px;color:#b6c3dc;font-size:12px}.mention-empty{line-height:1.7}
.mention-menu .mention-option{display:flex;align-items:center;gap:10px;width:100%;padding:8px;border:0;border-radius:6px;background:transparent;color:inherit;text-align:left;cursor:pointer}
.mention-menu .mention-option[aria-selected=true],.mention-menu .mention-option:hover{background:#3b4d70}
.mention-thumb,.mention-icon{width:40px;height:40px;flex-shrink:0;border-radius:5px;object-fit:cover;background:#181c25}.mention-icon{display:grid;place-items:center;font-size:24px}.mention-label{display:flex;flex-direction:column;gap:3px;min-width:0}.mention-label strong{font-size:13px;color:#c3d4ff}.mention-label>span{overflow-wrap:anywhere;font-size:12px}
