/* One responsive owner for project actions. Existing IDs retain save/export handlers. */
:root{--motion-export-space:0px;--studio-shell-dock-space:0px;--studio-header-height:72px}
html body.site-design .project-toolbar-header{gap:12px;padding-top:12px;padding-bottom:12px;min-height:72px;isolation:isolate}
html body.site-design .project-toolbar-header>.workspace-navigation{margin-left:0;flex:none}
html body.site-design .studio-project-toolbar{position:relative;display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:1 1 320px;min-width:0;color:var(--ui-text);background:transparent;border:0;box-shadow:none;padding:0;margin:0}
html body.site-design .studio-project-toolbar #project-bar{display:flex;align-items:center;flex-wrap:nowrap;flex:0 1 auto;gap:8px;min-width:0;padding:0;margin:0;border:0}
html body.site-design .studio-project-toolbar .project-file{position:relative;display:block;flex:0 1 180px;min-width:60px;max-width:180px;margin:0}
html body.site-design .studio-project-toolbar #project-file-name{display:block;box-sizing:border-box;width:100%;min-width:0;max-width:100%;height:36px;min-height:36px;margin:0;padding:7px 32px 7px 9px;font:inherit;font-size:13px;line-height:20px;text-overflow:ellipsis;background:var(--ui-field);color:var(--ui-text);border:1px solid var(--ui-border);border-radius:8px}
html body.site-design .studio-project-toolbar #project-file-name:hover{background:var(--ui-field)}
html body.site-design .studio-project-toolbar #project-file-name:focus{background:var(--ui-field);border-color:var(--ui-text);outline-offset:1px}
/* Status stays inside the name field; its words remain available to assistive tech. */
html body.site-design .studio-project-toolbar #project-save-status{position:absolute;right:10px;top:50%;transform:translateY(-50%);display:grid;place-items:center;box-sizing:border-box;width:16px;min-width:0;max-width:none;height:16px;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;color:var(--ui-text);font-size:0;line-height:1;white-space:normal;overflow:visible;text-decoration:none}
html body.site-design .studio-project-toolbar #project-save-status::before{content:"";display:block;box-sizing:border-box;flex:none;width:8px;height:8px;border:1px solid var(--ui-muted);border-radius:50%;background:var(--ui-accent);color:var(--ui-text);animation:none}
html body.site-design .studio-project-toolbar #project-save-status[data-state=saving]::before{content:"";width:12px;height:12px;border:2px solid var(--ui-border);border-top-color:var(--ui-text);background:transparent;animation:project-status-spin .8s linear infinite}
html body.site-design .studio-project-toolbar #project-save-status[data-state=saved]::before{content:"✓";width:16px;height:16px;border:0;border-radius:0;background:transparent;color:var(--ui-text);font-size:15px;line-height:16px;text-align:center}
html body.site-design .studio-project-toolbar #project-save-status[data-state=error]::before{content:"!";width:14px;height:14px;border:0;background:var(--ui-text);color:var(--ui-page);font-size:11px;font-weight:700;line-height:14px;text-align:center}
@keyframes project-status-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){html body.site-design .studio-project-toolbar #project-save-status[data-state=saving]::before{animation:none}}
html body.site-design .studio-project-toolbar .project-actions{display:flex;align-items:center;gap:6px;flex:none;flex-wrap:nowrap;width:auto;margin:0}
html body.site-design .studio-project-toolbar :is(#project-projects,#project-save,#project-more>summary,.toolbar-feedback-open){display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:36px;min-height:36px;margin:0;padding:7px 10px;border:0;border-radius:999px;background:var(--ui-raised);color:var(--ui-text);font:inherit;font-size:12px;line-height:20px;text-decoration:none;white-space:nowrap;cursor:pointer}
html body.site-design .studio-project-toolbar #project-projects{width:36px;padding:8px}
.studio-project-toolbar #project-projects svg{display:block;width:18px;height:18px;flex:none}
.studio-project-toolbar #project-projects>span{display:none}
html body.site-design .studio-project-toolbar #project-save:not(:disabled):hover{background:var(--ui-text);color:var(--ui-page)}
.studio-project-toolbar #project-more{position:relative;flex:none}
html body.site-design .studio-project-toolbar #project-more>summary{list-style:none;width:36px;padding:0;font-size:24px}
.studio-project-toolbar #project-more>summary::-webkit-details-marker{display:none}
.studio-project-toolbar .project-more-panel{position:absolute;top:calc(100% + 8px);right:0;z-index:5;width:180px;max-width:calc(100vw - 24px);padding:6px;display:grid;gap:4px;background:var(--ui-panel);color:var(--ui-text);border:1px solid var(--ui-border);border-radius:12px;box-shadow:0 8px 24px #0002}
html body.site-design .studio-project-toolbar .project-more-panel :is(button,#project-projects){display:flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;min-height:44px;height:auto;padding:10px 12px;margin:0;border:0;border-radius:8px;background:transparent;color:var(--ui-text);text-align:left;font-size:13px;line-height:20px;white-space:normal}
.studio-project-toolbar .project-more-panel #project-projects>span{display:inline}
html body.site-design .studio-project-toolbar .project-more-panel :is(button,#project-projects):not(:disabled):hover{background:var(--ui-raised);color:var(--ui-text)}
html body.site-design .studio-project-toolbar>:is(#motion-export-controls,#carousel-export-controls,#banner-actions,#font-actions){position:static;display:flex;align-items:center;gap:6px;flex:none;max-width:none;margin:0;padding:0}
html body.site-design #motion-export-dock.studio-project-toolbar .export-button{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:6px;width:auto;min-width:0;height:36px;min-height:36px;padding:7px 10px;margin:0;border:0;border-radius:999px;font:inherit;font-size:12px;line-height:20px;white-space:nowrap;background:var(--ui-accent);color:var(--ui-ink)}
html body.site-design #motion-export-dock.studio-project-toolbar .export-button>span[aria-hidden=true]{font-size:14px;line-height:20px}
html body.site-design .studio-project-toolbar :is(.export-policy,#banner-export-summary){display:none}
.studio-project-toolbar #export-note{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html body.site-design .toolbar-export-feedback{position:absolute;top:calc(100% + 12px);right:0;z-index:4;width:320px;max-width:calc(100vw - 24px);box-sizing:border-box;padding:16px;background:var(--ui-panel);color:var(--ui-text);border:1px solid var(--ui-border);border-radius:12px;box-shadow:0 8px 24px #0002}
html body.site-design .toolbar-export-feedback :is(p,#progress-text){margin:0 26px 0 0;padding:0;font-size:12px;line-height:1.5;color:var(--ui-text);overflow-wrap:anywhere}
html body.site-design .toolbar-export-feedback progress{display:block;width:calc(100% - 24px);height:4px;margin:8px 0 12px}
html body.site-design .toolbar-export-feedback #download{margin:12px 0 0;min-height:36px;font-size:12px}
html body.site-design .toolbar-feedback-close{position:absolute;right:8px;top:8px;display:grid;place-items:center;width:32px;height:32px;min-height:32px;margin:0;padding:0;border:0;border-radius:50%;background:var(--ui-raised);color:var(--ui-text);font-size:22px;line-height:1}
html body.site-design .studio-project-toolbar .toolbar-feedback-open{width:28px;padding:0}
html body.site-design #project-save-notice{top:calc(var(--studio-header-height) + 8px);left:auto;right:16px;transform:none;width:360px;max-width:calc(100vw - 32px);padding:14px 16px;font-size:13px;z-index:70}
.studio-project-toolbar .checkout-return-notice{position:absolute;top:calc(100% + 8px);right:0;max-width:min(420px,calc(100vw - 24px));padding:16px;background:var(--ui-panel);color:var(--ui-text);border:1px solid var(--ui-border);border-radius:12px;z-index:6}
html body.site-design .studio-project-toolbar [hidden]{display:none!important}
@media(min-width:761px) and (max-width:1000px){
 html body.site-design .project-toolbar-header .workspace-modes{display:none}
 html body.site-design .project-toolbar-header .mobile-studio-switch{display:block;flex:0 1 145px;min-width:100px;max-width:145px}
 html body.site-design .project-toolbar-header #mobile-studio-mode{width:100%;min-width:0;height:36px;padding:6px 24px 6px 10px;font-size:13px;border:0;border-radius:999px;background:var(--ui-raised);color:var(--ui-text)}
}
@media(max-width:760px){
 :root{--studio-header-height:64px}
 html body.site-design .project-toolbar-header{flex-wrap:wrap;gap:6px;padding-top:8px;padding-bottom:8px;min-height:64px}
 /* The early toolbar module moves these same controls below the active preview. */
 html body.site-design .project-toolbar-header>.studio-project-toolbar{display:none}
 html body.site-design .studio-project-toolbar[data-placement=preview]{display:flex;flex:0 0 auto;width:100%;min-height:44px;margin:0;z-index:3}
 html body.site-design .motion-main>.studio-project-toolbar[data-placement=preview]{margin-top:12px}
 html body.site-design .studio-project-toolbar :is(.export-button,#project-more>summary,.toolbar-feedback-open){height:44px;min-height:44px}
 html body.site-design #motion-export-dock.studio-project-toolbar .export-button{height:44px;min-height:44px;font-size:13px;padding:10px 12px}
 html body.site-design .studio-project-toolbar #project-more>summary{width:44px}
 html body.site-design .studio-project-toolbar #project-file-name{height:44px;min-height:44px;font-size:16px;line-height:24px}
 html body.site-design .toolbar-feedback-close{width:44px;height:44px;min-height:44px;right:2px;top:2px}
 html body.site-design .toolbar-export-feedback{top:calc(100% + 8px)}
 html body.site-design .studio-project-toolbar .toolbar-feedback-open{width:32px}
}
@media(prefers-reduced-motion:reduce){.studio-project-toolbar *{scroll-behavior:auto}}

/* Respect the server route while the editor modules initialize. */
html[data-studio-boot=true]:is([data-studio-route=carousel],[data-studio-route=banner],[data-studio-route=font]) .studio-project-toolbar #motion-export-controls{display:none!important}

/* Keep the parsed header compact before responsive controls are mounted. */
@media(max-width:1100px){html body.site-design .studio-project-toolbar .project-actions>:is(#project-projects,#project-save){display:none}}
@media(min-width:1101px){html body.site-design .studio-project-toolbar .project-actions:not(.has-save-error)>#project-more{display:none}}
