/* Shared page flow: live content fades in; only the decorative nav accent travels. */
:root {
    --sws-motion-fast: 160ms;
    --sws-motion-base: 260ms;
    --sws-motion-slow: 420ms;
    --sws-ease: cubic-bezier(.22,.68,0,1.01);
}
/* Reserve the same scrollbar space on short pages and while a dialog is open. */
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }
@view-transition { navigation: auto; }
/* Captured elements cannot receive clicks. Keep every interactive surface live. */
:root, .sws-header, .sws-entry-error-header { view-transition-name: none; }
.sws-nav-indicator { view-transition-name: sws-nav-indicator; }
::view-transition,
::view-transition-group(*),
::view-transition-image-pair(*),
::view-transition-old(*),
::view-transition-new(*) { pointer-events: none; }
/* Keep the browser's generated position/width keyframes, with no JS layout loop. */
::view-transition-group(sws-nav-indicator) {
    animation-duration: 400ms;
    animation-timing-function: cubic-bezier(.22, .68, 0, 1);
}
::view-transition-old(sws-nav-indicator),
::view-transition-new(sws-nav-indicator) { width: 100%; height: 100%; object-fit: fill; animation: none; mix-blend-mode: normal; }
::view-transition-old(sws-nav-indicator) { opacity: 0; }
::view-transition-new(sws-nav-indicator) { opacity: 1; }
/* Login/account pages have no text-nav marker: enter/leave without inventing a target. */
::view-transition-old(sws-nav-indicator):only-child { opacity: 1; animation: sws-page-dissolve 400ms cubic-bezier(.22, .68, 0, 1) reverse both; }
::view-transition-new(sws-nav-indicator):only-child { animation: sws-page-dissolve 400ms cubic-bezier(.22, .68, 0, 1) both; }
@keyframes sws-page-dissolve { from { opacity: 0; } to { opacity: 1; } }
/* Every page, including direct loads, form redirects and history restoration.
   Fade live content without moving hit targets when input finishes the animation. */
.sws-page-entering #sws-main-content,
.sws-page-entering .sws-footer {
    animation: sws-content-arrive 400ms cubic-bezier(.22, .68, 0, 1) backwards;
}
@keyframes sws-content-arrive {
    from { opacity: .35; }
    to { opacity: 1; }
}
@media (max-width: 1240px) {
    .sws-nav-indicator { view-transition-name: none; }
}

/* Independent translate/scale preserve each component's own transforms. */
.sws-site :is(.sws-workspace-action, .sws-secondary-action, .sws-entry__submit, .sws-entry__secondary, .sws-folio-start, .sws-home-instrument__start) {
    transition: background-color var(--sws-motion-fast) ease, border-color var(--sws-motion-fast) ease, color var(--sws-motion-fast) ease, transform var(--sws-motion-base) var(--sws-ease), translate var(--sws-motion-base) var(--sws-ease), scale var(--sws-motion-fast) var(--sws-ease);
}
.sws-site :is(.sws-workspace-action, .sws-secondary-action, .sws-entry__submit, .sws-entry__secondary, .sws-folio-start, .sws-home-instrument__start):active:not(:disabled) { scale: .98; }
.sws-site [data-motion-magnet] { translate: var(--sws-pointer-x, 0px) var(--sws-pointer-y, 0px); }
.sws-site :is(a, button, input, textarea, select, summary):focus-visible { transition-duration: 0s; }
.sws-site :is(.sws-nav__link, .sws-record-action, .sws-admin-open-link, .sws-file-picker__button, .sws-chat-attachment) { transition: color var(--sws-motion-fast) ease, border-color var(--sws-motion-fast) ease, background-color var(--sws-motion-fast) ease; }
.sws-site .sws-menu-toggle__line { transition: transform var(--sws-motion-base) var(--sws-ease), opacity var(--sws-motion-fast) ease; transform-origin: center; }
.sws-site .sws-menu-toggle[aria-expanded="true"] .sws-menu-toggle__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sws-site .sws-menu-toggle[aria-expanded="true"] .sws-menu-toggle__line:nth-child(2) { opacity: 0; }
.sws-site .sws-menu-toggle[aria-expanded="true"] .sws-menu-toggle__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.sws-nav[data-motion-owned] { max-height: calc(100dvh - 76px); overflow-y: auto; overscroll-behavior: contain; }
html:has(.sws-modal[open], .sws-work-drawer[open]) { overflow-y: hidden; }
.sws-modal[data-sws-modal-owner="shared"][open] { animation: none; }
.sws-site .sws-field { transition: color var(--sws-motion-fast) ease; }
.sws-site .sws-field:focus-within > :is(label, .sws-label) { color: #ac1748; }
.sws-site .sws-input { transition: border-color var(--sws-motion-fast) ease, background-color var(--sws-motion-fast) ease, box-shadow var(--sws-motion-fast) ease; }
.sws-site .sws-file-picker:has(input:focus-visible) { outline: 2px solid #c81754; outline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
    .sws-site :is(.sws-project-ledger tbody tr, .sws-admin-suite tbody tr) { transition: background-color var(--sws-motion-fast) ease; }
    .sws-site :is(.sws-project-ledger tbody tr, .sws-admin-suite tbody tr):hover { background-color: #a67c450b; }
}
@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
    .sws-page-entering #sws-main-content, .sws-page-entering .sws-footer { animation: none !important; }
    .sws-site *, .sws-site *::before, .sws-site *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; animation-delay: 0s !important; }
    .sws-site [data-motion-magnet] { translate: none !important; }
}
