/*
 * Accessibility: honour `prefers-reduced-motion: reduce` for the app's
 * spinners.
 *
 * Neither @chakra-ui/react nor @tornator-oyj/design-system-chakra suppresses
 * the indeterminate spin animation for users who ask for reduced motion — the
 * Chakra preset only exposes a `motionReduce` condition for authors to use, it
 * applies no reset of its own. This rule used to live inside
 * `chakra-spinner-fix.css`, the workaround for the #1856 empty-`@keyframes`
 * design-system bug. That bug is fixed in design-system-chakra 3.2.2 and the
 * workaround is gone, but the reduced-motion suppression it carried is a
 * separate, still-needed accessibility behaviour, so it is kept here on its own.
 *
 * Three selectors, all stable literal classes Chakra's recipes always emit:
 *   - `.chakra-spinner` — Chakra's plain Spinner (spinner.js recipe)
 *   - `.chakra-progress-circle__circle[data-state="indeterminate"]` — the
 *     indeterminate ProgressCircle's rotating `<svg>` (progress-circle.js
 *     recipe's "circle" slot; the design system drives it at 1.4s via an
 *     unlayered `& svg` rule, Chakra's own recipe at 2s).
 *   - `.chakra-progress-circle__circleRange[data-state="indeterminate"]` — the
 *     same component's "circleRange" slot, a separate
 *     `circular-progress 1.5s linear infinite` stroke-dash sweep. Without it
 *     the arc keeps sweeping under reduced motion even though the circle has
 *     stopped rotating.
 *
 * The `[data-state="indeterminate"]` scoping matters: a determinate
 * (percentage) ProgressCircle is not animated in the first place.
 *
 * Must be a plain, statically-loaded <link> (see index.html), NOT bundled via
 * Emotion/Panda. Chakra's `.chakra-spinner` animation is declared inside the
 * `@layer recipes` cascade layer, and per the CSS Cascade Layers spec an
 * UNLAYERED rule always wins over a layered one regardless of source order.
 * The design system's ProgressCircle animation comes from an unlayered
 * `css`-prop rule instead (that unlayered-ness is what made #1856 bite), so
 * there the override wins on specificity: `.chakra-progress-circle__circle
 * [data-state='indeterminate']` (0,2,0) beats the generated `.css-hash svg`
 * (0,1,1). Same plain-<link> reasoning as geo-chakra-compat.css.
 *
 * Not covered: the design system's `LinearProgress` (`ds-linear-indeterminate`
 * / `ds-linear-stripe`), which has no usages in `frontend/src` today. Add it
 * here if that changes.
 */
@media (prefers-reduced-motion: reduce) {
  .chakra-spinner,
  .chakra-progress-circle__circle[data-state='indeterminate'],
  .chakra-progress-circle__circleRange[data-state='indeterminate'] {
    animation: none;
  }
}
