.chat-modal {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 3vh 16px;
}

.chat-modal.is-open {
    display: flex;
}

.chat-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
}

.chat-modal-dialog {
    position: relative;
    display: flex;
    width: min(760px, 100%);
    height: min(860px, 94vh);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.chat-modal-header {
    display: flex;
    flex: 0 0 56px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid #e2e8f0;
}

.chat-modal-header h2 {
    overflow: hidden;
    margin: 0;
    color: #172033;
    font-size: 1rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-modal-close {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 1.15rem;
}

.chat-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.chat-modal-frame {
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    border: 0;
    background: #fff;
}

@media (max-width: 640px) {
    .chat-modal {
        padding: 0;
    }

    .chat-modal-dialog {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .chat-modal-header {
        flex-basis: 52px;
        padding: 0 14px;
    }
}