.mb-table-wrap {
  max-height: 480px;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.mb-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 11px;
}

.mb-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  color: var(--text-2);
  letter-spacing: 0.04em;
  font-weight: 500;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border); /* keeps a clean edge even on scroll */
}

.mb-table:not(.endemic-table) td.name {
  max-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mb-table td.class    { width: 180px}
.mb-table thead th.num,
.mb-table th.num,
.mb-table td.num {
  white-space: nowrap;
  min-width: 78px; /* enough for "2.56e-23" without wrapping */
}
.mb-table td.vip {
  white-space: nowrap;
  width: 30px;
}

.mb-table td.link {
  width: 28px;
  text-align: center;
  padding: 0;
}

.mb-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--text-3);
  text-decoration: none;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s;
}

.mb-link-icon:hover {
  color: var(--accent);
  background: var(--accent-bg);
}

.mb-link-icon i {
  font-size: 12px;
}

.mb-table tbody td {
  padding: 5px 12px;
  border-bottom: 1px solid var(--border-lt);
  color: var(--text);
}

.mb-table tbody tr:hover {
  background: var(--accent-bg);
}

.mb-table tbody tr.selected {
  background: var(--accent-lt);
}

/* magnitude bar, e.g. VIP / eta-squared */
.mb-bar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mb-bar-track {
  flex: 1;
  height: 5px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.mb-bar-fill {
  height: 100%;
  background: var(--accent-lt);
  border-radius: 3px;
}

/* count badge, e.g. "1277" or per-matrix tab counts */
.mb-count-badge {
  display: inline-block;
  padding: 1px 7px;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  border-radius: 999px;
}

.mb-table td.idx,
.mb-table th.idx {
  width: 32px;
  text-align: right;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
}