:root {
  --px-spinner-sm: 1.25rem;
  --px-spinner-md: 2rem;
  --px-spinner-lg: 2.75rem;
  --px-spinner-track: color-mix(in srgb, var(--text-muted) 35%, transparent);
  --px-spinner-accent: var(--brand);
}

.px-spinner {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  vertical-align: middle;
}

.px-spinner__ring {
  display: inline-block;
  border-radius: 50%;
  border-style: solid;
  border-color: var(--px-spinner-track);
  border-top-color: var(--px-spinner-accent);
  animation: px-spinner-rotate 0.7s linear infinite;
  flex-shrink: 0;
}

.px-spinner--sm .px-spinner__ring {
  width: var(--px-spinner-sm);
  height: var(--px-spinner-sm);
  border-width: 2px;
}

.px-spinner--md .px-spinner__ring {
  width: var(--px-spinner-md);
  height: var(--px-spinner-md);
  border-width: 3px;
}

.px-spinner--lg .px-spinner__ring {
  width: var(--px-spinner-lg);
  height: var(--px-spinner-lg);
  border-width: 4px;
}

.px-spinner__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes px-spinner-rotate {
  to { transform: rotate(360deg); }
}
