/* ==================== Variables ==================== */
:root {
    --bg-0: #0a0e17;
    --bg-1: #0f1419;
    --bg-2: #151b23;
    --bg-3: #1c2432;
    --bg-4: #242d3d;
    --bg-card: #131920;
    --border: #1e2a3a;
    --border-light: #2d3a4d;
    --border-focus: #00d4aa;
    --text-1: #edf2f7;
    --text-2: #94a3b8;
    --text-3: #64748b;
    --accent: #00d4aa;
    --accent-dim: rgba(0, 212, 170, 0.12);
    --accent-glow: rgba(0, 212, 170, 0.25);
    --blue: #3b82f6;
    --blue-dim: rgba(59, 130, 246, 0.12);
    --purple: #8b5cf6;
    --success: #10b981;
    --success-dim: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --gradient: linear-gradient(135deg, #00d4aa 0%, #3b82f6 100%);
    --gradient-btn: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444, #dc2626);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(0, 212, 170, 0.15);
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* ==================== Reset ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-0);
    color: var(--text-1);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
input, select, button { font-family: inherit; }

/* ==================== Utilities ==================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.screen { display: none; }
.screen.active { display: block; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hidden { display: none !important; }

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
    border: none; cursor: pointer; transition: var(--transition); text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--gradient-btn); color: white; box-shadow: 0 4px 15px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-outline { background: transparent; color: var(--text-1); border: 1.5px solid var(--border-light); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-2); border: none; padding: 8px 12px; border-radius: 8px; }
.btn-ghost:hover { color: var(--accent); background: var(--accent-dim); }
.btn-xl { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ==================== LANDING PAGE ==================== */
.landing-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 14px 0; background: rgba(10, 14, 23, 0.9); backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid rgba(30, 42, 58, 0.5);
}
.landing-nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand .logo-icon {
    width: 34px; height: 34px; background: var(--gradient); border-radius: 9px;
    display: flex; align-items: center; justify-content: center; font-size: 15px; color: white;
}
.brand-name { font-size: 18px; font-weight: 800; color: var(--text-1); letter-spacing: -0.3px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; transition: var(--transition); }
.nav-links a:hover { color: var(--accent); }
.nav-auth { display: flex; gap: 10px; }
.mobile-menu-btn { display: none; background: transparent; border: none; color: var(--text-1); font-size: 20px; cursor: pointer; padding: 4px; }

/* Hero */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 100px 0 80px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.grid-pattern {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(30, 42, 58, 0.15) 1px, transparent 1px), linear-gradient(90deg, rgba(30, 42, 58, 0.15) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(12px, -12px) scale(1.02); } }

.hero-content { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; position: relative; z-index: 2; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
    background: var(--accent-dim); border: 1px solid rgba(0, 212, 170, 0.25);
    border-radius: 100px; font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 20px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.account-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px 0;
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.22);
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
}
.hero h1 { font-size: clamp(36px, 4.5vw, 58px); font-weight: 900; line-height: 1.1; margin-bottom: 18px; letter-spacing: -1.5px; }
.hero-subtitle { font-size: 17px; color: var(--text-2); line-height: 1.7; margin-bottom: 28px; max-width: 480px; }
.hero-cta { display: flex; gap: 14px; margin-bottom: 40px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; }
.hero-stat { display: flex; flex-direction: column; }
.stat-number { font-size: 26px; font-weight: 800; color: var(--accent); }
.stat-text { font-size: 12px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* Trading Preview */
.trading-preview {
    background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-xl);
    padding: 20px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.trading-preview::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gradient); }
.preview-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 13px; font-weight: 500; }
.live-dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.preview-price { margin-left: auto; font-weight: 700; color: var(--accent); font-size: 15px; font-family: var(--font-mono); }
#hero-chart { width: 100%; height: 160px; border-radius: 10px; margin-bottom: 14px; }
.preview-actions { display: flex; gap: 10px; }
.mini-stat { flex: 1; padding: 10px; border-radius: 8px; text-align: center; font-size: 12px; font-weight: 600; }
.mini-stat.up { background: var(--success-dim); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.mini-stat.down { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }

/* Features */
.features { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 800; margin-bottom: 10px; letter-spacing: -0.5px; }
.section-header p { font-size: 16px; color: var(--text-2); }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; transition: var(--transition); }
.feature-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.feature-icon-wrap {
    width: 46px; height: 46px; background: var(--accent-dim); border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--accent); margin-bottom: 16px;
}
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-2); font-size: 13px; line-height: 1.6; }

/* Markets */
.markets { padding: 80px 0; background: var(--bg-1); }
.markets-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.market-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; text-align: center; transition: var(--transition); }
.market-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.market-icon { width: 48px; height: 48px; background: var(--accent-dim); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--accent); margin: 0 auto 12px; }
.market-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.market-card p { color: var(--text-3); font-size: 12px; margin-bottom: 10px; }
.market-badge { display: inline-block; padding: 3px 8px; background: var(--accent-dim); color: var(--accent); border-radius: 100px; font-size: 10px; font-weight: 600; text-transform: uppercase; }

/* How It Works */
.how-it-works { padding: 100px 0; }
.steps-grid { display: flex; align-items: center; justify-content: center; gap: 14px; }
.step-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px 24px; text-align: center; flex: 1; max-width: 280px; position: relative; transition: var(--transition); }
.step-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.step-number { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; background: var(--gradient); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; }
.step-icon { width: 52px; height: 52px; background: var(--accent-dim); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--accent); margin: 10px auto 14px; }
.step-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.step-card p { color: var(--text-2); font-size: 13px; line-height: 1.6; }
.step-connector { color: var(--text-3); font-size: 18px; }
.how-guide {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 16px;
}
.how-guide-card,
.account-compatibility {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.how-guide-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin-bottom: 14px;
    color: var(--text-1);
}
.how-guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.how-guide-grid span {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 650;
}
.how-guide-grid i { color: var(--accent); }
.account-compatibility {
    display: flex;
    gap: 12px;
    border-color: rgba(59,130,246,0.22);
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(0,212,170,0.05)), var(--bg-2);
}
.account-compatibility > i {
    color: #93c5fd;
    margin-top: 2px;
}
.account-compatibility strong {
    display: block;
    color: var(--text-1);
    margin-bottom: 6px;
}
.account-compatibility p {
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.6;
}

/* CTA */
.cta-section { padding: 80px 0; background: var(--bg-1); }
.cta-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 50px; text-align: center; position: relative; overflow: hidden; }
.cta-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gradient); }
.cta-card h2 { font-size: 28px; font-weight: 800; margin-bottom: 10px; }
.cta-card p { color: var(--text-2); font-size: 15px; margin-bottom: 28px; }
.cta-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Footer */
.landing-footer { padding: 36px 0; border-top: 1px solid var(--border); }
.footer-content { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.footer-brand .logo-icon { width: 28px; height: 28px; background: var(--gradient); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: white; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-3); text-decoration: none; font-size: 12px; transition: var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-disclaimer { width: 100%; text-align: center; color: var(--text-3); font-size: 11px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }


/* ==================== DASHBOARD - PREMIUM REDESIGN ==================== */
/* Font: Outfit + JetBrains Mono for data */

#dashboard-screen { display: none; height: 100vh; height: 100dvh; flex-direction: column; background: #080c14; }
#dashboard-screen.active { display: flex; }

/* ===== TOP NAV ===== */
.topnav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; height: 52px; flex-shrink: 0;
    background: #0d1117;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: relative; z-index: 100;
}
.topnav::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,212,170,0.3), transparent);
}

.nav-left { display: flex; align-items: center; gap: 16px; }
.logo-small { display: flex; align-items: center; gap: 9px; }
.logo-icon-sm {
    width: 28px; height: 28px; background: linear-gradient(135deg, #00d4aa, #3b82f6);
    border-radius: 7px; display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: white; flex-shrink: 0;
}
.logo-small span { font-size: 14px; font-weight: 800; color: #edf2f7; letter-spacing: -0.3px; }

.nav-center { display: flex; align-items: center; gap: 12px; }
.account-selector select {
    background: #161b22; color: #edf2f7; border: 1px solid rgba(255,255,255,0.08);
    padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
    cursor: pointer; font-family: inherit; outline: none;
    appearance: none; -webkit-appearance: none; padding-right: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
}
.account-selector select:hover { border-color: rgba(0,212,170,0.3); }

.connection-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 20px;
    background: #161b22; border: 1px solid rgba(255,255,255,0.08);
    font-size: 11px; font-weight: 600; color: #64748b;
}
.conn-dot {
    width: 6px; height: 6px; border-radius: 50%; background: #64748b;
    animation: pulse 2s infinite;
}
.connection-badge.connected { color: #10b981; border-color: rgba(16,185,129,0.2); background: rgba(16,185,129,0.05); }
.connection-badge.connected .conn-dot { background: #10b981; box-shadow: 0 0 6px #10b981; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.nav-right { display: flex; align-items: center; gap: 10px; }
.sound-toggle-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(0,212,170,0.22);
    background: rgba(0,212,170,0.08);
    color: #00d4aa;
    cursor: pointer;
    transition: all 0.15s;
}
.sound-toggle-btn:hover { background: rgba(0,212,170,0.14); }
.sound-toggle-btn.muted {
    color: #64748b;
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}
.balance-display {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px; border-radius: 10px;
    background: linear-gradient(135deg, rgba(0,212,170,0.08), rgba(59,130,246,0.08));
    border: 1px solid rgba(0,212,170,0.15);
}
.balance-info { display: flex; flex-direction: column; }
.balance-label { font-size: 9px; color: #64748b; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.balance-value { display: flex; align-items: baseline; gap: 4px; }
#balance-amount { font-size: 16px; font-weight: 800; color: #edf2f7; font-family: 'JetBrains Mono', monospace; letter-spacing: -0.5px; }
.currency-tag { font-size: 9px; font-weight: 700; color: #00d4aa; background: rgba(0,212,170,0.1); padding: 1px 5px; border-radius: 4px; }
.balance-icon-wrap { color: #00d4aa; font-size: 14px; }

.btn-logout-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: transparent; border: 1px solid rgba(255,255,255,0.08);
    color: #64748b; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; font-size: 13px;
}
.btn-logout-icon:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #ef4444; }

/* ===== DASHBOARD BODY ===== */
.dashboard-body {
    display: grid;
    grid-template-columns: 1fr 380px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ===== CHART PANEL ===== */
.panel-chart {
    display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: #080c14; min-height: 0;
}

.market-header {
    display: flex; align-items: center; gap: 14px; padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: #0d1117; flex-shrink: 0; flex-wrap: wrap;
}

.market-select {
    background: #161b22; color: #edf2f7;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 7px 28px 7px 12px; border-radius: 9px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    font-family: inherit; appearance: none; -webkit-appearance: none; outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    transition: all 0.2s;
}
.market-select:hover { border-color: rgba(0,212,170,0.3); }
.market-select:focus { border-color: #00d4aa; box-shadow: 0 0 0 2px rgba(0,212,170,0.1); }

.price-display { display: flex; align-items: baseline; gap: 8px; }
.live-price {
    font-size: 22px; font-weight: 800; font-family: 'JetBrains Mono', monospace;
    color: #edf2f7; letter-spacing: -0.5px; font-variant-numeric: tabular-nums;
}
.price-change {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700; padding: 3px 8px;
    border-radius: 6px; background: #161b22; color: #64748b;
    font-family: 'JetBrains Mono', monospace;
}
.price-change.up { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.price-change.down { background: rgba(239,68,68,0.12); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

.chart-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.chart-modes { display: flex; gap: 2px; background: #161b22; border-radius: 8px; padding: 3px; border: 1px solid rgba(255,255,255,0.06); }
.mode-btn {
    padding: 5px 9px; border: none; border-radius: 5px; font-size: 11px;
    background: transparent; color: #64748b; cursor: pointer; transition: all 0.15s;
}
.mode-btn:hover { color: #edf2f7; }
.mode-btn.active { background: #00d4aa; color: #000; }

.chart-timeframe { display: flex; gap: 2px; background: #161b22; border-radius: 8px; padding: 3px; border: 1px solid rgba(255,255,255,0.06); }
.tf-btn {
    padding: 5px 10px; border: none; border-radius: 5px; font-size: 10px; font-weight: 700;
    background: transparent; color: #64748b; cursor: pointer; transition: all 0.15s;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.tf-btn:hover:not(.active) { color: #edf2f7; }
.tf-btn.active { background: #00d4aa; color: #000; }

.count-select {
    background: #161b22; border: 1px solid rgba(255,255,255,0.06);
    color: #94a3b8; font-size: 11px; padding: 5px 8px;
    border-radius: 7px; cursor: pointer; font-family: 'JetBrains Mono', monospace; outline: none;
}

.chart-toolbar {
    display: flex; align-items: center; gap: 8px; padding: 6px 14px;
    background: #0d1117; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0;
}
.tool-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.08);
    color: #64748b; padding: 4px 10px; border-radius: 6px;
    font-size: 10px; cursor: pointer; font-weight: 600; transition: all 0.15s;
    display: flex; align-items: center; gap: 4px;
}
.tool-btn:hover { border-color: #00d4aa; color: #00d4aa; }
.tool-btn.active { background: rgba(0,212,170,0.1); border-color: #00d4aa; color: #00d4aa; }

.trend-indicator {
    margin-left: auto; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; gap: 5px; color: #64748b;
    padding: 4px 10px; border-radius: 6px; background: #161b22;
    border: 1px solid rgba(255,255,255,0.06);
}

.chart-area { flex: 1; padding: 8px; position: relative; min-height: 0; background: #080c14; }
.chart-area canvas { width: 100% !important; height: 100% !important; border-radius: 8px; display: block; }

.quick-stats {
    display: flex; border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0; background: #0d1117; overflow-x: auto;
}
.qs-item {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 16px; border-right: 1px solid rgba(255,255,255,0.06);
    gap: 2px; flex: 1; min-width: 80px;
}
.qs-item:last-child { border-right: none; }
.qs-label { font-size: 9px; color: #64748b; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.qs-value { font-size: 13px; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: #94a3b8; font-variant-numeric: tabular-nums; }
.qs-value.up { color: #10b981; }
.qs-value.down { color: #ef4444; }

/* ===== TRADE PANEL ===== */
.panel-trade {
    display: flex; flex-direction: column; overflow-y: auto;
    background: #0d1117;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.panel-trade::-webkit-scrollbar { width: 3px; }
.panel-trade::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* Mode Toggle */
.trade-mode-toggle {
    display: grid; grid-template-columns: 1fr 1fr;
    padding: 10px 12px; gap: 6px; background: #0d1117;
    border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; position: sticky; top: 0; z-index: 10;
}
.trade-mode-btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px; border-radius: 9px; font-size: 12px; font-weight: 700;
    border: 1px solid rgba(255,255,255,0.06); background: #161b22;
    color: #64748b; cursor: pointer; transition: all 0.2s;
}
.trade-mode-btn:hover { color: #edf2f7; border-color: rgba(255,255,255,0.12); }
.trade-mode-btn.active {
    background: linear-gradient(135deg, rgba(0,212,170,0.15), rgba(59,130,246,0.1));
    border-color: rgba(0,212,170,0.3); color: #00d4aa;
    box-shadow: 0 0 20px rgba(0,212,170,0.08);
}

.trade-mode-content { display: flex; flex-direction: column; }
.trade-mode-content.hidden { display: none; }

/* Trade Sections */
.trade-section { border-bottom: 1px solid rgba(255,255,255,0.05); }
.trade-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: rgba(255,255,255,0.02);
    position: sticky; top: 52px; z-index: 5;
}
.trade-section-header h3 {
    font-size: 10px; font-weight: 800; color: #64748b;
    display: flex; align-items: center; gap: 6px;
    text-transform: uppercase; letter-spacing: 1px;
}
.trade-section-header h3 i { color: #00d4aa; }

/* Forms */
.trade-form { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-row label { font-size: 10px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.form-control {
    background: #161b22; border: 1px solid rgba(255,255,255,0.08);
    color: #edf2f7; padding: 9px 12px; border-radius: 8px;
    font-size: 13px; font-family: inherit; outline: none; transition: all 0.2s; width: 100%;
}
.form-control:hover { border-color: rgba(255,255,255,0.14); }
.form-control:focus { border-color: #00d4aa; box-shadow: 0 0 0 2px rgba(0,212,170,0.1); }

.input-with-unit { position: relative; }
.input-with-unit .form-control { padding-right: 42px; }
.unit {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 10px; font-weight: 700; color: #64748b;
}

.duration-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* Proposal box */
.proposal-box {
    background: rgba(0,212,170,0.05); border: 1px solid rgba(0,212,170,0.15);
    border-radius: 9px; padding: 10px 12px; display: flex; justify-content: space-between;
}
.proposal-item { display: flex; flex-direction: column; gap: 2px; }
.proposal-item span:first-child { font-size: 9px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.proposal-val { font-size: 14px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: #edf2f7; }
.proposal-val.accent { color: #00d4aa; }

/* Trade Button */
.btn-trade {
    width: 100%; padding: 13px; border-radius: 10px; border: none;
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    color: #000; font-size: 14px; font-weight: 800; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.2s; letter-spacing: 0.3px;
    box-shadow: 0 4px 20px rgba(0,212,170,0.25);
}
.btn-trade:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(0,212,170,0.35); }
.btn-trade:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== BOT SETTINGS ===== */
.bot-settings-form { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bot-status-badge {
    font-size: 9px; font-weight: 800; padding: 3px 8px; border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.5px;
    background: #161b22; color: #64748b; border: 1px solid rgba(255,255,255,0.08);
}
.bot-status-badge.running { background: rgba(16,185,129,0.1); color: #10b981; border-color: rgba(16,185,129,0.3); }

/* ===== BOT CARDS ===== */
.bot-cards { display: flex; flex-direction: column; gap: 1px; background: rgba(255,255,255,0.03); }

.bot-card {
    background: #0d1117;
    padding: 14px;
    cursor: default;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.bot-card:hover {
    background: #111827;
    border-left-color: #00d4aa;
}

.bot-card-inner-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 7px;
}
.bot-card-icon-wrap {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
}
.bot-card-title-area { flex: 1; min-width: 0; }
.bot-card-title-row {
    display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap;
}
.bot-card-name-text {
    font-size: 13px; font-weight: 700; color: #edf2f7;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bot-risk-pill {
    font-size: 8px; font-weight: 800; padding: 2px 7px;
    border-radius: 100px; text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0;
}
.bot-risk-pill.low { background: rgba(16,185,129,0.15); color: #10b981; }
.bot-risk-pill.medium { background: rgba(245,158,11,0.15); color: #f59e0b; }
.bot-risk-pill.high { background: rgba(239,68,68,0.15); color: #ef4444; }
.bot-symbol-pill {
    font-size: 8px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
    background: #161b22; color: #64748b; font-family: 'JetBrains Mono', monospace;
    border: 1px solid rgba(255,255,255,0.06); flex-shrink: 0;
}
.bot-strategy-pill {
    font-size: 8px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
    background: rgba(59,130,246,0.1); color: #3b82f6;
    border: 1px solid rgba(59,130,246,0.15); flex-shrink: 0; margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
}

.bot-card-desc {
    font-size: 10px; color: #64748b; line-height: 1.5; margin-bottom: 6px;
}
.bot-card-strategy {
    font-size: 9px; color: #00d4aa;
    background: rgba(0,212,170,0.06); border: 1px solid rgba(0,212,170,0.12);
    border-radius: 6px; padding: 5px 8px; line-height: 1.5; margin-bottom: 10px;
}

.bot-card-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.bot-card-limits { display: flex; gap: 6px; }
.bot-limit-badge {
    font-size: 9px; font-family: 'JetBrains Mono', monospace;
    padding: 3px 8px; border-radius: 5px; font-weight: 700;
    background: #161b22; border: 1px solid rgba(255,255,255,0.06);
}
.bot-limit-badge.stop { color: #ef4444; }
.bot-limit-badge.target { color: #10b981; }

.bot-start-btn {
    background: linear-gradient(135deg, #00d4aa, #00b894);
    color: #000; border: none;
    padding: 8px 20px; border-radius: 8px;
    font-size: 11px; font-weight: 800; cursor: pointer;
    transition: all 0.2s; display: flex; align-items: center; gap: 5px;
    flex-shrink: 0; letter-spacing: 0.3px;
    box-shadow: 0 2px 12px rgba(0,212,170,0.2);
}
.bot-start-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(0,212,170,0.35); }

/* ===== BOT RUNNING PANEL ===== */
.bot-running-panel { padding: 14px; }
.bot-running-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.bot-active-info { display: flex; align-items: center; gap: 10px; }
.bot-active-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: white;
}
.bot-active-name { font-size: 14px; font-weight: 800; color: #edf2f7; }
.bot-active-status { font-size: 10px; color: #64748b; margin-top: 1px; }

.btn-bot-stop {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px; border: 1px solid rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.08); color: #ef4444;
    font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.btn-bot-stop:hover { background: rgba(239,68,68,0.15); }

.bot-profit-display {
    text-align: center; padding: 16px;
    background: #161b22; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06); margin-bottom: 12px;
}
.bot-profit-label { font-size: 9px; color: #64748b; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-bottom: 4px; }
.bot-profit-value {
    font-size: 28px; font-weight: 900; font-family: 'JetBrains Mono', monospace;
    color: #edf2f7; letter-spacing: -1px;
}
.bot-profit-value.positive { color: #10b981; }
.bot-profit-value.negative { color: #ef4444; }

.bot-stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 6px; margin-bottom: 12px;
}
.bot-stat {
    background: #161b22; border-radius: 8px; padding: 8px;
    text-align: center; border: 1px solid rgba(255,255,255,0.05);
}
.bot-stat-value { display: block; font-size: 16px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: #edf2f7; }
.bot-stat-value.green { color: #10b981; }
.bot-stat-value.red { color: #ef4444; }
.bot-stat-label { display: block; font-size: 9px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px; }

.bot-progress-section { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.bot-progress-item {}
.bot-progress-header {
    display: flex; justify-content: space-between;
    font-size: 10px; color: #64748b; margin-bottom: 4px; font-weight: 600;
}
.bot-progress-bar {
    height: 5px; background: #161b22; border-radius: 100px; overflow: hidden;
}
.bot-progress-fill {
    height: 100%; border-radius: 100px; transition: width 0.5s ease; width: 0%;
}
.bot-progress-fill.red { background: linear-gradient(90deg, #ef4444, #dc2626); }
.bot-progress-fill.green { background: linear-gradient(90deg, #10b981, #059669); }

/* Bot Log */
.bot-log-section { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px; }
.bot-log-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px; font-size: 10px; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.bot-history-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid rgba(0,212,170,0.22);
    border-radius: 7px;
    background: rgba(0,212,170,0.08);
    color: #00d4aa;
    font: inherit;
    font-size: 9px;
    cursor: pointer;
}
.bot-history-link:hover { background: rgba(0,212,170,0.14); }
.bot-log-count { background: #161b22; padding: 1px 6px; border-radius: 8px; font-size: 9px; color: #64748b; }
.bot-log { max-height: 150px; overflow-y: auto; }
.bot-log-entry {
    padding: 4px 8px; color: #64748b;
    display: flex; align-items: center; gap: 8px;
    border-radius: 4px; margin-bottom: 2px; font-size: 10px; font-family: 'JetBrains Mono', monospace;
}
.bot-log-entry.win { background: rgba(16,185,129,0.06); color: #10b981; }
.bot-log-entry.loss { background: rgba(239,68,68,0.06); color: #ef4444; }
.bot-log-entry.info { color: #00d4aa; }
.log-time { color: #64748b; opacity: 0.5; font-size: 9px; }

/* ===== POSITIONS & HISTORY ===== */
.positions-list { padding: 8px; }
.position-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: 8px;
    background: #161b22; border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 4px; font-size: 11px;
}
.position-type { font-weight: 700; color: #edf2f7; }
.position-info { color: #64748b; font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.position-profit { font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.position-profit.up { color: #10b981; }
.position-profit.down { color: #ef4444; }

.empty-state-sm {
    text-align: center; padding: 20px;
    color: #64748b; font-size: 11px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.empty-state-sm i { font-size: 20px; opacity: 0.3; }

.trade-history { padding: 8px; max-height: 200px; overflow-y: auto; }
.history-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: 7px;
    background: #161b22; border-left: 3px solid transparent;
    margin-bottom: 3px; font-size: 11px; transition: all 0.15s;
}
.history-item.win { border-left-color: #10b981; }
.history-item.loss { border-left-color: #ef4444; }
.history-result { font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.history-result.win { color: #10b981; }
.history-result.loss { color: #ef4444; }

/* ===== HISTORY TABS ===== */
.history-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(135deg, rgba(0,212,170,0.1), rgba(59,130,246,0.07)), #0d121b;
}
.history-title-copy {
    min-width: 0;
}
.history-title-copy span {
    display: block;
    font-size: 9px;
    font-weight: 800;
    color: #8ba0b8;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
.history-title-copy strong {
    display: block;
    margin-top: 2px;
    color: #edf2f7;
    font-size: 15px;
    line-height: 1.2;
}
.history-title-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0,212,170,0.2);
    background: rgba(0,212,170,0.1);
    color: #00d4aa;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.history-tabs {
    display: flex; border-bottom: 1px solid rgba(255,255,255,0.05);
    background: #0d1117; flex-shrink: 0;
}
.history-tab {
    flex: 1; padding: 9px 4px; font-size: 9px; font-weight: 700;
    color: #64748b; background: transparent; border: none; cursor: pointer;
    transition: all 0.15s; display: flex; align-items: center; justify-content: center;
    gap: 4px; border-bottom: 2px solid transparent; margin-bottom: -1px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.history-tab:hover { color: #94a3b8; }
.history-tab.active { color: #00d4aa; border-bottom-color: #00d4aa; }

.history-panel-content { display: none; }
.history-panel-content.active { display: block; }

.summary-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 6px; padding: 10px;
}
.summary-card {
    background: #161b22; border: 1px solid rgba(255,255,255,0.05);
    border-radius: 9px; padding: 10px; text-align: center;
}
.summary-card-value {
    font-size: 17px; font-weight: 800; font-family: 'JetBrains Mono', monospace;
    margin-bottom: 2px; color: #edf2f7;
}
.summary-card-value.green { color: #10b981; }
.summary-card-value.red { color: #ef4444; }
.summary-card-value.accent { color: #00d4aa; }
.summary-card-label { font-size: 9px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }

.history-list { max-height: 280px; overflow-y: auto; padding: 8px; }
.history-item-v2 {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border-radius: 8px; margin-bottom: 3px;
    background: #161b22; border-left: 3px solid transparent;
    transition: all 0.15s;
}
.history-item-v2.win { border-left-color: #10b981; }
.history-item-v2.loss { border-left-color: #ef4444; }
.history-item-v2:hover { background: #1c2432; }
.history-item-icon {
    width: 26px; height: 26px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0;
}
.history-item-icon.win { background: rgba(16,185,129,0.15); color: #10b981; }
.history-item-icon.loss { background: rgba(239,68,68,0.15); color: #ef4444; }
.history-item-info { flex: 1; min-width: 0; }
.history-item-type { font-size: 11px; font-weight: 600; color: #edf2f7; }
.history-item-time { font-size: 9px; color: #64748b; font-family: 'JetBrains Mono', monospace; }
.history-item-profit { font-size: 12px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.history-item-profit.win { color: #10b981; }
.history-item-profit.loss { color: #ef4444; }
.history-item-stake { font-size: 9px; color: #64748b; text-align: right; }

.statement-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.statement-table th {
    background: #161b22; color: #64748b; font-weight: 700;
    padding: 7px 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05);
    text-transform: uppercase; letter-spacing: 0.3px; font-size: 9px; position: sticky; top: 0;
}
.statement-table td {
    padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,0.03);
    color: #94a3b8; font-family: 'JetBrains Mono', monospace; font-size: 10px;
}
.statement-table tr:hover td { background: #161b22; }
.profit-cell.pos { color: #10b981; }
.profit-cell.neg { color: #ef4444; }

.session-item {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px;
    border-radius: 8px; margin-bottom: 4px; background: #161b22;
    border: 1px solid rgba(255,255,255,0.05);
}
.session-bot-name { font-size: 12px; font-weight: 700; color: #edf2f7; }
.session-meta { font-size: 9px; color: #64748b; font-family: 'JetBrains Mono', monospace; }
.session-stats { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.session-stat { font-size: 9px; background: #0d1117; padding: 2px 6px; border-radius: 3px; color: #64748b; }

.empty-history { text-align: center; padding: 24px 16px; color: #64748b; }
.empty-history i { font-size: 24px; margin-bottom: 8px; display: block; opacity: 0.3; }
.empty-history p { font-size: 11px; }

/* ===== SIGNALS ===== */
.signals-section { padding: 10px 12px; }
.signal-card {
    background: #161b22; border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9px; padding: 10px 12px; margin-bottom: 8px;
    display: flex; align-items: center; gap: 10px;
}
.signal-direction {
    display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 50px;
}
.signal-direction .signal-action {
    font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 5px;
}
.signal-direction.up .signal-action { background: rgba(16,185,129,0.15); color: #10b981; }
.signal-direction.down .signal-action { background: rgba(239,68,68,0.15); color: #ef4444; }
.signal-direction.neutral .signal-action { background: rgba(245,158,11,0.15); color: #f59e0b; }
.signal-badge { font-size: 9px; color: #64748b; font-weight: 600; }
.signal-info { flex: 1; }
.signal-reason { font-size: 11px; color: #94a3b8; }

.tips-list { display: flex; flex-direction: column; gap: 4px; }
.tip-item {
    display: flex; align-items: flex-start; gap: 7px;
    padding: 7px 9px; background: #161b22; border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.05); font-size: 10px; color: #94a3b8;
    line-height: 1.4;
}
.tip-item i { color: #00d4aa; font-size: 10px; margin-top: 1px; flex-shrink: 0; }

/* Misc */
.btn-icon {
    width: 28px; height: 28px; border-radius: 7px; background: transparent;
    border: 1px solid rgba(255,255,255,0.08); color: #64748b; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 11px;
    transition: all 0.15s;
}
.btn-icon:hover { border-color: #00d4aa; color: #00d4aa; }

/* ===== SIGNALS CONFIDENCE ===== */
#signal-confidence {
    font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 100px; background: #161b22; color: #64748b;
    border: 1px solid rgba(255,255,255,0.06);
}

/* Toast */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 12px 16px; border-radius: 10px; font-size: 12px; font-weight: 600;
    display: flex; align-items: center; gap: 8px; min-width: 200px; max-width: 320px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4); animation: slideIn 0.3s ease;
    backdrop-filter: blur(10px);
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #10b981; }
.toast.error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #ef4444; }
.toast.info { background: rgba(0,212,170,0.12); border: 1px solid rgba(0,212,170,0.25); color: #00d4aa; }

/* ===== MOBILE TABS ===== */
.mobile-tabs { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .dashboard-body { grid-template-columns: 1fr 340px; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .nav-auth { display: none; }

    .topnav { padding: 0 12px; }
    .logo-small span { display: none; }
    .balance-display { padding: 5px 10px; }
    #balance-amount { font-size: 14px; }

    .dashboard-body { grid-template-columns: 1fr; grid-template-rows: 1fr; }
    .panel-chart { border-right: none; }
    .panel-trade { display: none; }
    .panel-trade.mobile-active { display: flex; position: fixed; inset: 52px 0 56px 0; z-index: 50; overflow-y: auto; }
    .panel-chart.mobile-hidden { display: none; }
    .panel-chart.mobile-active { display: flex; }

    .mobile-tabs {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
        background: #0d1117; border-top: 1px solid rgba(255,255,255,0.06);
        height: 56px;
    }
    .mobile-tab {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
        padding: 6px 4px; font-size: 9px; color: #64748b; cursor: pointer;
        gap: 3px; border: none; background: transparent; transition: all 0.15s; font-weight: 700;
        text-transform: uppercase; letter-spacing: 0.3px;
    }
    .mobile-tab i { font-size: 18px; }
    .mobile-tab.active { color: #00d4aa; }

    #dashboard-screen.active { padding-bottom: 56px; }

    .market-header { padding: 8px 12px; gap: 8px; }
    .market-select { font-size: 12px; padding: 6px 24px 6px 10px; }
    .live-price { font-size: 18px; }
    .chart-tools { gap: 6px; }
    .tf-btn { padding: 4px 7px; font-size: 9px; }

    .trade-mode-toggle { padding: 8px 10px; }
    .bot-card { padding: 10px 12px; }
    .summary-grid { gap: 5px; padding: 8px; }
}

@media (max-width: 480px) {
    .hero-content { grid-template-columns: 1fr; }
    .hero-visual { display: none; }
    .features-grid { grid-template-columns: 1fr; }
    .markets-grid { grid-template-columns: 1fr 1fr; }
    .steps-grid { flex-direction: column; }
    .how-guide { grid-template-columns: 1fr; }
    .how-guide-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 28px; }
}



/* =====================================================
   TRADEPILOT MOBILE PATCH
   ===================================================== */

@media (max-width: 768px) {

    .trade-mode-toggle { display: none !important; }

    #dashboard-screen { height: 100dvh; overflow: hidden; }

    .topnav { padding: 6px 10px; min-height: 0; }
    .topnav .nav-brand span, .topnav .nav-brand .brand-sub { display: none; }
    .balance-label { display: none; }
    .balance-value { font-size: 13px; }

    .dashboard-body {
        display: block !important;
        overflow: hidden;
        position: relative;
        height: calc(100dvh - 48px - 56px);
    }

    .panel-chart {
        width: 100%; height: 100%;
        border-right: none !important;
        display: flex; flex-direction: column; overflow: hidden;
        position: absolute; inset: 0;
        transition: transform 0.25s ease, opacity 0.25s ease;
        z-index: 1;
        pointer-events: auto;
    }
    .panel-chart.tab-hidden {
        transform: translateX(-100%);
        opacity: 0; pointer-events: none;
    }

    .panel-trade {
        width: 100%; height: 100%;
        position: absolute; inset: 0;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        opacity: 0; pointer-events: none;
        transition: transform 0.25s ease, opacity 0.25s ease;
        z-index: 1;
    }
    .panel-trade.tab-active {
        transform: translateX(0);
        opacity: 1; pointer-events: all;
        display: flex !important;
        flex-direction: column;
        overflow-y: auto !important;
    }
    .panel-trade.tab-active #manual-mode,
    .panel-trade.tab-active .trade-mode-content:not(.hidden) {
        display: flex !important;
        flex-direction: column;
    }

    #mobile-tab-bar {
        position: fixed; bottom: 0; left: 0; right: 0;
        height: 56px;
        background: #0f1520;
        border-top: 1px solid #1e2a3a;
        display: flex; align-items: stretch;
        z-index: 9999;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-tab {
        flex: 1; display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 3px;
        background: transparent; border: none;
        color: #64748b; cursor: pointer;
        font-size: 9px; font-weight: 700;
        text-transform: uppercase; letter-spacing: 0.5px;
        transition: all 0.15s; padding: 0;
        -webkit-tap-highlight-color: transparent;
        font-family: inherit;
    }
    .mobile-tab i { font-size: 18px; line-height: 1; }
    .mobile-tab.active { color: #00c9a7; }
    .mobile-tab.active i { transform: scale(1.1); }
    .mobile-tab.active::after {
        content: ''; display: block;
        width: 18px; height: 2px;
        background: #00c9a7; border-radius: 2px; margin-top: 2px;
    }
    .mobile-tab[data-tab="bot"].bot-running { color: #10b981; }

    .quick-stats { grid-template-columns: repeat(4, 1fr); }
    .quick-stats .qs-item:nth-child(5),
    .quick-stats .qs-item:nth-child(6) { display: none; }

    .market-header { flex-wrap: nowrap; gap: 6px; padding: 6px 8px; }
    .chart-modes { display: none; }
    .chart-count { display: none; }

    .form-control { min-height: 40px; font-size: 14px; }

    #bot-cards { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
    .bot-card { width: 100% !important; }

    .btn-trade-up, .btn-trade-dn, #btn-buy, #btn-sell {
        min-height: 48px; font-size: 15px;
    }
}




/* ===== TRADEPILOT MOBILE PATCH ===== */
@media (max-width: 768px) {
    .trade-mode-toggle { display: none !important; }
    #dashboard-screen { height: 100dvh; overflow: hidden; }
    .topnav { padding: 6px 10px; min-height: 0; }
    .balance-label { display: none; }
    .balance-value { font-size: 13px; }
    .dashboard-body {
        display: block !important;
        overflow: hidden;
        position: relative;
        height: calc(100dvh - 48px - 56px);
    }
    .panel-chart {
        width: 100%; height: 100%;
        border-right: none !important;
        display: flex; flex-direction: column; overflow: hidden;
        position: absolute; inset: 0;
        transition: transform 0.25s ease, opacity 0.25s ease;
        z-index: 1;
    }
    .panel-chart.tab-hidden {
        transform: translateX(-100%);
        opacity: 0; pointer-events: none;
    }
    .panel-trade {
        width: 100%; height: 100%;
        position: absolute; inset: 0;
        overflow-y: auto;
        transform: translateX(100%);
        opacity: 0; pointer-events: none;
        transition: transform 0.25s ease, opacity 0.25s ease;
        z-index: 1;
    }
    .panel-trade.tab-active {
        transform: translateX(0);
        opacity: 1; pointer-events: all;
        display: flex !important;
        flex-direction: column;
        overflow-y: auto !important;
    }
    .panel-trade.tab-active #manual-mode,
    .panel-trade.tab-active .trade-mode-content:not(.hidden) {
        display: flex !important;
        flex-direction: column;
    }
    #mobile-tab-bar {
        position: fixed; bottom: 0; left: 0; right: 0;
        height: 56px;
        background: #0f1520;
        border-top: 1px solid #1e2a3a;
        display: flex; align-items: stretch;
        z-index: 9999;
    }
    .mobile-tab {
        flex: 1; display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 3px;
        background: transparent; border: none;
        color: #64748b; cursor: pointer;
        font-size: 9px; font-weight: 700;
        text-transform: uppercase; letter-spacing: 0.5px;
        font-family: inherit; padding: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-tab i { font-size: 20px; line-height: 1; }
    .mobile-tab.active { color: #00c9a7; }
    .mobile-tab.active::after {
        content: ""; display: block;
        width: 20px; height: 2px;
        background: #00c9a7; border-radius: 2px; margin-top: 2px;
    }
    .quick-stats .qs-item:nth-child(5),
    .quick-stats .qs-item:nth-child(6) { display: none; }
    .chart-modes { display: none; }
    .chart-count { display: none; }
    .form-control { min-height: 40px; font-size: 14px; }
    .bot-card { width: 100% !important; }
    #bot-cards { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
}

/* Mobile panel fix */
@media (max-width: 768px) {
    .panel-trade {
        display: none;
    }
    .panel-trade.mobile-active {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        bottom: 56px;
        z-index: 50;
        overflow-y: auto;
        background: #0d1117;
    }
    .panel-chart {
        height: calc(100dvh - 52px - 56px);
    }
    .panel-chart.mobile-hidden {
        display: none !important;
    }
    .panel-chart.mobile-active {
        display: flex !important;
    }
}

/* Production mobile hardening */
.money-management-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(0,212,170,0.1);
    border: 1px solid rgba(0,212,170,0.2);
    color: #00d4aa;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    min-height: 32px;
}

#mobile-tab-bar {
    display: none !important;
}

@media (max-width: 768px) {
    .landing-nav .container {
        position: relative;
    }

    .landing-nav .nav-links.open,
    .landing-nav .nav-auth.open {
        display: flex;
        position: absolute;
        left: 12px;
        right: 12px;
        background: #0d1117;
        border: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 16px 40px rgba(0,0,0,0.35);
        z-index: 1001;
    }

    .landing-nav .nav-links.open {
        top: 48px;
        flex-direction: column;
        gap: 0;
        border-radius: 12px 12px 0 0;
        padding: 8px;
    }

    .landing-nav .nav-links.open a {
        padding: 11px 12px;
    }

    .landing-nav .nav-auth.open {
        top: 180px;
        border-top: 0;
        border-radius: 0 0 12px 12px;
        padding: 10px;
        gap: 8px;
    }

    #dashboard-screen.active ~ #mobile-tab-bar {
        display: flex !important;
    }

    .topnav {
        gap: 8px;
        height: 52px;
    }

    .nav-center {
        flex: 1;
        min-width: 0;
        justify-content: center;
        gap: 6px;
    }

    .account-selector {
        min-width: 0;
    }

    .account-selector select {
        max-width: 120px;
        padding-left: 8px;
        padding-right: 20px;
        text-overflow: ellipsis;
    }

    .connection-badge {
        display: none;
    }

    .nav-right {
        gap: 6px;
        min-width: 0;
    }

    .balance-display {
        padding: 5px 8px;
    }

    .balance-icon-wrap,
    .currency-tag {
        display: none;
    }

    .money-management-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        flex: 0 0 34px;
    }

    .money-management-btn span {
        display: none;
    }
}

@media (max-width: 420px) {
    .account-selector select {
        max-width: 96px;
        font-size: 11px;
    }

    #balance-amount {
        font-size: 13px;
    }

    .market-header {
        align-items: stretch;
    }

    .market-selector,
    .price-display,
    .chart-tools,
    .chart-timeframe {
        width: 100%;
    }

    .market-select {
        width: 100%;
    }

    .price-display {
        justify-content: space-between;
    }

    .chart-timeframe {
        overflow-x: auto;
    }
}

/* Professional dashboard polish */
.logo-small span {
    letter-spacing: 0;
}

.panel-trade {
    background: #0b1018;
}

.trade-mode-toggle {
    background: #0b1018;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.bot-command-center {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: linear-gradient(135deg, rgba(0,212,170,0.08), rgba(59,130,246,0.08)), #0d121b;
}

.bot-command-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #06120f;
    background: #00d4aa;
    box-shadow: 0 10px 28px rgba(0,212,170,0.22);
}

.bot-command-copy {
    min-width: 0;
}

.bot-command-copy span {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: #8ba0b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.bot-command-copy strong {
    display: block;
    margin-top: 2px;
    color: #edf2f7;
    font-size: 16px;
    line-height: 1.2;
}

.bot-command-kpis {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bot-command-kpis span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.07);
    color: #b8c6d8;
    font-size: 11px;
    font-weight: 700;
}

.bot-settings-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    background: #0d121b;
}

.bot-card {
    position: relative;
    overflow: hidden;
    margin: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015)), #111827;
    box-shadow: 0 14px 32px rgba(0,0,0,0.22);
}

.bot-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--bot-color, #00d4aa);
}

.bot-card:hover {
    border-color: rgba(255,255,255,0.16);
    transform: translateY(-1px);
}

.bot-card-market-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.bot-card-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
}

.bot-card-metrics div {
    padding: 7px;
    border-radius: 8px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.06);
    min-width: 0;
}

.bot-card-metrics span {
    display: block;
    color: #7c8da5;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.bot-card-metrics strong {
    display: block;
    margin-top: 3px;
    color: #edf2f7;
    font-size: 11px;
    line-height: 1.2;
    word-break: break-word;
}

.bot-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    border-radius: 8px;
}

.bot-running-panel {
    margin: 10px;
    border: 1px solid rgba(0,212,170,0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(0,212,170,0.075), rgba(59,130,246,0.045)), #0e1622;
}

.bot-profit-display,
.bot-stat,
.bot-progress-section,
.bot-log-section {
    border-radius: 8px;
}

.history-list {
    max-height: 380px;
}

.history-item-v2 {
    align-items: center;
    gap: 10px;
}

.history-item-info {
    min-width: 0;
}

.history-item-type,
.history-item-time {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-meta {
    margin-left: auto;
    text-align: right;
    min-width: 86px;
}

.history-source {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #8ba0b8;
    background: rgba(255,255,255,0.06);
}

.history-source.bot {
    color: #00d4aa;
    background: rgba(0,212,170,0.1);
}

.statement-table th,
.statement-table td {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .history-title-row {
        position: sticky;
        top: 0;
        z-index: 6;
    }

    #dashboard-screen.active {
        height: 100dvh;
        overflow: hidden;
        padding-bottom: 0;
    }

    #dashboard-screen.active .dashboard-body {
        display: block !important;
        position: relative;
        height: calc(100dvh - 108px);
        height: calc(100dvh - 52px - 56px - env(safe-area-inset-bottom));
        overflow: hidden;
        min-height: 0;
    }

    #dashboard-screen.active .panel-chart,
    #dashboard-screen.active .panel-trade {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        transition: transform 0.22s ease, opacity 0.22s ease;
    }

    #dashboard-screen.active .panel-chart {
        display: flex !important;
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    #dashboard-screen.active .panel-chart.mobile-hidden,
    #dashboard-screen.active .panel-chart.tab-hidden {
        display: flex !important;
        transform: translateX(-105%);
        opacity: 0;
        pointer-events: none;
    }

    #dashboard-screen.active .panel-chart.mobile-active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    #dashboard-screen.active .panel-trade {
        display: flex !important;
        flex-direction: column;
        transform: translateX(105%);
        opacity: 0;
        pointer-events: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #0b1018;
        z-index: 55;
    }

    #dashboard-screen.active .panel-trade.mobile-active,
    #dashboard-screen.active .panel-trade.tab-active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    #dashboard-screen.active .panel-trade.mobile-hidden {
        transform: translateX(105%);
        opacity: 0;
        pointer-events: none;
    }

    #dashboard-screen.active .trade-mode-content.hidden {
        display: none !important;
    }

    #dashboard-screen.active .trade-mode-content:not(.hidden) {
        display: flex !important;
        flex-direction: column;
        min-height: 100%;
    }

    #mobile-tab-bar {
        height: 56px;
        height: calc(56px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: #0b1018;
        border-top-color: rgba(255,255,255,0.08);
    }

    .mobile-tab {
        min-width: 0;
        letter-spacing: 0.4px;
    }

    .trade-section-header {
        top: 0;
    }

    .bot-command-center {
        grid-template-columns: auto 1fr;
        padding: 12px;
    }

    .bot-command-kpis {
        gap: 6px;
    }

    .bot-settings-form,
    .bot-card-metrics {
        grid-template-columns: 1fr;
    }

    .bot-card {
        margin: 8px 10px;
    }

    .history-list {
        max-height: none;
    }
}
