.slider-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 52px;
}

.slider-control-wide {
  grid-template-columns: minmax(0, 1fr);
}

.calculator-field .slider-control input[type="range"] {
  --range-progress: 0%;
  width: 100%;
  min-height: 34px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.calculator-field .slider-control input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: linear-gradient(to right, #628b58 0 var(--range-progress), #dce5d9 var(--range-progress) 100%);
  border: 1px solid #afbdab;
  border-radius: 999px;
}

.calculator-field .slider-control input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -9px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--paper);
  border: 3px solid var(--dark);
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(5, 45, 32, .2);
}

.calculator-field .slider-control input[type="range"]::-moz-range-track {
  height: 8px;
  background: linear-gradient(to right, #628b58 0 var(--range-progress), #dce5d9 var(--range-progress) 100%);
  border: 1px solid #afbdab;
  border-radius: 999px;
}

.calculator-field .slider-control input[type="range"]::-moz-range-thumb {
  width: 19px;
  height: 19px;
  background: var(--paper);
  border: 3px solid var(--dark);
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(5, 45, 32, .2);
}

.calculator-field .slider-control input[type="range"]:focus {
  border-color: transparent;
  outline: 0;
}

.calculator-field .slider-control input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 3px solid #7fa876;
  outline-offset: 4px;
}

.calculator-field .slider-control input[type="range"]:focus-visible::-moz-range-thumb {
  outline: 3px solid #7fa876;
  outline-offset: 4px;
}

.slider-manual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 78px;
  min-height: 42px;
  color: var(--ink);
  background: #edf3e9;
  border: 1px solid #a9bba5;
  border-radius: 6px;
  overflow: hidden;
}

.slider-manual.is-enhanced {
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  min-width: 154px;
  background: #edf3e9;
}

.slider-control .slider-manual {
  width: 154px;
  justify-self: end;
}

.slider-manual-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  border-right: 1px solid #b7c5b3;
  border-left: 1px solid #b7c5b3;
}

.slider-manual-prefix {
  grid-template-columns: auto minmax(0, 1fr);
}

.slider-manual-prefix .slider-manual-value {
  grid-template-columns: auto minmax(0, 1fr);
}

.slider-manual:focus-within {
  border-color: #557f48;
  outline: 3px solid rgba(85, 127, 72, .26);
  outline-offset: 2px;
}

.calculator-field .slider-manual input[type="number"] {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 7px 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

.calculator-field .slider-manual input[type="number"]::-webkit-inner-spin-button,
.calculator-field .slider-manual input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.calculator-field .slider-manual > input:first-child:last-child,
.calculator-field .slider-manual-value > input:first-child:last-child {
  text-align: center;
}

.slider-manual span {
  padding-right: 9px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
}

.slider-manual-prefix span {
  padding: 0 0 0 9px;
}

.slider-control-wide .slider-manual {
  width: 172px;
  min-width: 172px;
}

.stepper-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  min-width: 40px;
  min-height: 42px;
  padding: 0;
  color: var(--dark);
  background: #dce9d8;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.stepper-button:hover {
  color: #fff;
  background: #557f48;
}

.stepper-button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid #557f48;
  outline-offset: -3px;
}

.stepper-button:disabled {
  color: #82917f;
  background: #edf2eb;
  cursor: not-allowed;
  opacity: .65;
}

.team-investment-control {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 4px;
  padding: 18px 20px;
  border: 1px solid #b9c9b4;
  border-radius: 12px;
  background: #f1f5ed;
}

.team-investment-control div {
  display: grid;
  gap: 4px;
}

.team-investment-control strong {
  color: var(--ink);
  font-size: .9rem;
}

.team-investment-control span {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
}

.team-investment-control button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid #0c3b2e;
  border-radius: 999px;
  color: #fff;
  background: #0c3b2e;
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.team-investment-control button:hover {
  color: #0c3b2e;
  background: #d8efc8;
  transform: translateY(-1px);
}

.team-investment-control button:focus-visible {
  outline: 3px solid #86aa79;
  outline-offset: 3px;
}

.team-investment-control button[aria-pressed="true"] {
  color: #0c3b2e;
  background: #d8efc8;
}

.investment-fields {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 4px 0 0;
  padding: 24px 0 0;
  border: 0;
  border-top: 1px solid #c8d2c5;
}

.investment-fields legend {
  padding: 0;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 700;
}

.investment-fields > p {
  max-width: 520px;
  margin: 7px 0 20px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.5;
}

.investment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 18px;
}

.results-card {
  grid-template-rows: auto auto 1fr auto;
}

.calculator-no-investment .results-card {
  grid-template-rows: auto 1fr auto;
}

.results-card.investment-hidden {
  grid-template-rows: auto 1fr auto;
}

.result-item span {
  margin-top: 12px;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
}

.roi-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 3.2vw, 38px);
  border-bottom: 1px solid #496859;
}

.roi-heading .eyebrow {
  margin-bottom: 10px;
  color: #b4d1a8;
}

.roi-heading h3 {
  color: #fff;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  line-height: 1.15;
}

.roi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  border-block: 1px solid #496859;
}

.roi-item {
  min-width: 0;
  padding: 18px 14px 18px 0;
}

.roi-item + .roi-item {
  padding-left: 14px;
  border-left: 1px solid #496859;
}

.roi-item strong {
  display: block;
  color: #d8efc8;
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  line-height: 1.05;
  white-space: nowrap;
}

.roi-item strong.is-negative {
  color: #ffb9a8;
}

.roi-item span {
  display: block;
  margin-top: 8px;
  color: #d2dcd5;
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.4;
}

#roiContext {
  margin: 15px 0 0;
  color: #b8cabd;
  font-size: .7rem;
  line-height: 1.5;
}

.live-calculation {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
}

.live-calculation span {
  width: 9px;
  height: 9px;
  background: #628b58;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(98, 139, 88, .14);
}

.calculator-actions {
  justify-content: space-between;
}

@media (max-width: 560px) {
  .slider-control,
  .slider-control-wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .slider-control-wide .slider-manual {
    width: 172px;
    min-width: 172px;
  }

  .calculator-actions {
    align-items: flex-start;
  }

  .team-investment-control {
    align-items: stretch;
    flex-direction: column;
  }

  .team-investment-control button {
    width: 100%;
  }

  .investment-grid,
  .roi-grid {
    grid-template-columns: 1fr;
  }

  .roi-item + .roi-item {
    padding-left: 0;
    border-top: 1px solid #496859;
    border-left: 0;
  }

  .roi-item strong {
    font-size: 1.7rem;
  }

  .result-item span {
    font-size: .86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calculator-field .slider-control input[type="range"] {
    scroll-behavior: auto;
  }
}
