/* Complete light-theme layer. Loaded last so page-specific dark styles cannot win. */
html[data-ui-theme=light]{
 --ink:#f5f1e9;--panel:#fffdfa;--line:rgba(76,57,24,.18);--muted:#6d675e;
 --light-bg:#f5f1e9;--light-panel:#fffdfa;--light-panel-alt:#f9f5ec;
 --light-text:#29251f;--light-muted:#6d675e;--light-gold:#805a12;
}
html[data-ui-theme=light] body{background:var(--light-bg)!important;color:var(--light-text)!important}
html[data-ui-theme=light] .navbar{background:rgba(255,253,250,.94)!important;box-shadow:0 1px 18px rgba(53,40,15,.07)}
html[data-ui-theme=light] .navbar-brand,html[data-ui-theme=light] a{color:var(--light-gold)}
html[data-ui-theme=light] .app-footer{background:#eee7da;color:#625b51}

html[data-ui-theme=light] :is(.admin-shell,.simple-admin,.user-home,.workspace-dashboard,.profile-page,.practice-setup,.unanswered-page,.conversation-report,.chat-shell,.chat-main,.voice-stage--polished,.auth-stage){
 background:radial-gradient(circle at 82% 0,rgba(210,151,39,.12),transparent 28%),var(--light-bg)!important;color:var(--light-text)!important
}
html[data-ui-theme=light] :is(.gold-hero){background:#f5f1e9!important;color:var(--light-text)!important}
html[data-ui-theme=light] .gold-hero__art{background:linear-gradient(90deg,rgba(245,241,233,.99) 0%,rgba(245,241,233,.93) 35%,rgba(245,241,233,.3) 68%,rgba(245,241,233,.12)),url('images/aitalk-gold-orb.png') center/cover no-repeat!important}

html[data-ui-theme=light] :is(.card,.auth-card,.auth-card--gold,.admin-provider,.admin-stats,.admin-panel,.provider-card,.provider-saved,.simple-status,.simple-step-grid,.simple-metrics>div,.simple-advanced,.user-actions>a,.user-recent,.profile-summary,.profile-form,.profile-links,.practice-config>section,.practice-choice-grid label>span,.unanswered-summary,.unanswered-filters,.unanswered-results,.report-metrics,.report-filters,.conversation-results,.response-legend,.response-legend article,.detail-metrics,.conversation-metadata,.transcript-report,.response-explanation,.response-explanation dl>div,.knowledge-admin>div:first-child,.knowledge-metrics,.knowledge-entry,.prompt-list article,.brand-live-preview,.brand-preview,.chat-sidebar,.chat-header,.bubble,.composer,.voice-console){
 background:var(--light-panel)!important;color:var(--light-text)!important;box-shadow:none
}
html[data-ui-theme=light] :is(.conversation.active,.practice-choice-grid input:checked+span,.user-actions>a:hover,.admin-links>a:hover,.conversation-cards>article:hover){background:#f4ead5!important}

html[data-ui-theme=light] :is(h1,h2,h3,h4,h5,h6,strong,.admin-hero h1,.admin-provider strong,.admin-stats h2,.admin-panel__heading h2,.admin-links strong,.simple-admin>header h1,.simple-heading h2,.user-home>header h1,.workspace-hero h1,.profile-heading h1,.practice-setup h1,.practice-choice-grid strong,.unanswered-hero h1,.report-hero h1,.report-metrics strong,.conversation-results h2,.response-legend h2,.transcript-report h2,.conversation-card-main h3 a,.response-legend strong,.transcript-content>header strong,.knowledge-admin>div:first-child h1,.category-list strong,.prompt-list h3,.voice-title,.chat-title strong,.auth-card--gold h2){color:var(--light-text)!important}
html[data-ui-theme=light] :is(p,small,.text-secondary,.admin-hero p,.admin-provider span,.admin-links small,.user-home>header p,.simple-admin>header p,.simple-status p,.workspace-dashboard p,.profile-heading p,.practice-setup header p,.practice-choice-grid p,.unanswered-hero p,.report-hero p,.report-metrics em,.conversation-card-main p,.response-legend p,.transcript-report header p,.transcript-content time,.response-explanation p,.knowledge-metrics span,.category-list small,.prompt-list p,.voice-connection,.chat-title small,.message-time,.auth-card--gold>p){color:var(--light-muted)!important}

html[data-ui-theme=light] :is(.form-control,.form-select,textarea,input){background-color:#fff!important;color:var(--light-text)!important;border-color:#cfc5b4!important}
html[data-ui-theme=light] :is(.form-control,.form-select,textarea,input)::placeholder{color:#8a8378!important;opacity:1}
html[data-ui-theme=light] .table{--bs-table-color:var(--light-text);--bs-table-bg:transparent;--bs-table-border-color:#ddd4c6}
html[data-ui-theme=light] .table>:not(caption)>*>*{color:var(--light-text);background:transparent}
html[data-ui-theme=light] :is(.btn-outline-secondary,.btn-outline-primary){background:#fff;color:#654a17;border-color:#bcae96}

html[data-ui-theme=light] .message.user .bubble{background:#ecd18f!important;color:#2f230d!important}
html[data-ui-theme=light] .composer-wrap{background:linear-gradient(transparent,var(--light-bg) 25%)!important}
html[data-ui-theme=light] .chat-sidebar #search{background:#fff!important}
html[data-ui-theme=light] .transcript-bubble{background:#fff!important;color:var(--light-text)!important;border-color:#ded5c7!important}
html[data-ui-theme=light] .transcript-message.user .transcript-bubble{background:#f4e6c5!important}
html[data-ui-theme=light] .ui-toast{background:#fff;color:var(--light-text);box-shadow:0 18px 55px rgba(56,41,13,.16)}
html[data-ui-theme=light] .ui-empty b{color:var(--light-text)}
html[data-ui-theme=light] .brand-color-field input[type=color]{background:#fff!important}
html[data-ui-theme=light] .voice-switch--polished{background:#fff!important}
html[data-ui-theme=light] .voice-switch :is(span,a){color:#625b51}
html[data-ui-theme=light] .voice-switch .active{color:#17130c}
html[data-ui-theme=light] .gold-grid{opacity:.12}

@media(prefers-reduced-motion:reduce){html[data-ui-theme=light] *{transition-duration:.01ms!important}}

/* Readability guardrails for components that ship with literal dark-theme colors. */
html[data-ui-theme=light] .provider-shell{background:radial-gradient(circle at 85% 0,rgba(208,150,40,.11),transparent 26%),var(--light-bg)!important;color:var(--light-text)!important}
html[data-ui-theme=light] :is(.provider-guide,.provider-list article,.profile-card,.unanswered-list>article,.unanswered-empty,.workspace-overview,.workspace-recent,.workspace-shortcuts,.workspace-status,.local-ai-status,.ai-switch-grid label,.route-test-results div){background:var(--light-panel)!important;color:var(--light-text)!important;box-shadow:none}
html[data-ui-theme=light] main :is(h1,h2,h3,h4,h5,h6){color:var(--light-text)!important}
html[data-ui-theme=light] main :is(p,li,label,dt,dd,.form-text){color:#514c44!important}
html[data-ui-theme=light] main :is(small,time){color:#6d675e!important}
html[data-ui-theme=light] :is(.provider-fields label>span,.provider-active strong,.provider-list article strong,.provider-guide strong,.profile-field label,.profile-meta dd,.profile-links strong,.unanswered-content h3,.unanswered-summary>a strong,.voice-state-label,.voice-transcript){color:var(--light-text)!important}
html[data-ui-theme=light] :is(.profile-summary,.profile-card,.profile-links){background:var(--light-panel)!important}
html[data-ui-theme=light] .profile-field .form-control:disabled{background:#eee9df!important;color:#655f56!important}
html[data-ui-theme=light] :is(.knowledge-tags span,.profile-badges span,.response-flow span){background:#f7eedc!important;color:#59451e!important}
html[data-ui-theme=light] :is(.alert-info,.alert-primary){background:#edf5fa!important;color:#24485e!important;border-color:#bfd8e6!important}
html[data-ui-theme=light] :is(.alert-success,.profile-alert.success){background:#eaf7ee!important;color:#235f37!important;border-color:#aad5b7!important}
html[data-ui-theme=light] :is(.alert-danger,.profile-alert.error){background:#fff0ed!important;color:#7b3026!important;border-color:#e4b3aa!important}
html[data-ui-theme=light] .bg-light{background:#f8f4ec!important;color:var(--light-text)!important}
html[data-ui-theme=light] hr{border-color:#cfc5b4;opacity:1}
html[data-ui-theme=light] svg{color:inherit}

/* Chat-history contrast in light mode. */
html[data-ui-theme=light] .chat-sidebar{background:#fffdf8!important;border-color:#d8cfbf!important;color:#28251f!important}
html[data-ui-theme=light] .chat-sidebar__head strong{color:#28251f!important}
html[data-ui-theme=light] .chat-sidebar #search{background:#fff!important;border-color:#bfb39f!important;color:#28251f!important}
html[data-ui-theme=light] .chat-sidebar #search::placeholder{color:#746d62!important}
html[data-ui-theme=light] .conversation-row{border-radius:9px}
html[data-ui-theme=light] .conversation{color:#403a32!important;background:transparent!important;border-color:transparent!important;font-weight:500}
html[data-ui-theme=light] .conversation:hover{background:#f7efdf!important;border-color:#d8c7a6!important;color:#563d0c!important}
html[data-ui-theme=light] .conversation.active{background:#ead8b4!important;border-color:#b28a3e!important;color:#342507!important;box-shadow:inset 3px 0 #a6751e}
html[data-ui-theme=light] .conversation .app-icon{color:#805a12!important}
html[data-ui-theme=light] .conversation-controls button{color:#625a4e!important}
html[data-ui-theme=light] .conversation-controls button:hover{background:#e7dcc8!important;color:#2f230d!important}
html[data-ui-theme=light] :is(.chat-history-close,.chat-history-open){background:#fff!important;border-color:#bfb39f!important;color:#4f3a12!important}

/* Final contrast audit: shared text and interactive states. */
html[data-ui-theme=light] main{color:#29251f!important}
html[data-ui-theme=light] main :is(p,li,label,legend,dt,dd,caption,figcaption){color:#4e4941!important}
html[data-ui-theme=light] main :is(.form-text,.text-muted,.text-secondary,small,time){color:#686158!important}
html[data-ui-theme=light] main :is(.provider-empty,.knowledge-empty,.unanswered-empty,.empty-state){color:#514b43!important}
html[data-ui-theme=light] main :is(.provider-empty,.knowledge-empty,.unanswered-empty,.empty-state) strong{color:#29251f!important}
html[data-ui-theme=light] main a:not(.btn):not(.gold-button):not(.workspace-primary){color:#72500f!important}
html[data-ui-theme=light] main a:not(.btn):not(.gold-button):not(.workspace-primary):hover{color:#3f2c08!important}
html[data-ui-theme=light] :is(.message-actions button,.conversation-controls button){color:#5e574e!important}
html[data-ui-theme=light] :is(.message-actions button,.conversation-controls button):hover{color:#2d281f!important}
html[data-ui-theme=light] .chat-suggestions button{background:#fff!important;border-color:#bfb39f!important;color:#403a32!important}
html[data-ui-theme=light] .chat-suggestions button:hover{background:#f4ead5!important;border-color:#9a742d!important;color:#342507!important}
html[data-ui-theme=light] :is(.btn-outline-warning,.btn-outline-danger){background:#fff!important}
html[data-ui-theme=light] .btn-outline-warning{color:#684a0d!important;border-color:#a98034!important}
html[data-ui-theme=light] .btn-outline-danger{color:#812d2d!important;border-color:#c27a7a!important}
html[data-ui-theme=light] :is(.gold-button,.btn-primary,.workspace-primary,.send){color:#171109!important}
html[data-ui-theme=light] :is(.eyebrow,.practice-step,.prompt-mode,.voice-kicker,.workspace-hero__copy>span,.workspace-recent header span,.workspace-shortcuts>span,.workspace-overview article>span){color:#765213!important}
html[data-ui-theme=light] :is(.knowledge-status,.prompt-status,.profile-badges span,.source-badge){font-weight:600}
html[data-ui-theme=light] :is(code,pre){background:#eee8dc!important;color:#302b24!important;border-color:#cfc5b4!important}
html[data-ui-theme=light] :focus-visible{outline-color:#805a12!important}
