:root{font-family:system-ui,-apple-system,"Segoe UI",Tahoma,sans-serif;color:#192d36;background:#f4f7f8;--border:#dce5e7;--dark:#133744;--accent:#0c806e;--muted:#627982}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;border-radius:9px;border:1px solid transparent;padding:10px 14px;font-weight:650}button:disabled{opacity:.46;cursor:not-allowed}button:hover:not(:disabled){filter:brightness(.97)}.primary{background:var(--accent);color:#fff}.secondary{background:#e3f4ee;color:#086955;border-color:#a8d4c8}.ghost{background:white;color:#315361;border-color:var(--border)}.small{padding:7px 10px;font-size:12px}.hidden{display:none!important}p{line-height:1.65}label{font-size:12px;font-weight:650;color:#3c5761}input:not([type=checkbox]),textarea,select{border:1px solid #cfdde0;padding:10px 11px;border-radius:9px;background:white;outline:none;width:100%;color:#183442}input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px #0c806e17}input[type=checkbox]{accent-color:var(--accent)}.topbar{height:70px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--border);padding:10px 25px;background:white}.brand{display:flex;align-items:center;gap:11px;direction:ltr}.brand strong{font-size:17px;letter-spacing:.6px}.brand small{display:block;color:var(--muted);font-size:11px;text-align:left;margin-top:3px}.brand-mark{font-weight:900;background:var(--dark);border-radius:12px;color:white;font-size:22px;width:43px;height:43px;display:grid;place-items:center}.top-actions{display:flex;align-items:center;gap:12px}.staff-name{font-size:12px;font-weight:650}.pill,.mini-badge{font-size:12px;color:#4f6772;background:#eef4f6;border:1px solid var(--border);border-radius:30px;padding:6px 10px}.login-card{background:white;border:1px solid var(--border);border-radius:19px;padding:30px;max-width:470px;margin:90px auto;box-shadow:0 12px 35px #102e3c09}.login-card h1{font-size:24px;margin:0 0 8px}.login-card p{color:var(--muted)}.login-card form{display:grid;gap:13px}.tabbar{display:flex;align-items:center;gap:6px;padding:9px 23px;background:white;border-bottom:1px solid var(--border)}.tab{border:0;border-radius:10px;background:transparent;color:#57707d;padding:11px 17px}.tab.active{background:#e7f5f0;color:#08735f}.spacer{flex:1}.inbox-layout{display:grid;grid-template-columns:350px minmax(0,1fr);height:calc(100dvh - 126px);min-height:580px;max-width:1700px;margin:auto}.sidebar{background:white;border-left:1px solid var(--border);padding:17px 14px;overflow-y:auto}.sidebar-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}.sidebar-heading h2{font-size:19px;margin:7px 0 16px}.filter-row{display:flex;gap:7px;margin-bottom:8px}.filter-row input{min-width:0;flex:1}.filter-row select{max-width:155px}.hint{font-size:12px;color:var(--muted)}.conversations{display:grid;gap:8px;margin-top:13px}.conversation{border:1px solid var(--border);border-radius:12px;background:#fff;padding:12px;display:flex;text-align:right;align-items:center;gap:10px;width:100%;color:inherit}.conversation:hover,.conversation.active{background:#f0faf6;border-color:#99c8bc}.avatar{width:39px;height:39px;flex:0 0 39px;border-radius:13px;background:#e2f0ed;color:#126f61;display:grid;place-items:center;font-weight:800}.conv-detail{min-width:0}.conv-name{font-size:14px;font-weight:750}.conv-info,.conv-owner{font-size:11px;color:var(--muted);margin-top:4px}.main-pane{display:flex;min-height:0;flex-direction:column}.empty{margin:auto;text-align:center;color:var(--muted);padding:22px}.empty h2{color:var(--dark)}.empty-icon{font-size:55px;color:var(--accent)}.chat-pane{height:100%;display:flex;min-height:0;flex-direction:column}.chat-header{background:white;border-bottom:1px solid var(--border);padding:12px 18px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.chat-header h2{margin:0 0 4px;font-size:17px}.chat-header small{color:var(--muted)}.chat-controls{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.chat-controls select{width:135px;padding:7px}.check-label{display:flex;align-items:center;gap:6px;white-space:nowrap}.check-label input{width:16px;height:16px}.warning{background:#fff4d7;border-bottom:1px solid #e8d69b;color:#855a11;padding:10px 18px;font-size:12px}.messages{flex:1;min-height:0;overflow-y:auto;padding:22px;display:flex;flex-direction:column;gap:13px;background:linear-gradient(135deg,#f3f8f6,#f6f8fa)}.message{max-width:78%;padding:13px 15px;border-radius:14px;border:1px solid var(--border);white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55;font-size:14px;background:white;align-self:flex-start}.message.outbound{background:#dcf3e9;align-self:flex-end;border-color:#c2e2d5}.message.draft{background:#fff8e4;border:1px dashed #d6bc6a}.message.internal{background:#eef1fa;border:1px solid #cbd3eb;align-self:center;max-width:90%}.message .meta{font-size:11px;color:#5e7380;margin-top:8px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}.composer{background:white;padding:12px 18px;border-top:1px solid var(--border);display:grid;gap:9px}.composer-top,.composer-bottom{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.composer-bottom .hint{margin:0}.composer textarea{min-height:66px;resize:vertical;max-height:180px}.content-page{max-width:1050px;margin:0 auto;padding:25px 20px}.section-head,.panel-head{display:flex;justify-content:space-between;align-items:center;gap:14px}.section-head{margin-bottom:20px}.section-head h1{margin:0;font-size:24px}.section-head p{margin:7px 0;color:var(--muted)}.panel{background:white;border:1px solid var(--border);border-radius:14px;padding:18px;margin-bottom:12px}.panel h3{font-size:16px;margin-top:0}.panel-head strong{font-size:16px}.panel-actions{display:flex;gap:9px;margin-top:12px}.stack{display:grid;gap:10px}.rule-response{white-space:pre-wrap;color:#425b66;font-size:13px}.rule-status{border-radius:30px;padding:5px 10px;background:#eef1f2;color:#667;font-size:12px;white-space:nowrap}.rule-status.enabled{background:#def4eb;color:#0b795c}.inline-fields{display:flex;gap:10px;align-items:end}.inline-fields>*{flex:1;min-width:0}.inline-fields>button{flex:0 0 auto}.inline-fields>div{display:grid;gap:8px}#preview-result{white-space:pre-wrap}dialog{width:min(510px,calc(100% - 26px));max-height:90dvh;overflow:auto;border:1px solid var(--border);border-radius:17px;padding:24px;box-shadow:0 20px 70px #19394335}dialog::backdrop{background:#0a202b7d}dialog h2{margin-top:0}dialog form{display:grid;gap:10px}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:12px}.notice{position:fixed;left:20px;bottom:20px;padding:14px 20px;border-radius:12px;background:#153b45;color:white;box-shadow:0 10px 30px #1939433b;max-width:min(430px,90vw);z-index:3}.notice.error{background:#953b2c}@media(max-width:900px){.topbar{padding:10px}.top-actions .pill{display:none}.staff-name{display:none}.tabbar{padding:6px 10px}.tab{padding:10px}.tabbar .mini-badge{display:none}.inbox-layout{display:flex;flex-direction:column;height:calc(100dvh - 122px);min-height:450px}.sidebar{height:245px;flex:none;border-left:0;border-bottom:1px solid var(--border);padding:10px}.conversations{display:flex;overflow-x:auto}.conversation{min-width:175px;max-width:245px;flex:none}.main-pane{min-height:240px;flex:1}.messages{padding:12px}.message{max-width:94%}.chat-header{padding:10px}.chat-controls select{width:110px}.chat-controls label{font-size:11px}.composer{padding:10px}.login-card{margin:35px 12px}.content-page{padding:16px 10px}.section-head h1{font-size:19px}}@media(max-width:450px){.chat-controls{gap:5px}.chat-controls select{width:100px}.chat-controls .check-label{margin-right:5px}.tab{font-size:12px}}

/* v0.3: visual ordered-flow editor and work-hours settings */
.builder-layout{display:grid;grid-template-columns:minmax(220px,280px) minmax(0,1fr);gap:18px;align-items:start}
.builder-list{padding:14px;border:1px solid var(--line,#dce4e8);border-radius:14px;max-height:80vh;overflow:auto}
.builder-list .compact{margin-bottom:10px;padding:12px}
.builder-workspace{min-width:0}
.step-heading,.step-bar,.step-add-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.builder-steps{display:flex;flex-direction:column;gap:12px;margin:12px 0}
.step-card{background:#f8fafc;color:#223248;border:1px solid #d9e2ef;border-right:5px solid #2d78a5;border-radius:14px;padding:14px;cursor:grab}
.step-card.dragging{opacity:.45}
.step-card textarea,.step-card select{width:100%;margin:4px 0 10px}
.step-card .step-tools{display:flex;gap:6px}
.step-add-row{padding:12px;background:#f0f7fc;border-radius:12px}
.step-add-row select{flex:1;min-width:150px}
.preview-panel{margin-top:16px}
.preview-text{white-space:pre-wrap;line-height:1.8;overflow-wrap:anywhere;font:inherit}
.settings-panel{max-width:790px}
.settings-panel textarea{display:block;width:100%;margin-top:8px}
.settings-panel hr{border:0;border-top:1px solid #dce4e8;margin:26px 0}
.weekdays{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}
.weekday{display:inline-flex;align-items:center;gap:5px;border:1px solid #dce4e8;border-radius:12px;padding:9px;background:#f9fafb}
@media(max-width:880px){.builder-layout{grid-template-columns:1fr}.builder-list{max-height:260px}}
@media(max-width:520px){.step-add-row{align-items:stretch;flex-direction:column}.step-card{padding:10px}.step-tools{gap:3px}.weekdays{gap:4px}}

/* v0.4 – guided forms, tags and customer profile */
.profile-summary{padding:9px 16px;background:#f7faf9;border-bottom:1px solid var(--border);display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;font-size:12px}
.profile-line{display:flex;align-items:center;gap:12px;flex-wrap:wrap;width:100%}
.profile-tags{margin:0;padding:5px 9px;border-radius:15px;background:#e5f5ee;color:#20624a}
.profile-field{background:#fff;border:1px solid var(--border);border-radius:8px;padding:5px 8px}
.guided-demo{padding:12px 17px;border-top:1px solid #cfe4dc;background:#eefaf3;display:grid;gap:8px}
.guide-buttons{display:flex;gap:8px;flex-wrap:wrap}
.guide-field{display:grid;gap:6px;margin:10px 0;min-width:0}
.guide-option{background:#eef5fb;border:1px solid #d5e6f5;border-radius:12px;padding:12px;margin:12px 0}
.guide-option .guide-field{margin:7px 0}
@media(max-width:800px){.tabbar{overflow-x:auto}.tab{white-space:nowrap;flex:none}.guided-demo{padding:9px}.guide-option{padding:9px}.profile-summary{max-height:130px;overflow-y:auto}}

/* v0.5 – campaign composer, audiences, explicit marketing permission, reports */
.marketing-panel{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:9px 16px;background:#fff8ed;border-bottom:1px solid #e9ddc6}
.marketing-panel label{flex:0 0 auto}.marketing-panel select{flex:0 1 230px;min-width:180px}
.marketing-panel input{flex:1 1 260px;min-width:180px}.marketing-panel button{flex:0 0 auto}
.report-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:15px 0}
.stat-number{display:block;font-size:25px;font-weight:800;color:#0d7565;padding:5px 0}
.report-line{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--border);padding:8px 0;font-size:13px}
#campaigns-view hr{border:0;border-top:1px solid var(--border);margin:22px 0}
#campaigns-view .builder-workspace>.hint{margin-top:14px}
@media(max-width:600px){.marketing-panel{padding:8px}.marketing-panel select,.marketing-panel input{flex:1 1 100%}.report-grid{grid-template-columns:1fr}}

.schedule-composer{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.schedule-composer label{flex:0 0 auto}.schedule-composer input{flex:1 1 180px;width:auto}
.composer details{font-size:12px;color:var(--muted)}
#scheduled-individual-list .report-line{font-size:12px}

/* v0.6: internal alerts, reply templates and operational metrics */
.notification-count{display:inline-block;min-width:20px;border-radius:12px;background:#e3f2ec;color:#1a6a55;padding:2px 6px;font-size:11px;font-weight:750}
.notification-item{display:grid;gap:3px}.notification-item p{margin:4px 0}.notification-unread{border-right:4px solid #17876e;background:#f6fdf9}
#reply-template-select{width:min(230px,100%);min-width:125px}
#report-daily .report-line{font-size:12px}
@media(max-width:600px){#reply-template-select{flex:1;min-width:150px}.notification-item .panel-actions{flex-wrap:wrap}}


/* v0.8 – extracted document review responsive controls */
#imports-form{max-width:800px}
#imports-proposals textarea{width:100%;white-space:pre-wrap;line-height:1.65;resize:vertical}
#imports-proposals input{width:100%}
#imports-proposals .import-confirm input{width:18px;height:18px;flex:none}
#imports-list .panel-actions,#imports-proposals .panel-actions{flex-wrap:wrap}
#imports-proposals .preview-text{white-space:pre-wrap;overflow-wrap:anywhere;max-height:250px;overflow:auto}
@media(max-width:600px){#imports-proposals .panel{padding:12px}#imports-proposals .panel-actions button{flex:1 1 160px}}

/* v0.9 compact memory drawer on desktop and mobile */
.memory-panel {border:1px solid var(--border, #dce1e7);border-radius:12px;padding:12px;margin:8px 12px;background:var(--card, #fff);}
.memory-panel summary {font-weight:700;cursor:pointer;margin-bottom:10px;}
.memory-panel textarea,.memory-panel input:not([type="checkbox"]) {width:100%;max-width:100%;box-sizing:border-box;}
.memory-panel .memory-facts {border-inline-start:3px solid #cbd5e1;padding:8px 12px;margin:10px 0;background:rgba(148,163,184,.07);border-radius:8px;}
.memory-panel .memory-actions {display:flex;flex-wrap:wrap;gap:8px;margin:12px 0;}
@media(max-width:680px){.memory-panel {margin:6px;padding:10px;}.memory-panel .memory-actions button{flex:1 1 140px;}}

/* v1.0 – approval gated agent execution log */
.agent-panel{border:1px solid var(--border);border-radius:12px;background:#fff;margin:8px 12px;padding:12px;}
.agent-panel summary{font-weight:700;cursor:pointer;margin-bottom:10px;}
.agent-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0;}
.agent-run{background:#f8fafb;border:1px solid var(--border);border-radius:12px;padding:12px;}
.agent-run p{margin:6px 0;}
.agent-step{border-inline-start:3px solid #c7dbe4;background:white;border-radius:6px;padding:9px 10px;margin-top:8px;}
.agent-step-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.65;margin-top:6px;}
.agent-step .panel-actions{flex-wrap:wrap;}
@media(max-width:680px){.agent-panel{margin:6px;padding:10px;}.agent-controls button,.agent-step button{flex:1 1 140px;}}
