/* The original Quelmint styles are loaded before these application bindings. */
:root {
  --surface: var(--paper);
  --white: var(--paper);
  --sheet: var(--soft);
  --dark: var(--ink);
  --muted: var(--ink-2);
  --sage: #65518b;
  --sage-soft: var(--mist);
  --focus: #65518b;
  --f-display: "Lexend", "Kontur Sans", system-ui, sans-serif;
  --f-body: "Work Sans", "Kontur Sans", system-ui, sans-serif;
  --mono: var(--f-body);
}

.shell {
  width: min(var(--container), calc(100% - 2 * var(--gutter)));
}

.site-header { background: var(--paper); border-color: var(--line); }
.site-header .header {
  position: static;
  display: flex;
  justify-content: space-between;
  gap: clamp(.5rem, 2vw, 1.5rem);
  min-height: 4.7rem;
}
.brand-logo { width: clamp(7.5rem, 11vw, 9.5rem); height: auto; flex: none; }
.footer-brand .brand-logo { width: 8.5rem; }
.site-header .header > nav { align-self: center; gap: .24rem; }
.site-header .header > nav button {
  min-height: 40px;
  padding: .48rem clamp(.48rem, 1vw, .9rem);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  color: var(--ink);
  font: 500 var(--t-sm)/1.2 var(--f-display);
}
.site-header .header > nav button::after { content: none; }
.site-header .header > nav button:hover { background: var(--soft); }
.site-header .header > nav button.active { border-color: var(--line-2); background: var(--mist); }
#account-button {
  max-width: 13rem;
  padding-inline: .9rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
}
#account-button:hover { background: var(--soft); color: var(--ink); }
.account-menu { border-color: var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-float); }
.account-menu button { border-radius: var(--r-sm); }

.button, .rate-action {
  border-color: var(--line-2);
  border-radius: var(--r-pill);
  background: var(--paper);
}
.button.secondary:hover:enabled, .rate-action:hover:enabled { background: var(--mist); color: var(--ink); }
.button.primary, .exchange-panel .primary { border-radius: var(--r-md); }
.button.primary:hover:enabled { background: #2a2536; border-color: #2a2536; }
.input { border: 1px solid var(--line); }
.input::placeholder { color: var(--ink-3); }
.panel, .order-card { border-color: var(--line); border-radius: var(--r-lg); }
.empty, .stat { border-color: var(--line); border-radius: var(--r-md); background: var(--soft); }

.exchange-hero.canvas { padding-block: clamp(1.75rem, 4vw, 3.2rem) clamp(1.4rem, 4vw, 3.4rem); }
.exchange-hero .hero__copy { margin-bottom: 0; padding-top: 0; gap: .75rem; }
.exchange-hero .hero__copy h1 { font-size: var(--t-hero); font-weight: 560; }
.exchange-hero .hero__lede { max-width: 34rem; }
.exchange-grid.hero__stage {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3.5rem);
  max-width: 990px;
  margin-top: clamp(1.75rem, 3.5vw, 3.25rem);
  padding-block: 0;
}
.exchange-grid.hero__stage:has(#hero-market[hidden]) { grid-template-columns: minmax(0, 1fr); max-width: 620px; }
.exchange-grid .ccard { min-width: 0; padding: clamp(1.15rem, 2.35vw, 1.75rem); }
.hero-market-label { flex-wrap: wrap; gap: .5rem; color: var(--ink-2); font-size: var(--t-sm); }
.hero-price {
  margin-top: .85rem;
  font: 560 clamp(1.8rem, 4vw, 3.15rem)/1.15 var(--f-display);
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.hero-price[data-direction=up] { color: var(--up); }
.hero-price[data-direction=down] { color: var(--down); }
.hero-chart { margin: .6rem 0 .85rem; }
.hero-chart canvas { display: block; width: 100%; height: clamp(5.5rem, 11vw, 8rem); }
.hero-chart figcaption { display: grid; gap: .15rem; color: var(--ink-2); font-size: var(--t-xs); }
.hero-chart output { min-height: 1.4em; font-variant-numeric: tabular-nums; }
.hero-assets { display: flex; flex-wrap: wrap; gap: .35rem; }
.hero-assets .btn[aria-pressed=true] { color: var(--paper); background: var(--ink); }

.exchange-panel.swapbox { padding: clamp(.8rem, 2vw, 1.3rem); }
.exchange-band {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  overflow: visible;
  background: transparent;
  border: 0;
}
.exchange-band .amount-box {
  min-height: 0;
  padding: .75rem clamp(.65rem, 2vw, 1rem);
  gap: .35rem .55rem;
  border: 1px solid transparent;
}
.exchange-band .amount-box:focus-within { border-color: var(--ink); }
.amount-caption { color: var(--ink-2); font-size: var(--t-sm); font-weight: 530; }
#calc-amount, #calc-result {
  font: 540 clamp(1.16rem, 3vw, 2.15rem)/1.1 var(--f-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.amount-box .token-select {
  justify-content: start;
  min-height: 46px;
  width: clamp(7.2rem, 12vw, 9.2rem);
  padding: .4rem .48rem;
  gap: .15rem .36rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper);
}
.amount-box .token-select:hover:enabled { border-color: var(--ink); }
.token-select .coin { width: 1.75rem; height: 1.75rem; }
.token-select strong { font-size: .92rem; }
.token-select .chevron { margin-inline: .1rem; }
.token-select .network { color: var(--ink-2); font-size: .66rem; }
.swap-rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding-inline: .55rem;
  min-height: 43px;
}
#amount-range { width: 100%; min-width: 0; margin: 0; accent-color: var(--sage); }
.swap-rule #swap-direction {
  width: 2.85rem;
  height: 2.85rem;
  margin: -.1rem 0;
  border: 4px solid var(--paper);
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
}
.swap-rule #swap-direction:hover:enabled { background: #2a2536; transform: rotate(180deg); }
.rate-line {
  order: 5;
  min-height: 0;
  padding: .48rem .42rem .1rem;
  justify-content: space-between;
  border-top: 0;
  text-transform: none;
  letter-spacing: 0;
}
.rate-line strong { text-align: right; }
.rounding-note { order: 6; padding: .3rem .4rem; background: var(--soft); border: 0; border-radius: var(--r-sm); }
.quote-actions { display: block; padding: .65rem 0 0; }
.quote-buttons { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: .45rem; }
.quote-buttons .button { min-height: 46px; padding-inline: .45rem; border-radius: var(--r-md); font-size: var(--t-sm); }
.quote-buttons #continue-exchange { margin: 0; }
.quote-disclosure summary { width: fit-content; min-height: 34px; padding: .25rem .4rem; color: var(--ink-2); font-size: var(--t-sm); }
.quote-disclosure .quote-panel { padding-inline: .4rem; }
.quote-facts { background: var(--soft); border: 0; border-radius: var(--r-sm); }
.quote-facts > div + div { border-color: var(--line); }

.market { padding-block: clamp(2.1rem, 5vw, 4rem); }
.market-heading h2 { font-size: var(--t-xl); scroll-margin-top: 5.5rem; }
.ticker-table .action-col { width: 16%; }
.ticker-table .direction-col { width: 53%; }
.ticker-table th, .ticker-table td { border-color: var(--line); }
.ticker-table tbody td { height: 74px; }
.ticker-table tbody td:first-child::before { content: none; }
.ticker-table tbody tr.is-selected { background: var(--soft); box-shadow: inset 2px 0 var(--orchid); }
.ticker-table tbody tr:focus-within { background: var(--mist); }
.route-identity small { color: var(--ink-2); }
.route-selected { color: var(--sage); }
.market-action { --action-width: 5.125rem; }
.market-action :is(.rate-action, .route-selected) {
  inline-size: var(--action-width);
  min-inline-size: 0;
  min-block-size: 2.5rem;
  justify-content: center;
  padding-inline: .35rem;
  vertical-align: middle;
}

.market-tape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--container), calc(100% - 2 * var(--gutter)));
  min-height: 3.375rem;
  margin: 1.15rem auto 0;
  border-block: 1px solid var(--line);
  padding-block: .5rem;
}
.market-tape.is-awaiting { visibility: hidden; }
.market-tape-viewport { min-width: 0; overflow: hidden; }
.market-tape-track, .market-tape ul, .tape-item { display: flex; align-items: center; }
.market-tape-track { width: max-content; animation: quelmint-ticker 26s linear infinite; }
.market-tape:is(.is-paused,.is-awaiting) .market-tape-track { animation-play-state: paused; }
.tape-item { gap: .45rem; padding-inline: .65rem 1.5rem; font-size: var(--t-sm); white-space: nowrap; }
.tape-item span { min-inline-size: 13ch; font-variant-numeric: tabular-nums; }
.tape-item .coin { width: 1.3rem; height: 1.3rem; }
.tape-pause { min-height: 36px; padding-inline: .65rem; border-radius: var(--r-pill); background: var(--soft); font-size: var(--t-sm); }
@keyframes quelmint-ticker { to { transform: translateX(-50%); } }

.inner-view:not(.quelmint-admin) > .section-heading,
.inner-view:not(.quelmint-admin) > .legal-heading {
  margin-block: 1.25rem;
  padding: clamp(1.15rem, 3vw, 2.25rem);
  border-radius: var(--r-xl);
  background: var(--mesh);
}
.section-heading h1, .legal-heading h1 { font-size: var(--t-2xl); letter-spacing: -.035em; }
.legal-heading h1 { overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .legal-heading h1 { font-size: clamp(1.45rem, 7.2vw, 2.25rem); }
}
.footer {
  width: auto;
  margin: 1.7rem var(--inset) var(--inset);
  padding: clamp(1.35rem, 4vw, 3.2rem);
  border-radius: var(--r-xl);
  color: var(--ink-2);
  background: var(--soft);
}
.footer-links strong { color: var(--ink); }
.footer-links a { min-width: 0; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--ink-2); text-decoration: underline; }
.view-entering { animation: section-enter 280ms var(--ease) both; }

@media (max-width: 800px) {
  .site-header .header { min-height: 4rem; }
  .site-header .header > nav { display: none; }
  .mobile-menu { order: 1; }
  .mobile-menu summary { border-radius: 50%; background: var(--soft); }
  .mobile-menu nav { background: var(--paper); border-color: var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-float); }
  .mobile-menu a { color: var(--ink); border-radius: var(--r-sm); }
  .mobile-menu a:hover, .mobile-menu a[aria-current=page] { color: var(--ink); background: var(--mist); }
  .exchange-grid.hero__stage { grid-template-columns: minmax(0, 1fr); max-width: 540px; }
  .exchange-grid .exchange-panel { grid-row: 1; }
  .ticker-table tbody td { height: auto; }
  .market-terms { display: grid; }
  .market-heading h2 { scroll-margin-top: 1rem; }
}
@media (max-width: 390px) {
  .exchange-hero .exchange-grid { padding-inline: .75rem; }
  .token-select .coin { width: 1.35rem; height: 1.35rem; }
  .amount-box .token-select { width: 6.85rem; }
  .amount-box .token-select .network { font-size: .61rem; }
  .market-action { --action-width: 4.75rem; }
}
@media (max-width: 355px) {
  .exchange-band .amount-caption { grid-column: 1; }
  .amount-box .token-select { grid-row: 1; }
  #calc-amount, #calc-result { grid-column: 1 / -1; }
}
@media (360px <= width <= 480px) {
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1rem; }
  .footer-links > div { padding-bottom: 0; border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .market-tape-track { animation: none; }
  .market-tape ul[aria-hidden=true], .tape-pause { display: none; }
  .market-tape-viewport { overflow-x: auto; }
}
