.bfo-rates {
  font-size: 16px;
  width: 100%;
}

.bfo-rates__board {
  animation: bfo-rates-rise 0.55s 0.08s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  background: var(--bfo-rates-paper);
  border: 1px solid var(--bfo-rates-line);
  border-radius: var(--bfo-rates-radius);
  box-shadow: var(--bfo-rates-shadow);
  opacity: 0;
  overflow: hidden;
  position: relative;
  transform: translateY(8px);
}

@keyframes bfo-rates-rise {
  to { opacity: 1; transform: translateY(0); }
}

.bfo-rates__head {
  align-items: center;
  background: linear-gradient(180deg, #fbfcff, var(--bfo-rates-paper));
  border-bottom: 1px solid var(--bfo-rates-line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px 22px;
}

.bfo-rates__title {
  color: var(--bfo-rates-ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
}

.bfo-rates__updated {
  align-items: center;
  color: var(--bfo-rates-muted);
  display: inline-flex;
  flex: none;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  gap: 7px;
  line-height: 1.4;
  text-align: right;
}

.bfo-rates__status-dot {
  animation: bfo-rates-pulse 2.4s infinite;
  background: var(--bfo-rates-good);
  border-radius: 50%;
  flex: none;
  height: 7px;
  width: 7px;
}

.bfo-rates--stale .bfo-rates__status-dot,
.bfo-rates--unavailable .bfo-rates__status-dot {
  animation: none;
  background: var(--bfo-rates-bad);
}

@keyframes bfo-rates-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.bfo-rates__notice {
  background: #fff5ef;
  border-bottom: 1px solid var(--bfo-rates-line);
  color: #69351f;
  font-size: 0.82rem;
  margin: 0;
  padding: 11px 22px;
}

.bfo-rates__table-wrap {
  max-width: 100%;
  overflow: visible;
}

.bfo-rates__table {
  border: 0;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  table-layout: fixed;
  width: 100%;
}

.bfo-rates__table th,
.bfo-rates__table td {
  border: 0;
  box-shadow: none;
}

.bfo-rates__table thead th {
  background: var(--bfo-rates-mist);
  color: var(--bfo-rates-muted-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  padding: 12px 22px;
  text-align: left;
  text-transform: uppercase;
}

.bfo-rates__table thead th:first-child { width: 56%; }
.bfo-rates__table thead th:nth-child(2) { text-align: right; width: 20%; }
.bfo-rates__table thead th:nth-child(3) { text-align: right; width: 24%; }

.bfo-rates__table tbody tr {
  background: var(--bfo-rates-paper);
  border-top: 1px solid var(--bfo-rates-line);
  transition: background 0.15s ease;
}

.bfo-rates__table tbody tr:first-child { border-top: 0; }
.bfo-rates__table tbody tr:hover { background: #fafbff; }
.bfo-rates__table tbody tr:focus-within { background: #f4f7ff; }

.bfo-rates__table tbody th,
.bfo-rates__table tbody td {
  overflow-wrap: anywhere;
  padding: 15px 22px;
  vertical-align: middle;
}

.bfo-rates__name {
  color: var(--bfo-rates-ink);
  font: inherit;
  font-size: 0.91rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

.bfo-rates__name > span { display: block; }

.bfo-rates__name small {
  color: var(--bfo-rates-muted-soft);
  display: block;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 3px;
}

.bfo-rates__methodology-link {
  color: var(--bfo-rates-ink-soft);
  display: inline-flex;
  min-height: 24px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bfo-rates__stale-badge {
  background: #fff0e8;
  border: 1px solid #eebda5;
  border-radius: 999px;
  color: #7a2b0d;
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 7px;
  padding: 2px 6px;
  text-transform: uppercase;
}


.bfo-rates__revision-badge {
  background: #eef0fb;
  border: 1px solid var(--bfo-rates-line-strong);
  border-radius: 999px;
  color: var(--bfo-rates-ink-soft);
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  margin-left: 7px;
  padding: 2px 6px;
  text-transform: uppercase;
  vertical-align: 1px;
}

.bfo-rates__rate {
  color: var(--bfo-rates-ink);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: right;
  white-space: nowrap;
}

.bfo-rates__delta-cell { text-align: right; }

.bfo-rates__delta {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  gap: 4px;
  justify-content: flex-end;
  line-height: 1.35;
}

.bfo-rates__delta--down { color: var(--bfo-rates-down); }
.bfo-rates__delta--up { color: var(--bfo-rates-up); }
.bfo-rates__delta--flat,
.bfo-rates__delta--unavailable { color: var(--bfo-rates-flat); }

.bfo-rates__trend-word {
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.bfo-rates__sparkline {
  display: block;
  height: 30px;
  margin-top: 7px;
  max-width: 132px;
  overflow: visible;
  width: 100%;
}

.bfo-rates__sparkline polyline {
  fill: none;
  stroke: var(--bfo-rates-signal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bfo-rates__foot {
  background: linear-gradient(180deg, var(--bfo-rates-paper), #fbfcff);
  border-top: 1px solid var(--bfo-rates-line);
  padding: 16px 22px;
}

.bfo-rates__matcher {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.bfo-rates__matcher-copy {
  color: var(--bfo-rates-muted);
  font-size: 0.84rem;
  line-height: 1.5;
  margin: 0;
}

.bfo-rates__matcher-copy strong { color: var(--bfo-rates-ink); font-weight: 650; }

.bfo-rates__button {
  align-items: center;
  background: var(--bfo-rates-signal);
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: 0 8px 18px -8px rgba(212, 67, 0, 0.65);
  color: #fff;
  display: inline-flex;
  flex: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  gap: 4px;
  justify-content: center;
  line-height: 1.25;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.12s ease;
}

.bfo-rates__button:visited { color: #fff; }
.bfo-rates__button:hover {
  background: #c23a0e;
  box-shadow: 0 12px 24px -8px rgba(194, 58, 14, 0.6);
  color: #fff;
  transform: translateY(-1px);
}

.bfo-rates__disclaimer,
.bfo-rates__source {
  color: var(--bfo-rates-muted-soft);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.005em;
  line-height: 1.55;
  margin: 10px 0 0;
}

.bfo-rates__source { margin-top: 6px; }
.bfo-rates__source a {
  color: var(--bfo-rates-muted);
  display: inline;
  min-height: 24px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.bfo-rates__empty {
  color: var(--bfo-rates-muted);
  font-size: 0.92rem;
  padding: 36px 22px;
  text-align: center;
}

@media (max-width: 620px) {
  .bfo-rates__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 16px 18px;
  }

  .bfo-rates__updated { text-align: left; }
  .bfo-rates__notice,
  .bfo-rates__foot { padding-left: 18px; padding-right: 18px; }

  .bfo-rates__table thead th,
  .bfo-rates__table tbody th,
  .bfo-rates__table tbody td { padding-left: 12px; padding-right: 12px; }

  .bfo-rates__table thead th:first-child { width: 50%; }
  .bfo-rates__table thead th:nth-child(2) { width: 23%; }
  .bfo-rates__table thead th:nth-child(3) { width: 27%; }
  .bfo-rates__rate { font-size: 0.92rem; }
  .bfo-rates__delta { font-size: 0.72rem; }
  .bfo-rates__trend-word { display: block; flex-basis: 100%; order: 3; text-align: right; }
  .bfo-rates__matcher { align-items: stretch; flex-direction: column; }
  .bfo-rates__button { align-self: flex-start; }
}

@media (max-width: 390px) {
  .bfo-rates__table thead th { font-size: 0.62rem; letter-spacing: 0.025em; }
  .bfo-rates__table thead th,
  .bfo-rates__table tbody th,
  .bfo-rates__table tbody td { padding-left: 8px; padding-right: 8px; }
  .bfo-rates__name { font-size: 0.84rem; }
  .bfo-rates__name small { font-size: 0.69rem; }
  .bfo-rates__rate { font-size: 0.84rem; }
  .bfo-rates__delta { font-size: 0.66rem; gap: 2px; }
  .bfo-rates__sparkline { max-width: 105px; }
}

@media (prefers-reduced-motion: reduce) {
  .bfo-rates__board { animation: none; opacity: 1; transform: none; }
  .bfo-rates__status-dot { animation: none; }
}

@media print {
  .bfo-rates__board { box-shadow: none; }
  .bfo-rates__button { display: none; }
}
