/*
 * Metscan — single stylesheet.
 * Visual language taken from the Meteora app: night-blue surfaces without
 * borders, three text roles, Inter at 400/500/600, orange used as a tint.
 * Scale: spacing on a 4px grid, type 11/12/13/14/16/18/28, radii 4/8/12.
 */

/* Inter by Rasmus Andersson (rsms.me/inter), SIL Open Font License 1.1, served
   from here so no visitor's address reaches a font CDN */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/InterVariable.woff2') format('woff2');
}

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;

  /* Meteora's steps, measured on its pool page: night page and gutters, panels
     two steps lighter, header rows sunk one step below the panel */
  --bg: #0d0d13;
  --inset: #12121c;
  --surface: #181825;
  --raised: #202031;
  --raised-2: #29293c;
  --raised-3: #34344a;
  --line: rgba(249, 249, 251, .06);
  --line-2: rgba(249, 249, 251, .1);

  --text: #f9f9fb;
  --text-2: #a0a0bb;
  --muted: #8787a6; /* 12px meta keeps 4.6:1 even on an input */

  --accent: #f54b00;
  --accent-text: #f76727;
  --accent-tint: rgba(245, 75, 0, .16);
  --accent-tint-2: rgba(245, 75, 0, .26);
  --violet: #9e83ff;

  --up: #24c98d;
  --up-tint: rgba(36, 201, 141, .12);
  --down: #f04438;
  --down-tint: rgba(240, 68, 56, .12);
  --warn: #f79009;
  --warn-tint: rgba(247, 144, 9, .1);

  /* names read by the scripts */
  --panel: var(--surface);
  --c-tvl: var(--up);
  --c-vol: #46465f;
  --bin-x: #f76727;
  --bin-y: #9e83ff;
  --shadow: 0 12px 32px rgba(0, 0, 0, .4);

  --radius-s: 4px;
  --radius: 8px;
  --radius-l: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: Inter, 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, monospace;
  --appbar-h: 56px;
  --statusbar-h: 32px;
}

/* Light theme: same roles, daylight values. Text colors keep 4.5:1 on white;
   the accent darkens for text, the charts' two token colors deepen. */
:root[data-theme="light"] {
  color-scheme: light;

  /* white panels on a grey page; controls one step darker than the page, so a
     field or a button still reads on the page as well as in a panel */
  --bg: #eef0f4;
  --inset: #f5f6f9;
  --surface: #ffffff;
  --raised: #e5e8ee;
  --raised-2: #dbdfe7;
  --raised-3: #c9ced9;
  --line: rgba(17, 17, 39, .08);
  --line-2: rgba(17, 17, 39, .14);

  --text: #15151f;
  --text-2: #50506a;
  --muted: #676782;

  --accent-text: #c2410c;
  --accent-tint: rgba(245, 75, 0, .1);
  --accent-tint-2: rgba(245, 75, 0, .18);
  --violet: #6d4fe0;

  --up: #0f9a6a;
  --up-tint: rgba(15, 154, 106, .1);
  --down: #d92d20;
  --down-tint: rgba(217, 45, 32, .08);
  --warn: #b54708;
  --warn-tint: rgba(181, 71, 8, .08);

  --c-vol: #c3c7d3;
  --bin-x: #ea580c;
  --bin-y: #7c5cff;
  --shadow: 0 12px 32px rgba(17, 17, 39, .12);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
/* an author `display` rule beats the UA stylesheet, so [hidden] needs to win back */
[hidden] { display: none !important; }

html { scrollbar-color: var(--raised-3) var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--statusbar-h) + 32px);
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 500; }
b, strong { font-weight: 500; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 12px; }
button, input, select, summary { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button { background: none; border: 0; padding: 0; transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease); }
button:disabled { opacity: .4; cursor: default; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: var(--radius-s); }
input:focus-visible, select:focus-visible { outline: none; }

input, select {
  height: 36px;
  min-width: 0;
  padding: 0 12px;
  background: var(--raised);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
input::placeholder { color: var(--muted); }
/* background-color only: the shorthand would drop the select's chevron on hover */
input:hover, select:hover { background-color: var(--raised-2); }
input:focus, select:focus { outline: none; border-color: var(--accent-text); background-color: var(--raised); }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; padding: 0; }
select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239595b2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
select option { background: var(--raised); color: var(--text); }

.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
  position: fixed; top: -48px; left: 16px; z-index: 100;
  padding: 8px 16px; border-radius: var(--radius);
  background: var(--text); color: var(--bg); font-weight: 500;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px;
  background: var(--accent-tint); color: var(--accent-text);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-tint-2); }
.btn-primary:active { transform: scale(.98); }

.lbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 32px; padding: 0 12px;
  background: var(--raised); color: var(--text);
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.lbtn:hover { background: var(--raised-2); text-decoration: none; }
.lbtn:active { transform: scale(.98); }
.lbtn svg { width: 12px; height: 12px; }
.lbtn .icon { width: 16px; height: 16px; }
.lbtn-padre { background: var(--accent-tint); color: var(--accent-text); }
.lbtn-padre:hover { background: var(--accent-tint-2); }
.lbtn.danger:hover { color: var(--down); }

.icon-button {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: var(--radius);
  color: var(--text-2);
}
.icon-button:hover { background: var(--raised); color: var(--text); }

.reset-button { height: 36px; padding: 0 4px; color: var(--muted); font-size: 13px; }
.reset-button:hover { color: var(--text); }

.linklike { color: var(--accent-text); font-size: 13px; font-weight: 500; text-align: left; }
.linklike:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- app bar */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 32px;
  height: var(--appbar-h); padding: 0 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 20px; height: 20px; fill: var(--accent); }
/* the wordmark is set lowercase, tight like a display line */
.brand-name { font-size: 18px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }

.tabs { display: flex; align-items: center; gap: 4px; min-width: 0; }
.tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  border-radius: var(--radius);
  color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.tab:hover { color: var(--text-2); text-decoration: none; }
.tab.on { color: var(--text); }
.tabbadge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px;
  background: var(--accent-tint); color: var(--accent-text);
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.appbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* the sun switches to light, the moon back to dark */
.theme-dark { display: none; }
:root[data-theme="light"] .theme-light { display: none; }
:root[data-theme="light"] .theme-dark { display: block; }
.appbar .btn-primary { height: 32px; padding: 0 12px; }

/* ---------------------------------------------------------------- workspace */
.workspace { max-width: 1600px; margin: 0 auto; padding: 32px 32px 0; }
.workspace:focus { outline: none; }

.page-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
  margin-bottom: 24px;
}
.page-title-block { min-width: 0; }
.page-heading h1 { font-size: 28px; line-height: 36px; letter-spacing: -.02em; }
.page-heading p { margin-top: 4px; color: var(--text-2); }

/* market stats sit inline in the heading, as on Meteora — no cards around them */
.kpis { display: flex; gap: 32px; margin: 0; }
.kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi dd { margin: 0; }
.kpi-label { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.kpi-value { font-size: 18px; line-height: 24px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-sub { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; line-height: 16px; }
.kpi-sub:empty { display: none; }
.kpi-sub a { color: var(--text-2); }
.kpi-sub a:hover { color: var(--text); }

/* ---------------------------------------------------------------- controls */
.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.search { position: relative; flex: 0 1 360px; min-width: 200px; }
.search input { width: 100%; padding-left: 36px; padding-right: 36px; }
.search-ic {
  position: absolute; left: 12px; top: 10px; width: 16px; height: 16px;
  fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; pointer-events: none;
}
.search kbd {
  position: absolute; right: 8px; top: 8px;
  display: grid; place-items: center; width: 20px; height: 20px;
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  color: var(--muted); font-family: var(--mono); font-size: 11px;
}

.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; width: 32px; height: 20px; border-radius: 10px; background: var(--raised-2); transition: background-color .15s var(--ease); }
.toggle-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .15s var(--ease), background-color .15s var(--ease); }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(12px); background: #fff; }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.density-control { margin-left: auto; }


.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30;
  overflow: hidden;
  background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.search-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.search-item:last-child { border-bottom: 0; }
.search-item:hover, .search-item.active { background: var(--raised-2); }
.si-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.si-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.si-name .coin-logo { width: 20px; height: 20px; flex-basis: 20px; font-size: 9px; border-color: var(--raised); }
.si-name .coin-pair .coin-logo + .coin-logo { margin-left: -6px; }
.si-badges { display: flex; align-items: center; gap: 4px; }
.si-addr { margin-left: 4px; color: var(--muted); }
.si-meta { flex: none; text-align: right; color: var(--text-2); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }
.si-meta b { color: var(--text); }
.si-tag { padding: 2px 8px; border-radius: 9px; background: var(--raised-2); color: var(--text-2); font-size: 11px; font-weight: 500; }
.si-tag.pinned { background: var(--accent-tint); color: var(--accent-text); }
.search-empty { display: flex; align-items: center; gap: 8px; padding: 16px; color: var(--muted); font-size: 13px; }
.spinner { width: 12px; height: 12px; flex: none; border: 2px solid var(--raised-3); border-top-color: var(--accent-text); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- table card */
.tablewrap { background: var(--surface); border-radius: var(--radius-l); }

.table-heading {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 16px 20px;
}
.table-note { color: var(--text-2); font-size: 13px; max-width: 720px; }
.metric-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.metric-switch { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.metric-switch select { height: 32px; font-size: 13px; }
.unit-switch select { min-width: 64px; }

/* segmented control, as on Meteora's pool type switch */
.filter-presets, .ranges {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px; border-radius: 10px; background: var(--inset);
}
.filter-chip, .rangebtn {
  height: 28px; padding: 0 12px;
  border-radius: 6px;
  color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.filter-chip:hover, .rangebtn:hover { color: var(--text); }
.filter-chip.on, .rangebtn.on { background: var(--raised-2); color: var(--text); }

.pool-filter-panel { padding: 0 20px 16px; }
#pool-tvl-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
#pool-tvl-filters label { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 12px; line-height: 16px; }
#pool-tvl-filters input, #pool-tvl-filters select { width: 100%; }
#token-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; align-items: end; gap: 12px; }
#token-filters > label:not(.toggle) { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 12px; line-height: 16px; }
#token-filters input[type=number], #token-filters select { width: 100%; }
#token-filters .toggle { height: 36px; }

/* hiding a token from the list: on the row's hover, always on touch screens */
.hide-tok { margin-left: auto; opacity: 0; transition: opacity .15s var(--ease); }
tr:hover .hide-tok, .hide-tok:focus-visible, .hide-tok.shown { opacity: 1; }
@media (hover: none) { .hide-tok { opacity: .7; } }
.textbtn { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.textbtn:hover { color: var(--text); }

/* liquidity against market cap: the share, then a bar split by side */
.liqcell { min-width: 112px; line-height: 20px; }
.liqbar { display: flex; height: 4px; margin-top: 4px; border-radius: 2px; overflow: hidden; background: var(--raised-2); }
.liqbar .paired { background: var(--bin-y); }
.liqbar .own { flex: 1; background: var(--bin-x); }

.table-context {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; line-height: 16px;
}
.table-context-end { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }

/* history coverage: one quiet line, only the windows still filling up */
.history-status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.history-status:empty { display: none; }
.hs-label { color: var(--muted); }
.hs-item { color: var(--text-2); white-space: nowrap; }
.hs-item b { color: var(--text); }

.metric-help { position: relative; }
.metric-help summary { list-style: none; color: var(--text-2); }
.metric-help summary::-webkit-details-marker { display: none; }
.metric-help summary:hover { color: var(--text); }
.metric-help p {
  position: absolute; right: 0; top: 24px; z-index: 15;
  width: 320px; max-width: 80vw; padding: 12px 16px;
  background: var(--raised-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text-2); font-size: 13px; line-height: 20px;
}

.table-scroll { overflow: auto; max-height: calc(100vh - 220px); min-height: 360px; border-top: 1px solid var(--line); scrollbar-width: thin; }
.table-scroll:focus-visible { outline-offset: -2px; }

table { width: 100%; border-collapse: collapse; }
.tablewrap table { min-width: 880px; }
/* the header row sits one step below its panel, as on Meteora */
thead th {
  position: sticky; top: 0; z-index: 2;
  padding: 12px 16px;
  background: var(--inset);
  color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 500;
  text-align: left; white-space: nowrap;
}
thead th b { color: var(--text-2); font-weight: 500; }
th.num, td.num { text-align: right; }
th.sortable, .multisort .sortable { cursor: pointer; }
th.sortable:hover, .multisort .sortable:hover { color: var(--text-2); }
th.sortable.active, .multisort .sortable.active { color: var(--text); }
th.sortable.active b { color: var(--text); }
th.sortable.active::after, .multisort .sortable.active::after { content: ' ↓'; color: var(--accent-text); }
th.sortable.active.asc::after, .multisort .sortable.active.asc::after { content: ' ↑'; }
.multisort .sortable + .sortable { margin-left: 8px; }

tbody tr { border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .15s var(--ease); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--raised); }
tbody td { padding: 12px 16px; vertical-align: middle; font-variant-numeric: tabular-nums; }
body[data-density=compact] tbody td { padding-top: 8px; padding-bottom: 8px; }
tr.placeholder, tr.placeholder:hover { cursor: default; background: none; }
tr.placeholder td { padding: 32px 16px; color: var(--muted); text-align: center; }

/* pool cell: pair logos, name, then one line of meta — Meteora's row anatomy */
.poolcell { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.poolname { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 500; }
.pool-title { color: var(--text); font-weight: 500; text-align: left; }
.pool-title:hover { color: var(--accent-text); text-decoration: none; }
.poolmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 16px; }
.poolmeta a { color: var(--muted); }
.poolmeta a:hover { color: var(--text-2); }
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 10px; background: var(--raised-2); color: var(--text-2);
  font-size: 11px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.badge.new { background: var(--accent-tint); color: var(--accent-text); margin-left: 8px; }
.tc-verif { color: var(--up); font-size: 12px; font-weight: 600; }

.pin { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 6px; color: var(--muted); }
.pin:hover { color: var(--text-2); background: var(--raised-2); }
.pin.on { color: var(--accent-text); }
.pin svg { width: 16px; height: 16px; }

.coin-pair { display: inline-flex; flex: none; }
.coin-pair .coin-logo + .coin-logo { margin-left: -8px; }
.coin-logo {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px;
  width: 28px; height: 28px; overflow: hidden;
  border-radius: 50%; border: 2px solid var(--surface);
  background: var(--raised-3); color: var(--text-2);
  font-size: 11px; font-weight: 600; vertical-align: middle;
}
.coin-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; background: var(--raised-2); }
.coin-logo.has-logo img { opacity: 1; }
.coin-logo.has-logo > span { visibility: hidden; }
tbody tr:hover .coin-logo { border-color: var(--raised); }
body[data-density=compact] .coin-logo { width: 24px; height: 24px; flex-basis: 24px; }

.tvlcell { line-height: 20px; }
.tvlmain { font-weight: 500; }
.delta { font-size: 12px; line-height: 16px; font-weight: 500; }
.delta.up, .up { color: var(--up); }
.delta.down, .down { color: var(--down); }
.delta.flat { color: var(--muted); font-weight: 400; }

.ratiocell { min-width: 96px; line-height: 20px; }
.ratiocell .delta { font-size: 14px; line-height: 20px; }
.ratiocell[title] { cursor: help; }
.ratioval { font-weight: 500; }
.ratioval.na, .na { color: var(--muted); font-weight: 400; }
.ratiovol { display: inline-block; color: var(--muted); font-size: 12px; line-height: 16px; }
.history-reason { color: var(--muted); font-size: 12px; line-height: 16px; white-space: nowrap; }
.meter { height: 3px; margin-top: 4px; border-radius: 2px; background: var(--raised-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--text-2); }
.meter i.up { background: var(--up); }
.meter i.down { background: var(--down); }
.splitbar { display: flex; gap: 2px; height: 3px; margin-top: 4px; margin-left: auto; max-width: 96px; border-radius: 2px; overflow: hidden; }
.splitbar i { display: block; height: 100%; }
.splitbar i:first-child { background: var(--text-2); }
.splitbar i:last-child { background: var(--raised-3); }

.col-spark { width: 120px; }
.spark svg { display: block; width: 96px; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; }
.empty-state strong { color: var(--text); font-size: 16px; line-height: 24px; }
.empty-state p { max-width: 420px; color: var(--text-2); }
.empty-state .lbtn { margin-top: 8px; }

.table-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums;
}
.table-pagination > div { display: flex; align-items: center; gap: 12px; }
.table-pagination .lbtn { width: 32px; padding: 0; }
#pool-page-number { min-width: 40px; text-align: center; color: var(--text-2); }

/* ---------------------------------------------------------------- shared bits */
.copybtn { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.copybtn:hover { color: var(--text); background: var(--raised-2); }
.copybtn.copied { color: var(--up); }

.detail-tip {
  position: fixed; z-index: 50; pointer-events: none;
  padding: 8px 12px;
  background: var(--raised-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text); font-size: 12px; line-height: 16px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.detail-tip .t { color: var(--text-2); }
@media (max-width: 520px) { .detail-tip { max-width: calc(100vw - 16px); white-space: normal; } }

/* ---------------------------------------------------------------- panels (flows, alerts) */
.panel { padding: 20px 24px; background: var(--surface); border-radius: var(--radius-l); }
.panel-head { margin-bottom: 16px; }
.panel-head h2 { font-size: 16px; line-height: 24px; }
.panel-head p, .panel-lead { margin-top: 4px; max-width: 760px; color: var(--text-2); font-size: 13px; }
.panel-lead { margin: 0 0 16px; }
.panel-head p b, .panel-lead b { color: var(--text); }

/* ---------------------------------------------------------------- flows */
#flowswrap { display: flex; flex-direction: column; gap: 16px; }
.flowbar { display: flex; flex-wrap: wrap; gap: 12px; }
.flowfilters { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.flabel { color: var(--muted); font-size: 12px; font-weight: 500; }
.flowfilters .inline { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.flowfilters input[type=number] { width: 104px; height: 32px; font-size: 13px; }
.fsep { width: 1px; height: 20px; background: var(--line-2); }
.chk { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; cursor: pointer; user-select: none; }
.fcount { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#flowswrap > .tablewrap { overflow: auto; max-height: calc(100vh - 220px); }
#flowswrap .poolname { display: flex; }
#flowtable tbody tr { cursor: pointer; }
.flowcell { min-width: 140px; }
.flowval { font-weight: 500; }
.flowval.up { color: var(--up); }
.flowval.down { color: var(--down); }
.pricemove { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- alerts */
#alertswrap { display: flex; flex-direction: column; gap: 16px; }
.request-notice { padding: 12px 16px; border-radius: var(--radius); background: var(--warn-tint); color: var(--warn); font-size: 13px; }

.cardlist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cardlist .empty { padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--text-2); font-size: 13px; }
.card {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px;
  padding: 12px 16px; background: var(--raised); border-radius: var(--radius);
}
.card.off { opacity: .5; }
.card.event { background: none; border: 1px solid var(--line); }
.card-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.card-sub { color: var(--text-2); font-size: 12px; line-height: 16px; }
.card-sub code { color: var(--muted); word-break: break-all; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kindtag, .chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 10px; background: var(--raised-2); color: var(--text-2);
  font-size: 11px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chip { font-size: 12px; }
.chip.good { background: var(--up-tint); color: var(--up); }
.chip.bad { background: var(--down-tint); color: var(--down); }

.formrow { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-field { display: flex; flex-direction: column; gap: 8px; flex: 1 1 180px; min-width: 0; color: var(--muted); font-size: 12px; line-height: 16px; }
.form-field:has(> [hidden]) { display: none; }
.form-field input, .form-field select { width: 100%; }
.paired-inputs { display: flex; gap: 8px; }
.paired-inputs input { width: 50%; }
#channelform .form-field:has(#ch-kind) { flex: 0 1 160px; }
#channelform .form-field:has(#ch-url) { flex-grow: 2; }
#ruleform { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 12px; }
.preset-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 16px; }
.preset-row .hint { margin-top: 0; }
#ruleform button { align-self: end; }
.hint { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 16px; }
.hint.ok { color: var(--up); }
.hint.bad { color: var(--down); }


/* ---------------------------------------------------------------- pages (pool, token, wallet) */
/* Meteora's pool page anatomy: pair header with its actions, one strip of key
   figures, the price chart leading a main column, details stacked on the side. */
.page { padding-bottom: 24px; }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs kbd {
  margin-left: auto; padding: 0 6px; height: 20px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  color: var(--muted); font-family: var(--mono); font-size: 11px;
}

.ph { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 24px; }
.ph-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ph-title { min-width: 0; }
/* what the page is about, as Etherscan labels "Address" or "Token" */
.ph-kind { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 16px; }
.ph-addr { word-break: break-all; }
.ph-addr .addr-short { display: none; }
.ph-title h1 { font-size: 28px; line-height: 36px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.ph-title h1 .muted { margin-left: 8px; color: var(--text-2); font-size: 16px; letter-spacing: 0; }
.ph-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 20px; }
.ph-meta code { color: var(--text-2); overflow-wrap: anywhere; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-actions .lbtn > svg, .btn-primary > svg { width: 14px; height: 14px; }
.lbtn.on { color: var(--accent-text); }
.badge.warn { background: var(--warn-tint); color: var(--warn); }
.badge.good { background: var(--up-tint); color: var(--up); }

.coin-logo.lg { width: 40px; height: 40px; flex-basis: 40px; font-size: 13px; border-color: var(--bg); }
.coin-logo.xl { width: 48px; height: 48px; flex-basis: 48px; font-size: 15px; border-color: var(--bg); }
.coin-pair.lg .coin-logo + .coin-logo { margin-left: -12px; }
.wallet-mark {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--raised-2); color: var(--text-2); font-family: var(--mono); font-size: 14px;
}

/* figures split by 2px of night, the way Meteora splits its side panel; each
   row fills the width whatever the number of figures, so no cell is ever missing */
.page-stats {
  display: flex; flex-wrap: wrap; gap: 2px;
  margin: 0 0 16px; background: var(--bg); border-radius: var(--radius-l); overflow: hidden;
}
.page-stats:empty { display: none; }
.pstat { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; min-width: 0; padding: 16px 20px; background: var(--surface); }
.pstat dt { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 500; }
.pstat dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstat-value { font-size: 20px; line-height: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pstat-sub { color: var(--muted); font-size: 12px; line-height: 16px; }

.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 384px; align-items: start; gap: 16px; }
.pg-main, .pg-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pcard { min-width: 0; padding: 20px; background: var(--surface); border-radius: var(--radius-l); }
.pcard-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 16px; }
.pcard-head h2 { font-size: 16px; line-height: 24px; }
.pcard-head > .pcard-sub { color: var(--muted); font-size: 12px; line-height: 24px; }
.pcard-head p.pcard-sub { margin-top: 4px; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.pcard-head p.pcard-sub b { color: var(--text); font-size: 16px; }
.pcard-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pcard-text { margin-bottom: 16px; color: var(--text-2); font-size: 13px; }
.chart-host { min-width: 0; }
.chart-host svg { display: block; max-width: 100%; height: auto; }
/* the price chart moves: a drag goes back in time, the wheel or a pinch
   zooms; a vertical swipe still scrolls the page on a phone */
.candle-wrap { position: relative; }
.candle-host { cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; border-radius: var(--radius-s); }
.candle-host.dragging { cursor: grabbing; }
.candle-host:focus-visible { outline-offset: 4px; }
.chart-reset { position: absolute; top: 2px; left: 12px; height: 28px; padding: 0 10px; font-size: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }

.pcard-tabs { display: flex; gap: 24px; margin: -4px 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.pcard-tabs::-webkit-scrollbar { display: none; }
.ctab { position: relative; flex: none; height: 40px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.ctab:hover { color: var(--text-2); }
.ctab.on { color: var(--text); }
.ctab.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 1px; background: var(--accent); }
.ctab .count { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ctab .count:empty { display: none; }
.tab-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 16px; }
.tab-lead { margin-bottom: 16px; color: var(--text-2); font-size: 13px; }

.loading-block { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--inset); color: var(--muted); font-size: 13px; text-align: center; }
.error-block { min-height: 96px; color: var(--text-2); }
.note { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 18px; }
.note.warn { color: var(--warn); }
.empty-line { padding: 24px 0; color: var(--text-2); font-size: 13px; text-align: center; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.warn-text { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* tables inside a card: same rows as the lists, a little tighter; the header
   band and the row hover run from edge to edge of the card */
.table-scroll.inner { max-height: 560px; min-height: 0; margin: 0 -20px; padding: 0; border-top: 0; }
.ptable { min-width: 640px; }
.ptable thead th { padding: 8px 12px; }
.ptable tbody td { padding: 10px 12px; font-size: 13px; }
/* a figure never breaks after its sign, a pair never at its hyphen */
.ptable td.num, .ptable td > a[href^="/pool/"] { white-space: nowrap; }
.ptable th:first-child, .ptable td:first-child { padding-left: 20px; }
.ptable th:last-child, .ptable td:last-child { padding-right: 20px; }
/* names in a table read as names: white, the accent only on hover */
td > a:not([class]), .poolname > a:not([class]), .poslist li > a:not([class]) { color: var(--text); font-weight: 500; }
td > a:not([class]):hover, .poolname > a:not([class]):hover, .poslist li > a:not([class]):hover { color: var(--accent-text); text-decoration: none; }
.ptable tbody tr { cursor: default; }
.ptable tbody tr.link-row { cursor: pointer; }
.ptable small { color: var(--muted); font-size: 11px; }
.ptable .meter { max-width: 96px; margin-left: auto; }
.addr-link { color: var(--text-2); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.addr-link:hover { color: var(--accent-text); text-decoration: none; }
.lbtn.more { margin-top: 12px; }
/* an LP's range shown on the pool charts: what it is, and a way out */
.focus-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: -4px 0 12px; padding: 8px 8px 8px 12px; border-radius: var(--radius); background: var(--inset); color: var(--text-2); font-size: 13px; line-height: 20px; }
.focus-bar b { color: var(--text); }
.focus-swatch { width: 16px; height: 10px; flex: none; border-block: 1.5px solid var(--violet); background: color-mix(in srgb, var(--violet) 14%, transparent); }
.focus-text { flex: 1 1 220px; min-width: 0; }
.lp-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.lp-filter .search { flex: 1 1 320px; max-width: 520px; }
.lp-filter-error { color: var(--down); font-size: 13px; }
.lp-filter-error:empty { display: none; }
/* the side card while one wallet is shown, laid out like Meteora's own */
.pos-range { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 18px; line-height: 28px; font-variant-numeric: tabular-nums; }
.pos-range b { font-weight: 500; }
.pos-sub { margin: 2px 0 16px; color: var(--muted); font-size: 12px; }
.pos-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.pos-figs dt { color: var(--muted); font-size: 12px; line-height: 16px; }
.pos-figs dd { margin: 4px 0 0; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pos-figs small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.range-link { color: inherit; }
.range-link:hover { color: var(--accent-text); text-decoration: none; }
/* the trapped-LP tab: three figures above the table, inside the card */
.trapped-stats { margin: 0 0 16px; }
.trapped-stats .pstat { background: var(--inset); }

.lp-summary { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-bottom: 16px; }
.lp-summary div { display: flex; flex-direction: column; gap: 4px; }
.lp-summary span { color: var(--muted); font-size: 12px; line-height: 16px; }
.lp-summary b { font-size: 16px; line-height: 24px; font-variant-numeric: tabular-nums; }
.lp-kind { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; background: var(--raised-2); color: var(--text-2); font-size: 11px; font-weight: 500; white-space: nowrap; }
.lp-kind.add { background: var(--up-tint); color: var(--up); }
.lp-kind.remove { background: var(--down-tint); color: var(--down); }
.range-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--raised-3); vertical-align: 1px; }
.range-dot.in { background: var(--up); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 16px; color: var(--text-2); font-size: 12px; }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px; }
.legend .muted { margin-left: auto; }
.chart-legend { margin-bottom: 0; }

/* small figure tables on the side: no row hover, no sticky header */
.depth, .flowlist { width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.depth thead th, .flowlist thead th { position: static; padding: 0 0 8px; background: none; font-size: 12px; }
.depth tbody tr, .flowlist tbody tr { cursor: default; }
.depth tbody tr:hover, .flowlist tbody tr:hover { background: none; }
.depth tbody td, .flowlist tbody td { padding: 8px 0; }
.depth td + td, .flowlist td + td, .depth th + th, .flowlist th + th { padding-left: 12px; }
.depth small { display: block; color: var(--muted); font-size: 11px; line-height: 16px; }
.dmeter { position: relative; height: 3px; margin-top: 4px; border-radius: 2px; background: var(--raised-2); }
.dmeter i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.dmeter i.up { left: 50%; background: var(--up); }
.dmeter i.down { right: 50%; background: var(--down); }

.kv { display: flex; flex-direction: column; margin: 0; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row dt { display: flex; align-items: center; gap: 8px; flex: none; color: var(--text-2); }
.kv-row dd { margin: 0; min-width: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kv-row[title] dt { cursor: help; text-decoration: underline dotted var(--line-2); text-underline-offset: 3px; }
.check { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--raised-3); }
.check.ok { background: var(--up); }
.check.warn { background: var(--warn); }

.tok + .tok { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.tok-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tok-head > div { display: flex; flex-direction: column; min-width: 0; }
.tok-head b { font-size: 14px; }
.tok-head .muted { font-size: 12px; line-height: 16px; }
.tok-side { margin-left: auto; font-size: 11px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.chip.warn { background: var(--warn-tint); color: var(--warn); }
.tok-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.follow-form { display: flex; flex-direction: column; gap: 12px; }
.follow-form .lbtn { align-self: flex-start; }
.poslist { margin: 0; padding: 0; list-style: none; }
.poslist li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.poslist li:last-child { border-bottom: 0; }
.poslist li .muted { margin-left: auto; font-size: 12px; }

#walletswrap { display: flex; flex-direction: column; gap: 16px; }
#walletswrap .card-title a { color: var(--text); }
#walletswrap .card-title a:hover { color: var(--accent-text); text-decoration: none; }

/* ---------------------------------------------------------------- search & home */
/* the header box; Home has its own, bigger one */
.header-search { flex: 1 1 320px; max-width: 420px; min-width: 180px; }
.header-search input { height: 34px; }
.header-search kbd { top: 7px; }
.si-type {
  flex: none; padding: 1px 6px; border-radius: var(--radius-s);
  background: var(--raised-2); color: var(--text-2);
  font-size: 11px; font-weight: 500; line-height: 16px;
}
.si-type.t-pool { background: var(--accent-tint); color: var(--accent-text); }
.si-type.t-token { background: var(--up-tint); color: var(--up); }
.si-sub { color: var(--muted); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-ext { flex: none; color: var(--muted); }

.home-hero { max-width: 760px; margin: 24px auto 32px; text-align: center; }
.home-hero h1 { font-size: 32px; line-height: 40px; letter-spacing: -.02em; }
.home-hero > p { margin-top: 8px; color: var(--text-2); font-size: 15px; }
.hero-search { max-width: none; margin-top: 24px; text-align: left; }
.hero-search input { height: 48px; padding-left: 44px; font-size: 15px; border-radius: var(--radius-l); background: var(--surface); border-color: var(--line-2); }
.hero-search .search-ic { left: 16px; top: 16px; }
.hero-search kbd { top: 14px; right: 12px; }
.hero-hint { margin-top: 12px; color: var(--muted); font-size: 12px; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pcard-more { color: var(--text-2); font-size: 13px; line-height: 24px; }
.pcard-more:hover { color: var(--accent-text); text-decoration: none; }
.home-flows { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.home-flows h3 { margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.flowlist-mini { margin: 0; padding: 0; list-style: none; }
.flowlist-mini li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.flowlist-mini li:last-child { border-bottom: 0; }
.flowlist-mini a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.flowlist-mini span { flex: none; font-variant-numeric: tabular-nums; }
.flowlist-mini small { margin-left: 8px; color: var(--muted); }
#homewrap tr[data-goto-pool] { cursor: pointer; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  max-width: 1600px; margin: 48px auto 0; padding: 24px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.footer-brand .brand-mark { width: 16px; height: 16px; }
.footer-brand b { color: var(--text); font-size: 13px; }
.footer-brand span::before { content: '·'; margin-right: 8px; color: var(--muted); }
.footer-note { margin-top: 8px; max-width: 720px; }

/* ---------------------------------------------------------------- status bar */
/* Meteora keeps RPC health in a bottom bar; Metscan keeps its collection pulse there */
.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  height: var(--statusbar-h); padding: 0 32px;
  background: var(--surface); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; line-height: 16px; white-space: nowrap;
}
.statusbox { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-2); font-variant-numeric: tabular-nums; }
.statusbox #statustext { overflow: hidden; text-overflow: ellipsis; }
.status-meta { font-variant-numeric: tabular-nums; }
.status-meta:empty { display: none; }
.status-source { margin-left: auto; }
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--up); }
.dot.err { background: var(--warn); }
/* the signature: one beat per collection round, never a loop */
.dot.beat { animation: beat .8s var(--ease); }
@keyframes beat {
  from { box-shadow: 0 0 0 0 rgba(36, 201, 141, .5); }
  to { box-shadow: 0 0 0 8px rgba(36, 201, 141, 0); }
}


/* ---------------------------------------------------------------- top LP traders */
.traders-view { display: flex; flex-direction: column; gap: 16px; }
.traders-view .page-stats { margin: 0; }
.tr-filter { flex: 0 1 220px; min-width: 160px; }
.tr-filter input { height: 32px; font-size: 13px; }
.tr-filter .search-ic { top: 8px; }
.tr-table td small { color: var(--muted); font-size: 11px; }
.tr-table .pin { margin-left: auto; }
/* the help reads as a paragraph under the table, not as a pop-over */
.tr-help { max-width: 860px; color: var(--text-2); font-size: 13px; }
.tr-help p { position: static; width: auto; max-width: 760px; margin-top: 8px; padding: 0; background: none; border: 0; box-shadow: none; }
.tr-help b { color: var(--text); }
.home-wide { grid-column: 1 / -1; }
.tx-main { display: flex; flex-direction: column; gap: 16px; }

/* ---------------------------------------------------------------- accounts */
/* header: Sign in, or the bell and the account menu */
.account-slot { display: flex; align-items: center; gap: 4px; min-height: 32px; }
.bell { position: relative; }
.bell-count {
  position: absolute; top: 2px; right: 0;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums;
}
.account-menu-wrap { position: relative; }
.account-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 8px 0 4px; border-radius: var(--radius);
  color: var(--text-2); font-size: 13px; font-weight: 500;
}
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--raised); color: var(--text); }
.avatar {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--raised-3); color: var(--text); font-size: 12px; font-weight: 600;
}
.account-email { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  display: flex; flex-direction: column; min-width: 240px; padding: 8px;
  background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--radius-l);
  box-shadow: var(--shadow);
}
.menu-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; padding: 4px 12px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 16px; }
.menu-head b { overflow: hidden; text-overflow: ellipsis; color: var(--text); font-size: 13px; line-height: 20px; }
.account-menu [role=menuitem] {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: var(--radius);
  color: var(--text); font-size: 13px; text-align: left;
}
.account-menu [role=menuitem]:hover, .account-menu [role=menuitem]:focus-visible { background: var(--raised-2); text-decoration: none; outline: none; }
.account-menu button[role=menuitem] { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); color: var(--text-2); }

/* a wallet's positions in one pool, from its open positions table */
dialog.pos-dialog {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius-l);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: hidden;
}
dialog.pos-dialog[open] { display: flex; flex-direction: column; }
dialog.pos-dialog::backdrop { background: rgba(5, 5, 10, .64); }
:root[data-theme="light"] dialog.pos-dialog::backdrop { background: rgba(17, 17, 39, .32); }
.pd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.pd-head .poolname { gap: 12px; }
.pd-head h2 { font-size: 18px; line-height: 28px; }
.pd-sub { color: var(--text-2); font-size: 13px; line-height: 20px; }
.pd-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 24px; overflow-y: auto; }
.pd-body > .page-stats { margin: 0; }
.pd-stats .pstat { flex-basis: 140px; padding: 12px 16px; }
.pd-stats .pstat-value { font-size: 16px; line-height: 24px; }
.pd-all h3 { margin-bottom: 8px; color: var(--text-2); font-size: 13px; line-height: 20px; font-weight: 500; }
.pd-pos { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-l); }
.pd-pos-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.pd-pos-head .badge { margin: 0; }
.pd-age { margin-left: auto; color: var(--muted); font-size: 12px; line-height: 16px; }
.pd-chart { min-height: 140px; }
.pd-chart .note { margin-top: 4px; }
.pd-kv { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; margin-top: 8px; }
.pd-body > .legend { margin: 0; }
.pd-body > .lbtn.more { margin-top: 0; align-self: flex-start; }
.pd-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 24px; border-top: 1px solid var(--line); font-size: 13px; }
.pd-foot .muted { font-size: 12px; }
@media (max-width: 640px) {
  dialog.pos-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .pd-head, .pd-body, .pd-foot { padding-left: 16px; padding-right: 16px; }
  .pd-kv { grid-template-columns: 1fr; }
  .pd-age { width: 100%; margin-left: 0; }
}

/* sign-in */
dialog.signin {
  width: min(420px, calc(100vw - 32px)); padding: 32px; border: 1px solid var(--line-2); border-radius: var(--radius-l);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
dialog.signin::backdrop { background: rgba(5, 5, 10, .64); }
:root[data-theme="light"] dialog.signin::backdrop { background: rgba(17, 17, 39, .32); }
.signin-close { position: absolute; top: 12px; right: 12px; }
.signin-step { display: flex; flex-direction: column; gap: 16px; }
.signin-step h2 { font-size: 18px; line-height: 28px; padding-right: 32px; }
.signin-why { margin-top: -8px; color: var(--text-2); font-size: 13px; }
.signin-why b { color: var(--text); overflow-wrap: anywhere; }
.signin-step .form-field { flex: none; }
.signin-step input[type=email] { height: 40px; }
/* only robots fill this one */
.signin-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.check-row { display: flex; align-items: flex-start; gap: 8px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.check-row input { flex: none; margin: 2px 0 0; }
.signin-error { color: var(--down); font-size: 13px; }
.btn-primary.wide { width: 100%; height: 40px; }
.signin-fine { color: var(--muted); font-size: 12px; line-height: 18px; }
.signin-dev { padding: 8px 12px; border-radius: var(--radius); background: var(--warn-tint); color: var(--warn); font-size: 12px; line-height: 18px; }
.code-input {
  height: 56px; text-align: center;
  font-family: var(--mono); font-size: 28px; letter-spacing: .4em; font-variant-numeric: tabular-nums;
}
.code-input::placeholder { color: var(--raised-3); }
.signin-links { display: flex; justify-content: space-between; gap: 16px; }
.signin-links .linklike:disabled { color: var(--muted); text-decoration: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--statusbar-h) + 16px); z-index: 90;
  max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px; transform: translateX(-50%);
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--raised-2); color: var(--text);
  box-shadow: var(--shadow); font-size: 13px;
}
.toast.bad { color: var(--down); }

/* a nickname reads as a name, not as an address */
.addr-link.tagged { color: var(--text); font-family: var(--font); font-size: 13px; font-weight: 500; }
.addr-link.tagged::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%;
  background: var(--violet); vertical-align: middle;
}
.ph-note { margin-top: 4px; max-width: 640px; color: var(--text-2); font-size: 13px; }

/* the name tag editor takes the place of the wallet's title */
.tag-editor { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; width: 100%; }
.tag-fields { display: flex; flex-direction: column; gap: 8px; flex: 1 1 320px; min-width: 0; max-width: 560px; }
.tag-fields input[name=label] { height: 44px; font-size: 20px; font-weight: 500; }
.watch-level { flex: none; margin-bottom: 4px; }
.linklike.danger-link { margin-top: 12px; color: var(--text-2); }
.linklike.danger-link:hover { color: var(--down); }

/* account pages */
.account-page { display: flex; flex-direction: column; gap: 16px; }
.watch-tabs { margin: 0; }
.watch-add { margin-bottom: 16px; padding-top: 0; border-top: 0; }
.watch-table td { vertical-align: middle; }
.watch-table select { height: 32px; font-size: 13px; }
.cell-sub { margin-top: 2px; color: var(--muted); font-size: 11px; }
.cell-sub code { font-size: 11px; }

.signed-out { display: grid; place-items: center; padding: 24px 0 8px; }
.so-card { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 520px; padding: 32px; border-radius: var(--radius-l); background: var(--surface); }
.so-card h2 { font-size: 20px; line-height: 28px; }
.so-card > p:not(.note) { color: var(--text-2); }
.so-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.so-list li { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.so-list svg { width: 16px; height: 16px; flex: none; color: var(--accent-text); }
.so-list svg.icon { fill: none; }
.so-card .note { margin-top: -8px; }

.tag-form { padding-top: 0; border-top: 0; }
.tag-form .grow { flex-grow: 2; }
.tag-filter { flex: 0 1 200px; min-width: 140px; }
.tag-filter input { height: 32px; font-size: 13px; }
.tag-filter .search-ic { top: 8px; }
.tag-name { color: var(--text); font-weight: 500; }
.tag-note { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.tag-table td .lbtn { height: 28px; padding: 0 10px; }

.note-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.note-list li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.note-list li:last-child { border-bottom: 0; }
.note-dot { width: 8px; height: 8px; border-radius: 50%; }
.note-list li.unread .note-dot { background: var(--accent); }
.note-title { font-size: 14px; }
.note-title a { color: var(--text); }
.note-list li:not(.unread) .note-title a { color: var(--text-2); }
.note-body { margin-top: 2px; color: var(--muted); font-size: 12px; }
.note-list time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.settings .kv { margin-bottom: 16px; }
.settings .note { max-width: 520px; }
.danger-zone .pcard-head h2 { color: var(--down); }
.danger-zone .formrow { padding-top: 0; border-top: 0; }
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px;
  border-radius: var(--radius); background: var(--down-tint); color: var(--down); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.btn-danger:hover { background: var(--down); color: #fff; }

.admin-stats { margin: 0; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bar { flex: 1 1 0; min-width: 2px; border-radius: 2px 2px 0 0; background: var(--accent); opacity: .85; }
.bar.zero { background: var(--raised-3); opacity: 1; }
.bar:hover { opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 11px; }

/* the alert tools belong to the admins for now */
.admin-only { display: none !important; }
body.is-admin .admin-only { display: inline-flex !important; }
.st-gap { margin-top: 16px; }

.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px 24px; margin: 0; padding: 0; list-style: none; }
.checklist li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checklist b { font-size: 13px; }
.checklist p { margin-top: 2px; color: var(--text-2); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.check-mark { width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--warn); }
.checklist li.ok .check-mark { border-color: var(--up); background: var(--up-tint); }
.checklist li.ok .check-mark::after { content: ''; display: block; width: 4px; height: 8px; margin: 1px 0 0 4.5px; border: solid var(--up); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }

/* privacy, terms, legal notice: a column made for reading */
.legal-body { max-width: 720px; padding: 8px 0 24px; color: var(--text-2); font-size: 15px; line-height: 24px; }
.legal-body h2 { margin: 32px 0 8px; color: var(--text); font-size: 18px; line-height: 28px; }
.legal-body p, .legal-body ul { margin: 0 0 12px; }
.legal-body ul { padding-left: 20px; }
.legal-body li { margin-bottom: 6px; }
.legal-updated { color: var(--muted); font-size: 13px; }
.legal-missing { padding: 0 6px; border-radius: var(--radius-s); background: var(--warn-tint); color: var(--warn); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.footer-links a { color: var(--text-2); font-size: 13px; }
.footer-links a:hover { color: var(--text); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  /* tablets and small laptops: the tabs no longer fit beside the search, so
     they get a bar of their own under the header row, the page marked in orange */
  .appbar { flex-wrap: wrap; height: auto; column-gap: 16px; row-gap: 0; padding: 0 24px; }
  .brand { height: var(--appbar-h); }
  .header-search { order: 2; flex: 1 1 280px; max-width: 640px; }
  .appbar-actions { order: 3; }
  .tabs {
    order: 4; flex: 0 0 calc(100% + 48px); margin: 0 -24px; padding: 0 16px;
    border-top: 1px solid var(--line);
    overflow-x: auto; scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { height: 44px; border-radius: 0; }
  .tab.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 1px; background: var(--accent); }

  .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .kpis { flex-wrap: wrap; gap: 16px 32px; }
  .page-grid { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 1100px) {
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .pg-side { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
  /* a wallet's position card comes right under the chart that draws it */
  .page-grid:has(> .pg-side > .position-card) :is(.pg-main, .pg-side) { display: contents; }
  .page-grid:has(> .pg-side > .position-card) section { order: 3; }
  .page-grid:has(> .pg-side > .position-card) #pp-price { order: 0; }
  .page-grid:has(> .pg-side > .position-card) .position-card { order: 1; }
  .page-grid:has(> .pg-side > .position-card) #pp-tabs { order: 2; }
}

@media (max-width: 1024px) {
  .account-email { display: none; }
  .settings, .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .workspace { padding: 24px 24px 0; }
  .statusbar { padding: 0 24px; }
  .site-footer { padding: 24px; }
  .home-grid { grid-template-columns: 1fr; }
  #pool-tvl-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #pool-tvl-filters .reset-button { justify-self: start; }
  #token-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #token-filters .reset-button { justify-self: start; }
  #ruleform { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  /* phones: brand and actions, then the search, then the same tab bar */
  .appbar { column-gap: 8px; padding: 0 16px; }
  .brand { height: 52px; }
  .appbar-actions { order: 2; }
  .appbar .btn-primary { font-size: 13px; }
  .tabs { flex-basis: calc(100% + 32px); margin: 0 -16px; padding: 0 8px; }
  /* header addresses shrink to 4…4; the full one stays for screen readers and the copy button */
  .ph-addr .addr-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ph-addr .addr-short { display: inline; }
  .workspace { padding: 20px 16px 0; }
  .statusbar { padding: 0 16px; }
  .site-footer { margin-top: 32px; padding: 20px 16px; }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; margin-bottom: 8px; }
  .home-hero { margin: 8px auto 24px; }
  .home-hero h1 { font-size: 24px; line-height: 32px; }
  .home-flows { grid-template-columns: 1fr; gap: 16px; }
  .status-source { display: none; }
  .page-heading h1 { font-size: 24px; line-height: 32px; }
  .kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .controls { gap: 12px; }
  .search { flex: 1 1 100%; min-width: 0; }
  .search kbd { display: none; }
  .density-control { margin-left: 0; }
  .table-heading, .pool-filter-panel, .table-context, .table-pagination { padding-left: 16px; padding-right: 16px; }
  .filter-presets { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .table-scroll { max-height: 70vh; }
  .tablewrap table { min-width: 760px; }
  #pooltable thead th:first-child, #pooltable tbody tr > td:first-child,
  #tokentable thead th:first-child, #tokentable tbody tr > td:first-child {
    position: sticky; left: 0; z-index: 3; background: var(--surface);
  }
  #pooltable thead th:first-child, #tokentable thead th:first-child { z-index: 4; background: var(--inset); }
  #pooltable tbody tr:hover > td:first-child, #tokentable tbody tr:hover > td:first-child { background: var(--raised); }
  .poolcell { min-width: 200px; gap: 8px; }
  #tokentable .poolcell { min-width: 156px; }
  .panel { padding: 16px; }
  .flowfilters input[type=number] { width: 88px; }
  .fsep { display: none; }
  .fcount { margin-left: 0; width: 100%; }
  #ruleform { grid-template-columns: 1fr; }
  #channelform .form-field:has(#ch-kind) { flex-basis: 100%; }
  .formrow .btn-primary { width: 100%; }
  .crumbs kbd { display: none; }
  dialog.signin { padding: 24px 20px; }
  .so-card { padding: 24px 20px; }
  .tag-filter { flex-basis: 100%; }
  .note-list li { grid-template-columns: 8px minmax(0, 1fr); }
  .note-list time { grid-column: 2; }
  .ph { margin-bottom: 16px; }
  .ph-title h1 { font-size: 22px; line-height: 30px; }
  .ph-actions { width: 100%; }
  .pstat { flex-basis: 140px; }
  .pstat { padding: 12px 16px; }
  .pstat-value { font-size: 18px; line-height: 24px; }
  .pg-side { grid-template-columns: minmax(0, 1fr); }
  .pcard { padding: 16px; }
  .table-scroll.inner { margin: 0 -16px; }
  .ptable th:first-child, .ptable td:first-child { padding-left: 16px; }
  .ptable th:last-child, .ptable td:last-child { padding-right: 16px; }
  .pcard-tabs { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
