/* ═══════════════════════════════════════════════════════════
   divimarkets — Design Tokens & Component Styles
   Dark-first fintech aesthetic inspired by Robinhood / Webull / Coinbase
   ═══════════════════════════════════════════════════════════ */

@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Font families */
  --font-display: 'General Sans', 'Inter', sans-serif;
  --font-body: 'Inter', 'General Sans', sans-serif;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-default: 1280px;
  --content-wide: 1440px;
}

/* ── DARK THEME (default) ── */
:root, [data-theme="dark"] {
  --color-bg:             #0a0a0f;
  --color-surface:        #12121a;
  --color-surface-2:      #1a1a26;
  --color-surface-3:      #22222e;
  --color-surface-hover:  #2a2a38;
  --color-divider:        #2a2a38;
  --color-border:         #2a2a38;
  --color-border-subtle:  #1e1e2a;

  --color-text:           #eaeaf0;
  --color-text-secondary: #8b8b9e;
  --color-text-muted:     #5a5a70;

  --color-primary:        #00d4aa;
  --color-primary-hover:  #00e8bc;
  --color-primary-muted:  rgba(0, 212, 170, 0.12);
  --color-primary-glow:   rgba(0, 212, 170, 0.15);

  --color-success:        #00d68f;
  --color-success-bg:     rgba(0, 214, 143, 0.1);
  --color-danger:         #ff4757;
  --color-danger-bg:      rgba(255, 71, 87, 0.1);
  --color-warning:        #ffa502;
  --color-warning-bg:     rgba(255, 165, 2, 0.1);
  --color-blue:           #4e9fff;
  --color-blue-bg:        rgba(78, 159, 255, 0.1);
  --color-purple:         #a855f7;
  --color-purple-bg:      rgba(168, 85, 247, 0.1);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(0, 212, 170, 0.08);
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --color-bg:             #f5f5f8;
  --color-surface:        #ffffff;
  --color-surface-2:      #f8f8fb;
  --color-surface-3:      #f0f0f5;
  --color-surface-hover:  #eaeaf0;
  --color-divider:        #e2e2ea;
  --color-border:         #dcdce5;
  --color-border-subtle:  #eaeaf0;

  --color-text:           #1a1a2e;
  --color-text-secondary: #5a5a70;
  --color-text-muted:     #9090a5;

  --color-primary:        #00a88a;
  --color-primary-hover:  #009078;
  --color-primary-muted:  rgba(0, 168, 138, 0.08);
  --color-primary-glow:   rgba(0, 168, 138, 0.06);

  --color-success:        #059669;
  --color-success-bg:     rgba(5, 150, 105, 0.08);
  --color-danger:         #dc2626;
  --color-danger-bg:      rgba(220, 38, 38, 0.08);
  --color-warning:        #d97706;
  --color-warning-bg:     rgba(217, 119, 6, 0.08);
  --color-blue:           #2563eb;
  --color-blue-bg:        rgba(37, 99, 235, 0.08);
  --color-purple:         #7c3aed;
  --color-purple-bg:      rgba(124, 58, 237, 0.08);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 40px rgba(0, 168, 138, 0.04);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg:             #f5f5f8;
    --color-surface:        #ffffff;
    --color-surface-2:      #f8f8fb;
    --color-surface-3:      #f0f0f5;
    --color-surface-hover:  #eaeaf0;
    --color-divider:        #e2e2ea;
    --color-border:         #dcdce5;
    --color-border-subtle:  #eaeaf0;
    --color-text:           #1a1a2e;
    --color-text-secondary: #5a5a70;
    --color-text-muted:     #9090a5;
    --color-primary:        #00a88a;
    --color-primary-hover:  #009078;
    --color-primary-muted:  rgba(0, 168, 138, 0.08);
    --color-primary-glow:   rgba(0, 168, 138, 0.06);
    --color-success:        #059669;
    --color-success-bg:     rgba(5, 150, 105, 0.08);
    --color-danger:         #dc2626;
    --color-danger-bg:      rgba(220, 38, 38, 0.08);
    --color-warning:        #d97706;
    --color-warning-bg:     rgba(217, 119, 6, 0.08);
    --color-blue:           #2563eb;
    --color-blue-bg:        rgba(37, 99, 235, 0.08);
    --color-purple:         #7c3aed;
    --color-purple-bg:      rgba(124, 58, 237, 0.08);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 40px rgba(0, 168, 138, 0.04);
  }
}

/* ══════════════════════════════════════════════
   PASSWORD GATE
   ══════════════════════════════════════════════ */
#pwGate {
  position: fixed; inset: 0; z-index: 10001;
  background: var(--color-bg);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
  -webkit-overflow-scrolling: touch;
  overflow: hidden;
}
#pwGate.hidden { display: none; }

.gate-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-8);
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  text-align: center;
  margin-top: var(--space-6);
}

.gate-logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.gate-logo span { color: var(--color-primary); }

.gate-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: calc(-1 * var(--space-2));
}

.gate-badge {
  background: var(--color-primary-muted);
  color: var(--color-primary);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.gate-label {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: calc(-1 * var(--space-3));
}

.gate-input-wrap {
  width: 100%;
  position: relative;
}
.gate-input {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-10) var(--space-3) var(--space-4);
  color: var(--color-text);
  font-size: 16px;
  outline: none;
  transition: border-color var(--transition-fast);
}
.gate-input:focus { border-color: var(--color-primary); }
.gate-toggle {
  position: absolute; right: var(--space-3); top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; opacity: 0.6;
  color: var(--color-text);
}
.gate-toggle:hover { opacity: 1; }

.gate-submit {
  width: 100%;
  background: var(--color-primary);
  color: #000;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.gate-submit:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
.gate-submit:active { transform: translateY(0); }

.gate-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  min-height: 1.2em;
}

.gate-footer {
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

/* ══════════════════════════════════════════════
   TICKER BAR
   ══════════════════════════════════════════════ */
.ticker-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  overflow: hidden;
  white-space: nowrap;
  height: 32px;
  display: flex;
  align-items: center;
}
.ticker-content {
  display: inline-flex;
  gap: var(--space-8);
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  gap: var(--space-8);
  will-change: transform;
}
.ticker-symbol { color: var(--color-text-secondary); }
.ticker-price { color: var(--color-text); }
.ticker-change.pos { color: var(--color-success); }
.ticker-change.neg { color: var(--color-danger); }

/* ticker animation handled by JS */

/* ══════════════════════════════════════════════
   HEADER / NAV
   ══════════════════════════════════════════════ */
header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 32px;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.logo {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  letter-spacing: -0.02em;
}
.logo-text { display: inline; }
.logo-text > span { color: var(--color-primary); }

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

nav {
  display: flex;
  gap: var(--space-1);
}
.nav-btn {
  background: none;
  border: none;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.nav-btn:hover { color: var(--color-text); background: var(--color-surface-2); }
.nav-btn.active { color: var(--color-primary); background: var(--color-primary-muted); }

.theme-toggle {
  width: 36px; height: 36px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: background var(--transition-fast);
}
.theme-toggle::before { content: '🌙'; }
[data-theme="light"] .theme-toggle::before { content: '☀️'; }
.theme-toggle:hover { background: var(--color-surface-hover); }

/* ══════════════════════════════════════════════
   SEGMENT BAR
   ══════════════════════════════════════════════ */
.segment-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: var(--space-2) var(--space-6);
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.segment-bar::-webkit-scrollbar { display: none; }

.segment-btn {
  background: none;
  border: none;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.segment-btn:hover { color: var(--color-text); background: var(--color-surface-2); }
.segment-btn.active { color: var(--color-primary); background: var(--color-primary-muted); }

.seg-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

.segment-badge {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: var(--radius-full);
  padding: 0.1rem 0.35rem;
}
.segment-badge.live {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(0,214,143,0.2);
}
.segment-badge.soon {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(255,165,2,0.2);
}

/* ══════════════════════════════════════════════
   SCREENS
   ══════════════════════════════════════════════ */
.screen {
  display: none;
  padding: var(--space-6);
  max-width: var(--content-wide);
  margin: 0 auto;
}
.screen.active { display: block; }

/* ══════════════════════════════════════════════
   COMMON COMPONENTS
   ══════════════════════════════════════════════ */

/* Section headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  gap: var(--space-4);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.section-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

/* Controls / Sort */
.controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.sort-buttons {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.sort-btn {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.sort-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.sort-btn.active {
  background: var(--color-primary-muted);
  border-color: rgba(0,212,170,0.3);
  color: var(--color-primary);
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
}
.card h3 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--radius-full);
  padding: 0.15rem var(--space-2);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(0,214,143,0.2); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger);  border: 1px solid rgba(255,71,87,0.2); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(255,165,2,0.2); }
.badge-info    { background: var(--color-blue-bg);    color: var(--color-blue);    border: 1px solid rgba(78,159,255,0.2); }
.badge-purple  { background: var(--color-purple-bg);  color: var(--color-purple);  border: 1px solid rgba(168,85,247,0.2); }
.badge-primary { background: var(--color-primary-muted); color: var(--color-primary); border: 1px solid rgba(0,212,170,0.2); }

/* Info row */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: var(--text-xs);
}
.info-row:last-of-type { border-bottom: none; }
.info-label { color: var(--color-text-muted); }
.info-value { color: var(--color-text); font-weight: 600; text-align: right; }
.info-value.pos { color: var(--color-success); }
.info-value.neg { color: var(--color-danger); }

/* Price display */
.price-display {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}
.price-item {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  text-align: center;
}
.price-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); }
.price-value { font-size: var(--text-sm); font-weight: 800; color: var(--color-text); margin-top: var(--space-1); }
.price-item.bid .price-value { color: var(--color-success); }
.price-item.ask .price-value { color: var(--color-danger); }

/* Chart container */
.chart-container {
  height: 80px;
  margin: var(--space-3) 0 var(--space-2);
}

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-buy {
  background: var(--color-success-bg);
  border: 1px solid rgba(0,214,143,0.3);
  color: var(--color-success);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.btn-buy:hover { background: rgba(0,214,143,0.2); }
.btn-sell {
  background: var(--color-danger-bg);
  border: 1px solid rgba(255,71,87,0.3);
  color: var(--color-danger);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.btn-sell:hover { background: rgba(255,71,87,0.2); }

/* Tabs */
.tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: var(--space-1);
}
.tab {
  background: none;
  border: none;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: color var(--transition-fast), background var(--transition-fast);
  position: relative;
}
.tab::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0; right: 0;
  height: 2px;
  background: transparent;
  transition: background var(--transition-fast);
}
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-primary); }
.tab.active::after { background: var(--color-primary); }

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.stat-card {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
}
.stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
.stat-value {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text);
}
.stat-value.pos { color: var(--color-success); }
.stat-value.neg { color: var(--color-danger); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--color-text-muted);
}
.empty-state h3 { font-size: var(--text-base); font-weight: 700; margin-bottom: var(--space-2); color: var(--color-text-secondary); }
.empty-state p { font-size: var(--text-xs); }

/* Map */
#wellMap {
  height: 480px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin-top: var(--space-4);
}
.map-filter-row {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.map-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.map-filter-group label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}
.map-filter-group select {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  outline: none;
  cursor: pointer;
}

/* Segment content visibility */
.segment-content { display: none; }
.segment-content.active { display: block; }

/* ══════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  padding: var(--space-4);
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
}
.modal.active { display: flex; }

.modal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 640px;
  margin: var(--space-8) auto;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-hero {
  background: var(--color-surface-2);
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border-subtle);
  position: relative;
}
.modal-close {
  position: absolute;
  top: var(--space-4); right: var(--space-4);
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--color-danger-bg); color: var(--color-danger); border-color: var(--color-danger); }

.modal-hero h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  margin: var(--space-2) 0 var(--space-1);
  letter-spacing: -0.02em;
}
.modal-sub {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.modal-tabs {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.modal-tab {
  background: none;
  border: none;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.modal-tab:hover { color: var(--color-text); background: var(--color-surface-3); }
.modal-tab.active { color: var(--color-primary); background: var(--color-primary-muted); }

.modal-body {
  padding: var(--space-6);
}

/* ══════════════════════════════════════════════
   CRYPTO TABLE
   ══════════════════════════════════════════════ */
.crypto-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.crypto-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
}
.crypto-table thead th {
  background: var(--color-surface-2);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-subtle);
  white-space: nowrap;
}
.crypto-table tbody tr {
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background var(--transition-fast);
  cursor: pointer;
}
.crypto-table tbody tr:hover { background: var(--color-surface-2); }
.crypto-table tbody tr:last-child { border-bottom: none; }
.crypto-table tbody td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  font-weight: 500;
}
.crypto-coin-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.crypto-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.crypto-name { font-weight: 700; color: var(--color-text); }
.crypto-symbol { font-size: 0.65rem; color: var(--color-text-muted); }
.sparkline { height: 32px; width: 80px; }

/* ══════════════════════════════════════════════
   WALLET
   ══════════════════════════════════════════════ */
.wallet-banner {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.wallet-banner-text h3 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.wallet-banner-text p {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.wallet-btns {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.wallet-btn {
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.wallet-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

#walletStatus {
  font-size: var(--text-xs);
  color: var(--color-success);
  font-weight: 600;
}

/* ══════════════════════════════════════════════
   PREDICTION MARKETS — Kalshi-style compact
   ══════════════════════════════════════════════ */
.pk-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.pk-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-border); }
.pk-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-2); }
.pk-cat { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.pk-vol { font-size: 0.62rem; font-weight: 700; color: var(--color-text-muted); background: var(--color-surface-2); padding: 0.1rem var(--space-2); border-radius: var(--radius-full); }
.pk-question { font-size: var(--text-xs); font-weight: 700; color: var(--color-text); line-height: 1.35; margin-bottom: var(--space-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.pk-bar-wrap { background: var(--color-surface-2); border-radius: var(--radius-full); height: 4px; overflow: hidden; margin-bottom: var(--space-2); }
.pk-bar { height: 100%; border-radius: var(--radius-full); transition: width 0.4s ease; }
.pk-prices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-bottom: var(--space-2); }
.pk-yes { background: var(--color-blue-bg); border: 1px solid rgba(78,159,255,0.2); color: var(--color-blue); border-radius: var(--radius-md); padding: var(--space-2); font-size: var(--text-xs); font-weight: 800; cursor: pointer; text-align: center; transition: background var(--transition-fast); }
.pk-yes:hover { background: rgba(78,159,255,0.2); }
.pk-no { background: var(--color-surface-2); border: 1px solid var(--color-border-subtle); color: var(--color-text-secondary); border-radius: var(--radius-md); padding: var(--space-2); font-size: var(--text-xs); font-weight: 800; cursor: pointer; text-align: center; transition: background var(--transition-fast); }
.pk-no:hover { background: var(--color-surface-hover); }
.pk-foot { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--color-text-muted); }
.pred-category { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--space-2); }
.pred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.pred-filter-bar { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); flex-wrap: wrap; }
.pred-filter {
  background: var(--color-surface-2); border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full); padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs); font-weight: 600;
  cursor: pointer; color: var(--color-text-secondary);
}
.pred-filter.active, .pred-filter:hover {
  background: var(--color-primary-muted); color: var(--color-primary);
  border-color: rgba(0,212,170,0.3);
}
.pred-vol-chip {
  background: var(--color-primary-muted); color: var(--color-primary);
  border-radius: var(--radius-full);
  padding: 0.1rem var(--space-2); font-size: var(--text-xs); font-weight: 700;
}

/* ══════════════════════════════════════════════
   ASSET CARDS — Compact
   ══════════════════════════════════════════════ */
.ak-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.ak-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-border); }
.ak-top { margin-bottom: var(--space-2); }
.ak-badges { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.ak-yield { display: inline-block; background: var(--color-success-bg); color: var(--color-success); border-radius: var(--radius-full); padding: 0.15rem var(--space-2); font-size: 0.68rem; font-weight: 800; }
.ak-name { font-weight: 700; font-size: var(--text-sm); color: var(--color-text); margin-bottom: var(--space-1); line-height: 1.3; }
.ak-meta { font-size: 0.72rem; color: var(--color-text-muted); margin-bottom: var(--space-2); }
/* Keep old classes for modal compatibility */
.asset-card { background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-xl); padding: var(--space-4) var(--space-5); cursor: pointer; }
.asset-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-3); }
.asset-yield {
  background: var(--color-success-bg); border: 1px solid rgba(0,214,143,0.2); color: var(--color-success);
  border-radius: var(--radius-lg); padding: var(--space-2) var(--space-3); text-align: center; flex-shrink: 0;
}
.asset-yield .yield-num { font-size: var(--text-sm); font-weight: 800; display: block; }
.asset-yield .yield-lab { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; }

/* ══════════════════════════════════════════════
   MAP POPUP STYLES (Leaflet overrides)
   ══════════════════════════════════════════════ */
.leaflet-popup-content-wrapper {
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md) !important;
  color: var(--color-text) !important;
}
.leaflet-popup-tip { background: var(--color-surface) !important; }
.leaflet-popup-content { font-family: var(--font-body) !important; font-size: var(--text-xs) !important; }
.map-popup-title { font-weight: 700; margin-bottom: var(--space-1); }
.map-popup-meta { color: var(--color-text-secondary); font-size: 0.7rem; }

/* ══════════════════════════════════════════════
   NEWS
   ══════════════════════════════════════════════ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}
.news-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.news-card:hover { border-color: var(--color-border); box-shadow: var(--shadow-sm); }
.news-category {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.news-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: var(--space-2);
}
.news-excerpt {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--color-text-muted);
}
.news-source { font-weight: 700; }

/* ══════════════════════════════════════════════
   PORTFOLIO
   ══════════════════════════════════════════════ */
.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.port-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
}
.port-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
.port-stat-value {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.port-stat-value.pos { color: var(--color-success); }
.port-stat-value.neg { color: var(--color-danger); }

.port-section {
  margin-bottom: var(--space-6);
}
.port-section-title {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.port-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  font-size: var(--text-xs);
}
.port-table thead th {
  background: var(--color-surface-2);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-subtle);
}
.port-table tbody tr {
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background var(--transition-fast);
}
.port-table tbody tr:hover { background: var(--color-surface-2); }
.port-table tbody tr:last-child { border-bottom: none; }
.port-table tbody td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  font-weight: 500;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  max-width: 340px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-text { flex: 1; }
.toast-title { font-weight: 800; margin-bottom: 0.15rem; }
.toast-desc { color: var(--color-text-secondary); font-weight: 500; }

/* Order ticket */
.order-ticket {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  margin-top: var(--space-4);
}
.order-ticket-title {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--color-border-subtle);
}
.order-row:last-of-type { border-bottom: none; }
.order-label { color: var(--color-text-muted); }
.order-value { font-weight: 700; color: var(--color-text); }

/* Music cards — Unitized */
.mk-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.mk-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-border); }
.mk-top {
  background: var(--color-surface-2);
  padding: var(--space-2) var(--space-3);
  display: flex; align-items: center; gap: var(--space-2);
  position: relative;
}
.mk-name { font-size: var(--text-xs); font-weight: 800; line-height: 1.25; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-meta { font-size: 0.62rem; color: var(--color-text-muted); }
.mk-body { padding: var(--space-2) var(--space-3); }
.mk-badges { display: flex; gap: var(--space-1); flex-wrap: wrap; margin-bottom: var(--space-2); }
.mk-stats { display: flex; flex-wrap: wrap; gap: var(--space-1); font-size: 0.68rem; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.mk-stats span { background: var(--color-surface-2); padding: 0.1rem var(--space-2); border-radius: var(--radius-sm); }
.mk-stats strong { color: var(--color-text); font-weight: 700; }
.mc-term {
  background: var(--color-purple-bg); border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius-sm);
  padding: 0.05rem var(--space-2);
  font-size: 0.55rem; font-weight: 700; color: var(--color-purple);
  white-space: nowrap; flex-shrink: 0;
}
/* Basket card classes */
.music-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.music-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mc-header {
  background: var(--color-surface-2);
  padding: var(--space-2) var(--space-3);
  display: flex; align-items: center; gap: var(--space-2);
  position: relative;
}
.mc-artist { font-size: 0.62rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.mc-title { font-size: var(--text-xs); font-weight: 800; line-height: 1.25; color: var(--color-text); }
.mc-body { padding: var(--space-2) var(--space-3); }
.mc-kpi { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: var(--space-2); }
.mc-kpi-price { font-size: var(--text-sm); font-weight: 800; color: var(--color-text); }
.mc-kpi-yield { font-size: var(--text-xs); font-weight: 700; color: var(--color-success); }
.mc-detail {
  display: flex; justify-content: space-between;
  font-size: var(--text-xs); padding: var(--space-1) 0;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-subtle);
}
.mc-detail:last-of-type { border: none; }
.mc-detail strong { color: var(--color-text); font-weight: 700; }

/* ══════════════════════════════════════════════
   HOME SCREEN
   ══════════════════════════════════════════════ */
.home-hero {
  text-align: center;
  padding: var(--space-16) 0 var(--space-10);
  max-width: 680px;
  margin: 0 auto var(--space-10);
}
.home-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}
.home-hero h1 span { color: var(--color-primary); }
.home-hero p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-6);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.home-cta {
  background: var(--color-primary);
  color: #000;
  border: none;
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-8);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.home-cta:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
.home-cta:active { transform: translateY(0); }

.market-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.market-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.market-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-border); }
.market-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.market-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.market-card-desc {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}
.market-card-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.market-card-tag {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.1rem var(--space-2);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* ══════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════ */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-6);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-12);
}
.site-footer a {
  color: var(--color-primary);
  font-weight: 600;
  transition: color var(--transition-fast);
}
.site-footer a:hover { color: var(--color-primary-hover); }

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .grid, .pred-grid, .market-cards { grid-template-columns: 1fr; }
  .pk-question { -webkit-line-clamp: 3; }
  header { flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
  .header-right { width: 100%; justify-content: center; }
  nav { width: 100%; justify-content: center; }
  .segment-bar { padding: var(--space-2) var(--space-3); gap: var(--space-1); }
  .segment-btn { padding: var(--space-1) var(--space-3); font-size: 0.7rem; }
  .seg-icon { width: 14px; height: 14px; }
  .screen { padding: var(--space-4); }
  #wellMap { height: 350px; }
  .map-filter-row { flex-direction: column; gap: var(--space-2); }
  .crypto-table-wrap { overflow-x: auto; }
  .crypto-table { min-width: 700px; }
  .modal-content { max-width: 100%; margin: var(--space-2) 0; }
  .modal.active { padding: var(--space-2); }
  .modal-body { padding: var(--space-4); }
  .portfolio-summary { grid-template-columns: repeat(2, 1fr); }
  .port-table { display: block; overflow-x: auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .wallet-banner { flex-direction: column; text-align: center; }
  .news-grid { grid-template-columns: 1fr; }
  .home-hero { padding: var(--space-8) 0 var(--space-6); }
  .home-hero h1 { font-size: var(--text-xl); }
}


/* ══════════════════════════════════════════════
   LOGO IMAGE
   ══════════════════════════════════════════════ */
.logo-img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

/* ══════════════════════════════════════════════
   HERO LOGO
   ══════════════════════════════════════════════ */
.hero-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-4);
  display: block;
  filter: drop-shadow(0 0 24px rgba(0,160,255,0.25));
}

/* ══════════════════════════════════════════════
   HOME STATS BAR
   ══════════════════════════════════════════════ */
.home-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  max-width: 700px;
  margin: 0 auto var(--space-10);
}
.home-stat {
  text-align: center;
}
.home-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-primary);
}
.home-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ══════════════════════════════════════════════
   HOME SECTION TITLE
   ══════════════════════════════════════════════ */
.home-section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-6);
}

/* ══════════════════════════════════════════════
   MARKET CARDS GRID — 5 balanced cards
   ══════════════════════════════════════════════ */
.market-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  max-width: var(--content-default);
  margin: 0 auto var(--space-10);
  padding: 0 var(--space-4);
}
@media (max-width: 1024px) {
  .market-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 640px) {
  .market-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mc-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.mc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}
.mc-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto var(--space-3);
}
.mc-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.mc-desc {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin-bottom: var(--space-2);
}
.mc-tags {
  display: flex;
  gap: var(--space-1);
  justify-content: center;
  flex-wrap: wrap;
}
.mc-tags span {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-weight: 600;
}

/* ══════════════════════════════════════════════
   TICKER — fixed to top of page, always visible
   ══════════════════════════════════════════════ */
.ticker-bar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
}
body {
  padding-top: 32px;
}


/* ══════════════════════════════════════════════
   PORTFOLIO DONUT & ACTIONS
   ══════════════════════════════════════════════ */
.port-donut-section {
  display: flex;
  gap: var(--space-8);
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}
.port-donut-wrap {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
}
.port-donut-legend {
  flex: 1;
  min-width: 0;
}
.port-donut-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.port-donut-score-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.port-donut-score-bar {
  flex: 1;
  height: 6px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.port-donut-score-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.port-donut-score-text {
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}
.port-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  margin-bottom: var(--space-2);
}
.port-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.port-legend-label {
  color: var(--color-text-secondary);
  flex: 1;
}
.port-legend-pct {
  font-weight: 700;
  color: var(--color-text);
}
.port-holdings-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.port-action-btns {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.port-btn {
  padding: var(--space-2) var(--space-4) !important;
  font-size: 0.75rem !important;
  min-width: 80px;
}
.port-holding-card {
  transition: border-color var(--transition-fast);
}
.port-holding-card:hover {
  border-color: var(--color-primary);
}
@media (max-width: 768px) {
  .port-donut-section {
    flex-direction: column;
    align-items: stretch;
  }
  .port-donut-wrap {
    width: 160px;
    height: 160px;
    margin: 0 auto;
  }
  .port-action-btns {
    width: 100%;
    margin-top: var(--space-2);
  }
  .port-btn {
    flex: 1;
  }
}

/* ══════════════════════════════════════════════
   GATE LOGO — no space
   ══════════════════════════════════════════════ */
.gate-logo span {
  margin-left: -0.1em;
}


/* ═══════ FILTER BAR ═══════ */
.filter-bar{display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap;padding:0.75rem 0;margin-bottom:0.5rem;}
.filter-group{display:flex;flex-direction:column;gap:0.2rem;}
.filter-group label{font-size:0.65rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted);}
.filter-group select{padding:0.4rem 0.65rem;border:1px solid var(--color-border);border-radius:var(--radius-lg);font-size:16px;font-weight:600;outline:none;cursor:pointer;background:var(--color-surface-2);color:var(--color-text);min-width:110px;transition:border-color 0.2s;}
.filter-group select:hover{border-color:var(--color-primary);}
.filter-group select:focus{border-color:var(--color-primary);box-shadow:0 0 0 2px rgba(74,222,128,0.15);}

/* ═══════ TRADE BUTTON ═══════ */
.btn-trade{width:100%;padding:0.55rem 1rem;border:none;border-radius:8px;font-size:0.82rem;font-weight:700;cursor:pointer;color:#fff;background:linear-gradient(135deg,#3b82f6,#6366f1);transition:all 0.2s;letter-spacing:0.02em;}
.btn-trade:hover{background:linear-gradient(135deg,#2563eb,#4f46e5);transform:translateY(-1px);box-shadow:0 4px 12px rgba(59,130,246,0.3);}
.btn-trade.port-btn{padding:0.45rem 1.2rem;font-size:0.78rem;width:auto;}

/* ═══════ MAP TILES ═══════ */
