.editor-page #editor-toolbar-content { display: flex; flex: 1; flex-direction: column; min-height: 0; width: 100%; gap: 6px; }
.editor-page[data-editor-presentation=modern] { --editor-rail-width: 72px; }
.editor-page #editor-presentation-toggle { flex: 0 0 34px; height: 34px; width: 100%; padding: 2px; border: 1px solid #454545; border-radius: 4px; background: #1a1a1a; color: #ddd; font: 10px/1.2 system-ui,sans-serif; cursor: pointer; }
.editor-page #editor-modern-tools { flex: 0 0 56px; width: 56px; height: 56px; margin: 16px auto 22px; position: relative; border-radius: 50%; border: 1px solid #555; background: linear-gradient(150deg,#303030,#111 65%); color: #eee; box-shadow: inset 0 1px 1px #ffffff20,0 4px 10px #0007; cursor: pointer; }
.editor-page #editor-modern-tools svg { width: 38px; height: 38px; fill: #bdbdbd; stroke: #101010; stroke-width: 1.6; stroke-linejoin: round; }
.editor-page #editor-modern-tools span { position: absolute; top: 60px; left: -8px; width: 72px; font: 9px/1.2 system-ui,sans-serif; letter-spacing: .05em; }
.editor-page #editor-modern-tools[aria-expanded=true] { border-color: #aaa; }
.editor-page :is(#editor-modern-tools,#editor-presentation-toggle):focus-visible { outline: 2px solid #ddd; outline-offset: 2px; }
.editor-page #editor-toolbar-content[hidden],.editor-page #editor-modern-tools[hidden] { display: none; }
.editor-page[data-editor-presentation=modern] #editor-toolbar-content { position: fixed; z-index: 1000; top: calc(var(--editor-topbar-height) + 62px); left: calc(var(--editor-rail-width) + 5px); width: 145px; max-height: calc(100dvh - var(--editor-topbar-height) - 80px); padding: 7px; border: 1px solid #454545; border-radius: 6px; background: var(--editor-floating-background); box-shadow: 0 7px 20px #0008; }
.editor-page[data-editor-presentation=modern] .editor-tool-grid { grid-template-columns: repeat(3,37px); grid-auto-rows: 37px; gap: 5px; padding: 4px; flex: 0 1 auto; }
.editor-page[data-editor-presentation=modern] .editor-tool-grid .rail-button { width: 37px; max-width: 37px; height: 37px; }
.editor-page[data-editor-presentation=modern] .editor-tool:is(:hover,:focus-visible)::after { left: calc(var(--editor-rail-width) + 155px); }
.editor-page[data-editor-presentation=modern] #ai-edit-group { transform: none !important; }
.editor-page[data-editor-presentation=modern] #prometheus-trigger { position: fixed; left: calc((var(--editor-rail-width) - 58px) / 2) !important; top: calc(var(--editor-topbar-height) + 162px) !important; right: auto !important; bottom: auto !important; width: 56px; height: 56px; min-width: 56px; min-height: 56px; cursor: pointer; }
.editor-page[data-editor-presentation=modern] #ai-region-panel { position: fixed; left: calc((var(--editor-rail-width) - 58px) / 2) !important; top: calc(var(--editor-topbar-height) + 262px) !important; width: 56px; height: 56px; }
.editor-page[data-editor-presentation=modern] #ai-region-expand,.editor-page[data-editor-presentation=modern] .ai-group-handle { cursor: pointer; }
/* The Gallery launcher is in the rail in Modern UI; remove its old left gutter. */
.editor-page[data-editor-presentation=modern] #generator-overlay .generator-window { margin-left: 0; justify-self: start; }

/* Reposition the existing Gallery launcher; its state/actions are shared. */
.editor-page[data-editor-presentation=modern] #toggle-session-gallery { position: fixed; z-index: 40; left: calc((var(--editor-rail-width) - 48px) / 2); right: auto; bottom: auto; top: calc(var(--editor-topbar-height) + 362px); transform: none; width: 46px; max-height: calc(100dvh - var(--editor-topbar-height) - 375px); padding: 14px 10px; gap: 0; border: 1px solid #555; border-radius: 5px; background: #191919; color: #ddd; font: 10px/1.3 system-ui,sans-serif; letter-spacing: .1em; writing-mode: vertical-rl; text-transform: uppercase; cursor: pointer; }
.editor-page[data-editor-presentation=modern] #toggle-session-gallery span { display: none; }
.editor-page[data-editor-presentation=modern] #toggle-session-gallery[aria-expanded=true] { border-color: #aaa; background: #303030; }
.editor-page[data-editor-presentation=modern] #toggle-session-gallery:focus-visible { outline: 2px solid #ddd; outline-offset: 2px; }
