.portal-chat [hidden]{display:none!important}
.portal-chat .chat-users__toggle{display:block;border:0;cursor:pointer}
.portal-chat button{cursor:pointer}
.portal-chat .chat-dropdown__actionlinks button{background:none;border:0}
.portal-chat .chat-dropdown__autor{padding-right:40px}
.portal-chat [data-chat-title]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.portal-chat [data-chat-header-icon]{display:flex;align-items:center;flex-shrink:0}
.portal-chat [data-chat-header-icon] svg{flex-shrink:0}
.portal-chat [data-chat-header-icon] .ico{margin-right:8px}
.portal-chat [data-chat-directory] .chat-dropdown__field{padding-right:35px}
.portal-chat .users-table__line{border-top:0;border-left:0;border-right:0;text-align:left;cursor:pointer}
.portal-chat .users-table__img{flex-shrink:0}
.portal-chat .users-table__img img{width:40px;height:40px;object-fit:cover}
.portal-chat .users-table__name{overflow-wrap:anywhere}
.portal-chat .users-table__line b{margin-left:auto;color:#82c352;font-size:12px}
.portal-chat [data-chat-status]{font-size:12px;color:#d43369;padding:0 12px;margin:8px 0}
.portal-chat [data-chat-status]:empty{display:none}
.portal-chat__guest{height:auto;padding:25px;line-height:1.5;font-size:13px}
.portal-chat__guest p{margin-bottom:20px}
.portal-chat .chat-dropdown__message{white-space:pre-wrap;overflow-wrap:anywhere;min-width:0}
.portal-chat .chat-dropdown__message small{display:none;font-size:10px;opacity:.65;margin-top:5px}
.portal-chat .chat-dropdown__message:hover small,.portal-chat .chat-dropdown__message:focus-within small{display:block}
.portal-chat .chat-dropdown__message img{max-width:100%;border-radius:3px}
.portal-chat .chat-dropdown__message iframe{width:100%;height:130px;border:0}
.portal-chat .chat-dropdown__actions button,.portal-chat [data-chat-emoji],.portal-chat [data-chat-delete]{background:none;border:0}
.portal-chat [data-chat-emoji]{font-size:20px;padding:0;margin-right:7px;flex-shrink:0}
.portal-chat [data-chat-delete]{display:none;font-size:10px;color:#999;padding:0;margin-top:5px}
.portal-chat .chat-dropdown__message:hover [data-chat-delete],.portal-chat .chat-dropdown__message:focus-within [data-chat-delete]{display:block}
.portal-chat [data-chat-older],.portal-chat [data-chat-more-contacts]{width:100%;padding:8px;border:0;background:#fff;color:#82c352}
.portal-chat [data-chat-attachment]{font-size:12px;margin-bottom:10px;overflow-wrap:anywhere}
.portal-chat [data-chat-avatars] .chat-users__item{display:block}
.portal-chat .chat-users__item img{width:40px;height:40px;object-fit:cover}
.portal-chat .chat-users__list{margin-bottom:0;overflow:visible}
.portal-chat [data-chat-messages]:empty:after{content:'Начните переписку';display:block;color:#999;text-align:center;font-size:13px;padding:20px 0}
.portal-chat__search{font-size:13px;line-height:1.5;padding:15px;color:#999}
.portal-chat__send{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);border:0;padding:0}
.portal-chat__send:focus{position:static;width:auto;height:auto;clip-path:none;padding:8px 12px;background:#82c352;color:#fff;margin-top:10px}
.portal-chat__video{position:absolute;bottom:100%;left:0;width:100%;padding:15px;background:#fff;box-shadow:0 -1px 8px #0002;font-size:13px;z-index:1000}
.portal-chat__video label{display:block;margin-bottom:8px}.portal-chat__video p{font-size:11px;color:#999;margin:10px 0}.portal-chat__video input{width:100%;height:36px}.portal-chat__video button{border:0;font-size:12px}.portal-chat__video-play{border:0;background:none;color:inherit;text-decoration:underline;font-size:13px}
@media(hover:none){.portal-chat [data-chat-delete],.portal-chat .chat-dropdown__message small{display:block}}
@media(max-width:420px){.portal-chat .chat-dropdown{width:calc(100vw - 85px);right:65px;margin-right:5px}.portal-chat .chat-dropdown__body{height:min(300px,45vh)}}

.portal-chat .chat-dropdown__right{flex-shrink:0}
.portal-chat .chat-dropdown__actionlinks{right:5px}
.portal-chat .chat-dropdown__actionlinks button{width:29px;min-width:29px;padding:0;display:flex;align-items:center;justify-content:center;line-height:1;color:#fff}
.portal-chat .chat-dropdown__actionlinks svg{display:block;flex:none;width:11px;height:11px;overflow:visible}
.portal-chat .chat-dropdown__actionlinks button:hover{background:rgba(255,255,255,.12)}
.portal-chat .chat-dropdown__actionlinks button:focus-visible{outline:1px solid #fff;outline-offset:-3px}
.portal-chat [data-chat-header-icon]{line-height:0}
.portal-chat [data-chat-header-icon]>svg{display:block;width:15px;height:15px;margin-right:8px}

.portal-chat [data-chat-attachment] img{display:block;max-width:100%;max-height:100px;margin-bottom:8px;border-radius:3px}
.portal-chat button,.portal-chat a{transition:background-color .15s,color .15s,box-shadow .15s}
.portal-chat button:focus-visible,.portal-chat a:focus-visible{outline:2px solid #82c352;outline-offset:2px}
.portal-chat button:disabled{opacity:.45;cursor:wait}
.portal-chat .chat-dropdown__links button:hover,.portal-chat .chat-dropdown__links button[aria-expanded="true"]{background:#f2f9ed}
.portal-chat .chat-dropdown__links button:hover path,.portal-chat .chat-dropdown__links button[aria-expanded="true"] path,.portal-chat .chat-dropdown__actions button:hover path{fill:#82c352}
.portal-chat .chat-dropdown__actions button:hover{background:#f2f9ed}
.portal-chat .portal-chat__icon-button{width:26px;height:26px;min-width:26px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e2df;border-radius:50%;background:#fff;color:#999;cursor:pointer;line-height:1}
.portal-chat .portal-chat__icon-button svg{display:block;position:static!important;width:11px;height:11px;opacity:1!important;visibility:visible!important;margin:0}
.portal-chat .portal-chat__icon-button path{fill:currentColor}
.portal-chat .portal-chat__icon-button:hover{color:#d43369;border-color:#d43369;background:#fff3f7}
.portal-chat [data-chat-attachment]{position:relative;padding:10px 40px 10px 10px;background:#fff;border:1px solid #e0e0e0;border-radius:3px;line-height:18px;color:#555}
.portal-chat [data-chat-attachment]>.portal-chat__icon-button{position:absolute;top:7px;right:7px}
.portal-chat .portal-chat__panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.portal-chat .portal-chat__panel-head label{margin:0;font-weight:700}
.portal-chat .portal-chat__video .btn{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:7px 15px;font-size:12px;border-radius:2px}
.portal-chat .portal-chat__video .btn-trans{margin-left:6px;border:1px solid #d6d6d6;background:#fff;color:#555}
.portal-chat .portal-chat__video .btn-trans:hover{border-color:#82c352;color:#82c352}
.portal-chat [data-chat-delete].portal-chat__icon-button{display:none;width:20px;height:20px;min-width:20px;margin:5px 0 0 auto}
.portal-chat .chat-dropdown__message:hover [data-chat-delete].portal-chat__icon-button,.portal-chat .chat-dropdown__message:focus-within [data-chat-delete].portal-chat__icon-button{display:flex}
.portal-chat [data-chat-older],.portal-chat [data-chat-more-contacts]{font-size:12px;line-height:18px;border-bottom:1px solid #e5e2df}
.portal-chat [data-chat-older]:hover,.portal-chat [data-chat-more-contacts]:hover{background:#f2f9ed}
.portal-chat [data-chat-status]:not(:empty){padding:9px 12px;margin:0;border-top:1px solid #e5e2df;background:#fff;font-size:12px;line-height:17px;overflow-wrap:anywhere}
@media(hover:none){.portal-chat [data-chat-delete].portal-chat__icon-button{display:flex}}

.portal-chat .chat-dropdown__smiles{height:58px;padding:10px;gap:5px;flex-wrap:nowrap}
/* The photo viewer is appended to body, outside the chat root. */
.portal-chat-photo .mfp-container{padding:20px 24px}
.portal-chat-photo .mfp-content{text-align:center}
.portal-chat-photo img.mfp-img{width:auto;max-width:100%;object-fit:contain;padding:40px 0}
.portal-chat-photo .mfp-figure{margin:0 auto}
.portal-chat-photo.mfp-wrap>.mfp-close{position:fixed;top:16px;right:16px;width:40px;height:40px;padding:0;border:1px solid #ffffff70;border-radius:50%;background:#333;color:#fff;font:32px/36px Arial,sans-serif;text-align:center;opacity:1;z-index:1050;cursor:pointer}
.portal-chat-photo.mfp-wrap>.mfp-close:before,.portal-chat-photo.mfp-wrap>.mfp-close:after{display:none}
.portal-chat-photo.mfp-wrap>.mfp-close:hover{background:#82c352;border-color:#82c352}
.portal-chat-photo.mfp-wrap>.mfp-close:focus-visible{outline:2px solid #fff;outline-offset:3px}
@media(max-width:480px){.portal-chat-photo .mfp-container{padding:12px}.portal-chat-photo.mfp-wrap>.mfp-close{top:10px;right:10px}}

/* Preserve the compact field from the original chat layout. */
.portal-chat .chat-dropdown__form{margin:0;padding:0;display:block}
.portal-chat .chat-dropdown__fieldbox{height:36px;min-height:36px}
.portal-chat input.chat-dropdown__field{display:block;box-sizing:border-box;width:100%;height:36px;min-height:0;margin:0;border:0;border-radius:2px;padding:0 100px 0 12px;font-size:13px;line-height:36px;background:#fff;box-shadow:none}
.portal-chat [data-chat-directory] input.chat-dropdown__field{padding-right:35px}
.portal-chat .chat-dropdown__links{height:36px;align-items:center}
.portal-chat .chat-dropdown__links>button{display:flex;align-items:center;justify-content:center;width:30px;height:36px;min-height:0;margin:0;padding:0;border:0;background:none;line-height:1}
.portal-chat .chat-dropdown__links svg{display:block;flex-shrink:0}
.portal-chat .chat-dropdown__smiles{justify-content:space-around}
.portal-chat [data-chat-emoji]{display:flex;align-items:center;justify-content:center;flex:0 0 28px;width:28px;height:30px;padding:0;margin:0;font-size:20px;line-height:1}

.portal-chat .portal-chat__report{display:none;background:none;border:0;padding:0;margin-top:6px;color:#999;font-size:10px}
.portal-chat .chat-dropdown__message:hover .portal-chat__report,.portal-chat .chat-dropdown__message:focus-within .portal-chat__report{display:block}
.portal-chat .portal-chat__report-form{margin-top:8px;white-space:normal}
.portal-chat .portal-chat__report-form textarea{width:100%;padding:8px;border:1px solid #ddd;font-size:12px;line-height:17px;resize:vertical}
.portal-chat .portal-chat__report-form .btn{padding:6px 8px;font-size:11px;margin:6px 4px 0 0}
@media(hover:none){.portal-chat .portal-chat__report{display:block}}

/* Visible send control and a compact multiline composer. */
.portal-chat .portal-chat__send,.portal-chat .portal-chat__send:focus{position:static;clip-path:none;overflow:visible;display:flex;align-items:center;justify-content:center;width:34px;height:36px;min-width:34px;padding:0;margin:0 0 0 6px;border:0;border-radius:3px;background:#82c352;color:#fff}
.portal-chat [data-chat-form] .chat-dropdown__form{display:flex;align-items:flex-end}
.portal-chat [data-chat-form] .chat-dropdown__fieldbox{height:auto;min-width:0;flex:1}
.portal-chat textarea.chat-dropdown__field{display:block;box-sizing:border-box;width:100%;height:36px;min-height:36px;max-height:108px;margin:0;border:0;border-radius:2px;padding:9px 95px 9px 10px;font-size:13px;line-height:18px;background:#fff;resize:none;overflow-y:auto;box-shadow:none}
.portal-chat [data-chat-form] .chat-dropdown__links{top:auto;bottom:0}
.portal-chat [data-chat-form] .chat-dropdown__links [data-chat-list]{display:flex}
.portal-chat .portal-chat__tools{display:flex;gap:8px;padding:7px 10px;background:#fff;border-bottom:1px solid #e5e2df;flex-wrap:wrap}
.portal-chat .portal-chat__tools button{padding:2px 0;background:none;border:0;color:#999;font-size:10px;line-height:16px}
.portal-chat .portal-chat__tools button:first-child{color:#82c352;margin-right:auto}
.portal-chat .portal-chat__tools button:hover{color:#619c36}
.portal-chat .portal-chat__notice{padding:10px 12px;margin:0;color:#999;background:#fff;font-size:12px;line-height:18px}
.portal-chat .portal-chat__reply{display:flex;align-items:center;gap:8px;border-left:3px solid #82c352;background:#fff;padding:8px 10px;margin-bottom:8px;font-size:11px;line-height:16px}
.portal-chat .portal-chat__reply span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.portal-chat .portal-chat__quote{border-left:2px solid #82c352;background:#82c35212;padding:6px 8px;margin:0 0 7px;font-size:11px;line-height:16px;white-space:pre-wrap}
.portal-chat .portal-chat__message-state{display:block;margin-top:5px;font-size:9px;line-height:13px;color:#888;text-align:right}
.portal-chat .portal-chat__respond{border:0;background:none;color:#82c352;padding:0;margin:5px 8px 0 0;font-size:10px;line-height:15px}
.portal-chat .portal-chat__unread-divider{text-align:center;font-size:11px;color:#82c352;padding:6px;margin:8px 0;background:#e8f2e1;border-radius:3px}
.portal-chat .portal-chat__avatar-unread{position:absolute;right:0;bottom:0;min-width:15px;height:15px;border-radius:8px;background:#d43369;color:#fff;font-size:9px;line-height:15px;text-align:center;padding:0 3px;pointer-events:none}
.portal-chat .portal-chat__drop{outline:2px dashed #82c352;outline-offset:-3px;background:#f2f9ed}
@media(max-width:600px){
 .portal-chat [data-chat-window]{position:fixed;top:var(--chat-viewport-top,0px);left:0;right:0;bottom:auto;width:100%;height:var(--chat-viewport-height,100dvh);margin:0;display:flex;flex-direction:column;z-index:1001;border:0;border-radius:0}
 .portal-chat [data-chat-dialog],.portal-chat [data-chat-directory]{display:flex;flex-direction:column;flex:1;min-height:0}
 .portal-chat .chat-dropdown__body{flex:1;min-height:0;height:auto;overflow:auto}
 .portal-chat .chat-dropdown__bottom{flex-shrink:0;padding-bottom:max(15px,env(safe-area-inset-bottom))}
 .portal-chat .chat-dropdown__header{flex-shrink:0}
 .portal-chat .portal-chat__tools button{font-size:12px;min-height:30px}
 .portal-chat .chat-dropdown__links>button{width:36px}
 .portal-chat textarea.chat-dropdown__field{padding-right:112px;font-size:16px}
 .portal-chat .chat-dropdown__actionlinks button{min-height:40px}
 .portal-chat .chat-dropdown__message{max-width:85%}
}
.portal-chat .chat-users__item:not(.chat-users__more) .ico{top:50%;left:50%;right:auto;transform:translate(-50%,-50%);width:11px;height:11px}
/* Hover controls must not move the message while the user clicks Reply. */
.portal-chat .chat-dropdown__message small{display:block;visibility:hidden;min-height:13px;line-height:13px}
.portal-chat .chat-dropdown__message:hover small,.portal-chat .chat-dropdown__message:focus-within small{visibility:visible}
.portal-chat .portal-chat__respond{display:block}
.portal-chat .portal-chat__report{display:block;visibility:hidden;min-height:13px}
.portal-chat .chat-dropdown__message:hover .portal-chat__report,.portal-chat .chat-dropdown__message:focus-within .portal-chat__report{visibility:visible}
.portal-chat [data-chat-delete].portal-chat__icon-button{position:absolute;right:7px;bottom:5px;margin:0}
.portal-chat .chat-dropdown__message{position:relative}
.portal-chat .portal-chat__quote{color:#555;background:#f2f9ed}
@media(hover:none){.portal-chat .chat-dropdown__message small,.portal-chat .portal-chat__report{visibility:visible}}

.portal-chat__notification-action{display:block;margin-top:12px;padding:8px 12px;border:1px solid #80c34a;border-radius:3px;color:#599c29;background:#fff;text-align:center;font-weight:600}.portal-chat__notification-action:hover{background:#eef7e7;color:#477e20}

/* More room for the message without overlapping the controls. */
.portal-chat [data-chat-dialog] .chat-dropdown__bottom{padding:10px 8px}
.portal-chat [data-chat-form] .chat-dropdown__links>button{width:26px}
.portal-chat [data-chat-form] .chat-dropdown__links svg{width:18px;height:18px}
.portal-chat [data-chat-form] textarea.chat-dropdown__field{padding-left:8px;padding-right:82px}
.portal-chat .portal-chat__send,.portal-chat .portal-chat__send:focus{width:30px;min-width:30px;margin-left:4px}
@media(max-width:600px){
 .portal-chat [data-chat-dialog] .chat-dropdown__bottom{padding-bottom:max(10px,env(safe-area-inset-bottom))}
 .portal-chat [data-chat-form] .chat-dropdown__links>button{width:32px}
 .portal-chat [data-chat-form] textarea.chat-dropdown__field{padding-right:100px}
}

.portal-chat{bottom:calc(15px + var(--cookie-panel-height,0px))}
