#sceneToolbar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; padding: 5px 8px; border: 1px solid rgb(230 230 230 / 75%); border-radius: 999px; background: rgb(255 255 255 / 72%); box-shadow: 0 4px 18px #0000000b; color: #191919; font: 12px 'Roboto Mono', monospace; }
#sceneToolbar [hidden], #sceneToolbar[hidden] { display: none; }
#sceneToolbar button { border: 0; background: transparent; color: inherit; font: inherit; padding: 6px 10px; cursor: pointer; border-radius: 999px; }
#sceneToolbar button:disabled { color: #b6b6b6; cursor: default; }
#sceneToolbar button:hover:enabled { background: rgb(0 0 0 / 4%); }
#sceneToolbar button:focus-visible, #sceneToolbar input:focus-visible { outline: 1px solid #999; outline-offset: 1px; }
#sceneToolbar .scene-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sceneToolbar .scene-add { border-left: 1px solid rgb(70 70 70 / 22%); border-radius: 0; font-size: 16px; padding: 3px 10px; }
#sceneToolbar .scene-rename { width: 160px; border: 0; border-radius: 999px; padding: 6px 10px; font: inherit; background: rgb(255 255 255 / 60%); }
#sceneToolbar .scene-popover { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); min-width: 230px; max-width: min(340px, 90vw); max-height: min(400px, 60vh); overflow-y: auto; padding: 8px; border: 1px solid rgb(230 230 230 / 75%); border-radius: 20px; background: rgb(255 255 255 / 72%); box-shadow: 0 4px 18px #0000000b; }
#sceneToolbar .scene-popover button { display: block; width: 100%; text-align: left; overflow-wrap: anywhere; padding: 10px 12px; }
@media (max-width: 900px) { #sceneToolbar { bottom: 72px; } }

/* Keep text and actions directly on the shared toolbar surface. */
body #sceneToolbar button,
body #sceneToolbar button:hover:enabled,
body #sceneToolbar button:active {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}
body #sceneToolbar .scene-add { border-left: 1px solid rgb(70 70 70 / 22%) !important; }
#sceneToolbar .scene-rename { background: transparent; border-radius: 0; }

/* Rename stays on the same unboxed text surface, including after commit. */
body #sceneToolbar .scene-rename,
body #sceneToolbar .scene-rename:focus,
body #sceneToolbar .scene-name:focus {
    appearance: none !important;
    background: transparent !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
body #sceneToolbar .scene-popover {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 8px) scale(.96);
    transform-origin: bottom center;
    transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
}
body #sceneToolbar .scene-popover.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
    transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
    body #sceneToolbar .scene-popover { transition: none; }
}
#sceneToolbar .scene-row { display: flex; align-items: center; }
#sceneToolbar .scene-row .scene-select { flex: 1; min-width: 0; }
#sceneToolbar .scene-row .scene-delete { flex: 0 0 32px; width: 32px; padding: 10px 0; text-align: center; }
