.portalMessenger {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 12000;
    font-family: Arial, Helvetica, sans-serif;
}

.pmLauncher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #b31622;
    border-radius: 999px;
    background: #c91d2b;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 14px 34px rgba(29, 39, 54, .24);
    overflow: visible;
}

.pmLauncher:hover,
.pmLauncher:focus {
    background: #aa1724;
    color: #fff;
    outline: none;
}

.pmLauncher.pmHasUnread {
    animation: pmPulse 1.05s ease-in-out infinite;
    background: #e11d2f;
    box-shadow: 0 0 0 0 rgba(201, 29, 43, .64), 0 18px 38px rgba(29, 39, 54, .30);
}

.pmLauncher.pmHasUnread:before {
    content: "";
    position: absolute;
    inset: -14px;
    border: 3px solid rgba(201, 29, 43, .22);
    border-radius: 999px;
    pointer-events: none;
    animation: pmUnreadRing 1.45s ease-out infinite;
}

.pmLauncher.pmHasUnread:after {
    content: "";
    position: absolute;
    top: -5px;
    right: 5px;
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    border-radius: 999px;
    background: #ff3b4f;
    box-shadow: 0 4px 10px rgba(201, 29, 43, .38);
    pointer-events: none;
}

@keyframes pmPulse {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 0 0 rgba(201, 29, 43, .64), 0 18px 38px rgba(29, 39, 54, .30);
    }
    50% {
        transform: translateY(-3px) scale(1.08);
        box-shadow: 0 0 0 18px rgba(201, 29, 43, 0), 0 24px 52px rgba(29, 39, 54, .36);
    }
    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 0 0 rgba(201, 29, 43, 0), 0 18px 38px rgba(29, 39, 54, .28);
    }
}

@keyframes pmUnreadRing {
    0% {
        opacity: .95;
        transform: scale(.88);
        box-shadow: 0 0 0 0 rgba(201, 29, 43, .18);
    }
    70% {
        opacity: .15;
        transform: scale(1.25);
        box-shadow: 0 0 0 18px rgba(201, 29, 43, 0);
    }
    100% {
        opacity: 0;
        transform: scale(1.28);
        box-shadow: 0 0 0 20px rgba(201, 29, 43, 0);
    }
}

.pmUnread {
    display: none;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fff;
    color: #aa1724;
    line-height: 22px;
    text-align: center;
    font-size: 12px;
}

.pmSoundPrompt {
    position: absolute;
    right: 0;
    bottom: 54px;
    width: 250px;
    padding: 10px 12px;
    border: 1px solid #f6c55b;
    border-radius: 9px;
    background: #fff8e6;
    color: #5f4300;
    box-shadow: 0 14px 32px rgba(29, 39, 54, .18);
    font-size: 12px;
    line-height: 1.35;
}

.pmSoundPrompt:after {
    content: "";
    position: absolute;
    right: 24px;
    bottom: -7px;
    width: 12px;
    height: 12px;
    border-right: 1px solid #f6c55b;
    border-bottom: 1px solid #f6c55b;
    background: #fff8e6;
    transform: rotate(45deg);
}

.pmEnableSound {
    display: block;
    margin-top: 7px;
    padding: 5px 9px;
    border: 1px solid #b31622;
    border-radius: 6px;
    background: #c91d2b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.pmEnableSound:hover,
.pmEnableSound:focus {
    background: #aa1724;
    color: #fff;
    outline: none;
}

.pmSoundStatus {
    display: block;
    margin-top: 6px;
    color: #7a5a05;
    font-size: 11px;
}

.pmToastStack {
    position: fixed;
    right: 22px;
    bottom: 78px;
    z-index: 12020;
    width: 340px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.pmToast {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 0;
    border: 1px solid #b31622;
    border-left: 5px solid #c91d2b;
    border-radius: 10px;
    background: #fff;
    color: #10233c;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .28);
    text-align: left;
    pointer-events: auto;
    animation: pmToastIn .18s ease-out;
}

.pmToast:hover {
    border-color: #8d111c;
    box-shadow: 0 22px 52px rgba(15, 23, 42, .34);
}

.pmToastBody {
    display: block;
    width: 100%;
    min-height: 76px;
    padding: 12px 42px 12px 14px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.pmToastBody:hover,
.pmToastBody:focus {
    outline: none;
}

.pmToastClose {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: #f3f6f9;
    color: #667085;
    font-size: 18px;
    font-weight: 800;
    line-height: 24px;
    text-align: center;
    z-index: 1;
}

.pmToastClose:hover,
.pmToastClose:focus {
    background: #c91d2b;
    color: #fff;
    outline: none;
}

.pmToastLabel {
    display: block;
    margin-bottom: 3px;
    color: #c91d2b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pmToastSender {
    display: block;
    margin-bottom: 4px;
    color: #10233c;
    font-size: 14px;
    font-weight: 800;
}

.pmToastText {
    display: block;
    color: #43536a;
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}

.pmToastLeaving {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .22s ease, transform .22s ease;
}

@keyframes pmToastIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pmPanel {
    display: none;
    position: absolute;
    right: 0;
    bottom: 56px;
    width: 720px;
    max-width: calc(100vw - 36px);
    height: 560px;
    max-height: calc(100vh - 108px);
    background: #fff;
    border: 1px solid #c9d7e8;
    border-radius: 10px;
    box-shadow: 0 26px 70px rgba(15, 23, 42, .28);
    overflow: hidden;
}

.pmPanel.pmOpen {
    display: block;
}

.pmHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 0 14px 0 18px;
    background: linear-gradient(180deg, #303640 0%, #222832 100%);
    color: #fff;
}

.pmTitle {
    font-size: 16px;
    font-weight: 700;
}

.pmConnection {
    margin-top: 2px;
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
}

.pmClose {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    color: #fff;
    font-size: 20px;
    line-height: 1;
}

.pmBody {
    display: flex;
    height: calc(100% - 54px);
    min-height: 0;
}

.pmPeople {
    width: 250px;
    border-right: 1px solid #dbe8f5;
    background: #f5f9fd;
    overflow-y: auto;
}

.pmPeopleHeader {
    padding: 12px 14px;
    color: #5f6f83;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pmUser {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-top: 1px solid #e3edf7;
    background: transparent;
    text-align: left;
}

.pmUser:hover,
.pmUser.pmSelected {
    background: #fff;
}

.pmStatusDot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #9ca3af;
}

.pmStatusDot.Active {
    background: #16a34a;
}

.pmStatusDot.Away {
    background: #f59e0b;
}

.pmUserName {
    flex: 1 1 auto;
    min-width: 0;
    color: #10233c;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pmUserStatus {
    display: block;
    margin-top: 2px;
    color: #69778a;
    font-size: 11px;
    font-weight: 500;
}

.pmUserUnread {
    flex: 0 0 auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #c91d2b;
    color: #fff;
    text-align: center;
    line-height: 20px;
    font-size: 11px;
    font-weight: 700;
}

.pmChat {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    background: #fff;
}

.pmChatHeader {
    padding: 12px 16px;
    border-bottom: 1px solid #dbe8f5;
    color: #10233c;
    font-size: 15px;
    font-weight: 800;
}

.pmMessages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    background: #fbfdff;
}

.pmEmpty {
    margin: auto;
    color: #667085;
    font-size: 14px;
    text-align: center;
}

.pmMessage {
    max-width: 78%;
    margin-bottom: 10px;
    clear: both;
}

.pmMessageMine {
    float: right;
}

.pmMessageTheirs {
    float: left;
}

.pmBubble {
    padding: 9px 11px;
    border-radius: 12px;
    background: #edf3fa;
    color: #10233c;
    font-size: 13px;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.pmMessageMine .pmBubble {
    background: #c91d2b;
    color: #fff;
}

.pmMeta {
    margin: 4px 4px 0;
    color: #7d8998;
    font-size: 10px;
}

.pmMessageMine .pmMeta {
    text-align: right;
}

.pmCompose {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #dbe8f5;
    background: #fff;
}

.pmInput {
    flex: 1 1 auto;
    min-height: 38px;
    max-height: 90px;
    padding: 9px 10px;
    border: 1px solid #b9cbe0;
    border-radius: 8px;
    resize: vertical;
    font-size: 13px;
}

.pmSend {
    flex: 0 0 auto;
    min-width: 74px;
    border: 1px solid #2273b9;
    border-radius: 8px;
    background: #2f80bd;
    color: #fff;
    font-weight: 700;
}

.pmSend:disabled {
    background: #9aa9b8;
    border-color: #9aa9b8;
}

@media (max-width: 767px) {
    .portalMessenger {
        right: 12px;
        bottom: 12px;
    }

    .pmSoundPrompt {
        right: 0;
        bottom: 54px;
        width: 230px;
    }

    .pmToastStack {
        right: 12px;
        bottom: 68px;
        width: calc(100vw - 24px);
    }

    .pmPanel {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 64px;
        width: auto;
        max-width: none;
        height: calc(100vh - 92px);
        max-height: none;
    }

    .pmBody {
        flex-direction: column;
    }

    .pmPeople {
        width: 100%;
        height: 168px;
        border-right: 0;
        border-bottom: 1px solid #dbe8f5;
    }

    .pmChat {
        min-height: 0;
    }
}
