.calc {
  position: relative;
  height: calc(402.2 * var(--u));
  padding: calc(39.8 * var(--u)) 0 0 var(--gutter);
  overflow: clip;
}

.calc__pattern {
  position: absolute;
  top: calc(-0.4 * var(--u));
  right: calc(4.1 * var(--u));
  width: calc(938.6 * var(--u));
  height: calc(561.2 * var(--u));
  pointer-events: none;
}

.calc__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.calc__panel {
  position: relative;
  z-index: 1;
}

.calc__eyebrow {
  font-size: calc(16.7 * var(--u));
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--c-teal);
}

.calc__title {
  margin-top: calc(14.8 * var(--u));
  font-size: calc(27.9 * var(--u));
  line-height: calc(34.3 * var(--u));
  letter-spacing: 0;
}

.calc__amount {
  display: grid;
  grid-template-columns: calc(206.7 * var(--u)) auto;
  align-items: start;
  margin-top: calc(16.6 * var(--u));
  margin-left: calc(1 * var(--u));
  font-weight: 600;
  line-height: 1;
}

.calc__amount-label {
  font-size: calc(17.9 * var(--u));
  padding-top: calc(2 * var(--u));
  color: #808080;
}

.calc__amount-value {
  display: none;
  margin-top: calc(-2 * var(--u));
  font-size: calc(31.8 * var(--u));
  color: var(--c-teal);
  white-space: nowrap;
}

.calc__slider {
  position: relative;
  width: calc(546.3 * var(--u));
  height: calc(96.9 * var(--u));
  margin-top: calc(53.6 * var(--u));
  margin-left: calc(1.7 * var(--u));
}

.calc__track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(8.9 * var(--u));
  border-radius: calc(4.45 * var(--u));
  background: #cccccc;
}

.calc__zone {
  position: absolute;
  top: calc(-13.1 * var(--u));
  height: calc(34.2 * var(--u));
  cursor: pointer;
}

.calc__zone--1 { left: -3%;     width: 27%; }
.calc__zone--2 { left: 24%;     width: 28.9%; }
.calc__zone--3 { left: 52.9%;   width: 28.4%; }
.calc__zone--4 { left: 81.3%;   width: 21.7%; }

.calc__thumb {
  position: absolute;
  pointer-events: none;
  top: calc(-13.1 * var(--u));
  left: var(--pos, 38.83%);
  width: calc(34.2 * var(--u));
  height: calc(34.2 * var(--u));
  margin-left: calc(-17.1 * var(--u));
  border-radius: 50%;
  background: var(--c-green);
  transition: left 0.3s ease;
}

.calc__tick {
  position: absolute;
  top: calc(53.1 * var(--u));
  left: var(--at);
  font-size: calc(17.9 * var(--u));
  font-weight: 600;
  line-height: calc(21.9 * var(--u));
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transform: translateX(-50%);
}

.calc__tick--1 {
  --at: 9.31%;
  color: #808080;
}
.calc__tick--2 {
  --at: 38.65%;
  color: var(--c-green);
}
.calc__tick--3 {
  --at: 67.06%;
  color: var(--c-teal);
}
.calc__tick--4 {
  --at: 95.59%;
  color: var(--c-blue);
}

.calc__result {
  position: absolute;
  top: calc(43 * var(--u));
  right: calc(56.7 * var(--u));
  z-index: 1;
  width: calc(701.1 * var(--u));
  height: calc(326 * var(--u));
  padding-top: calc(48.3 * var(--u));
  background: #f7f7f7;
  border-radius: calc(8 * var(--u));
}

.calc__mark {
  position: absolute;
  top: calc(11 * var(--u));
  left: calc(425.8 * var(--u));
  width: calc(263 * var(--u));
  height: calc(304 * var(--u));
  fill: #d9dada;
}

.calc__result-title {
  position: relative;
  margin-left: calc(45.4 * var(--u));
  font-size: calc(18.5 * var(--u));
  font-weight: 600;
  line-height: 1;
}

.calc__years {
  position: relative;
  display: none;
  margin-top: calc(24 * var(--u));
  margin-left: calc(44.8 * var(--u));
  font-size: calc(96.5 * var(--u));
  font-weight: 600;
  line-height: 1;
  color: var(--c-teal);
  white-space: nowrap;
}

.calc__years span {
  font-size: calc(49.5 * var(--u));
}

.calc__result-text {
  position: relative;
  margin-top: calc(37.35 * var(--u));
  margin-left: calc(41 * var(--u));
  font-size: calc(18.5 * var(--u));
  font-weight: 600;
  line-height: calc(22.6 * var(--u));
  white-space: nowrap;
}

#inv-1:checked ~ .calc__panel .calc__amount-value--1,
#inv-2:checked ~ .calc__panel .calc__amount-value--2,
#inv-3:checked ~ .calc__panel .calc__amount-value--3,
#inv-4:checked ~ .calc__panel .calc__amount-value--4 {
  display: block;
}

#inv-1:checked ~ .calc__result .calc__years--1,
#inv-2:checked ~ .calc__result .calc__years--2,
#inv-3:checked ~ .calc__result .calc__years--3,
#inv-4:checked ~ .calc__result .calc__years--4 {
  display: block;
}

#inv-1:checked ~ .calc__panel .calc__thumb {
  --pos: 9.31%;
}
#inv-2:checked ~ .calc__panel .calc__thumb {
  --pos: 38.83%;
}
#inv-3:checked ~ .calc__panel .calc__thumb {
  --pos: 67.06%;
}
#inv-4:checked ~ .calc__panel .calc__thumb {
  --pos: 95.59%;
}

#inv-1:focus-visible ~ .calc__panel .calc__tick--1,
#inv-2:focus-visible ~ .calc__panel .calc__tick--2,
#inv-3:focus-visible ~ .calc__panel .calc__tick--3,
#inv-4:focus-visible ~ .calc__panel .calc__tick--4 {
  outline: 2px solid var(--c-blue);
  outline-offset: 4px;
  border-radius: 2px;
}

@media (max-width: 900px) {
  .calc {
    height: auto;
    padding: 0 var(--gutter) var(--section-y);
  }

  .calc__pattern {
    display: none;
  }

  .calc__eyebrow {
    font-size: 15px;
  }

  .calc__title {
    margin-top: var(--sp-4);
    font-size: 24px;
    line-height: 1.25;
  }

  .calc__amount {
    grid-template-columns: auto;
    gap: var(--sp-2);
    margin: var(--sp-5) 0 0;
  }

  .calc__amount-label {
    font-size: 15px;
  }

  .calc__amount-value {
    font-size: 28px;
  }

  .calc__slider {
    width: auto;
    height: 84px;
    margin: var(--sp-6) var(--sp-5) 0;
  }

  .calc__track {
    height: 8px;
    border-radius: 4px;
  }

  .calc__zone {
    top: -12px;
    height: 32px;
  }

  .calc__thumb {
    top: -12px;
    width: 32px;
    height: 32px;
    margin-left: -16px;
  }

  .calc__tick {
    top: 40px;
    font-size: 12.5px;
    line-height: 1.4;
  }

  .calc__result {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    height: auto;
    margin-top: var(--sp-5);
    padding: var(--sp-6) var(--sp-5);
    overflow: hidden;
    border-radius: var(--radius);
  }

  .calc__mark {
    top: 50%;
    left: auto;
    right: -20px;
    width: 150px;
    height: 174px;
    transform: translateY(-50%);
  }

  .calc__result-title,
  .calc__years,
  .calc__result-text {
    margin-left: 0;
  }

  .calc__result-title {
    font-size: 15px;
  }

  .calc__years {
    margin-top: var(--sp-4);
    font-size: 64px;
  }

  .calc__years span {
    font-size: 32px;
  }

  .calc__result-text {
    margin-top: var(--sp-4);
    font-size: 15px;
    line-height: 1.5;
    white-space: normal;
  }
}
