:root {
    --bg: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --panel: #000000;
    --panel-hover: #0a0a0a;
    --panel-strong: #000000;
    --line: #333333;
    --line-strong: #666666;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --muted: #666666;
    --accent: #ffffff;
    --accent-bright: #ffffff;
    --accent-deep: #888888;
    --ink: #ffffff;
    --success: #00ff88;
    --success-dim: rgba(255, 255, 255, 0.1);
    --success-glow: transparent;
    --danger: #ff4d4d;
    --danger-dim: rgba(255, 255, 255, 0.1);
    --danger-glow: transparent;
    --warning: #ffffff;
    --warning-dim: rgba(255, 255, 255, 0.1);
    --shadow: none;
    --shadow-lg: none;
    --radius: 0px;
    --radius-sm: 0px;
    --radius-xs: 0px;
}
/* Ensure minimum legible font size and sufficient contrast for small text elements */
small,
.metric-label,
.status-chip,
.text-link,
.panel-note,
.feed-symbol,
.feed-meta {
    font-size: 0.75rem;
    color: var(--text);
}

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

body {
    min-height: 100vh;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.mesh {
    display: none;
}

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    background: var(--text);
    margin-left: 4px;
    vertical-align: middle;
    animation: blink 3s step-end infinite;
}

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

.container {
    position: relative;
    z-index: 1;
    width: min(1440px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 3rem;
}

.hero, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.hero.compact { align-items: center; }

.hero:not(.compact) {
    align-items: flex-start;
}

.hero:not(.compact) h1 {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero:not(.compact) .hero-copy-block {
    flex-direction: column;
    align-items: flex-start;
}

.hero:not(.compact) .hero-aside {
    flex-direction: column;
    align-items: flex-end;
    min-width: 230px;
}

.hero-copy-block {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-logo {
    width: 40px; height: 40px;
    border: 1px solid #fff;
    background: #000;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 800; color: #fff; flex-shrink: 0;
}

.eyebrow {
    margin-bottom: 0.25rem;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Terminal Hero Overrides */
.terminal-hero {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #333 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.75rem 0 1rem;
    margin-bottom: 1.5rem;
}

.terminal-prompt {
    color: #00ff88;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: none;
    font-size: 0.7rem;
}

.terminal-hero h1 {
    font-weight: 400;
    letter-spacing: 0.02em;
    font-size: 1rem;
    color: #fff;
}

.terminal-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
}

.terminal-status.ok { color: #00ff88; }
.terminal-status.error { color: #ff4d4d; }
.terminal-status.warn { color: #fbbf24; }

.terminal-updated {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #666;
    margin-left: 0.5rem;
}

.terminal-clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #e2e8f0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 0.35rem;
}

.hero h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    line-height: 1.2;
}

.hero-copy {
    margin-top: 0.75rem;
    max-width: 56rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
}

.hero-metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.metric-label {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.metric-value {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.hero-aside {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-metric-stack {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-chip, .table-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid #333;
    padding: 0.4rem 0.75rem;
    background: #000;
    color: #fff;
}

.status-chip::before {
    content: '';
    width: 6px; height: 6px;
    background: #fff;
    animation: pulse-dot 3s step-end infinite;
}

.status-chip.ok, .table-status.ok {
    border-color: #333;
    color: #fff;
}

.status-chip.error, .table-status.error {
    border-color: #fff;
    background: #fff;
    color: #000;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

.text-link, .panel-note {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.text-link:hover { color: var(--accent-bright); }

.metric-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.metric-card, .mini-stat {
    padding: 0.65rem 0.75rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    transition: border-color 0.2s;
}

.metric-card:hover { border-color: var(--line-strong); }

.metric-label, .metric-card .label, .mini-label {
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-value, .metric-card .value {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.metric-card .value.positive { color: var(--success); }
.metric-card .value.negative { color: var(--danger); }

.panel { padding: 1.25rem; }

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-heading h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.panel-note {
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.panel-note::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 2s ease-in-out infinite;
}

.chart-panel { margin-bottom: 1rem; }

.chart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
    gap: 1rem;
    align-items: stretch;
}

.chart-main {
    min-width: 0;
}

.insights-panel {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.insights-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    margin-bottom: 0.65rem;
}

.insights-tab {
    border: none;
    border-radius: calc(var(--radius-sm) - 4px);
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0.48rem 0.45rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.insights-tab:hover { color: var(--text-secondary); }

.insights-tab.active {
    background: #fff;
    color: #000;
}

.insights-pane {
    display: none;
    flex: 1;
    min-height: 0;
}

.insights-pane.active {
    display: block;
}

.compact-feed {
    max-height: 335px;
}

.chart-shell { height: 320px; position: relative; }
.chart-shell-large { height: 480px; }

#portfolioChart, #modelChart { width: 100%; height: 100%; overflow: hidden; }

.arena-chart-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: rgba(0, 0, 0, 0.76);
    border: 1px solid #333;
    z-index: 20;
}

.arena-chart-loading.visible {
    display: flex;
}

.arena-chart-loading-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #fff;
    letter-spacing: 0.08em;
}

.d3-chart-tooltip {
    position: absolute;
    background: #000;
    border: 1px solid #fff;
    border-radius: 0;
    padding: 10px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #e2e8f0;
    pointer-events: none;
    z-index: 100;
    min-width: 180px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.08);
    transition: opacity 0.15s ease;
}

.d3-chart-tooltip .tt-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.d3-chart-tooltip .tt-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 2px 0;
}

.d3-chart-tooltip .tt-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.d3-chart-tooltip .tt-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
}

.d3-chart-tooltip .tt-value.positive { color: var(--success); }
.d3-chart-tooltip .tt-value.negative { color: var(--danger); }

.d3-chart-tooltip .tt-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 4px 0;
}

.d3-chart-tooltip .tt-trade {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}

.d3-chart-tooltip .tt-trade.buy {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.d3-chart-tooltip .tt-trade.sell {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.d3-chart-tooltip .tt-trade .tt-trade-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.d3-chart-tooltip .tt-trade.buy .tt-trade-dot { background: var(--success); }
.d3-chart-tooltip .tt-trade.sell .tt-trade-dot { background: var(--danger); }

#portfolioChart svg {
    display: block;
    width: 100%;
    height: 100%;
}

#portfolioChart .axis text {
    fill: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

#portfolioChart .axis line,
#portfolioChart .axis path {
    stroke: rgba(255, 255, 255, 0.06);
}

#portfolioChart .y-axis-grid line {
    stroke: rgba(255, 255, 255, 0.04);
    stroke-dasharray: none;
}

#portfolioChart .trade-dot {
    stroke: #0a0e17;
    stroke-width: 1.5;
    cursor: pointer;
    transition: r 0.15s ease;
}

#portfolioChart .trade-dot:hover {
    r: 6;
    stroke-width: 2;
}

#portfolioChart .trade-dot.buy { fill: var(--success); }
#portfolioChart .trade-dot.sell { fill: var(--danger); }

#portfolioChart .current-dot {
    fill: var(--text);
    stroke: var(--bg);
    stroke-width: 2;
}

#portfolioChart .current-dot-pulse {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.5;
    opacity: 0;
    animation: d3-pulse 2s ease-in-out infinite;
}

@keyframes d3-pulse {
    0% { r: 4; opacity: 0.8; }
    100% { r: 12; opacity: 0; }
}

#portfolioChart .crosshair-v {
    stroke: rgba(148, 163, 184, 0.25);
    stroke-dasharray: 4, 3;
    stroke-width: 1;
    pointer-events: none;
}

#portfolioChart .crosshair-h {
    stroke: rgba(148, 163, 184, 0.15);
    stroke-dasharray: 4, 3;
    stroke-width: 1;
    pointer-events: none;
}

#portfolioChart .hover-dot {
    fill: var(--text);
    stroke: var(--bg);
    stroke-width: 2;
    pointer-events: none;
    transition: r 0.1s ease;
}

.brush-chart {
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.brush-chart .brush-area {
    fill: rgba(99, 102, 241, 0.08);
}

.brush-chart .brush-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1;
    opacity: 0.5;
}

.brush-chart .selection {
    fill: rgba(99, 102, 241, 0.12);
    stroke: var(--accent);
    stroke-width: 0.5;
}

.chart-price-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.chart-price-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    transition: color 0.3s;
}

.chart-price-value.up { color: var(--success); }
.chart-price-value.down { color: var(--danger); }

.chart-price-change {
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.chart-price-change.positive { color: var(--success); }
.chart-price-change.negative { color: var(--danger); }

.period-selector {
    display: flex;
    gap: 0;
    background: #000;
    border: 1px solid #333;
    padding: 0;
}

.period-btn {
    padding: 0.35rem 0.75rem;
    border: none;
    border-right: 1px solid #333;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-btn:last-child { border-right: none; }

.period-btn:hover { background: #111; color: #fff; }

.period-btn.active {
    background: #fff !important;
    color: #000 !important;
}

.period-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.arena-tabs {
    display: flex;
    gap: 0;
    background: #000;
    border: 1px solid #333;
    padding: 0;
    margin-bottom: 0.75rem;
}

.arena-tab {
    flex: 1;
    border: none;
    border-right: 1px solid #333;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.48rem 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.arena-tab:last-child { border-right: none; }

.arena-tab:hover { background: #111; color: #fff; }

.arena-tab.active {
    background: #fff !important;
    color: #000 !important;
}

.arena-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.arena-chart-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.arena-stat-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.arena-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

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

.arena-stat-value.positive { color: var(--success); }
.arena-stat-value.negative { color: var(--danger); }

.arena-stat {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-family: 'JetBrains Mono', monospace;
}

.arena-stat-label {
    color: var(--muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.arena-stat-name {
    color: var(--text-secondary);
    font-size: 0.65rem;
}

.console-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.trades-panel { grid-column: 1 / -1; }

.symbol-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-bright);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

.watch-move, .positive, .negative { font-weight: 700; }
.watch-move.positive, .positive { color: var(--success); }
.watch-move.negative, .negative { color: var(--danger); }

.mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.mini-value {
    font-size: 1.1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.operations-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.95fr);
    gap: 1rem;
}

.watchlist-panel { grid-column: 1 / -1; }

.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.watch-card {
    display: grid;
    gap: 0.5rem;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    padding: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.watch-card:hover, .watch-card.active {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.watch-card.autobuy {
    border-color: rgba(34, 197, 94, 0.3);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), var(--panel));
}

.watch-card.autosell {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), var(--panel));
}

.watch-card.ai_evaluating {
    border-color: rgba(99, 102, 241, 0.5);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.10), var(--panel));
    animation: ai-pulse 2s ease-in-out infinite;
}

@keyframes ai-pulse {
    0%, 100% { border-color: rgba(99, 102, 241, 0.5); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
    50% { border-color: rgba(99, 102, 241, 0.8); box-shadow: 0 0 12px 2px rgba(99, 102, 241, 0.2); }
}

.watch-card.surging, .watch-card.sliding { border-style: dashed; }

.refreshing .value { opacity: 0.6; transition: opacity 0.15s; }

.watch-card-top, .watch-card-bottom, .feed-item-top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
}

.watch-price {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.watch-headline, .focus-headline, .feed-item p, .empty-state {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.watch-headline { min-height: 3.9em; }
.watch-card-bottom { font-size: 0.78rem; color: var(--muted); }

.focus-panel, .feed-panel, .positions-panel, .orders-panel { min-height: 100%; }
.focus-headline { margin-bottom: 0.75rem; }

.feed-list {
    display: grid;
    gap: 0.6rem;
    max-height: 640px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
}

.feed-list::-webkit-scrollbar { width: 4px; }
.feed-list::-webkit-scrollbar-track { background: transparent; }
.feed-list::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }

.feed-item {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--line);
    border-left: 3px solid var(--muted);
    transition: border-color 0.2s, background 0.2s;
}

.feed-item:hover { background: var(--panel-hover); }

.feed-item h3 {
    margin: 0.3rem 0 0.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

.feed-symbol, .feed-meta {
    font-family: "JetBrains Mono", "IBM Plex Mono", monospace;
    font-size: 0.7rem;
}

.feed-symbol { color: var(--accent-bright); font-weight: 600; }
.feed-meta { color: var(--muted); }

.feed-item.trade { border-left-color: var(--accent); }
.feed-item.swing { border-left-color: var(--warning); }
.feed-item.news { border-left-color: var(--ink); }
.feed-item.system { border-left-color: var(--muted); }

.feed-item.ai-thought {
    border-left-color: var(--accent-bright);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), var(--bg-tertiary));
}

.feed-item.ai-failure {
    border-left-color: var(--danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), var(--bg-tertiary));
}

.feed-item.ai-failure .ai-badge {
    background: var(--danger-dim);
    color: var(--danger);
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-bright);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.confidence-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.confidence-track {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--line-strong);
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent-bright);
    transition: width 0.4s ease;
}

.confidence-fill.high { background: var(--success); }
.confidence-fill.medium { background: var(--warning); }
.confidence-fill.low { background: var(--danger); }

.confidence-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    text-align: right;
}

.rationale-text {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-top: 0.35rem;
}

.thought-meta {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.thought-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: var(--line);
    color: var(--text-secondary);
}

.thought-tag.action-hold { background: var(--success-dim); color: var(--success); }
.thought-tag.action-exit { background: var(--danger-dim); color: var(--danger); }
.thought-tag.action-reduce { background: var(--warning-dim); color: var(--warning); }

.table-shell {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th, .data-table td {
    padding: 0.65rem 0.6rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 0.82rem;
}

.data-table th {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.data-table td {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(99, 102, 241, 0.04); }

.table-status {
    padding: 0.2rem 0.45rem;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-bright);
    font-size: 0.68rem;
}

.table-status.ok { background: var(--success-dim); color: var(--success); }
.table-status.error { background: var(--danger-dim); color: var(--danger); }

.table-empty { text-align: center; color: var(--muted); padding: 1.5rem 0.6rem; }
.orders-panel { grid-column: 1 / -1; }
.system-panel { padding: 1.25rem; margin-bottom: 1rem; }

.live-dot {
    display: inline-block;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--success);
    margin-right: 0.35rem;
    animation: pulse-dot 4s ease-in-out infinite;
}

@media (max-width: 1100px) {
    .chart-layout { grid-template-columns: 1fr; }
    .console-grid { grid-template-columns: 1fr; }
    .metric-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .mini-stats, .watchlist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operations-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .container { width: min(100% - 1rem, 100%); padding-top: 0.75rem; }
    .hero, .panel { border-radius: var(--radius-sm); padding: 1rem; }
    .hero { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .hero-aside { align-items: flex-start; width: 100%; flex-wrap: wrap; gap: 0.5rem; }
    .hero-copy-block { gap: 0.75rem; }
    .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mini-stats, .watchlist-grid { grid-template-columns: 1fr; }
    .insights-tabs { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1rem; }
    .metric-value, .metric-card .value { font-size: 1rem; }
    .chart-shell-large { height: 320px; }
    .chart-price-value { font-size: 1.5rem; }
    .arena-model-grid { grid-template-columns: 1fr; }
    .terminal-hero { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 0.5rem 0 0.75rem; }
    .terminal-hero h1 { font-size: 0.9rem; }
    .terminal-prompt { font-size: 0.65rem; }
    .terminal-clock { font-size: 0.6rem; white-space: normal; }
    .panel-heading { flex-wrap: wrap; gap: 0.75rem; }
    .panel-heading h2 { font-size: 0.9rem; }
    .period-selector { flex-wrap: wrap; }
    .period-btn { min-height: 40px; padding: 0.35rem 0.65rem; font-size: 0.75rem; }
    .arena-tabs { flex-wrap: wrap; }
    .arena-tab { min-height: 40px; font-size: 0.7rem; padding: 0.45rem 0.3rem; }
    .data-table th, .data-table td { padding: 0.5rem 0.4rem; font-size: 0.78rem; }
    .data-table th { font-size: 0.65rem; }
    .arena-chart-stats { gap: 0.5rem; }
    .arena-stat-label { font-size: 0.6rem; }
    .arena-stat-name { font-size: 0.6rem; }
    .live-indicator { top: 0.75rem; right: 0.75rem; }
    .model-card-metrics { grid-template-columns: repeat(2, 1fr); }
    .model-card { padding: 0.65rem; }
    .model-name { font-size: 0.65rem; }
    .ai-timeline-feed { max-height: 350px; }
    .timeline-item { padding: 0.5rem 0; gap: 0.5rem; }
    .timeline-model { font-size: 0.75rem; }
    .timeline-symbol { font-size: 0.75rem; }
    .timeline-time { font-size: 0.6rem; }
    .timeline-rationale { font-size: 0.72rem; }
    /* Leaderboard table: hide non-essential columns on mobile */
    .leaderboard-table th:nth-child(4),
    .leaderboard-table td:nth-child(4),
    .leaderboard-table th:nth-child(5),
    .leaderboard-table td:nth-child(5),
    .leaderboard-table th:nth-child(6),
    .leaderboard-table td:nth-child(6) { display: none; }
    .table-shell { overflow-x: hidden; }
    .leaderboard-table { table-layout: fixed; }
    .leaderboard-table th:nth-child(1),
    .leaderboard-table td:nth-child(1) { width: 45px; }
    .leaderboard-table th:nth-child(2),
    .leaderboard-table td:nth-child(2) { width: auto; }
    .leaderboard-table th:nth-child(3),
    .leaderboard-table td:nth-child(3) { width: 90px; }
    .leaderboard-table th:nth-child(7),
    .leaderboard-table td:nth-child(7) { width: 80px; text-align: right; }
}

@media (max-width: 520px) {
    .model-card-metrics { grid-template-columns: 1fr; }
    .leaderboard-row, a.leaderboard-row { gap: 0.4rem; padding: 0.35rem 0.4rem; font-size: 0.72rem; }
    .leaderboard-preview { min-width: auto; padding: 0.75rem; width: 100%; }
    .arena-trade-row { gap: 0.4rem; padding: 0.4rem 0.5rem; }
    .arena-trade-prices { min-width: 4rem; font-size: 0.6rem; }
    .arena-trade-result { min-width: 4rem; }
    .arena-trade-result span { font-size: 0.7rem; }
    .arena-decision-card { padding: 0.4rem 0.5rem; }
    .arena-decision-rationale { font-size: 0.72rem; }
    .hero-stats-row { justify-content: flex-start; flex-wrap: wrap; gap: 1rem; }
    .leaderboard-table th, .leaderboard-table td { padding: 0.4rem 0.3rem; font-size: 0.72rem; }
    .leaderboard-table th:nth-child(3),
    .leaderboard-table td:nth-child(3) { width: 80px; }
    .leaderboard-table th:nth-child(7),
    .leaderboard-table td:nth-child(7) { width: 70px; }
}

/* ===== Arena Styles ===== */

#arenaChart { width: 100%; height: 100%; overflow: hidden; }

#arenaChart .arena-y-axis text,
#arenaChart .arena-x-axis text {
    fill: #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

#arenaChart .arena-y-axis line,
#arenaChart .arena-y-axis path {
    stroke: rgba(255, 255, 255, 0.15);
}

#arenaChart .arena-x-axis line {
    stroke: rgba(255, 255, 255, 0.15);
}

.arena-model-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1400px) {
    .arena-model-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .arena-model-grid {
        grid-template-columns: 1fr;
    }
}

.model-card {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
    color: inherit;
}

.model-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--model-color, var(--accent));
}

.model-card:hover {
    border-color: var(--model-color, var(--accent));
}

.model-card-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.65rem;
}

.model-card-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

.model-metric {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.model-metric .label {
    font-size: 0.55rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.model-metric .value {
    font-size: 0.75rem;
    color: var(--text);
    font-weight: 600;
}

.model-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.model-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.model-color-dot-sm {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.model-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    flex: 1;
    text-transform: uppercase;
}

.rank-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.35rem;
    border: 1px solid currentColor;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rank-badge.gold {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.rank-badge.silver {
    background: rgba(192, 192, 192, 0.15);
    color: #c0c0c0;
    border: 1px solid rgba(192, 192, 192, 0.3);
}

.rank-badge.bronze {
    background: rgba(205, 127, 50, 0.15);
    color: #cd7f32;
    border: 1px solid rgba(205, 127, 50, 0.3);
}

.model-card-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem 0.75rem;
}

.model-metric {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.model-metric .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.model-metric .value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}

.model-card-positions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.mini-positions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mini-position {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
}

.mini-pos-symbol {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
}

.mini-pos-qty {
    color: var(--text-secondary);
}

.mini-pos-pl {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.mini-pos-pl.positive { color: var(--success); }
.mini-pos-pl.negative { color: var(--danger); }

.leaderboard-panel {
    margin-bottom: 1.5rem;
}

.leaderboard-table th {
    text-align: left;
}

.rank-1 td:first-child {
    color: #ffc107;
    font-weight: 700;
}

.rank-2 td:first-child {
    color: #c0c0c0;
    font-weight: 700;
}

.rank-3 td:first-child {
    color: #cd7f32;
    font-weight: 700;
}

.model-table-name {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.empty-state {
    color: var(--muted);
    font-size: 0.8rem;
    font-style: italic;
}

.model-selector-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.model-selector {
    background: var(--bg-tertiary);
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-xs);
    cursor: pointer;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
}

.model-selector:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* ===== Arena Trade Panel ===== */

.arena-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(340px, 0.9fr);
    gap: 1rem;
    align-items: stretch;
}

.arena-chart-area { min-width: 0; }

.arena-trade-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: 1rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.arena-trade-panel.is-trades-tab::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(transparent 0%, rgba(255,255,255,0.01) 50%, transparent 100%);
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.1;
}

.arena-trade-panel.is-trades-tab::before {
    content: '';
    position: absolute;
    top: -100px; left: 0; right: 0;
    height: 100px;
    background: linear-gradient(transparent, rgba(255,255,255,0.04), transparent);
    animation: scanline 12s linear infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(800px); }
}

.arena-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 0.75rem;
}

.arena-tab {
    flex: 1;
    border: none;
    border-radius: calc(var(--radius-sm) - 4px);
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.48rem 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.arena-tab:hover { color: var(--text-secondary); }

.arena-tab.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.arena-tab-content {
    flex: 1;
    min-height: 300px;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding-bottom: 1rem; /* space for scrollbar */
}

@keyframes entry-fade-in {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-entry {
    animation: entry-fade-in 0.55s ease-out both;
}

.arena-pane.active .fade-in-entry:nth-child(1) { animation-delay: 0.02s; }
.arena-pane.active .fade-in-entry:nth-child(2) { animation-delay: 0.04s; }
.arena-pane.active .fade-in-entry:nth-child(3) { animation-delay: 0.06s; }
.arena-pane.active .fade-in-entry:nth-child(4) { animation-delay: 0.08s; }
.arena-pane.active .fade-in-entry:nth-child(5) { animation-delay: 0.10s; }
.arena-pane.active .fade-in-entry:nth-child(6) { animation-delay: 0.12s; }
.arena-pane.active .fade-in-entry:nth-child(7) { animation-delay: 0.14s; }
.arena-pane.active .fade-in-entry:nth-child(8) { animation-delay: 0.16s; }
.arena-pane.active .fade-in-entry:nth-child(n+9) { animation-delay: 0.18s; }

/* New entry slide-in from top */
@keyframes slide-in-top {
    from { opacity: 0; transform: translateY(-8px); max-height: 0; }
    to { opacity: 1; transform: translateY(0); max-height: 200px; }
}

.fade-in-new {
    animation: slide-in-top 0.4s ease-out both;
    overflow: hidden;
}

/* Brief highlight flash for updated values */
@keyframes highlight-flash {
    0% { background: rgba(255, 255, 255, 0.08); }
    100% { background: transparent; }
}

.highlight-update {
    animation: highlight-flash 0.6s ease-out;
}

/* Fade-out for removed items */
@keyframes fade-out-shrink {
    from { opacity: 1; max-height: 200px; }
    to { opacity: 0; max-height: 0; padding: 0; margin: 0; border: none; }
}

.fade-out-remove {
    animation: fade-out-shrink 0.35s ease-in both;
    overflow: hidden;
}

.cheese {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 0.9em;
    line-height: 1;
    vertical-align: middle;
    margin-right: 0.3em;
}

.arena-pane {
    display: none;
}

.arena-pane.active {
    display: block;
}

.arena-tab-content::-webkit-scrollbar,
.ai-timeline-feed::-webkit-scrollbar,
.feed-list::-webkit-scrollbar {
    width: 6px;
}

.arena-tab-content::-webkit-scrollbar-track,
.ai-timeline-feed::-webkit-scrollbar-track,
.feed-list::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.arena-tab-content::-webkit-scrollbar-thumb,
.ai-timeline-feed::-webkit-scrollbar-thumb,
.feed-list::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 3px;
}

.arena-tab-content::-webkit-scrollbar-thumb:hover,
.ai-timeline-feed::-webkit-scrollbar-thumb:hover,
.feed-list::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

.arena-tab-content,
.ai-timeline-feed,
.feed-list {
    scrollbar-width: thin;
    scrollbar-color: #333333 #0a0a0a;
}

.arena-pane { display: none; }
.arena-pane.active { display: block; }

.arena-empty {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 2rem 1rem;
}

.arena-model-section {
    margin-bottom: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.arena-model-section.collapsed .arena-model-section-body { display: none; }
.arena-model-section.collapsed .arena-collapse-icon { transform: rotate(-90deg); }

.arena-model-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: var(--bg-tertiary);
    cursor: pointer;
    user-select: none;
}

.arena-model-section-header:hover { background: var(--panel-hover); }

.arena-model-section-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.arena-model-section-count {
    font-size: 0.7rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.arena-collapse-icon {
    font-size: 0.65rem;
    color: var(--muted);
    transition: transform 0.2s;
}

.arena-model-section-body {
    padding: 0.35rem 0;
}

.arena-trade-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--line);
    &:last-child { border-bottom: none; }
}

.arena-trade-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.arena-trade-model {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.arena-trade-symbol {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    font-size: 0.75rem;
}

.arena-trade-qty {
    font-size: 0.55rem;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 600;
}

.arena-trade-time {
    font-size: 0.55rem;
    color: var(--muted);
    margin-top: 1px;
}

.arena-trade-prices {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.65rem;
    color: var(--text-secondary);
    min-width: 5rem;
    font-family: 'JetBrains Mono', monospace;
}

.arena-trade-result {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 5rem;
    font-family: 'JetBrains Mono', monospace;
}

.arena-trade-result span {
    font-weight: 700;
    font-size: 0.75rem;
}

.arena-trade-result small {
    font-size: 0.6rem;
    opacity: 0.8;
}

.arena-trade-result.positive { color: var(--success); }
.arena-trade-result.negative { color: var(--danger); }

/* Timestamp style */
.arena-trade-timestamp {
    font-size: 0.7rem;
    color: var(--muted);
    margin-left: 8px;
}
/* Live feed indicator */
.live-indicator {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: none;
    align-items: center;
    z-index: 20;
}
.arena-trade-panel.is-trades-tab .live-indicator {
    display: flex;
}
.live-dot {
    width: 5px;
    height: 5px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--success);
    animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

.arena-position-row .arena-trade-current {
    color: var(--text);
}

/* Decision cards */
.arena-decision-card {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--line);
    &:last-child { border-bottom: none; }
}

.arena-decision-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.arena-decision-icon { font-size: 0.85rem; }

.arena-decision-action {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.1rem 0.35rem;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.arena-decision-action.action-buy { background: var(--success-dim); color: var(--success); }
.arena-decision-action.action-sell { background: var(--danger-dim); color: var(--danger); }
.arena-decision-action.action-exit { background: var(--danger-dim); color: var(--danger); }
.arena-decision-action.action-reduce { background: var(--warning-dim); color: var(--warning); }
.arena-decision-action.action-hold { background: rgba(148,163,184,0.12); color: var(--text-secondary); }

.arena-decision-symbol {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text);
}

.arena-decision-time {
    font-size: 0.65rem;
    color: var(--muted);
    margin-left: auto;
}

.arena-decision-rationale {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0.2rem 0;
}

.arena-decision-confidence {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
}

.confidence-label { font-size: 0.65rem; color: var(--muted); }
.confidence-track {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 99px;
    overflow: hidden;
}
.confidence-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.3s;
}
.confidence-fill.high { background: var(--success); }
.confidence-fill.medium { background: var(--warning); }
.confidence-fill.low { background: var(--danger); }

/* AI Timeline */
.ai-timeline-panel { margin-bottom: 1.5rem; }

.ai-timeline-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 500px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
    &:last-child { border-bottom: none; }
}

.timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.timeline-model {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.timeline-symbol {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text);
}

.timeline-time {
    font-size: 0.65rem;
    color: var(--muted);
    margin-left: auto;
}

.timeline-rationale {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0.2rem 0;
}

@media (max-width: 900px) {
    .arena-layout { grid-template-columns: 1fr; }
    .arena-trade-panel { margin-left: 0; margin-top: 1rem; }
}

/* Arena page loader */
.arena-main {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.arena-main.visible {
    opacity: 1;
    transform: translateY(0);
}

.arena-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03), transparent 42%), var(--bg);
    transition: opacity 0.3s ease;
}
.arena-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.boot-shell {
    width: min(760px, calc(100% - 2rem));
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 48%), #000;
    border: 1px solid var(--line);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.boot-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.boot-logo {
    width: 64px;
    height: 64px;
    border: 1px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.boot-copy h2 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.boot-eyebrow {
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.boot-subcopy {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    max-width: 48rem;
}

.boot-rows {
    display: grid;
    gap: 0.9rem;
}

.boot-row {
    display: grid;
    gap: 0.45rem;
}

.boot-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.boot-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text);
}

.boot-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-transform: uppercase;
}

.boot-row.is-loading .boot-status,
.boot-row.is-complete .boot-status,
.boot-row.is-error .boot-status {
    color: var(--text);
}

.boot-bar-track {
    position: relative;
    height: 14px;
    border: 1px solid var(--line);
    background: #050505;
    overflow: hidden;
}

.boot-bar-fill {
    width: 0%;
    height: 100%;
    background: repeating-linear-gradient(90deg, #fff 0 8px, rgba(255, 255, 255, 0.2) 8px 12px);
    transition: width 0.35s ease;
}

.boot-row.is-loading .boot-bar-fill {
    animation: boot-scan 1.1s linear infinite;
}

.boot-row.is-complete .boot-bar-fill {
    width: 100%;
    animation: none;
    background: linear-gradient(90deg, #fff, #d1d5db);
}

.boot-row.is-error .boot-bar-track {
    border-style: dashed;
}

.boot-row.is-error .boot-bar-fill {
    width: 100%;
    animation: none;
    background: repeating-linear-gradient(90deg, #fff 0 8px, rgba(255, 255, 255, 0.1) 8px 12px);
}

.boot-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.boot-footer-label,
.boot-system-status {
    font-size: 0.72rem;
    font-weight: 700;
}

.boot-system-status {
    color: var(--muted);
}

.boot-system-status.online {
    color: var(--text);
}

.boot-system-status.partial {
    color: var(--text-secondary);
}

.arena-loader.boot-online::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    animation: boot-flash 0.45s ease;
    pointer-events: none;
}

.arena-loader.boot-online .boot-shell {
    animation: boot-pulse 0.45s ease;
}

@keyframes boot-scan {
    0% { background-position: 0 0; }
    100% { background-position: 24px 0; }
}

@keyframes boot-pulse {
    0% { transform: scale(1); }
    35% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

@keyframes boot-flash {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

@media (max-width: 720px) {
    .boot-shell {
        padding: 1rem;
    }

    .boot-header {
        flex-direction: column;
    }

    .boot-logo {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .boot-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .boot-row-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--line-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}

.loader-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.loader-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

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

/* ===== Landing Page Styles ===== */

body.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.5rem;
    position: relative;
}

.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 800px;
    text-align: center;
}

.landing-logo {
    width: 64px;
    height: 64px;
    border: 2px solid #fff;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.landing-content > * {
    opacity: 0;
}

.landing-content > .landing-headline {
    opacity: 1;
}

.type-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    background: #fff;
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink-cursor 1.1s step-end infinite;
}

.landing-content.typed > .landing-logo {
    animation: fade-in 1.0s ease-out forwards;
}

.landing-content.typed > *:not(.landing-logo):not(.landing-headline) {
    animation: fade-in 0.2s ease-out forwards;
}

.landing-content.typed > .landing-logo { animation-delay: 0s; }
.landing-content.typed > *:not(.landing-logo):not(.landing-headline) { animation-delay: 1.05s; }

.landing-headline {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--text);
    text-transform: uppercase;
}

.landing-subhead {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 600px;
}

.model-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.model-pill {
    padding: 0.35rem 0.75rem;
    background: transparent;
    border: 1px solid var(--line-strong);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.landing-cta {
    margin-top: 1rem;
    padding: 0.85rem 2rem;
    border: 2px solid #fff;
    background: transparent;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.landing-cta:hover {
    background: #fff;
    color: #000;
}

.leaderboard-preview {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--line);
    min-width: 320px;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.leaderboard-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
}

.live-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 4s ease-in-out infinite;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.leaderboard-row,
a.leaderboard-row {
    display: grid;
    grid-template-columns: min-content 1fr min-content min-content;
    gap: 0.75rem;
    align-items: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    transition: background 0.15s;
}

a.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.leaderboard-row.rank-1 .leaderboard-rank {
    color: #ffc107;
    font-weight: 700;
}

.leaderboard-row.rank-2 .leaderboard-rank {
    color: #c0c0c0;
    font-weight: 700;
}

.leaderboard-row.rank-3 .leaderboard-rank {
    color: #cd7f32;
    font-weight: 700;
}

.leaderboard-rank {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.leaderboard-model {
    text-align: left;
    font-weight: 600;
    color: var(--text);
}

.leaderboard-equity {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-weight: 600;
}

.leaderboard-return {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.loading-text {
    font-size: 0.75rem;
    color: var(--muted);
    font-style: italic;
}

.landing-footer {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    border-top: 1px solid var(--line);
}

.footer-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--text);
}

/* SEO Quick Answer Rework */
.seo-quick-answer {
    margin: 1.5rem 0;
    padding: 0.75rem 1rem;
    border-left: 1px solid var(--line-strong);
    background: var(--bg-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.seo-quick-answer strong {
    color: var(--text);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.25rem;
}

@media (max-width: 720px) {
    .landing-hero {
        padding: 2rem 1rem;
    }

    .landing-logo {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .model-pills {
        gap: 0.35rem;
    }

    .model-pill {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }

    .leaderboard-preview {
        min-width: auto;
        width: 100%;
        padding: 0.75rem;
    }

    .landing-footer {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .leaderboard-row, a.leaderboard-row {
        gap: 0.5rem;
        padding: 0.35rem 0.4rem;
    }

    .seo-quick-answer {
        font-size: 0.75rem;
        padding: 0.6rem 0.75rem;
    }
}

/* ===== Market Closed State — Subtle visual indicator when market is closed ===== */

body.market-closed .arena-main {
    opacity: 0.92;
}

body.market-closed #arenaStatus {
    border-color: #f59e0b;
    color: #f59e0b;
}

body.market-closed #arenaStatus::before {
    background: #f59e0b;
    animation: none;
}

body.market-closed .live-dot {
    background: #f59e0b;
    box-shadow: none;
    animation: none;
    opacity: 0.6;
}

body.market-closed .live-indicator {
    opacity: 0.5;
}

/* ===== Market Clock — ET time and status display ===== */

.market-clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 0.25rem;
    white-space: nowrap;
}

body.market-closed .market-clock {
    color: #f59e0b;
}
