/* A press is immediate; visible pending and server-owned outcomes remain readable. */
:where(button, .button, .compact-action, .text-action, summary) {
  transition: transform calc(var(--theme-motion-press-ms) * 1ms) ease-out,
    background-color calc(var(--theme-motion-press-ms) * 1ms) ease-out;
}
:where(button, .button, .compact-action, .text-action, summary):active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(var(--theme-feedback-press-distance));
}
.is-action-pending { cursor: progress; }
button.is-action-pending { display: inline-grid; align-items: center; }
.action-button-original, .action-button-working { grid-area: 1 / 1; }
.action-button-original { visibility: hidden; }
.action-button-working { display: inline-flex; align-items: center; justify-content: center; gap: var(--theme-space-2); }
.action-button-working > span:last-child { min-inline-size: 0; overflow-wrap: anywhere; }
.action-button-spinner {
  display: inline-block;
  flex: 0 0 auto;
  inline-size: var(--theme-feedback-progress-size);
  block-size: var(--theme-feedback-progress-size);
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  vertical-align: middle;
  animation: action-working 1s linear infinite;
}
.action-feedback {
  grid-column: 1 / -1;
  flex-basis: 100%;
  inline-size: 100%;
  box-sizing: border-box;
  margin: var(--theme-space-2) 0 var(--theme-space-3);
  padding: var(--theme-space-3) var(--theme-space-4);
  border-inline-start: 3px solid var(--theme-color-brand);
  background: var(--theme-color-surface);
  color: var(--theme-color-ink);
  font: inherit;
  overflow-wrap: anywhere;
}
.action-feedback.is-action-error { border-inline-start-color: var(--theme-color-error); }
/* Normal pending is inside the button. Keep one announcement outside the busy
   form without creating a second visible panel or moving the surrounding page. */
.action-feedback:not(.is-action-error):not(.is-action-slow) {
  position: absolute; inline-size: 1px; block-size: 1px; padding: 0;
  margin: -1px; border: 0; overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}
@keyframes action-working { to { transform: rotate(360deg); } }
html[data-motion="off"] :where(button, .button, .compact-action, .text-action, summary),
html[data-motion="off"] .action-button-spinner { transition: none; animation: none; transform: none; }
@media (prefers-reduced-motion: reduce) {
  :where(button, .button, .compact-action, .text-action, summary), .action-button-spinner {
    transition: none; animation: none; transform: none !important;
  }
}

.workspace-progress[hidden] { display: none; }
.workspace-request-error.is-inline-error {
  position: static; transform: none; grid-column: 1 / -1; flex-basis: 100%;
  inline-size: 100%; max-inline-size: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--theme-space-3);
}
.workspace-request-error.is-inline-error[hidden] { display: none; }

html[data-feedback-hidden="true"] .action-button-spinner { animation-play-state: paused; }
