/*
 * BitStepX components: the list screens (home hero, category tabs, post cards and their grid,
 * level lists, list and search headings) and the exchange screens (disclosure and risk lines,
 * breadcrumbs, exchange card, comparison table, hub and single exchange layout).
 * Values come from tokens.css only: no color values here, font sizes only through --text-*,
 * spacing through --space-*.
 *
 * Screen widths as in base.css: phones first (360px), 600px two columns, 1100px four columns.
 */

/* ---------- List screens: spacing between the parts of <main> ---------- */

/* WordPress's flow layout puts its own block gap between these; the list screens set it here. */
.bsx-main.bsx-list-screen > * {
  margin-block: 0;
}

.bsx-main.bsx-list-screen > * + * {
  margin-block-start: var(--space-6);
}

.bsx-main.bsx-list-screen > .bsx-list {
  margin-block-start: var(--space-8);
}

.bsx-main.bsx-list-screen > .bsx-home-only {
  margin-block-start: var(--space-16);
}

/* Phones, home page 1: the learning paths ("where to start") come right after the hero, before the
   tabs and the cards (2026-11-12 decision). The section is drawn once and only its place on screen
   moves (flex order); the HTML order stays, so screen readers and the Tab key still reach it after
   the cards (the sections do not depend on each other). The paths sit closer to the hero, and the
   tabs start a new part below them. Wider screens keep the HTML order. */
@media (max-width: 599px) {
  .bsx-main.bsx-home {
    display: flex;
    flex-direction: column;
  }

  .bsx-main.bsx-home > .bsx-hero {
    order: -2;
  }

  .bsx-main.bsx-home > .bsx-home-paths {
    order: -1;
    margin-block-start: var(--space-8);
  }

  /* With the paths shown above them (a level list is there), the tabs start a new part: 64px below
     the paths and left-aligned like them (centering is for the hero only, DESIGN.md 3). Without the
     paths the tabs stay right under the hero, centered and 24px below it, as on wider screens. */
  .bsx-main.bsx-home:has(> .bsx-home-paths .bsx-level-list) > .bsx-hero ~ .bsx-tabs {
    margin-block-start: var(--space-16);
  }

  .bsx-main.bsx-home:has(> .bsx-home-paths .bsx-level-list) > .bsx-hero + .bsx-tabs .bsx-tabs__list {
    justify-content: flex-start;
  }
}

/* List, level and search headings: a long word or search term breaks instead of widening the page. */
.bsx-list-title {
  margin: 0;
  overflow-wrap: anywhere;
}

.bsx-list-intro {
  max-width: var(--measure);
  color: var(--text-muted);
}

.bsx-list-intro > * {
  margin: 0;
}

.bsx-list-intro > * + * {
  margin-top: var(--space-3);
}

.bsx-no-results {
  margin: 0;
  font-size: var(--text-base);
}

/* ---------- Home hero (page 1 of the home list only) ---------- */

.bsx-hero {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding-block: var(--space-4) var(--space-2);
  text-align: center;
}

.bsx-hero__title {
  max-width: 14em;
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-heavy);
  line-height: var(--leading-display);
}

.bsx-hero__intro {
  max-width: 34em;
  margin: 0;
  color: var(--text-muted);
  text-wrap: balance;
}

/* Page 2 and later of the home list: the list only. */
body.paged .bsx-hero,
body.paged .bsx-home-only {
  display: none;
}

/* ---------- Category tabs ---------- */

.bsx-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bsx-tabs__list > li {
  margin: 0;
}

.bsx-hero + .bsx-tabs .bsx-tabs__list {
  justify-content: center;
}

/* The tab of this screen: inverted, like the current page number below the grid. */
.bsx-tabs__tab[aria-current] {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.bsx-tabs__tab[aria-current]:hover {
  background: var(--btn-bg);
  opacity: 0.86;
}

/* ---------- Card grid: one, two, four columns ---------- */

.bsx-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-10) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bsx-grid > li {
  min-width: 0;
  margin: 0;
}

/* ---------- Post card: no line, no shadow, straight on the page background ---------- */

.bsx-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  height: 100%;
  container-type: inline-size;
}

.bsx-card__thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-box);
  color: var(--text-muted);
  text-decoration: none;
}

.bsx-card__thumb:hover {
  text-decoration: none;
}

.bsx-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--duration) var(--ease-out);
}

.bsx-card__thumb:hover .bsx-card__img {
  opacity: 0.86;
}

/* No featured image: the category name in a box of the same size. */
.bsx-card__label {
  padding: var(--space-4);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-align: center;
  overflow-wrap: anywhere;
}

.bsx-card__body {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  min-width: 0;
}

.bsx-card__title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
  text-wrap: pretty;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.bsx-card__title a {
  color: var(--text-strong);
}

.bsx-card__excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-body);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.bsx-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.bsx-card__meta time {
  margin-right: var(--space-1);
}

.bsx-card__meta a.bsx-pill {
  min-height: var(--space-8);
  padding-inline: var(--space-3);
}

/* Narrow cards (four columns, small tablets): the date on its own line, the two pills together below
   it, instead of one pill left alone on a second line. */
@container (max-width: 320px) {
  .bsx-card__meta time {
    flex-basis: 100%;
  }
}

/* ---------- Home: section titles and learning paths ---------- */

.bsx-section-title {
  margin: 0 0 var(--space-6);
  font-size: var(--text-xl);
}

/* Placeholders that are still empty, and the paths section when no level has posts, take no room. */
.bsx-home-only:empty,
.bsx-home-paths:not(:has(.bsx-level-list)) {
  display: none;
}

.bsx-paths {
  display: grid;
  gap: var(--space-6);
}

.bsx-paths > * {
  margin: 0;
}

.bsx-level-list {
  display: grid;
  align-content: start;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-box);
}

.bsx-level-list__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

.bsx-level-list__items {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bsx-level-list__items > li {
  margin: 0;
}

.bsx-level-list__items > li + li {
  border-top: 1px solid var(--border);
}

.bsx-level-list__items a {
  display: flex;
  align-items: center;
  min-height: var(--space-12);
  padding-block: var(--space-3);
  color: var(--text-strong);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.bsx-level-list__more {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: var(--space-2);
  min-height: var(--space-10);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.bsx-level-list__more .bsx-icon {
  width: var(--space-5);
  height: var(--space-5);
}

/* ---------- Referral disclosure and risk note (exchange screens; post bodies use the same names) ---------- */

.bsx-disclosure {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.bsx-disclosure a,
.bsx-risk a {
  text-decoration: underline;
}

.bsx-risk {
  max-width: var(--measure);
  margin: 0;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-box);
  color: var(--text-body);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.bsx-risk strong {
  color: var(--text-strong);
}

/* ---------- Breadcrumbs ---------- */

.bsx-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-2);
  margin: 0;
  padding: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
  list-style: none;
}

.bsx-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  overflow-wrap: anywhere;
}

.bsx-breadcrumbs li + li::before {
  content: "/";
  content: "/" / "";
  color: var(--border-strong);
}

.bsx-breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--space-10);
  color: var(--text-muted);
}

.bsx-breadcrumbs a:hover {
  color: var(--text-strong);
}

.bsx-breadcrumbs [aria-current] {
  color: var(--text-body);
}

/* ---------- Exchange logo: the logo image, or the first letter in a neutral circle ---------- */

.bsx-num {
  font-variant-numeric: tabular-nums;
}

/* Sign-up offers keep the line breaks they were written with. */
.bsx-text-lines {
  white-space: pre-line;
}

.bsx-exchange-logo {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--space-8);
  height: var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-pill);
  color: var(--text-strong);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: 0;
}

.bsx-exchange-logo--image {
  display: block;
  object-fit: cover;
}

.bsx-exchange-logo--large {
  width: var(--space-12);
  height: var(--space-12);
  font-size: var(--text-lg);
}

/* ---------- Exchange card: a box, the sign-up button at the bottom ---------- */

.bsx-exchange-card {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-box);
}

.bsx-exchange-card > * {
  margin: 0;
}

.bsx-exchange-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.bsx-exchange-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-width: 0;
}

.bsx-exchange-card__name {
  color: var(--text-strong);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  overflow-wrap: anywhere;
}

/* Inside the box the pill sits on the page color, so it stays visible in both themes. */
.bsx-exchange-card .bsx-pill {
  background: var(--bg-base);
}

.bsx-exchange-card__facts {
  display: grid;
}

.bsx-exchange-card__facts > div {
  display: grid;
  gap: var(--space-1);
  padding-block: var(--space-3);
  border-top: 1px solid var(--border);
}

.bsx-exchange-card__facts > div:last-child {
  padding-bottom: 0;
}

.bsx-exchange-card__facts dt {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
}

.bsx-exchange-card__facts dd {
  margin: 0;
  color: var(--text-strong);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

/* "Last checked …" and the disclosure sentence: two short muted lines kept together above the button. */
.bsx-exchange-card__notes {
  display: grid;
  gap: var(--space-1);
}

.bsx-exchange-card__notes > p {
  margin: 0;
}

.bsx-exchange-card__checked {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  font-variant-numeric: tabular-nums;
}

.bsx-exchange-card .bsx-btn {
  width: 100%;
  white-space: normal;
}

/* ---------- Comparison table ---------- */

.bsx-exchanges {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.bsx-exchanges > * {
  margin: 0;
}

/* "Last checked {date}": one right-aligned line sitting just above the table (2026-11-15 decision). */
.bsx-exchanges__checked {
  margin-block-end: calc(var(--space-2) * -1);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* A sign-up offer: a new line before each "+" (bsx_offer_html()). */
.bsx-offer {
  display: grid;
  gap: var(--space-1);
}

/* Safety net: if the table is ever wider than the screen (very long names, large zoom), only the
   table scrolls sideways, never the page. position: relative keeps the visually hidden labels inside
   (absolute boxes escape a scroller that is not their containing block, and would widen the page). */
.bsx-exchanges__scroll {
  position: relative;
  overflow-x: auto;
}

.bsx-exchange-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-body);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Grid: every cell has a line on all four sides (rows and columns). Every cell, the headers too, is
   centered across and down (2026-11-15 decision); the cards below 1100px stay left aligned. */
.bsx-exchange-table th,
.bsx-exchange-table td {
  padding: var(--space-4) var(--space-2);
  border: 1px solid var(--border);
  font-weight: var(--weight-regular);
  text-align: center;
  vertical-align: middle;
}

.bsx-exchange-table thead th {
  padding-block: var(--space-1);
  border-bottom-color: var(--border-strong);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

/* "Futures fee" over its Maker and Taker columns, with a plain line between it and them. */
.bsx-exchange-table thead .bsx-col-fees {
  padding-block: var(--space-2);
  border-bottom-color: var(--border);
}

.bsx-exchange-table td.bsx-num {
  white-space: nowrap;
}

/* A fee with our referral code: the standard fee struck through, the code fee, then its condition. */
.bsx-fee {
  display: grid;
}

.bsx-fee__standard {
  color: var(--text-muted);
}

.bsx-fee__code {
  color: var(--price-up);
  font-weight: var(--weight-bold);
}

.bsx-fee__note {
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}

/* Header button: label and icon flow as text, so a label that wraps keeps the icon after its last word. */
.bsx-sort {
  display: inline-block;
  min-height: var(--space-10);
  margin: 0;
  padding: var(--space-2) 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: var(--leading-tight);
  text-align: inherit;
  cursor: pointer;
}

.bsx-sort:hover,
.bsx-exchange-table th[aria-sort] .bsx-sort {
  color: var(--text-strong);
}

/* Light theme: the sort buttons are outlined pills (edge color in base.css), so they read as buttons
   on the near-white page. The pill reaches 4px into the cell's own padding on each side (negative
   margin), so the full table keeps its width and still fits from 1100px. The labels stay on one line. */
:root[data-theme="light"] .bsx-sort {
  margin-inline: calc(var(--space-1) * -1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.bsx-sort__end {
  white-space: nowrap;
}

.bsx-sort .bsx-icon {
  display: inline-block;
  width: var(--space-4);
  height: var(--space-4);
  margin-left: var(--space-1);
  vertical-align: -0.15em;
}

/* Both chevrons faint until the column is sorted, then only the direction in use is bright. */
.bsx-exchange-table th:not([aria-sort]) .bsx-sort .bsx-icon,
.bsx-exchange-table th[aria-sort="ascending"] .bsx-icon__down,
.bsx-exchange-table th[aria-sort="descending"] .bsx-icon__up {
  opacity: 0.4;
}

/* The logo and the name centered together in the table; the cards set them at the left. */
.bsx-exchange-table__name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-width: 0;
}

.bsx-exchange-table__label {
  display: grid;
  gap: var(--space-1);
}

.bsx-exchange-table td.bsx-col-offer {
  min-width: calc(var(--space-16) * 2.25);
}

.bsx-exchange-table__label a {
  color: var(--text-strong);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  white-space: nowrap;
}

/* Sign-up buttons in the table: the same green fill as everywhere (.bsx-btn--signup), a little shorter. */
.bsx-exchange-table .bsx-btn {
  min-height: var(--space-10);
  padding-inline: var(--space-4);
}

/* Below 1100px: one card per row, each value under its column name. The full table needs about
   1,020px, so a narrower screen would hide the sign-up column behind a sideways scroll. Phones show
   one card per line, wider screens two (see the 600px rule below). */
@media (max-width: 1099px) {
  .bsx-exchange-table,
  .bsx-exchange-table tbody,
  .bsx-exchange-table tr,
  .bsx-exchange-table th,
  .bsx-exchange-table td {
    display: block;
  }

  /* The header row is not drawn and its sort buttons leave the tab order: a hidden button would take
     keyboard focus that nobody can see. Each cell carries its column name (data-label) instead. */
  .bsx-exchange-table thead {
    display: none;
  }

  .bsx-exchange-table tbody {
    display: grid;
    gap: var(--space-4);
  }

  /* The logo sits beside the name line, not in the middle of the name and country lines. */
  .bsx-exchange-table__name {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .bsx-exchange-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: var(--space-4);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--bg-box);
  }

  .bsx-exchange-table tbody th,
  .bsx-exchange-table tbody td,
  .bsx-exchange-table tbody tr > :first-child,
  .bsx-exchange-table tbody tr > :last-child {
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .bsx-exchange-table td {
    color: var(--text-strong);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    overflow-wrap: anywhere;
  }

  .bsx-exchange-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: var(--space-1);
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
  }

  .bsx-exchange-table .bsx-num {
    white-space: normal;
    text-align: left;
  }

  /* On the light card box the green reads at 4.47:1, under the 4.5:1 text floor: the code fee is the
     strong text color there (still bold, under the struck standard fee). */
  :root[data-theme="light"] .bsx-exchange-table .bsx-fee__code {
    color: var(--text-strong);
  }

  .bsx-exchange-table__label,
  .bsx-exchange-table td.bsx-col-offer {
    min-width: 0;
    max-width: none;
  }

  .bsx-exchange-table__label a {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Maker next to taker; the name, the offer and the button take the full width. */
  .bsx-exchange-table tbody th,
  .bsx-exchange-table .bsx-col-offer,
  .bsx-exchange-table .bsx-col-cta {
    grid-column: 1 / -1;
  }

  .bsx-exchange-table td.bsx-col-cta::before {
    display: none;
  }

  .bsx-exchange-table td:empty {
    display: none;
  }

  .bsx-exchange-table .bsx-btn {
    width: 100%;
    min-height: var(--space-12);
    white-space: normal;
  }
}

/* ---------- Hub (/exchanges/) and one exchange ---------- */

.bsx-hub .bsx-list-intro {
  margin-top: var(--space-3);
}

.bsx-main.bsx-hub > .bsx-exchanges {
  margin-block-start: var(--space-8);
}

.bsx-main.bsx-hub > .bsx-savings {
  margin-block-start: var(--space-12);
}

.bsx-main.bsx-hub > .bsx-risk {
  margin-block-start: var(--space-10);
}

/* ---------- Fee savings picture (hub, below the table) ----------
   Bars start at zero and carry their numbers in text beside them. Green marks money kept: the bar and
   amount of the fee with our code and every saving; the standard fee is the muted bar. */

.bsx-savings {
  display: grid;
  gap: var(--space-6);
}

.bsx-savings > *,
.bsx-savings__intro > *,
.bsx-savings__all > * {
  margin: 0;
}

.bsx-savings__intro {
  display: grid;
  gap: var(--space-2);
}

.bsx-savings__title {
  color: var(--text-strong);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.bsx-savings__basis {
  max-width: var(--measure);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.bsx-savings__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--space-8);
}

/* The worked example: a box, like the exchange cards. */
.bsx-savings__example {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-box);
}

.bsx-savings__example > * {
  margin: 0;
}

.bsx-savings__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.bsx-savings__name {
  color: var(--text-strong);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

.bsx-savings__caption {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* One bar: its label and its amount on one line, the bar under them. */
.bsx-savings__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.bsx-savings__label {
  min-width: 0;
  color: var(--text-body);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
}

.bsx-savings__value {
  color: var(--text-strong);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  text-align: right;
}

.bsx-savings__track {
  display: block;
  grid-column: 1 / -1;
  height: var(--space-3);
  border-radius: var(--radius-full);
  background: var(--border);
}

.bsx-savings__fill {
  display: block;
  width: calc(var(--share, 1) * 100%);
  height: 100%;
  border-radius: inherit;
  background: var(--price-up);
}

/* The amounts beside the two bars stay the strong text color: on the light box the green reads under
   4.5:1 at this size. The green bar and the saving below carry the color. */
.bsx-savings__row--standard .bsx-savings__fill {
  background: var(--control-border);
}

.bsx-savings__result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.bsx-savings__amount {
  color: var(--price-up);
  font-size: var(--text-3xl);
  font-weight: var(--weight-heavy);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-tight);
}

.bsx-savings__less {
  color: var(--text-strong);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}

/* Inside the box the pill sits on the page color, so it stays visible in both themes. */
.bsx-savings__example .bsx-pill {
  background: var(--bg-base);
}

.bsx-savings__sum {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

/* Every exchange: one bar each, the largest saving first, on the page color. */
.bsx-savings__all {
  display: grid;
  gap: var(--space-4);
}

.bsx-savings__subtitle {
  color: var(--text-strong);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.bsx-savings__list {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bsx-savings__who {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-strong);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

.bsx-savings__saved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1) var(--space-2);
  color: var(--price-up);
}

.bsx-savings__fees {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
}

.bsx-exchange-page > * {
  margin-block: 0;
}

.bsx-exchange-page > * + * {
  margin-block-start: var(--space-4);
}

.bsx-exchange-page__title {
  margin-bottom: 0;
}

.bsx-main.bsx-exchange-page > .bsx-exchange-page__cols {
  margin-block-start: var(--space-6);
}

.bsx-exchange-page__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--space-8);
}

.bsx-exchange-page__cols > *,
.bsx-exchange-page__body > * {
  margin: 0;
}

.bsx-exchange-page__body {
  display: grid;
  gap: var(--space-8);
  min-width: 0;
}

/* Home strip: hidden when no exchange is published. */
.bsx-home-exchanges:not(:has(.bsx-exchange-table)) {
  display: none;
}

.bsx-more-link {
  margin: var(--space-4) 0 0;
}

/* Home strip: the short risk box under the sign-up buttons (2026-11-27, the footer no longer has one). */
.bsx-home-exchanges > .bsx-risk {
  margin-block-start: var(--space-6);
}

.bsx-more-link a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--space-10);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.bsx-more-link .bsx-icon {
  width: var(--space-5);
  height: var(--space-5);
}

/* ---------- Wider screens ---------- */

@media (min-width: 600px) {
  .bsx-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bsx-paths {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bsx-level-list {
    padding: var(--space-6);
  }

  .bsx-exchange-card,
  .bsx-savings__example,
  .bsx-risk {
    padding: var(--space-6);
  }
}

/* Tablets and small laptops: the exchange cards two to a row. */
@media (min-width: 600px) and (max-width: 1099px) {
  .bsx-exchange-table tbody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .bsx-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-10) var(--space-6);
  }

  .bsx-hero {
    padding-block: var(--space-8) var(--space-4);
  }

  /* One exchange: the body on the left, the card in a right column that stays in view. */
  .bsx-exchange-page__cols {
    grid-template-columns: minmax(0, 1fr) calc(var(--space-16) * 6);
    gap: var(--space-12);
  }

  .bsx-exchange-page__cols > .bsx-exchange-card {
    position: sticky;
    top: var(--space-6);
    grid-row: 1;
    grid-column: 2;
  }

  .bsx-exchange-page__body {
    grid-row: 1;
    grid-column: 1;
  }

  /* The worked example and the bars of every exchange side by side. */
  .bsx-savings__body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-12);
  }
}
