/* Persistent application theme. Light remains the default; dark is opt-in from Account Settings. */
.theme-choice{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0;padding:0;border:0}
.theme-choice legend{grid-column:1/-1;margin-bottom:8px;font-weight:850}
.theme-choice label{position:relative;min-width:0;cursor:pointer}
.theme-choice input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.theme-choice label>span{display:grid;grid-template-columns:auto 1fr;gap:3px 12px;min-height:92px;align-content:center;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.theme-choice label i{grid-row:1/3;align-self:center;color:var(--brand);font-size:27px;font-style:normal}
.theme-choice label strong{font-size:15px}.theme-choice label small{color:var(--muted);line-height:1.35}
.theme-choice label.selected>span{border-color:var(--brand);box-shadow:inset 0 0 0 1px var(--brand),0 0 0 3px rgba(198,161,91,.14)}
.theme-choice input:focus-visible+span{outline:3px solid rgba(198,161,91,.28);outline-offset:2px}
.theme-choice-note{margin:12px 0 0;color:var(--muted);font-size:12px}

html[data-theme="dark"]{color-scheme:dark;--ink:#f2eee5;--muted:#b9b1a3;--line:#4a443a;--panel:#1c1a17;--page:#11100e;--soft:#24211c;--brand:#ddb868;--brand-dark:#080808;--teal:#d0a85a;--cyan:#c39745;--amber:#e2bd6b;--rose:#ef7f72;--shadow:0 12px 34px rgba(0,0,0,.36)}
html[data-theme="dark"] body{background:#11100e;color:var(--ink)}
html[data-theme="dark"] :is(.shell,.main,.workspace-layout){background-color:#11100e}
html[data-theme="dark"] .auth-shell{background:radial-gradient(circle at top left,rgba(221,184,104,.14),transparent 34%),linear-gradient(135deg,#11100e,#1d1913)}
html[data-theme="dark"] :is(input,select,textarea){border-color:#514a3e;background-color:#171614;color:#f3efe7}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#8e877b;opacity:1}
html[data-theme="dark"] :is(input,select,textarea):disabled{background-color:#25221e;color:#a9a195;opacity:1}
html[data-theme="dark"] :is(input[type="checkbox"],input[type="radio"],input[type="range"]){accent-color:#ddb868}
html[data-theme="dark"] :is(a,.link-button){color:#e4bd68}
html[data-theme="dark"] :focus-visible{outline-color:#e4bd68}

html[data-theme="dark"] :is(.auth-card,.loading-showcase,.section,.modal,.landing-section,.landing-card,.form-card,.primary-card,.financial-card,.inline-financial-card,.employment-card,.expense-card,.monthly-card,.month-card,.scenario-card,.income-summary-card,.insight-card,.kpi-card,.report-card,.scenario-report-card,.budget-report-card,.document-checklist-card,.compliance-policy-card,.retirement-matrix-card,.networth-total-card,.client-library-card,.client-opportunity-card,.client-risk-create-card,.client-risk-match-card,.fact-find-choice-card,.fact-find-ghl-contact-card,.highlevel-connection-card,.user-create-card,.final-notes-card,.tax-client-card,.tax-working-section,.print-option-card,.report-reference-card,.dashboard-test-panel,.dashboard-test-chart-panel,.budget-report-panel,.budget-split-panel,.chart-panel,.client-opportunity-notes-panel,.client-notes-field-manager,.ad-hoc-panel,.scenario-expense-panel){border-color:#484238;background:#1c1a17;color:#f2eee5;box-shadow:var(--shadow)}
html[data-theme="dark"] :is(.section-header,.section-body,.section-row,.section-note,.section-comment,.notice,.toolbar-secondary,.plan-toolbar,.client-notes-toolbar,.fact-find-ghl-toolbar,.ghl-pipeline-toolbar,.import-review-toolbar,.monthly-toolbar,.variables-toolbar,.client-opportunity-fields,.ghl-client-card-fields,.ghl-client-card-notes,.client-notes-field-options,.import-review-field,.field-block,.pill-field,.prefix-field,.retirement-test-field){border-color:#494238;color:#f2eee5}
html[data-theme="dark"] :is(.section-note,.section-comment,.notice,.dashboard-test-notice,.client-opportunity-fields,.ghl-client-card-notes,.import-review-field){background:#26221c}
html[data-theme="dark"] :is(.notice.error,.vault-error){border-color:#9e554d;background:#321b19;color:#ffaaa1}
html[data-theme="dark"] :is(.notice.success,.vault-info){border-color:#377c65;background:#142a23;color:#8fdbc1}
html[data-theme="dark"] :is(.section-header p,.section-body p,.landing-section p,.landing-card small,.modal-head p,.auth-card p,.field-label,.client-card-meta,.theme-choice-note){color:#b9b1a3}

html[data-theme="dark"] :is(.table-wrap,.users-table-wrap,.financial-table-wrap,.people-table-wrap,.document-table-wrap,.budget-table-wrap,.year-table-wrap,.subaccount-table-wrap,.transposed-table-wrap,.application-log-table-wrap){border-color:#4a443a;background:#171614}
html[data-theme="dark"] :is(.vault-table,.users-table,.financial-table,.people-table,.document-checklist-table,.budget-report-table,.monthly-detail-table,.monthly-table,.pension-access-table,.retirement-client-table,.retirement-line-table,.retirement-setup-table,.retirement-test-table,.subaccount-table,.subaccount-year-column-table,.year-table,.application-log-table) :is(th,td){border-color:#484238}
html[data-theme="dark"] :is(.vault-table,.users-table,.financial-table,.people-table,.document-checklist-table,.budget-report-table,.monthly-detail-table,.monthly-table,.pension-access-table,.retirement-client-table,.retirement-line-table,.retirement-setup-table,.retirement-test-table,.subaccount-table,.subaccount-year-column-table,.year-table,.application-log-table) th{background:#29251f;color:#ead7a8}
html[data-theme="dark"] :is(.vault-table,.users-table,.financial-table,.people-table,.document-checklist-table,.budget-report-table,.monthly-detail-table,.monthly-table,.pension-access-table,.retirement-client-table,.retirement-line-table,.retirement-setup-table,.retirement-test-table,.subaccount-table,.subaccount-year-column-table,.year-table,.application-log-table) td{background:#1a1815;color:#eee9df}
html[data-theme="dark"] :is(.button,.icon-btn,.toolbar-action,.client-notes-toolbar-action){border-color:#575044}
html[data-theme="dark"] :is(.button:not(.primary):not(.danger),.icon-btn,.toolbar-action,.client-notes-toolbar-action){background:#24211c;color:#eee9df}
html[data-theme="dark"] .button.primary{border-color:#ddb868;background:#ddb868;color:#17120a}
html[data-theme="dark"] :is(.utility-menu-panel,.section-rail,.mobile-nav-drawer){border-color:#494238;background:#191714;color:#f2eee5}
html[data-theme="dark"] :is(.utility-menu-panel button:hover,.section-rail-list button:hover){background:#2a261f}

html[data-theme="dark"] .fp-page{--fp-ink:#f1ede4;--fp-muted:#b5aea2;--fp-cream:#211e19;--fp-line:#4b453b;--fp-green:#54c69e;--fp-red:#f07f73}
html[data-theme="dark"] .ss-page{--ss-ink:#f1ede4;--ss-deep:#11120f;--ss-gold-soft:#3a3020;--ss-cream:#211e19;--ss-line:#4b453b;--ss-muted:#b5aea2;--ss-green:#54c69e;--ss-red:#f07f73}
html[data-theme="dark"] :is(.fp-page,.ss-page) :is(.fp-topline,.fp-tabs,.fp-panel,.fp-card,.fp-filter-panel,.fp-table-panel,.fp-detail-panel,.fp-comparison-workspace,.fp-phase,.fp-empty,.fp-loading,.ss-tabs,.ss-panel,.ss-kpi,.ss-filter-panel,.ss-table-panel,.ss-modal,.ss-stock-card,.ss-source,.ss-empty,.ss-loading,.ss-tv-card,.ss-history-section,.ss-metrics-section){border-color:#4b453b;background-color:#1b1916;color:#f1ede4}
html[data-theme="dark"] :is(.fp-page,.ss-page) :is(input,select,button:not(.fp-refresh):not(.ss-refresh)){border-color:#514a3e;background-color:#24211c;color:#f1ede4}
html[data-theme="dark"] :is(.fp-page,.ss-page) table th{border-color:#4b453b;background:#29251f;color:#ead7a8}
html[data-theme="dark"] :is(.fp-page,.ss-page) table td{border-color:#413c34;background:#1a1815;color:#eee9df}
html[data-theme="dark"] :is(.fp-page,.ss-page) tbody tr:nth-child(even) td{background:#201d19}
html[data-theme="dark"] :is(.ss-tabs button.active,.fp-tabs button.active){background:#302a21;color:#f6ead0}
html[data-theme="dark"] :is(.ss-modal-body,.fp-modal-body){background:#171512}

html[data-theme="dark"] :is(.mc-page,.pc-page,.fire-pension-calculator-shell,.rc-page,.btl-page,.mfc-page,.nit-page,.mcx-page){color:#f1ede4}
html[data-theme="dark"] :is(.mc-page,.pc-page,.fire-pension-calculator-shell,.rc-page,.btl-page,.mfc-page,.nit-page,.mcx-page) :is(.mc-topline,.mc-card,.pc-topline,.pc-card,.fire-card,.rc-card,.btl-card,.mfc-card,.nit-card,.mcx-panel,.mcx-modal,.mcx-metric,.mcx-detail-section,.mcx-compare-table-wrap,.mcx-saved-card,.nit-kpis .mc-kpi){border-color:#4b453b;background-color:#1c1a17;color:#f1ede4}
html[data-theme="dark"] :is(.mc-page,.pc-page,.fire-pension-calculator-shell,.rc-page,.btl-page,.mfc-page,.nit-page,.mcx-page) :is(input,select,textarea){border-color:#514a3e;background:#171614;color:#f3efe7}
html[data-theme="dark"] :is(.mc-page,.pc-page,.fire-pension-calculator-shell,.rc-page,.btl-page,.mfc-page,.nit-page,.mcx-page) :is(.mc-back,.mc-button:not(.primary),.pc-back,.pc-button:not(.primary),.fire-button:not(.primary),.rc-button:not(.primary),.btl-button:not(.primary),.mfc-button:not(.primary),.mfc-choice:not(.selected),.mcx-button:not(.mcx-button-primary),.mcx-pagination button){border-color:#575044;background:#24211c;color:#eee9df}
html[data-theme="dark"] :is(.mc-page,.pc-page,.fire-pension-calculator-shell,.rc-page,.btl-page,.mfc-page,.nit-page,.mcx-page) :is(p,small,.mcx-update,.mcx-section-heading p,.mfc-card-head p,.mfc-field>span,.nit-card-head p,.nit-kpis span,.nit-kpis small){color:#b9b1a3}
html[data-theme="dark"] .mcx-table-wrap{border-color:#4b453b;background:#171512}
html[data-theme="dark"] :is(.mcx-table th,.mcx-side-compare th){border-color:#4b453b;background:#29251f;color:#ead7a8}
html[data-theme="dark"] :is(.mcx-table td,.mcx-side-compare td){border-color:#413c34;background:#1a1815;color:#eee9df}
html[data-theme="dark"] :is(.mcx-table tbody tr:nth-child(even) td,.mcx-side-compare tbody tr:nth-child(even) td){background:#201d19}
html[data-theme="dark"] :is(.nit-note,.mcx-alert,.mcx-source,.mcx-formula-note,.mcx-compare-hint,.mcx-compare-toolbar,.mfc-range-field){border-color:#5d5138;background:#2a251b;color:#e8d8ae}

html[data-theme="dark"] :is(.ghl-ff-toolbar,.ghl-ff-list,.ghl-ff-section,.ghl-ff-field,.ghl-ff-related,.ghl-import-modal){border-color:#4b453b;background:#1b1916;color:#f1ede4}
html[data-theme="dark"] .ghl-ff-list>button:not(.button){border-color:#3f3a32;background:#211f1b;color:#f1ede4}
html[data-theme="dark"] :is(.ghl-ff-list>button:not(.button):hover,.ghl-ff-list>button.active){border-color:#ddb868;background:#302819}
html[data-theme="dark"] .ghl-ff-related .ghl-ff-field{background:#211f1b}
html[data-theme="dark"] :is(.ghl-ff-field span,.ghl-ff-related h4){color:#c9c0b2}
html[data-theme="dark"] .ghl-ff-notice{border-color:#6d5a31;background:#302819;color:#ead39a}

html[data-theme="dark"] :is(.mq-page,.rp-page){color:#f1ede4}
html[data-theme="dark"] :is(.mq-steps span,.mq-card,.mq-condition,.mq-condition-followup,.mq-review article,.mq-actions,.rp-panel,.rp-back,.rp-button:not(.primary)){border-color:#4b453b;background:#1c1a17;color:#f1ede4}
html[data-theme="dark"] :is(.mq-steps .active,.mq-condition.selected){border-color:#ddb868;background:#302819}
html[data-theme="dark"] :is(.mq-steps b,.mq-attestation,.mq-consent,.mq-detail-grid>div,.mq-disclosure){background:#29251f;color:#eee9df}
html[data-theme="dark"] :is(.mq-card-head p,.mq-card-head span,.mq-field>span,.mq-detail-grid span,.rp-topline){color:#b9b1a3}
html[data-theme="dark"] :is(.mq-field input,.mq-field select,.mq-joint select,.mq-submission-toolbar input){border-color:#514a3e;background:#171614;color:#f3efe7}
html[data-theme="dark"] .mq-table td{border-color:#484238;background:#1a1815;color:#eee9df}

/* Dense calculator surfaces that use their own component prefixes. */
html[data-theme="dark"] :is(.fpc-page,.bsc-page){color:#f1ede4}
html[data-theme="dark"] .fpc-page :is(.fpc-topline,.fpc-card,.fpc-actions,.fpc-results,.fpc-table-wrap,.fpc-flow-root,.fpc-flow-option,.fpc-flow-help,.fpc-summary-rows),
html[data-theme="dark"] .bsc-page :is(.bsc-topline,.bsc-card,.bsc-actions,.bsc-flow>div,.bsc-assumptions,.bsc-property,.bsc-row-result,.bsc-kpis article,.bsc-waterfall,.bsc-cashflow-chart,.bsc-explainer,.bsc-summary,.bsc-checklist p,.bsc-entry-table-wrap){border-color:#4b453b;background:#1c1a17;color:#f1ede4}
html[data-theme="dark"] :is(.fpc-page,.bsc-page) :is(input,select,textarea){border-color:#514a3e;background:#171614;color:#f3efe7}
html[data-theme="dark"] .fpc-page :is(.fpc-button:not(.primary),.fpc-flow-option),
html[data-theme="dark"] .bsc-page :is(.bsc-button:not(.primary),.bsc-button.secondary){border-color:#575044;background:#24211c;color:#eee9df}
html[data-theme="dark"] :is(.fpc-page,.bsc-page) :is(p,small,label,.fpc-card-head p,.bsc-section-head p,.bsc-flow small,.bsc-kpis span,.bsc-chart-title span,.bsc-disclaimer){color:#b9b1a3}
html[data-theme="dark"] .bsc-input b{border-color:#514a3e;background:#29251f;color:#d5cbb9}
html[data-theme="dark"] .bsc-entry-table :is(th,td){border-color:#443f36;background:#1a1815;color:#eee9df}
html[data-theme="dark"] .bsc-entry-table tbody tr:nth-child(even) td{background:#211e1a}
html[data-theme="dark"] .bsc-entry-table tfoot td{background:#302819;color:#f2dfa9}
html[data-theme="dark"] .bsc-summary td{border-color:#484238;color:#eee9df}
html[data-theme="dark"] :is(.bsc-completion-banner,.bsc-funding-status.positive,.bsc-ready){border-color:#377c65;background:#142a23;color:#9ce1ca}
html[data-theme="dark"] :is(.bsc-row-result.negative,.bsc-funding-status.negative,.bsc-warnings){border-color:#9e554d;background:#321b19;color:#ffaaa1}

/* Fund report builder and comparison controls. */
html[data-theme="dark"] .fp-page :is(.fp-phase-head,.fp-compare-empty,.fp-calendar-performance,.fp-important,.fp-setup,.fp-modal,.fp-kpi,.fp-report-modal,.fp-report-progress,.fp-report-section,.fp-report-choice label,.fp-report-totals span,.fp-report-preview,.fp-report-modal>footer,.fp-detail-allocation,.fp-comparison-allocations,.fp-allocation-card,.fp-selection-chips button,.fp-chart-toolbar>div){border-color:#4b453b;background:#1c1a17;color:#f1ede4}
html[data-theme="dark"] .fp-page :is(.fp-notice,.fp-report-unavailable){border-color:#6d5a31;background:#302819;color:#ead39a!important}
html[data-theme="dark"] .fp-page .fp-notice.error{border-color:#9e554d;background:#321b19;color:#ffaaa1}
html[data-theme="dark"] .fp-page .fp-chart-toolbar button.active{background:#302a21;color:#f6ead0}
html[data-theme="dark"] .fp-page .fp-report-unit-input b{border-color:#514a3e;background:#29251f;color:#d5cbb9}

/* Questionnaire controls and result cards. */
html[data-theme="dark"] .mq-page :is(.mq-condition-question,.mq-condition-options,.mq-condition-section-intro,.mq-anxiety-card,.mq-anxiety-intro,.mq-history-result,.mq-history-result-head,.mq-completion-choice,.mq-review-lifestyle>div){border-color:#4b453b;background:#211f1b;color:#f1ede4}
html[data-theme="dark"] .mq-page textarea{border-color:#514a3e;background:#171614;color:#f3efe7}
html[data-theme="dark"] .mq-alert.error{border-color:#9e554d;background:#321b19;color:#ffaaa1}
html[data-theme="dark"] .mq-alert.success{border-color:#377c65;background:#142a23;color:#9ce1ca}
html[data-theme="dark"] .rp-page :is(.rp-card,.rp-question,.rp-options label,.rp-info,.rp-note,.rp-result,.rp-result-grid>div,.rp-category-section,.rp-capacity-section,.rp-warning-section,.rp-answer-section,.rp-save-panel,.rp-success-card,.rp-sustainability-report,.rp-asset-row,.rp-percent-row,.rp-range-row){border-color:#4b453b;background:#1c1a17;color:#f1ede4}
html[data-theme="dark"] .rp-page :is(input,select,textarea){border-color:#514a3e;background:#171614;color:#f3efe7}
html[data-theme="dark"] .rp-page :is(.rp-question p,.rp-note,.rp-info,.rp-card p,.rp-result p,.rp-save-status,.rp-footer){color:#b9b1a3}
html[data-theme="dark"] .rp-page .rp-form-error{border-color:#9e554d;background:#321b19;color:#ffaaa1}

/* Keep generated report pages visually stable and printable. */
html[data-theme="dark"] :is(.rp-report-cover,.rp-report-section,.rp-answer-table,.mq-report-page,.mq-report-declaration){color-scheme:light;background:#fff;color:#171713}

html[data-theme="dark"] :is(.report-page,.report-sheet,.print-report,.pdf-page,.fp-chart-stage,.ss-tv-widget){color-scheme:light;background-color:#fff;color:#171713}
@media(max-width:640px){.theme-choice{grid-template-columns:1fr}}
@media print{html[data-theme="dark"],html[data-theme="dark"] body{color-scheme:light;background:#fff!important;color:#151515!important}}
