/* Shared motion layer (7 Nov 2026; user: "transitions are poor, this is the case throughout the dashboard").
   One set of tokens and a few gentle, opacity-led entrances so every page moves the same way:
   - route change: the page section fades in (opacity only: no transform, so position:fixed children and sticky
     headers stay put, and nothing reflows);
   - the lazy "Loading…" placeholder waits 250ms before it shows, so fast pages never flash it;
   - tab panels fade in when they become visible;
   - dialogs fade + settle in and out (top layer, so transform is safe); their backdrop fades;
   - floating menus and dropdowns (.pd-pop from dropdowns.js, role=menu/listbox) fade + drop 4px using the `translate`
     property, which composes with any transform a page already positions them with;
   - hover and focus colour changes on controls ease over 120ms.
   Every rule is wrapped in :where() so it has zero specificity: a page's own transition or animation always wins.
   Reduced motion: prism-prefs.css already cuts every duration when the reader picks Reduce (or the OS asks and the
   reader did not pick Allow); the entrance animations are also switched off here outright. */
:root{--motion-fast:120ms;--motion-base:160ms;--motion-slow:200ms;--motion-ease:cubic-bezier(.2,.8,.2,1)}

@keyframes prism-fade-in{from{opacity:.35}}
@keyframes prism-pop-in{from{opacity:0;translate:0 -4px}}
@keyframes prism-late-in{0%,99%{opacity:0}}

/* route change */
:where(#main>section:not([hidden])){animation:prism-fade-in var(--motion-slow) var(--motion-ease)}
:where(.prism-lazy-state){animation:prism-late-in 250ms linear}

/* tabs */
:where([role="tabpanel"]:not([hidden])){animation:prism-fade-in var(--motion-base) var(--motion-ease)}

/* dialogs: open via @starting-style, close via allow-discrete (browsers without either simply snap, as before) */
:where(dialog){transition:opacity var(--motion-base) var(--motion-ease),translate var(--motion-base) var(--motion-ease),
  overlay var(--motion-base) allow-discrete,display var(--motion-base) allow-discrete}
:where(dialog:not([open])){opacity:0;translate:0 6px}
@starting-style{:where(dialog[open]){opacity:0;translate:0 6px}}
:where(dialog)::backdrop{transition:opacity var(--motion-base) var(--motion-ease),overlay var(--motion-base) allow-discrete,display var(--motion-base) allow-discrete}
:where(dialog:not([open]))::backdrop{opacity:0}
@starting-style{:where(dialog[open])::backdrop{opacity:0}}

/* menus, dropdowns, popovers */
:where(.pd-pop,[role="menu"],[role="listbox"]:not(select)){animation:prism-pop-in var(--motion-fast) var(--motion-ease)}

/* hover / focus colour changes on controls */
:where(a,button,summary,select,input,textarea,[role="tab"],[role="menuitem"],[role="option"]){
  transition:color var(--motion-fast) var(--motion-ease),background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),box-shadow var(--motion-fast) var(--motion-ease),
    opacity var(--motion-fast) var(--motion-ease)}

@media (prefers-reduced-motion:reduce){
  html:not([data-motion="allow"]) :where(#main>section,.prism-lazy-state,[role="tabpanel"],.pd-pop,[role="menu"],[role="listbox"]){animation:none}
}
html[data-motion="reduce"] :where(#main>section,.prism-lazy-state,[role="tabpanel"],.pd-pop,[role="menu"],[role="listbox"]){animation:none}
