@charset "utf-8";

.mc_main {
    overflow: hidden;
    background-color: #ffffff;
    display: flex;
    flex-direction: row;
    color: #243447;
}

.mc_left_menu {
    position: relative;
    display: flex;
    overflow: visible;
    border-right: 1px solid #d8e2eb;
    background-color: #ffffff;
    width: 320px;
    flex-direction: column;
    flex-shrink: 0;
    box-sizing: border-box;
    z-index: 3;
}

.mc_left_menu_resize_handle {
    position: absolute;
    top: 0;
    right: -5px;
    width: 10px;
    height: 100%;
    z-index: 20;
    cursor: col-resize;
    background: transparent;
    transition: background-color .15s ease;
}

.mc_left_menu_resize_handle:hover {
    background-color: rgba(46, 139, 192, .32);
}

body.mc_chat_resizing {
    cursor: col-resize !important;
    user-select: none !important;
}

.mc_left_menu_top_panel {
    height: 54px;
    border-bottom: 1px solid #e2e9ef;
    position: relative;
    flex-shrink: 0;
    padding: 8px;
    box-sizing: border-box;
    background: #ffffff;
}

.mc_left_menu_compact .mc_left_menu_top_panel > * {
    opacity: 0;
    pointer-events: none;
}

.mc_left_menu_compact .mc_left_menu_top_panel::after {
    content: "⌕";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6d7f90;
    font-size: 25px;
}

.mc_left_menu_contact_parent {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.mc_contacts_loader {
    position: absolute;
    top: 54px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 15;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(241, 246, 250, .68);
    backdrop-filter: blur(1px);
}

.mc_contacts_loader_visible {
    display: flex;
}

.mc_contacts_loader::after {
    content: "";
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    border: 3px solid rgba(50, 140, 193, .20);
    border-top-color: #328cc1;
    border-radius: 50%;
    animation: mc_contacts_loader_spin .7s linear infinite;
}

@keyframes mc_contacts_loader_spin {
    to {
        transform: rotate(360deg);
    }
}

.mc_contact_item {
    width: 100%;
    height: 74px;
    background-color: #ffffff;
    border-bottom: 1px solid #edf1f4;
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.mc_contact_item:hover {
    background-color: #f3f8fc;
}

.mc_contact_item_active {
    background-color: #e6f3fc !important;
    box-shadow: inset 3px 0 0 #328cc1;
}

.mc_contact_item_pic_parent {
    width: 50px;
    height: 50px;
    position: relative;
    flex-shrink: 0;
    overflow: visible !important;
}

.mc_contact_item_pic {
    width: 50px;
    height: 50px;
    margin: auto;
    border-radius: 50%;
    object-fit: cover;
    background: #e8eef3;
}

.mc_contact_request_badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #f39a2f;
    box-shadow: 0 1px 3px rgba(94, 56, 10, .28);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    pointer-events: none;
}

.mc_contact_item_has_request .mc_contact_item_name {
    color: #9a5a0c;
}

.mc_contact_item_request_in_progress .mc_contact_request_badge {
    background: #328cc1;
    box-shadow: 0 1px 3px rgba(21, 79, 113, .28);
}

.mc_contact_item_request_in_progress .mc_contact_item_name {
    color: #226e9b;
}

.mc_contact_item_bot_stopped {
    background-color: #f7f3f3;
}

.mc_contact_item_bot_stopped:hover {
    background-color: #f3eaea;
}

.mc_contact_item_bot_stopped .mc_contact_item_pic {
    filter: grayscale(70%);
    opacity: .7;
}

.mc_contact_item_bot_stopped .mc_contact_item_name,
.mc_contact_item_bot_stopped .mc_contact_item_preview,
.mc_contact_item_bot_stopped .mc_contact_item_phone,
.mc_contact_item_bot_stopped .mc_contact_item_time {
    color: #8d7c7c;
}

.mc_contact_stopped_badge {
    position: absolute;
    right: -1px;
    bottom: -1px;
    z-index: 4;
    width: 17px;
    height: 17px;
    box-sizing: border-box;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #b76565;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    pointer-events: none;
}

.mc_contact_item_text_parent {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.mc_contact_item_top {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 18px;
}

.mc_contact_item_name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    color: #1f2f3d;
}

.mc_contact_item_time {
    flex: 0 0 auto;
    margin-left: auto;
    padding-left: 7px;
    color: #8493a0;
    font-size: 10px;
    line-height: 18px;
    white-space: nowrap;
}

.mc_contact_item_preview,
.mc_contact_item_phone {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    line-height: 15px;
}

.mc_contact_item_preview {
    color: #667786;
}

.mc_contact_item_preview_empty {
    color: #9ba8b3;
    font-style: italic;
}

.mc_contact_item_phone {
    color: #34779e;
    font-weight: 600;
    margin-top: 1px;
}

.mc_contact_item_phone_empty {
    color: #9aa6af;
    font-weight: 400;
}

.mc_contacts_empty {
    padding: 22px 12px;
    color: #8996a1;
    font-size: 12px;
    text-align: center;
}

.mc_contact_item_has_card .mc_contact_item_phone {
    padding-right: 23px;
}

.mc_contact_card_button {
    z-index: 4;
    cursor: pointer;
    border-radius: 3px;
    opacity: .82;
    transition: opacity .15s ease, background-color .15s ease;
}

.mc_contact_card_button:hover {
    opacity: 1;
    background-color: rgba(50, 140, 193, .11);
}

.mc_left_menu_compact .mc_contact_item {
    justify-content: center;
    gap: 0;
    padding: 8px 5px;
}

.mc_left_menu_compact .mc_contact_item_text_parent {
    display: none;
}

.mc_left_menu_compact .mc_contact_item_active {
    box-shadow: inset 3px 0 0 #328cc1;
}

.mc_main_content {
    position: relative;
    min-width: 0;
    flex: 1;
    background: linear-gradient(160deg, #d9edf9 0%, #e7e8f8 52%, #f2e3ef 100%);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mc_main_content_top_panel {
    position: relative;
    height: 56px;
    border-bottom: 1px solid #d2dde6;
    flex-shrink: 0;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 1px 2px rgba(38, 60, 78, .06);
    z-index: 2;
}

.mc_top_panel_img {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: #e7edf2;
}

.mc_top_panel_img_clickable {
    cursor: zoom-in;
}

.mc_top_panel_img_clickable:hover {
    box-shadow: 0 0 0 2px rgba(63, 130, 181, .25);
}

.mc_top_panel_text_parent {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mc_top_panel_name_row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mc_top_panel_name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1d2d3b;
    font-size: 14px;
    line-height: 19px;
    font-weight: 600;
}

.mc_top_panel_identity {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border-radius: 50%;
    background: #a9b4bd;
    color: #ffffff;
    font-size: 10px;
    line-height: 15px;
    text-align: center;
    font-weight: 700;
    cursor: default;
}

.mc_top_panel_identity_verified {
    background: #2a91ce;
}

.mc_top_panel_meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #748493;
    font-size: 11px;
    line-height: 16px;
}

.mc_request_actions {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.mc_request_actions_visible {
    display: flex;
}

.mc_request_status {
    padding: 4px 8px;
    border-radius: 10px;
    background: #eef3f6;
    color: #657785;
    font-size: 11px;
    font-weight: 600;
    line-height: 14px;
    white-space: nowrap;
}

.mc_request_actions_new .mc_request_status {
    background: #fff1dd;
    color: #9a5a0c;
}

.mc_request_actions_mine .mc_request_status {
    background: #e2f2fc;
    color: #226e9b;
}

.mc_take_request_button {
    height: 30px;
    padding: 0 11px;
    border: 1px solid #287fae;
    border-radius: 5px;
    background: #328cc1;
    color: #ffffff;
    cursor: pointer;
    font: 600 11px Roboto, Arial, sans-serif;
    white-space: nowrap;
    transition: background-color .15s ease, opacity .15s ease;
}

.mc_take_request_button:hover {
    background: #287ba8;
}

.mc_take_request_button:disabled {
    cursor: default;
    opacity: .65;
}

.mc_complete_request_button {
    display: none !important;
    height: 30px;
    padding: 0 11px;
    border: 1px solid #2e984f;
    border-radius: 5px;
    background: #36a85b;
    color: #ffffff;
    cursor: pointer;
    font: 600 11px Roboto, Arial, sans-serif;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease;
}

.mc_request_actions_new .mc_complete_request_button,
.mc_request_actions_mine .mc_complete_request_button {
    display: inline-block !important;
}

.mc_complete_request_button:hover {
    border-color: #267f42;
    background: #2d914e;
}

.mc_main_content_dialog_parent {
    display: flex;
    position: relative;
    flex: 1;          /* растягивается */
    min-height: 0;
    padding: 12px 16px;
    overflow-y: auto;  /* если контент большой */
    flex-direction: column;
    scroll-behavior: auto;
}

.mc_main_content_dialog {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: auto !important;
    overflow: visible;
}

.mc_message_row {
    position: relative;
    width: 100%;
    overflow: visible;
    display: flex;
    justify-content: flex-start;
    height: auto;
    padding: 1px 0;
    box-sizing: border-box;

    opacity: 0;
    transform: scale(0.98);
    transform-origin: bottom;

    animation: mc_message_show 0.28s ease forwards;
}

@keyframes mc_message_show {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mc_message_row_right {
    justify-content: flex-end !important;
}

.mc_message_row_system {
    justify-content: center !important;
    padding: 7px 0;
}

.mc_date_separator {
    position: relative;
    z-index: 1;
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
    padding: 9px 0 7px;
    pointer-events: none;
}

.mc_date_separator_text {
    height: auto;
    padding: 3px 10px;
    border: 0;
    border-radius: 10px;
    background: rgba(0, 0, 0, .25);
    box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    line-height: 14px;
    white-space: nowrap;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.mc_message_bubble {
    position: relative;
    width: auto;
    height: auto;
    white-space: pre-wrap;
    border: 1px solid rgba(111, 137, 157, .24);
    padding: 7px 9px 5px;
    margin: 2px 5px;
    border-radius: 6px 6px 6px 2px;
    background-color: rgba(255, 255, 255, .96);
    box-shadow: 0 1px 1px rgba(52, 73, 89, .08);

    overflow: visible;
    word-break: break-word;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    max-width: 72%;
}

.mc_message_row_right .mc_message_bubble {
    border-color: #c4ddd2;
    border-radius: 6px 6px 2px 6px;
    background-color: #edf8f3;
}

.mc_message_row_system .mc_message_bubble_system {
    max-width: 82%;
    padding: 5px 11px;
    margin: 2px 8px;
    border: 1px solid #d8a94f;
    border-radius: 12px;
    background-color: rgba(255, 248, 225, .96);
    box-shadow: 0 1px 2px rgba(111, 79, 22, .12);
    color: #6d521f;
    align-items: center;
}

.mc_message_row_system .mc_message_footer {
    align-items: center;
}

.mc_message_row_system .mc_message_text {
    font-size: 11px;
    font-weight: 600;
    line-height: 15px;
    text-align: center;
}

.mc_message_row_system .mc_message_time {
    color: #8a6a2f;
    margin-left: 8px;
}

.mc_message_row_system_request_taken .mc_message_bubble_system {
    border-color: #74afd1;
    background-color: rgba(235, 247, 253, .97);
    color: #28698f;
    box-shadow: 0 1px 2px rgba(32, 102, 143, .12);
}

.mc_message_row_system_request_taken .mc_message_time {
    color: #4d819f;
}

.mc_message_row_system_appointment_requested .mc_message_bubble_system {
    flex-direction: column;
    align-items: stretch;
}

.mc_message_row_system_appointment_requested .mc_message_footer {
    justify-content: center;
}

.mc_message_row_system_appointment_cancel_requested .mc_message_bubble_system {
    flex-direction: column;
    align-items: stretch;
}

.mc_message_row_system_appointment_cancel_requested .mc_message_footer {
    justify-content: center;
}

.mc_message_row_system_request_completed .mc_message_bubble_system {
    flex-direction: column;
    align-items: stretch;
    border-color: #79bd8d;
    background-color: rgba(237, 250, 241, .97);
    color: #287442;
    box-shadow: 0 1px 2px rgba(37, 111, 63, .12);
}

.mc_message_row_system_request_completed .mc_message_footer {
    justify-content: center;
}

.mc_message_row_system_request_completed .mc_message_time {
    color: #568b67;
}

.mc_message_system_comment {
    max-width: 420px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(96, 119, 106, .22);
    color: #78847d;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
}

.mc_message_bubble_with_files {
    min-width: 210px;
    flex-direction: column;
    align-items: stretch;
}

.mc_message_footer {
    display: flex;
    min-width: 0;
    align-items: flex-end;
}

.mc_message_files {
    display: none;
    width: 100%;
    max-width: 380px;
    margin-bottom: 5px;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: 4px;
    white-space: normal;
}

.mc_message_files_visible {
    display: grid;
}

.mc_message_files_single {
    grid-template-columns: minmax(210px, 300px);
}

.mc_message_image_link {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 90px;
    max-height: 260px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(82, 112, 135, .1);
    color: #50687b;
    text-decoration: none;
}

.mc_message_image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: cover;
}

.mc_message_file,
.mc_message_file_broken {
    display: flex;
    min-width: 0;
    min-height: 48px;
    padding: 5px;
    box-sizing: border-box;
    align-items: center;
    border: 1px solid rgba(93, 123, 145, .2);
    border-radius: 4px;
    background: rgba(255, 255, 255, .48);
    color: #334b5d;
    text-decoration: none;
}

.mc_message_file:hover {
    border-color: rgba(50, 140, 193, .4);
    background: rgba(255, 255, 255, .72);
}

.mc_message_file_broken {
    justify-content: center;
    font-size: 12px;
}

.mc_message_file_icon {
    display: flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #6da7cb;
    color: #ffffff;
    font-size: 9px;
    font-weight: 600;
}

.mc_message_file_info {
    min-width: 0;
    margin-left: 7px;
}

.mc_message_file_name {
    overflow: hidden;
    color: #334b5d;
    font-size: 12px;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mc_message_file_size {
    color: #7a8c99;
    font-size: 10px;
    line-height: 14px;
}

.mc_message_text {
    flex: 1;
    min-width: 0; /* ВАЖНО — иначе не сжимается */
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
}

.mc_message_time {
    position: relative;
    flex: 0 0 auto;
    white-space: nowrap;
    color: #70808e;
    font-size: 10px;
    opacity: .85;
    margin-left: 6px;
}

.mc_message_row_no_animation {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.mc_main_content_bottom_panel {
    position: relative;
    flex-shrink: 0;
    padding: 8px 10px;
    display: flex;
    gap: 6px;
    align-items: center;
    background: rgba(255, 255, 255, .82);
    border-top: 1px solid rgba(191, 205, 216, .75);
    backdrop-filter: blur(5px);
}

.mc_chat_textarea {
    position: relative;
    flex: 1;
    min-width: 100px;
    min-height: 40px;
    max-height: 160px;
    padding: 8px 11px;
    border: 1px solid #cbd7e0;
    border-radius: 6px;
    resize: none;
    line-height: 18px;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-word;
    outline: none;
    font-size: 11pt;
    font-family: Roboto, Arial, sans-serif;
    font-weight: normal;
    overflow-y: auto;
    resize: none;
    background: #ffffff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.mc_chat_textarea:focus {
    border-color: #4597c6;
    box-shadow: 0 0 0 2px rgba(69, 151, 198, .13);
}

.mc_button_send {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color .15s ease, transform .15s ease;
}

.mc_button_send:hover {
    background-color: rgba(50, 140, 193, .1);
    transform: translateY(-1px);
}

.mc_button_clip_loading::before {
    content: '';
    position: absolute;
    left: 2px;
    bottom: 2px;
    z-index: 4;
    width: 13px;
    height: 13px;
    box-sizing: border-box;
    border: 2px solid rgba(50, 140, 193, .22);
    border-top-color: #328cc1;
    border-radius: 50%;
    pointer-events: none;
    animation: mc_file_upload_spin .8s linear infinite;
}

@keyframes mc_file_upload_spin {
    to {
        transform: rotate(360deg);
    }
}

.mc_clip_files_count {
    position: absolute;
    top: auto;
    right: 2px;
    bottom: 2px;
    z-index: 4;
    display: none;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, .95);
    border-radius: 9px;
    background: #328cc1;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    line-height: 13px;
    text-align: center;
    pointer-events: none;
}

.mc_clip_files_count_visible {
    display: block;
}

.mc_main_content_dialog_parent::-webkit-scrollbar {
    width: 6px;
}

.mc_main_content_dialog_parent::-webkit-scrollbar-track {
    background: transparent;
}

.mc_main_content_dialog_parent::-webkit-scrollbar-thumb {
    background: rgba(51, 102, 153, 0.9);
    border-radius: 10px;
}

.mc_bottom_panel_files {
    position: relative;
    display: none;
    flex: 0 1 auto;
    max-width: 50%;
    min-width: 0;
    height: 42px;
    box-sizing: border-box;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
}

.mc_bottom_panel_files_visible {
    display: flex;
}

.mc_file_item {
    display: flex;
    flex: 1 1 120px;
    min-width: 68px;
    max-width: 140px;
    height: 36px;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    box-sizing: border-box;
    border-radius: 6px;
    background: #edf4f8;
    border: 1px solid #d5e1e9;
}

.mc_file_name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mc_file_remove {
    flex: 0 0 auto;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
}

.mc_bottom_panel_files::-webkit-scrollbar {
    height: 3px;
}

.mc_bottom_panel_files::-webkit-scrollbar-track {
    background: transparent;
}

.mc_bottom_panel_files::-webkit-scrollbar-thumb {
    background: rgba(101, 126, 145, .32);
    border-radius: 4px;
}

.mc_socket_indicator {
    position: relative;
    width: 12px;
    margin: auto 10px;
    height: 12px;
    border-radius: 50%;
    background: #4caf50;
    transition: .2s;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .22);
}

.mc_socket_indicator_offline {
    background: #f44336;
}

.mc_socket_indicator_connecting {
    background: #ffc107;
}

.mc_left_menu_contact_parent::-webkit-scrollbar {
    width: 5px;
}

.mc_left_menu_contact_parent::-webkit-scrollbar-track {
    background: transparent;
}

.mc_left_menu_contact_parent::-webkit-scrollbar-thumb {
    background: rgba(101, 126, 145, .35);
    border-radius: 10px;
}

/*.mc_main_content_dialog_parent::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 102, 153, 0.9);
}*/

