/* ==========================================================================
   NEXUSPRO MASTER STYLESHEET (100% BITGET PRO THEME)
   ========================================================================== */

:root {
    --bg-base: #080B11;
    --bg-surface: #0F1420;
    --bg-surface-elevated: #141B2B;
    --bg-card: #182236;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: #00DFC0;
    
    --brand-teal: #00DFC0;
    --brand-cyan: #00F0FF;
    --brand-glow: rgba(0, 223, 192, 0.25);
    
    --buy-green: #00C087;
    --buy-glow: rgba(0, 192, 135, 0.2);
    --sell-red: #FF4B55;
    --sell-glow: rgba(255, 75, 85, 0.2);
    
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --gold: #FFB800;

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --top-bar-height: 56px;
    --bottom-bar-height: 64px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.4;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ==========================================================================
   TOP BAR (BITGET STYLE HEADER)
   ========================================================================== */
.top-header {
    height: var(--top-bar-height);
    background: rgba(15, 20, 32, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00DFC0, #0077FF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #080B11;
    font-weight: 900;
    font-size: 16px;
    box-shadow: 0 0 14px var(--brand-glow);
}

.brand-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.brand-pro-pill {
    font-size: 9px;
    font-weight: 800;
    background: var(--brand-teal);
    color: #080B11;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.6px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 20px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: var(--bg-surface-elevated);
}

.nav-link.active {
    color: var(--brand-teal);
}

.nav-link-hologram {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(139, 92, 246, 0.2)) !important;
    border: 1px solid rgba(0, 240, 255, 0.45) !important;
    color: #00F0FF !important;
    font-weight: 800 !important;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25), 0 0 20px rgba(139, 92, 246, 0.15) !important;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.nav-link-hologram:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(139, 92, 246, 0.35)) !important;
    border-color: #00F0FF !important;
    color: #fff !important;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.5), 0 0 25px rgba(139, 92, 246, 0.3) !important;
    transform: translateY(-1px);
}

.hologram-live-badge {
    background: linear-gradient(135deg, #00F0FF, #8B5CF6);
    color: #080B11;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.1;
}

.hologram-pulse-dot {
    width: 6px;
    height: 6px;
    background: #080B11;
    border-radius: 50%;
    display: inline-block;
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.7); }
}

.btn-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.btn-modal-close:hover {
    background: rgba(255, 75, 85, 0.15);
    border-color: rgba(255, 75, 85, 0.35);
    color: var(--sell-red);
    transform: scale(1.05);
}

.header-ticker-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 5px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
}

.top-stats-pill {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-surface-elevated);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.stat-val {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.stat-val.green { color: var(--buy-green); }
.stat-val.gold { color: var(--gold); }

/* ==========================================================================
   FUTURES TERMINAL GRID (BITGET PRO LAYOUT)
   ========================================================================== */
.terminal-layout {
    display: grid;
    grid-template-columns: 1fr 300px 320px;
    grid-template-rows: 48px calc(100vh - 56px - 48px - 260px) 260px;
    height: calc(100vh - var(--top-bar-height));
    background: var(--bg-base);
    overflow: hidden;
}

.ticker-sub-bar {
    grid-column: 1 / -1;
    height: 48px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 24px;
    overflow-x: auto;
}

.pair-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.pair-symbol {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
}

.pair-price {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 800;
}

.pair-change-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.pill-green { background: rgba(0, 192, 135, 0.15); color: var(--buy-green); }
.pill-red { background: rgba(255, 75, 85, 0.15); color: var(--sell-red); }

/* CHART CONTAINER */
.chart-container {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    position: relative;
    display: flex;
    flex-direction: column;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.tf-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.tf-btn.active, .tf-btn:hover {
    color: var(--brand-teal);
    background: var(--bg-surface-elevated);
}

#tradingview_chart {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 330px;
}

/* ORDER BOOK */
.orderbook-container {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
}

.ob-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.ob-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.ob-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    position: relative;
}

.ob-depth-bar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    opacity: 0.15;
    pointer-events: none;
}

.ob-depth-bar.ask { background: var(--sell-red); }
.ob-depth-bar.bid { background: var(--buy-green); }

.ob-mid-price {
    padding: 6px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    margin: 4px 0;
}

/* ORDER PLACEMENT DESK */
.order-desk {
    background: var(--bg-surface);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.desk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.leverage-badge {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--brand-teal);
    font-weight: 800;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.type-tabs {
    display: flex;
    background: var(--bg-base);
    border-radius: 6px;
    padding: 2px;
}

.type-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    font-size: 11px;
}

.type-tab.active {
    background: var(--bg-surface-elevated);
    color: #fff;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 8px 12px;
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    outline: none;
}

.input-unit {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.percent-slider {
    display: flex;
    gap: 6px;
}

.pct-btn {
    flex: 1;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 5px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
}

.pct-btn:hover {
    background: var(--border-subtle);
    color: #fff;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
}

.btn-trade {
    border: none;
    padding: 12px;
    font-weight: 800;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.2s ease;
}

.btn-trade:active { transform: scale(0.98); }
.btn-buy { background: var(--buy-green); color: #080B11; }
.btn-buy:hover { filter: brightness(1.1); box-shadow: 0 0 12px var(--buy-glow); }
.btn-sell { background: var(--sell-red); color: #fff; }
.btn-sell:hover { filter: brightness(1.1); box-shadow: 0 0 12px var(--sell-glow); }

/* BOTTOM DOCK (POSITIONS & ORDERS) */
.bottom-dock {
    grid-column: 1 / -1;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.dock-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-subtle);
    height: 40px;
}

.dock-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12px;
    padding: 0 12px;
    height: 100%;
    cursor: pointer;
    position: relative;
}

.dock-tab.active {
    color: #fff;
}

.dock-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-teal);
}

.dock-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
}

.terminal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.terminal-table th {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    text-align: left;
    padding: 10px 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.terminal-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    vertical-align: middle;
}

.btn-close-pos {
    background: rgba(255, 75, 85, 0.1);
    border: 1px solid rgba(255, 75, 85, 0.3);
    color: var(--sell-red);
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 800;
    font-size: 11px;
    transition: all 0.2s ease;
}

.btn-close-pos:hover {
    background: var(--sell-red);
    color: #fff;
    box-shadow: 0 0 10px var(--sell-glow);
}

/* ==========================================================================
   DECA COMPOUNDING GRID & CARDS
   ========================================================================== */
.deca-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px;
}

.hero-banner {
    background: linear-gradient(135deg, rgba(0, 223, 192, 0.1), rgba(15, 20, 32, 0.8));
    border: 1px solid rgba(0, 223, 192, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-stats {
    display: flex;
    gap: 32px;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.section-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.section-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand-teal);
}

.sec-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sec-badge {
    background: var(--bg-surface-elevated);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    color: var(--brand-teal);
}

/* ==========================================================================
   MOBILE BOTTOM BAR & DRAWER
   ========================================================================== */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-bar-height);
    background: rgba(11, 15, 23, 0.98);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-subtle);
    z-index: 100;
    align-items: center;
    justify-content: space-around;
}

.mobile-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
}

.mobile-tab-btn.active {
    color: var(--brand-teal);
}

.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
}

.mobile-drawer {
    position: fixed;
    top: 0; left: -320px; bottom: 0;
    width: 320px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    z-index: 201;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    overflow-y: auto;
}

.mobile-drawer.open { left: 0; }

/* ==========================================================================
   MOBILE RESPONSIVE OPTIMIZATIONS (ZERO GLITCH • INSTANT TRACKING)
   ========================================================================== */
@media (max-width: 960px) {
    body {
        padding-bottom: 70px;
        overflow-x: hidden;
    }

    .terminal-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 85px;
        width: 100%;
        max-width: 100vw;
    }

    /* Sub-bar ticker */
    .ticker-sub-bar {
        order: 1;
        width: 100%;
        max-width: 100vw;
        padding: 0 10px;
        gap: 12px;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 1. Chart - Compact height on phone screen */
    .chart-container { 
        order: 2;
        height: 310px; 
        min-height: 310px;
        max-height: 310px;
        width: 100%;
        max-width: 100vw;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .chart-controls {
        padding: 4px 8px;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tf-btn {
        padding: 4px 7px;
        font-size: 11px;
    }

    /* 2. Positions & Setups Radar Dock - Immediately under chart for mobile tracking */
    .bottom-dock {
        order: 3;
        width: 100%;
        max-width: 100vw;
        min-height: 360px;
        border-top: 1px solid var(--border-subtle);
        border-bottom: 1px solid var(--border-subtle);
        background: var(--bg-surface);
    }

    .dock-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding: 0 8px;
        gap: 6px;
    }

    .dock-tab {
        font-size: 11px;
        padding: 8px 10px;
        flex-shrink: 0;
    }

    .dock-content {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 10px;
    }

    .terminal-table {
        min-width: 580px;
    }

    /* 3. Order Placement Desk */
    .order-desk {
        order: 4;
        width: 100%;
        max-width: 100vw;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        padding: 14px 12px;
    }

    /* 4. Order Book */
    .orderbook-container {
        order: 5;
        width: 100%;
        max-width: 100vw;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
        max-height: 220px;
        padding: 8px 12px;
    }

    /* Top Header Adjustments */
    .top-header {
        padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px 10px;
    }

    .nav-links { display: none; }
    .top-stats-pill { display: none; }

    .header-ticker-pill {
        padding: 3px 8px;
        font-size: 11px;
        gap: 6px;
    }

    /* Mobile Fixed Bottom Dock */
    .mobile-bottom-bar { 
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        height: 60px;
        background: rgba(8, 11, 17, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-subtle);
        align-items: center;
        justify-content: space-around;
        padding-bottom: env(safe-area-inset-bottom, 4px);
    }

    .mobile-tab-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 700;
        padding: 6px 10px;
        transition: color 0.15s ease;
    }

    .mobile-tab-btn i {
        font-size: 16px;
    }

    .mobile-tab-btn.active, .mobile-tab-btn:hover {
        color: var(--brand-teal);
    }
}

/* ==========================================================================
   STRATEGY HUD OVERLAY ON CHART (TV STYLE)
   ========================================================================== */
.chart-strategy-hud {
    position: absolute;
    top: 40px;
    left: 10px;
    z-index: 25;
    background: rgba(11, 15, 25, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 223, 192, 0.45);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
    width: calc(100% - 20px);
    max-width: 380px;
    font-family: var(--font-sans);
    animation: fadeInHud 0.25s ease-out;
}

@keyframes fadeInHud {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-pill {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}
.hud-pill.pill-long {
    background: rgba(0, 192, 135, 0.18);
    color: var(--buy-green);
    border: 1px solid rgba(0, 192, 135, 0.4);
}
.hud-pill.pill-short {
    background: rgba(255, 75, 85, 0.18);
    color: var(--sell-red);
    border: 1px solid rgba(255, 75, 85, 0.4);
}
.hud-pill.pill-sec {
    background: rgba(0, 223, 192, 0.12);
    color: var(--brand-teal);
    border: 1px solid rgba(0, 223, 192, 0.3);
}
.hud-pill.pill-strat {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.hud-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.hud-close-btn:hover { color: #fff; }

.hud-metric-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.hud-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hud-lbl {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}
.hud-val {
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: 800;
}
.hud-val.cyan { color: var(--brand-teal); }
.hud-val.white { color: #fff; }
.hud-val.red { color: var(--sell-red); }
.hud-val.green { color: var(--buy-green); }

.hud-pnl-strip {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hud-trailing-stage {
    font-size: 10px;
    color: #FCD34D;
    font-weight: 600;
}

.clickable-row {
    cursor: pointer;
    transition: background 0.15s ease;
}
.clickable-row:hover {
    background: rgba(0, 223, 192, 0.06) !important;
}

/* ==========================================================================
   ADVANCED TRADINGVIEW CHART ENGINE: REPLAY, INDICATORS, FULLSCREEN & OHLC BAR
   ========================================================================== */

.chart-controls-wrapper {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.chart-tool-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.chart-tool-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--bg-surface-elevated);
}

.chart-tool-btn.active {
    background: rgba(0, 223, 192, 0.14);
    color: var(--brand-teal);
    border-color: rgba(0, 223, 192, 0.5);
    box-shadow: 0 0 8px rgba(0, 223, 192, 0.2);
}

.chart-tool-btn.btn-replay-active {
    background: rgba(245, 158, 11, 0.18);
    color: #FBBF24;
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

/* OHLC Tooltip Bar */
.chart-ohlc-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px;
    background: rgba(8, 11, 17, 0.9);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    overflow-x: auto;
    white-space: nowrap;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    -webkit-overflow-scrolling: touch;
}

.ohlc-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.ohlc-lbl {
    color: var(--text-muted);
    font-weight: 700;
}
.ohlc-val {
    color: #fff;
    font-weight: 800;
}
.ohlc-val.green { color: var(--buy-green); }
.ohlc-val.red { color: var(--sell-red); }
.ohlc-val.gold { color: #F59E0B; }
.ohlc-val.cyan { color: var(--brand-teal); }
.ohlc-val.purple { color: #A78BFA; }

/* Interactive Bar Replay Floating Controller */
.replay-controller-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(20, 27, 43, 0.98), rgba(15, 20, 32, 0.98));
    border-bottom: 2px solid #F59E0B;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 20;
    gap: 10px;
    font-family: var(--font-mono);
}

.replay-badge {
    background: #F59E0B;
    color: #080B11;
    font-weight: 900;
    font-size: 9px;
    padding: 3px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.replay-ctrl-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.replay-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.replay-ctrl-btn.active-play {
    background: var(--buy-green);
    color: #000;
    border-color: var(--buy-green);
    font-weight: 900;
}

.replay-speed-pill {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    font-weight: 800;
}

.replay-speed-pill.active {
    background: rgba(245, 158, 11, 0.2);
    border-color: #F59E0B;
    color: #F59E0B;
}

.replay-slider {
    flex: 1;
    max-width: 200px;
    accent-color: #F59E0B;
    cursor: pointer;
}

/* Fullscreen Chart Container */
.chart-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border: none !important;
    z-index: 9999 !important;
    background: #080B11 !important;
}

.chart-container:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border: none !important;
    z-index: 9999 !important;
    background: #080B11 !important;
}

/* Forced Landscape Mode (for mobile fullscreen & rotate button) */
.chart-container.chart-forced-landscape,
.chart-section.chart-forced-landscape {
    position: fixed !important;
    top: 0 !important;
    left: 100vw !important;
    width: 100vh !important;
    height: 100vw !important;
    max-width: 100vh !important;
    max-height: 100vw !important;
    transform: rotate(90deg) !important;
    transform-origin: top left !important;
    z-index: 99999 !important;
    background: #080B11 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.chart-container.chart-fullscreen-natural,
.chart-section.chart-fullscreen-natural {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 99999 !important;
    background: #080B11 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ==========================================================================
   TRADINGVIEW PRICE RANGE / MEASURE TOOL (PRO FIDELITY)
   ========================================================================== */
.measure-tool-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 18;
    overflow: hidden;
    user-select: none;
}

.measure-tool-overlay.drawing-mode {
    pointer-events: all !important;
    cursor: crosshair !important;
}

.measure-tool-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.measure-box {
    fill: rgba(41, 98, 255, 0.22);
    stroke: rgba(41, 98, 255, 0.50);
    stroke-width: 1px;
    stroke-dasharray: 2 2;
    pointer-events: auto;
    cursor: move;
}

.measure-bound-line {
    stroke: #2962FF;
    stroke-width: 1.5px;
}

.measure-center-line {
    stroke: #2962FF;
    stroke-width: 1.5px;
}

.measure-handle {
    fill: #0F1420;
    stroke: #2962FF;
    stroke-width: 2.5px;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
    transition: transform 0.1s ease, fill 0.1s ease;
}

.measure-handle:hover, .measure-handle:active {
    transform: scale(1.3);
    fill: #2962FF;
    cursor: grabbing;
}

.measure-badge {
    position: absolute;
    background: rgba(20, 24, 35, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
    pointer-events: auto;
    white-space: nowrap;
    z-index: 22;
    transform: translate(-50%, 0);
    user-select: none;
}

.measure-action-bar {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(20, 24, 35, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    padding: 3px 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
    pointer-events: auto;
    z-index: 26;
    transform: translate(-50%, -100%);
    user-select: none;
}

.measure-bar-handle {
    color: #64748B;
    font-size: 11px;
    padding: 2px;
}

.measure-action-btn {
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 12px;
    padding: 3px 6px;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.measure-action-btn:hover {
    color: #FF4B55;
    background: rgba(255, 75, 85, 0.18);
}

.measure-action-btn.close-btn {
    font-size: 15px;
    line-height: 1;
    color: #94A3B8;
}

.measure-action-btn.close-btn:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.12);
}

.btn-measure-active {
    background: rgba(41, 98, 255, 0.25) !important;
    border-color: #2962FF !important;
    color: #60A5FA !important;
    box-shadow: 0 0 10px rgba(41, 98, 255, 0.4) !important;
}


/* ==========================================================================
   HERMES 3.0 MODEL 2A BAR REPLAY & STRATEGY BACKTESTER SUITE
   ========================================================================== */

.replay-ctrl-btn.active-strat {
    background: rgba(0, 223, 192, 0.18) !important;
    color: var(--brand-teal) !important;
    border-color: rgba(0, 223, 192, 0.4) !important;
}

.replay-ctrl-btn.active-auto {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #F59E0B !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.replay-journal-pill {
    background: rgba(167, 139, 250, 0.18);
    color: #A78BFA;
    border: 1px solid rgba(167, 139, 250, 0.35);
    font-weight: 700;
}

/* Floating Hermes 3.0 Signal Card */
.replay-signal-card {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 92%;
    max-width: 440px;
    background: rgba(15, 20, 32, 0.96);
    backdrop-filter: blur(12px);
    border: 1.5px solid var(--brand-teal);
    box-shadow: 0 8px 32px rgba(0, 223, 192, 0.25), 0 0 15px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 14px;
    animation: signalSlideDown 0.25s ease-out;
}

@keyframes signalSlideDown {
    from { opacity: 0; transform: translate(-50%, -15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.rsc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.rsc-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rsc-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.rsc-badge-long {
    background: rgba(0, 192, 135, 0.2);
    color: var(--buy-green);
    border: 1px solid rgba(0, 192, 135, 0.4);
}

.rsc-badge-short {
    background: rgba(255, 75, 85, 0.2);
    color: var(--sell-red);
    border: 1px solid rgba(255, 75, 85, 0.4);
}

.rsc-prob-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--gold);
    background: rgba(255, 184, 0, 0.15);
    border: 1px solid rgba(255, 184, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
}

.rsc-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}

.rsc-close-btn:hover { color: #fff; }

.rsc-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.rsc-metric {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 6px 10px;
}

.rsc-label {
    display: block;
    font-size: 9.5px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 2px;
}

.rsc-val {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
}

.val-cyan { color: var(--brand-teal); }
.val-green { color: var(--buy-green); }
.val-red { color: var(--sell-red); }
.val-gold { color: var(--gold); }

.rsc-actions {
    display: flex;
    gap: 8px;
}

.rsc-btn {
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.rsc-btn-execute {
    flex: 1;
    background: linear-gradient(135deg, #00C087, #00DFC0);
    color: #080B11;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(0, 192, 135, 0.35);
}

.rsc-btn-execute:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 192, 135, 0.5);
}

.rsc-btn-skip {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.rsc-btn-skip:hover { color: #fff; border-color: rgba(255,255,255,0.2); }

/* Floating Active Trade Simulation HUD */
.replay-active-hud {
    position: absolute;
    top: 48px;
    right: 12px;
    z-index: 95;
    background: rgba(15, 20, 32, 0.94);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 223, 192, 0.35);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 11px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    min-width: 240px;
    max-width: 320px;
}

.rah-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.rah-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
}

.rah-long { background: rgba(0, 192, 135, 0.2); color: var(--buy-green); }
.rah-short { background: rgba(255, 75, 85, 0.2); color: var(--sell-red); }

.rah-status-badge {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--gold);
    background: rgba(255, 184, 0, 0.15);
    padding: 1px 5px;
    border-radius: 3px;
}

.rah-close-trade-btn {
    background: rgba(255, 75, 85, 0.15);
    color: var(--sell-red);
    border: 1px solid rgba(255, 75, 85, 0.3);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    cursor: pointer;
}

.rah-close-trade-btn:hover {
    background: var(--sell-red);
    color: #fff;
}

.rah-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
    font-family: var(--font-mono);
    margin-bottom: 6px;
}

.rah-lbl {
    color: var(--text-muted);
    font-size: 9.5px;
    margin-right: 4px;
}

.rah-trailing-ladder {
    font-size: 10px;
    font-weight: 700;
    color: var(--gold);
    background: rgba(255, 184, 0, 0.1);
    border: 1px solid rgba(255, 184, 0, 0.25);
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Replay Outcome Notification Banner */
.replay-outcome-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 110;
    background: rgba(15, 20, 32, 0.98);
    backdrop-filter: blur(14px);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
    animation: outcomePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

@keyframes outcomePop {
    from { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.replay-outcome-banner.win {
    border: 2px solid var(--buy-green);
    box-shadow: 0 0 30px rgba(0, 192, 135, 0.4);
}

.replay-outcome-banner.loss {
    border: 2px solid var(--sell-red);
    box-shadow: 0 0 30px rgba(255, 75, 85, 0.4);
}

.replay-outcome-banner.shield {
    border: 2px solid var(--gold);
    box-shadow: 0 0 30px rgba(255, 184, 0, 0.4);
}

.rob-icon {
    font-size: 28px;
}

.win .rob-icon { color: var(--buy-green); }
.loss .rob-icon { color: var(--sell-red); }
.shield .rob-icon { color: var(--gold); }

.rob-title {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #fff;
}

.rob-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-top: 3px;
}

/* Replay Backtest Journal Modal */
.replay-journal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.rjm-content {
    background: #0F1420;
    border: 1px solid rgba(0, 223, 192, 0.3);
    border-radius: 14px;
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.rjm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

.rjm-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.rjm-close-btn:hover { color: #fff; }

.rjm-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border-subtle);
}

@media (max-width: 500px) {
    .rjm-stats-row { grid-template-columns: 1fr 1fr; }
}

.rjm-stat-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 8px 10px;
}

.rjm-stat-label {
    display: block;
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 4px;
}

.rjm-stat-val {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 900;
    color: #fff;
}

.rjm-table-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 12px 18px;
}

.rjm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

.rjm-table th {
    text-align: left;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.rjm-table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: var(--font-mono);
}

.rjm-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

.rjm-btn-clear {
    background: rgba(255, 75, 85, 0.15);
    color: var(--sell-red);
    border: 1px solid rgba(255, 75, 85, 0.3);
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 7px 12px;
    cursor: pointer;
}

.rjm-btn-clear:hover { background: var(--sell-red); color: #fff; }

.rjm-btn-done {
    background: var(--brand-teal);
    color: #080B11;
    border: none;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 800;
    padding: 7px 16px;
    cursor: pointer;
}
