/* Button: primary, secondary, quiet, danger (and the outline danger for rows
   and menus); default 40px, small 32px, icon-only. States: hover, focus-visible,
   pressed, disabled (native or aria-disabled), busy (aria-busy).
   .is-hover / .is-active / .is-focus draw a state statically (gallery only). */

.pr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--pr-space-sm);
  height: var(--pr-density-standard-control);
  padding: 0 var(--pr-space-lg);
  border-radius: var(--pr-radius-sm);
  border: var(--pr-border-hairline) solid transparent;
  font: 500 0.85rem/1 var(--font-sans);
  color: var(--pr-text-primary);
  background: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--pr-dur-fast) var(--pr-ease-standard), border-color var(--pr-dur-fast) var(--pr-ease-standard);
}
.pr-btn:focus-visible, .pr-btn.is-focus { outline: var(--pr-border-focus) solid var(--pr-focus-ring); outline-offset: var(--pr-border-focus); }

.pr-btn--primary { background: var(--pr-brand-fill); color: var(--pr-text-on-brand); }
.pr-btn--primary:hover, .pr-btn--primary.is-hover { background: var(--pr-brand-fill-hover); }

.pr-btn--secondary { border-color: var(--pr-border-control); background: var(--pr-surface-card); }
.pr-btn--secondary:hover, .pr-btn--secondary.is-hover,
.pr-btn--quiet:hover, .pr-btn--quiet.is-hover { background: var(--pr-surface-hover); }

.pr-btn--quiet { color: var(--pr-text-link); }

.pr-btn--danger { background: var(--pr-danger-fill); color: var(--pr-text-on-brand); }
.pr-btn--danger:hover, .pr-btn--danger.is-hover { background: var(--pr-danger-fill-hover); }

/* Outline destructive: rows and menus. The solid form is for the confirming step. */
.pr-btn--danger-quiet { color: var(--pr-danger-text); border-color: var(--pr-danger-text); }
.pr-btn--danger-quiet:hover, .pr-btn--danger-quiet.is-hover { background: var(--pr-danger-tint); }

.pr-btn:active, .pr-btn.is-active { transform: translateY(1px); }

.pr-btn--sm { height: var(--pr-density-dense-control); padding: 0 var(--pr-space-md); font-size: 0.75rem; }
.pr-btn--icon { width: var(--pr-density-standard-control); padding: 0; }
.pr-btn--icon.pr-btn--sm { width: var(--pr-density-dense-control); }
.pr-btn--block { width: 100%; }

/* Disabled: a flat nested fill. aria-disabled keeps it focusable so the
   reason beside it can be read; it must not act (the page guards clicks). */
.pr-btn[disabled], .pr-btn[aria-disabled="true"], .pr-btn.is-disabled {
  background: var(--pr-surface-nested);
  color: var(--pr-text-disabled);
  border-color: transparent;
  cursor: not-allowed;
  transform: none;
}
.pr-btn__why { font-size: 0.75rem; line-height: 1.4; color: var(--pr-text-caption); }

/* Busy: the width holds, the icon becomes the arc, the label says what is happening. */
.pr-btn[aria-busy="true"] { cursor: progress; }
.pr-btn[aria-busy="true"]:active { transform: none; }

@media (max-width: 768px) {
  .pr-btn { height: var(--pr-touch-target); font-size: 1rem; }
  .pr-btn--icon { width: var(--pr-touch-target); }
  .pr-btn--sm { height: var(--pr-touch-target); font-size: 0.85rem; }
  .pr-btn--icon.pr-btn--sm { width: var(--pr-touch-target); }
  /* Full width in sheets and dialog footers on a phone */
  .pr-sheet .pr-btn, .pr-btn--block-phone { width: 100%; }
}
