/* ════════════════════════════════════════════════════════════
   Ончейн: страница пула/токена /onchain/<net>/<pool> (webapp/js/onchain-token.js)
   Стиль — как у страницы токена разлоков: нейтральные токены темы, зелёный /
   красный только для покупок/продаж и знаковых чисел; моно-цифры.
   ════════════════════════════════════════════════════════════ */
#page-onchaintok.active {
  height: auto; min-height: 100%;
  gap: 0; padding: 0 0 28px; box-sizing: border-box;
  font-variant-numeric: tabular-nums; color: var(--text-1);
}
#page-onchaintok .ot-pos, .ot-menu .ot-pos { color: var(--c-pos); }
#page-onchaintok .ot-neg, .ot-menu .ot-neg { color: var(--c-neg); }
#page-onchaintok .ot-dim { color: var(--text-3); font-weight: 400; }
#page-onchaintok .ot-mono { font-family: var(--font-mono); }
#page-onchaintok .ot-sp { flex: 1; }
#page-onchaintok button { font-family: inherit; }

/* ── шапка токена ── */
.ot-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px;
  padding: 10px 16px; min-height: 56px; box-sizing: border-box;
  background: var(--bg-panel); border-bottom: 1px solid var(--border);
}
.ot-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-right: -8px; border-radius: var(--r-md);
  color: var(--text-3); text-decoration: none; font-size: 22px; line-height: 1;
}
.ot-back:hover { color: var(--text-1); background: var(--bg-hover); }
.ot-logo {
  position: relative; width: 36px; height: 36px; flex: none; border-radius: 50%; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
}
.ot-logo i { font-style: normal; font-weight: 700; color: var(--text-3); font-family: var(--font-display); }
.ot-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ot-tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ot-tt1 { display: flex; align-items: center; gap: 7px; white-space: nowrap; min-width: 0; overflow: hidden; }
.ot-tt1 > b { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.ot-tt1 > .ot-dim { font-size: 13px; }
.ot-tt2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ot-nm { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.ot-badge {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  color: var(--text-2); background: var(--tb-badge-bg); border: 1px solid var(--tb-badge-bd);
}
.ot-badge.ot-bnet { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); background: var(--brand-glow); }
[data-theme="light"] .ot-badge.ot-bnet { color: var(--brand-dim); }
.ot-addr, .ot-cp {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 5px;
  border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer;
  color: var(--text-3); font-family: var(--font-mono); font-size: 11px; text-decoration: none;
}
.ot-addr:hover, .ot-cp:hover { color: var(--text-1); border-color: var(--border-hi); background: var(--bg-hover); }
.ot-addr svg, .ot-cp svg { width: 12px; height: 12px; flex: none; }
.ot-addr .ic-d, .ot-cp .ic-d { display: none; }
.ot-addr.done .ic-c, .ot-cp.done .ic-c { display: none; }
.ot-addr.done .ic-d, .ot-cp.done .ic-d { display: block; color: var(--c-pos); }
.ot-px { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.ot-px > b { font-family: var(--font-mono); font-size: 20px; font-weight: 600; }
.ot-px > span { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.ot-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.ot-st { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; }
.ot-st > span { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ot-st > b { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.ot-head .chart-tile-spacer { flex: 1 1 0; min-width: 0; }
.ot-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ot-ib {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px;
  border: 1px solid var(--tb-chip-bd); border-radius: var(--r-md); background: var(--tb-chip-bg);
  color: var(--text-2); font-size: 12px; text-decoration: none; white-space: nowrap;
}
.ot-ib:hover { color: var(--text-1); background: var(--tb-chip-bg-hi); border-color: var(--tb-chip-bd-hi); }
.ot-ib svg { width: 13px; height: 13px; flex: none; }
.ot-ib.ot-ico { width: 30px; padding: 0; justify-content: center; }
.ot-ib.ot-ico svg { width: 15px; height: 15px; }
.ot-hb {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-width: 32px; padding: 0 8px;
  border: 1px solid var(--tb-chip-bd); border-radius: var(--r-md); background: var(--tb-chip-bg);
  color: var(--text-2); cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.ot-hb:hover { color: var(--text-1); background: var(--tb-chip-bg-hi); border-color: var(--tb-chip-bd-hi); }
.ot-hb svg { width: 16px; height: 16px; flex: none; }
.ot-star svg { fill: none; }
.ot-star.on { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.ot-star.on svg { fill: currentColor; }
[data-theme="light"] .ot-star.on { color: var(--gold-dim); }
.ot-gbtn { color: var(--text-1); }

/* ── график + правая панель ── */
.ot-main {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--ot-sw, 300px);
  height: var(--ot-mh, calc(var(--app-h, 100dvh) - 220px)); min-height: 260px;
  background: var(--bg-panel); border-bottom: 1px solid var(--border); overflow: hidden;
}
.ot-chart { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.ot-tbar { gap: 6px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; border-radius: 0; flex-shrink: 0; }
.ot-tbar::-webkit-scrollbar { display: none; }
.ot-tbar > * { flex-shrink: 0; }
.ot-tbar .chart-tile-spacer { flex: 1 1 8px; min-width: 8px; }
.ot-tfs { display: flex; gap: 2px; }
.ot-tf {
  padding: 5px 8px; border: 0; border-radius: var(--r-sm); background: none; cursor: pointer;
  color: var(--text-3); font-size: 12.5px; font-weight: 600; transition: all var(--dur) var(--ease);
}
.ot-tf:hover { color: var(--text-1); }
.ot-tf.active { background: var(--outline-soft); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--outline); }
.ot-vsep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.ot-mkl { color: var(--text-3); font-size: 11.5px; }
.ot-mkn { color: var(--text-3); font-family: var(--font-mono); font-size: 11px; }
/* сегменты-переключатели */
.ot-seg {
  display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r-md);
  background: var(--tb-chip-bg); border: 1px solid var(--tb-chip-bd);
}
.ot-sg {
  height: 24px; padding: 0 9px; border: 0; border-radius: 6px; background: none; cursor: pointer;
  color: var(--text-3); font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.ot-sg:hover { color: var(--text-1); }
.ot-sg.on { color: var(--text-1); background: var(--bg-hover); box-shadow: inset 0 0 0 1px var(--border-hi); }
.ot-sg u { text-decoration: none; border-bottom: 1px dashed currentColor; padding: 0 1px; font-family: var(--font-mono); font-size: 11.5px; }
.ot-sg u:hover { color: var(--brand); }
.ot-chip {
  display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 10px;
  border: 1px solid var(--tb-chip-bd); border-radius: var(--r-md); background: var(--tb-chip-bg);
  color: var(--text-3); font-size: 12px; font-weight: 600; cursor: pointer;
}
.ot-chip:hover { color: var(--text-1); background: var(--tb-chip-bg-hi); border-color: var(--tb-chip-bd-hi); }
.ot-chip.on { color: var(--text-1); border-color: var(--border-hi); background: var(--tb-chip-bg-hi); }
.ot-chip.ot-ic { width: 28px; padding: 0; }
.ot-chip.ot-ic svg { width: 15px; height: 15px; }
.ot-chip.ot-ic.on { color: var(--brand); border-color: var(--brand); background: var(--brand-glow); }
/* порог «Крупные» — меню в body */
.ot-menu {
  display: none; position: fixed; z-index: 1000; min-width: 110px; padding: 4px; box-sizing: border-box;
  background: var(--bg-modal); border: 1px solid var(--border-hi); border-radius: var(--r-md);
  box-shadow: 0 18px 44px rgba(0,0,0,.5);
}
[data-theme="light"] .ot-menu { box-shadow: 0 12px 30px rgba(0,0,0,.14); }
.ot-menu.open { display: block; animation: pageEnter .16s cubic-bezier(.16,1,.3,1); }
.ot-menu .tf-dd-opt { font-family: var(--font-mono); font-size: 12px; }
.ot-mh { padding: 4px 10px 6px; color: var(--text-3); font-size: 11px; white-space: nowrap; }

.ot-cv { position: relative; flex: 1 1 auto; min-height: 0; }
.ot-box { position: absolute; inset: 0; }
.ot-lbl {
  position: absolute; z-index: 3; top: 8px; left: 10px; right: 96px; pointer-events: none;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.ot-ohlc { display: flex; gap: 5px; align-items: baseline; flex-wrap: wrap; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2); }
.ot-ohlc b { color: var(--text-1); font-weight: 600; margin-right: 2px; }
.ot-ohlc i { font-style: normal; color: var(--text-3); margin-left: 4px; }
.ot-lsel:empty { display: none; }
.ot-lchip {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  border-radius: 11px; border: 1px solid var(--brand); background: var(--bg-float); cursor: pointer;
  color: var(--text-1); font-size: 11.5px; font-weight: 600; max-width: 260px; overflow: hidden; white-space: nowrap;
}
.ot-lchip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ot-lchip em { font-style: normal; color: var(--text-3); font-size: 10px; }
.ot-lchip:hover em { color: var(--c-neg); }
.ot-msg {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 13px; pointer-events: none; text-align: center; padding: 0 20px;
}
.ot-msg:empty { display: none; }
.ot-flash {
  position: absolute; z-index: 9; left: 50%; top: 40px; transform: translate(-50%, -4px);
  max-width: calc(100% - 60px); padding: 6px 12px; border-radius: var(--r-md);
  background: var(--bg-modal); border: 1px solid var(--border-hi); box-shadow: 0 8px 22px rgba(0,0,0,.35);
  color: var(--text-2); font-size: 12px; text-align: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
.ot-flash.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.ot-cv .tz-btn { width: 84px; height: 28px; right: 0; bottom: 0; }
.ot-cv .tz-menu { bottom: 32px; }

/* ── карточка сделок у маркера ── */
.ot-tip[hidden] { display: none !important; }
.ot-tip {
  position: absolute; z-index: 6; left: 0; top: 0; pointer-events: none;
  width: max-content; min-width: 220px; max-width: min(360px, calc(100% - 16px));
  max-height: calc(100% - 12px); overflow: hidden; box-sizing: border-box; padding: 8px 10px 9px;
  background: var(--bg-modal); border: 1px solid var(--border-hi); border-radius: var(--r-md);
  box-shadow: 0 10px 28px rgba(0,0,0,.45); font-size: 12px; line-height: 1.45; color: var(--text-1);
}
[data-theme="light"] .ot-tip { box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.ot-tip.pin { pointer-events: auto; overflow: auto; border-color: var(--brand); }
.ot-tip-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.ot-tip-h b { font-weight: 700; font-size: 12.5px; }
.ot-tip-h .ot-dim { margin-left: auto; font-size: 11.5px; }
.ot-tip-x {
  display: none; width: 22px; height: 22px; margin: -3px -5px -3px 0; padding: 0; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-3); cursor: pointer; font-size: 13px; line-height: 22px;
}
.ot-tip-x:hover { color: var(--text-1); background: var(--bg-hover); }
.ot-tip.pin .ot-tip-x, .ot-tip.dock .ot-tip-x { display: block; }
.ot-tip-kv { display: flex; justify-content: space-between; gap: 16px; color: var(--text-2); }
.ot-tip-kv b { font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; color: var(--text-1); white-space: nowrap; }
.ot-tip-sum { display: flex; gap: 10px; align-items: baseline; padding-bottom: 5px; margin-bottom: 4px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 11.5px; }
.ot-tip-sum b { font-size: 13px; }
.ot-tip-rows { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 1px 10px; align-items: center; }
.ot-tip-r { display: contents; }
.ot-tip-r > b { font-family: var(--font-mono); font-weight: 600; font-size: 11.5px; text-align: right; }
.ot-tip-r > span { font-family: var(--font-mono); font-size: 11px; text-align: right; }
.ot-tip-r.on .ot-tip-w span { color: var(--brand); }
.ot-tip-w {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 1px 0; border: 0; background: none;
  color: var(--text-1); font-size: 12px; cursor: pointer; text-align: left;
}
.ot-tip-w span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-tip-w i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ot-tip-w em { font-style: normal; color: var(--gold); font-size: 11px; }
.ot-tip-w small { color: var(--text-3); font-family: var(--font-mono); font-size: 10.5px; }
.ot-tip-w:hover span { text-decoration: underline; text-underline-offset: 2px; }
.ot-tip > .ot-tip-w { margin-bottom: 4px; font-weight: 600; }
.ot-tip-more { margin-top: 4px; font-size: 11px; }
.ot-tip.dock {
  left: 8px !important; right: 8px; top: auto !important; bottom: 34px;
  width: auto; min-width: 0; max-width: none; max-height: 60%;
  overflow: auto; pointer-events: auto; overscroll-behavior: contain;
}

/* ── правая панель ── */
.ot-side { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--border); background: var(--bg-panel); }
.ot-side > .ot-srz { position: absolute; top: 0; bottom: 0; left: -3px; width: 5px; flex: none; touch-action: none; }
.ot-side > .ot-srz::after { right: auto; left: 2px; }
.ot-sb { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-hi) transparent; }
.ot-sb::-webkit-scrollbar { width: 6px; }
.ot-sb::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
.ot-ss { padding: var(--sp-3); border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.ot-ss.ot-selc { border-left-color: var(--brand); background: color-mix(in srgb, var(--brand) 4%, transparent); }
.ot-ssh { display: flex; align-items: center; gap: var(--sp-2); min-height: 20px; margin-bottom: var(--sp-2); white-space: nowrap; min-width: 0; }
.ot-ttl { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ot-selnm { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.ot-wdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ot-fold {
  margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; border: 1px solid var(--border-hi); border-radius: 4px;
  background: transparent; color: var(--text-3); cursor: pointer; transition: color .12s ease, border-color .12s ease, transform .18s ease;
}
.ot-fold svg { width: 9px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ot-fold:hover { color: var(--text-1); border-color: var(--text-3); }
.ot-fold.on { transform: rotate(-90deg); }
.ot-ss.folded .ot-ssb { display: none; }
.ot-ss.folded .ot-ssh { margin-bottom: 0; }
.ot-pseg { margin-left: auto; padding: 1px; }
.ot-pseg .ot-sg { height: 20px; padding: 0 7px; font-size: 11px; }
.ot-pseg + .ot-fold { margin-left: 4px; }
.ot-kv { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); font-size: 12px; padding: 2.5px 0; }
.ot-kv > span { color: var(--text-3); white-space: nowrap; }
.ot-kv > b { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; color: var(--text-1); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ot-kv.ot-pxr > b { font-size: 15px; }
.ot-kv.ot-ar > b { font-weight: 500; font-size: 11.5px; }
.ot-kv .ot-cp { height: 22px; padding: 0 4px; }
.ot-chg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 4px 0 6px; }
.ot-chg > div {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px;
  border-radius: 6px; background: var(--bg-card); border: 1px solid var(--border-soft);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.ot-chg > div > span:first-child { font-family: var(--font-body); font-size: 10px; font-weight: 500; color: var(--text-3); }
.ot-bs { margin: 3px 0 7px; }
.ot-bsh { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.ot-bsv { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; }
.ot-bsv b { font-weight: 600; }
.ot-bsb { position: relative; display: flex; height: 5px; margin-top: 3px; border-radius: 3px; overflow: hidden; background: var(--c-neg); }
.ot-bsb i { display: block; height: 100%; background: var(--c-pos); border-right: 2px solid var(--bg-panel); }
.ot-bsb.empty { background: var(--border); }
.ot-bsb.empty i { background: transparent; border: 0; }
.ot-sub { margin: 8px 0 3px; padding-top: 7px; border-top: 1px solid var(--border-soft); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.ot-note { color: var(--text-3); font-size: 12px; line-height: 1.5; }
.ot-sacts { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.ot-sbtn {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px;
  border: 1px solid var(--tb-chip-bd); border-radius: var(--r-md); background: var(--tb-chip-bg);
  color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer;
}
.ot-sbtn svg { width: 14px; height: 14px; flex: none; fill: none; }
.ot-sbtn:hover { color: var(--text-1); background: var(--tb-chip-bg-hi); border-color: var(--tb-chip-bd-hi); }
.ot-sbtn.on { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.ot-sbtn.on svg { fill: currentColor; }
[data-theme="light"] .ot-sbtn.on { color: var(--gold-dim); }
.ot-sbtn.ot-sx { margin-left: auto; width: 28px; padding: 0; justify-content: center; }
.ot-sbtn.ot-sx:hover { color: var(--c-neg); }
.ot-state { color: var(--text-3); font-size: 13px; padding: 18px 12px; }
.ot-sbot { margin-top: auto; flex-shrink: 0; display: flex; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); background: var(--bg-panel); }
.ot-stog {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: transparent; color: var(--text-2); cursor: pointer;
}
.ot-stog svg { width: 16px; height: 16px; }
.ot-stog:hover { color: var(--text-1); border-color: var(--border-hi); background: var(--bg-hover); }
.ot-main.ot-sfold { grid-template-columns: minmax(0, 1fr) 46px; }
.ot-sfold .ot-sb, .ot-sfold .ot-srz { display: none; }
.ot-sfold .ot-sbot { justify-content: center; padding: var(--sp-3) 0; }
.ot-sfold .ot-stog svg { transform: scaleX(-1); }

/* ── вкладки ── */
.ot-tabs { min-width: 0; padding: 0 16px; margin-top: 10px; }
.ot-tabbar { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ot-tabbar::-webkit-scrollbar { display: none; }
.ot-tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; flex-shrink: 0;
  border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.ot-tab:hover { color: var(--text-1); }
.ot-tab.on { color: var(--text-1); }
.ot-tab.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.ot-tc { font-style: normal; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; padding: 0 5px; line-height: 16px; border-radius: 8px; color: var(--text-3); background: var(--tb-badge-bg); }
.ot-tc:empty { display: none; }
.ot-upd { font-size: 11px; white-space: nowrap; padding-right: 2px; }
.ot-filt { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 8px 0; }
.ot-filt[hidden] { display: none; }
.ot-in {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 9px;
  border: 1px solid var(--tb-chip-bd); border-radius: var(--r-md); background: var(--input-bg);
  color: var(--text-3); font-size: 12px;
}
.ot-in:focus-within { border-color: var(--border-hi); }
.ot-in input {
  width: 84px; height: 26px; border: 0; outline: 0; background: transparent; color: var(--text-1);
  font-family: var(--font-mono); font-size: 12px;
}
.ot-inw input { width: 190px; }
.ot-hint, .ot-span { font-size: 11.5px; }
.ot-hsum { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.ot-hk b { font-family: var(--font-mono); font-weight: 600; color: var(--text-1); }
.ot-hk b.ot-neg { color: var(--c-neg); }
.ot-hbar { display: inline-flex; width: 180px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--border); }
.ot-hbar i { display: block; height: 100%; border-right: 1px solid var(--bg); }
.ot-tw {
  overflow: auto; max-height: min(72vh, 760px); overscroll-behavior: contain;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-md);
}
.ot-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ot-table thead { position: sticky; top: 0; z-index: 2; }
.ot-table th {
  background: var(--bg-panel); color: var(--text-3); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .2px;
  padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.ot-table th.ot-sort { cursor: pointer; user-select: none; }
.ot-table th.ot-sort:hover { color: var(--text-1); }
.ot-table th.on { color: var(--text-1); }
.ot-table td { padding: 4px 10px; height: 26px; text-align: right; white-space: nowrap; font-family: var(--font-mono); font-size: 12px; border-bottom: 1px solid var(--border-soft); }
.ot-table .l { text-align: left; }
.ot-table tbody tr { transition: background var(--dur) var(--ease); }
.ot-table tbody tr:hover { background: var(--bg-hover); }
.ot-table tbody tr.on { background: var(--brand-glow); }
.ot-table tbody tr.on td:first-child { box-shadow: inset 2px 0 0 var(--brand); }
.ot-table tbody tr:last-child td { border-bottom: 0; }
.ot-table tr.ot-rb td.ot-usd { font-weight: 600; }
.ot-table tr.ot-rs td.ot-usd { font-weight: 600; }
.ot-table tr.ot-new { animation: otNew 2.4s ease-out; }
@keyframes otNew { from { background: color-mix(in srgb, var(--brand) 22%, transparent); } to { background: transparent; } }
.ot-ago { color: var(--text-2); font-family: var(--font-mono); }
.ot-sd.b, .ot-sd.s {
  display: inline-block; min-width: 62px; padding: 0 6px; border-radius: 4px; line-height: 18px; text-align: center;
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
}
.ot-sd.b { color: var(--c-pos); background: color-mix(in srgb, var(--c-pos) 13%, transparent); }
.ot-sd.s { color: var(--c-neg); background: color-mix(in srgb, var(--c-neg) 13%, transparent); }
.ot-w {
  display: inline-flex; align-items: center; gap: 6px; max-width: 230px; padding: 1px 4px; margin: -1px -4px;
  border: 0; border-radius: 4px; background: none; cursor: pointer; color: var(--text-1); font-size: 12px;
}
.ot-w:hover { background: var(--bg-card); }
.ot-w i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ot-wl { font-family: var(--font-body); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.ot-wa { font-family: var(--font-mono); color: var(--text-2); }
.ot-w:hover .ot-wa { color: var(--text-1); }
.ot-wst { font-style: normal; color: var(--gold); font-size: 11px; }
.ot-tx { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); text-decoration: none; font-family: var(--font-mono); font-size: 11.5px; }
.ot-tx svg { width: 11px; height: 11px; }
.ot-tx:hover { color: var(--text-1); }
.ot-acts { width: 1%; padding-right: 6px !important; }
.ot-ab {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 22px; margin-left: 2px; padding: 0;
  border: 1px solid transparent; border-radius: 5px; background: none; color: var(--text-3); cursor: pointer; vertical-align: middle;
}
.ot-ab svg { width: 14px; height: 14px; fill: none; }
.ot-ab:hover { color: var(--text-1); border-color: var(--border-hi); background: var(--bg-card); }
.ot-ab.ot-abst.on { color: var(--gold); }
.ot-ab.ot-abst.on svg { fill: currentColor; }
.ot-kind {
  display: inline-block; padding: 0 6px; border-radius: 4px; line-height: 18px; font-family: var(--font-body); font-size: 11px; font-weight: 600;
  color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--kc) 30%, transparent);
}
.ot-pbar { display: inline-block; width: 120px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; vertical-align: middle; }
.ot-pbar i { display: block; height: 100%; border-radius: 3px; }
.ot-more {
  display: block; width: 100%; height: 34px; border: 0; border-top: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-2); cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.ot-more:hover { color: var(--text-1); background: var(--bg-hover); }
.ot-key { display: flex; flex-direction: column; gap: 6px; margin: 14px; padding: 14px 16px; border-radius: var(--r-md);
  border: 1px dashed color-mix(in srgb, var(--c-warn) 60%, transparent); background: color-mix(in srgb, var(--c-warn) 8%, transparent); }
.ot-key b { color: var(--c-warn); font-size: 13.5px; }
.ot-key span { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.ot-key.ot-key-s { margin: 8px; padding: 8px 12px; font-size: 12px; color: var(--text-2); }
.ot-wchips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ot-wchip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 13px;
  border: 1px solid var(--tb-chip-bd); background: var(--tb-chip-bg); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer;
}
.ot-wchip i { width: 8px; height: 8px; border-radius: 50%; }
.ot-wchip em { font-style: normal; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.ot-wchip:hover, .ot-wchip.on { color: var(--text-1); border-color: var(--brand); }

/* шапка в одну строку: подписи «Токен/Пул» — только на широком экране */
@media (max-width: 1599px) {
  .ot-ib:not(.ot-ico) span { display: none; }
  .ot-ib:not(.ot-ico) { width: 30px; padding: 0; justify-content: center; }
  .ot-head { gap: 10px 14px; }
  .ot-stats { gap: 14px; }
}
/* ── планшет ── */
@media (max-width: 1199px) {
  .ot-main { grid-template-columns: minmax(0, 1fr) var(--ot-sw, 270px); }
  .ot-nm { max-width: 140px; }
  .ot-ib:not(.ot-ico) span { display: none; }
  .ot-ib:not(.ot-ico) { width: 30px; padding: 0; justify-content: center; }
}
/* ── телефон / узко: график сверху, вкладки, затем панель ── */
@media (max-width: 900px) {
  .ot-main, .ot-main.ot-sfold { display: contents; }
  .ot-chart { order: 2; height: max(360px, 58vh); height: max(360px, 58svh); border-bottom: 1px solid var(--border); }
  .ot-tabs { order: 3; padding: 0 10px; }
  .ot-side { order: 4; margin-top: 12px; border-left: 0; border-top: 1px solid var(--border); }
  .ot-head { order: 1; }
  .ot-sb, .ot-sfold .ot-sb { display: block; overflow: visible; }
  .ot-sbot, .ot-srz { display: none !important; }
  .ot-tw { max-height: 70vh; overscroll-behavior: auto; }
}
@media (min-width: 600px) and (max-width: 900px) {
  .ot-sb { column-count: 2; column-gap: 0; column-rule: 1px solid var(--border); }
  .ot-ss { break-inside: avoid; }
}
@media (max-width: 768px) {
  .ot-head { padding: 8px 10px; gap: 8px 12px; }
  .ot-logo { width: 30px; height: 30px; }
  .ot-tt1 > b { font-size: 16px; }
  .ot-px { order: 5; }
  .ot-px > b { font-size: 17px; }
  .ot-stats { order: 6; width: 100%; gap: 6px 14px; display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; }
  .ot-head .chart-tile-spacer { display: none; }
  .ot-links { order: 7; width: 100%; }
  .ot-star { order: 3; margin-left: auto; }
  .ot-gbtn { order: 4; }
  .ot-tt { flex: 1 1 0; }
  .ot-nm { max-width: 120px; }
  .ot-tbar { padding: 6px 8px; }
  .ot-mkl { display: none; }
  .ot-vsep { margin: 0 1px; }
  .ot-sg { height: 28px; }
  .ot-chip { height: 32px; }
  .ot-chip.ot-ic { width: 32px; }
  .ot-lbl { right: 10px; }
  .ot-ohlc { font-size: 10.5px; gap: 3px; }
  .ot-cv .tz-btn { width: 58px; font-size: 9px; letter-spacing: -.02em; }
  .ot-badge:not(.ot-bnet) { display: none; }
  .ot-tf { padding: 7px 8px; }
  .ot-tab { height: 40px; padding: 0 10px; }
  .ot-upd { display: none; }
  .ot-hint { display: none; }
  .ot-inw { flex: 1 1 160px; }
  .ot-inw input { width: 100%; min-width: 0; }
  .ot-in { height: 34px; }
  .ot-table td { padding: 5px 8px; height: 30px; }
  .ot-table th { padding: 8px; }
  .ot-w { max-width: 150px; }
  .ot-ab { width: 30px; height: 28px; }
  .ot-hbar { width: 100%; }
}
@media (max-width: 480px) {
  .ot-gbtn span { display: none; }
}
@media (hover: none) {
  .ot-table tbody tr:hover { background: transparent; }
  .ot-table tbody tr.on { background: var(--brand-glow); }
}

/* ручка высоты графика (между графиком и вкладками) */
.ot-main { position: relative; }
.ot-hrz { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; z-index: 30; cursor: row-resize; touch-action: none; }
.ot-hrz::after { content: ""; position: absolute; left: 50%; top: 4px; width: 44px; height: 3px; margin-left: -22px; border-radius: 2px; background: var(--border-hi, var(--border)); opacity: 0; transition: opacity .15s; }
.ot-hrz:hover::after, body.ot-hrz-drag .ot-hrz::after { opacity: 1; background: var(--brand); }
body.ot-hrz-drag { cursor: row-resize; user-select: none; }
body.ot-hrz-drag .ot-box { pointer-events: none; }

/* ── измерения «цена»/«время» (oc-ruler.js) — вид как у разлоков (.ut-tools/.ut-r-*):
   кнопки слева под легендой, нейтральная заливка, тонкие уровни, стрелки,
   тёмная подпись; ручки на концах при наведении (на таче — всегда) ── */
.oc-tools {
  position: absolute; left: 8px; top: 36px; z-index: 6;
  display: flex; flex-direction: column; gap: 4px;
}
.oc-tool {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--tb-chip-bd, var(--border)); border-radius: 8px; cursor: pointer;
  background: var(--bg-panel); color: var(--text-3);
}
.oc-tool:hover { color: var(--text-1); background: var(--tb-chip-bg-hi, var(--bg-hover)); }
.oc-tool.on { color: var(--brand); border-color: var(--brand); background: var(--brand-glow); }
.oc-ruling .ot-box { cursor: crosshair; touch-action: none; }
.oc-ruler { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.oc-ruler[hidden] { display: none; }
.oc-r-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.oc-r-svg .r-m .r-fill { pointer-events: all; cursor: pointer; }
.oc-r-svg .r-fill { fill: color-mix(in srgb, var(--text-1) 9%, transparent); }
.oc-r-svg .r-m:hover .r-fill, .oc-r-svg .r-m.sel .r-fill { fill: color-mix(in srgb, var(--text-1) 13%, transparent); }
.oc-r-svg .r-m.sel .r-fill { stroke: var(--c-info, #3987e5); stroke-width: 1; stroke-dasharray: 4 3; }
.oc-r-svg .r-edge { stroke: color-mix(in srgb, var(--text-1) 45%, transparent); stroke-width: 1; shape-rendering: crispEdges; }
.oc-r-svg .r-arrow { stroke: var(--text-1); stroke-width: 1.3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.oc-r-svg .r-h {
  fill: var(--bg); stroke: var(--c-info, #3987e5); stroke-width: 2;
  opacity: 0; pointer-events: none; cursor: grab;
  transition: opacity var(--dur) var(--ease);
}
.oc-r-svg .r-m:hover .r-h, .oc-r-svg .r-m.ed .r-h, .oc-r-svg .r-m.sel .r-h { opacity: 1; pointer-events: all; }
.oc-r-svg .r-m.ed .r-h { cursor: grabbing; }
@media (hover: none) { .oc-r-svg .r-h { opacity: 1; pointer-events: all; } }
.oc-r-lbls { position: absolute; inset: 0; }
.oc-r-lbl {
  position: absolute; transform: translate(-50%, -100%); white-space: nowrap; text-align: center;
  padding: 6px 11px; border-radius: 8px; font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums;
  background: var(--bg-modal); border: 1px solid var(--border-hi); color: var(--text-1);
  box-shadow: 0 6px 18px rgba(0,0,0,.42);
}
[data-theme="light"] .oc-r-lbl { box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.oc-r-lbl.below { transform: translate(-50%, 0); }
.oc-r-lbl b { font-weight: 600; }
.oc-r-lbl .oc-pos { color: var(--c-pos); }
.oc-r-lbl .oc-neg { color: var(--c-neg); }
.oc-r-lbl .r2 { color: var(--text-2); font-size: 11.5px; }
.oc-r-lbl[data-i] { pointer-events: auto; cursor: pointer; transition: border-color var(--dur) var(--ease); }
.oc-r-lbl[data-i]::after {
  content: "✕"; position: absolute; top: -7px; right: -7px;
  width: 16px; height: 16px; border-radius: 50%; font-size: 9px; line-height: 16px; text-align: center;
  background: var(--c-neg); color: #fff; opacity: 0; transform: scale(.6);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.oc-r-lbl[data-i]:hover { border-color: var(--c-neg); }
.oc-r-lbl[data-i]:hover::after { opacity: 1; transform: scale(1); }
@media (hover: none) { .oc-r-lbl[data-i]::after { opacity: 1; transform: scale(1); } }
@media (max-width: 768px) { .oc-tools { top: 58px; left: 6px; } .oc-tool { width: 28px; height: 28px; } }

/* график на весь экран (кнопка в шапке графика радара): шапка + полотно */
.ot-chart:fullscreen { max-height: none; background: var(--bg); order: 0; border: 0; }
.ot-chart:-webkit-full-screen { max-height: none; background: var(--bg); order: 0; border: 0; }
.ot-chart:fullscreen .ot-cv { flex: 1 1 auto; min-height: 0; }
.ot-chart:fullscreen::backdrop { background: var(--bg); }
