:root { color-scheme:light; }
.theme-picker { position:absolute; right:24px; top:16px; display:flex; align-items:center; gap:10px; font-size:13px; color:var(--neo-muted); }
.theme-picker select { width:160px; margin:0; padding:8px 12px; min-height:40px; font-size:13px; }
.theme-settings { border-bottom:1px solid var(--neo-line); padding-bottom:26px; margin-bottom:28px; }
.theme-settings label { margin-bottom:14px; }.theme-settings h2 { margin-bottom:16px; }
.plan-context-menu button { display:flex; align-items:center; gap:9px; }
.plan-context-menu .pin-icon { width:18px; height:18px; margin:0; color:inherit; }
.plan-group .pin-icon,.plan-history-item .pin-icon { width:18px; height:18px; color:var(--neo-ink); }
[data-theme=dark] {
 color-scheme:dark;
 --neo-bg:#202731; --neo-ink:#eef2f8; --neo-muted:#b1bfd1; --neo-line:#414d5f; --neo-control:#63758c; --neo-red:#e44359;
 --neo-raised:none;
 --neo-small:none;
 --neo-inset:none;
}
[data-theme=dark] body { background:var(--neo-bg); color:var(--neo-ink); }
[data-theme=dark] :is(.shell,.application,.product,.conversation,.loan-option,.queue-table,.financing-plan,dialog,.error-dialog,.summary,.overview-metrics .metric,.analytics-soft-panel,.plan-history,.profile-preview,.profile-trigger,.credit-summary-row) { background:var(--neo-bg); border-color:var(--neo-line); box-shadow:none; color:var(--neo-ink); }
[data-theme=dark] .shell { box-shadow:none; }
[data-theme=dark] .summary.overview-metrics { background:transparent; box-shadow:none; border:0; }
[data-theme=dark] :is(.secondary,.profile-trigger,.error-close,.plan-more,.icon,.text-button,.plan-group>summary,.queue-tabs button,.sidebar-collapsed .cabinet-sidebar nav button) { background:var(--neo-bg); color:var(--neo-ink); border-color:var(--neo-control); }
[data-theme=dark] :is(.secondary,.text-button,.plan-more,.plan-group>summary,.sidebar-collapsed .cabinet-sidebar nav button):hover { background:#323f50; color:#fff; }
[data-theme=dark] :is(.primary,.primary:hover) { color:white; box-shadow:none; }
[data-theme=dark] :is(.chat-message.user,.plan-history-item,.estimate,.bank-case,.queue-table th,.rejection-dialog .approval-terms,.plan-context-menu) { background:#293443; color:var(--neo-ink); border-color:var(--neo-line); box-shadow:none; }
[data-theme=dark] :is(.plan-history-item.selected,.plan-history-item:hover,.plan-context-menu button:hover,.status-visual [data-status-legend].legend-active) { background:#3a4c64; color:#fff; }
[data-theme=dark] .plan-context-menu button { color:var(--neo-ink); }
[data-theme=dark] :is(.plan-history-item strong,.plan-history-item small,.plan-group>summary,.plan-more,.product p,.chart-row span,.monthly-bar>span,.comparison-table-scroll th,.conversation-bar strong,.app-symbol,.brand>span,.metric strong,.credit-summary-row strong) { color:var(--neo-ink); }
[data-theme=dark] :is(.analytics-switch [aria-pressed=true],.analytics-period [aria-pressed=true],.comparison-metrics [aria-pressed=true],.sidebar-collapsed .cabinet-sidebar nav button.active,.queue-tabs button.current) { background:#4a2b38; color:#ffb2bf; border-color:#b2697d; box-shadow:none; }
[data-theme=dark] :is(input,select,textarea,.profile-settings input:not([type=file])) { background:var(--neo-bg); color:var(--neo-ink); border-color:var(--neo-control); box-shadow:none; }
[data-theme=dark] :is(input::placeholder,textarea::placeholder) { color:#a4b4c9; }
[data-theme=dark] :is(button:disabled,input:disabled,textarea:disabled) { background:#303a48; color:#95a2b4; }
[data-theme=dark] :is(.chart-track,.comparison-track,.application .progress i:not(.done):not(.current),.bar-plot) { background:#344154; box-shadow:none; }
[data-theme=dark] .application.status-submitted { --status-color:#6ba5ff; }
[data-theme=dark] .application.status-review { --status-color:#bc91ff; }
[data-theme=dark] .application.status-needs_info { --status-color:#efba61; }
[data-theme=dark] .application.status-approved { --status-color:#66cc92; }
[data-theme=dark] .application.status-rejected { --status-color:#ff8097; }
[data-theme=dark] .application.status-funded { --status-color:#5dcfc2; }
[data-theme=dark] :is(.soft-bar,.soft-bar-stacked,.profile-preview,.avatar-upload) { border-color:var(--neo-line); }
[data-theme=dark] :is(.soft-bar,.empty) { box-shadow:none; }
[data-theme=dark] :is(.bar-tooltip,.analytics-tooltip,.donut-tooltip) { background:#101923; color:#f0f4fa; border-color:var(--neo-line); }
[data-theme=dark] .repayment-ring>div { background:var(--neo-bg); }
[data-theme=dark] :is(.message,.detail p,.detail small,.document-row,.document-upload,.file-pick,.repayment-totals strong,.repayment-totals small,.comparison-bar-heading,.chart-legend,.chart-row strong,.news-item,.soft-chart-value) { color:var(--neo-ink); }
[data-theme=dark] .profile-files { border-color:var(--neo-line); }
[data-theme=dark] .pin-icon { color:#e7edf7; }
[data-theme=dark] #toast { background:#101923; box-shadow:none; }
@media(max-width:600px) { .theme-picker { right:12px; top:19px; }.theme-picker>span { display:none; }.theme-picker select { width:130px; font-size:12px; }.brand-bar .brand>span { font-size:13px; } }

/* Theme parity for nested controls, upload areas and credit details. */
[data-theme=dark] .secondary.credit-detail-link { background:var(--neo-bg); color:var(--neo-ink); border-color:var(--neo-line); }
[data-theme=dark] .secondary.credit-detail-link:hover { background:#303c4c; border-color:#71849c; }
[data-theme=dark] .credit-detail-arrow { color:#ff9bab; background:#273341; }
[data-theme=dark] :is(.file-pick,.document-upload,.avatar-upload,.side-panel) { background:#293443; color:var(--neo-ink); border-color:var(--neo-control); }
[data-theme=dark] :is(.file-pick:hover,.document-upload:hover) { background:#344357; }
[data-theme=dark] :is(.file-selection,.document-upload>span,.side-note,.steps li,.steps li small) { color:var(--neo-muted); }
[data-theme=dark] .steps li::before { background:#35445a; color:#f1f5fb; }
[data-theme=dark] :is(.analytics-table th,.analytics-table td,.comparison-table-scroll th,.comparison-table-scroll td,.repayment-months>div) { color:var(--neo-ink); border-color:var(--neo-line); }
[data-theme=dark] :is(.analytics-table thead,.repayment-months>div:nth-child(even)) { background:#293443; }
[data-theme=dark] :is(.payment-view-switch [aria-pressed=true],.role .selected) { background:#3b2a3b; color:#ffbdc7; border-color:#bd8393; box-shadow:none; }
[data-theme=dark] :is(.paid-label,.eligibility) { color:#91dcc2; }
[data-theme=dark] :is(.advisor-error,#form-error) { color:#ff9dad; }
[data-theme=dark] .preferred .loan-fit { color:#ffacbb; }
[data-theme=dark] .chat-composer button { color:#fff; }
[data-theme=dark] .chat-composer button:disabled { color:#b9c6d7; }
[data-theme=dark] .profile-settings .primary { box-shadow:none; }
[data-theme=dark] .plan-history-list { scrollbar-color:#71849c transparent; }
[data-theme=dark] .plan-history-list::-webkit-scrollbar-track { background:transparent; }
[data-theme=dark] .plan-history-list::-webkit-scrollbar-thumb { background:#71849c; border:0; }
[data-theme=dark] :is(.application .stage-labels .current,.comparison-table-scroll thead th) { color:var(--neo-ink); }
[data-theme=dark] .status-donut.segmented-donut { background:none; box-shadow:none; }
[data-theme=dark] :is(.monthly-chart-panel,.support-help) { color:var(--neo-ink); }
@media(max-width:420px) { .theme-picker { right:10px; }.theme-picker select { width:118px; padding:8px; }.brand-bar .brand { gap:8px; }.brand-bar .brand>span { font-size:11px; letter-spacing:0; } }
[data-theme=dark] .primary { background:#c92c46; border-color:#a8243a; }
[data-theme=dark] .primary:hover { background:#b8223c; }
[data-theme=dark] .plan-placeholder>span { color:#b1bfd1; }

/* Rounded theme menu with keyboard selection and restrained motion. */
.theme-control { position:relative; min-width:160px; }
.theme-toggle { width:100%; min-height:42px; padding:10px 13px; display:flex; align-items:center; justify-content:space-between; gap:14px; border-radius:22px; font-size:13px; }
.theme-toggle svg { width:16px; height:16px; flex:none; transition:transform .2s ease; }
.theme-toggle[aria-expanded=true] svg { transform:rotate(180deg); }
.theme-menu { position:absolute; top:calc(100% + 10px); right:0; width:260px; max-width:calc(100vw - 24px); z-index:1100; padding:8px; border-radius:22px; border:1px solid var(--neo-line); background:var(--neo-bg); box-shadow:none; animation:theme-menu-enter .2s ease-out; transform-origin:top right; }
.theme-menu[hidden] { display:none; }
.theme-menu button { width:100%; display:flex; align-items:center; text-align:left; gap:12px; padding:12px; background:transparent; border:0; border-radius:16px; color:var(--neo-ink); transition:background .18s ease,translate .18s ease; }
.theme-menu button:hover,.theme-menu button:focus-visible { background:#dbe2ed; translate:2px 0; }
.theme-menu button[aria-checked=true] { background:#f1dfe5; color:#991d33; }
.theme-menu strong { display:block; font-size:14px; font-weight:600; }.theme-menu small { display:block; margin-top:3px; font-size:11px; color:var(--neo-muted); }
.theme-option-symbol { font-size:23px; width:24px; text-align:center; }.theme-option-check { margin-left:auto; opacity:0; transform:scale(.5); transition:opacity .18s,transform .18s; }
[aria-checked=true]>.theme-option-check { opacity:1; transform:scale(1); }
.theme-settings .theme-control { margin-bottom:16px; max-width:300px; }.theme-settings .theme-menu { right:auto; left:0; }
[data-theme=dark] .theme-menu button:hover,[data-theme=dark] .theme-menu button:focus-visible { background:#344357; }
[data-theme=dark] .theme-menu button[aria-checked=true] { background:#4a2b38; color:#ffb2bf; }
@keyframes theme-menu-enter { from { opacity:0; transform:translateY(-7px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }
@media(max-width:600px) { .theme-picker .theme-control { min-width:130px; }.theme-toggle { font-size:12px; padding:9px 10px; } }
@media(prefers-reduced-motion:reduce) { .theme-menu { animation:none; }.theme-menu button,.theme-toggle svg,.theme-option-check { transition:none; } }
[data-theme=dark] .starter-prompts .secondary { background:transparent; border-color:var(--neo-control); box-shadow:none; }
[data-theme=dark] .starter-prompts .secondary:hover { background:#34435780; }
[data-theme=dark] .plan-history-item.selected { background:#34465d; border-color:#7388a3; box-shadow:none; }
[data-theme=dark] .comparison-view-switch [aria-pressed=true] { background:#4a2b38; color:#ffb2bf; border-color:#b2697d; }
[data-theme=dark] .comparison-chart[data-view=columns] .comparison-track { background:transparent; box-shadow:none; }

/* Keep scroll handles visible without a framed or filled track. */
html { --scroll-handle:#7b8da6; }
html[data-theme=dark] { --scroll-handle:#71849c; }
html, body, body * { scrollbar-color:var(--scroll-handle) transparent; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track, body *::-webkit-scrollbar-track { background:transparent; border:0; box-shadow:none; }
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb, body *::-webkit-scrollbar-thumb { background:var(--scroll-handle); border:0; border-radius:6px; box-shadow:none; }
html::-webkit-scrollbar-corner, body::-webkit-scrollbar-corner, body *::-webkit-scrollbar-corner { background:transparent; }

/* A continuous edge follows the history panel's rounded corners. */
.advisor-workspace .plan-history {
  border:1px solid #95a5bb;
  background-clip:padding-box;
}
[data-theme=dark] .advisor-workspace .plan-history {
  border-color:#63758c;
}
