/* ==================== 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%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.25; animation: float 12s ease-in-out infinite; }
.orb-1 { width: 500px; height: 500px; background: var(--accent); top: 5%; left: -10%; }
.orb-2 { width: 400px; height: 400px; background: var(--purple); top: 50%; right: -8%; animation-delay: -5s; }
.orb-3 { width: 300px; height: 300px; background: var(--blue); bottom: 10%; left: 30%; animation-delay: -8s; }
@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;
}
.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; }

/* 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 ==================== */
#dashboard-screen { display: none; height: 100vh; height: 100dvh; flex-direction: column; background: var(--bg-0); }
#dashboard-screen.active { display: flex; }

/* ---- Top Nav ---- */
.topnav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; background: var(--bg-1); border-bottom: 1px solid var(--border);
    flex-shrink: 0; gap: 8px; min-height: 52px;
}
.nav-left, .nav-right, .nav-center { display: flex; align-items: center; gap: 10px; }
.logo-small { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; color: var(--text-1); }
.logo-icon-sm {
    width: 28px; height: 28px; background: var(--gradient); border-radius: 7px;
    display: flex; align-items: center; justify-content: center; font-size: 12px; color: white;
}

.account-selector select {
    background: var(--bg-3); color: var(--text-1); border: 1px solid var(--border);
    padding: 6px 12px; border-radius: 7px; font-size: 11px; cursor: pointer;
    font-family: inherit; appearance: none; -webkit-appearance: 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 8px center; padding-right: 24px;
}

.connection-badge {
    display: flex; align-items: center; gap: 5px; padding: 4px 10px;
    background: var(--bg-3); border-radius: 100px; font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-3);
}
.conn-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); animation: pulse 2s infinite; }
.connection-badge.live .conn-dot { background: var(--success); }
.connection-badge.live .conn-text { color: var(--success); }

/* ---- Balance ---- */
.balance-display {
    display: flex; align-items: center; gap: 10px; padding: 6px 12px;
    background: var(--bg-3); border-radius: 10px; border: 1px solid var(--border);
}
.balance-info { display: flex; flex-direction: column; }
.balance-label { font-size: 9px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.balance-value { font-size: 15px; font-weight: 800; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.currency-tag { font-size: 10px; color: var(--text-3); margin-left: 3px; font-weight: 500; }
.balance-icon-wrap {
    width: 32px; height: 32px; background: var(--accent-dim); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 13px;
}

/* ---- Dashboard Body ---- */
.dashboard-body {
    display: grid; grid-template-columns: 1fr 320px; flex: 1; overflow: hidden;
    min-height: 0;
}

/* ---- Chart Panel ---- */
.panel-chart {
    display: flex; flex-direction: column; border-right: 1px solid var(--border);
    background: var(--bg-0); min-height: 0;
}

.market-header {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px;
    border-bottom: 1px solid var(--border); background: var(--bg-1); flex-shrink: 0;
    flex-wrap: wrap;
}
.market-select {
    background: var(--bg-3); color: var(--text-1); border: 1px solid var(--border);
    padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
    cursor: pointer; font-family: inherit;
    appearance: none; -webkit-appearance: 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; padding-right: 28px;
}

.price-display { display: flex; align-items: baseline; gap: 8px; }
.live-price {
    font-size: 20px; font-weight: 800; font-family: var(--font-mono);
    font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}
.price-change {
    display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600;
    padding: 2px 7px; border-radius: 5px; background: var(--bg-3); color: var(--text-3);
}
.price-change.up { background: var(--success-dim); color: var(--success); }
.price-change.down { background: var(--danger-dim); color: var(--danger); }

.chart-timeframe { margin-left: auto; display: flex; gap: 2px; background: var(--bg-3); border-radius: 7px; padding: 2px; }
.tf-btn {
    padding: 5px 10px; border: none; border-radius: 5px; font-size: 10px; font-weight: 700;
    background: transparent; color: var(--text-3); cursor: pointer; transition: var(--transition);
    text-transform: uppercase; letter-spacing: 0.3px;
}
.tf-btn.active { background: var(--accent); color: white; box-shadow: 0 2px 8px var(--accent-glow); }
.tf-btn:hover:not(.active) { color: var(--text-1); background: var(--bg-4); }

/* ---- Chart Area ---- */
.chart-area { flex: 1; padding: 6px; position: relative; min-height: 0; background: var(--bg-0); }
.chart-area canvas { width: 100% !important; height: 100% !important; border-radius: 6px; display: block; }

/* ---- Quick Stats ---- */
.quick-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border);
    flex-shrink: 0; background: var(--bg-1);
}
.qs-item {
    display: flex; flex-direction: column; align-items: center; padding: 8px 6px;
    border-right: 1px solid var(--border); gap: 1px;
}
.qs-item:last-child { border-right: none; }
.qs-label { font-size: 9px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.qs-value { font-size: 12px; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.qs-value.up { color: var(--success); }
.qs-value.down { color: var(--danger); }

/* ---- Trade Panel ---- */
.panel-trade {
    display: flex; flex-direction: column; overflow-y: auto; background: var(--bg-1);
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.panel-trade::-webkit-scrollbar { width: 4px; }
.panel-trade::-webkit-scrollbar-track { background: transparent; }
.panel-trade::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.trade-section { border-bottom: 1px solid var(--border); }
.trade-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: var(--bg-2); position: sticky; top: 0; z-index: 2;
}
.trade-section-header h3 {
    font-size: 11px; font-weight: 700; color: var(--text-2); display: flex;
    align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.trade-section-header h3 i { color: var(--accent); font-size: 11px; }
.btn-icon {
    background: transparent; border: none; color: var(--text-3); cursor: pointer;
    padding: 5px; border-radius: 5px; transition: var(--transition); font-size: 12px;
}
.btn-icon:hover { color: var(--accent); background: var(--accent-dim); }

/* ---- Trade Form ---- */
.trade-form { padding: 12px 14px; }
.form-row { margin-bottom: 10px; }
.form-row label {
    display: block; font-size: 10px; font-weight: 700; color: var(--text-3);
    margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.6px;
}
.form-control {
    width: 100%; padding: 8px 10px; background: var(--bg-3); color: var(--text-1);
    border: 1px solid var(--border); border-radius: 7px; font-size: 13px;
    transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
select.form-control {
    appearance: none; -webkit-appearance: 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; padding-right: 28px;
    cursor: pointer;
}
.input-with-unit { display: flex; align-items: center; position: relative; }
.input-with-unit input { padding-right: 42px; }
.input-with-unit .unit { position: absolute; right: 10px; font-size: 10px; color: var(--text-3); font-weight: 700; pointer-events: none; }
.duration-inputs { display: flex; gap: 6px; }
.duration-inputs input { flex: 1; }
.duration-inputs select { flex: 1; }

/* ---- Proposal ---- */
.proposal-box {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.06), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(0, 212, 170, 0.2); border-radius: 8px; padding: 10px 12px;
    margin-bottom: 10px; backdrop-filter: blur(4px);
}
.proposal-item { display: flex; justify-content: space-between; align-items: center; padding: 2px 0; font-size: 12px; }
.proposal-item span:first-child { color: var(--text-3); font-weight: 500; }
.proposal-val { font-weight: 700; color: var(--text-1); font-family: var(--font-mono); }
.proposal-val.accent { color: var(--accent); }

/* ---- Trade Button ---- */
.btn-trade {
    width: 100%; padding: 12px; border: none; border-radius: 8px;
    background: var(--gradient-btn); color: white; font-size: 14px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: var(--transition); position: relative; overflow: hidden;
    box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-trade::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0; transition: opacity 0.2s;
}
.btn-trade:hover:not(:disabled)::before { opacity: 1; }
.btn-trade:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 24px var(--accent-glow); }
.btn-trade:active:not(:disabled) { transform: translateY(0); box-shadow: 0 2px 8px var(--accent-glow); }
.btn-trade:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---- Positions & History ---- */
.positions-list, .trade-history { padding: 8px 14px; max-height: 160px; overflow-y: auto; }
.position-item, .history-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: 7px; margin-bottom: 4px;
    background: var(--bg-3); border: 1px solid var(--border); transition: var(--transition);
}
.position-item:hover { border-color: var(--border-light); }
.position-info { display: flex; flex-direction: column; gap: 1px; }
.position-symbol { font-weight: 600; font-size: 11px; }
.position-type { font-size: 10px; color: var(--text-3); }
.btn-sell {
    padding: 4px 8px; border: none; border-radius: 5px; background: var(--danger-dim);
    color: var(--danger); font-size: 10px; font-weight: 700; cursor: pointer; transition: var(--transition);
    text-transform: uppercase; letter-spacing: 0.3px;
}
.btn-sell:hover { background: var(--danger); color: white; }
.empty-state-sm {
    text-align: center; color: var(--text-3); font-size: 11px; padding: 16px 8px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ---- Status Bar ---- */
.status-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 16px; background: var(--bg-1); border-top: 1px solid var(--border);
    font-size: 10px; color: var(--text-3); flex-shrink: 0;
}
.ws-status { display: flex; align-items: center; gap: 5px; }
.ws-status i { font-size: 6px; }
.ws-status.connected { color: var(--success); }
.ws-status.disconnected { color: var(--danger); }

/* ---- Toast ---- */
.toast-container { position: fixed; top: 12px; right: 12px; z-index: 10000; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast {
    padding: 10px 14px; border-radius: 8px; font-size: 12px; font-weight: 500;
    display: flex; align-items: center; gap: 8px; animation: slideIn 0.3s ease-out;
    box-shadow: var(--shadow-lg); backdrop-filter: blur(12px); pointer-events: auto;
}
.toast.success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--success); }
.toast.error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger); }
.toast.info { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); color: var(--blue); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==================== MOBILE RESPONSIVE ==================== */

/* Tablet - Trade panel below chart */
@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-subtitle { margin: 0 auto 28px; }
    .hero-cta { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero-visual { display: none; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .markets-grid { grid-template-columns: repeat(2, 1fr); }

    /* Dashboard: stack chart and trade panel */
    .dashboard-body {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        overflow-y: auto;
    }
    .panel-chart {
        min-height: 50vh; border-right: none; border-bottom: 1px solid var(--border);
    }
    .panel-trade {
        overflow-y: visible;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column; background: var(--bg-1); padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px; z-index: 100; }
    .nav-auth { display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column; background: var(--bg-1); padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 10px; z-index: 100; }
    .nav-links.open, .nav-auth.open { display: flex; }
    .mobile-menu-btn { display: flex; align-items: center; }
    .hero { padding: 80px 0 50px; }
    .hero h1 { font-size: 32px; }
    .features-grid { grid-template-columns: 1fr; }
    .markets-grid { grid-template-columns: 1fr 1fr; }
    .steps-grid { flex-direction: column; gap: 12px; }
    .step-connector { transform: rotate(90deg); }
    .cta-card { padding: 30px 20px; }
    .footer-content { flex-direction: column; text-align: center; }

    /* Dashboard Mobile */
    .topnav {
        padding: 6px 10px; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: auto;
    }
    .nav-left { order: 1; }
    .nav-center { order: 3; width: 100%; justify-content: center; }
    .nav-right { order: 2; margin-left: auto; }
    .logo-small span { display: none; }
    .balance-display { padding: 4px 8px; }
    .balance-value { font-size: 13px; }
    .balance-label { font-size: 8px; }
    .balance-icon-wrap { width: 26px; height: 26px; font-size: 11px; }

    .dashboard-body {
        grid-template-columns: 1fr;
        grid-template-rows: 45vh auto;
        overflow-y: auto;
    }
    .panel-chart { min-height: 280px; border-right: none; border-bottom: 1px solid var(--border); }
    .market-header { padding: 8px 10px; gap: 8px; }
    .live-price { font-size: 16px; }
    .market-select { font-size: 11px; padding: 5px 8px; }
    .chart-timeframe { margin-left: 0; }
    .quick-stats { grid-template-columns: repeat(4, 1fr); }
    .qs-item { padding: 6px 4px; }
    .qs-label { font-size: 8px; }
    .qs-value { font-size: 11px; }

    .trade-form { padding: 10px 12px; }
    .trade-section-header { padding: 8px 12px; }

    .status-bar { padding: 3px 10px; font-size: 9px; }
}

/* Small phones */
@media (max-width: 480px) {
    .hero-cta { flex-direction: column; }
    .btn-xl { width: 100%; }
    .cta-buttons { flex-direction: column; align-items: stretch; }
    .markets-grid { grid-template-columns: 1fr; }
    .hero-stats { flex-direction: column; gap: 12px; align-items: center; }

    .topnav { gap: 4px; }
    .connection-badge { font-size: 9px; padding: 3px 7px; }
    .account-selector select { font-size: 10px; padding: 5px 8px; }

    .dashboard-body { grid-template-rows: 40vh auto; }
    .panel-chart { min-height: 240px; }
    .live-price { font-size: 15px; }
    .market-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .chart-timeframe { width: 100%; justify-content: center; }
    .price-display { width: 100%; }

    .form-row { margin-bottom: 8px; }
    .form-control { padding: 7px 9px; font-size: 13px; }
    .btn-trade { padding: 11px; font-size: 13px; }
    .proposal-box { padding: 8px 10px; }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    .dashboard-body {
        grid-template-columns: 1fr 280px;
        grid-template-rows: 1fr;
        overflow: hidden;
    }
    .panel-chart { min-height: 0; border-right: 1px solid var(--border); border-bottom: none; }
    .panel-trade { overflow-y: auto; }
    .topnav { padding: 4px 10px; min-height: 40px; }
    .nav-center { display: none; }
    .market-header { padding: 6px 10px; }
    .quick-stats { display: none; }
    .status-bar { display: none; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* Focus styles for accessibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus:not(:focus-visible), select:focus:not(:focus-visible), input:focus:not(:focus-visible) { outline: none; }

/* ====== CHART MODES ====== */
.chart-modes {
    display: flex;
    gap: 4px;
    margin-left: auto;
}
.mode-btn {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.mode-btn:hover { border-color: var(--accent); color: var(--text-1); }
.mode-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ====== CHART TOOLBAR ====== */
.chart-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
}
.tool-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-3);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.15s;
}
.tool-btn:hover { border-color: var(--text-2); color: var(--text-1); }
.tool-btn.active { background: rgba(0, 212, 170, 0.1); border-color: var(--accent); color: var(--accent); }
.trend-indicator {
    margin-left: auto;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.trend-indicator i { font-size: 16px; }

/* ====== SIGNALS SECTION ====== */
.signals-section {
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    max-height: 300px;
    overflow-y: auto;
}
.signal-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.signal-direction {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 56px;
}
.signal-direction .signal-action {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.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: 10px;
    color: var(--text-3);
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}
.signal-info { flex: 1; }
.signal-reason {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.4;
}

/* ====== TIPS LIST ====== */
.tips-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-1);
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-2);
    line-height: 1.4;
    transition: border-color 0.15s;
}
.tip-item:hover { border-color: var(--accent); }
.tip-item i {
    color: var(--accent);
    font-size: 12px;
    margin-top: 1px;
    flex-shrink: 0;
}

/* ====== RESPONSIVE: Chart modes & signals ====== */
@media (max-width: 768px) {
    .chart-modes { gap: 2px; }
    .mode-btn { padding: 3px 7px; font-size: 10px; }
    .chart-toolbar { padding: 4px 8px; gap: 4px; flex-wrap: wrap; }
    .tool-btn { padding: 3px 7px; font-size: 9px; }
    .signals-section { padding: 8px; max-height: 200px; }
    .signal-card { padding: 8px; gap: 8px; }
    .tip-item { padding: 6px 8px; font-size: 10px; }
}
@media (max-width: 480px) {
    .chart-modes { flex-wrap: wrap; }
    .mode-btn span { display: none; }
}
