/* ==========================================================================
   Busy feedback — shared by every IBV app (docs/design-system.md → Busy feedback).
   Loaded by templates/includes/ibv_busy.html, which every app's chrome includes,
   including the apps that predate ibv.css. No literals: colours come from the
   button's own text colour and from whichever amber token the page defines.
   ========================================================================== */

/* The button that started the work: dimmed, spinner before its label. */
[aria-busy="true"] { cursor: progress; }
button[aria-busy="true"], a[aria-busy="true"], input[aria-busy="true"] { opacity: .75; pointer-events: none; }
button[aria-busy="true"]::before, a[aria-busy="true"]::before {
    content: ""; display: inline-block; flex: none; width: 1em; height: 1em; margin-right: .5em; vertical-align: -.15em;
    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: ibv-busy-spin .7s linear infinite;
}
/* A spinner replaces the button's own icon rather than sitting beside it. */
button[aria-busy="true"] > svg:first-child, a[aria-busy="true"] > svg:first-child { display: none; }

/* The page-wide bar: a thin amber line across the top while anything is working. */
.ibv-busybar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 10000; overflow: hidden; pointer-events: none;
    color: var(--ibv-amber, var(--amber, var(--lbo-amber, var(--bg-amber, currentColor)))); }
.ibv-busybar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; background: currentColor;
    border-radius: 999px; animation: ibv-busy-slide 1.1s ease-in-out infinite; }
.ibv-busybar[hidden] { display: none; }

/* The live label under or beside the button: what is happening and for how long. */
.ibv-busy-note { display: block; margin-top: .35em; font-size: .85em; opacity: .8; }

@keyframes ibv-busy-spin { to { transform: rotate(360deg); } }
@keyframes ibv-busy-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) {
    button[aria-busy="true"]::before, a[aria-busy="true"]::before { animation-duration: 2.4s; }
    .ibv-busybar::before { animation: none; width: 100%; opacity: .6; }
}
