@scope (.progress-indicator) {
  :scope {
    --_track-width: 5rem;
    --_track-height: var(--space-sm);
    --_track: var(--color-surface-muted);
    --_fill: var(--color-primary);
    --_text: var(--color-text);
    --_radius: var(--radius-full);
    --percentage: 0%;

    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
  }

  :scope.progress-indicator--sm {
    --_track-width: 3.5rem;
    --_track-height: var(--space-xs);
  }

  :scope.progress-indicator--lg {
    --_track-width: 7rem;
  }

  :scope.progress-indicator--complete {
    --_fill: var(--color-success);
  }

  .track {
    width: var(--_track-width);
    height: var(--_track-height);
    flex-shrink: 0;
    border-radius: var(--_radius);
    background: var(--_track);
    box-shadow: inset 0 0 0 1px var(--color-border-muted);
    overflow: hidden;
  }

  .fill {
    height: 100%;
    width: var(--percentage);
    max-width: 100%;
    background: var(--_fill);
    border-radius: inherit;
    transform-origin: inline-start center;

    @media (prefers-reduced-motion: no-preference) {
      animation: progress-indicator-fill 0.7s ease-out both;
    }
  }

  .value {
    min-width: 4ch;
    font-size: var(--text-caption);
    font-weight: var(--font-bold);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--_text);
    text-align: end;
    line-height: 1;
  }

  :scope.progress-indicator--lg .value {
    font-size: var(--text-body-sm);
  }
}

@keyframes progress-indicator-fill {
  from {
    scale: 0 1;
  }

  to {
    scale: 1 1;
  }
}
