/* Pending: what a slow action shows while it runs.

   It serves every action that takes longer than a second: writing a proposal,
   which calls the model, and sending photos or a video, which can take a minute.
   The disabled button in 070-button.css alone is not enough. A button that
   merely stops responding is indistinguishable from a button that did nothing,
   and the merchant's next move is to click it again. */

/* Hidden until HTMX marks the request in flight, then laid out as a row.
   display is what toggles, so the reserved space appears with the message
   rather than sitting empty under the button for the life of the page. */
.pending { display: none; }

.htmx-request .pending,
.htmx-request.pending {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.pending__spinner {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: pending-spin 0.7s linear infinite;
}

@keyframes pending-spin {
  to { transform: rotate(360deg); }
}

/* The text carries the meaning, so without motion the spinner stops rather
   than disappears: the row still says the work is running, and a frozen ring
   next to live text reads as a still image, not as a stalled request. */
@media (prefers-reduced-motion: reduce) {
  .pending__spinner { animation: none; }
}
