/* Social Matter Payments: the one spring (dashboard, partner portal, CRM, questionnaire, docs), the website's law. apps/shared/MOTION.md
   has the numbers. A press is a real damped spring run frame by frame in motion.js (k 640, c 25, on the scale property only); whatever
   opens or changes state rides the same spring baked into --spring (k 420, c 24, .62 s). Colour changes at once. */
:root {
  --spring: linear(0,0.0381,0.1331,0.2619,0.4056,0.5498,0.6843,0.8023,0.9003,0.9771,1.0333,1.0711,1.0929,1.1019,1.1012,1.0935,1.0814,1.0671,1.0522,1.0378,1.025,1.0141,1.0053,0.9987,0.9941,0.9912,0.9898,0.9895,0.99,0.9911,0.9925,0.994,0.9955,0.9969,0.9981,0.9991,0.9999,1.0004,1.0008,1.001,1.0011,1.0011,1.001,1.0008,1);
  --spring-t: .62s;
  --press-dim: .72;
}
@supports not (animation-timing-function: linear(0, 1)) { :root { --spring: cubic-bezier(.2, 1.3, .36, 1) } }

/* Keys: nothing here moves them, motion.js does. These only keep a touch from selecting or zooming. */
button, [role=button], a[href], summary, label.choice, .agree, .checks label, input[type=submit] { touch-action: manipulation; -webkit-tap-highlight-color: transparent }
/* A link inside a sentence cannot scale (an inline box takes no transform): it dims while pressed, at once. */
p a[href]:active, li a[href]:not([class]):active, td a[href]:active { opacity: var(--press-dim) }

:disabled, [aria-disabled=true] { cursor: not-allowed }

/*@app-only*/
/* Pending: the button the person pressed is aria-busy until its request answers (motion.js). One bar springs in, no loop. */
:is(.btn, .btn2, .btn-acc, .btn-ghost, .btn-paper, .btn-board)[aria-busy=true] { position: relative; cursor: progress; overflow: hidden }
:is(.btn, .btn2, .btn-acc, .btn-ghost, .btn-paper, .btn-board)[aria-busy=true]::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: currentColor; transform-origin: left; pointer-events: none;
  animation: smp-pend var(--spring-t) var(--spring) both;
}
@keyframes smp-pend { from { transform: scaleX(0) } to { transform: scaleX(.92) } }

/*@end*/

/* Entrances and exits ride the spring. */
@keyframes smp-rise { from { opacity: 0; translate: 0 10px } to { opacity: 1; translate: 0 0 } }
@keyframes smp-fade { from { opacity: 0 } to { opacity: 1 } }
/*@app-only*/
.toast { animation: smp-rise var(--spring-t) var(--spring) both; transition: opacity var(--spring-t) var(--spring), translate var(--spring-t) var(--spring) }
.toast.is-out { opacity: 0; translate: 0 10px }
/*@end*/
details[open] > :not(summary) { animation: smp-rise var(--spring-t) var(--spring) both }
summary { -webkit-tap-highlight-color: transparent }

/*@app-only*/
/* Dialogs: open and close on the spring; the dialog leaves the top layer when it has settled. */
dialog { opacity: 0; translate: 0 14px;
  transition: opacity var(--spring-t) var(--spring), translate var(--spring-t) var(--spring), overlay var(--spring-t) allow-discrete, display var(--spring-t) allow-discrete }
dialog[open] { opacity: 1; translate: 0 0 }
@starting-style { dialog[open] { opacity: 0; translate: 0 14px } }
dialog::backdrop { opacity: 0; transition: opacity var(--spring-t) var(--spring), overlay var(--spring-t) allow-discrete, display var(--spring-t) allow-discrete }
dialog[open]::backdrop { opacity: 1 }
@starting-style { dialog[open]::backdrop { opacity: 0 } }

/*@end*/

/* Reduced motion: no spring runs (motion.js checks the same query) and nothing transitions; a press dims at once. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important }
  :is(button, [role=button], a[href], summary, label.choice, .agree, .checks label, input[type=submit]):active:not(:disabled, [aria-disabled=true], [aria-busy=true]) { opacity: var(--press-dim) }
}
