/* ====== IRA MATRIX (clean minimal build) ====== */

/* Theme tokens */
.ira-matrix {
  --border: #e5e7eb;
  --panel: #ffffff;
  --panel2: #f7f7fb;
  --text: #111827;
  --muted: #6b7280;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

/* Grid: feature column + N value columns (default 5) */
.ira-matrix__grid {
  display: grid;
  grid-template-columns: 240px repeat(var(--cols, 5), 1fr);
  background: var(--panel);
}

/* Header cells */
.ira-matrix__featureHead {
  padding: 74px 16px 20px;
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
  visibility: hidden; /* keep layout, hide text */
}
.ira-matrix__colHead {
  position: relative;
  padding: 66px 16px 18px;
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-weight: 700;
  overflow: visible;
}
.ira-matrix__colHead .tab {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  padding: 10px 14px 14px;
  border-radius: 10px 10px 16px 16px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
  z-index: 1;
  max-width: 95%;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Body cells */
.ira-matrix__cell {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}
.ira-matrix__label { background: #fafafa; font-weight: 600; }

/* Footnote */
.ira-matrix__foot {
  grid-column: 1 / -1;
  padding: 10px 16px;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  font-size: 0.65rem;
  line-height: 1.2;
  text-align: center;
  background: #fff;
}

/* State “icons” */
.state { display: flex; justify-content: center; align-items: center; min-height: 28px; }
.state.yes { color: var(--yes, #16a34a); }
.state.no  { color: var(--no,  #7e22ce); }
.state.depends { color: var(--muted); font-weight: 600; }
.state.text { color: #111827; }

/* ---------- MOBILE (keep all columns, enable horizontal scroll) ---------- */
@media (max-width: 860px) {
  /* Let the outer container scroll sideways */
  .ira-matrix {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* Make the grid as wide as its contents so it can overflow and scroll */
  .ira-matrix__grid {
    display: grid !important;
    /* Give fixed minimums to keep 6 columns readable on small screens */
    grid-template-columns:
      240px                                /* Feature */
      repeat(var(--cols, 5), minmax(140px, 1fr)) !important;
    width: max-content;                    /* allow overflow width */
    gap: 0.75rem;
  }

  /* Reduce header vertical space and remove the absolute chip overlay */
  .ira-matrix__featureHead { padding: 12px !important; }
  .ira-matrix__colHead     { padding: 12px !important; }
  .ira-matrix__colHead .tab {
    position: static;                      /* stop overlapping the grid */
    transform: none;
    margin: 0 0 4px 0;
    display: inline-block;
  }

  /* If any tab/segment UI exists separately, hide it on mobile */
  .ira-matrix [role="tablist"],
  .ira-matrix .tabs,
  .ira-matrix .segmented,
  .ira-matrix .switcher { display: none !important; }
}

/* Stack matrix + CTAs and center CTAs (desktop and mobile) */
#quick-compare .pad { display:block; }
#quick-compare .cta {
  display:flex; justify-content:center; gap:12px; margin-top:12px; width:100%;
}

/* Keep CTAs under the matrix in this card */
#quick-compare .pad { display:block; }
#quick-compare .cta {
  display:flex; justify-content:center; gap:12px; margin-top:12px; width:100%;
}
