.rates-page {
  --rate-external: #65aef7;
  --rate-external-soft: rgba(101, 174, 247, 0.12);
  --rate-rustyflight: var(--amber);
  --rate-rustyflight-soft: rgba(247, 199, 98, 0.1);
  --rate-grid: rgba(159, 181, 189, 0.13);
  --rate-axis: rgba(238, 248, 250, 0.5);
}

.rates-page button,
.rates-page input,
.rates-page select {
  font: inherit;
}

.rates-page .rate-tool {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 84px;
  overflow: visible;
}

.rates-page .rate-intro {
  max-width: 880px;
  padding: 68px 0 48px;
}

.rates-page .rate-intro h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-size: clamp(3rem, 8vw, 6.1rem);
}

.rates-page .rate-intro > p:not(.eyebrow) {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.rates-page .rate-panel {
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(139, 234, 242, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    rgba(18, 26, 36, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 60px rgba(1, 5, 12, 0.25);
}

.rates-page .rate-chart-panel {
  padding: 24px 24px 16px;
}

.rates-page .rate-panel-heading,
.rates-page .rate-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.rates-page .rate-panel-heading {
  margin-bottom: 18px;
}

.rates-page .rate-panel-heading h2,
.rates-page .rate-card-heading h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
}

.rates-page .rate-kicker,
.rates-page .rate-card-tag {
  display: block;
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.rates-page .rate-card-tag {
  color: var(--rate-external);
}

.rates-page .rate-rustyflight-card .rate-card-tag {
  color: var(--rate-rustyflight);
}

.rates-page .rate-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

.rates-page .rate-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rates-page .rate-legend b {
  font-weight: 700;
}

.rates-page .rate-swatch {
  display: inline-block;
  width: 26px;
  height: 3px;
  border-radius: 999px;
}

.rates-page .rate-swatch-external {
  background: var(--rate-external);
}

.rates-page .rate-swatch-rustyflight {
  background: var(--rate-rustyflight);
}

.rates-page .rate-chart-frame {
  height: 450px;
  overflow: hidden;
  border: 1px solid rgba(139, 234, 242, 0.11);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 50%, rgba(47, 209, 195, 0.035), transparent 58%),
    #0b1119;
}

.rates-page #rate-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.rates-page .rate-chart-caption {
  margin: 10px 0 0;
  color: rgba(159, 181, 189, 0.82);
  font-size: 0.78rem;
  text-align: center;
}

.rates-page .rate-controls-grid,
.rates-page .rate-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.rates-page .rate-controls-grid > *,
.rates-page .rate-details-grid > * {
  min-width: 0;
}

.rates-page .rate-curve-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.rates-page .rate-curve-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
}

.rates-page .rate-external-card::before {
  background: var(--rate-external);
}

.rates-page .rate-rustyflight-card::before {
  background: var(--rate-rustyflight);
}

.rates-page .rate-card-heading {
  align-items: flex-end;
}

.rates-page .rate-model-picker {
  display: grid;
  min-width: 208px;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rates-page .rate-model-picker select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(101, 174, 247, 0.42);
  border-radius: 7px;
  padding: 0 34px 0 11px;
  color: var(--text);
  background: #0b1119;
  cursor: pointer;
}

.rates-page .rate-model-picker select:focus-visible,
.rates-page .rate-number-input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.rates-page .rate-model-note {
  margin: 16px 0 4px;
  color: rgba(159, 181, 189, 0.84);
  font-size: 0.8rem;
  line-height: 1.5;
}

.rates-page .rate-control-list {
  display: grid;
  gap: 20px;
  margin-top: 22px;
}

.rates-page .rate-control {
  display: grid;
  gap: 9px;
}

.rates-page .rate-control-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 760;
}

.rates-page .rate-control-label small {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 650;
}

.rates-page .rate-boolean-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
  gap: 14px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 760;
  cursor: pointer;
}

.rates-page .rate-boolean-input-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.rates-page .rate-boolean-input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--rate-external);
  cursor: pointer;
}

.rates-page .rate-boolean-input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.rates-page .rate-boolean-state {
  min-width: 2.2rem;
  color: var(--muted);
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: right;
}

.rates-page .rate-input-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 98px;
  align-items: center;
  gap: 14px;
}

.rates-page .rate-range-input {
  width: 100%;
  margin: 0;
  accent-color: var(--rate-external);
  cursor: pointer;
}

.rates-page .rate-rustyflight-card .rate-range-input {
  accent-color: var(--rate-rustyflight);
}

.rates-page .rate-number-wrap {
  position: relative;
}

.rates-page .rate-number-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(139, 234, 242, 0.2);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--text);
  background: #0b1119;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rates-page .rate-number-input:focus {
  border-color: rgba(139, 234, 242, 0.5);
}

.rates-page .rate-constraint {
  min-height: 1.45em;
  margin: 18px 0 0;
  color: #f8dc99;
  font-size: 0.76rem;
  line-height: 1.45;
}

.rates-page .rate-equations,
.rates-page .rate-samples {
  padding: 24px;
}

.rates-page .rate-equation-card {
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(139, 234, 242, 0.14);
  border-radius: 7px;
  padding: 17px 18px;
  background: #0b1119;
}

.rates-page .rate-equation-card + .rate-equation-card {
  margin-top: 12px;
}

.rates-page .rate-equation-external {
  box-shadow: inset 3px 0 var(--rate-external);
}

.rates-page .rate-equation-rustyflight {
  box-shadow: inset 3px 0 var(--rate-rustyflight);
}

.rates-page .rate-equation-card h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rates-page .rate-equation {
  max-width: 100%;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  color: #dcebed;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.77rem;
  line-height: 1.65;
}

.rates-page .rate-variables {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 12px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.rates-page .rate-variables dt {
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 850;
}

.rates-page .rate-equation-rustyflight .rate-variables dt {
  color: var(--rate-rustyflight);
}

.rates-page .rate-variables dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.rates-page .rate-source-note {
  margin-bottom: 0;
  color: rgba(159, 181, 189, 0.72);
  font-size: 0.77rem;
  line-height: 1.55;
}

.rates-page #external-source {
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 750;
}

.rates-page #external-source:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rates-page .rate-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.rates-page .rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.rates-page .rate-table th,
.rates-page .rate-table td {
  border-bottom: 1px solid rgba(139, 234, 242, 0.11);
  padding: 11px 9px;
  text-align: right;
  white-space: nowrap;
}

.rates-page .rate-table th:first-child,
.rates-page .rate-table td:first-child {
  text-align: left;
}

.rates-page .rate-table thead th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.rates-page .rate-table thead th:nth-child(2) {
  color: var(--rate-external);
}

.rates-page .rate-table thead th:nth-child(3) {
  color: var(--rate-rustyflight);
}

.rates-page .rate-table tbody th {
  color: var(--text);
  font-weight: 750;
}

.rates-page .rate-table tbody tr:last-child > * {
  border-bottom: 0;
}

.rates-page .rate-delta-positive {
  color: var(--teal);
}

.rates-page .rate-delta-negative {
  color: #ff9d91;
}

.rates-page .rate-table-note {
  margin: 14px 0 0;
  color: rgba(159, 181, 189, 0.76);
  font-size: 0.75rem;
  line-height: 1.5;
}

.rates-page .rate-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 820px) {
  .rates-page .rate-controls-grid,
  .rates-page .rate-details-grid {
    grid-template-columns: 1fr;
  }

  .rates-page .rate-chart-frame {
    height: 390px;
  }
}

@media (max-width: 560px) {
  .rates-page .rate-tool {
    width: min(100% - 24px, 1120px);
    padding-bottom: 56px;
  }

  .rates-page .rate-intro {
    padding: 46px 0 38px;
  }

  .rates-page .rate-intro h1 {
    font-size: clamp(2.7rem, 15vw, 4rem);
  }

  .rates-page .rate-intro > p:not(.eyebrow) {
    font-size: 1rem;
  }

  .rates-page .rate-chart-panel,
  .rates-page .rate-curve-card,
  .rates-page .rate-equations,
  .rates-page .rate-samples {
    padding: 17px;
  }

  .rates-page .rate-panel-heading,
  .rates-page .rate-card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .rates-page .rate-legend {
    justify-content: flex-start;
  }

  .rates-page .rate-chart-frame {
    height: 340px;
  }

  .rates-page .rate-model-picker {
    width: 100%;
    min-width: 0;
  }

  .rates-page .rate-input-pair {
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 10px;
  }

  .rates-page .rate-boolean-label {
    gap: 10px;
  }

  .rates-page .rate-table {
    min-width: 520px;
  }

}
