/* "Estimate ROI": assumptions on the left, the illustrative estimate on the right (stacked on narrow screens). */
.roi__head p {
  margin-top: 16px;
  font-size: 17px;
}

.roi__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 0;
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface);
  overflow: clip;
}

.roi__inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 18px;
  min-width: 0;
  margin: 0;
  padding: clamp(24px, 3.4vw, 44px);
  border: 0;
}

.roi__inputs legend {
  float: left;
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: var(--dw);
}

.roi__field {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
}

.roi__hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.roi__val {
  margin-left: auto;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.roi__field input[type="number"],
.roi__field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 400;
}

.roi__field input[type="number"]::placeholder {
  color: var(--muted);
}

.roi__field input[type="range"] {
  width: 100%;
  min-height: 32px;
  margin: 0;
  accent-color: var(--accent);
}

.roi__out {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(24px, 3.4vw, 44px);
  border-left: 1px solid var(--line);
  background: var(--sunken);
}

.roi__out-h {
  color: var(--accent);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
}

.roi__hours {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 10px 0 0;
}

.roi__hours [data-roi-out] {
  font-family: var(--display);
  font-size: clamp(44px, 5.4vw, 76px);
  font-weight: var(--dw);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
}

.roi__hours > span:last-child {
  font-size: 18px;
}

.roi__people {
  margin: 10px 0 0;
}

/* one dot per working year (or per 10, 100…), so the hours read as people */
.roi__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 10px;
  margin-top: 16px;
}

.roi__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.roi__dots-key {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.roi__bars {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.roi__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  font-size: 14px;
}

.roi__bar-label {
  grid-column: 1 / -1;
  color: var(--ink2);
}

.roi__track {
  height: 12px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.roi__fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.roi__bar [data-roi-out] {
  min-width: 7ch;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.roi__bar[data-bar="potential"] .roi__fill {
  background: var(--accent-line);
}

.roi__bar[data-bar="realizable"] .roi__fill {
  background: var(--accent);
}

.roi__bar[data-bar="cost"] .roi__fill {
  background: var(--navy);
}

.roi__totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0 0;
}

.roi__totals > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.roi__totals dt {
  color: var(--ink2);
  font-size: 13px;
}

.roi__totals dd {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}

.roi__prompt {
  margin: 24px 0 0;
  padding: 14px 16px;
  border: 1px dashed var(--accent-line);
  border-radius: 16px;
  color: var(--ink2);
  font-size: 14px;
}

.roi__note {
  margin: auto 0 0;
  padding-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.roi__note b {
  color: var(--ink2);
  font-weight: 600;
}

.roi__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 899.98px) {
  .roi__card {
    grid-template-columns: minmax(0, 1fr);
  }

  .roi__out {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .roi__fill {
    transition: clip-path 0.25s var(--ease-out);
  }
}

.roi__totals[hidden],
.roi__prompt[hidden] {
  display: none;
}

/* the totals fade up when a cost first makes them appear */
@media (prefers-reduced-motion: no-preference) {
  .roi__totals {
    transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
  }

  @starting-style {
    .roi__totals {
      opacity: 0;
      transform: translateY(4px);
    }
  }
}
