:root[data-theme="light"] {
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --line: #dce2e8;
  --line-strong: #c3ccd6;
  --ink: #17202a;
  --ink-2: #465361;
  --ink-3: #73808d;
  --blue: #286fc0;
  --teal: #276c75;
  --green: #27744a;
  --red: #ad4149;
  --violet: #7356a7;
  color-scheme: light;
}

[data-theme="light"] body { color: var(--ink); background: var(--canvas); }
[data-theme="light"] body.app-mode { --canvas: #f4f6f8; --surface: #ffffff; --line: #dce2e8; --line-strong: #c3ccd6; --ink: #17202a; --ink-2: #465361; --ink-3: #73808d; --blue: #286fc0; --teal: #276c75; --green: #27744a; --red: #ad4149; --violet: #7356a7; }
[data-theme="light"] p, [data-theme="light"] label { color: var(--ink-2); }
[data-theme="light"] button { color: var(--ink-2); background: #fff; border-color: var(--line-strong); }
[data-theme="light"] button:hover { color: var(--ink); border-color: var(--blue); }
[data-theme="light"] button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea { color: var(--ink); background: #fff; border-color: var(--line-strong); }
[data-theme="light"] input:disabled, [data-theme="light"] select:disabled { color: #98a3ae; background: #f3f5f7; }
[data-theme="light"] .card, [data-theme="light"] .empty, [data-theme="light"] .table-wrap { color: var(--ink); background: #fff; border-color: var(--line); }
[data-theme="light"] th, [data-theme="light"] td { border-bottom-color: var(--line); }
[data-theme="light"] th:first-child, [data-theme="light"] td:first-child { background: #fbfcfd; }
[data-theme="light"] .muted, [data-theme="light"] .card small, [data-theme="light"] .loading { color: var(--ink-3); }
[data-theme="light"] #message { color: var(--ink); background: #eaf2fb; border-color: #a8c9e8; box-shadow: 0 14px 30px #17202a22; }

[data-theme="light"] .topbar { background: #fffffff5; border-bottom-color: var(--line); }
[data-theme="light"] body.app-mode .topbar { background: #fffffff5; }
[data-theme="light"] .brand-mark::after { border-color: var(--ink); }
[data-theme="light"] .prototype { color: var(--blue); }
[data-theme="light"] .topbar #navigation button:hover { color: var(--ink); background: #f1f4f7; }
[data-theme="light"] .topbar #navigation button.active { color: var(--ink); background: #eaf1fa; }
[data-theme="light"] .topbar .session .theme-toggle { min-height: 30px; padding: 5px 9px; color: var(--ink-2); background: #fff; border-color: var(--line); white-space: nowrap; }
[data-theme="light"] .topbar .session .theme-toggle:hover { color: var(--ink); background: #edf1f4; border-color: var(--line-strong); }
.topbar .session .theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
@media (max-width: 650px) {
  .topbar .session .theme-toggle { width: 28px; min-width: 28px; padding: 4px; }
  .topbar .session .theme-text { display: none; }
}

[data-theme="light"] body:not(.app-mode) { color: #eff3f7; background: #05070d; }
[data-theme="light"] .access-intro { color: #eff3f7; background: linear-gradient(145deg,#080e17,#050a11 62%,#0a1420); border-color: #1c2933; }
[data-theme="light"] body:not(.app-mode) .brand-mark::after { border-color: #e8edf1; }
[data-theme="light"] .access-brand, [data-theme="light"] .access-headline, [data-theme="light"] .access-login-card h1 { color: #eff3f7; }
[data-theme="light"] .access-auth-region { background: radial-gradient(circle at 100% 100%,#0e1b2a 0%,transparent 46%),#080c11; }
[data-theme="light"] .access-login-card { color: #eff3f7; }
[data-theme="light"] .access-card-description, [data-theme="light"] .access-pending { color: #a7b3bf; }
[data-theme="light"] .access-card-footnote { color: #91a0ae; }
[data-theme="light"] .access-local-form label { color: #c3ccd4; }
[data-theme="light"] .access-local-form input { color: #eff3f7; background: #0d151e; border-color: #344354; }
[data-theme="light"] .access-local-form button.primary, [data-theme="light"] .access-google-button { color: #0a1722; background: #dfeaf2; border-color: #dfeaf2; }
[data-theme="light"] .access-google-button:hover:not(:disabled) { color: #0a1722; background: #f2f8fc; border-color: #f2f8fc; }
[data-theme="light"] .access-issue { color: #f1c4cb; background: #2a1820; border-color: #835662; }
[data-theme="light"] .access-issue span { color: #ddb3bd; }
[data-theme="light"] .access-status { color: var(--ink); background: #fff; border-color: var(--line); box-shadow: 0 20px 50px #17202a14; }
[data-theme="light"] .access-status-marker { background: #eaf2fb; color: var(--blue); border-color: #b5d1e7; }
[data-theme="light"] .access-status-action { color: #fff; background: var(--blue); }

[data-theme="light"] .command-dialog, [data-theme="light"] .portfolio-detail-dialog, [data-theme="light"] .chart-dialog { color: var(--ink); background: #fff; border-color: var(--line-strong); box-shadow: 0 24px 80px #17202a29; }
[data-theme="light"] .command-dialog input { background: #fff; }
[data-theme="light"] .command-results button:hover, [data-theme="light"] .command-results button.selected { background: #eaf1fa; }
[data-theme="light"] .portfolio-controls input, [data-theme="light"] .portfolio-controls select, [data-theme="light"] .portfolio-summary-bar, [data-theme="light"] .portfolio-table, [data-theme="light"] .portfolio-detail-status, [data-theme="light"] .portfolio-horizon, [data-theme="light"] .portfolio-capital { background: #fff; border-color: var(--line); }
[data-theme="light"] .portfolio-header { background: #f1f4f6; color: var(--ink-3); }
[data-theme="light"] .portfolio-item { color: var(--ink); background: #fff; }
[data-theme="light"] .portfolio-item:hover, [data-theme="light"] .portfolio-item:focus-visible { background: #f3f6f9; }
[data-theme="light"] .portfolio-detail-head, [data-theme="light"] .portfolio-detail-actions { background: #f7f9fb; }
[data-theme="light"] .portfolio-detail-metric, [data-theme="light"] .portfolio-detail-close, [data-theme="light"] .portfolio-detail-actions button { background: #fff; }
[data-theme="light"] .portfolio-detail-actions button.primary { color: #fff; background: var(--blue); }
[data-theme="light"] .portfolio-connection:not(.portfolio-connection-boot) { background: radial-gradient(circle at 70% 35%,#dbe9f4 0%,transparent 38%),var(--canvas); }
[data-theme="light"] .portfolio-connection:not(.portfolio-connection-boot) .portfolio-connection-panel { border-color: var(--line-strong); background: linear-gradient(145deg,#fff,#f8fafc 75%); box-shadow: 0 25px 70px #17202a20; }
[data-theme="light"] .portfolio-connection:not(.portfolio-connection-boot) h1 { color: var(--ink); }
[data-theme="light"] .portfolio-connection:not(.portfolio-connection-boot) .portfolio-connection-detail { color: var(--ink-2); }
[data-theme="light"] .portfolio-connection:not(.portfolio-connection-boot) .portfolio-connection-status { color: var(--ink-2); }
[data-theme="light"] .portfolio-connection:not(.portfolio-connection-boot) .portfolio-connection-visual { border-color: var(--line); background: radial-gradient(circle,#d8eaf6 0%,#f6f9fc 70%); }
[data-theme="light"] .portfolio-connection:not(.portfolio-connection-boot) .portfolio-connection-core { background: radial-gradient(circle at 35% 30%,#91c1e1,#3677a4 74%); }
[data-theme="light"] .portfolio-connection-boot .portfolio-connection-detail { color: #a7b3bf; }
[data-theme="light"] .portfolio-connection-boot .brand-mark::after { border-color: #e8edf1; }

[data-theme="light"] .product-context { background: #fff; }
[data-theme="light"] .workbench-transition { background: radial-gradient(ellipse 55% 65% at 50% 48%,#e2edf5 0%,transparent 72%),var(--canvas); }
[data-theme="light"] .workbench-transition-panel { background: linear-gradient(155deg,#fff,#f7f9fb 75%); box-shadow: 0 24px 70px #17202a1c; }
[data-theme="light"] .workbench-transition-row span { background: linear-gradient(90deg,#e2e8ee 0%,#ccdbe8 50%,#e2e8ee 100%); background-size: 200% 100%; }
[data-theme="light"] .workbench-transition-actions button.primary { border-color: var(--blue); background: var(--blue); color: #fff; }
[data-theme="light"] .context-field select:hover { color: var(--ink); }
[data-theme="light"] .statement-tabs { background: #e8edf2; }
[data-theme="light"] .statement-tabs button.active { color: #fff; background: var(--blue); box-shadow: none; }
[data-theme="light"] .context-field .time-trigger { color: var(--ink-2); background: transparent; border-color: transparent; }
[data-theme="light"] .time-panel, [data-theme="light"] .calculated-columns-panel { background: #fff; border-color: var(--line-strong); box-shadow: 0 18px 50px #17202a24; }
[data-theme="light"] .time-presets button, [data-theme="light"] .time-field input, [data-theme="light"] .time-field select, [data-theme="light"] .time-actions button { color: var(--ink-2); background: #fff; border-color: var(--line); }
[data-theme="light"] .time-presets button.active, [data-theme="light"] .time-preview { color: var(--blue); background: #eaf1fa; border-color: #a8c9e8; }
[data-theme="light"] .time-actions button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
[data-theme="light"] .calculated-columns-choice:hover { background: #f5f8fb; }
[data-theme="light"] .native-kpi { background: linear-gradient(180deg,#fff,#fbfcfd); border-color: #d9e1e7; box-shadow: inset 0 1px 0 #fff,0 5px 15px #26374811; }
[data-theme="light"] .native-kpi:hover,[data-theme="light"] .native-kpi:focus-within { background: #fff; border-color: #bdc9d2; box-shadow: inset 0 1px 0 #fff,0 9px 22px #2637481a; }
[data-theme="light"] .native-kpi .kpi-title { color: #42515e; }
[data-theme="light"] .native-kpi .kpi-primary strong { color: var(--ink); }
[data-theme="light"] .native-kpi .kpi-primary strong.negative { color: #b83e4d; }
[data-theme="light"] .native-kpi .kpi-basis { color: #73808d; }
[data-theme="light"] .native-kpi .kpi-state,[data-theme="light"] .native-kpi .kpi-foot span { background: #f5f8fa; border-color: #e1e7ec; }
[data-theme="light"] .native-kpi .kpi-state.favorable,[data-theme="light"] .native-kpi .kpi-delta.favorable { color: #27744a; }
[data-theme="light"] .native-kpi .kpi-state.watch,[data-theme="light"] .native-kpi .kpi-state.loss,[data-theme="light"] .native-kpi .kpi-delta.watch,[data-theme="light"] .native-kpi .kpi-delta.loss { color: #ad4149; }
[data-theme="light"] .native-kpi .kpi-spark-point { fill: #fff; }
[data-theme="light"] .native-kpi .kpi-action { color: #5a6977; background: #f7f9fb; border-color: #e1e7ec; }
[data-theme="light"] .kpi-inspection-tooltip { color: var(--ink); background: #fff; border-color: #c3ccd6; box-shadow: 0 18px 40px #26374838; }
[data-theme="light"] .kpi-tooltip-cell { background: #f7f9fb; }
[data-theme="light"] .kpi-tooltip-cell strong { color: var(--ink); }
[data-theme="light"] .kpi-picker-dialog,[data-theme="light"] .kpi-focus-dialog { color: var(--ink); background: #fff; border-color: var(--line-strong); box-shadow: 0 24px 80px #17202a29; }
[data-theme="light"] .kpi-picker-option { color: var(--ink-2); background: #fff; border-color: var(--line); }
[data-theme="light"] .kpi-picker-option:hover,[data-theme="light"] .kpi-picker-option.current { color: var(--ink); background: #eaf3fb; border-color: var(--blue); }
[data-theme="light"] .kpi-focus-chart { background: #f8fafc; }
[data-theme="light"] .kpi-focus-current,[data-theme="light"] .kpi-focus-comparison { background: #f5f8fb; }
[data-theme="light"] .kpi-focus-point { fill: #fff; }
[data-theme="light"] .kpi-tooltip-cell strong.positive { color: #27744a; }
[data-theme="light"] .kpi-tooltip-cell strong.negative { color: #ad4149; }
[data-theme="light"] .product-statement-shell { background: #fff; }
[data-theme="light"] .product-statement-head, [data-theme="light"] .product-toolbar { background: #fff; }
[data-theme="light"] .workbench-modes { background: #f6f8fa; }
[data-theme="light"] .workbench-mode { color: var(--ink-2); }
[data-theme="light"] .workbench-mode:hover { background: #edf3f8; }
[data-theme="light"] .workbench-mode.active { color: var(--ink); background: #e5f1fb; }
[data-theme="light"] .product-toolbar button:hover, [data-theme="light"] .product-toolbar button.active { color: var(--ink); background: #edf1f4; }
[data-theme="light"] .product-toolbar .toolbar-model { color: #235a89; background: #eaf3fb; border-color: #a8c8e2; }
[data-theme="light"] .product-toolbar .toolbar-model:hover { color: #153e62; background: #dceeff; border-color: #78afdc; }
[data-theme="light"] .product-table-note { color: var(--ink-3); background: #f6f8fa; }

[data-theme="light"] .native-table { background: #fff; }
[data-theme="light"] .native-table th, [data-theme="light"] .native-table td { border-bottom-color: #e8edf1; }
[data-theme="light"] .native-table thead th { color: var(--ink-3); background: #f2f5f7; }
[data-theme="light"] .native-table .column-groups th { background: #e9eef2; }
[data-theme="light"] .native-table .line-name { background: #fbfcfd; }
[data-theme="light"] .native-table .financial-row .line-name { color: var(--ink-2); }
[data-theme="light"] .native-table .role-detail .line-name { color: #667481; }
[data-theme="light"] .native-table .role-detail td:not(.line-name) { color: #74818c; background-color: #fafbfd; }
[data-theme="light"] .native-table .role-normal td:not(.line-name) { color: #475663; }
[data-theme="light"] .native-table .role-total td:not(.line-name) { color: #273745; }
[data-theme="light"] .native-table .role-ratio td:not(.line-name) { color: #187c85; }
[data-theme="light"] .native-table .role-total td, [data-theme="light"] .native-table .role-key td, [data-theme="light"] .native-table .role-profit td { background: #e8eef5; border-top-color: var(--line-strong); }
[data-theme="light"] .native-table .role-total .line-name, [data-theme="light"] .native-table .role-key .line-name, [data-theme="light"] .native-table .role-profit .line-name { color: var(--ink); background: #e8eef5; }
[data-theme="light"] .native-table .role-ratio td, [data-theme="light"] .native-table .role-profitRatio td { background: #eef5f5; }
[data-theme="light"] .native-table .role-ratio .line-name, [data-theme="light"] .native-table .role-profitRatio .line-name { color: var(--teal); background: #eef5f5; }
[data-theme="light"] .native-table .statement-section td { color: #657482; background: #f3f6f8; }
[data-theme="light"] .native-table .hierarchy-depth-1 .line-name,[data-theme="light"] .native-table .hierarchy-depth-2 .line-name { color: #667481; background: #fbfcfd; }
[data-theme="light"] .native-table .hierarchy-depth-1:not(.role-key):not(.role-total) td:not(.line-name),[data-theme="light"] .native-table .hierarchy-depth-2 td:not(.line-name),[data-theme="light"] .native-table .hierarchy-depth-1.role-key td { color: #74818c; background: #fafbfd; }
[data-theme="light"] .native-table .source-plan { background-image: repeating-linear-gradient(135deg,rgba(115,86,167,.045) 0 4px,transparent 4px 8px); }
[data-theme="light"] .native-table .source-plan:not(th) { background-color: #fbf9fd; }
[data-theme="light"] .native-table .variance-column { color: #235c91; background-color: #edf5fc; border-left-color: #b5cfe6; }
[data-theme="light"] .native-table tr:hover td:not(.line-name) { background-color: #f3f6fa; }
[data-theme="light"] .native-table .cell-button:hover, [data-theme="light"] .native-table .cell-button.selected { color: var(--ink); background: #e6eef9; }
[data-theme="light"] .line-disclosure:hover { color: var(--blue); }
[data-theme="light"] .product-status, [data-theme="light"] .native-inspector, [data-theme="light"] .native-inspector .inspector-head, [data-theme="light"] .inspector-tabs { background: #fff; }
[data-theme="light"] .inspector-formula, [data-theme="light"] .compare-cell, [data-theme="light"] .trend-stat { background: #f7f9fb; }
[data-theme="light"] .visual-workspace { background: var(--canvas); }
[data-theme="light"] .visual-metric select, [data-theme="light"] .visual-picker-trigger, [data-theme="light"] .chart-expand, [data-theme="light"] .chart-dialog-close { color: var(--ink-2); background: #fff; border-color: var(--line); }
[data-theme="light"] .chart-picker { background: #fff; box-shadow: 0 18px 45px #17243124; }
[data-theme="light"] .chart-picker-option:hover, [data-theme="light"] .chart-picker-option.active { background: #edf3f8; }
[data-theme="light"] .chart-replace-option, [data-theme="light"] .chart-replace-cancel { background: #fff; }
[data-theme="light"] .chart-card { background: #fff; border-color: var(--line); }
[data-theme="light"] .chart-insight { border-color: var(--line); }
[data-theme="light"] .chart-gridline { stroke: #e1e6eb; }
[data-theme="light"] .chart-zero { stroke: #c3ccd6; }
[data-theme="light"] .chart-axis-label { fill: #73808d; }
[data-theme="light"] .chart-hit:hover { stroke: #17202a; }

[data-theme="light"] .analysis-workspace { background: var(--canvas); }
[data-theme="light"] .analysis-control select, [data-theme="light"] .analysis-card { color: var(--ink-2); background: #fff; border-color: var(--line); }
[data-theme="light"] .analysis-tabs button.active, [data-theme="light"] .analysis-source { color: var(--blue); }
[data-theme="light"] .analysis-driver-track { background: #e3e9ef; }
[data-theme="light"] .analysis-driver-child { background: #f4f7fa; }
[data-theme="light"] .analysis-empty { background: #fff; }
[data-theme="light"] .terminal-main .model-panel, [data-theme="light"] .model-panel, [data-theme="light"] .model-history, [data-theme="light"] .model-bridge { color: var(--ink); background: #fff; border-color: var(--line); }
[data-theme="light"] .terminal-main .model-field input, [data-theme="light"] .terminal-main .model-field select, [data-theme="light"] .terminal-main .model-controls select { color: var(--ink); background: #fff; }
[data-theme="light"] .model-results h3, [data-theme="light"] .model-bridge-head strong { color: var(--ink); }
[data-theme="light"] .model-results .model-major { color: var(--ink); background: #e8eef5; }
[data-theme="light"] .model-form .model-field label, [data-theme="light"] .model-guidance, [data-theme="light"] .model-notes { color: var(--ink-2); }
[data-theme="light"] .model-overlay { background: #0c1c2b6b; }
[data-theme="light"] .model-dialog { color: #172431; background: #eef2f6; border-color: #b7c5d1; box-shadow: 0 34px 110px #142a3c40; }
[data-theme="light"] .model-dialog-header { background: linear-gradient(110deg,#e2edf8,#f6f8fa 48%); border-color: #cdd9e2; }
[data-theme="light"] .model-dialog-heading h2,[data-theme="light"] .model-statement-table tr.anchor th,[data-theme="light"] .model-statement-table tr.anchor td { color: #172431; }
[data-theme="light"] .model-source-picker,[data-theme="light"] .model-content,[data-theme="light"] .model-table-bar,[data-theme="light"] .model-statement-table thead th { background: #fff; border-color: #cdd9e2; }
[data-theme="light"] .model-active-base,[data-theme="light"] .model-dialog-footer { background: #e8eef4; border-color: #cdd9e2; }
[data-theme="light"] .model-source-picker select,[data-theme="light"] .model-editor-field select,[data-theme="light"] .model-editor-field input,[data-theme="light"] .model-close,[data-theme="light"] .model-dialog-footer button { color: #172431; background: #fff; border-color: #cdd9e2; }
[data-theme="light"] .model-session-status,[data-theme="light"] .model-dialog-kicker,[data-theme="light"] .model-active-base span,[data-theme="light"] .model-editor-actions button,[data-theme="light"] .model-bridge-toggle { color: #1b6fae; }
[data-theme="light"] .model-statement-table tbody th,[data-theme="light"] .model-statement-table tbody td { color: #344656; border-color: #dce5ed; }
[data-theme="light"] .model-statement-table tr.anchor { background: #edf6fc; }
[data-theme="light"] .model-statement-table tr.subtotal { background: #f5f8fa; }
[data-theme="light"] .model-statement-table tr.ratio th,[data-theme="light"] .model-statement-table tr.ratio td { color: #187c85; }
[data-theme="light"] .model-statement-table td.positive { color: #177b57; }
[data-theme="light"] .model-statement-table td.negative { color: #b53f4a; }
[data-theme="light"] .model-statement-table tr.anchor td.positive { color: #177b57; }
[data-theme="light"] .model-statement-table tr.anchor td.negative { color: #b53f4a; }
[data-theme="light"] .model-inline-editor-row td,[data-theme="light"] .model-inline-editor { background: #f7fafc; }
[data-theme="light"] .model-dialog-footer .model-export,[data-theme="light"] .model-editor-actions .model-editor-apply { color: #fff; background: #176493; }
[data-theme="light"] .trend-panel { color: var(--ink); background: #fff; border-color: var(--line); }
[data-theme="light"] .trend-panel svg text, [data-theme="light"] .model-history-chart svg text, [data-theme="light"] .model-waterfall svg text, [data-theme="light"] .analysis-card svg text { fill: var(--ink-3); }

[data-theme="light"] .client-setup-panel, [data-theme="light"] .presentation-group, [data-theme="light"] .client-note-preview { background: #fff; border-color: var(--line); }
[data-theme="light"] .client-identity-controls select, [data-theme="light"] .client-knowledge-controls select, [data-theme="light"] .client-knowledge-controls input, [data-theme="light"] .client-backup-import input, [data-theme="light"] .presentation-client select, [data-theme="light"] .presentation-slot select { color: var(--ink); background: #fff; }
[data-theme="light"] .client-note-row button, [data-theme="light"] .client-backup-actions button, [data-theme="light"] .client-backup-import, [data-theme="light"] .presentation-slot button { color: var(--ink-2); background: #f7f9fb; }
[data-theme="light"] .data-upload, [data-theme="light"] .data-history, [data-theme="light"] .data-review { background: #fff; border-color: var(--line); }
[data-theme="light"] .data-preview { color: var(--ink-2); border-color: var(--line); }
[data-theme="light"] .data-import-list button.selected { color: var(--blue); background: #eaf1fa; }
[data-theme="light"] .data-issue { background: #fff; border-color: var(--line); border-left-color: #ad7a2f; }
[data-theme="light"] .data-issue.blocker { border-left-color: var(--red); }
[data-theme="light"] .data-issue p, [data-theme="light"] .data-issue small { color: var(--ink-2); }
[data-theme="light"] .data-approval textarea { color: var(--ink); background: #fff; }
