        * { margin: 0; padding: 0; box-sizing: border-box; }
        html {
            overflow-x: hidden;
            max-width: 100vw;
        }
        body {
            font-family: 'Roboto Mono', -apple-system, BlinkMacSystemFont, monospace;
            background: #0d1117;
            color: #c9d1d9;
            min-height: 100vh;
            font-size: 12px;
            -webkit-tap-highlight-color: transparent;
            overflow-x: hidden;
            max-width: 100vw;
            width: 100%;
        }

        /* === BITMEX-STYLE HEADER === */
        .trading-header {
            display: flex;
            align-items: center;
            padding: 8px 16px;
            background: #161b22;
            border-bottom: 1px solid #30363d;
            gap: 16px;
            flex-wrap: wrap;
            max-width: 100vw;
            overflow-x: hidden;
        }
        .instrument-dropdown {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
        }
        .instrument-dropdown:hover { background: rgba(255,255,255,0.05); }
        .instrument-name {
            font-size: 15px;
            font-weight: 700;
            color: #fff;
        }
        .instrument-type {
            font-size: 12px;
            color: #8b949e;
            margin-left: 4px;
        }
        .instrument-badges {
            display: flex;
            gap: 4px;
            margin-left: 8px;
        }
        .badge-sm {
            font-size: 9px;
            padding: 2px 5px;
            border-radius: 2px;
            font-weight: 600;
        }
        .badge-btc { background: #f7931a; color: #000; }
        .badge-leverage { background: #3fb950; color: #000; }
        .price-section {
            display: flex;
            flex-direction: column;
            margin-left: 16px;
        }
        .price-main {
            font-size: 22px;
            font-weight: 700;
            color: #3fb950;
            display: flex;
            align-items: center;
            gap: 4px;
            min-width: 140px; /* Fixed width prevents jumping on price changes */
        }
        .price-main.down { color: #f85149; }
        .price-arrow { font-size: 14px; }
        .price-change {
            font-size: 12px;
            color: #f85149;
        }
        .price-change.positive { color: #3fb950; }
        .header-stats {
            display: flex;
            gap: 20px;
            margin-left: auto;
            font-size: 11px;
        }
        .header-stat {
            display: flex;
            flex-direction: column;
            gap: 1px;
        }
        .header-stat-label {
            color: #8b949e;
            font-size: 10px;
        }
        .header-stat-value {
            color: #c9d1d9;
            font-weight: 500;
        }
        .header-stat-value.positive { color: #3fb950; }
        .header-stat-value.negative { color: #f85149; }

        /* === MAIN TRADING LAYOUT === */
        .trading-main {
            display: grid;
            grid-template-columns: 1fr 340px;
            height: 55vh; /* Fixed height so bots section is visible below */
            min-height: 400px;
            max-height: 550px;
            gap: 1px;
            background: #30363d;
        }
        /* Mobile: Stack chart and panel vertically */
        @media (max-width: 768px) {
            .trading-main {
                grid-template-columns: 1fr;
                grid-template-rows: 350px auto;
                height: auto;
                min-height: 400px;
                max-height: none;
            }
        }
        .chart-section {
            background: #0d1117;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
            position: relative;
        }
        /* Mobile: Ensure chart section has explicit height */
        @media (max-width: 768px) {
            .chart-section {
                min-height: 300px;
                height: 350px;
            }
        }
        .chart-toolbar {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 4px 8px; /* Tighter padding */
            background: #161b22;
            border-bottom: 1px solid #30363d;
        }
        .period-dropdown {
            position: relative;
        }
        .period-btn {
            background: #21262d;
            border: 1px solid #30363d;
            color: #c9d1d9;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .period-btn:hover { background: #30363d; }
        .period-menu {
            position: absolute;
            top: 100%;
            left: 0;
            background: #161b22;
            border: 1px solid #30363d;
            border-radius: 4px;
            z-index: 1000;
            display: none;
            min-width: 100px;
        }
        .period-menu.show { display: block; }
        .period-option {
            padding: 8px 12px;
            cursor: pointer;
            font-size: 12px;
        }
        .period-option:hover { background: #21262d; }
        .period-option.active { color: #00d4ff; }

        /* === OHLC DISPLAY === */
        .ohlc-display {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 2px 8px; /* Tighter */
            background: #0d1117;
            font-size: 11px;
            font-family: 'JetBrains Mono', monospace;
        }
        .ohlc-item {
            display: flex;
            align-items: center;
            gap: 2px;
        }
        .ohlc-label {
            color: #8b949e;
        }
        .ohlc-value {
            color: #c9d1d9;
        }
        .ohlc-value.up { color: #3fb950; }
        .ohlc-value.down { color: #f85149; }

        /* === BOTTOM PERIOD SELECTOR === */
        .chart-period-bar {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 3px;
            padding: 3px 8px; /* Tighter */
            background: #161b22;
            border-top: 1px solid #30363d;
            position: relative;
            z-index: 50;
        }
        .chart-period-btn {
            padding: 2px 8px; /* Tighter */
            background: transparent;
            border: 1px solid #30363d;
            border-radius: 3px;
            color: #8b949e;
            font-size: 10px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .chart-period-btn:hover {
            background: #21262d;
            color: #c9d1d9;
        }
        .chart-period-btn.active {
            background: #238636;
            border-color: #238636;
            color: #ffffff;
        }

        .chart-container-pro {
            flex: 1 1 auto;
            min-height: 0;
            position: relative;
        }
        #live-price-chart-container {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
        }

        /* === RIGHT PANEL (ORDERBOOK + TRADES) === */
        .right-panel {
            background: #0d1117;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        /* PRICE TO BEAT section - Polymarket A markets only */
        .panel-section.price-to-beat-section {
            flex: 0 0 auto; /* Fixed size */
            display: flex;
            flex-direction: column;
            border-bottom: 1px solid #30363d;
            background: linear-gradient(135deg, #1a1f28 0%, #0d1117 100%);
        }
        .price-to-beat-section .panel-header {
            background: #1f2937;
            border-bottom: 1px solid #374151;
        }
        /* ORDERBOOK section - fixed height with scrollable content */
        .panel-section.orderbook-section {
            flex: 0 0 auto; /* Fixed size, doesn't shrink */
            display: flex;
            flex-direction: column;
            min-height: 280px; /* Enough for ~15 rows each side */
            max-height: 350px;
            border-bottom: 1px solid #30363d;
            overflow: hidden;
        }
        /* TRADES section - fills remaining space, has scrollbar */
        .panel-section.trades-section {
            flex: 1 1 auto; /* Fills remaining space */
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
        }
        .panel-header {
            flex-shrink: 0;
            padding: 4px 8px; /* Tighter padding */
            background: #161b22;
            font-size: 10px;
            font-weight: 600;
            color: #8b949e;
            text-transform: uppercase;
            border-bottom: 1px solid #30363d;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        /* Orderbook content - scrollable to show all rows */
        .orderbook-section .panel-content {
            flex: 1 1 auto;
            overflow-y: auto; /* Allow scroll if needed */
            overflow-x: hidden;
            padding: 2px;
            min-height: 0;
        }
        /* Trades content - overflow auto, HAS scrollbar */
        .trades-section .panel-content {
            flex: 1 1 auto;
            overflow-y: auto; /* HAS scrollbar */
            overflow-x: hidden;
            padding: 2px;
            min-height: 0;
        }

        /* === ORDERBOOK STYLES === */
        .orderbook-row {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            padding: 1px 4px; /* Tighter */
            font-size: 10px;
            position: relative;
        }
        .orderbook-row.header {
            color: #8b949e;
            font-weight: 500;
            padding: 2px 4px; /* Tighter */
            border-bottom: 1px solid #30363d;
        }
        .orderbook-row.bid .ob-price { color: #3fb950; }
        .orderbook-row.ask .ob-price { color: #f85149; }
        .ob-price { text-align: left; }
        .ob-size { text-align: right; }
        .ob-total { text-align: right; color: #8b949e; }
        .orderbook-row .depth-bar {
            position: absolute;
            top: 0;
            bottom: 0;
            right: 0;
            opacity: 0.15;
        }
        .orderbook-row.bid .depth-bar { background: #3fb950; }
        .orderbook-row.ask .depth-bar { background: #f85149; }
        .spread-row {
            text-align: center;
            padding: 3px; /* Tighter */
            background: #161b22;
            font-size: 10px;
            color: #8b949e;
        }

        /* === RECENT TRADES STYLES === */
        .trade-row {
            display: grid;
            grid-template-columns: 55px 40px 1fr 60px;
            padding: 1px 4px; /* Tighter */
            font-size: 10px;
        }
        .trade-row.header {
            color: #8b949e;
            font-weight: 500;
            padding: 2px 4px; /* Tighter */
            border-bottom: 1px solid #30363d;
        }
        .trade-row.buy .trade-side { color: #3fb950; }
        .trade-row.sell .trade-side { color: #f85149; }
        .trade-time { color: #8b949e; }
        .trade-price { text-align: right; }
        .trade-size { text-align: right; }

        /* === BOTTOM TAB BAR === */
        .tab-bar {
            display: flex;
            background: #161b22;
            border-top: 1px solid #30363d;
            border-bottom: 1px solid #30363d;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            position: relative;
            z-index: 100; /* Ensure tab bar is above chart canvas */
            margin: 0;
            padding: 0;
        }
        .tab-bar::-webkit-scrollbar { height: 0; }
        .tab-item {
            padding: 10px 16px;
            color: #8b949e;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            white-space: nowrap;
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
        }
        .tab-item:hover { color: #c9d1d9; background: rgba(255,255,255,0.05); }
        .tab-item.active { color: #00d4ff; border-bottom-color: #00d4ff; }
        .tab-count { opacity: 0.7; }
        .tab-content { display: none; background: #0d1117; min-height: 200px; margin: 0; padding: 0; }
        .tab-content.active { display: block; }

        /* === YOUR BOTS TAB === */
        .bots-container { padding: 0; display: flex; flex-direction: column; gap: 0; }
        .bots-table { width: 100%; }
        .bots-table-header {
            display: grid;
            grid-template-columns: 120px 1fr 150px 120px 100px;
            padding: 10px 16px;
            background: #161b22;
            border-bottom: 1px solid #30363d;
            font-size: 12px;
            color: #8b949e;
        }
        .bots-table-body { min-height: 100px; }
        .bot-row {
            display: grid;
            grid-template-columns: 120px 1fr 150px 120px 100px;
            padding: 12px 16px;
            border-bottom: 1px solid #21262d;
            font-size: 13px;
            align-items: center;
        }
        .bot-row:hover { background: rgba(255,255,255,0.02); }
        .bot-status { display: flex; align-items: center; gap: 6px; }
        .status-dot { width: 8px; height: 8px; border-radius: 50%; }
        .status-dot.running { background: #3fb950; animation: pulse 1.5s infinite; }
        .status-dot.stopped { background: #8b949e; }
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
        .add-bot-row {
            display: flex;
            gap: 12px;
            padding: 12px 16px;
            background: #161b22;
            border-top: 1px solid #30363d;
        }
        .visually-hidden {
            position: absolute;
            width: 1px;
            height: 1px;
            margin: -1px;
            padding: 0;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            border: 0;
        }
        .running-bot-stats {
            display: flex;
            gap: 24px;
            padding: 12px 16px;
            background: rgba(63,185,80,0.1);
            border: 1px solid #3fb950;
            border-radius: 4px;
            margin: 12px 16px;
            align-items: center;
        }
        .bot-controls-card {
            display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap;
            padding: 16px; background: #161b22; border-radius: 8px; border: 1px solid #30363d;
        }
        .control-item { display: flex; flex-direction: column; gap: 6px; }
        .control-item label { font-size: 11px; color: #8b949e; text-transform: uppercase; }
        .pro-select {
            background: #21262d; border: 1px solid #30363d; color: #c9d1d9;
            padding: 8px 12px; border-radius: 4px; font-size: 13px; min-width: 180px;
            cursor: pointer;
            -webkit-appearance: menulist;
            -moz-appearance: menulist;
            appearance: menulist;
        }
        .pro-select:focus {
            outline: 2px solid #00d4ff;
            outline-offset: 1px;
        }
        .button-group { display: flex; gap: 8px; }
        .btn-pro {
            padding: 8px 16px; border-radius: 4px; font-size: 12px; font-weight: 500;
            cursor: pointer; border: none; transition: all 0.2s;
        }
        .btn-start-pro { background: #238636; color: #fff; }
        .btn-start-pro:hover:not(:disabled) { background: #2ea043; }
        .btn-start-pro:disabled { opacity: 0.5; cursor: not-allowed; }
        .btn-stop-pro { background: #da3633; color: #fff; }
        .btn-stop-pro:hover:not(:disabled) { background: #f85149; }
        .btn-stop-pro:disabled { opacity: 0.5; cursor: not-allowed; }
        .test-stats-row { display: flex; gap: 24px; margin-left: auto; }
        .test-stat { display: flex; flex-direction: column; align-items: center; }
        .test-stat .stat-label { font-size: 10px; color: #8b949e; text-transform: uppercase; }
        .test-stat .stat-value { font-size: 16px; font-weight: 600; color: #c9d1d9; }
        .test-stat .stat-value.positive { color: #3fb950; }
        .test-stat .stat-value.negative { color: #f85149; }

        /* Metrics + Equity Row */
        .metrics-equity-row { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
        @media (max-width: 900px) { .metrics-equity-row { grid-template-columns: 1fr; } }
        .panel-card {
            background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 16px;
        }
        .panel-title {
            font-size: 13px; font-weight: 600; color: #c9d1d9; margin-bottom: 12px;
            display: flex; align-items: center; gap: 8px;
        }
        .metrics-grid-pro { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
        .metric-item { display: flex; flex-direction: column; gap: 4px; }
        .metric-label { font-size: 11px; color: #8b949e; }
        .metric-value { font-size: 16px; font-weight: 600; color: #c9d1d9; }
        .metric-value.positive { color: #3fb950; }
        .metric-value.negative { color: #f85149; }
        .equity-chart-pro { height: 200px; background: #0d1117; border-radius: 4px; }

        /* Trade Logs */
        .logs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
        @media (max-width: 768px) { .logs-row { grid-template-columns: 1fr; } }
        .log-column { background: #161b22; border: 1px solid #30363d; border-radius: 8px; overflow: hidden; }
        .log-header {
            padding: 10px 12px; display: flex; justify-content: space-between;
            align-items: center; font-size: 12px; border-bottom: 1px solid #30363d;
        }
        .log-header.test { background: rgba(0,212,255,0.1); }
        .log-header.backtest { background: rgba(138,43,226,0.1); }
        .log-badge { padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 600; }
        .log-header.test .log-badge { background: #00d4ff; color: #000; }
        .log-header.backtest .log-badge { background: #8b5cf6; color: #fff; }
        .log-list { max-height: 250px; overflow-y: auto; padding: 8px; }
        .log-item { padding: 8px; border-bottom: 1px solid #21262d; font-size: 12px; }
        .log-item:last-child { border-bottom: none; }
        .log-item.divergent { background: rgba(248,81,73,0.1); }
        .no-data { color: #8b949e; text-align: center; padding: 20px; font-size: 12px; }

        /* Legacy container styles for compatibility */
        .container { max-width: 100%; margin: 0; padding: 0; }
        header { display: none; } /* Hide old header */
        .subtitle { color: #8b949e; font-size: 11px; }
        .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
        .card {
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px;
            padding: 24px;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .card:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 40px rgba(0,212,255,0.1);
        }
        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            flex-wrap: wrap;
            gap: 10px;
        }
        .card-title { font-size: 1.3rem; font-weight: 600; }
        .badge {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 500;
        }
        .badge-success { background: rgba(0,200,83,0.2); color: #00c853; }
        .badge-warning { background: rgba(255,193,7,0.2); color: #ffc107; }
        .badge-info { background: rgba(0,212,255,0.2); color: #00d4ff; }
        .badge-real { background: rgba(123,44,191,0.3); color: #c77dff; }
        .stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
        .stat-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
        .stat-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
        .stat {
            background: rgba(0,0,0,0.2);
            padding: 15px;
            border-radius: 8px;
        }
        .stat-sm { padding: 12px; }
        .stat-label { color: #8892b0; font-size: 0.85rem; margin-bottom: 5px; }
        .stat-label-sm { font-size: 0.75rem; }
        .stat-value { font-size: 1.4rem; font-weight: 600; }
        .stat-value-sm { font-size: 1.1rem; }
        .stat-value.positive { color: #00c853; }
        .stat-value.negative { color: #ff5252; }
        .test-list { list-style: none; }
        .test-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .test-item:last-child { border-bottom: none; }
        .test-name { display: flex; align-items: center; gap: 10px; }
        .test-icon { font-size: 1.2rem; }
        .test-status { font-size: 0.85rem; font-weight: 500; }
        .passed { color: #00c853; }
        .failed { color: #ff5252; }
        .skipped { color: #ffc107; }
        .bot-card { margin-bottom: 15px; cursor: pointer; padding: 10px; border-radius: 8px; transition: background 0.2s; }
        .bot-card:hover { background: rgba(255,255,255,0.05); }
        .bot-card.active { background: rgba(0,212,255,0.15); border: 1px solid rgba(0,212,255,0.3); }
        .bot-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 10px;
        }
        .bot-icon {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.3rem;
        }
        .bot-icon.pair { background: rgba(123,44,191,0.3); }
        .bot-icon.saz { background: rgba(0,212,255,0.3); }
        .bot-icon.sd { background: rgba(255,193,7,0.3); }
        .bot-icon.diverge { background: rgba(0,200,83,0.3); }
        .bot-desc { color: #8892b0; font-size: 0.9rem; margin-top: 5px; }
        .progress-bar {
            height: 6px;
            background: rgba(255,255,255,0.1);
            border-radius: 3px;
            overflow: hidden;
            margin-top: 10px;
        }
        .progress-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.3s;
        }
        .timestamp {
            color: #8892b0;
            font-size: 0.85rem;
            text-align: center;
            margin-top: 30px;
        }
        .section-title {
            font-size: 1.5rem;
            margin-bottom: 20px;
            color: #00d4ff;
        }
        .full-width { grid-column: 1 / -1; }
        #chart-container, #equity-chart-container {
            width: 100%;
            height: 400px;
            border-radius: 8px;
            overflow: hidden;
            touch-action: pan-x pan-y;
        }
        #equity-chart-container { height: 250px; }
        .chart-legend {
            display: flex;
            gap: 20px;
            margin-top: 15px;
            flex-wrap: wrap;
        }
        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
        }
        .legend-color {
            width: 16px;
            height: 16px;
            border-radius: 4px;
        }
        .trade-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
        }
        .trade-table th, .trade-table td {
            padding: 10px;
            text-align: left;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .trade-table th {
            color: #8892b0;
            font-weight: 500;
            font-size: 0.85rem;
        }
        .trade-table tr:hover {
            background: rgba(255,255,255,0.05);
        }
        .loading {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 200px;
            color: #8892b0;
        }
        .error-message {
            background: rgba(255,82,82,0.2);
            border: 1px solid rgba(255,82,82,0.5);
            padding: 20px;
            border-radius: 8px;
            color: #ff5252;
            text-align: center;
        }
        /* Error Toast for API failures */
        .error-toast {
            position: fixed;
            top: 20px;
            right: 20px;
            background: rgba(255,82,82,0.95);
            border: 1px solid #ff5252;
            border-radius: 8px;
            padding: 16px 20px;
            color: #fff;
            font-size: 0.95rem;
            max-width: 400px;
            z-index: 10000;
            box-shadow: 0 4px 20px rgba(255,82,82,0.4);
            display: none;
            animation: slideIn 0.3s ease-out;
        }
        .error-toast.show { display: block; }
        .error-toast-title {
            font-weight: 600;
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .error-toast-message { opacity: 0.9; font-size: 0.9rem; }
        .error-toast-close {
            position: absolute;
            top: 8px;
            right: 10px;
            background: none;
            border: none;
            color: #fff;
            cursor: pointer;
            font-size: 1.2rem;
            opacity: 0.7;
        }
        .error-toast-close:hover { opacity: 1; }
        @keyframes slideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        /* JS Error Panel - persistent error log */
        .js-error-panel {
            position: fixed;
            bottom: 20px;
            left: 20px;
            background: rgba(30, 30, 40, 0.98);
            border: 2px solid #ff5252;
            border-radius: 8px;
            padding: 0;
            max-width: 600px;
            max-height: 300px;
            z-index: 10001;
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
            font-family: monospace;
            font-size: 12px;
        }
        .js-error-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            background: #ff5252;
            color: #fff;
            font-weight: bold;
        }
        .js-error-header button {
            background: none;
            border: none;
            color: #fff;
            font-size: 18px;
            cursor: pointer;
        }
        .js-error-list {
            max-height: 250px;
            overflow-y: auto;
            padding: 8px;
        }
        .js-error-entry {
            padding: 4px 0;
            border-bottom: 1px solid #333;
            color: #ff8a80;
        }
        .js-error-entry .error-time { color: #888; margin-right: 8px; }
        .js-error-entry .error-type { color: #ffab40; margin-right: 8px; font-weight: bold; }
        .js-error-entry .error-msg { color: #ff8a80; }
        .js-error-entry .error-loc { color: #666; margin-left: 8px; font-size: 10px; }
        .config-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 10px;
            margin-top: 15px;
        }
        .config-item {
            background: rgba(0,0,0,0.2);
            padding: 10px;
            border-radius: 6px;
        }
        .config-label { color: #8892b0; font-size: 0.75rem; }
        .config-value { color: #fff; font-size: 0.9rem; margin-top: 3px; }

        /* Controls Bar */
        .controls-bar {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            flex-wrap: wrap;
            align-items: center;
            justify-content: center;
        }
        .control-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .control-label {
            color: #8892b0;
            font-size: 0.85rem;
        }
        .control-select {
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 8px;
            color: #fff;
            padding: 10px 15px;
            font-size: 0.9rem;
            cursor: pointer;
            min-width: 160px;
            -webkit-appearance: none;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            padding-right: 35px;
        }
        .control-select:focus {
            outline: none;
            border-color: #00d4ff;
        }
        .control-select option {
            background: #1a1a2e;
            color: #fff;
        }

        /* Export Buttons */
        .export-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
        .btn {
            background: rgba(0,212,255,0.2);
            border: 1px solid rgba(0,212,255,0.4);
            border-radius: 8px;
            color: #00d4ff;
            padding: 10px 18px;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
            touch-action: manipulation;
        }
        .btn:hover {
            background: rgba(0,212,255,0.3);
            transform: translateY(-1px);
        }
        .btn:active {
            transform: translateY(0);
        }
        .btn-icon {
            font-size: 1rem;
        }

        /* Mobile Improvements */
        @media (max-width: 768px) {
            h1 { font-size: 2rem; }
            .subtitle { font-size: 1rem; }
            .grid { grid-template-columns: 1fr; }
            .stat-grid { grid-template-columns: 1fr; }
            .stat-grid-3, .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
            #chart-container { height: 350px; }
            #equity-chart-container { height: 220px; }
            .card { padding: 18px; }
            .card-title { font-size: 1.1rem; }
            .trade-table { font-size: 0.85rem; }
            .trade-table th, .trade-table td { padding: 8px 5px; }
            .controls-bar { flex-direction: column; }
            .control-group { width: 100%; }
            .control-select { width: 100%; }
            .export-buttons { width: 100%; justify-content: center; }
            .btn { flex: 1; justify-content: center; min-width: 120px; }
        }
        @media (max-width: 480px) {
            body { padding: 10px; }
            h1 { font-size: 1.6rem; }
            header { padding: 20px 0; }
            #chart-container { height: 280px; }
            #equity-chart-container { height: 180px; }
            .stat-grid-3, .stat-grid-4 { grid-template-columns: 1fr; }
            .config-grid { grid-template-columns: repeat(2, 1fr); }
            .card-header { flex-direction: column; align-items: flex-start; }
            .chart-legend { justify-content: center; }
            .legend-item { font-size: 0.8rem; }
            .legend-color { width: 12px; height: 12px; }
        }

        /* Touch-friendly scrolling for trade table */
        .table-wrapper {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.2) transparent;
        }
        .table-wrapper::-webkit-scrollbar {
            height: 6px;
        }
        .table-wrapper::-webkit-scrollbar-track {
            background: transparent;
        }
        .table-wrapper::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.2);
            border-radius: 3px;
        }

        /* Session Comparison Styles */
        .comparison-container {
            display: none;
        }
        .comparison-container.active {
            display: block;
        }
        .comparison-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding: 15px;
            background: rgba(0,212,255,0.1);
            border-radius: 8px;
            border: 1px solid rgba(0,212,255,0.3);
        }
        .comparison-title {
            font-size: 1.2rem;
            color: #00d4ff;
        }
        .comparison-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 20px;
        }
        .session-column {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px;
            padding: 20px;
        }
        .session-column.test {
            border-color: rgba(0,212,255,0.3);
        }
        .session-column.backtest {
            border-color: rgba(123,44,191,0.3);
        }
        .session-label {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .session-label .badge {
            font-size: 0.9rem;
            padding: 6px 14px;
        }
        .session-label .session-name {
            font-size: 1.1rem;
            font-weight: 600;
        }
        .comparison-metric {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
            margin-bottom: 10px;
        }
        .comparison-metric:last-child {
            margin-bottom: 0;
        }
        .comparison-metric .label {
            color: #8892b0;
            font-size: 0.9rem;
        }
        .comparison-metric .value {
            font-weight: 600;
            font-size: 1.1rem;
        }
        .comparison-metric .value.match {
            color: #00c853;
        }
        .comparison-metric .value.mismatch {
            color: #ff5252;
        }
        .match-indicator {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
            margin-left: 10px;
        }
        .match-indicator.match {
            background: rgba(0,200,83,0.2);
            color: #00c853;
        }
        .match-indicator.mismatch {
            background: rgba(255,82,82,0.2);
            color: #ff5252;
        }
        .comparison-summary {
            margin-top: 20px;
            padding: 20px;
            background: rgba(0,0,0,0.2);
            border-radius: 12px;
        }
        .summary-title {
            font-size: 1.1rem;
            margin-bottom: 15px;
            color: #00d4ff;
        }
        .summary-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
        }
        .summary-item {
            text-align: center;
            padding: 15px;
            background: rgba(255,255,255,0.03);
            border-radius: 8px;
        }
        .summary-item .number {
            font-size: 2rem;
            font-weight: 700;
        }
        .summary-item .number.positive {
            color: #00c853;
        }
        .summary-item .number.negative {
            color: #ff5252;
        }
        .summary-item .label {
            color: #8892b0;
            font-size: 0.85rem;
            margin-top: 5px;
        }

        @media (max-width: 768px) {
            .comparison-grid {
                grid-template-columns: 1fr;
            }
            .summary-grid {
                grid-template-columns: 1fr;
            }
        }

        /* Trade Logs Comparison Styles */
        .trade-logs-comparison {
            margin-top: 30px;
            background: rgba(0,0,0,0.2);
            border-radius: 12px;
            padding: 20px;
        }
        .trade-logs-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 10px;
        }
        .trade-logs-title {
            font-size: 1.2rem;
            color: #00d4ff;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .trade-logs-filters {
            display: flex;
            gap: 10px;
        }
        .filter-btn {
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.8rem;
            cursor: pointer;
            border: 1px solid rgba(255,255,255,0.2);
            background: transparent;
            color: #8892b0;
            transition: all 0.2s;
        }
        .filter-btn:hover {
            background: rgba(255,255,255,0.1);
        }
        .filter-btn.active {
            background: rgba(0,212,255,0.2);
            border-color: rgba(0,212,255,0.5);
            color: #00d4ff;
        }
        .trade-logs-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }
        .trade-log-column {
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 8px;
            overflow: hidden;
        }
        .trade-log-column.test {
            border-color: rgba(0,212,255,0.3);
        }
        .trade-log-column.backtest {
            border-color: rgba(123,44,191,0.3);
        }
        .trade-log-header {
            padding: 12px 15px;
            background: rgba(0,0,0,0.3);
            display: flex;
            align-items: center;
            gap: 10px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .trade-log-header .badge {
            font-size: 0.75rem;
            padding: 4px 10px;
        }
        .trade-log-header .count {
            margin-left: auto;
            color: #8892b0;
            font-size: 0.85rem;
        }
        .trade-log-list {
            max-height: 500px;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.2) transparent;
        }
        .trade-log-list::-webkit-scrollbar {
            width: 6px;
        }
        .trade-log-list::-webkit-scrollbar-track {
            background: transparent;
        }
        .trade-log-list::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.2);
            border-radius: 3px;
        }
        .trade-log-item {
            padding: 12px 15px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .trade-log-item:last-child {
            border-bottom: none;
        }
        .trade-log-item.divergent {
            background: rgba(255,82,82,0.1);
            border-left: 3px solid #ff5252;
        }
        .trade-log-item.matching {
            background: rgba(0,200,83,0.05);
            border-left: 3px solid rgba(0,200,83,0.3);
        }
        .trade-log-time {
            font-size: 0.8rem;
            color: #8892b0;
        }
        .trade-log-action {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .trade-log-action .side-long {
            color: #2196F3;
        }
        .trade-log-action .side-short {
            color: #FF9800;
        }
        .trade-log-action .exit {
            color: #8892b0;
        }
        .trade-log-details {
            display: flex;
            gap: 15px;
            font-size: 0.85rem;
            color: #8892b0;
        }
        .trade-log-details .pnl-positive {
            color: #00c853;
        }
        .trade-log-details .pnl-negative {
            color: #ff5252;
        }
        .divergence-indicator {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.7rem;
            background: rgba(255,82,82,0.2);
            color: #ff5252;
        }
        .no-trades-msg {
            padding: 30px;
            text-align: center;
            color: #8892b0;
        }
        @media (max-width: 768px) {
            .trade-logs-container {
                grid-template-columns: 1fr;
            }
        }

        /* Live Test Control Panel Styles */
        .live-test-panel {
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(0,212,255,0.3);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
        }
        .live-test-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .live-test-title {
            font-size: 1.2rem;
            font-weight: 600;
            color: #00d4ff;
        }
        .live-test-badge {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 500;
        }
        .live-test-controls {
            display: flex;
            gap: 15px;
            align-items: center;
            flex-wrap: wrap;
        }
        .live-test-select {
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 8px;
            color: #fff;
            padding: 12px 15px;
            font-size: 0.95rem;
            min-width: 180px;
            cursor: pointer;
            -webkit-appearance: none;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            padding-right: 35px;
        }
        .live-test-select:focus {
            outline: none;
            border-color: #00d4ff;
        }
        .live-test-select option {
            background: #1a1a2e;
            color: #fff;
        }
        .strategy-description {
            background: rgba(0,0,0,0.2);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 6px;
            color: rgba(255,255,255,0.7);
            padding: 8px 12px;
            font-size: 0.8rem;
            line-height: 1.4;
            margin-top: 8px;
            max-width: 350px;
        }
        .btn-start {
            background: rgba(0,200,83,0.2);
            border: 1px solid rgba(0,200,83,0.4);
            color: #00c853;
            padding: 12px 24px;
            font-size: 0.95rem;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 500;
            transition: all 0.2s;
        }
        .btn-start:hover:not(:disabled) {
            background: rgba(0,200,83,0.3);
            transform: translateY(-1px);
        }
        .btn-start:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .btn-stop {
            background: rgba(255,82,82,0.2);
            border: 1px solid rgba(255,82,82,0.4);
            color: #ff5252;
            padding: 12px 24px;
            font-size: 0.95rem;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 500;
            transition: all 0.2s;
        }
        .btn-stop:hover:not(:disabled) {
            background: rgba(255,82,82,0.3);
            transform: translateY(-1px);
        }
        .btn-stop:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .live-status {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
            min-width: 200px;
        }
        .status-indicator {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            animation: none;
        }
        .status-indicator.ready {
            background: #8892b0;
        }
        .status-indicator.running {
            background: #00c853;
            animation: pulse 1.5s infinite;
        }
        .status-indicator.backtesting {
            background: #ffc107;
            animation: pulse 1s infinite;
        }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        .status-text {
            font-size: 0.9rem;
            color: #fff;
        }

        /* Real-time Stats Display */
        .live-stats {
            display: none;
            margin-top: 15px;
            padding: 15px;
            background: rgba(0,200,83,0.1);
            border: 1px solid rgba(0,200,83,0.3);
            border-radius: 8px;
        }
        .live-stats.active {
            display: block;
        }
        .live-stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
        }
        .live-stat-item {
            text-align: center;
        }
        .live-stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: #fff;
        }
        .live-stat-value.positive {
            color: #00c853;
        }
        .live-stat-value.negative {
            color: #ff5252;
        }
        .live-stat-label {
            font-size: 0.8rem;
            color: #8892b0;
            margin-top: 4px;
        }

        @media (max-width: 768px) {
            .live-test-controls {
                flex-direction: column;
                align-items: stretch;
            }
            .live-test-select {
                width: 100%;
            }
            .btn-start, .btn-stop {
                width: 100%;
                justify-content: center;
            }
            .live-status {
                justify-content: center;
            }
            .live-stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        /* Live Trade Feed Styles */
        .live-trade-feed {
            display: none;
            background: rgba(0,0,0,0.4);
            border: 1px solid rgba(123,44,191,0.4);
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 20px;
            max-height: 300px;
            overflow: hidden;
        }
        .live-trade-feed.active {
            display: block;
        }
        .live-trade-feed-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .live-trade-feed-title {
            font-size: 1rem;
            font-weight: 600;
            color: #c77dff;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .ws-status {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.8rem;
            color: #8892b0;
        }
        .ws-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #ff5252;
        }
        .ws-dot.connected {
            background: #00c853;
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        .live-trade-list {
            max-height: 220px;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.2) transparent;
        }
        .live-trade-list::-webkit-scrollbar {
            width: 6px;
        }
        .live-trade-list::-webkit-scrollbar-track {
            background: transparent;
        }
        .live-trade-list::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.2);
            border-radius: 3px;
        }
        .live-trade-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            background: rgba(255,255,255,0.03);
            border-radius: 6px;
            margin-bottom: 6px;
            animation: slideIn 0.3s ease-out;
        }
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateX(-20px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }
        .live-trade-item.long {
            border-left: 3px solid #2196F3;
        }
        .live-trade-item.short {
            border-left: 3px solid #FF9800;
        }
        .live-trade-info {
            display: flex;
            gap: 15px;
            align-items: center;
        }
        .live-trade-side {
            font-weight: 600;
            font-size: 0.85rem;
        }
        .live-trade-side.long { color: #2196F3; }
        .live-trade-side.short { color: #FF9800; }
        .live-trade-price {
            color: #fff;
            font-size: 0.9rem;
        }
        .live-trade-time {
            color: #8892b0;
            font-size: 0.8rem;
        }
        .no-trades-message {
            text-align: center;
            color: #8892b0;
            padding: 30px;
            font-size: 0.9rem;
        }

        /* Live Market Data Section Styles */
        #live-market-content {
            display: none;
        }
        #live-market-content.active {
            display: block;
        }
        #dashboard-content.hidden {
            display: none !important;
        }
        .market-controls {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            flex-wrap: wrap;
            align-items: center;
        }
        .market-control-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .market-control-label {
            color: #8892b0;
            font-size: 0.9rem;
        }
        .market-select {
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.1);
            color: #fff;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 0.9rem;
            cursor: pointer;
        }
        .market-select:focus {
            outline: none;
            border-color: #00d4ff;
        }
        .refresh-btn {
            padding: 8px 16px;
            background: rgba(0,212,255,0.2);
            border: 1px solid rgba(0,212,255,0.3);
            color: #00d4ff;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.2s;
        }
        .refresh-btn:hover {
            background: rgba(0,212,255,0.3);
        }
        .refresh-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        /* REMOVED: Duplicate #live-price-chart-container with hardcoded height - use the one in main styles */
        .market-data-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-top: 20px;
        }
        @media (max-width: 900px) {
            .market-data-grid {
                grid-template-columns: 1fr;
            }
        }
        .orderbook-container {
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
            padding: 15px;
        }
        .orderbook-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .orderbook-title {
            font-weight: 600;
            color: #fff;
        }
        .orderbook-spread {
            color: #8892b0;
            font-size: 0.85rem;
        }
        .orderbook-sides {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }
        .orderbook-side {
            font-size: 0.85rem;
        }
        .orderbook-side-header {
            display: flex;
            justify-content: space-between;
            color: #8892b0;
            padding-bottom: 5px;
            margin-bottom: 5px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .orderbook-row {
            display: flex;
            justify-content: space-between;
            padding: 3px 0;
            position: relative;
        }
        .orderbook-row .price {
            font-weight: 500;
        }
        .orderbook-row .amount {
            color: #8892b0;
        }
        .orderbook-side.bids .price { color: #00c853; }
        .orderbook-side.asks .price { color: #ff5252; }
        .orderbook-row .bar {
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            opacity: 0.15;
        }
        .orderbook-side.bids .bar { background: #00c853; }
        .orderbook-side.asks .bar { background: #ff5252; }
        .trades-container {
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
            padding: 15px;
            max-height: 400px;
            overflow-y: auto;
        }
        .trades-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .trades-title {
            font-weight: 600;
            color: #fff;
        }
        .trades-table {
            width: 100%;
            font-size: 0.85rem;
        }
        .trades-table th {
            text-align: left;
            color: #8892b0;
            font-weight: 500;
            padding: 5px 0;
        }
        .trades-table td {
            padding: 4px 0;
        }
        .trades-table .side-buy { color: #00c853; }
        .trades-table .side-sell { color: #ff5252; }
        .market-price-display {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-left: auto;
        }
        .current-price {
            font-size: 1.5rem;
            font-weight: 600;
            color: #fff;
        }
        .price-change {
            font-size: 0.9rem;
            padding: 4px 8px;
            border-radius: 4px;
            cursor: help;
        }
        .price-change .change-label {
            opacity: 0.7;
            font-size: 0.8rem;
        }
        .price-change.positive {
            background: rgba(0,200,83,0.2);
            color: #00c853;
        }
        .price-change.negative {
            background: rgba(255,82,82,0.2);
            color: #ff5252;
        }

        /* === SESSION MANAGEMENT UI === */

        /* Sub-tabs within Your Bots */
        .session-sub-tabs {
            display: flex;
            gap: 0;
            background: #161b22;
            border-bottom: 1px solid #30363d;
            padding: 0 16px;
        }
        .session-sub-tab {
            padding: 12px 20px;
            color: #8b949e;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .session-sub-tab:hover {
            color: #c9d1d9;
            background: rgba(255,255,255,0.03);
        }
        .session-sub-tab.active {
            color: #00d4ff;
            border-bottom-color: #00d4ff;
        }
        .session-sub-tab .tab-count-badge {
            background: #30363d;
            color: #8b949e;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 11px;
            font-weight: 600;
            min-width: 28px; /* Fixed width prevents jumping when count changes */
            text-align: center;
        }
        .session-sub-tab.active .tab-count-badge {
            background: rgba(0,212,255,0.2);
            color: #00d4ff;
        }

        /* Session content panels */
        .session-panel {
            display: none;
            padding: 16px;
            flex-direction: column;
            gap: 12px;
            min-height: 300px;
        }
        .session-panel.active {
            display: flex;
        }

        /* Session toolbar */
        .session-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
        }
        .session-filters {
            display: flex;
            gap: 12px;
            align-items: center;
        }
        .session-filter-select {
            background: #21262d;
            border: 1px solid #30363d;
            color: #c9d1d9;
            padding: 6px 12px;
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
        }
        .btn-new-session {
            background: #238636;
            color: #fff;
            border: none;
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
        }
        .btn-new-session:hover {
            background: #2ea043;
        }

        /* Session cards/rows */
        .session-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            min-height: 100px; /* Prevent collapse when empty/loading */
        }
        .session-card {
            display: grid;
            grid-template-columns: 1fr 120px 100px 100px 80px 140px;
            gap: 16px;
            align-items: center;
            padding: 12px 16px;
            background: #161b22;
            border: 1px solid #30363d;
            border-radius: 8px;
            transition: background 0.2s, border-color 0.2s;
            min-height: 60px; /* Fixed height prevents layout jumps */
            contain: layout style; /* CSS containment for performance */
        }
        .session-card:hover {
            background: #1c2128;
            border-color: #444c56;
        }
        .session-card.stale-warning {
            border-color: #d29922;
            background: rgba(210,153,34,0.08);
        }
        .session-card.stale-danger {
            border-color: #f85149;
            background: rgba(248,81,73,0.08);
        }

        .session-info {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .session-name {
            font-size: 14px;
            font-weight: 600;
            color: #c9d1d9;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .session-meta {
            font-size: 11px;
            color: #8b949e;
            display: flex;
            gap: 12px;
        }
        .session-strategy {
            color: #8b949e;
            font-size: 12px;
        }
        .session-params {
            color: #58a6ff;
            font-size: 11px;
            font-weight: 500;
            background: rgba(88, 166, 255, 0.1);
            padding: 2px 6px;
            border-radius: 4px;
        }
        .session-market {
            font-size: 12px;
            color: #58a6ff;
        }
        .live-data-badge {
            font-size: 10px;
            background: rgba(56, 139, 253, 0.15);
            color: #58a6ff;
            padding: 2px 6px;
            border-radius: 4px;
            margin-left: 8px;
            font-weight: 600;
            animation: pulse-live 2s infinite;
        }
        @keyframes pulse-live {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }
        .session-runtime {
            font-size: 12px;
            color: #8b949e;
            font-family: 'JetBrains Mono', monospace;
        }

        /* Heartbeat indicator */
        .heartbeat-indicator {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: #8b949e;
        }
        .heartbeat-icon {
            font-size: 12px;
            animation: heartbeat 1.5s ease-in-out infinite;
        }
        .heartbeat-indicator.healthy .heartbeat-icon {
            color: #3fb950;
        }
        .heartbeat-indicator.warning .heartbeat-icon {
            color: #d29922;
            animation: heartbeat-warning 0.8s ease-in-out infinite;
        }
        .heartbeat-indicator.stale .heartbeat-icon {
            color: #f85149;
            animation: heartbeat-danger 0.5s ease-in-out infinite;
        }
        .heartbeat-indicator.dead .heartbeat-icon {
            color: #484f58;
            animation: none;
        }
        /* Service active indicator for scrapers */
        .heartbeat-indicator.service-active .heartbeat-icon {
            color: #3fb950;
            animation: pulse-service 2s ease-in-out infinite;
        }
        .heartbeat-indicator.service-inactive .heartbeat-icon {
            color: #f85149;
            animation: none;
        }
        @keyframes pulse-service {
            0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.4); }
            50% { transform: scale(1.15); opacity: 0.9; box-shadow: 0 0 8px 2px rgba(63, 185, 80, 0.3); }
        }
        @keyframes heartbeat {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.1); opacity: 0.8; }
        }
        @keyframes heartbeat-warning {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.15); opacity: 0.7; }
        }
        @keyframes heartbeat-danger {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.2); opacity: 0.6; }
        }

        /* Session status badge */
        .session-status {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            padding: 4px 10px;
            border-radius: 12px;
            font-weight: 500;
        }
        .session-status.running {
            background: rgba(63,185,80,0.15);
            color: #3fb950;
        }
        .session-status.stopped {
            background: rgba(139,148,158,0.15);
            color: #8b949e;
        }
        .session-status.completed {
            background: rgba(88,166,255,0.15);
            color: #58a6ff;
        }
        .session-status.failed {
            background: rgba(248,81,73,0.15);
            color: #f85149;
        }
        .session-status.created {
            background: rgba(210,153,34,0.15);
            color: #d29922;
        }
        .status-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
        }
        .session-status.running .status-dot {
            animation: pulse 1.5s infinite;
        }

        /* Session metrics */
        .session-metrics {
            display: flex;
            gap: 16px;
            font-size: 12px;
        }
        .session-metric {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .metric-label {
            color: #8b949e;
            font-size: 10px;
        }
        .metric-value {
            color: #c9d1d9;
            font-weight: 500;
        }
        .metric-value.positive { color: #3fb950; }
        .metric-value.negative { color: #f85149; }

        /* Session actions */
        .session-actions {
            display: flex;
            gap: 8px;
        }
        .btn-session-action {
            padding: 6px 12px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            border: 1px solid;
            transition: all 0.2s;
        }
        .btn-session-stop {
            background: transparent;
            border-color: #f85149;
            color: #f85149;
        }
        .btn-session-stop:hover {
            background: rgba(248,81,73,0.15);
        }
        .btn-session-restart {
            background: transparent;
            border-color: #f0883e;
            color: #f0883e;
        }
        .btn-session-restart:hover {
            background: rgba(240,136,62,0.15);
        }
        .btn-session-backtest {
            background: transparent;
            border-color: #8b5cf6;
            color: #8b5cf6;
        }
        .btn-session-backtest:hover {
            background: rgba(139,92,246,0.15);
        }
        .btn-session-view {
            background: transparent;
            border-color: #30363d;
            color: #8b949e;
        }
        .btn-session-view:hover {
            background: #21262d;
            color: #c9d1d9;
        }
        .btn-session-clone {
            background: transparent;
            border-color: #58a6ff;
            color: #58a6ff;
        }
        .btn-session-clone:hover {
            background: rgba(88,166,255,0.15);
        }
        .btn-session-start {
            background: transparent;
            border-color: #3fb950;
            color: #3fb950;
        }
        .btn-session-start:hover {
            background: rgba(63,185,80,0.15);
        }
        .btn-session-delete {
            background: transparent;
            border-color: #484f58;
            color: #8b949e;
        }
        .btn-session-delete:hover {
            background: rgba(248,81,73,0.15);
            border-color: #f85149;
            color: #f85149;
        }

        /* Empty state */
        .session-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px 20px;
            color: #8b949e;
            text-align: center;
        }
        .session-empty-icon {
            font-size: 48px;
            margin-bottom: 16px;
            opacity: 0.5;
        }
        .session-empty-text {
            font-size: 14px;
            margin-bottom: 16px;
        }

        /* History pagination */
        .history-pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 16px;
            padding: 16px;
            border-top: 1px solid #30363d;
            background: #161b22;
        }
        .history-pagination .pagination-btn {
            background: #21262d;
            border: 1px solid #30363d;
            color: #c9d1d9;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.2s;
        }
        .history-pagination .pagination-btn:hover:not(:disabled) {
            background: #30363d;
        }
        .history-pagination .pagination-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .history-pagination .pagination-info {
            color: #8b949e;
            font-size: 13px;
        }

        /* Modal styles */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.7);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
        }
        .modal-overlay.active {
            display: flex;
        }
        .modal-content {
            background: #161b22;
            border: 1px solid #30363d;
            border-radius: 12px;
            width: 100%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            border-bottom: 1px solid #30363d;
        }
        .modal-title {
            font-size: 16px;
            font-weight: 600;
            color: #c9d1d9;
        }
        .modal-close {
            background: none;
            border: none;
            color: #8b949e;
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            line-height: 1;
        }
        .modal-close:hover {
            color: #c9d1d9;
        }
        .modal-body {
            padding: 20px;
        }
        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            padding: 16px 20px;
            border-top: 1px solid #30363d;
        }

        /* Form styles */
        .form-group {
            margin-bottom: 16px;
        }
        .form-label {
            display: block;
            font-size: 12px;
            color: #8b949e;
            margin-bottom: 6px;
            text-transform: uppercase;
        }
        .form-input, .form-select {
            width: 100%;
            background: #0d1117;
            border: 1px solid #30363d;
            color: #c9d1d9;
            padding: 10px 12px;
            border-radius: 6px;
            font-size: 14px;
        }
        .form-input:focus, .form-select:focus {
            outline: none;
            border-color: #58a6ff;
        }
        .input-with-suffix {
            display: flex;
            align-items: center;
        }
        .input-with-suffix .form-input {
            border-radius: 6px 0 0 6px;
            border-right: none;
        }
        .input-suffix {
            background: #21262d;
            border: 1px solid #30363d;
            border-left: none;
            border-radius: 0 6px 6px 0;
            padding: 10px 12px;
            color: #8b949e;
            font-size: 14px;
        }
        .form-hint {
            font-size: 11px;
            color: #6e7681;
            margin-top: 4px;
        }
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }
        .form-hint {
            font-size: 11px;
            color: #8b949e;
            margin-top: 4px;
        }

        /* Strategy params container */
        .strategy-params {
            background: #0d1117;
            border: 1px solid #30363d;
            border-radius: 6px;
            padding: 12px;
            margin-top: 8px;
        }
        .strategy-params-title {
            font-size: 11px;
            color: #8b949e;
            text-transform: uppercase;
            margin-bottom: 12px;
        }

        /* Button styles for modal */
        .btn-modal {
            padding: 10px 20px;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
        }
        .btn-modal-cancel {
            background: #21262d;
            color: #c9d1d9;
        }
        .btn-modal-cancel:hover {
            background: #30363d;
        }
        .btn-modal-create {
            background: #238636;
            color: #fff;
        }
        .btn-modal-create:hover {
            background: #2ea043;
        }
        .btn-modal-create:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Session Detail Modal Styles */
        .modal-large {
            max-width: 900px;
        }
        .modal-header-info {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .detail-session-meta {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .detail-badge {
            background: #21262d;
            color: #8b949e;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 11px;
            text-transform: uppercase;
        }
        .detail-status {
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
        }
        .detail-status.running { background: rgba(63,185,80,0.2); color: #3fb950; }
        .detail-status.stopped { background: rgba(139,148,158,0.2); color: #8b949e; }
        .detail-status.completed { background: rgba(88,166,255,0.2); color: #58a6ff; }
        .detail-status.failed { background: rgba(248,81,73,0.2); color: #f85149; }
        .modal-tabs {
            display: flex;
            border-bottom: 1px solid #30363d;
            padding: 0 20px;
        }
        .modal-tab {
            background: none;
            border: none;
            color: #8b949e;
            padding: 12px 16px;
            cursor: pointer;
            font-size: 13px;
            border-bottom: 2px solid transparent;
            margin-bottom: -1px;
        }
        .modal-tab:hover { color: #c9d1d9; }
        .modal-tab.active {
            color: #58a6ff;
            border-bottom-color: #58a6ff;
        }
        .modal-body-tabs {
            min-height: 400px;
            max-height: 500px;
            overflow-y: auto;
        }
        .detail-tab-content {
            display: none;
        }
        .detail-tab-content.active {
            display: block;
        }
        .detail-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }
        .detail-section {
            background: #0d1117;
            border: 1px solid #30363d;
            border-radius: 8px;
            padding: 16px;
        }
        .detail-section-wide {
            grid-column: span 2;
        }
        .detail-section-title {
            font-size: 12px;
            color: #8b949e;
            text-transform: uppercase;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid #30363d;
        }
        .detail-row {
            display: flex;
            justify-content: space-between;
            padding: 6px 0;
            font-size: 13px;
        }
        .detail-label { color: #8b949e; }
        .detail-value { color: #c9d1d9; font-family: monospace; }
        .detail-params {
            background: #0d1117;
            color: #8b949e;
            padding: 8px;
            border-radius: 4px;
            font-size: 11px;
            overflow-x: auto;
            white-space: pre-wrap;
            margin: 0;
        }
        .detail-notes {
            width: 100%;
            background: #0d1117;
            border: 1px solid #30363d;
            color: #c9d1d9;
            padding: 10px;
            border-radius: 6px;
            font-size: 13px;
            min-height: 80px;
            resize: vertical;
        }
        .btn-save-notes {
            margin-top: 8px;
            background: #21262d;
            border: 1px solid #30363d;
            color: #c9d1d9;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
        }
        .btn-save-notes:hover { background: #30363d; }

        /* Metrics grid */
        .metrics-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-bottom: 20px;
        }
        .metric-card {
            background: #0d1117;
            border: 1px solid #30363d;
            border-radius: 8px;
            padding: 12px;
            text-align: center;
        }
        .metric-card-label {
            font-size: 11px;
            color: #8b949e;
            text-transform: uppercase;
            margin-bottom: 4px;
        }
        .metric-card-value {
            font-size: 18px;
            font-weight: 600;
            color: #c9d1d9;
            font-family: monospace;
        }
        .metric-card-value.positive { color: #3fb950; }
        .metric-card-value.negative { color: #f85149; }
        .equity-chart-section {
            background: #0d1117;
            border: 1px solid #30363d;
            border-radius: 8px;
            padding: 16px;
        }

        /* Trades table */
        .trades-table-container {
            max-height: 350px;
            overflow-y: auto;
        }
        .trades-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
        }
        .trades-table th, .trades-table td {
            padding: 8px 10px;
            text-align: left;
            border-bottom: 1px solid #30363d;
        }
        .trades-table th {
            background: #161b22;
            color: #8b949e;
            text-transform: uppercase;
            font-weight: 500;
            position: sticky;
            top: 0;
        }
        .trades-table td { color: #c9d1d9; }
        .trades-table .no-data { text-align: center; color: #8b949e; padding: 30px; }
        .trades-table .buy { color: #3fb950; }
        .trades-table .sell { color: #f85149; }
        .trades-pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 16px;
            padding: 12px;
            border-top: 1px solid #30363d;
        }
        .pagination-btn {
            background: #21262d;
            border: 1px solid #30363d;
            color: #c9d1d9;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
        }
        .pagination-btn:hover { background: #30363d; }
        .pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .pagination-info { color: #8b949e; font-size: 12px; }

        /* Logs viewer */
        .logs-controls {
            display: flex;
            gap: 12px;
            align-items: center;
            padding-bottom: 12px;
            border-bottom: 1px solid #30363d;
            margin-bottom: 12px;
        }
        .logs-filter {
            background: #21262d;
            border: 1px solid #30363d;
            color: #c9d1d9;
            padding: 6px 10px;
            border-radius: 4px;
            font-size: 12px;
        }
        .logs-autoscroll {
            display: flex;
            align-items: center;
            gap: 6px;
            color: #8b949e;
            font-size: 12px;
        }
        .btn-logs-stream {
            background: #238636;
            border: none;
            color: #fff;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            margin-left: auto;
        }
        .btn-logs-stream.streaming { background: #f85149; }
        .logs-container {
            background: #0d1117;
            border: 1px solid #30363d;
            border-radius: 6px;
            height: 300px;
            overflow-y: auto;
            font-family: monospace;
            font-size: 11px;
            padding: 8px;
        }
        .log-line {
            padding: 2px 0;
            white-space: pre-wrap;
            word-break: break-all;
        }
        .log-line.log-info { color: #8b949e; }
        .log-line.log-trade { color: #58a6ff; }
        .log-line.log-warn { color: #d29922; }
        .log-line.log-error { color: #f85149; }

        /* Modal action buttons */
        .btn-modal-action {
            background: #21262d;
            color: #c9d1d9;
        }
        .btn-modal-action:hover { background: #30363d; }
        .btn-modal-clone {
            background: #1f6feb;
            color: #fff;
        }
        .btn-modal-clone:hover { background: #388bfd; }

        /* Responsive adjustments for session cards */
        @media (max-width: 900px) {
            .session-card {
                grid-template-columns: 1fr 1fr;
                gap: 12px;
            }
            .session-actions {
                grid-column: span 2;
                justify-content: flex-end;
            }
        }
        @media (max-width: 600px) {
            .session-card {
                grid-template-columns: 1fr;
            }
            .session-actions {
                grid-column: span 1;
            }
        }

        /* === INLINE SESSION DETAIL VIEW === */
        .btn-back-to-list {
            background: transparent;
            border: 1px solid #30363d;
            color: #58a6ff;
            padding: 6px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
        }
        .btn-back-to-list:hover {
            background: #21262d;
        }
        .inline-detail-actions {
            display: flex;
            gap: 8px;
        }
        .inline-detail-content {
            padding: 12px;
            display: flex;
            flex-direction: column;
            flex-grow: 1;
            gap: 12px;
        }
        .inline-detail-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 8px;
        }
        .inline-detail-header h3 {
            margin: 0;
            color: #f0f6fc;
            font-size: 16px;
        }
        .inline-session-status {
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 500;
            text-transform: uppercase;
        }
        .inline-session-status.running { background: #238636; color: #fff; }
        .inline-session-status.stopped { background: #6e7681; color: #fff; }
        .inline-session-status.completed { background: #1f6feb; color: #fff; }
        .inline-session-status.failed { background: #da3633; color: #fff; }
        .inline-detail-meta {
            display: flex;
            gap: 16px;
            color: #8b949e;
            font-size: 12px;
            margin-bottom: 16px;
        }
        .inline-metrics-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
            margin-bottom: 16px;
        }
        .inline-metric {
            background: #21262d;
            padding: 10px;
            border-radius: 6px;
            text-align: center;
        }
        .inline-metric-label {
            display: block;
            color: #8b949e;
            font-size: 10px;
            text-transform: uppercase;
            margin-bottom: 4px;
        }
        .inline-metric-value {
            display: block;
            color: #f0f6fc;
            font-size: 14px;
            font-weight: 600;
        }
        .inline-metric-value.positive { color: #3fb950; }
        .inline-metric-value.negative { color: #f85149; }
        /* Two-column layout: Equity chart left (75%), Trades right (25%) */
        .inline-equity-trades-row {
            display: grid;
            grid-template-columns: 3fr 1fr;
            gap: 12px;
            margin-bottom: 16px;
        }
        @media (max-width: 768px) {
            .inline-equity-trades-row {
                grid-template-columns: 1fr;
            }
        }
        .inline-equity-section {
            background: #161b22;
            border-radius: 8px;
            padding: 12px;
            min-height: 200px;
        }
        .inline-equity-section h4 {
            margin: 0 0 8px 0;
            color: #8b949e;
            font-size: 11px;
            text-transform: uppercase;
        }
        .inline-trades-section {
            background: #161b22;
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            max-height: 250px;
        }
        .inline-trades-section h4 {
            margin: 0;
            padding: 10px 12px;
            color: #8b949e;
            font-size: 11px;
            text-transform: uppercase;
            border-bottom: 1px solid #30363d;
            flex-shrink: 0;
        }
        .inline-trades-list {
            font-family: monospace;
            font-size: 11px;
            overflow-y: auto;
            flex: 1;
        }
        .inline-trade-row {
            display: grid;
            grid-template-columns: 70px 45px 70px 50px 70px;
            gap: 6px;
            padding: 5px 10px;
            border-bottom: 1px solid #21262d;
        }
        .inline-trade-row:nth-child(even) { background: rgba(255,255,255,0.02); }
        .inline-trade-row.new-trade {
            animation: flash-new-trade 1s ease-out;
        }
        @keyframes flash-new-trade {
            0% { background: rgba(63, 185, 80, 0.4); }
            100% { background: transparent; }
        }

        /* Logs section - flex to fill remaining space */
        .inline-logs-section {
            background: #161b22;
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            flex-grow: 1;
            min-height: 200px;
        }
        .inline-logs-section h4 {
            margin: 0;
            padding: 10px 12px;
            color: #8b949e;
            font-size: 11px;
            text-transform: uppercase;
            border-bottom: 1px solid #30363d;
            flex-shrink: 0;
        }
        .inline-logs-list {
            font-family: monospace;
            font-size: 11px;
            padding: 8px 12px;
            flex-grow: 1;
            /* No scrollbar - logs expand page downward */
        }
        .inline-log-row {
            padding: 4px 0;
            border-bottom: 1px solid #21262d;
            word-break: break-word;
        }
        .inline-log-row:last-child { border-bottom: none; }
        .inline-log-row.error { color: #f85149; }
        .inline-log-row.warn { color: #d29922; }
        .inline-log-row.info { color: #58a6ff; }
        .inline-log-row.new-log {
            animation: flash-new-log 1s ease-out;
        }
        @keyframes flash-new-log {
            0% { background: rgba(88, 166, 255, 0.3); }
            100% { background: transparent; }
        }
        .inline-empty {
            color: #6e7681;
            text-align: center;
            padding: 24px;
        }
        /* Make session cards clickable */
        .session-card.clickable {
            cursor: pointer;
        }
        .session-card.clickable:hover {
            border-color: #58a6ff;
        }

        /* === FOOTER === */
        .dashboard-footer {
            margin-top: 40px;
            padding: 24px 16px;
            background: #161b22;
            border-top: 1px solid #30363d;
            text-align: center;
            color: #8b949e;
            font-size: 12px;
        }
        .footer-content {
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: center;
        }
        .footer-logo {
            font-size: 16px;
            font-weight: 600;
            color: #c9d1d9;
        }
        .footer-links {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            justify-content: center;
        }
        .footer-links a {
            color: #58a6ff;
            text-decoration: none;
        }
        .footer-links a:hover {
            text-decoration: underline;
        }
        .footer-copyright {
            margin-top: 8px;
            font-size: 11px;
            color: #6e7681;
        }
