:root {
  --bg: #0a0a0b;
  --card: #121315;
  --card2: #17181b;
  --card3: #1e2024;
  --line: #222429;
  --line2: #2e3137;
  --fg: #ecebe6;
  --fg2: #adb0b5;
  --muted: #80858c;
  --accent: #ff6a3d;
  --accent-bg: rgba(255,106,61,0.1);
  --up: #79c95a;
  --up-bg: rgba(121,201,90,0.12);
  --down: #f06a5f;
  --down-bg: rgba(240,106,95,0.12);
  --warn: #e6ae48;
  --eth: #8fa0ff;
  --rh: #c8f24c;
  --v4: #b793ff;
  --radius: 14px;
  --top-h: 64px;
  --sans: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(255,106,61,0.06), transparent 70%),
    var(--bg);
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

/* View-only accounts: the blacklist is shared, only the admin changes it. */
body.ro [data-act^="block-"],
body.ro [data-act^="unblock"] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

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

svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

kbd {
  font: 11px var(--mono);
  padding: 1px 6px;
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.err {
  color: var(--down);
  margin: 0;
}

.num,
.grid td {
  font-variant-numeric: tabular-nums;
}

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--card2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  background: var(--card3);
  border-color: #4a4e55;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.ghost {
  background: transparent;
}

.btn.ghost:hover {
  background: var(--card2);
}

.btn.icon {
  width: 36px;
  padding: 0;
  font-weight: 600;
}

.btn.wide {
  width: 100%;
  height: 42px;
}

.btn.small {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 8px;
}

.link {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.link:hover {
  color: var(--fg);
}

input {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--card);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}

input:focus {
  border-color: rgba(255,106,61,0.6);
  box-shadow: 0 0 0 3px rgba(255,106,61,0.12);
}

input::placeholder {
  color: #5a5e65;
}

select {
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--card);
  padding: 0 6px;
}

.count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--card3);
  color: var(--fg2);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.count:empty {
  display: none;
}

.count.hot {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

/* ---------- brand ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M7 22l5-6 4 3 6-9 3 4' fill='none' stroke='%23ff6a3d' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 100% no-repeat,
    linear-gradient(145deg, #1e2024, #121315);
  border: 1px solid var(--line2);
}

/* ---------- login ---------- */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(400px, 100%);
  display: grid;
  gap: 16px;
  padding: 32px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card2), var(--card));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.login-card .brand {
  font-size: 20px;
}

.login-card p {
  margin: -6px 0 4px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--fg2);
  font-size: 13px;
}

.field input {
  height: 42px;
}

/* ---------- app shell ---------- */

.app {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 28px 48px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 -28px;
  padding: 0 28px;
  background: rgba(10,10,11,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--card);
  font-size: 13px;
  white-space: nowrap;
  cursor: default;
}

.chip b {
  font-weight: 600;
}

.chip .sep {
  width: 1px;
  height: 14px;
  background: var(--line2);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.dot.ok {
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(121,201,90,0.15);
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(230,174,72,0.15);
}

.dot.bad {
  background: var(--down);
  box-shadow: 0 0 0 3px rgba(240,106,95,0.15);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* ---------- donation wallet ---------- */

.donate {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 34px;
  padding: 0 4px 0 13px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
  white-space: nowrap;
}

.donate-top {
  flex: 0 1 auto;
  margin-left: auto;
  overflow: hidden;
}

.donate-l,
.donate-s {
  flex: none;
  color: var(--muted);
}

.donate-s {
  display: none;
}

.donate-net {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,106,61,0.12);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.donate-a {
  display: flex;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg2);
  cursor: text;
  -webkit-user-select: all;
  user-select: all;
}

.donate-h {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donate-a > span:last-child {
  flex: none;
}

.donate-c {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 999px;
}

.donate-c .i-ok,
.donate-c.ok .i-copy {
  display: none;
}

.donate-c.ok .i-ok {
  display: block;
}

.donate-c.ok {
  color: var(--up);
}

.donate-low {
  display: none;
  width: fit-content;
  max-width: 100%;
  margin: 14px auto 0;
}

/* the admin's Old/New switch takes ~90px of the header */
@media (max-width: 1280px) {
  .top:has(#ui-sw) .donate-top .donate-l {
    display: none;
  }
  .top:has(#ui-sw) .donate-top .donate-s {
    display: inline;
  }
}

@media (max-width: 1180px) {
  .donate-top .donate-l {
    display: none;
  }
  .donate-top .donate-s {
    display: inline;
  }
  .top:has(#ui-sw) .donate-top .donate-net {
    display: none;
  }
}

@media (max-width: 1100px) {
  .donate-top {
    display: none;
  }
  .donate-low {
    display: flex;
  }
}

@media (max-width: 360px) {
  .donate-low .donate-l {
    display: none;
  }
  .donate-low .donate-s {
    display: inline;
  }
}

.live {
  min-width: 118px;
  font-size: 13px;
}

.live .dot {
  background: var(--up);
  animation: pulse 2s infinite;
}

.live.paused .dot {
  background: var(--warn);
  animation: none;
}

.live.offline .dot {
  background: var(--down);
  animation: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(121,201,90,0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(121,201,90,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(121,201,90,0);
  }
}

#sound .mute {
  display: none;
}

#sound.off .waves {
  display: none;
}

#sound.off .mute {
  display: inline;
}

#sound.off {
  color: var(--muted);
}

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  background: none;
  border: 0;
  padding: 10px 14px 12px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
}

.tab .count {
  margin-left: 0;
}

.tab:hover {
  color: var(--fg2);
}

.tab.active {
  color: var(--fg);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------- toolbar & filters ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search:focus-within {
  border-color: rgba(255,106,61,0.6);
  box-shadow: 0 0 0 3px rgba(255,106,61,0.12);
}

.search svg {
  color: var(--muted);
}

.search input {
  flex: 1;
  border: 0;
  background: none;
  padding: 0;
  height: 34px;
  box-shadow: none !important;
}

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

.seg button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.seg button:hover {
  color: var(--fg);
}

.seg button.on {
  background: var(--card3);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line2);
}

.cdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.cdot.eth {
  background: var(--eth);
}

.cdot.rh {
  background: var(--rh);
}

#more.on {
  border-color: rgba(255,106,61,0.5);
  color: var(--accent);
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}

.range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.range span {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
}

.range input {
  height: 32px;
  font-size: 13px;
}

.range input:only-of-type {
  grid-column: 1 / -1;
}

.range input.set {
  border-color: rgba(255,106,61,0.45);
}

.range.iss-f,
.range.mkt-f,
.range.opt {
  grid-column: span 2;
}

.range.wide {
  grid-column: 1 / -1;
}

.range.iss-f .seg,
.range.mkt-f .seg,
.range.opt .seg,
.range.wide .seg {
  grid-column: 1 / -1;
  justify-self: start;
}

.range.mkt-f .seg button.on[data-v="1"],
.range.iss-f .seg button.on.set,
.range.opt .seg button.on:not([data-v=""]) {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255,106,61,0.45);
}

#venue-f {
  gap: 6px;
  align-items: center;
}

#venue-f .vg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding-right: 6px;
  border-right: 1px solid var(--line);
}

#venue-f .vb {
  font-weight: 600;
}

#venue-f button:not(.on):not(.link) {
  opacity: 0.45;
  text-decoration: line-through;
}

#venue-f .vg-act {
  font-size: 12px;
  color: var(--muted);
  padding-left: 4px;
}

.hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.hint b {
  color: var(--fg2);
  font-weight: 600;
}

.rule {
  margin: 0;
  font-size: 13px;
}

/* ---------- tables ---------- */

.table-card {
  margin-top: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  overflow: clip;
}

.qnote {
  margin: 0;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.qnote b {
  color: var(--fg);
}

.qnote .qscan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}

.qnote .err {
  color: var(--down);
}

/* The portfolio table is wider than a laptop card: it scrolls sideways, so its header cannot stick. */
.table-scroll:has(> #pf-table) {
  overflow-x: auto;
}

.table-scroll:has(> #pf-table) th {
  position: static;
}

.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.grid th {
  position: sticky;
  top: var(--top-h);
  z-index: 5;
  background: #141518;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
}

.grid th.left,
.grid td.left {
  text-align: left;
}

.grid th[data-sort] {
  cursor: pointer;
}

.grid th[data-sort]:hover {
  color: var(--fg);
}

.grid th.sorted {
  color: var(--accent);
}

.grid th.sorted::after {
  content: " ↓";
}

.grid th.sorted.asc::after {
  content: " ↑";
}

.grid td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

.grid tbody tr:last-child td {
  border-bottom: 0;
}

.grid tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.grid tbody tr:hover td {
  background: var(--card2);
}

.grid tbody tr.bump td.c-fees .big {
  animation: bump 1.8s ease-out;
}

@keyframes bump {
  0% {
    color: var(--up);
    text-shadow: 0 0 12px rgba(121,201,90,0.7);
  }
  100% {
    color: var(--fg);
    text-shadow: none;
  }
}

.pool {
  display: grid;
  gap: 3px;
  text-align: left;
}

.pair {
  font-weight: 600;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tags {
  display: flex;
  gap: 5px;
  align-items: center;
}

.b {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border: 1px solid var(--line2);
  color: var(--fg2);
  background: rgba(255, 255, 255, 0.02);
}

.b.eth {
  color: var(--eth);
  border-color: rgba(143, 160, 255, 0.35);
  background: rgba(143, 160, 255, 0.08);
}

.b.rh {
  color: var(--rh);
  border-color: rgba(200, 242, 76, 0.32);
  background: rgba(200, 242, 76, 0.07);
}

.b.v4 {
  color: var(--v4);
  border-color: rgba(183, 147, 255, 0.35);
}

.b.pcs {
  color: #31d0aa;
  border-color: rgba(49, 208, 170, 0.35);
}

.b.aero {
  color: #5c8dff;
  border-color: rgba(92, 141, 255, 0.38);
}

.b.new {
  color: #121a10;
  background: var(--up);
  border-color: var(--up);
}

.b.hook {
  color: var(--warn);
  border-color: rgba(230,174,72,0.35);
  cursor: help;
}

.b.rug {
  color: #f48a80;
  border-color: rgba(244,138,128,0.45);
  background: rgba(244,138,128,0.08);
  font-weight: 650;
  cursor: help;
}

.b.rug.hard {
  color: #fff;
  border-color: #d9534f;
  background: #d9534f;
}

.b.bell {
  color: var(--accent);
  border-color: rgba(255,106,61,0.4);
  background: var(--accent-bg);
}

.b.iss {
  color: #64a8ff;
  border-color: rgba(64,156,255,0.4);
}

.b.sus {
  color: #f48a80;
  border-color: rgba(244,138,128,0.45);
  background: rgba(244,138,128,0.08);
  cursor: help;
}

.b.blk {
  color: var(--fg2);
  border-style: dashed;
}

.act.blk:hover,
.btn.blk:hover {
  color: #f48a80;
  border-color: rgba(244,138,128,0.45);
}

.token .btn.small {
  margin-left: auto;
}

.sus-note {
  border-left: 3px solid #f48a80;
  padding-left: 10px;
}

.hook-note {
  border-left: 3px solid var(--warn);
  padding-left: 10px;
}

.big {
  font-weight: 650;
  color: var(--fg);
}

.sub {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.rg {
  display: grid;
  gap: 3px;
  min-width: 128px;
  max-width: 196px;
  font: 11.5px/1.2 var(--mono);
  color: var(--fg2);
}

.rg-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.rg-pct {
  color: var(--muted);
  font-size: 10.5px;
}

.rg-num.muted {
  color: var(--muted);
}

.rg-track {
  position: relative;
  height: 2px;
  border-radius: 99px;
  background: var(--line2);
}

.rg-tick {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 12px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--accent);
}

.rg.out .rg-tick {
  background: var(--down);
}

.trend {
  display: inline-block;
  min-width: 58px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.trend.up {
  color: var(--up);
  background: var(--up-bg);
}

.trend.down {
  color: var(--down);
  background: var(--down-bg);
}

.trend.flat {
  color: var(--muted);
}

.trend.fresh {
  color: var(--accent);
  background: var(--accent-bg);
}

.lq {
  display: inline-flex;
  vertical-align: middle;
}

.lq.wait .lqs {
  opacity: 0.5;
}

.lq-none {
  display: inline-block;
  width: 120px;
  font-size: 11.5px;
  color: var(--fg2);
  border-bottom: 1px solid #2a2c31;
  line-height: 22px;
  vertical-align: middle;
}

.lq-none.drained {
  color: var(--warn);
}

.lqs {
  width: 120px;
  height: 24px;
  display: block;
  stroke: none;
}

.lqs rect.bid,
.lchart rect.bid {
  fill: rgba(121,201,90,0.62);
}

.lqs rect.ask,
.lchart rect.ask {
  fill: rgba(240,106,95,0.58);
}

.lqs line.floor {
  stroke: #2a2c31;
  stroke-width: 1;
}

.lqs line.now {
  stroke: var(--accent);
  stroke-width: 1.4;
}

.grid td.c-f5.hit {
  color: var(--accent);
  font-weight: 650;
}

.tvl-null {
  color: var(--muted);
}

.acts {
  display: inline-flex;
  gap: 2px;
}

.act {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.act:hover {
  background: var(--card3);
  color: var(--fg);
}

.act svg {
  width: 15px;
  height: 15px;
}

.act.okx {
  width: auto;
  padding: 0 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.act.ph {
  visibility: hidden;
}

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.empty b {
  color: var(--fg2);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.pages {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pages .btn {
  width: 30px;
  height: 30px;
  font-size: 18px;
}

.pages .btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pnums {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.pnums .pn {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.pnums .pn:hover {
  background: var(--card3);
  color: var(--fg);
}

.pnums .pn.on {
  background: var(--card3);
  color: var(--fg);
  font-weight: 650;
  cursor: default;
}

.pnums .gap {
  min-width: 16px;
  text-align: center;
  color: var(--muted);
}

.per {
  display: flex;
  align-items: center;
  gap: 8px;
}

.foot {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
}

.in {
  color: var(--up);
}

.out {
  color: var(--muted);
}

.pnl-up,
.cl-kpis b.pnl-up {
  color: var(--up);
}

.pnl-down,
.cl-kpis b.pnl-down {
  color: var(--down);
}

/* ---------- drawer ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10,10,11,0.55);
  backdrop-filter: blur(2px);
  animation: fade 0.18s ease-out;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(620px, 100vw);
  overflow-y: auto;
  padding: 26px 28px 40px;
  background: #121315;
  border-left: 1px solid var(--line2);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
  animation: slide 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slide {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.drawer .close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  margin: -6px -8px 0 0;
  font-size: 22px;
  background: #121315;
}

.d-head {
  display: grid;
  gap: 8px;
  padding-right: 40px;
}

.d-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.3px;
  word-break: break-all;
}

.d-addr {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 12.5px var(--mono);
  color: var(--muted);
  word-break: break-all;
}

.d-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
}

.d-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.m {
  padding: 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
}

.m .l {
  font-size: 11.5px;
  color: var(--muted);
}

.m .v {
  font-size: 17px;
  font-weight: 650;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.m .v small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.d-sec {
  margin-top: 22px;
}

.d-sec h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 14px;
}

.chart {
  padding: 14px 14px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
}

.chart svg {
  width: 100%;
  height: 130px;
  display: block;
  stroke: none;
}

.chart rect.p {
  fill: #3a3d44;
}

.chart rect.c {
  fill: var(--accent);
}

.chart rect:hover {
  fill: #fff;
}

.chart line {
  stroke: #2a2c31;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.chart .axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.lplot {
  position: relative;
  cursor: crosshair;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.lplot svg * {
  pointer-events: none;
}

.lplot:not(.on) .sc {
  display: none;
}

.lchart rect.band.bid {
  fill: rgba(121,201,90,0.1);
}

.lchart rect.band.ask {
  fill: rgba(240,106,95,0.1);
}

.lchart rect.shade {
  fill: var(--card);
  opacity: 0.72;
}

.lchart line.cur {
  stroke: var(--fg);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.lq-tip {
  position: absolute;
  top: 2px;
  left: 0;
  z-index: 3;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--line2);
  background: rgba(20,21,24,0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  color: var(--fg2);
  font-size: 12px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  width: max-content;
  max-width: 230px;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.lq-tip .px {
  color: var(--fg);
  font-size: 15px;
  font-weight: 700;
}

.lq-tip b {
  color: var(--fg);
}

.lq-tip .bid {
  color: var(--up);
  font-weight: 600;
}

.lq-tip .ask {
  color: var(--down);
  font-weight: 600;
}

.lchart line.floor {
  stroke: #2a2c31;
  stroke-dasharray: none;
}

.lchart line.now {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: none;
}

.lchart .axis .now {
  color: var(--accent);
}

.lq-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.lq-stats .m {
  padding: 9px 10px;
  background: var(--card2);
}

.lq-stats .m .v {
  font-size: 15px;
}

.lchart .note {
  margin: 10px 0 2px;
  font-size: 12.5px;
  line-height: 1.45;
}

.lchart .note b {
  color: var(--fg);
}

.zooms {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.zooms button {
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.zooms button:hover {
  color: var(--fg);
}

.zooms button.on {
  background: var(--accent-bg);
  border-color: rgba(255,106,61,0.5);
  color: var(--accent);
}

.tokens {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.token {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
}

.token b {
  min-width: 70px;
}

.token code {
  flex: 1;
  font: 12px var(--mono);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mini-scroll {
  overflow-x: auto;
}

.mini th {
  text-align: right;
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.mini td {
  text-align: right;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mini .left {
  text-align: left;
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.mini .act {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}

.note {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- popover & toast ---------- */

.pop {
  position: fixed;
  top: calc(var(--top-h) + 8px);
  right: max(28px, calc((100vw - 1480px) / 2 + 28px));
  z-index: 60;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 100px);
  overflow: auto;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line2);
  background: #141518;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: fade 0.15s;
}

.pop h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.pop dl {
  margin: 0;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 12px;
  font-size: 13px;
}

.pop dt {
  font-weight: 600;
  color: var(--fg);
}

.pop dd {
  margin: 0;
  color: var(--fg2);
}

.pop p {
  margin: 14px 0 0;
  font-size: 12.5px;
}

/* ---------- what's new ---------- */

.news-btn {
  position: relative;
  margin-left: 2px;
  color: var(--muted);
  font-weight: 400;
}

.news-btn.on {
  color: var(--accent);
}

.news-n {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--down);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.pop.news-pop {
  left: max(28px, calc((100vw - 1480px) / 2 + 28px));
  right: auto;
  width: min(430px, calc(100vw - 32px));
}

.news-it {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.news-it:first-child {
  padding-top: 2px;
  border-top: 0;
}

.news-it b {
  display: block;
  margin: 3px 0 6px;
  font-size: 14px;
}

.news-it ul {
  margin: 0;
  padding-left: 18px;
  color: var(--fg2);
  font-size: 13px;
  line-height: 1.45;
}

.news-it li + li {
  margin-top: 3px;
}

.news-d {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.news-new {
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.pop p.news-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.news-foot a {
  color: var(--accent);
}

.news-note {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 66;
  display: grid;
  gap: 4px;
  width: min(340px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,106,61,0.35);
  background: #141518;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  animation: fade 0.15s;
}

.news-note-h {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.news-note-acts {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ---------- site suggestions ---------- */

.news-btn.ideas-btn {
  margin-left: -4px;
}

.ideas-form {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.ideas-form textarea {
  width: 100%;
  min-height: 96px;
  max-height: 320px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ideas-form textarea:focus {
  border-color: rgba(255,106,61,0.6);
  box-shadow: 0 0 0 3px rgba(255,106,61,0.12);
}

.ideas-form textarea::placeholder {
  color: #5a5e65;
}

.ideas-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.ideas-row .warn {
  color: var(--warn);
}

.ideas-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ideas-att {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.ideas-att svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ideas-form.drop textarea {
  border-color: rgba(255,106,61,0.6);
  box-shadow: 0 0 0 3px rgba(255,106,61,0.12);
}

.ideas-shots,
.idea-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.idea-shots {
  margin-top: 8px;
}

.ideas-shot,
.idea-shots a {
  position: relative;
  display: block;
  width: 88px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line2);
  background: var(--card);
}

.ideas-shot img,
.idea-shots img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ideas-shot button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}

.ideas-seg {
  margin-bottom: 6px;
}

.ideas-seg button {
  height: 26px;
  font-size: 12.5px;
}

.ideas-mine {
  margin: 0 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.news-it.idea-it .news-d b {
  display: inline;
  margin: 0;
  color: var(--fg);
  font-size: 12px;
}

.idea-t {
  margin: 6px 0 0;
  color: var(--fg2);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pop p.idea-t {
  margin-top: 6px;
  font-size: 13px;
}

.idea-st {
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--card3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.idea-st.done {
  background: rgba(121,201,90,0.12);
  color: #94d97a;
}

.idea-st.no {
  background: rgba(240,106,95,0.1);
  color: #f48a80;
}

.idea-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.idea-acts .btn.small {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
}

.idea-acts .btn.del {
  margin-left: auto;
  color: var(--muted);
}

.idea-acts .btn.del:hover {
  color: var(--down);
}

/* ---------- open-position workspace ---------- */

.seg.wrap {
  flex-wrap: wrap;
}

.btn.primary.blk,
.btn.primary.blk:hover {
  background: var(--warn);
  border-color: var(--warn);
  color: #ffffff;
}

.btn.primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn.off,
.btn.off:hover {
  opacity: 0.45;
  cursor: help;
  background: transparent;
}

.lpx-open svg {
  width: 15px;
  height: 15px;
}

.act.lpa {
  width: auto;
  padding: 0 6px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.act.lpa.off {
  color: var(--muted);
  opacity: 0.4;
  cursor: help;
}

.act.lpa.off:hover {
  background: none;
}

body.lpx-on {
  overflow: hidden;
}

body.lpx-resizing,
body.lpx-resizing * {
  cursor: ns-resize !important;
  user-select: none;
}

body.lpx-grabbing,
body.lpx-grabbing * {
  cursor: grabbing !important;
  user-select: none;
}

.lpx {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: flex;
  flex-direction: column;
  background: #0a0a0b;
  animation: fade 0.15s ease-out;
}

.lpx-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 62px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #101113;
  flex: none;
}

.lpx-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  margin-right: -8px;
  padding: 0;
  border: 1px solid var(--line2);
  border-radius: 11px;
  background: var(--card2);
  color: var(--muted);
  cursor: pointer;
}

.lpx-home:hover {
  background: var(--card3);
  border-color: #4a4e55;
  color: var(--fg);
}

.lpx-home svg {
  width: 18px;
  height: 18px;
}

.lpx-pool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: 11px;
  background: var(--card2);
  cursor: pointer;
  font-size: 15px;
  white-space: nowrap;
}

.lpx-pool:hover {
  background: var(--card3);
  border-color: #4a4e55;
}

.lpx-pool #lpx-pool-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lpx-pool b {
  font-weight: 700;
  margin-right: 2px;
}

.lpx-pool > svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.lpx-price {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 120px;
}

.lpx-pxv {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.lpx-pxv small {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.lpx-chg {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lpx-chg.up {
  color: var(--up);
}

.lpx-chg.down {
  color: var(--down);
}

/* A stat that does not fit drops whole to a second line, which stays hidden, instead of being cut mid-word. */
.lpx-stats {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 24px 18px;
  /* The 1м / 5м / 30м / 24ч cards. */
  max-height: 58px;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
}

.lpx-stats div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
}

.lpx-stats span {
  color: var(--muted);
  font-size: 11px;
}

.lpx-stats b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Owner, 2026-11-05: one card per period instead of the table. The period's fees are the big figure. */
.lpx-stats .lpx-cards {
  display: grid;
  flex: 0 1 auto;
  grid-template-columns: repeat(4, minmax(0, 108px));
  gap: 6px;
  width: 450px;
  min-width: 0;
}

.lpx-stats .lpx-cd {
  display: block;
  min-width: 0;
  padding: 5px 9px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  line-height: 1.25;
}

.lpx-stats .lpx-cdh {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 6px;
}

.lpx-stats .lpx-cdh i {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lpx-stats .lpx-cdh i:first-child {
  flex: none;
  color: var(--fg2);
  font-weight: 700;
}

.lpx-stats .lpx-cd b {
  display: block;
  overflow: hidden;
  color: var(--fg);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lpx-stats .lpx-cd.z b {
  color: var(--muted);
  font-weight: 500;
}

.lpx-stats .lpx-cdv {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lpx-stats .lpx-cdv span {
  color: inherit;
  font-size: inherit;
}

.lpx-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  cursor: help;
}

.lpx-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.lpx-live.on i {
  background: var(--up);
}

.lpx-live.down i {
  background: var(--down);
}

.lpx-live.pulse i {
  animation: lpx-pulse 0.7s ease-out;
}

@keyframes lpx-pulse {
  from {
    box-shadow: 0 0 0 0 rgba(121,201,90,0.75);
  }
  to {
    box-shadow: 0 0 0 9px rgba(121,201,90,0);
  }
}

.lpx-links {
  display: flex;
  gap: 4px;
}

.lpx-links svg {
  width: 13px;
  height: 13px;
}

.lpx-x {
  font-size: 22px;
}

.lpx-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
}

.lpx-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
}

.lpx-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #0d0d0f;
  flex-wrap: wrap;
  flex: none;
}

.lpx-tools .seg button {
  height: 24px;
  padding: 0 9px;
  font-size: 12.5px;
}

.lpx-tools .btn.small {
  height: 30px;
}

.lpx-tools .btn.on {
  color: var(--accent);
  border-color: rgba(255,106,61,0.45);
}

.lpx-lowrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.lpx-lost {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}

.lpx-lost.err {
  color: var(--down);
}

.lpx-hist {
  margin-left: auto;
}

.lpx-liqw {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lpx-chart {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #101113;
  touch-action: none;
}

.lpx-legend {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 8px;
  z-index: 3;
  display: flex;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
  font: 12px var(--mono);
  color: var(--fg2);
  pointer-events: none;
}

.lpx-legend b {
  font-weight: 500;
}

.lpx-legend .up {
  color: #79c95a;
}

.lpx-legend .down {
  color: #f06a5f;
}

.lpx-over {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.lpx-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 22px;
  border-radius: 12px;
  background: rgba(16,17,19,0.85);
  text-align: center;
}

.lpx-empty .btn {
  margin-top: 8px;
  pointer-events: auto;
}

.lpx-tools .btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.lpx-empty .lpx-spin {
  width: 22px;
  height: 22px;
  margin-bottom: 6px;
}

/* "Прогрузить период": the picker under its button, and the bar of the period on screen. */
.lpx-pvwrap {
  position: relative;
}

.lpx-pvpop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: 340px;
  max-width: calc(100vw - 16px);
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: #121315;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  animation: fade 0.12s ease-out;
}

.lpx-pvpop[hidden] {
  display: none;
}

.lpx-pvh {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.lpx-pvrow {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 116px;
  align-items: center;
  gap: 6px;
}

.lpx-pvrow > span {
  color: var(--muted);
  font-size: 12.5px;
}

.lpx-pvrow input {
  height: 32px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: #0d0d0f;
  color: var(--fg);
  font: 13px var(--mono);
  color-scheme: dark;
}

.lpx-pvrow input:focus {
  outline: none;
  border-color: rgba(255,106,61,0.55);
}

.lpx-pvql {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lpx-pvql .seg button {
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

.lpx-pverr {
  color: var(--down);
  font-size: 12.5px;
}

.lpx-pverr:empty {
  display: none;
}

.lpx-pvgo {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.lpx-pvbar {
  order: 10;
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 30px;
  padding: 0 4px 0 10px;
  border: 1px solid rgba(255,106,61,0.45);
  border-radius: 9px;
  background: rgba(255,106,61,0.07);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
}

.lpx-pvbar[hidden] {
  display: none;
}

.lpx-pvbar b {
  color: var(--accent);
  font-weight: 600;
}

.lpx-pvic {
  flex: none;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0 25%, transparent 0);
}

.lpx-pvr {
  font-family: var(--mono);
  font-size: 12px;
}

.lpx-pvst {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg2);
}

.lpx-pvbar.part .lpx-pvst,
.lpx-pvbar.stop .lpx-pvst,
.lpx-pvbar.none .lpx-pvst {
  color: var(--warn);
}

.lpx-pvbar.err .lpx-pvst {
  color: var(--down);
}

.lpx-pvprog {
  flex: none;
  width: 70px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,106,61,0.15);
  overflow: hidden;
}

.lpx-pvprog i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.lpx-tools .lpx-rt {
  flex: none;
  height: 22px;
  margin-left: 4px;
  padding: 0 9px;
  gap: 6px;
  font-size: 12px;
}

.lpx-rt i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(121,201,90,0.18);
}

.lpx-spin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255,106,61,0.18);
  border-top-color: var(--accent);
  animation: lpx-spin 0.8s linear infinite;
}

@keyframes lpx-spin {
  to {
    transform: rotate(360deg);
  }
}

.lpx-chart {
  min-height: 220px;
}

/* ---------- trade feed beside the chart ---------- */

.lpx-crow {
  position: relative;
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 220px;
}

.lpx-crow > .lpx-chart {
  flex: 1;
  min-width: 0;
}

.lpx-fxt {
  flex: none;
  width: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: #0d0d0f;
  color: var(--muted);
  cursor: pointer;
}

.lpx-fxt svg {
  box-sizing: content-box;
  width: 12px;
  height: 12px;
  padding: 16px 1px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: var(--card2);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    transform 0.2s ease,
    color 0.15s,
    border-color 0.15s;
}

.lpx-fxt:hover {
  color: var(--accent);
}

.lpx-fxt:hover svg {
  border-color: rgba(255,106,61,0.5);
}

.lpx-crow.fx-on .lpx-fxt svg {
  transform: rotate(180deg);
}

.lpx-fxt.buy svg {
  animation: lpx-fxping-buy 0.6s ease-out;
}

.lpx-fxt.sell svg {
  animation: lpx-fxping-sell 0.6s ease-out;
}

@keyframes lpx-fxping-buy {
  from {
    color: #79c95a;
    border-color: #79c95a;
  }
}

@keyframes lpx-fxping-sell {
  from {
    color: #f06a5f;
    border-color: #f06a5f;
  }
}

.lpx-fx {
  flex: none;
  width: 0;
  overflow: hidden;
  background: #0d0d0f;
  transition: width 0.18s ease;
}

.lpx-crow.fx-on .lpx-fx {
  width: 400px;
}

.lpx-fxin {
  width: 400px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.lpx-fxh {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 7px;
  flex: none;
}

.lpx-fxtt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 650;
}

.lpx-fxtt i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.lpx-fxtt i.on {
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(121,201,90,0.14);
}

.lpx-fxtt i.down {
  background: var(--down);
}

#lpx-fxn {
  white-space: nowrap;
}

.lpx-fxh .seg {
  margin-left: auto;
}

.lpx-fxseg {
  padding: 2px;
  border-radius: 9px;
}

.lpx-fxseg button {
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
}

.lpx-fxf {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 0 12px 8px;
  flex: none;
}

.lpx-fxw {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 12px 8px;
  padding: 5px 6px 5px 9px;
  border: 1px solid rgba(255,106,61,0.35);
  border-radius: 9px;
  background: var(--accent-bg);
  font-size: 12px;
  flex: none;
}

.lpx-fxw a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-family: var(--mono);
  text-decoration: none;
}

.lpx-fxw a:hover {
  text-decoration: underline;
}

.lpx-fxw svg,
.lpx-fxic svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lpx-fxic,
.lpx-fxwx {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.lpx-fxic:hover,
.lpx-fxwx:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}

.lpx-fxwx {
  margin-left: auto;
  font-size: 16px;
  line-height: 1;
}

.lpx-fxwn {
  white-space: nowrap;
}

.lpx-fxerr {
  margin: 0 12px 6px;
  color: var(--warn);
  font-size: 11.5px;
  flex: none;
}

/* The price keeps 66 px ($0.001800 is 63 at 12.5 px); the pool · wallet column gives way first (owner, 2026-10-31: «цена
   сделок не влазит если у токена много нулей»). */
.lpx-fxc,
.lpx-fxr {
  display: grid;
  grid-template-columns: 62px minmax(66px, 1fr) minmax(0, 150px) 38px;
  column-gap: 8px;
  align-items: center;
  padding: 0 12px;
}

.lpx-agg .lpx-fxc,
.lpx-agg .lpx-fxr {
  grid-template-columns: 58px minmax(66px, 1fr) minmax(0, 190px) 36px;
}

.lpx-fxc {
  height: 26px;
  flex: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.lpx-fxc span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lpx-fxc span:nth-child(2),
.lpx-fxc span:nth-child(4),
.lpx-fxr .c-p,
.lpx-fxr .c-t {
  text-align: right;
}

.lpx-fxbw {
  position: relative;
  flex: 1;
  min-height: 0;
}

.lpx-fxb {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.lpx-fxb:hover {
  scrollbar-color: var(--line2) transparent;
}

.lpx-fxr {
  position: relative;
  height: 27px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}

.lpx-fxr > span {
  position: relative;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lpx-fxr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.lpx-fxr.buy .c-u {
  color: #79c95a;
  font-weight: 600;
}

.lpx-fxr.sell .c-u {
  color: #f06a5f;
  font-weight: 600;
}

.lpx-fxr .c-p {
  color: var(--fg2);
}

.lpx-fxr .c-t {
  color: var(--muted);
}

.lpx-fxr .c-w {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lpx-fxr.buy.new {
  animation: lpx-fxnew-buy 1.2s ease-out;
}

.lpx-fxr.sell.new {
  animation: lpx-fxnew-sell 1.2s ease-out;
}

@keyframes lpx-fxnew-buy {
  from {
    background: rgba(121,201,90,0.2);
  }
}

@keyframes lpx-fxnew-sell {
  from {
    background: rgba(240,106,95,0.2);
  }
}

.lpx-fxa {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg2);
  font: 11.5px var(--mono);
  cursor: pointer;
}

.lpx-fxa:hover {
  color: var(--accent);
  text-decoration: underline;
}

.lpx-fxa.me {
  color: var(--accent);
}

.lpx-fxme,
.lpx-fxcnt {
  flex: none;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.lpx-fxme {
  background: var(--accent);
  color: #ffffff;
}

.lpx-fxcnt {
  background: rgba(64,156,255,0.14);
  color: #64a8ff;
  cursor: help;
}

.lpx-fxwait {
  color: var(--muted);
}

.lpx-fxq {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  height: 24px;
  padding: 0 11px;
  border: 1px solid rgba(255,106,61,0.45);
  border-radius: 999px;
  background: #1c1d20;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.lpx-fxe {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 18px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.lpx-fxe b {
  color: var(--fg2);
  font-weight: 600;
}

.lpx-fxe .lpx-spin {
  width: 20px;
  height: 20px;
}

body.lpx-ruling,
body.lpx-ruling * {
  cursor: crosshair !important;
  user-select: none;
}

.lpx-split {
  flex: none;
  height: 7px;
  cursor: ns-resize;
  background: #0d0d0f;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.lpx-split::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  width: 36px;
  height: 2px;
  margin-left: -18px;
  border-radius: 2px;
  background: var(--line2);
}

.lpx-split:hover::after {
  background: var(--accent);
}

.lpx-pos {
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 96px;
  background: #0d0d0f;
  overflow: hidden;
}

.lpx-phd {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  flex-wrap: wrap;
  flex: none;
  font-size: 17px;
}

.lpx-phd .seg button {
  height: 36px;
  padding: 0 16px;
  font-size: 15px;
}

.lpx-ptot {
  margin-left: auto;
  color: var(--muted);
  font-size: 15.5px;
}

.lpx-phd .lpx-dbtn {
  margin-left: auto;
  height: 38px;
  padding: 0 18px;
  font-size: 15px;
}

.lpx-dbtn + .lpx-ptot {
  margin-left: 0;
}

.lpx-ptot b {
  color: var(--fg);
  font-weight: 650;
}

.lpx-perr {
  margin: 0 12px 6px;
}

.lpx-pbody {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.lpx-pempty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  min-height: 60px;
  padding: 10px 16px;
  text-align: center;
  font-size: 14px;
}

.lpx-spin.sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
  display: inline-block;
  vertical-align: -2px;
}

.lpx-ptab {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  font-variant-numeric: tabular-nums;
}

.lpx-ptab th {
  position: sticky;
  top: 0;
  z-index: 1;
  width: 1%;
  padding: 10px 12px;
  background: #0d0d0f;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.lpx-ptab th:nth-child(2) {
  width: auto;
}

.lpx-ptab td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  line-height: 1.35;
  text-align: right;
  vertical-align: middle;
}

.lpx-ptab .pool {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.lpx-ptab .big {
  font-size: 17px;
  white-space: nowrap;
}

.lpx-ptab .sub {
  margin-top: 3px;
  font-size: 13.5px;
}

.lpx-ptab .b {
  height: 22px;
  font-size: 13px;
  white-space: nowrap;
}

.lpx-ptab .rg {
  gap: 6px;
  min-width: 200px;
  max-width: none;
  font-size: 14.5px;
}

.lpx-ptab .rg-pct {
  font-size: 13px;
}

.lpx-ptab .rg-track {
  height: 5px;
}

.lpx-ptab .rg-tick {
  height: 14px;
  top: -5px;
}

/* «Мои позиции» on a wide screen: the range keeps a sane width, the spare width goes to the three numbers, centred. */
@media (min-width: 1200px) {
  .lpx-ptab.lpx-mine th:nth-child(2) {
    width: 1%;
  }

  .lpx-ptab.lpx-mine th:nth-child(n + 3):not(.c-act) {
    width: 14%;
  }

  .lpx-ptab.lpx-mine :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(5)) {
    text-align: center;
  }

  .lpx-ptab.lpx-mine .rg {
    width: clamp(220px, 19vw, 360px);
    max-width: none;
  }
}

.lpx-ptab th.left,
.lpx-ptab td.left {
  text-align: left;
}

.lpx-ptab tbody tr[data-cid] {
  cursor: pointer;
}

.lpx-ptab tbody tr[data-cid]:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Closed: as LP wallets — the date keeps its own width, the spare width is shared by all columns; two lines a row. */
.lpx-ctab th:nth-child(2) {
  width: 1%;
}

.lpx-ctab .rg {
  min-width: 200px;
  max-width: 260px;
}

.lpx-ctab .pool {
  flex-wrap: nowrap;
}

.lpx-ctab td {
  white-space: nowrap;
}

.lpx-cacts button:disabled {
  opacity: 0.5;
  cursor: default;
}

.lpx-ptab tbody tr[data-pid] {
  cursor: pointer;
}

.lpx-ptab tbody tr[data-pid]:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.lpx-ptab tr.here td {
  background: rgba(64,156,255,0.045);
}

.lpx-ptab tr.here td:first-child {
  box-shadow: inset 2px 0 0 #409cff;
}

.lpx-ptab tr.sel td {
  background: rgba(64,156,255,0.1);
}

.lpx-ptab tr.out .pair {
  color: var(--fg2);
}

.lpx-ptab .pair {
  max-width: 260px;
  font-size: 17px;
}

.lpx-hereb {
  color: #409cff;
  font-weight: 600;
}

.lpx-ptab td.c-act {
  white-space: nowrap;
}

.lpx-acts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lpx-acts .btn.small {
  height: 38px;
  padding: 0 16px;
  font-size: 15px;
}

.lpx-acts .act {
  width: 38px;
  height: 38px;
}

.lpx-acts .act svg {
  width: 18px;
  height: 18px;
}

.lpx-phd .lpx-hf button {
  height: 32px;
  padding: 0 12px;
  font-size: 14px;
}

.lpx-ptab tbody tr[data-hid] {
  cursor: pointer;
}

.lpx-ptab tbody tr[data-hid]:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.lpx-htab tr.sel td {
  background: rgba(199, 146, 255, 0.09);
}

.lpx-htab tr.sel td:first-child {
  box-shadow: inset 2px 0 0 #c792ff;
}

.lpx-htab tr.out .lpx-hw {
  color: var(--fg2);
}

/* LP wallets: the range bar keeps a compact width, the spare width is shared by all columns. */
.lpx-htab th:nth-child(2) {
  width: 1%;
}

.lpx-htab .rg {
  min-width: 200px;
  max-width: 260px;
}

.lpx-hwal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lpx-hw {
  font-size: 16px;
  white-space: nowrap;
}

.lpx-hwal .act {
  width: 28px;
  height: 28px;
}

.lpx-hwal .act svg {
  width: 15px;
  height: 15px;
}

.lpx-acts .lpx-prof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.lpx-acts .lpx-prof svg {
  width: 14px;
  height: 14px;
}

.lpx-acts .lpx-hpos {
  font-weight: 650;
  font-size: 16px;
  text-decoration: none;
}

.lpx-rpct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lpx-rpct .btn.small {
  padding: 0 12px;
}

@media (max-width: 1599px) {
  .lpx-phd {
    font-size: 16px;
    padding: 10px 12px;
  }

  .lpx-phd .seg button {
    height: 34px;
    padding: 0 12px;
    font-size: 14px;
  }

  .lpx-phd .lpx-dbtn {
    height: 34px;
    padding: 0 14px;
    font-size: 14px;
  }

  .lpx-ptab th,
  .lpx-ptab td {
    padding-left: 8px;
    padding-right: 8px;
  }

  .lpx-ptab th {
    white-space: normal;
  }

  .lpx-ptab .rg {
    min-width: 160px;
  }

  /* Four buttons in a 2×2 grid, the link beside them: the numbers get the width a single row of buttons would take. */
  .lpx-acts {
    display: inline-grid;
    grid-template-columns: auto auto auto;
    gap: 6px;
  }

  .lpx-acts > .act {
    grid-column: 3;
    grid-row: 1;
  }

  .lpx-acts > .act + .act {
    grid-row: 2;
  }

  .lpx-acts > .act:last-child:not(.act + .act) {
    grid-row: 1 / span 2;
  }

  .lpx-acts .act {
    width: 34px;
    height: 34px;
  }

  .lpx-htab .lpx-acts,
  .lpx-ctab .lpx-acts {
    display: inline-flex;
  }

  /* Narrow: pair above its badges; position id and wallet move to the pair's tooltip, this pool's row keeps its highlight. */
  .lpx-ctab .pool {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .lpx-ctab td:first-child > .sub {
    display: none;
  }

  .lpx-acts > .lpx-rpct {
    grid-column: 1 / span 2;
    grid-row: 1 / span 2;
    flex-wrap: wrap;
    max-width: 240px;
  }

  .lpx-acts .btn.small {
    height: 34px;
    padding: 0 12px;
    font-size: 14px;
  }
}

/* Wide panels: numbers and buttons keep their own width, the range bar takes what is left instead of gaps in every column. */
@media (min-width: 1800px) {
  .lpx-phd {
    font-size: 18px;
  }

  .lpx-phd .seg button,
  .lpx-phd .lpx-dbtn {
    height: 40px;
    font-size: 16px;
  }

  .lpx-ptot {
    font-size: 16px;
  }

  .lpx-ptab {
    font-size: 16.5px;
  }

  .lpx-ptab th {
    padding: 11px 16px;
    font-size: 14.5px;
  }

  .lpx-ptab tr[data-pid] td {
    padding: 14px 16px;
    white-space: nowrap;
  }

  .lpx-ptab .pool {
    flex-wrap: nowrap;
  }

  .lpx-ptab .big,
  .lpx-ptab .pair {
    font-size: 18.5px;
  }

  .lpx-ptab .sub {
    font-size: 14.5px;
  }

  .lpx-ptab .b {
    height: 24px;
    font-size: 13.5px;
  }

  .lpx-ptab .rg {
    font-size: 15.5px;
  }

  .lpx-ptab .rg-pct {
    font-size: 14px;
  }

  .lpx-acts {
    gap: 10px;
  }

  .lpx-acts .btn.small {
    height: 42px;
    padding: 0 18px;
    font-size: 16px;
  }

  .lpx-acts .act {
    width: 42px;
    height: 42px;
  }

  .lpx-acts .act svg {
    width: 20px;
    height: 20px;
  }
}

.btn.lpx-claim {
  color: #94d97a;
  background: rgba(121,201,90,0.08);
  border-color: rgba(121,201,90,0.4);
}

.btn.lpx-claim:hover {
  background: rgba(121,201,90,0.15);
  border-color: rgba(121,201,90,0.6);
}

.btn.lpx-claim:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn.lpx-danger {
  color: #f48a80;
  border-color: rgba(244,138,128,0.35);
}

.btn.primary.lpx-danger {
  color: #fff;
  background: #c8463f;
  border-color: #c8463f;
}

.lpx-inc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px 0 10px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(64,156,255,0.1);
  border: 1px solid rgba(64,156,255,0.35);
  font-size: 12.5px;
}

.lpx-inc b {
  color: #409cff;
}

.lpx-inc[hidden] {
  display: none;
}

.lpx-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 14px;
  background: #0d0d0f;
}

.lpx-side .lpx-nd,
.lpx-nodraft #lpx-range,
.lpx-nodraft #lpx-amount,
.lpx-nodraft #lpx-prev,
.lpx-nodraft #lpx-go,
.lpx-nodraft #lpx-steps {
  display: none;
}

.lpx-nodraft .lpx-side .lpx-nd {
  display: inline-flex;
}

/* A chain read on demand: chart, liquidity and swaps only. */
.lpx-view .lpx-side .lpx-nd {
  display: none;
}

/* All pools of a token as one market: no position form, no period loader; the pools list sits right of the chart. */
.lpx-agg .lpx-main {
  grid-template-columns: minmax(0, 1fr) 400px;
}

.lpx-agg .lpx-side,
.lpx-agg .lpx-pvwrap,
.lpx-agg #lpx-unit,
.lpx-agg .lpx-split,
.lpx-agg .lpx-pos,
.lpx-apools {
  display: none;
}

.lpx-agg .lpx-apools {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #0d0d0f;
}

.b.agg {
  color: #64a8ff;
  border-color: rgba(64,156,255,0.45);
  background: rgba(64,156,255,0.1);
}

tr.agg-row {
  cursor: pointer;
}

tr.agg-row td {
  background: rgba(64,156,255,0.05);
}

tr.agg-row td:first-child {
  box-shadow: inset 3px 0 0 #409cff;
}

tr.agg-row .pair {
  font-weight: 700;
}

tr.agg-row:hover td {
  background: rgba(64,156,255,0.1);
}

.act.lpa.agg {
  color: #64a8ff;
}

.lpx-fxg {
  flex: none;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 5px;
  color: var(--fg2);
  font-size: 11px;
  line-height: 16px;
  cursor: help;
}

.lpx-fxg i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 4px 1px 0;
  border-radius: 2px;
  vertical-align: middle;
}

.lpx-abody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.lpx-aptab {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.lpx-aptab th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 8px;
  background: #0d0d0f;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.lpx-aptab td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}

.lpx-aptab tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}

.lpx-aptab th:first-child,
.lpx-aptab td:first-child {
  width: 100%;
  padding-left: 14px;
  text-align: left;
  white-space: normal;
}

.lpx-aptab th:last-child,
.lpx-aptab td:last-child {
  padding-right: 14px;
}

.lpx-aptab td .sub {
  margin-top: 2px;
  font-size: 11.5px;
}

.lpx-aptab tbody tr[data-aggopen] {
  cursor: pointer;
}

.lpx-aptab tbody tr[data-aggopen]:hover td {
  background: rgba(64,156,255,0.08);
}

.lpx-apair {
  display: flex;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.lpx-atags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.lpx-alink {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--fg2);
  font-size: 11px;
  text-decoration: none;
}

.lpx-alink:hover {
  color: var(--fg);
}

.lpx-alink svg {
  width: 11px;
  height: 11px;
}

@media (max-width: 1180px) {
  .lpx-agg .lpx-main {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

@media (max-width: 900px) {
  .lpx-agg .lpx-apools {
    flex: none;
    max-height: 60vh;
  }
}

.lpx-sw {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  margin: 0 8px 1px 0;
  border-radius: 3px;
  vertical-align: middle;
}

/* a pool outside the chart's colours: the same slot, empty, so the names line up */
.lpx-sw.off {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}

.lpx-an {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the pools that build the price on the chart */
.lpx-apx {
  flex: none;
  width: 5px;
  height: 5px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--accent, #409cff);
}

.lpx-apair .lpx-alink {
  margin-left: 6px;
}

/* venue · fee · dyn under the pair, one quiet line (no chips) */
.lpx-ameta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0 17px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lpx-awarn {
  color: var(--warn, #f0b90b);
}

.lpx-aptab td {
  vertical-align: middle;
}

.lpx-nopool .lpx-side > *,
.lpx-nopool .lpx-tools > *,
.lpx-nopool .lpx-stats,
.lpx-nopool .lpx-price,
.lpx-nopool .lpx-live,
.lpx-nopool .lpx-links {
  visibility: hidden;
}

.lpx-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.lpx-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13.5px;
  font-weight: 600;
}

.lpx-h .seg button {
  height: 24px;
  padding: 0 9px;
  font-size: 12px;
}

.lpx-wrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.lpx-wrow img,
.lpx-wrow .wi {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.lpx-wname {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lpx-wrow > select {
  min-width: 0;
}

.lpx-push {
  flex: none;
  margin-left: auto;
  white-space: nowrap;
}

.lpx-wswitch {
  width: 100%;
  margin-top: 10px;
}

.lpx-addr {
  flex: none;
  white-space: nowrap;
  padding: 3px 8px;
  border: 1px solid var(--line2);
  border-radius: 7px;
  background: var(--card2);
  font: 12.5px var(--mono);
  color: var(--fg2);
  cursor: pointer;
}

.lpx-addr:hover {
  color: var(--fg);
}

.lpx-wnote {
  margin: 8px 0 0;
}

.lpx-warnbtn {
  color: var(--warn);
  border-color: rgba(230,174,72,0.45);
}

.lnk {
  color: var(--accent);
}

.lpx-prow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lpx-plbl {
  flex: none;
}

.lpx-bins {
  margin-bottom: 10px;
}

.lpx-bins canvas {
  display: block;
  width: 100%;
  height: 104px;
  border-radius: 8px;
  background: #121315;
  cursor: pointer;
  touch-action: none;
}

.lpx-locked .lpx-bins canvas {
  cursor: default;
  opacity: 0.6;
}

.lpx-binfo {
  min-height: 34px;
  margin-top: 6px;
  line-height: 1.45;
  color: var(--fg2);
  font-variant-numeric: tabular-nums;
}

.lpx-locked .lpx-presets,
.lpx-locked .lpx-step {
  opacity: 0.45;
}

.lpx-presets button {
  height: 26px;
  padding: 0 9px;
  font-size: 12.5px;
}

.lpx-edges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lpx-edge {
  padding: 8px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card2);
  text-align: center;
}

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

.lpx-ein {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 2px;
}

.lpx-ein input {
  flex: 1;
  width: 0;
  height: 34px;
  padding: 0 6px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: #121315;
}

.lpx-step {
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: var(--card3);
  color: var(--fg2);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.lpx-step:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(255,106,61,0.5);
}

.lpx-ep {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lpx-runit {
  margin-top: 8px;
}

.lpx-usd {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: #121315;
}

.lpx-usd:focus-within {
  border-color: rgba(255,106,61,0.6);
  box-shadow: 0 0 0 3px rgba(255,106,61,0.12);
}

.lpx-usd span {
  font-size: 22px;
  font-weight: 600;
  color: var(--muted);
}

.lpx-usd input {
  flex: 1;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 24px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  box-shadow: none !important;
}

.lpx-tok {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card2);
}

.lpx-tok.off {
  opacity: 0.5;
}

.lpx-tok.short {
  border-color: rgba(240,106,95,0.5);
}

.lpx-tsym {
  font-size: 14px;
  white-space: nowrap;
}

.lpx-tok input {
  height: 32px;
  padding: 0 4px;
  border: 0;
  background: none;
  text-align: right;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: none !important;
}

.lpx-tbal {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.lpx-tbal .link {
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}

.lpx-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--fg2);
}

.lpx-check input {
  height: auto;
  margin-top: 2px;
}

.lpx-slip {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.lpx-sliplbl {
  justify-self: start;
  font-size: 13.5px;
  font-weight: 600;
  cursor: help;
}

.lpx-slip .seg {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.lpx-slip .seg button {
  justify-content: center;
  height: 34px;
  padding: 0 6px;
  color: var(--fg2);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lpx-slip .seg button.on,
.lpx-side1 .seg button.on,
.lpx-slipc.on {
  background: var(--accent-bg);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255,106,61,0.5);
}

.lpx-side1 {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.lpx-side1 .seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lpx-side1 .seg button {
  justify-content: center;
  min-width: 0;
  height: 34px;
  padding: 0 6px;
  overflow: hidden;
  color: var(--fg2);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lpx-slipc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  color: var(--fg2);
  font-size: 14px;
  font-weight: 600;
  cursor: text;
}

.lpx-slipc input {
  width: 34px;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: right;
}

@supports (field-sizing: content) {
  .lpx-slipc input {
    width: auto;
    min-width: 1ch;
    max-width: 44px;
    field-sizing: content;
  }
}

.lpx-slipc input:focus {
  box-shadow: none;
}

.lpx-slipc input:placeholder-shown {
  text-align: center;
}

.lpx-slipc input:placeholder-shown + span {
  display: none;
}

.lpx-slipc:hover,
.lpx-slipc:focus-within {
  color: var(--fg);
}

.lpx-slipc:focus-within:not(.on) {
  background: var(--card3);
  box-shadow: inset 0 0 0 1px var(--line2);
}

.lpx-slipc.bad {
  box-shadow: inset 0 0 0 1px var(--down);
}

.lpx-sliphint {
  margin-top: 6px;
  color: var(--warn);
}

.lpx-prev:empty {
  display: none;
}

.lpx-prev > p:first-child {
  margin: 0;
}

.lpx-steps {
  margin: 4px 0 0;
  padding-left: 20px;
  color: var(--fg2);
  font-size: 13px;
}

.lpx-steps:empty {
  display: none;
}

.lpx-steps li.ok {
  color: var(--up);
}

.lpx-steps li.err {
  color: var(--down);
}

.lpx-steps li.warn {
  color: var(--warn);
}

.lpx-steps a svg {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}

.lpx-sts {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.lpx-go {
  height: 50px;
  font-size: 15px;
  flex: none;
}

.lpx-picker {
  position: absolute;
  top: 58px;
  left: 66px;
  z-index: 10;
  width: min(460px, calc(100vw - 80px));
  max-height: min(560px, calc(100vh - 90px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: #121315;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.lpx-picker .search {
  flex: none;
}

.lpx-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lpx-ph {
  margin: 6px 4px 2px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.lpx-pi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  text-align: left;
  cursor: pointer;
}

.lpx-pi:hover,
.lpx-pi.on {
  background: var(--card3);
}

.lpx-pn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lpx-none,
.lpx-pnote {
  margin: 4px;
}

.lpx-pcreate {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px dashed var(--line2);
  border-radius: 9px;
  background: none;
  color: var(--accent);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.lpx-pcreate:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}

.lpx-pcreate b {
  font-size: 16px;
  line-height: 1;
}

/* «Создать свой пул»: a dialog over the workspace; the panel then opens the draft like any pool. */
.lpx-cp {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 7, 10, 0.62);
}

.lpx-cpbox {
  width: min(480px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line2);
  border-radius: 20px;
  background: #121315;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.lpx-cph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lpx-cph b {
  font-size: 18px;
}

.lpx-cpbody {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.lpx-cpwhere {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.lpx-cppair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.lpx-cptk {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  height: 64px;
  padding: 0 32px 0 16px;
  border: 1px solid var(--line2);
  border-radius: 16px;
  background: var(--card);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}

.lpx-cptk:hover {
  border-color: var(--muted);
}

.lpx-cptk.on {
  border-color: var(--accent);
}

.lpx-cptk .s {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 600;
}

.lpx-cptk .s.e {
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 500;
}

.lpx-cptk .p {
  color: var(--muted);
  font-size: 12.5px;
}

.lpx-cptk::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%2380858c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 12px;
}

.lpx-cptk.on::after {
  transform: translateY(-50%) rotate(180deg);
}

.lpx-cpsw {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line2);
  border-radius: 50%;
  background: var(--card2);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.lpx-cpsw:hover {
  color: var(--fg);
  border-color: var(--muted);
}

.lpx-cppick {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: -8px;
  padding: 12px;
  border: 1px solid var(--line2);
  border-radius: 16px;
  background: var(--card2);
}

.lpx-cppick[hidden] {
  display: none;
}

.lpx-cpchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lpx-cpchips:empty {
  display: none;
}

.lpx-cpchip {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg2);
  font: 13px var(--sans);
  cursor: pointer;
}

.lpx-cpchip:hover {
  border-color: var(--accent);
  color: var(--fg);
}

.lpx-cpr {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.lpx-cpr[hidden] {
  display: none;
}

.lpx-cpl {
  padding-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.lpx-cpt {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.lpx-cpt input,
.lpx-cppick input,
.lpx-cpsel {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
  font: 13.5px var(--mono);
}

.lpx-cpsel {
  padding-right: 30px;
  font-family: var(--sans);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%2380858c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  cursor: pointer;
}

.lpx-cpsel:disabled {
  cursor: default;
  opacity: 0.6;
}

.lpx-cppick input {
  font-family: var(--sans);
}

.lpx-cpt input:focus,
.lpx-cppick input:focus,
.lpx-cpsel:focus {
  outline: none;
  border-color: var(--accent);
}

.lpx-cpi:empty {
  display: none;
}

.lpx-cpi {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lpx-cppx {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  white-space: nowrap;
}

.lpx-cppx input {
  flex: 1;
  min-width: 0;
}

.lpx-cpcus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--muted);
}

.lpx-cpcus label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lpx-cpcus input {
  width: 90px;
}

.lpx-cpcus .link {
  color: var(--muted);
}

.lpx-cpn p {
  margin: 0;
}

.lpx-cpn:empty {
  display: none;
}

.lpx-cpcost {
  margin: -8px 0 0;
  text-align: center;
}

.lpx-cpcost:empty {
  display: none;
}

/* A pool that is not on chain yet: what the one candle is and how to change the pool. */
.lpx-dban {
  position: absolute;
  left: 12px;
  top: 34px;
  z-index: 5;
  max-width: min(520px, calc(100% - 90px));
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid rgba(121,201,90,0.35);
  border-radius: 10px;
  background: rgba(16,17,19,0.9);
  font-size: 12.5px;
  color: var(--fg2);
}

.lpx-dban b {
  color: var(--up);
  font-size: 13px;
}

.lpx-dban .link {
  align-self: flex-start;
}

@media (max-width: 640px) {
  .lpx-cpr {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .lpx-cpl {
    padding-top: 0;
  }
}

@media (max-width: 1180px) {
  .lpx-main {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .lpx-crow.fx-on .lpx-fx,
  .lpx-fxin {
    width: 360px;
  }

  .lpx-fxc,
  .lpx-fxr {
    grid-template-columns: 56px minmax(66px, 1fr) minmax(0, 128px) 36px;
    column-gap: 6px;
    padding: 0 10px;
  }

  .lpx-agg .lpx-fxc,
  .lpx-agg .lpx-fxr {
    grid-template-columns: 54px minmax(66px, 1fr) minmax(0, 176px) 36px;
  }

  .lpx-fxg {
    max-width: 78px;
  }

  .lpx-stats > div:nth-child(n + 3) {
    display: none;
  }

  .lpx-ptab th:nth-child(6):not(.c-act),
  .lpx-ptab td:nth-child(6):not(.c-act) {
    display: none;
  }
}

@media (max-width: 900px) {
  .lpx-top {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .lpx-stats {
    order: 5;
    width: 100%;
  }

  .lpx-links {
    display: none;
  }

  .lpx-main {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .lpx-left {
    flex: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .lpx-chart {
    flex: none;
    height: 48vh;
  }

  .lpx-crow {
    flex: none;
    height: 48vh;
  }

  .lpx-crow > .lpx-chart {
    flex: 1;
    height: auto;
  }

  .lpx-fx {
    position: absolute;
    top: 0;
    right: 16px;
    bottom: 0;
    z-index: 6;
    box-shadow: -14px 0 28px rgba(0, 0, 0, 0.5);
  }

  .lpx-crow.fx-on .lpx-fx,
  .lpx-fxin {
    width: min(400px, calc(100vw - 56px));
  }

  .lpx-split {
    display: none;
  }

  .lpx-pos {
    height: auto !important;
    max-height: 60vh;
  }

  .lpx-side {
    overflow: visible;
  }

  .lpx-ptab th:nth-child(5),
  .lpx-ptab td:nth-child(5),
  .lpx-ptab th:nth-child(6):not(.c-act),
  .lpx-ptab td:nth-child(6):not(.c-act),
  .lpx-ptab th:nth-child(7):not(.c-act),
  .lpx-ptab td:nth-child(7):not(.c-act) {
    display: none;
  }
}

@media (max-width: 720px) {
  .btn.lpx-open {
    padding: 0 8px;
    font-size: 0;
    gap: 0;
  }

  .lpx-open svg {
    width: 16px;
    height: 16px;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 70;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 10px;
  background: #222429;
  border: 1px solid var(--line2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  animation: fade 0.15s;
}

/* ---------- portfolio ---------- */

.small {
  font-size: 12px;
}

.toolbar .push {
  margin-left: auto;
}

.warn {
  color: var(--warn);
}

/* ---------- portfolio: header ---------- */

.pfh {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.pf-scope:empty {
  display: none;
}

.pf-scope button {
  font-weight: 600;
}

.pf-scope .count {
  min-width: 18px;
  margin-left: 0;
  padding: 0 5px;
  line-height: 18px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.pf-scope button.on .count {
  background: var(--accent-bg);
  color: var(--accent);
}

.pfh-read {
  margin-left: auto;
  white-space: nowrap;
}

.pfh .btn svg {
  width: 15px;
  height: 15px;
}

.pf-none .pfh-read,
.pf-none #pf-refresh,
.pf-none #pf-share {
  display: none;
}

.pf-none .pf-connect {
  margin-left: auto;
}

.pf-connect {
  position: relative;
}

/* ---------- portfolio: add-wallet popover ---------- */

.pf-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: 360px;
  max-height: min(600px, calc(100vh - 150px));
  overflow-y: auto;
  padding: 14px;
  display: grid;
  gap: 6px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: var(--card2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.pa-form {
  display: grid;
  gap: 8px;
}

.pa-l {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

#pf-addr,
#pf-label {
  width: 100%;
}

#pf-addr {
  font-family: var(--mono);
  font-size: 12.5px;
}

.pa-btns {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.pa-btns .btn {
  flex: 1;
}

.pa-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.pa-sep::before,
.pa-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line2);
}

.pa-wl {
  display: grid;
  gap: 2px;
}

.pa-wl p {
  margin: 2px 4px 4px;
}

.pa-wl button,
.pa-wl .pm-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.pa-wl button:hover,
.pa-wl .pm-link:hover {
  border-color: var(--line2);
  background: var(--card3);
}

.pa-wl button span:nth-child(2),
.pa-wl .pm-link span:nth-child(2) {
  flex: 1;
}

.pa-wl .pm-h {
  margin: 6px 4px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pa-wl .pm-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--fg2);
}

.pa-wl img,
.wi {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex: none;
}

.wi {
  display: inline-block;
  background: var(--card3);
}

.wi.sol {
  background: linear-gradient(135deg, #9945ff, #14f195);
}

/* ---------- portfolio: summary strip ---------- */

.pf-sum {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card2), var(--card));
  overflow: hidden;
}

.pf-sum:empty {
  display: none;
}

.ps {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: 12px 18px;
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.ps:first-child {
  border-left: 0;
}

.ps-l,
.ps-s {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.ps-v {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}

.ps-v.accent {
  color: var(--accent);
}

.ps-v.zero {
  color: var(--muted);
  font-weight: 600;
}

.ps-of {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.ps-s {
  color: var(--fg2);
  font-size: 12px;
}

button.ps:not(:disabled) {
  cursor: pointer;
  transition: background 0.15s;
}

button.ps:not(:disabled):hover {
  background: var(--card3);
}

.ps-rg.on {
  background: var(--down-bg);
}

.ps-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 99px;
  border: 1px solid rgba(240,106,95,0.35);
  background: var(--down-bg);
  color: var(--down);
  font-size: 11.5px;
  font-weight: 650;
}

/* ---------- portfolio: wallet rail ---------- */

.pf-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.pf-rail:empty {
  display: none;
}

.wp-all,
.wp {
  flex: none;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--fg2);
  font: inherit;
  font-size: 12.5px;
  transition: border-color 0.15s, background 0.15s;
}

.wp-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  cursor: pointer;
  font-weight: 600;
}

.wp-all .count {
  min-width: 18px;
  margin-left: 0;
  padding: 0 5px;
  line-height: 18px;
  font-size: 11px;
}

.wp-all:hover,
.wp:hover {
  border-color: #4a4e55;
  color: var(--fg);
}

.wp-all.on,
.wp.on {
  border-color: rgba(255,106,61,0.55);
  background: var(--accent-bg);
  color: var(--fg);
}

/* «Ещё N» / «Свернуть»: the section's other wallets (empty, or not connected for «Мои») */
.wp-exp {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border: 1px dashed var(--line2);
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.wp-exp:hover {
  border-color: #4a4e55;
  color: var(--fg);
}

.pf-rail .wp-exp .count {
  min-width: 0;
  margin: 0;
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  font-variant-numeric: tabular-nums;
}

.wp-exp svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}

.wp-exp[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.wp {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
}

.wp-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 6px 0 10px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.wp-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-weight: 600;
}

.wp-v {
  font-variant-numeric: tabular-nums;
}

.wp-n {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--card3);
  color: var(--fg2);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.wp-st {
  color: var(--muted);
}

.wp-st.warn {
  color: var(--warn);
}

.wp.wp-empty {
  opacity: 0.7;
}

.wp.wp-empty .wp-name {
  color: var(--fg2);
  font-weight: 500;
}

.wp.wp-conn {
  border-color: color-mix(in srgb, var(--fg) 34%, transparent);
  opacity: 1;
}

.wp-live {
  width: 6px;
  height: 6px;
  flex: none;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--up) 20%, transparent);
}

.wp-more {
  width: 28px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.wp-more:hover {
  background: var(--card3);
  color: var(--fg);
}

.wp-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--eth);
}

.wp-dot.sol {
  background: linear-gradient(135deg, #9945ff, #14f195);
}

.wp.own .wp-dot {
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--accent);
}

/* ---------- portfolio: wallet menu ---------- */

.pf-wmenu {
  position: fixed;
  z-index: 45;
  width: 264px;
  padding: 6px;
  display: grid;
  gap: 1px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: var(--card2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.wm-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
}

.wm-h > span {
  display: grid;
  min-width: 0;
}

.wm-h b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-h .mono {
  font-size: 11.5px;
}

.wm-i {
  display: grid;
  gap: 1px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.wm-i:hover {
  background: var(--card3);
}

.wm-i .small {
  font-size: 11.5px;
}

.wm-i.danger {
  color: var(--down);
}

.wm-form {
  display: grid;
  gap: 8px;
  padding: 4px 6px 6px;
}

.wm-row {
  display: flex;
  gap: 8px;
  padding: 0 6px 6px;
}

.wm-form .wm-row {
  padding: 0;
}

.wm-q {
  margin: 4px 10px 10px;
  color: var(--fg2);
  font-size: 13px;
  line-height: 1.45;
}

.btn.wm-danger {
  border-color: rgba(240,106,95,0.45);
  background: var(--down-bg);
  color: var(--down);
}

/* ---------- portfolio: status filter ---------- */

.pf-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 14px;
}

.pf-none .pf-tools {
  display: none;
}

.pf-tools .search.pf-q {
  flex: 0 1 340px;
  height: 36px;
  margin-left: auto;
  border-radius: 11px;
}

.pf-tools .search.pf-q input {
  height: 34px;
  font-size: 13px;
}

.ps-f {
  color: var(--accent);
}

.pf-sortm {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

#pf-sort {
  height: 28px;
  font-size: 12.5px;
}

#pf-sort-dir {
  width: 28px;
  height: 28px;
  padding: 0;
}

.pf-grid th span[data-sort] {
  cursor: pointer;
}

.pf-grid th span[data-sort]:hover {
  color: var(--fg);
}

.pf-grid th span.sorted {
  color: var(--accent);
}

.pf-grid th span.sorted::after {
  content: " ↓";
}

.pf-grid th span.sorted.asc::after {
  content: " ↑";
}

/* ---------- portfolio: positions table ---------- */

.pf-card {
  margin-top: 10px;
}

.pf-grid td.pf-c-when {
  white-space: nowrap;
}

.fk {
  font-weight: 650;
  white-space: nowrap;
}

.fk::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.fk.up {
  color: var(--up);
}

.fk.down {
  color: var(--down);
}

.fk.warn {
  color: var(--warn);
}

.fk.accent {
  color: var(--accent);
}

.pf-grid tbody tr.fresh td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.pf-was {
  margin-top: 4px;
}

.pf-feed-more {
  display: flex;
  justify-content: center;
  padding: 10px;
}

.pf-feed-more:has(> [hidden]) {
  display: none;
}

.pf-card.nothing .table-scroll {
  display: none;
}

.pf-grid td {
  padding: 10px 12px;
}

.pf-grid td.pf-c-pos {
  min-width: 210px;
  white-space: normal;
}

.pf-pos {
  display: grid;
  gap: 4px;
}

.pf-pos .pair {
  max-width: 280px;
}

.pf-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 5px;
}

.pf-meta .b {
  white-space: nowrap;
}

.pf-wl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  max-width: 100%;
  min-width: 0;
  padding: 2px 8px 2px 6px;
  border-radius: 7px;
  border: 1px solid var(--line2);
  background: var(--card2);
  color: var(--fg2);
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
}

.pf-wl:hover {
  border-color: var(--muted);
}

.pf-wl svg {
  flex: none;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pf-wl b {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
  font-weight: 600;
  color: var(--fg);
}

.pf-wl span {
  font: 11px var(--mono);
  color: var(--muted);
}

.pf-wl.own {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.pf-wl.own svg {
  stroke: var(--accent);
}

.pf-wl.own b {
  color: var(--accent);
}

.pf-grid .big.zero {
  color: var(--muted);
  font-weight: 500;
}

.pf-grid tr.pf-out td:first-child {
  box-shadow: inset 3px 0 0 var(--down);
}

.pf-grid tr.pf-edge td:first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}

.pf-grid tbody tr.open td {
  border-bottom-color: transparent;
  background: var(--card2);
}

.rv {
  display: grid;
  gap: 6px;
  min-width: 170px;
  max-width: 230px;
}

.rv-bar {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: var(--line);
}

.rv-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 3px;
  border-radius: 99px;
  background: rgba(121,201,90,0.55);
}

.rv-seg.open {
  border-radius: 99px 0 0 99px;
}

.rv.edge .rv-seg {
  background: rgba(230,174,72,0.6);
}

.rv.out .rv-seg {
  background: rgba(240,106,95,0.35);
}

.rv-now {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--fg);
}

.rv.out .rv-now {
  background: var(--down);
}

.rv-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--fg2);
  font: 11.5px/1.2 var(--mono);
  white-space: nowrap;
}

.rv-st {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
}

.rv.edge .rv-st {
  color: var(--warn);
}

.rv.out .rv-st {
  color: var(--down);
  font-weight: 600;
}

.pf-grid td.pf-c-act {
  width: 1%;
}

.pf-grid .acts .act:not(.pf-more) {
  opacity: 0.45;
  transition: opacity 0.15s;
}

.pf-grid tr:hover .acts .act,
.pf-grid tr.open .acts .act {
  opacity: 1;
}

@media (hover: none) {
  .pf-grid .acts .act:not(.pf-more) {
    opacity: 1;
  }
}

.pf-more .caret {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.pf-more[aria-expanded="true"] {
  color: var(--accent);
}

.pf-more[aria-expanded="true"] .caret {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.pf-grid tbody tr.pf-det {
  cursor: default;
}

.pf-grid tbody tr.pf-det td,
.pf-grid tbody tr.pf-det:hover td {
  padding: 0 12px 12px;
  background: var(--card2);
  text-align: left;
  white-space: normal;
}

.pd {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 26px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
}

.pd-i {
  display: grid;
  gap: 2px;
}

.pd-l {
  color: var(--muted);
  font-size: 11.5px;
}

.pd-v {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.pd-v .act {
  width: 22px;
  height: 22px;
}

.pd-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.pd-links .btn svg {
  width: 13px;
  height: 13px;
}

.pf-hero {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

.pf-hero > b {
  color: var(--fg);
  font-size: 17px;
}

.pf-hero p {
  margin: 0;
  color: var(--fg2);
  line-height: 1.55;
}

@media (max-width: 900px) {
  .pf-sum {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ps:nth-child(3) {
    border-left: 0;
  }
  .ps:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .pf-scope {
    flex: 1 1 100%;
  }
  .pf-scope button {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
  }
  .pfh-read {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11.5px;
  }
  .pfh .pfh-t {
    display: none;
  }
  #pf-share {
    width: 30px;
    padding: 0;
  }
  .pf-menu {
    width: min(360px, calc(100vw - 28px));
  }
  .pf-sortm {
    display: flex;
    margin-left: 0;
  }
  .pf-sortm #pf-sort,
  .pf-sortm #pf-sort-dir {
    height: 36px;
  }
  .pf-sortm #pf-sort-dir {
    width: 36px;
  }
  .pf-view {
    flex: 1 1 100%;
  }
  .pf-view button {
    flex: 1;
    justify-content: center;
  }
  .pf-tools .search.pf-q {
    flex: 1 1 0;
    min-width: 0;
    margin-left: 0;
  }
  .pf-tools .search.pf-q kbd {
    display: none;
  }
  .pf-feed td.pf-c-pos {
    order: -1;
  }
  .pf-feed td.pf-c-kind {
    text-align: right !important;
  }
  .pf-grid tbody tr.fresh {
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .pf-rail {
    flex-wrap: nowrap;
    margin-right: -14px;
    padding: 0 14px 2px 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ps {
    padding: 10px 12px;
  }
  .ps-v {
    font-size: 19px;
  }
  .pf-grid thead {
    display: none;
  }
  .pf-grid,
  .pf-grid tbody {
    display: block;
  }
  .pf-grid tbody tr[data-id] {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .pf-grid tbody tr[data-id]:hover,
  .pf-grid tbody tr[data-id].open {
    background: var(--card2);
  }
  .pf-grid tbody tr[data-id] td {
    display: block;
    padding: 0;
    border: 0;
    background: none !important;
    text-align: left;
    white-space: normal;
  }
  .pf-grid tbody tr.pf-out {
    box-shadow: inset 3px 0 0 var(--down);
  }
  .pf-grid tbody tr.pf-edge {
    box-shadow: inset 3px 0 0 var(--warn);
  }
  .pf-grid tbody tr[data-id] td:first-child {
    box-shadow: none;
  }
  .pf-grid td.pf-c-pos {
    grid-column: 1 / -1;
    min-width: 0;
    padding-right: 64px !important;
  }
  .pf-grid td.pf-c-rg {
    grid-column: 1 / -1;
  }
  .pf-grid .rv {
    max-width: none;
  }
  .pf-grid td[data-l]::before {
    content: attr(data-l);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
  }
  .pf-grid td.pf-c-act {
    position: absolute;
    top: 8px;
    right: 8px;
    width: auto;
  }
  .pf-grid .acts .act:not(.pf-more):not(.shr-btn) {
    display: none;
  }
  .pf-grid tbody tr.pf-det,
  .pf-grid tbody tr.pf-det td {
    display: block;
  }
  .pf-grid tbody tr.pf-det td {
    padding: 0 10px 12px;
    border-bottom: 1px solid var(--line);
  }
  .pd {
    gap: 10px 18px;
  }
  .pd-links {
    margin-left: 0;
  }
}

.b.st-in,
.b.mine {
  color: var(--up);
  border-color: rgba(121,201,90,0.4);
  background: var(--up-bg);
}

.b.st-out {
  color: var(--down);
  border-color: rgba(240,106,95,0.4);
  background: var(--down-bg);
}

.b.trk {
  color: var(--eth);
  border-color: rgba(143, 160, 255, 0.35);
}

.act[data-act="track"] {
  font-size: 15px;
  font-weight: 600;
}

/* ---------- personal alerts ---------- */

.ua-card {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card2), var(--card));
  min-width: 0;
}

.ua-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 15px;
}

.ua-card p {
  margin: 8px 0;
  color: var(--fg2);
}

.steps {
  margin: 8px 0 14px;
  padding-left: 20px;
  color: var(--fg2);
  line-height: 1.7;
}

.ua-card .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wait {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 12px;
}

.pf-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.pf-field input,
.pf-field select {
  width: 100%;
  height: 32px;
  font-size: 13px;
  color: var(--fg);
}

.tgl {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--fg2);
  font-size: 13px;
}

.tgl input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.ua-card p.warn {
  color: var(--warn);
}

/* ---------- alerts tab ---------- */

.al-view .count,
.al-ff .count {
  min-width: 18px;
  margin-left: 0;
  padding: 0 5px;
  line-height: 18px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.al-view button.on .count,
.al-ff button.on .count {
  background: var(--accent-bg);
  color: var(--accent);
}

.al-view .count.hot {
  background: var(--accent);
  color: #ffffff;
}

.al-ff button:disabled {
  opacity: 0.4;
  cursor: default;
}

.al-ff button:disabled:hover {
  color: var(--muted);
}

.al-pane {
  margin-top: 14px;
}

.al-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: clip;
}

.al-st {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
}

.al-st::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.al-st.ok::before {
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(121,201,90,0.15);
}

.al-st.warn::before {
  background: var(--warn);
}

.al-st.bad {
  color: var(--down);
}

.al-st.bad::before {
  background: var(--down);
}

.al-st.none {
  color: var(--fg2);
  font-weight: 600;
}

.al-go {
  color: var(--accent);
}

.al-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 22px 18px;
  border: 1px dashed var(--line2);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
}

.al-hero > b {
  font-size: 16px;
}

.al-hero p {
  max-width: 580px;
  margin: 0;
  color: var(--fg2);
  line-height: 1.55;
}

.al-hero .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

/* rules */

.al-nets {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.al-net-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.al-net {
  position: relative;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: var(--card);
  color: var(--fg2);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.al-net:hover {
  color: var(--fg);
}

.al-net.on {
  border-color: rgba(255,106,61,0.5);
  background: var(--accent-bg);
  color: var(--fg);
}

.al-net.own::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.al-net-more {
  min-width: 0;
  height: 30px;
}

.al-nets .al-note .btn {
  margin-left: 6px;
  vertical-align: middle;
}

.al-r {
  border-bottom: 1px solid var(--line);
}

.al-rh {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto 20px;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 16px;
}

/* the whole tile is the button: a fold opens, a tile without one flips its switch or opens its list */
.al-rh {
  cursor: pointer;
  transition: background 0.12s;
}

.al-rh:hover {
  background: var(--card2);
}

.al-rh:focus-visible {
  outline: 2px solid rgba(255,106,61,0.6);
  outline-offset: -2px;
}

.al-ic {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.al-ic svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}

.al-r.on .al-ic {
  background: var(--accent-bg);
  color: var(--accent);
}

.al-rt {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.al-rt b {
  font-size: 14px;
  font-weight: 650;
}

.al-r.off .al-rt b {
  color: var(--fg2);
}

.al-rs {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.al-rm {
  grid-column: 3;
  color: var(--fg2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.al-rh > .sw,
.al-rh > .al-sel {
  grid-column: 4;
}

.al-cv {
  grid-column: 5;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.al-cv .caret,
.al-c-cv .caret {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.al-r.open .al-cv,
.al-grid tr.open .al-c-cv {
  color: var(--accent);
}

.al-r.open .al-cv .caret,
.al-grid tr.open .al-c-cv .caret {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.al-sel {
  min-width: 132px;
  height: 32px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 13px;
}

.al-rb {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px 62px;
  border-top: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.al-r:not(.open) .al-rb {
  display: none;
}

/* «Дополнительно»: a rule's rarely changed fields folded under one line; the number counts the changed ones */
.al-more,
.al-mb {
  display: grid;
  gap: 12px;
}

.al-more:not(.open) > .al-mb {
  display: none;
}

.al-mh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.al-mh:hover,
.al-more.open > .al-mh {
  color: var(--fg);
}

.al-mh .caret {
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.al-more.open > .al-mh .caret {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.al-mn {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Settings › «Цикл»: wallet chips, then the panel */
.al-cy-w {
  margin-bottom: 12px;
}

#al-cy > .pf-cycle {
  margin-top: 0;
}

.al-f {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.al-fl {
  color: var(--muted);
  font-size: 12.5px;
}

.al-fc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.al-in {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: var(--card);
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.al-in > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.al-in input,
.al-in input:focus {
  width: 84px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.al-in.al-list input,
.al-in.al-list input:focus {
  width: 170px;
}

.al-in:focus-within {
  border-color: rgba(255,106,61,0.6);
  box-shadow: 0 0 0 3px rgba(255,106,61,0.12);
}

.al-in:has(input[style*="border-color"]) {
  border-color: var(--down);
}

.sw {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.sw input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.sw span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--line2);
  pointer-events: none;
  transition: background 0.15s;
}

.sw span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fg2);
  transition: transform 0.15s, background 0.15s;
}

.sw input:checked + span {
  background: var(--accent);
}

.sw input:checked + span::after {
  transform: translateX(16px);
  background: #ffffff;
}

.sw input:focus-visible + span {
  outline: 2px solid rgba(255,106,61,0.6);
  outline-offset: 2px;
}

.chip-tgl {
  position: relative;
  height: 30px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line2);
  background: var(--card);
  font-size: 12.5px;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.chip-tgl input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chip-tgl span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--line2);
  vertical-align: 1px;
  transition: background 0.15s;
}

.chip-tgl:hover {
  color: var(--fg);
}

.chip-tgl:has(input:checked) {
  border-color: rgba(255,106,61,0.4);
  background: var(--accent-bg);
  color: var(--fg);
}

.chip-tgl:has(input:checked) span::before {
  background: var(--accent);
}

.chip-tgl:has(input:focus-visible) {
  outline: 2px solid rgba(255,106,61,0.6);
  outline-offset: 1px;
}

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

.al-est {
  margin: 2px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg2);
  font-size: 12.5px;
  line-height: 1.55;
}

.al-est b {
  color: var(--fg);
}

.al-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.al-warn {
  margin: 0;
  padding: 0 16px 12px 62px;
  color: var(--warn);
  font-size: 12.5px;
}

.al-foot {
  margin: 0;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12px;
}

.al-foot:empty {
  display: none;
}

/* history */

.al-hist {
  margin-top: 10px;
}

.al-grid td.al-c-when,
.al-grid td.al-c-kind,
.al-grid td.al-c-cv {
  width: 1%;
}

.al-c-when > span {
  display: block;
}

.al-ago {
  color: var(--muted);
  font-size: 11.5px;
}

.al-grid td.al-c-msg {
  width: 100%;
  max-width: 0;
}

.al-m1,
.al-m2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.al-m1 b {
  font-weight: 650;
}

.al-m2 {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.al-m2 b {
  color: var(--fg2);
  font-weight: 600;
}

.al-grid td.al-c-cv {
  color: var(--muted);
}

.al-c-cv .caret {
  display: inline-block;
}

.al-grid tbody tr.fresh td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.al-grid tbody tr.open td {
  background: var(--card2);
}

.al-grid tbody tr.al-det {
  cursor: default;
}

.al-grid tbody tr.al-det td,
.al-grid tbody tr.al-det:hover td {
  padding: 0 12px 12px;
  background: var(--card2);
  text-align: left;
  white-space: normal;
}

.al-dm {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.al-dm pre {
  margin: 0;
  color: var(--fg2);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.al-dm pre b {
  color: var(--fg);
}

.al-dm pre a {
  color: var(--accent);
}

.al-dm pre code {
  color: var(--muted);
  font-size: 11.5px;
}

.al-dm .row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.al-empty {
  padding: 40px 18px;
  text-align: center;
}

.fk.iss {
  color: #64a8ff;
}

.fk.mute {
  color: var(--muted);
}

/* channels */

.al-ch {
  display: grid;
  gap: 14px;
}

.al-chc {
  padding: 16px 18px;
}

.al-chh {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.al-chh h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
}

.al-chh .al-ic {
  background: var(--accent-bg);
  color: var(--accent);
}

.al-chh .row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.al-chc > p {
  margin: 10px 0 0;
  color: var(--fg2);
  line-height: 1.55;
}

.al-chc > p.al-chm {
  color: var(--muted);
  font-size: 12.5px;
}

.al-chc > p.warn {
  color: var(--warn);
}

.al-chc .steps {
  margin: 10px 0 0;
}

.al-chc > .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.po-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-top: 14px;
}

.al-sec {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
}

.al-sh {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.al-sh span {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.al-sec .al-sh:not(:first-child) {
  margin-top: 18px;
}

.al-sec p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.po-form {
  grid-template-columns: minmax(0, 340px) minmax(0, 220px);
  margin: 12px 0;
}

div.al-sec.pw-sec {
  margin-top: 22px;
}

.pw-list {
  display: grid;
  margin-top: 10px;
}

.pw-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.pw-rule.off .pw-rm {
  opacity: 0.55;
}

.pw-rm {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 280px;
  overflow-wrap: anywhere;
}

.pw-ra {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pw-grid {
  margin-top: 12px;
}

.pw-tok {
  grid-column: span 2;
}

.pw-sec .row {
  margin-top: 12px;
}

@media (max-width: 480px) {
  .pw-tok {
    grid-column: 1 / -1;
  }
}

.po-del {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.po-kinds {
  display: grid;
}

.po-k {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--fg2);
}

.po-k:first-child {
  padding-top: 0;
  border-top: 0;
}

.po-k select {
  width: 100%;
  height: 30px;
  font-size: 13px;
  color: var(--fg);
}

.po-k.em > span {
  color: var(--fg);
}

.po-k.em select {
  border-color: var(--warn);
}

.po-off {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--warn);
}

.al-sec p.po-legend {
  margin-top: 10px;
}

.po-recent {
  display: grid;
  max-height: 280px;
  overflow: auto;
}

.po-it {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.po-it:first-child {
  padding-top: 0;
  border-top: 0;
}

.po-ih {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.po-t {
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-is {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 2px;
  font-size: 12px;
}

.po-is .fk {
  font-weight: 600;
}

@media (max-width: 1000px) {
  .po-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .al-view,
  .al-ff {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .al-view button,
  .al-ff button {
    flex: 1 0 auto;
    justify-content: center;
    padding: 0 10px;
  }
  .al-rh {
    grid-template-columns: 30px minmax(0, 1fr) auto 14px;
    gap: 10px;
    min-height: 56px;
    padding: 10px 12px;
  }
  .al-rm {
    display: none;
  }
  .al-rh > .sw,
  .al-rh > .al-sel {
    grid-column: 3;
  }
  .al-cv {
    grid-column: 4;
  }
  .al-ic {
    width: 30px;
    height: 30px;
  }
  .al-rs {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }
  .al-sel {
    min-width: 0;
    max-width: 140px;
  }
  .al-rb {
    padding: 12px;
  }
  .al-f {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .al-warn {
    padding: 0 12px 12px;
  }
  .al-grid,
  .al-grid tbody,
  .al-grid tr.al-det,
  .al-grid tr.al-det td {
    display: block;
  }
  .al-grid thead,
  .al-c-when .al-ago {
    display: none;
  }
  .al-grid tbody tr[data-al] {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 14px;
    grid-template-areas: "when kind cv" "msg msg msg";
    align-items: center;
    gap: 4px 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
  }
  .al-grid tbody tr[data-al] td,
  .al-grid tbody tr[data-al]:hover td {
    width: auto;
    max-width: none;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
  .al-grid tbody tr[data-al]:last-child {
    border-bottom: 0;
  }
  .al-grid tbody tr[data-al].open {
    background: var(--card2);
  }
  .al-grid tbody tr[data-al].fresh {
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .al-grid td.al-c-when {
    grid-area: when;
    color: var(--muted);
    font-size: 12px;
  }
  .al-grid td.al-c-kind {
    grid-area: kind;
    font-size: 12.5px;
  }
  .al-grid td.al-c-msg {
    grid-area: msg;
  }
  .al-grid td.al-c-cv {
    grid-area: cv;
  }
  .al-chc {
    padding: 14px;
  }
  .po-del,
  .po-form {
    grid-template-columns: 1fr;
  }
  .po-k {
    grid-template-columns: minmax(0, 1fr) 124px;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1320px) {
  .c-age {
    display: none;
  }
}

@media (max-width: 1180px) {
  .c-vol,
  .c-swaps {
    display: none;
  }
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .c-yield,
  .c-trend {
    display: none;
  }
  .d-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app {
    padding: 0 14px 40px;
  }
  .top {
    margin: 0 -14px;
    padding: 0 14px;
  }
  .live {
    min-width: 0;
  }
  #live-text {
    display: none;
  }
  #logout {
    padding: 0 10px;
  }
  .top .brand > span:not(.logo) {
    display: none;
  }
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .table-scroll {
    overflow-x: auto;
  }
  .grid th {
    position: static;
  }
  .c-trend,
  .c-f5,
  .c-last,
  .c-yield,
  .c-act {
    display: none;
  }
  .grid th,
  .grid td {
    padding: 8px 9px;
  }
  .grid td.c-pool {
    white-space: normal;
    min-width: 110px;
  }
  .lqs {
    width: 84px;
  }
  .tags {
    flex-wrap: wrap;
  }
  .pair {
    max-width: 170px;
  }
  .drawer {
    padding: 22px 16px 32px;
  }
  .lq-stats {
    grid-template-columns: 1fr;
  }
  .pager .per {
    display: none;
  }
  .tabs {
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tab {
    padding: 10px 11px 12px;
  }
  .tab.active::after {
    left: 11px;
    right: 11px;
    bottom: 0;
  }
}

/* ---------- one-off wallet view ---------- */

.pf-peek {
  margin-top: 14px;
  padding: 12px 14px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,106,61,0.35);
  background: linear-gradient(180deg, var(--accent-bg), transparent 90px), var(--card);
}

.pk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.pk-head .push {
  margin-left: auto;
}

.pk-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 14px;
}

.pk-title > b {
  color: var(--accent);
}

.pk-title .mono {
  color: var(--fg);
}

.pk-x {
  font-size: 18px;
  font-weight: 500;
}

.pk-note {
  margin-top: 6px;
  line-height: 1.5;
}

.pf-peek .table-card {
  margin-top: 10px;
}

.pf-peek .empty {
  padding: 28px 20px;
}

.pk-cta {
  margin-top: 14px;
}

.table-scroll:has(> #pf-peek-table) {
  overflow-x: auto;
}

.table-scroll:has(> #pf-peek-table) th {
  position: static;
}

/* ---------- closed-position history ---------- */

.pf-closed {
  border-color: var(--line2);
  background: var(--card);
}

.pf-closed .pk-title > b {
  color: var(--fg);
}

.cl-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.cl-kpis b {
  font-weight: 650;
  color: var(--fg);
}

.table-scroll:has(> #pf-closed-table) {
  overflow-x: auto;
}

.table-scroll:has(> #pf-closed-table) th {
  position: static;
}

#pf-closed-rows td.left {
  white-space: normal;
}

#pf-closed-rows td.left .b,
#pf-closed-rows td.left > .sub {
  white-space: nowrap;
}

#pf-closed-rows .sub .acts {
  display: inline-flex;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---------- closed history by day: calendar, daily bars, cumulative PnL ---------- */

.cl-tabs button,
.cl-per button {
  height: 26px;
  padding: 0 11px;
  font-size: 12.5px;
}

.cl-days {
  margin-top: 12px;
}

.cl-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.cl-bar .push,
.cl-mnav .push {
  margin-left: auto;
}

.cl-modes button svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cl-modes button span {
  display: none;
}

.cl-modes button.on {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.cl-modes button.on span {
  display: inline;
}

.cl-mnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 14px 0 10px;
}

.cl-arr {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line2);
  font-size: 17px;
  font-weight: 500;
}

.cl-arr:disabled,
.cl-mnav .btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.cl-mt {
  font-size: 15px;
  font-weight: 650;
}

.cl-mtot {
  color: var(--muted);
  font-size: 13px;
}

.cl-mtot b {
  margin-left: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.cl-mtot b.pnl-up {
  color: var(--up);
}

.cl-mtot b.pnl-down {
  color: var(--down);
}

.cl-wd,
.cl-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cl-wd span {
  padding: 2px 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.cl-d {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 66px;
  padding: 20px 4px 8px;
  border: 0;
  border-radius: 10px;
  background: var(--card2);
  color: var(--muted);
  font: inherit;
  text-align: center;
  overflow: hidden;
}

button.cl-d {
  cursor: pointer;
}

button.cl-d:hover {
  filter: brightness(1.18);
}

.cl-d.pad {
  background: none;
}

.cl-d.future,
.cl-d.none {
  background: none;
  box-shadow: inset 0 0 0 1px var(--line);
}

.cl-d.unread {
  background: repeating-linear-gradient(135deg, transparent 0 6px, var(--line) 6px 7px);
}

.cl-dn {
  position: absolute;
  top: 6px;
  left: 8px;
  color: var(--fg2);
  font-size: 12px;
  font-weight: 600;
}

.cl-d.future .cl-dn,
.cl-d.none .cl-dn,
.cl-d.unread .cl-dn {
  color: var(--muted);
  opacity: 0.6;
}

.cl-dv {
  max-width: 100%;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

span.cl-dv {
  font-weight: 500;
}

.cl-short {
  display: none;
}

.cl-dc {
  font-size: 11.5px;
  white-space: nowrap;
}

.cl-d.up {
  background: var(--up-bg);
  box-shadow: inset 3px 0 0 var(--up);
}

.cl-d.down {
  background: var(--down-bg);
  box-shadow: inset 3px 0 0 var(--down);
}

.cl-d.up .cl-dv,
.cl-d.up .cl-dc {
  color: var(--up);
}

.cl-d.down .cl-dv,
.cl-d.down .cl-dc {
  color: var(--down);
}

.cl-d.flat,
.cl-d.nopnl {
  background: var(--card3);
  color: var(--fg2);
}

.cl-d.today {
  outline: 1.5px solid var(--accent);
  outline-offset: -1.5px;
}

.cl-d.on {
  outline: 2px solid var(--fg);
  outline-offset: -2px;
}

.cl-chart {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 210px auto;
  column-gap: 8px;
}

.cl-y {
  position: relative;
  min-width: 52px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.cl-y span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  white-space: nowrap;
}

.cl-plot {
  position: relative;
  border-radius: 10px;
  background: var(--card2);
}

.cl-in {
  position: absolute;
  inset: 12px 0;
}

.cl-unr {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 10px 0 0 10px;
  background: repeating-linear-gradient(135deg, transparent 0 6px, var(--line) 6px 7px);
}

.cl-zero {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--line2);
}

.cl-cols {
  position: absolute;
  inset: 0;
  display: flex;
}

.cl-col {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
}

.cl-col::before {
  content: "";
  position: absolute;
  inset: -12px 0;
}

button.cl-col {
  cursor: pointer;
}

.cl-col:hover::before,
.cl-col.on::before {
  background: var(--accent-bg);
}

.cl-col i {
  position: absolute;
  left: 16%;
  right: 16%;
  min-height: 2px;
  border-radius: 3px;
}

.cl-col i.up {
  background: var(--up);
}

.cl-col i.down {
  background: var(--down);
}

.cl-col i.flat {
  background: var(--muted);
}

.cl-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.cl-line .l {
  fill: none;
  stroke: var(--up);
  stroke-width: 2;
  stroke-linejoin: round;
}

.cl-line .a {
  fill: var(--up-bg);
  stroke: none;
}

.cl-line.down .l {
  stroke: var(--down);
}

.cl-line.down .a {
  fill: var(--down-bg);
}

.cl-line.flat .l {
  stroke: var(--muted);
}

.cl-line.flat .a {
  fill: none;
}

.cl-x {
  display: flex;
  justify-content: space-between;
  padding-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.cl-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cl-pick .pk-x {
  margin-left: auto;
}

.cl-pick b.pnl-up {
  color: var(--up);
}

.cl-pick b.pnl-down {
  color: var(--down);
}

.cl-tip {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 290px;
  padding: 9px 11px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  color: var(--fg);
  font-size: 12.5px;
  line-height: 1.4;
  pointer-events: none;
}

.cl-tip .pnl-up {
  color: var(--up);
}

.cl-tip .pnl-down {
  color: var(--down);
}

.cl-tr {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.cl-tr span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .cl-wd,
  .cl-grid {
    gap: 3px;
  }

  .cl-d {
    min-height: 52px;
    padding: 16px 2px 5px;
    border-radius: 7px;
  }

  .cl-dn {
    top: 3px;
    left: 5px;
    font-size: 10.5px;
  }

  .cl-dv {
    font-size: 11px;
  }

  .cl-full {
    display: none;
  }

  .cl-short {
    display: inline;
  }

  .cl-dc {
    font-size: 10px;
  }

  .cl-dcw {
    display: none;
  }

  .cl-chart {
    grid-template-rows: 170px auto;
  }
}

/* ---------- share card ---------- */

.act.shr-btn {
  color: var(--accent);
}

.act.shr-btn svg {
  width: 15px;
  height: 15px;
}

.btn.shr-row {
  gap: 6px;
  color: var(--accent);
  border-color: rgba(255,106,61,0.35);
}

.btn.shr-row svg {
  width: 14px;
  height: 14px;
}

.btn.shr-row:hover {
  border-color: var(--accent);
}

.shr {
  position: fixed;
  inset: 0;
  z-index: 66;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10,10,11,0.72);
  backdrop-filter: blur(4px);
  animation: fade 0.15s;
}

body.shr-on {
  overflow: hidden;
}

.shr-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(880px, 100%);
  max-height: calc(100vh - 40px);
  padding: 18px 20px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line2);
  background: #121315;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.shr-box[data-view="square"] {
  width: min(640px, 100%);
}

.shr-box[data-view="story"] {
  width: min(460px, 100%);
}

.shr-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.shr-head b {
  font-size: 16px;
}

.shr-x {
  margin-left: auto;
  font-size: 20px;
  font-weight: 400;
}

.shr-view {
  display: grid;
  place-items: center;
  min-height: 0;
  flex: 1 1 auto;
}

.shr-view canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 230px);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.shr-opts,
.shr-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.shr-hide {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--fg2);
  cursor: pointer;
  user-select: none;
}

.shr-acts .btn {
  flex: 1 1 150px;
}

/* ---------- API tab ---------- */

#tab-api > .ua-card {
  margin-top: 14px;
}

.api-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.6fr) 150px 120px auto;
  align-items: end;
  gap: 10px 12px;
}

.api-made {
  border-color: rgba(255,106,61,0.45);
}

.api-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.api-key code {
  flex: 1 1 360px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--card);
  font: 13px var(--mono);
  color: var(--fg);
  word-break: break-all;
  user-select: all;
}

#api-rows tr.api-off td {
  opacity: 0.5;
}

/* Any text a key carries (an IPv6, a long note) is cut inside its cell; the buttons stay pinned to the right edge,
   and a table wider than the screen scrolls under them. */
#tab-api .table-scroll {
  overflow-x: auto;
}

#tab-api .grid th {
  position: static;
}

.api-cut {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-who {
  max-width: 160px;
}

.api-note {
  max-width: 200px;
}

.api-last {
  max-width: 200px;
}

#tab-api th.api-act,
#api-rows td.api-act {
  position: sticky;
  top: auto;
  right: 0;
  z-index: 1;
  width: 1%;
  white-space: nowrap;
  background: var(--card);
  box-shadow: -12px 0 10px -10px rgba(0, 0, 0, 0.7);
}

#tab-api th.api-act {
  background: #141518;
}

#api-rows tr:hover td.api-act {
  background: var(--card2);
}

#api-rows tr.api-off td.api-act {
  opacity: 1;
}

.b.api-rev {
  color: var(--down);
  background: var(--down-bg);
}

.api-doc h4 {
  margin: 16px 0 6px;
  font-size: 13.5px;
  color: var(--fg);
}

.api-doc code {
  font: 12px var(--mono);
  color: var(--fg);
}

.api-dl {
  display: grid;
  grid-template-columns: minmax(200px, max-content) minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
  font-size: 13px;
  color: var(--fg2);
  line-height: 1.5;
}

.api-dl dt {
  white-space: nowrap;
}

.api-dl dd {
  margin: 0;
}

.api-pre {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  font: 12px/1.55 var(--mono);
  color: var(--fg);
  overflow-x: auto;
  white-space: pre;
}

.ua-card p.api-fields {
  line-height: 1.7;
}

/* The reference: folded to its title until clicked. */
.api-doc > h3 {
  justify-content: space-between;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.api-doc > h3::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s ease;
}

.api-doc > h3:hover::after {
  border-color: var(--fg);
}

.api-doc.open > h3::after {
  transform: rotate(225deg) translateY(-3px);
}

.api-doc:not(.open) > :not(h3) {
  display: none;
}

.api-doc.open > h3 {
  margin-bottom: 12px;
}

/* ---------- API usage charts ---------- */

.as-card {
  position: relative;
}

.as-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.as-head h3 {
  margin: 0;
}

.as-ctl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#as-key {
  max-width: 340px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
}

.as-empty,
.as-none {
  padding: 28px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.as-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 760px) {
  .as-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.as-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  min-width: 0;
}

.as-kpi > span {
  font-size: 12px;
  color: var(--muted);
}

.as-kpi > b {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.as-kpi > b small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.as-kpi > em {
  font-style: normal;
  font-size: 12px;
  color: var(--fg2);
  line-height: 1.4;
}

.as-kpi.bad {
  border-color: color-mix(in srgb, var(--down) 45%, transparent);
}

.as-kpi.bad > b {
  color: var(--down);
}

.as-kpi.warn {
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}

.as-kpi.warn > b {
  color: var(--warn);
}

.as-d {
  display: inline-block;
  margin-left: 2px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card3);
  white-space: nowrap;
}

.as-d.up {
  color: var(--up);
  background: color-mix(in srgb, var(--up) 14%, transparent);
}

.as-d.dn {
  color: var(--down);
  background: color-mix(in srgb, var(--down) 14%, transparent);
}

.as-box {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  min-width: 0;
}

.as-box h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--fg);
}

.as-box h4 small {
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
}

.as-box .seg button {
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
}

.as-tl-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.as-tl-h h4 {
  margin: 0;
}

.as-tl {
  position: relative;
  padding: 0 0 22px 56px;
}

.as-tl svg {
  display: block;
  width: 100%;
  height: 190px;
  overflow: visible;
}

.as-grid line {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.as-tl svg,
.as-ring svg {
  stroke: none;
}

.as-col rect {
  stroke: none;
}

.as-col .as-hit {
  fill: transparent;
}

.as-col:hover .as-hit {
  fill: color-mix(in srgb, var(--fg) 6%, transparent);
}

.as-col .as-b {
  fill: var(--accent);
  transition: opacity 0.15s;
}

.as-col .as-b.m-m {
  fill: var(--up);
}

.as-col .as-b.m-b {
  fill: var(--eth, #8fa0ff);
}

.as-col .as-b.m-e {
  fill: var(--down);
}

.as-col.fut .as-hit {
  fill: color-mix(in srgb, var(--fg) 2.5%, transparent);
}

.as-tl svg:hover .as-col .as-b {
  opacity: 0.55;
}

.as-tl svg:hover .as-col:hover .as-b {
  opacity: 1;
}

.as-y {
  position: absolute;
  inset: 0 auto 22px 0;
  width: 50px;
}

.as-y span {
  position: absolute;
  right: 0;
  transform: translateY(50%);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.as-x {
  position: absolute;
  left: 56px;
  right: 0;
  bottom: 0;
  height: 18px;
}

.as-x span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.as-dns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 0 12px;
}

.as-dn {
  container-type: inline-size;
}

.as-dn-in {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Too narrow for the ring and a readable legend side by side: the legend goes under the ring. */
@container (max-width: 380px) {
  .as-dn-in {
    flex-direction: column;
    align-items: stretch;
  }

  .as-ring {
    align-self: center;
  }
}

.as-ring {
  position: relative;
  flex: 0 0 132px;
  width: 132px;
  height: 132px;
}

.as-ring svg {
  display: block;
  width: 100%;
  height: 100%;
}

.as-track {
  fill: none;
  stroke: var(--card3);
  stroke-width: 16;
}

.as-seg {
  fill: none;
  stroke-width: 16;
  cursor: pointer;
  transition:
    opacity 0.15s,
    stroke-width 0.15s;
}

.as-dn.dim .as-seg:not(.hot) {
  opacity: 0.3;
}

.as-seg.hot {
  stroke-width: 20;
}

.as-mid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.as-mid b {
  font-size: 17px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.as-mid span {
  font-size: 11px;
  color: var(--muted);
}

.as-lg {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
}

.as-lg li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto 46px;
  align-items: center;
  gap: 8px;
  padding: 3px 4px;
  border-radius: 6px;
  cursor: default;
}

.as-lg li.hot {
  background: var(--card3);
}

.as-dn.dim .as-lg li:not(.hot) {
  opacity: 0.5;
}

.as-lg i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.as-lb {
  overflow-wrap: anywhere;
  line-height: 1.3;
  color: var(--fg2);
}

.as-lg b {
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.as-lg b,
.as-lg em {
  white-space: nowrap;
}

.as-lg em {
  font-style: normal;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.as-note {
  margin: 10px 0 0 !important;
  font-size: 12px;
  color: var(--muted);
}

.as-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.as-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  color: var(--fg2);
  font-size: 12px;
}

.as-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.as-chip b {
  color: var(--fg);
}

.as-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 0 12px;
}

.as-bar {
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--fg2);
}

.as-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.as-bar b {
  font-family: var(--mono);
  color: var(--fg);
}

.as-bar > div,
.as-share > div {
  height: 8px;
  border-radius: 4px;
  background: var(--card3);
  overflow: hidden;
}

.as-bar > div i,
.as-share > div i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--up);
}

.as-bar.e4 > div i {
  background: var(--warn);
}

.as-bar.rl > div i {
  background: var(--accent);
}

.as-bar.e5 > div i {
  background: var(--down);
}

.as-bar em {
  font-style: normal;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.as-heat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-x: auto;
}

.as-hr {
  display: grid;
  grid-template-columns: 24px repeat(24, minmax(10px, 1fr));
  gap: 3px;
  align-items: center;
}

.as-hr > span {
  font-size: 11px;
  color: var(--muted);
}

.as-hr > i {
  position: relative;
  height: 16px;
  border-radius: 3px;
  background: var(--card3);
  overflow: hidden;
}

.as-hr > i:hover {
  outline: 1px solid var(--fg2);
}

.as-hr > i b {
  position: absolute;
  inset: 0;
  background: var(--accent);
}

.as-hx em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
}

.as-rt .grid td code {
  display: block;
  margin-top: 2px;
  font: 11px var(--mono);
  color: var(--muted);
}

.as-share {
  min-width: 140px;
}

.as-share > div {
  display: inline-block;
  width: 90px;
  vertical-align: middle;
}

.as-share em {
  display: inline-block;
  width: 46px;
  margin-left: 6px;
  font-style: normal;
  color: var(--muted);
  text-align: right;
}

.as-rt td.as-bad {
  color: var(--down);
}

.as-rt h4 .btn {
  margin-left: auto;
}

.as-rt tr.as-click {
  cursor: pointer;
}

.as-rt tr.as-click:hover td,
.as-rt tr.as-click.open td {
  background: var(--card2);
}

.as-why-btn {
  border-bottom: 1px dashed currentColor;
}

.as-why-btn::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px 2px 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.as-rt tr.open .as-why-btn::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.as-rt tr.as-why > td {
  padding: 0;
  background: var(--card2);
  white-space: normal;
  text-align: left;
}

.as-why-in {
  padding: 6px 14px 12px;
}

.as-why-in ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.as-why-in li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.as-why-in li:last-child {
  border-bottom: 0;
}

.as-why-n {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
}

.as-why-n b {
  font-size: 15px;
  color: var(--fg);
}

.as-why-n em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.as-why-t > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.as-why-t b {
  font-size: 13.5px;
  color: var(--fg);
}

.as-why-t p {
  margin: 4px 0 0 !important;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg2);
  max-width: 900px;
}

.as-why-t code {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--card);
  font: 11px var(--mono);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.as-code {
  padding: 1px 6px;
  border-radius: 6px;
  font: 600 11px var(--mono);
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
}

.as-code.c5 {
  color: var(--down);
  background: color-mix(in srgb, var(--down) 14%, transparent);
}

.as-main {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--down);
  border: 1px solid color-mix(in srgb, var(--down) 45%, transparent);
}

.as-why-in li.main .as-why-n b {
  color: var(--down);
}

.as-rt tr.as-zero td {
  opacity: 0.45;
}

.as-rt tr.as-zero td.as-share {
  font-size: 12px;
  color: var(--muted);
}

.as-foot {
  margin: 12px 0 0 !important;
  font-size: 12px;
  color: var(--muted);
}

.as-tip {
  position: absolute;
  z-index: 20;
  max-width: 320px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--card3);
  color: var(--fg);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (max-width: 860px) {
  .api-form,
  .api-dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .as-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .as-dns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .as-dn-in {
    flex-direction: column;
    align-items: stretch;
  }

  .as-ring {
    align-self: center;
  }

  .as-tl {
    padding-left: 44px;
  }

  .as-y {
    width: 40px;
  }

  .as-x {
    left: 44px;
  }
}

/* ---------- autopilot tab (admins) ---------- */

.ap-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card2), var(--card));
}

.ap-hero.ap-live-on {
  border-color: rgba(240,106,95,0.32);
  background: linear-gradient(180deg, rgba(240,106,95,0.07), var(--card) 75%);
}

.ap-hero-l {
  display: grid;
  flex: 1 1 460px;
  gap: 12px;
  min-width: 0;
}

.ap-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.ap-mode-t {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.ap-mode-s {
  color: var(--muted);
  font-size: 12.5px;
}

.ap-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.ap-dot.on {
  background: var(--up);
  box-shadow: 0 0 8px rgba(121,201,90,0.7);
}

.ap-dot.pause {
  background: var(--warn);
}

.ap-dot.ap-live-on {
  background: var(--down);
  box-shadow: 0 0 8px rgba(240,106,95,0.7);
}

.ap-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ap-health {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ap-hc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.02);
  color: var(--fg2);
  font-size: 12px;
}

.ap-hc i {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.ap-hc.ok i {
  background: var(--up);
}

.ap-hc.warn {
  color: var(--warn);
  border-color: rgba(230,174,72,0.35);
}

.ap-hc.warn i {
  background: var(--warn);
}

.ap-hc.bad {
  color: var(--down);
  border-color: rgba(240,106,95,0.4);
  background: var(--down-bg);
}

.ap-hc.bad i {
  background: var(--down);
}

.ap-hc b {
  color: var(--fg);
  font-weight: 600;
}

.ap-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ap-sec {
  margin-top: 20px;
}

.ap-sec-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  min-height: 32px;
}

.ap-sec-h h3 {
  margin: 0;
  font-size: 15px;
}

.ap-sec-t {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ap-n {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ap-n b {
  font-weight: 650;
}

.ap-sec .table-card {
  margin-top: 10px;
}

.ap-stream {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.ap-stream i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.ap-stream.on {
  color: var(--up);
}

.ap-stream.on i {
  background: var(--up);
  animation: pulse 1.6s ease-in-out infinite;
}

.ap-fold {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.ap-fold .caret,
.ap-card-f > summary::before {
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.ap-card-f > summary::before {
  content: "";
}

.ap-fold[aria-expanded="true"] .caret,
.ap-card-f[open] > summary::before {
  margin-top: -3px;
  transform: rotate(45deg);
}

.ap-fold-t {
  font-size: 15px;
  font-weight: 700;
}

.ap-fold:hover .ap-fold-t,
.ap-card-f > summary:hover {
  color: var(--accent);
}

.ap-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.ap-pager[hidden] {
  display: none;
}

.ap-pg {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--card2);
  color: var(--fg2);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.ap-pg:hover:not(:disabled):not(.on) {
  border-color: var(--muted);
  color: var(--fg);
}

.ap-pg.on {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: default;
}

.ap-pg:disabled {
  opacity: 0.35;
  cursor: default;
}

.ap-pg-gap {
  padding: 0 2px;
  color: var(--muted);
}

.ap-pg-of {
  margin-right: 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ap-grid td {
  font-variant-numeric: tabular-nums;
}

.ap-grid .big {
  font-size: 14px;
}

.ap-grid .pf-pos .pair {
  font-weight: 650;
}

.ap-grid .sub + .sub {
  margin-top: 1px;
}

.ap-grid .sub.ap-why {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-grid tbody tr.ap-out td:first-child {
  box-shadow: inset 3px 0 0 var(--down);
}

.ap-grid tbody tr.ap-edge td:first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}

.ap-grid tbody tr.open td {
  border-bottom-color: transparent;
  background: var(--card2);
}

.ap-grid td.ap-c-act {
  width: 1%;
}

.ap-grid .acts {
  align-items: center;
  gap: 6px;
}

.ap-grid tbody tr.ap-det,
.ap-grid tbody tr.ap-det:hover td {
  cursor: default;
  background: var(--card2);
}

.ap-grid tbody tr.ap-det td {
  padding: 2px 14px 14px;
  white-space: normal;
  text-align: left;
}

.ap-empty {
  padding: 28px 24px;
}

.b.ap-b-live {
  color: var(--down);
  border-color: rgba(240,106,95,0.4);
  background: var(--down-bg);
}

.ap-st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg2);
  font-size: 12px;
  font-weight: 600;
}

.ap-st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ap-st.up {
  background: var(--up-bg);
  color: var(--up);
}

.ap-st.warn {
  background: rgba(230,174,72,0.12);
  color: var(--warn);
}

.ap-st.down {
  background: var(--down-bg);
  color: var(--down);
}

.ap-flash {
  animation: ap-flash 1.1s ease-out;
}

@keyframes ap-flash {
  0% {
    text-shadow: 0 0 10px rgba(121,201,90,0.85);
    filter: brightness(1.45);
  }
  100% {
    text-shadow: none;
    filter: none;
  }
}

.ap-chip {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 12px;
}

.ap-up {
  color: var(--up);
}

.ap-down {
  color: var(--down);
}

.ap-warn {
  color: var(--warn);
}

.ap-h {
  margin: 18px 0 0;
  font-size: 15px;
}

.ap-why {
  max-width: 360px;
  white-space: normal;
}

.ap-dgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.ap-dgrid > div {
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.ap-dgrid h4 {
  margin: 2px 0 6px;
  font-size: 13px;
}

.ap-dgrid p {
  margin: 5px 0;
  color: var(--fg2);
  font-size: 13px;
  line-height: 1.45;
}

.ap-legs {
  margin: 4px 0;
  padding-left: 18px;
  color: var(--fg2);
}

.ap-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.ap-mini td {
  padding: 6px 8px;
}

.ap-mini tbody tr {
  cursor: default;
}

.ap-jlist {
  max-height: 420px;
  overflow: auto;
}

.ap-j {
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg2);
  font-size: 13px;
}

.ap-j-open {
  color: var(--up);
}

.ap-j-close {
  color: var(--fg);
}

.ap-j-skip {
  color: var(--muted);
}

.ap-j-revert {
  color: var(--warn);
}

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

.ap-sigl {
  max-height: 300px;
}

.ap-ctl {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.ap-ctl h3 {
  margin: 0;
}

.ap-ctl-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 6px 14px;
}

.ap-ctl-l {
  color: var(--muted);
  font-size: 13px;
}

.ap-enter {
  display: flex;
  gap: 6px;
}

.ap-enter input {
  flex: 1;
  max-width: 480px;
  height: 32px;
  font-size: 13px;
}

.ap-deny-r {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.ap-deny-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
}

.ap-deny-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 2px 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  color: var(--fg);
  font-size: 12px;
}

.ap-deny-chip button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
}

.ap-deny-chip button:hover {
  color: var(--down);
}

.ap-deny-form {
  display: inline-flex;
  gap: 6px;
}

.ap-deny-form input {
  width: 220px;
  height: 28px;
  font-size: 12px;
}

.ap-deny-form input.ap-tok-mkt {
  width: 150px;
}

.ap-tok-sw {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 13px;
}

.ap-deny-chip .ap-tok-m {
  color: var(--muted);
  margin-left: 4px;
}

.ap-po {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 13px;
}

.ap-po .ap-chk {
  color: var(--fg);
}

.ap-po-st {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ap-card-f {
  margin-top: 14px;
  padding: 0;
}

.ap-card-f > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.ap-card-f > summary::-webkit-details-marker {
  display: none;
}

.ap-card-f > summary .ap-n {
  margin-left: auto;
}

.ap-card-b {
  padding: 0 18px 16px;
}

.ap-card-b > .rule {
  color: var(--fg2);
  line-height: 1.55;
}

.ap-fs {
  margin: 0 0 10px;
  padding: 8px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ap-fs legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.ap-fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 14px;
}

.ap-chks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.ap-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.ap-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

@media (max-width: 1100px) {
  .ap-grid .sub.ap-why {
    max-width: 200px;
  }
}

@media (max-width: 900px) {
  .ap-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ap-kpis .ps:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .ap-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .ap-ctl-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- touch: a long press shows the tooltip ---------- */

.tap-tip {
  position: fixed;
  z-index: 90;
  max-width: min(340px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: #191a1d;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  animation: fade 0.12s;
}

@media (hover: none) {
  [title] {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .key-hint {
    display: none;
  }
}

@media (hover: hover) {
  .tap-hint {
    display: none;
  }
}

/* ---------- phone (iPhone portrait): safe areas, bottom tab bar, cards ---------- */

@media (max-width: 520px) {
  :root {
    --top-h: 52px;
    --tab-h: 56px;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --dock: calc(var(--tab-h) + var(--safe-b));
  }

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

  body {
    -webkit-tap-highlight-color: transparent;
  }

  /* iOS zooms the page into any field under 16px. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  .btn {
    height: 40px;
  }

  .btn.small {
    height: 34px;
  }

  .login {
    padding: calc(var(--safe-t) + 20px) 14px calc(var(--safe-b) + 20px);
  }

  .login-card {
    padding: 26px 20px;
  }

  /* shell */

  .app {
    padding: 0 max(12px, env(safe-area-inset-right)) calc(var(--dock) + 24px) max(12px, env(safe-area-inset-left));
  }

  .top {
    height: calc(var(--top-h) + var(--safe-t));
    margin: 0 -12px;
    padding: var(--safe-t) 12px 0;
    gap: 8px;
  }

  .brand {
    gap: 4px;
  }

  .top-actions {
    gap: 4px;
  }

  .top .btn {
    height: 38px;
  }

  .top .btn.icon,
  .top .btn.lpx-open,
  .top .live {
    width: 38px;
    padding: 0;
  }

  #logout {
    padding: 0 10px;
    font-size: 13px;
  }

  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0;
    margin: 0;
    padding: 0 max(4px, env(safe-area-inset-right)) var(--safe-b) max(4px, env(safe-area-inset-left));
    overflow: visible;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(10,10,11,0.92);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
  }

  .tab {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    height: var(--tab-h);
    padding: 5px 2px 3px;
    font-size: 10.5px;
    line-height: 1.1;
    letter-spacing: 0;
  }

  .tab::before {
    content: "";
    flex: none;
    width: 24px;
    height: 24px;
    background: currentColor;
    -webkit-mask: var(--tab-ic) center / 24px 24px no-repeat;
    mask: var(--tab-ic) center / 24px 24px no-repeat;
  }

  .tab:hover {
    color: var(--muted);
  }

  .tab.active {
    color: var(--accent);
  }

  .tab.active::after {
    top: 0;
    bottom: auto;
    left: 26%;
    right: 26%;
    border-radius: 0 0 2px 2px;
  }

  .tab .count {
    position: absolute;
    top: 4px;
    left: calc(50% + 5px);
    min-width: 17px;
    margin: 0;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    box-shadow: 0 0 0 2px rgb(10,10,11);
  }

  .tab[data-tab="pools"] {
    --tab-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 18l5-6 4 3 8-9'/%3E%3Cpath d='M15 6h5v5'/%3E%3C/svg%3E");
  }

  .tab[data-tab="portfolio"] {
    --tab-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7V5a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v3h-4a2 2 0 0 0 0 4h4v3a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V6'/%3E%3C/svg%3E");
  }

  .tab[data-tab="alerts"] {
    --tab-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2.75h-.44a1.75 1.75 0 0 0-1.75 1.75v.16a1.75 1.75 0 0 1-.88 1.51l-.38.22a1.75 1.75 0 0 1-1.75 0l-.13-.07a1.75 1.75 0 0 0-2.39.64l-.22.38a1.75 1.75 0 0 0 .64 2.39l.13.08a1.75 1.75 0 0 1 .88 1.5v.45a1.75 1.75 0 0 1-.88 1.52l-.13.08a1.75 1.75 0 0 0-.64 2.39l.22.38a1.75 1.75 0 0 0 2.39.64l.13-.07a1.75 1.75 0 0 1 1.75 0l.38.22a1.75 1.75 0 0 1 .88 1.51v.16a1.75 1.75 0 0 0 1.75 1.75h.44a1.75 1.75 0 0 0 1.75-1.75v-.16a1.75 1.75 0 0 1 .88-1.51l.38-.22a1.75 1.75 0 0 1 1.75 0l.13.07a1.75 1.75 0 0 0 2.39-.64l.22-.38a1.75 1.75 0 0 0-.64-2.39l-.13-.08a1.75 1.75 0 0 1-.88-1.52v-.44a1.75 1.75 0 0 1 .88-1.52l.13-.08a1.75 1.75 0 0 0 .64-2.39l-.22-.38a1.75 1.75 0 0 0-2.39-.64l-.13.07a1.75 1.75 0 0 1-1.75 0l-.38-.22a1.75 1.75 0 0 1-.88-1.51V4.5a1.75 1.75 0 0 0-1.75-1.75z'/%3E%3Ccircle cx='12' cy='12' r='2.75'/%3E%3C/svg%3E");
  }

  .tab[data-tab="blacklist"] {
    --tab-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M5.7 5.7l12.6 12.6'/%3E%3C/svg%3E");
  }

  .tab[data-tab="api"] {
    --tab-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 18l6-6-6-6'/%3E%3Cpath d='M8 6l-6 6 6 6'/%3E%3C/svg%3E");
  }

  .tab[data-tab="autopilot"] {
    --tab-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2L4 14h8l-1 8 9-12h-8l1-8z'/%3E%3C/svg%3E");
  }

  .toast {
    bottom: calc(var(--dock) + 14px);
    max-width: calc(100vw - 24px);
    text-align: center;
  }

  .news-note {
    left: 12px;
    right: 12px;
    bottom: calc(var(--dock) + 12px);
    width: auto;
  }

  .pop,
  .pop.news-pop {
    top: calc(var(--top-h) + var(--safe-t) + 6px);
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100vh - var(--top-h) - var(--safe-t) - var(--dock) - 18px);
    max-height: calc(100dvh - var(--top-h) - var(--safe-t) - var(--dock) - 18px);
    padding: 16px;
    overscroll-behavior: contain;
  }

  /* The insets are borders, not padding: content scrolls inside them and never under the clock or the home bar. */
  .drawer {
    width: 100vw;
    padding: 14px 14px 28px;
    border: 0 solid #121315;
    border-width: var(--safe-t) 0 var(--safe-b);
    overscroll-behavior: contain;
  }

  .drawer .close {
    width: 40px;
    height: 40px;
  }

  .lpx {
    padding: var(--safe-t) env(safe-area-inset-right) var(--safe-b) env(safe-area-inset-left);
  }

  .lpx-top {
    gap: 8px 10px;
    min-height: 54px;
    padding: 6px 10px;
  }

  .shr {
    padding: calc(var(--safe-t) + 12px) 12px calc(var(--safe-b) + 12px);
  }

  .foot {
    font-size: 11.5px;
    line-height: 1.5;
  }

  /* pools: toolbar */

  .toolbar {
    gap: 8px;
  }

  .toolbar > .search {
    flex: 1 1 0;
    min-width: 0;
    height: 40px;
  }

  .search input {
    height: 38px;
  }

  .search kbd {
    display: none;
  }

  #more {
    order: 1;
    padding: 0 12px;
  }

  #csv {
    order: 2;
    width: 40px;
    padding: 0;
    gap: 0;
    font-size: 0;
  }

  .toolbar > .seg {
    order: 3;
    flex: 1 1 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .toolbar > .seg::-webkit-scrollbar {
    display: none;
  }

  .seg button {
    flex: 1 0 auto;
    justify-content: center;
    height: 32px;
  }

  .filters {
    gap: 12px;
    padding: 12px;
  }

  .range input {
    height: 38px;
    min-width: 0;
  }

  .range.iss-f .seg,
  .range.mkt-f .seg,
  .range.opt .seg,
  .range.wide .seg {
    justify-self: stretch;
    flex-wrap: wrap;
  }

  /* pools: rows as cards, the header as sort chips */

  .table-card {
    margin-top: 12px;
  }

  #pool-table,
  #pool-table thead,
  #pool-table tbody {
    display: block;
  }

  #pool-table thead tr {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--line);
    background: #141518;
  }

  #pool-table thead tr::-webkit-scrollbar {
    display: none;
  }

  #pool-table thead tr::before {
    content: "Сортировка";
    flex: none;
    color: var(--muted);
    font-size: 12px;
  }

  #pool-table th {
    position: static;
    display: inline-flex;
    align-items: center;
    flex: none;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line2);
    border-radius: 999px;
    background: var(--card);
    color: var(--fg2);
    font-size: 12.5px;
  }

  #pool-table th:not([data-sort]),
  #pool-table th.c-age {
    display: none;
  }

  #pool-table th.sorted {
    border-color: rgba(255,106,61,0.5);
    background: var(--accent-bg);
    color: var(--accent);
  }

  #rows > tr {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 10px 6px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  #rows > tr:last-child {
    border-bottom: 0;
  }

  #rows > tr:active {
    background: var(--card2);
  }

  #rows > tr > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none !important;
    box-shadow: none !important;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #rows > tr > td.c-age {
    display: none;
  }

  #rows > tr > td.c-pool {
    grid-row: 1;
    grid-column: 1 / 8;
    overflow: visible;
    white-space: normal;
  }

  #rows > tr > td:nth-child(2),
  #rows > tr > td.c-f5,
  #rows > tr > td.c-trend,
  #rows > tr > td.c-vol,
  #rows > tr > td.c-yield {
    grid-row: 2;
  }

  #rows > tr > td.c-liq,
  #rows > tr > td.c-swaps,
  #rows > tr > td.c-last,
  #rows > tr > td.c-act {
    grid-row: 3;
  }

  #rows .pair {
    max-width: 100%;
    font-size: 15px;
  }

  #rows .tags {
    flex-wrap: wrap;
    gap: 4px;
  }

  #rows > tr > td.c-fees {
    grid-row: 1;
    grid-column: 8 / 11;
    text-align: right;
  }

  #rows .c-fees .big {
    display: block;
    font-size: 17px;
    line-height: 1.25;
  }

  #rows > tr > td:nth-child(2) {
    grid-column: 1 / 3;
  }

  #rows > tr > td.c-f5 {
    grid-column: 3 / 5;
  }

  #rows > tr > td.c-trend {
    grid-column: 5 / 7;
  }

  #rows > tr > td.c-vol {
    grid-column: 7 / 9;
  }

  #rows > tr > td.c-yield {
    grid-column: 9 / 11;
  }

  #rows > tr > td.c-liq {
    grid-column: 1 / 4;
  }

  #rows > tr > td.c-swaps {
    grid-column: 4 / 6;
  }

  #rows > tr > td.c-last {
    grid-column: 6 / 8;
  }

  #rows > tr > td.c-act {
    grid-column: 8 / 11;
    align-self: end;
    overflow: visible;
    text-align: right;
  }

  #rows > tr > td:nth-child(2)::before,
  #rows > tr > td.c-f5::before,
  #rows > tr > td.c-trend::before,
  #rows > tr > td.c-vol::before,
  #rows > tr > td.c-yield::before,
  #rows > tr > td.c-liq::before,
  #rows > tr > td.c-swaps::before,
  #rows > tr > td.c-last::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 500;
  }

  #rows > tr > td:nth-child(2)::before {
    content: "TVL";
  }

  #rows > tr > td.c-f5::before {
    content: "5 мин";
  }

  #rows > tr > td.c-trend::before {
    content: "Рост";
  }

  #rows > tr > td.c-vol::before {
    content: "Объём 30м";
  }

  #rows > tr > td.c-yield::before {
    content: "на $1k";
  }

  #rows > tr > td.c-liq::before {
    content: "Ликвидность";
  }

  #rows > tr > td.c-swaps::before {
    content: "Свопы";
  }

  #rows > tr > td.c-last::before {
    content: "Посл. своп";
  }

  #rows .trend {
    min-width: 0;
    padding: 1px 6px;
  }

  #rows .lq,
  #rows .lqs {
    width: 100%;
    max-width: 120px;
  }

  #rows .lq-none {
    width: auto;
  }

  #rows .acts {
    gap: 4px;
  }

  #rows .act {
    width: 34px;
    height: 32px;
    border: 1px solid var(--line2);
    background: var(--card2);
    color: var(--fg2);
  }

  #rows .act.okx,
  #rows .act.agg {
    width: auto;
    padding: 0 8px;
  }

  #rows .act.blk,
  #rows .act.ph {
    display: none;
  }

  .pager {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
  }

  .pager #range {
    order: 2;
    flex: 1 1 100%;
    text-align: center;
    font-size: 12px;
  }

  .pages .btn,
  .pnums .pn {
    min-width: 38px;
    height: 38px;
  }

  /* autopilot: hero, controls, positions as cards */

  .ap-hero {
    padding: 12px 14px;
  }

  .ap-hero-l {
    flex-basis: 100%;
  }

  .ap-btns {
    width: 100%;
  }

  .ap-btns .btn {
    flex: 1 1 auto;
    height: 38px;
  }

  .ap-hc {
    min-height: 28px;
  }

  #ap-kpis .ps-s {
    white-space: normal;
  }

  .ap-sec-h {
    align-items: flex-start;
  }

  .ap-pager {
    width: 100%;
    justify-content: flex-end;
  }

  .ap-pg {
    min-width: 36px;
    height: 36px;
  }

  .ap-pg-of {
    margin-right: auto;
  }

  .ap-grid thead {
    display: none;
  }

  .ap-grid,
  .ap-grid tbody {
    display: block;
  }

  .ap-grid tbody tr:not(.ap-det) {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .ap-grid tbody:last-of-type tr:last-child {
    border-bottom: 0;
  }

  .ap-grid tbody tr.open {
    background: var(--card2);
  }

  .ap-grid tbody tr:not(.ap-det) > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none !important;
    box-shadow: none !important;
    text-align: left;
    white-space: normal;
  }

  .ap-grid tbody tr.ap-out {
    box-shadow: inset 3px 0 0 var(--down);
  }

  .ap-grid tbody tr.ap-edge {
    box-shadow: inset 3px 0 0 var(--warn);
  }

  .ap-grid td.ap-c-pos {
    grid-column: 1 / -1;
    padding-right: 128px !important;
  }

  .ap-grid td.ap-c-rg {
    grid-column: 1 / -1;
  }

  .ap-grid .rv {
    max-width: none;
  }

  .ap-grid td[data-l]::before {
    content: attr(data-l);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
  }

  .ap-grid td.ap-c-act {
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto;
  }

  .ap-grid td.ap-c-act .btn {
    height: 34px;
  }

  .ap-grid .big {
    font-size: 16px;
  }

  .ap-grid .sub.ap-why {
    max-width: none;
    white-space: normal;
  }

  .ap-grid tbody tr.ap-det,
  .ap-grid tbody tr.ap-det td {
    display: block;
  }

  .ap-grid tbody tr.ap-det td {
    padding: 0 10px 12px;
    border-bottom: 1px solid var(--line);
  }

  .ap-dgrid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ap-enter input,
  .ap-deny-form input {
    height: 38px;
  }

  .ap-deny-form {
    display: flex;
    width: 100%;
  }

  .ap-deny-form input,
  .ap-deny-form input.ap-tok-mkt {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  #ap-tok-form {
    flex-wrap: wrap;
  }

  #ap-tok-form input:first-child {
    flex-basis: 100%;
  }

  .ap-deny-chip {
    padding: 4px 2px 4px 10px;
    font-size: 13px;
  }

  .ap-deny-chip button {
    padding: 2px 8px;
    font-size: 16px;
  }

  .ap-card-f > summary {
    padding: 12px 14px;
  }

  .ap-card-b {
    padding: 0 14px 14px;
  }
}

/* ---------- full cycle: buy → LP → sale (admin, own Solana wallets) ---------- */

.cy-cell {
  display: inline-grid;
  justify-items: end;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: pointer;
}

.cy-cell .big {
  text-decoration: underline dotted transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.cy-cell:hover .big {
  text-decoration-color: currentColor;
}

/* Another wallet's cycle: the same figure, view only (hover breakdown, no click). */
.cy-cell.cy-ro {
  cursor: default;
}

.cy-cell.cy-ro:hover .big {
  text-decoration-color: transparent;
}

.cy-cell .big.muted {
  font-weight: 500;
  color: var(--muted);
}

.cy-q {
  color: var(--warn) !important;
}

.pf-cycle {
  scroll-margin-top: calc(var(--top-h) + 10px);
}

.cy-st {
  min-width: 0;
}

.cy-excl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
  cursor: pointer;
  user-select: none;
}

.cy-excl.muted {
  cursor: default;
}

.cy-excl input {
  margin: 0;
}

.cy-sec {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cy-sec-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 8px;
}

.cy-sec-h h3 {
  margin: 0;
  font-size: 14px;
}

.cy-sec-h .push {
  margin-left: auto;
}

/* a folding section header («Не сведено») */
.cy-sec-tg {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cy-chev {
  width: 12px;
  height: 12px;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s;
}

.cy-sec-tg[aria-expanded="true"] .cy-chev {
  transform: rotate(180deg);
}

.cy-sec-tg[aria-expanded="false"] {
  margin-bottom: 0;
}

.cy-one {
  margin-top: 14px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card2);
}

.cy-one .cl-kpis {
  margin-top: 4px;
}

.cy-one .table-card {
  margin-top: 10px;
}

.cy-line {
  color: var(--fg2);
}

.cy-urs {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: clip;
}

.cy-ur {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.cy-ur:last-child {
  border-bottom: 0;
}

.cy-ur-t {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cy-ur-t > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cy-ur-f {
  display: flex;
  gap: 6px;
}

.cy-ur-f input {
  width: 130px;
  height: 30px;
  font-size: 13px;
}

.cy-parse {
  display: flex;
  gap: 8px;
}

.cy-parse input {
  flex: 1;
  height: 32px;
  font-size: 13px;
}

.cy-prev {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,106,61,0.35);
  background: var(--accent-bg);
  font-size: 13px;
}

.cy-prev.warn {
  border-color: rgba(230,174,72,0.4);
  background: rgba(230,174,72,0.08);
}

.cy-prev.bad {
  border-color: rgba(240,106,95,0.4);
  background: var(--down-bg);
  color: var(--down);
}

.cy-man,
.cy-bp-f {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.cy-bp-f p {
  margin: 0;
}

.cy-fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 12px;
}

.cy-fgrid .cy-f-note {
  grid-column: span 2;
}

.cy-bps {
  display: grid;
  gap: 6px;
}

.cy-bp-i {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 13px;
}

.cy-bp-i > b {
  min-width: 70px;
}

.cy-acts {
  display: inline-flex;
  gap: 6px;
}

.cy-grid tbody tr {
  cursor: default;
}

.cy-grid tbody tr.cy-editing td {
  background: var(--accent-bg);
}

.table-scroll:has(> .cy-grid) {
  overflow-x: auto;
}

.table-scroll:has(> .cy-grid) th {
  position: static;
}

@media (max-width: 720px) {
  .pf-grid tbody tr[data-id] td.cy-none {
    display: none;
  }

  .cy-cell {
    justify-items: start;
    text-align: left;
  }

  .cy-fgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cy-ur-f {
    flex: 1 1 100%;
  }

  .cy-ur-f input {
    flex: 1;
    width: auto;
  }

  .cy-parse {
    flex-wrap: wrap;
  }

  .cy-parse input {
    flex: 1 1 100%;
  }
}

/* Цикл › Backpack: the server-made key's public half */
.cy-bp-pub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.cy-bp-pub code {
  word-break: break-all;
}

/* «Цикл» › Backpack: the new subaccount's name field shows only while «+ ещё суб-аккаунт…» is picked */
.cy-bp-sub[hidden] {
  display: none !important;
}

/* «Свапалка» (admin): the tab finds a pool; the LP window in swap mode shows the swap card in place of the position form. */
.lpx-mode { width: 100%; }
.lpx-mode button { flex: 1; }
.lpx-swapc { display: none; flex-direction: column; gap: 10px; }
.lpx.lpx-swapmode .lpx-swapc { display: flex; }
.lpx.lpx-swapmode .lpx-dbtn { display: none !important; }
.lpx.lpx-swapmode #lpx-range, .lpx.lpx-swapmode #lpx-amount, .lpx.lpx-swapmode #lpx-prev, .lpx.lpx-swapmode #lpx-go, .lpx.lpx-swapmode #lpx-steps, .lpx.lpx-swapmode .lpx-nd { display: none !important; }
.lpx-swapc #sw-form { display: flex; flex-direction: column; gap: 10px; }
.lpx-swapc #sw-form[hidden] { display: none; }
.sw-side { width: 100%; }
.sw-side button { flex: 1; }
.sw-amt input { width: 100%; }
.sw-amt-in { display: flex; align-items: center; gap: 8px; }
.sw-unit { color: var(--muted); white-space: nowrap; }
.sw-quote { display: flex; flex-direction: column; gap: 4px; min-height: 18px; }
.sw-get { font-size: 14px; }
.sw-warn { color: var(--warn, #e6ae48); }
.sw-err { color: var(--down); }
.sw-log { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.sw-log:empty { display: none; }
.sw-log .ok { color: var(--up); }
.sw-log .err { color: var(--down); }
/* Свапалка for view accounts: greyed "soon", not clickable */
.tab-sw-btn .sw-soon { display: inline; font-size: 0.85em; }
/* «Свапалка» is a beta: what to know before a swap */
.sw-beta { padding: 8px 10px; border: 1px solid var(--warn); border-radius: 8px; color: var(--fg2); font-size: 12px; line-height: 1.4; }
.sw-beta b { color: var(--warn); }
/* The whole pool card is a link for the wheel, Ctrl + click and the right-click menu; its own links and figures stay on top. */
.pc-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
:is(.pc, .pr) { position: relative; }
:is(.pc, .pr) :is(.pc-acts, .pc-liq, .pr-liq, .cm, .pc-tags) { position: relative; z-index: 2; }
a.pool-link { color: inherit; }
/* Donation wallets in the new design's title bar, in place of the old ticker */
.bar-donate { display: flex; flex: 0 1 auto; align-items: center; gap: 8px; min-width: 0; margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.bar-donate .donate-net { margin-left: 4px; }
.bar-donate .donate-a { cursor: default; -webkit-user-select: text; user-select: text; }
@media (max-width: 1240px) { .bar-donate { display: none; } }
/* LP window, closed tab: «Показать ещё» under the table */
.lpx-cmore { display: flex; justify-content: center; padding: 10px 0 4px; }
/* LP window tables: a figure's head sorts by it; the arrow sits left of the text and takes no width, so the columns stay. */
.lpx-ptab thead th.lpx-sth { cursor: pointer; user-select: none; }
.lpx-ptab thead th.lpx-sth:hover { color: var(--fg); }
.lpx-ptab thead th.lpx-son { color: var(--fg); }
.lpx-ptab thead th.lpx-son::before { content: "↓"; position: absolute; margin-left: -13px; color: var(--accent); }
.lpx-ptab thead th.lpx-son.asc::before { content: "↑"; }
/* LP window, own positions: the range and number columns keep fixed widths, so values that change every read do not
   re-balance the table and shift the columns left and right; the pool column takes the rest (owner, 2026-10-29).
   d189: the pool column is fixed too and its content never wider: a pool's fee that drifts (1.0001% → 1%) resized it
   by 30 px and moved every column right of it («всё ещё дёргается», 2026-10-30). */
@media (min-width: 900px) {
  .lpx-ptab:not(.lpx-ctab, .lpx-htab) :is(th, td):nth-child(1) { width: 300px; }
  .lpx-ptab:not(.lpx-ctab, .lpx-htab) td:nth-child(1) .pool { max-width: 276px; }
  .lpx-ptab:not(.lpx-ctab, .lpx-htab) td:nth-child(1) .tags { min-width: 0; overflow: hidden; }
  .lpx-ptab:not(.lpx-ctab, .lpx-htab) :is(th, td):nth-child(2) { width: 260px; }
  .lpx-ptab:not(.lpx-ctab, .lpx-htab) :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(5)) { width: 112px; }
}
/* ---------- «Лимитки»: the LP window with a book, an order form and trades on the right (limit.js) ---------- */
.lpx-lim, .li-only { display: none; }
.lpx.lpx-limitmode .li-only { display: inline-flex; }
.lpx.lpx-limitmode .lpx-main { grid-template-columns: minmax(0, 1fr) 636px; }
.lpx.lpx-limitmode .lpx-side { padding: 0; gap: 0; overflow: hidden; scrollbar-gutter: auto; }
.lpx.lpx-limitmode .lpx-mode { margin: 8px 10px; flex: none; align-self: flex-start; }
.lpx.lpx-limitmode #lpx-swap, .lpx.lpx-limitmode #lpx-wallet, .lpx.lpx-limitmode #lpx-range, .lpx.lpx-limitmode #lpx-amount, .lpx.lpx-limitmode #lpx-prev, .lpx.lpx-limitmode #lpx-go, .lpx.lpx-limitmode #lpx-steps, .lpx.lpx-limitmode .lpx-nd, .lpx.lpx-limitmode .lpx-dbtn { display: none !important; }
.lpx.lpx-limitmode .lpx-fx, .lpx.lpx-limitmode .lpx-fxt, .lpx.lpx-limitmode #lpx-lost { display: none !important; }
.lpx.lpx-limitmode .lpx-lim { flex: 1; min-height: 0; display: grid; grid-template-columns: 306px 330px; border-top: 1px solid var(--line); }
.li-book { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.li-bh { display: flex; align-items: center; gap: 6px; padding: 8px 10px 6px; flex: none; }
.li-tt { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 650; margin-right: auto; }
.li-tt i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.li-tt i.on { background: var(--up); box-shadow: 0 0 0 3px rgba(121,201,90,0.14); }
.li-tt i.down { background: var(--down); }
.li-sel { height: 26px; max-width: 96px; padding: 0 4px; color: var(--fg2); background: var(--card2); border: 1px solid var(--line2); border-radius: 7px; font-family: inherit; font-size: 12px; font-variant-numeric: tabular-nums; }
.li-unit { padding: 2px; border-radius: 9px; }
.li-unit button { height: 22px; max-width: 62px; padding: 0 7px; border-radius: 7px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sum { padding: 0 10px 5px; flex: none; color: var(--fg2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sum .up { color: var(--up); font-weight: 600; }
.li-sum .down { color: var(--down); font-weight: 600; }
.li-src { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 7px; flex: none; }
.li-src:empty { display: none; }
.li-chip { height: 20px; padding: 0 6px; color: var(--muted); background: transparent; border: 1px solid var(--line2); border-radius: 6px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.li-chip b { color: var(--fg2); font-weight: 600; font-variant-numeric: tabular-nums; }
.li-chip:hover { border-color: var(--muted); }
.li-chip.off { opacity: 0.45; text-decoration: line-through; }
.li-chip.err { border-color: var(--down); }
.li-cols, .li-r { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 6px; align-items: center; padding: 0 10px; }
.li-cols { height: 22px; flex: none; color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; border-top: 1px solid var(--line); }
.li-cols span { overflow: hidden; text-overflow: ellipsis; }
.li-cols span, .li-r > span { text-align: center; }
.li-side { flex: 1 1 0; min-height: 0; display: flex; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.li-side:hover { scrollbar-color: var(--line2) transparent; }
.li-asks { flex-direction: column-reverse; }
.li-bids { flex-direction: column; }
.li-r { position: relative; flex: none; width: 100%; height: 21px; color: var(--fg); background: transparent; border: 0; font-family: inherit; font-size: 12.5px; line-height: 21px; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; cursor: pointer; text-align: left; }
.li-r > span { position: relative; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.li-r .li-t { color: var(--fg2); }
.li-r.ask .li-p { color: var(--down); }
.li-r.bid .li-p { color: var(--up); }
.li-bar { position: absolute; top: 0; right: 0; bottom: 0; pointer-events: none; }
.li-r.ask .li-bar { background: rgba(240,106,95,0.14); }
.li-r.bid .li-bar { background: rgba(121,201,90,0.14); }
.li-r:hover { background: var(--card2); }
.li-r.me .li-p::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: var(--accent); vertical-align: 1.5px; }
.li-mid { display: flex; align-items: baseline; gap: 6px; flex: none; padding: 6px 10px; color: var(--fg); background: var(--card2); border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; }
.li-mid b { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.li-sp { margin-left: auto; color: var(--fg2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.li-foot { flex: none; padding: 5px 10px; border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-right { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden auto; scrollbar-width: thin; }
.li-form { flex: none; padding: 10px; border-bottom: 1px solid var(--line); }
.li-form:empty { display: none; }
.li-fx { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.li-fx .lpx-fxin { flex: 1; width: 100%; height: auto; min-height: 0; }
.lpx .li-fx .lpx-fxc, .lpx .li-fx .lpx-fxr { grid-template-columns: 62px minmax(0, 1fr) 84px 40px; column-gap: 4px; padding: 0 10px; font-family: inherit; }
.lpx .li-fx .lpx-fxr { height: 25px; line-height: 25px; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.lpx .li-fx .lpx-fxr :is(span, button) { font-family: inherit; font-size: 12px; }
.li-fx .lpx-fxcnt, .li-fx #lpx-fxm { display: none; }
.li-fx .lpx-fxb { overflow-x: hidden; }
.li-fx .lpx-fxseg button { padding: 0 6px; font-size: 11.5px; }
.li-fx .lpx-fxh, .li-fx .lpx-fxf { padding-left: 10px; padding-right: 10px; }
.li-mine { height: 100%; }
@media (max-width: 1180px) {
  .lpx.lpx-limitmode .lpx-main { grid-template-columns: minmax(0, 1fr) 560px; }
  .lpx.lpx-limitmode .lpx-lim { grid-template-columns: 270px 290px; }
}
@media (max-width: 900px) {
  .lpx.lpx-limitmode .lpx-side { overflow: visible; }
  .lpx.lpx-limitmode .lpx-lim { display: flex; flex-direction: column; }
  .li-book { border-right: 0; height: 520px; flex: none; }
  .li-right { flex: none; }
  .li-fx { height: 420px; flex: none; }
}.li-sides { width: 100%; flex: none; }
.li-sides button { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sides button.on.buy { color: var(--up); background: var(--up-bg); }
.li-sides button.on.sell { color: var(--down); background: var(--down-bg); }
.li-fbody { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.li-fbody[hidden] { display: none; }
.li-fld { display: flex; flex-direction: column; gap: 3px; }
.li-fl { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.li-in { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; background: var(--card2); border: 1px solid var(--line2); border-radius: 8px; }
.li-in:focus-within { border-color: var(--accent); }
.li-in input { flex: 1; min-width: 0; height: 100%; padding: 0; color: var(--fg); background: transparent; border: 0; outline: 0; font-family: inherit; font-size: 14px; font-variant-numeric: tabular-nums; }
.li-u { color: var(--muted); font-size: 12px; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.li-pay { height: 24px; max-width: 86px; color: var(--fg2); background: var(--card3); border: 0; border-radius: 6px; font-size: 12px; }
.li-quick { display: flex; align-items: center; gap: 4px; }
.li-quick button { height: 20px; padding: 0 6px; color: var(--muted); background: transparent; border: 1px solid var(--line2); border-radius: 6px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.li-quick button:hover { color: var(--fg); border-color: var(--muted); }
.li-bal { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-exp { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.li-exp .seg button { height: 22px; padding: 0 8px; font-size: 12px; }
.li-fsum { display: flex; flex-direction: column; gap: 3px; }
.li-fsum:empty { display: none; }
.li-kv { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.li-kv b { color: var(--fg); font-weight: 600; font-size: 12px; }
.btn.li-go { height: 34px; flex: none; }
.btn.li-go.sell { background: var(--down); border-color: var(--down); color: #fff; }
.li-mine { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.li-mh { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex: none; border-bottom: 1px solid var(--line); }
.li-mh .btn { margin-left: auto; }
.li-me { display: flex; flex: 1; align-items: center; justify-content: center; padding: 14px; }
.li-mt { flex: 1; min-height: 0; overflow: auto; }
.li-mt .up { color: var(--up); }
.li-mt .down { color: var(--down); }
.li-mt .warn { color: var(--warn); }.li-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.li-tab th { position: sticky; top: 0; padding: 6px 10px; color: var(--muted); background: #0d0d0f; font-size: 11.5px; font-weight: 600; text-align: left; }
.li-tab td { padding: 5px 10px; border-top: 1px solid var(--line); }
.li-tab .num { text-align: right; font-variant-numeric: tabular-nums; }
.li-tab .c-act { text-align: right; }
.lpx.lpx-limitmode .lpx-mode { max-width: calc(100% - 20px); }
.lpx.lpx-limitmode #lpx-allp { display: none; }
.li-hint { min-height: 15px; margin-top: -3px; }
.li-sides[hidden] { display: none; }
.li-fbody input:disabled, .li-fbody select:disabled { opacity: 0.6; }
.lpx.lpx-limitmode .lpx-pcreate, .lpx.lpx-swapmode .lpx-pcreate, .lpx.lpx-limitmode .lpx-pnote, .lpx.lpx-swapmode .lpx-pnote { display: none; }.lpx.lpx-limitmode.lpx-agg .lpx-side { display: flex; }
.lpx.lpx-limitmode.lpx-agg .lpx-split { display: block; }
.lpx.lpx-limitmode.lpx-agg .lpx-pos { display: block; }
.lpx.lpx-limitmode.lpx-agg .lpx-apools { display: none; }
.li-fx .lpx-fxg { display: none; }
select.li-pools { height: 30px; max-width: 230px; padding: 0 6px; font-family: inherit; font-size: 12.5px; }
.li-pools[hidden], .lpx.lpx-limitmode .li-pools[hidden] { display: none; }
.li-in input, .li-in input:focus, .li-in input:focus-visible { border: 0 !important; outline: 0 !important; box-shadow: none !important; background: none !important; }
.li-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.li-pay:focus, .li-pay:focus-visible { outline: 0; box-shadow: none; }
.li-hint:empty { display: none; }
.li-get { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 9px; background: var(--card2); border-radius: 8px; color: var(--muted); font-size: 12px; }
.li-get b { min-width: 0; overflow: hidden; color: var(--fg); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-overflow: ellipsis; }
.li-get b.up { color: var(--up); }
.li-get b.down { color: var(--down); }
.li-get b.muted { color: var(--muted); font-weight: 400; }
.lpx-pi.li-tok.hit { border: 1px solid var(--accent); background: var(--accent-bg); }
.li-taddr { color: var(--muted); font-size: 11px; font-weight: 400; }
.li-fh { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 16px; }
.li-lnk { padding: 0; color: var(--muted); background: none; border: 0; font: inherit; font-size: 11.5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.li-lnk:hover { color: var(--fg); }
.li-lnk[hidden] { display: none; }
.li-quick button { flex: 1; }
.li-pay { max-width: 96px; }
.li-fbody { gap: 9px; }
#lif-other[hidden], #lif-err[hidden] { display: none; }
.li-getb { flex: none; }
.li-getb:empty { display: none; }
.li-get { align-items: center; }
.li-get b { margin-left: auto; }
.li-in .li-u[hidden] { display: none; }
.li-fill { display: inline-block; width: 46px; height: 5px; margin-right: 7px; overflow: hidden; vertical-align: 1px; background: var(--card3); border-radius: 3px; }
.li-fill i { display: block; height: 100%; background: var(--up); }
.li-fillc { white-space: nowrap; font-variant-numeric: tabular-nums; }
.li-tab .warn { color: var(--warn); font-size: 11.5px; }
.li-prefs { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.li-pf { display: flex; align-items: center; gap: 9px; padding: 6px 0; cursor: pointer; }
.li-pr { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 0; flex-wrap: wrap; }
.li-mh .seg button { height: 26px; padding: 0 10px; font-size: 12.5px; }
.li-tab .up { color: var(--up); }
.li-tab a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.lpx .li-fx .lpx-fxc > span, .lpx .li-fx .lpx-fxr > span { display: block; text-align: center !important; }
