progressbar {
  // sizing
  &.horizontal {
    > trough {
      min-width: 150px;
      &, > progress { min-height: 8px; }
    }
  }

  &.vertical {
    > trough {
      min-height: 80px;
      &, > progress { min-width: 8px; }
    }
  }

  > text {
    @extend .dim-label;
    @extend .numeric;
    font-size: smaller;
  }

  &:disabled {
    filter: opacity($disabled_opacity);
  }

  > trough {
    @extend %scale_trough;

    > progress {
      @extend %scale_highlight; /* share most of scales' */

      $_progress-radius: 99px;

      border-radius: $_progress-radius;

      &.left {
        border-top-left-radius: $_progress-radius;
        border-bottom-left-radius: $_progress-radius;
      }

      &.right {
        border-top-right-radius: $_progress-radius;
        border-bottom-right-radius: $_progress-radius;
      }

      &.top {
        border-top-right-radius: $_progress-radius;
        border-top-left-radius: $_progress-radius;
      }

      &.bottom {
        border-bottom-right-radius: $_progress-radius;
        border-bottom-left-radius: $_progress-radius;
      }
    }
  }

  &.osd {
    // Thin progress bar with no trough, usually goes under the header bar
    min-width: 2px;
    min-height: 2px;
    background-color: transparent;
    color: inherit;

    > trough {
      border-style: none;
      border-radius: 0;
      background-color: transparent;
      box-shadow: none;

      > progress {
        border-style: none;
        border-radius: 0;
      }

    }

    &.horizontal {
      > trough, > trough > progress { min-height: 2px; }
    }

    &.vertical {
      > trough, > trough > progress { min-width: 2px; }
    }
  }

  > trough.empty > progress { all: unset; } // makes the progress indicator disappear, when the fraction is 0

  .osd & > trough > progress {
    background-color: $osd_fill_bg_color;
  }
}
