/* APEX Adaptive Appearance — applies to product showcase and hosted SaaS beta.
   Styles are original; palette choices do not imply affiliation with other brands. */
body[data-apex-theme="light"] {--bg:#f8fafc;--sidebar:#ffffff;--surface:#ffffff;--border:#e1e7ee;--border2:#cbd5e1;--text:#14263d;--muted:#5e6f84;--light:#f1f5fa;--blue:#2563eb;--bluebg:#edf4ff;--shadow:0 2px 10px #13243b08;--apex-ring:#2563eb;color-scheme:light}
body[data-apex-theme="dark"] {--bg:#0d1727;--sidebar:#101d30;--surface:#182539;--border:#34445a;--border2:#4d6076;--text:#f0f5fb;--muted:#bccadc;--light:#1b3047;--blue:#7faeff;--bluebg:#243f60;--shadow:0 6px 25px #0002;--apex-ring:#7faeff;color-scheme:dark}
body[data-apex-theme="automotive"] {--bg:#0d1015;--sidebar:#12161d;--surface:#1b2029;--border:#404751;--border2:#65707a;--text:#f6f7f9;--muted:#c0c7d0;--light:#272d36;--blue:#f56d61;--bluebg:#402c31;--shadow:0 9px 24px #0006;--apex-ring:#ff796a;color-scheme:dark}
body[data-apex-theme="luxury"] {--bg:#faf7f0;--sidebar:#fffdf8;--surface:#ffffff;--border:#e8dcc6;--border2:#cbb998;--text:#342e29;--muted:#786b59;--light:#f4eddf;--blue:#9e773d;--bluebg:#f8edda;--shadow:0 6px 19px #58421c0c;--apex-ring:#9e773d;color-scheme:light}
body[data-apex-theme="healthcare"] {--bg:#f5fbfa;--sidebar:#ffffff;--surface:#ffffff;--border:#d5e9e5;--border2:#b8d5d0;--text:#173d3b;--muted:#5c7977;--light:#e9f5f3;--blue:#087e80;--bluebg:#e1f3f1;--shadow:0 2px 12px #146b660a;--apex-ring:#087e80;color-scheme:light}
body[data-apex-theme="hospitality"] {--bg:#fcf9f6;--sidebar:#fffefa;--surface:#ffffff;--border:#ebe2db;--border2:#d5bda9;--text:#46352c;--muted:#7b6b63;--light:#f7eee8;--blue:#aa694c;--bluebg:#fff0e8;--shadow:0 2px 14px #8f5a2c0c;--apex-ring:#aa694c;color-scheme:light}
body[data-apex-theme="neon"] {--bg:#0b1020;--sidebar:#10172c;--surface:#19233b;--border:#35405b;--border2:#596b8c;--text:#f0f4ff;--muted:#bcc8e7;--light:#232d49;--blue:#b09bff;--bluebg:#333050;--shadow:0 9px 27px #0504146b;--apex-ring:#b09bff;color-scheme:dark}
body[data-apex-theme="minimal"] {--bg:#ffffff;--sidebar:#ffffff;--surface:#ffffff;--border:#e6e9ef;--border2:#cad1db;--text:#1b2431;--muted:#687789;--light:#f7f9fc;--blue:#36516d;--bluebg:#edf2f6;--shadow:none;--apex-ring:#36516d;color-scheme:light}
/* Common appearance applies to both apps and fixes legacy background color overrides. */
body .topbar,body .sidebar,body .panel,body .chat-main,body .chat-list,body .chat-meta,body .app-card,body .modal,body .sidebar-workspace,body .auth-card,body .integration-card {background:var(--surface);color:var(--text);border-color:var(--border)}
body .sidebar{background:var(--sidebar)}
body .nav-link{color:var(--muted)}
body .nav-link:hover{background:var(--light);color:var(--text)}
body .nav-link.active{background:var(--bluebg);color:var(--blue)}
body .btn:not(.secondary):not(.ghost),body button.btn:not(.secondary):not(.ghost){background:var(--blue);border-color:var(--blue);color:#fff}
body .btn.secondary,body .btn.ghost,body .topbar select,body .icon-button,body .field input,body .field textarea,body .field select,body .data-form input,body .data-form textarea,body .data-form select,body .chat-compose input{background:var(--surface);color:var(--text);border-color:var(--border2)}
body .brand-mark,body .brand-names em{color:var(--blue)}
body .brand-mark{background:var(--blue);color:white}
body .page-title,body h1,body h2,body h3,body h4,body b,body strong{color:var(--text)}
body .page-subtitle,body .section-note,body .sub,body small,body .metric-title,body .metric-note{color:var(--muted)}
body .eyebrow{color:var(--blue)}
body .pill.blue{color:var(--blue);background:var(--bluebg)}
body .chip.active,body .tabbar button.active{color:var(--blue);border-color:var(--blue)}
body .activity-marker,body .metric-icon{color:var(--blue);background:var(--bluebg)}
body .metric-panel,body .panel,body .app-card,body .sidebar-workspace{box-shadow:var(--shadow)}
body .chart .bar{background:linear-gradient(180deg,var(--blue),color-mix(in srgb,var(--blue),#ffffff 38%))}
body .hero-panel{background:linear-gradient(105deg,var(--bluebg),var(--surface));border-color:var(--border2)}
body .hero-content h2 em{color:var(--blue)}
body .hero-content p{color:var(--muted)}
body .chat-bubble,body .thread.active,body .thread:hover{background:var(--light);color:var(--text)}
body .chat-bubble.user,body .bubble.sent{background:var(--bluebg);color:var(--text)}
body .global-banner{border-color:var(--border2);background:var(--light);color:var(--muted)}
body .global-banner strong{color:var(--text)}
body .topbar select,body select{background:var(--surface);color:var(--text)}
body .brand-names small{color:var(--muted)}
body .auth-logo span{color:var(--blue)}
body :is(button,a,input,textarea,select):focus-visible{outline:2px solid var(--apex-ring);outline-offset:2px}
body .app{background:var(--bg)}
body[data-apex-theme="automotive"] .metric-value,body[data-apex-theme="neon"] .metric-value{color:var(--text)}
body[data-apex-theme="automotive"] .sidebar-workspace,body[data-apex-theme="neon"] .sidebar-workspace{background:var(--surface)}
body[data-apex-theme="luxury"] .nav-link.active{font-weight:750}
body[data-apex-theme="minimal"] .panel,body[data-apex-theme="minimal"] .metric-panel{box-shadow:none}
body[data-apex-theme="automotive"] .auth-card,body[data-apex-theme="neon"] .auth-card,body[data-apex-theme="dark"] .auth-card{background:var(--surface);color:var(--text)}
body:is([data-apex-theme="dark"],[data-apex-theme="neon"],[data-apex-theme="automotive"]) #loginScreen{background:var(--bg)}
body:is([data-apex-theme="dark"],[data-apex-theme="neon"],[data-apex-theme="automotive"]) .chat-bubble{background:var(--light);color:var(--text)}
/* Theme picker. Dropdown is full keyboard-accessible, not a decorative control. */
.apex-theme-trigger{min-width:111px;display:inline-flex;align-items:center;gap:7px;justify-content:center;padding:7px 9px;border:1px solid var(--border2);border-radius:8px;background:var(--surface);color:var(--text);font-weight:650;font-size:11px}
.apex-theme-trigger .theme-swatch{width:11px;height:11px;display:inline-block;border-radius:50%;background:var(--blue);box-shadow:0 0 0 2px var(--bluebg)}
.apex-theme-panel{position:fixed;right:22px;top:69px;z-index:1000;border-radius:13px;border:1px solid var(--border2);padding:14px;background:var(--surface);color:var(--text);box-shadow:0 12px 50px #0003;width:min(340px,calc(100vw - 30px));max-height:min(650px,calc(100vh - 85px));overflow-y:auto}
.apex-theme-panel[hidden]{display:none}
.apex-theme-panel h3{font-size:13px;margin:0 0 4px;color:var(--text)}.apex-theme-panel>p{font-size:11px;color:var(--muted);margin:0 0 13px}
.apex-theme-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.apex-theme-choice{display:flex;align-items:center;gap:8px;padding:11px;border-radius:9px;border:1px solid var(--border);background:var(--surface);text-align:left;color:var(--text);font-size:11px}
.apex-theme-choice:hover{border-color:var(--blue)}.apex-theme-choice[aria-pressed="true"]{outline:2px solid var(--blue);border-color:var(--blue);background:var(--bluebg)}
.apex-theme-preview{height:28px;width:28px;display:block;flex-shrink:0;border-radius:8px;background:var(--preview-bg);border:2px solid var(--preview-border);position:relative}
.apex-theme-preview:after{content:"";position:absolute;left:5px;right:5px;bottom:6px;height:5px;border-radius:3px;background:var(--preview-accent)}
.apex-theme-choice strong{font-size:11px;font-weight:700}.apex-theme-choice small{display:block;font-size:9px;color:var(--muted)}
.apex-theme-panel .close-theme{border:1px solid var(--border2);background:var(--surface);color:var(--text);padding:6px 11px;border-radius:7px;float:right}
@media(max-width:860px){.apex-theme-trigger{min-width:35px;font-size:0;padding:8px}.apex-theme-trigger .theme-swatch{width:13px;height:13px}.apex-theme-panel{top:62px;right:10px}.topbar-right{gap:4px}}
