/* ============================================================================
   PiScan (piscan.net) — Pi Network Block Explorer Design System
   Inspired by blockexplorer.minepi.com/mainnet/ — elevated for speed & clarity
   ============================================================================ */

:root {
  /* Core Pi Network Brand Palette */
  --pi-purple: #703D92;
  --pi-purple-dark: #542B70;
  --pi-purple-deeper: #3D1C54;
  --pi-purple-light: #8E54B6;
  --pi-purple-soft: #F3ECF8;
  --pi-purple-soft-2: #E7D9F2;
  --pi-gold: #F6B133;
  --pi-gold-dark: #C9820B;
  --pi-gold-soft: #FFF6E0;

  /* Light Theme Surfaces */
  --bg: #F6F4F9;
  --surface: #FFFFFF;
  --surface-subtle: #FAF8FC;
  --surface-hover: #F3EEF8;
  --border: #E6DFEE;
  --border-strong: #D5C8E3;

  /* Text */
  --text: #1E1629;
  --text-secondary: #534863;
  --text-muted: #7F7490;
  --link: #703D92;
  --link-hover: #4F256B;

  /* Status Colors (matching official Pi explorer green + crisp semantic tokens) */
  --success: #15803D;
  --success-bg: #E5F6D6;
  --success-border: #B5E194;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --danger-border: #FECACA;
  --warning: #B45309;
  --warning-bg: #FEF3C7;
  --warning-border: #FDE68A;
  --info: #2563EB;
  --info-bg: #DBEAFE;

  /* Shadows & Radii */
  --shadow-xs: 0 1px 2px rgba(45, 22, 66, 0.04);
  --shadow-sm: 0 2px 8px rgba(45, 22, 66, 0.06);
  --shadow-md: 0 8px 24px rgba(45, 22, 66, 0.09);
  --shadow-hero: 0 14px 36px rgba(61, 28, 84, 0.22);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0D0914;
  --surface: #161022;
  --surface-subtle: #1D162C;
  --surface-hover: #241B37;
  --border: #2C2142;
  --border-strong: #3E2F5C;

  --text: #F4EFFA;
  --text-secondary: #C5B9D6;
  --text-muted: #8E80A6;
  --link: #C28BF0;
  --link-hover: #DEB9FA;

  --pi-purple-soft: rgba(139, 77, 184, 0.16);
  --pi-purple-soft-2: rgba(139, 77, 184, 0.28);
  --pi-gold-soft: rgba(246, 177, 51, 0.14);

  --success: #4ADE80;
  --success-bg: rgba(34, 197, 94, 0.15);
  --success-border: rgba(74, 222, 128, 0.3);
  --danger: #F87171;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(248, 113, 113, 0.3);
  --warning: #FBBF24;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --warning-border: rgba(251, 191, 36, 0.3);
  --info: #60A5FA;
  --info-bg: rgba(59, 130, 246, 0.16);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.45);
}

/* Base Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--link); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--link-hover); }
button { font-family: inherit; cursor: pointer; }
code, pre, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================================
   Top Live Ticker Bar
   ============================================================================ */
.top-ticker-bar {
  background: var(--pi-purple-deeper);
  color: #EAE0F5;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-ticker-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
}

.ticker-left, .ticker-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.ticker-label { color: #BCAAD1; }
.ticker-item strong { color: #FFFFFF; font-weight: 600; }
.ticker-change {
  font-weight: 600;
  font-size: 11.5px;
  padding: 1px 6px;
  border-radius: 999px;
}
.ticker-change.up { background: rgba(74, 222, 128, 0.18); color: #86EFAC; }
.ticker-change.down { background: rgba(248, 113, 113, 0.2); color: #FCA5A5; }

.ticker-divider {
  width: 1px;
  height: 13px;
  background: rgba(255, 255, 255, 0.18);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.live-pill:hover { background: rgba(255, 255, 255, 0.18); }
.live-pill.paused { opacity: 0.7; }
.live-pill.paused .live-dot { background: #FBBF24; animation: none; }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: pulseDot 2s infinite;
  display: inline-block;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.65); }
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  transition: all 0.15s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.18); }

.watchlist-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--pi-gold);
  color: #2A1600;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* ============================================================================
   Header & Navigation
   ============================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-logo { border-radius: 10px; box-shadow: 0 3px 10px rgba(112, 61, 146, 0.25); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-dot { color: var(--pi-purple); }
[data-theme="dark"] .brand-dot { color: var(--pi-gold); }
.brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Network Switcher */
.network-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.net-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.net-btn:hover { color: var(--text); }
.net-btn.active {
  background: var(--pi-purple);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(112, 61, 146, 0.35);
}
.net-dot { width: 7px; height: 7px; border-radius: 50%; }
.net-mainnet { background: #22C55E; }
.net-testnet { background: #F6B133; }
.net-testnet2 { background: #38BDF8; }
.net-btn.active .net-mainnet { background: #86EFAC; }

/* Header Search */
.header-search {
  position: relative;
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
}
.header-search .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.header-search input:focus {
  border-color: var(--pi-purple);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(112, 61, 146, 0.14);
}
.kbd-hint {
  position: absolute;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--surface);
  pointer-events: none;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
}

/* Sub Navigation Tabs & Dropdowns */
.main-nav {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.main-nav-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-drop-trigger {
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
}
.nav-drop-trigger .chev {
  transition: transform 0.16s ease;
  opacity: 0.75;
}
.nav-dropdown.open .nav-drop-trigger .chev,
.nav-dropdown:hover .nav-drop-trigger .chev {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 268px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}
.dropdown-menu-right { left: auto; right: 0; }

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  transition: background 0.14s ease;
}
.dropdown-item:hover,
.dropdown-item.active {
  background: var(--pi-purple-soft);
  color: var(--pi-purple);
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item.active {
  color: #E2C4FA;
}
.dropdown-item strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.dropdown-item span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 5px 8px;
}

/* Segmented Toggle Pills (Daily / Weekly / Monthly, Thresholds) */
.seg-group {
  display: inline-flex;
  align-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 7px;
  transition: all 0.15s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--pi-purple);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(112, 61, 146, 0.28);
}

/* Stacked Share Bar (CEX Holdings) */
.stacked-bar {
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: var(--pi-purple-soft);
  margin: 12px 0;
}
.stacked-seg {
  height: 100%;
  transition: width 0.5s ease;
}

/* Calculator & Rank Form Inputs */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.field-group { margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field-input, .field-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-mono);
  outline: none;
}
.field-input:focus, .field-select:focus {
  border-color: var(--pi-purple);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(112, 61, 146, 0.14);
}

.rank-result-box {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--pi-purple-soft);
  border: 1px solid var(--pi-purple-soft-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 860px) {
  .calc-grid { grid-template-columns: 1fr; }
  .dropdown-menu-right { left: 0; right: auto; }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.nav-link:hover {
  color: var(--pi-purple);
  background: var(--surface-hover);
}
[data-theme="dark"] .nav-link:hover { color: #D8B4FE; }
.nav-link.active {
  color: var(--pi-purple);
  border-bottom-color: var(--pi-purple);
}
[data-theme="dark"] .nav-link.active {
  color: var(--pi-gold);
  border-bottom-color: var(--pi-gold);
}

.nav-badge-gold {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--pi-gold-soft);
  color: var(--pi-gold-dark);
  border: 1px solid rgba(246, 177, 51, 0.45);
}
[data-theme="dark"] .nav-badge-gold { color: var(--pi-gold); }

/* ============================================================================
   Hero Banner (Signature Pi Purple Gradient — Upgraded!)
   ============================================================================ */
.app-main { flex: 1; }

.hero-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #4B2368 0%, #703D92 52%, #8648AD 100%);
  color: #FFFFFF;
  padding: 36px 0 68px;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 80% at 88% 15%, rgba(246, 177, 51, 0.18) 0%, transparent 65%),
    radial-gradient(ellipse 50% 75% at 10% 90%, rgba(163, 78, 167, 0.28) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 28px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #FCE8B8;
  margin-bottom: 12px;
}

.hero-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: #FFFFFF;
}

.hero-subtitle {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14.5px;
  max-width: 650px;
}

.hero-search-form {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border-radius: 14px;
  padding: 5px;
  box-shadow: var(--shadow-hero);
  border: 2px solid rgba(246, 177, 51, 0.35);
  max-width: 720px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.hero-search-form:focus-within {
  border-color: var(--pi-gold);
}

.hero-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: #1E1629;
  font-size: 14.5px;
  padding: 11px 14px;
  min-width: 0;
}
.hero-search-input::placeholder { color: #827692; }

.hero-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #703D92, #572B75);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-weight: 700;
  font-size: 14px;
  transition: filter 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.hero-search-btn:hover { filter: brightness(1.12); }
.hero-search-btn:active { transform: scale(0.98); }

.hero-quick-samples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}
.sample-chip {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.sample-chip:hover { background: rgba(246, 177, 51, 0.28); border-color: var(--pi-gold); }

/* Right Hero Highlight Card */
.hero-price-card {
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.hero-price-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.hero-price-coin {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 14px;
}
.pi-coin-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD46B, #F6B133);
  color: #4A2366;
  font-weight: 900;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(246, 177, 51, 0.45);
}
.hero-price-val {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.hero-price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 12px;
}
.hero-price-grid span { color: rgba(255, 255, 255, 0.72); display: block; }
.hero-price-grid strong { font-family: var(--font-mono); font-size: 13px; color: #FFFFFF; }

/* ============================================================================
   Mainnet Metrics Cards (Overlapping Hero like top-tier explorers)
   ============================================================================ */
.metrics-overlap {
  margin-top: -38px;
  position: relative;
  z-index: 5;
  margin-bottom: 24px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.metric-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.metric-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pi-purple-soft);
  color: var(--pi-purple);
}
[data-theme="dark"] .metric-icon { color: #D8B4FE; }
.metric-icon.gold { background: var(--pi-gold-soft); color: var(--pi-gold-dark); }
[data-theme="dark"] .metric-icon.gold { color: var(--pi-gold); }
.metric-icon.green { background: var(--success-bg); color: var(--success); }

.metric-value {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.metric-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* Supply Progress Bar Card */
.supply-bar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: center;
}

.supply-bar-track {
  height: 12px;
  background: var(--pi-purple-soft);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  margin: 10px 0;
}
.supply-seg-locked {
  background: linear-gradient(90deg, #703D92, #9B59C7);
  height: 100%;
  transition: width 0.6s ease;
}
.supply-seg-unlocked {
  background: linear-gradient(90deg, #F6B133, #FFD166);
  height: 100%;
  transition: width 0.6s ease;
}

.supply-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ============================================================================
   Cards, Panels, Tables, Badges
   ============================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 18px 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.section-spacing { margin-bottom: 24px; }

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 11px 16px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-hover); }

.text-right { text-align: right !important; }
.text-muted { color: var(--text-muted); }

/* Feed Rows (Dashboard compact cards) */
.feed-list { display: flex; flex-direction: column; }
.feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.feed-row:last-child { border-bottom: none; }
.feed-row:hover { background: var(--surface-hover); }

.feed-row-new { animation: rowFlash 1.4s ease; }
@keyframes rowFlash {
  0% { background: var(--pi-purple-soft-2); }
  100% { background: transparent; }
}

.feed-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--pi-purple-soft);
  color: var(--pi-purple);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .feed-icon-box { color: #D8B4FE; }
.feed-icon-box.gold { background: var(--pi-gold-soft); color: var(--pi-gold-dark); }
[data-theme="dark"] .feed-icon-box.gold { color: var(--pi-gold); }
.feed-icon-box.green { background: var(--success-bg); color: var(--success); }

.feed-main {
  flex: 1;
  min-width: 0;
}
.feed-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.feed-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-right {
  text-align: right;
  flex-shrink: 0;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-purple { background: var(--pi-purple-soft); color: var(--pi-purple); border: 1px solid var(--pi-purple-soft-2); }
[data-theme="dark"] .badge-purple { color: #D8B4FE; }
.badge-gold { background: var(--pi-gold-soft); color: var(--pi-gold-dark); border: 1px solid rgba(246, 177, 51, 0.4); }
[data-theme="dark"] .badge-gold { color: var(--pi-gold); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--surface-subtle); color: var(--text-secondary); border: 1px solid var(--border); }

.amount-pill {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--pi-purple-soft);
  color: var(--pi-purple);
  white-space: nowrap;
}
[data-theme="dark"] .amount-pill { color: #E2C4FA; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s ease;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--pi-purple);
  color: #FFFFFF;
  border-color: var(--pi-purple);
}
.btn-primary:hover { background: var(--pi-purple-dark); color: #FFFFFF; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s ease;
  vertical-align: middle;
}
.copy-btn:hover {
  background: var(--pi-purple-soft);
  color: var(--pi-purple);
  border-color: var(--pi-purple-soft-2);
}

/* ============================================================================
   Page Headers, Breadcrumbs, Detail Views
   ============================================================================ */
.page-shell { padding: 24px 0 48px; }

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.page-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.hash-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
  max-width: 100%;
}

/* Key-Value Detail Grid */
.kv-list { display: flex; flex-direction: column; }
.kv-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.kv-row:last-child { border-bottom: none; }
.kv-key {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.kv-val {
  font-size: 13.5px;
  color: var(--text);
  word-break: break-word;
}

/* Tabs */
.tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  background: var(--surface-subtle);
  overflow-x: auto;
}
.tab-btn {
  border: none;
  background: transparent;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--pi-purple);
  border-bottom-color: var(--pi-purple);
}
[data-theme="dark"] .tab-btn.active {
  color: var(--pi-gold);
  border-bottom-color: var(--pi-gold);
}
.tab-count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--pi-purple-soft);
  color: var(--pi-purple);
}
[data-theme="dark"] .tab-count { color: #D8B4FE; }

/* Charts */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 170px;
}
.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #1E1629;
  color: #FFFFFF;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  z-index: 15;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s ease;
}

/* Lockup Checker Banner */
.lockup-hero-box {
  background: linear-gradient(135deg, rgba(112, 61, 146, 0.1), rgba(246, 177, 51, 0.1));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.lockup-form {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 280px;
  max-width: 560px;
}
.lockup-form input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  outline: none;
}
.lockup-form input:focus { border-color: var(--pi-purple); }

/* SEO Guide & FAQ Section (bottom of dashboard) */
.seo-faq-section {
  margin-top: 32px;
  padding-top: 10px;
}
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.faq-item summary {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.faq-item summary::after {
  content: '+';
  font-size: 18px;
  color: var(--pi-purple);
  font-weight: 600;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* API Docs Code Blocks */
.code-block {
  background: #171124;
  color: #E7DDF5;
  padding: 14px 16px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
  border: 1px solid #2D2246;
  max-height: 360px;
}

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

/* Watchlist Drawer & Modal */
.drawer-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 24, 0.55);
  backdrop-filter: blur(3px);
  z-index: 80;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(390px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 90;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
}
.drawer-header, .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h3, .modal-header h3 { margin: 0; font-size: 16px; }
.drawer-header .icon-btn, .modal-header .icon-btn {
  background: var(--surface-subtle);
  color: var(--text);
  border-color: var(--border);
}
.drawer-body, .modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop[hidden], .drawer[hidden], .drawer-backdrop[hidden] { display: none !important; }
.modal-card {
  width: min(640px, 96vw);
  max-height: 85vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #231733;
  color: #FFFFFF;
  border: 1px solid rgba(246, 177, 51, 0.4);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Spinners & Empty States */
.spinner-lg {
  width: 36px;
  height: 36px;
  border: 3px solid var(--pi-purple-soft-2);
  border-top-color: var(--pi-purple);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  padding: 42px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.footer-desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 14px;
  max-width: 380px;
}
.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
  padding: 5px 12px;
  border-radius: 999px;
}
.footer-col h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col a {
  color: var(--text-secondary);
  font-size: 13px;
}
.footer-col a:hover { color: var(--pi-purple); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================================
   Responsive Breakpoints
   ============================================================================ */
@media (max-width: 1080px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .supply-bar-card { grid-template-columns: 1fr; }
  .two-col-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hide-lg { display: none; }
}

@media (max-width: 768px) {
  .header-search { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .hide-md { display: none; }
  .kv-row { grid-template-columns: 1fr; gap: 4px; }
  .faq-grid { grid-template-columns: 1fr; }
  .hero-banner { padding: 26px 0 54px; }
  .hero-search-form { flex-direction: column; align-items: stretch; gap: 6px; padding: 6px; }
  .hero-search-btn { width: 100%; }
}

@media (max-width: 560px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hide-sm, .hide-xs { display: none; }
  .container { padding: 0 14px; }
  .brand-sub { display: none; }
}
