#animation-editor{width:min(1200px,95vw);max-width:95vw;max-height:92dvh;padding:24px;overflow:auto;border:1px solid var(--border,#dce2ed);border-radius:18px;background:var(--surface,#fff);color:var(--text,#303746)}
#animation-editor header,#animation-editor footer{display:flex;align-items:center;justify-content:space-between;gap:16px}#animation-editor h2{margin:0}#animation-editor button{padding:8px 12px;cursor:pointer}#animation-editor [data-close]{font-size:24px;background:transparent;border:0}#animation-editor label{display:flex;flex-direction:column;gap:5px;font-size:13px}#animation-editor input,#animation-editor select{width:100%;min-width:0;padding:8px;border:1px solid #cbd3e0;border-radius:6px;background:#fff;color:#303746}#animation-editor input[type=checkbox]{width:auto}#animation-editor label:has(input[type=checkbox]){flex-direction:row;align-items:center}#animation-editor p,#animation-editor footer span{font-size:12px;line-height:1.5;color:#657086}.animation-layout{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,1fr);gap:24px;margin-top:20px}.animation-stage{position:sticky;top:0;align-self:start}.animation-stage svg{width:100%;height:400px;background:#f6f8fc;border:1px solid #dce2ed;border-radius:12px;touch-action:none}.animation-transport{display:flex;gap:8px;align-items:center;margin:12px 0}.animation-transport output{margin-left:auto;font-size:12px;white-space:nowrap}.animation-settings{display:flex;flex-direction:column;gap:14px}.animation-presets{display:flex;align-items:end;gap:8px}.animation-presets label{flex:1}.animation-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px}#animation-editor fieldset{border:1px solid #dce2ed;border-radius:10px;margin:12px 0;padding:12px}#animation-editor legend{font-size:13px;padding:0 5px}#animation-editor [data-error]{color:#b93648;min-height:18px}#animate-selection{margin:8px}#edit-animations{white-space:nowrap}#animation-editor [data-timeline]{padding:0}#animation-editor [hidden]{display:none!important}@media(max-width:760px){#animation-editor{padding:16px}.animation-layout{grid-template-columns:1fr}.animation-stage{position:static}.animation-stage svg{height:260px}#animation-editor footer{align-items:flex-start}.animation-transport{flex-wrap:wrap}}

/* Keep intrinsic form widths and site-wide header/footer rules inside the dialog. */
#animation-editor{box-sizing:border-box;overscroll-behavior:contain}
#animation-editor header{height:auto;min-height:48px;padding:0 0 12px;position:static;grid-template-columns:none;grid-template-rows:none}
#animation-editor h2{min-width:0;font-size:24px;line-height:1.2}
#animation-editor [data-close]{flex:none;min-width:44px;min-height:44px}
#animation-editor footer{height:auto;min-height:0;padding:16px 0 0}
#animation-editor footer span{white-space:normal;overflow-wrap:anywhere}
#animation-editor :is(.animation-stage,.animation-settings,.animation-presets label,.animation-grid label,fieldset){min-width:0}
#animation-editor :is(input,select,svg){max-width:100%;box-sizing:border-box}
@media(max-width:760px){
 #animation-editor{position:fixed;inset:auto;left:calc(var(--mobile-viewport-left,0px) + 8px);top:calc(var(--mobile-viewport-top,0px) + 8px);margin:0;width:calc(var(--mobile-viewport-width,100vw) - 16px);max-width:calc(var(--mobile-viewport-width,100vw) - 16px);max-height:calc(var(--mobile-viewport-height,100dvh) - 16px);padding:16px;border-radius:14px}
 #animation-editor .animation-layout{grid-template-columns:minmax(0,1fr);gap:16px;margin-top:16px}
 #animation-editor .animation-stage svg{display:block;height:clamp(150px,28dvh,260px)}
 #animation-editor :is(input,select){font-size:16px}
 #animation-editor .animation-presets{flex-direction:column;align-items:stretch}
 #animation-editor .animation-transport{flex-wrap:wrap}
 #animation-editor .animation-transport output{flex-basis:100%;margin-left:0}
 #animation-editor button{min-height:44px;white-space:normal}
 #animation-editor footer{flex-direction:column;align-items:stretch;gap:12px}
 #animation-editor footer span{display:block}
 #animation-editor footer [data-save]{width:100%}
}
