/* Shared busy indicator. The label stays; the spinner is painted over the
   trailing padding so the control's width does not change. */

.shadowland-busy {
  cursor: progress;
}

.shadowland-busy-anchor {
  position: relative;
}

.shadowland-busy::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  inset-inline-end: 6px;
  top: 50%;
  margin-top: -5px;
  pointer-events: none;
  animation: shadowland-busy-spin 0.7s linear infinite;
}

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

#shadowland-busy-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 80;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: 0 0;
  background: #e3b23c;
  box-shadow: 0 0 8px rgba(227, 178, 60, 0.65);
  opacity: 0;
}

#shadowland-busy-bar.is-on {
  opacity: 1;
  transform: scaleX(0.72);
  transition: transform 10s cubic-bezier(0.15, 0.7, 0.2, 1), opacity 120ms linear;
}

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

@media (prefers-reduced-motion: reduce) {
  .shadowland-busy::after {
    animation: none;
  }

  #shadowland-busy-bar,
  #shadowland-busy-bar.is-on {
    transition: none;
  }
}

@media (forced-colors: active) {
  .shadowland-busy::after {
    border-color: CanvasText;
    border-inline-end-color: transparent;
  }

  #shadowland-busy-bar {
    background: Highlight;
    box-shadow: none;
  }
}
