/* Automation 12 ROI: three-segment share bar (cost gold, sales bone 50%, margin bone 22%), the pages
   line under the yearly figure, fixed table layout, and the 390px dock. Shared rules come from roi.css.
   Every rule is scoped under #roi. */

/* ---------- Share bar and legend: three segments ---------- */

/* Caption above the bar: says what the three shares are a share of */
#roi .roi-bar-cap {
  margin: 28px 0 0;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--ash);
}

#roi .roi-bar {
  margin-top: 10px;
}

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

#roi .roi-seg-c,
#roi .roi-sw-c {
  background: color-mix(in srgb, var(--bone) 22%, transparent);
}

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

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

@media (max-width: 479px) {
  #roi .roi-legend li {
    white-space: normal;
  }
}

/* ---------- Pages line: under the yearly figure, 15px bone-70 ---------- */

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

/* ---------- Undercuts group: the third slider spans both columns on desktop, so no empty cell ---------- */

@media (min-width: 1280px) {
  #roi .roi-group[aria-labelledby="roi-g-undercuts"] .roi-row[data-roi-row="kept"] {
    grid-column: 1 / -1;
  }
}

/* ---------- Disclaimer: spans the full panel width (roi.css capped it at 62ch) ---------- */

#roi .roi-foot .roi-fine {
  max-width: none;
}

/* ---------- Notes ---------- */

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

/* ---------- Dock ---------- */

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

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

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

@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;
  }
}
