:root {
  --motion-feedback: 160ms;
  --motion-surface: 220ms;
  --motion-ease-out: cubic-bezier(0.2, 0, 0, 1);
}

.progress-fill { transition: none; }

@media (prefers-reduced-motion: no-preference) {
  [id^="screen-"]:not(.hidden) {
    animation: finance-screen-in var(--motion-feedback) var(--motion-ease-out);
  }

  .modal-backdrop:not(.hidden) {
    animation: finance-screen-in var(--motion-feedback) var(--motion-ease-out);
  }

  .modal-backdrop:not(.hidden) > .modal,
  :is(.category-dialog, .voice-dialog, .savings-dialog)[open] {
    animation: finance-surface-in var(--motion-surface) var(--motion-ease-out);
  }

  :is(.category-dialog, .voice-dialog, .savings-dialog)[open]::backdrop {
    animation: finance-screen-in var(--motion-feedback) var(--motion-ease-out);
  }

  .toast {
    animation: finance-toast-in var(--motion-feedback) var(--motion-ease-out);
  }

  button, .sf-navigation a {
    transition: background-color var(--motion-feedback) ease-out,
                color var(--motion-feedback) ease-out;
  }

  button:enabled:active { opacity: 0.78; }

  @keyframes finance-screen-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes finance-surface-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes finance-toast-in {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
