/* === Session Bridge v4 === */

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

:root {
    --bg-base: #050a09;
    --bg-primary: #0a1210;
    --bg-secondary: #0f1a17;
    --bg-card: rgba(16, 32, 28, 0.6);
    --bg-card-solid: #10201c;
    --bg-elevated: rgba(20, 45, 38, 0.4);
    --glass-bg: rgba(16, 42, 36, 0.5);
    --glass-border: rgba(52, 211, 153, 0.15);
    --glass-blur: 12px;
    --border-subtle: rgba(52, 211, 153, 0.1);
    --border-default: rgba(52, 211, 153, 0.2);
    --border-prominent: rgba(52, 211, 153, 0.3);
    --text-primary: #f0fdf9;
    --text-secondary: #a7c7c0;
    --text-muted: #5f8a80;
    --text-dimmed: #3d5a54;
    --accent-primary: #34d399;
    --accent-secondary: #10b981;
    --accent-tertiary: #059669;
    --accent-glow: rgba(52, 211, 153, 0.4);
    --accent-subtle: rgba(52, 211, 153, 0.1);
    --positive: #34d399;
    --positive-glow: rgba(52, 211, 153, 0.3);
    --negative: #f87171;
    --negative-glow: rgba(248, 113, 113, 0.3);
    --warning: #fbbf24;
    --warning-glow: rgba(251, 191, 36, 0.3);
    --extreme: #ef4444;
    --extreme-glow: rgba(239, 68, 68, 0.4);
    --gradient-primary: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
    --chart-height: 280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--accent-glow);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-base) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: linear-gradient(rgba(52, 211, 153, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(52, 211, 153, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.app-container { position: relative; z-index: 1; max-width: 1440px; margin: 0 auto; padding: 2rem; }
.mono { font-family: 'JetBrains Mono', monospace; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; }

/* --- Header --- */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 200px; height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.logo { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 0.5rem; }
.logo-svg { width: 48px; height: 48px; filter: drop-shadow(0 0 8px var(--accent-glow)); }
.logo h1 { font-size: 1.75rem; font-weight: 700; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.tagline { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1rem; }
.header-meta { display: flex; justify-content: center; gap: 2rem; font-size: 0.8rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* --- Session Timeline --- */
.session-timeline { margin-bottom: 1.5rem; padding: 1.5rem; background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); }
.timeline-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.timeline-title { font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.timeline-clock { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; color: var(--accent-primary); }
.timeline-track { position: relative; height: 48px; background: var(--bg-secondary); border-radius: var(--radius-md); overflow: hidden; }
.timeline-sessions { display: flex; height: 100%; position: relative; }
.timeline-session { display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 0.5rem; border-right: 1px solid var(--border-subtle); transition: background var(--transition-normal); }
.timeline-session:last-child { border-right: none; }
.timeline-session.tokyo { flex: 8; background: rgba(52, 211, 153, 0.05); }
.timeline-session.europe { flex: 8; background: rgba(59, 130, 246, 0.05); }
.timeline-session.us { flex: 8; background: rgba(168, 85, 247, 0.05); }
.timeline-session.active { background: var(--accent-subtle); box-shadow: inset 0 0 20px var(--accent-glow); }
.timeline-session-name { font-size: 0.7rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.timeline-session-hours { font-family: 'JetBrains Mono', monospace; font-size: 0.65rem; color: var(--text-muted); }
.timeline-marker { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--accent-primary); box-shadow: 0 0 12px var(--accent-glow), 0 0 24px var(--accent-glow); z-index: 10; transition: left var(--transition-slow); }
.timeline-marker::before { content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; background: var(--accent-primary); border-radius: 50%; box-shadow: 0 0 12px var(--accent-glow); animation: pulse-glow 2s ease-in-out infinite; }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 8px var(--accent-glow); } 50% { box-shadow: 0 0 20px var(--accent-glow), 0 0 30px var(--accent-glow); } }

/* --- Main Tabs (Live / Historical) --- */
.main-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
}

.main-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.main-tab:hover { color: var(--text-secondary); background: rgba(52, 211, 153, 0.05); }
.main-tab.active { background: var(--accent-subtle); color: var(--accent-primary); box-shadow: 0 0 16px var(--accent-glow); }

.main-tab-content { display: none; }
.main-tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Alert Banner --- */
.alert-banner { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); border-radius: var(--radius-lg); padding: 1rem 1.5rem; margin-bottom: 1.5rem; display: none; }
.alert-banner.active { display: block; animation: slideDown 0.3s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.alert-banner.extreme { background: rgba(239, 68, 68, 0.2); border-color: var(--extreme); }
.alert-banner.high { background: rgba(251, 191, 36, 0.15); border-color: var(--warning); }
.alert-content { display: flex; justify-content: space-between; align-items: center; }
.alert-message { color: var(--text-primary); font-weight: 600; font-size: 0.95rem; }
.alert-cta { color: var(--text-muted); font-size: 0.75rem; }

/* --- Controls --- */
.controls {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: end;
}

.control-group { display: flex; flex-direction: column; flex: 1; }
.control-group label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.control-group select, .control-group input { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 0.75rem; color: var(--text-primary); font-size: 0.85rem; transition: all var(--transition-fast); }
.control-group select:focus, .control-group input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-subtle); }

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px var(--accent-glow);
    margin-left: auto;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }

.date-input { font-family: 'JetBrains Mono', monospace; }

.preset-buttons { display: flex; gap: 0.5rem; }
.preset-btn { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 0.5rem 1rem; color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.preset-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.preset-btn.active { background: var(--accent-subtle); border-color: var(--accent-primary); color: var(--accent-primary); box-shadow: 0 0 8px var(--accent-glow); }

/* --- Metrics Grid --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-normal);
}

.metric-card:hover { border-color: var(--border-prominent); transform: translateY(-2px); }
.metric-card.highlight { border-color: var(--accent-primary); box-shadow: 0 0 20px var(--accent-glow); }
.metric-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; }
.metric-value { font-family: 'JetBrains Mono', monospace; font-size: 1.75rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.metric-value.positive { color: var(--positive); text-shadow: 0 0 12px var(--positive-glow); }
.metric-value.negative { color: var(--negative); text-shadow: 0 0 12px var(--negative-glow); }
.metric-value.warning { color: var(--warning); text-shadow: 0 0 12px var(--warning-glow); }
.metric-value.extreme { color: var(--extreme); text-shadow: 0 0 12px var(--extreme-glow); }
.metric-sub { font-size: 0.75rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* --- Charts --- */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-header h2 { font-size: 1rem; font-weight: 600; }
.section-badge { padding: 0.25rem 0.75rem; background: var(--accent-subtle); color: var(--accent-primary); border-radius: 12px; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; }
.section-desc { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }

.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-bottom: 1.5rem; }
.chart-container { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 1.5rem; }
.chart-container.full-width { grid-column: 1 / -1; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-subtle); }
.chart-title { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.chart-price { font-family: 'JetBrains Mono', monospace; font-size: 1rem; font-weight: 700; color: var(--accent-primary); }
.chart-stats { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-muted); }
.chart { height: var(--chart-height); position: relative; }
.chart-large { height: 400px; }

/* --- Divergence Section --- */
.divergence-section { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.divergence-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.divergence-status { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; padding: 1rem; background: var(--bg-secondary); border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.divergence-level { padding: 0.5rem 1rem; border-radius: var(--radius-md); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.divergence-level.extreme { background: rgba(239, 68, 68, 0.2); color: var(--extreme); border: 1px solid var(--extreme); }
.divergence-level.high { background: rgba(251, 191, 36, 0.2); color: var(--warning); border: 1px solid var(--warning); }
.divergence-level.moderate { background: rgba(52, 211, 153, 0.2); color: var(--accent-primary); border: 1px solid var(--accent-primary); }
.divergence-level.normal { background: var(--accent-subtle); color: var(--accent-primary); border: 1px solid var(--border-prominent); }
.divergence-message { flex: 1; font-size: 0.9rem; color: var(--text-primary); }

.trade-suggestion { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 1.5rem; }
.suggestion-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-subtle); }
.suggestion-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.suggestion-confidence { padding: 0.25rem 0.65rem; border-radius: 12px; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; }
.suggestion-confidence.high { background: rgba(52, 211, 153, 0.2); color: var(--positive); }
.suggestion-confidence.medium { background: rgba(251, 191, 36, 0.2); color: var(--warning); }
.suggestion-body { display: flex; flex-direction: column; gap: 0.75rem; }
.suggestion-trade { display: flex; justify-content: space-between; padding: 0.5rem; background: var(--bg-secondary); border-radius: var(--radius-sm); }
.trade-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.trade-value { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; font-weight: 700; }
.trade-value.positive { color: var(--positive); }
.trade-value.negative { color: var(--negative); }
.suggestion-meta p { font-size: 0.75rem; color: var(--text-secondary); margin: 0.25rem 0; }
.rationale { font-weight: 600; color: var(--text-primary); }
.stats { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.risk-note { color: var(--warning); font-style: italic; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.stat-box { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 1rem; text-align: center; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.5rem; }
.stat-value { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }

/* --- Regime Tracking --- */
.regime-section { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.regime-badges { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.regime-badge { padding: 0.35rem 0.85rem; border-radius: 20px; font-size: 0.7rem; font-weight: 600; background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border-subtle); transition: all var(--transition-normal); }
.regime-badge.active { border-color: currentColor; box-shadow: 0 0 12px currentColor; }
.regime-badge[data-regime="high"] { color: var(--positive); }
.regime-badge[data-regime="medium"] { color: #4ade80; }
.regime-badge[data-regime="low"] { color: var(--warning); }
.regime-badge[data-regime="decoupling"] { color: #fb923c; }
.regime-badge[data-regime="negative"] { color: var(--negative); }
.threshold-legend { display: flex; gap: 1rem; margin-bottom: 1rem; }
.threshold-item { padding: 0.35rem 0.85rem; border-radius: 20px; font-size: 0.7rem; font-weight: 600; }
.threshold-item.extreme { background: rgba(239, 68, 68, 0.15); color: var(--extreme); border: 1px solid rgba(239, 68, 68, 0.3); }
.threshold-item.high { background: rgba(251, 191, 36, 0.15); color: var(--warning); border: 1px solid rgba(251, 191, 36, 0.3); }
.threshold-item.moderate { background: rgba(52, 211, 153, 0.15); color: var(--accent-primary); border: 1px solid rgba(52, 211, 153, 0.3); }

/* --- Session Stats & Heatmaps --- */
.session-section { margin-bottom: 2rem; }
.session-section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.session-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.session-card { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 1rem; text-align: center; transition: all var(--transition-normal); }
.session-card:hover { border-color: var(--border-prominent); transform: translateY(-2px); }
.session-name { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.session-corr { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; font-weight: 700; }
.session-samples { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; font-family: 'JetBrains Mono', monospace; }
.heatmap-section { margin-bottom: 2rem; }
.heatmap-section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.heatmap, .volume-heatmap { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1rem; }
.heatmap-cell, .volume-cell { aspect-ratio: 1; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; font-weight: 600; color: rgba(255, 255, 255, 0.9); cursor: default; transition: transform var(--transition-fast); }
.heatmap-cell:hover, .volume-cell:hover { transform: scale(1.1); }
.heatmap-cell.high, .volume-cell.very-high { background: var(--positive); box-shadow: 0 0 8px var(--positive-glow); }
.heatmap-cell.medium-high, .volume-cell.high { background: #4ade80; }
.heatmap-cell.medium, .volume-cell.medium { background: #fbbf24; }
.heatmap-cell.medium-low, .volume-cell.low { background: #fb923c; }
.heatmap-cell.low, .volume-cell.very-low { background: var(--negative); }
.heatmap-cell.na { background: var(--bg-card-solid); color: var(--text-dimmed); }

/* --- Historical Section --- */
.historical-controls { background: var(--glass-bg); }
.historical-summary { margin-bottom: 2rem; }
.historical-summary h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-primary); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.summary-card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 1rem; text-align: center; }
.summary-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.summary-value { font-family: 'JetBrains Mono', monospace; font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }

/* --- Events Table --- */
.events-table-section { margin-bottom: 2rem; }
.events-table-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.events-table-container { overflow-x: auto; background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.events-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.events-table th, .events-table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--border-subtle); }
.events-table th { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; background: var(--bg-card-solid); }
.events-table tbody tr:hover { background: var(--accent-subtle); }
.events-table td { font-family: 'JetBrains Mono', monospace; color: var(--text-secondary); }
.events-table .no-data { text-align: center; color: var(--text-muted); font-style: italic; }
.events-table .level-extreme { color: var(--extreme); font-weight: 600; }
.events-table .level-high { color: var(--warning); font-weight: 600; }
.events-table .direction-positive { color: var(--positive); }
.events-table .direction-negative { color: var(--negative); }

/* --- Session Performance Grid --- */
.session-performance { margin-bottom: 2rem; }
.session-performance h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.session-performance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.perf-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 1.25rem; }
.perf-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-subtle); }
.perf-card-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.perf-card-badge { font-size: 0.65rem; padding: 0.2rem 0.5rem; background: var(--accent-subtle); color: var(--accent-primary); border-radius: 10px; }
.perf-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.perf-stat { text-align: center; }
.perf-stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.25rem; }
.perf-stat-value { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }

/* --- Tabbed Section --- */
.tabbed-section { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.tabs-nav { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.tab-btn { flex: 1; padding: 0.75rem 1.25rem; background: transparent; border: none; border-radius: var(--radius-md); color: var(--text-muted); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--transition-normal); }
.tab-btn:hover { color: var(--text-secondary); background: rgba(52, 211, 153, 0.05); }
.tab-btn.active { background: var(--accent-subtle); color: var(--accent-primary); box-shadow: 0 0 12px var(--accent-glow); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
.session-strength { font-size: 0.7rem; color: var(--text-secondary); }

/* --- Footer --- */
.footer { text-align: center; padding: 2rem; margin-top: 2rem; border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 0.8rem; }
.footer a { color: var(--accent-primary); text-decoration: none; transition: color var(--transition-fast); }
.footer a:hover { color: var(--accent-secondary); text-decoration: underline; }
.footer-note { margin-top: 0.5rem; font-size: 0.75rem; color: var(--text-dimmed); }

/* --- Loading Overlay --- */
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(5, 10, 9, 0.95); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity var(--transition-normal); }
.loading-overlay.active { opacity: 1; pointer-events: all; }
.spinner { width: 48px; height: 48px; border: 3px solid var(--border-subtle); border-top-color: var(--accent-primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { color: var(--text-secondary); font-size: 0.9rem; }

/* --- Initial Prompt --- */
.initial-prompt {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    margin: 2rem 0;
    text-align: center;
}

.prompt-content {
    max-width: 500px;
    margin: 0 auto;
}

.prompt-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    display: block;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.prompt-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.prompt-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.prompt-btn {
    margin-top: 1rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .app-container { padding: 1rem; }
    .charts-grid { grid-template-columns: 1fr; }
    .divergence-panel { grid-template-columns: 1fr; }
    .controls { flex-direction: column; align-items: stretch; }
    .btn-primary { margin-left: 0; margin-top: 0.5rem; }
    .heatmap, .volume-heatmap { grid-template-columns: repeat(12, 1fr); }
    .header-meta { flex-direction: column; gap: 0.5rem; }
    .divergence-status { flex-direction: column; text-align: center; }
    .stats-grid { grid-template-columns: 1fr; }
    .main-tabs { flex-direction: column; }
    .tabs-nav { flex-direction: column; }
    .preset-buttons { flex-wrap: wrap; }
}
