:root {
  --bg: #0b0d10;
  --card: #12161b;
  --card2: #171c22;
  --card3: #1d232b;
  --line: #20262e;
  --line2: #2b323c;
  --fg: #e8eaed;
  --fg2: #b8bec7;
  --muted: #7a828e;
  --accent: #e3c77d;
  --accent-bg: rgba(227, 199, 125, 0.1);
  --up: #3fcf8e;
  --up-bg: rgba(63, 207, 142, 0.12);
  --down: #f07171;
  --down-bg: rgba(240, 113, 113, 0.12);
  --warn: #f2b95b;
  --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(227, 199, 125, 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,
.kpi .v {
  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: #3a434e;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1609;
  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(227, 199, 125, 0.6);
  box-shadow: 0 0 0 3px rgba(227, 199, 125, 0.12);
}

input::placeholder {
  color: #59616c;
}

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: #1a1609;
  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='%23e3c77d' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 100% no-repeat,
    linear-gradient(145deg, #1d232b, #12161b);
  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(11, 13, 16, 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(63, 207, 142, 0.15);
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(242, 185, 91, 0.15);
}

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

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

.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(63, 207, 142, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(63, 207, 142, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(63, 207, 142, 0);
  }
}

#sound .mute {
  display: none;
}

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

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

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

/* ---------- KPIs ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 8px;
}

.kpi {
  position: relative;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card2), var(--card));
  text-align: left;
  overflow: hidden;
}

button.kpi {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

button.kpi:hover {
  border-color: var(--line2);
  transform: translateY(-1px);
}

.kpi .l {
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi .v {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin: 4px 0 2px;
}

.kpi .s {
  color: var(--fg2);
  font-size: 12.5px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.kpi.accent .v {
  color: var(--accent);
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto -30px -60px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 199, 125, 0.07), transparent 70%);
  pointer-events: none;
}

/* ---------- 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(227, 199, 125, 0.6);
  box-shadow: 0 0 0 3px rgba(227, 199, 125, 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);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
}

.presets .sep {
  width: 1px;
  height: 20px;
  background: var(--line2);
  margin: 0 2px;
}

.presets button[data-preset],
.presets button[data-toggle] {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--fg2);
  cursor: pointer;
  font-size: 13px;
}

.presets button[data-preset]:hover,
.presets button[data-toggle]:hover {
  border-color: #3a434e;
  color: var(--fg);
}

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

.presets button.on {
  background: var(--accent-bg);
  border-color: rgba(227, 199, 125, 0.5);
  color: var(--accent);
}

#more.on {
  border-color: rgba(227, 199, 125, 0.5);
  color: var(--accent);
}

.adv {
  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(227, 199, 125, 0.45);
}

.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;
}

/* Portfolio and LP-wallet tables are wider than a laptop card: they scroll sideways, so their header cannot stick. */
.table-scroll:has(> #pf-table),
.table-scroll:has(> #wallet-table) {
  overflow-x: auto;
}

.table-scroll:has(> #pf-table) th,
.table-scroll:has(> #wallet-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: #141920;
  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.zone td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.grid tbody tr.zone td {
  background: rgba(227, 199, 125, 0.04);
}

.grid tbody tr.zone: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(63, 207, 142, 0.7);
  }
  100% {
    color: var(--fg);
    text-shadow: none;
  }
}

.c-star {
  width: 36px;
  padding-right: 0 !important;
  text-align: center !important;
}

.star {
  background: none;
  border: 0;
  padding: 2px;
  cursor: pointer;
  color: #414953;
  font-size: 16px;
  line-height: 1;
  transition: color 0.12s, transform 0.12s;
}

.star:hover {
  color: var(--fg2);
  transform: scale(1.15);
}

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

.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.new {
  color: #0d1a12;
  background: var(--up);
  border-color: var(--up);
}

.b.hook {
  color: var(--warn);
  border-color: rgba(242, 185, 91, 0.35);
}

.b.bell {
  color: var(--accent);
  border-color: rgba(227, 199, 125, 0.4);
  background: var(--accent-bg);
}

.b.sus {
  color: #ff8a7a;
  border-color: rgba(255, 138, 122, 0.45);
  background: rgba(255, 138, 122, 0.08);
  cursor: help;
}

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

.act.blk:hover,
.btn.blk:hover {
  color: #ff8a7a;
  border-color: rgba(255, 138, 122, 0.45);
}

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

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

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

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

.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;
}

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

.lqs rect.bid,
.lchart rect.bid {
  fill: rgba(63, 207, 142, 0.62);
}

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

.lqs line.floor {
  stroke: #262d36;
  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);
}

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

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 5, 8, 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: #10141a;
  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: #10141a;
}

.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: #3a424d;
}

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

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

.chart line {
  stroke: #2a313a;
  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(63, 207, 142, 0.1);
}

.lchart rect.band.ask {
  fill: rgba(240, 113, 113, 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, 25, 32, 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: #2a313a;
  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(227, 199, 125, 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: #141920;
  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;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 70;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 10px;
  background: #1f262e;
  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);
}

.pf-top {
  display: grid;
  gap: 12px;
}

.pf-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pf-connect {
  position: relative;
}

.pf-connect svg {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

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

.pf-menu p {
  margin: 2px 4px 6px;
}

.pf-menu button,
.pf-menu .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;
}

.pf-menu button:hover,
.pf-menu .pm-link:hover {
  border-color: var(--line2);
  background: var(--card3);
}

.pf-menu button span:nth-child(2),
.pf-menu .pm-link span:nth-child(2) {
  flex: 1;
}

.pf-menu .pm-h {
  margin: 6px 4px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pf-menu .pm-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--fg2);
}

.pf-menu 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);
}

.pf-add {
  flex: 1 1 420px;
  display: flex;
  gap: 8px;
}

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

#pf-label {
  flex: 0 1 140px;
}

.pf-wallets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.wchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 6px 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--card);
  font-size: 12.5px;
}

.wchip.own {
  border-color: rgba(227, 199, 125, 0.4);
}

.wchip .act {
  width: 24px;
  height: 24px;
}

.wchip .act.tag {
  width: auto;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line2);
  font-size: 11px;
  font-weight: 600;
}

.wchip.own .act.tag {
  color: var(--accent);
  border-color: rgba(227, 199, 125, 0.4);
}

.b.st-in,
.b.mine {
  color: var(--up);
  border-color: rgba(63, 207, 142, 0.4);
  background: var(--up-bg);
}

.b.st-out {
  color: var(--down);
  border-color: rgba(240, 113, 113, 0.4);
  background: var(--down-bg);
}

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

#pf-rows td.left {
  white-space: normal;
}

.pf-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.pf-who b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(143, 160, 255, 0.45);
  background: rgba(143, 160, 255, 0.14);
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-who b.own {
  border-color: rgba(227, 199, 125, 0.5);
  background: var(--accent-bg);
}

.pf-who b i {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--eth);
}

.pf-who b.own i {
  color: var(--accent);
}

#pf-rows td.left .b,
#pf-rows td.left > .in,
#pf-rows td.left > .out,
#pf-rows td.left > .sub {
  white-space: nowrap;
}

#pf-rows tr.pf-out td:first-child {
  box-shadow: inset 3px 0 0 var(--down);
}

.act[data-act="track"] {
  font-size: 15px;
  font-weight: 600;
}

/* ---------- personal alerts ---------- */

.ua {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  align-items: start;
  gap: 14px;
  margin-bottom: 26px;
}

.ua-col {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.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;
  }
}

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

.pgroup:first-of-type {
  border-top: 0;
  padding-top: 2px;
}

.pg-h {
  margin-bottom: 10px;
}

.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);
}

.prow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
}

.pg-h + .prow {
  margin-top: 0;
}

.prow + .pgrid {
  margin-top: 12px;
}

.pgroup .est {
  margin: 12px 0 0;
  line-height: 1.55;
}

.pgroup .est b {
  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);
}

.chip-tgl {
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line2);
}

.my-alerts {
  display: grid;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
}

.ma {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
}

.ma-h {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.ma pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--fg2);
}

.sec-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 15px;
}

/* ---------- responsive ---------- */

@media (max-width: 1320px) {
  .c-age {
    display: none;
  }
}

@media (max-width: 1180px) {
  .c-vol,
  .c-swaps {
    display: none;
  }
  .adv {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .c-yield,
  .c-trend {
    display: none;
  }
  .d-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ua {
    grid-template-columns: 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;
  }
  .kpi .v {
    font-size: 21px;
  }
  .adv {
    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,
  .c-star {
    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;
  }
  .pf-add {
    flex-wrap: wrap;
  }
  #pf-label {
    flex: 1 1 100px;
  }
  .pf-menu {
    width: min(320px, calc(100vw - 28px));
  }
}

/* ---------- one-off wallet view ---------- */

.pf-peek {
  margin-top: 14px;
  padding: 12px 14px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(227, 199, 125, 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;
}

.pf-who b.pk {
  border-color: var(--line2);
  background: var(--card3);
}

.pf-who b.pk i {
  color: var(--accent);
}

.table-scroll:has(> #pf-peek-table) {
  overflow-x: auto;
}

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

#pf-peek-rows td.left {
  white-space: normal;
}

#pf-peek-rows td.left .b,
#pf-peek-rows td.left > .in,
#pf-peek-rows td.left > .out,
#pf-peek-rows td.left > .sub {
  white-space: nowrap;
}

#pf-peek-rows tr.pf-out td:first-child {
  box-shadow: inset 3px 0 0 var(--down);
}
