:root {
  --bg: #07090f;
  --bg-elevated: #0d111a;
  --bg-card: #121826;
  --bg-card-hover: #182033;
  --border: #1e2a3d;
  --border-strong: #2a3a55;
  --text: #e8eef8;
  --text-muted: #8b9bb4;
  --text-dim: #5c6b84;
  --accent: #00e5a0;
  --accent-dim: rgba(0, 229, 160, 0.15);
  --accent-glow: rgba(0, 229, 160, 0.35);
  --danger: #ff4d6d;
  --danger-dim: rgba(255, 77, 109, 0.15);
  --warn: #ffb020;
  --warn-dim: rgba(255, 176, 32, 0.15);
  --info: #4da3ff;
  --info-dim: rgba(77, 163, 255, 0.15);
  --purple: #a78bfa;
  --purple-dim: rgba(167, 139, 250, 0.15);
  --sol: #14f195;
  --bsc: #f0b90b;
  --eth: #627eea;
  --rh: #00c805;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(0, 229, 160, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(77, 163, 255, 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(167, 139, 250, 0.05), transparent);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(7, 9, 15, 0.85);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--info));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #04140f;
  box-shadow: 0 0 20px var(--accent-glow);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--warn-dim);
  color: var(--warn);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 176, 32, 0.3);
}

.scan-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.scan-time strong { color: var(--text); }

/* Layout */
.layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  /* Keep detail off-screen until a card is opened (fullscreen sheet) */
  .detail-panel:not(.mobile-open) {
    display: none !important;
  }
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 160px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-box input:focus { border-color: var(--accent); }
.search-box::before {
  content: "⌕";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.chip[data-chain="solana"].active { background: rgba(20, 241, 149, 0.12); border-color: var(--sol); color: var(--sol); }
.chip[data-chain="bsc"].active { background: rgba(240, 185, 11, 0.12); border-color: var(--bsc); color: var(--bsc); }
.chip[data-chain="ethereum"].active { background: rgba(98, 126, 234, 0.12); border-color: var(--eth); color: var(--eth); }
.chip[data-chain="robinhood"].active { background: rgba(0, 200, 5, 0.12); border-color: var(--rh); color: var(--rh); }

.sort-select {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.8rem;
  outline: none;
}

/* Stats bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.stat-card .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card .value {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--mono);
  margin-top: 0.15rem;
}

.stat-card .value.up { color: var(--accent); }
.stat-card .value.hot { color: var(--warn); }

/* Token list */
.token-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.token-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}

.token-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.18s;
}

.token-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.token-card.selected {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 1px var(--accent-dim), var(--shadow);
}

.token-card.selected::before { background: var(--accent); }

.token-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.token-identity {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.token-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.token-avatar.solana { background: rgba(20, 241, 149, 0.12); color: var(--sol); }
.token-avatar.bsc { background: rgba(240, 185, 11, 0.12); color: var(--bsc); }
.token-avatar.ethereum { background: rgba(98, 126, 234, 0.12); color: var(--eth); }
.token-avatar.robinhood { background: rgba(0, 200, 5, 0.12); color: var(--rh); }

.token-names { min-width: 0; }
.token-symbol {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.token-fullname {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multiplier-badge {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.multiplier-badge.up {
  background: var(--accent-dim);
  color: var(--accent);
}

.multiplier-badge.down {
  background: var(--danger-dim);
  color: var(--danger);
}

.token-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.chain-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chain-badge.solana { background: rgba(20, 241, 149, 0.15); color: var(--sol); }
.chain-badge.bsc { background: rgba(240, 185, 11, 0.15); color: var(--bsc); }
.chain-badge.ethereum { background: rgba(98, 126, 234, 0.15); color: var(--eth); }
.chain-badge.robinhood { background: rgba(0, 200, 5, 0.15); color: var(--rh); }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.hot { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.status-dot.new { background: var(--info); box-shadow: 0 0 6px var(--info); }
.status-dot.watch { background: var(--text-dim); }
.status-dot.dead { background: var(--danger); }

.tag {
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: var(--purple-dim);
  color: var(--purple);
}

.narrative-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.token-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

.token-stats-row .chg.up { color: var(--accent); }
.token-stats-row .chg.down { color: var(--danger); }

.risk-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.risk-pill {
  font-size: 0.65rem;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-weight: 500;
}

.risk-pill.low { background: var(--accent-dim); color: var(--accent); }
.risk-pill.medium { background: var(--warn-dim); color: var(--warn); }
.risk-pill.high { background: var(--danger-dim); color: var(--danger); }
.risk-pill.extreme { background: rgba(255, 0, 80, 0.2); color: #ff6b8a; border: 1px solid rgba(255, 77, 109, 0.4); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state h3 { color: var(--text); margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.9rem; max-width: 360px; margin: 0 auto; }

/* Detail panel */
.detail-panel {
  position: sticky;
  top: 72px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.detail-placeholder {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.detail-placeholder .icon { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.4; }

.detail-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.detail-header .symbol-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.detail-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.detail-header .name { color: var(--text-muted); font-size: 0.85rem; }

.detail-body { padding: 1.15rem 1.25rem; }

.detail-section {
  margin-bottom: 1.25rem;
}

.detail-section h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.55rem;
  font-weight: 600;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.metric {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
}

.metric .m-label { font-size: 0.68rem; color: var(--text-dim); }
.metric .m-value {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

.metric .m-value.up { color: var(--accent); }
.metric .m-value.down { color: var(--danger); }

.narrative-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.contract-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  word-break: break-all;
  color: var(--text-muted);
}

.contract-box button {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
}

.contract-box button:hover { border-color: var(--accent); color: var(--accent); }

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--info-dim);
  color: var(--info);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(77, 163, 255, 0.25);
  text-decoration: none;
}

.ext-link:hover { background: rgba(77, 163, 255, 0.25); text-decoration: none; }

/* In-page charts removed — deep analysis opens on GMGN */

.demo-price-note {
  font-size: 0.72rem;
  color: var(--warn);
  background: var(--warn-dim);
  border: 1px solid rgba(255, 176, 32, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  margin-bottom: 1rem;
}

.robinhood-note {
  font-size: 0.8rem;
  color: var(--rh);
  background: rgba(0, 200, 5, 0.08);
  border: 1px solid rgba(0, 200, 5, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-top: 0.75rem;
}

.footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid var(--border);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.loading .spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 0.75rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.mobile-detail-close {
  display: none;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  z-index: 5;
}

@media (max-width: 1024px) {
  .detail-panel.mobile-open {
    display: block !important;
    position: fixed !important;
    inset: 0;
    z-index: 200;
    max-height: none;
    border-radius: 0;
    border: none;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-overflow-scrolling: touch;
  }
  .detail-panel.mobile-open .mobile-detail-close {
    display: grid;
    place-items: center;
    position: sticky;
    top: 0.5rem;
    float: right;
    margin: 0.5rem 0.75rem 0 0;
    width: 40px;
    height: 40px;
    z-index: 10;
    background: rgba(18, 24, 38, 0.95);
    backdrop-filter: blur(8px);
  }
  body.detail-open {
    overflow: hidden;
    touch-action: none;
  }
}

/* View tabs (最新 / 历史) */
.view-tabs {
  max-width: 1440px;
  margin: 0.75rem auto 0;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.view-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.view-tab:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.view-tab.active {
  color: #04140f;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
}

.data-source-hint {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* History view */
.history-view {
  max-width: 1440px;
  margin: 0.75rem auto 2rem;
  padding: 0 1.25rem;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1rem;
  min-height: 60vh;
}

.history-list-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: calc(100vh - 180px);
  overflow: hidden;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.history-toolbar h2 {
  font-size: 1rem;
  font-weight: 700;
}

.btn-refresh {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-refresh:hover {
  color: var(--text);
  border-color: var(--accent);
}

.history-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.history-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  padding-right: 0.25rem;
}

.history-item {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.history-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.history-item.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.history-item .hi-time {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

.history-item .hi-meta {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.history-detail-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 320px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.history-snap-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.history-snap-header h3 {
  font-size: 1rem;
}

.history-entries {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.history-entry-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.history-entry-row .sym {
  font-weight: 700;
  font-family: var(--mono);
}

.history-entry-row .nar {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-entry-row .mult {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .history-layout {
    grid-template-columns: 1fr;
  }
  .history-list-panel,
  .history-detail-panel {
    max-height: none;
  }
}

button.history-entry-row,
.history-entry-btn {
  appearance: none;
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.history-entry-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.gmgn-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #00e5a0, #4da3ff);
  color: #04140f !important;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none !important;
  box-shadow: 0 0 18px var(--accent-glow);
}
.gmgn-open-btn:hover { filter: brightness(1.05); text-decoration: none !important; }

/* Same-ticker / same-name CA alternates */
.alt-section .alt-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0.75rem;
  line-height: 1.45;
}
.alt-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: var(--info-dim);
  color: var(--info);
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}
.alt-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.alt-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.alt-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}
.alt-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 229, 160, 0.25);
}
.alt-row.is-recommended {
  border-color: rgba(0, 229, 160, 0.45);
  background: linear-gradient(135deg, rgba(0, 229, 160, 0.08), rgba(77, 163, 255, 0.05));
}
.alt-row-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.alt-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #04140f;
  background: linear-gradient(135deg, #00e5a0, #4da3ff);
  box-shadow: 0 0 12px var(--accent-glow);
}
.alt-index {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  font-family: var(--mono);
}
.alt-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.alt-ca-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.alt-ca {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(0, 229, 160, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.alt-copy,
.alt-gmgn {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none !important;
}
.alt-copy:hover,
.alt-gmgn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.alt-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--mono);
}
.alt-why {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
}


/* Multi-CA list prominence */
.multi-ca-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #041018;
  background: linear-gradient(135deg, #ffd166, #00e5a0);
  margin-left: 0.25rem;
  vertical-align: middle;
}
.alt-section {
  border: 1px solid rgba(0, 229, 160, 0.35) !important;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(0, 229, 160, 0.07), rgba(77, 163, 255, 0.04));
  padding: 0.85rem 0.9rem 1rem !important;
  margin: 0.75rem 0 1rem !important;
  box-shadow: 0 0 0 1px rgba(0, 229, 160, 0.12), 0 8px 24px rgba(0, 0, 0, 0.25);
}
.alt-section-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #04140f;
  background: linear-gradient(135deg, #00e5a0, #4da3ff);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}
.alt-section h3 {
  margin-top: 0.15rem;
  font-size: 1rem;
}


/* ===== Mobile polish ===== */
@media (max-width: 720px) {
  html { font-size: 14px; }

  .app-header {
    padding: 0.65rem 0.85rem;
    padding-top: max(0.65rem, env(safe-area-inset-top));
  }

  .header-inner {
    gap: 0.45rem;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  .brand-text h1 {
    font-size: 1rem;
  }

  .brand-text .subtitle {
    display: none;
  }

  .scan-time {
    font-size: 0.72rem;
    width: 100%;
  }

  .view-tabs {
    padding: 0 0.85rem;
    margin-top: 0.55rem;
    gap: 0.4rem;
  }

  .view-tab {
    padding: 0.5rem 0.85rem;
    min-height: 40px;
    font-size: 0.8rem;
  }

  .data-source-hint {
    margin-left: 0;
    width: 100%;
    order: 3;
    font-size: 0.65rem;
  }

  .layout {
    padding: 0.75rem 0.85rem 1.25rem;
    gap: 0.75rem;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .stat-card {
    padding: 0.65rem 0.75rem;
  }

  .stat-card .value {
    font-size: 1.15rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .search-box {
    min-width: 0;
    width: 100%;
  }

  .search-box input {
    font-size: 16px; /* avoid iOS zoom */
    min-height: 44px;
    padding: 0.65rem 0.85rem 0.65rem 2.2rem;
  }

  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
    margin: 0 -0.15rem;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }

  .filter-chips::-webkit-scrollbar { display: none; }

  .chip {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0.5rem 0.95rem;
    font-size: 0.85rem;
  }

  .sort-select {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  .token-list {
    gap: 0.55rem;
  }

  .token-card {
    padding: 0.85rem 0.9rem;
  }

  .token-card-top {
    gap: 0.5rem;
  }

  .narrative-snippet {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8rem;
  }

  .token-stats-row {
    gap: 0.55rem 0.75rem;
    font-size: 0.72rem;
  }

  .risk-pills {
    max-height: none;
  }

  .multi-ca-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
  }

  .token-symbol {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }

  .detail-header {
    padding: 0.85rem 1rem 0.85rem;
    padding-right: 3.25rem;
  }

  .detail-body {
    padding: 0.9rem 1rem 1.5rem;
  }

  .detail-header h2 {
    font-size: 1.2rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .metric {
    padding: 0.55rem 0.6rem;
  }

  .metric .m-value {
    font-size: 0.85rem;
    word-break: break-word;
  }

  .contract-box {
    flex-wrap: wrap;
    font-size: 0.68rem;
    gap: 0.45rem;
  }

  .contract-box #contractText {
    flex: 1 1 100%;
    word-break: break-all;
  }

  .contract-box button {
    min-height: 40px;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }

  .gmgn-open-btn {
    width: 100%;
    min-height: 48px;
    margin-top: 0.65rem;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }

  .alt-section {
    padding: 0.75rem !important;
  }

  .alt-ca-row {
    gap: 0.35rem;
  }

  .alt-copy,
  .alt-gmgn {
    min-height: 40px;
    padding: 0.45rem 0.75rem;
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
  }

  .alt-ca {
    font-size: 0.72rem;
    word-break: break-all;
  }

  .history-view {
    padding: 0 0.85rem 1.5rem;
    margin-top: 0.55rem;
  }

  .history-layout {
    gap: 0.75rem;
  }

  .history-entry-row {
    grid-template-columns: 64px 1fr auto;
    gap: 0.45rem;
    padding: 0.65rem 0.7rem;
  }

  .footer {
    padding: 1rem 0.85rem calc(1rem + env(safe-area-inset-bottom));
    font-size: 0.7rem;
    line-height: 1.45;
  }

  .toast {
    bottom: calc(1rem + env(safe-area-inset-bottom));
    max-width: calc(100vw - 2rem);
    text-align: center;
  }
}

@media (max-width: 380px) {
  .stats-bar { gap: 0.4rem; }
  .stat-card { padding: 0.55rem 0.6rem; }
  .multiplier-badge { font-size: 0.75rem; }
}
