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

/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  --bg:          #07090f;
  --bg2:         #0d1117;
  --bg3:         #131920;
  --bg4:         #1a2030;
  --border:      rgba(255,255,255,.07);
  --border-mid:  rgba(255,255,255,.11);
  --text:        #eef2ff;
  --text-2:      #c7d0e8;
  --muted:       #5a6380;
  --green:       #22d3a0;
  --green-glow:  rgba(34,211,160,.15);
  --red:         #f05c6b;
  --red-glow:    rgba(240,92,107,.15);
  --blue:        #60a5fa;
  --accent:      #6366f1;
  --accent-2:    #818cf8;
  --accent-glow: rgba(99,102,241,.2);
  --gold:        #fbbf24;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   18px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.3);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ── Base ──────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle noise texture on body */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: .4;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--text-2); }

/* ── Layout ────────────────────────────────────────────────────── */
.container { max-width: 1380px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(7,9,15,.82);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.header-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px; height: 56px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 800;
  color: var(--text); text-decoration: none;
  letter-spacing: -.3px;
}
.logo-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-glow);
}
.header-nav { display: flex; align-items: center; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .18s;
  border: 1px solid transparent; line-height: 1;
  text-decoration: none;
}
.btn-ghost {
  color: var(--muted); border-color: var(--border);
  background: transparent;
}
.btn-ghost:hover { color: var(--text-2); border-color: var(--border-mid); background: var(--bg3); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff; border-color: transparent;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-2), #8b5cf6);
  box-shadow: 0 0 28px rgba(99,102,241,.35);
}

/* ── Category sub-nav ──────────────────────────────────────────── */
.cat-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 150;
}
.cat-nav-inner {
  display: flex; align-items: center;
  gap: 0; overflow-x: auto; scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav-link {
  display: inline-flex; align-items: center;
  padding: 13px 18px; font-size: 13px; font-weight: 500;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  letter-spacing: -.1px;
}
.cat-nav-link:hover { color: var(--text-2); }
.cat-nav-link.active { color: var(--accent-2); border-bottom-color: var(--accent); }

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
  padding: 72px 0 52px;
  text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% -5%, rgba(99,102,241,.18), transparent),
    radial-gradient(ellipse 40% 40% at 20% 100%, rgba(34,211,160,.06), transparent),
    radial-gradient(ellipse 40% 40% at 80% 100%, rgba(96,165,250,.06), transparent);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(34,211,160,.08);
  border: 1px solid rgba(34,211,160,.22);
  border-radius: 20px; padding: 5px 14px;
  font-size: 12px; font-weight: 600;
  color: var(--green); margin-bottom: 22px;
  letter-spacing: .2px;
}
.hero-badge .dot {
  width: 6px; height: 6px; background: var(--green);
  border-radius: 50%; animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px var(--green);
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900; letter-spacing: -1.5px;
  line-height: 1.08; margin-bottom: 18px; color: var(--text);
}
.hero h1 span {
  background: linear-gradient(90deg, var(--green), var(--accent-2), var(--blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 16px; color: var(--muted); max-width: 520px; margin: 0 auto; line-height: 1.7; }

/* ── Toolbar ───────────────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }

.search-wrap { position: relative; }
.search-input {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 13px; padding: 8px 12px 8px 36px;
  width: 230px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input::placeholder { color: var(--muted); }

/* ── Main table card ───────────────────────────────────────────── */
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow);
}
.leaderboard-table {
  width: 100%; border-collapse: collapse;
}
.leaderboard-table thead {
  background: linear-gradient(180deg, var(--bg3), var(--bg2));
  border-bottom: 1px solid var(--border);
}
.leaderboard-table th {
  padding: 10px 12px;
  text-align: left; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted); white-space: nowrap;
  user-select: none;
}
.leaderboard-table th.lb-th { cursor: pointer; }
.leaderboard-table th:hover { color: var(--text-2); }
.leaderboard-table th.sorted { color: var(--accent-2); }

.leaderboard-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leaderboard-table tbody tr:last-child td { border-bottom: none; }
.leaderboard-table tbody tr {
  transition: background .12s;
  cursor: pointer;
}
.leaderboard-table tbody tr:hover {
  background: rgba(99,102,241,.045);
}

/* Rank */
.rank { font-size: 13px; font-weight: 700; color: var(--muted); }
.rank-1 { color: var(--gold); filter: drop-shadow(0 0 4px rgba(251,191,36,.4)); }
.rank-2 { color: #a8b3c5; }
.rank-3 { color: #c87f45; }

/* Trader cell */
.trader-cell { display: flex; align-items: center; gap: 9px; }
.trader-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bg4), var(--bg3));
  border: 1.5px solid var(--border-mid);
  flex-shrink: 0; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); overflow: hidden;
}
.trader-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.trader-name {
  font-weight: 600; font-size: 13px; color: var(--text);
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trader-addr { font-size: 11px; color: var(--muted); font-family: 'SF Mono', 'Fira Code', monospace; margin-top: 1px; }

/* Score badge */
.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(34,211,160,.1);
  border: 1px solid rgba(34,211,160,.22);
  color: var(--green); font-weight: 800; font-size: 14px;
  border-radius: var(--radius); padding: 4px 11px; min-width: 50px;
  letter-spacing: -.3px;
}
.score-badge.high {
  background: rgba(34,211,160,.16);
  border-color: rgba(34,211,160,.38);
  box-shadow: 0 0 14px rgba(34,211,160,.15);
}

/* PNL colors */
.pnl-pos { color: var(--green); font-weight: 600; }
.pnl-neg { color: var(--red);   font-weight: 600; }
.green   { color: var(--green); }
.red     { color: var(--red);   }

/* Win rate */
.winrate-cell { min-width: 100px; }
.winrate-label { font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.winrate-bar { height: 3px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.winrate-fill { height: 100%; background: linear-gradient(90deg, var(--green), #10b981); border-radius: 3px; transition: width .4s ease; }

/* Mini chart */
.mini-chart { width: 96px; height: 36px; display: block; }

/* Sort icon */
.sort-icon { opacity: .35; font-size: 10px; margin-left: 3px; }
.lb-th.sorted .sort-icon { opacity: 1; }
.lb-th:hover .sort-icon { opacity: .7; }

/* Copy / View buttons */
.copy-btn, .view-btn {
  padding: 4px 10px; border-radius: 7px; font-size: 11px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); transition: all .15s;
  text-decoration: none; display: inline-block; white-space: nowrap;
  font-family: var(--font);
}
.copy-btn { background: transparent; color: var(--muted); }
.copy-btn:hover { color: var(--text-2); border-color: var(--border-mid); background: var(--bg3); }
.view-btn {
  background: transparent; color: var(--accent-2);
  border-color: rgba(129,140,248,.25);
}
.view-btn:hover { background: rgba(99,102,241,.12); border-color: var(--accent); color: var(--text); }

/* ── Pagination ─────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 20px;
  border-top: 1px solid var(--border);
}
.page-btn {
  padding: 6px 13px; border-radius: var(--radius); font-size: 13px; font-weight: 500;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: all .15s;
  font-family: var(--font);
}
.page-btn:hover { color: var(--text-2); border-color: var(--border-mid); background: var(--bg3); }
.page-btn.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── Skeleton loader ─────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite; border-radius: 5px;
}
.skeleton-row td { padding: 15px 16px; }
.skel { height: 13px; display: block; }

/* ── Toast ───────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--bg3); border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg); padding: 13px 20px;
  font-size: 13px; font-weight: 500; color: var(--text);
  box-shadow: var(--shadow); z-index: 999;
  transform: translateY(80px) scale(.95); opacity: 0;
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
}
.toast.show { transform: none; opacity: 1; }

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); padding: 36px 0;
  margin-top: 64px; text-align: center;
  color: var(--muted); font-size: 12px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text-2); }

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes pulse      { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.9)} }
@keyframes fadeSlide  { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
@keyframes spin       { to { transform: rotate(360deg); } }
.row-appear { animation: fadeSlide .22s ease both; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .leaderboard-table .hide-md { display: none; }
  .hero h1 { font-size: 34px; }
}
@media (max-width: 600px) {
  .leaderboard-table .hide-sm { display: none; }
  .search-input { width: 170px; }
  .hero { padding: 44px 0 36px; }
  .container { padding: 0 16px; }
}

/* ═══════════════════════════════════════════════════════════════════
   TRADER PROFILE PAGE
═══════════════════════════════════════════════════════════════════ */

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted); margin-bottom: 24px;
  padding-top: 28px;
}
.breadcrumb a { color: var(--muted); transition: color .15s; }
.breadcrumb a:hover { color: var(--text-2); }
.breadcrumb span { color: var(--bg4); }

/* Profile header */
.profile-header { padding-bottom: 8px; }

.profile-hero {
  display: flex; align-items: center;
  gap: 24px; flex-wrap: wrap;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 250px; height: 250px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.profile-avatar-lg {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bg4), var(--bg3));
  border: 2px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: var(--muted);
  flex-shrink: 0; overflow: hidden;
  box-shadow: 0 0 0 4px rgba(99,102,241,.1);
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.profile-meta h1 {
  font-size: 24px; font-weight: 800;
  letter-spacing: -.5px; color: var(--text);
}
.profile-meta .addr {
  font-family: 'SF Mono','Fira Code',monospace; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 7px; margin-top: 5px;
}
.copy-addr-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 0; display: inline-flex; transition: color .15s;
}
.copy-addr-btn:hover { color: var(--accent-2); }
.profile-bio { font-size: 13px; color: var(--muted); margin-top: 9px; max-width: 460px; line-height: 1.6; }

/* Social links */
.profile-socials { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.social-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); color: var(--muted); text-decoration: none;
  transition: all .15s; background: rgba(255,255,255,.02);
}
.social-link:hover { text-decoration: none; color: var(--text-2); border-color: var(--border-mid); }
.social-link.x-social:hover { border-color: rgba(255,255,255,.25); color: var(--text); }
.social-link.polymarket-social:hover { border-color: rgba(96,165,250,.4); color: var(--blue); }

.profile-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Score badge on profile */
.score-badge[style] { position: relative; }

/* ── Live bar ────────────────────────────────────────────────────── */
.live-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--bg2), rgba(34,211,160,.04));
  border: 1px solid rgba(34,211,160,.15);
  border-radius: var(--radius-lg); padding: 14px 20px;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
  box-shadow: 0 0 20px rgba(34,211,160,.06);
}
.live-indicator {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--green);
  letter-spacing: .2px;
}
.live-dot {
  width: 8px; height: 8px; background: var(--green);
  border-radius: 50%; position: relative;
  box-shadow: 0 0 8px var(--green);
}
.live-dot::after {
  content: ''; position: absolute; inset: -4px;
  background: var(--green); border-radius: 50%; opacity: .25;
  animation: liveping 1.5s ease-out infinite;
}
@keyframes liveping {
  0%   { transform: scale(1); opacity: .25; }
  70%  { transform: scale(2.5); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}
.live-updated { font-size: 11px; color: var(--muted); font-weight: 400; }
.stale-notice { font-size: 11px; color: var(--muted); }
.live-value-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.live-metric { text-align: right; }
.live-metric-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.live-metric-value { font-size: 20px; font-weight: 800; transition: color .3s; letter-spacing: -.5px; }

/* Flash animations */
@keyframes flashGreen { 0%{background:rgba(34,211,160,.22)} 100%{background:transparent} }
@keyframes flashRed   { 0%{background:rgba(240,92,107,.22)} 100%{background:transparent} }
@keyframes countUp    { from{opacity:.5;transform:translateY(3px)} to{opacity:1;transform:none} }
.flash-green { animation: flashGreen .6s ease-out; border-radius: 5px; }
.flash-red   { animation: flashRed   .6s ease-out; border-radius: 5px; }
.val-updated { animation: countUp .2s ease-out; }

/* ── Stats grid ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 22px;
  transition: border-color .15s, box-shadow .15s;
  position: relative; overflow: hidden;
}
.stat-card:hover { border-color: var(--border-mid); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .2s;
}
.stat-card:hover::before { opacity: 1; }
.stat-card-label {
  font-size: 10.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 8px; font-weight: 600;
}
.stat-card-value { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.stat-card-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat-card-value.green { color: var(--green); }
.stat-card-value.red   { color: var(--red);   }

/* ── Chart card ──────────────────────────────────────────────────── */
.chart-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px;
  margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.chart-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.chart-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.interval-tabs { display: flex; gap: 3px; background: var(--bg3); border-radius: 10px; padding: 3px; }
.interval-tab {
  padding: 5px 13px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; background: transparent;
  color: var(--muted); transition: all .15s; font-family: var(--font);
}
.interval-tab:hover { color: var(--text-2); }
.interval-tab.active { background: var(--bg4); color: var(--text); box-shadow: var(--shadow-sm); }
.chart-container { position: relative; height: 260px; overflow: hidden; }

/* ── Two-col ─────────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* ── Section cards ───────────────────────────────────────────────── */
.section-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.section-card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, var(--bg3), var(--bg2));
}

/* Positions table */
.positions-table { width: 100%; border-collapse: collapse; }
.positions-table th {
  padding: 9px 14px; text-align: left; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  background: var(--bg3); border-bottom: 1px solid var(--border);
}
.positions-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  font-size: 12px; vertical-align: middle;
}
.positions-table tbody tr:last-child td { border-bottom: none; }
.positions-table tbody tr:hover { background: rgba(255,255,255,.02); }

.outcome-yes { color: var(--green); font-weight: 700; }
.outcome-no  { color: var(--red);   font-weight: 700; }
.market-title-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-title-cell a { color: var(--text-2); }
.market-title-cell a:hover { color: var(--text); }

.redeemable-badge {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: rgba(34,211,160,.12); border: 1px solid rgba(34,211,160,.25);
  color: var(--green); font-size: 10px; font-weight: 700;
  vertical-align: middle; margin-left: 5px;
}

/* Activity */
.activity-list { list-style: none; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.activity-item:hover { background: rgba(255,255,255,.018); }
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0; margin-top: 1px;
}
.activity-icon.buy  { background: var(--green-glow); color: var(--green); }
.activity-icon.sell { background: var(--red-glow);   color: var(--red);   }
.activity-icon.other{ background: rgba(96,165,250,.1); color: var(--blue); }
.activity-content { flex: 1; min-width: 0; }
.activity-market { font-size: 12px; font-weight: 500; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-meta   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.activity-amount { font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* ── Polycop extended stats ──────────────────────────────────────── */
.polycop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
}
.pc-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  transition: border-color .15s;
}
.pc-card:hover { border-color: var(--border-mid); }
.pc-card.pc-highlight {
  border-color: rgba(34,211,160,.3);
  background: linear-gradient(135deg, rgba(34,211,160,.06), var(--bg2));
}
.pc-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; font-weight: 600; }
.pc-val   { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.pc-val.green { color: var(--green); }
.pc-val.red   { color: var(--red);   }
.pc-sub   { font-size: 11px; color: var(--muted); margin-top: 3px; }
.pc-bar   { height: 3px; background: var(--bg4); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.pc-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), #10b981); border-radius: 3px; }

/* ── Empty / Error ───────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 52px 20px; color: var(--muted);
}
.empty-state svg { display: block; margin: 0 auto 14px; opacity: .25; }
.empty-state p { font-size: 14px; }
.error-banner {
  background: var(--red-glow); border: 1px solid rgba(240,92,107,.3);
  border-radius: var(--radius); padding: 13px 18px; color: var(--red);
  font-size: 13px; margin-bottom: 20px;
}

/* ── Spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 34px; height: 34px;
  border: 2.5px solid var(--bg4); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .65s linear infinite;
  margin: 36px auto;
}

/* ── Chart tooltip ───────────────────────────────────────────────── */
#chart-tooltip {
  position: fixed;
  background: var(--bg3); border: 1px solid var(--border-mid);
  border-radius: 9px; padding: 8px 12px;
  font-size: 12px; pointer-events: none; display: none;
  z-index: 50; line-height: 1.5;
  box-shadow: var(--shadow);
}

/* ── Inline page styles that were in <style> tags ────────────────── */
#pnl-chart { width: 100%; height: 100%; display: block; cursor: crosshair; }
#chart-loading {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: var(--bg2); z-index: 2;
  border-radius: var(--radius-lg);
}
.stale-notice { font-size: 11px; color: var(--muted); margin-left: 4px; }
