:root {
  --bg: #0b0e15;
  --panel: #11151f;
  --panel-2: #171c29;
  --line: #232a3b;
  --text: #e6e9f2;
  --muted: #8a93a8;
  --accent: #22d3a6;
  --accent-2: #7c6cff;
  --up: #22d3a6;
  --down: #ff5c7a;
  --warn: #ffb547;
  --new: #7c6cff;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.pad { padding: 18px; }
.r { text-align: right; }
.num, td.r { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: rgba(11, 14, 21, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.brand b { color: var(--accent); }
.chips { display: flex; gap: 8px; flex: 1; min-width: 0; }
.chip {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); font-family: var(--mono); font-size: 12.5px; white-space: nowrap;
}
.chip img { width: 16px; height: 16px; border-radius: 50%; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok, .dot.live { background: var(--accent); box-shadow: 0 0 0 0 rgba(34, 211, 166, .6); animation: pulse 2s infinite; }
.dot.bad { background: var(--down); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 166, .55); } 70% { box-shadow: 0 0 0 7px rgba(34, 211, 166, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 211, 166, 0); } }
.actions { display: flex; gap: 8px; }

.btn {
  border: 1px solid var(--line); background: var(--panel-2);
  padding: 8px 14px; border-radius: 10px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: #37415a; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04120d; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.danger { color: var(--down); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.search { padding: 18px 20px 6px; max-width: 1480px; margin: 0 auto; }
.search form { display: flex; gap: 10px; }
.search input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); font-family: var(--mono); font-size: 13.5px; outline: none;
}
.search input:focus { border-color: var(--accent); }
.recent { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.recent button {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 12.5px;
}
.recent img { width: 18px; height: 18px; border-radius: 50%; }

main { max-width: 1480px; margin: 0 auto; padding: 10px 20px 60px; }
.empty { padding: 60px 0; max-width: 720px; }
.empty h1 { font-size: 26px; line-height: 1.25; margin: 0 0 12px; }
.empty p { color: var(--muted); font-size: 15px; }

.token-card {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "icon id watch" "stats stats stats";
  gap: 12px 16px; align-items: center;
  padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
}
.token-card > img { grid-area: icon; width: 44px; height: 44px; border-radius: 50%; background: var(--panel-2); }
.tok-id { grid-area: id; min-width: 0; }
.tok-name { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tok-name span { color: var(--muted); font-size: 14px; }
.mint { border: 0; background: none; padding: 0; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.mint:hover { color: var(--text); }
.tok-stats { grid-area: stats; display: flex; gap: 28px; flex-wrap: wrap; }
.tok-stats label { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.tok-stats b { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.watch { grid-area: watch; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 10px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.create-btn { margin-left: auto; }
.field select { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 13px; outline: none; }
.check { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; cursor: pointer; }

.table-wrap { border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; background: var(--panel); }
table.pools { width: 100%; border-collapse: collapse; min-width: 1100px; }
.pools th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel);
}
.pools th.r { text-align: right; }
.pools td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.pools tr:last-child td { border-bottom: 0; }
.pools tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.pair { display: flex; align-items: center; gap: 8px; }
.pair .icons { display: flex; }
.pair .icons img { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--panel); }
.pair .icons img + img { margin-left: -8px; }
.pair b { font-weight: 600; }
.sub { display: block; color: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); }
.tag.clmm { color: var(--accent); }
.tag.cpmm { color: #62b0ff; }
.tag.amm { color: var(--warn); }
.tag.new { background: var(--new); border-color: var(--new); color: #fff; animation: blink 1.2s ease-in-out 6; }
.tag.warn { color: var(--warn); }
@keyframes blink { 50% { opacity: .35; } }
tr.fresh td { background: rgba(124, 108, 255, .10); }
tr.fresh td:first-child { box-shadow: inset 3px 0 0 var(--new); }
.up { color: var(--up); }
.down { color: var(--down); }
.flash-up { animation: fu .9s; }
.flash-down { animation: fd .9s; }
@keyframes fu { from { background: rgba(34, 211, 166, .28); } to { background: transparent; } }
@keyframes fd { from { background: rgba(255, 92, 122, .28); } to { background: transparent; } }
td .btns { display: flex; gap: 6px; justify-content: flex-end; }
.linkbtn { color: var(--muted); font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.linkbtn:hover { color: var(--text); }

.positions { margin-top: 22px; }
.pos-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.pos-head h2 { font-size: 16px; margin: 0; }
.range-bar { position: relative; height: 6px; border-radius: 3px; background: var(--panel-2); margin-top: 5px; min-width: 120px; }
.range-bar i { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--text); }
.range-bar span { position: absolute; top: 0; bottom: 0; background: rgba(34, 211, 166, .45); border-radius: 3px; }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(3, 5, 10, .72); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.sheet { position: relative; width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.sheet.narrow { max-width: 480px; }
.sheet h2 { margin: 0 0 14px; font-size: 18px; }
.sheet h3 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.x { position: absolute; top: 14px; right: 14px; border: 0; background: var(--panel-2); width: 30px; height: 30px; border-radius: 8px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.field span { color: var(--muted); font-size: 12.5px; }
.field input:not([type=checkbox]) { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-family: var(--mono); font-size: 13.5px; outline: none; }
.field input:focus { border-color: var(--accent); }
.field.check { flex-direction: row; align-items: center; margin-top: 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 2px 0 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.wallet-list { display: flex; flex-direction: column; gap: 8px; }
.wallet-list button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); text-align: left; }
.wallet-list img { width: 26px; height: 26px; border-radius: 6px; }

.lp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; padding-right: 36px; }
.lp-head .pair .icons img { width: 28px; height: 28px; }
.lp-price { display: flex; gap: 20px; flex-wrap: wrap; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }
.lp-price label { display: block; color: var(--muted); font-size: 11.5px; }
.lp-price b { font-family: var(--mono); font-size: 16px; }
.unit { margin-left: auto; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.presets button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 4px 9px; font-size: 12.5px; }
.presets button.on { border-color: var(--accent); color: var(--accent); }
.range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rbox { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.rbox label { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }
.rbox input { width: 100%; border: 0; background: none; outline: none; font-family: var(--mono); font-size: 18px; padding: 4px 0; }
.rbox .conv { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.rbox .pct { font-family: var(--mono); font-size: 12px; }
.amt { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.amt img { width: 26px; height: 26px; border-radius: 50%; }
.amt .sym { font-weight: 600; min-width: 56px; }
.amt input { flex: 1; min-width: 0; border: 0; background: none; outline: none; text-align: right; font-family: var(--mono); font-size: 18px; }
.amt .bal { display: block; color: var(--muted); font-size: 11.5px; font-family: var(--mono); text-align: right; }
.amt .bal button { border: 0; background: none; color: var(--accent); padding: 0 0 0 6px; font-size: 11.5px; }
.amt.disabled { opacity: .45; }
.summary { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.summary div { display: flex; justify-content: space-between; padding: 2px 0; }
.summary span:last-child { font-family: var(--mono); }
.inline-fields { display: flex; gap: 12px; align-items: flex-end; margin: 12px 0; flex-wrap: wrap; }
.inline-fields .field { margin: 0; }
.inline-fields .field input { width: 130px; }
.slip-presets { display: flex; gap: 4px; }
.slip-presets button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; }
.submit { width: 100%; padding: 13px; font-size: 15px; margin-top: 12px; }
.warnbox { border: 1px solid rgba(255, 181, 71, .35); background: rgba(255, 181, 71, .08); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-top: 10px; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 10px 14px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); word-break: break-word; }
.toast.err { border-left-color: var(--down); }
.toast.new { border-left-color: var(--new); }
.toast b { display: block; margin-bottom: 2px; }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .chips { order: 3; flex-basis: 100%; }
  .actions { margin-left: auto; }
  #settingsBtn { padding: 8px 10px; }
  .search, main { padding-left: 16px; padding-right: 16px; }
  .search form { flex-direction: column; }
  .token-card { grid-template-columns: auto 1fr; grid-template-areas: "icon id" "watch watch" "stats stats"; }
  .tok-stats { gap: 16px; }
  .range-grid, .grid2 { grid-template-columns: 1fr; }
  .modal { padding: 12px; }
  .sheet { padding: 18px 14px; }
}
