.operator-mode-switch{display:inline-grid;grid-template-columns:1fr 1fr;gap:3px;padding:3px;border:1px solid #d8e5f2;border-radius:12px;background:#f4f8fd;min-width:220px}
.operator-mode-switch button{min-height:32px;padding:6px 10px;border:0;border-radius:9px;background:transparent;color:#526982;font-size:10px;font-weight:900;white-space:nowrap;cursor:pointer}
.operator-mode-switch button:hover:not(:disabled){background:#e7f1ff;color:#075fcf}
.operator-mode-switch button.active{background:#0b6ee8;color:#fff;box-shadow:0 5px 14px rgba(11,110,232,.22)}
.operator-mode-switch button:disabled{cursor:default}
.conversation-actions{display:flex!important;align-items:center;gap:7px;min-height:48px;padding:7px 14px;border-bottom:1px solid #dce6f2;background:#f7faff;overflow-x:auto;scrollbar-width:thin}
.conversation-actions button{flex:0 0 auto;min-height:34px;padding:7px 11px;border:1px solid #cedded;border-radius:10px;background:#fff;color:#17436f;font-size:10px;font-weight:850;cursor:pointer}
.conversation-actions button:hover{border-color:#0b6ee8;color:#075fcf;background:#eef6ff}
.conversation-actions button.danger-action{color:#b42318;border-color:#f0c8c4;background:#fff8f7}
.handover-alert-status{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px;padding-top:8px;border-top:1px solid rgba(120,83,12,.18);font-size:10px;line-height:1.4}
.handover-alert-status span{color:inherit}
.handover-alert-status button{flex:0 0 auto;min-height:28px;padding:5px 9px;border:1px solid currentColor;border-radius:8px;background:rgba(255,255,255,.65);color:#8a5500;font-size:9px;font-weight:900;cursor:pointer}
.erp-action-grid a{display:flex;align-items:center;justify-content:center;min-height:38px;padding:7px;border:1px solid var(--prod-border,#dce6f2);border-radius:10px;background:var(--prod-panel-soft,#f7faff);color:var(--prod-blue,#0968e8);font-size:10px;font-weight:850;text-decoration:none;text-align:center}
.erp-action-grid a:hover{border-color:var(--prod-blue,#0968e8);background:color-mix(in srgb,var(--prod-blue,#0968e8) 8%,var(--prod-panel,#fff))}
.erp-direct-notice{min-height:112px;padding:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;border:1px dashed var(--prod-border,#dce6f2);border-radius:13px;background:var(--prod-panel-soft,#f7faff)}
.erp-direct-notice strong{color:var(--prod-text,#11243d)}
.erp-direct-notice p{max-width:280px;margin:6px 0 0;color:var(--prod-muted,#64748b);font-size:11px;line-height:1.55}
.operator-drawer-open{overflow:hidden}
.operator-drawer-overlay{position:fixed;inset:0;z-index:7000;display:grid;grid-template-columns:1fr minmax(430px,620px)}
.operator-drawer-backdrop{grid-column:1;border:0;background:rgba(3,12,25,.58);backdrop-filter:blur(4px)}
.operator-drawer{grid-column:2;height:100dvh;display:flex;flex-direction:column;min-height:0;background:var(--prod-panel,#fff);color:var(--prod-text,#11243d);box-shadow:-24px 0 70px rgba(4,20,42,.3)}
.operator-drawer>header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px 24px;border-bottom:1px solid var(--prod-border,#dce6f2)}
.operator-drawer>header span{display:block;color:var(--prod-blue,#0968e8);font-size:10px;font-weight:950;letter-spacing:.15em}
.operator-drawer>header h2{margin:5px 0 0;color:var(--prod-text,#11243d);font-size:1.45rem}
.operator-drawer>header button{width:40px;height:40px;border:1px solid var(--prod-border,#dce6f2);border-radius:12px;background:var(--prod-panel-soft,#f7faff);color:var(--prod-text,#11243d);font-size:24px;cursor:pointer}
.operator-drawer-content{padding:20px 22px 34px;overflow-y:auto;min-height:0;background:var(--prod-bg,#f4f7fb)}
.operator-loading,.operator-empty{min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--prod-muted,#64748b)}
.operator-empty strong{color:var(--prod-text,#11243d)}
.operator-empty p{max-width:420px;line-height:1.55}
.operator-empty.error strong{color:#b42318}
.operator-alert-summary{display:grid;gap:11px}
.operator-alert-summary article{padding:16px;border:1px solid var(--prod-border,#dce6f2);border-radius:16px;background:var(--prod-panel,#fff)}
.operator-alert-summary span{display:block;color:var(--prod-muted,#64748b);font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.07em}
.operator-alert-summary strong{display:block;margin-top:5px;color:var(--prod-text,#11243d);font-size:1rem}
.operator-alert-summary small{display:block;margin-top:5px;color:var(--prod-muted,#64748b);line-height:1.5}
.operator-alert-actions{display:flex;gap:9px;flex-wrap:wrap;margin:13px 0}
.operator-alert-actions button,.operator-alert-actions a{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 13px;border:1px solid var(--prod-border,#dce6f2);border-radius:11px;background:var(--prod-panel,#fff);color:var(--prod-blue,#0968e8);font-size:11px;font-weight:900;text-decoration:none;cursor:pointer}
.operator-alert-actions .operator-primary{background:var(--prod-blue,#0968e8);border-color:var(--prod-blue,#0968e8);color:#fff}
.operator-alert-actions button:disabled{opacity:.55;cursor:not-allowed}
.operator-alert-guidance{padding:14px 15px;border:1px solid #f0cf8a;border-radius:14px;background:#fff8e8;color:#805000}
.operator-alert-guidance.ready{border-color:#a9dfc7;background:#eefaf4;color:#116846}
.operator-alert-guidance p{margin:5px 0 0;color:inherit;font-size:11px;line-height:1.55}
.operator-section-title{margin:20px 0 9px;color:var(--prod-text,#11243d);font-size:.95rem}
.operator-alert-list{display:grid;gap:8px}
.operator-alert-list article{display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:11px;align-items:start;padding:13px;border:1px solid var(--prod-border,#dce6f2);border-radius:14px;background:var(--prod-panel,#fff)}
.operator-alert-list article strong{color:var(--prod-text,#11243d)}
.operator-alert-list article p{margin:3px 0 0;color:var(--prod-muted,#64748b);font-size:10px;line-height:1.4}
.operator-alert-list article small{color:var(--prod-muted,#64748b);font-size:9px;text-align:right;line-height:1.45}
.operator-alert-state{width:9px;height:9px;margin-top:5px;border-radius:50%;background:#d97706;box-shadow:0 0 0 4px rgba(217,119,6,.12)}
.operator-alert-state.sent{background:#16a66a;box-shadow:0 0 0 4px rgba(22,166,106,.12)}

html[data-theme="dark"]{color-scheme:dark;--prod-bg:#06172b;--prod-panel:#0b2139;--prod-panel-soft:#102b48;--prod-text:#f5f9ff;--prod-muted:#b7c9dc;--prod-border:#294864;--prod-blue:#45a4ff;--prod-blue-strong:#79bfff;--prod-shadow:0 22px 60px rgba(0,0,0,.34)}
html[data-theme="dark"] body{background:#06172b;color:#f5f9ff}
html[data-theme="dark"] .app-shell{background:#06172b;color:#f5f9ff}
html[data-theme="dark"] .rail{background:#071a31;border-color:#25415c}
html[data-theme="dark"] .rail-button{color:#d9e9fb;border-color:transparent}
html[data-theme="dark"] .rail-button:hover,html[data-theme="dark"] .rail-button.active{background:#173959;color:#fff}
html[data-theme="dark"] :is(.inbox-panel,.chat-panel,.details-panel){background:#0b2139;color:#f5f9ff;border-color:#294864}
html[data-theme="dark"] :is(.panel-heading,.chat-heading,.composer,.stats,.search-row,.conversation-actions,.details-panel>header){background:#0b2139;color:#f5f9ff;border-color:#294864}
html[data-theme="dark"] .stats{background:#0e2844}
html[data-theme="dark"] .stats>div{border-color:#294864}
html[data-theme="dark"] .stats span{color:#fff}
html[data-theme="dark"] .stats small{color:#a9bdd3}
html[data-theme="dark"] :is(.search-box,input,textarea,select){background:#102b48!important;color:#f4f8fd!important;border-color:#345878!important}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#8fa7c0}
html[data-theme="dark"] .conversation-list{background:#081c32}
html[data-theme="dark"] .conversation-item{background:#0b2139;color:#f5f9ff;border-color:#294864}
html[data-theme="dark"] .conversation-item:hover{background:#123352}
html[data-theme="dark"] .conversation-item.active{background:#17466f;color:#fff}
html[data-theme="dark"] .conversation-item :is(strong,p,.conversation-meta,time){color:inherit}
html[data-theme="dark"] .conversation-item p,html[data-theme="dark"] .conversation-item .conversation-meta,html[data-theme="dark"] .conversation-item time{color:#c1d1e1}
html[data-theme="dark"] .chat-content{background:#081c32}
html[data-theme="dark"] .messages{background:#081c32;background-image:radial-gradient(circle at 12px 12px,rgba(85,143,196,.05) 1px,transparent 1px);background-size:24px 24px}
html[data-theme="dark"] .bubble{background:#153755;color:#f5f9ff;border-color:#294864}
html[data-theme="dark"] .outbound .bubble{background:#0877ea;color:#fff;border-color:#2092ff}
html[data-theme="dark"] .bubble :is(p,small,strong){color:inherit}
html[data-theme="dark"] .composer{box-shadow:0 -12px 28px rgba(1,10,22,.22)}
html[data-theme="dark"] .composer-notice{color:#a8bdd2}
html[data-theme="dark"] .send-button{background:#1687f8;color:#fff}
html[data-theme="dark"] .details-panel{background:#0a1e35}
html[data-theme="dark"] .order-details{background:#0a1e35;color:#f5f9ff}
html[data-theme="dark"] :is(.order-card,.erp-workspace,.erp-customer-card,.erp-direct-notice){background:#0d2742;color:#f5f9ff;border-color:#315371}
html[data-theme="dark"] .erp-workspace>header{background:#102d4c;border-color:#315371}
html[data-theme="dark"] .erp-action-grid{border-color:#315371}
html[data-theme="dark"] .erp-action-grid :is(button,a){background:#123453;color:#7ec2ff;border-color:#315b7d}
html[data-theme="dark"] #erpContextPanel{background:#0d2742}
html[data-theme="dark"] .erp-empty,html[data-theme="dark"] .erp-direct-notice p{color:#b8cadd}
html[data-theme="dark"] .erp-empty strong,html[data-theme="dark"] .erp-direct-notice strong{color:#f6f9fd}
html[data-theme="dark"] .human-takeover-banner{background:#fff3d7;color:#6b4300;border-color:#e7b957}
html[data-theme="dark"] .human-takeover-banner :is(strong,span){color:#6b4300}
html[data-theme="dark"] .handoff-note{background:#fff6e5;color:#704700;border-color:#e8bd66}
html[data-theme="dark"] .assignment-badge.ai{background:#dff7ec;color:#08764b}
html[data-theme="dark"] .assignment-badge.human,html[data-theme="dark"] .assignment-badge.human_attention_required{background:#fff0ca;color:#815000}
html[data-theme="dark"] .operator-mode-switch{background:#102b48;border-color:#345878}
html[data-theme="dark"] .operator-mode-switch button{color:#bcd0e4}
html[data-theme="dark"] .operator-mode-switch button:hover:not(:disabled){background:#173c60;color:#fff}
html[data-theme="dark"] .operator-mode-switch button.active{background:#1687f8;color:#fff}
html[data-theme="dark"] .conversation-actions{background:#0e2844;border-color:#294864}
html[data-theme="dark"] .conversation-actions button{background:#123453;color:#dcecff;border-color:#315b7d}
html[data-theme="dark"] .conversation-actions button:hover{background:#17466f;color:#fff;border-color:#48a5ff}
html[data-theme="dark"] .conversation-actions button.danger-action{background:#45252b;color:#ffd8d4;border-color:#7a3e46}
html[data-theme="dark"] .production-drawer-content,html[data-theme="dark"] .operator-drawer-content{background:#06172b}
html[data-theme="dark"] :is(.production-drawer,.operator-drawer,.production-stat,.integration-grid article,.operator-alert-summary article,.operator-alert-list article){background:#0b2139;color:#f5f9ff;border-color:#294864}
html[data-theme="dark"] :is(.production-drawer>header,.operator-drawer>header){background:#0b2139;border-color:#294864}
html[data-theme="dark"] :is(.production-drawer>header button,.operator-drawer>header button){background:#102b48;color:#f5f9ff;border-color:#345878}
html[data-theme="dark"] :is(.production-stat strong,.integration-grid article strong,.operator-alert-summary strong,.operator-alert-list strong,.operator-section-title){color:#f5f9ff}
html[data-theme="dark"] :is(.production-stat span,.production-stat small,.integration-grid article p,.operator-alert-summary span,.operator-alert-summary small,.operator-alert-list p,.operator-alert-list small){color:#b7c9dc}
html[data-theme="dark"] .operator-alert-actions a{background:#102b48;border-color:#345878;color:#7ec2ff}
html[data-theme="dark"] .operator-alert-guidance{background:#3c3018;border-color:#7e642c;color:#ffe5a6}
html[data-theme="dark"] .operator-alert-guidance.ready{background:#113b30;border-color:#286d58;color:#b9f4dc}
html[data-theme="dark"] .auth-overlay{background:#06172b}
html[data-theme="dark"] .auth-card{background:#0b2139;color:#f5f9ff;border-color:#294864}
html[data-theme="dark"] .auth-card .muted{color:#b7c9dc}

@media(max-width:1100px){.operator-mode-switch{min-width:0}.operator-mode-switch button{padding-inline:7px}.conversation-actions{padding-inline:10px}}
@media(max-width:900px){.chat-heading{flex-wrap:wrap}.operator-mode-switch{order:5;width:100%;grid-template-columns:1fr 1fr}.operator-drawer-overlay{grid-template-columns:1fr}.operator-drawer-backdrop{grid-column:1;grid-row:1}.operator-drawer{grid-column:1;grid-row:1;margin-left:min(10vw,76px);z-index:2}.conversation-actions{position:relative;z-index:3}}
@media(max-width:620px){.operator-drawer{margin-left:0}.operator-drawer>header,.operator-drawer-content{padding-left:16px;padding-right:16px}.operator-alert-list article{grid-template-columns:12px minmax(0,1fr)}.operator-alert-list article small{grid-column:2;text-align:left}.handover-alert-status{align-items:flex-start;flex-direction:column}.erp-action-grid{grid-template-columns:1fr}.conversation-actions{gap:6px}.conversation-actions button{font-size:9px;padding-inline:9px}}
@media(prefers-reduced-motion:reduce){.operator-drawer,.operator-mode-switch button{transition:none}}
