/* Automation 08 ROI: three-segment share bar (gold, bone-50, faint remainder), one-line legend,
   opaque mobile dock, full-time-equivalent line, table note. Shared rules come from roi.css.
   Every rule is scoped under #roi. */

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

#roi .roi-sw-c,
#roi .roi-seg-c {
  background: hsl(42 30% 94% / 0.24);
}

/* Empty bar (every input at zero): no segments and no gap ticks */
#roi .roi-bar[data-empty="true"] .roi-gap {
  opacity: 0;
}

#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);
}

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

#roi .ia-roi-note {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ash);
}

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

/* 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 docked total drops its unit so the figure is not clipped */
@media (max-width: 359px) {
  #roi .roi-dock-u {
    display: none;
  }
}
