.rich-tools{display:flex;gap:7px;flex-wrap:wrap;padding:8px 14px 0;background:#142f40}.rich-tools button{min-width:36px;min-height:36px;padding:6px 9px;font-size:17px}.rich-message-actions{display:flex;gap:4px;justify-content:flex-end;margin-top:5px}.rich-message-actions button{background:transparent;border:0;padding:3px 8px;font-size:15px;color:#95b9d1;min-height:27px}.rich-message-actions button::before{display:none}.rich-message-actions button:hover{background:#356079;color:#fff}.rich-message-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}.rich-receipt{font-size:10px;color:#afc4d2}.rich-receipt.is-read{color:#89d7ff}.rich-deleted{font-style:italic;opacity:.65}.rich-forwarded{display:block;color:#8ac4e9;font-size:10px;margin-bottom:6px}.rich-quote{white-space:pre-wrap;text-align:left;display:block;max-width:100%;width:100%;font-size:11px;font-weight:400;overflow-wrap:anywhere;border:0;border-left:3px solid #77c0ed;border-radius:3px;background:#0b263759;padding:7px 9px;color:#baddef;margin-bottom:8px}.rich-quote::before{display:none}.rich-photo{max-width:100%;max-height:320px;display:block;object-fit:contain;border-radius:7px}.rich-sticker{font-size:84px;line-height:1.3;text-align:center;padding:12px;filter:drop-shadow(0 5px 3px #0002)}.rich-sticker-image{width:180px;max-width:100%;max-height:200px;object-fit:contain}.chat-message audio{display:block;width:min(300px,100%);height:42px;margin:5px 0}.chat-message video{display:block;width:min(350px,100%);max-height:340px;border-radius:8px;background:#000;margin:7px 0}.rich-file{display:block;padding:12px 5px;overflow-wrap:anywhere}.rich-highlight{outline:2px solid #8ccbff}.rich-compose-line,.rich-draft{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 14px;background:#1b3b4f;border-left:3px solid #67b5ef;font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere}.rich-compose-line button,.rich-draft button{flex:none;padding:5px 10px}.rich-draft img{max-width:100px;max-height:80px;object-fit:contain}.rich-draft audio{max-width:240px}.rich-draft video{max-width:200px;max-height:120px}.rich-picker{padding:12px;background:#17394d;border-top:1px solid #35566d}.rich-emoji-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}.rich-emoji-grid button{padding:7px 3px;font-size:23px;min-height:42px}.rich-record-state{padding:12px;background:#4a2b37;display:flex;gap:10px;align-items:center;flex-wrap:wrap}.rich-record-state video{width:140px;max-height:120px;border-radius:5px}.rich-call-buttons{display:flex;gap:6px;margin-left:auto;flex:none}.rich-call-buttons button{padding:7px 10px;min-height:36px;font-size:20px}#rich-forward-dialog{width:min(440px,calc(100vw - 24px));background:#132a3a;color:#e1edf5;border:1px solid #37566b;padding:0;border-radius:8px}#rich-forward-dialog .panel{margin:0;border:0}#rich-forward-dialog p{margin:12px 0;white-space:pre-wrap;overflow-wrap:anywhere}.rich-call-panel{position:fixed;right:20px;bottom:20px;z-index:90;width:min(440px,calc(100vw - 24px));padding:20px;background:#132f42;border:1px solid #48738e;border-radius:12px;box-shadow:0 14px 70px #0009}.rich-call-panel p{margin:10px 0}.rich-call-videos{position:relative;background:#071b27;border-radius:8px;overflow:hidden}.rich-call-videos:has(video[hidden]){background:transparent}.rich-call-videos video{display:block;width:100%;max-height:48dvh;object-fit:contain}.rich-call-videos #rich-call-local{position:absolute;bottom:8px;right:8px;width:25%;max-height:100px;border:1px solid #78a1b8;border-radius:5px;background:#102430}.rich-call-controls{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}.rich-call-controls button{min-height:44px}#rich-call-audio{display:none}@media(max-width:700px){.rich-tools{padding:6px 10px 0;gap:5px}.rich-tools button{min-height:38px;padding:5px 9px}.rich-message-actions button{min-width:35px;min-height:32px}#chat .chat-message{max-width:94%}.rich-emoji-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.rich-call-panel{right:12px;bottom:calc(12px + env(safe-area-inset-bottom));padding:15px}.rich-call-buttons{gap:4px}.rich-call-buttons button{padding:6px 8px;min-width:36px}.rich-draft{flex-wrap:wrap}.rich-draft audio{max-width:100%}.rich-compose-line{font-size:11px}.rich-sticker{font-size:70px}.chat-conversation-head{flex-wrap:wrap}}
.rich-call-panel{width:min(320px,calc(100vw - 16px));padding:12px;max-height:calc(100dvh - 16px);overflow:auto;z-index:110}.rich-call-panel h3{font-size:15px;margin:8px 0}.rich-call-panel p{font-size:12px;margin:6px 0}.rich-call-videos video{max-height:29dvh}.rich-call-controls{gap:5px;margin-top:8px}.rich-call-controls button{padding:7px;font-size:12px;min-height:36px}.rich-call-dragbar{display:flex;justify-content:space-between;gap:6px;align-items:center}.rich-call-dragbar button{min-height:30px;padding:4px 8px;font-size:12px}.rich-call-drag{touch-action:none;cursor:move;user-select:none;flex:1}.rich-call-panel.rich-call-minimized .rich-call-videos,.rich-call-panel.rich-call-minimized #rich-call-mute,.rich-call-panel.rich-call-minimized #rich-call-camera{display:none}.chat-message video.rich-circle,.rich-draft video.rich-circle,#rich-record-preview.rich-circle{width:220px;height:220px;max-width:100%;max-height:none;aspect-ratio:1;object-fit:cover;border-radius:50%;background:#071b27}.rich-draft video.rich-circle,#rich-record-preview.rich-circle{width:140px;height:140px}#chat-send{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}#chat-send.recording{background:#a83c50;animation:record-pulse 1s infinite}@keyframes record-pulse{50%{box-shadow:0 0 0 7px #e75c6833}}@media(prefers-reduced-motion:reduce){#chat-send.recording{animation:none}}
.rich-call-panel[popover]{margin:0;inset:auto;right:20px;bottom:20px}.rich-call-panel::backdrop{background:transparent;pointer-events:none}
.shared-avatar{display:inline-flex;align-items:center;justify-content:center;flex:none;width:28px;height:28px;border-radius:50%;overflow:hidden;background:#32617d;color:#fff;font-size:11px;font-weight:700;vertical-align:middle}.shared-avatar img,.chat-avatar img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}.chat-avatar{overflow:hidden}.employee-name-inline{display:inline-flex;gap:8px;align-items:center;vertical-align:middle}.message-who{display:flex;gap:7px;align-items:center;font-size:11px;color:#a8ccdf;margin-bottom:7px}.chat-message.mine .message-who{justify-content:flex-end}.message-who .shared-avatar{width:24px;height:24px;font-size:10px}.sidebar-avatar{margin-right:8px;width:32px;height:32px}#rich-call-name .shared-avatar{width:32px;height:32px}

.assignment-panel{border-color:#5b8bac}.assignment-panel h2{font-size:16px}.assignment-line{display:flex;gap:10px;align-items:center;padding:12px;border-radius:8px;margin-top:8px;background:#17384a}.assignment-line>div{flex:1}.assignment-line p{margin:5px 0;font-size:12px}.assignment-line.is-urgent{border-left:3px solid #f3ad58}.assignment-line button{min-height:42px;white-space:nowrap}@media(max-width:600px){.assignment-line{flex-wrap:wrap}.assignment-line>div{flex-basis:100%}.assignment-line button{flex:1}}
.conference-tile{position:relative;min-width:0;background:#081b28;border-radius:12px;overflow:hidden}.conference-tile video{width:100%;max-height:220px;object-fit:contain;display:block}.conference-tile span{display:block;padding:5px 8px;font-size:12px;background:#102b3c}#conference-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:48vh;overflow:auto}#conference-grid:has(>.conference-tile:only-child){grid-template-columns:1fr}#conference-people{font-size:12px;overflow-wrap:anywhere}.conference-picker{width:min(480px,90vw);background:#102b3c;color:#e2f1fb;border:1px solid #42637a;border-radius:16px;padding:20px}.conference-options{display:grid;gap:12px;max-height:48vh;overflow:auto;margin:18px 0}.conference-options label{display:flex;gap:10px;align-items:center}.conference-options input{width:auto}.conference-picker button{margin:5px}.conference-active .rich-call-videos{max-height:100px}.conference-active #rich-call-local{max-height:90px;width:130px;position:static}#rich-call-panel:has(#conference-grid>.conference-tile) .rich-call-videos{min-height:0}
#rich-call-panel .rich-call-videos #rich-call-local{position:static;width:120px;max-height:90px;margin:6px 0}.rich-call-minimized #conference-grid,.rich-call-minimized #conference-people{display:none}.rich-call-buttons button:last-child{font-size:12px}

.chat-sidebar-head{gap:8px;flex-wrap:wrap}.chat-sidebar-head h2{margin-right:auto}#conference-start{font-size:12px;padding:8px 10px;min-height:40px;white-space:nowrap}.rich-call-buttons button:last-child{font-size:20px}
.left-item-card{display:grid;grid-template-columns:2fr 1fr 1fr;gap:16px;border:1px solid #315064;border-radius:10px;padding:16px;margin-top:12px;background:#132d3e}.left-item-card small{display:block;color:#98b6ca;margin-bottom:7px}.left-item-card p{white-space:pre-wrap;overflow-wrap:anywhere;margin:0}.left-item-actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}.left-item-actions button{font-size:12px;padding:7px 10px}.left-item-form{grid-column:1/-1}.left-item-form textarea{display:block;width:100%;margin:8px 0}.left-item-form button{margin:5px}#left-items-search{width:100%}@media(max-width:700px){.left-item-card{grid-template-columns:1fr;gap:12px}}

body.crm-chat-screen{overflow:hidden}
body.crm-chat-screen #chat:not([hidden]){position:fixed;inset:0;width:100%;max-width:none;height:100dvh;margin:0;padding:0;border:0;border-radius:0;z-index:70;background:#0e1621}
body.crm-chat-screen #chat .chat-layout{display:grid;grid-template-columns:340px minmax(0,1fr);height:100%;min-height:0;border:0;border-radius:0}
body.crm-chat-screen #chat .chat-sidebar{background:#17212b!important;min-height:0;overflow:hidden;border-right:1px solid #0d1720;display:flex;flex-direction:column}
body.crm-chat-screen #chat .chat-sidebar-head{padding:10px 12px;flex:none;min-height:64px;flex-wrap:nowrap;background:#17212b}
#chat-exit,#chat #chat-back{display:block;background:transparent;box-shadow:none;border:0;color:#8cabbf;min-width:40px;min-height:40px;padding:4px;font-size:26px}
#chat-exit::before,#chat #chat-back::before{display:none}
body.crm-chat-screen #chat .chat-sidebar-head h2{font-size:18px}
body.crm-chat-screen #chat .chat-search-label{padding:5px 12px 12px;background:#17212b}
body.crm-chat-screen #chat .chat-search-label input{border:0;border-radius:24px;background:#242f3d;color:#dce6ee}
body.crm-chat-screen #chat #chat-threads{flex:1;max-height:none;background:#17212b!important;overflow:auto;border:0}
body.crm-chat-screen #chat .chat-thread{padding:14px 12px;border:0;border-radius:0;min-height:82px;display:flex;gap:12px;align-items:center;background:transparent}
body.crm-chat-screen #chat .chat-thread .chat-avatar{width:50px;height:50px;flex-basis:50px;font-size:17px}
body.crm-chat-screen #chat .chat-thread.selected{background:#2b5278}
body.crm-chat-screen #chat .chat-thread:hover{background:#223447}
body.crm-chat-screen #chat .chat-thread.selected:hover{background:#2b5278}
body.crm-chat-screen #chat .chat-thread strong{font-size:14px;font-weight:600}
body.crm-chat-screen #chat .chat-thread small{font-size:13px;margin-top:7px;color:#8fa9bf}
body.crm-chat-screen #chat .chat-note{padding:10px;background:#17212b!important;font-size:11px;flex:none}
body.crm-chat-screen #chat .chat-conversation{display:flex;min-height:0;padding:0;background:#0e1621;background-image:none}
body.crm-chat-screen #chat .chat-conversation-head{background:#17212b;border:0;padding:9px 16px;min-height:64px;flex-wrap:nowrap;flex:none;gap:12px}
body.crm-chat-screen #chat .chat-conversation-head h3{font-size:15px;color:#e4edf4}
body.crm-chat-screen #chat .chat-conversation-head p{font-size:12px;color:#7e9ab1}
body.crm-chat-screen #chat .chat-history{background:#0e1621;background-image:none;min-height:0;flex:1;overflow:hidden;display:flex;flex-direction:column}
body.crm-chat-screen #chat #chat-messages{height:auto;min-height:0;flex:1;padding:22px 7%;gap:7px;overflow:auto;overscroll-behavior:contain}
body.crm-chat-screen #chat .chat-message{position:relative;background:#182533;border-radius:15px 15px 15px 4px;box-shadow:none;padding:9px 13px;max-width:78%;color:#edf4f9}
body.crm-chat-screen #chat .chat-message.mine{background:#2b5278;border-radius:15px 15px 4px 15px}
body.crm-chat-screen #chat .chat-message p{font-size:14px;line-height:1.45;color:#edf4f9;margin:3px 0}
body.crm-chat-screen #chat .chat-message time{font-size:11px;color:#89abc5}
body.crm-chat-screen #chat .rich-message-actions{display:none;position:relative;flex-wrap:wrap;border-top:1px solid #7295b633;padding-top:5px;margin-top:8px}
body.crm-chat-screen #chat .message-menu-open .rich-message-actions{display:flex}
#chat .message-more{background:transparent;border:0;box-shadow:none;color:#8aabc3;font-size:18px;min-height:24px;min-width:28px;padding:0;position:absolute;right:-30px;top:3px;opacity:0}
#chat .message-more::before{display:none}#chat .mine .message-more{right:auto;left:-30px}
#chat .chat-message:hover .message-more,#chat .chat-message:focus-within .message-more,#chat .message-menu-open .message-more{opacity:1}
body.crm-chat-screen #chat #chat-form{display:flex;flex-direction:row;align-items:flex-end;gap:7px;flex:none;padding:10px 16px max(10px,env(safe-area-inset-bottom));background:#17212b;border:0}
body.crm-chat-screen #chat #chat-form label{min-width:0;flex:1;margin:0}
body.crm-chat-screen #chat #chat-body{background:transparent;color:#edf4f9;border:0;box-shadow:none;min-height:44px;max-height:140px;border-radius:0;padding:11px 6px;font-size:15px;resize:none}
#chat #chat-send{width:44px;height:44px;min-height:44px;flex:none;border-radius:50%;background:#5288b6;box-shadow:none;padding:10px;border:0;color:white}
#chat #chat-send::before{display:none}#chat #chat-send svg{width:24px;height:24px;fill:currentColor;display:block}
#chat #chat-attach,#chat #chat-emoji{width:38px;min-width:38px;min-height:44px;padding:6px;background:transparent;border:0;box-shadow:none;color:#89a0b4;font-size:26px}
#chat #chat-attach::before,#chat #chat-emoji::before{display:none}
body.crm-chat-screen #chat .rich-tools{display:none;position:absolute;bottom:72px;left:12px;z-index:6;max-width:calc(100% - 24px);padding:8px;border-radius:12px;background:#223344;box-shadow:0 7px 30px #0006}
body.crm-chat-screen #chat.chat-tools-open .rich-tools{display:grid;gap:4px}
#chat .rich-tools button:not([hidden]){text-align:left;display:flex;gap:12px;align-items:center;background:transparent;font-size:20px;border:0;box-shadow:none;min-height:42px}
#chat .rich-tools button:not([hidden])::after{content:attr(aria-label);font-size:13px}
#chat .rich-picker{position:absolute;bottom:72px;right:12px;max-width:calc(100% - 24px);width:340px;max-height:50%;overflow:auto;z-index:7;border-radius:12px;background:#223344}
#chat .telegram-voice{display:flex;gap:11px;align-items:center;min-width:230px;width:300px;max-width:100%;padding:5px 0}
#chat .telegram-voice>button{border:0;border-radius:50%;width:43px;min-width:43px;height:43px;min-height:43px;background:#4c9cce;color:white;padding:0;box-shadow:none;font-size:20px}
#chat .telegram-voice>button::before{display:none}#chat .telegram-voice>div{min-width:0;flex:1}#chat .telegram-voice input{width:100%;min-height:20px;padding:0;margin:0;background:transparent;border:0;accent-color:#7db9e9}
#chat .voice-time{font-size:11px;color:#8ab6d9}#chat .rich-record-state{flex:none;font-size:13px;padding:9px 14px;background:#442b38}#chat .chat-day{background:#1c2e40;color:#b1c9dd}
@media(max-width:900px) and (min-width:701px){body.crm-chat-screen #chat .chat-layout{grid-template-columns:280px minmax(0,1fr)}}
@media(max-width:700px){body.crm-chat-screen #chat .chat-layout{display:flex;flex-direction:row;height:100%;min-height:0}body.crm-chat-screen #chat .chat-sidebar{width:100%;flex:1}body.crm-chat-screen #chat .chat-conversation{display:none;width:100%;flex:1}body.crm-chat-screen #chat.chat-mobile-open .chat-sidebar{display:none}body.crm-chat-screen #chat.chat-mobile-open .chat-conversation{display:flex}body.crm-chat-screen #chat .chat-conversation-head{padding:6px 8px;gap:7px;min-height:60px}body.crm-chat-screen #chat .chat-conversation-head .chat-avatar{display:none}body.crm-chat-screen #chat .chat-conversation-head h3{font-size:14px}body.crm-chat-screen #chat #chat-messages{padding:14px 32px}body.crm-chat-screen #chat .chat-message{max-width:94%}body.crm-chat-screen #chat #chat-form{padding:7px 7px max(7px,env(safe-area-inset-bottom));gap:3px}body.crm-chat-screen #chat #chat-body{font-size:16px}#chat .message-more{opacity:1;right:-27px}#chat .mine .message-more{left:-27px}#chat .rich-call-buttons{gap:3px}#chat .rich-call-buttons button{padding:4px 6px;min-width:30px}#chat .telegram-voice{width:250px;min-width:170px}}

body.crm-chat-screen{position:fixed;left:0;right:0;width:100%;overscroll-behavior:none}
body.crm-chat-screen #chat:not([hidden]){bottom:auto;overflow:hidden}
body.crm-chat-screen #chat .chat-conversation{min-width:0;min-height:0}
/* Profile avatars in message headers must never be rendered as message media. */
body.crm-chat-screen #chat .chat-message img[src*="/api/profiles/"]{width:28px!important;height:28px!important;min-width:28px!important;max-width:28px!important;max-height:28px!important;object-fit:cover!important;border-radius:50%!important;display:block!important}
body.crm-chat-screen #chat .chat-message .message-who{position:relative;z-index:1}
/* Telegram-like composer alignment: attachment left, input center, emoji and mic right. */
body.crm-chat-screen #chat #chat-form{display:grid!important;grid-template-columns:44px minmax(0,1fr) 42px 48px!important;align-items:center!important;gap:6px!important}
body.crm-chat-screen #chat #chat-form>label{grid-column:2!important;grid-row:1!important;width:auto!important;min-width:0!important}
body.crm-chat-screen #chat #chat-attach{grid-column:1!important;grid-row:1!important}
body.crm-chat-screen #chat #chat-emoji{grid-column:3!important;grid-row:1!important}
body.crm-chat-screen #chat #chat-send{grid-column:4!important;grid-row:1!important;justify-self:end!important}
body.crm-chat-screen #chat #chat-body{width:100%!important;box-sizing:border-box!important;white-space:pre-wrap!important;overflow:auto!important}
@media(max-width:700px){body.crm-chat-screen #chat #chat-form{grid-template-columns:38px minmax(0,1fr) 38px 46px!important;gap:3px!important;padding-left:7px!important;padding-right:7px!important}}
/* Final composer order */
body.crm-chat-screen #chat #chat-form{display:flex!important;align-items:center!important;flex-direction:row!important}
body.crm-chat-screen #chat #chat-form>label{order:2!important;flex:1 1 auto!important}
body.crm-chat-screen #chat #chat-attach{order:1!important}
body.crm-chat-screen #chat #chat-emoji{order:3!important}
body.crm-chat-screen #chat #chat-send{order:4!important}
/* Absolute composer anchors prevent legacy flex rules from moving controls. */
body.crm-chat-screen #chat #chat-form{position:relative!important;display:block!important;min-height:64px!important;padding-left:54px!important;padding-right:102px!important}
body.crm-chat-screen #chat #chat-form>label{display:block!important;width:100%!important}
body.crm-chat-screen #chat #chat-attach{position:absolute!important;left:8px!important;bottom:10px!important}
body.crm-chat-screen #chat #chat-emoji{position:absolute!important;right:58px!important;bottom:10px!important}
body.crm-chat-screen #chat #chat-send{position:absolute!important;right:8px!important;bottom:10px!important}
