/* ============================================================
   QuantumGrid Design System v2.0
   ============================================================ */

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

/* === CSS Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === Design Tokens === */
:root {
    --bg-primary:       #0A0E1A;
    --bg-secondary:     #111827;
    --bg-tertiary:      #1A2235;
    --bg-sidenav:       #0D1117;
    --border:           #1E2D45;
    --text-primary:     #F0F4FF;
    --text-secondary:   #8B9AB0;
    --text-muted:       #4A5568;
    --accent-blue:      #3B82F6;
    --accent-blue-hover:#2563EB;
    --accent-purple:    #7C3AED;
    --accent-purple-glow:#8B5CF6;
    --success:          #10B981;
    --warning:          #F59E0B;
    --danger:           #EF4444;
    --gradient-brand:   linear-gradient(135deg, #3B82F6 0%, #7C3AED 100%);
    --radius:           8px;
    --radius-lg:        12px;
    --shadow-card:      0 4px 24px rgba(0,0,0,0.4);
    --font-body:        'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:        'JetBrains Mono', 'Courier New', monospace;
}

/* === Base === */
html { font-size: 14px; }
body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent-blue); text-decoration: none; transition: color 150ms; }
a:hover { color: var(--accent-blue-hover); }

::selection { background: rgba(59,130,246,0.3); color: var(--text-primary); }

/* Monospace numbers */
.mono { font-family: var(--font-mono); }

/* === Scrollbar === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo:hover { text-decoration: none; opacity: 0.9; }

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}
.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: color 150ms, background 150ms;
}
.nav-links a:hover {
    color: var(--text-primary);
    text-decoration: none;
}
.nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Plan badge in navbar */
.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.plan-badge.starter { background: var(--border); color: var(--text-secondary); }
.plan-badge.trader  { background: #1E3A5F; color: var(--accent-blue); }
.plan-badge.pro     { background: #2D1B69; color: var(--accent-purple-glow); }

/* Mobile hamburger */
.nav-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 24px; cursor: pointer; padding: 8px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 200ms;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: 0 2px 12px rgba(59,130,246,0.25);
}
.btn-primary:hover { opacity: 0.9; color: #fff; }

.btn-secondary, .btn-outline {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}
.btn-secondary:hover, .btn-outline:hover {
    background: rgba(59,130,246,0.1);
    color: var(--accent-blue);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #DC2626; color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.btn-lg { padding: 16px 36px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-block { display: flex; width: 100%; }
.btn.disabled, .btn:disabled { opacity: 0.5; pointer-events: none; }

.inline-form { display: inline; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: border-color 200ms;
}
.card:hover { border-color: rgba(59,130,246,0.3); }
.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Settings cards (legacy compat) */
.settings-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}
.settings-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.settings-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color 200ms, box-shadow 200ms;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}
.form-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Checkbox / toggle */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    cursor: pointer;
    font-size: 14px;
}
.toggle-label input { accent-color: var(--accent-blue); width: 18px; height: 18px; }

/* ============================================================
   ALERTS / FLASH MESSAGES
   ============================================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: alertSlideIn 300ms ease-out;
}
@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alert-error, .alert-danger {
    background: #450A0A;
    border-left: 4px solid var(--danger);
    color: #FCA5A5;
}
.alert-success {
    background: #064E3B;
    border-left: 4px solid var(--success);
    color: #6EE7B7;
}
.alert-warning {
    background: #451A03;
    border-left: 4px solid var(--warning);
    color: #FCD34D;
}
.alert-info {
    background: #1E3A5F;
    border-left: 4px solid var(--accent-blue);
    color: #93C5FD;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; margin-bottom: 24px; border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--bg-tertiary); }
th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
tr:nth-child(even) { background: rgba(255,255,255,0.02); }
tr:hover { background: rgba(59,130,246,0.05); }
td .mono, .table-num { font-family: var(--font-mono); font-size: 13px; }

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 14px;
    color: var(--text-primary);
}

/* Color utilities */
.positive { color: var(--success); }
.negative { color: var(--danger); }
.buy-side { color: var(--success); font-weight: 600; }
.sell-side { color: var(--danger); font-weight: 600; }
.text-muted { color: var(--text-secondary); }
.text-warning { color: var(--warning); }
.empty-state { color: var(--text-secondary); padding: 32px 0; text-align: center; font-size: 14px; }

code {
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-purple-glow);
}

/* Row states */
.row-inactive { opacity: 0.4; }
.action-cell { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ============================================================
   STATUS INDICATORS
   ============================================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.running {
    background: var(--success);
    animation: statusPulse 2s infinite;
}
.status-dot.paused { background: var(--warning); }
.status-dot.error {
    background: var(--danger);
    animation: statusPulse 2s infinite;
}
@keyframes statusPulse {
    0%   { box-shadow: 0 0 0 0 currentColor; transform: scale(1); }
    50%  { box-shadow: 0 0 0 6px transparent; transform: scale(1.3); }
    100% { box-shadow: 0 0 0 0 transparent; transform: scale(1); }
}
.status-dot.running { color: var(--success); }
.status-dot.error   { color: var(--danger); }

/* ============================================================
   BANNERS
   ============================================================ */
.beta-banner {
    background: var(--gradient-brand);
    color: #fff;
    text-align: center;
    padding: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.beta-dashboard-banner {
    background: var(--gradient-brand);
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
}
.testing-mode-banner {
    background: var(--danger);
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============================================================
   LANDING PAGE — HERO
   ============================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    overflow: hidden;
}

/* Grid pattern overlay */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(30,45,69,0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30,45,69,0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Animated gradient orb */
.hero-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(123,58,237,0.15) 0%, rgba(59,130,246,0.08) 50%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat 8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%      { transform: translate(-50%, -50%) scale(1.15); }
}

.hero-content { position: relative; z-index: 2; max-width: 800px; }

.hero h1 {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.hero .subtext {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Stats bar */
.hero-stats {
    display: inline-flex;
    gap: 32px;
    padding: 16px 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: 14px;
}
.hero-stats .stat-item { display: flex; align-items: center; gap: 8px; }
.hero-stats .stat-value { color: var(--success); font-weight: 500; }

/* ============================================================
   LANDING PAGE — HOW IT WORKS
   ============================================================ */
.how-it-works { padding: 100px 0; }
.how-it-works h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 56px;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.step-card { text-align: center; padding: 32px 24px; }
.step-num {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.step-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.step-card p { color: var(--text-secondary); font-size: 15px; line-height: 1.7; }

/* ============================================================
   LANDING PAGE — FEATURES
   ============================================================ */
.features-section { padding: 100px 0; }
.features-section h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}
.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 56px;
    font-size: 16px;
}
.feature-grid-lg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feature-card-lg {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
    transition: border-color 200ms, transform 200ms;
}
.feature-card-lg:hover {
    border-color: rgba(59,130,246,0.3);
    transform: translateY(-2px);
}
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: rgba(59,130,246,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}
.feature-card-lg h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.feature-card-lg p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; }

/* ============================================================
   LANDING PAGE — LIVE PERFORMANCE
   ============================================================ */
.live-perf-section { padding: 100px 0; text-align: center; }
.live-perf-section h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}
.live-perf-card {
    display: inline-block;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 60px;
    box-shadow: var(--shadow-card);
    margin-top: 32px;
    text-align: center;
}
.live-perf-card .perf-stats {
    display: flex;
    gap: 48px;
    justify-content: center;
    margin-bottom: 20px;
}
.live-perf-card .perf-stat-item {
    text-align: center;
}
.live-perf-card .perf-stat-value {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    color: var(--success);
    display: block;
}
.live-perf-card .perf-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.live-perf-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 24px;
}

/* ============================================================
   LANDING PAGE — PRICING
   ============================================================ */
.pricing { padding: 100px 0; }
.pricing h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* Annual toggle */
.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}
.pricing-toggle span { font-size: 14px; color: var(--text-secondary); }
.pricing-toggle span.active { color: var(--text-primary); font-weight: 600; }
.pricing-toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--border);
    border-radius: 13px;
    cursor: pointer;
    transition: background 200ms;
}
.pricing-toggle-switch.active { background: var(--accent-blue); }
.pricing-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 200ms;
}
.pricing-toggle-switch.active::after { transform: translateX(22px); }
.pricing-toggle-label { text-align: center; color: var(--text-muted); margin-bottom: 40px; font-size: 14px; }
.pricing-save-badge {
    background: rgba(16,185,129,0.15);
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}
.pricing-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-card);
    transition: border-color 200ms, transform 200ms;
}
.pricing-card:hover { transform: translateY(-2px); }
.pricing-card.featured {
    border-color: var(--accent-purple);
    box-shadow: 0 4px 32px rgba(124,58,237,0.2);
}
.pricing-card .badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-brand);
    color: #fff;
    padding: 4px 20px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.pricing-card h3 { font-size: 22px; font-weight: 600; margin-bottom: 12px; }
.price {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: var(--font-mono);
}
.price span { font-size: 16px; color: var(--text-secondary); font-weight: 400; }
.pricing-card ul { list-style: none; margin: 24px 0 32px; }
.pricing-card li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}
.pricing-card li::before { content: '\2713  '; color: var(--success); font-weight: 700; }
.pricing-note {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 32px;
    font-size: 14px;
}

/* ============================================================
   LANDING PAGE — TESTIMONIALS
   ============================================================ */
.social-proof { padding: 100px 0; }
.social-proof h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 48px;
}
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.testimonial-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
}
.testimonial-stars { color: var(--warning); font-size: 16px; margin-bottom: 16px; }
.testimonial-quote {
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.8;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}
.testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.testimonial-author-info strong { display: block; color: var(--text-primary); font-size: 14px; }
.testimonial-author-info span { font-size: 12px; color: var(--text-secondary); }

/* ============================================================
   LANDING PAGE — FAQ
   ============================================================ */
.faq-section { padding: 100px 0; }
.faq-section h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 48px;
}
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    background: var(--bg-secondary);
    overflow: hidden;
    transition: border-color 200ms;
}
.faq-item:hover { border-color: rgba(59,130,246,0.3); }
.faq-item summary {
    padding: 20px 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    transition: color 150ms;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 20px;
    color: var(--accent-blue);
    font-weight: 400;
    transition: transform 200ms;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p {
    padding: 0 24px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: var(--bg-sidenav);
    padding: 60px 0 32px;
    border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}
.footer-brand p { color: var(--text-secondary); font-size: 14px; margin-top: 10px; }
.footer-links h4 {
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.footer-links a {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 4px 0;
    transition: color 150ms;
}
.footer-links a:hover { color: var(--text-primary); text-decoration: none; }
.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.footer-bottom p { color: var(--text-secondary); font-size: 13px; }
.footer-disclaimer { margin-top: 8px; font-size: 12px; color: var(--text-muted); }

/* ============================================================
   AUTH PAGES (Login, Signup, Forgot, Reset)
   ============================================================ */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 64px);
    padding: 40px 24px;
}
.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-card);
}
.auth-card .logo-header {
    text-align: center;
    margin-bottom: 8px;
}
.auth-card .logo-header .logo { font-size: 28px; }
.auth-card h2 {
    text-align: center;
    margin-bottom: 6px;
    font-size: 24px;
    font-weight: 700;
}
.auth-card .subtext {
    text-align: center;
    margin-bottom: 28px;
    color: var(--text-secondary);
    font-size: 14px;
}
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Password strength meter */
.password-strength {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin-top: 6px;
    overflow: hidden;
}
.password-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 300ms, background 300ms;
    width: 0;
}
.password-strength-fill.weak   { width: 33%; background: var(--danger); }
.password-strength-fill.medium { width: 66%; background: var(--warning); }
.password-strength-fill.strong { width: 100%; background: var(--success); }

/* ============================================================
   DASHBOARD LAYOUT WITH SIDE NAV
   ============================================================ */
.app-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

/* Side navigation */
.side-nav {
    width: 240px;
    background: var(--bg-sidenav);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    flex-shrink: 0;
}
.side-nav-section {
    margin-bottom: 24px;
}
.side-nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 12px;
    margin-bottom: 8px;
}
.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 150ms;
    text-decoration: none;
    margin-bottom: 2px;
}
.side-nav a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.side-nav a.active {
    background: var(--bg-tertiary);
    color: var(--accent-blue);
    border-left: 3px solid var(--accent-blue);
    padding-left: 13px;
}
.side-nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }

/* Main content area */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-x: hidden;
    min-width: 0;
}

/* ============================================================
   DASHBOARD — STATUS BAR
   ============================================================ */
.dash-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.dash-status-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}
.status-item strong { color: var(--text-primary); }
.status-text-running { color: var(--success); font-weight: 600; }
.status-text-paused  { color: var(--warning); font-weight: 600; }
.status-text-error   { color: var(--danger); font-weight: 600; }

/* Legacy compat */
.status-bar {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.dashboard-section { padding: 32px 0; }
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

/* ============================================================
   DASHBOARD — METRICS GRID
   ============================================================ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}
.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: border-color 200ms;
}
.metric-card:hover { border-color: rgba(59,130,246,0.3); }
.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    font-weight: 500;
}
.metric-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}
.metric-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Legacy perf grid (admin reuse) */
.perf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.perf-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.perf-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    font-weight: 500;
}
.perf-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
}
.perf-value.positive { color: var(--success); }
.perf-value.negative { color: var(--danger); }

/* ============================================================
   DASHBOARD — TWO-COLUMN LAYOUT
   ============================================================ */
.dash-columns {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 24px;
}
.dash-col-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}
.dash-col-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Activity feed */
.activity-feed { list-style: none; }
.activity-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }
.activity-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.activity-text { color: var(--text-secondary); }

/* Quick stats */
.quick-stat {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.quick-stat:last-child { border-bottom: none; }
.quick-stat-label { color: var(--text-secondary); }
.quick-stat-value { font-family: var(--font-mono); font-weight: 500; color: var(--text-primary); }

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-section { padding: 32px 0; }
.settings-section h1 { margin-bottom: 24px; font-size: 24px; font-weight: 700; }

/* Key status badge */
.key-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}
.key-status.connected { background: rgba(16,185,129,0.12); color: var(--success); }
.key-status.disconnected { background: rgba(239,68,68,0.12); color: var(--danger); }

/* Coin grid */
.coin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.coin-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: border-color 200ms;
}
.coin-item.selected { border-color: var(--accent-blue); background: rgba(59,130,246,0.05); }
.coin-item.locked { opacity: 0.4; pointer-events: none; position: relative; }
.coin-item.locked::after {
    content: '\1F512';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
}
.coin-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.coin-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-blue);
    flex-shrink: 0;
}
.coin-info .coin-ticker { font-weight: 600; font-size: 14px; }
.coin-info .coin-name { font-size: 11px; color: var(--text-muted); }
.coin-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}
.coin-checkbox input { accent-color: var(--accent-blue); width: 16px; height: 16px; }
.alloc-group { margin-bottom: 0; margin-top: 8px; }
.alloc-group label { font-size: 11px; color: var(--text-muted); }
.alloc-group input {
    padding: 8px 12px;
    font-size: 13px;
    font-family: var(--font-mono);
}

/* Trading mode toggle cards */
.mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.mode-card {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all 200ms;
    text-align: center;
}
.mode-card:hover { border-color: var(--text-muted); }
.mode-card.active { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.mode-card-icon { font-size: 36px; margin-bottom: 12px; }
.mode-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.mode-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.mode-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.mode-badge.safe { background: rgba(16,185,129,0.12); color: var(--success); }
.mode-badge.live { background: rgba(239,68,68,0.12); color: var(--danger); }
.mode-warning {
    font-size: 12px;
    color: var(--warning);
    margin-top: 8px;
}

/* Strategy settings */
.strategy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.strategy-field { position: relative; }

/* ── Education Tooltip Trigger (?) ── */
.edu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    margin-left: 6px;
    vertical-align: middle;
    transition: background 150ms, color 150ms;
    flex-shrink: 0;
    line-height: 1;
}
.edu-trigger:hover,
.edu-trigger:focus {
    background: var(--accent-blue);
    color: #fff;
    outline: none;
}

/* ── Education Tooltip Popup ── */
.edu-tooltip {
    position: absolute;
    z-index: 9999;
    width: 320px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 150ms ease-out, transform 150ms ease-out;
}
.edu-tooltip.edu-tooltip-visible {
    opacity: 1;
    transform: translateY(0);
}
.edu-tooltip-inner {
    background: #1A2235;
    border: 1px solid var(--accent-blue);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Arrow */
.edu-tooltip-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #1A2235;
    border: 1px solid var(--accent-blue);
    transform: rotate(45deg);
    z-index: -1;
}
.edu-tooltip[data-arrow="bottom"] .edu-tooltip-arrow {
    bottom: -9px;
    border-top: none;
    border-left: none;
}
.edu-tooltip[data-arrow="top"] .edu-tooltip-arrow {
    top: -9px;
    border-bottom: none;
    border-right: none;
}

/* Content sections */
.edu-tooltip-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.edu-tooltip-section {
    margin-bottom: 10px;
}
.edu-tooltip-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.edu-tooltip-text {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
}
.edu-tooltip-tip {
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 12px;
    color: #93C5FD;
    line-height: 1.6;
}

/* Legacy tooltip-btn compat (hidden, replaced by edu-trigger) */
.strategy-field .tooltip-btn { display: none; }
.strategy-field .tooltip-text { display: none; }

/* Collapsible instructions */
.instructions-toggle {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
}
.instructions-toggle:hover { color: var(--accent-blue-hover); }
.instructions-content {
    display: none;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
    margin-bottom: 16px;
}
.instructions-content.open { display: block; }
.instructions-content ol {
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 2;
}

/* Info popup — legacy class, now uses .edu-trigger instead */
.info-popup-btn {
    display: none;
}
.info-popup-text {
    display: none;
}

/* ============================================================
   BILLING PAGE
   ============================================================ */
.billing-section { padding: 32px 0; }
.billing-section h1 { margin-bottom: 24px; font-size: 24px; font-weight: 700; }

.current-plan { text-align: center; margin-bottom: 20px; }
.plan-name {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.plan-price {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 600;
    margin: 6px 0;
}
.plan-price span { font-size: 14px; color: var(--text-secondary); font-weight: 400; }
.plan-status { font-size: 14px; color: var(--text-secondary); }

.trial-banner {
    background: #1E3A5F;
    border-left: 4px solid var(--accent-blue);
    color: #93C5FD;
    padding: 14px 20px;
    border-radius: var(--radius);
    text-align: center;
    font-size: 14px;
    margin-bottom: 16px;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}
.plan-option {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    transition: border-color 200ms;
}
.plan-option:hover { border-color: rgba(59,130,246,0.3); }
.plan-option.current { border-color: var(--accent-blue); }
.plan-option h3 { font-size: 18px; margin-bottom: 8px; }
.plan-option .plan-price { font-size: 20px; }
.plan-option ul { list-style: none; margin: 16px 0 20px; font-size: 13px; color: var(--text-secondary); }
.plan-option li { padding: 4px 0; }

/* ============================================================
   ADMIN PAGE
   ============================================================ */
.admin-section { padding: 32px 0; }
.admin-section h1 { margin-bottom: 24px; font-size: 24px; font-weight: 700; }

/* ============================================================
   ONBOARDING
   ============================================================ */
.onboarding-section { padding: 40px 0; max-width: 780px; margin: 0 auto; }

.ob-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 36px;
}
.ob-step-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    color: var(--text-muted);
    transition: all 200ms;
}
.ob-step-dot.active {
    background: var(--gradient-brand);
    border-color: var(--accent-blue);
    color: #fff;
}
.ob-step-dot.done { background: var(--success); border-color: var(--success); color: #fff; }
.ob-step-line {
    flex: 1;
    max-width: 48px;
    height: 2px;
    background: var(--border);
    transition: background 200ms;
}
.ob-step-line.done { background: var(--success); }

.ob-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-card);
}
.ob-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.ob-lead { color: var(--text-secondary); margin-bottom: 24px; font-size: 15px; line-height: 1.6; }
.ob-card-center { text-align: center; }

.ob-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 28px;
}
.ob-info-item h3 { margin-bottom: 10px; font-size: 16px; }
.ob-info-item ul { padding-left: 20px; color: var(--text-secondary); font-size: 14px; }
.ob-info-item li { margin-bottom: 8px; }

.ob-steps-guide { margin-bottom: 28px; }
.ob-guide-step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.ob-guide-step:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.ob-guide-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.ob-guide-step h3 { margin-bottom: 6px; font-size: 15px; }
.ob-guide-step p { color: var(--text-secondary); font-size: 14px; margin-bottom: 8px; }
.ob-guide-step ul { padding-left: 18px; color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.ob-guide-step li { margin-bottom: 4px; }

.ob-screenshot-placeholder {
    background: var(--bg-primary);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}

.ob-warning {
    background: #451A03;
    border-left: 4px solid var(--warning);
    color: #FCD34D;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin: 8px 0;
}

.ob-btn-row { display: flex; gap: 12px; margin-top: 8px; }

.ob-validate-result {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin: 12px 0;
}
.ob-validate-result.success { background: #064E3B; color: #6EE7B7; border-left: 4px solid var(--success); }
.ob-validate-result.error { background: #450A0A; color: #FCA5A5; border-left: 4px solid var(--danger); }

.ob-check-list { list-style: none; text-align: left; display: inline-block; margin: 0 auto 28px; }
.ob-check-list li { padding: 8px 0; font-size: 15px; }
.ob-check-list li::before { content: '\2713  '; color: var(--success); font-weight: 700; }

.ob-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.modal p { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; line-height: 1.6; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 600ms linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Save feedback */
.save-feedback {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--success);
    opacity: 0;
    transition: opacity 300ms;
}
.save-feedback.visible { opacity: 1; }

/* ============================================================
   RESPONSIVE — TABLET (768px)
   ============================================================ */
@media (max-width: 768px) {
    html { font-size: 13px; }

    .hero h1 { font-size: 36px; }
    .hero-sub { font-size: 16px; }
    .hero { padding: 80px 20px 60px; min-height: auto; }
    .hero-ctas { flex-direction: column; align-items: center; }
    .hero-ctas .btn { width: 100%; max-width: 320px; }
    .hero-stats { flex-direction: column; gap: 12px; padding: 16px 20px; }
    .hero-orb { width: 300px; height: 300px; }

    .steps-grid, .feature-grid-lg, .pricing-grid, .testimonial-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }

    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
        gap: 4px;
        z-index: 99;
    }
    .nav-toggle { display: block; }

    /* Side nav collapses */
    .app-layout { flex-direction: column; }
    .side-nav {
        width: 100%;
        display: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px;
    }
    .side-nav.open { display: block; }
    .side-nav a { display: inline-flex; }

    .main-content { padding: 20px 16px; }

    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-columns { grid-template-columns: 1fr; }
    .dash-status-bar { flex-direction: column; align-items: flex-start; }
    .dash-header { flex-direction: column; gap: 12px; align-items: flex-start; }

    .status-bar { flex-direction: column; gap: 10px; align-items: flex-start; }

    .mode-cards { grid-template-columns: 1fr; }
    .strategy-grid { grid-template-columns: 1fr; }
    .coin-grid { grid-template-columns: repeat(2, 1fr); }
    .plan-grid { grid-template-columns: 1fr; }

    .ob-guide-step { flex-direction: column; }
    .ob-card { padding: 24px; }

    .live-perf-card { padding: 24px 20px; }
    .live-perf-card .perf-stats { flex-direction: column; gap: 20px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (480px)
   ============================================================ */
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero h1 { font-size: 28px; }
    .btn-lg { padding: 14px 24px; font-size: 15px; }
    .metrics-grid { grid-template-columns: 1fr; }
    .coin-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 32px 24px; }
    .pricing-card { padding: 28px 20px; }
}

/* ============================================================
   CHART COMPONENTS
   ============================================================ */
.chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    overflow: hidden;
}
.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}
.chart-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.chart-header-left h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
.chart-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.chart-live-price {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
}
.chart-live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
}
.chart-live-indicator .live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
    animation: statusPulse 2s infinite;
    color: var(--danger);
}

/* Coin tabs */
.coin-tabs {
    display: flex;
    gap: 4px;
}
.coin-tab {
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 150ms;
    font-family: var(--font-body);
}
.coin-tab:hover { border-color: var(--text-muted); color: var(--text-primary); }
.coin-tab.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

/* Timeframe pills */
.tf-pills { display: flex; gap: 4px; }
.tf-btn {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 150ms;
    font-family: var(--font-mono);
}
.tf-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.tf-btn.active { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--text-secondary); }

.chart-container { width: 100%; }
.chart-footer {
    padding: 8px 24px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

/* ============================================================
   STATUS BAR — LIVE PRICE TICKER
   ============================================================ */
.status-ticker {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.ticker-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}
.ticker-coin { font-weight: 600; color: var(--text-primary); }
.ticker-price {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 500;
    transition: color 300ms;
}
.ticker-change {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
}
.price-flash { animation: priceFlash 600ms ease-out; }
@keyframes priceFlash {
    0% { background: rgba(59,130,246,0.3); }
    100% { background: transparent; }
}

/* ============================================================
   METRICS — SECONDARY ROW (6 small cards)
   ============================================================ */
.metrics-grid-sm {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.metric-card-sm {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
}
.metric-card-sm .metric-label { font-size: 11px; margin-bottom: 4px; }
.metric-card-sm .metric-value { font-size: 18px; }

/* Win rate arc */
.win-rate-arc {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: conic-gradient(var(--success) var(--arc-pct, 60%), var(--border) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    float: right;
    margin-top: -4px;
}
.win-rate-arc-inner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
}

/* ============================================================
   REGIME BADGES
   ============================================================ */
.regime-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.regime-badge.ranging { background: #1E3A5F; color: var(--accent-blue); }
.regime-badge.uptrend { background: #064E3B; color: var(--success); }
.regime-badge.downtrend { background: #450A0A; color: var(--danger); }

/* ============================================================
   COIN BREAKDOWN CARDS
   ============================================================ */
.coin-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.coin-breakdown-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: border-color 200ms, transform 200ms;
}
.coin-breakdown-card:hover {
    border-color: rgba(59,130,246,0.3);
    transform: translateY(-2px);
}
.coin-breakdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.coin-breakdown-stats {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}
.coin-breakdown-stats strong { color: var(--text-primary); }

/* ============================================================
   EXPANDABLE TABLE ROWS
   ============================================================ */
.expandable-row { cursor: pointer; }
.expandable-row:hover { background: rgba(59,130,246,0.08); }
.expandable-row td:first-child::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 6px;
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 200ms;
}
.expandable-row.row-expanded td:first-child::before { transform: rotate(90deg); }
.row-detail {
    display: none;
    background: var(--bg-primary);
}
.row-detail-open { display: table-row; }
.row-detail td {
    padding: 16px 24px;
    font-size: 13px;
    color: var(--text-secondary);
}
.grid-level-list { list-style: none; padding: 0; }
.grid-level-list li {
    padding: 4px 0;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* ============================================================
   P&L CHART RANGE BUTTONS
   ============================================================ */
.pnl-range-pills { display: flex; gap: 4px; }
.pnl-range-btn {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 150ms;
    font-family: var(--font-mono);
}
.pnl-range-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.pnl-range-btn.active { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--text-secondary); }

/* ============================================================
   IQ ASSISTANT — CHAT BUBBLE
   ============================================================ */
.iq-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    box-shadow: 0 4px 24px rgba(59,130,246,0.4);
    transition: transform 200ms, opacity 200ms;
    animation: iqPulseOnce 2s ease-out 1s 1;
    font-family: var(--font-body);
}
.iq-bubble:hover { transform: scale(1.08); }
.iq-bubble.iq-hidden { opacity: 0; pointer-events: none; transform: scale(0.8); }
.iq-bubble .iq-bubble-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms;
    border: 1px solid var(--border);
}
.iq-bubble:hover .iq-bubble-tooltip { opacity: 1; }

/* NEW badge */
.iq-bubble.iq-new::after {
    content: 'NEW';
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
}

@keyframes iqPulseOnce {
    0% { box-shadow: 0 4px 24px rgba(59,130,246,0.4); }
    50% { box-shadow: 0 4px 40px rgba(59,130,246,0.7); }
    100% { box-shadow: 0 4px 24px rgba(59,130,246,0.4); }
}

/* ============================================================
   IQ ASSISTANT — CHAT PANEL
   ============================================================ */
.iq-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    height: 540px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 -8px 64px rgba(0,0,0,0.5);
    z-index: 901;
    display: flex;
    flex-direction: column;
    transform: translateY(100%) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform 250ms ease-out, opacity 250ms ease-out;
}
.iq-panel.iq-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.iq-panel-header {
    background: var(--gradient-brand);
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.iq-panel-header-left h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.iq-panel-header-left .iq-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}
.iq-panel-header-left .iq-online {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    margin-top: 4px;
}
.iq-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}
.iq-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms;
}
.iq-close-btn:hover { background: rgba(255,255,255,0.3); }

/* Messages area */
.iq-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.iq-msg {
    display: flex;
    gap: 8px;
    animation: iqMsgIn 200ms ease-out;
}
@keyframes iqMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.iq-msg-user {
    justify-content: flex-end;
    flex-direction: column;
    align-items: flex-end;
}
.iq-msg-iq {
    justify-content: flex-start;
    align-items: flex-start;
}

.iq-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.iq-msg-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    max-width: 280px;
    word-wrap: break-word;
}
.iq-msg-bubble-user {
    background: var(--accent-blue);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.iq-msg-bubble-iq {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-left: 3px solid var(--accent-purple);
    border-bottom-left-radius: 4px;
}

.iq-msg-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Typing animation */
.iq-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}
.iq-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-purple-glow);
    animation: iqBounce 1.4s infinite ease-in-out;
}
.iq-typing span:nth-child(2) { animation-delay: 0.2s; }
.iq-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes iqBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Suggestion chips */
.iq-chips {
    padding: 0 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.iq-chip {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 150ms;
    font-family: var(--font-body);
    white-space: nowrap;
}
.iq-chip:hover { border-color: var(--accent-blue); color: var(--accent-blue); }

/* Input area */
.iq-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}
.iq-input-wrap { flex: 1; position: relative; }
#iq-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    resize: none;
    max-height: 80px;
    transition: border-color 200ms;
}
#iq-input:focus { outline: none; border-color: var(--accent-blue); }
#iq-input::placeholder { color: var(--text-muted); }
#iq-char-count {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 10px;
    color: var(--text-muted);
}
.iq-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-brand);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 200ms;
    font-size: 16px;
}
.iq-send-btn:hover { opacity: 0.9; }
.iq-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Disclaimer */
.iq-disclaimer {
    padding: 6px 16px 10px;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============================================================
   IQ / CHART RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .iq-panel {
        width: 100%;
        height: 85vh;
        bottom: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
    }
    .metrics-grid-sm { grid-template-columns: repeat(3, 1fr); }
    .coin-breakdown-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-header { flex-direction: column; align-items: flex-start; }
    .status-ticker { display: none; }
}

@media (max-width: 480px) {
    .metrics-grid-sm { grid-template-columns: repeat(2, 1fr); }
    .coin-breakdown-grid { grid-template-columns: 1fr; }
}
