.mini-chat-launcher {
    position: fixed;
    bottom: 18px;
    right: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #00b4d8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 2100;
}

#mini-chat-launcher-badge {
    position: absolute;
    top: -6px;
    right: -6px;
}

.mini-chat-drawer {
    position: fixed;
    bottom: 82px;
    right: 18px;
    width: 320px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    overflow: hidden;
    z-index: 2100;
}

.mini-chat-drawer__header {
    padding: 10px 12px;
    background: linear-gradient(135deg, #0d6efd, #35a2ff);
    color: #fff;
    position: relative;
}

.mini-chat-drawer__search {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
}

.mini-chat-contacts {
    max-height: 320px;
    overflow-y: auto;
}

.mini-chat-contact {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mini-chat-contact:hover {
    background: #f7f9fb;
}

.mini-chat-contact__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.mini-chat-contact__body {
    flex: 1;
}

.mini-chat-contact__title {
    font-weight: 600;
    font-size: 14px;
}

.mini-chat-contact__snippet {
    font-size: 12px;
    color: #6c757d;
}

.mini-chat-popups {
    position: fixed;
    bottom: 12px;
    right: 86px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    z-index: 2100;
}

.mini-chat-window {
    width: 320px;
    background: #fff;
    border-radius: 12px 12px 10px 10px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mini-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(135deg, #0d6efd, #35a2ff);
    color: #fff;
}

.mini-chat-header .title {
    font-weight: 600;
    font-size: 14px;
}

.mini-chat-header .btn-icon {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    transition: background 0.2s ease, transform 0.15s ease;
}

.mini-chat-header .btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.mini-chat-header .subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.mini-chat-body {
    padding: 10px;
    max-height: 280px;
    overflow-y: auto;
    background: #f8fafc;
}

.mini-chat-footer {
    padding: 8px 10px 10px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.mini-chat-footer form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.mini-chat-footer .btn {
    min-width: 56px;
    padding: 6px 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d6efd, #00b4d8);
    border: none;
    box-shadow: 0 5px 12px rgba(13, 110, 253, 0.2);
    font-weight: 600;
}

.mini-chat-footer .btn:hover {
    filter: brightness(1.05);
}

.mini-chat-footer input.form-control {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.mini-chat-attach {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #6c757d;
    background: #f1f3f5;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.mini-chat-attach:hover {
    background: #e2e6ea;
    transform: translateY(-1px);
}

.mini-chat-file {
    display: none;
}

.mini-chat-message {
    display: flex;
    margin-bottom: 8px;
}

.mini-chat-message.mine {
    justify-content: flex-end;
}

.mini-chat-bubble {
    max-width: 78%;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    background: #e9ecef;
    color: #1f2937;
}

.mini-chat-message.mine .mini-chat-bubble {
    background: #0d6efd;
    color: #fff;
}

.mini-chat-bubble img {
    max-width: 180px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    display: block;
}

.mini-chat-time {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.8;
}

.mini-chat-typing {
    font-size: 12px;
    color: #0d6efd;
    padding: 4px 0 2px;
}

.mini-chat-window.minimized .mini-chat-body,
.mini-chat-window.minimized .mini-chat-footer {
    display: none;
}

.mini-chat-window.minimized {
    width: 200px;
}

.mini-chat-window .btn-icon {
    color: inherit;
    border: none;
    background: transparent;
}

.mini-chat-drawer__header button {
    color: #fff;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    padding: 0;
    position: absolute;
    top: 12px;
    right: 12px;
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.mini-chat-drawer__header button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    transform: translateY(-1px);
}

.mini-chat-unread {
    min-width: 18px;
    height: 18px;
    font-size: 11px;
}

.mini-chat-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.mini-chat-lightbox__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mini-chat-lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    transform-origin: center;
    cursor: grab;
    user-select: none;
}

.mini-chat-lightbox__actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
}

.mini-chat-lightbox__btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.85);
    color: #0d6efd;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mini-chat-lightbox__btn:hover {
    background: #fff;
}

.mini-chat-bubble.pending {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .mini-chat-popups {
        right: 12px;
        left: 12px;
        flex-direction: column;
        align-items: flex-end;
    }

    .mini-chat-window {
        width: 100%;
        max-width: 100%;
    }
}
