/* Shared by every EvalSys page, including AJAX/modal content.
 * Individual translate/scale preserve the declared resting transform.
 * No colors, dimensions, event listeners, or action handlers are replaced.
 * .evalsys-interactive is an opt-in for future custom controls.
 */
html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], a[href], [role="button"], .btn, .button, .btn-close, [onclick], [data-bs-toggle], [data-bs-dismiss], .person-account-card, .evalsys-interactive) {
  --evalsys-button-lift: -1px;
  --evalsys-button-press: .98;
  /* Own motion in one place, including legacy hover rules. */
  transition: translate 180ms ease, scale 180ms ease, transform 180ms ease,
    box-shadow 180ms ease, background-color 180ms ease,
    border-color 180ms ease, color 180ms ease, opacity 180ms ease !important;
}

/* Keep the existing centered search control and collapsed-sidebar arrow. */
html body .filter-edge-btn { --evalsys-button-rest-transform: translateY(-50%); }
html body.sidebar-collapsed .sidebar-collapse-btn { --evalsys-button-rest-transform: rotate(180deg); }

/* Allow inline custom icon controls to receive transforms. */
html body :is(span, i)[onclick], html body span[role="button"] {
  display: inline-block;
}

@media (hover: hover) and (pointer: fine) {
  html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], a[href], [role="button"], .btn, .button, .btn-close, [onclick], [data-bs-toggle], [data-bs-dismiss], .person-account-card, .evalsys-interactive):not(:is(:disabled, [disabled], [aria-disabled="true"], .disabled, .loading, .is-loading, .submitting, .is-submitting, [aria-busy="true"], [data-loading="true"])):not(:where(:is(:disabled, [disabled], [aria-disabled="true"], .disabled, .loading, .is-loading, .submitting, .is-submitting, [aria-busy="true"], [data-loading="true"]) *)):hover {
    translate: 0 var(--evalsys-button-lift);
  }
  html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], .btn, .button, [role="button"]):not(:is(:disabled, [disabled], [aria-disabled="true"], .disabled, .loading, .is-loading, .submitting, .is-submitting, [aria-busy="true"], [data-loading="true"])):not(:where(:is(:disabled, [disabled], [aria-disabled="true"], .disabled, .loading, .is-loading, .submitting, .is-submitting, [aria-busy="true"], [data-loading="true"]) *)):hover {
    box-shadow: 0 4px 12px rgba(0, 8, 25, .22);
  }
}

/* Touch, mouse, stylus and keyboard activation share the same press feedback. */
html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], a[href], [role="button"], .btn, .button, .btn-close, [onclick], [data-bs-toggle], [data-bs-dismiss], .person-account-card, .evalsys-interactive):not(:is(:disabled, [disabled], [aria-disabled="true"], .disabled, .loading, .is-loading, .submitting, .is-submitting, [aria-busy="true"], [data-loading="true"])):not(:where(:is(:disabled, [disabled], [aria-disabled="true"], .disabled, .loading, .is-loading, .submitting, .is-submitting, [aria-busy="true"], [data-loading="true"]) *)):is(:active, .evalsys-pressed) {
  translate: 0 0;
  scale: var(--evalsys-button-press);
}

html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], a[href], [role="button"], .btn, .button, .btn-close, [onclick], [data-bs-toggle], [data-bs-dismiss], .person-account-card, .evalsys-interactive):focus-visible {
  outline: 2px solid #72b7ff !important;
  outline-offset: 3px;
}

html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], a[href], [role="button"], .btn, .button, .btn-close, [onclick], [data-bs-toggle], [data-bs-dismiss], .person-account-card, .evalsys-interactive):is(:is(:disabled, [disabled], [aria-disabled="true"], .disabled, .loading, .is-loading, .submitting, .is-submitting, [aria-busy="true"], [data-loading="true"])),
html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], a[href], [role="button"], .btn, .button, .btn-close, [onclick], [data-bs-toggle], [data-bs-dismiss], .person-account-card, .evalsys-interactive):where(:is(:disabled, [disabled], [aria-disabled="true"], .disabled, .loading, .is-loading, .submitting, .is-submitting, [aria-busy="true"], [data-loading="true"]) *) {
  translate: none;
  scale: none;
  cursor: not-allowed;
}

/* No expanding hover scale, so edge-aligned controls stay within the viewport. */
@media (max-width: 575px), (pointer: coarse) {
  html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], a[href], [role="button"], .btn, .button, .btn-close, [onclick], [data-bs-toggle], [data-bs-dismiss], .person-account-card, .evalsys-interactive) {
    --evalsys-button-lift: -.5px;
    --evalsys-button-press: .99;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], a[href], [role="button"], .btn, .button, .btn-close, [onclick], [data-bs-toggle], [data-bs-dismiss], .person-account-card, .evalsys-interactive), html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], a[href], [role="button"], .btn, .button, .btn-close, [onclick], [data-bs-toggle], [data-bs-dismiss], .person-account-card, .evalsys-interactive):hover, html body :is(button, input[type="submit"], input[type="button"], input[type="reset"], a[href], [role="button"], .btn, .button, .btn-close, [onclick], [data-bs-toggle], [data-bs-dismiss], .person-account-card, .evalsys-interactive):is(:active, .evalsys-pressed) {
    translate: none !important;
    scale: none !important;
    animation: none !important;
    transition: none !important;
  }
}
