/* Shared app theme. Light mode retains the existing page palettes. */
.sidebar .beeai-theme-toggle{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;padding:8px 12px;margin:0 0 8px;border:1px solid #ffffff26;border-radius:9px;background:#ffffff0a;color:#cbd8ed;font:inherit;font-size:12px;box-shadow:none;cursor:pointer}
.sidebar .beeai-theme-toggle:hover{background:#ffffff18;color:#fff}
.sidebar .beeai-theme-toggle:focus-visible{outline:2px solid #8db9ff;outline-offset:2px}
html[data-theme="dark"]{--ink:#e0e7f2;--muted:#a3b1c6;--line:#344155;--blue:#438bf5;background:#101722;color:#e0e7f2;color-scheme:dark}
html[data-theme="dark"] body{background:#101722!important;color:#e0e7f2}
html[data-theme="dark"] :is(main,.main,.agents-main,.chat-page,.video-tool-main){background-color:#101722;color:#e0e7f2}
html[data-theme="dark"] :is(.card,.stat,.module-card,.dashboard-stats article,.management-task,.support-conversations,.task-dialog,.modal-content,.dialog,.panel,.ag-agent-card,.ag-workspace,.ag-task-card,.ag-job-card,.ag-run-card,.ag-detail-panel,.ag-secondary,.video-card,.image-card,.transcript-panel,.transcript-message,.advisor-text-panel,.fb-post,.company-card,.customer-card){background:#1b2534!important;color:#e0e7f2!important;border-color:#344155!important;box-shadow:none}
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),textarea,select){background:#131d2b!important;color:#e0e7f2!important;border-color:#40516a!important}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#95a4bb!important}
html[data-theme="dark"] :is(th,td){border-color:#344155}
html[data-theme="dark"] th{background:#202e40;color:#b8c7dc}
html[data-theme="dark"] :is(.notice,.link-preview,.tag,.mode,.schedule-extra,.ag-quiet:hover,.ag-composer,.ag-conversation-head){background:#243247!important;color:#c3d4eb!important;border-color:#40516a!important}
html[data-theme="dark"] :is(.agents-muted,.empty,.empty b,.activity small,.section-note,.field-tip,.preview-tip,.card-title>span,label small,.placeholder){color:#a3b1c6!important}
html[data-theme="dark"] :is(.module-card a,.dashboard-list .card-title>a,.detail a){color:#8bbaff}
html[data-theme="dark"] :is(.status.published,.status.completed){background:#173d32;color:#83dfb8}
html[data-theme="dark"] :is(.status.failed,.ag-notice){background:#452c30;color:#ffc0b8;border-color:#775057}
html[data-theme="dark"] :is(.actions,.reactions,.activity){border-color:#344155;color:#a3b1c6}
html[data-theme="dark"] :is(.sidebar-language-menu){background:#1b2534;border-color:#40516a;color:#e0e7f2}
html[data-theme="dark"] .sidebar-language-menu button{color:#e0e7f2}
html[data-theme="dark"] :is(.ag-panel,.ag-template-dialog,.ag-stage-popover,.ag-work-menu,.ag-template-option,.ag-session-item,.ag-work-row,.ag-run-row,.ag-message,.ag-auto-task,.ag-task-welcome,.ag-setup-aside){background:#1b2534!important;color:#e0e7f2!important;border-color:#344155!important}
html[data-theme="dark"] :is(.ag-task-filters,.ag-tabs,.ag-summary-cards>*,.ag-preview-text,.ag-scenario-chip,.ag-page-button,.ag-upload-chip){background:#243247!important;color:#c3d4eb!important;border-color:#40516a!important}
html[data-theme="dark"] :is(.ag-work-row.active,.ag-run-row.active,.ag-session-item.active,.ag-page-button.active){background:#2c3c61!important;border-color:#8497ef!important;color:#e0e7f2!important}
html[data-theme="dark"] :is(.ag-panel,.ag-agent-card,.ag-work-row,.ag-run-row) :is(h2,h3,h4,label){color:#e0e7f2}
/* Controls and native dialogs also occur outside the regular app sidebar. */
html[data-theme="dark"]{--blue:#1c64c8}
.beeai-theme-floating{position:fixed;right:18px;bottom:max(18px,env(safe-area-inset-bottom));z-index:1001;display:flex;align-items:center;gap:7px;width:auto;min-height:40px;padding:9px 14px;border:1px solid #b9c7da;border-radius:999px;background:#fff;color:#23405f;font:600 12px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 3px 12px #17213b18;cursor:pointer}
html[data-theme="dark"] .beeai-theme-floating{background:#243247;color:#e0e7f2;border-color:#647996}
html[data-theme="dark"] :is(dialog,[role="dialog"]){background:#1b2534!important;color:#e0e7f2!important;border-color:#647996!important;color-scheme:dark}
html[data-theme="dark"] dialog::backdrop{background:#040a14bb;backdrop-filter:blur(4px)}
html[data-theme="dark"] :is(input:not([type="hidden"]),textarea,select){caret-color:#e0e7f2;accent-color:#8bbaff}
html[data-theme="dark"] :is(input,textarea,select,button,a):focus-visible{outline:2px solid #a5c9ff;outline-offset:3px}
html[data-theme="dark"] :is(input,textarea,select):disabled{color:#aabbd3!important;-webkit-text-fill-color:#aabbd3;opacity:1}
html[data-theme="dark"] :is(input[readonly],textarea[readonly]){color:#c5d1e3!important}
html[data-theme="dark"] ::selection{background:#365c9b;color:#fff}
/* Browser default links and buttons need explicit dark colors too. */
html[data-theme="dark"] a{color:#9bc4ff}
html[data-theme="dark"] button:not([class]){background-color:#243247;color:#e0e7f2;border-color:#647996}
html[data-theme="dark"] .telegram-icon{background-color:#175aad!important;color:#fff!important}
html[data-theme="dark"] .good{color:#83dfb8!important}
html[data-theme="dark"] .cm-primary{background:#a81432!important;color:#fff!important}
html[data-theme="dark"] :is(.connect-button,.primary-button){color:#fff}
html[data-theme="dark"] :is(button,input,textarea,select):disabled{opacity:1}
/* Keep the guest call controls clear by placing its switch in the top bar. */
.beeai-theme-inline{display:flex;align-items:center;justify-content:center;gap:6px;width:auto;height:34px;padding:0 10px;margin:0;border:1px solid #b9c7da;border-radius:11px;background:#fff;color:#23405f;box-shadow:none;font:600 11px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;cursor:pointer}
html[data-theme="dark"] .beeai-theme-inline{background:#243247;color:#e0e7f2;border-color:#647996}
@media(max-width:520px){.beeai-theme-inline{width:34px;padding:0;flex:none}.beeai-theme-inline [data-theme-label]{display:none}}

/* Compact account controls: language, then theme, followed by sign out. */
.sidebar.sidebar{background-color:#101b38}
.sidebar.sidebar .sidebar-foot{flex-wrap:nowrap;gap:6px;padding-left:0;padding-right:0}
.sidebar.sidebar .sidebar-foot .profile{gap:6px}
.sidebar.sidebar .profile .avatar{width:28px;height:28px}
.sidebar.sidebar .profile-language{margin-left:0}
.sidebar.sidebar .profile-language .sidebar-language-trigger{width:30px;height:32px}
.sidebar.sidebar .profile .beeai-theme-icon{flex:none;display:grid;place-items:center;width:30px;height:32px;min-height:0;padding:0;margin:0;border:1px solid #344562;border-radius:10px;background:transparent;color:#a9bbd5;box-shadow:none}
.sidebar.sidebar .profile .beeai-theme-icon:hover{background:#253557;border-color:#536987;color:#fff}
.beeai-theme-icon [data-theme-label]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.beeai-theme-icon .nav-icon{display:grid;place-items:center;width:18px;height:18px}
.beeai-theme-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
html[data-theme="light"] .beeai-theme-icon .theme-sun,html[data-theme="dark"] .beeai-theme-icon .theme-moon{display:none}
.sidebar.sidebar .nav-section-label{color:#94a5c0}
