.ps-chatdevice-modal.modal {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 28px !important;
}

.ps-chatdevice-modal.modal .modal-dialog,
.ps-chatdevice-modal.modal .modal-dialog.modal-sm,
.ps-chatdevice-modal.modal .modal-dialog.modal-lg,
.ps-chatdevice-modal.modal .modal-dialog.modal-xl {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.ps-chatdevice-modal.modal .modal-content {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.ps-chatdevice-modal.modal .modal-header,
.ps-chatdevice-modal.modal .modal-footer {
    display: none !important;
}

.ps-chatdevice-modal.modal .modal-body {
    padding: 0 !important;
    background: transparent !important;
}

.ps-chatdevice-modal.modal .card-body:has(.cd-screen),
.ps-chatdevice-modal.modal .card-body:has(.cd-wrap) {
    overflow: visible !important;
}


.cd-screen {
    position: relative;
    width: min(670px, 100%);
    height: 100%;
    max-height: 100%;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 28px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.10), inset 0 0 0 2px rgba(47, 59, 0, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cd-phone .cd-screen,
.cd-screen.cd-phone {
    aspect-ratio: auto;
}

.cd-tablet .cd-screen,
.cd-screen.cd-tablet {
    aspect-ratio: auto;
    border-radius: 26px;
}

.cd-screen::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 22px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
}

.cd-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 30;

    width: 36px;
    height: 36px;
    border-radius: 999px;

    border: 1px solid rgba(31, 35, 24, 0.18);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10);

    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
}

.cd-close::before,
.cd-close::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: rgba(31, 35, 24, 0.70);
}

.cd-close::before {
    transform: rotate(45deg);
}

.cd-close::after {
    transform: rotate(-45deg);
}

.cd-close:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(31, 35, 24, 0.26);
}

.cd-chat {
    flex: 1 1 auto;
    min-height: 0;
    padding: 54px 14px 18px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.cd-chat::after {
    content: "";
    display: block;
    height: 24px;
}

.cd-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 10px 0;
}

.cd-row-you {
    justify-content: flex-end;
}

.cd-row-them {
    justify-content: flex-start;
}

.cd-bubble-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
}

.cd-bubble-wrap {
    max-width: 78%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cd-bubble {
    border-radius: 18px;
    padding: 10px 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    line-height: 1.25;
}

.cd-bubble-you {
    background: rgba(76, 107, 0, 0.14);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(76, 107, 0, 0.18);
    border-bottom-right-radius: 6px;
}

.cd-bubble-them {
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(47, 59, 0, 0.10);
    border-bottom-left-radius: 6px;
}

.cd-time {
    font-size: 0.75rem;
    opacity: 0.65;
    padding: 0 6px;
}

.cd-bubble .prose,
.cd-bubble p,
.cd-bubble ul,
.cd-bubble ol {
    margin: 0;
}

.cd-bubble ul,
.cd-bubble ol {
    padding-left: 1.1rem;
    margin-top: 0.35rem;
}

.cd-bubble code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.1rem 0.3rem;
    border-radius: 8px;
}