/* Keep Bootstrap in a lower layer so it cannot restyle the shared site shell. */
@import url("bootstrap.min.css") layer(bootstrap);

html:has(.home-rates-page) { height: auto; overflow-x: clip; }
.home-rates-page { height: auto; overflow-x: clip; line-height: normal; }
.home-rates-page .site-footer h2,
.home-rates-page .modal h3 { line-height: normal; }
.home-rates-page .modal h3 { font-weight: 700; }

.home-rates-surface {
  --table-background: #fff;
  --burgundy: #71112e;
  --gold: #e3c378;
  --ink: #2f3030;
  --muted: #73757b;
  --divider: #eeeeef;
  --gutter: clamp(16px, 4vw, 32px);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--page-background);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.rate-board {
  display: grid;
  gap: clamp(18px, 4.2vw, 38px);
  width: calc(100% - var(--gutter) - var(--gutter));
  max-width: 970px;
  margin: 0 auto;
  padding-block: clamp(20px, 4.2vw, 40px);
}

.rounded-table {
  overflow: hidden;
  background: var(--table-background);
  border-radius: clamp(18px, 4vw, 30px);
  box-shadow: 0 3px 5px rgb(48 30 35 / 5%);
}

.rate-board .table {
  width: 100%;
  table-layout: fixed;
  --bs-table-bg: var(--table-background);
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--divider);
}

.summary-table td {
  position: relative;
  height: clamp(78px, 15vw, 112px);
  padding: 12px 4px;
  vertical-align: middle;
  border: 0;
}

.summary-table td + td::before {
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 0;
  width: 1px;
  background: var(--divider);
  content: "";
}

.market-label,
.market-value,
.price,
.price-range {
  display: block;
}

.market-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: clamp(11px, 2.4vw, 18px);
  font-weight: 600;
  letter-spacing: .04em;
}

.market-value {
  font-size: clamp(18px, 3.6vw, 28px);
  font-weight: 700;
  line-height: 1.2;
}

.market-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
  padding-inline: clamp(8px, 2vw, 16px);
  color: var(--ink);
  font-size: clamp(9px, 2.2vw, 12px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.market-high { text-align: left; }
.market-low { text-align: right; }

.product-column { width: 45%; }
.price-column { width: 27.5%; }

.rates-table thead th {
  height: clamp(42px, 7.8vw, 64px);
  padding: 10px 8px;
  border: 0;
  background: var(--burgundy);
  color: var(--gold);
  font-size: clamp(13px, 2.8vw, 20px);
  font-weight: 700;
  letter-spacing: .08em;
  vertical-align: middle;
}

.rates-table th:first-child,
.rates-table td:first-child {
  padding-left: clamp(14px, 4vw, 32px);
  text-align: left;
}

.rates-table th:not(:first-child),
.rates-table td:not(:first-child) {
  text-align: center;
}

.rates-table tbody td {
  height: clamp(68px, 12.8vw, 116px);
  padding: 12px 8px;
  border-bottom-width: 2px;
}

.rates-table tbody tr:last-child td { border-bottom: 0; }

.product-name {
  font-size: clamp(13px, 3vw, 23px);
  font-weight: 700;
  line-height: 1.3;
}

.price,
.market-value {
  font-variant-numeric: tabular-nums;
}

.price {
  font-size: clamp(17px, 3.4vw, 26px);
  font-weight: 700;
  line-height: 1.2;
}

.price-range {
  margin-top: 4px;
  color: var(--muted);
  font-size: clamp(11px, 2.2vw, 17px);
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.price-down { color: #c51d33; }
.price-up { color: #23834b; }

.rate-board .product-name { overflow-wrap: anywhere; }
.rate-board .feed-message {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.rate-board tr[data-rate-code] { cursor: pointer; }
.rate-board tr[data-rate-code]:focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: -2px;
}

/* Compact desktop rate board, scoped to LiveRates.html. */
@media (min-width: 900px) {
  .live-rates-compact .rate-board {
    gap: 16px;
    padding-block: 16px;
  }

  .live-rates-compact .summary-table td {
    height: 70px;
    padding-block: 8px;
  }

  .live-rates-compact .market-label {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .live-rates-compact .market-value { font-size: 20px; }

  .live-rates-compact .rates-table thead th {
    height: 38px;
    padding: 6px 12px;
    font-size: 13px;
  }

  .live-rates-compact .rates-table tbody td {
    height: 54px;
    padding: 6px 12px;
  }

  .live-rates-compact .product-name { font-size: 15px; }
  .live-rates-compact .price { font-size: 18px; }
  .live-rates-compact .price-range {
    margin-top: 2px;
    font-size: 12px;
  }
}

@media (max-width: 359.98px) {
  .rates-table th,
  .rates-table tbody td { padding-inline: 4px; }
  .rates-table th:first-child,
  .rates-table td:first-child { padding-left: 10px; }
  .product-name { font-size: 12px; }
  .price { font-size: 15px; }
}
