﻿.pv-chat-modal .modal-dialog {
    max-width: 430px;
}

.pv-chat-modal .modal-dialog {
    position: fixed;
    right: 18px;
    bottom: 18px;
    margin: 0;
    width: min(430px, calc(100vw - 24px));
    pointer-events: auto;
}

.pv-chat-modal {
    pointer-events: none;
}

body.pv-chat-docked-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

.pv-chat-modal .modal-content.pv-chat-card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.pv-chat-modal .modal-header {
    border: 0;
    padding: 0;
}

.pv-chat-modal .modal-body.pv-chat-body {
    padding: 12px;
    background: #f8fafc;
}

.pv-chat-modal .modal-footer.pv-chat-footer {
    border: 0;
    padding: 10px 12px 12px;
    display: block;
}

.pv-chat-message-list {
    height: min(56vh, 380px);
    min-height: 220px;
    overflow-y: auto;
    padding: 2px;
}

.pv-chat-message-list::-webkit-scrollbar {
    width: 6px;
}

.pv-chat-message-list::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
    border-radius: 999px;
}

.pv-chat-message-row {
    display: flex;
    margin-bottom: 10px;
}

.pv-chat-message-row:last-child {
    margin-bottom: 0;
}

.pv-chat-message-row.me {
    justify-content: flex-end;
}

.pv-chat-message-row.system {
    justify-content: center;
}

.pv-chat-bubble {
    max-width: 84%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    border-radius: 14px;
    padding: 8px 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.pv-chat-message-row.me .pv-chat-bubble {
    background: #f35b04;
    border-color: #f35b04;
    color: #ffffff;
}

.pv-chat-message-row.system .pv-chat-bubble {
    max-width: 95%;
    border-style: dashed;
    background: #fff7ef;
    border-color: #ffd8bf;
    color: #9a4011;
    text-align: center;
}

.pv-chat-message-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.45;
}

.pv-chat-message-images {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.pv-chat-message-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
}

.pv-chat-message-meta {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    font-size: 11px;
    color: rgba(100, 116, 139, 0.92);
}

.pv-chat-message-row.me .pv-chat-message-meta {
    color: rgba(255, 255, 255, 0.86);
}

.pv-chat-empty {
    margin-top: 12px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

.pv-chat-quick-replies {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pv-chat-quick-reply-btn {
    border: 1px solid #f35b04;
    background: #fff;
    color: #f35b04;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
    padding: 6px 11px;
    transition: all 0.2s ease;
}

.pv-chat-quick-reply-btn:hover {
    background: #f35b04;
    color: #fff;
}

.pv-chat-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.pv-chat-image-preview img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
}

.pv-chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.pv-chat-action-btn,
.pv-chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pv-chat-action-btn {
    background: #eef2f7;
    color: #1D2939;
}

.pv-chat-send-btn {
    background: #f35b04;
    color: #ffffff;
}

.pv-chat-action-btn:hover {
    background: #e2e8f0;
}

.pv-chat-send-btn:hover {
    background: #d14d00;
}

.pv-chat-action-btn:disabled,
.pv-chat-send-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pv-chat-input {
    flex: 1;
    resize: none;
    min-height: 38px;
    max-height: 120px;
    border-radius: 12px;
    border: 1px solid #d2d9e4;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.35;
    background: #fff;
}

.pv-chat-input:focus {
    outline: none;
    border-color: #f35b04;
    box-shadow: 0 0 0 0.18rem rgba(243, 91, 4, 0.16);
}

@media (max-width: 575.98px) {
    .pv-chat-modal .modal-dialog {
        max-width: none;
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
        margin: 0;
    }

    .pv-chat-message-list {
        height: min(60vh, 420px);
    }

    .pv-chat-bubble {
        max-width: 90%;
    }

    .pv-chat-message-image {
        height: 106px;
    }
}
