.crm-chat{--chat-blue:#2549bf;--chat-ink:#152340;--chat-muted:#53627c;--chat-line:#dde4ef;color:var(--chat-ink);max-width:1500px;margin:auto;caret-color:var(--chat-blue)}
.crm-chat ::selection{background:#d6e3ff;color:#152340}.crm-chat *{box-sizing:border-box}.crm-chat [hidden]{display:none!important}.crm-chat button,.crm-chat input,.crm-chat textarea,.crm-chat select{font:inherit}.crm-chat button{cursor:pointer}.crm-chat button:disabled{opacity:.55;cursor:not-allowed}.crm-chat :focus-visible{outline:3px solid #527bea;outline-offset:3px}.crm-chat svg,.chat-shortcut svg{width:21px;height:21px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.chat-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}.chat-heading h1{font-size:26px;font-weight:750;margin:0 0 4px}.chat-heading p,.chat-muted{color:var(--chat-muted);font-size:13px}.chat-heading p{margin:0}.chat-tabs{display:flex;gap:4px;flex-wrap:wrap}.chat-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:9px 14px;border:1px solid var(--chat-line);border-radius:9px;background:white;color:var(--chat-ink);font-weight:600;line-height:1.4}.chat-btn:hover{background:#f1f5fc}.chat-btn.primary,.chat-tabs .selected{background:var(--chat-blue);color:white;border-color:var(--chat-blue)}.chat-btn.primary:hover{background:#193a9f}.chat-btn.danger{color:#b42338;background:#fff3f4;border-color:#f0c2c8}.chat-icon{padding:9px;min-width:42px}.chat-link-form{background:white;border:1px solid var(--chat-line);border-radius:12px;padding:18px;margin-bottom:16px}.chat-link-form h2{font-size:16px;font-weight:700;margin:0 0 12px}.chat-link-fields{display:grid;grid-template-columns:1fr 1fr auto;align-items:end;gap:12px}.crm-chat label{display:block;font-size:13px;color:var(--chat-muted);margin-bottom:6px}.chat-input{width:100%;border:1px solid #bfcde3;background:white;border-radius:8px;padding:10px 12px;color:var(--chat-ink);min-height:43px}.chat-input::placeholder{color:#63738d}.chat-input.small{min-height:35px;padding:6px 10px;margin-bottom:6px}.chat-workspace{display:grid;grid-template-columns:310px minmax(0,1fr);height:min(740px,calc(100dvh - 205px));min-height:440px;border:1px solid var(--chat-line);border-radius:14px;overflow:hidden;background:#fff}.chat-directory{display:flex;flex-direction:column;min-height:0;border-inline-end:1px solid var(--chat-line);background:#fff}.chat-directory-top{padding:18px 16px 14px;border-bottom:1px solid var(--chat-line)}.chat-directory-top strong{display:block;font-size:15px;margin-bottom:12px}.chat-thread-list{overflow:auto;flex:1;scrollbar-width:thin;scrollbar-color:#aebed9 transparent}.chat-thread{width:100%;display:flex;align-items:flex-start;gap:11px;border:0;border-bottom:1px solid #edf1f7;background:white;text-align:start;padding:17px 15px;position:relative}.chat-thread:hover{background:#f7f9fd}.chat-thread.selected{background:#edf3ff}.chat-avatar{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;border-radius:12px;background:#e7edfa;color:#2549bf;font-size:15px;font-weight:750}.chat-thread.selected .chat-avatar{background:#2549bf;color:white}.chat-thread-copy{min-width:0;flex:1}.chat-thread-copy strong{display:block;font-size:13px;line-height:1.6;overflow-wrap:anywhere}.chat-thread-copy p{font-size:12px;color:var(--chat-muted);margin:4px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-thread-copy small{display:block;color:#63718a;font-size:11px;margin-top:4px;font-variant-numeric:tabular-nums}.chat-count{background:#2549bf;color:white;border-radius:20px;min-width:22px;padding:2px 6px;font-size:11px;text-align:center}.chat-state{font-size:11px;color:#8b3947}.chat-conversation{display:flex;flex-direction:column;min-width:0;min-height:0;background:#f7f9fd}.chat-thread-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:17px 22px;background:white;border-bottom:1px solid var(--chat-line)}.chat-thread-head h2{font-size:16px;font-weight:750;margin:0;overflow-wrap:anywhere}.chat-thread-head p{font-size:12px;color:var(--chat-muted);margin:3px 0 0}.chat-policy{display:flex;align-items:center;justify-content:center;gap:8px;background:#f0f4fc;color:#4a5c7a;font-size:12px;padding:9px 16px}.chat-policy svg{width:16px;height:16px}.chat-messages{flex:1;overflow:auto;padding:22px;scrollbar-width:thin;scrollbar-color:#b2c1dc transparent;overscroll-behavior:contain}.chat-message{display:flex;flex-direction:column;align-items:flex-start;max-width:80%;margin:0 auto 16px 0}.crm-chat[dir=rtl] .chat-message{margin:0 0 16px auto}.chat-message.own{align-items:flex-end;margin:0 0 16px auto}.crm-chat[dir=rtl] .chat-message.own{margin:0 auto 16px 0}.chat-bubble{border:1px solid #e0e6f0;background:#fff;border-radius:12px;padding:12px 15px;min-width:100px;max-width:100%}.chat-message.own .chat-bubble{background:#e8efff;border-color:#d8e3ff}.chat-author{font-size:11px;color:#526381;margin-bottom:5px;font-weight:650}.chat-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.85;font-size:14px;margin:0}.chat-time{font-size:10px;color:#5c6d87;margin-top:6px;font-variant-numeric:tabular-nums}.chat-attachment{display:flex;gap:10px;align-items:center;border:0;background:transparent;color:#2346ad;padding:8px 0;text-align:start;max-width:100%}.chat-attachment span{overflow-wrap:anywhere;font-size:13px}.chat-attachment small{display:block;color:#53627c;font-size:11px}.chat-bubble audio{max-width:100%;width:290px;height:40px}.chat-composer{background:white;padding:13px 18px 15px;border-top:1px solid var(--chat-line)}.chat-composer textarea{resize:none;max-height:140px;min-height:68px;border:0;padding:7px 4px;border-radius:4px;background:#fff;line-height:1.7}.chat-compose-actions{display:flex;align-items:center;gap:7px;margin-top:8px}.chat-compose-actions .primary{margin-inline-start:auto}.chat-compose-hint{font-size:11px;color:var(--chat-muted);padding-inline:4px}.chat-preview{display:flex;align-items:center;gap:10px;background:#f0f4fc;padding:8px 12px;border-radius:8px;font-size:12px;overflow-wrap:anywhere}.chat-preview audio{height:36px;max-width:70%}.chat-preview .chat-icon{margin-inline-start:auto}.chat-recording{color:#b42338;font-weight:700;font-variant-numeric:tabular-nums}.chat-record-dot{width:9px;height:9px;background:#ca273e;border-radius:50%;animation:chat-record 1.4s ease-out infinite}.chat-error{margin:10px 0;background:#fff1f2;color:#9c2434;padding:10px 14px;border-radius:8px;font-size:13px}.chat-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;text-align:center;padding:30px;gap:10px}.chat-empty>svg{width:44px;height:44px;color:#6b84b2;margin-bottom:8px}.chat-empty h2{font-size:20px;font-weight:700;margin:0}.chat-empty p{max-width:340px;color:var(--chat-muted);font-size:14px;line-height:1.9;margin:0}.chat-list-empty{padding:28px 20px;line-height:1.9;color:var(--chat-muted);font-size:13px;text-align:center}.chat-older{display:block;margin:0 auto 20px;font-size:12px}.chat-back{display:none}.chat-shortcut{position:relative}.chat-shortcut [data-chat-badge]{position:absolute;top:-6px;right:-7px;border-radius:12px;background:#b42338;color:white;padding:1px 5px;font-size:10px}.chat-shortcut [hidden]{display:none}.chat-readonly{font-size:13px;color:var(--chat-muted);padding:18px;text-align:center;background:#fff;border-top:1px solid var(--chat-line)}
@media(max-width:640px){.chat-shortcut{display:none!important}}
@keyframes chat-record{50%{opacity:.35}}@media(prefers-reduced-motion:reduce){.chat-record-dot{animation:none}}
@media(max-width:1000px){.chat-workspace{grid-template-columns:265px minmax(0,1fr)}.chat-heading{align-items:flex-start;flex-direction:column}.chat-link-fields{grid-template-columns:1fr 1fr}.chat-link-fields>.chat-btn{grid-column:1/-1}.chat-compose-hint{display:none}}
@media(max-width:640px){.chat-heading h1{font-size:22px}.chat-workspace{display:flex;height:calc(100dvh - 240px);min-height:430px}.chat-directory,.chat-conversation{width:100%;flex:1}.chat-workspace:not(.has-thread) .chat-conversation{display:none}.chat-workspace.has-thread .chat-directory{display:none}.chat-back{display:inline-flex}.chat-thread-head{padding:12px;flex-wrap:wrap}.chat-thread-head h2{font-size:14px}.chat-policy{font-size:11px;padding:8px}.chat-messages{padding:16px 12px}.chat-message{max-width:92%}.chat-composer{padding:10px 12px}.chat-link-fields{grid-template-columns:1fr}.chat-heading{gap:12px}.chat-tabs{width:100%}.chat-tabs .chat-btn{flex:1;font-size:12px}.chat-thread-head .danger{font-size:11px;min-height:36px}.chat-bubble audio{width:230px}}
