/* States, declared last so they win: hidden, disabled, busy, and no motion for those who ask for none.
   The only file (with print.css) allowed !important. */
[hidden] { display: none !important; }

/* disabled: a pale button that says it cannot be pressed now */
.btn:not(.link):is(:disabled, [aria-disabled="true"]) {
  background-color: var(--disabled-bg) !important; background-image: none !important; border-color: var(--disabled-line) !important;
  color: var(--disabled-ink) !important; box-shadow: none !important; transform: none !important; filter: none; cursor: not-allowed;
}
.btn.link:is(:disabled, [aria-disabled="true"]) { color: var(--disabled-ink) !important; cursor: not-allowed; }
.f :is(input, select, textarea):disabled { border-color: var(--disabled-line); background-color: var(--disabled-bg); color: var(--disabled-ink); cursor: not-allowed; }
.choice[aria-disabled="true"] { background: var(--disabled-bg); border-color: var(--disabled-line); color: var(--disabled-ink); cursor: not-allowed; }

/* busy: the words fade and a small ring turns until the server answers */
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; width: 16px; height: 16px; margin: auto; border-radius: var(--r-dot);
  border: 2px solid var(--on-cover-a35); border-top-color: var(--on-accent); animation: spin .7s linear infinite;
}
.btn:is(.ghost, .soft, .link)[aria-busy="true"]::after { border-color: var(--accent-a25); border-top-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn[aria-busy="true"]::after { animation: spin 2s linear infinite !important; }
}
