.rfr-chat-top-bell {
    width: 38px;
    height: 38px;
    border: 1px solid #059669;
    border-radius: 10px;
    background: #059669;
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.rfr-chat-top-bell:hover {
    background: #047857;
    border-color: #047857;
    transform: translateY(-1px);
}

.rfr-chat-top-bell.has-unread {
    background: #DC2626;
    border-color: #DC2626;
    color: #FFFFFF;
}

.rfr-chat-top-bell.has-unread:hover {
    background: #B91C1C;
    border-color: #B91C1C;
}

.rfr-chat-top-bell i {
    font-size: 17px;
}

.rfr-system-notify-bell {
    width: 38px;
    height: 38px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #FFFFFF;
    color: #991B1B;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.rfr-system-notify-bell:hover {
    background: #FFF7F7;
    border-color: #FCA5A5;
    transform: translateY(-1px);
}

.rfr-system-notify-bell i {
    font-size: 17px;
}

.rfr-system-notify-bell .notif-badge-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #DC2626;
    color: #FFFFFF;
    font-size: 10px;
    line-height: 18px;
    font-weight: 800;
    text-align: center;
    position: absolute;
    top: -6px;
    right: -6px;
    box-shadow: 0 0 0 2px #FFFFFF;
    display: none;
}

.rfr-chat-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #DC2626;
    color: #FFFFFF;
    font-size: 10px;
    line-height: 18px;
    font-weight: 800;
    text-align: center;
    position: absolute;
    top: -6px;
    right: -6px;
    box-shadow: 0 0 0 2px #FFFFFF;
    display: none;
}

.rfr-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    font-family: 'Poppins', sans-serif;
}

.rfr-chat-widget.is-minimized .rfr-chat-launcher {
    animation: rfr-chat-minimized-pulse 1.1s ease 1;
}

@keyframes rfr-chat-minimized-pulse {
    0% { transform: translateY(0) scale(1); }
    45% { transform: translateY(-4px) scale(1.04); }
    100% { transform: translateY(0) scale(1); }
}

.rfr-chat-launcher {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 18px;
    background: #059669;
    color: #FFFFFF;
    box-shadow: 0 18px 34px rgba(5, 150, 105, .32);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

.rfr-chat-launcher.has-unread {
    background: #DC2626;
    box-shadow: 0 18px 34px rgba(220, 38, 38, .32);
}

.rfr-chat-launcher.has-unread:hover {
    background: #B91C1C;
    box-shadow: 0 22px 38px rgba(220, 38, 38, .36);
}

.rfr-chat-launcher:hover {
    transform: translateY(-3px);
    background: #047857;
    box-shadow: 0 22px 38px rgba(5, 150, 105, .36);
}

.rfr-chat-launcher i {
    font-size: 22px;
}

.rfr-chat-launcher .rfr-chat-badge {
    top: -7px;
    right: -7px;
}

.rfr-chat-panel {
    width: min(var(--rfr-chat-panel-width, 760px), calc(100vw - 48px));
    height: min(var(--rfr-chat-panel-height, 620px), calc(100vh - 104px));
    min-width: min(560px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    max-height: 720px;
    min-height: 0;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    box-shadow: 0 26px 60px rgba(15, 23, 42, .22);
    overflow: hidden;
    resize: both;
    position: absolute;
    right: 0;
    bottom: 0;
    opacity: 0;
    transform: translateY(22px) scale(.97);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    display: flex;
    flex-direction: column;
}

.rfr-chat-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10px;
    z-index: 30;
    cursor: ew-resize;
    background: transparent;
}

.rfr-chat-resize-left {
    left: 0;
}

.rfr-chat-resize-right {
    right: 0;
}

.rfr-chat-widget.is-open .rfr-chat-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.rfr-chat-head {
    flex: 0 0 auto;
    min-height: 62px;
    padding: 13px 16px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #FFFFFF;
}

.rfr-chat-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rfr-chat-title strong {
    color: #111827;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.2;
}

.rfr-chat-title span {
    color: #6B7280;
    font-size: 11px;
    font-weight: 600;
}

.rfr-chat-title .rfr-chat-sound-status {
    color: #047857;
    font-size: 10px;
    font-weight: 850;
}

.rfr-chat-title .rfr-chat-sound-status.is-muted {
    color: #DC2626;
}

.rfr-chat-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rfr-chat-head-bell,
.rfr-chat-minimize,
.rfr-chat-close,
.rfr-chat-back {
    width: 36px;
    height: 36px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #FFFFFF;
    color: #991B1B;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.rfr-chat-head-bell.has-unread {
    background: #FEF2F2;
    border-color: #FCA5A5;
    color: #DC2626;
}

.rfr-chat-head-bell.is-muted {
    color: #6B7280;
}

.rfr-chat-minimize {
    color: #374151;
}

.rfr-chat-close {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #B91C1C;
}

.rfr-chat-close:hover {
    background: #FEE2E2;
    border-color: #FCA5A5;
    color: #991B1B;
}

.rfr-chat-presence-toggle {
    height: 36px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #FFFFFF;
    color: #374151;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.rfr-chat-presence-toggle.is-online {
    color: #047857;
    border-color: #A7F3D0;
    background: #ECFDF5;
}

.rfr-chat-presence-toggle.is-offline {
    color: #4B5563;
    border-color: #E5E7EB;
    background: #F9FAFB;
}

.rfr-chat-presence-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #9CA3AF;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, .14);
}

.rfr-chat-presence-toggle.is-online .rfr-chat-presence-dot {
    background: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, .16);
}

.rfr-chat-back {
    display: none;
    color: #374151;
}

.rfr-chat-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 270px 1fr;
    background: #F8FAFC;
}

.rfr-chat-users {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-right: 1px solid #E5E7EB;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
}

.rfr-chat-users-head {
    padding: 12px 14px;
    border-bottom: 1px solid #F3F4F6;
    color: #111827;
    font-size: 13px;
    font-weight: 850;
}

.rfr-chat-user-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

.rfr-chat-user {
    width: 100%;
    border: 0;
    background: transparent;
    color: #111827;
    border-radius: 10px;
    padding: 9px 8px;
    display: grid;
    grid-template-columns: 38px 1fr auto;
    gap: 9px;
    align-items: center;
    text-align: left;
    cursor: pointer;
}

.rfr-chat-user:hover,
.rfr-chat-user.is-active {
    background: #FFF7F7;
}

.rfr-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #FEF2F2;
    color: #991B1B;
    font-size: 12px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.rfr-chat-presence {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    position: absolute;
    right: -2px;
    bottom: -2px;
    background: #9CA3AF;
}

.rfr-chat-presence.is-online {
    background: #059669;
}

.rfr-chat-user-main {
    min-width: 0;
}

.rfr-chat-user-name {
    display: block;
    font-size: 12px;
    font-weight: 850;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rfr-chat-user-meta {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    font-weight: 600;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rfr-chat-user-unread {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #DC2626;
    color: #FFFFFF;
    font-size: 10px;
    line-height: 20px;
    text-align: center;
    font-weight: 850;
    display: none;
}

.rfr-chat-conversation {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #F8FAFC;
}

.rfr-chat-conversation-head {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 10px 14px;
    border-bottom: 1px solid #E5E7EB;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rfr-chat-peer-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rfr-chat-peer-title strong {
    font-size: 13px;
    font-weight: 850;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rfr-chat-peer-title span {
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
}

.rfr-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rfr-chat-empty,
.rfr-chat-loading {
    margin: auto;
    color: #6B7280;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    max-width: 240px;
}

.rfr-chat-bubble-row {
    display: flex;
    width: 100%;
}

.rfr-chat-bubble-row.is-me {
    justify-content: flex-end;
}

.rfr-chat-bubble {
    max-width: min(78%, 420px);
    border-radius: 14px;
    padding: 9px 10px 7px;
    background: #FFFFFF;
    color: #111827;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.rfr-chat-bubble-row.is-me .rfr-chat-bubble {
    background: #059669;
    color: #FFFFFF;
    border-color: #059669;
}

.rfr-chat-message-text {
    font-size: 12px;
    line-height: 1.45;
    font-weight: 500;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.rfr-chat-message-meta {
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 9px;
    font-weight: 700;
    color: #6B7280;
}

.rfr-chat-bubble-row.is-me .rfr-chat-message-meta {
    color: rgba(255, 255, 255, .78);
}

.rfr-chat-check {
    color: #9CA3AF;
    letter-spacing: -2px;
    font-weight: 900;
}

.rfr-chat-check.is-read {
    color: #86EFAC;
}

.rfr-chat-compose {
    flex: 0 0 auto;
    position: relative;
    padding: 10px;
    border-top: 1px solid #E5E7EB;
    background: #FFFFFF;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.rfr-chat-input {
    flex: 1;
    min-height: 42px;
    max-height: 110px;
    overflow-y: auto;
    resize: none;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.45;
    outline: none;
}

.rfr-chat-input:focus {
    border-color: #FCA5A5;
    box-shadow: 0 0 0 3px rgba(175, 21, 26, .08);
}

.rfr-chat-send,
.rfr-chat-attach-toggle {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #991B1B;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.rfr-chat-attach-toggle {
    background: #F3F4F6;
    color: #991B1B;
    border: 1px solid #E5E7EB;
}

.rfr-chat-attach-toggle.is-open,
.rfr-chat-attach-toggle:hover:not(:disabled) {
    background: #FEF2F2;
    border-color: #FCA5A5;
}

.rfr-chat-send:disabled,
.rfr-chat-attach-toggle:disabled {
    background: #D1D5DB;
    border-color: #D1D5DB;
    color: #FFFFFF;
    cursor: not-allowed;
}

.rfr-chat-attach-menu,
.rfr-chat-audio-panel {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 62px;
    z-index: 5;
    display: none;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .14);
}

.rfr-chat-attach-menu.is-open {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
}

.rfr-chat-attach-menu button {
    min-height: 64px;
    border: 1px solid #F3F4F6;
    border-radius: 12px;
    background: #F9FAFB;
    color: #111827;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.rfr-chat-attach-menu button:hover {
    background: #FEF2F2;
    border-color: #FCA5A5;
    color: #991B1B;
}

.rfr-chat-attach-menu i {
    font-size: 18px;
    color: #991B1B;
}

.rfr-chat-audio-panel.is-open {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
}

.rfr-chat-audio-panel.is-recording {
    border-color: #FCA5A5;
    background: #FFF7F7;
}

.rfr-chat-audio-status {
    min-width: 94px;
    color: #991B1B;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 850;
}

.rfr-chat-audio-preview {
    width: min(220px, 100%);
    height: 34px;
    flex: 1 1 180px;
}

.rfr-chat-audio-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.rfr-chat-audio-actions button {
    min-height: 32px;
    border: 1px solid #E5E7EB;
    border-radius: 9px;
    background: #FFFFFF;
    color: #111827;
    padding: 0 9px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
}

.rfr-chat-audio-actions button:hover:not(:disabled) {
    background: #FEF2F2;
    border-color: #FCA5A5;
    color: #991B1B;
}

.rfr-chat-audio-actions button:disabled {
    color: #9CA3AF;
    background: #F3F4F6;
    cursor: not-allowed;
}

.rfr-chat-attachment {
    width: 100%;
    color: #111827;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.rfr-chat-attachment + .rfr-chat-message-text {
    margin-top: 8px;
}

.rfr-chat-attachment-image {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(229, 231, 235, .96);
    padding: 0;
}

.rfr-chat-attachment-image img {
    display: block;
    width: 100%;
    max-width: 280px;
    max-height: 220px;
    object-fit: cover;
    background: #F3F4F6;
}

.rfr-chat-attachment-document,
.rfr-chat-attachment-audio {
    min-width: min(260px, 100%);
    border: 1px solid rgba(229, 231, 235, .96);
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rfr-chat-attachment-document {
    cursor: pointer;
}

.rfr-chat-file-icon,
.rfr-chat-file-download {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #FEF2F2;
    color: #991B1B;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.rfr-chat-file-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    font-weight: 800;
    color: #111827;
}

.rfr-chat-file-info > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rfr-chat-file-info i {
    margin-right: 6px;
    color: #991B1B;
}

.rfr-chat-file-size {
    color: #6B7280;
    font-size: 10px;
    font-weight: 700;
}

.rfr-chat-attachment-audio audio {
    width: 190px;
    max-width: 100%;
    height: 34px;
}

.rfr-chat-attachment-audio a {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #FEF2F2;
    color: #991B1B;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex: 0 0 auto;
}

.rfr-chat-preview {
    position: fixed;
    inset: 0;
    z-index: 6200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .46);
    padding: 16px;
}

.rfr-chat-preview.is-open {
    display: flex;
}

.rfr-chat-preview-dialog {
    width: min(1440px, calc(100vw - 32px));
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: 1080px;
    border-radius: 14px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .34);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rfr-chat-preview-head {
    min-height: 54px;
    border-bottom: 1px solid #E5E7EB;
    padding: 10px 12px 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #FFFFFF;
}

.rfr-chat-preview-head strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
    font-size: 13px;
    font-weight: 850;
}

.rfr-chat-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rfr-chat-preview-download,
.rfr-chat-preview-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

.rfr-chat-preview-download {
    border: 1px solid #D1FAE5;
    background: #ECFDF5;
    color: #047857;
}

.rfr-chat-preview-close {
    border: 1px solid #FECACA;
    background: #FEF2F2;
    color: #B91C1C;
}

.rfr-chat-preview-body {
    flex: 1 1 auto;
    min-height: 0;
    background: #F8FAFC;
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.rfr-chat-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #FFFFFF;
    opacity: 0;
    transition: opacity .16s ease;
}

.rfr-chat-preview-body.is-loaded .rfr-chat-preview-frame {
    opacity: 1;
}

.rfr-chat-preview-loading {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #4B5563;
    background: #F8FAFC;
    font-size: 13px;
}

.rfr-chat-preview-loading i {
    color: #B91C1C;
    font-size: 24px;
}

.rfr-chat-preview-body.is-loaded .rfr-chat-preview-loading {
    display: none;
}

.rfr-chat-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: auto;
}

.rfr-chat-preview-empty {
    margin: auto;
    max-width: 360px;
    color: #374151;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    font-size: 12px;
}

.rfr-chat-preview-empty i {
    color: #991B1B;
    font-size: 28px;
}

html.rfr-chat-preview-open,
body.rfr-chat-preview-open {
    overflow: hidden !important;
}

@media (max-width: 768px), (max-width: 950px) and (max-height: 500px) {
    html.rfr-chat-mobile-open,
    body.rfr-chat-mobile-open {
        width: 100%;
        height: 100%;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    .rfr-chat-widget {
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        height: var(--rfr-chat-mobile-height, 100dvh);
        max-height: 100vh;
        max-height: var(--rfr-chat-mobile-height, 100dvh);
        z-index: 5000;
        pointer-events: none;
        overflow: hidden;
    }

    .rfr-chat-widget.is-open {
        pointer-events: auto;
    }

    .rfr-chat-launcher {
        display: none;
    }

    .rfr-chat-panel {
        width: 100vw;
        height: 100vh;
        height: var(--rfr-chat-mobile-height, 100dvh);
        min-height: 0;
        min-width: 0;
        max-height: 100vh;
        max-height: var(--rfr-chat-mobile-height, 100dvh);
        max-width: none;
        right: 0;
        left: 0;
        bottom: 0;
        top: 0;
        border: 0;
        border-radius: 0;
        transform: translateY(18px);
        display: none;
        resize: none;
    }

    .rfr-chat-resize-handle {
        display: none;
    }

    .rfr-chat-widget.is-open .rfr-chat-panel {
        display: flex;
        animation: rfr-chat-mobile-flip .24s ease both;
    }

    @keyframes rfr-chat-mobile-flip {
        from { opacity: 0; transform: perspective(900px) rotateX(7deg) translateY(18px) scale(.98); }
        to { opacity: 1; transform: perspective(900px) rotateX(0deg) translateY(0) scale(1); }
    }

    .rfr-chat-head {
        min-height: 62px;
        padding-top: max(10px, env(safe-area-inset-top));
        padding-right: max(10px, env(safe-area-inset-right));
        padding-bottom: 10px;
        padding-left: max(10px, env(safe-area-inset-left));
        gap: 8px;
    }

    .rfr-chat-title {
        flex: 1 1 auto;
    }

    .rfr-chat-title strong {
        font-size: 13px;
    }

    .rfr-chat-title span:not(.rfr-chat-sound-status) {
        display: none;
    }

    .rfr-chat-head-actions {
        flex: 0 0 auto;
        gap: 6px;
    }

    .rfr-chat-presence-toggle {
        width: auto;
        min-width: 76px;
        padding: 0 8px;
    }

    .rfr-chat-presence-toggle span:last-child {
        display: inline;
    }

    .rfr-chat-head-bell,
    .rfr-chat-minimize,
    .rfr-chat-close {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .rfr-chat-body {
        flex: 1 1 0;
        min-height: 0;
        height: auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .rfr-chat-users {
        flex: 1 1 0;
        min-height: 0;
        border-right: 0;
    }

    .rfr-chat-conversation {
        display: none;
        flex: 1 1 0;
        width: 100%;
        height: auto;
        min-height: 0;
        overflow: hidden;
    }

    .rfr-chat-widget.has-peer .rfr-chat-users {
        display: none;
    }

    .rfr-chat-widget.has-peer .rfr-chat-conversation {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .rfr-chat-conversation-head { grid-row: 1; }

    .rfr-chat-back {
        display: inline-flex;
    }

    .rfr-chat-bubble {
        max-width: 84%;
    }

    .rfr-chat-messages {
        grid-row: 2;
        min-height: 0;
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding: 12px;
    }

    .rfr-chat-compose {
        grid-row: 3;
        position: relative;
        z-index: 8;
        flex: none;
        width: 100%;
        min-height: 58px;
        box-sizing: border-box;
        gap: 6px;
        padding-top: 9px;
        padding-right: max(9px, env(safe-area-inset-right));
        padding-bottom: calc(9px + env(safe-area-inset-bottom));
        padding-left: max(9px, env(safe-area-inset-left));
    }

    .rfr-chat-send,
    .rfr-chat-attach-toggle {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .rfr-chat-attach-menu,
    .rfr-chat-audio-panel {
        left: 9px;
        right: 9px;
        bottom: 58px;
    }

    .rfr-chat-attach-menu button {
        min-height: 58px;
    }

    .rfr-chat-audio-panel.is-open {
        align-items: stretch;
        flex-direction: column;
    }

    .rfr-chat-audio-preview {
        width: 100%;
        height: 38px;
    }

    .rfr-chat-audio-actions {
        justify-content: stretch;
    }

    .rfr-chat-audio-actions button {
        flex: 1 1 calc(50% - 6px);
    }

    .rfr-chat-attachment-audio {
        min-width: 0;
    }

    .rfr-chat-attachment-audio audio {
        width: 150px;
    }

    .rfr-chat-preview {
        padding: 0;
    }

    .rfr-chat-preview-dialog {
        width: 100vw;
        height: 100vh;
        height: var(--rfr-chat-mobile-height, 100dvh);
        max-height: none;
        border-radius: 0;
        border: 0;
    }
}

.rfr-chat-upload-progress{position:absolute;bottom:80px;left:16px;right:16px;z-index:12;background:#fff;padding:12px;border:1px solid #eee;border-radius:12px;box-shadow:0 4px 20px #0002;font-size:13px;overflow-wrap:anywhere}.rfr-chat-upload-progress progress{display:block;width:100%;height:8px;margin-top:8px;accent-color:#af151a}

.rfr-chat-upload-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.rfr-chat-upload-actions button{min-height:44px;padding:8px 12px;font:inherit}.rfr-chat-upload-actions button[hidden]{display:none}
