.theme-toggle{font-size:1.2rem;padding:5px;width:40px;min-height:40px;flex:none;line-height:1}.auth-theme{position:fixed;top:18px;right:18px;z-index:10}
html[data-theme=dark]{color-scheme:dark;background:#12161d;color:#eef1f6;--canvas:#12161d;--surface:#1b222c;--surface-raised:#232d39;--surface-soft:#202936;--hover:#293646;--selected:#2b405c;--ink:#eef1f6;--muted:#b6c0ce;--line:#3f4b5c;--control-border:#728299;--accent:#b1ccf8;--on-accent:#15233b;--green:#aacbff;--link:#aacbff;--white:var(--surface);--lime:var(--selected);--success-bg:#1d392f;--success-text:#b4e7c9;--warning-bg:#3d3220;--warning-text:#f5d69a;--danger-bg:#442c30;--danger-text:#ffb9b5;--info-bg:#24364e;--info-text:#bdd8ff}
html[data-theme=dark] body{background:var(--canvas);color:var(--ink)}
html[data-theme=dark] :is(h1,h2,h3,h4,label,dt,dd,strong){color:inherit}
html[data-theme=dark] :is(p,small,.muted,.note,.hint,.eyebrow,.back){color:var(--muted)}
html[data-theme=dark] a{color:var(--link)}
html[data-theme=dark] :is(input,select,textarea){background:#161d27;color:var(--ink);border-color:var(--control-border);caret-color:#a5e5e7}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#a0afba;opacity:1}
html[data-theme=dark] input[readonly]{background:#25343e;color:#becbd4}
html[data-theme=dark] button,html[data-theme=dark] .btn{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
html[data-theme=dark] :is(button,.btn).secondary{background:var(--surface-raised);color:#d4eff2;border-color:var(--control-border)}
html[data-theme=dark] :is(button,.btn).subtle{background:transparent;color:#b4dfe8;border-color:transparent}
html[data-theme=dark] :is(button,.btn).danger,html[data-theme=dark] .catalog-delete{background:transparent;color:var(--danger-text);border-color:#79514f}
html[data-theme=dark] :is(button,input,select,textarea,a):focus-visible{outline-color:var(--accent)}
html[data-theme=dark] :is(.panel,.metric,.vacancy-card,.demand-card,.kanban-card,.crm-column,.history-session,.document-file,.document-request-card,.settings-tabs,.settings-panel,.settings-checklist,.settings-person,.wa-load-result,.recipient-preview,.audience-preview,.intake-example,.link-box,.checklist-edit-row,.quick-picker,.label-options .check,.label-catalog article){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] :is(.app-toolbar,.app-shell .sidebar,.app-shell .main,.app-shell .page-content){background:#171e27;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .app-shell .page-content{background:var(--canvas)}
html[data-theme=dark] :is(.app-shell .nav a,.account a,.account button,.app-location strong){color:#d9e7ed}
html[data-theme=dark] .nav a.active{background:var(--selected);color:var(--ink)}
html[data-theme=dark] .nav a:hover{background:#20333e}
html[data-theme=dark] :is(.app-product,.dashboard-hero-eyebrow,.settings-preview-label,.vacancy-specialty,.crm-job,.kanban-empty){color:var(--muted)}
html[data-theme=dark] :is(.hero,.next-action,.number,.empty-icon,.avatar,.contact-avatar,.welcome-symbol,.journey span,.funnel a,.settings-checklist-icon){background:var(--surface-raised);color:var(--ink);border-color:#3b5e68}
html[data-theme=dark] :is(.dashboard-hero,.auth-story){background:#202e41;color:#eff7fa;border-color:#42606c}
html[data-theme=dark] :is(.dashboard-hero p,.auth-story p,.auth-story .eyebrow){color:#c3dce4}
html[data-theme=dark] :is(.capture-tabs a,.crm-stage-links a,.tabs button,.settings-tabs a,.wa-inbox-tabs a){background:var(--surface-soft);border-color:var(--line);color:var(--muted)}
html[data-theme=dark] :is(.capture-tabs a[aria-current],.settings-tabs a[aria-current],.tabs button.active,.wa-inbox-tabs a[aria-current],.crm-stage-links a[aria-current]){background:var(--selected);color:var(--ink);border-color:var(--accent)}
html[data-theme=dark] :is(.kanban-column,.journey .done){background:var(--surface-soft);color:#b5d0db;border-color:var(--line)}
html[data-theme=dark] :is(.kanban-column-heading>span,.badge){background:#29424c;color:#d1e9ed}
html[data-theme=dark] :is(.pill,.label-chip){background:#243b46;color:#d2e8ef;border-color:#4c6875}
html[data-theme=dark] .pill.good,html[data-theme=dark] .notice.good{background:var(--success-bg);color:var(--success-text);border-color:#397a62}
html[data-theme=dark] .pill.warn{background:var(--warning-bg);color:var(--warning-text)}
html[data-theme=dark] .pill.bad{background:var(--danger-bg);color:var(--danger-text)}
html[data-theme=dark] .pill.blue{background:var(--info-bg);color:var(--info-text)}
html[data-theme=dark] .notice{background:var(--warning-bg);color:var(--warning-text);border-color:#7d663c}
html[data-theme=dark] :is(.error,.form-error){color:var(--danger-text)}
html[data-theme=dark] .form-error{background:var(--danger-bg)}
html[data-theme=dark] :is(table,td){color:var(--ink);border-color:var(--line)}
html[data-theme=dark] th{background:#20313c;color:#c2d2de;border-color:var(--line)}
html[data-theme=dark] :is(dialog,.message-action-menu,.app-alert-panel,.app-alerts-panel,.br-calendar,.br-date-picker,.quick-picker){background:var(--surface-raised);color:var(--ink);border-color:#48606e;box-shadow:0 16px 60px #0008}
html[data-theme=dark] dialog::backdrop{background:#0009}
html[data-theme=dark] :is(.message-action-menu>button,.quick-picker button){background:transparent;color:#e3eff4}
html[data-theme=dark] :is(.message-action-menu>button:hover,.message-action-menu>button:focus,.quick-picker button:hover){background:#29444f}
html[data-theme=dark] :is(.auth-form,.professional-portal,.app-offline-page){background:var(--canvas);color:var(--ink)}
html[data-theme=dark] :is(.settings-message-preview,.settings-message-preview .bubble,.button-preview span){background:var(--surface-raised);color:#d4eeee;border-color:#587d86}
html[data-theme=dark] .settings-message-preview .bubble.out{background:#2b3d51}
html[data-theme=dark] .bubble{background:var(--surface-raised);color:var(--ink)}
html[data-theme=dark] .bubble.out{background:#2b3d51;color:var(--ink)}
html[data-theme=dark] .bubble footer{color:#c0ccda}
html[data-theme=dark] .attendance-mode :is(.inbox-panel,.inbox-heading,.inbox-scope,.inbox-search,.inbox-pagination,.chat-panel,.chat-heading,.chat-tab-return,.chat-tools-panel,.inbox-options-panel,.contact-panel,.contact-panel-heading,.attendance-nav-heading){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .attendance-mode .inbox-item{background:var(--surface);color:var(--ink);border-color:#2d3d48}
html[data-theme=dark] .attendance-mode .inbox-item:hover{background:#223740}
html[data-theme=dark] .attendance-mode .inbox-item.selected{background:var(--selected)}
html[data-theme=dark] .attendance-mode :is(.inbox-item-top strong,.chat-heading h2,.chat-heading .chat-person strong){color:var(--ink)}
html[data-theme=dark] .attendance-mode :is(.inbox-preview,.inbox-item small,.inbox-item time,.chat-heading p,.inbox-pagination,.conversation-count){color:#c0ccda}
html[data-theme=dark] .attendance-mode .chat-body,html[data-theme=dark] .attendance-mode .chat-body .conversation{background:var(--canvas);background-image:none;color:var(--ink)}
html[data-theme=dark] .attendance-mode .chat-body .bubble{background:var(--surface-raised);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .attendance-mode .chat-body .bubble.out{background:#2b3d51;color:var(--ink)}
html[data-theme=dark] .attendance-mode .composer{background:var(--surface);border-color:var(--line);color:#d9e5ed}
html[data-theme=dark] .attendance-mode .composer textarea{background:#293340;color:#eaf3f6;border-color:var(--control-border)}
html[data-theme=dark] .attendance-mode .composer button[type=submit]{background:var(--accent);color:var(--on-accent)}
html[data-theme=dark] :is(.chat-tab-return,.contact-documents,.document-request-list){color:var(--ink)}
html[data-theme=dark] :is(.message-quote,.attachment-file,.reply-preview,.attendance-mode .composer>.reply-preview){background:#344254;color:#daedf1;border-color:var(--accent)}
html[data-theme=dark] :is(.message-state,.message-markers,.automatic-label){color:#c2cedd}
html[data-theme=dark] :is(.state-failed,.state-uncertain){color:#ffc2a1}
html[data-theme=dark] :is(.wa-shortcuts,.wa-group-shortcut,.wa-load-status,.delivery-status,.delivery-notice){background:var(--surface-soft);color:#cce4ed;border-color:var(--control-border)}
html[data-theme=dark] :is(.inbox-scope-caption,.inbox-options-panel .wa-inbox-tabs,.chat-tools-panel .chat-menu-tabs){background:var(--surface-soft);color:var(--ink)}
html[data-theme=dark] .document-file-icon{background:#23424b;color:#b7e7ed}
html[data-theme=dark] #toast{background:#29434f;color:#f0f7fa;border:1px solid #65808e}
@media(max-width:700px){html[data-theme=dark] .app-shell .nav{background:#171e27;border-color:var(--line)}html[data-theme=dark] .app-toolbar .theme-toggle{width:34px;min-height:34px}}

@media(max-width:700px){.app-toolbar-actions [data-action=app-install]{display:none}}

.mobile-theme-shortcut,.inbox-mobile-menu{display:none}
html[data-theme=dark] .attendance-mode .inbox-search input{background:#161d27;color:var(--ink);border-color:var(--control-border)}
html[data-theme=dark] .wa-shortcuts a,html[data-theme=dark] .wa-shortcuts button{background:var(--surface-raised);color:#d5e2f5;border-color:#496472}
html[data-theme=dark] .attendance-mode .mobile-back,html[data-theme=dark] .attendance-mode .inbox-list-heading,html[data-theme=dark] .attendance-mode .inbox-list-head,html[data-theme=dark] .attendance-mode .inbox-sort{background:var(--surface);color:var(--muted);border-color:var(--line)}
html[data-theme=dark] .attendance-mode .contact-avatar{background:#34455b;color:#d0edf1}
@media(max-width:700px){.mobile-theme-shortcut,.inbox-mobile-menu{display:inline-flex;width:32px;min-height:34px;padding:4px}.inbox-heading{gap:6px}.attendance-mode .inbox-heading h2{font-size:1.05rem}.chat-header-controls .mobile-theme-shortcut{width:30px;min-height:32px}.inbox-heading>.theme-toggle{width:30px}}

html[data-theme=dark] .attendance-mode .attendance-back{background:var(--surface);color:#d5e2f5;border-color:var(--line)}
html[data-theme=dark] .sidebar .nav a.active{background:var(--selected);color:var(--ink)}
html[data-theme=dark] :is(.dashboard-panel,.dashboard-metric){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.dashboard-metric-top i,.funnel-step,.dashboard-priorities i){background:var(--surface-raised);color:#b8e7ec}
html[data-theme=dark] :is(.dashboard-funnel a,.dashboard-priorities a,.dashboard-recent a){color:#d9e7ed;border-color:var(--line)}
html[data-theme=dark] .dashboard-alert{background:#3b3020;color:var(--warning-text);border-color:#7d663c}
html[data-theme=dark] .dashboard-alert p{color:inherit}
html[data-theme=dark] .dashboard-breakdown meter,html[data-theme=dark] .dashboard-breakdown meter::-webkit-meter-bar{background:#30434d}
html[data-theme=dark] :is(.dashboard-chart svg text,.dashboard-chart text){fill:#b6c6d1}
html[data-theme=dark] :is(.dashboard-chart svg line,.dashboard-chart line){stroke:var(--line)}
html[data-theme=dark] :is(summary,.document-library summary){color:#bfd2dd}

html[data-theme=dark] .urgent-banner{background:var(--warning-bg);color:var(--warning-text);border-color:#a76f4d}

/* Reading, focus and semantic states: avoid pale foregrounds on legacy light cards. */
html[data-theme=dark] :is(.app-shell .nav a,.account a,.account button,.brand){color:var(--ink)}
html[data-theme=dark] :is(.brand small,.app-product){color:var(--muted)}
html[data-theme=dark] .sidebar .nav a.active{background:var(--selected);color:var(--ink);box-shadow:inset 3px 0 var(--accent)}
html[data-theme=dark] :is(button,.btn):hover{background:#c8dcfc;color:var(--on-accent)}
html[data-theme=dark] :is(button,.btn).secondary{border-color:#65758a;color:var(--ink)}
html[data-theme=dark] :is(button,.btn).secondary:hover{background:var(--hover);color:var(--ink);border-color:#8da5c2}
html[data-theme=dark] :is(button,.btn).subtle:hover{background:var(--hover);color:var(--ink)}
html[data-theme=dark] :is(button,input,select,textarea,a,summary):focus-visible,html[data-theme=dark] :is(input,select,textarea):focus{outline:3px solid #b6d3ff;outline-offset:3px;box-shadow:none}
html[data-theme=dark] ::selection{background:#5378a6;color:#fff}
html[data-theme=dark] :is(input,select,textarea){accent-color:var(--accent)}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#aebaca;opacity:1}
html[data-theme=dark] :is(.notice,.dashboard-alert,.queue-notice) :is(p,small,a){color:inherit}
html[data-theme=dark] .queue-notice{background:var(--warning-bg);color:var(--warning-text);border-color:#9c8151}
html[data-theme=dark] :is(.message-action-menu,.attendance-context-menu,.app-alert-panel,.quick-picker){background:var(--surface-raised);color:var(--ink);border-color:#677b96}
html[data-theme=dark] :is(.message-action-menu>button,.attendance-context-menu>button,.quick-picker button){background:transparent;color:var(--ink)}
html[data-theme=dark] :is(.message-action-menu>button,.attendance-context-menu>button,.quick-picker button):is(:hover,:focus){background:#35475e;color:var(--ink)}
html[data-theme=dark] :is(.app-alert-count,.pinned-unread,.nav-unread){background:#a73d44;color:#fff;border-color:#dfa4a9}
html[data-theme=dark] :is(.crm-card,.crm-column .kanban-column-heading,.crm-job){background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .crm-stage-links b{background:#34455b;color:var(--ink)}
html[data-theme=dark] :is(.pagination,.crm-pagination){color:var(--muted)}
html[data-theme=dark] .intake-steps li{color:var(--muted)}
html[data-theme=dark] .intake-steps li>span{background:var(--surface-raised);color:var(--ink)}
html[data-theme=dark] .intake-steps .current{color:var(--ink)}
html[data-theme=dark] .intake-steps .current>span{background:var(--accent);color:var(--on-accent)}
html[data-theme=dark] .intake-steps .done>span{background:var(--success-bg);color:var(--success-text)}
html[data-theme=dark] :is(code,.settings-variables code,.quick-reply-code){background:var(--surface-raised);color:#d0e1fc;border-color:#647690}
html[data-theme=dark] .attendance-mode .inbox-current-view{background:var(--surface);color:var(--muted)}
html[data-theme=dark] .attendance-mode .chat-tools-panel :is(button,a,.attendance-tabs button){background:transparent;color:var(--ink)}
html[data-theme=dark] .attendance-mode .chat-tools-panel :is(button,a):is(:hover,:focus){background:var(--hover);color:var(--ink)}
html[data-theme=dark] .attendance-mode .chat-tools-panel .attendance-tabs button.active{background:var(--selected);color:var(--ink);box-shadow:inset 3px 0 var(--accent)}
html[data-theme=dark] .attendance-mode .chat-body,html[data-theme=dark] .attendance-mode .chat-body .conversation{background:#121821}
html[data-theme=dark] .attendance-mode .chat-body .bubble{font-size:1.0625rem;line-height:1.6}
html[data-theme=dark] .attendance-mode .chat-body .bubble footer{font-size:.8125rem;line-height:1.5;color:#c0ccda}
html[data-theme=dark] .attendance-mode .composer textarea{font-size:1.0625rem;line-height:1.5}
html[data-theme=dark] .attendance-mode .composer .attachment-label{color:var(--link)}
html[data-theme=dark] :is(.document-selection small,.message-hidden){color:var(--muted)}
html[data-theme=dark] .message-state{background:#3c4859;color:#edf2fa}
html[data-theme=dark] :is(.message-state.state-queued,.message-state.state-sending){background:var(--warning-bg);color:var(--warning-text)}
html[data-theme=dark] :is(.message-state.state-failed,.message-state.state-uncertain){background:var(--danger-bg);color:var(--danger-text)}
html[data-theme=dark] .message-state.state-delivered{background:var(--success-bg);color:var(--success-text)}
html[data-theme=dark] .message-state.state-read{background:var(--info-bg);color:var(--info-text)}
html[data-theme=dark] .delivery-notice.ready{background:var(--success-bg);color:var(--success-text)}
html[data-theme=dark] .delivery-notice.attention{background:var(--warning-bg);color:var(--warning-text);border-color:#9c8151}
html[data-theme=dark] .attendance-mode .composer>.delivery-notice.ready{background:transparent;color:var(--success-text)}

html[data-theme=dark] :is(.flow-tabs a,.flow-stats>article,.intake-summary){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .flow-tabs a[aria-current]{background:var(--selected);color:var(--ink);border-color:var(--accent)}

html[data-theme=dark] .layout.app-shell .nav .nav-label{color:inherit}
html[data-theme=dark] .layout.app-shell .nav .nav-unread{background:#a73d44;color:#fff}

html[data-theme=dark] .layout.app-shell .sidebar .nav a{color:var(--muted)}
html[data-theme=dark] .layout.app-shell .sidebar .nav a.active{color:var(--ink)}
html[data-theme=dark] .layout.app-shell .nav .nav-label{color:var(--ink)}
@media(max-width:700px){html[data-theme=dark] .layout.app-shell .nav .nav-label{font-size:.75rem;line-height:1.25}}
