.refresh-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.34);
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(8px) saturate(.72);
  -webkit-backdrop-filter: blur(8px) saturate(.72);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.refresh-loader-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

html[data-theme="dark"] .refresh-loader-overlay {
  background: rgba(10, 12, 16, 0.38);
}

html.dashboard-is-refreshing,
html.dashboard-is-refreshing body {
  overflow: hidden;
}

.dashboard-refresh-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dashboard-refresh-note {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 30;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 9px 11px;
  border: 1px solid var(--border, #e4e7ec);
  border-radius: 9px;
  background: var(--surface, #fff);
  color: var(--text-soft, #344054);
  box-shadow: 0 10px 24px rgba(16, 24, 40, .14);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.dashboard-refresh-note::before {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--border, #e4e7ec);
  border-left: 1px solid var(--border, #e4e7ec);
  background: inherit;
  content: '';
  transform: translateX(-50%) rotate(45deg);
}

.dashboard-refresh-control:hover .dashboard-refresh-note,
.dashboard-refresh-control:focus-within .dashboard-refresh-note,
.dashboard-refresh-note.is-forced {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

html[data-theme="dark"] .dashboard-refresh-note {
  border-color: rgba(255, 255, 255, .14);
  background: #20242b;
  color: #e5e7eb;
}

html[data-theme="dark"] .dashboard-refresh-note::before {
  border-color: rgba(255, 255, 255, .14);
}

.refresh-loader {
  position: relative;
  z-index: 1;
  width: 200px;
  height: 64px;
  transform: translateY(8px) scale(.98);
  transition: transform 220ms ease;
}

.refresh-loader-overlay.is-visible .refresh-loader {
  transform: translateY(0) scale(1);
}

.refresh-loader__dot {
  position: absolute;
  top: 0;
  left: 15%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e51d2a;
  box-shadow: 0 0 12px rgba(229, 29, 42, .28);
  transform-origin: 50%;
  animation: refresh-dot-bounce .5s alternate infinite ease;
}

.refresh-loader__dot:nth-child(2) {
  left: 45%;
  animation-delay: .2s;
}

.refresh-loader__dot:nth-child(3) {
  right: 15%;
  left: auto;
  animation-delay: .3s;
}

.refresh-loader__shadow {
  position: absolute;
  z-index: -1;
  top: 62px;
  left: 15%;
  width: 20px;
  height: 4px;
  border-radius: 50%;
  background: rgba(139, 14, 24, .34);
  filter: blur(1px);
  transform-origin: 50%;
  animation: refresh-dot-shadow .5s alternate infinite ease;
}

.refresh-loader__shadow:nth-child(5) {
  left: 45%;
  animation-delay: .2s;
}

.refresh-loader__shadow:nth-child(6) {
  right: 15%;
  left: auto;
  animation-delay: .3s;
}

@keyframes refresh-dot-bounce {
  0% {
    top: 60px;
    height: 5px;
    border-radius: 50px 50px 25px 25px;
    transform: scaleX(1.7);
  }

  40% {
    height: 20px;
    border-radius: 50%;
    transform: scaleX(1);
  }

  100% { top: 0; }
}

@keyframes refresh-dot-shadow {
  0% { transform: scaleX(1.5); }

  40% {
    opacity: .7;
    transform: scaleX(1);
  }

  100% {
    opacity: .4;
    transform: scaleX(.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .refresh-loader__dot,
  .refresh-loader__shadow { animation-duration: 1s; }
  .refresh-loader,
  .refresh-loader-overlay,
  .dashboard-refresh-note { transition: none; }
}
