.loading-overlay {
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 150ms ease, visibility 150ms ease;
}

.loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loading-overlay--global {
  position: fixed;
  inset: 0;
  z-index: 7000;
  background: rgba(20, 31, 36, .42);
}

.loading-overlay--workspace {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(241, 245, 244, .72);
}

.loading-scope-host { position: relative; }

.loading-overlay--component {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .72);
}

.loading-status {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: #40545a;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
}

.rbsoft-loader {
  --loader-size: 40px;
  position: relative;
  width: var(--loader-size);
  height: var(--loader-size);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.rbsoft-loader--button { --loader-size: 24px; }
.rbsoft-loader--small { --loader-size: 24px; }
.rbsoft-loader--standard { --loader-size: 40px; }
.rbsoft-loader--page { --loader-size: 52px; }

.rbsoft-loader svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke-width: 3px;
}

.rbsoft-loader-track { stroke: rgba(112, 130, 130, .28); }
.rbsoft-loader-segment {
  stroke: #008f7f;
  stroke-linecap: round;
  stroke-dasharray: 26 74;
  animation: rbsoft-loader-progress 1.1s linear infinite;
}

.rbsoft-loader img {
  width: calc(var(--loader-size) - 18px);
  height: calc(var(--loader-size) - 18px);
  display: block;
  object-fit: contain;
}

.rbsoft-loader--button img { width: 12px; height: 12px; }
.rbsoft-loader--page img { width: 30px; height: 30px; }
.enterprise-spinner--button { flex: 0 0 auto; }

button.is-loading { cursor: wait; }
button.is-loading > .enterprise-spinner--button { margin-left: 1px; }
button.is-loading > .rbsoft-loader--on-dark .rbsoft-loader-track { stroke: rgba(255, 255, 255, .34); }
button.is-loading > .rbsoft-loader--on-dark .rbsoft-loader-segment { stroke: rgba(255, 255, 255, .96); }

html[data-theme="standard"] .workspace-shell { position: relative; }
html[data-theme="standard"] .loading-overlay--global .loading-status { color: #fff; }

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

@keyframes rbsoft-loader-progress { to { stroke-dashoffset: -100; } }

@media (prefers-reduced-motion: reduce) {
  .loading-overlay { transition: none; }
  .rbsoft-loader-segment { animation: none; stroke-dashoffset: 0; }
}
