html[data-app-transition="theme"]::view-transition-old(root),
html[data-app-transition="theme"]::view-transition-new(root){animation:none;mix-blend-mode:normal}
html[data-app-transition="theme"]::view-transition-new(root){z-index:2}
@media(prefers-reduced-motion:reduce){::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}}

html.theme-color-transition :is(body,header,aside,.panel,.card,dialog,input,select,textarea,button,main,nav,.feature-card,.store-card,.site-header,.closing){transition:background-color 1s ease,color 1s ease,border-color 1s ease}

/* Preserve snapshot ordering through the final frame; no default cross-fade. */
html[data-app-transition="theme"]::view-transition-group(root){animation:none}
html[data-app-transition="theme"]::view-transition-old(root){opacity:1;z-index:1}
html[data-app-transition="theme"]::view-transition-new(root){opacity:1;z-index:2}
html[data-theme="dark"]{background-color:#000}
html[data-theme="light"]{background-color:#f5f8f6}

.tab-motion-source{visibility:hidden}
.tab-motion-stage{position:fixed;overflow:hidden;contain:strict;pointer-events:none;z-index:20;background:#f5f7f8}
.motion-frame{position:absolute;inset:0;overflow:hidden;backface-visibility:hidden;will-change:transform;background:#f5f7f8}
html[data-theme="dark"] :is(.tab-motion-stage,.motion-frame){background:#000}
body[data-workspace="store"] aside{z-index:100}
body[data-workspace="store"] main>header{z-index:90}

/* All moving content belongs to main's stacking context, below store navigation. */
body[data-workspace="store"] main{position:relative;isolation:isolate;z-index:0}
body[data-workspace="store"] aside{isolation:isolate;z-index:1000!important}
body[data-workspace="store"] aside>nav{position:relative;z-index:1}
body[data-workspace="store"] main>header{z-index:90}
body[data-workspace="store"] .tab-motion-stage{z-index:1}
/* The highlight lives outside the replaceable nav markup. Navigation stays above moving content. */
.nav-active-marker{position:absolute;left:0;top:0;pointer-events:none;z-index:0;background:var(--primary-soft);transition:transform .5s ease,width .5s ease,height .5s ease;will-change:transform}
body[data-workspace="store"] aside.has-nav-marker>nav>button{position:relative;z-index:1;background:transparent!important;box-shadow:none!important}
@media(prefers-reduced-motion:reduce){.nav-active-marker{transition:none}}

/* Keep dialogs in the top layer through exit, including Escape and backdrop closes. */
dialog{opacity:0;scale:.94;transform-origin:center center;transition:opacity .3s ease,scale .3s ease,display .3s allow-discrete,overlay .3s allow-discrete}
dialog[open]{opacity:1;scale:1}
@starting-style{dialog[open]{opacity:0;scale:.94}}
dialog::backdrop{opacity:0;transition:opacity .3s ease,display .3s allow-discrete,overlay .3s allow-discrete}
dialog[open]::backdrop{opacity:1}
@starting-style{dialog[open]::backdrop{opacity:0}}
@media(prefers-reduced-motion:reduce){dialog,dialog::backdrop{transition:none}}
