/* Tables inside cards — scoped styles (not shared table block CSS) */

.cards > ul > li:has(.cards-card-table) {
  grid-column: 1 / -1;
  border: none;
  background-color: transparent;
}

.cards .cards-card-body:has(.cards-card-table) {
  margin: 0;
  padding: 0;
  overflow-x: auto;
}

.cards .cards-card-table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
  background-color: var(--color-white, #fff);
  border: none;
  border-radius: 12px;
  overflow: hidden;
}

.cards .cards-card-table th,
.cards .cards-card-table td {
  border: 1px solid #e0e0e0;
  padding: 17px 16px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  color: #333;
  text-align: left;
  vertical-align: middle;
  background-color: var(--color-white, #fff);
}

.cards .cards-card-table th *,
.cards .cards-card-table td * {
  color: inherit;
}

/* Header row — peach first col, maroon gradient on rest (thead or richtext td row) */
.cards .cards-card-table thead th,
.cards .cards-card-table tr.cards-card-table__header-row > th,
.cards .cards-card-table tr.cards-card-table__header-row > td {
  font-family: var(--body-font-family-semibold, inherit);
  font-weight: 600;
}

.cards .cards-card-table thead th:first-child,
.cards .cards-card-table tr.cards-card-table__header-row > th:first-child,
.cards .cards-card-table tr.cards-card-table__header-row > td:first-child {
  background-color: rgba(254, 242, 237, 1);
  color: #111;
  border-top-left-radius: 12px;
}

.cards .cards-card-table thead th:first-child :is(p, span, strong, b, em),
.cards .cards-card-table tr.cards-card-table__header-row > :is(th, td):first-child :is(p, span, strong, b, em) {
  color: #111;
}

.cards .cards-card-table thead th:not(:first-child),
.cards .cards-card-table tr.cards-card-table__header-row > th:not(:first-child),
.cards .cards-card-table tr.cards-card-table__header-row > td:not(:first-child) {
  background: linear-gradient(24.77deg, #4e0004 14.08%, #8e0006 67.23%);
  color: #fff;
}

.cards .cards-card-table thead th:not(:first-child) :is(p, span, strong, b, em),
.cards .cards-card-table tr.cards-card-table__header-row > :is(th, td):not(:first-child) :is(p, span, strong, b, em) {
  color: #fff;
}

.cards .cards-card-table thead th:last-child,
.cards .cards-card-table tr.cards-card-table__header-row > th:last-child,
.cards .cards-card-table tr.cards-card-table__header-row > td:last-child {
  border-top-right-radius: 12px;
}

/* Body rows */
.cards .cards-card-table tbody tr:not(.cards-card-table__header-row) > td:first-child,
.cards .cards-card-table tbody tr:not(.cards-card-table__header-row) > td:first-child :is(p, span, strong, b, em) {
  color: #97291e;
  font-family: var(--body-font-family-semibold, inherit);
  font-weight: 600;
}

.cards .cards-card-table tbody tr:not(.cards-card-table__header-row) > td:nth-child(2) {
  color: #111;
}

/* Extra space for column 1 (tenor) and column 2 (rate) */
.cards .cards-card-table:has(thead th:nth-child(3)) :is(th, td):first-child,
.cards .cards-card-table:has(tr.cards-card-table__header-row > td:nth-child(3)) :is(th, td):first-child {
  min-width: 160px;
  padding-left: 24px;
  padding-right: 24px;
}

.cards .cards-card-table:has(thead th:nth-child(3)) :is(th, td):nth-child(2),
.cards .cards-card-table:has(tr.cards-card-table__header-row > td:nth-child(3)) :is(th, td):nth-child(2) {
  min-width: 140px;
  padding-left: 24px;
  padding-right: 24px;
}

/* 4+ column tables — center narrow cols */
.cards .cards-card-table:has(thead th:nth-child(3)) thead th:first-child,
.cards .cards-card-table:has(thead th:nth-child(3)) thead th:nth-child(2),
.cards .cards-card-table:has(tr.cards-card-table__header-row > td:nth-child(3)) tr.cards-card-table__header-row > th:first-child,
.cards .cards-card-table:has(tr.cards-card-table__header-row > td:nth-child(3)) tr.cards-card-table__header-row > th:nth-child(2),
.cards .cards-card-table:has(tr.cards-card-table__header-row > td:nth-child(3)) tr.cards-card-table__header-row > td:first-child,
.cards .cards-card-table:has(tr.cards-card-table__header-row > td:nth-child(3)) tr.cards-card-table__header-row > td:nth-child(2) {
  text-align: center;
}

.cards .cards-card-table:has(thead th:nth-child(3)) tbody tr:not(.cards-card-table__header-row) > td:first-child,
.cards .cards-card-table:has(thead th:nth-child(3)) tbody tr:not(.cards-card-table__header-row) > td:nth-child(2),
.cards .cards-card-table:has(tr.cards-card-table__header-row > td:nth-child(3)) tbody tr:not(.cards-card-table__header-row) > td:first-child,
.cards .cards-card-table:has(tr.cards-card-table__header-row > td:nth-child(3)) tbody tr:not(.cards-card-table__header-row) > td:nth-child(2) {
  text-align: center;
}

.cards .cards-card-table td p,
.cards .cards-card-table th p {
  margin: 0;
}

.cards .cards-card-table ul {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
  text-align: left;
}

.cards .cards-card-table ul li {
  margin: 8px 0;
}

@media (max-width: 767px) {
  .cards .cards-card-table th,
  .cards .cards-card-table td {
    padding: 12px;
    font-size: 14px;
  }

  .cards .cards-card-table:has(thead th:nth-child(3)) :is(th, td):first-child,
  .cards .cards-card-table:has(tr.cards-card-table__header-row > td:nth-child(3)) :is(th, td):first-child {
    min-width: 120px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .cards .cards-card-table:has(thead th:nth-child(3)) :is(th, td):nth-child(2),
  .cards .cards-card-table:has(tr.cards-card-table__header-row > td:nth-child(3)) :is(th, td):nth-child(2) {
    min-width: 100px;
    padding-left: 16px;
    padding-right: 16px;
  }
}
