/* Busy links (web/js/busy-link.js): spinner replaces the leading icon, or sits
   after the label when there is none, so the button width does not jump. */
.is-busy {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
    cursor: progress;
}

.is-busy > i:first-child {
    visibility: hidden;
}

.is-busy::after {
    content: '';
    width: 0.9em;
    height: 0.9em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: busy-spin 0.6s linear infinite;
    display: inline-block;
    vertical-align: -0.1em;
    margin-left: 0.4em;
}

.is-busy:has(> i:first-child)::after {
    margin-left: 0;
    position: absolute;
    left: 0.75em;
    top: 50%;
    margin-top: -0.45em;
}

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

@media (prefers-reduced-motion: reduce) {
    .is-busy::after {
        animation: none;
        border-style: dotted;
        border-right-color: currentColor;
    }
}
