/* ============================================================
   Spread Radar — оформление
   ============================================================ */

:root {
  /* поверхности: чем выше слой, тем светлее */
  --bg: #05070c;
  --bg-2: #080b12;
  --surface: #0d1119;
  --surface-2: #111724;
  --surface-3: #161d2c;

  --line: #1c2434;
  --line-soft: #151c28;
  --line-bright: #2a3448;

  --text: #e8eefb;
  --text-2: #aab6cc;
  --muted: #6e7c95;

  --green: #2ee6a8;
  --green-deep: #0f9d72;
  --red: #ff5d78;
  --red-deep: #b83553;
  --amber: #ffc061;
  --blue: #5eaaff;
  --violet: #a98bff;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .3);
  --inset: inset 0 1px 0 rgba(255, 255, 255, .04);
  --ease: cubic-bezier(.22, .68, .35, 1);

  --sticky-top: 88px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

::selection { background: rgba(46, 230, 168, .25); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.5 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 620px at 8% -12%, rgba(46, 230, 168, .13), transparent 62%),
    radial-gradient(1000px 560px at 88% -14%, rgba(94, 170, 255, .12), transparent 60%),
    radial-gradient(900px 700px at 55% 105%, rgba(169, 139, 255, .07), transparent 65%),
    var(--bg);
}

h1 { font-size: 18px; margin: 0; letter-spacing: -.2px; font-weight: 650; }
a { color: var(--blue); text-decoration-color: rgba(94, 170, 255, .35); }
a:hover { text-decoration-color: currentColor; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

.dim { color: var(--muted); font-size: 12px; }

/* Числа везде одинаковой ширины — иначе таблица «дышит» на каждом обновлении. */
.num, .pct, .price, .stat b, .hstat b, td { font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #232c3d; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #303c52; }

/* ---------------------------- шапка ---------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: linear-gradient(180deg, rgba(8, 11, 18, .92), rgba(8, 11, 18, .72));
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 13px; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 20px;
  color: #04140e;
  text-decoration: none;
  background: linear-gradient(145deg, var(--green), #4fd6ff);
  box-shadow: 0 0 0 1px rgba(46, 230, 168, .35), 0 6px 22px rgba(46, 230, 168, .28);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.logo:hover { transform: translateY(-1px) scale(1.03); box-shadow: 0 0 0 1px rgba(46, 230, 168, .5), 0 10px 28px rgba(46, 230, 168, .38); }

.stats { display: flex; gap: 8px; margin-left: auto; }
.stat {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .022);
  border: 1px solid var(--line-soft);
}
.stat b { font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
.stat span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }

.live {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-2);
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .022);
  border: 1px solid var(--line-soft);
}
.live .age { color: var(--muted); font-variant-numeric: tabular-nums; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); position: relative; }
.dot::after {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%; border: 1px solid currentColor;
  opacity: 0; animation: ping 2.4s var(--ease) infinite;
}
.dot.on { background: var(--green); color: var(--green); box-shadow: 0 0 10px rgba(46, 230, 168, .8); }
.dot.off { background: var(--red); color: var(--red); }
.dot.off::after { animation: none; }
@keyframes ping {
  0% { transform: scale(.7); opacity: .9; }
  70% { transform: scale(2.1); opacity: 0; }
  100% { opacity: 0; }
}

/* ---------------------------- вкладки ---------------------------- */

.tabs { display: flex; gap: 4px; padding: 14px 24px 0; }
.tab {
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 9px 16px;
  border-radius: 11px 11px 0 0;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.tab.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  border-bottom-color: transparent;
}
.tab.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green), var(--blue));
}
.tab-count:not(:empty) {
  display: inline-block; margin-left: 7px; padding: 0 7px;
  border-radius: 999px; background: var(--green); color: #04140e;
  font-size: 11px; font-weight: 700;
}

/* ---------------------------- фильтры и чипы ---------------------------- */

.filters {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end;
  padding: 14px 24px;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1 1 220px; max-width: 300px; }
.field span, .bfield span {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .8px; font-weight: 500;
}

input, select {
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
input::placeholder { color: #55617a; }
input:hover, select:hover { border-color: var(--line-bright); }
input:focus, select:focus {
  outline: none;
  border-color: rgba(46, 230, 168, .55);
  background: rgba(46, 230, 168, .05);
  box-shadow: 0 0 0 3px rgba(46, 230, 168, .12);
}
.field input { width: 128px; }
.field.grow input { width: 100%; }

.check {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-2); cursor: pointer; padding-bottom: 9px;
}
.check:hover { color: var(--text); }
.check input { accent-color: var(--green); width: 15px; height: 15px; }

.chips { display: flex; flex-wrap: wrap; gap: 18px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-bright); transform: translateY(-1px); }
.chip.on {
  color: #04140e; font-weight: 600; border-color: transparent;
  background: linear-gradient(140deg, var(--green), #52dcc4);
  box-shadow: 0 3px 12px rgba(46, 230, 168, .25);
}
.chip.market.on {
  background: linear-gradient(140deg, var(--blue), var(--violet));
  color: #050c19;
  box-shadow: 0 3px 12px rgba(94, 170, 255, .25);
}
.chip.err { border-color: rgba(255, 93, 120, .5); color: var(--red); }

/* ---------------------------- конструктор связки ---------------------------- */

.builder-bar { padding: 14px 24px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.builder-bar-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 11px; }
.builder-bar-title { font-weight: 650; font-size: 13px; letter-spacing: -.1px; }
.builder-bar-title::before {
  content: '⚡'; margin-right: 7px; filter: saturate(1.4);
}
.builder-host { padding: 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }

.builder-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.bfield { display: flex; flex-direction: column; gap: 6px; }
.builder input { width: 118px; }
.builder input.token { text-transform: uppercase; letter-spacing: .6px; font-weight: 500; }
.builder select { min-width: 132px; }
.b-arrow { color: var(--line-bright); font-size: 17px; padding-bottom: 9px; }
.b-actions { display: flex; gap: 8px; margin-left: auto; }

.btn {
  background: linear-gradient(140deg, var(--green), #4fd6c0);
  border: none; border-radius: var(--radius-sm); color: #04140e;
  padding: 10px 17px; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 3px 14px rgba(46, 230, 168, .22);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), filter .16s var(--ease);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 6px 20px rgba(46, 230, 168, .3); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
  color: var(--text-2); font-weight: 500; padding: 6px 13px; box-shadow: none;
}
.btn.ghost:hover { color: var(--text); border-color: var(--line-bright); filter: none; }
.b-open:not([href]) { opacity: .35; pointer-events: none; box-shadow: none; }

.builder-preview {
  margin-top: 12px; font-size: 13px; color: var(--text-2);
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.builder-preview b { font-weight: 650; }
.builder-preview.ok {
  border-color: rgba(46, 230, 168, .3);
  background: linear-gradient(90deg, rgba(46, 230, 168, .07), rgba(46, 230, 168, .01));
  color: var(--text);
}
.builder-preview.bad {
  border-color: rgba(255, 93, 120, .35);
  background: linear-gradient(90deg, rgba(255, 93, 120, .07), rgba(255, 93, 120, .01));
  color: var(--red);
}
.url-hint { color: var(--muted); font-size: 12px; padding: 16px 18px 0; margin: 0; line-height: 1.9; }
.url-hint a { text-decoration: none; }

/* ---------------------------- панели и таблица ---------------------------- */

main { padding: 20px 24px 70px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: clip; /* не hidden: hidden сделал бы панель скролл-контейнером и сломал липкую шапку */
  box-shadow: var(--shadow), var(--inset);
}
.panel.pad { padding: 18px; }
.hidden { display: none; }

.grid { width: 100%; border-collapse: collapse; }
.grid thead th {
  position: sticky; top: var(--sticky-top); z-index: 5;
  background: linear-gradient(180deg, #131a27, #10161f);
  text-align: left;
  font-size: 10px;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.grid th.num, .grid td.num { text-align: right; }
.sortable { cursor: pointer; user-select: none; transition: color .15s var(--ease); }
.sortable:hover { color: var(--text); }
.sortable.sorted { color: var(--green); }
.sortable.sorted::after { content: ' ▼'; font-size: 8px; }
.sortable.sorted.asc::after { content: ' ▲'; }

.grid tbody tr { border-bottom: 1px solid var(--line-soft); transition: background .14s var(--ease); }
.grid tbody tr.row { cursor: pointer; }
.grid tbody tr.row:hover { background: linear-gradient(90deg, rgba(46, 230, 168, .05), rgba(255, 255, 255, .025)); }
.grid td { padding: 9px 14px; }

.pair { font-weight: 600; letter-spacing: -.1px; white-space: nowrap; }
.pair small { color: var(--muted); font-weight: 400; margin-left: 5px; font-size: 10px; letter-spacing: .4px; }
.pair .open {
  color: var(--muted); text-decoration: none; margin-left: 8px;
  font-size: 12px; opacity: 0; transition: opacity .16s var(--ease), color .16s var(--ease);
}
.grid tbody tr:hover .open { opacity: 1; }
.pair .open:hover { color: var(--green); }

.venue { display: inline-flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.venue .name { font-weight: 500; }
.venue .mk {
  font-size: 9px; text-transform: uppercase; letter-spacing: .7px; font-weight: 600;
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--muted);
}
.venue .mk.futures { color: var(--violet); border-color: rgba(169, 139, 255, .32); background: rgba(169, 139, 255, .08); }
.venue .mk.spot { color: var(--blue); border-color: rgba(94, 170, 255, .32); background: rgba(94, 170, 255, .08); }
.price { color: var(--text-2); margin-left: 9px; font-size: 12px; }

/* Проценты — плашки, насыщенность растёт вместе со спредом (--i задаётся в разметке). */
.pct { font-weight: 650; }
td.pct {
  border-radius: 8px;
  background: rgba(46, 230, 168, calc(var(--i, 0) * .16));
}
td.pct.neg { background: rgba(255, 93, 120, calc(var(--i, 0) * .16)); }
.pct.pos { color: var(--green); }
.pct.neg { color: var(--red); }
.pct.zero { color: var(--muted); }
.fee { color: var(--muted); font-size: 12px; }

.badge-i {
  font-size: 9px; color: var(--amber); text-transform: uppercase; letter-spacing: .5px;
  border: 1px solid rgba(255, 192, 97, .35); background: rgba(255, 192, 97, .08);
  border-radius: 5px; padding: 1px 5px; margin-left: 6px;
}
.badge-o { color: var(--red); border-color: rgba(255, 93, 120, .35); background: rgba(255, 93, 120, .08); }

.th-spark { width: 74px; }
.spark-cell { width: 74px; padding: 6px 14px 6px 0; }
.spark { width: 62px; height: 22px; display: block; }
.spark path { fill: none; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.spark.up path { stroke: var(--green); }
.spark.down path { stroke: var(--red); }
.spark-empty { color: #333c4e; font-size: 11px; }

/* ---------------------------- раскрытая строка ---------------------------- */

.detail td { background: linear-gradient(180deg, #0a0e16, #0c1119); padding: 0; }
.detail-inner { padding: 16px 18px; }
.detail-inner .cards { display: flex; flex-wrap: wrap; gap: 9px; }
.q {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 13px;
  min-width: 196px;
  background: var(--surface-2);
  transition: transform .16s var(--ease), border-color .16s var(--ease);
}
.q:hover { transform: translateY(-2px); border-color: var(--line-bright); }
.q .top { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 6px; }
.q .nums { display: flex; gap: 14px; font-size: 12px; font-variant-numeric: tabular-nums; }
.q .nums b { font-weight: 650; }
.q .bid b { color: var(--green); }
.q .ask b { color: var(--red); }
.q .meta { color: var(--muted); font-size: 11px; margin-top: 5px; }
.q.best-buy { border-color: rgba(46, 230, 168, .45); box-shadow: 0 0 0 1px rgba(46, 230, 168, .12) inset, 0 4px 16px rgba(46, 230, 168, .1); }
.q.best-sell { border-color: rgba(255, 93, 120, .45); box-shadow: 0 0 0 1px rgba(255, 93, 120, .12) inset, 0 4px 16px rgba(255, 93, 120, .1); }

.empty { color: var(--muted); text-align: center; padding: 32px; margin: 0; }

/* ---------------------------- график ---------------------------- */

.chart { width: 100%; margin-bottom: 14px; --chart-h: 160px; }
.chart-head {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  font-size: 11px; color: var(--muted); margin-bottom: 9px;
}
.chart-head b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 650; }
.chart-head .title {
  text-transform: uppercase; letter-spacing: .9px; color: var(--text);
  font-weight: 600; font-size: 11px;
}
.chart-head .spacer { margin-left: auto; }

.tf-group {
  display: inline-flex; gap: 2px; padding: 3px;
  border-radius: 9px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
}
.tf-group:not(:last-child) { margin-left: 0; }
.chart-head .spacer + .tf-group { margin-left: 0; }
.tf {
  border: none; background: transparent; color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 500;
  padding: 4px 10px; border-radius: 7px; cursor: pointer;
  transition: all .15s var(--ease);
}
.tf:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.tf.on { color: #04140e; background: linear-gradient(140deg, var(--green), #4fd6c0); font-weight: 650; }
.tf.empty { opacity: .4; }

.chart-body { display: flex; gap: 9px; }
.chart-plot { flex: 1; min-width: 0; position: relative; }

/* Подписи осей — обычный HTML: внутри растянутого viewBox текст расплющило бы. */
.chart-yaxis {
  position: relative; width: 56px; height: var(--chart-h); flex: none;
  font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.chart-yaxis span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }

.chart-svg {
  display: block; width: 100%; height: var(--chart-h);
  background: linear-gradient(180deg, #090d15, #0b1019);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.chart-svg .line { fill: none; stroke: var(--green); stroke-width: 1.8px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart-svg .line.neg { stroke: var(--red); }
.chart-svg .area { stroke: none; }
.chart-svg .band { fill: rgba(46, 230, 168, .13); stroke: none; }
.chart-svg .fill-top { stop-color: rgba(46, 230, 168, .3); }
.chart-svg .fill-top.neg { stop-color: rgba(255, 93, 120, .3); }
.chart-svg .fill-bottom { stop-color: rgba(46, 230, 168, 0); }
.chart-svg .zero { stroke: #3d4a66; stroke-width: 1px; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.chart-svg .grid-line { stroke: #161e2c; stroke-width: 1px; vector-effect: non-scaling-stroke; }

.chart-cursor {
  position: absolute; top: 0; bottom: 22px; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(46, 230, 168, .55), transparent);
  opacity: 0; pointer-events: none; transition: opacity .12s var(--ease);
}
.chart-cursor.on { opacity: 1; }
.chart-tip {
  position: absolute; top: 8px;
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 10px; border-radius: 9px;
  background: rgba(10, 14, 22, .95);
  border: 1px solid var(--line-bright);
  box-shadow: var(--shadow-sm);
  font-size: 11px; color: var(--muted);
  opacity: 0; pointer-events: none; transition: opacity .12s var(--ease);
  white-space: nowrap;
}
.chart-tip.on { opacity: 1; }
.chart-tip b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-tip .range { color: var(--muted); font-size: 10px; }

.chart-xaxis {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--muted); padding: 5px 2px 0;
  font-variant-numeric: tabular-nums;
}
.chart-empty {
  border: 1px dashed var(--line); border-radius: 11px;
  padding: 30px; text-align: center; color: var(--muted); font-size: 12px;
  background: rgba(255, 255, 255, .012);
}

/* ---------------------------- свои связки ---------------------------- */

.custom-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 14px; padding: 18px; }
.ccard {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-sm), var(--inset);
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.ccard:hover { border-color: var(--line-bright); transform: translateY(-2px); }
.ccard .head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ccard .head .name { font-weight: 650; letter-spacing: -.1px; }
.ccard .head .note { color: var(--muted); font-size: 12px; }
.ccard .head .btn:first-of-type { margin-left: auto; }
.ccard .legs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ccard .legbox {
  flex: 1 1 190px; border: 1px solid var(--line-soft); border-radius: 11px;
  padding: 10px 12px; background: rgba(255, 255, 255, .018);
}
.ccard .legbox .sym { font-weight: 650; font-size: 13px; margin-bottom: 3px; }
.ccard .legbox .nums { display: flex; gap: 14px; font-size: 12px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.ccard .legbox .nums .b { color: var(--green); }
.ccard .legbox .nums .a { color: var(--red); }
.ccard .legbox .meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.ccard .dirs { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ccard .dir {
  flex: 1 1 195px; border: 1px solid var(--line-soft); border-radius: 11px;
  padding: 10px 12px; background: rgba(255, 255, 255, .018);
}
.ccard .dir .lbl { font-size: 10px; color: var(--muted); display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .7px; }
.ccard .dir b { font-size: 19px; font-variant-numeric: tabular-nums; font-weight: 650; }
.ccard .dir .net { font-size: 11px; color: var(--muted); margin-left: 7px; }
.ccard .miss { color: var(--amber); font-size: 12px; }

/* ---------------------------- статус площадок ---------------------------- */

.venues { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 11px; padding: 18px; }
.vcard {
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
  background: rgba(255, 255, 255, .018);
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.vcard:hover { border-color: var(--line-bright); transform: translateY(-2px); }
.vcard .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.vcard .state {
  font-size: 10px; padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .7px; font-weight: 600;
}
.vcard .state.ok { color: var(--green); background: rgba(46, 230, 168, .12); }
.vcard .state.error { color: var(--red); background: rgba(255, 93, 120, .12); }
.vcard .state.pending { color: var(--amber); background: rgba(255, 192, 97, .12); }
.vcard .kv { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 2px 0; }
.vcard .kv b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 500; }
.vcard .err { margin-top: 9px; font-size: 11px; color: var(--red); word-break: break-word; }
.note { color: var(--muted); font-size: 12px; padding: 0 18px 18px; margin: 0; line-height: 1.8; }

/* ---------------------------- страница связки ---------------------------- */

.pair-page .topbar { position: static; }
.pair-main { padding: 20px 24px 70px; display: flex; flex-direction: column; gap: 16px; max-width: 1320px; }

.hero {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow), var(--inset);
}
.hstat {
  display: flex; flex-direction: column; gap: 5px; justify-content: center;
  min-width: 156px; padding: 12px 16px;
  border: 1px solid var(--line-soft); border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
}
.hstat .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.hstat b { font-size: 27px; font-weight: 650; letter-spacing: -.6px; }

.route { display: flex; align-items: center; gap: 12px; flex: 1 1 360px; }
.route-leg {
  flex: 1; display: flex; flex-direction: column; gap: 5px;
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 16px;
  background: rgba(255, 255, 255, .02);
}
.route-leg .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.route-leg b { font-size: 19px; font-variant-numeric: tabular-nums; font-weight: 650; }
.route-leg.buy { border-color: rgba(46, 230, 168, .4); background: linear-gradient(180deg, rgba(46, 230, 168, .07), transparent); }
.route-leg.buy b { color: var(--green); }
.route-leg.sell { border-color: rgba(255, 93, 120, .4); background: linear-gradient(180deg, rgba(255, 93, 120, .07), transparent); }
.route-leg.sell b { color: var(--red); }
.route-arrow { color: var(--line-bright); font-size: 20px; }

.hero-note { flex: 1 1 100%; margin: 0; color: var(--muted); font-size: 12px; }
.pair-page .brand p code { font-size: 11px; }
.fail { padding: 6px 4px; line-height: 1.9; }
.fail p { margin: 0 0 8px; }
.fail .dim { color: var(--muted); font-size: 12px; }

.pair-page .grid td.green { color: var(--green); }
.pair-page .grid td.red { color: var(--red); }
.pair-page .grid tr.is-buy { background: linear-gradient(90deg, rgba(46, 230, 168, .08), transparent); }
.pair-page .grid tr.is-sell { background: linear-gradient(90deg, rgba(255, 93, 120, .08), transparent); }
.pair-page .grid thead th { position: static; }

/* ---------------------------- адаптив ---------------------------- */

@media (max-width: 1100px) {
  .stats { order: 3; margin-left: 0; width: 100%; }
  .stat { flex: 1; }
}

@media (max-width: 900px) {
  .topbar, .filters, .chips, .builder-bar, main, .pair-main, .tabs { padding-left: 14px; padding-right: 14px; }
  .grid thead th { position: static; }
  .grid td, .grid th { padding: 8px 10px; }
  .th-spark, .spark-cell { display: none; }
  .custom-list { grid-template-columns: 1fr; }
  .b-actions { margin-left: 0; }
}
