:root {
  --color-green-darker: #002e33;
  --color-green-dark: #036351;
  --color-green-medium: #39b388;
  --color-green-light: #7df8c2;
  --color-green-lighter: #e5f2e3;
  --color-orange-darker: #330900;
  --color-orange-dark: #632303;
  --color-orange-medium: #784216;
  --color-orange-light: #f1571c;
  --color-orange-lighter: #f7a77e;
  --canvas-bg: #fff;
  --canvas-text: #28363c;
  --bar-height: 6em;
  --bar-half: calc(var(--bar-height) / 2);
  --bar-third: calc(var(--bar-height) / 3);
  --bar-quarter: calc(var(--bar-height) / 4);
  --bar-tenth: calc(var(--bar-height) / 10);
  --bar-text-left: 4em;
  --bar-text-right: 6em;
}

.barchart {
  position: relative;
}

.bar__wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.bar {
  height: var(--bar-height);
  position: relative;
}

  .bar::before,
  .bar::after {
    clip-path: polygon(0 0, calc(100% - var(--bar-quarter)) 0, 100% var(--bar-half), calc(100% - var(--bar-quarter)) 100%, 0 100%);
    content: '';
    height: var(--bar-height);
    left: 0;
    position: absolute;
  }

  .bar::before {
    right: 0;
  }

  .bar::after {
    right: var(--bar-tenth);
  }

.bar--subsidy {
  animation: growBarSubsidy 1500ms ease-out forwards;
  width: var(--subsidy-bar-length);
}

  .bar--subsidy::before {
    background: var(--color-green-light);
  }

  .bar--subsidy::after {
    background: linear-gradient(290deg, var(--color-green-dark) var(--bar-height), var(--color-green-light) calc(3 * var(--bar-height)));
    border: 1px solid var(--color-green-medium);
  }

.bar--regular {
  animation: growBarRegular 1500ms ease-out forwards;
  width: var(--regular-bar-length);
}

  .bar--regular::before {
    background: var(--color-orange-light);
  }

  .bar--regular::after {
    background: linear-gradient(290deg, var(--color-orange-dark) var(--bar-height), var(--color-orange-light) calc(3 * var(--bar-height)));
    border: 1px solid var(--color-orange-medium);
  }

.bar__text {
  display: flex;
  flex-direction: column;
  height: var(--bar-height);
  justify-content: center;
  position: absolute;
  z-index: 1;
  max-width: calc(var(--bar-text-left) + var(--bar-text-right));
}

.bar--subsidy .bar__text {
  left: max(10px, calc(100% - var(--bar-text-left) - var(--bar-text-right) - 60px));
}

.bar--regular .bar__text {
  left: max(10px, calc(100% - var(--bar-text-left) - var(--bar-text-right) - 60px));
}

.bar__paragraph {
  align-items: center;
  color: #fff;
  display: flex;
  line-height: 1.2;
  gap: 10px;
  justify-content: space-between;
  margin: 0;
  text-shadow: 1px 1px 1px hsl(0 0% 0% / 0.4), 0 0 5px hsl(0 0% 0% / 0.3);
}

.bar--targetless .bar__paragraph {
  color: #222;
  text-shadow: none;
}

.bar__label {
  flex: 1 0 var(--bar-text-left);
}

.bar__time,
.bar__currency {
  flex: 1 0 var(--bar-text-right);
}

.bar__time {
  text-align: right;
}

.bar__currency {
  text-align: right;
}

.bar--targetless .bar__currency {
    text-align: right;
}

.bar__percentage {
  font-weight: 600;
  font-size: 16px;
  padding: 0 0.5em;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(200%, 70%);
  max-width: 4em;
}

.bar--subsidy .bar__percentage {
  color: var(--color-green-dark);
}

.bar--regular .bar__percentage {
  color: var(--color-orange-dark);
}

.marker__wrapper {
  position: initial;
}

.marker {
  bottom: 0;
  display: block;
  left: 0;
  position: absolute;
  top: 0;
}

.marker__arrow {
  clip-path: polygon(0 0, calc(100% - var(--bar-quarter)) 0, 100% var(--bar-half), calc(100% - var(--bar-quarter)) 100%, 0 100%);
  content: '';
  height: var(--bar-height);
  left: 0;
  position: absolute;
  right: 0;
}

.marker--subsidy {
  border-right: 2px solid var(--color-green-medium);
  right: calc(100% - var(--bar-max-percentage) * var(--subsidy-bar-max));
}

  .marker--subsidy .marker__arrow {
    background: var(--color-green-lighter);
    background: linear-gradient(100deg, var(--color-green-dark) 0, var(--color-green-lighter) calc(3 * var(--bar-height)));
    opacity: 0.5;
  }

.marker--regular {
  border-right: 2px solid var(--color-orange-medium);
  right: calc(100% - var(--bar-max-percentage) * var(--regular-bar-max));
}

  .marker--regular .marker__arrow {
    background: var(--color-orange-lighter);
    background: linear-gradient(100deg, var(--color-orange-dark) 0, var(--color-orange-lighter) calc(3 * var(--bar-height)));
    bottom: 0;
    opacity: 0.2;
  }

.marker__text {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  padding: 0 0.5em;
  position: absolute;
  right: 0;
}

.marker--subsidy .marker__text {
  color: var(--color-green-dark);
  transform: translate(100%, 0);
  top: 0;
}

.marker--regular .marker__text {
  color: var(--color-orange-medium);
  text-align: right;
  transform: translate(0, -100%);
  top: 50%;
}

@keyframes growBarSubsidy {
  from {
    width: 0;
  }
  30% {
    width: 0;
  }
  to {
    width: var(--subsidy-bar-length);
  }
}

@keyframes growBarRegular {
  from {
      width: 0;
  }
  30% {
    width: 0;
  }
  to {
    width: var(--regular-bar-length);
  }
}

/* Oude revenue bar css */
.revenue {
  --revenue-full: hsl(169 93% 36%);
  --revenue-gradient-1: hsl(162 82% 62%);
  --revenue-gradient-2: hsl(158 76% 82%);
  --revenue-gradient-3: hsl(154 62% 93%);
  --revenue-light: hsl(154 90% 73%);
  --revenue-transparent: hsl(169 93% 36% / 0.2);
  display: flex;
  font-size: 24px;
}

.revenue__start {
  background: var(--revenue-light);
  border: 50px solid transparent;
  border-right: 0 solid transparent;
  border-left: 10px solid white;
  flex: 0 0 10px;
  height: 0;
  width: 0;
}

.revenue__result {
  background: var(--rz-primary);
  background: linear-gradient(to right, var(--revenue-light), var(--revenue-full));
  color: #fff;
  flex: 1 1 auto;
  line-height: 100px;
  padding-right: 0.5em;
  text-align: right;
  transition: flex 600ms ease-out;
}

.revenue__arrows {
  width: 90px;
  position: relative;
}

.revenue__arrow {
  display: inline;
  height: 100px;
  width: 30px;
  position: absolute;
  border: 50px solid transparent;
  border-right: 0 solid transparent;
}

  .revenue__arrow:nth-child(1) {
    border-left: 30px solid var(--revenue-full);
    background: var(--revenue-gradient-1);
    left: 0;
  }

  .revenue__arrow:nth-child(2) {
    border-left: 30px solid var(--revenue-gradient-1);
    background: var(--revenue-gradient-2);
    left: 30px;
  }

  .revenue__arrow:nth-child(3) {
    border-left: 30px solid var(--revenue-gradient-2);
    background: var(--revenue-gradient-3);
    left: 60px;
  }

.revenue__gap {
  background: var(--revenue-gradient-3);
  flex: 0 0 25%;
  transition: flex 600ms ease-out;
}

.revenue__end {
  border: 50px solid transparent;
  border-left: 40px solid var(--revenue-gradient-3);
  border-right: 1px solid transparent;
  flex: 0 0 40px;
  height: 0;
  width: 0;
}