:is(#world,.layer-world) .block{padding:14px 18px;background:transparent!important;border:0!important;border-radius:0;box-shadow:none;transition:none;isolation:auto;touch-action:none}:is(#world,.layer-world) .block::after{display:none}:is(#world,.layer-world) .block-shell{position:absolute;inset:0;overflow:visible;z-index:-1;pointer-events:none}:is(#world,.layer-world) .block-shell path{fill:var(--create);stroke:#77a394;stroke-width:1}:is(#world,.layer-world) .modify .block-shell path{fill:var(--modify);stroke:#a58abb}:is(#world,.layer-world) .combine .block-shell path{fill:var(--combine);stroke:#6a9da2}:is(#world,.layer-world) .block.selected{outline:0}:is(#world,.layer-world) .block.selected .block-shell path{stroke:var(--focus);stroke-width:2.4}:is(#world,.layer-world) .block .tree-icon{float:right;width:27px;height:27px;margin-right:15px}:is(#world,.layer-world) .block strong{font-size:14px;margin:7px 0 5px;font-weight:600}:is(#world,.layer-world) .block .node-properties{font:10px/1.6 Consolas,monospace;opacity:.75;max-width:calc(100% - 26px)}:is(#world,.layer-world) .block .node-meter{bottom:17px;right:60px;left:18px}:is(#world,.layer-world) .block .node-value{bottom:12px;right:17px}:is(#world,.layer-world) .node-grip{position:absolute;left:2px;top:36px;padding:0;width:14px;min-width:0;height:30px;border:0;background:transparent;opacity:.4;cursor:grab;font-size:17px}:is(#world,.layer-world) .port{z-index:20;position:absolute;top:-10px;transform:translateX(-50%);width:21px;height:21px;border-radius:50%;font-size:15px;line-height:18px;cursor:copy;opacity:.7}:is(#world,.layer-world) .port:hover,:is(#world,.layer-world) .port:focus-visible{opacity:1;outline:2px solid var(--focus);outline-offset:2px}:is(#world,.layer-world) .below-slot{top:auto;bottom:-10px;left:50%;opacity:.35}:is(#world,.layer-world) .block:hover .below-slot{opacity:1}:is(#world,.layer-world) .drag-origin{opacity:.2}:is(#world,.layer-world) .drop-ghost{opacity:.55;pointer-events:none}:is(#world,.layer-world) .drop-ghost .block-shell path{stroke-dasharray:5 3;stroke-width:2}.branch-drag-ghost{position:fixed;z-index:1000;pointer-events:none;max-width:240px;padding:14px 18px;border:1px solid #72dec2;border-radius:12px;background:#183c30e8;color:#e7fff4;box-shadow:0 14px 45px #0003;backdrop-filter:blur(10px)}.branch-drag-ghost strong,.branch-drag-ghost small{display:block}.branch-drag-ghost small{font-size:11px;opacity:.75;margin-top:5px}.branch-drag-ghost[data-valid=false]{border-color:#dc8e74;background:#462e29ed}#scene .grid-cursor{fill:#72dec218;stroke:#72dec2;stroke-width:1.5;pointer-events:none}#scene .grid-child-band{fill:#72dec212;stroke:#72dec255;stroke-width:.6;pointer-events:none}#scene .grid-caption{font:7px Consolas,monospace;fill:#72dec2;pointer-events:none}@media(prefers-reduced-motion:reduce){:is(#world,.layer-world) .block{animation:none!important;transition:none!important}}

:is(#world,.layer-world) .drag-origin{pointer-events:none;opacity:.16}:is(#world,.layer-world) .drag-origin .block-shell path{stroke-dasharray:4 3}:is(#world,.layer-world) .block .fold{z-index:4}
/* Layer workspaces share one inspector and one live input canvas. */
#layers{display:flex;align-items:center;gap:5px;overflow-x:auto;min-width:0;padding:3px}.layer-tab{display:flex;align-items:center;gap:2px;flex:none}.layer-tab input{width:15px;height:15px;margin:0 6px 0 0;accent-color:var(--focus);cursor:pointer}.layer-tab input:disabled{opacity:.3}.layer-bar{gap:8px;min-width:0}.layer-bar #layers{flex:1}#split-layers{white-space:nowrap}.add-layer{min-width:30px}
#layer-viewports[hidden]{display:none}#layer-viewports{flex:1;min-height:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(275px,1fr));grid-auto-rows:minmax(275px,1fr);gap:8px;padding:8px;overflow:auto;background:var(--paper)}.layer-viewport{display:flex;flex-direction:column;min-width:0;min-height:275px;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--paper)}.layer-viewport.active{border-color:var(--focus);box-shadow:0 0 0 1px var(--focus)}.layer-viewport-header{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);min-height:35px;padding:3px 8px;gap:8px}.layer-viewport-header button{border:0;background:transparent;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:11px}.layer-viewport-header span{font:9px Consolas,monospace;opacity:.65}.layer-viewport.muted .block{opacity:.45}.layer-canvas{position:relative;overflow:hidden;flex:1;min-height:235px;touch-action:none;background-image:radial-gradient(#6c8e8444 .7px,transparent .7px);background-size:15px 15px}.layer-world{position:absolute;transform-origin:0 0}.layer-empty{padding:35px 15px;text-align:center;font-size:12px;color:var(--ink)}.layer-viewport #canvas{min-height:235px;flex:1}.layer-viewport .canvas-label{display:none}.layer-viewport .canvas-tools{bottom:8px;left:8px}.layer-world .block{position:absolute}.layer-world .block .fold{z-index:4}.layer-world .port{z-index:10}
@media(max-width:600px){#layer-viewports{grid-template-columns:minmax(0,1fr)}.layer-bar{flex-wrap:wrap}#layers{max-width:100%}}
/* Original Schéma's persistent top-right fold / grab / delete chrome. */
:is(#world,.layer-world) .node-tools{position:absolute;right:5px;top:4px;display:flex;gap:2px;z-index:5}:is(#world,.layer-world) .node-tools button{position:relative;left:auto;top:auto;height:22px;width:23px;min-width:23px;padding:0;display:grid;place-items:center;border:0;border-radius:6px;font-size:15px;background:transparent;box-shadow:none}:is(#world,.layer-world) .node-grip{color:var(--ink);opacity:.6;cursor:grab;touch-action:none}:is(#world,.layer-world) .node-grip:hover{background:#ffffff33;opacity:1}:is(#world,.layer-world) .node-delete{color:#b06d64;opacity:.7}:is(#world,.layer-world) .node-delete:hover{background:#e2978324;opacity:1}:is(#world,.layer-world) .block .fold{right:57px;top:5px;width:23px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;z-index:5}:is(#world,.layer-world) .block .kind{padding-left:18px;padding-right:74px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:is(#world,.layer-world) .block .tree-icon{position:absolute;left:16px;top:12px;width:14px;height:14px;float:none;margin:0}:is(#world,.layer-world) .node-tools button:focus-visible{opacity:1;outline:2px solid var(--focus);outline-offset:2px}.node-delete-dialog{max-width:440px}.node-delete-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:20px 0}.node-delete-actions button,.node-delete-dialog>button{min-height:40px}.node-delete-dialog [role=alert]{color:#b06d64;min-height:16px}@media(pointer:coarse){:is(#world,.layer-world) .node-tools{gap:4px}:is(#world,.layer-world) .node-tools button{width:32px;min-width:32px;height:32px}:is(#world,.layer-world) .block .fold{right:77px;top:4px;width:32px;height:32px}:is(#world,.layer-world) .block .kind{padding-right:108px}:is(#world,.layer-world) .block strong{margin-top:18px}:is(#world,.layer-world) .block .node-properties{max-height:16px}.node-delete-actions button,.node-delete-dialog>button{min-height:44px}}

/* Fold echoes are visual only; the live parent and all final input targets remain authoritative. */
:is(#world,.layer-world) .block-shell{width:100%;height:100%;transform-origin:50% 0;pointer-events:none}
.fold-motion-layer{position:absolute;left:0;top:0;z-index:2;pointer-events:none}
.fold-motion-layer .fold-exit-ghost{pointer-events:none!important;user-select:none}
:is(#world,.layer-world) .fold-shell-before{pointer-events:none}
@media(prefers-reduced-motion:reduce){.fold-motion-layer{display:none}}

/* Layout variants keep physical geometry, tabs and input targets in the same coordinate system. */
:is(#world,.layer-world) .scaled-block{padding:0}
.block-face{position:absolute;left:0;top:0;transform-origin:0 0;padding:14px 18px;pointer-events:none}
.block-face>*{pointer-events:auto}
:is(#world,.layer-world) .scaled-block>.port{width:calc(21px * var(--block-scale));height:calc(21px * var(--block-scale));font-size:calc(15px * var(--block-scale));line-height:calc(18px * var(--block-scale));top:calc(-10px * var(--block-scale));border-width:calc(1px * var(--block-scale))}
:is(#world,.layer-world) .scaled-block>.below-slot{top:auto;bottom:calc(-10px * var(--block-scale))}
.stack-layout-menu{position:relative;font-size:11px;flex:none}
.stack-layout-menu>summary{cursor:pointer;padding:6px 8px;border:1px solid var(--line);border-radius:5px;list-style:none}
.stack-layout-choices{position:absolute;right:0;top:100%;z-index:80;min-width:190px;padding:8px 12px;background:var(--paper);border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 25px #0003}
.stack-layout-choices label{display:block;text-transform:none;letter-spacing:normal;margin:6px 0;color:var(--ink)}
.stack-layout-choices select{display:block!important;width:100%!important;max-width:none!important;min-height:32px}

:is(#world,.layer-world) .scaled-block>.block-shell path{stroke-width:calc(1px * var(--block-scale))}
:is(#world,.layer-world) .scaled-block.selected>.block-shell path{stroke-width:calc(2.4px * var(--block-scale))}

.scene-stacks{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:4}.scene-stack{position:absolute;inset:0;pointer-events:none}.scene-stack .layer-world{pointer-events:none}.scene-stack .block,.scene-stack button,.scene-stack select{pointer-events:auto}.scene-stack .block:focus-visible .block-shell path{stroke:var(--focus);stroke-width:3}.scene-stack-label{position:absolute;left:0;top:0;display:flex;gap:4px;white-space:nowrap;pointer-events:auto;background:var(--paper);border:1px solid var(--line);border-radius:5px;padding:2px}.scene-stack-label button,.scene-stack-label select{font-size:11px;padding:3px;margin:0;width:auto;color:var(--ink);background:var(--paper)}.scene-stack.selected .scene-stack-label{border-color:var(--focus)}.scene-stacks-notice{position:absolute;bottom:0;left:8px;background:var(--paper);font-size:11px}.panel-scene-controls{z-index:12}.panel-scene-controls>select{width:auto;margin:0;font-size:11px;padding:5px;background:var(--paper);color:var(--ink)}.panel-scene-controls>input[type=range]{width:65px;margin:0;padding:0}
.workspace-panel .panel-scene-controls{z-index:12}
