/* Automation 11 ROI: the second line under the yearly figure, the note under the table, the opaque
   mobile dock, a no-wrap legend and a fixed table layout. Every rule is scoped under #roi.
   The shared calculator rules (sliders, bar, table, dock) come from roi.css. */

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

#roi .so-roi-note {
  margin: 16px 0 0;
  line-height: 1.5;
}

#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 fine print spans both columns under the calculator (visual-09): the form and the results sit
   side by side in row 1 and the foot takes row 2 on desktop. Phones keep the DOM order. */
@media (min-width: 1024px) {
  #roi .roi-inputs {
    grid-column: 1;
    grid-row: 1;
  }

  #roi .roi-results-col {
    grid-column: 2;
    grid-row: 1;
  }

  #roi .roi-foot {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0;
    background: var(--roi-ink);
    border-top: 1px solid var(--line);
  }

  #roi .roi-group:nth-of-type(3) {
    padding-bottom: 12px;
  }
}

/* ---------- 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;
}

/* Phones: the two numeric columns need room for "~1,440 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;
  }
}

/* ---------- 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;
  }
}
