:root {
  --bg: #0b0c1a;
  --bg2: #11132a;
  --panel: #151834;
  --panel2: #1b1f42;
  --line: #262b57;
  --text: #e8e9ff;
  --muted: #8a8fbf;
  --accent: #8b5cff;
  --accent2: #c084fc;
  --danger: #ff5c7a;
  --ok: #34d399;
  --warn: #fbbf24;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.4 "Segoe UI", "Inter", system-ui, sans-serif; overflow: hidden; }
button, input { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar { position: relative; height: 64px; display: flex; align-items: center; gap: 20px; padding: 0 18px;
  background: linear-gradient(180deg, #13153a, #0f1130); border-bottom: 1px solid var(--line); z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; white-space: nowrap; }
.brand b { color: var(--accent2); }
.brand small { color: var(--muted); font-size: 13px; margin-left: 2px; }
.brand-logo { width: 34px; height: 34px; filter: drop-shadow(0 0 10px #8b5cff88); }
.search { flex: 1; max-width: 760px; display: flex; align-items: center; gap: 8px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 12px; padding: 5px 5px 5px 12px; transition: border .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #8b5cff33; }
.search-ico { width: 18px; height: 18px; fill: var(--muted); flex: none; }
.search input { flex: 1; background: none; border: 0; outline: 0; font-size: 14px; font-family: Consolas, "Segoe UI", monospace; }
.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 9px; padding: 8px 16px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, #9b6bff, #6d3bff); border: 0; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.12); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; font-size: 18px; transition: .15s; }
.icon-btn svg { width: 18px; height: 18px; fill: var(--text); }
.icon-btn:hover:not(:disabled) { border-color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.pill { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--line); font-size: 12.5px; max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.pill.running .dot { background: var(--accent2); animation: pulse 1s infinite; }
.pill.watch .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.pill.error { border-color: var(--danger); }
.pill.error .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
.power { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 12.5px; letter-spacing: .5px; transition: .2s; }
.power .knob { width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: .2s; }
.power.on { border-color: var(--ok); color: var(--ok); }
.power.on .knob { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.power.off { border-color: var(--danger); color: var(--danger); }
.power.off .knob { background: var(--danger); }
.power:disabled { opacity: .4; cursor: default; }
.btn.refresh { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; }
.btn.refresh svg { width: 16px; height: 16px; fill: currentColor; }
.btn:disabled { opacity: .4; cursor: default; border-color: var(--line); }
.pill.done .dot { background: var(--ok); }
.pill.paused { border-color: var(--danger); }
.pill.paused .dot { background: var(--danger); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
#progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ff5ca8); transition: width .4s; box-shadow: 0 0 8px var(--accent); }

/* ---------- layout ---------- */
.layout { display: flex; height: calc(100% - 64px); }
.sidebar { width: 340px; flex: none; display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--bg2);
  border-right: 1px solid var(--line); overflow: hidden; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.token-card { display: flex; gap: 12px; align-items: center; }
.token-card img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--panel2); flex: none; }
.token-meta { min-width: 0; }
.token-name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.token-mint { font: 12px Consolas, monospace; color: var(--muted); cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.token-mint:hover { color: var(--accent2); }
.stats { display: flex; flex-direction: column; gap: 12px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 34px; font-weight: 700; letter-spacing: -.5px;
  background: linear-gradient(90deg, #d8b4fe, #ff7ac6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-value.sm { font-size: 18px; background: none; color: var(--text); font-weight: 600; }
.gauge { height: 6px; border-radius: 6px; background: var(--panel2); overflow: hidden; margin-top: 6px; }
#gauge-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ff5ca8); transition: width .6s; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-grid .stat { background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tab { flex: 1; border: 0; background: none; padding: 7px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.tab.active { background: var(--panel2); color: var(--text); }
.tab-panel { flex: 1; overflow-y: auto; margin-right: -6px; padding-right: 6px; }
.tab-panel::-webkit-scrollbar, .details::-webkit-scrollbar { width: 6px; }
.tab-panel::-webkit-scrollbar-thumb, .details::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.empty-list { color: var(--muted); text-align: center; padding: 24px 8px; font-size: 13px; }

.list-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: .12s; }
.list-item:hover { background: var(--panel); border-color: var(--line); }
.list-item.active { background: var(--panel2); border-color: var(--accent); }
.swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.mono { font-family: Consolas, monospace; }
.tag { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: var(--panel2); color: var(--muted); margin-left: 4px; vertical-align: 1px; }
.tag.cex { color: #f0b90b; } .tag.lp { color: #7dd3fc; } .tag.new { color: var(--ok); }
.log-line { font-size: 12px; color: var(--muted); padding: 4px 2px; border-bottom: 1px dashed var(--line); }
.log-line b { color: var(--text); font-weight: 500; }

/* ---------- map ---------- */
.map-wrap { position: relative; flex: 1; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #171a3d 0%, #0b0c1a 70%); }
#map { width: 100%; height: 100%; display: block; cursor: grab; }
#map:active { cursor: grabbing; }
.node circle { transition: opacity .2s, stroke-width .15s; cursor: pointer; }
.node text { pointer-events: none; fill: #fff; font-weight: 600; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: #0008; stroke-width: 3px; }
.node circle.ring { fill: none; stroke-width: 2.5; pointer-events: none; }
.node.pending circle.body { animation: pendingPulse 1.4s ease-in-out infinite; }
@keyframes pendingPulse { 50% { stroke-opacity: .25; } }
.node.dim, .link.dim { opacity: .12; }
.node.selected circle.body { stroke-width: 4px !important; filter: drop-shadow(0 0 10px currentColor); }
.link { stroke-opacity: .75; fill: none; transition: opacity .2s; }
.legend { position: absolute; left: 14px; top: 14px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 90px); }
.chip { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  background: #151834dd; border: 1px solid var(--line); backdrop-filter: blur(4px); user-select: none; }
.chip i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chip.off { opacity: .4; text-decoration: line-through; }
.map-tools { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none; padding: 40px; }
.empty-state img { width: 110px; opacity: .9; filter: drop-shadow(0 0 30px #8b5cff88); margin-bottom: 10px; }
.empty-state h1 { font-size: 26px; margin: 8px 0; }
.empty-state p { color: var(--muted); max-width: 560px; }
.tooltip { position: absolute; pointer-events: none; background: #0d0f24f2; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 11px; font-size: 12.5px; box-shadow: 0 8px 24px #0008; z-index: 4; max-width: 280px; }
.tooltip .tt-pct { font-size: 16px; font-weight: 700; }

/* ---------- details ---------- */
.details { width: 360px; flex: none; position: relative; background: var(--bg2); border-left: 1px solid var(--line);
  padding: 18px; overflow-y: auto; animation: slideIn .2s ease-out; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
.details .close { position: absolute; right: 12px; top: 10px; background: none; border: 0; font-size: 24px; color: var(--muted); cursor: pointer; }
.details h3 { margin: 0 0 4px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.details h4 { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.addr-box { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 9px; font: 12px Consolas, monospace; word-break: break-all; margin: 8px 0; }
.addr-box button { flex: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; padding: 3px 7px; font-size: 11px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; font-size: 13px; }
.kv div:nth-child(odd) { color: var(--muted); }
.big-pct { font-size: 30px; font-weight: 700; }
.ext-links { display: flex; gap: 8px; margin-top: 6px; }
.ext-links a { color: var(--accent2); font-size: 12.5px; text-decoration: none; }
.ext-links a:hover { text-decoration: underline; }
.link-item { padding: 8px 10px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 6px; cursor: pointer; }
.link-item:hover { border-color: var(--accent); }
.link-item .lt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.link-item .ld { font-size: 12px; color: var(--muted); }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; background: #05061099; display: grid; place-items: center; z-index: 20; backdrop-filter: blur(3px); }
.modal-card { width: 560px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.modal-card h2 { margin: 0 0 4px; }
.modal-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); flex: 1; }
.modal-card input { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: 0; color: var(--text); }
.modal-card input:focus { border-color: var(--accent); }
.row { display: flex; gap: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.icon-btn.small { width: 30px; height: 30px; margin-left: auto; flex: none; }
.icon-btn.small svg { width: 15px; height: 15px; }
.btn.small { padding: 6px 10px; font-size: 12px; }
.list-tools { display: flex; gap: 6px; margin-bottom: 8px; position: sticky; top: 0; background: var(--bg2); padding-bottom: 4px; z-index: 1; }
.list-tools input { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; outline: 0; font-size: 12.5px; }
.list-tools input:focus { border-color: var(--accent); }
.modal-card label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.modal-card label.check input { width: auto; }
.modal-card a, .hint a { color: var(--accent2); }
.small { font-size: 12px; }
.stat-grid .stat-value.sm { font-size: 16px; }
.icon-btn.small + .icon-btn.small { margin-left: 4px; }
.signals { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: none; }
.creator-line { font-size: 12px; margin: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creator-line a { color: var(--accent2); text-decoration: none; }
.signal { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.signal:hover { background: var(--panel2); }
.signal i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.signal .sig-label { flex: 1; }
.signal b { font-variant-numeric: tabular-nums; }
.signal .muted { font-size: 11px; min-width: 62px; text-align: right; }
.mem-alert { font-size: 12px; padding: 6px 8px; margin: 4px 0; border-radius: 8px; background: #fbbf2414; border: 1px solid #fbbf2455; }
.mem-alert a { color: var(--warn); font-weight: 600; text-decoration: none; }
.tag.dev { color: #ef4444; } .tag.sniper { color: #fb923c; } .tag.fresh { color: #22d3ee; } .tag.seen { color: var(--warn); }
.mem-row { display: flex; align-items: center; gap: 10px; }
.mem-row .hint { flex: 1; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 10px; z-index: 30; box-shadow: 0 8px 30px #000a; }
.toast.err { border-color: var(--danger); }
