/* ============================================
   Sygnal Markets — Trade Smarter.
   Premium fintech design system
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@700&display=swap');

/* ── LANDING PAGE ── */
.landing {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}
.landing-content {
    max-width: 640px;
    padding: 48px 24px;
    text-align: center;
}
.landing-badge {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--accent);
    font-weight: 700;
    border: 1px solid rgba(0,136,255,0.2);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 24px;
}
.landing-title {
    font-family: 'Space Grotesk', var(--font);
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text);
    margin-bottom: 8px;
    padding-bottom: 6px;
    line-height: 1.15;
}
.landing-subtitle {
    font-family: var(--font);
    font-size: 16px;
    letter-spacing: 4px;
    color: var(--text-dim);
    font-weight: 400;
    margin-bottom: 24px;
}
.landing-desc {
    font-size: 15px;
    color: var(--text-mid);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
.landing-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 40px;
    text-align: left;
}
.landing-feature {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.landing-feature-icon {
    font-size: 20px;
    display: block;
    margin-bottom: 8px;
}
.landing-feature-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}
.landing-feature-desc {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}
.landing-cta {
    display: inline-block;
    padding: 16px 48px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    letter-spacing: 1px;
    transition: opacity 0.2s;
    margin-bottom: 12px;
}
.landing-cta:hover { opacity: 0.9; }
.landing-note {
    font-size: 12px;
    color: var(--text-dim);
}
@media (max-width: 600px) {
    .landing-title { font-size: 34px; letter-spacing: 3px; }
    .landing-features { grid-template-columns: 1fr; }
    .landing-content { padding: 32px 16px; }
}

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

:root {
    --bg: #0a0a12;
    --bg-card: #12121f;
    --bg-card-hover: #1a1a2e;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(0, 136, 255, 0.25);
    --text: #eaeaef;
    --text-dim: #55556a;
    --text-mid: #8888a0;
    --accent: #0088ff;
    --accent-glow: rgba(0, 136, 255, 0.1);
    --green: #00d68f;
    --red: #ff3b5c;
    --gold: #ffb800;
    --purple: #8b5cf6;
    --radius: 14px;
    --font: 'Sora', -apple-system, sans-serif;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
canvas { max-width: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    letter-spacing: -0.01em;
}

/* ── NAVIGATION ── */
nav {
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    height: 60px;
    background: rgba(10, 10, 18, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #fff;
    line-height: 1.2;
}

.logo-tag {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.nav-links > a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 10px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.nav-links > a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.nav-links > a.active {
    color: var(--accent);
    background: var(--accent-glow);
}

/* ── NAV MORE DROPDOWN ── */
.nav-more {
    position: relative;
}
.nav-more-btn {
    color: var(--text-dim);
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 12.5px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-more-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-more-btn.active { color: var(--accent); background: var(--accent-glow); border-color: rgba(0,136,255,0.2); }

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 16px;
    height: 14px;
    justify-content: center;
}
.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.nav-more-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    min-width: 160px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 10000;
}
.nav-more-menu.open { display: flex; flex-direction: column; }
.nav-more-menu a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.15s;
}
.nav-more-menu a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-more-menu a.active { color: var(--accent); background: var(--accent-glow); }
body.light .nav-more-btn { color: #8890a0; border-color: rgba(0,0,0,0.1); }
body.light .nav-more-btn:hover { color: #1a1a2e; background: rgba(0,0,0,0.04); }
body.light .nav-more-btn.active { color: #0066cc; background: rgba(0,102,204,0.08); }
body.light .nav-more-menu { background: #fff; border-color: rgba(0,0,0,0.1); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
body.light .nav-more-menu a { color: #5a6070; }
body.light .nav-more-menu a:hover { color: #1a1a2e; background: rgba(0,0,0,0.04); }
body.light .nav-more-menu a.active { color: #0066cc; background: rgba(0,102,204,0.08); }

/* Nav search bar — centered */
.nav-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 9px 18px;
    flex: 1;
    min-width: 180px;
    max-width: 520px;
    margin: 0 auto;
    transition: all 0.25s;
}

.nav-search:focus-within {
    border-color: var(--accent);
    background: rgba(0, 136, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.08);
}

.nav-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    width: 100%;
}

.nav-search input::placeholder {
    color: #444;
}

/* ── HERO ── */
.hero {
    text-align: center;
    padding: 60px 20px 32px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(0, 136, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-family: 'Space Grotesk', var(--font);
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -1px;
    color: #4dc9ff;
    margin-bottom: 8px;
    padding: 0;
    line-height: 1.3;
    text-shadow: 0 0 40px rgba(0, 136, 255, 0.25);
    animation: hero-enter 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
    overflow: visible;
}

@keyframes title-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tagline {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 5px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 12px;
}

.hero p:last-of-type {
    font-size: 15px;
    color: var(--text-dim);
    max-width: 420px;
    margin: 0 auto;
}

/* ── STATS BAR ── */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    margin: 0 40px;
    max-width: 100%;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 500;
}

/* ── SECTIONS ── */
section {
    padding: 36px 40px;
    max-width: 1240px;
    margin: 0 auto;
}

section h2 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

section h2 span {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 400;
}

/* ── MARKET GRID ── */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

/* ── MARKET CARD ── */
.market-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
}

.market-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 0.2s;
}

.market-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,136,255,0.1);
}

.market-card:hover::before {
    opacity: 1;
}

.market-card h3 {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.45;
    letter-spacing: -0.2px;
    min-height: 42px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── PRICES ── */
.prices {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 10px;
}

.price-pill {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.price-yes {
    background: rgba(0, 214, 143, 0.1);
    color: var(--green);
    border: 1px solid rgba(0, 214, 143, 0.2);
}

.price-no {
    background: rgba(255, 59, 92, 0.1);
    color: var(--red);
    border: 1px solid rgba(255, 59, 92, 0.2);
}

.price-change {
    font-size: 11px;
    font-weight: 700;
}

.volume {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 10px;
}

/* ── BADGES ── */
.badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    padding: 3px 8px;
    border-radius: 5px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.kalshi-badge {
    background: rgba(0, 136, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 136, 255, 0.2);
}

.poly-badge {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.arb-badge {
    background: rgba(255, 184, 0, 0.1);
    color: var(--gold);
    border: 1px solid rgba(255, 184, 0, 0.2);
}

/* ── ARBITRAGE CARD ── */
.arb-card {
    border-color: rgba(255, 184, 0, 0.15);
}

.arb-card:hover {
    border-color: rgba(255, 184, 0, 0.4);
}

/* ── PLATFORM HEADER ── */
.platform-header {
    grid-column: 1 / -1;
    padding: 16px 0 4px;
}

.platform-header h3 {
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--text-dim);
    font-weight: 600;
}

/* ── AI POPUP ── */
#ai-popup {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

#ai-popup-content {
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    position: relative;
}

#ai-popup-content h3 {
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-right: 30px;
    line-height: 1.4;
}

#ai-body {
    color: var(--text-mid);
    font-size: 14px;
    line-height: 1.7;
}

#ai-body p {
    margin-bottom: 12px;
}

.ai-section {
    padding: 10px 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--border);
    font-size: 13px;
    line-height: 1.6;
}

.verdict {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    letter-spacing: 0.5px;
}

.verdict-yes {
    background: rgba(0, 214, 143, 0.08);
    border: 1px solid rgba(0, 214, 143, 0.2);
    color: var(--green);
}

.verdict-no {
    background: rgba(255, 59, 92, 0.08);
    border: 1px solid rgba(255, 59, 92, 0.2);
    color: var(--red);
}

.verdict-hold {
    background: rgba(255, 184, 0, 0.08);
    border: 1px solid rgba(255, 184, 0, 0.2);
    color: var(--gold);
}

#ai-close {
    position: absolute;
    top: 16px; right: 20px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}

#ai-close:hover {
    color: var(--red);
}

/* ── FILTERS ── */
#filters {
    padding-bottom: 0;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* ── FILTER CHIPS ── */
.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 8px 16px;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.chip:hover {
    border-color: rgba(255,255,255,0.12);
    color: var(--text);
    background: rgba(255,255,255,0.06);
}

.chip.active {
    background: rgba(0, 136, 255, 0.12);
    border-color: rgba(0, 136, 255, 0.2);
    color: var(--accent);
    font-weight: 600;
}


/* ── PARTICLES CANVAS ── */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Everything else above particles */
section, .stats-bar {
    position: relative;
    z-index: 1;
}
#filters {
    position: relative;
    z-index: 200;
}

#ai-popup {
    position: fixed;
    z-index: 10000;
}

/* market-detail styles are below in MARKET DETAIL OVERLAY section */

/* ── APPLE-STYLE SCROLL ANIMATIONS ── */
.reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Cards fade in via IntersectionObserver */
.market-card {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}
.market-card.card-visible {
    opacity: 1;
    transform: translateY(0);
}
/* Platform headers should always be visible */
.platform-header, .trending-section-header {
    opacity: 1 !important;
    transform: none !important;
}

/* Hero elements animate in on load */
.hero h1 {
    animation: hero-enter 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}
.tagline {
    animation: hero-enter 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}
.hero p:last-of-type {
    animation: hero-enter 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}
.hero-logo {
    animation: hero-enter 1s cubic-bezier(0.16, 1, 0.3, 1) 0s both;
}

@keyframes hero-enter {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── REFRESH COUNTDOWN ── */
.refresh-countdown {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 400;
    margin-left: 12px;
}

/* ── SPARKLINE CHART ── */
.sparkline {
    margin-top: 12px;
    height: 30px;
    width: 100%;
}

.sparkline canvas {
    width: 100%;
    height: 30px;
}


/* ── BOT PANEL ── */
#bot-panel {
    border-bottom: 1px solid var(--border);
}

.bot-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.bot-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.bot-stat-label {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.bot-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.bot-stat-value.running {
    color: var(--green);
}

.bot-stat-value.stopped {
    color: var(--red);
}

.bot-position {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-position-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.bot-position-side {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

.bot-position-pnl {
    font-size: 14px;
    font-weight: 600;
}

.bot-position-pnl.positive { color: var(--green); }
.bot-position-pnl.negative { color: var(--red); }

/* ── CARD TOP ROW (badge + AI button) ── */
.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-btn {
    background: rgba(0, 136, 255, 0.1);
    border: 1px solid rgba(0, 136, 255, 0.2);
    color: var(--accent);
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}

.ai-btn:hover {
    background: rgba(0, 136, 255, 0.25);
    border-color: var(--accent);
    transform: scale(1.1);
}

/* ── THEME TOGGLE BUTTON ── */
/* ── SETTINGS DROPDOWN ── */
.settings-dropdown {
    position: relative;
    z-index: 999;
    margin-left: auto;
    flex-shrink: 0;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.settings-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
}

.settings-menu {
    display: none;
    position: absolute;
    top: 44px;
    right: -8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 200px;
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 999;
}

.settings-menu.open {
    display: block;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: background 0.15s;
}

.settings-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.settings-item span:first-child {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.theme-btn {
    display: none; /* hidden — replaced by settings dropdown */
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
}

/* ── LIGHT THEME ── */
body.light {
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f2f5;
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 136, 255, 0.3);
    --text: #1a1a2e;
    --text-dim: #8890a0;
    --text-mid: #5a6070;
    --accent: #0066cc;
    --accent-glow: rgba(0, 102, 204, 0.1);
    --green: #00b374;
    --red: #e53e3e;
    --gold: #d4a017;
    --purple: #7c3aed;
}

body.light nav {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(0,0,0,0.08);
}

body.light .logo-text { color: #1a1a2e; }
body.light .stat-value { color: #1a1a2e; }
body.light .bot-stat-value { color: #1a1a2e; }
body.light section h2 { color: #1a1a2e; }
body.light .hero h1 {
    color: #0066cc;
    text-shadow: none;
}
body.light .hero .tagline { color: #0066cc; }
body.light .hero p { color: #8890a0; }
body.light #particles { opacity: 0.15; }
body.light .settings-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); color: #5a6070; }
body.light .settings-btn:hover { background: rgba(0,0,0,0.08); }
body.light .settings-menu { background: #fff; border-color: rgba(0,0,0,0.1); box-shadow: 0 10px 40px rgba(0,0,0,0.12); }
body.light .settings-item { color: #1a1a2e; }
body.light .settings-item:hover { background: rgba(0,0,0,0.04); }
body.light .nav-search { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
body.light .nav-search input { color: #1a1a2e; }
body.light .nav-search input::placeholder { color: #aab0b8; }
body.light .nav-links > a { color: #8890a0; }
body.light .nav-links > a:hover { color: #1a1a2e; background: rgba(0,0,0,0.04); }
body.light .nav-links > a.active { color: #0066cc; background: rgba(0,102,204,0.08); }
body.light .refresh-countdown { color: #8890a0; }
body.light .mobile-nav { background: rgba(255,255,255,0.95); border-top-color: rgba(0,0,0,0.08); }
body.light .mobile-nav-item { color: #8890a0; }
body.light .mobile-nav-item.active { color: #0066cc; }
body.light .card-sygnal-label { color: #8890a0; }
body.light .card-sygnal-score { filter: brightness(0.75) saturate(0.85); }
body.light .card-signal { filter: brightness(0.8) saturate(0.9); }
body.light .market-card { box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
body.light .market-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
body.light #market-detail { background: rgba(0,0,0,0.4); }
body.light #market-detail-content { background: #fff; }
body.light #ai-popup { background: rgba(0,0,0,0.4); }
body.light #ai-popup-content { background: #fff; color: #1a1a2e; border-color: rgba(0,0,0,0.1); }
body.light .toast { background: #0066cc; color: #fff; }
body.light .custom-select-btn { background: #fff; border-color: rgba(0,0,0,0.1); color: #1a1a2e; }
body.light .custom-select-btn:hover { background: #f0f2f5; }
body.light .custom-select-menu { background: #fff; border-color: rgba(0,0,0,0.1); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
body.light .custom-select-option { color: #5a6070; }
body.light .custom-select-option:hover { background: rgba(0,0,0,0.04); color: #1a1a2e; }
body.light .custom-select-option.active { color: #0066cc; background: rgba(0,102,204,0.08); }

/* Buy buttons — light */
body.light .buy-yes { background: rgba(0, 179, 116, 0.1); color: #00b374; border-color: rgba(0, 179, 116, 0.3); }
body.light .buy-no { background: rgba(229, 62, 62, 0.1); color: #e53e3e; border-color: rgba(229, 62, 62, 0.3); }
body.light .buy-yes:hover { background: #00b374; color: #fff; }
body.light .buy-no:hover { background: #e53e3e; color: #fff; }

/* ── MARKET DETAIL OVERLAY ── */
#market-detail {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999 !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#market-detail-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

#market-detail-content::-webkit-scrollbar {
    width: 6px;
}

#market-detail-content::-webkit-scrollbar-track {
    background: transparent;
}

#market-detail-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

#market-detail-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

.detail-close {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
}
.detail-close:hover { color: var(--text); }

#detail-title {
    font-size: 20px;
    font-weight: 700;
    margin: 12px 0 16px;
    color: var(--text);
    line-height: 1.3;
}

.detail-price-row {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.detail-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.detail-price-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    opacity: 0.6;
}

.detail-price-value {
    font-size: 36px;
    font-weight: 800;
}

#detail-chart {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 16px;
}

.detail-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.detail-stats-grid > div {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
}

.detail-stat-label {
    font-size: 12px;
    color: var(--text-dim);
    flex-shrink: 0;
    margin-right: 8px;
}

.detail-stat-value {
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Detail page Sygnal Score */
.detail-sygnal-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.detail-sygnal-score {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-sygnal-num {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.detail-sygnal-label {
    font-size: 7px;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    font-weight: 700;
    margin-top: 3px;
}

.detail-sygnal-info {
    font-size: 14px;
    color: var(--text-mid);
}

.detail-btn-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.detail-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
}

.detail-btn-yes {
    background: rgba(0, 214, 143, 0.1);
    color: var(--green);
    border-color: rgba(0, 214, 143, 0.3);
}
.detail-btn-yes:hover { background: var(--green); color: #000; }

.detail-btn-no {
    background: rgba(255, 59, 92, 0.1);
    color: var(--red);
    border-color: rgba(255, 59, 92, 0.3);
}
.detail-btn-no:hover { background: var(--red); color: #fff; }

/* Paper trade section inside detail */
.paper-trade-section {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.paper-trade-section h4 {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.paper-trade-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.paper-trade-row select,
.paper-trade-row input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
}

.paper-trade-row select { width: 80px; }
.paper-trade-row input { width: 100px; }

.detail-btn-paper {
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple);
    border-color: rgba(139, 92, 246, 0.3);
    flex: 1;
}
.detail-btn-paper:hover { background: var(--purple); color: #fff; }

.paper-cost {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 8px;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green);
    color: #000;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    z-index: 9999;
    animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toast-out {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ── AI MARKET BRIEF ── */
.brief-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 0 auto 24px;
    max-width: calc(100% - 32px);
}

.brief-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.brief-time {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.brief-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-mid);
    margin-bottom: 16px;
}

.brief-section {
    margin-bottom: 12px;
}

.brief-section h4 {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.brief-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.brief-item-title {
    font-size: 13px;
    color: var(--text);
}

.brief-item-value {
    font-size: 13px;
    font-weight: 600;
}

/* ── WATCHLIST STAR ── */
.star-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-dim);
    transition: all 0.2s;
    padding: 0 4px;
    line-height: 1;
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-btn.starred {
    color: var(--gold);
}

/* ── BUY BUTTONS ── */
.buy-btns {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.buy-btn {
    flex: 1;
    padding: 6px 0;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: block;
}

.buy-yes {
    background: rgba(0, 214, 143, 0.1);
    border: 1px solid rgba(0, 214, 143, 0.25);
    color: var(--green);
}

.buy-yes:hover {
    background: rgba(0, 214, 143, 0.2);
    border-color: var(--green);
}

.buy-no {
    background: rgba(255, 59, 92, 0.1);
    border: 1px solid rgba(255, 59, 92, 0.25);
    color: var(--red);
}

.buy-no:hover {
    background: rgba(255, 59, 92, 0.2);
    border-color: var(--red);
}

/* ── SKELETON LOADING ── */
.skeleton-card {
    min-height: 180px;
}

.skel {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.skel-badge { width: 60px; height: 18px; margin-bottom: 12px; }
.skel-title { width: 80%; height: 16px; margin-bottom: 8px; }
.skel-title-sm { width: 55%; height: 14px; margin-bottom: 16px; }
.skel-prices { width: 70%; height: 20px; margin-bottom: 12px; }
.skel-chart { width: 100%; height: 30px; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── CATEGORY DOT ── */
.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ── PRICE CHANGE ── */
.price-change {
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}

/* ── SYGNAL SCORE ── */
.sygnal-score {
    font-size: 12px;
    font-weight: 800;
    font-family: var(--font);
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* ── SHARE BUTTON ── */
.share-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-dim);
    transition: all 0.2s;
    padding: 0 2px;
    line-height: 1;
}

.share-btn:hover {
    color: var(--accent);
    transform: scale(1.2);
}

/* ── MOVERS HEADER ── */
.movers-header h3 {
    color: var(--gold) !important;
    font-size: 12px !important;
}

/* ── SYGNAL SCORE EXPLAINER — full-width banner ── */
.sygnal-explainer {
    width: 100%;
    max-width: 100%;
    padding: 0;
    position: relative;
    z-index: 1;
}

.sygnal-explainer-card {
    background: linear-gradient(135deg, rgba(0, 136, 255, 0.08) 0%, rgba(0, 214, 143, 0.04) 50%, rgba(139, 92, 246, 0.06) 100%);
    border-top: 1px solid rgba(0, 136, 255, 0.15);
    border-bottom: 1px solid rgba(0, 136, 255, 0.15);
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 40px 40px;
    text-align: center;
    width: 100%;
}

/* Explainer Top: intro text + demo score side by side */
.explainer-top {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto 28px;
}

.explainer-intro {
    flex: 1;
    text-align: left;
}

.explainer-intro h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.explainer-intro p {
    font-size: 15px;
    color: var(--text-mid);
    line-height: 1.6;
    margin: 0;
}

.explainer-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.demo-score {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 214, 143, 0.06);
}

.demo-score-num {
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
}

.demo-score-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-top: 2px;
}

.demo-score-tag {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

/* Factors row */
.sygnal-factors {
    display: flex;
    flex-direction: row;
    gap: 12px;
    text-align: left;
    max-width: 900px;
    margin: 0 auto 24px;
}

.sygnal-factor {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex: 1;
    transition: background 0.2s;
}

.sygnal-factor:hover {
    background: rgba(255, 255, 255, 0.07);
}

.sygnal-factor-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.sygnal-factor strong {
    display: block;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.sygnal-factor span {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Bottom: scale + features side by side */
.explainer-bottom {
    display: flex;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto 24px;
}

.sygnal-scale {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.sygnal-scale-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scale-bar {
    width: 4px;
    height: 28px;
    border-radius: 2px;
    flex-shrink: 0;
}

.sygnal-scale-item {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    flex-shrink: 0;
    min-width: 42px;
}

.scale-desc {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}

.explainer-features {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.explainer-feat {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.5;
}

.explainer-feat > span:first-child {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Dismiss button */
.sygnal-dismiss {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sygnal-dismiss:hover {
    background: #0077dd;
    transform: translateY(-1px);
}

/* ── SHOW ALL TOGGLE ── */
.show-all-chip {
    background: rgba(255, 184, 0, 0.08) !important;
    border-color: rgba(255, 184, 0, 0.2) !important;
    color: var(--gold) !important;
    font-size: 12px !important;
    white-space: nowrap;
}

/* ── FILTER + SORT ROW ── */
.filter-sort-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ── CUSTOM SORT DROPDOWN ── */
.custom-select {
    position: relative;
    z-index: 200;
}
.custom-select-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.custom-select-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.custom-select-btn svg {
    opacity: 0.5;
    transition: transform 0.2s;
}
.custom-select.open .custom-select-btn svg {
    transform: rotate(180deg);
}
.custom-select-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 190px;
    padding: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    z-index: 9999;
}
.custom-select-menu.open {
    display: block;
    animation: dropdown-in 0.15s ease;
}
@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.custom-select-option {
    padding: 9px 14px;
    font-size: 13px;
    font-family: var(--font);
    color: var(--text-mid);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.custom-select-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}
.custom-select-option.active {
    color: var(--accent);
    background: var(--accent-glow);
    font-weight: 600;
}

/* ── PORTFOLIO CHART ── */
.portfolio-chart-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.portfolio-chart-section canvas {
    width: 100%;
    height: 150px;
    border-radius: 8px;
}

/* ── CORRELATIONS ── */
.corr-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

.corr-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
}

.corr-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.corr-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.corr-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.corr-cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.corr-count {
    font-size: 12px;
    color: var(--text-dim);
}

.corr-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.corr-stats > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.corr-label {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.corr-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.corr-top-market {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 10px;
}

.corr-market-name {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.corr-related {
    margin-top: 8px;
}

.corr-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.corr-tag {
    background: rgba(0, 136, 255, 0.08);
    border: 1px solid rgba(0, 136, 255, 0.15);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
}

.corr-card-platform {
    border-color: rgba(255, 184, 0, 0.15);
}

.corr-platform-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.corr-platform {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.corr-platform-vs {
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 600;
}

.corr-platform-avg {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.corr-platform-count {
    font-size: 11px;
    color: var(--text-dim);
}

.corr-insight {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

/* ── IMPROVED ARBITRAGE ── */
.arb-comparison {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.arb-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.arb-vs {
    font-size: 16px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.arb-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.arb-question {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.3;
}

.arb-profit-row {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.arb-profit-row > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.arb-profit-label {
    font-size: 11px;
    color: var(--text-dim);
}

.arb-profit-value {
    font-size: 15px;
    font-weight: 700;
}

/* ── HIDDEN SECTIONS (tab navigation) ── */
.view-hidden {
    display: none !important;
}

/* ── MOBILE ── */
@media (max-width: 768px) {
    nav {
        padding: 0 12px;
        gap: 6px;
        flex-wrap: wrap;
        height: auto;
        min-height: 56px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .logo { gap: 6px; }
    .logo-text { font-size: 16px; }
    .logo-tag { display: none; }
    .nav-search { display: none; }
    .nav-links {
        gap: 2px;
    }
    .nav-links > a {
        font-size: 11px;
        padding: 5px 10px;
        white-space: nowrap;
    }
    .hero {
        padding: 40px 16px 24px;
    }
    .hero h1 {
        font-size: 28px;
        letter-spacing: -0.5px;
        line-height: 1.3;
    }
    .tagline {
        font-size: 12px;
        letter-spacing: 4px;
    }
    .hero p:last-of-type {
        font-size: 12px;
    }
    .stats-bar {
        gap: 12px;
        margin: 0 12px;
        padding: 12px;
    }
    .stat-value { font-size: 16px; }
    .stat-label { font-size: 9px; }
    section {
        padding: 16px 12px;
    }
    section h2 {
        font-size: 16px;
        flex-wrap: wrap;
    }
    .market-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .market-card {
        padding: 14px;
    }
    .market-card h3 {
        font-size: 13px;
    }
    .filter-sort-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .filter-chips {
        gap: 4px;
        flex-wrap: wrap;
    }
    .chip {
        padding: 5px 12px;
        font-size: 11px;
    }
    .custom-select-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    .bot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bot-stat {
        padding: 12px;
    }
    .bot-stat-value {
        font-size: 16px;
    }
    .bot-stat-label {
        font-size: 9px;
    }
    #ai-popup-content {
        padding: 20px 16px;
        max-width: 95%;
        max-height: 85vh;
    }
    /* Detail overlay mobile */
    #market-detail {
        padding: 8px;
    }
    #market-detail-content {
        padding: 20px;
        max-height: 95vh;
        max-width: 100%;
    }
    #detail-title {
        font-size: 18px;
        word-break: break-word;
    }
    .detail-stat-value {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .detail-price-value {
        font-size: 28px;
    }
    .detail-price-row {
        gap: 12px;
    }
    .detail-stats-grid {
        grid-template-columns: 1fr;
    }
    .detail-btn-row {
        flex-direction: column;
    }
    .paper-trade-row {
        flex-wrap: wrap;
    }
    /* Brief mobile */
    .brief-card {
        margin: 0 12px 16px;
    }
    /* Correlations mobile */
    .corr-cards {
        grid-template-columns: 1fr;
    }
    .arb-comparison {
        flex-direction: column;
    }
    .arb-vs {
        transform: rotate(90deg);
    }
    /* Portfolio chart */
    .portfolio-chart-section canvas {
        height: 120px;
    }
    /* Sygnal explainer mobile */
    .sygnal-explainer-card {
        padding: 24px 16px;
    }
    .sygnal-factors {
        flex-direction: column;
    }
    .explainer-top {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .explainer-intro {
        text-align: center;
    }
    .explainer-bottom {
        flex-direction: column;
    }
    .sygnal-scale {
        flex-direction: column;
        gap: 8px;
    }
    /* Recap banner mobile */
    .recap-banner {
        flex-direction: column;
        gap: 8px;
    }
    .recap-content {
        flex-direction: column;
        gap: 4px;
    }
    .recap-sep { display: none; }
    /* Email signup mobile */
    .signup-card {
        padding: 32px 16px;
    }
    .signup-card h3 { font-size: 18px; }
    .signup-features {
        align-items: flex-start;
        gap: 6px;
    }
    .signup-form {
        max-width: 100%;
    }
}

/* ── SYGNAL RING ── */
.sygnal-ring { flex-shrink: 0; }

/* ── CARD SYGNAL SCORE — footer bar at bottom of card ── */
.card-sygnal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.card-trade-btn {
    display: block;
    text-align: center;
    padding: 8px 12px;
    margin-top: 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font);
    text-decoration: none;
    color: var(--accent);
    background: rgba(0, 136, 255, 0.06);
    border: 1px solid rgba(0, 136, 255, 0.12);
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.card-trade-btn:hover {
    background: rgba(0, 136, 255, 0.14);
    border-color: rgba(0, 136, 255, 0.3);
    transform: translateY(-1px);
}

.card-sygnal-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-dim);
    font-family: var(--font);
}

.card-sygnal-score {
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font);
    letter-spacing: -0.5px;
    line-height: 1;
}

/* ── DETAIL CARD ENHANCEMENTS ── */
.detail-cross-edge {
    background: rgba(0,136,255,0.06);
    border: 1px solid rgba(0,136,255,0.15);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.detail-edge-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}
.detail-edge-value {
    font-size: 12px;
    color: var(--text-mid);
    text-align: right;
}
.sygnal-history-section {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.sygnal-history-section h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
#sygnal-history-chart {
    width: 100%;
    height: 80px;
    display: block;
    border-radius: 6px;
}
.sygnal-history-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-dim);
}
.sygnal-history-stats b {
    font-weight: 700;
}

.card-signal {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-family: var(--font);
}

/* ── GROUP CARDS ── */
.group-count-badge {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.group-card { border-color: rgba(139, 92, 246, 0.15); }
.group-badge { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.2); }
.group-preview { padding: 8px 0; flex: 1; }
.group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    color: var(--text-mid);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.group-item:last-child { border-bottom: none; }
.group-toggle {
    background: rgba(139,92,246,0.06);
    border: 1px solid rgba(139,92,246,0.15);
    color: #8b5cf6;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: all 0.2s;
}
.group-toggle:hover { background: rgba(139,92,246,0.12); }

/* ── TRENDING ── */
.trending-section-header {
    grid-column: 1 / -1;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text);
    padding: 20px 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
}
.trending-section-header:first-child { padding-top: 0; }
.trending-section-icon { font-size: 18px; }
.trending-change { font-size: 14px; font-weight: 700; background: rgba(0,214,143,0.1); padding: 2px 8px; border-radius: 8px; }
.trending-card { border-color: rgba(0,214,143,0.15); }

/* ── MOBILE BOTTOM NAV ── */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(13, 13, 21, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 6px 0;
    padding-bottom: env(safe-area-inset-bottom, 6px);
    z-index: 9000;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 10px;
    font-family: var(--font);
    transition: color 0.2s;
}

.mobile-nav-item.active {
    color: var(--accent);
}

.mobile-nav-item svg {
    opacity: 0.6;
}

.mobile-nav-item.active svg {
    opacity: 1;
    stroke: var(--accent);
}

/* Mobile More dropdown (pops up from bottom nav) */
.mobile-more-wrap {
    position: relative;
}
.mobile-more-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    right: -20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    min-width: 150px;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
    z-index: 9999;
}
.mobile-more-menu.open {
    display: flex;
    flex-direction: column;
}
.mobile-more-menu a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.15s;
}
.mobile-more-menu a:hover,
.mobile-more-menu a:active {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}
body.light .mobile-more-menu { background: #fff; border-color: rgba(0,0,0,0.1); box-shadow: 0 -8px 32px rgba(0,0,0,0.12); }
body.light .mobile-more-menu a { color: #5a6070; }
body.light .mobile-more-menu a:hover { color: #1a1a2e; background: rgba(0,0,0,0.04); }

@media (max-width: 768px) {
    .mobile-nav { display: flex; }
    .nav-links { display: none !important; }
    body { padding-bottom: 70px; }
}

/* Tablet (iPad) */
@media (min-width: 769px) and (max-width: 1024px) {
    html, body { overflow-x: hidden; max-width: 100vw; }
    nav {
        padding: 8px 12px;
        gap: 4px;
        flex-wrap: wrap;
        height: auto;
        max-width: 100%;
    }
    .logo { gap: 6px; }
    .logo-text { font-size: 18px; }
    .logo-tag { display: none; }
    .nav-search { max-width: 160px; }
    .nav-links {
        gap: 2px;
    }
    .nav-links > a {
        font-size: 11px;
        padding: 5px 8px;
    }
    .hero { padding: 32px 16px 20px; }
    .hero h1 { font-size: 32px; letter-spacing: -0.5px; }
    .hero .tagline { font-size: 12px; letter-spacing: 4px; }
    .hero p:last-of-type { font-size: 13px; max-width: 90%; }
    .stats-bar { padding: 10px 16px; gap: 12px; margin: 0 16px; }
    .market-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .bot-grid { grid-template-columns: repeat(3, 1fr); }
    section { padding: 0 16px; max-width: 100%; box-sizing: border-box; }
    #filters { padding: 0 16px; }
    .filter-chips { flex-wrap: wrap; gap: 4px; }
    .sygnal-explainer-card { padding: 24px 16px; }
    .sygnal-factors { flex-direction: column; }
    .explainer-top { flex-direction: column; gap: 16px; }
    .explainer-bottom { flex-direction: column; }
    .sygnal-scale { flex-direction: column; }
    .bot-control-row { grid-template-columns: repeat(2, 1fr); }
    .league-stats-row { grid-template-columns: repeat(2, 1fr); }
    .perf-stats-row { grid-template-columns: repeat(3, 1fr); }
    .compare-platforms { gap: 12px; }
    .alert-builder-row { flex-wrap: wrap; }
    .detail-btn-row { flex-direction: column; }
}

/* ── SHARE POPUP ── */
.share-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.share-popup-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.share-popup-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.share-popup-content button,
.share-popup-content a {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text);
}
.share-popup-content button:hover,
.share-popup-content a:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--border-hover);
}
.share-cancel {
    background: transparent !important;
    border: none !important;
    color: var(--text-dim) !important;
    font-size: 13px !important;
}
.share-card-popup { max-width: 480px; width: 95%; }
.share-card-preview canvas { width: 100% !important; height: auto !important; border-radius: 12px; margin-bottom: 8px; display: block; }
.share-btn-row { display: flex; gap: 8px; }
.share-btn-row .share-action-btn { flex: 1; font-size: 12px; padding: 10px 8px; }

.embed-textarea {
    width: 100%;
    height: 120px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    font-family: monospace;
    font-size: 11px;
    padding: 10px;
    resize: none;
}

/* ── PRICE TOAST ── */
.price-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast-icon { font-size: 16px; }

/* ── MARKET INSIGHTS ── */
.market-insights {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.market-insights h4 {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
}
.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.4;
}
.insight-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

/* ── EMAIL SIGNUP ── */
#email-signup {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

.signup-card {
    background: linear-gradient(135deg, rgba(0,136,255,0.06) 0%, rgba(139,92,246,0.04) 50%, rgba(0,214,143,0.04) 100%);
    border-top: 1px solid rgba(0,136,255,0.15);
    border-bottom: 1px solid rgba(0,136,255,0.15);
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 48px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.signup-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0,136,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.signup-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}
.signup-card > p {
    font-size: 14px;
    color: var(--text-mid);
    margin-bottom: 24px;
    max-width: 420px;
    line-height: 1.5;
}
.signup-form {
    display: flex;
    gap: 0;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}
.signup-form input {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 10px 0 0 10px;
    border-right: none;
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    height: 44px;
    box-sizing: border-box;
}
.signup-form input:focus {
    outline: none;
    border-color: var(--accent);
}
.signup-form button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 0 10px 10px 0;
    padding: 0 24px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    height: 44px;
    box-sizing: border-box;
    white-space: nowrap;
}
.signup-form button:hover {
    background: #0077dd;
}
.signup-features {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
}
.signup-feature {
    font-size: 13px;
    color: var(--text-mid);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}
.sf-icon { font-size: 15px; flex-shrink: 0; }
.signup-disclaimer {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 12px;
    margin-bottom: 0;
}
.signup-note {
    font-size: 12px;
    color: var(--green);
    margin-top: 8px;
}

/* ── DAILY RECAP BANNER ── */
.recap-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 40px;
    background: linear-gradient(90deg, rgba(0, 136, 255, 0.1), rgba(0, 214, 143, 0.08), rgba(139, 92, 246, 0.06));
    border-bottom: 1px solid rgba(0, 136, 255, 0.15);
    position: relative;
    z-index: 99;
    animation: recap-slide 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes recap-slide {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.recap-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    font-family: var(--font);
}
.recap-time {
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.recap-stat {
    color: var(--text);
    font-weight: 500;
}
.recap-sep {
    color: var(--text-dim);
    font-size: 10px;
}
.recap-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.recap-close:hover {
    color: var(--text);
}

/* ── SYGNAL DISMISS — positioned for full-width banner ── */
.sygnal-dismiss {
    margin-top: 4px;
}

/* ── SYGNAL LEAGUES ── */
.league-header-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.league-week-badge { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--accent); background: rgba(0,136,255,0.1); padding: 4px 10px; border-radius: 6px; }
.league-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.league-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.league-stat-value { font-size: 22px; font-weight: 700; color: var(--text); }
.league-stat-value.positive { color: var(--green); }
.league-stat-value.negative { color: var(--red); }
.league-stat-label { font-size: 10px; color: var(--text-dim); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 4px; }
.league-section { margin-bottom: 24px; }
.league-leaderboard { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.league-row { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 12px; }
.league-row:last-child { border-bottom: none; }
.league-row.you { background: rgba(0,136,255,0.06); border-left: 3px solid var(--accent); }
.league-rank-num { font-size: 16px; width: 28px; text-align: center; }
.league-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.league-name { flex: 1; font-weight: 500; font-size: 14px; }
.league-return { font-size: 15px; font-weight: 700; }
.league-return.positive { color: var(--green); }
.league-return.negative { color: var(--red); }
.league-pick { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.league-history-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.league-history-week { font-weight: 600; font-size: 13px; flex: 1; }
@media (max-width: 600px) {
    .league-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── PUSH NOTIFICATION OVERLAY ── */
.push-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    z-index: 20001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.push-overlay-content {
    max-width: 400px;
    padding: 48px 32px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
}

/* ── SYGNAL AUTOPILOT ── */
.autopilot-panel {
    position: fixed;
    top: 60px;
    right: 16px;
    width: 360px;
    max-height: 80vh;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 14px;
    z-index: 9999;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
}
.autopilot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.autopilot-alerts {
    overflow-y: auto;
    max-height: 50vh;
    padding: 8px;
}
.autopilot-alert {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
}
@media (max-width: 600px) {
    .autopilot-panel { right: 8px; left: 8px; width: auto; top: 50px; }
}

/* ── SYGNAL PRO MODAL ── */
.pro-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}
.pro-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
}
.pro-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: opacity 0.2s;
}
.pro-btn:hover { opacity: 0.9; }

/* ── SYGNAL AI CHAT WIDGET ── */
#sygnal-chat-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,136,255,0.3);
    z-index: 9000;
    transition: transform 0.2s, box-shadow 0.2s;
}
#sygnal-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,136,255,0.4);
}

#sygnal-chat {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 360px;
    max-height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.3);
    z-index: 9001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(0,136,255,0.05);
}
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: chat-blink 2s ease-in-out infinite;
}
@keyframes chat-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.chat-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text);
}
.chat-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 350px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.chat-msg {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 90%;
}
.chat-msg.bot {
    background: rgba(0,136,255,0.08);
    border: 1px solid rgba(0,136,255,0.12);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-msg.user {
    background: var(--accent);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-msg.bot .chat-signal {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin: 2px 4px 2px 0;
}
.chat-input-row {
    display: flex;
    gap: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}
.chat-input-row input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); }
.chat-input-row button {
    background: var(--accent);
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 0 14px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.chat-input-row button:hover { background: #0077dd; }

/* ── LIVE BOT FEED ── */
#bot-feed {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 320px;
    max-height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    z-index: 8999;
    overflow: hidden;
}
.feed-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(0,214,143,0.05);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-dim);
}
.feed-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: chat-blink 2s ease-in-out infinite;
}
.feed-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
#feed-trades {
    padding: 8px;
    max-height: 340px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.feed-trade {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    font-size: 12px;
}
.feed-trade-side {
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.feed-trade-side.yes { color: #00d68f; background: rgba(0,214,143,0.12); }
.feed-trade-side.no { color: #ff3b5c; background: rgba(255,59,92,0.12); }
.feed-trade-title {
    flex: 1;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.feed-trade-price {
    color: var(--text-mid);
    font-weight: 600;
    white-space: nowrap;
}
.feed-trade-time {
    color: var(--text-dim);
    font-size: 10px;
    white-space: nowrap;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #sygnal-chat {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 80px;
    }
    #sygnal-chat-btn {
        bottom: 72px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
    #bot-feed {
        left: 8px;
        right: 8px;
        width: auto;
        bottom: 72px;
    }
}

/* ── BOT CONTROLS ── */
.bot-controls {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.bot-controls-title {
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.bot-control-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.bot-control-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bot-control-item label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.bot-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bot-slider-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}
.bot-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg);
    box-shadow: 0 2px 6px rgba(0,136,255,0.3);
}
.bot-slider-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    min-width: 48px;
    text-align: right;
    font-family: var(--font);
}
.bot-toggle-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}
.bot-toggle-btn.running {
    background: rgba(0, 214, 143, 0.1);
    border-color: rgba(0, 214, 143, 0.3);
    color: var(--green);
}
.bot-toggle-btn.running:hover {
    background: rgba(0, 214, 143, 0.2);
}
.bot-toggle-btn.paused {
    background: rgba(255, 59, 92, 0.1);
    border-color: rgba(255, 59, 92, 0.3);
    color: var(--red);
}
.bot-toggle-btn.paused:hover {
    background: rgba(255, 59, 92, 0.2);
}
.bot-save-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.bot-save-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.bot-config-status {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    min-height: 20px;
}
.bot-config-status.success { color: var(--green); }
.bot-config-status.error { color: var(--red); }

/* Bot Signals */
.bot-signal-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}
.bot-signal-ticker {
    flex: 1;
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bot-signal-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
}
.bot-signal-badge.acted {
    color: var(--green);
    background: rgba(0, 214, 143, 0.1);
}
.bot-signal-badge.skipped {
    color: var(--text-dim);
    background: rgba(255,255,255,0.04);
}

/* ── PERFORMANCE DASHBOARD ── */
.bot-perf-dashboard {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.perf-stats-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.perf-stat {
    text-align: center;
    padding: 12px 8px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.perf-stat-val {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    font-family: var(--font);
}
.perf-stat-val.positive { color: var(--green); }
.perf-stat-val.negative { color: var(--red); }
.perf-stat-label {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 4px;
}
#equity-chart {
    width: 100%;
    height: 160px;
    border-radius: 8px;
}

/* ── TRADE HISTORY ── */
.bot-trade-history {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.trade-hist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.trade-hist-filters {
    display: flex;
    gap: 6px;
}
.trade-hist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.trade-hist-row:last-child { border-bottom: none; }
.trade-hist-side {
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    min-width: 32px;
    text-align: center;
}
.trade-hist-side.yes { color: var(--green); background: rgba(0,214,143,0.1); }
.trade-hist-side.no { color: var(--red); background: rgba(255,59,92,0.1); }
.trade-hist-title { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-hist-price { color: var(--text-mid); font-weight: 600; min-width: 50px; text-align: right; }
.trade-hist-pnl { font-weight: 700; min-width: 60px; text-align: right; }
.trade-hist-pnl.positive { color: var(--green); }
.trade-hist-pnl.negative { color: var(--red); }
.trade-hist-time { color: var(--text-dim); font-size: 11px; min-width: 90px; text-align: right; }

/* ── NEWS FEED ── */
.news-feed-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.news-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: background 0.2s;
}
.news-item:hover { background: rgba(255,255,255,0.04); }
.news-tag {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    min-width: 70px;
}
.news-title {
    flex: 1;
    font-size: 13px;
    color: var(--text);
}
.news-time {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
}

/* ── CUSTOM ALERTS ── */
.alert-builder-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.alert-select, .alert-input {
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
}
.alert-select { min-width: 160px; }
.alert-input { width: 80px; }
.alert-add-btn {
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.alert-add-btn:hover { opacity: 0.9; }
.alert-rule {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
}
.alert-rule.disabled { opacity: 0.5; }
.alert-rule-info { display: flex; gap: 12px; align-items: center; }
.alert-rule-cond { font-size: 14px; font-weight: 600; color: var(--text); }
.alert-rule-cat { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.alert-rule-actions { display: flex; gap: 6px; }
.alert-rule-toggle {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: rgba(0,214,143,0.1);
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
}
.alert-rule.disabled .alert-rule-toggle { background: rgba(255,255,255,0.05); color: var(--text-dim); }
.alert-rule-delete {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,59,92,0.3);
    background: rgba(255,59,92,0.1);
    color: var(--red);
    font-size: 12px;
    cursor: pointer;
}

/* ── MARKET COMPARISON ── */
.compare-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.compare-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.compare-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
}
.compare-platforms {
    display: flex;
    align-items: center;
    gap: 20px;
}
.compare-platform {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.compare-plat-name {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-dim);
}
.compare-plat-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.compare-plat-price.dim {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}
.compare-plat-vol {
    font-size: 11px;
    color: var(--text-dim);
}
.compare-spread {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 60px;
}
.compare-spread-val {
    font-size: 24px;
    font-weight: 900;
    font-family: var(--font);
}
.compare-spread-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-dim);
}
.compare-arb-badge {
    margin-top: 12px;
    padding: 8px 14px;
    background: rgba(0,214,143,0.08);
    border: 1px solid rgba(0,214,143,0.2);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--green);
    text-align: center;
}

/* ── RESPONSIVE: Mobile overrides for new features ── */
@media (max-width: 768px) {
    .perf-stats-row { grid-template-columns: repeat(3, 1fr); }
    .perf-stat-val { font-size: 16px; }
    .trade-hist-time { display: none; }
    .trade-hist-price { min-width: 40px; }
    .compare-platforms { flex-direction: column; }
    .compare-spread { flex-direction: row; gap: 8px; }
    .alert-builder-row { flex-direction: column; }
    .alert-select { width: 100%; }
    .alert-input { width: 100%; }
}
