/* Automation 09 ROI: gold, bone-50 and bone-22 bar segments, one-line legend, opaque mobile dock,
   full-time-equivalent line, fixed table layout. Every rule is scoped under #roi. Shared rules come from roi.css. */

#roi {
  --ip-bone-22: hsl(42 30% 94% / 0.22);
}

#roi .roi-seg-b,
#roi .roi-sw-b {
  background: var(--bone-50);
}

#roi .roi-seg-c,
#roi .roi-sw-c {
  background: var(--ip-bone-22);
}

#roi .roi-legend {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

#roi .roi-legend li {
  white-space: nowrap;
}

#roi .roi-dock {
  background: var(--ink);
}

/* The disclaimer runs the full width of the form column, so it takes fewer lines and sits closer
   to the groups above it */
#roi .roi-foot .roi-fine {
  max-width: none;
}

#roi .ip-roi-fte {
  margin: 12px 0 0;
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--bone-70);
}

/* ---------- Table: fixed layout, so the numbers never move sideways when a slider changes ---------- */

#roi .roi-table {
  table-layout: fixed;
}

#roi .roi-table thead th.roi-num,
#roi .roi-table td.roi-num {
  width: 22%;
  font-variant-numeric: tabular-nums;
}

#roi .roi-table td.roi-num {
  text-align: right;
}

/* Every "how" line reserves two lines, so the total row keeps its place when a sentence wraps */
#roi .roi-how {
  min-height: 3em;
}

/* ---------- 359px and narrower: the CTA may wrap; the yearly figure stays inside its card ---------- */

@media (max-width: 359px) {
  #roi .roi-cta .btn {
    white-space: normal;
    max-width: 100%;
    height: auto;
    padding-block: 0.75rem;
    text-align: center;
  }

  #roi .roi-year {
    font-size: 1.25rem;
    overflow-wrap: anywhere;
  }

  #roi .roi-big-n {
    font-size: 2.5rem;
    overflow-wrap: anywhere;
  }

  /* The docked total drops its unit so the figure is not clipped */
  #roi .roi-dock-u {
    display: none;
  }
}

/* Phones: the two numeric columns need room for "~1,530 hours" and the yearly header */
@media (max-width: 479px) {
  #roi .roi-table thead th.roi-num,
  #roi .roi-table td.roi-num {
    width: 30%;
    white-space: normal;
  }

  #roi .roi-table td.roi-num small {
    display: block;
    margin-left: 0;
  }
}
