/* Shared, finite motion. Content remains visible without JavaScript.
   No table, money field, scan field or destructive action receives a transform. */
:root {
  --twf-motion-in: 220ms;
  --twf-motion-menu: 180ms;
  --twf-motion-menu-out: 144ms;
  --twf-motion-popover: 200ms;
  --twf-motion-popover-out: 160ms;
  --twf-motion-ease-out: cubic-bezier(.16, 1, .3, 1);
  --twf-motion-ease-move: cubic-bezier(.4, 0, .2, 1);
}

/* Pointer dismissal keeps its separate 350 ms grace period in navigation code.
   Closing panels remain visual for 144 ms and become inert immediately. */
html.twf-motion-ready .twf-public-dropdown.twf-motion-exiting { display: block !important; }
html.twf-motion-ready .twf-nav__panel.twf-motion-exiting[hidden] {
  display: var(--twf-motion-panel-display, grid) !important;
  z-index: 2499 !important;
}
.twf-motion-exiting { pointer-events: none !important; }
@media (max-width: 960px) {
  html.twf-motion-ready .twf-public-nav.twf-motion-exiting { display: flex !important; }
}

/* Only navigation, customer information links, and review controls opt into press.
   Transform changes immediately while held. JavaScript eases the release only. */
.twf-motion-press { transform-origin: center; }
.twf-motion-press.twf-motion-held {
  transform: scale(.97) !important;
  transition: none !important;
  animation: none !important;
}
.twf-motion-icon-host { display: inline-grid; min-width: 1em; place-items: center; vertical-align: middle; }
.twf-motion-icon-host > .twf-motion-icon-frame { grid-area: 1 / 1; display: inline-block; }

/* Small color changes keep focus, contrast and layout intact. */
html.twf-motion-ready :is(.twf-admin-link, .twf-command-launch, .twf-admin-menu, .twf-command-results a) {
  transition: background-color 160ms var(--twf-motion-ease-out), border-color 160ms var(--twf-motion-ease-out), color 160ms var(--twf-motion-ease-out);
}
html.twf-motion-ready :is(.twf-public-dropdown, .twf-nav__panel, .twf-command-dialog) {
  transform-origin: var(--twf-motion-origin, 50% 0);
}

/* Changing the preference settles WAAPI/scroll work in motion.js as well.
   Do not reset transforms globally: off-canvas layout still needs its static state. */
@media (prefers-reduced-motion: reduce) {
  html.twf-motion-ready,
  html.twf-motion-ready *,
  html.twf-motion-ready *::before,
  html.twf-motion-ready *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
  .twf-motion-press.twf-motion-held { transform: none !important; }
}
@media print {
  html.twf-motion-ready *,
  html.twf-motion-ready *::before,
  html.twf-motion-ready *::after { animation: none !important; transition: none !important; }
  .twf-motion-exiting { display: none !important; }
}
