/* The header and hero use the same content width and mobile gutters. */
.ex-wrap {
  --guide-gap: clamp(14px, 1.6vw, 22px);
  padding: clamp(40px, 5vw, 72px) max(32px, calc((100% - var(--content)) / 2));
  background: var(--canvas);
  color: var(--ink, #1d291d);
}
.ex-wrap section + section { margin-top: clamp(40px, 5vw, 72px); }
.ex-wrap h2 {
  margin: 0 0 clamp(18px, 2vw, 28px);
  font-size: clamp(27px, 3vw, 40px);
  line-height: 1.13;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.ex-wrap h3 { margin: 0 0 10px; line-height: 1.25; }
.ex-wrap p { line-height: 1.5; }
.ex-wrap article > p { margin: 0; color: var(--muted); }
.ex-wrap article, .ex-chart, .ex-tutorial {
  min-width: 0;
  padding: clamp(18px, 2vw, 26px);
  border: 1px solid #dce2d5;
  border-radius: 16px;
  background: #fff;
}
.ex-steps, .ex-grid, .ex-benefits, .ex-stats, .ex-market {
  display: grid;
  gap: var(--guide-gap);
}
.ex-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; }
.ex-steps article {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  row-gap: 12px;
  align-content: start;
}
.ex-steps h3 { margin: 0; }
.ex-steps article::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e3f7b9;
}
.ex-grid, .ex-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ex-grid > :only-child, .ex-market > :only-child { grid-column: 1 / -1; }
.ex-tutorial { padding: 0; overflow: hidden; }
.ex-video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.ex-tutorial a { display: inline-block; margin: 12px 18px; font-weight: 600; }
.ex-grid article { align-content: center; }
.ex-grid article h2 { font-size: clamp(24px, 2.3vw, 32px); }
.ex-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.ex-facts > * { margin: 0; padding: 12px 0; border-top: 1px solid #e2e7dd; }
.ex-facts dd { text-align: right; font-weight: 600; }
.ex-market { grid-template-columns: minmax(0, 1fr); row-gap: 9px; }
.ex-market-paired {
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr);
  grid-template-areas: "stats chart" "source .";
  align-items: stretch;
}
.ex-market-paired .ex-market-summary { grid-area: stats; }
.ex-market-paired .ex-market-source { grid-area: source; }
.ex-market-paired .ex-chart { grid-area: chart; }
.ex-market-summary { min-width: 0; }
.ex-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; }
.ex-market-paired .ex-stats { height: 100%; }
.ex-stats article { min-height: 62px; box-sizing: border-box; display: grid; align-content: center; gap: 2px; padding: 10px 14px; border-radius: 12px; }
.ex-stats article:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ex-stats small, .ex-chips small, .ex-market-source { color: var(--muted); }
.ex-stats strong { display: block; font-size: clamp(.95rem, 1.3vw, 1.12rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ex-market-source { margin: 0; font-size: .86rem; }
.ex-chart { box-sizing: border-box; min-height: 380px; display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 12px; overflow: hidden; }
.ex-chart .tradingview-widget-container__widget { min-height: 0; height: 100% !important; }
.ex-chart .tradingview-widget-copyright { margin-top: 6px; }
.ex-benefits article:first-child { grid-row: span 2; background: linear-gradient(125deg, #fafcf5, #e4f2cc); }
.ex-illustration { display: flex; align-items: center; min-height: 100px; gap: 6px; margin-bottom: 14px; }
.ex-illustration img { object-fit: contain; }
.ex-quote-arrows { display: grid; color: #779338; font-size: 3rem; line-height: .52; }
@media (prefers-reduced-motion: no-preference) {
  .ex-illustration img { animation: ex-quote-coin 3.6s ease-in-out infinite; }
  .ex-quote-arrows > span { animation: ex-quote-arrow 3.6s ease-in-out infinite; }
  .ex-quote-arrows > span + span { animation-direction: reverse; }
}
@keyframes ex-quote-coin {
  0%, 100% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(-4px) rotate(-5deg); }
}
@keyframes ex-quote-arrow {
  0%, 15%, 100% { transform: translateX(0); }
  52%, 65% { transform: translateX(var(--ex-travel, 8px)); }
}
.ex-quote-arrows > span + span { --ex-travel: -8px; }
.ex-chips { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; }
.ex-chips a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #d8dfd0;
  border-radius: 12px;
  background: white;
  color: #203219;
  text-decoration: none;
  font-weight: 600;
}
.ex-chips a:hover { background: #e6f7c6; }
.ex-chips img { flex: none; }
.ex-chip-icons { display: inline-flex; flex: none; align-items: center; }
.ex-chip-icons img { width: 22px; height: 22px; object-fit: contain; }
.ex-chip-icons img + img { margin-inline-start: -5px; border-radius: 50%; box-shadow: 0 0 0 2px white; }
.ex-chips span { min-width: 0; overflow-wrap: anywhere; }
.ex-chips small { display: block; font-weight: 400; }
.ex-wrap [hidden] { display: none !important; }
.ex-route-header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.ex-route-header h2 { margin-bottom: 6px; }
.ex-route-header p, .ex-route-directory > p { margin: 0; color: var(--muted, #566652); }
.ex-route-directions { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid #dce2d5; border-radius: 12px; background: #eff2e9; }
.ex-route-directions button {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #25351f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ex-route-directions button[aria-pressed=true] { background: #fff; border-color: #d7e0cb; }
.ex-route-panel { padding: clamp(12px, 2.2vw, 24px); border: 1px solid #dce2d5; border-radius: 18px; background: #fff; }
.ex-route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.ex-route-grid > li { min-width: 0; margin: 0; }
.ex-route {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  min-height: 62px;
  height: 100%;
  padding: 9px 12px;
  border: 1px solid #e0e7d8;
  border-radius: 11px;
  background: #f8faf5;
  color: #203219;
  text-decoration: none;
}
.ex-route:hover { background: #edf6dd; border-color: #c2d0b1; text-decoration: none; }
.ex-route:focus-visible, .ex-route-directions button:focus-visible, .ex-route-panel a:focus-visible, .ex-route-filters :is(input, select, button):focus-visible {
  outline: 2px solid #4c642d;
  outline-offset: 2px;
}
.ex-route img, .ex-route-symbol { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; object-fit: contain; }
.ex-route-symbol { display: grid; place-items: center; background: #e7eddf; font-size: 12px; font-weight: 700; }
.ex-route-copy { display: block; min-width: 0; }
.ex-route-copy strong { display: block; font-size: .95rem; overflow-wrap: anywhere; }
.ex-route-copy small { display: block; margin-top: 2px; font-size: .78rem; line-height: 1.2; color: var(--muted, #566652); overflow-wrap: anywhere; }
.ex-route-arrow { margin-inline-start: auto; color: #627737; font-size: 1.25rem; }
.ex-route-footer { display: flex; justify-content: end; align-items: center; gap: 12px; margin-top: 14px; padding-top: 13px; border-top: 1px solid #e2e8da; }
.ex-route-footer a, .ex-route-summary a, .ex-route-back { color: #415d27; font-weight: 650; }
.ex-route-footer a { padding: 5px 2px; }
.ex-route-empty { margin: 0; padding: 6px; color: var(--muted, #566652); }
.ex-route-directory h1 { margin: 12px 0 6px; font-size: clamp(30px, 4vw, 48px); line-height: 1.12; letter-spacing: -.04em; }
.ex-route-directory .ex-route-panel { margin-top: 22px; }
.ex-route-filters { display: grid; grid-template-columns: minmax(108px, .8fr) minmax(124px, .85fr) minmax(160px, 2fr) auto; align-items: end; gap: 10px; }
.ex-route-filters label { display: grid; min-width: 0; gap: 5px; color: #25351f; font-size: .85rem; font-weight: 650; }
.ex-route-filters :is(select, input, button) { box-sizing: border-box; min-width: 0; width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #cdd5c6; border-radius: 9px; background: #fff; color: #203219; font: inherit; }
.ex-route-filters button { border-color: #bfd887; background: #e6f7c6; font-weight: 650; cursor: pointer; }
.ex-route-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-block: 14px 10px; color: var(--muted, #566652); font-size: .88rem; }
.ex-route-summary p { margin: 0; }
.ex-route-pagination { justify-content: space-between; font-size: .9rem; }
.ex-route-pagination span { color: var(--muted, #566652); }
.ex-price { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.ex-market-delta { --ex-change-color: #45534a; --ex-change-bg: #e9ede5; color: var(--ex-change-color); }
.ex-market-delta.is-up { --ex-change-color: #216432; --ex-change-bg: #e3f2e2; }
.ex-market-delta.is-down { --ex-change-color: #9d3034; --ex-change-bg: #f8e7e5; }
.ex-price-delta { display: inline-block; border-radius: 999px; padding: 4px 9px; background: var(--ex-change-bg); font-size: .9em; white-space: nowrap; }
.ex-price-period { font-size: .85em; font-weight: 600; }
@media (max-width: 900px) {
  .ex-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-market-paired { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stats" "source" "chart"; }
  .ex-market-paired .ex-stats { height: auto; }
  .ex-market-paired .ex-chart { margin-top: 6px; }
  .ex-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ex-stats article:last-child:nth-child(odd) { grid-column: auto; }
}
@media (max-width: 680px) {
  .ex-grid, .ex-benefits { grid-template-columns: 1fr; }
  .ex-benefits article:first-child { grid-row: auto; }
  .ex-route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-route-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .ex-wrap { padding-inline: 18px; }
  .ex-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-stats article:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .ex-chips a { padding: 10px; gap: 7px; }
  .ex-route { gap: 7px; padding-inline: 7px; }
  .ex-route img, .ex-route-symbol { flex-basis: 22px; width: 22px; height: 22px; }
  .ex-route-copy strong { font-size: .83rem; }
  .ex-chart { min-height: 340px; }
}
@media (max-width: 420px) {
  .ex-steps { grid-template-columns: 1fr; }
}

.ex-prices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-block: 12px; }
.ex-prices .ex-price { margin: 0; }

.ex-comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ex-comparison-grid article { padding: clamp(18px, 2.5vw, 30px); border: 1px solid var(--line); background: white; border-radius: 16px; }
.ex-comparison-grid header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.ex-comparison-grid h3 { margin: 0; }
.ex-comparison-grid small { color: var(--muted); }
.ex-comparison-grid dd { font-variant-numeric: tabular-nums; }
@media (max-width: 680px) { .ex-comparison-grid { grid-template-columns: 1fr; } }

.ex-chart.ex-history { display: block; padding: 18px; }
.ex-history-periods { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.ex-history-periods a { display: inline-block; text-decoration: none; border: 0; background: transparent; color: inherit; padding: 6px 9px; border-radius: 6px; }
.ex-history-periods a[aria-current="true"] { background: var(--accent); color: #172008; }
.ex-history [data-price-series] svg { display: block; width: 100%; height: 160px; margin: 12px 0; color: var(--focus); }
.ex-history[aria-busy="true"] [data-price-series] { opacity: .55; }

.swap-hero .ex-coin-intro { display: flex; flex-direction: column; min-width: 0; }
.swap-hero .ex-coin-intro h1 { font-size: clamp(2.5rem, 4vw, 4.25rem); line-height: 1.06; text-wrap: balance; }
.swap-hero .ex-coin-intro .intro-mission { max-width: 48ch; margin-block: 1rem 0; }
.ex-coin-intro .intro-mission p { margin-block: 0 .5rem; }
.swap-hero .ex-coin-intro .ex-prices { order: 1; margin-block: 1rem 0; padding-top: .85rem; border-top: 1px solid var(--line); }
.swap-hero .ex-coin-intro .ex-price { font-size: .95rem; font-weight: 500; }
.swap-hero .ex-coin-intro .ex-price-delta { background: transparent; padding: 0; }
.swap-hero .ex-coin-intro .ex-price-delta.is-down { color: #ffaaa8; }
.swap-hero .ex-coin-intro .ex-price-delta.is-up { color: #a6df9a; }
