/* Shared semantic palette. Original document images/PDFs are never recolored. */
:root{color-scheme:light;--theme-canvas:#f4f6fa;--theme-surface:#fff;--theme-soft:#edf2f8;--theme-hover:#dfe9f5;--theme-text:#182638;--theme-muted:#4c6078;--theme-line:#bac8d9;--theme-link:#2354a0;--theme-focus:#315bc7;--theme-code:#e6edf6;--theme-user:#e3ecfa;--theme-warning-bg:#fff3d6;--theme-warning:#704b00;--theme-error-bg:#ffeaec;--theme-error:#9c2439;--theme-success-bg:#e3f4e9;--theme-success:#17613b}
:root[data-theme=dark]{color-scheme:dark;--theme-canvas:#0b1020;--theme-surface:#151e33;--theme-soft:#1d2b43;--theme-hover:#293d59;--theme-text:#f0f4ff;--theme-muted:#b6c4de;--theme-line:#465976;--theme-link:#aacbff;--theme-focus:#a8c5ff;--theme-code:#0d162b;--theme-user:#1c2942;--theme-warning-bg:#332914;--theme-warning:#ffe0a1;--theme-error-bg:#38202b;--theme-error:#ffd1d9;--theme-success-bg:#17382d;--theme-success:#a5eacb}
:root[data-theme]{--bg:var(--theme-canvas);--panel:var(--theme-surface);--surface-soft:var(--theme-soft);--text:var(--theme-text);--muted:var(--theme-muted);--border:var(--theme-line);--line:var(--theme-line)}
body :is(input,select,textarea,option){color:var(--theme-text);background-color:var(--theme-surface);border-color:var(--theme-line)}
body :is(input,textarea)::placeholder{color:var(--theme-muted);opacity:1}
body :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--theme-focus);outline-offset:2px}
::selection{background:#315bc7;color:#fff}
:root[data-theme] body :is(.export-menu,.modal-card,.responsible-options,.work-drawer,.work-drawer-note,.summary-box,.kv,.doc,.recon,.finding,.command-kpi,.kanban-column-head,.kanban-card,.kanban-audit-pane,.kanban-pinned-summary,.kanban-navigation,.batch-mode-card,.batch-review-card,.assistant-sidecard){background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-line)}
:root[data-theme=dark] :is(.decision-hero,.drawer-note-hero,.kanban-audit-pane.decision,.resolution-section,.audit-viewer-context,.audit-search-results){background:var(--theme-soft);color:var(--theme-text);border-color:var(--theme-line)}
:root[data-theme] body :is(.export-menu,.responsible-options) button{color:var(--theme-text);background:var(--theme-surface)}
:root[data-theme] body :is(.export-menu,.responsible-options) button:is(:hover,[aria-selected=true]),:root[data-theme] body .ghost:hover{background:var(--theme-hover);color:var(--theme-text)}
:root[data-theme] #app .main tbody tr:is(:hover,:focus-within)>:is(td,th){background:var(--theme-hover);color:var(--theme-text)}
:root[data-theme] #app .main :is(.attention-box,.audit-date-row.is-pending){background:var(--theme-warning-bg);color:var(--theme-warning);border-color:var(--theme-warning)}
:root[data-theme] #app .main :is(.assistant-error,.assistant-message.error,.audit-date-row.is-divergent){background:var(--theme-error-bg);color:var(--theme-error);border-color:var(--theme-error)}
:root[data-theme] #app .main :is(.attention-box,.assistant-error,.audit-date-row.is-pending,.audit-date-row.is-divergent) :is(p,small,strong,dt,dd){color:inherit}
:root[data-theme=dark] :is(.upload-state-erro,.upload-state-conflito) span{color:var(--theme-error)}
:root[data-theme=dark] .upload-state-concluido span{color:var(--theme-success)}
:root[data-theme=dark] :is(.logs pre,.priority-reason,.work-focus-panel td.critical-point,.work-drawer-list li,.work-note-finding,.kanban-card .card-action,.kanban-audit-rule p,.kanban-decision-copy,.workflow-event p,.audit-billing-row dt){color:var(--theme-muted)}
:root[data-theme=dark] .kanban-drop-hint{background:var(--theme-soft);color:var(--theme-muted);border-color:var(--theme-line)}
:root[data-theme=dark] :is(.responsible-options button[aria-selected=true],#treatmentMine[aria-pressed=true],.audit-search-hit:hover,.assistant-suggestion:hover,#sidebarToggle:hover){background:var(--theme-hover);color:var(--theme-text);border-color:var(--theme-line)}
:root[data-theme=light] #camelSidebar .nav-item:hover{background:var(--theme-hover);color:var(--theme-text)}
/* Chat uses the same palette, including nested tables and pointer states. */
:root[data-theme] .ca-panel,:root[data-theme] .ca-launch{--ca-bg:var(--theme-canvas);--ca-surface:var(--theme-surface);--ca-text:var(--theme-text);--ca-muted:var(--theme-muted);--ca-line:var(--theme-line);color-scheme:inherit}
:root[data-theme] .ca-panel :is(.ca-context-preview,.ca-message summary,.ca-timeline,.ca-render-timing){color:var(--theme-muted)}
:root[data-theme] .ca-panel .ca-message[data-role=user]{background:var(--theme-user);color:var(--theme-text);border-color:var(--theme-line)}
:root[data-theme] .ca-panel :is(.ca-kpis>div,.ca-message pre){background:var(--theme-code);color:var(--theme-text)}
:root[data-theme] .ca-panel :is(button:hover,.ca-table-scroll th){background:var(--theme-hover);color:var(--theme-text)}
:root[data-theme] .ca-panel .ca-table-scroll :is(td,th){color:var(--theme-text);border-color:var(--theme-line)}
:root[data-theme] .ca-panel .ca-table-scroll td{background:var(--theme-surface)}
:root[data-theme] .ca-panel .ca-table-scroll tr:is(:hover,:focus-within)>:is(td,th),:root[data-theme] dialog.camel-chat-panel tr:is(:hover,:focus-within)>:is(td,th){background:var(--theme-hover);color:var(--theme-text)}
:root[data-theme] .ca-panel .ca-alert{background:var(--theme-warning-bg);color:var(--theme-warning);border-color:var(--theme-warning)}
:root[data-theme] .ca-panel .ca-alert[data-error=true]{background:var(--theme-error-bg);color:var(--theme-error);border-color:var(--theme-error)}
:root[data-theme] .ca-panel .ca-badge{color:var(--theme-link);border-color:var(--theme-line)}
:root[data-theme] .ca-panel .ca-badge:is([data-state=partial],[data-state=historical]){background:var(--theme-warning-bg);color:var(--theme-warning)}
:root[data-theme] .ca-panel .ca-badge:is([data-state=technical_error],[data-state=forbidden]){background:var(--theme-error-bg);color:var(--theme-error)}
:root[data-theme] .ca-panel .ca-status[data-connected=true]{color:var(--theme-success)}
:root[data-theme] .ca-panel .ca-primary,:root[data-theme] .ca-panel .ca-answer-views [aria-pressed=true]{background:#315bc7;color:#fff;border-color:#315bc7}
/* Chart exports retain the chart's explicit dark palette in both app themes. */
:root[data-theme] .ca-panel .chat-chart{background:var(--theme-surface);color:var(--theme-text)}
:root[data-theme] .ca-panel .chat-chart :is(button,summary,figcaption,th,td){background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-line)}
:root[data-theme] .ca-panel .chat-chart :is(p,small){color:var(--theme-muted)}
:root[data-theme] .ca-panel .chat-chart svg text{fill:#f0f4ff}
:root[data-theme] .ca-panel .chat-chart tr:hover>td{background:var(--theme-hover);color:var(--theme-text)}
