/* Canvas-first editor. Existing fields retain their IDs and behavior. */
#editor .creator-workspace[data-cockpit]{--panel:#1c3c2c;--line:#3a5c4b;--muted:#abc6b8;display:flex;flex-direction:column;height:var(--creator-vh,100dvh);overflow:hidden;background:#172d22;color:#edf5ef}
#editor .creator-workspace[data-cockpit][hidden]{display:none}
#editor [data-cockpit] .creator-work-header{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;min-height:60px;height:60px;padding:8px 16px;border-bottom:1px solid var(--line);background:#1d3d2d;flex-shrink:0}
#editor [data-cockpit] .map-name-label{flex:1;min-width:40px;margin:0;max-width:460px}
#editor [data-cockpit] #level-name{width:100%;height:40px;margin:0;border:1px solid transparent;background:transparent;font-size:16px;font-weight:650}
#editor [data-cockpit] #level-name:focus{border-color:#71c9b7;background:#153224}
#editor [data-cockpit] #save-state{margin-left:auto;font-size:11px;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis}
#editor [data-cockpit] .creator-main-actions{display:flex;align-items:center;gap:4px;flex:none;margin:0}
#editor [data-cockpit] .creator-work-header button,#editor [data-cockpit] .editor-file-menu>summary{min-height:38px;padding:7px 12px;border-radius:12px;white-space:nowrap}
#editor [data-cockpit] #test-level{background:#91d6bd;color:#163224;border:0;font-weight:750}
#editor [data-cockpit] .creator-layout{position:relative;display:block;flex:1;min-height:0;margin:0;padding:0;overflow:hidden}
#editor [data-cockpit] .creator-canvas{position:absolute;inset:0;display:block;padding:0;border:0;border-radius:0;min-height:0}
#editor [data-cockpit] #map-stage{position:absolute;inset:0;min-height:0;border:0;border-radius:0}
#editor [data-cockpit] #map,#editor [data-cockpit] #editor3d{position:absolute;inset:0;width:100%;height:100%;min-height:0}
#editor [data-cockpit] #creator-controls,#editor [data-cockpit] .canvas-modes,#editor [data-cockpit] #selection-actions,#editor [data-cockpit] .creator-canvas-help,#editor [data-cockpit] .map-navigation,#editor [data-cockpit] #touch-hint,#editor [data-cockpit] #dimension-readout{display:none!important}
#editor [data-cockpit] .creator-canvas-toolbar{position:absolute;inset:12px auto auto 50%;transform:translateX(-50%);z-index:8;display:flex;align-items:center;justify-content:center;gap:8px;width:max-content;max-width:calc(100% - 16px);padding:5px;background:#1d3d2ded;border:1px solid #56776688;border-radius:16px;box-shadow:0 5px 18px #0a261840}
#editor [data-cockpit] .creator-canvas-toolbar .view-switch,#editor [data-cockpit] .canvas-edit-buttons{display:flex;gap:3px;flex:none}
#editor [data-cockpit] .creator-canvas-toolbar button{min-height:36px;min-width:38px;padding:6px 10px;margin:0;border:0;border-radius:10px;background:transparent;font-size:13px}
#editor [data-cockpit] .creator-canvas-toolbar button[aria-pressed=true]{background:#8fd6bd;color:#153d35}
#editor [data-cockpit] #undo-edit,#editor [data-cockpit] #redo-edit{font-size:22px;line-height:1}
#editor [data-cockpit] #map-summary{position:absolute;inset:68px 12px auto auto;font-size:10px;background:#1d3d2dbb;border:0;padding:4px 8px;border-radius:8px;pointer-events:none}
#editor [data-cockpit] .creator-work-footer{display:flex;align-items:center;gap:12px;flex-shrink:0;min-height:25px;height:25px;padding:2px 12px;border-top:1px solid var(--line);font-size:10px;background:#1d3d2d;overflow:hidden}
#editor [data-cockpit] .creator-work-footer p{margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1}
#editor [data-cockpit] #map-readiness{font-size:10px;max-width:45%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#editor [data-cockpit] .editor-dock{position:absolute;bottom:max(12px,env(safe-area-inset-bottom));right:16px;display:flex;align-items:center;gap:6px;z-index:15;padding:5px;background:#1d3d2df5;border:1px solid #56776688;border-radius:18px;box-shadow:0 5px 20px #0a261840}
#editor [data-cockpit] .editor-dock button,#editor [data-cockpit] .editor-dock summary{min-width:42px;min-height:42px;height:42px;margin:0;border:0;border-radius:12px;display:flex;align-items:center;justify-content:center;padding:6px 10px;font-size:22px;cursor:pointer;background:transparent;color:#d5e2dc}
#editor [data-cockpit] .editor-dock .dock-add{background:#ffc974;color:#49331b;gap:6px;padding:6px 16px;font-size:13px;font-weight:800;box-shadow:0 2px 0 #bc873e}
#editor [data-cockpit] .dock-add span:first-child{font-size:24px;font-weight:400}
#editor [data-cockpit] #editor-focus-toggle{position:static;display:flex;inset:auto;transform:none}
#editor [data-cockpit] .editor-dock [aria-pressed=true],#editor [data-cockpit] .editor-dock .dock-settings[aria-expanded=true]{background:#386758}
#editor [data-cockpit] .cockpit-view{position:relative;border:0;margin:0;padding:0}
#editor [data-cockpit] .cockpit-view summary{list-style:none}
#editor [data-cockpit] .cockpit-view summary::-webkit-details-marker{display:none}
#editor [data-cockpit] .cockpit-view-body{position:absolute;bottom:52px;right:0;width:210px;display:flex;flex-wrap:wrap;gap:5px;padding:10px;background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:0 8px 25px #0a261860}
#editor [data-cockpit] .cockpit-view:not([open]) .cockpit-view-body{display:none}
#editor [data-cockpit] .cockpit-view-body button{font-size:12px;flex:1 1 42%;background:#2e5240}
#editor [data-cockpit] .cockpit-view-body .map-rotation{display:flex;gap:4px;flex:1 1 100%}
#editor [data-cockpit] .selection-window{position:absolute;z-index:10;left:12px;top:76px;width:260px;max-height:calc(100% - 92px);display:flex;flex-direction:column;border:1px solid #5c7c6c88;background:#1c3c2cf5;border-radius:18px;box-shadow:0 10px 28px #0b22173d;overflow:hidden}
#editor [data-cockpit] .selection-window[hidden],#editor [data-cockpit] .object-tray[hidden],#editor [data-cockpit] .map-settings-window[hidden]{display:none!important}
#editor [data-cockpit] .selection-window-header,#editor [data-cockpit] .tray-header,#editor [data-cockpit] .map-settings-window>header{display:flex;align-items:center;gap:6px;min-height:46px;padding:4px 8px 4px 14px;border-bottom:1px solid var(--line);flex-shrink:0}
#editor [data-cockpit] .selection-window-header strong,#editor [data-cockpit] .map-settings-window>header strong{font-size:13px;flex:1;min-width:0}
#editor [data-cockpit] #selection-clear,#editor [data-cockpit] #close-object-tray,#editor [data-cockpit] #close-map-settings{min-height:38px;min-width:38px;border:0;background:#365a48;color:#dcf1e9;border-radius:11px;font-size:24px;padding:0}
#editor [data-cockpit] .selection-window-body,#editor [data-cockpit] .map-settings-body{overflow:auto;overscroll-behavior:contain;padding:10px;min-height:0;scrollbar-width:thin}
#editor [data-cockpit] .selection-window fieldset{padding:0;margin:0;border:0;min-width:0}
#editor [data-cockpit] .selection-window legend,#editor [data-cockpit] #back-to-items{display:none}
#editor [data-cockpit] .selection-window label,#editor [data-cockpit] .map-settings-body label{display:block;font-size:11px;color:#c6dad0;margin:8px 0}
#editor [data-cockpit] .selection-window input,#editor [data-cockpit] .selection-window select,#editor [data-cockpit] .selection-window textarea,#editor [data-cockpit] .map-settings-body input,#editor [data-cockpit] .map-settings-body select,#editor [data-cockpit] .map-settings-body textarea{min-width:0;max-width:100%;font-size:13px;min-height:35px;border-radius:9px;margin:4px 0 0;background:#153425}
#editor [data-cockpit] .selection-window input[type=range]{width:100%}
#editor [data-cockpit] .selection-window button,#editor [data-cockpit] .map-settings-body button{min-height:36px;border-radius:9px;font-size:11px;padding:5px 8px}
#editor [data-cockpit] .selection-window details,#editor [data-cockpit] .map-settings-body details{border:0;border-top:1px solid var(--line);border-radius:0;padding:6px 0;margin:6px 0;background:transparent}
#editor [data-cockpit] .selection-window summary,#editor [data-cockpit] .map-settings-body summary{font-size:11px;min-height:32px;padding:7px 0}
#editor [data-cockpit] .selection-window .tool-help,#editor [data-cockpit] .field-hint{font-size:10px;line-height:1.5;color:var(--muted)}
#editor [data-cockpit] .selection-window .quick-point,#editor [data-cockpit] .selection-window .quick-rotate{display:none!important}
#editor [data-cockpit] .selection-window .number-stepper{display:grid;grid-template-columns:34px minmax(0,1fr) 34px;gap:3px;align-items:center}
#editor [data-cockpit] .selection-window .number-stepper input{width:100%;text-align:center;margin:0}
#editor [data-cockpit] .selection-window .number-stepper button{min-width:0;font-size:18px}
#editor [data-cockpit] .selection-window-actions{display:flex;gap:6px;padding:8px 10px;border-top:1px solid var(--line);flex-shrink:0}
#editor [data-cockpit] .selection-window-actions button{flex:1}
#editor [data-cockpit] .course-buttons{display:flex;gap:5px;margin-bottom:8px}
#editor [data-cockpit] .course-buttons button{flex:1;background:#325645;color:#d4f3dc}
#editor [data-cockpit] .object-tray{position:absolute;left:12px;right:12px;bottom:78px;max-width:900px;margin:auto;z-index:16;border:1px solid #5c7c6c88;background:#1c3c2cfc;border-radius:20px;box-shadow:0 10px 30px #0b221760;max-height:min(430px,65%);overflow:auto;overscroll-behavior:contain}
#editor [data-cockpit] .tray-header strong{font-size:13px;flex:1}
#editor [data-cockpit] .tray-header span{font-size:11px;color:var(--muted)}
#editor [data-cockpit] .tray-filters{display:flex;gap:6px;padding:8px 12px 0}
#editor [data-cockpit] .tray-filters input,#editor [data-cockpit] .tray-filters select{margin:0;min-height:34px;font-size:12px;border-radius:10px;min-width:0;width:auto;max-width:50%;background:#153425}
#editor [data-cockpit] .tray-filters input{flex:1}
#editor [data-cockpit] #palette{display:flex;gap:8px;padding:10px 12px 12px;overflow-x:auto;overscroll-behavior:contain;touch-action:pan-x;scrollbar-width:thin}
#editor [data-cockpit] .palette-group{display:contents}
#editor [data-cockpit] .palette-group[hidden]{display:none}
#editor [data-cockpit] .palette-group h3{display:none}
#editor [data-cockpit] .palette-buttons{display:flex;gap:8px;flex:none}
#editor [data-cockpit] .palette-buttons button{display:block;flex:0 0 70px;width:70px;height:72px;min-width:70px;min-height:72px;padding:4px;border:1px solid #466656;border-radius:14px;background:#294f3c;touch-action:pan-x;cursor:grab;margin:0}
#editor [data-cockpit] .palette-buttons button[hidden]{display:none}
#editor [data-cockpit] .palette-buttons button:hover,#editor [data-cockpit] .palette-buttons button:focus-visible{background:#3c6651;border-color:#ffd18a;outline:2px solid #ffd18a;outline-offset:1px}
#editor [data-cockpit] .palette-buttons svg{width:100%;height:100%;pointer-events:none}
#editor [data-cockpit] .tray-extra{margin:0 12px 8px;padding:0;border:0;border-top:1px solid var(--line);background:transparent}
#editor [data-cockpit] .tray-extra summary{font-size:11px;padding:9px 0}
#editor [data-cockpit] .map-settings-window{position:absolute;right:12px;top:76px;bottom:78px;width:min(350px,calc(100% - 24px));z-index:16;background:#1c3c2cfc;border:1px solid #5c7c6c88;border-radius:18px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 10px 28px #0b221760}
#editor [data-cockpit] #panel-options{padding:0;display:block!important}
#editor [data-cockpit] #panel-options>h2{display:none}
#editor [data-cockpit] .placement-actions{position:absolute;left:50%;right:auto;bottom:78px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 20px);z-index:9;background:#1d3d2df5;border:1px solid var(--line);border-radius:14px;padding:5px;display:flex;gap:5px}
#editor [data-cockpit] .placement-actions[hidden]{display:none}
#editor [data-cockpit] .placement-actions button{font-size:12px;min-height:38px;border-radius:9px}
#editor .item-drag-ghost{position:fixed;z-index:1000;width:64px;height:64px;transform:translate(-50%,-50%);pointer-events:none;filter:drop-shadow(0 5px 6px #0008)}
#editor [data-cockpit][data-focus=true] .selection-window,#editor [data-cockpit][data-focus=true] .object-tray,#editor [data-cockpit][data-focus=true] .map-settings-window,#editor [data-cockpit][data-focus=true] .creator-canvas-toolbar{display:none!important}
#editor [data-cockpit][data-focus=true] .editor-dock{display:flex!important}
#editor [data-cockpit] button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:600px){
 #editor [data-cockpit] .creator-work-header{height:54px;min-height:54px;padding:6px 8px;gap:5px}
 #editor [data-cockpit] #save-state{display:none}
 #editor [data-cockpit] #level-name{font-size:14px;padding:4px}
 #editor [data-cockpit] .creator-work-header button,#editor [data-cockpit] .editor-file-menu>summary{padding:6px 9px;font-size:11px}
 #editor [data-cockpit] .selection-window{top:72px;left:6px;width:min(190px,49vw);max-height:calc(100% - 154px);border-radius:14px}
 #editor [data-cockpit] .selection-window-header{padding-left:9px;min-height:44px}
 #editor [data-cockpit] .selection-window-body{padding:7px}
 #editor [data-cockpit] .selection-window input,#editor [data-cockpit] .selection-window select,#editor [data-cockpit] .selection-window textarea{font-size:16px}
 #editor [data-cockpit] .selection-window .creator-field-pair{display:block}
 #editor [data-cockpit] .selection-window .creator-button-pair{gap:4px}
 #editor [data-cockpit] .selection-window-actions{padding:6px;gap:4px}
 #editor [data-cockpit] .editor-dock{right:8px;bottom:max(8px,env(safe-area-inset-bottom));gap:2px;padding:4px}
 #editor [data-cockpit] .editor-dock button,#editor [data-cockpit] .editor-dock summary{min-height:44px;height:44px;min-width:44px}
 #editor [data-cockpit] .tray-header{flex-wrap:wrap;position:relative;padding:10px 48px 10px 12px;gap:3px}
 #editor [data-cockpit] .tray-header strong,#editor [data-cockpit] .tray-header span{flex-basis:100%}
 #editor [data-cockpit] #close-object-tray{position:absolute;right:7px;top:8px}
 #editor [data-cockpit] .object-tray{left:6px;right:6px;bottom:70px;max-height:55%;border-radius:16px}
 #editor [data-cockpit] .map-settings-window{top:70px;right:6px;bottom:70px}
 #editor [data-cockpit] #map-readiness{display:none}
 #editor [data-cockpit] .creator-work-footer{height:22px;min-height:22px}
 #editor [data-cockpit] .cockpit-view-body{right:-45px}
}

#editor [data-cockpit] .cockpit-view>summary::before,#editor [data-cockpit] .cockpit-view>summary::after{display:none}
#editor [data-cockpit] .selection-window .number-stepper>button{display:block!important}
#editor [data-cockpit] .selection-window .number-stepper>input{width:100%!important;grid-column:2}
#editor [data-cockpit] .selection-window input[type=number]{appearance:textfield;-moz-appearance:textfield}
#editor [data-cockpit] .selection-window input[type=number]::-webkit-inner-spin-button{appearance:none}

#editor [data-cockpit] #palette{flex-wrap:nowrap}
#editor [data-cockpit] #remove-object,#editor [data-cockpit] #remove-point{display:none}
#editor [data-cockpit] .placement-caption{align-self:center;padding:0 6px;font-size:11px;color:#f0dbb1}
#editor [data-cockpit] .map-settings-body .number-stepper{display:grid;grid-template-columns:34px minmax(0,1fr) 34px;gap:3px;align-items:center}
#editor [data-cockpit] .map-settings-body .number-stepper>button{display:block!important}
#editor [data-cockpit] .map-settings-body .number-stepper>input{width:100%!important;grid-column:2;text-align:center;margin:0}

#editor [data-cockpit] .selection-window{max-height:min(540px,calc(100% - 154px))}
@media(max-width:600px){#editor [data-cockpit] .selection-window{max-height:min(440px,calc(100% - 154px))}}

/* Camera actions are direct, not another menu. */
#editor [data-cockpit] .camera-rail{position:absolute;right:10px;top:96px;z-index:8;display:flex;flex-direction:column;gap:2px;padding:3px;background:#1c3c2cba;border:1px solid #56776655;border-radius:14px;max-height:calc(100% - 174px);overflow:auto;scrollbar-width:none}
#editor [data-cockpit] .camera-rail button{display:flex;align-items:center;justify-content:center;width:36px;min-width:36px;height:36px;min-height:36px;padding:7px;border:0;border-radius:9px;background:transparent;color:#c7dbd1;margin:0}
#editor [data-cockpit] .camera-rail button:hover,#editor [data-cockpit] .camera-rail button[aria-pressed=true]{background:#35695f;color:#d5ffdf}
#editor [data-cockpit] .camera-rail .map-rotation{display:flex;flex-direction:column;gap:2px;padding:3px 0 0;margin:3px 0 0;border-top:1px solid #56776666}
#editor [data-cockpit] .camera-rail .map-rotation[hidden]{display:none}
#editor [data-cockpit] button svg{display:block;pointer-events:none;flex-shrink:0}
#editor [data-cockpit] .selection-window-actions{justify-content:flex-end}
#editor [data-cockpit] .selection-window-actions button{flex:none;display:flex;justify-content:center;align-items:center;min-width:40px}
#editor [data-cockpit] .selection-window-actions #selection-remove{color:#eeb29c}
#editor [data-cockpit] .selection-window-header button,#editor [data-cockpit] .tray-header button,#editor [data-cockpit] .map-settings-window>header button{display:flex;align-items:center;justify-content:center}
#editor [data-cockpit] .creator-canvas-toolbar button{display:flex;align-items:center;justify-content:center}
#editor [data-cockpit] .map-settings-window{z-index:18}
@media(max-width:600px){#editor [data-cockpit] .camera-rail{right:6px;top:92px}#editor [data-cockpit] .camera-rail button{width:40px;height:40px;min-width:40px;min-height:40px}}
@media(max-height:540px){#editor [data-cockpit] .camera-rail{top:68px;max-height:calc(100% - 140px)}}

/* Floating editor update: canvas owns the viewport, panels are overlays. */
#editor [data-cockpit] .creator-work-header{position:absolute;inset:0 0 auto;z-index:22;height:56px;min-height:56px;background:transparent;border:0;pointer-events:none;padding:8px 12px;gap:8px}
#editor [data-cockpit] .creator-work-header>*{pointer-events:auto}
#editor [data-cockpit] .creator-work-header button{display:flex;align-items:center;justify-content:center;width:40px;min-width:40px;height:40px;min-height:40px;padding:9px;border:1px solid #74978544;background:#1d3d2def;box-shadow:0 3px 12px #0a261822;border-radius:13px}
#editor [data-cockpit] .creator-work-header .map-name-label{max-width:300px;background:#1d3d2ddf;border-radius:12px}
#editor [data-cockpit] .creator-work-header #level-name{font-size:13px;padding:8px 10px}
#editor [data-cockpit] .creator-work-header .creator-main-actions:empty{display:none}
#editor [data-cockpit] .creator-layout{height:100%;flex:1}
#editor [data-cockpit] .creator-work-footer{position:absolute;left:12px;bottom:8px;max-width:45%;z-index:7;background:transparent;border:0;pointer-events:none;color:#c2d9ce;height:auto}
#editor [data-cockpit] .creator-canvas-toolbar{top:64px;border-radius:13px;gap:4px;padding:3px}
#editor [data-cockpit] .creator-canvas-toolbar button{min-width:36px;min-height:36px;padding:6px}
#editor [data-cockpit] #map-summary{top:112px}
#editor [data-cockpit] .camera-rail{top:140px}
#editor [data-cockpit] .camera-rail .map-rotation,#editor [data-cockpit] #focus-object{display:none!important}
#editor [data-cockpit] .selection-window{top:auto;bottom:74px;left:12px;right:12px;width:min(680px,calc(100% - 24px));max-height:50%;margin:0 auto;border-radius:20px;z-index:17}
#editor [data-cockpit] .selection-window-body{padding:8px 12px}
#editor [data-cockpit] .selection-window-header{min-height:40px;padding-block:2px}
#editor [data-cockpit] .selection-window-actions{padding:4px 10px}
#editor [data-cockpit] .map-settings-window{top:62px;bottom:76px;width:min(410px,calc(100% - 24px))}
#editor [data-cockpit] .map-settings-body{flex:1;min-height:0}
#editor [data-cockpit] .publish-footer{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line);background:#1d3d2d;flex-shrink:0}
#editor [data-cockpit] .publish-footer button{flex:1;min-height:44px;border-radius:12px;font-size:12px}
#editor [data-cockpit] #publish-level{background:#ffc974;color:#49331b;border:0;font-weight:750}
#editor [data-cockpit] .map-items-window{position:absolute;right:10px;top:62px;bottom:76px;width:min(330px,calc(100% - 20px));z-index:19;background:#1c3c2cfc;border:1px solid var(--line);border-radius:18px;display:flex;flex-direction:column;overflow:hidden}
#editor [data-cockpit] .map-items-window>header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;font-size:13px;flex-shrink:0;border-bottom:1px solid var(--line)}
#editor [data-cockpit] #close-map-items{display:flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;border:0;border-radius:10px;background:#365a48}
#editor [data-cockpit] #map-items{overflow:auto;border:0;padding:10px;margin:0;min-height:0}
#editor [data-cockpit] #map-items>summary{display:none}
#editor [data-cockpit] #hazards{display:grid;gap:6px}
#editor [data-cockpit] #hazards button{font-size:12px;min-height:44px;border-radius:10px}
#editor [data-cockpit] .npc-defaults{margin:0 12px 10px;border:0;border-top:1px solid var(--line);padding:8px 0;background:transparent}
#editor [data-cockpit] .npc-defaults summary{font-size:12px;min-height:36px;padding:8px 0;cursor:pointer}
#editor [data-cockpit] .npc-defaults label{display:block;margin:10px 0;font-size:12px}
#editor [data-cockpit] .npc-defaults input,#editor [data-cockpit] .npc-defaults select{max-width:100%;min-height:40px;font-size:14px;border-radius:9px}
#editor [data-cockpit] .npc-defaults .tool-help{font-size:11px;line-height:1.5;color:var(--muted)}
#editor [data-cockpit] .editor-dock{z-index:23}
/* Focus preserves all open/selected state, hiding chrome without resetting it. */
#editor [data-cockpit][data-focus=true]>.creator-work-header,#editor [data-cockpit][data-focus=true]>.creator-work-footer,
#editor [data-cockpit][data-focus=true] .creator-layout>:not(.creator-canvas):not(.editor-dock),
#editor [data-cockpit][data-focus=true] .creator-canvas>:not(#map-stage),
#editor [data-cockpit][data-focus=true] #map-stage>:not(#map):not(#editor3d),
#editor [data-cockpit][data-focus=true] .editor-dock>:not(#editor-focus-toggle){display:none!important}
#editor [data-cockpit][data-focus=true] .editor-dock{border:0;box-shadow:none;background:transparent;padding:0}
#editor [data-cockpit][data-focus=true] #editor-focus-toggle{background:#1d3d2ded;border:1px solid #74978566}
@media(min-width:1000px){
 #editor [data-cockpit] .selection-window{left:16px;right:auto;width:520px;bottom:24px;margin:0}
 #editor [data-cockpit] .selection-window .creator-field-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}
 #editor [data-cockpit] .creator-canvas-toolbar{top:10px}
 #editor [data-cockpit] .map-settings-window{width:410px}
}
@media(max-width:600px){
 #editor [data-cockpit] .creator-work-header{padding:6px;gap:5px}
 #editor [data-cockpit] .creator-work-header button{min-width:40px;width:40px;height:40px;padding:9px}
 #editor [data-cockpit] .selection-window{left:6px;right:6px;width:calc(100% - 12px);max-height:50%;bottom:70px}
 #editor [data-cockpit] .selection-window .creator-field-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 #editor [data-cockpit] .selection-window input,#editor [data-cockpit] .selection-window select,#editor [data-cockpit] .selection-window textarea{font-size:16px;min-height:36px}
 #editor [data-cockpit] .map-settings-window{top:58px;bottom:70px}
 #editor [data-cockpit] .creator-work-footer{display:none}
 #editor [data-cockpit] .camera-rail{top:128px}
 #editor [data-cockpit] .object-tray{max-height:50%}
}

#editor [data-cockpit] #selection-fold{display:flex;align-items:center;justify-content:center;min-height:38px;min-width:38px;background:transparent;border:0;padding:7px}
#editor [data-cockpit] .selection-window[data-collapsed=true] .selection-window-body,#editor [data-cockpit] .selection-window[data-collapsed=true] .selection-window-actions{display:none}
/* Mobile refinement: unified layers drawer and compact floating chrome. */
#editor [data-cockpit] .camera-rail{display:flex;flex-direction:row;align-items:flex-start;padding:5px;gap:0;max-width:calc(100% - 12px);overflow:hidden;transition:background-color .24s,border-color .24s,box-shadow .24s}
#editor [data-cockpit] .camera-rail-buttons{display:flex;flex-direction:column;gap:4px;flex:none}
#editor [data-cockpit] .camera-rail .map-items-window{position:static;inset:auto;width:0;max-height:min(50dvh,390px);border:0;border-radius:0;background:transparent;flex:none;margin:0;transition:width .28s cubic-bezier(.2,.8,.2,1),opacity .18s;opacity:0}
#editor [data-cockpit] .camera-rail[data-items-open=true] .map-items-window{width:min(290px,calc(100vw - 88px));opacity:1;border-right:1px solid #8ea99c33;margin-right:5px}
#editor [data-cockpit] .camera-rail #map-items-window[hidden]{display:none!important}
#editor [data-cockpit] #toggle-map-items[aria-pressed=true]{background:#85d4bb;color:#142b20;box-shadow:0 0 0 1px #b7ead7}
#editor [data-cockpit] #focus-point:disabled{opacity:.28;cursor:default;background:transparent;box-shadow:none}
#editor [data-cockpit] .map-items-window>header{padding:5px 7px;font-size:12px;white-space:nowrap}
#editor [data-cockpit] #map-items{padding:6px}
#editor [data-cockpit] #hazards .map-item-row{display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:5px;align-items:center}
#editor [data-cockpit] #hazards .hazard-select{display:flex;align-items:center;gap:7px;text-align:left;padding:6px;border:1px solid #75918340;background:#ffffff08;font-size:11px;min-width:0;line-height:1.4;cursor:pointer}
#editor [data-cockpit] #hazards .hazard-select::after{content:'›';margin-left:auto;font-size:18px;color:#9bd4c5}
#editor [data-cockpit] #hazards .hazard-select[aria-pressed=true]{background:#85d4bb22;border-color:#85d4bb}
#editor [data-cockpit] .map-item-illustration{width:30px;height:30px;flex:none;display:block}
#editor [data-cockpit] .map-item-illustration svg{width:100%;height:100%}
#editor [data-cockpit] #hazards .hazard-remove{width:36px;height:36px;min-height:36px;padding:0;border-radius:10px;border:1px solid #eaa69a33;background:#ba5d5020;color:#f3b1a5;font-size:20px;align-self:center}
#editor [data-cockpit] #hazards .hazard-remove:hover{background:#ba5d5040}
#editor [data-cockpit] .publish-footer{flex-wrap:wrap}
#editor [data-cockpit] .publish-footer button{min-width:85px}
@media(max-width:600px){
 #editor [data-cockpit] .creator-work-header{align-items:center;gap:6px}
 #editor [data-cockpit] .creator-work-header .map-name-label{height:40px;min-height:40px;padding:0;display:flex;align-items:center;box-sizing:border-box;align-self:center;line-height:1;margin:0}
 #editor [data-cockpit] .creator-work-header #level-name{display:block;box-sizing:border-box;height:40px;min-height:40px;max-height:40px;line-height:20px;padding:10px 9px;margin:0;font-size:16px;border-radius:12px}
 #editor [data-cockpit] #hazards .hazard-remove{min-height:44px;width:36px;height:44px}
}
@media(prefers-reduced-motion:no-preference){
 #editor [data-cockpit] button{transition:background-color .16s,border-color .16s,color .16s,box-shadow .16s,opacity .16s,transform .16s}
 #editor [data-cockpit] button:active:not(:disabled){transform:scale(.96)}
 #editor [data-cockpit] .selection-window:not([hidden]),#editor [data-cockpit] .object-tray:not([hidden]),#editor [data-cockpit] .map-settings-window:not([hidden]){animation:editor-panel-arrive .24s cubic-bezier(.2,.8,.2,1)}
 #editor .creator-dialog[open]{animation:editor-panel-arrive .22s cubic-bezier(.2,.8,.2,1)}
 @keyframes editor-panel-arrive{from{opacity:0;translate:0 10px}to{opacity:1;translate:0 0}}
}
@media(prefers-reduced-motion:reduce){#editor [data-cockpit] *,#editor .creator-dialog{animation:none!important;transition:none!important}}
#editor [data-cockpit] .camera-rail #hazards .hazard-select{width:100%;height:auto;min-height:44px;max-width:none}
#editor [data-cockpit] .camera-rail #close-map-items{width:32px;height:36px;min-width:32px;min-height:36px;padding:5px}
/* Fast, coordinated editor motion. Containers resize while their content fades in. */
#editor [data-cockpit] .camera-rail{box-sizing:border-box;width:52px;height:232px;min-height:0;transition:width .18s cubic-bezier(.2,.8,.2,1),height .18s cubic-bezier(.2,.8,.2,1),background-color .18s;align-items:stretch}
#editor [data-cockpit] .camera-rail[data-items-open=true]{width:min(350px,calc(100vw - 16px));height:min(390px,calc(100dvh - 240px));background:#1d392bf5}
#editor [data-cockpit] .camera-rail-buttons{margin-left:auto;width:40px;justify-content:flex-start}
#editor [data-cockpit] .camera-rail .map-items-window,#editor [data-cockpit] .camera-rail[data-items-open=true] .map-items-window{display:flex!important;flex:1;min-width:0;width:auto;max-height:none;margin:0 5px 0 0;border:0;border-right:1px solid #8ea99c22;opacity:0;visibility:hidden;transform:translateX(7px);transition:opacity .12s,transform .18s,visibility .18s;pointer-events:none}
#editor [data-cockpit] .camera-rail[data-items-open=true] .map-items-window{visibility:visible;opacity:1;transform:none;pointer-events:auto}
#editor [data-cockpit] #hazards .map-item-row{border:0!important;padding:0!important;margin:0!important;grid-template-columns:minmax(0,1fr) 36px;transition:grid-template-columns .14s;gap:4px}
#editor [data-cockpit] #hazards .map-item-row[data-delete-armed=true]{grid-template-columns:minmax(0,1fr) 76px}
#editor [data-cockpit] #hazards .hazard-select{border:0;background:transparent;padding:4px}
#editor [data-cockpit] #hazards .hazard-remove[data-armed=true]{width:76px!important;background:#b8473e;color:#fff3ee;font-size:12px;font-weight:700;border:1px solid #f6a69a66}
#editor [data-cockpit] .editor-dock{box-sizing:border-box;overflow:hidden;gap:5px;padding:5px;border-radius:18px;box-shadow:0 6px 26px #081d1344;backdrop-filter:blur(14px)}
#editor [data-cockpit] .editor-dock #add-object-tray{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:42px;min-height:42px;line-height:1;padding:0 13px;margin:0;font-size:12px;font-weight:750;border-radius:12px;background:#efc581;color:#273d36;box-shadow:none;white-space:nowrap}
#editor [data-cockpit] #add-object-tray>span{font-size:12px;line-height:1;display:block}
#editor [data-cockpit] #add-object-tray .ui-icon{width:18px;height:18px;display:block;margin:0;flex:none}
#editor [data-cockpit] .object-tray{border-radius:22px;background:#1d392bf7;backdrop-filter:blur(18px);box-shadow:0 12px 40px #0a1e1455;max-height:min(360px,50dvh)}
#editor [data-cockpit] .tray-header{position:relative;border:0;padding:10px 14px 8px;display:grid;grid-template-columns:1fr auto;gap:2px 12px}
#editor [data-cockpit] .tray-header::after{content:'';position:absolute;left:16px;right:16px;bottom:0;height:1px;background:#9db5a92b}
#editor [data-cockpit] .tray-header strong{font-size:14px;letter-spacing:-.02em}
#editor [data-cockpit] .tray-header>span{grid-column:1;font-size:10px}
#editor [data-cockpit] #close-object-tray{grid-column:2;grid-row:1/3;background:transparent}
#editor [data-cockpit] .tray-filters{padding:10px 14px 2px;gap:8px}
#editor [data-cockpit] #palette{padding:10px 14px 14px;gap:6px}
#editor [data-cockpit] .palette-buttons{gap:6px}
#editor [data-cockpit] .palette-buttons button{border:1px solid #8eaa9c25;background:linear-gradient(145deg,#365646,#284436);width:64px;min-width:64px;height:66px;min-height:66px;flex-basis:64px;border-radius:16px;padding:5px;box-shadow:inset 0 1px #ffffff08}
#editor [data-cockpit] .palette-buttons button[data-dragging=true]{background:#467a6b;border-color:#b8e9cf;transform:scale(.95)}
#editor [data-cockpit] .map-settings-window{width:min(420px,calc(100% - 20px));border-radius:24px;background:#1d392bf8;box-shadow:0 12px 40px #0a1e1466;backdrop-filter:blur(18px)}
#editor [data-cockpit] .map-settings-window>header{border:0;padding:10px 14px;min-height:42px}
#editor [data-cockpit] .map-settings-body{padding:0 12px 12px;display:flex;flex-direction:column;gap:8px}
#editor [data-cockpit] .settings-intro{padding:9px 4px 3px}
#editor [data-cockpit] .settings-intro strong{font-size:16px;letter-spacing:-.03em}
#editor [data-cockpit] .settings-intro p{font-size:11px;color:#aec2b8;margin:5px 0}
#editor [data-cockpit] .map-settings-body .settings-section,#editor [data-cockpit] .settings-world-options>details{border:1px solid #849c9020;background:#ffffff04;border-radius:14px;margin:0;padding:6px 10px}
#editor [data-cockpit] .settings-section>summary,#editor [data-cockpit] .settings-world-options>details>summary{font-size:12px;font-weight:650;padding:8px 0;min-height:36px}
#editor [data-cockpit] .settings-section-note{font-size:10px;line-height:1.4;color:#abc1b6;margin:0 0 8px}
#editor [data-cockpit] .settings-world-options{display:flex!important;flex-direction:column;gap:8px;border:0;padding:0;margin:0}
#editor [data-cockpit] .settings-world-options>h2{display:none}
#editor [data-cockpit] .settings-world-options>label{background:#ffffff04;border:1px solid #849c9020;border-radius:12px;padding:8px 10px;margin:0}
#editor [data-cockpit] .publish-footer{padding:9px 12px;background:#1d392b;border-top:1px solid #8ea99c26;gap:6px}
#editor [data-cockpit] .selection-window{width:min(470px,calc(100% - 20px));max-height:40dvh;border-radius:18px;background:#1d392bf5;backdrop-filter:blur(16px);margin:0;left:10px;right:auto;bottom:76px}
#editor [data-cockpit] .selection-window-header{min-height:38px;padding:3px 8px 3px 12px;border-bottom:1px solid #8ea99c20}
#editor [data-cockpit] .selection-window-body{padding:5px 10px}
#editor [data-cockpit] .selection-window label{margin:5px 0;font-size:10px}
#editor [data-cockpit] .selection-window input,#editor [data-cockpit] .selection-window select{min-height:32px;margin-top:3px}
#editor [data-cockpit] .selection-window .creator-field-pair{gap:8px}
#editor [data-cockpit] .selection-window-actions{padding:5px 8px;border-top:1px solid #8ea99c20;gap:4px}
#editor [data-cockpit] .selection-window-actions button{flex:none;min-width:42px;height:34px;min-height:34px;margin-left:auto}
#editor [data-cockpit] .selection-window-actions button+button{margin-left:0}
@media(min-width:900px){#editor [data-cockpit] .selection-window{max-height:55dvh;width:360px}.map-settings-body{scrollbar-gutter:stable}}
@media(max-width:600px){#editor [data-cockpit] .selection-window{max-height:36dvh}#editor [data-cockpit] .selection-window input,#editor [data-cockpit] .selection-window select{font-size:16px}#editor [data-cockpit] .camera-rail{width:52px}}
@media(prefers-reduced-motion:reduce){#editor [data-cockpit] .camera-rail,#editor [data-cockpit] .map-items-window{transition:none!important}}
#editor [data-cockpit] .selection-transforms{display:grid;grid-template-columns:1fr 1fr;gap:5px 9px}
#editor [data-cockpit] .selection-transforms>label:last-child{grid-column:1/-1}
#editor [data-cockpit] .selection-guidance{font-size:10px;line-height:1.4;color:#a1b9ad;margin:3px 0 7px}
#editor [data-cockpit] .selection-window #remove-object{display:none}
/* Unified rail geometry and publication form controls. */
#editor [data-cockpit] .camera-rail{padding:5px;width:52px;align-items:stretch}
#editor [data-cockpit] .camera-rail-buttons{width:40px;min-width:40px;display:flex;align-items:center;gap:4px;margin:0 0 0 auto}
#editor [data-cockpit] .camera-rail-buttons>button{box-sizing:border-box;width:40px;height:40px;min-width:40px;min-height:40px;padding:9px;display:flex;align-items:center;justify-content:center;flex:none}
#editor [data-cockpit] .camera-rail .map-items-window,#editor [data-cockpit] .camera-rail[data-items-open=true] .map-items-window{border:0!important;margin-right:8px;position:relative}
#editor [data-cockpit] .camera-rail[data-items-open=true]::after{content:'';position:absolute;right:49px;top:25%;height:50%;width:1px;background:#a7c0b330;pointer-events:none}
#editor [data-cockpit] .map-items-window>header,#editor [data-cockpit] #map-items,#editor [data-cockpit] #hazards>*{border:0!important}
#editor [data-cockpit] .map-items-window>header{padding:4px 7px;gap:6px}
#editor [data-cockpit] #hazards .map-item-row{grid-template-columns:minmax(0,1fr) 32px}
#editor [data-cockpit] #hazards .hazard-remove{width:32px!important;height:34px;min-height:34px;min-width:32px;font-size:17px;border-radius:9px}
#editor [data-cockpit] #hazards .hazard-remove[data-armed=true]{width:76px!important}
#editor .editor-settings-dialog{color:#edf4ed}
#editor .editor-settings-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:12px}
#editor .editor-settings-dialog h2{font-size:18px;margin:0}
#editor .editor-settings-dialog details{padding:10px;margin:10px 0;border:1px solid #8eaa9c25;border-radius:13px;background:#ffffff04}
#editor .editor-settings-dialog label{display:block;margin:10px 0;font-size:12px}
#editor .editor-settings-dialog input,#editor .editor-settings-dialog select{max-width:100%;box-sizing:border-box}
#editor [data-cockpit] .settings-world-options{gap:10px}
#editor [data-cockpit] .settings-world-options label{font-size:12px;color:#dce9e3;line-height:1.45}
#editor [data-cockpit] .settings-world-options textarea,#editor [data-cockpit] .settings-world-options select,#editor [data-cockpit] .settings-world-options input:not([type=checkbox]):not([type=range]){width:100%;box-sizing:border-box;background:#143022;border:1px solid #75958f55;padding:10px 11px;border-radius:11px;color:#eef4ed;font:inherit;min-height:42px}
#editor [data-cockpit] .settings-world-options textarea{min-height:76px;resize:vertical}
#editor .map-settings-window input[type=checkbox],#editor .editor-settings-dialog input[type=checkbox],#editor #publish-dialog input[type=checkbox]{appearance:none;-webkit-appearance:none;box-sizing:border-box;width:36px;height:22px;min-height:22px;min-width:36px;border:1px solid #78998e66;border-radius:20px;background:#0f2b1d;vertical-align:middle;margin:0 8px 0 0;position:relative;cursor:pointer;transition:background .16s}
#editor .map-settings-window input[type=checkbox]::before,#editor .editor-settings-dialog input[type=checkbox]::before,#editor #publish-dialog input[type=checkbox]::before{content:'';position:absolute;width:16px;height:16px;left:2px;top:2px;background:#9ebbb5;border-radius:50%;transition:transform .16s}
#editor .map-settings-window input[type=checkbox]:checked,#editor .editor-settings-dialog input[type=checkbox]:checked,#editor #publish-dialog input[type=checkbox]:checked{background:#73bea2}
#editor .map-settings-window input[type=checkbox]:checked::before,#editor .editor-settings-dialog input[type=checkbox]:checked::before,#editor #publish-dialog input[type=checkbox]:checked::before{transform:translateX(14px);background:#113d31}
#editor input[type=checkbox]:focus-visible{outline:2px solid #f0ca89;outline-offset:3px}
#editor #editor-tools-settings{display:flex;align-items:center;justify-content:center}
/* Canonical rail layout: two explicit grid tracks, no invisible flex margins. */
#editor #editor-camera-rail{--rail-button:40px;display:grid;grid-template-columns:minmax(0,1fr) var(--rail-button);grid-template-rows:minmax(0,1fr);align-items:stretch;gap:0;box-sizing:border-box;width:52px;height:232px;padding:5px;border:1px solid #64898155;overflow:hidden;background:#1d392b;max-height:calc(100% - 154px)}
#editor #editor-camera-rail[data-items-open=true]{width:min(350px,calc(100% - 16px));height:min(390px,calc(100dvh - 200px));background:#1d392b}
#editor #editor-camera-rail .camera-rail-buttons{grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;box-sizing:border-box;width:40px;min-width:0;padding:0;margin:0;overflow:auto;scrollbar-width:none}
#editor #editor-camera-rail .camera-rail-buttons>button{display:grid;place-items:center;box-sizing:border-box;flex:0 0 40px;width:40px;height:40px;min-width:0;min-height:0;padding:10px;margin:0;line-height:1;border:0}
#editor #editor-camera-rail .camera-rail-buttons>button .ui-icon{display:block;width:20px;height:20px;min-width:0;margin:0;padding:0}
#editor #editor-camera-rail #map-items-window{grid-column:1;grid-row:1;position:static;display:flex!important;box-sizing:border-box;min-width:0;width:100%;height:100%;max-height:none;padding:0 9px 0 0;margin:0!important;border:0!important;overflow:hidden;transform:none}
#editor #editor-camera-rail[data-items-open=false] #map-items-window{padding:0;visibility:hidden;opacity:0;pointer-events:none}
#editor #editor-camera-rail[data-items-open=true]::after{right:49px;top:25%;height:50%;width:1px;background:#a7c0b330}
#editor #editor-camera-rail #map-items-window>header{padding:1px 3px 5px 7px;min-width:0;min-height:36px;gap:4px;flex:none;border:0}
#editor #editor-camera-rail #map-items-window>header strong{font-size:12px;line-height:1.3;min-width:0;flex:1}
#editor #editor-camera-rail #close-map-items{flex:0 0 30px;display:grid;place-items:center;width:30px;height:32px;min-width:0;min-height:0;padding:5px;margin:0}
#editor #editor-camera-rail #map-items{padding:0 3px 3px;min-width:0;overflow:auto;scrollbar-width:thin}
#editor #editor-camera-rail #hazards{gap:3px}
#editor #editor-camera-rail .hazard-select{justify-content:flex-start;min-width:0;overflow-wrap:anywhere}
#editor #editor-camera-rail #hazards .hazard-remove{box-sizing:border-box;display:grid;place-items:center;min-width:0;padding:0;flex:none}
/* All three forms share the same opaque surface, fields and disclosure cards. */
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog).editor-form-panel{box-sizing:border-box;background:#1d392b;color:#edf4ed;border:1px solid #758e8255;box-shadow:0 16px 42px #081b1255;backdrop-filter:none;border-radius:22px;opacity:1}
#editor #map-settings-window.editor-form-panel{width:min(430px,calc(100% - 20px));top:64px;right:10px;bottom:76px;max-height:none;display:flex;flex-direction:column}
#editor #selection-window.editor-form-panel{width:min(380px,calc(100% - 20px));max-height:43dvh;left:10px;bottom:76px}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog).editor-form-panel>header{display:flex;align-items:center;gap:8px;min-height:48px;box-sizing:border-box;padding:8px 12px;border:0;flex:none}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog).editor-form-panel>header :is(strong,h2){font-size:15px;font-weight:700;letter-spacing:-.025em;line-height:1.3;flex:1;min-width:0;margin:0}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog).editor-form-panel>header button{display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;min-height:32px;min-width:32px;padding:6px;margin:0;border:0;border-radius:10px;background:#2e4c3d;color:#d9eae1}
#editor :is(#map-settings-window,#selection-window) :is(.map-settings-body,.selection-window-body){box-sizing:border-box;padding:0 12px 12px;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-gutter:stable}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) details{box-sizing:border-box;background:#ffffff04;border:1px solid #8eaa9c25;border-radius:13px;padding:8px 10px;margin:0 0 8px}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) summary{font-size:12px;font-weight:650;line-height:1.4;padding:7px 0;min-height:32px;cursor:pointer;list-style:none;display:flex;align-items:center;gap:8px}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) summary::-webkit-details-marker{display:none}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) summary::before{display:none}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) summary::after{content:'›';font-size:19px;line-height:1;margin-left:auto;color:#94b9ae;transform:rotate(0);transition:transform .16s}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) details[open]>summary::after{transform:rotate(90deg)}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) label{display:block;box-sizing:border-box;min-width:0;margin:9px 0;color:#cbded5;font-size:11px;font-weight:500;line-height:1.5}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) :is(input:not([type=range]):not([type=checkbox]),select,textarea){box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:38px;padding:8px 10px;margin:5px 0 0;border:1px solid #6c918659;border-radius:10px;background:#143022;color:#eef4ed;font:inherit;line-height:1.4;box-shadow:none}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) textarea{resize:vertical;min-height:70px}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) input[type=range]{width:100%;height:24px;min-height:24px;margin:5px 0;accent-color:#8bcdb5;cursor:pointer}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) :is(input,select,textarea):focus-visible{outline:2px solid #e6c185;outline-offset:2px}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) :is(.tool-help,.field-hint,.settings-section-note,.selection-guidance){font-size:10px;font-weight:400;line-height:1.5;color:#9ebbb2;margin:4px 0 8px}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) input[type=checkbox]{appearance:none;-webkit-appearance:none;box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;width:36px;height:22px;min-width:36px;min-height:22px;margin:0 8px 0 0;padding:0;border:1px solid #78998e66;border-radius:20px;background:#0f2b1d;cursor:pointer;transition:background .16s}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) input[type=checkbox]::before{content:'';position:absolute;left:2px;top:2px;width:16px;height:16px;border-radius:50%;background:#a6c3b6;transition:transform .16s}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) input[type=checkbox]:checked{background:#73bea2}
#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) input[type=checkbox]:checked::before{transform:translateX(14px);background:#113d31}
#editor #map-settings-window .settings-world-options{gap:0;padding:0;margin:0;background:transparent}
#editor #map-settings-window .publish-footer{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;gap:8px;padding:12px;border-top:1px solid #758e8233;background:#1d392b;margin:0;width:100%;box-sizing:border-box}
#editor #map-settings-window .publish-footer button{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;width:100%;min-height:44px;margin:0;line-height:1.3;font-size:12px;font-weight:600;padding:10px 8px;border-radius:10px;white-space:normal;box-sizing:border-box;box-shadow:none}
#editor #map-settings-window .publish-footer :is(#save-level,#export-map-file){background:#bcd4b40a;border:1px solid #bcd4b42b;color:#cbded0}
#editor #map-settings-window .publish-footer #publish-level{grid-column:1/-1;background:#ffda79;color:#214740;border:1px solid transparent;font-weight:700}
#editor #map-settings-window .publish-footer button:disabled{opacity:.45}
#editor #map-settings-window #publish-level{grid-column:2;grid-row:1/3;font-size:13px;background:#efc581;color:#283d34}
#editor #map-settings-window #unpublish-level{grid-column:1/-1;min-height:30px;background:transparent;color:#efb5a8;border:0}
#editor #map-settings-window #unpublish-level:disabled{display:none}
#editor #selection-window .selection-transforms{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
#editor #selection-window .selection-transforms>label:last-child{grid-column:1/-1}
#editor #selection-window .selection-window-actions{padding:7px 12px;border-top:1px solid #758e8233;gap:6px}
#editor #selection-window .selection-window-actions button{width:38px;height:34px;min-height:34px;padding:7px;border-radius:10px}
#editor #selection-window .number-stepper input{margin:0;text-align:center}
#editor #selection-window :is(fieldset,.creator-field-pair){min-width:0}
#editor .editor-compatibility-fields[hidden]{display:none!important}
@media(max-width:600px){#editor #map-settings-window.editor-form-panel{top:60px;bottom:76px}#editor #selection-window.editor-form-panel{max-height:40dvh}#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) :is(input:not([type=range]):not([type=checkbox]),select,textarea){font-size:16px}}
@media(prefers-reduced-motion:reduce){#editor :is(#map-settings-window,#selection-window,.editor-settings-dialog) *,#editor #editor-camera-rail{transition:none!important;animation:none!important}}

/* Content-sized item drawer, bounded by the available workspace. */
#editor #editor-camera-rail[data-items-open=true]{height:auto;min-height:min(232px,calc(100dvh - 200px));max-height:min(390px,calc(100dvh - 200px))}
#editor #editor-camera-rail[data-items-open=true] #map-items-window{height:auto;min-height:0;max-height:min(378px,calc(100dvh - 212px))}
#editor #editor-camera-rail #map-items{min-height:0;flex:0 1 auto}
#editor #editor-camera-rail .map-items-empty{margin:14px 8px;color:#b1c9bf;font-size:12px;line-height:1.5}
#editor #selection-window fieldset{background:transparent;border:0;padding:0;margin:8px 0}
#editor #selection-window .number-stepper{background:transparent;border:0;box-shadow:none;padding:0;display:grid;grid-template-columns:32px minmax(0,1fr) 32px;align-items:center;gap:4px}
#editor #selection-window .number-stepper>button,#editor #selection-window .number-stepper>input{box-sizing:border-box;height:36px;min-height:36px;margin:0;padding:5px;align-self:center}
#editor #road-disconnect-list{display:grid;gap:6px}

/* Keep active paint inside the camera button, never outside its grid cell. */
#editor #editor-camera-rail .camera-rail-buttons>button{border-radius:10px;overflow:hidden;box-shadow:none;transform:none}
#editor #editor-camera-rail #toggle-map-items[aria-pressed=true]{box-shadow:inset 0 0 0 1px #b7ead7;transform:none}
/* Explicit row placement prevents older responsive field rules moving the input. */
#editor #selection-window .number-stepper{min-height:36px;height:36px;margin:5px 0 0;overflow:visible;grid-template-rows:36px;align-items:stretch}
#editor #selection-window .number-stepper>button,#editor #selection-window .number-stepper>input{grid-row:1;min-width:0;max-width:100%;width:100%;height:36px;min-height:36px;max-height:36px;box-sizing:border-box;margin:0!important;vertical-align:middle;line-height:1.2;transform:none;border-radius:9px;align-self:stretch}
#editor #selection-window .number-stepper>button{display:flex!important;align-items:center;justify-content:center;padding:0;font-size:19px}
#editor #selection-window .number-stepper>button:first-child{grid-column:1}
#editor #selection-window .number-stepper>input{grid-column:2;padding:0 4px;appearance:textfield;-moz-appearance:textfield}
#editor #selection-window .number-stepper>button:last-child{grid-column:3}
#editor #selection-window .number-stepper>input::-webkit-inner-spin-button,#editor #selection-window .number-stepper>input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
/* Focus mode has one painted surface: the button itself. */
#editor [data-cockpit][data-focus=true] .editor-dock{background:none!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;padding:0!important;gap:0;border-radius:12px;min-width:0;overflow:hidden}
#editor [data-cockpit][data-focus=true] .editor-dock::before,#editor [data-cockpit][data-focus=true] .editor-dock::after{display:none!important}
#editor [data-cockpit][data-focus=true] #editor-focus-toggle{box-sizing:border-box;flex:0 0 42px;width:42px;min-width:42px;max-width:42px;height:42px;margin:0;box-shadow:none;transform:none;border-radius:12px}
/* Shared stepper geometry for selection, editor settings and publishing. */
#editor :is(#selection-window,#map-settings-window,.editor-settings-dialog).editor-form-panel .number-stepper{display:flex!important;flex-flow:row nowrap!important;align-items:center!important;justify-content:center;gap:4px;height:36px!important;min-height:36px!important;padding:0!important;border:0!important;background:transparent;margin-top:5px}
#editor :is(#selection-window,#map-settings-window,.editor-settings-dialog).editor-form-panel .number-stepper>button,
#editor :is(#selection-window,#map-settings-window,.editor-settings-dialog).editor-form-panel .number-stepper>input[type=number]{box-sizing:border-box!important;position:static!important;align-self:center!important;height:36px!important;min-height:36px!important;max-height:36px!important;margin:0!important;padding-block:0!important;transform:none!important;line-height:normal!important;vertical-align:middle;float:none}
#editor :is(#selection-window,#map-settings-window,.editor-settings-dialog).editor-form-panel .number-stepper>button{display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 32px!important;width:32px!important;min-width:32px!important;padding:0!important;border:1px solid transparent!important;border-radius:9px!important}
#editor :is(#selection-window,#map-settings-window,.editor-settings-dialog).editor-form-panel .number-stepper>input[type=number]{display:block!important;flex:1 1 0!important;width:0!important;min-width:0!important;padding:0 4px!important;border:1px solid #6c918659!important;text-align:center;font-size:16px;appearance:textfield;-moz-appearance:textfield}

#editor .editor-theme-icon{display:inline-block;flex:none;width:20px;height:20px;background-color:currentColor;mask:var(--editor-icon) center/contain no-repeat;-webkit-mask:var(--editor-icon) center/contain no-repeat;filter:none!important;opacity:1}
#editor .editor-item-art{color:var(--editor-art-color,#c9dfd5)}
#editor #test-level{color:#183e32}
#editor #editor-tools-settings,#editor #creator-help{color:#c9dfd5}
#editor #editor-camera-rail .camera-rail-buttons>button{color:#bbd7ce}
#editor #editor-camera-rail #toggle-map-items[aria-pressed=true]{color:#163d32}
#editor #selection-remove{color:#edaa9b}
#editor [data-place=tree],#editor [data-place=mountain]{--editor-art-color:#8fc6a2}
#editor [data-place=wet],#editor [data-place=wind]{--editor-art-color:#99d4b7}
#editor [data-place=barrier],#editor [data-place=cone],#editor [data-place=gap]{--editor-art-color:#edbc79}
#editor [data-place=rock],#editor [data-place=concrete]{--editor-art-color:#bccbc6}
/* My Maps — collection-first, mobile-friendly library. Scoped away from canvas UI. */
#editor #creator-home{min-height:100dvh;background:radial-gradient(ellipse at 90% 0,#31584e55,transparent 45%),#142c34;color:#eaf2e9;font-family:'DM Sans',sans-serif}
#editor #creator-home .creator-home-header{display:flex;align-items:center;flex-wrap:nowrap;gap:12px;min-height:64px;padding:12px max(18px,calc((100% - 1100px)/2));background:transparent;border:0;border-bottom:1px solid #8cafa51a}
#editor #creator-home .creator-brand{display:flex;align-items:center;gap:10px;font-size:12px;letter-spacing:.12em;text-decoration:none;color:#eaf2e9}
#editor #creator-home .creator-brand>span{font-size:9px;color:#97b4a9;letter-spacing:.1em;margin:0;border-left:1px solid #8cafa540;padding-left:10px}
#editor #creator-home .creator-home-header nav{margin-left:auto;display:flex;flex-direction:row;gap:0}
#editor #creator-home .creator-home-header nav a,#editor #creator-home .library-back{display:flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:8px;border-radius:12px;background:transparent;border:0;color:#bbd2c6;text-decoration:none;font-size:12px}
#editor #creator-home .library-icon{display:inline-block;flex:none;width:19px;height:19px;background:currentColor;mask:var(--art) center/contain no-repeat;-webkit-mask:var(--art) center/contain no-repeat}
#editor #creator-home .creator-library{max-width:1100px;margin:auto;padding:38px 18px 48px}
#editor #creator-home .library-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 28px}
#editor #creator-home .library-heading>div{flex:1;min-width:0}
#editor #creator-home .library-heading h1{font:700 clamp(28px,4vw,40px)/1.15 'DM Sans',sans-serif;letter-spacing:-.05em;margin:0 0 8px}
#editor #creator-home .library-heading h1::after{content:none}
#editor #creator-home .library-heading p{color:#a8c1b5;font-size:13px;line-height:1.5;margin:0}
#editor #creator-home #blank-map{display:flex;align-items:center;justify-content:center;gap:7px;flex:none;width:auto;min-height:44px;padding:11px 17px;border:0;border-radius:14px;background:#efc681;color:#283b32;font-size:13px;font-weight:700;box-shadow:none}
#editor #creator-home .library-tabs{display:flex;flex-wrap:nowrap;gap:4px;width:fit-content;max-width:100%;padding:4px;margin:0 0 22px;border:1px solid #8cafa522;border-radius:14px;background:#0b202844}
#editor #creator-home .library-tabs>button{display:flex;align-items:center;justify-content:center;gap:5px;min-height:38px;min-width:0;padding:8px 18px;border:0;border-radius:10px;background:transparent;color:#a8c1b5;font-size:12px;white-space:nowrap}
#editor #creator-home .library-tabs>button[aria-selected=true]{background:#91cbb3;color:#173c30;box-shadow:0 2px 6px #071b2522}
#editor #creator-home .library-tabs span{font-size:10px;opacity:.72}
#editor #creator-home .library-utilities{display:flex;align-items:center;gap:6px}
#editor #creator-home .library-utilities>span{margin-right:auto;font-size:9px;font-weight:700;letter-spacing:.15em;color:#91afa1}
#editor #creator-home .library-utilities button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:38px;width:auto;margin:0;padding:8px 10px;border:1px solid #87a99b25;border-radius:11px;background:transparent;color:#c6dacd;font-size:12px}
#editor #creator-home #library-status{font-size:11px;line-height:1.5;color:#94b0a4;min-height:17px;margin:8px 0 16px}
#editor #creator-home #library-status[data-error=yes]{color:#f4b4a2}
#editor #creator-home .map-card-grid{grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px;align-items:start}
#editor #creator-home .map-card{display:flex;flex-direction:column;min-width:0;border:1px solid #85a79c2c;border-radius:20px;background:#1d3942;overflow:hidden;padding:0;box-shadow:0 6px 18px #06171d20;transition:transform .16s,border-color .16s}
#editor #creator-home .map-card>img,#editor #creator-home .map-card>canvas{display:block;width:100%;height:156px;min-height:0;object-fit:cover;aspect-ratio:16/9;background:#102831;margin:0;border-radius:0}
#editor #creator-home .map-card-content{padding:14px!important;gap:7px;min-width:0}
#editor #creator-home .map-card-state{align-self:flex-start;font-size:9px!important;font-weight:650;letter-spacing:.04em;padding:4px 7px;border-radius:6px;color:#b2cbbb;background:#91bfa912}
#editor #creator-home [data-kind=published] .map-card-state{color:#a5dfbd;background:#7ad6a41c}
#editor #creator-home .map-card h2{font-size:18px!important;letter-spacing:-.025em;margin:2px 0;line-height:1.3;overflow-wrap:anywhere}
#editor #creator-home .map-card-content>p:not(.map-card-state){font-size:11px!important;color:#9db9ac;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#editor #creator-home .map-card-actions{display:grid;grid-template-columns:minmax(0,1fr) 40px minmax(0,1fr) 40px;align-items:center;gap:6px;margin-top:10px}
#editor #creator-home .map-card-actions>button{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;width:100%;height:40px;min-height:40px;margin:0;padding:7px;border-radius:10px;border:1px solid #89ac9e30;background:transparent;color:#c7ddcf;font-size:11px;white-space:nowrap}
#editor #creator-home .map-card-actions>.map-open{background:#86c4ab;color:#173b2e;border:0;font-weight:700}
#editor #creator-home .map-card-actions>.draft-delete{color:#d99b8e;border-color:transparent}
#editor #creator-home [data-kind=template] .map-card-actions{grid-template-columns:1fr}
#editor #creator-home .map-library-empty{grid-column:1/-1;padding:48px 20px;border:1px dashed #88ab9a38;border-radius:20px;background:#8cbbaa05;text-align:center}
#editor #creator-home .map-library-empty strong{font-size:20px;font-weight:650;letter-spacing:-.025em}
#editor #creator-home .map-library-empty p{font-size:13px;color:#9eb9ad;line-height:1.6;margin:10px auto 18px;max-width:330px}
#editor #creator-home .map-library-empty button{background:#8ac8ae;color:#183b30;border:0;border-radius:12px;padding:10px 15px;min-height:42px}
#editor #creator-home .recovery-card{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid #dfbe7f44;border-radius:14px;background:#dfbe7f09;margin:0 0 20px;font-size:12px}
#editor #creator-home .recovery-card>div{flex:1;min-width:0}
#editor #creator-home .recovery-card p{font-size:11px;line-height:1.5;color:#b8c4ad}
#editor #creator-home button:focus-visible,#editor #creator-home a:focus-visible{outline:2px solid #efc681;outline-offset:3px}
@media(hover:hover){#editor #creator-home .map-card:hover{border-color:#85a79c77;transform:translateY(-2px)}#editor #creator-home button:hover{filter:brightness(1.08)}}
@media(max-width:600px){#editor #creator-home .creator-library{padding:24px 14px 32px}#editor #creator-home .creator-home-header{padding:10px 14px;gap:6px}#editor #creator-home .creator-home-header nav a>span:last-child{display:none}#editor #creator-home .library-heading{gap:10px;margin-bottom:22px}#editor #creator-home .library-heading p{max-width:190px;font-size:12px}#editor #creator-home #blank-map{padding:10px 12px;font-size:12px}#editor #creator-home .library-tabs{width:100%;box-sizing:border-box}#editor #creator-home .library-tabs>button{flex:1;padding:8px 5px}#editor #creator-home .map-card-grid{grid-template-columns:1fr!important;gap:14px}#editor #creator-home .map-card>img,#editor #creator-home .map-card>canvas{height:150px}#editor #creator-home .recovery-card{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){#editor #creator-home *{transition:none!important;animation:none!important}}
#editor #creator-home .creator-brand{background:none;border:0;padding:0;box-shadow:none}
#editor #creator-home .creator-library{background:transparent}
#editor #creator-home .map-card-grid:not([hidden]){animation:library-reveal .16s ease-out}
@keyframes library-reveal{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){#editor #creator-home .map-card-grid{animation:none!important}}

/* Workspace palette follows the game shell; library styling stays independent. */
#editor .creator-workspace[data-cockpit]{--panel:#18382b;--line:#bcd4b426;--muted:#a8bfaa;font-family:'DM Sans',system-ui,sans-serif;color:#f6f3e9;background:#10251f}
#editor [data-cockpit] button{background-color:#203e31;border-color:#bcd4b42b;color:#e3e8d9;box-shadow:none}
#editor [data-cockpit] button:hover:not(:disabled){border-color:#bcd4b45c;color:#fff7e6}
#editor [data-cockpit] :is(.creator-work-header,.creator-work-footer){background:#102b22;border-color:var(--line)}
#editor [data-cockpit] :is(#save-state,#editor-status,#map-readiness){color:var(--muted)}
#editor [data-cockpit] :is(input,select,textarea){border-color:#bcd4b433;color:#f6f3e9}
#editor [data-cockpit] :is(button,input,select,textarea,summary):focus-visible{outline:2px solid #ffda79;outline-offset:2px}
#editor [data-cockpit] :is(#test-level,.dock-add,#publish-level,.creator-primary){background:#ffda79;color:#214740;border-color:transparent;box-shadow:none}
#editor [data-cockpit] :is(#test-level,.dock-add,#publish-level,.creator-primary):hover:not(:disabled){background:#ffe49c;color:#214740}
#editor [data-cockpit] .creator-canvas-toolbar button[aria-pressed=true],#editor [data-cockpit] #palette [data-place][aria-pressed=true]{background:#ffda791a;color:#ffda79;box-shadow:inset 0 0 0 1px #ffda7970}
#editor [data-cockpit] :is(.object-tray,.selection-window-body,.map-settings-body,#palette),#editor .editor-settings-dialog{scrollbar-width:none}
#editor [data-cockpit] :is(.object-tray,.selection-window-body,.map-settings-body,#palette)::-webkit-scrollbar,#editor .editor-settings-dialog::-webkit-scrollbar{display:none}
#editor :is(.creator-dialog,.editor-settings-dialog){background:#18382b;color:#f6f3e9;border-color:#bcd4b433}
#editor :is(.creator-dialog,.editor-settings-dialog)::backdrop{background:#06140dc9}
#editor :is(.creator-dialog,.editor-settings-dialog) :is(input:not([type=range]):not([type=checkbox]),select,textarea){background:#10291f;color:#f6f3e9;border-color:#bcd4b433}
#editor :is(.creator-dialog,.editor-settings-dialog) button{background:#254536;color:#e3e8d9;border-color:#bcd4b433}
#editor :is(.creator-dialog,.editor-settings-dialog) .creator-primary{background:#ffda79;color:#214740;border-color:transparent}

/* Primary-action glyphs inherit the dark foreground on gold buttons. */
#editor #add-object-tray .editor-theme-icon,
#editor #test-level .editor-theme-icon{color:inherit}

/* Settings use the same stepper geometry as selected-item properties above. */
#editor .editor-settings-dialog.editor-form-panel .creator-field-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#editor .editor-settings-dialog .number-stepper input::-webkit-inner-spin-button,#editor .editor-settings-dialog .number-stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
#editor .editor-settings-dialog .grid-spacing-field{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 12px}
#editor .editor-settings-dialog .grid-spacing-field output{display:block;margin:0;color:#ffda79;font-size:12px;font-variant-numeric:tabular-nums}
#editor .editor-settings-dialog .grid-spacing-field input[type=range]{grid-column:1/-1;width:100%;min-height:44px;height:44px;margin:0;padding:0;border:0;background:transparent;accent-color:#ffda79}
#editor .editor-settings-dialog .grid-spacing-stops{grid-column:1/-1;display:flex;justify-content:space-between;margin:0;color:#a8bfaa;font-size:10px}
#editor [data-cockpit] :is(.creator-canvas,#map-stage){background:#10251f}
@media(max-width:480px){#editor .editor-settings-dialog.editor-form-panel .creator-field-pair{grid-template-columns:minmax(0,1fr);gap:0}}

/* Vehicle rules must not leave a disabled, unexplained test picker. */
#editor #map-settings-window label[hidden]{display:none!important}
#editor #map-settings-window #test-vehicle-note{display:block;margin:6px 0 12px;color:#a8bfaa;font-size:11px;line-height:1.55;overflow-wrap:anywhere}
#editor #publish-dialog #publish-status[data-error=yes]{display:block;padding:10px 12px;border-left:2px solid #e5ad94;border-radius:6px;background:#e5ad940c;color:#efc0ad;font-size:13px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}

/* Shared vehicle screen entry; the selected test value stays editor-local. */
#editor #map-settings-window .test-vehicle-field[hidden],#editor #map-settings-window #test-car[hidden]{display:none!important}
#editor #map-settings-window .test-vehicle-field{margin:12px 0;color:#cbded5;font-size:11px}
#editor #map-settings-window .editor-choose-vehicle{display:flex;align-items:center;gap:10px;width:100%;min-height:72px;margin-top:7px;padding:8px 12px;border:1px solid #bcd4b433;border-radius:12px;background:#10291f;color:#f6f3e9;text-align:left}
#editor #map-settings-window .editor-choose-vehicle img{width:88px;height:56px;object-fit:contain;flex:none}
#editor #map-settings-window .editor-choose-vehicle>span{min-width:0;overflow-wrap:anywhere}
#editor #map-settings-window .editor-choose-vehicle .editor-vehicle-change{margin-left:auto;color:#ffda79;font-size:11px;white-space:nowrap}


/* One expandable test cluster; no header status or text labels. */
#editor [data-cockpit] .creator-work-header{--test-toolbar-size:40px;align-items:flex-start;background:transparent;gap:6px}
#editor [data-cockpit] .creator-work-header #save-state{display:none}
#editor [data-cockpit] .editor-test-controls{position:relative;display:flex;align-items:flex-start;gap:4px;flex:none;margin-left:auto;padding:2px;border:1px solid #bcd4b42b;border-radius:13px;box-sizing:border-box;background:#18382bf5;box-shadow:0 5px 18px #06140d33;pointer-events:auto}
#editor [data-cockpit] .editor-test-controls .test-vehicle-field{display:block;box-sizing:border-box;flex:0 0 auto;width:64px;min-width:0;margin:0;padding:0;transition:width .22s ease}
#editor [data-cockpit] .editor-test-controls .test-vehicle-field[data-expanded=true]{width:116px}
#editor [data-cockpit] .editor-test-controls #test-car[hidden]{display:none!important}
#editor [data-cockpit] .editor-test-controls .editor-choose-vehicle{display:flex;align-items:center;justify-content:flex-start;width:100%;min-width:0;box-sizing:border-box;height:calc(var(--test-toolbar-size) - 6px);min-height:0;margin:0;padding:0 2px;border:0;border-radius:11px;background:transparent;box-shadow:none;transition:height .22s ease}
#editor [data-cockpit] .editor-test-controls .editor-choose-vehicle img{display:block;box-sizing:border-box;flex:none;width:60px;max-width:100%;height:calc(var(--test-toolbar-size) - 8px);margin:0;padding:0;object-fit:contain;transform-origin:left top;transition:width .22s ease,height .22s ease}
#editor [data-cockpit] .test-vehicle-field[data-expanded=true] .editor-choose-vehicle{height:64px}
#editor [data-cockpit] .test-vehicle-field[data-expanded=true] .editor-choose-vehicle img{width:112px;height:60px}
#editor [data-cockpit] .editor-test-reveal{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows .22s ease,opacity .18s ease}
#editor [data-cockpit] .test-vehicle-field[data-expanded=true] .editor-test-reveal{grid-template-rows:1fr;opacity:1}
#editor [data-cockpit] .editor-test-controls .editor-change-test-car{display:block;min-height:0;height:auto;min-width:0;width:100%;overflow:hidden;padding:0;border:0;border-radius:9px;background:#ffda7912;color:#ffda79;font-size:11px;line-height:40px;white-space:nowrap;box-shadow:none}
#editor [data-cockpit] .editor-test-controls #test-level{flex:none;box-sizing:border-box;width:calc(var(--test-toolbar-size) - 6px);min-width:0;height:calc(var(--test-toolbar-size) - 6px);min-height:0;padding:7px;margin:0;box-shadow:none;border-radius:9px}
#editor #map-settings-window .map-name-label{display:block;width:100%;max-width:none;margin:10px 0}
@media(prefers-reduced-motion:reduce){#editor [data-cockpit] .editor-test-controls *{transition:none}}

/* Quiet, integrated vehicle action beneath the expanded preview. */
#editor [data-cockpit] .editor-test-controls .editor-change-test-car{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-width:0;min-height:0;height:auto;margin:0;padding:0 6px;border:0;border-radius:8px;background:transparent;color:#c3d7bb;font-family:inherit;font-size:11px;font-weight:600;line-height:1.4;letter-spacing:0;white-space:nowrap;box-shadow:none;transition:padding .22s ease,background-color .15s ease,color .15s ease}
#editor [data-cockpit] .test-vehicle-field[data-expanded=true] .editor-change-test-car{padding:11px 6px}
#editor [data-cockpit] .editor-test-controls .editor-change-test-car::before{content:'';display:block;flex:0 0 13px;width:13px;height:13px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h15m-4-4 4 4-4 4M20 17H5m4-4-4 4 4 4'/%3E%3C/svg%3E") center/contain no-repeat;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h15m-4-4 4 4-4 4M20 17H5m4-4-4 4 4 4'/%3E%3C/svg%3E") center/contain no-repeat}
#editor [data-cockpit] .editor-test-controls .editor-change-test-car:hover:not(:disabled){background:#bcd4b40b;color:#f6f3e9;border-color:transparent}
#editor [data-cockpit] .editor-test-controls .editor-change-test-car:active:not(:disabled){background:#bcd4b418}

#editor #map-settings-window .number-stepper input::-webkit-inner-spin-button,#editor #map-settings-window .number-stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}

/* Route metrics sit just above the bottom-right action dock. */
#editor [data-cockpit] #map-summary{inset:auto 16px calc(max(12px,env(safe-area-inset-bottom)) + 62px) auto;max-width:calc(100% - 32px);padding:3px 0;background:transparent;border:0;border-radius:0;color:#b8cbb6;font-size:10px;line-height:1.4;text-align:right;white-space:normal;overflow-wrap:anywhere;text-shadow:0 1px 3px #06140dcc;pointer-events:none}
@media(max-width:900px), (max-height:540px) and (max-width:1200px){#editor [data-cockpit] #map-summary{right:8px;bottom:calc(max(8px,env(safe-area-inset-bottom)) + 62px);max-width:calc(100% - 16px)}}

/* Lighter action dock, with full touch targets retained on small screens. */
#editor [data-cockpit]:not([data-focus=true]) .editor-dock{gap:2px;padding:3px;border:1px solid #bcd4b426;border-radius:14px;background:#163328f2;box-shadow:0 3px 12px #06140d26;backdrop-filter:none}
#editor [data-cockpit]:not([data-focus=true]) .editor-dock button{width:40px;min-width:40px;height:40px;min-height:40px;padding:8px;border-radius:10px;background:transparent;color:#b8cbb6}
#editor [data-cockpit]:not([data-focus=true]) .editor-dock #add-object-tray{width:auto;gap:6px;height:40px;min-height:40px;padding:0 11px;border-radius:10px;background:#ffda79;color:#214740;font-size:12px;font-weight:650;box-shadow:none}
#editor [data-cockpit]:not([data-focus=true]) .editor-dock .editor-theme-icon{width:18px;height:18px}
#editor [data-cockpit]:not([data-focus=true]) .editor-dock [aria-pressed=true],#editor [data-cockpit]:not([data-focus=true]) .editor-dock .dock-settings[aria-expanded=true]{background:#bcd4b412;color:#e6dfbf}
#editor [data-cockpit] #map-summary{bottom:calc(max(12px,env(safe-area-inset-bottom)) + 56px)}
@media(max-width:900px), (max-height:540px) and (max-width:1200px){#editor [data-cockpit]:not([data-focus=true]) .editor-dock button,#editor [data-cockpit]:not([data-focus=true]) .editor-dock #add-object-tray{min-width:44px;height:44px;min-height:44px}#editor [data-cockpit] #map-summary{bottom:calc(max(8px,env(safe-area-inset-bottom)) + 60px)}}

/* Expanded preview has its own consistent inset within the shared test card. */
#editor [data-cockpit] .editor-test-controls .editor-test-reveal{box-sizing:border-box;margin:0;padding:0;min-width:0;overflow:hidden}
#editor [data-cockpit] .editor-test-controls .editor-change-test-car{box-sizing:border-box;max-width:100%;margin:0;border-radius:9px}
#editor [data-cockpit] .test-vehicle-field[data-expanded=true] .editor-change-test-car{padding:10px 6px}

/* Creator tool organization: one dock, with unchanged placement handlers. */
#editor [data-cockpit] .canvas-modes[hidden]{display:none!important}
#editor [data-cockpit] .editor-dock{gap:3px}
#editor [data-cockpit] .editor-dock>[data-place]{font-size:11px;font-weight:650;padding:6px 10px}
#editor [data-cockpit] .editor-dock>[data-place][aria-pressed=true]{background:#b5cea71f;color:#d8e8cd;box-shadow:inset 0 0 0 1px #b5cea747}
#editor [data-cockpit][data-focus=true] .editor-dock>[data-place]{display:none}
#editor [data-cockpit] :is(.selection-window,.object-tray,.map-settings-window)>header{min-height:44px;box-sizing:border-box;align-items:center}
#editor [data-cockpit] :is(.point-more,.object-placement,.object-edge,.settings-section)>summary{cursor:pointer}
@media(pointer:coarse),(max-width:700px){
 #editor [data-cockpit] .creator-work-header{--test-toolbar-size:44px}
 #editor [data-cockpit] :is(.creator-canvas-toolbar,.camera-rail,.creator-work-header) button{min-width:44px;min-height:44px;box-sizing:border-box;touch-action:manipulation}
 #editor [data-cockpit] .camera-rail button{width:44px;height:44px;padding:11px}
 #editor [data-cockpit] .creator-canvas-toolbar{gap:4px;padding:3px}
 #editor [data-cockpit] .creator-canvas-toolbar button{padding:8px}
 #editor [data-cockpit]:not([data-focus=true]) .editor-dock>button{min-height:44px;height:44px;min-width:44px;box-sizing:border-box}
 #editor [data-cockpit] :is(.selection-window,.map-settings-window,.object-tray) :is(button,select,summary){min-height:44px;box-sizing:border-box;touch-action:manipulation}
 #editor [data-cockpit] :is(.selection-window-header,.tray-header,.map-settings-window>header)>button{min-width:44px;padding:10px}
 #editor [data-cockpit] :is(.point-more,.object-placement,.object-edge,.settings-section)>summary{display:flex;align-items:center}
 #editor :is(#selection-window,#map-settings-window,.editor-settings-dialog).editor-form-panel .number-stepper{height:44px!important;min-height:44px!important}
 #editor :is(#selection-window,#map-settings-window,.editor-settings-dialog).editor-form-panel .number-stepper>button{flex:0 0 44px!important;width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
 #editor .editor-settings-dialog :is(button,select,summary){min-height:44px;box-sizing:border-box}
 #editor [data-cockpit] .placement-actions button{min-width:44px;min-height:44px}
}


/* Mobile obstacle inspector replaces the object tray with a bottom sheet. */
@media(pointer:coarse),(max-width:900px){
 #editor [data-cockpit] .selection-window[data-object-sheet=true]{left:8px;right:8px;top:auto;bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-width:none;max-height:min(46dvh,380px);border-radius:18px 18px 12px 12px;z-index:16;transform:none}
 #editor [data-cockpit] .selection-window[data-object-sheet=true] .selection-window-header{position:relative;padding-top:12px;flex-shrink:0}
 #editor [data-cockpit] .selection-window[data-object-sheet=true] .selection-window-header::before{content:'';position:absolute;top:5px;left:calc(50% - 16px);width:32px;height:3px;border-radius:3px;background:#bcd4b44d}
 #editor [data-cockpit] .selection-window[data-object-sheet=true] .selection-window-body{min-height:0;overflow-y:auto;overscroll-behavior:contain}
}

@media(pointer:coarse),(max-width:900px){
 #editor [data-cockpit] .editor-dock{transition:transform .2s ease,opacity .2s ease}
 #editor [data-cockpit][data-object-selected=true]:not([data-focus=true]) .editor-dock{transform:translateY(calc(100% + 32px));opacity:0;pointer-events:none}
 #editor [data-cockpit] .selection-window[data-object-sheet=true]{position:absolute;inset:auto 8px max(8px,env(safe-area-inset-bottom));width:auto;max-height:min(46dvh,380px);margin:0}
 #editor [data-cockpit][data-object-selected=true] #map-summary{visibility:hidden}
}
@media(prefers-reduced-motion:reduce){#editor [data-cockpit] .editor-dock{transition:none}}

/* One scale for each creator overlay; nested controls inherit it once. */
#editor{--creator-panel-scale:.88}
#editor [data-cockpit] :is(.creator-work-header,.creator-work-footer,.selection-window,.object-tray,.map-settings-window,.map-items-window,.creator-canvas-toolbar,.camera-rail,.editor-dock),
#editor .creator-dialog{zoom:var(--creator-panel-scale)}

/* Match neighbouring header actions to the compact test cluster. */
#editor [data-cockpit] .creator-work-header>button{box-sizing:border-box;height:var(--test-toolbar-size);min-height:var(--test-toolbar-size);padding:7px}
#editor #creator-weather label:has(input[type=range]){display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px 10px}
#editor #creator-weather input[type=range]{grid-column:1;width:100%;min-width:0;margin:0;accent-color:#ffda79}
#editor #creator-weather output{grid-column:2;color:#c3d7bb;font-size:11px;font-variant-numeric:tabular-nums}

/* All overlay sizes inherit the same editor setting, with no nested scaling. */
#editor [data-cockpit] #editor-camera-rail{top:50%;bottom:auto;transform:translateY(-50%);max-height:calc(100% - 140px)}
#editor .editor-ui-scale{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;margin:10px 0 16px}
#editor .editor-ui-scale input{grid-column:1/-1;width:100%;min-width:0;margin:0;accent-color:#ffda79}
#editor .editor-ui-scale output{font-size:11px;color:#c3d7bb;font-variant-numeric:tabular-nums}

/* Primary publishing action above three compact secondary actions. */
#editor #map-settings-window .publish-footer{container-type:inline-size}
#editor #map-settings-window .publish-footer #publish-level{grid-column:1/-1;grid-row:1}
#editor #map-settings-window .publish-footer #unpublish-level{grid-column:1/-1}
#editor #map-settings-window .publish-footer .publish-action-icon{width:18px;height:18px;flex:none}
#editor #map-settings-window .publish-footer .publish-action-label{white-space:nowrap}
@container(max-width:300px){
 #editor #map-settings-window .publish-footer .publish-action-label{display:none}
}
#editor #map-settings-window .publish-footer #invite-test-ride{background:#bcd4b40a;border:1px solid #bcd4b42b;color:#cbded0}

/* Compact view controls; snapping settings stay confined to editor settings. */
#editor [data-cockpit] .creator-canvas-toolbar{padding:2px;gap:2px}
#editor [data-cockpit] .creator-canvas-toolbar button{height:36px;min-height:36px;padding:6px 9px}
#editor [data-cockpit] #editor-snap-toggle{display:inline-flex;align-items:center;justify-content:center;width:36px;min-width:36px}
#editor [data-cockpit] #editor-snap-toggle[aria-pressed=true]{background:#b5cea727;color:#dfebd8;box-shadow:inset 0 0 0 1px #b5cea74d}
#editor .editor-snap-row{display:grid;grid-template-columns:minmax(0,1fr) 76px 16px;align-items:center;gap:8px;margin:8px 0}
#editor .editor-snap-row label{display:flex;align-items:center;gap:8px;margin:0;font-size:12px}
#editor .editor-snap-row input[type=checkbox]{width:18px;height:18px;margin:0;flex:none}
#editor .editor-snap-row input[type=number]{width:100%;min-width:0;margin:0;box-sizing:border-box;padding:8px}
#editor .editor-snap-row small{font-size:11px;opacity:.65}

#editor .snap-value-box{position:relative;min-width:0}
#editor .editor-snap-row .snap-value-box input{padding-right:25px;appearance:textfield;-moz-appearance:textfield}
#editor .snap-value-box input::-webkit-inner-spin-button,#editor .snap-value-box input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
#editor .snap-value-arrows{position:absolute;inset:3px 3px 3px auto;width:20px;display:grid;grid-template-rows:1fr 1fr}
#editor .editor-settings-dialog .snap-value-arrows button{display:flex;align-items:center;justify-content:center;width:20px;min-width:0;height:100%;min-height:0;margin:0;padding:0;border:0;background:transparent;color:#c3d7bb;border-radius:4px;box-shadow:none}
#editor .editor-settings-dialog .snap-value-arrows button:hover{background:#bcd4b418}


#editor .editor-settings-dialog{scroll-padding-top:64px}
#editor .editor-snap-row .snap-value-box{height:40px}
#editor .editor-snap-row .snap-value-box input{height:100%;min-height:0;padding-top:0;padding-bottom:0;line-height:normal}
#editor .snap-value-arrows{align-items:stretch;gap:0}
#editor input[type=range]{touch-action:pan-y;pointer-events:auto}
#editor input[type=range]::-webkit-slider-thumb{pointer-events:auto;touch-action:pan-y}
#editor input[type=range]::-moz-range-thumb{pointer-events:auto;touch-action:pan-y}

#editor [data-cockpit] #editor-settings-window{padding:0}
#editor [data-cockpit] #editor-settings-window>.map-settings-body{min-height:0;overflow-y:auto;overscroll-behavior:contain}

#editor .editor-range-gesture{position:relative;display:grid;align-items:center;min-width:0;width:100%;flex:1;box-sizing:border-box}
#editor .editor-range-gesture input[type=range],#editor .editor-range-gesture input[type=range]::-webkit-slider-thumb{pointer-events:none}
#editor .editor-range-gesture input[type=range]::-moz-range-thumb{pointer-events:none}
#editor .editor-range-hit{position:absolute;inset:0;z-index:1;touch-action:pan-y;cursor:ew-resize}
#editor [data-cockpit][data-panel-backgrounds=hidden] :is(.creator-work-header,.creator-work-footer,.creator-canvas-toolbar,.view-switch,.editor-dock,.camera-rail,#editor-camera-rail,.selection-window,.object-tray,.map-settings-window,.placement-actions,.cockpit-view-body,.editor-test-controls,.map-items-window){background:var(--editor-clear-surface,transparent)!important;border-color:var(--editor-clear-edge,transparent)!important;box-shadow:var(--editor-clear-shadow,none)!important;-webkit-backdrop-filter:var(--editor-clear-blur,none)!important;backdrop-filter:var(--editor-clear-blur,none)!important}
#editor [data-cockpit][data-panel-backgrounds=hidden] :is(.selection-window-header,.tray-header,.map-settings-window>header,.publish-footer){background:transparent!important;box-shadow:none!important}
#editor .editor-panel-backgrounds{display:flex;align-items:center;gap:8px}

@media(min-width:761px){
 #editor #creator-home .creator-library{box-sizing:border-box;width:100%;max-width:1560px;padding:32px clamp(24px,4vw,64px) 48px}
 #editor #creator-home .map-card-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,clamp(235px,20vw,310px)),1fr));gap:clamp(14px,1.5vw,24px)}
}

/* Clear desktop panels retain legibility over the moving editor canvas.
   Apply blur once per outer panel; toolbars and nested content stay clear. */
@media(min-width:761px){
 #editor [data-cockpit][data-panel-backgrounds=hidden] :is(.selection-window,.object-tray,.map-settings-window,.cockpit-view-body,#editor-camera-rail){
  --editor-clear-surface:#142d24f2;
  --editor-clear-edge:#bcd4b426;
  --editor-clear-shadow:0 8px 28px #06140d40;
 }
 @supports ((backdrop-filter:blur(12px)) or (-webkit-backdrop-filter:blur(12px))){
  #editor [data-cockpit][data-panel-backgrounds=hidden] :is(.selection-window,.object-tray,.map-settings-window,.cockpit-view-body,#editor-camera-rail){
   --editor-clear-surface:#142d24b8;
   --editor-clear-blur:blur(12px);
  }
 }
 /* The map-items body belongs to the camera rail's single glass surface. */
 #editor [data-cockpit][data-panel-backgrounds=hidden] #editor-camera-rail .map-items-window{
  --editor-clear-surface:transparent;--editor-clear-edge:transparent;--editor-clear-shadow:none;--editor-clear-blur:none;
 }
 #editor [data-cockpit][data-panel-backgrounds=hidden] :is(.selection-window-header,.tray-header,.map-settings-window>header){border-bottom:1px solid #bcd4b418}
}
