/* ==========================================================================
   Blockchain Credit DEX Pool — terminal design system
   Dense, instrument-panel aesthetic: deep navy ground, cyan signal accent,
   condensed technical UI type paired with a tabular mono for every figure.
   ========================================================================== */

:root {
  /* Ground — layered off-black navies, never pure black */
  --ground:        #04101d;
  --ground-deep:   #020a13;
  --surface:       #08192b;
  --surface-2:     #0a2038;
  --surface-3:     #0d2942;
  --inset:         #030d18;

  /* Structure */
  --line:          #143550;
  --line-soft:     #0f2840;
  --line-bright:   #1d5477;

  /* Signal */
  --cyan:          #35d9ff;
  --cyan-deep:     #0d94c4;
  --cyan-wash:     rgba(53, 217, 255, 0.09);
  --gold:          #f0b849;

  /* Direction — desaturated so long tables stay readable */
  --up:            #19c08a;
  --up-wash:       rgba(25, 192, 138, 0.12);
  --down:          #ef5f75;
  --down-wash:     rgba(239, 95, 117, 0.12);

  /* Type */
  --ink:           #e4f3fd;
  --ink-2:         #a7c4da;
  --ink-3:         #6c8ca6;
  --ink-4:         #486880;

  --ui:   "Saira", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 18px 44px rgba(1, 7, 14, 0.55);
  --shadow-sm: 0 6px 18px rgba(1, 7, 14, 0.4);

  --header-h: 58px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Faint instrument grid + corner glow: atmosphere without cost, fixed so it
   never repaints while scrolling. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 88% -10%, rgba(53, 217, 255, 0.11), transparent 60%),
    radial-gradient(90% 70% at 0% 100%, rgba(13, 148, 196, 0.08), transparent 62%),
    linear-gradient(transparent 95%, rgba(53, 217, 255, 0.035) 95%) 0 0 / 100% 34px,
    linear-gradient(90deg, transparent 95%, rgba(53, 217, 255, 0.028) 95%) 0 0 / 34px 100%;
}

#app, .page { position: relative; z-index: 1; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(53, 217, 255, 0.28); color: #fff; }

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

/* Every figure in the product is mono + tabular so columns align optically. */
.num, td .num, .mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------------ header */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(4, 14, 26, 0.9);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.masthead-in {
  max-width: 1420px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand b { color: var(--cyan); font-weight: 800; }
/*
 * "POOL" belongs to the name, so it is always in the wordmark. "DEX" is the
 * qualifier: the mark is nowrap next to a nav, a price chip and two buttons,
 * so that one word drops out on the narrowest screens and the pool still
 * reads as "BLOCKCHAINCREDIT POOL".
 */
.brand-suffix {
  display: inline;
  margin-left: 7px;
  padding-left: 8px;
  border-left: 1px solid var(--line-bright);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.brand-dex {
  display: none;
  font-style: normal;
}
.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 7px;
  background: linear-gradient(150deg, var(--cyan), var(--cyan-deep));
  color: #021019;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(53, 217, 255, 0.35), 0 4px 14px rgba(53, 217, 255, 0.22);
}

.mast-nav { display: none; gap: 2px; margin-left: 8px; }
.mast-nav a {
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.mast-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.mast-nav a[aria-current="page"] {
  background: var(--cyan-wash);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(53, 217, 255, 0.22);
}

.mast-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.bcc-chip {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--inset);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.bcc-chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 3px var(--up-wash);
}
.bcc-chip b { color: var(--ink); font-family: var(--mono); }

.burger {
  display: grid;
  place-items: center;
  width: 36px; height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}

.drawer {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--ground-deep);
  padding: 10px 14px 14px;
}
.drawer.open { display: block; }
.drawer nav { display: grid; gap: 6px; }
.drawer nav a {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  font-weight: 600;
}
.drawer nav a[aria-current="page"] { border-color: var(--line-bright); color: var(--cyan); }

/* -------------------------------------------------------------- containers */

.page { max-width: 1420px; margin: 0 auto; padding: 16px 14px 64px; }
.page-narrow { max-width: 760px; }

.crumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--ink-3); margin-bottom: 12px;
}
.crumb a { color: var(--ink-2); }

.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}
.eyebrow-dim { color: var(--ink-3); }

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; color: #f2fbff; font-weight: 700; }
h1 { font-size: 26px; line-height: 1.1; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }

.lede { color: var(--ink-2); font-size: 14px; margin: 8px 0 0; max-width: 62ch; }
.muted { color: var(--ink-3); font-size: 12px; }
.tiny  { color: var(--ink-4); font-size: 11px; }

.section { margin-top: 20px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}

/* ------------------------------------------------------------------ panels */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel-pad { padding: 14px; }
.panel-head {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.panel-inset { background: var(--inset); border-color: var(--line-soft); }

/* ------------------------------------------------------------------ buttons */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform 0.09s ease, background 0.16s ease, border-color 0.16s ease;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(168deg, #4ce0ff, var(--cyan-deep));
  color: #01131c;
  box-shadow: 0 4px 16px rgba(53, 217, 255, 0.2);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(168deg, #6ce8ff, #0fa6db); }

.btn-ghost { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-bright); }

.btn-quiet { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-quiet:hover:not(:disabled) { color: var(--ink); border-color: var(--line-bright); }

.btn-buy   { background: var(--up);   color: #01140d; }
.btn-buy:hover:not(:disabled) { background: #21d69b; }
.btn-sell  { background: var(--down); color: #22060b; }
.btn-sell:hover:not(:disabled) { background: #f4768a; }

.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-lg { padding: 13px 18px; font-size: 14px; }
.btn-block { width: 100%; }

.btn-star {
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-3); width: 34px; height: 32px; padding: 0;
  border-radius: var(--radius-sm); cursor: pointer;
  display: grid; place-items: center;
}
.btn-star:hover { color: var(--gold); border-color: var(--gold); }
.btn-star[aria-pressed="true"] { color: var(--gold); border-color: rgba(240, 184, 73, 0.5); background: rgba(240, 184, 73, 0.1); }

/* ------------------------------------------------------------------- forms */

label, .field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 11px;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 14px;
  outline: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input.num, input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-wash);
}
input[aria-invalid="true"] { border-color: var(--down); }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) calc(50% + 1px), calc(100% - 10px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
textarea { min-height: 74px; resize: vertical; font-size: 13px; line-height: 1.5; }

.field { margin-bottom: 12px; }
.field-row { display: grid; gap: 12px; }
.field-error { color: var(--down); font-size: 11px; margin-top: 5px; min-height: 14px; }

.input-suffix { position: relative; }
.input-suffix input { padding-right: 62px; }
.input-suffix span {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink-3);
  pointer-events: none;
}

.chiprow { display: flex; gap: 6px; flex-wrap: wrap; }
.chiprow .btn-sm { flex: 1; min-width: 58px; }

/* ---------------------------------------------------------------- stat grid */

.statstrip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.statstrip .cell { background: var(--surface); padding: 11px 13px; }
.statstrip .cell small {
  display: block; font-size: 10px; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 4px;
}
.statstrip .cell strong {
  display: block; font-family: var(--mono); font-size: 16px; font-weight: 700;
  color: #f2fbff; letter-spacing: -0.03em;
}

.tilegrid { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
.tile {
  background: var(--inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
.tile small {
  display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 3px;
}
.tile strong {
  display: block; font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--ink);
}
.tile-lg strong { font-size: 19px; }

/* --------------------------------------------------------------- filter bar */

.filterbar {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  background: rgba(4, 14, 26, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 12px;
  display: grid;
  gap: 9px;
}

.segrow { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.segrow::-webkit-scrollbar { display: none; }

.seg {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  padding: 7px 12px;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.seg:hover { color: var(--ink); border-color: var(--line-bright); }
.seg[aria-pressed="true"] {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #01131c;
}
.seg-tf[aria-pressed="true"] { background: var(--surface-3); border-color: var(--cyan); color: var(--cyan); }

.searchwrap { position: relative; }
.searchwrap input { padding-left: 34px; }
.searchwrap svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); pointer-events: none;
}

.filter-adv {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}
.filter-adv.open { display: grid; }
.filter-adv label { margin-bottom: 4px; }
.filter-adv input, .filter-adv select { padding: 8px 10px; font-size: 13px; }

.toggle-row { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.toggle-row label {
  margin: 0; text-transform: none; letter-spacing: 0; font-size: 12px;
  color: var(--ink-2); font-weight: 600; cursor: pointer;
}
input[type="checkbox"] {
  width: 16px; height: 16px; flex: 0 0 16px; padding: 0;
  accent-color: var(--cyan); cursor: pointer;
}

.resultline {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 2px 8px; font-size: 12px; color: var(--ink-3);
}

/* ------------------------------------------------------------ token listing */

.pair {
  display: flex; align-items: center; gap: 9px; min-width: 0;
}
.pair-logo {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 9px;
  background: linear-gradient(155deg, var(--surface-3), var(--inset));
  border: 1px solid var(--line);
  object-fit: cover;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--cyan);
  overflow: hidden;
}
.pair-id { min-width: 0; }
.pair-id b {
  display: block; font-size: 13px; font-weight: 700; color: #f2fbff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pair-id span {
  display: block; font-size: 11px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.rank {
  font-family: var(--mono); font-size: 11px; color: var(--ink-4);
  width: 22px; flex-shrink: 0; text-align: right;
}

.up   { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--ink-3); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--up-wash); color: var(--up);
  box-shadow: inset 0 0 0 1px rgba(25, 192, 138, 0.28);
  white-space: nowrap;
}
.badge-dry { background: var(--down-wash); color: var(--down); box-shadow: inset 0 0 0 1px rgba(239, 95, 117, 0.3); }
.badge-new { background: rgba(240, 184, 73, 0.12); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(240, 184, 73, 0.3); }
.badge-verified { background: var(--cyan-wash); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(53, 217, 255, 0.3); }
.badge-ledger { background: var(--surface-3); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-bright); }

/* Mobile-first card list */
.cardlist { display: grid; gap: 8px; }

.tokencard {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-bright);
  border-radius: var(--radius);
  padding: 11px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.09s ease;
}
.tokencard:hover { border-color: var(--line-bright); border-left-color: var(--cyan); background: var(--surface-2); }
.tokencard:active { transform: translateY(1px); }
.tokencard.is-up   { border-left-color: var(--up); }
.tokencard.is-down { border-left-color: var(--down); }

.tokencard-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 9px;
}
.tokencard-price { text-align: right; flex-shrink: 0; }
.tokencard-price b {
  display: block; font-family: var(--mono); font-size: 14px; font-weight: 700; color: #f2fbff;
}
.tokencard-price span { font-family: var(--mono); font-size: 11px; font-weight: 700; }

.microgrid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); overflow: hidden;
}
.microgrid div { background: var(--inset); padding: 6px 8px; }
.microgrid small {
  display: block; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 2px;
}
.microgrid b { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink-2); }

/* Desktop table */
.tablewrap { display: none; }

table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky;
  top: calc(var(--header-h) + 1px);
  z-index: 10;
  background: var(--surface-2);
  padding: 9px 12px;
  text-align: right;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
thead th:first-child, thead th.left { text-align: left; }
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--cyan); }
thead th .arrow { color: var(--cyan); font-size: 9px; }

tbody tr {
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s ease;
}
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child { border-bottom: 0; }

tbody td {
  padding: 9px 12px;
  text-align: right;
  font-size: 13px;
  white-space: nowrap;
  color: var(--ink);
}
tbody td:first-child, tbody td.left { text-align: left; }
tbody td.pct { font-family: var(--mono); font-weight: 700; }

/* ---------------------------------------------------------- pressure bars */

.pressure { margin-top: 6px; }
.pressure-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; color: var(--ink-3); margin-bottom: 4px;
}
.pressure-head b { font-family: var(--mono); font-size: 12px; }
.pressure-track {
  height: 5px; border-radius: 3px; overflow: hidden;
  display: flex; background: var(--down); gap: 1px;
}
.pressure-fill { background: var(--up); height: 100%; }

/* ----------------------------------------------------------------- chart */

.chartbox { position: relative; height: 260px; padding: 10px 4px 0; }
.chartbox canvas { display: block; }

/* -------------------------------------------------------------- trade feed */

.feed { display: grid; gap: 1px; background: var(--line-soft); }
.feedrow {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 9px;
  align-items: center;
  background: var(--surface);
  padding: 8px 12px;
  font-size: 12px;
}
.feedrow .side {
  font-family: var(--mono); font-size: 10px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.feedrow .amt { font-family: var(--mono); color: var(--ink-2); }
.feedrow .who { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.feedrow .when { font-family: var(--mono); font-size: 11px; color: var(--ink-4); text-align: right; }

/* ------------------------------------------------------------ swap terminal */

.swapcard {
  background: linear-gradient(178deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 11px;
}

.sidetoggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--inset); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 4px;
}
.sidetoggle button {
  background: transparent; border: 0; border-radius: 5px;
  padding: 9px; color: var(--ink-3);
  font-family: var(--ui); font-size: 13px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidetoggle button[aria-pressed="true"] { background: var(--up); color: #01140d; }
.sidetoggle button[data-side="sell"][aria-pressed="true"] { background: var(--down); color: #22060b; }

.quote {
  background: var(--inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: grid;
  gap: 6px;
  font-size: 12px;
}
.quote-row { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-3); }
.quote-row b { font-family: var(--mono); color: var(--ink); font-weight: 700; }
.quote-out b { font-size: 17px; color: var(--cyan); }

.note {
  border-left: 2px solid var(--cyan);
  background: rgba(53, 217, 255, 0.06);
  padding: 9px 11px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}
.note-warn { border-left-color: var(--gold); background: rgba(240, 184, 73, 0.07); }
.note-bad  { border-left-color: var(--down); background: var(--down-wash); color: #f7b9c3; }

/* --------------------------------------------------------- states & skeleton */

.empty {
  text-align: center;
  padding: 44px 20px;
  border: 1px dashed var(--line-bright);
  border-radius: var(--radius);
  background: var(--inset);
}
.empty-mark {
  width: 42px; height: 42px; margin: 0 auto 12px;
  border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--cyan); border: 1px solid var(--line-bright);
}
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--ink-3); font-size: 13px; margin: 0 auto 16px; max-width: 42ch; }

@keyframes shimmer { to { background-position-x: -200%; } }
.skel {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface) 40%, var(--surface-3) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skel-row { height: 74px; margin-bottom: 8px; }
.skel-line { height: 11px; margin-bottom: 7px; }

/* ------------------------------------------------------------------ toasts */

.toaster {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 90;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.toast {
  pointer-events: auto;
  background: var(--surface-2);
  border: 1px solid var(--line-bright);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  box-shadow: var(--shadow);
  animation: toast-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast b { display: block; font-size: 13px; margin-bottom: 2px; color: #f2fbff; }
.toast p { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.toast-ok  { border-left-color: var(--up); }
.toast-bad { border-left-color: var(--down); }

/* ------------------------------------------------------------------ modals */

.scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(2, 9, 17, 0.82);
  backdrop-filter: blur(7px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.scrim.open { display: flex; }
@keyframes sheet-up { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet {
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 16px;
  animation: sheet-up 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.sheet-close {
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); width: 30px; height: 30px; border-radius: var(--radius-sm);
  cursor: pointer; flex-shrink: 0; display: grid; place-items: center;
}

/* --------------------------------------------------------------- buy page */

/*
 * The buy form reads best in a narrow column, but the BCC market section
 * underneath it needs the full width for the token/BCC pairs table, so the
 * page itself is wide and only the top block is constrained.
 */
.page-buy { max-width: 1140px; }
.buy-top { max-width: 760px; }

/* Ten columns of pair stats can still outgrow a laptop, so this one table
 * scrolls sideways instead of clipping. */
.tablewrap-x { overflow-x: auto; }

/* ------------------------------------------------------------------- misc */

.hr { height: 1px; background: var(--line-soft); border: 0; margin: 12px 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: grid; gap: 10px; }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.addr { font-family: var(--mono); font-size: 11px; color: var(--ink-3); word-break: break-all; }
.hide { display: none !important; }

.linkchips { display: flex; gap: 6px; flex-wrap: wrap; }
.linkchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--inset);
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.linkchip:hover { border-color: var(--cyan); color: var(--cyan); text-decoration: none; }

footer.foot {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 20px 14px 34px;
  text-align: center;
  color: var(--ink-4);
  font-size: 11px;
  line-height: 1.7;
}
footer.foot b { color: var(--ink-2); }

/* ----------------------------------------------------------- API page */

/*
 * The API page is a reference: a reader is either reading a figure or copying
 * a URL, so every URL is monospaced, selectable and sits next to its own copy
 * button rather than being buried in prose.
 */
.api-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px 10px;
  background: var(--inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.api-row-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.api-row-id b { font-size: 12px; }
.api-url {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  word-break: break-all;
  user-select: all;
}
.api-copy { flex-shrink: 0; }

.api-kvgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.api-kv {
  background: var(--inset);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  min-width: 0;
}
.api-kv small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 2px;
}
.api-kv b { font-size: 12px; font-weight: 700; color: var(--ink); word-break: break-word; }

.api-pair { overflow: hidden; }
.api-pair-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.api-pair-head:hover { background: var(--surface-2); }
.api-pair-head code { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.api-pair-figs { display: none; margin-left: auto; gap: 18px; }
.api-pair-figs span { display: flex; flex-direction: column; text-align: right; }
.api-pair-figs small {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.api-pair-figs b { font-family: var(--mono); font-size: 13px; }
.api-chev { color: var(--ink-3); margin-left: auto; flex-shrink: 0; }
.api-pair-figs + .api-chev { margin-left: 0; }
.api-pair-head[aria-expanded="true"] .api-chev { color: var(--cyan); transform: rotate(90deg); }
.api-pair-body { padding: 0 14px 14px; border-top: 1px solid var(--line-soft); }
.api-pair-body .panel-head { margin-top: 4px; }

.api-endpoint {
  padding: 9px 10px;
  background: var(--inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.api-endpoint-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.api-endpoint p { margin: 6px 0 0; color: var(--ink-2); }
.api-endpoint .api-url { grid-column: auto; flex: 1; min-width: 180px; }

/* ------------------------------------------------------------- breakpoints */

@media (min-width: 560px) {
  .brand-dex { display: inline; margin-right: 5px; }
  .api-kvgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .api-row { grid-template-columns: 200px 1fr auto; }
  .api-row .api-url { grid-column: auto; }
  .statstrip { grid-template-columns: repeat(4, 1fr); }
  .tilegrid { grid-template-columns: repeat(3, 1fr); }
  .field-row { grid-template-columns: 1fr 1fr; }
  .filter-adv { grid-template-columns: repeat(3, 1fr); }
  .toaster { left: auto; right: 16px; bottom: 16px; width: 348px; }
  .scrim { align-items: center; padding: 16px; }
  .sheet { border-radius: var(--radius); max-width: 560px; }
}

@media (min-width: 900px) {
  h1 { font-size: 34px; }
  .page { padding: 22px 18px 72px; }
  .mast-nav { display: flex; }
  .api-pair-figs { display: flex; }
  .bcc-chip { display: inline-flex; }
  .burger { display: none; }
  .drawer { display: none !important; }
  .filterbar { grid-template-columns: auto 1fr auto; align-items: center; }
  .filter-adv { grid-column: 1 / -1; }
  .tilegrid { grid-template-columns: repeat(4, 1fr); }
  .chartbox { height: 330px; }
}

@media (min-width: 1080px) {
  .cardlist { display: none; }
  .tablewrap {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .split-terminal { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
  .split-info { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .split-launch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); gap: 16px; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
