/* Decorative motion only. No layout changes to photos, gestures or selection. */
:root { --pv-motion-ease: cubic-bezier(.2,.78,.24,1); --pv-motion-spring: cubic-bezier(.2,.85,.26,1.12); }
.pv-motion-flight { position:fixed; z-index:2147483000; margin:0; pointer-events:none!important; object-fit:fill; transform-origin:top left; border-radius:5px; box-shadow:none; contain:paint; }
.pv-motion-tab-line { position:fixed; z-index:60; height:3px; border-radius:99px; background:#aa6946; pointer-events:none!important; }
.pv-motion-tab-line[hidden] { display:none!important; }
.pv-motion-hold { position:fixed; z-index:100010; pointer-events:none!important; width:38px;height:38px; margin:-19px 0 0 -19px; color:#fff8e8; filter:drop-shadow(0 1px 2px #39240b80); }
.pv-motion-hold circle { fill:none; stroke-width:3; }
.pv-motion-hold .pv-motion-hold-track { stroke:#291c1870; }
.pv-motion-hold .pv-motion-hold-progress { stroke:currentColor; stroke-linecap:round; stroke-dasharray:94.25; stroke-dashoffset:94.25; animation:pv-motion-hold-fill 1000ms linear forwards; }
.pv-motion-hold.pv-motion-armed {color:#d6edb2;}
@keyframes pv-motion-hold-fill {to{stroke-dashoffset:0}}
.pv-motion-waiting { background:linear-gradient(110deg,#e8d8c4 30%,#f7ead9 48%,#e8d8c4 65%); background-size:230% 100%; animation:pv-motion-shimmer 620ms ease-out 1; }
@keyframes pv-motion-shimmer {from{background-position:110% 0}to{background-position:-100% 0}}
.pv-motion-success::before { content:'\2713'; display:inline-grid; place-items:center; width:22px; height:22px; margin-right:8px; vertical-align:middle; color:#f8ffed; background:#718653; border-radius:50%; animation:pv-motion-tick 330ms var(--pv-motion-spring) both; }
@keyframes pv-motion-tick {0%{transform:scale(.45);opacity:0}65%{transform:scale(1.18);opacity:1}100%{transform:scale(1)}}
/* Scale only the icon, not the surrounding touch target. */
html[data-pv-premium-motion="on"] .studio-app :is(.tool-button,.photo-action,.stat-button,.set-tab,.create-button,.pv-icon-btn):active > svg,
html[data-pv-premium-motion="on"] .pv-modern-viewer .viewer-tools button:active > svg { scale:.87; transition:scale 95ms ease!important; }
html[data-pv-premium-motion="on"] .studio-app :is(.tool-button,.photo-action,.stat-button,.set-tab,.create-button,.pv-icon-btn) > svg,
html[data-pv-premium-motion="on"] .pv-modern-viewer .viewer-tools button > svg { transition:scale 160ms var(--pv-motion-spring)!important; }
/* Use the existing mobile menu/panel positioning. Only the entry path changes. */
@media(max-width:767px) {
 html[data-pv-premium-motion="on"] .studio-app details[open] > .pv-gallery-menu-panel,
 html[data-pv-premium-motion="on"] .pv-modern-viewer :is(.pv-info-panel,.pv-viewer-extra-tools),
 html[data-pv-premium-motion="on"] .studio-app .modal-overlay .create-modal { animation:pv-motion-sheet-in 270ms var(--pv-motion-ease) both!important; }
 @keyframes pv-motion-sheet-in {from{opacity:0;transform:translate3d(0,24px,0) scale(.985)}to{opacity:1;transform:translate3d(0,0,0) scale(1)}}
}
@media(prefers-reduced-motion:reduce) {
 .pv-motion-flight,.pv-motion-hold,.pv-motion-tab-line {display:none!important}
 .pv-motion-waiting,.pv-motion-success::before { animation:none!important; }
 html[data-pv-premium-motion="on"] .studio-app :is(button,summary) > svg,html[data-pv-premium-motion="on"] .pv-modern-viewer button > svg {transition:none!important;scale:none!important}
 html[data-pv-premium-motion="on"] .studio-app details[open] > .pv-gallery-menu-panel,html[data-pv-premium-motion="on"] .pv-modern-viewer :is(.pv-info-panel,.pv-viewer-extra-tools),html[data-pv-premium-motion="on"] .studio-app .modal-overlay .create-modal {animation:none!important;}
}
/* The thumbnail flight owns visibility only for its 300ms lifetime. */
html[data-pv-premium-motion="on"] .pv-modern-viewer.pv-motion-opening .pv-touch-viewer:not(.pv-zoomed) > img { opacity:0!important; }
.pv-motion-sparks {position:fixed;z-index:2147483001;pointer-events:none!important;}
.pv-motion-sparks i {position:absolute;font:normal 12px/1 system-ui;color:#d77f72;animation:pv-motion-spark 360ms ease-out both;}
.pv-motion-sparks[data-kind="star"] i {color:#dba342;}
@keyframes pv-motion-spark {from{opacity:1;transform:translate(-50%,-50%) scale(.6)}to{opacity:0;transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(1.1)}}
@media(max-width:767px){
 .studio-app .detail-controls details.pv-gallery-menu > .pv-gallery-menu-panel,
 .studio-app details.pv-batch-more > .pv-gallery-menu-panel {position:fixed;top:auto;right:8px;left:8px;bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-height:min(70dvh,560px);border-radius:20px;overscroll-behavior:contain;}
}
@media(prefers-reduced-motion:reduce){.pv-motion-sparks{display:none!important}html[data-pv-premium-motion="on"] .pv-modern-viewer.pv-motion-opening .pv-touch-viewer:not(.pv-zoomed)>img{opacity:1!important}}
/* Native details close transition is progressive; older Safari closes instantly.
   Transition the panel, not its ancestor (fixed positioning stays intact). */
@supports selector(details::details-content) {
 @media(max-width:767px) and (prefers-reduced-motion:no-preference){
  html[data-pv-premium-motion="on"] .studio-app details.pv-gallery-menu::details-content{transition:content-visibility 200ms allow-discrete!important;}
  html[data-pv-premium-motion="on"] .studio-app details.pv-gallery-menu:not([open]) > .pv-gallery-menu-panel{opacity:0;translate:0 18px;transition:opacity 180ms ease,translate 180ms ease!important;pointer-events:none;}
  html[data-pv-premium-motion="on"] .studio-app details.pv-gallery-menu[open] > .pv-gallery-menu-panel{opacity:1;translate:none;transition:opacity 180ms ease,translate 180ms ease!important;}
 }
}

/* Only the Premium layer is independent of data saver. The React data-motion
   flag and all image/network policy remain unchanged. */
@media(prefers-reduced-motion:no-preference){
 html[data-pv-premium-motion="on"] .studio-app .pv-motion-waiting {animation:pv-motion-shimmer 620ms ease-out 1!important;}
 html[data-pv-premium-motion="on"] .studio-app .pv-motion-success::before,
 html[data-pv-premium-motion="on"] .pv-modern-viewer .pv-motion-success::before {animation:pv-motion-tick 330ms var(--pv-motion-spring) both!important;}
}
.pv-motion-debug {position:fixed;z-index:2147483646;pointer-events:none;top:calc(8px + env(safe-area-inset-top,0px));right:8px;max-width:calc(100vw - 16px);margin:0;padding:8px;background:#19120eeb;color:#fff4dc;border-radius:8px;font:11px/1.45 monospace;white-space:pre-wrap;}

@media(prefers-reduced-motion:reduce){
 html[data-pv-premium-motion="on"] .studio-app :is(.tool-button,.photo-action,.stat-button,.set-tab,.create-button,.pv-icon-btn) > svg,
 html[data-pv-premium-motion="on"] .studio-app :is(.tool-button,.photo-action,.stat-button,.set-tab,.create-button,.pv-icon-btn):active > svg,
 html[data-pv-premium-motion="on"] .pv-modern-viewer .viewer-tools button > svg,
 html[data-pv-premium-motion="on"] .pv-modern-viewer .viewer-tools button:active > svg {transition:none!important;scale:none!important;}
 html[data-pv-premium-motion="on"] .studio-app details[open] > .pv-gallery-menu-panel,
 html[data-pv-premium-motion="on"] .pv-modern-viewer :is(.pv-info-panel,.pv-viewer-extra-tools),
 html[data-pv-premium-motion="on"] .studio-app .modal-overlay .create-modal {animation:none!important;}
}
