/* The one Hetu loader (trial, 7 Nov), drawn by assets/hetu-loader.js. Colours come from three variables so the
   same loader sits on paper, on an indigo button or on a dark panel:
   --hl-dot (the Hetu dot), --hl-tail (the trail), --hl-track (the ring under it). */
:root{--hl-dot:var(--brand-dot,#c58a3d);--hl-tail:var(--accent-line,var(--accent,#2e2f7a));--hl-track:color-mix(in srgb,var(--hl-tail) 14%,transparent)}
.hl-on .hl-ring{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
body:not(#_) .hl-on circle.hl-track{fill:none;stroke:var(--hl-track);stroke-width:2.6}
body:not(#_) .hl-on circle.hl-tail{fill:none;stroke:var(--hl-tail);stroke-width:2.6;stroke-linecap:round}
body:not(#_) .hl-on circle.hl-dot{fill:var(--hl-dot);stroke:none}

/* large: the research waiting mark replaces its spinning arc and h/dot swap */
body:not(#_) .st-hmark.hl-on :is(.st-ring-arc,.st-hdot){display:none}
body:not(#_) .st-hmark.hl-on .st-h{animation:none;opacity:1;transform:none}
body .st-hmark.hl-on .hl-ring{width:40px;height:40px}
body .st-status[data-state="paused"] .st-hmark.hl-on{--hl-tail:var(--line-strong)}

/* small: one size, thicker strokes so it reads at 12-18px */
.hl-spin{position:relative;display:inline-block;width:16px;height:16px;flex:none;vertical-align:-3px}
body:not(#_) .hl-spin.hl-on circle:is(.hl-track,.hl-tail){stroke-width:5}
body :is(.hx-ap-spin,.m-appeal-spin).hl-on{position:relative;border:0!important;animation:none!important;border-radius:0}

/* a busy button: the loader replaces the old ring, in the button's own text colour */
body :is(.is-busy):not(#_):has(> .hl-spin):after{content:none}
body .is-busy > .hl-in-btn{position:absolute;inset:0;margin:auto;width:18px;height:18px;--hl-tail:var(--btn-text,currentColor);--hl-track:color-mix(in srgb,var(--btn-text,#fff) 22%,transparent)}
body :is(.secondary,.lp-button-outline).is-busy > .hl-in-btn{--hl-tail:var(--ink);--hl-track:color-mix(in srgb,var(--ink) 16%,transparent)}

/* "a job is running" dots: the Hetu dot, breathing (one keyframe for all of them) */
@keyframes hl-breathe{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.45;transform:scale(.72)}}
body :is(.wc-live i,.wf-dot,.lk-box.is-suggesting::after,.st-sec-mark .st-dot,.hx-live,.history-live,.app-nav-item.has-live .app-nav-icon::after,.f-index-row[data-ready="false"] .m-index-num::after){background:var(--hl-dot)!important;box-shadow:none!important;animation:hl-breathe 1.9s ease-in-out infinite!important}
body .rb-chip-reading .hetu-icon{animation:hl-breathe 1.9s ease-in-out infinite!important}
body .rb-chip-opening .rb-chip-bar{display:none!important}   /* the opening sweep was a second kind of loader */
@media (prefers-reduced-motion:reduce){body :is(.wc-live i,.wf-dot,.lk-box.is-suggesting::after,.st-sec-mark .st-dot,.hx-live,.history-live,.app-nav-item.has-live .app-nav-icon::after,.f-index-row[data-ready="false"] .m-index-num::after,.rb-chip-reading .hetu-icon){animation:none!important}}

/* large mark (7 Nov): the dot and its tail turn on a CSS animation (keeps going while the page is busy);
   GSAP only lengthens the tail and handles setting off, resting and coming home. */
body .st-hmark.hl-on .hl-orbit{position:absolute;inset:0;animation:hl-orbit 1.9s linear infinite;will-change:transform}
body .st-hmark.hl-on .hl-orbit.hl-held{animation:none}
body .st-hmark.hl-on .hl-orbit .hl-ring{width:40px;height:40px}
@keyframes hl-orbit{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){body .st-hmark.hl-on .hl-orbit{animation:none}}
