/* Global appearance and language preferences. Loaded last on every prototype entry. */
.sidebar-collapse-btn{min-width:44px!important;width:44px!important;height:44px!important}
.investor-shell .dashboard-grid>aside .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.exca-preferences{position:fixed;left:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom));z-index:160;font-family:"Inter",system-ui,sans-serif}.exca-preferences details{position:relative}.exca-preferences summary{min-width:64px;height:44px;display:flex;align-items:center;justify-content:center;gap:7px;padding:0 11px;color:var(--ink-800);background:color-mix(in srgb,var(--surface) 94%,transparent);border:1px solid var(--line);border-radius:13px;box-shadow:0 8px 24px rgb(4 31 72 / 14%);cursor:pointer;list-style:none;backdrop-filter:blur(10px)}.exca-preferences summary::-webkit-details-marker{display:none}.exca-preferences summary svg{width:18px;height:18px}.exca-preferences summary span{font-size:.6rem;font-weight:800;white-space:nowrap}.exca-preference-panel{position:absolute;bottom:52px;left:0;width:min(286px,calc(100vw - 24px));max-height:calc(100dvh - 130px);padding:14px;overflow:auto;color:var(--ink-950);background:var(--surface);border:1px solid var(--line);border-radius:17px;box-shadow:0 22px 55px rgb(3 20 47 / 22%)}.exca-preference-panel header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 2px 10px;border-bottom:1px solid var(--line)}.exca-preference-panel header strong{font:800 .72rem var(--font-heading)}.exca-preference-panel header button{width:44px;height:44px;display:grid;place-items:center;margin:-9px -9px -9px 0;color:var(--ink-600);background:transparent;border:0;border-radius:10px;font-size:1.25rem;cursor:pointer}.exca-preference-group{margin-top:13px}.exca-preference-group>span{display:block;margin-bottom:7px;color:var(--ink-600);font-size:.57rem;font-weight:800;text-transform:uppercase}.exca-preference-group>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.exca-preference-group button{min-width:0;min-height:48px;display:grid;grid-template-columns:30px minmax(0,1fr);align-items:center;gap:7px;padding:7px 9px;color:var(--ink-800);text-align:left;background:var(--canvas);border:1px solid var(--line);border-radius:11px;cursor:pointer}.exca-preference-group button i{width:30px;height:30px;display:grid;place-items:center;color:var(--ink-600);background:var(--surface);border-radius:8px;font-size:.62rem;font-style:normal;font-weight:800}.exca-preference-group button span{overflow-wrap:anywhere;font-size:.61rem;font-weight:700}.exca-preference-group button.active{color:var(--brand-blue);background:var(--brand-blue-soft);border-color:#7eaae5}.exca-preference-group button.active i{color:#fff;background:var(--brand-blue)}

html[data-theme="dark"]{color-scheme:dark;--brand-blue:#6aa7ff;--brand-blue-dark:#9bc5ff;--brand-navy:#0b2346;--brand-blue-soft:#122b4d;--brand-orange:#ff8a45;--brand-orange-dark:#ffad7a;--brand-orange-soft:#3d261b;--ink-950:#f5f8fc;--ink-900:#edf2f8;--ink-800:#e3eaf4;--ink-700:#c9d4e3;--ink-600:#aab7ca;--ink-500:#94a3b8;--ink-400:#8290a5;--line:#2b3b52;--canvas:#0b1422;--surface:#111e31;--surface-soft:#17263b;--success:#43c896;--success-soft:#12382f;--warning:#f5b94e;--warning-soft:#3d3018;--danger:#ff7b88;--danger-soft:#402028;--purple:#b79aed;--purple-soft:#2e2444;--shadow-sm:0 5px 18px rgb(0 0 0 / 22%);--shadow-md:0 18px 45px rgb(0 0 0 / 34%)}
html[data-theme="dark"] body{color:var(--ink-950);background:var(--canvas)}
html[data-theme="dark"] .hub-header{color:#f5f8fc!important;background:rgb(4 19 41 / 92%)!important;border-color:rgb(255 255 255 / 12%)!important}
html[data-theme="dark"] .hub-logo{filter:brightness(0) invert(1)!important}
html[data-theme="dark"] .hub-header-status{color:#c8d6ec!important}
html[data-theme="dark"] .hub-header-status b{color:#90a6c6!important;border-color:rgb(255 255 255 / 15%)!important}
html[data-theme="dark"] .hub-visual-note{color:var(--ink-950)!important;background:rgb(13 33 58 / 88%)!important;border-color:#355071!important}
html[data-theme="dark"] :is(.public-header,.dash-topbar,.investor-sidebar,.internal-auth-panel,.modal-panel,.modal-actions,.account-menu-popover,.account-subpanel,.agent-panel,.agent-prompts,.agent-composer,.agent-footer,.catalog-mobile-filterbar){color:var(--ink-950);background:color-mix(in srgb,var(--surface) 96%,transparent)!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(.staff-topbar,.role-access-banner){color:var(--ink-950);background:color-mix(in srgb,var(--surface) 96%,transparent)!important;border-color:var(--line)!important}
html[data-theme="dark"] .role-access-facts span{color:var(--ink-600);background:#17263b!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(.card:not(.card-blue):not(.card-orange),.kpi,.quick-action,.finance-step,.product-card,.category-card,.option-card,.role-card,.task-card,.approval-card,.applicant-card,.document-library article,.internal-security-grid article,.investor-order-stat,.investor-order-card,.partner-action-grid button,.help-category,.help-sop,.faq-list details,.journey-options article,.journey-trust-list>div,.esign-reader-card,.esign-action-card){color:var(--ink-950);background:var(--surface)!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(.role-pill,.metric,.investor-order-meta div,.applicant-checks,.review-data-grid>div,.review-checklist label,.registration-progress>div,.registration-consents,.verification-channel,.kyc-requirement-grid>div,.review-timeline,.review-facts>div,.help-flow article,.help-track-result,.branch-checklist label,.branch-photo-placeholder,.branch-kanban>section,.branch-form-field input,.branch-form-field select,.branch-form-field textarea,.control,.chip,.bubble:not(.mine),.agent-composer input,.upload,.modal-dropzone,.upload-file-state,.modal-confirmation){color:var(--ink-800);background:#17263b!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(input,select,textarea){color:var(--ink-950);background-color:#17263b;border-color:var(--line)}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#8796aa}
html[data-theme="dark"] :is(.btn-secondary,.icon-btn,.sidebar-collapse-btn,.table-action){color:var(--brand-blue);background:var(--surface)!important;border-color:#39516f!important}
html[data-theme="dark"] :is(.status-note.neutral,.esign-reader-toolbar>span){color:var(--ink-800);background:#203149}
html[data-theme="dark"] .notice{color:#b9d7ff;background:#102b4d;border-color:#28517f}
html[data-theme="dark"] .notice.warning{color:#ffd58a;background:#3a2c15;border-color:#705326}
html[data-theme="dark"] .public-account-links .data-row{color:var(--ink-950);background:var(--surface)}
html[data-theme="dark"] .public-account-links .data-row:hover{background:#192a42}
html[data-theme="dark"] .catalog-empty{color:var(--ink-600);background:var(--surface);border-color:var(--line)}
html[data-theme="dark"] .option-card.selected{background:#102b4d}
html[data-theme="dark"] .journey-section,html[data-theme="dark"] .help-section{background:var(--canvas)}
html[data-theme="dark"] .journey-steps article{background:#142239;border-color:var(--line)}
html[data-theme="dark"] .agent-message-avatar,html[data-theme="dark"] .agent-avatar,html[data-theme="dark"] .agent-mini-mark{background:var(--surface);border-color:var(--line)}
html[data-theme="dark"] .modal-backdrop{background:rgb(1 7 16 / 78%)}
html[data-theme="dark"] .brand-loader{color:var(--ink-950);background:#0b1422}
html[data-theme="dark"] .brand-loader-mark{background:var(--surface);border-color:var(--line)}
html[data-theme="dark"] .brand-loader-logo,html[data-theme="dark"] .public-nav>a>img{filter:brightness(0) invert(1)}
html[data-theme="dark"] .brand-loader-progress{background:#28384e}
html[data-theme="dark"] :is(.internal-field>div,.branch-role-picker summary,.branch-role-menu,.public-user-menu,.shift-chip){color:var(--ink-950);background:#17263b!important;border-color:var(--line)!important}
html[data-theme="dark"] .internal-field>div:focus-within,html[data-theme="dark"] .branch-role-picker[open] summary{border-color:#6aa7ff!important;box-shadow:0 0 0 3px rgb(106 167 255 / 18%)}
html[data-theme="dark"] .branch-role-option{color:var(--ink-900);background:transparent}
html[data-theme="dark"] .branch-role-option:hover{background:#1d3049}
html[data-theme="dark"] .branch-role-option:has(input:checked){background:#102f55}
html[data-theme="dark"] :is(.branch-role-leading,.branch-role-option-icon){color:#a9ccff;background:#203149}
html[data-theme="dark"] .branch-role-option:has(input:checked) .branch-role-option-icon{color:#b9d7ff;background:#294260}
html[data-theme="dark"] .internal-login-error{color:#ffb5bd;background:#3b2028;border-color:#6b3440}
html[data-theme="dark"] :is(input,select,textarea):-webkit-autofill{-webkit-text-fill-color:var(--ink-950);box-shadow:0 0 0 1000px #17263b inset}
html[data-theme="dark"] select option{color:var(--ink-950);background:#17263b}
html[data-theme="dark"] .btn-primary{color:#fff;background:#185aa8!important;border-color:#185aa8!important}
html[data-theme="dark"] .btn-orange{color:#fff;background:#b94700!important;border-color:#b94700!important}
html[data-theme="dark"] .card-blue{color:#fff;background:#0b4ca6!important}
html[data-theme="dark"] .card-orange{color:#fff;background:#a94208!important}
html[data-theme="dark"] .chart{background:repeating-linear-gradient(to bottom,transparent 0,transparent 44px,#25354b 45px),linear-gradient(to top,rgb(91 156 255 / 13%),transparent 65%)}
html[data-theme="dark"] .timeline-dot{border-color:var(--surface);box-shadow:0 0 0 1px var(--line)}
html[data-theme="dark"] .esign-document{color:#dce5f2;background:#0d1726}
html[data-theme="dark"] .esign-document-facts{background:var(--line);border-color:var(--line)}
html[data-theme="dark"] .esign-document-facts>div{background:var(--surface)}
html[data-theme="dark"] .esign-document>section p,html[data-theme="dark"] .esign-disclosure p{color:var(--ink-600)}
html[data-theme="dark"] .esign-canvas{background:#0d1726;border-color:#54647a}
html[data-theme="dark"] .branch-table th,html[data-theme="dark"] .branch-table td{border-color:var(--line)}
html[data-theme="dark"] .branch-copy-box{color:#a9ccff;background:#102b4d;border-color:#426a9d}
html[data-theme="dark"] .branch-location{background:#102b4d}
html[data-theme="dark"] .branch-location>span{background:var(--surface)}
html[data-theme="dark"] .branch-number-input span{background:#203149;border-color:var(--line)}
html[data-theme="dark"] .branch-bars{background:linear-gradient(180deg,transparent,#10233e)}
html[data-theme="dark"] .map-placeholder{filter:brightness(.7) saturate(.7)}

/* Dark-mode contrast completion: semantic states, onboarding, signature, and active controls. */
html[data-theme="dark"] .exca-preference-group button.active i{color:#fff;background:#185aa8}
html[data-theme="dark"] .notice.success{color:#9de7c8;background:#12382f;border-color:#2f6b58}
html[data-theme="dark"] .notice.danger{color:#ffbdc4;background:#402028;border-color:#743541}
html[data-theme="dark"] .status-note.success{color:#78ddb3}
html[data-theme="dark"] .status-note.warning{color:#ffd07a}
html[data-theme="dark"] .status-note.danger{color:#ff9eaa}
html[data-theme="dark"] .status-note.purple{color:#cfb8ff}
html[data-theme="dark"] .chip.active{color:#fff;background:#185aa8!important;border-color:#185aa8!important}
html[data-theme="dark"] .registration-progress>div{color:var(--ink-900);background:var(--surface)!important;border-color:var(--line)!important}
html[data-theme="dark"] .registration-progress span{color:var(--ink-700);background:#203149}
html[data-theme="dark"] .registration-progress .done span{color:#8be1bd;background:#12382f}
html[data-theme="dark"] .registration-progress .active{color:#fff;background:#185aa8!important;border-color:#185aa8!important}
html[data-theme="dark"] .registration-progress .active span{color:#cfe4ff;background:#10335d}
html[data-theme="dark"] .verification-channel.is-verified .verification-state{color:#78ddb3}
html[data-theme="dark"] .journey-choice-section{background:var(--canvas)}
html[data-theme="dark"] :is(.esign-signer,.esign-disclosure,.esign-read-state,.esign-document-end,.esign-evidence){color:var(--ink-900);background:#17263b;border-color:var(--line)}
html[data-theme="dark"] .esign-signer>span{color:var(--ink-600);background:#203149}
html[data-theme="dark"] .esign-signer.active{background:#102f55;border-color:#35669b}
html[data-theme="dark"] .esign-signer.active>span{color:#fff;background:#185aa8}
html[data-theme="dark"] .esign-signer.active b{color:#9bc5ff}
html[data-theme="dark"] .esign-signer.done{background:#12382f;border-color:#2f6b58}
html[data-theme="dark"] .esign-signer.done b,html[data-theme="dark"] .esign-document-end{color:#8be1bd}
html[data-theme="dark"] .esign-read-state{color:#ffd58a;background:#3a2c15}
html[data-theme="dark"] .esign-read-state.complete{color:#8be1bd;background:#12382f}
html[data-theme="dark"] .esign-disclosure{background:#3a2c15;border-color:#705326}
html[data-theme="dark"] .esign-evidence{color:#9de7c8;background:#12382f;border-color:#2f6b58}
html[data-theme="dark"] .esign-evidence p{color:#9fcfbd}
html[data-theme="dark"] .esign-document-letterhead img{filter:brightness(0) invert(1)}

/* Component surfaces that use literal light colors in their source styles. */
html[data-theme="dark"] .detail-meta>span{color:var(--ink-700);background:var(--surface-soft)!important}
html[data-theme="dark"] .investor-order-filters button{color:var(--ink-700);background:var(--surface)!important;border-color:var(--line)!important}
html[data-theme="dark"] .investor-order-filters button.active{color:#fff;background:#185aa8!important;border-color:#185aa8!important}
html[data-theme="dark"] .investor-action-list button{color:var(--ink-900);background:var(--surface)!important}
html[data-theme="dark"] .investor-action-list button:hover{background:#192a42!important}
html[data-theme="dark"] .approval-kpis>div{color:var(--ink-900);background:var(--surface)!important;border-color:var(--line)!important}
html[data-theme="dark"] .branch-kanban header span{color:var(--ink-900);background:var(--surface)!important}
html[data-theme="dark"] .branch-kanban article{color:var(--ink-900);background:var(--surface)!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(.help-search,.p1-search,.help-empty){color:var(--ink-900);background:var(--surface)!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(.help-escalation,.review-decision-state){color:#ffd58a;background:#3a2c15!important;border-color:#705326!important}
html[data-theme="dark"] .review-decision-state.rejected{color:#ffbdc4;background:#402028!important;border-color:#743541!important}
html[data-theme="dark"] .review-decision-state.approved{color:#9de7c8;background:#12382f!important;border-color:#2f6b58!important}
html[data-theme="dark"] .otp-grid input{color:var(--ink-950);background:var(--surface-soft)!important;border-color:var(--line)!important}
html[data-theme="dark"] .modal-filter-intro>span{background:var(--surface)!important}
html[data-theme="dark"] .finance-step:not(:last-child)::after{color:var(--brand-blue);background:var(--surface)!important;border-color:var(--line)!important}
html[data-theme="dark"] .control:focus-within,html[data-theme="dark"] .agent-composer input:focus{background:var(--surface-soft)!important;border-color:#6aa7ff!important}
html[data-theme="dark"] :is(.account-menu-card,.account-security-card){background:var(--surface)!important;border-color:var(--line)!important}
html[data-theme="dark"] .account-password-settings{color:var(--ink-950);background:var(--surface-soft)!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(.account-contact-options button,.account-verification-code input,.account-password-field>div){color:var(--ink-950);background:var(--surface)!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(.account-subview-head button,.account-settings-note){color:var(--ink-800);background:#203149!important;border-color:var(--line)!important}
html[data-theme="dark"] .account-security-title .account-item-icon{color:#a9ccff;background:#203149!important}
html[data-theme="dark"] .account-preference:hover,html[data-theme="dark"] .account-preference:focus-visible{background:#192a42!important}
html[data-theme="dark"] .account-password-field button:hover{background:#203149!important}
html[data-theme="dark"] .account-step-label.success,html[data-theme="dark"] .account-password-result{color:#78ddb3}
html[data-theme="dark"] .account-password-result.is-error{color:#ff9eaa}

/* The hub keeps its photographic identity, while the light theme raises contrast. */
html[data-theme="light"] body:has(.hub){color:#102039;background:#eaf0f7}
html[data-theme="light"] .hub-header{background:rgb(255 255 255 / 88%);border-color:#dbe3ee}
html[data-theme="light"] .hub-logo{filter:none}
html[data-theme="light"] .hub-header-status{color:#51637b}
html[data-theme="light"] .hub-header-status b{color:#6c7d94;border-color:#d8e1ec}
html[data-theme="light"] .hub-main{background:#eaf0f7}
html[data-theme="light"] .hub-main::after{background:linear-gradient(180deg,rgb(234 240 247 / 20%) 0%,rgb(234 240 247 / 78%) 52%,#eaf0f7 88%),linear-gradient(90deg,#eaf0f7 0%,rgb(234 240 247 / 90%) 36%,rgb(234 240 247 / 30%) 78%)}
html[data-theme="light"] .hub-background-photo{opacity:.3;filter:saturate(.68) contrast(.95)}
html[data-theme="light"] .hub-copy h1{color:#102039}
html[data-theme="light"] .hub-copy h1 span{color:#075fd8}
html[data-theme="light"] .hub-copy>p,html[data-theme="light"] .hub-section-head p,html[data-theme="light"] .hub-visual-note p{color:#52657f}
html[data-theme="light"] .hub-eyebrow,html[data-theme="light"] .hub-section-head span,html[data-theme="light"] .hub-visual-kicker{color:#075fd8}
html[data-theme="light"] .hub-proof span{border-color:#bac7d8}
html[data-theme="light"] .hub-proof small{color:#657991}
html[data-theme="light"] .hub-visual-note{color:#102039;background:rgb(255 255 255 / 76%);border-color:#cbd7e6}
html[data-theme="light"] .hub-footer{color:#667a94;background:#eaf0f7;border-color:#d7e0eb}

/* Mobile controls remain reachable without covering app navigation or safe areas. */
@media(max-width:780px){.exca-preferences{left:max(8px,env(safe-area-inset-left));bottom:max(10px,env(safe-area-inset-bottom))}.exca-preferences summary{min-width:44px;width:44px;padding:0}.exca-preferences summary span{display:none}.exca-preference-panel{bottom:50px;width:min(276px,calc(100vw - 16px));max-height:calc(100dvh - 160px)}.modal-root{padding:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}.modal-panel{max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px)}.modal-actions{padding-bottom:max(14px,env(safe-area-inset-bottom))}.dash-content{padding-bottom:70px!important}}
@media(max-width:780px){body :is(.btn,.icon-btn,.sidebar-collapse-btn,.table-action,.chip,.catalog-mobile-filterbar button,.modal-actions button,.account-menu-trigger,.agent-prompts button,.faq-list summary){min-height:44px}body :is(.icon-btn,.sidebar-collapse-btn,.table-action){min-width:44px}.exca-preferences{max-width:calc(100vw - 16px)}.exca-preference-panel{overscroll-behavior:contain}.account-menu-popover,.account-subpanel{max-width:calc(100vw - 20px);max-height:calc(100dvh - 92px);overflow:auto;overscroll-behavior:contain}}
@media(max-width:380px){.exca-preference-panel{width:min(264px,calc(100vw - 16px))}.exca-preference-group button{grid-template-columns:26px minmax(0,1fr);padding-inline:7px}.exca-preference-group button i{width:26px;height:28px}.exca-preference-group button span{font-size:.57rem}}
@media(min-width:781px){body:has(.investor-shell) .exca-preferences,body:has(.staff-shell) .exca-preferences{top:19px;right:calc(var(--page-gutter) + 250px);bottom:auto;left:auto;z-index:155}body:has(.investor-shell) .exca-preference-panel,body:has(.staff-shell) .exca-preference-panel{top:52px;right:0;bottom:auto;left:auto}}
@media(prefers-reduced-motion:reduce){.exca-preferences *{transition:none!important}}
