:root{color-scheme:light}
:root[data-theme="light"]{--muted:#586651;--theme-label:#3e5138;--theme-placeholder:#66735f}
:root[data-theme="light"] :is(.brand small,.workspace small,.nav-caption,.nav-item,.help-button,.profile small,.breadcrumb,.search-trigger,.search-trigger kbd,.eyebrow,.page-heading p,.period-label,.stat-top,.stat-indicator,.panel-heading p,.performance-footer,.chart-empty,.segmented button,.data-table th,.data-table td,.table-name small,.agenda-date span,.agenda-text>span,.channel-strip small,.app-footer,.tabs button,.empty-state p,.post-card-top,.post-excerpt,.post-card-footer>span:last-child,.calendar-weekday,.day-number,.ai-type small,.form-hint,.ai-result-empty p,.asset-list small,.library-empty,.crm-overview>span,.kanban-title>span,.lead-main small,.lead-source,.lead-value,.lead-stage-select,.kanban-add,.conversation-item strong small,.conversation-item p,.conversation-item>div>span,.chat-header>div>span,.chat-date,.message small,.reply-ai>span,.email-info p,.email-info small,.email-card>strong small,.worker-state,.automation-card>p,.flow-preview small,.automation-bottom>span,.automation-bottom strong,.automation-new p,.connection-summary p,.connection-summary>strong,.integration-category,.connection-status,.integration-card>p,.integration-card>small,.integration-bottom>span,.source-bar>span,.source-bar strong,.report-hint,.activity-list>div>span,.activity-list small,.client-card>p:first-of-type,.client-website,.client-brief,.settings-body p,.setting-row,.modal-head p,.modal-body>p,.help-content ol,.search-result small,.login-card>p,.resource-card>small,.media-card code,.operation-step p,.operation-module p,.operation-step code,.operation-section-title>span,.operation-connection-title>div>span,.operation-missing,.operation-webhook,.operation-copy-row,.setup-title p,.setup-muted,.setup-brand span,.setup-checks p,.setup-main>p,.setup-complete p,.setup-shell footer){color:var(--muted)}
:root[data-theme="light"] :is(label,input,textarea,select,.filter-search input,.generated-text,.message p,.flow-preview strong,.chart-empty strong,.ai-result-empty h3,.agenda-date strong,.agenda-more,.lead-value strong,.email-card>strong,.setting-row strong,.command,.search-result,.help-content strong,.avatar,.placeholder .editorial-title){color:var(--theme-label)}
:root[data-theme="light"] :is(input,textarea)::placeholder{color:var(--theme-placeholder);opacity:1}
:root[data-theme="light"] .lead-source>span:last-child:not(.channel){color:var(--muted)}
:root[data-theme="light"] .badge.green{color:#3b6330}
:root[data-theme="light"] .badge.gray{color:#5a6251}
:root[data-theme="light"] .badge.blue{color:#36567f}
:root[data-theme="light"] .badge.amber{color:#756026}
:root[data-theme="light"] :is(.nav-item.active,.nav-item:hover,.tabs button.active,.segmented button.selected,.roas,.calendar-event,.connection-status.saved,.operation-ready,.automation-new h3){color:#3e6331}
:root[data-theme="light"] :is(.demo-note,.info-strip,.sidebar-promo p,.automation-banner p){color:#536848}
:root[data-theme="light"] .demo-note button{color:#426333}
:root[data-theme="light"] :is(.funnel>div,.funnel strong){color:#466538}
:root[data-theme="light"] :is(.copilot-card>p,.ai-hero p){color:#c5d9bf}
:root[data-theme="light"] .copilot-prompts button{color:#dce8d2}
:root[data-theme="light"] .copilot-footer{color:#b6cfaa}
:root[data-theme="light"] .performance-chart text{fill:var(--muted)}
:root[data-theme="dark"]{color-scheme:dark;--bg:#111b18;--surface:#192621;--ink:#e5ede7;--muted:#a2b3a7;--border:#304039;--green:#b0d79c;--lime:#c0e8a8;--mint:#22382b;--theme-raised:#21312a;--theme-input:#14201b;--theme-accent:#b8dea4;--theme-accent-ink:#192d1e}
.theme-topbar-toggle>span{display:none}.theme-sidebar-toggle{display:none}.theme-entry-toggle{position:absolute;top:24px;right:28px;z-index:2;font-size:12px}.login-page{position:relative}.setup-shell{position:relative}.setup-shell>.theme-entry-toggle{top:46px}.theme-preferences label{display:flex;flex-direction:column;gap:8px}.theme-preferences select{width:100%}
:root[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
:root[data-theme="dark"] :is(.sidebar,.topbar,.panel,.stat-card,.connection-summary,.lead-card,.modal,.toast,.flow-node,.btn.secondary){background:var(--surface);border-color:var(--border)}
:root[data-theme="dark"] :is(h1,h2,h3,.plain-link,.stat-value,.table-name strong,.conversation-name,.chat-head strong,.workspace strong,.client-card h2,.setup-brand,.setup-main input,.calendar-toolbar h2){color:var(--ink)}
:root[data-theme="dark"] :is(.page-heading p,.panel-heading p,.nav-caption,.nav-item,.breadcrumb,.search-trigger,.help-button,.app-footer,.stat-top,.stat-bottom,.data-table th,.data-table td,.table-name small,.post-excerpt,.post-card-footer,.integration-card>p,.integration-card>small,.integration-category,.connection-status,.connection-summary p,.connection-summary>strong,.client-website,.client-brief,.client-card>p,.conversation-preview,.conversation-time,.chat-head small,.message small,.email-card p,.email-card small,.settings-body p,.setting-row,.setting-row strong,.form-hint,.modal-head p,.form-error:empty,.filter-search,.tabs button,.empty-state p,.library-empty,.activity-list>div>span,.activity-list small,.flow-preview small,.flow-preview strong,.flow-builder-head p,.advanced-fields p,.kanban-title,.lead-card p,.lead-card small,.automation-card>p,.automation-bottom>span,.automation-bottom strong,.report-hint,.source-bar>span,.source-bar strong,.generated-text,.ai-result-empty p,.ai-chat-welcome p,.ai-chat-session small,.ai-chat-message small,.model-list code,.model-list small){color:var(--muted)}
:root[data-theme="dark"] :is(input,textarea,select){background:var(--theme-input);color:var(--ink);border-color:var(--border);accent-color:var(--theme-accent)}
:root[data-theme="dark"] label{color:var(--muted)}
:root[data-theme="dark"] .message p{color:var(--ink)}
:root[data-theme="dark"] :is(.message,.message.outgoing){border-color:var(--border)}
:root[data-theme="dark"] :is(.data-table th,.data-table td,.conversation-item,.app-footer,.agenda-item,.chat-head,.post-card-footer,.email-card-footer,.automation-bottom,.integration-bottom,.flow-preview>div,.calendar-day,.calendar-weekday){border-color:var(--border)}
:root[data-theme="dark"] :is(.stat-indicator,.period-label,.performance-footer){color:var(--muted)}
:root[data-theme="dark"] :is(input,textarea)::placeholder{color:#83978a;opacity:1}
:root[data-theme="dark"] :is(input,textarea,select):focus{outline-color:#8fb776}
:root[data-theme="dark"] :is(button,a):focus-visible{outline-color:var(--theme-accent)}
:root[data-theme="dark"] .btn.primary{background:var(--theme-accent);border-color:var(--theme-accent);color:var(--theme-accent-ink);box-shadow:none}
:root[data-theme="dark"] .btn.primary:hover{background:#c8ecb6;border-color:#c8ecb6}
:root[data-theme="dark"] .btn.secondary:hover{background:#293c30}
:root[data-theme="dark"] .btn.danger{background:#3a2525;border-color:#623b39;color:#ffb4ab}
:root[data-theme="dark"] .btn.danger:hover{background:#482c2b}
:root[data-theme="dark"] :is(.text-button,.brand-dot,.sidebar-promo button,.copilot-footer,.agenda-more,.agenda-text strong,.ai-chat-message small,.setup-main legend){color:var(--green)}
:root[data-theme="dark"] :is(.nav-item:hover,.icon-btn:hover,.data-table tr:hover td,.conversation-item:hover,.search-result:hover,.calendar-day:hover){background:#23362b;color:var(--ink)}
:root[data-theme="dark"] :is(.nav-item.active,.conversation-item.selected,.ai-chat-session.selected){background:#2b4130;color:#d0e6c2}
:root[data-theme="dark"] :is(.workspace-logo,.nav-badge,.nav-badge.ai,.plan,.stat-icon,.count-badge,.agenda-date,.form-brand,.result-spark,.empty-state>.icon,.robot-icon,.email-icon,.connection-bubble,.automation-banner-icon,.flow-preview .icon,.flow-step,.automation-new>.icon,.activity-list .icon){background:#2a3d2d;color:#bdd5ac}
:root[data-theme="dark"] :is(.sidebar-promo,.demo-note,.info-strip,.automation-banner,.operation-banner,.crm-overview,.secret-setup){background:#203329;border-color:#3a5140;color:#bed1b3}
:root[data-theme="dark"] :is(.sidebar-promo>span,.sidebar-promo p,.demo-note span,.automation-banner h2,.automation-banner p,.worker-state,.operation-banner .text-button){color:#bad0af}
:root[data-theme="dark"] :is(.segmented,.kanban-column,.filter-search,.chat-messages,.ai-chat-sidebar,.advanced-fields,.flow-builder,.command,.json-preview,.simulation-step,.calendar-day.outside,.source-bar>div,.search-trigger kbd){background:var(--theme-input);border-color:var(--border);color:var(--muted)}
:root[data-theme="dark"] :is(.segmented button.selected,.flow-preview>div,.ai-chat-session,.channel-strip>button,.ai-type,.file-visual){background:var(--theme-raised);border-color:var(--border);color:var(--ink)}
:root[data-theme="dark"] :is(.channel-strip>button:hover,.ai-type.active,.automation-new:hover){background:#304532;border-color:#729665;color:#deecd6}
:root[data-theme="dark"] .automation-new{background:#1b2c23;border-color:#4b664a;color:#b6cbaa}
:root[data-theme="dark"] .automation-new :is(h3,p){color:#b6cbaa}
:root[data-theme="dark"] :is(.message,.ai-chat-message){background:#26372c;color:var(--ink)}
:root[data-theme="dark"] :is(.message.outgoing,.ai-chat-message.user){background:#314c33;color:#e5eedf}
:root[data-theme="dark"] .calendar-event{background:#304b34;color:#d4e8c7}
:root[data-theme="dark"] .today .day-number{background:var(--theme-accent);color:var(--theme-accent-ink)}
:root[data-theme="dark"] .badge.green{background:#29452e;color:#c5e4b6}
:root[data-theme="dark"] .badge.gray{background:#2e3d34;color:#c0cec1}
:root[data-theme="dark"] .badge.blue{background:#213d49;color:#abd8ea}
:root[data-theme="dark"] .badge.amber{background:#483a24;color:#efd291}
:root[data-theme="dark"] :is(.connection-status.saved,.roas){color:#b9dc9f}
:root[data-theme="dark"] .stat-card.mint{background:#223b2a}
:root[data-theme="dark"] .mint .stat-icon{background:#354e34;color:#c9e5b9}
:root[data-theme="dark"] :is(.copilot-card,.ai-hero,.operation-hero,.login-brand){background:linear-gradient(120deg,#203c30,#152b24);border-color:#3b5140;color:#edf3e7}
:root[data-theme="dark"] :is(.copilot-card h2,.ai-hero h2,.operation-hero h2,.login-brand h1){color:#edf3e7}
:root[data-theme="dark"] :is(.copilot-card p,.ai-hero p,.login-brand p){color:#b4c7b6}
:root[data-theme="dark"] .copilot-prompts button{background:#294432;border-color:#476046;color:#d1e4c3}
:root[data-theme="dark"] .copilot-prompts button:hover{background:#35543c}
:root[data-theme="dark"] :is(.copilot-icon,.ai-pill){background:#324c35;color:#c0dfa9}
:root[data-theme="dark"] .ai-type small{color:var(--muted)}
:root[data-theme="dark"] :is(.modal-footer,.conversation-list-head){background:#1c2b24;border-color:var(--border)}
:root[data-theme="dark"] .modal-backdrop{background:#060c09bf}
:root[data-theme="dark"] :is(.inline-error,.toast.error){background:#3b2826;border-color:#65413b;color:#ffc0b1}
:root[data-theme="dark"] .form-error{color:#ffb7ab}
:root[data-theme="dark"] .modal :is(label,.form-brand){color:#d7e4d6}
:root[data-theme="dark"] .performance-chart text{fill:var(--muted)}
:root[data-theme="dark"] .performance-chart line{stroke:var(--border)}
:root[data-theme="dark"] .performance-chart path[stroke]{stroke:var(--green)}
:root[data-theme="dark"] .performance-chart circle[fill="#4f845d"]{fill:var(--green)}
:root[data-theme="dark"] :is(.data-table th,.top-divider){background:#203127}
:root[data-theme="dark"] :is(.funnel>div,.funnel>div:nth-child(2),.funnel>div:nth-child(3),.funnel>div:nth-child(4)){background:#293f2e;border-color:#3b5240;color:#c4dabb}
:root[data-theme="dark"] .funnel strong{color:#c7e7b3}
:root[data-theme="dark"] :is(.media-card>img,.media-card>video,.mask-stage){background-color:#14211b}
:root[data-theme="dark"] .mask-tools .active{background:#304b32;color:#d2e7c2}
:root[data-theme="dark"] .post-visual.placeholder{background:linear-gradient(135deg,#283f30,#1c2b23);color:#c5d5bc}
:root[data-theme="dark"] :is(.operation-step p,.operation-module p,.operation-step code,.operation-section-title>span,.operation-connection-title>div>span,.operation-missing,.operation-ready,.operation-webhook,.operation-copy-row){color:var(--muted)}
:root[data-theme="dark"] .operation-webhook{border-color:var(--border)}
:root[data-theme="dark"] .operation-webhook code{background:var(--theme-input);color:#bed4b5}
:root[data-theme="dark"] .operation-number{color:var(--green)}
:root[data-theme="dark"] .login-page{background:var(--bg)}
:root[data-theme="dark"] :is(.login-card h2,.login-card label){color:var(--ink)}
:root[data-theme="dark"] :is(.login-card>p,.setup-title p,.setup-muted,.setup-checks p,.setup-main>p,.setup-complete p,.setup-shell footer,.setup-brand span){color:var(--muted)}
:root[data-theme="dark"] .setup-page{background:var(--bg);color:var(--ink)}
:root[data-theme="dark"] .setup-main input{background:var(--theme-input);border-color:var(--border);color:var(--ink)}
:root[data-theme="dark"] .setup-main fieldset{border-color:var(--border)}
:root[data-theme="dark"] :is(.check-dot.ok,.setup-success){background:#28452e;color:#bdddac}
:root[data-theme="dark"] .check-dot.error{background:#493724;color:#efce96}
:root[data-theme="dark"] .setup-main #setup-status{color:#b7dba3}
:root[data-theme="dark"] .setup-main .form-error{color:#ffb7ab}
:root[data-theme="dark"] ::selection{background:#557643;color:#f1f8e8}
@media(max-width:760px){.theme-topbar-toggle{display:none}.theme-sidebar-toggle{display:flex}.theme-entry-toggle{top:16px;right:16px;padding:8px 10px;font-size:12px}.login-brand{padding-top:64px}.setup-shell>.theme-entry-toggle{position:static;margin:0 0 18px auto;display:flex;width:max-content}.theme-preferences{grid-column:1/-1}}
