/* Root container */
.df-chat-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2147483647;
    /* very high to sit above footers/backdrops */
}

/* Panel */
.df-chat-panel {
    position: absolute;
    right: 0;
    bottom: 64px;
    width: 320px;
    max-width: calc(100vw - 36px);
    border-radius: 16px;
    overflow: hidden;
    display: none;
    /* toggled by .open */
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}

.df-chat-widget.open .df-chat-panel {
    display: block;
}

.df-chat-header {
    background: linear-gradient(90deg, rgba(20, 67, 166, .10), rgba(242, 201, 76, .10));
    border-bottom: 1px solid #e7eefe;
}

.df-chat-body {
    background: #fff;
}

/* Preview transcript */
.df-chat-mini {
    max-height: 220px;
    overflow: auto;
    background: #fbfdff;
    border: 1px solid #eef3ff;
    border-radius: 10px;
    padding: 10px;
}

.df-msg {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.df-bubble {
    padding: 8px 12px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    max-width: 78%;
    font-size: .92rem;
}

.df-user .df-bubble {
    background: #e9f2ff;
    color: #0d1b4d;
}

.df-agent {
    justify-content: flex-end;
}

.df-agent .df-bubble {
    background: #fff7d6;
    color: #4a3c00;
}

/* Floating Action Button */
.df-chat-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
    cursor: pointer;
    border: 0;
    position: relative;
}

.df-unread {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #1443A6;
    color: #fff;
    border: 2px solid #fff;
}

@media (max-width:576px) {
    .df-chat-widget {
        right: 12px;
        bottom: 12px;
    }

    .df-chat-panel {
        width: calc(100vw - 24px);
    }
}

/* Keep Bootstrap backdrops below the widget */
.modal-backdrop,
.offcanvas-backdrop {
    z-index: 1040 !important;
}