/* ============================================================================
   OnchainUtils — stylesheet
   Theme model: light tokens on bare :root, dark tokens redefined twice —
   once under prefers-color-scheme (guarded so an explicit light choice wins)
   and once under [data-theme="dark"] (so the toggle wins in both directions).
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #f4f6fb;
  --bg-glow: rgba(59, 110, 246, 0.08);
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --surface-3: #eaeef7;
  --border: #e0e5f0;
  --border-strong: #ccd4e5;

  --text: #0f1319;
  --text-dim: #5a6478;
  --text-faint: #8b95a9;

  --accent: #3b6ef6;
  --accent-soft: rgba(59, 110, 246, 0.12);
  --coin: #627eea;

  --good: #0ca678;
  --warn: #e8930c;
  --bad: #e5484d;

  --shadow-sm: 0 1px 2px rgba(15, 19, 25, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 19, 25, 0.07);
  --shadow-lg: 0 16px 48px rgba(15, 19, 25, 0.13);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #0b0d12;
    --bg-glow: rgba(98, 126, 234, 0.1);
    --surface: #12151d;
    --surface-2: #171b25;
    --surface-3: #1e2330;
    --border: #232838;
    --border-strong: #333a4e;

    --text: #e9edf7;
    --text-dim: #97a2b8;
    --text-faint: #6b7691;

    --accent: #6b93ff;
    --accent-soft: rgba(107, 147, 255, 0.16);

    --good: #2bc79a;
    --warn: #f0a92c;
    --bad: #f26d70;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b0d12;
  --bg-glow: rgba(98, 126, 234, 0.1);
  --surface: #12151d;
  --surface-2: #171b25;
  --surface-3: #1e2330;
  --border: #232838;
  --border-strong: #333a4e;

  --text: #e9edf7;
  --text-dim: #97a2b8;
  --text-faint: #6b7691;

  --accent: #6b93ff;
  --accent-soft: rgba(107, 147, 255, 0.16);

  --good: #2bc79a;
  --warn: #f0a92c;
  --bad: #f26d70;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
}

/* ---------- base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 50% -10%, var(--bg-glow), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- layout ---------- */

.shell {
  width: min(100% - 32px, 1160px);
  margin-inline: auto;
  padding-block: 28px 64px;
}

/* Side tool first in the source, so it stacks above the converter on narrow screens. */
.columns {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 940px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- price board ---------- */

/* Tiles that reflow, never a horizontal scroller: auto-fit gives five across at full
   width and drops to four, three, then two as the viewport narrows. */
.board {
  margin-bottom: 16px;
}

.board__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.board__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.board__item:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.board__item.is-current {
  border-color: var(--coin);
  background: color-mix(in srgb, var(--coin) 10%, var(--surface));
}

.board__icon { display: grid; place-items: center; flex: none; }
.board__icon svg { width: 20px; height: 20px; display: block; border-radius: 50%; }

.board__ticker { font-size: 12.5px; font-weight: 640; letter-spacing: -0.005em; }

.board__price {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-dim);
  transition: color .3s ease;
}
.board__price[data-dir="up"] { color: var(--good); }
.board__price[data-dir="down"] { color: var(--bad); }

/* A price the cross-source check distrusts: shown, but never shown plainly. */
.board__price[data-suspect] {
  color: var(--warn);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

@media (max-width: 420px) {
  .board__list { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .board__item { padding: 9px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .board__item:hover { transform: none; }
}

/* ---------- token converter ---------- */

.tool { padding: 16px; }
.tool__title { margin: 0 0 14px; font-size: 14px; font-weight: 640; letter-spacing: -0.01em; }

.swap { display: grid; gap: 6px; }
.swap__row { display: grid; gap: 7px; }

.swap__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.swap__controls:focus-within {
  border-color: var(--coin);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coin) 18%, transparent);
}

.swap__amount {
  width: 100%;
  min-width: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: transparent;
  border: 0;
}
.swap__amount:focus { outline: none; }
.swap__amount::placeholder { color: var(--text-faint); }
.swap__amount[aria-invalid="true"] { color: var(--bad); }

.swap__token .cbx__button { background: var(--surface); }

.swap__flip {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  margin: -9px 0;
  position: relative;
  z-index: 1;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, transform .18s ease;
}
.swap__flip:hover { color: var(--coin); border-color: var(--coin); }
.swap__flip:active { transform: rotate(180deg); }
.swap__flip svg { width: 15px; height: 15px; }

.swap__rate {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-dim);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .swap__flip:active { transform: none; }
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
}

.brand__mark {
  width: 34px; height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--coin), color-mix(in srgb, var(--coin) 55%, #7c5cff));
  box-shadow: var(--shadow-sm);
}
.brand__mark svg { width: 20px; height: 20px; }

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.brand__tag { font-size: 11.5px; color: var(--text-faint); }

/* ---------- segmented control (theme) ---------- */

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.seg__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, color .15s ease;
}
.seg__btn svg { width: 15px; height: 15px; display: block; }
.seg__btn:hover { color: var(--text); }
.seg__btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  appearance: none;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 560px) {
  .head { grid-template-columns: 1fr; }
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 7px;
}

/* ---------- price readout ---------- */

.price {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.price__row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }

.price__value {
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transition: color .35s ease;
}
.price__value.is-up { color: var(--good); }
.price__value.is-down { color: var(--bad); }
.price__value.is-empty { color: var(--text-faint); }

.price__pair { font-size: 12px; color: var(--text-faint); font-weight: 550; }

.price__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-dim);
  min-width: 0;
}
.price__meta strong { font-weight: 600; color: var(--text); }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--text-faint);
}
.dot[data-state="live"] { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.dot[data-state="connecting"] { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.dot[data-state="stale"] { background: var(--warn); }
.dot[data-state="suspect"] { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
.dot[data-state="error"] { background: var(--bad); }
.dot[data-state="unsupported"] { background: var(--border-strong); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .dot[data-state="connecting"] { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------- unit rows ---------- */

.units { padding: 6px 8px; }

.unit {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius);
  transition: background .15s ease;
}
.unit:hover { background: var(--surface-2); }
.unit:not(:last-child) { box-shadow: inset 0 -1px 0 var(--border); }

.unit__meta { min-width: 0; }
.unit__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 570;
  font-size: 14px;
}
.unit__exp {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  background: var(--surface-3);
  border-radius: 5px;
  padding: 1px 5px;
}
.unit__alias {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit__input {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  font-family: var(--mono);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.unit__input:hover { border-color: var(--border-strong); }
.unit__input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--coin);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coin) 20%, transparent);
}
.unit__input[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent);
}
.unit__input::placeholder { color: var(--text-faint); }

.copy {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.copy:hover { color: var(--text); background: var(--surface-3); }
.copy.is-done { color: var(--good); }
.copy svg { width: 15px; height: 15px; }

@media (max-width: 560px) {
  .unit { grid-template-columns: minmax(0, 1fr) auto; }
  .unit__meta { grid-column: 1 / -1; }
}

/* ---------- disclosure + total ---------- */

.more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: calc(100% - 16px);
  margin: 2px 8px 10px;
  padding: 9px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.more:hover { color: var(--text); border-color: var(--coin); }
.more svg { width: 14px; height: 14px; transition: transform .18s ease; }
.more[aria-expanded="true"] svg { transform: rotate(180deg); }

.total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.total__label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.total__sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.total__value {
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.total__value.is-empty { color: var(--text-faint); }

/* ---------- settings modal ---------- */

.modal {
  width: min(100% - 32px, 620px);
  max-height: min(88vh, 860px);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal::backdrop {
  background: rgba(6, 8, 13, 0.55);
  backdrop-filter: blur(3px);
}
.modal[open] { display: flex; flex-direction: column; }

.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.modal__title { margin: 0; font-size: 16px; font-weight: 640; letter-spacing: -0.01em; }
.modal__head .icon-btn { margin-left: auto; flex: none; }

.modal__body {
  padding: 18px;
  display: grid;
  gap: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.settings__block { min-width: 0; }
.settings__title { font-size: 13px; font-weight: 620; margin: 0 0 3px; }
.settings__hint { font-size: 12px; color: var(--text-dim); margin: 0 0 10px; }

.radio-row { display: flex; flex-direction: column; gap: 8px; }

.radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.radio:hover { border-color: var(--border-strong); }
.radio:has(input:checked) { border-color: var(--coin); background: color-mix(in srgb, var(--coin) 7%, transparent); }
.radio input { accent-color: var(--coin); margin-top: 2px; flex: none; }
.radio__body { display: flex; flex-direction: column; gap: 1px; }
.radio__title { font-size: 13.5px; font-weight: 560; }
.radio__desc { font-size: 11.5px; color: var(--text-dim); }

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.source {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s ease, opacity .15s ease;
}
.source:hover { border-color: var(--border-strong); }
.source input { accent-color: var(--coin); flex: none; }
.source__name { font-size: 13px; font-weight: 540; margin-right: auto; }
.source__state { font-size: 10.5px; color: var(--text-faint); text-transform: capitalize; }
.source.is-unsupported { opacity: .5; }
.source.is-primary .source__name::after {
  content: "primary";
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--coin);
  margin-left: 6px;
}

.select {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.select:hover { border-color: var(--border-strong); }

/* ---------- coverage table ---------- */

.cov {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.cov th {
  text-align: left;
  font-size: 10px;
  font-weight: 620;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 8px 7px;
  border-bottom: 1px solid var(--border);
}
.cov td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cov tr:last-child td { border-bottom: 0; }
.cov tr.is-current td { background: color-mix(in srgb, var(--coin) 8%, transparent); }
.cov tr.is-current td:first-child { border-radius: 8px 0 0 8px; }
.cov tr.is-current td:last-child { border-radius: 0 8px 8px 0; }

.cov__coin { display: flex; align-items: center; gap: 8px; }
.cov__coin svg { width: 19px; height: 19px; flex: none; border-radius: 50%; }
.cov__ticker { font-weight: 620; }
.cov__name { color: var(--text-faint); font-size: 11.5px; }

.cov__src { display: flex; align-items: center; gap: 7px; font-weight: 540; }
.cov__src .dot { width: 6px; height: 6px; }
.cov__note {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: 5px;
  padding: 1px 4px;
}
.cov__market { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }

.cov__note.is-bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
}

.cov__providercell { text-align: right; }

.cov__select {
  max-width: 100%;
  padding: 4px 6px;
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
}
.cov__select:hover { border-color: var(--border-strong); color: var(--text); }
.cov__select.is-pinned {
  color: var(--text);
  font-weight: 560;
  border-color: var(--coin);
  background: color-mix(in srgb, var(--coin) 10%, transparent);
}

/* Narrow screens drop the market symbol; the provider picker is the point of the
   table on mobile, so it stays. */
@media (max-width: 560px) {
  .cov__name,
  .cov thead th:nth-child(3),
  .cov td:nth-child(3) { display: none; }
}

/* ---------- combobox (structure owned by combobox.js) ---------- */

.cbx { position: relative; }

.cbx__button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cbx__button:hover { border-color: var(--border-strong); }
.cbx[data-open="true"] .cbx__button {
  border-color: var(--coin);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coin) 18%, transparent);
}

.cbx__icon { flex: none; display: grid; place-items: center; }
.cbx__icon svg { width: 24px; height: 24px; display: block; border-radius: 50%; }

.cbx__ticker { font-weight: 640; font-size: 14.5px; letter-spacing: -0.005em; }
.cbx__name {
  color: var(--text-dim);
  font-size: 12.5px;
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cbx__caret { width: 15px; height: 15px; flex: none; color: var(--text-faint); transition: transform .18s ease; }
.cbx[data-open="true"] .cbx__caret { transform: rotate(180deg); }

.cbx__panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.cbx__searchwrap { padding: 8px; border-bottom: 1px solid var(--border); }

.cbx__search {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
}
.cbx__search:focus { outline: none; border-color: var(--coin); }

.cbx__list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 288px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cbx__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
}
.cbx__option .cbx__name { font-size: 12.5px; }
.cbx__option.is-active { background: var(--surface-3); }
.cbx__option[aria-selected="true"] { color: var(--coin); }
.cbx__option[aria-selected="true"] .cbx__ticker { color: var(--coin); }

.cbx__badge {
  font-size: 9.5px;
  font-weight: 620;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 5px;
  flex: none;
}
.cbx__option.is-active .cbx__badge { background: var(--surface); }

.cbx__empty { margin: 0; padding: 18px; text-align: center; font-size: 13px; color: var(--text-faint); }

.cbx__foot {
  position: relative;
  margin: 0;
  padding: 7px 12px;
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
/* Fades the last row out under the footer so the scroll is legible as a scroll. */
.cbx__foot.has-more::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 26px;
  background: linear-gradient(to top, var(--surface), transparent);
  pointer-events: none;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 540;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
