/* Shared light palette for the authenticated application and auth screens. */
:root {
    color-scheme: light;
    --bg: #f4f6fa;
    --side: #ffffff;
    --panel: #ffffff;
    --panel2: #f7f9fc;
    --line: #dce2ea;
    --muted: #687386;
    --text: #202939;
    --blue: #3478e5;
    --green: #16845b;
    --red: #d34855;
}

body.terminal-theme {
    --bg: #f4f6fa;
    --side: #ffffff;
    --panel: #ffffff;
    --panel2: #f7f9fc;
    --line: #dce2ea;
    --muted: #687386;
    --text: #202939;
    --blue: #3478e5;
    --green: #16845b;
    --red: #d34855;
    --font-body: 15px;
    --font-small: 12px;
    color-scheme: light;
    font-size: var(--font-body);
    background: var(--bg);
    color: var(--text);
}

.terminal-theme.auth-page { background: radial-gradient(ellipse at 50% 0, #e5efff 0, transparent 48%), var(--bg); }
.terminal-theme .auth-card,
.terminal-theme :is(.panel, .metric-card, .auth-card, .trade-chart-card, .trade-fetch-card, .trade-summary, .trade-empty, .trade-evidence-bar, .signal-analyzer-entry, .signal-analyzer-how, .signal-analysis-list, .positions-panel, .evidence-call-overview, .evidence-chart-panel, .evidence-reasons, .evidence-summary, .evidence-import) {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
    box-shadow: 0 2px 12px #2536530a;
}

.terminal-theme :is(.sidebar, .topbar) { background: #fff; border-color: var(--line); }
.terminal-theme .sidebar { box-shadow: 2px 0 10px #25365308; }
.terminal-theme .brand-copy strong span { color: #667085; }
.terminal-theme :is(.workspace-label, .breadcrumb, .market-state, .page-heading p, .panel-heading p, .metric-label, .metric-foot, .metric-unit, .sample-note, .chart-x-labels, .app-footer, .muted-text) { color: var(--muted); }
.terminal-theme .breadcrumb strong { color: #202939; }
.terminal-theme .crumb-sep { color: #a4adba; }
.terminal-theme :is(.nav-link, .market-state) { color: #536174; }
.terminal-theme .nav-link:hover { color: #243247; background: #f2f6fc; }
.terminal-theme .nav-link.is-active { color: #245fb5; background: #eaf2ff; box-shadow: inset 3px 0 var(--blue); }
.terminal-theme :is(.sidebar-divider, .user-mini, .app-footer) { border-color: var(--line); }
.terminal-theme .data-status { background: #f7f9fc; border-color: var(--line); }
.terminal-theme :is(.data-status small, .user-mini small) { color: #687386; }
.terminal-theme .avatar { background: #e8f0fc; color: #245fb5; }
.terminal-theme .metric-icon.blue { background: #e8f0fc; color: #245fb5; }
.terminal-theme .metric-icon.violet { background: #f0edff; color: #5946b2; }
.terminal-theme .metric-icon.green { background: #e6f5ee; color: #176b43; }
.terminal-theme .metric-icon.amber { background: #fff3dc; color: #8a5b00; }
.terminal-theme .instrument-icon.nifty { background: #e8f0fc; color: #245fb5; }
.terminal-theme .side-badge.buy { background: #e6f5ee; border-color: #b8dfc8; color: #176b43; }
.terminal-theme .source-tag { background: #eaf2ff; border-color: #c9dcfb; color: #245fb5; font-size: 12px; font-weight: 600; }
.terminal-theme .signal-table .direction { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.4; }
.terminal-theme .signal-table .direction.buy-text { color: #16845b; }
.terminal-theme .signal-table .direction.sell-text { color: #c03945; }
.terminal-theme .signal-table .paper-trade-link { font-size: 12px; font-weight: 600; }

.terminal-theme :is(.button-secondary, .select-button, .logout-button) {
    background: #fff;
    border-color: #cbd4e0;
    color: #344054;
}
.terminal-theme :is(.button-secondary, .select-button, .logout-button):hover { background: #f2f6fc; border-color: #9db9e6; color: #1d4f91; }
.terminal-theme .button-primary { color: #fff; }
.terminal-theme :is(.analyzer-form, .form-field) label,
.terminal-theme :is(.auth-form>label:not(.remember-row), .form-field label, .filter-form, .strategy-row form label) { color: #344054; }
.terminal-theme :is(input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='color']):not([type='hidden']), select, textarea) {
    color-scheme: light;
    background-color: #fff !important;
    border-color: #cbd4e0 !important;
    color: #202939 !important;
}
.terminal-theme :is(input, textarea)::placeholder { color: #687386 !important; }
.terminal-theme :is(input, select, textarea):focus-visible { outline-color: #3478e5; }
.terminal-theme .auth-form input:not([type=checkbox]) { background: #fff; color: #202939; border-color: #cbd4e0; }
.terminal-theme .auth-form>label:not(.remember-row),
.terminal-theme .remember-row,
.terminal-theme .auth-switch,
.terminal-theme .top-user-name { color: #536174; }
.terminal-theme .auth-note { background: #f7f9fc; border-color: var(--line); color: #536174; }
.terminal-theme .auth-disclaimer { color: #687386; }
.terminal-theme :is(.text-link, .trade-back, .paper-trade-link, .order-strategy-form button) { color: #245fb5; }
.terminal-theme th { color: #536174; }
.terminal-theme td { color: #344054; }
.terminal-theme tbody tr:hover { background: #f5f8fc; }

.terminal-theme :is(.signal-empty-icon, .analyzer-number, .count-pill, .positions-count) { background: #eaf2ff; border-color: #c9dcfb; color: #245fb5; }
.terminal-theme .dashboard-workflow p { color: #596579; }
.terminal-theme .dashboard-workflow > a { color: #245fb5; }
.terminal-theme .dashboard-workflow > a > span { color: #536174; }
.terminal-theme .dashboard-workflow > a:hover { color: #194f9a; }
.terminal-theme :is(.signal-override-fields, .screenshot-options, .ocr-confirm, .analysis-price-grid>div, .evidence-chart-controls, .trade-chart-controls, .trade-tabs, .trade-zoom button, .trade-range-shortcuts button, .evidence-zoom-controls button, .filter-form, .select-button) {
    background-color: #f7f9fc;
    border-color: var(--line);
    color: #344054;
}
.terminal-theme :is(.analysis-explanation, .paper-signal-context, .dashboard-workflow) { background: #eef5ff; border-color: #cbdcf6; color: #344054; }
.terminal-theme :is(.analysis-explanation strong, .paper-signal-context strong) { color: #245fb5; }
.terminal-theme :is(.analysis-price-grid small, .signal-form-actions p, .signal-pagination, .signal-disclaimer, .paper-section ul, .strategy-row form label, .trade-summary span, .trade-summary small, .trade-chart-header p, .trade-chart-note, .trade-live-toolbar p, .trade-fetch-card summary small, .trade-range-shortcuts>span, .trade-form-grid label, .trade-confirm, .trade-form-footer p, .trade-disclaimer, .evidence-toolbar p, .evidence-reasons>p, .evidence-import p, .evidence-summary p, .evidence-chart-note, .evidence-history, .evidence-confirm) { color: #596579; }
.terminal-theme .form-success { background: #e9f7ef; border-color: #a8d8bb; color: #176b43; }
.terminal-theme .field-error { color: #b42332; }
.terminal-theme .demo-banner { background: #fff8e6; border-color: #eed99a; color: #72510b; }
.terminal-theme .demo-banner strong { color: #72510b; }

.terminal-theme :is(.analysis-explanation, .paper-signal-context, .evidence-reason, .evidence-level-card, .evidence-readout, .evidence-chart-scroll, .evidence-chart-panel, .evidence-chart-controls, .evidence-source, .evidence-demo, .trade-chip, .trade-summary, .trade-side, .trade-tabs, .trade-instrument, .trade-match-icon, .trade-empty, .trade-evidence-menu>div, .positions-paper, .positions-long, .positions-exit, .position-details, .position-details>div) {
    color: #344054;
}
.terminal-theme :is(.evidence-chart-scroll, .evidence-readout, .evidence-level-card, .evidence-reason, .evidence-chart-controls, .evidence-history select, .evidence-workspace select, .trade-tabs, .trade-chart-controls, .trade-plot, .trade-evidence-menu>div, .trade-workspace select, .trade-workspace input[type=datetime-local], .trade-chip, .trade-instrument, .trade-match-icon, .positions-paper, .positions-long, .positions-exit) {
    background: #f7f9fc;
    border-color: var(--line);
}
.terminal-theme .evidence-reason:hover,
.terminal-theme .evidence-reason[aria-pressed=true] { background: #eaf2ff; border-color: #8fb4ed; }
.terminal-theme .evidence-reason span,
.terminal-theme .evidence-reason small,
.terminal-theme .evidence-readout,
.terminal-theme .evidence-level-card span { color: #536174; }
.terminal-theme .evidence-level-card strong { color: var(--level-color); }
.terminal-theme .evidence-source { background: #eaf7f5; border-color: #b8dfd8; color: #175e58; }
.terminal-theme .evidence-demo { background: #fff8e6; border-color: #eed99a; color: #72510b; }
.terminal-theme .trade-summary strong,
.terminal-theme .evidence-call-overview strong { color: #202939; }
.terminal-theme .trade-level-strip { background: #f7f9fc; border-color: var(--line); color: #536174; }
.terminal-theme .trade-level-strip strong { color: #202939; }
.terminal-theme .trade-level-strip small { color: #687386; }
.terminal-theme .trade-side.buy,
.terminal-theme .trade-chip.connected { background: #e8f6ef; border-color: #b8dfc8; color: #176b43; }
.terminal-theme .trade-side.sell { background: #fff0f0; color: #b42332; }
.terminal-theme .trade-tabs button { color: #536174; }
.terminal-theme .trade-tabs button[aria-selected=true] { background: #e3edfc; color: #194f9a; box-shadow: none; }
.terminal-theme .trade-plot { background: #fff; }
.terminal-theme .trade-svg text { fill: #667085; }
.terminal-theme .trade-svg line[stroke="#293b50"] { stroke: #d6dde7; }
.terminal-theme .trade-empty { background: #f7f9fc; border-color: #cbd4e0; }
.terminal-theme .trade-empty-icon { color: #3478e5; }
.terminal-theme .trade-evidence-menu>div { box-shadow: 0 12px 32px #2536531c; }
.terminal-theme .trade-chart-note,
.terminal-theme .trade-disclaimer,
.terminal-theme .trade-form-footer p { color: #596579; }
.terminal-theme .positions-paper { color: #245fb5; }

/* Shared readable type scale across the workspace and its feature pages. */
.terminal-theme .nav-link { font-size: 14px; }
.terminal-theme .workspace-label,
.terminal-theme .brand-copy small { font-size: 11px; }
.terminal-theme :is(.data-status strong, .user-mini strong) { font-size: 12px; }
.terminal-theme :is(.data-status small, .user-mini small) { font-size: 11px; }
.terminal-theme :is(.breadcrumb, .market-state, .top-user-name, .logout-button, .app-footer) { font-size: 12px; }
.terminal-theme .button { font-size: 13px; }
.terminal-theme .page-heading h1 { font-size: 30px; }
.terminal-theme .panel-heading h2 { font-size: 17px; }
.terminal-theme :is(.eyebrow, .timezone, .metric-label, .metric-foot, .metric-unit, .select-button, .chart-summary>span, .chart-summary small, .chart-y-labels, .chart-x-labels, .chart-legend, .sample-note, .count-pill, .text-link) { font-size: 12px; }
.terminal-theme .market-page-title h1 { font-size: 16px; }
.terminal-theme .market-chart-heading h2 { font-size: 14px; }
.terminal-theme .metric-label { font-size: 12px; }
.terminal-theme :is(.metric-foot, .metric-unit) { font-size: 12px; }
.terminal-theme :is(.page-heading p, .panel-heading p) { font-size: 14px; }
.terminal-theme th { font-size: 12px; }
.terminal-theme td { font-size: 14px; }
.terminal-theme td strong { font-size: 14px; }
.terminal-theme td small { font-size: 12px; }
.terminal-theme :is(.field-hint, .auth-disclaimer, .signal-empty p, .signal-pagination, .signal-disclaimer, .signal-form-actions p, .strategy-row>div p, .analyzer-form label, .signal-search-form label, .signal-override-fields summary, .signal-analyzer-heading p, .signal-analyzer-how ul, .analyzer-data-note strong, .analyzer-data-note p, .signal-count, .analysis-call-heading time, .analysis-price-grid small, .analysis-price-grid strong, .analysis-explanation strong, .provider-rationale strong, .analysis-explanation p, .provider-rationale p, .analysis-warnings, .analysis-original-message, .analysis-card-actions>span, .positions-toolbar, .positions-paper, .positions-table th, .positions-table td small, .positions-long, .position-details, .position-details p, .position-details>div) {
    font-size: var(--font-small);
}
.terminal-theme :is(.trade-chip, .trade-summary span, .trade-summary small, .trade-chart-header p, .trade-scale, .trade-zoom, .trade-chart-caption, .trade-chart-note, .trade-evidence-bar small, .trade-evidence-menu summary, .trade-evidence-menu label, .trade-instrument label, .trade-instrument small, .trade-range-shortcuts>span, .trade-form-grid label, .trade-confirm, .trade-form-footer p, .trade-disclaimer, .trade-empty p, .evidence-chart-source, .evidence-chart-note, .evidence-call-overview small, .evidence-call-overview span, .evidence-call-overview>p, .evidence-level-card span, .evidence-readout, .evidence-history, .evidence-reason span, .evidence-reason small, .evidence-chart-controls, .screenshot-options>summary, .screenshot-options p, .ocr-confirm) {
    font-size: var(--font-small);
}
.terminal-theme .market-workspace :is(.market-page-title span, .market-controls label, .market-controls select, .market-controls .button, .market-timeframes button, .market-range-bar button, .market-summary, .market-notice, #market-source-label, .market-ohlc, .market-range-bar, .market-statistics dt, .market-footnote) {
    font-size: var(--font-small);
}
.terminal-theme .positions-long { color: #176b43; }
.terminal-theme .positions-stale { color: #8a5b00 !important; }
.terminal-theme .positions-exit { background: #fff0f0; border-color: #e7b9bf; color: #a52a38; }
.terminal-theme .position-details { color: #536174; }
.terminal-theme .positions-toolbar { color: #596579; }

.terminal-theme .market-workspace { --muted:#687386; --text:#202939; --line:#dce2ea; color-scheme: light; background: #fff; color: #202939; border-color: var(--line); }
.terminal-theme .market-workspace :is(.market-controls, .market-timeframes, .market-summary, .market-range-bar, .market-statistics, .market-footnote, .drawing-bar) { border-color: var(--line); }
.terminal-theme .market-workspace .market-controls label,
.terminal-theme .market-workspace .market-timeframes button,
.terminal-theme .market-workspace .market-range-bar button,
.terminal-theme .market-workspace .market-chart-heading span,
.terminal-theme .market-workspace .market-ohlc,
.terminal-theme .market-workspace .market-live-help,
.terminal-theme .market-workspace .market-statistics dt,
.terminal-theme .market-workspace .market-hint,
.terminal-theme .market-workspace .market-data-note { color: #536174; }
.terminal-theme .market-workspace .market-chart-heading h2 { color: #202939; }
.terminal-theme .market-workspace .market-timeframes button[aria-pressed=true] { background: #eaf2ff; color: #245fb5; }
.terminal-theme .market-workspace .market-controls .button {
    background: #fff;
    border-color: #cbd4e0;
    color: #344054;
}
.terminal-theme .market-workspace .market-controls .button:hover {
    background: #f2f6fc;
    border-color: #9db9e6;
    color: #1d4f91;
}
.terminal-theme .market-workspace .market-timeframes button,
.terminal-theme .market-workspace .market-range-bar button {
    border-radius: 5px;
    color: #536174;
}
.terminal-theme .market-workspace .market-timeframes button:hover,
.terminal-theme .market-workspace .market-range-bar button:hover {
    background: #f2f6fc;
    color: #245fb5;
}
.terminal-theme .market-workspace .market-range-bar button[aria-pressed=true] {
    background: #eaf2ff;
    color: #245fb5;
}
.terminal-theme .market-workspace .market-notice { background: #eef2f7; color: #536174; }
.terminal-theme .market-workspace .market-notice.is-demo { background: #fff6df; color: #72510b; }
.terminal-theme .market-workspace .market-notice.is-live { background: #e8f6ef; color: #176b43; }
.terminal-theme .market-workspace .market-notice.is-error { background: #fff0f0; color: #a52a38; }
.terminal-theme .market-workspace .market-notice.is-live::before { color: #16845b; }
.terminal-theme .market-workspace :is(select, button:not(.market-indicative-quote)) { color: #344054; }
.terminal-theme .market-workspace :is(select, .market-controls select, .drawing-settings select) { background: #fff; border-color: #cbd4e0; }
.terminal-theme .market-workspace .market-plot-shell,
.terminal-theme .market-workspace .drawing-stage,
.terminal-theme .market-workspace #market-plot { background: #fff; }
.terminal-theme .market-workspace .market-state-overlay { background: #ffffffed; color: #536174; }
.terminal-theme .market-workspace .market-indicative-note { background: #f7f9fc; color: #596579; }
.terminal-theme .market-workspace .drawing-rail { background: #f7f9fc; border-color: var(--line); }
.terminal-theme .market-workspace .drawing-rail button,
.terminal-theme .market-workspace .drawing-settings,
.terminal-theme .market-workspace .drawing-status,
.terminal-theme .market-workspace .market-hint,
.terminal-theme .market-workspace .market-data-note { color: #536174; }
.terminal-theme .market-workspace .drawing-rail button:hover { background: #eaf2ff; color: #245fb5; }
.terminal-theme .market-workspace .drawing-rail button[aria-pressed=true],
.terminal-theme .market-workspace .drawing-rail button[aria-expanded=true] { background: #e3edfc; border-color: #9db9e6; color: #194f9a; }
.terminal-theme .market-workspace .drawing-flyout-section h3 { color: #687386; }
.terminal-theme .market-workspace .drawing-flyout { background: #fff; border-color: #cbd4e0; color: #202939; box-shadow: 0 10px 26px #25365324; }
.terminal-theme .market-workspace .drawing-flyout-item { color: #344054; }
.terminal-theme .market-workspace .drawing-flyout-item:hover,
.terminal-theme .market-workspace .drawing-flyout-item[aria-pressed=true] { background: #eaf2ff; color: #245fb5; }
.terminal-theme .market-workspace .drawing-toolbar-toggle { background: #f7f9fc; border-color: #cbd4e0; color: #245fb5; }
.terminal-theme .market-workspace .drawing-dialog { background: #fff; color: #202939; border-color: #cbd4e0; }
.terminal-theme .market-workspace .drawing-dialog p { color: #596579; }
.terminal-theme .market-workspace .drawing-dialog input { background: #fff; color: #202939; border-color: #cbd4e0; }
.terminal-theme .market-workspace .drawing-dialog button { background: #eaf2ff; color: #245fb5; border-color: #cbdcf6; }
.terminal-theme .contract-results button { background: #f7f9fc; border-color: var(--line); color: #344054; }

.terminal-theme .module-chart-view,
.terminal-theme .module-chart-expanded,
.terminal-theme .module-drawer { background: #fff; color: #202939; border-color: var(--line); }
.terminal-theme .module-chart-view>.module-chart-header { background: #f7f9fc; border-color: var(--line); color: #202939; }
.terminal-theme .module-chart-header button { background: #fff; border-color: #cbd4e0; color: #344054; }
.terminal-theme .module-frame { background: #fff; }
.terminal-theme .module-drawer::backdrop { background: #25365366; }
.terminal-theme :is(.screenshot-options input[type=file]::file-selector-button, .ocr-confirm) { background: #f7f9fc; color: #344054; border-color: var(--line); }

@media (max-width: 780px) {
    .terminal-theme .nav-link:hover { background: #f2f6fc; }
}
