:root {
  --bg: #06070c;
  --bg-elev: #0b0d14;
  --bg-panel: #10131c;
  --bg-hover: #161a27;
  --bg-input: #0c0e16;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --text: #e8eaf4;
  --muted: #8a90a8;
  --faint: #5c637a;
  --accent: #8b7cff;
  --accent-2: #2ee6c5;
  --accent-dim: rgba(139,124,255,0.15);
  --teal-dim: rgba(46,230,197,0.12);
  --green: #2ee6c5;
  --red: #ff6b7a;
  --amber: #ffb020;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 228px;
  --topbar: 56px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
table { border-collapse: collapse; width: 100%; }
img, svg { display: block; }

.app {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 8% -8%, rgba(139,124,255,0.14), transparent 55%),
    radial-gradient(700px 400px at 92% 0%, rgba(46,230,197,0.08), transparent 50%),
    var(--bg);
}

/* ——— Sidebar ——— */
.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: rgba(8,9,14,0.96);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.brand-name { font-weight: 700; letter-spacing: -0.03em; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--faint); padding: 10px 12px 4px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--muted); transition: background .12s, color .12s;
  font-weight: 500; font-size: 13.5px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim); color: #c4bbff;
  box-shadow: inset 0 0 0 1px rgba(139,124,255,0.25);
}
.nav-icon { width: 18px; text-align: center; opacity: 0.85; font-size: 13px; }
.sidebar-foot { margin-top: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.demo-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--amber);
  background: rgba(255,176,32,0.1); border: 1px solid rgba(255,176,32,0.25);
  padding: 6px 10px; border-radius: 999px; width: fit-content;
}
.demo-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.gh-link { font-size: 12px; color: var(--muted); }
.gh-link:hover { color: var(--accent-2); }

/* ——— Main ——— */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar); display: flex; align-items: center; gap: 12px;
  padding: 0 18px; border-bottom: 1px solid var(--border);
  background: rgba(6,7,12,0.75); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 30;
}
.menu-btn { display: none; font-size: 20px; padding: 6px 8px; color: var(--muted); }
.search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px; height: 36px;
}
.search:focus-within { border-color: rgba(139,124,255,0.45); box-shadow: 0 0 0 2px rgba(139,124,255,0.35); }
.search-icon { color: var(--faint); }
.search input {
  flex: 1; min-width: 0; background: none; border: none; outline: none; height: 100%;
  font-size: 13px; color: var(--text);
}
.search input::placeholder { color: var(--faint); }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.network-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  background: var(--bg-panel); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 999px;
}
.network-chip .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 13px;
  border: 1px solid var(--border); background: var(--bg-panel); transition: .12s;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-primary {
  background: linear-gradient(135deg, #7c6cff, #5b8cff);
  border: none; color: #fff;
  box-shadow: 0 4px 16px rgba(124,108,255,0.35);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.content { padding: 18px 20px 40px; flex: 1; }
.section { display: none; animation: fadeIn .18s ease; }
.section.visible { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -0.03em; font-weight: 700; }
.page-head .muted, .muted { color: var(--muted); }
.page-meta { font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.badge-demo {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--amber); background: rgba(255,176,32,0.12);
  border: 1px solid rgba(255,176,32,0.3); padding: 2px 6px; border-radius: 4px;
}

/* ——— Panels & grids ——— */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.stat-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 14px 12px;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2)); opacity: 0.7;
}
.stat-label { font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.up { color: var(--green); }
.down { color: var(--red); }

.panel-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin-bottom: 12px; }
.panel-grid.three { grid-template-columns: repeat(3, 1fr); }
.panel-grid.equal { grid-template-columns: 1fr 1fr; }
.panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; min-width: 0;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.panel-head h2, .panel-head h3 {
  margin: 0; font-size: 13px; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em;
}
.panel-head .muted { font-size: 12px; }

.seg { display: inline-flex; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg-btn {
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
  color: var(--muted); transition: .12s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--accent-dim); color: #c4bbff; }

.chart-wrap { position: relative; width: 100%; height: 260px; }
.chart-wrap.sm { height: 180px; }
.chart-wrap.xs { height: 140px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }
.chart-error {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: auto; z-index: 2;
}
.chart-error .btn { pointer-events: auto; }

/* ——— Tables ——— */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table th, .data-table td {
  padding: 10px 12px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums;
}
.data-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--faint); font-weight: 600; cursor: pointer; user-select: none;
  position: sticky; top: 0; background: var(--bg-panel); z-index: 1;
}
.data-table th:hover { color: var(--text); }
.data-table th.sorted { color: var(--accent-2); }
.data-table td { font-size: 13px; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--bg-hover); cursor: pointer; }
.data-table .token-cell { display: flex; align-items: center; gap: 10px; }
.token-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent-dim), var(--teal-dim));
  border: 1px solid var(--border); color: #c4bbff; flex-shrink: 0;
}
.token-avatar.sm { width: 22px; height: 22px; font-size: 9px; border-radius: 6px; }
.token-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.token-meta strong { font-size: 13px; }
.token-meta span { font-size: 11px; color: var(--muted); }
.star-btn { color: var(--faint); padding: 4px; font-size: 14px; }
.star-btn.on { color: var(--amber); }

.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px;
}
.filters input, .filters select {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; outline: none;
}
.filters input:focus, .filters select:focus { border-color: rgba(139,124,255,0.45); box-shadow: 0 0 0 2px rgba(139,124,255,0.35); }
.filters input { min-width: 200px; }

/* ——— Lists / strips ——— */
.list-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg-hover); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.news-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.news-chip {
  flex: 0 0 auto; max-width: 280px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.news-chip:hover { border-color: rgba(139,124,255,0.35); }
.news-chip .src { font-size: 10px; color: var(--accent-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.news-chip .ttl { font-size: 12.5px; margin: 4px 0 2px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-chip .when { font-size: 11px; color: var(--faint); }
.tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px; background: var(--accent-dim); color: #c4bbff;
}
.tag.midnight { background: var(--teal-dim); color: var(--accent-2); }
.tag.dex { background: rgba(91,140,255,0.15); color: #8bb0ff; }
.tag.markets { background: rgba(255,176,32,0.12); color: var(--amber); }

/* ——— Token page ——— */
.token-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(139,124,255,0.12), rgba(46,230,197,0.06));
  border: 1px solid var(--border);
}
.token-banner .big-avatar {
  width: 48px; height: 48px; border-radius: 14px; font-size: 16px;
  display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(135deg, #8b7cff, #2ee6c5); color: #0a0b12;
}
.token-banner h1 { margin: 0; font-size: 22px; }
.token-picker { background: rgba(255,255,255,0.06); border: 1px solid rgba(139,124,255,0.25); border-radius: 10px; padding: 8px 10px; font-size: 13px; max-width: 230px; }
.token-picker:focus { border-color: rgba(139,124,255,0.45); box-shadow: 0 0 0 2px rgba(139,124,255,0.35); outline: none; }
.token-banner .price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.token-banner .price { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.links-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.link-out {
  font-size: 12px; color: var(--muted); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
}
.link-out:hover { color: var(--accent-2); border-color: rgba(46,230,197,0.35); }

.fish-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.03em;
}
.fish-badge.whale { background: rgba(139,124,255,0.2); color: #c4bbff; }
.fish-badge.dolphin { background: rgba(91,140,255,0.2); color: #8bb0ff; }
.fish-badge.fish { background: rgba(46,230,197,0.15); color: var(--accent-2); }
.fish-badge.shrimp { background: rgba(148,163,184,0.15); color: #94a3b8; }

.trade-side.buy { color: var(--green); font-weight: 600; }
.trade-side.sell { color: var(--red); font-weight: 600; }

/* ——— Portfolio ——— */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab {
  padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: #c4bbff; border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.alloc-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.alloc-legend span { display: flex; justify-content: space-between; gap: 12px; }
.dot-swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* ——— Midnight ——— */
.midnight-hero {
  padding: 18px; border-radius: var(--radius); margin-bottom: 14px;
  background:
    radial-gradient(600px 200px at 80% 0%, rgba(46,230,197,0.15), transparent),
    linear-gradient(135deg, rgba(139,124,255,0.1), rgba(10,11,18,0.4));
  border: 1px solid rgba(46,230,197,0.2);
}
.midnight-hero h2 { margin: 0 0 6px; font-size: 18px; }
.calc-box {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.calc-box label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.calc-box input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; outline: none;
}
.calc-box input:focus { border-color: rgba(46,230,197,0.45); box-shadow: 0 0 0 2px rgba(46,230,197,0.35); }
.calc-result {
  margin-top: 12px; padding: 12px; border-radius: 10px;
  background: var(--teal-dim); border: 1px solid rgba(46,230,197,0.25);
  font-size: 13px; line-height: 1.6;
}
.bridge-flow {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  flex-wrap: wrap; padding: 16px 8px;
}
.bridge-node {
  padding: 14px 18px; border-radius: 12px; text-align: center; min-width: 120px;
  background: var(--bg-elev); border: 1px solid var(--border);
}
.bridge-node strong { display: block; margin-bottom: 4px; }
.bridge-arrow { color: var(--accent-2); font-size: 20px; font-weight: 700; }

/* ——— Watchlist empty ——— */
.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
}
.empty strong { display: block; color: var(--text); margin-bottom: 6px; }

/* ——— Toast ——— */
.toast-host {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-panel); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow);
  font-size: 13px; max-width: 320px; animation: fadeIn .2s ease;
}

/* ——— Overlay mobile ——— */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 45;
}
.sidebar-overlay.show { display: block; }

/* ——— Responsive ——— */
@media (max-width: 1100px) {
  .panel-grid, .panel-grid.three, .panel-grid.equal { grid-template-columns: 1fr; }
  .calc-box { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; transform: translateX(-105%);
    transition: transform .2s ease; width: min(280px, 86vw);
    z-index: 60; /* decisively above the scrim (45) so taps always land on links */
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn {
    display: inline-flex;
    -webkit-tap-highlight-color: transparent;
    border-radius: 8px;
    transition: background .12s ease;
  }
  .menu-btn:active { background: rgba(139,124,255,0.16); }
  .menu-btn[aria-expanded="true"] { background: rgba(139,124,255,0.16); color: var(--text); }
  .network-chip span:not(.dot) { display: none; }
  .content { padding: 14px 12px 32px; }
  .stat-value { font-size: 17px; }
}

/* ——— Float-inspired denser tweaks ——— */
.data-table th, .data-table td { padding: 8px 10px; }
.data-table td { font-size: 12.5px; }
.spark {
  width: 72px; height: 28px; display: inline-block; vertical-align: middle;
}
.spark canvas { width: 72px !important; height: 28px !important; }
.rank-cell { color: var(--faint); font-size: 12px; width: 28px; }
.freshness {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
}
.freshness .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  animation: pulse 1.6s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(46,230,197,0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(46,230,197,0); }
}
.market-tabs { margin-bottom: 12px; }
.liq-filter { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.liq-filter input[type="range"] { width: 120px; accent-color: var(--accent); }
.chk {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); user-select: none;
}
.chk input { accent-color: var(--accent); }

/* Token detail denser header */
.token-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px; margin: 12px 0;
}
.token-stat {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px;
}
.token-stat .lbl { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.token-stat .val { font-size: 14px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.asset-id {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: var(--bg-elev); border: 1px solid var(--border);
  padding: 4px 8px; border-radius: 6px; cursor: pointer; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.asset-id:hover { color: var(--accent-2); border-color: rgba(46,230,197,0.35); }

.expand-row { cursor: pointer; }
.expand-detail {
  display: none; background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.expand-detail.open { display: table-row; }
.expand-detail td { padding: 12px 16px; white-space: normal; font-size: 12px; color: var(--muted); }

/* Command palette ⌘K */
.cmdk-backdrop {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.cmdk-backdrop.open { display: flex; }
.cmdk {
  width: min(560px, 92vw); background: #12141e;
  border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65); overflow: hidden;
}
.cmdk input {
  width: 100%; background: transparent; border: none; outline: none;
  padding: 16px 18px; font-size: 15px; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.cmdk-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px;
}
.cmdk-item:hover, .cmdk-item.active { background: var(--accent-dim); }
.cmdk-item .hint { margin-left: auto; font-size: 11px; color: var(--faint); }
.cmdk-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.kbd {
  font-size: 11px; color: var(--faint); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 4px; background: var(--bg-elev);
}
.search-hint { display: none; }
@media (min-width: 900px) {
  .search-hint { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
}

.smart-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  padding: 1px 5px; border-radius: 3px; margin-left: 4px;
  background: rgba(255,176,32,0.15); color: var(--amber);
}

/* ——— Live rebuild additions ——— */
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--green);
  background: rgba(46,230,197,0.08); border: 1px solid rgba(46,230,197,0.25);
  padding: 6px 10px; border-radius: 999px; width: fit-content; line-height: 1.3;
}
.live-pill .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: pulse 1.6s ease infinite; flex-shrink: 0;
}
.flat { color: var(--muted); }
img.token-avatar { object-fit: cover; }
.token-banner .big-avatar img,
.token-banner .big-avatar span.token-avatar {
  width: 48px; height: 48px; border-radius: 14px; font-size: 16px;
}

/* skeletons */
.skel {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skel 1.2s ease infinite;
}
@keyframes skel { to { background-position: -200% 0; } }

/* key-value rows */
.kv {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.kv:last-child { border-bottom: none; }
.kv > span:first-child { color: var(--muted); font-size: 12px; }
.kv code { font-family: var(--mono); font-size: 11px; }

/* wallet */
.wallet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.wallet-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--border); transition: .12s;
}
.wallet-card:hover { border-color: rgba(139,124,255,0.45); background: var(--bg-hover); }
.wallet-card img { width: 40px; height: 40px; border-radius: 10px; }
.install-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; justify-content: center; }
.install-row a {
  font-size: 12px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); text-transform: capitalize;
}
.install-row a:hover { color: var(--accent-2); border-color: rgba(46,230,197,0.35); }
.row-flex { display: flex; gap: 8px; flex-wrap: wrap; }
.row-flex .input { flex: 1; min-width: 200px; }
.input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; outline: none; font-size: 13px;
}
.input:focus { border-color: rgba(139,124,255,0.45); box-shadow: 0 0 0 2px rgba(139,124,255,0.35); }

/* nfts */
.nft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.nft-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px; overflow: hidden;
}
.nft-art {
  height: 84px; border-radius: 8px; display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: #0a0b12;
  background: linear-gradient(135deg, #8b7cff, #2ee6c5); margin-bottom: 8px;
}
.nft-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* buys vs sells */
.bs-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-elev); margin: 6px 0 10px; }
.bs-buy { background: linear-gradient(90deg, #1fbf9e, #2ee6c5); }
.bs-sell { background: linear-gradient(90deg, #ff6b7a, #d94f5e); }
.bs-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }

.hover-readout { min-height: 20px; font-size: 12px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
canvas.chart-lg { width: 100% !important; height: 100% !important; }

.pf-mini-worth { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.pf-mini-worth .muted { font-size: 12px; font-weight: 500; }

/* footer */
.footer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--faint);
}
.footer-links { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-links a { color: var(--accent-2); }
.footer-bar .muted { font-family: var(--mono); font-size: 10.5px; }

@media (max-width: 860px) {
  .footer-bar { padding: 12px; }
}

.footer-bar {
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-start;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 220px;
}
.footer-donate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  max-width: 100%;
}
.footer-donate code {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--text);
  max-width: min(520px, 70vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.footer-donate code:hover { border-color: rgba(139,124,255,0.45); color: var(--accent-2); }

/* ---------- Ecosystem strip ---------- */
.eco-strip { margin: 0 0 18px; }
.eco-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.eco-head h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.eco-head .muted { font-size: 12px; }
.eco-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.eco-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 16px 5px 5px;
  font-size: 13px; font-weight: 600;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.eco-chip img { width: 34px; height: 34px; border-radius: 50%; background: #0b0d14; object-fit: cover; }
.eco-chip:hover { transform: translateY(-2px); border-color: rgba(139,124,255,0.4); box-shadow: var(--shadow); }

/* ---------- Rank badges (trending) ---------- */
.rank-badge {
  display: inline-grid; place-items: center; flex-shrink: 0;
  min-width: 26px; height: 24px; padding: 0 6px; border-radius: 7px;
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--bg-elev); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.rank-badge.top {
  color: #06131a; border: none;
  background: linear-gradient(135deg, var(--accent-2), #8fd6ff);
}

/* ---------- Liquidity share bars ---------- */
.liq-bar { height: 4px; border-radius: 3px; background: rgba(255,255,255,0.08); margin-top: 6px; overflow: hidden; min-width: 70px; }
.liq-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- DEX venue cells ---------- */
.dex-cell { display: inline-flex; align-items: center; gap: 8px; }
.dex-cell img { width: 22px; height: 22px; border-radius: 50%; background: #0b0d14; object-fit: cover; flex-shrink: 0; }
.dex-cell span:last-child { text-transform: capitalize; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: #0a0b16 url("../assets/hero-bg.jpg") center/cover no-repeat;
  margin-bottom: 18px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(6,7,12,0.88) 20%, rgba(6,7,12,0.45) 55%, rgba(6,7,12,0.15) 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 44px 36px;
  max-width: 640px;
}
.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(46,230,197,0.4);
  background: rgba(46,230,197,0.08);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.03em;
  font-weight: 800;
  line-height: 1.08;
}
.hero p {
  margin: 0 0 20px;
  color: #c3c9e6;
  font-size: 15px;
  line-height: 1.55;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-cta .btn { padding: 10px 20px; font-size: 14px; }
@media (max-width: 640px) {
  .hero-inner { padding: 30px 22px; }
  /* ~390px topbar: menu + search + freshness + chip + connect button overflowed
     the viewport (search input's intrinsic min-width blocked flex shrink).
     Give the search room: hide the freshness caption, tighten gaps. */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-actions { gap: 8px; }
  .freshness { display: none; }
}

/* ---------- Ad slots (hidden until ads enabled) ---------- */
.ad-slot { display: none; }
.ad-slot.ad-live {
  display: block;
  margin: 18px 0;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.015);
  position: relative;
}
.ad-slot .ad-label {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}
