#mdsChat {
    --chat-bg: #f5f7fb;
    --chat-panel: #ffffff;
    --chat-panel-soft: #fbfcff;
    --chat-line: #e4eaf2;
    --chat-text: #172033;
    --chat-muted: #647086;
    --chat-accent: #2563eb;
    --chat-accent-soft: #eaf1ff;
    display: flex;
    flex-wrap: nowrap;
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1040;
    width: min(820px, calc(100vw - 36px));
    height: min(560px, calc(100vh - 150px));
    min-height: 420px;
    margin: 0 !important;
    overflow: hidden;
    color: var(--chat-text);
    background: var(--chat-panel);
    border: 1px solid var(--chat-line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(24, 39, 75, 0.08);
}

#mdsChat.hf-floating-chat-widget.hf-floating-chat-closed {
    display: none;
}

#mdsChat.hf-floating-chat-widget.hf-floating-chat-open {
    display: flex;
}

#mdsChat .hf-floating-chat-close {
    display: none;
}

#mdsChat.hf-floating-chat-widget .hf-floating-chat-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #5d6a7d;
    background: #f4f7fb;
    border: 1px solid #e3e9f2;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
}

#mdsChat.hf-floating-chat-widget .hf-floating-chat-close:hover {
    color: #172033;
    background: #eaf1ff;
}

#wrapper {
    min-height: calc(100vh - 1px);
    background: #f5f7fb;
}

#wrapper .nav-breadcrumb {
    margin: 16px 0 14px;
}

#mdsChat .chat-left {
    width: 270px;
    min-width: 250px;
    background: var(--chat-panel-soft);
}

#mdsChat .chat-left-inner {
    border-right: 1px solid var(--chat-line);
}

#mdsChat .chat-user {
    padding: 12px 14px 8px;
}

#mdsChat .chat-user .user-img,
#mdsChat .chat-user .user-img img {
    width: 40px;
    height: 40px;
}

#mdsChat .chat-left .chat-search {
    padding: 6px 14px 10px;
}

#mdsChat .chat-left .chat-search input {
    height: 36px;
    padding: 7px 38px 7px 12px;
    border: 1px solid var(--chat-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
}

#mdsChat .chat-left .chat-search i {
    top: 9px;
    right: 14px;
    color: var(--chat-muted);
}

#mdsChat .chat-left .text-recent-chats {
    padding: 3px 14px 8px;
    color: var(--chat-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
}

#mdsChat .chat-left .chat-contacts .item .time {
    font-size: 10px;
    line-height: 1.15;
}

#mdsChat .chat-left .chat-contacts-container {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: 0 8px 10px;
}

#mdsChat .chat-left .chat-contacts {
    position: relative;
}

#mdsChat .chat-left .chat-contacts .item .chat-contact {
    margin-bottom: 4px;
    padding: 8px;
    border-radius: 8px;
    transition: background-color .18s ease, box-shadow .18s ease;
}

#mdsChat .chat-left .chat-contacts .item .chat-contact:hover {
    background: #f1f5fb;
}

#mdsChat .chat-left .chat-contacts .item .chat-contact.active {
    background: var(--chat-accent-soft);
    box-shadow: inset 3px 0 0 var(--chat-accent);
}

#mdsChat .chat-left .chat-contacts .item .item-img,
#mdsChat .chat-left .chat-contacts .item img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
}

#mdsChat .chat-left .chat-contacts .item .username {
    color: var(--chat-text);
    font-size: 13px;
    margin-bottom: 2px;
}

#mdsChat .chat-left .chat-contacts .item .subject {
    color: #41506a;
    font-size: 11px;
    line-height: 1.25;
}

#mdsChat .hf-floating-chat-empty-list {
    padding: 14px 10px;
    color: var(--chat-muted);
    font-size: 12px;
}

#mdsChat .chat-right {
    display: flex;
    min-width: 0;
    flex-direction: column;
    background: linear-gradient(180deg, #f9fbff 0%, #eef3f8 100%);
}

#mdsChat .chat-right .chat-header {
    flex: 0 0 auto;
    min-height: 62px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--chat-line);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
}

#mdsChat.hf-floating-chat-widget .chat-right .chat-header {
    padding-right: 54px;
}

#mdsChat .chat-right .chat-header .chat-user {
    padding: 0;
    gap: 10px;
}

#mdsChat.hf-floating-chat-widget .btn-open-chat-contacts {
    align-items: center;
    gap: 6px;
}

#mdsChat.hf-floating-chat-widget .btn-open-chat-contacts-text {
    display: none;
}

#mdsChat .chat-right .chat-header .chat-user .user-img,
#mdsChat .chat-right .chat-header .chat-user .user-img img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

#mdsChat .chat-right .chat-header .chat-user .flex-item-center > a {
    color: var(--chat-accent);
    font-size: 14px;
    font-weight: 700;
}

#mdsChat .chat-right .chat-header .chat-user .p-last-seen {
    margin-top: 3px;
}

#mdsChat .chat-right .chat-header .chat-user .p-last-seen .last-seen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    color: #31405a;
    background: #f3f6fb;
    border: 1px solid #dfe6f0;
    border-radius: 999px;
    line-height: 1;
}

#mdsChat .chat-right .chat-header .chat-user .p-last-seen .last-seen-online {
    background: #eef9f1;
    border-color: #d7efd9;
    color: #276b35;
}

#mdsChat .chat-right .chat-header .chat-user .btn-chat-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #43516a;
    background: #f4f7fb;
    border-radius: 8px;
}

#mdsChat .chat-header .topic {
    margin-top: 4px;
    margin-left: 44px;
    color: var(--chat-muted);
    font-size: 12px;
}

#mdsChat .chat-content {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding-bottom: 0;
    flex-direction: column;
}

#mdsChat .chat-content .messages {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: 12px 0 6px;
    overflow: hidden;
}

#mdsChat:not(.chat-empty) .chat-content .messages,
#mdsChat:not(.chat-empty) .chat-content .messages-inner {
    justify-content: flex-start !important;
}

#mdsChat .chat-content .messages-inner {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: 0 18px;
}

#mdsChat .chat-content .messages .message {
    align-items: flex-end;
    justify-content: flex-start;
    margin-bottom: 9px;
}

#mdsChat .chat-content .messages .message .item-user {
    width: 30px;
}

#mdsChat .chat-content .messages .message .user-img,
#mdsChat .chat-content .messages .message .user-img img {
    width: 22px;
    height: 22px;
    border-radius: 8px;
}

#mdsChat .chat-content .messages .message .message-text {
    max-width: min(380px, calc(100vw - 380px));
    padding: 7px 11px;
    color: var(--chat-text);
    background: #fff;
    border: 1px solid #e7edf6;
    border-radius: 12px 12px 12px 4px;
    box-shadow: 0 6px 16px rgba(24, 39, 75, 0.05);
    line-height: 1.34;
}

#mdsChat .chat-content .messages .message-right {
    justify-content: flex-start;
    text-align: left;
}

#mdsChat .chat-content .messages .message-right > .flex-item:not(.item-user) {
    order: 1;
}

#mdsChat .chat-content .messages .message-right .item-user {
    order: 0;
    justify-content: flex-start;
}

#mdsChat .chat-content .messages .message-right .message-text {
    color: #fff;
    background: linear-gradient(135deg, #2f6df6 0%, #1f55d8 100%);
    border-color: transparent;
    border-radius: 12px 12px 12px 4px;
}

#mdsChat .chat-content .messages .message .time {
    height: auto;
    min-width: 0;
    margin-top: 3px;
}

#mdsChat .chat-content .messages .message .time span {
    position: static;
    color: #6b7890;
    font-size: 10px;
}

#mdsChat .chat-content .messages .message-right .time span {
    right: auto;
    left: 0;
}

#mdsChat .chat-content .chat-input {
    position: relative;
    flex: 0 0 auto;
    height: auto;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .95);
    border-top: 1px solid var(--chat-line);
}

#mdsChat .chat-content .chat-input input {
    height: 38px;
    padding: 8px 46px;
    color: var(--chat-text);
    background: #f4f7fb;
    border: 1px solid transparent !important;
    border-radius: 8px;
    box-shadow: none;
}

#mdsChat .chat-content .chat-input input:focus {
    background: #fff;
    border-color: #a9bff9 !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

#mdsChat .chat-content .chat-input .btn-chat-attachment {
    left: 8px;
    top: 3px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
}

#mdsChat .chat-content .chat-input .btn:not(.btn-chat-attachment) {
    right: 5px;
    top: 3px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
}

#mdsChat .chat-content .chat-input .btn:hover {
    background: #eaf1ff !important;
}

#mdsChat .chat-attachment-meta {
    margin: 10px 4px 0;
}

#mdsChat .select-chat-container {
    position: static;
    align-self: center;
    padding-top: 44px;
}

#mdsChat .select-chat-container label {
    border: 1px solid var(--chat-line);
    border-radius: 8px;
    background: #fff;
}

@media (max-width: 992px) {
    #mdsChat {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        height: min(620px, calc(100vh - 92px));
        min-height: 0;
    }

    #mdsChat .chat-left {
        width: 100% !important;
        min-width: 0;
    }

    #mdsChat.hf-floating-chat-widget .hf-floating-chat-close {
        top: 14px;
        right: 16px;
        width: 42px;
        height: 42px;
        font-size: 24px;
    }

    #mdsChat.hf-floating-chat-widget .chat-left .chat-search {
        padding: 14px 68px 12px 14px;
    }

    #mdsChat.hf-floating-chat-widget .chat-left .chat-search input {
        height: 44px;
        padding-right: 42px;
    }

    #mdsChat.hf-floating-chat-widget .chat-left .chat-search i {
        top: 13px;
    }

    #mdsChat .chat-left .chat-contacts-container {
        height: min(58vh, 430px) !important;
    }

    #mdsChat.hf-floating-chat-widget .chat-right .chat-header .chat-user {
        padding-left: 0;
    }

    #mdsChat.hf-floating-chat-widget .btn-open-chat-contacts {
        position: static;
        display: inline-flex !important;
        flex: 0 0 auto;
        width: auto;
        height: 38px;
        margin-right: 6px;
        padding: 0 12px;
        color: #fff;
        background: linear-gradient(135deg, #ff7a1a 0%, #e23d18 100%) !important;
        border: 1px solid rgba(226, 61, 24, .28) !important;
        border-radius: 10px;
        box-shadow: 0 0 0 3px rgba(255, 122, 26, .16), 0 10px 24px rgba(226, 61, 24, .28);
        font-size: 13px;
        font-weight: 900;
        line-height: 1;
    }

    #mdsChat.hf-floating-chat-widget .btn-open-chat-contacts:hover,
    #mdsChat.hf-floating-chat-widget .btn-open-chat-contacts:focus {
        color: #fff;
        background: linear-gradient(135deg, #ff8a2f 0%, #d92f12 100%) !important;
        box-shadow: 0 0 0 4px rgba(255, 122, 26, .2), 0 12px 26px rgba(226, 61, 24, .32);
    }

    #mdsChat.hf-floating-chat-widget .btn-open-chat-contacts svg {
        width: 17px;
        height: 17px;
    }

    #mdsChat.hf-floating-chat-widget .btn-open-chat-contacts-text {
        display: inline;
    }

    #mdsChat.chat-mobile-open .chat-content,
    #mdsChat .chat-content {
        height: 100% !important;
    }
}

@media (max-width: 576px) {
    #wrapper .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    #mdsChat .chat-right .chat-header {
        padding: 12px;
    }

    #mdsChat .chat-header .topic {
        margin-left: 0;
    }

    #mdsChat .chat-content .messages-inner {
        padding: 0 10px;
    }

    #mdsChat .chat-content .messages .message .message-text {
        max-width: calc(100vw - 92px);
    }

    #mdsChat .chat-content .chat-input {
        padding: 9px;
    }

    #mdsChat .chat-content .chat-input .btn:not(.btn-chat-attachment) {
        right: 5px;
        top: 3px;
    }
}

.hf-product-page .btn.hf-product-chat-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px !important;
    padding: 10px 22px !important;
    color: #fff !important;
    background: linear-gradient(135deg, #ff7a1a 0%, #e23d18 100%) !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 28px rgba(226, 61, 24, 0.28) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    float: none !important;
}

.hf-product-page .btn.hf-product-chat-cta i {
    color: currentColor;
    margin-right: 0 !important;
}

.hf-product-page .btn.hf-product-chat-cta:hover,
.hf-product-page .btn.hf-product-chat-cta:focus {
    color: #fff !important;
    background: linear-gradient(135deg, #ff8a2f 0%, #d92f12 100%) !important;
    box-shadow: 0 14px 32px rgba(226, 61, 24, 0.34) !important;
    transform: translateY(-1px);
}

.hf-product-page .btn.hf-product-chat-cta-primary {
    min-width: 150px !important;
    margin-left: 14px !important;
}

.hf-product-page .btn.hf-product-chat-cta.is-opening {
    cursor: progress;
    opacity: .78;
}
