:is(.vr-lab,.challenge-shell) .block-edit-bar{display:flex;gap:5px;align-items:center;flex-wrap:wrap;padding:7px 10px;background:#f0f4fa;border-bottom:1px solid #dce5f0;flex-shrink:0}.block-edit-bar>span{font-size:11px;color:#52647b;flex:1 0 100%}.block-edit-bar button{min-height:40px;flex:1;padding:5px 7px;font-size:12px;border:1px solid #c7d5e7;border-radius:6px;background:white;color:#315b91}.block-edit-bar button:disabled{opacity:.4;cursor:default}.block-edit-bar button:nth-of-type(3){color:#a5404b}:is(.vr-lab,.challenge-shell) :is(.program-row,.race-block).block-selected{outline:2px solid #e4a436;outline-offset:1px}:is(.vr-lab,.challenge-shell) :is(.program-row,.race-block) .row-tools{display:none!important}:is(.vr-lab,.challenge-shell) :is(.program-row,.race-block) .touch-handle{display:block!important;position:absolute;left:1px;top:3px!important;width:30px;height:40px!important;min-height:40px!important;min-width:30px;padding:0;background:transparent;color:#fff;border:0;font-size:24px;touch-action:none;cursor:grab;z-index:3}:is(.vr-lab,.challenge-shell) :is(.program-row,.race-block){padding-left:34px!important}:is(.vr-lab,.challenge-shell) .block-trash{flex-shrink:0;display:grid;place-items:center;min-height:44px;border:1px dashed #bdcce0;border-radius:7px;color:#62748e;font-size:12px;margin:5px 10px;background:#f8faff;transition:background .2s,border-color .2s}:is(.vr-lab,.challenge-shell) .block-trash.trash-over{background:#ffe7e8;border:2px dashed #bc4655;color:#a13140}:is(.vr-lab,.challenge-shell) .block-trash.drag-ready{border-color:#bc4655}:is(.vr-lab,.challenge-shell) .touch-drop{box-shadow:0 -3px #e9a72f!important}:is(.vr-lab,.challenge-shell) .touch-dragging{opacity:.55}.block-edit-bar button:focus-visible,.block-trash:focus-visible{outline:3px solid #e6af50;outline-offset:2px}
@media(max-width:850px){body:is(.vr-lab,.challenge-shell).mobile-lab :is(.program-row,.race-block){padding-left:34px!important}:is(.vr-lab,.challenge-shell) .block-edit-bar{padding:5px 8px;gap:4px}.block-edit-bar button{min-height:44px;font-size:12px}:is(.vr-lab,.challenge-shell) .block-trash{min-height:44px;margin:4px 8px}:is(.vr-lab,.challenge-shell) .block-edit-bar>span{font-size:11px}}

/* Editor additions must occupy their own rows, never fixed legacy grid tracks. */
@media(max-width:850px){
 body:is(.vr-lab,.challenge-shell).mobile-lab main{height:auto!important;min-height:340px;display:block!important}
 body:is(.vr-lab,.challenge-shell).mobile-lab .lab{height:auto!important;min-height:0!important;overflow:visible!important}
 body:is(.vr-lab,.challenge-shell).mobile-lab .lab>.program-panel{display:flex!important;flex-direction:column!important;flex:1 0 auto!important;height:auto!important;min-height:340px!important;overflow:hidden!important}
 body:is(.vr-lab,.challenge-shell).mobile-lab .program-panel>.panel-head,body:is(.vr-lab,.challenge-shell).mobile-lab .program-toolbar,body:is(.vr-lab,.challenge-shell).mobile-lab .program-panel>div:has(>.start-block),body:is(.vr-lab,.challenge-shell).mobile-lab .block-edit-bar,body:is(.vr-lab,.challenge-shell).mobile-lab .block-trash{flex:0 0 auto!important;height:auto!important;position:relative!important;inset:auto!important}
 body:is(.vr-lab,.challenge-shell).mobile-lab .program-toolbar{min-height:30px!important;flex-wrap:wrap!important}
 body:is(.vr-lab,.challenge-shell).mobile-lab .block-edit-bar{min-height:68px!important;padding:6px 8px!important;box-sizing:border-box;z-index:2}
 body:is(.vr-lab,.challenge-shell).mobile-lab .block-edit-bar button{height:44px!important;min-height:44px!important}
 body:is(.vr-lab,.challenge-shell).mobile-lab .program-list{flex:1 1 auto!important;min-height:150px!important;max-height:36dvh!important;height:auto!important;overflow:auto!important;padding-top:8px!important}
 body:is(.vr-lab,.challenge-shell).mobile-lab .program-panel>.legend{display:none!important}
 body:is(.vr-lab,.challenge-shell).mobile-lab .block-trash{min-height:44px!important;margin:6px 8px!important}
}
/* One uninterrupted stack, like a block canvas. */
body.experience-shell .block-edit-bar{display:none!important}
body.experience-shell .scratch-canvas{flex:1 1 0;min-height:0;overflow:auto;background:#fafbff radial-gradient(#d4ddef 1px,transparent 1px) 0 0/20px 20px;padding:16px 18px 28px;box-sizing:border-box;overscroll-behavior:contain}
body.experience-shell .scratch-canvas>.start-block,body.experience-shell .scratch-canvas>.race-start{margin:0!important;min-width:0!important;width:max-content!important;max-width:100%;height:44px!important;padding:7px 14px!important;line-height:28px;box-sizing:border-box;border-radius:22px 22px 4px 4px;font-size:13px}
body.experience-shell .scratch-canvas>ol{background:transparent!important;list-style:none;padding:0!important;margin:0!important;min-height:0!important;max-height:none!important;height:auto!important;overflow:visible!important;display:flex!important;flex-direction:column;align-items:flex-start;gap:0!important}
body.experience-shell .scratch-canvas :is(.program-row,.race-block){flex:0 0 auto!important;margin:-1px 0 0!important}
body.experience-shell .scratch-canvas :is(.program-empty,.race-empty){font-size:12px;padding:20px 0;color:#62748e}
body.experience-shell .scratch-undo{min-height:30px;font-size:11px;padding:6px 8px;border-radius:5px}
.scratch-menu{position:fixed;z-index:2200;width:160px;padding:5px;background:#fff;border:1px solid #d5deec;border-radius:9px;box-shadow:0 8px 26px #243b6230}.scratch-menu[hidden]{display:none}.scratch-menu button{display:block;width:100%;min-height:40px;text-align:left;border:0;background:transparent;color:#243b62;padding:7px 10px;font-size:13px;border-radius:5px}.scratch-menu button:hover{background:#edf2fa}.scratch-menu button:last-child{color:#ac3d4b}.scratch-menu button:disabled{opacity:.35}.scratch-ghost{position:fixed!important;z-index:2300!important;pointer-events:none!important;opacity:.88;transform:rotate(-2deg);margin:0!important;min-width:0!important;max-height:64px;overflow:hidden;box-shadow:0 8px 18px #14243c44;box-sizing:border-box}.scratch-insert{position:fixed;z-index:2100;height:7px;border-radius:4px;background:#ffd254;box-shadow:0 0 0 2px white,0 1px 9px #ffbc3355;pointer-events:none}.scratch-insert[hidden]{display:none}.scratch-delete-zone{outline:3px dashed #c14959;outline-offset:-4px;background:#fff1f2!important}
body.experience-shell :is([data-add],[data-race-add],[data-auto-add]){touch-action:none;cursor:grab}
@media(max-width:850px){body.experience-shell .scratch-canvas{flex:1 1 auto!important;min-height:170px!important;max-height:40dvh!important;padding:12px 9px 26px!important}body.experience-shell .scratch-canvas>ol{min-height:0!important;max-height:none!important;overflow:visible!important}body.experience-shell .scratch-canvas>.race-start,body.experience-shell .scratch-canvas>.start-block{margin:0!important;height:40px!important;font-size:12px!important}.scratch-menu button{min-height:44px}}
/* Match the head tab to each block's notch; remove inherited list insets. */
body.experience-shell .scratch-canvas>.start-block,body.experience-shell .scratch-canvas>.race-start{position:relative;overflow:visible!important;z-index:1;border-bottom:0!important;box-shadow:none!important}
body.experience-shell .scratch-canvas>.start-block:after,body.experience-shell .scratch-canvas>.race-start:after{content:'';position:absolute;left:14px;bottom:-5px;width:24px;height:6px;background:inherit;clip-path:polygon(0 0,100% 0,75% 100%,25% 100%);z-index:2}
body.experience-shell.mobile-lab .scratch-canvas>ol,body.experience-shell.vr-lab.mobile-lab .scratch-canvas>ol,body.experience-shell.challenge-shell.mobile-lab .scratch-canvas>ol{padding:0!important;margin:0!important;gap:0!important;min-height:0!important;max-height:none!important;height:auto!important;overflow:visible!important;align-items:flex-start!important}
body.experience-shell .scratch-canvas :is(.program-row,.race-block),body.experience-shell.mobile-lab .scratch-canvas :is(.program-row,.race-block){margin:-1px 0 0!important;outline:0!important;border-radius:4px!important}
body.experience-shell .scratch-canvas :is(.program-row,.race-block).block-selected{outline:0!important;filter:drop-shadow(0 0 1px #e1a033)}
