/* ========================================
   AIF — Sci-Fi EA Trading System
   Cyberpunk dark theme with non-linear dynamics
   GPU-accelerated, no layout-thrash animations
   ======================================== */

/* === Design Tokens === */
:root {
    /* Deep space base */
    --bg-base: #060912;
    --bg-surface: #0c1220;
    --bg-elevated: #131b2e;
    --bg-hover: #1a2440;
    
    /* Border tints — purple-gold */
    --border-subtle: rgba(167, 139, 250, 0.06);
    --border-default: rgba(167, 139, 250, 0.12);
    --border-strong: rgba(251, 191, 36, 0.2);
    
    --text-primary: #d6e4ff;
    --text-secondary: #7a8ba8;
    --text-tertiary: #5a6b88;
    --text-muted: #3a4862;
    
    /* Neon accents — purple / gold / violet */
    --accent-blue: #a78bfa;
    --accent-blue-dim: rgba(167, 139, 250, 0.12);
    --accent-blue-glow: rgba(167, 139, 250, 0.35);
    --accent-green: #34d399;
    --accent-green-dim: rgba(52, 211, 153, 0.12);
    --accent-green-glow: rgba(52, 211, 153, 0.3);
    --accent-red: #fb7185;
    --accent-red-dim: rgba(251, 113, 133, 0.12);
    --accent-red-glow: rgba(251, 113, 133, 0.3);
    --accent-yellow: #fbbf24;
    --accent-yellow-dim: rgba(251, 191, 36, 0.12);
    --accent-purple: #a78bfa;
    --accent-purple-dim: rgba(167, 139, 250, 0.12);
    --accent-purple-glow: rgba(167, 139, 250, 0.3);
    
    /* Gradient stops — purple & gold */
    --grad-cyan: linear-gradient(135deg, #a78bfa, #fbbf24);
    --grad-violet: linear-gradient(135deg, #a78bfa, #7c3aed);
    --grad-green: linear-gradient(135deg, #34d399, #059669);
    --grad-surface: linear-gradient(160deg, rgba(19,27,46,0.95), rgba(12,18,32,0.98));
    --grad-border: linear-gradient(135deg, rgba(167,139,250,0.3), rgba(251,191,36,0.2), transparent 60%);
    --grad-line: linear-gradient(90deg, transparent, rgba(167,139,250,0.5) 30%, rgba(251,191,36,0.4) 70%, transparent);
    --grad-line-full: linear-gradient(90deg, transparent, #a78bfa, #fbbf24, transparent);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    /* Shadows — tinted with purple-gold for depth */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 1px rgba(167, 139, 250, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 1px rgba(167, 139, 250, 0.12);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 2px rgba(167, 139, 250, 0.15);
    --shadow-glow: 0 0 20px rgba(167, 139, 250, 0.2);
    
    /* Non-linear easing curves (spring-like) */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-quint: cubic-bezier(0.83, 0, 0.17, 1);
    --ease-back: cubic-bezier(0.68, -0.55, 0.27, 1.55);
    
    /* Transition durations */
    --transition-fast: 120ms var(--ease-out-expo);
    --transition-normal: 220ms var(--ease-spring);
    --transition-slow: 400ms var(--ease-out-expo);
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Animated aurora mesh — purple & gold */
    background-image:
        radial-gradient(ellipse 60% 50% at 20% 0%, rgba(167, 139, 250, 0.1), transparent 70%),
        radial-gradient(ellipse 50% 40% at 80% 10%, rgba(251, 191, 36, 0.06), transparent 70%),
        radial-gradient(ellipse 40% 30% at 50% 100%, rgba(167, 139, 250, 0.05), transparent 70%),
        var(--bg-base);
    background-attachment: fixed;
    background-size: 100% 100%;
}

/* Subtle grid overlay for tech feel — pure CSS, no images */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(167, 139, 250, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(251, 191, 36, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 90%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 90%);
}

/* All content above grid overlay */
.topbar, .agent-status-bar, .account-bar, .main-content, .bottom-section {
    position: relative;
    z-index: 1;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.3), rgba(251, 191, 36, 0.2));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.5), rgba(251, 191, 36, 0.35));
}

/* === Top Navigation Bar === */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 var(--space-lg);
    background: linear-gradient(180deg, rgba(12, 18, 32, 0.95), rgba(12, 18, 32, 0.85));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--grad-line);
    background-size: 200% 100%;
    opacity: 0.6;
    animation: line-flow 4s linear infinite;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--grad-cyan);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    width: 20px;
    height: 20px;
}

.logo-text {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.status-pills {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 100px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.pill-mode.online {
    background: var(--accent-green-dim);
    color: var(--accent-green);
    border-color: rgba(52, 211, 153, 0.25);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.15);
}

.pill-mode.offline {
    background: var(--accent-red-dim);
    color: var(--accent-red);
    border-color: rgba(251, 113, 133, 0.25);
}

.pill-mode.warning {
    background: var(--accent-yellow-dim);
    color: var(--accent-yellow);
    border-color: rgba(251, 191, 36, 0.25);
}

.pill-env.online {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.pill-env.warning {
    background: var(--accent-yellow-dim);
    color: var(--accent-yellow);
}

.pill-equity {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Topbar Center */
.topbar-center {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.mode-toggle {
    display: flex;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 2px;
    border: 1px solid var(--border-subtle);
}

.mode-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-btn:hover {
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
}

.controls {
    display: flex;
    gap: var(--space-xs);
}

.ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ctrl-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ctrl-start:hover {
    background: var(--accent-green-dim);
    color: var(--accent-green);
    border-color: rgba(63, 185, 80, 0.3);
}

.ctrl-pause:hover {
    background: var(--accent-yellow-dim);
    color: var(--accent-yellow);
    border-color: rgba(210, 153, 34, 0.3);
}

.ctrl-stop:hover {
    background: var(--accent-red-dim);
    color: var(--accent-red);
    border-color: rgba(248, 81, 73, 0.3);
}

.interval-select {
    padding: 6px 12px;
    font-size: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
}

.interval-select:hover {
    border-color: var(--border-default);
}

/* Topbar Right */
.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.symbol-display {
    padding: 4px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-blue);
}

/* Symbol Prices Ticker */
.symbol-prices {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0 var(--space-sm);
}

.symbol-price-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    transition: all var(--transition-fast);
}

.symbol-price-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
}

.symbol-price-item .coin-icon {
    flex-shrink: 0;
    border-radius: 50%;
}

.symbol-price-item .symbol-name {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 10px;
}

.symbol-price-item .symbol-price {
    color: var(--text-primary);
    font-weight: 600;
}

.symbol-price-item .symbol-change {
    font-size: 10px;
    font-weight: 500;
    padding: 1px 4px;
    border-radius: 3px;
}

/* Status colors for price changes */
.symbol-price-item .symbol-change.positive {
    color: var(--accent-green);
    background: var(--accent-green-dim);
}

.symbol-price-item .symbol-change.negative {
    color: var(--accent-red);
    background: var(--accent-red-dim);
}

.symbol-price-item .symbol-change.neutral {
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

/* Status indicator dot — hidden, replaced by coin icons */
.symbol-price-item::before {
    display: none;
}

.symbol-price-item.status-neutral::before {
    background: var(--text-secondary);
}

.symbol-price-item.status-warning::before {
    background: var(--accent-yellow);
    box-shadow: 0 0 4px var(--accent-yellow);
}

.llm-badge {
    padding: 4px 10px;
    background: var(--accent-purple-dim);
    border: 1px solid rgba(163, 113, 247, 0.3);
    border-radius: var(--radius-md);
    font-size: 11px;
    color: var(--accent-purple);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(19, 27, 46, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-sm::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-cyan);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.btn-sm:hover {
    color: var(--text-primary);
    border-color: var(--accent-blue-glow);
    transform: translateY(-1px);
}

.btn-sm:hover::before {
    opacity: 0.08;
}

/* === Main Content Layout === */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr;
    gap: var(--space-lg);
    padding: var(--space-lg);
    flex: 1 1 0;
    min-height: 300px;
    overflow: hidden;
}

/* Grid 子项必须设 min-width:0，否则内容会撑开列宽导致溢出/消失 */
.main-content > .panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

/* === Team PnL Chart Panel === */
.panel-team-chart {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.pnl-timeframe-tabs {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: rgba(6, 9, 18, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.pnl-timeframe-tabs .tf-tab {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.pnl-timeframe-tabs .tf-tab:hover {
    color: var(--text-primary);
    background: rgba(167, 139, 250, 0.06);
}

.pnl-timeframe-tabs .tf-tab.active {
    color: var(--accent-blue);
    background: var(--accent-blue-dim);
    box-shadow: inset 0 0 8px rgba(167, 139, 250, 0.08);
}

.team-pnl-chart-wrapper {
    flex: 1 1 0;
    position: relative;
    min-height: 120px;
    height: 100%;
}

#teamPnlChart {
    width: 100% !important;
    height: 100% !important;
}

.team-pnl-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-muted);
}

.team-pnl-empty p {
    margin-top: var(--space-sm);
    font-size: 12px;
}

/* === Agent Status Bar === */
.agent-status-bar {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px var(--space-lg);
    background: linear-gradient(180deg, rgba(12, 18, 32, 0.8), rgba(6, 9, 18, 0.9));
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.agent-status-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.agent-status-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    margin-right: 2px;
}

.agent-status-sep {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 2px;
    opacity: 0.4;
}

.agent-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    background: rgba(19, 27, 46, 0.7);
    border: 1px solid var(--border-subtle);
    transition: border-color var(--transition-fast), background var(--transition-fast);
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.agent-status-dot .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.agent-status-dot .dot-label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

.agent-status-dot .agent-badge {
    font-size: 7px;
    padding: 1px 4px;
    border-radius: 3px;
}

.agent-status-dot.dot-running {
    border-color: var(--accent-blue-glow);
    background: var(--accent-blue-dim);
}

.agent-status-dot.dot-running .dot {
    background: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue-glow);
    animation: pulse-dot 1.2s var(--ease-in-out-quint) infinite;
}

.agent-status-dot.dot-completed {
    border-color: rgba(52, 211, 153, 0.3);
    background: var(--accent-green-dim);
}

.agent-status-dot.dot-completed .dot {
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green-glow);
}

.agent-status-dot.dot-off {
    opacity: 0.35;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.65); }
}

.agent-status-cycle {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-blue);
    background: var(--accent-blue-dim);
    padding: 2px 8px;
    border-radius: 100px;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    overflow-y: auto;
}

/* === Panel Base === */
.panel {
    background: var(--grad-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    contain: content;
}

/* Gradient top-border accent on each panel */
.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--grad-line);
    background-size: 200% 100%;
    opacity: 0.7;
    pointer-events: none;
    animation: line-flow 6s linear infinite;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.03), transparent);
}

.panel-header h2 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}

.panel-header h2 svg {
    color: var(--accent-blue);
    filter: drop-shadow(0 0 4px var(--accent-blue-glow));
}

.panel-header h2 svg {
    color: var(--text-tertiary);
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cycle-tag {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    border-radius: 100px;
}

.count-badge {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: 100px;
}

/* === Chatroom Panel === */
.panel-chatroom {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.chatroom-container {
    flex: 1 1 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chatroom-messages {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-md);
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Chat bubble — card style with colored left border per agent type */
.chat-bubble {
    padding: 10px 14px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(19, 27, 46, 0.7), rgba(12, 18, 32, 0.5));
    border-radius: var(--radius-md);
    border-left: 3px solid var(--border-default);
    font-size: 12px;
    line-height: 1.5;
    animation: msg-in 280ms var(--ease-spring) both;
    word-break: break-word;
}

/* Agent-specific left border colors */
.chat-bubble.symbol_selector { border-left-color: #a78bfa; }
.chat-bubble.system          { border-left-color: #64748b; }
.chat-bubble.quant_analyst   { border-left-color: #22d3ee; }
.chat-bubble.predict_agent   { border-left-color: #c084fc; }
.chat-bubble.trend_agent     { border-left-color: #34d399; }
.chat-bubble.setup_agent     { border-left-color: #fbbf24; }
.chat-bubble.trigger_agent   { border-left-color: #f97316; }
.chat-bubble.bull_agent      { border-left-color: #22c55e; }
.chat-bubble.bear_agent      { border-left-color: #ef4444; }
.chat-bubble.multi_period_agent { border-left-color: #06b6d4; }
.chat-bubble.decision_core   { border-left-color: #fbbf24; background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(12, 18, 32, 0.5)); }
.chat-bubble.risk_audit      { border-left-color: #ef4444; }
.chat-bubble.reflection_agent { border-left-color: #8b5cf6; }

/* Level-based background tint */
.chat-bubble.chat-level-success { background: linear-gradient(135deg, rgba(34, 211, 153, 0.06), rgba(12, 18, 32, 0.5)); }
.chat-bubble.chat-level-warning { background: linear-gradient(135deg, rgba(251, 191, 36, 0.06), rgba(12, 18, 32, 0.5)); }
.chat-bubble.chat-level-error   { background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), rgba(12, 18, 32, 0.5)); }

.chat-bubble .chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-bubble .chat-agent-name {
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
}

.chat-bubble .chat-timestamp {
    font-size: 10px;
    color: var(--text-tertiary);
}

.chat-bubble .chat-content {
    color: var(--text-primary);
    font-size: 12px;
}

.chatroom-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: var(--space-md);
}

.chatroom-empty svg {
    opacity: 0.5;
}

.chat-message {
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, rgba(19, 27, 46, 0.6), rgba(12, 18, 32, 0.4));
    border-radius: var(--radius-md);
    border-left: 2px solid var(--border-default);
    font-size: 13px;
    line-height: 1.6;
    animation: msg-in 280ms var(--ease-spring) both;
}

@keyframes msg-in {
    from { opacity: 0; transform: translateX(-8px) scale(0.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.chat-message.agent {
    border-left-color: var(--accent-blue);
    box-shadow: -2px 0 8px rgba(167, 139, 250, 0.06);
}

.chat-message.decision {
    border-left-color: var(--accent-yellow);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.06), rgba(12, 18, 32, 0.4));
}

.chat-message .agent-name {
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 4px;
    font-size: 12px;
    text-shadow: 0 0 8px rgba(167, 139, 250, 0.2);
}

.chat-message .message-content {
    color: var(--text-primary);
}

.chat-message .message-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* === Agent Badge (used in status bar) === */
.agent-badge {
    font-size: 7px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 100px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.agent-badge.idle {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.agent-badge.running {
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
}

.agent-badge.completed {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.agent-badge.off {
    background: var(--bg-elevated);
    color: var(--text-muted);
    opacity: 0.5;
}

/* === Sidebar Panels === */
.panel-account,
.panel-positions,
.panel-llm {
    flex-shrink: 0;
}

.account-stats,
.positions-summary,
.llm-metrics {
    padding: var(--space-md) var(--space-lg);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.stat-value.pos,
.stat-value.stat-positive {
    color: var(--accent-green);
}

.stat-value.neg,
.stat-value.stat-negative {
    color: var(--accent-red);
}

.stat-value.neutral {
    color: var(--text-secondary);
}

.stat-mono {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* === Positions List === */
.positions-list {
    padding: 6px 10px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.empty-state {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-muted);
    font-size: 12px;
}

.position-item {
    padding: 6px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    border-left: 3px solid var(--border-default);
}

.position-item.long {
    border-left-color: var(--accent-green);
}

.position-item.short {
    border-left-color: var(--accent-red);
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.position-symbol {
    font-weight: 600;
    font-size: 12px;
}

.position-side {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
}

.position-side.long {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.position-side.short {
    background: var(--accent-red-dim);
    color: var(--accent-red);
}

.position-details {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 10px;
}

.position-detail {
    display: flex;
    gap: 3px;
    align-items: center;
}

.position-detail .label {
    color: var(--text-tertiary);
    font-size: 10px;
}

.position-detail .value {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 10px;
}

/* === Bottom Section === */
.bottom-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    padding: 0 var(--space-lg) var(--space-lg);
    height: 390px;
    max-height: 45vh;
    flex-shrink: 1;
    overflow: hidden;
}

.panel-rankings,
.panel-trades,
.panel-decisions {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    height: 100%;
}

/* === Tables === */
.table-container {
    flex: 1;
    overflow: auto;
    min-height: 0;
    max-width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    table-layout: auto;
    white-space: nowrap;
    max-width: 100%;
}

.data-table th {
    position: sticky;
    top: 0;
    background: rgba(12, 18, 32, 0.95);
    backdrop-filter: blur(8px);
    padding: 10px 12px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border-default);
}

.data-table th.text-right {
    text-align: right;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.data-table td.text-right {
    text-align: right;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(167, 139, 250, 0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 24px !important;
}

/* Table value styles */
.val.pos {
    color: var(--accent-green);
}

.val.neg {
    color: var(--accent-red);
}

.val.neutral,
.val.warn {
    color: var(--accent-yellow);
}

.cell-na {
    color: var(--text-muted);
}

/* Action badges in tables */
.action-buy,
.action-long {
    color: var(--accent-green);
    font-weight: 600;
}

.action-sell,
.action-short {
    color: var(--accent-red);
    font-weight: 600;
}

.action-hold,
.action-wait {
    color: var(--text-tertiary);
}

/* === Filter Selects === */
.filter-select {
    padding: 4px 8px;
    font-size: 11px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

/* === Ranking Summary === */
.ranking-summary {
    padding: var(--space-sm) var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: var(--space-lg);
}

/* === Modal === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 5, 12, 0.92);
}

.modal-content {
    position: relative;
    background: linear-gradient(160deg, rgba(19, 27, 46, 0.97), rgba(12, 18, 32, 0.98));
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(167, 139, 250, 0.08);
    animation: modal-in 320ms var(--ease-spring);
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--grad-line-full);
    opacity: 0.7;
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-content.modal-xlarge {
    max-width: 900px;
    width: 92vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

.settings-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

/* === Settings Tabs === */
.settings-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
    overflow-x: auto;
    scrollbar-width: thin;
}

.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-sm) var(--space-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.settings-tab .icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: 0.7;
}

.settings-tab:hover {
    color: var(--text-primary);
    background: rgba(167, 139, 250, 0.05);
}

.settings-tab:hover .icon {
    opacity: 1;
}

.settings-tab.active {
    color: var(--accent-blue);
    background: var(--accent-blue-dim);
    box-shadow: inset 0 -2px 0 var(--accent-blue);
}

.settings-tab.active .icon {
    opacity: 1;
    filter: drop-shadow(0 0 4px var(--accent-blue-glow));
}

.settings-tab-content {
    display: none;
    animation: settingsTabIn 120ms ease;
}

.settings-tab-content.active {
    display: block;
}

@keyframes settingsTabIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Settings Sections === */
.settings-section {
    margin-bottom: var(--space-xl);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.settings-hint {
    margin-top: var(--space-xs);
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-error {
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--accent-red-dim);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    font-size: 12px;
}

/* === Strategy Profile Form === */
.strategy-section {
    margin-bottom: var(--space-xl);
}

.strategy-section:last-child {
    margin-bottom: 0;
}

.strategy-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.strategy-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
    padding: 4px var(--space-sm);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.strategy-row:hover {
    background: var(--bg-elevated);
}

.strategy-label {
    flex: 1;
    font-size: 12px;
    color: var(--text-secondary);
}

.strategy-input {
    width: 100px;
    padding: 6px 10px;
    font-size: 12px;
    font-family: var(--font-mono);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: right;
}

.strategy-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.strategy-default {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    min-width: 60px;
}

.strategy-reset-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.strategy-reset-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.strategy-weights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm) var(--space-lg);
}

.strategy-weights-sum {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-secondary);
}

.strategy-weights-sum .sum-value {
    font-family: var(--font-mono);
    font-weight: 600;
}

.strategy-weights-sum .sum-value.valid {
    color: var(--accent-green);
}

.strategy-weights-sum .sum-value.invalid {
    color: var(--accent-red);
}

.loading-text {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-xl);
    animation: shimmer 1.8s var(--ease-in-out-quint) infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Dynamic gradient line flow — GPU-only (background-position) */
@keyframes line-flow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* === Form Controls === */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    background: rgba(6, 9, 18, 0.5);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.08);
}

.textarea-lg {
    min-height: 200px;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* === Buttons === */
.btn-primary {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--grad-cyan);
    color: #060912;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-normal);
    position: relative;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(19, 27, 46, 0.8);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-blue-glow);
    transform: translateY(-1px);
}

/* === Config Tabs === */
.config-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
}

.config-tab {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.config-tab:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.config-tab.active {
    color: var(--accent-blue);
    background: var(--accent-blue-dim);
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
}

/* === Logs (hidden but kept for compatibility) === */
.log-entry {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 8px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.log-time {
    color: var(--text-muted);
    margin-right: 8px;
}

/* === Value Tags (for compatibility) === */
.value-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.value-tag.bullish {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.value-tag.bearish {
    background: var(--accent-red-dim);
    color: var(--accent-red);
}

.value-tag.neutral {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

/* === Responsive === */

/* Low height screens (Windows PCs with low resolution) */
@media (max-height: 800px) {
    :root {
        --space-lg: 10px;
        --space-md: 6px;
        --space-sm: 3px;
    }
    body {
        font-size: 13px;
    }
    .topbar {
        height: 40px;
        padding: 0 10px;
    }
    .symbol-price-item {
        padding: 2px 5px;
        font-size: 10px;
    }
    .symbol-price-item .symbol-name {
        font-size: 9px;
    }
    .symbol-price-item .coin-icon {
        width: 12px;
        height: 12px;
    }
    .account-bar {
        padding: 3px 10px;
        gap: 16px;
    }
    .account-bar-item {
        min-width: 75px;
    }
    .account-bar-label {
        font-size: 9px;
    }
    .account-bar-value {
        font-size: 13px;
    }
    .agent-status-bar {
        padding: 3px 10px;
    }
    .agent-status-bar .agent-badge {
        font-size: 6px;
        padding: 1px 3px;
    }
    .main-content {
        padding: 6px;
        gap: 6px;
        min-height: 350px;
    }
    .bottom-section {
        height: 240px;
        max-height: 32vh;
        padding: 0 6px 6px;
        gap: 6px;
    }
    .panel-header h2 {
        font-size: 13px;
    }
    .data-table {
        font-size: 10px;
    }
    .data-table th,
    .data-table td {
        padding: 3px 6px;
    }
    .chat-bubble {
        padding: 5px 8px;
        margin-bottom: 4px;
        font-size: 11px;
    }
    .chat-bubble .chat-agent-name {
        font-size: 10px;
    }
    .chat-bubble .chat-content {
        font-size: 11px;
    }
    .position-item {
        padding: 4px 8px;
        margin-bottom: 3px;
    }
    .pnl-timeframe-tabs .tf-tab {
        padding: 2px 6px;
        font-size: 10px;
    }
}

@media (max-height: 650px) {
    :root {
        --space-lg: 8px;
        --space-md: 4px;
        --space-sm: 2px;
    }
    body {
        font-size: 12px;
    }
    .topbar {
        height: 36px;
        padding: 0 8px;
    }
    .symbol-price-item {
        padding: 1px 4px;
        font-size: 9px;
    }
    .account-bar {
        padding: 2px 8px;
        gap: 12px;
    }
    .account-bar-item {
        min-width: 65px;
    }
    .account-bar-label {
        font-size: 8px;
    }
    .account-bar-value {
        font-size: 12px;
    }
    .agent-status-bar {
        padding: 2px 8px;
    }
    .main-content {
        padding: 4px;
        gap: 4px;
        min-height: 280px;
    }
    .bottom-section {
        height: 180px;
        max-height: 28vh;
        padding: 0 4px 4px;
        gap: 4px;
    }
    .panel-header h2 {
        font-size: 12px;
    }
    .data-table {
        font-size: 9px;
    }
    .data-table th,
    .data-table td {
        padding: 2px 4px;
    }
    .chat-bubble {
        padding: 4px 6px;
        margin-bottom: 3px;
        font-size: 10px;
    }
    .chat-bubble .chat-agent-name {
        font-size: 9px;
    }
    .chat-bubble .chat-content {
        font-size: 10px;
    }
    .position-item {
        padding: 3px 6px;
        margin-bottom: 2px;
    }
    .pnl-timeframe-tabs .tf-tab {
        padding: 1px 5px;
        font-size: 9px;
    }
}

@media (max-width: 1400px) {
    .bottom-section {
        grid-template-columns: 240px 1fr 1fr;
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 2fr 1fr;
    }
    
    .bottom-section {
        grid-template-columns: 1fr 1fr;
        height: auto;
    }
    
    .panel-rankings {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }
    .panel-team-chart {
        grid-column: auto;
    }
    
    .column-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .column-sidebar .panel {
        flex: 1;
        min-width: 250px;
    }
    
    .bottom-section {
        grid-template-columns: 1fr;
    }
    
    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding: var(--space-md);
    }
    
    .topbar-center {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: var(--space-md);
    }
}

/* === Animations (minimal for performance) === */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.panel {
    animation: fade-in 200ms ease;
}

/* === Utility Classes === */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* === Team Selector === */
.team-select {
    padding: 4px 10px;
    font-size: 11px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    margin-left: var(--space-sm);
    min-width: 120px;
}

.team-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* === Teams Management === */
.teams-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.teams-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.team-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    transition: all var(--transition-fast);
}

.team-card:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

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

.team-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.team-card-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-surface);
}

.team-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
}

.team-status-dot.active {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(63, 185, 80, 0.5);
}

.team-status-dot.inactive {
    background: var(--text-muted);
}

.team-card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.team-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-sm);
    background: var(--bg-surface);
}

.team-stat-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.team-stat-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 12px;
}

.team-stat-value.positive {
    color: var(--accent-green);
}

.team-stat-value.negative {
    color: var(--accent-red);
}

.team-card-actions {
    display: flex;
    gap: var(--space-xs);
    justify-content: flex-end;
}

.team-card-actions button {
    padding: 4px 10px;
    font-size: 11px;
}

.teams-summary {
    margin-top: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

@media (max-width: 600px) {
    .team-card-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Leaderboard === */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.leaderboard-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.leaderboard-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.leaderboard-table tr:hover {
    background: var(--bg-elevated);
}

.leaderboard-rank {
    font-weight: 600;
    width: 40px;
}

.leaderboard-rank.gold {
    color: #ffd700;
}

.leaderboard-rank.silver {
    color: #c0c0c0;
}

.leaderboard-rank.bronze {
    color: #cd7f32;
}

/* === Trade/Decision Tabs === */
.panel-tabs {
    display: flex;
    gap: 2px;
    padding: 0 var(--space-md);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
}

.panel-tab {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.panel-tab:hover {
    color: var(--text-primary);
}

.panel-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* === Backtest Modal Styles === */

/* Compact modal for backtest */
/* Backtest content now lives inside the Settings tab-backtest panel.
   The old .modal-backtest sizing rules are no longer needed. */
.backtest-modal-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Live Status Indicator */
.live-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    align-self: flex-end;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #888;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.running {
    background: #00ff9d;
    box-shadow: 0 0 8px rgba(0, 255, 157, 0.6);
}

.status-dot.paused {
    background: #f0ad4e;
    box-shadow: 0 0 8px rgba(240, 173, 78, 0.6);
    animation: none;
}

.status-dot.stopped {
    background: #888;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.live-status-text {
    color: var(--text-secondary);
}

.live-status-text.running {
    color: #00ff9d;
}

.live-status-text.paused {
    color: #f0ad4e;
}

/* Backtest Form */
.backtest-form {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.form-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

/* Backtest config row (Start/End/Capital/Step) */
.backtest-config-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: flex-end;
}

.backtest-config-field {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.backtest-config-field label {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.backtest-input {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.backtest-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

@media (max-width: 600px) {
    .backtest-config-field {
        min-width: 100%;
    }
}

/* Note: .form-group base styles defined earlier (see "=== Form Controls ===" section).
   The duplicate below used undefined vars (--bg-secondary, --panel-border) and was
   removed to prevent it from overriding the correct definitions. */

/* Run/Stop Buttons */
.run-btn {
    background: linear-gradient(135deg, var(--accent-blue), #8b5cf6);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.run-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.run-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.stop-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.stop-btn.visible {
    display: inline-flex !important;
}

.stop-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(220, 53, 69, 0.5);
}

.stop-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Progress Section */
.progress-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    display: none;
}

.progress-section.active {
    display: block;
}

.progress-bar-container {
    background: var(--bg-surface);
    border-radius: 10px;
    height: 16px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #8b5cf6);
    border-radius: 10px;
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Realtime Metrics */
.realtime-metrics {
    background: rgba(0, 153, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.realtime-metrics .metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.realtime-metrics .metric-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.realtime-metrics .metric-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.realtime-metrics .metric-value.positive {
    color: #10b981 !important;
}

.realtime-metrics .metric-value.negative {
    color: #ef4444 !important;
}

/* Live Charts */
.live-chart-container,
.live-trades-container {
    background: rgba(0, 153, 255, 0.03);
    border: 1px solid rgba(0, 153, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    display: none;
}

.live-chart-container {
    height: 220px;
    position: relative;
}

.live-chart-container canvas {
    max-height: 180px !important;
    width: 100% !important;
}

#liveDrawdownContainer {
    background: rgba(255, 68, 68, 0.03);
    border: 1px solid rgba(255, 68, 68, 0.1);
}

.live-chart-container h4,
.live-trades-container h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Results Section */
.results-section {
    display: none;
    margin-top: 20px;
}

.results-section.active {
    display: block;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px;
}

.metric-card h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.metric-item:last-child {
    border-bottom: none;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.metric-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.metric-value.positive {
    color: var(--accent-green);
}

.metric-value.negative {
    color: var(--accent-red);
}

/* Charts */
.chart-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.chart-card h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.chart-wrapper {
    position: relative;
    height: 250px;
}

/* Trades Table */
.trades-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
}

.trades-card h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.trades-table th {
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 8px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 2px solid var(--border-subtle);
}

.trades-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.trades-table tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

.side-long {
    color: var(--accent-green);
    font-weight: 600;
}

.side-short {
    color: var(--accent-red);
    font-weight: 600;
}

.trade-long {
    color: var(--accent-green);
    font-weight: 600;
}

.trade-short {
    color: var(--accent-red);
    font-weight: 600;
}

/* History Section */
.history-section {
    margin-top: 20px;
}

.history-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-list {
    display: grid;
    gap: 12px;
}

.history-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.history-item:hover {
    border-color: var(--accent-blue);
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.history-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info .symbol {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.history-info .run-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-detail-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.history-info .period {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-info .config {
    font-size: 0.75rem;
    color: var(--accent-blue);
}

.history-stats {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    margin-top: 6px;
}

.history-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 60px;
    text-align: center;
}

.history-stat .label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-stat .value {
    font-weight: 700;
    font-size: 0.9rem;
}

.history-stat .value.positive {
    color: var(--accent-green);
}

.history-stat .value.negative {
    color: var(--accent-red);
}

/* Quick Select Buttons */
.quick-btn {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}

/* Symbol Checkboxes */
.symbol-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.symbol-checkbox:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.symbol-checkbox input:checked+span,
.symbol-checkbox:has(input:checked) {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-blue);
}

.symbol-checkbox.major:has(input:checked) {
    background: rgba(255, 193, 7, 0.15);
    border-color: #ffc107;
}

.symbol-checkbox.ai500:has(input:checked) {
    background: rgba(0, 255, 157, 0.15);
    border-color: #00ff9d;
}

.symbol-checkbox.alts:has(input:checked) {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
}

/* Tab Navigation */
.backtest-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--bg-surface);
    border-radius: 8px;
}

.backtest-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
}

.backtest-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.backtest-tab.active {
    color: var(--text-primary);
    background: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
}

.backtest-tab .tab-status {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

.backtest-tab.active .tab-status {
    background: rgba(255, 255, 255, 0.2);
}

.backtest-tab .tab-status.running {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
    animation: pulse 2s ease-in-out infinite;
}

.backtest-tab .tab-status.completed {
    background: rgba(63, 185, 80, 0.3);
    color: var(--accent-green);
}

.backtest-tab .tab-close {
    font-size: 0.9rem;
    opacity: 0.5;
    margin-left: 4px;
    padding: 2px 4px;
    border-radius: 4px;
}

.backtest-tab .tab-close:hover {
    opacity: 1;
    background: rgba(255, 71, 87, 0.2);
    color: var(--accent-red);
}

.add-tab-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px dashed var(--text-secondary);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 4px;
    transition: all 0.2s;
}

.add-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === SVG Icon System === */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
}

.icon-sm {
    width: 14px;
    height: 14px;
}

.icon-md {
    width: 18px;
    height: 18px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

.icon-xl {
    width: 32px;
    height: 32px;
}

/* Icon color variants */
.icon-success {
    color: var(--accent-green);
}

.icon-danger {
    color: var(--accent-red);
}

.icon-warning {
    color: var(--accent-yellow);
}

.icon-info {
    color: var(--accent-blue);
}

.icon-muted {
    color: var(--text-secondary);
}

/* Icon in buttons */
button .icon,
.btn .icon {
    margin-right: 0.25em;
}

/* Icon in nav */
.topbar .icon {
    vertical-align: middle;
}

/* Icon animation */
@keyframes icon-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.icon-spin {
    animation: icon-spin 1s linear infinite;
}

@keyframes icon-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.icon-pulse {
    animation: icon-pulse 2s ease-in-out infinite;
}

/* === Account Bar (Horizontal) === */
.account-bar {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(180deg, rgba(12, 18, 32, 0.9), rgba(6, 9, 18, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    flex-shrink: 0;
}

.account-bar-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 100px;
}

.account-bar-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
}

.account-bar-value {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    text-shadow: 0 0 12px rgba(214, 228, 255, 0.1);
}

.account-bar-value.neutral {
    color: var(--text-secondary);
}

.account-bar-value.positive {
    color: var(--accent-green);
    text-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

.account-bar-value.negative {
    color: var(--accent-red);
    text-shadow: 0 0 12px rgba(251, 113, 133, 0.25);
}

/* === Chatroom Team Tabs === */
.chatroom-tabs {
    display: flex;
    gap: 2px;
    padding: 0 var(--space-md);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
}

.chatroom-tabs::-webkit-scrollbar {
    height: 4px;
}

.chatroom-tabs::-webkit-scrollbar-track {
    background: var(--bg-elevated);
}

.chatroom-tabs::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.2), rgba(251, 191, 36, 0.15));
    border-radius: 2px;
}

.chatroom-tab {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatroom-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.chatroom-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.chatroom-tab .tab-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chatroom-tab .tab-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    flex-shrink: 0;
}

.chatroom-tab .tab-indicator.inactive {
    background: var(--text-muted);
}

/* === Right Panel with Tabs === */
.panel-right {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.right-panel-tabs {
    display: flex;
    gap: 2px;
    padding: 0 var(--space-md);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.right-tab {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.right-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.right-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.right-tab .count-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    border-radius: 10px;
    font-weight: 600;
}

.right-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.right-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* === Bottom Tab Content (merged Rankings/Decisions/Positions panel) === */
.bottom-tab-content {
    display: none;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
}

.bottom-tab-content.active {
    display: block !important;
}

/* === Adjust Bottom Section to 2 columns === */
.bottom-section {
    grid-template-columns: 1fr 1fr;
}

/* Remove old sidebar styles */
.column-sidebar {
    display: none;
}

/* === Responsive Adjustments === */
@media (max-width: 1400px) {
    .account-bar {
        gap: var(--space-lg);
    }
    
    .account-bar-item {
        min-width: 80px;
    }
    
    .account-bar-value {
        font-size: 14px;
    }
}

@media (max-width: 1200px) {
    .bottom-section {
        grid-template-columns: 1fr;
        max-height: none;
    }
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .account-bar {
        flex-wrap: wrap;
        gap: var(--space-md);
    }
    
    .account-bar-item {
        flex: 1 1 calc(33.33% - var(--space-md));
        min-width: 100px;
    }
}

/* === Agent Config in Settings === */
.agent-config-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    min-height: 420px;
}

.agent-config-tabs {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    padding: var(--space-sm);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.agent-config-tab {
    padding: var(--space-sm) var(--space-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-config-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-default);
}

.agent-config-tab.active {
    color: var(--accent-blue);
    background: var(--accent-blue-dim);
    border-color: var(--accent-blue);
}

.agent-config-tab.is-disabled {
    opacity: 0.55;
}

.agent-tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    transition: background var(--transition-fast);
}

.agent-tab-dot.on {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(63, 185, 80, 0.5);
}

.agent-tab-label {
    font-size: 12px;
}

.agent-config-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: calc(-1 * var(--space-xs)) 0 var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-left: 2px solid var(--accent-blue);
    border-radius: var(--radius-sm);
}

.agent-config-count {
    margin-left: var(--space-xs);
    padding: 1px 7px;
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.agent-config-panel {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    max-height: 52vh;
}

.agent-config-section {
    margin-bottom: var(--space-lg);
}

.agent-config-section:last-child {
    margin-bottom: 0;
}

.agent-config-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.agent-config-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.agent-config-row:last-child {
    border-bottom: none;
}

.agent-config-row-params,
.agent-config-row-prompt {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
}

.agent-config-row-params > label,
.agent-config-row-prompt > label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-config-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    margin-bottom: var(--space-md);
}

.agent-config-toggle-row label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.agent-config-toggle-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

.agent-config-panel textarea[data-field="system_prompt"] {
    width: 100%;
    min-height: 140px;
    max-height: 220px;
    padding: var(--space-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    resize: vertical;
    line-height: 1.5;
}

.agent-config-panel textarea[data-field="system_prompt"]:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.agent-config-param-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm) var(--space-md);
    margin-top: var(--space-xs);
}

.agent-config-param-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.agent-config-param-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agent-config-param-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.agent-config-param-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-blue);
    font-family: var(--font-mono);
}

.agent-config-param-controls {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.agent-config-param-controls input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.agent-config-param-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
}

.agent-config-param-controls input[type="number"] {
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.agent-config-param-controls input[type="number"]:focus,
.agent-config-param-item input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.agent-config-param-item input[type="text"] {
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.agent-config-param-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

.agent-config-param-inline {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.agent-config-param-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: var(--space-lg);
    grid-column: 1 / -1;
}

.agent-config-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

@media (max-width: 720px) {
    .agent-config-param-list {
        grid-template-columns: 1fr;
    }
}

/* Toast notification */
#agent-config-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#agent-config-toast.success {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

#agent-config-toast.error {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

#agent-config-toast.info {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* === LLM Info Bar in Settings === */
.llm-info-bar {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), rgba(251, 191, 36, 0.05), transparent 70%);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    align-items: center;
}

.llm-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 100px;
}

.llm-info-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.llm-info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.llm-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* === AIF Logo === */
.logo-image {
    height: 32px;
    width: auto;
    display: block;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* === Team Performance Cards === */
.team-performance-cards {
    display: flex;
    gap: var(--space-sm);
    margin-left: auto;
    padding-left: var(--space-lg);
    border-left: 1px solid var(--border-subtle);
    overflow-x: auto;
}

.team-performance-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    min-width: 90px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.team-performance-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
}

.team-performance-card.active {
    border-color: var(--accent-blue);
    background: var(--accent-blue-dim);
}

.team-card-name {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.team-card-values {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.team-pnl {
    font-family: var(--font-mono);
    font-weight: 700;
    white-space: nowrap;
}

.team-pnl.large {
    font-size: 14px;
}

.team-pct {
    font-family: var(--font-mono);
    font-weight: 600;
    white-space: nowrap;
}

.team-pct.small {
    font-size: 10px;
}

/* Color states */
.team-pnl.positive,
.team-pct.positive {
    color: var(--accent-green);
}

.team-pnl.negative,
.team-pct.negative {
    color: var(--accent-red);
}

.team-pnl.neutral,
.team-pct.neutral {
    color: var(--text-secondary);
}

/* === Trading Tab in Settings === */
.trading-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.trading-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.trading-field-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.form-control-sm {
    width: auto;
    min-width: 140px;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.form-control-sm:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.mode-toggle-inline {
    display: inline-flex;
    gap: var(--space-xs);
    padding: 3px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.mode-toggle-inline .mode-btn {
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.mode-toggle-inline .mode-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.mode-toggle-inline .mode-btn.active {
    background: var(--grad-cyan);
    color: #060912;
    box-shadow: 0 0 12px var(--accent-blue-glow);
}

.control-buttons-inline {
    display: inline-flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.control-buttons-inline .ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    height: auto;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(6, 9, 18, 0.5);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
}

.control-buttons-inline .ctrl-btn:hover {
    transform: translateY(-1px);
}

.control-buttons-inline .ctrl-start {
    border-color: rgba(52, 211, 153, 0.4);
    color: var(--accent-green);
}

.control-buttons-inline .ctrl-start:hover {
    background: var(--accent-green-dim);
    box-shadow: 0 0 16px rgba(52, 211, 153, 0.15);
}

.control-buttons-inline .ctrl-pause {
    border-color: rgba(251, 191, 36, 0.4);
    color: var(--accent-yellow);
}

.control-buttons-inline .ctrl-pause:hover {
    background: var(--accent-yellow-dim);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.12);
}

.control-buttons-inline .ctrl-stop {
    border-color: rgba(251, 113, 133, 0.4);
    color: var(--accent-red);
}

.control-buttons-inline .ctrl-stop:hover {
    background: var(--accent-red-dim);
}

.trading-status-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-subtle);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-md) var(--space-sm);
    background: var(--bg-elevated);
    min-width: 0;
}

.status-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-value {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .trading-status-info {
        grid-template-columns: repeat(2, 1fr);
    }
    .trading-field {
        justify-content: flex-start;
    }
}

/* Remove old topbar controls styles */
.topbar .mode-toggle,
.topbar .controls,
.topbar .interval-select,
.topbar .status-pills {
    display: none;
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
    /* Allow page to scroll on mobile */
    body {
        overflow: auto;
        min-height: 100vh;
        height: auto;
    }

    /* Global smaller fonts but more spacing between panels */
    :root {
        --space-lg: 10px;
        --space-md: 6px;
        --space-sm: 3px;
    }
    body {
        font-size: 12px;
    }

    /* Topbar: compact */
    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 6px 10px;
        gap: 6px;
    }
    .topbar-center {
        order: 3;
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }
    .symbol-prices {
        gap: 3px;
    }
    .symbol-price-item {
        padding: 2px 5px;
        font-size: 9px;
    }
    .symbol-price-item .coin-icon {
        width: 11px;
        height: 11px;
    }
    .symbol-price-item .symbol-name {
        font-size: 8px;
    }

    /* Account bar: compact + scroll */
    .account-bar {
        overflow-x: auto;
        gap: 10px;
        padding: 5px 10px;
        margin-bottom: 2px;
    }
    .account-bar-item {
        min-width: 65px;
        flex-shrink: 0;
    }
    .account-bar-label {
        font-size: 8px;
    }
    .account-bar-value {
        font-size: 12px;
    }

    /* Agent status bar: force strictly horizontal, scrollable */
    .agent-status-bar {
        overflow-x: auto;
        overflow-y: hidden;
        gap: 3px;
        padding: 3px 10px;
        margin-bottom: 4px;
        white-space: nowrap;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }
    .agent-status-bar .agent-status-group {
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        flex-shrink: 0;
        align-items: center;
    }
    .agent-status-bar .agent-status-label {
        white-space: nowrap !important;
        font-size: 8px;
        flex-shrink: 0;
    }
    .agent-status-bar .agent-status-dot {
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        flex-shrink: 0;
        align-items: center;
    }
    .agent-status-bar .dot-label {
        white-space: nowrap !important;
        font-size: 9px;
        flex-shrink: 0;
    }
    .agent-status-bar .agent-badge {
        font-size: 6px;
        padding: 1px 3px;
        white-space: nowrap !important;
        flex-shrink: 0;
    }
    .agent-status-bar .agent-status-sep {
        flex-shrink: 0;
        white-space: nowrap !important;
    }

    /* Main content: single column, auto height, scrollable */
    .main-content {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 14px;
        flex: 0 0 auto;
        overflow: visible;
        height: auto;
        min-height: 0;
    }
    .main-content > .panel {
        min-height: 180px;
        height: auto;
        overflow: visible;
        margin-bottom: 4px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding-bottom: 8px;
    }

    /* PnL chart: taller on mobile */
    .main-content > .panel.panel-team-chart {
        min-height: 300px;
        height: 300px;
    }
    .team-pnl-chart-wrapper {
        min-height: 200px;
    }
    /* Chart legend: single line, scrollable on mobile */
    .team-pnl-chart-wrapper canvas {
        max-width: 100%;
    }

    /* Chatroom: 1.5x taller on mobile */
    .main-content > .panel.panel-chatroom {
        min-height: 525px;
        height: 525px;
    }
    .panel-chatroom .chatroom-container {
        flex: 1 1 0;
        min-height: 0;
    }
    .panel-chatroom .chatroom-messages {
        flex: 1 1 0;
        min-height: 400px;
        overflow-y: auto;
    }
    .chatroom-messages {
        overflow-y: auto;
    }

    /* Bottom section: single column, auto height */
    .bottom-section {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        padding: 0 10px 10px;
        gap: 14px;
        flex-shrink: 0;
    }
    .panel-rankings,
    .panel-trades {
        min-height: 180px;
        max-height: 300px;
        overflow: hidden;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding-bottom: 4px;
    }

    /* Tables: smaller */
    .data-table {
        font-size: 9px;
    }
    .data-table th,
    .data-table td {
        padding: 3px 5px;
    }

    /* Chatroom tabs: scrollable */
    .chatroom-tabs {
        overflow-x: auto;
        gap: 3px;
    }
    .chatroom-tab {
        padding: 3px 7px;
        font-size: 9px;
        white-space: nowrap;
    }

    /* Chat bubbles: compact */
    .chat-bubble {
        padding: 5px 8px;
        margin-bottom: 4px;
        font-size: 10px;
    }
    .chat-bubble .chat-agent-name {
        font-size: 9px;
    }
    .chat-bubble .chat-content {
        font-size: 10px;
    }

    /* Position cards: compact */
    .position-item {
        padding: 3px 6px;
        margin-bottom: 3px;
    }
    .position-details {
        gap: 6px;
        font-size: 8px;
    }

    /* Modal: full width */
    .modal-content {
        width: 96vw;
        max-width: 96vw;
        max-height: 92vh;
    }
    .modal-content.modal-xlarge {
        width: 96vw;
        max-width: 96vw;
    }

    /* Settings tabs: scrollable */
    .settings-tabs {
        overflow-x: auto;
        gap: 2px;
    }
    .settings-tab {
        padding: 5px 8px;
        font-size: 10px;
        white-space: nowrap;
    }

    /* Form controls: full width */
    .form-control {
        width: 100%;
        font-size: 12px;
    }
    .form-control-sm {
        width: 100%;
        min-width: 0;
        font-size: 11px;
    }

    /* Demo team rows: stack vertically */
    .demo-team-row {
        flex-direction: column !important;
        gap: 3px !important;
    }
    .demo-team-row .form-group {
        min-width: 100% !important;
    }

    /* PnL timeframe tabs: smaller */
    .pnl-timeframe-tabs .tf-tab {
        padding: 2px 5px;
        font-size: 9px;
    }

    /* Team performance cards: smaller on mobile */
    .team-performance-cards {
        gap: 3px;
        padding-left: 6px;
    }
    .team-performance-card {
        min-width: 65px;
        padding: 2px 4px;
        gap: 1px;
    }
    .team-card-name {
        font-size: 7px;
        max-width: 60px;
    }
    .team-pnl.large {
        font-size: 10px;
    }
    .team-pct.small {
        font-size: 8px;
    }

    /* Panel headers: smaller + clear separation */
    .panel-header {
        padding: 8px 10px;
        border-bottom: 1px solid var(--border-subtle);
        margin-bottom: 4px;
    }
    .panel-header h2 {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    body {
        font-size: 11px;
    }
    .topbar-center {
        display: none;
    }
    .account-bar {
        gap: 6px;
        padding: 3px 8px;
    }
    .account-bar-item {
        min-width: 55px;
    }
    .account-bar-value {
        font-size: 11px;
    }
    .account-bar-label {
        font-size: 7px;
    }
    .panel-header h2 {
        font-size: 11px;
    }
    .chat-bubble {
        padding: 4px 6px;
        font-size: 9px;
    }
    .chat-bubble .chat-agent-name {
        font-size: 8px;
    }
    .chat-bubble .chat-content {
        font-size: 9px;
    }
    .data-table {
        font-size: 8px;
    }
    .data-table th,
    .data-table td {
        padding: 2px 4px;
    }
    .position-details {
        font-size: 7px;
    }
    .pnl-timeframe-tabs .tf-tab {
        padding: 1px 4px;
        font-size: 8px;
    }
    .symbol-price-item {
        padding: 1px 3px;
        font-size: 8px;
    }
    .team-performance-card {
        min-width: 55px;
        padding: 1px 3px;
    }
    .team-card-name {
        font-size: 6px;
        max-width: 50px;
    }
    .team-pnl.large {
        font-size: 9px;
    }
    .team-pct.small {
        font-size: 7px;
    }
}
