.plot-loader {
  display: flex;
  width: 100%;
  min-height: 250px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  text-align: center;
}

.plot-loader--compact {
  min-height: 180px;
}

.plot-loader__icon {
  width: 100px;
  height: 100px;
  overflow: visible;
}

.plot-loader--compact .plot-loader__icon {
  width: 80px;
  height: 80px;
}

.plot-loader__contour {
  fill: none;
  stroke: rgb(var(--bs-primary-rgb));
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 275;
  stroke-dashoffset: 275;
  animation: plot-loader-draw 3.2s ease-in-out infinite;
}

.plot-loader__contour:nth-child(2) {
  stroke: color-mix(in srgb, rgb(var(--bs-primary-rgb)) 45%, var(--bs-body-bg));
  stroke-width: 2.5;
  animation-delay: 0.22s;
}

.plot-loader__contour:nth-child(3) {
  stroke-width: 2;
  animation-delay: 0.44s;
}

.plot-loader__center {
  fill: rgb(var(--bs-primary-rgb));
  transform-origin: 50px 50px;
  animation: plot-loader-beat 3.2s ease-in-out infinite;
}

.plot-loader__status {
  font-size: 0.875rem;
  font-weight: 500;
}

.plot-loader__hint {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}

@keyframes plot-loader-draw {
  0% { stroke-dashoffset: 275; opacity: 0.35; }
  45%, 65% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -275; opacity: 0.35; }
}

@keyframes plot-loader-beat {
  0%, 35%, 100% { transform: scale(0.75); opacity: 0.55; }
  55% { transform: scale(1.2); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .plot-loader__contour,
  .plot-loader__center {
    animation: none;
  }

  .plot-loader__contour {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}
