.nv-chat,
.nv-chat * {
    box-sizing: border-box;
}

/* ===== Green World UI: Nhắc lịch trong chat ===== */
.gw-ui-chat-reminder-toggle,
.gw-ui-chat-reminder-create {
    position: relative;
}

.gw-ui-chat-reminder-toggle.has-reminders {
    color: #0f766e;
    background: #f1f9f8;
    border-color: #9ecdc9;
}

.gw-ui-chat-reminder-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    box-sizing: border-box;
}

.nv-chat-message-action.gw-ui-chat-reminder-action {
    color: #8a5b12;
}

.nv-chat-message-action.gw-ui-chat-reminder-action:hover,
.nv-chat-message-action.gw-ui-chat-reminder-action:focus {
    background: #fff9e8;
    color: #8a5b12;
}

.gw-ui-chat-reminder-layer {
    position: fixed;
    inset: 0;
    z-index: 2147483100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(16, 54, 51, 0.52);
    font-family: Arial, Helvetica, sans-serif;
}

.gw-ui-chat-reminder-modal {
    width: 560px;
    max-width: 100%;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border: 1px solid #d8e3e2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(16, 54, 51, 0.16);
    color: #1f2d2b;
}

.gw-ui-chat-reminder-modal--list {
    width: 680px;
    display: flex;
    flex-direction: column;
}

.gw-ui-chat-reminder-modal-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #d8e3e2;
    background: #f7faf9;
}

.gw-ui-chat-reminder-modal-head > div {
    min-width: 0;
    flex: 1 1 auto;
}

.gw-ui-chat-reminder-modal-head h3 {
    margin: 0;
    color: #1f2d2b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
}

.gw-ui-chat-reminder-modal-head p {
    margin: 3px 0 0;
    overflow: hidden;
    color: #7b8f8c;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gw-ui-chat-reminder-close {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #526b68;
    font-size: 16px;
}

.gw-ui-chat-reminder-close:hover,
.gw-ui-chat-reminder-close:focus {
    background: #eef2f1;
    color: #1f2d2b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.20);
}

.gw-ui-chat-reminder-form {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 20px;
}

.gw-ui-chat-reminder-form > label,
.gw-ui-chat-reminder-scope legend {
    display: block;
    margin: 0 0 6px;
    color: #526b68;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
}

.gw-ui-chat-reminder-form > .form-control {
    min-height: 40px;
    margin-bottom: 16px;
    border-color: #b8ccca;
    border-radius: 5px;
    box-shadow: none;
    color: #1f2d2b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 400;
}

.gw-ui-chat-reminder-form > textarea.form-control {
    min-height: 88px;
    resize: vertical;
}

.gw-ui-chat-reminder-form > .form-control:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.20);
}

.gw-ui-chat-reminder-source {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    border-left: 3px solid #287d7a;
    border-radius: 8px;
    background: #f1f9f8;
    color: #526b68;
}

.gw-ui-chat-reminder-source > i {
    margin-top: 2px;
    color: #0f766e;
}

.gw-ui-chat-reminder-source div {
    min-width: 0;
}

.gw-ui-chat-reminder-source strong,
.gw-ui-chat-reminder-source span {
    display: block;
}

.gw-ui-chat-reminder-source strong {
    margin-bottom: 2px;
    color: #0f5f5c;
    font-size: 12px;
    font-weight: 700;
}

.gw-ui-chat-reminder-source span {
    overflow: hidden;
    font-size: 13px;
    font-weight: 400;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gw-ui-chat-reminder-scope {
    margin: 0;
    padding: 0;
    border: 0;
}

.gw-ui-chat-reminder-scope > label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 44px;
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid #d8e3e2;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.gw-ui-chat-reminder-scope > label:has(input:checked) {
    border-color: #9ecdc9;
    background: #f1f9f8;
}

.gw-ui-chat-reminder-scope input {
    margin-top: 3px;
}

.gw-ui-chat-reminder-scope span,
.gw-ui-chat-reminder-scope strong,
.gw-ui-chat-reminder-scope small {
    display: block;
}

.gw-ui-chat-reminder-scope strong {
    color: #1f2d2b;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
}

.gw-ui-chat-reminder-scope small {
    margin-top: 2px;
    color: #7b8f8c;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

.gw-ui-chat-reminder-error {
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid #f2c5c0;
    border-radius: 8px;
    background: #fde9e7;
    color: #a93226;
    font-size: 13px;
    line-height: 18px;
}

.gw-ui-chat-reminder-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.gw-ui-chat-reminder-modal-actions .btn {
    min-height: 38px;
    border-radius: 6px;
    font-weight: 700;
}

.gw-ui-chat-reminder-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #d8e3e2;
}

.gw-ui-chat-reminder-tabs {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: #eef2f1;
}

.gw-ui-chat-reminder-tabs button {
    min-height: 32px;
    padding: 5px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #526b68;
    font-size: 13px;
    font-weight: 700;
}

.gw-ui-chat-reminder-tabs button.is-active {
    background: #fff;
    color: #0f5f5c;
    box-shadow: 0 1px 2px rgba(16, 54, 51, 0.06);
}

.gw-ui-chat-reminder-list {
    min-height: 220px;
    max-height: calc(100vh - 210px);
    overflow-y: auto;
    padding: 16px;
    background: #f7faf9;
}

.gw-ui-chat-reminder-card {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #d8e3e2;
    border-left: 4px solid #287d7a;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 54, 51, 0.06);
}

.gw-ui-chat-reminder-card.is-due {
    border-color: #efb5ae;
    border-left-color: #c0392b;
    background: #fffafa;
}

.gw-ui-chat-reminder-card.is-done {
    border-left-color: #18723e;
}

.gw-ui-chat-reminder-card.is-cancelled {
    border-left-color: #b8ccca;
    opacity: 0.78;
}

.gw-ui-chat-reminder-card.is-highlighted {
    animation: gw-ui-chat-reminder-highlight 1.4s ease-out 2;
}

@keyframes gw-ui-chat-reminder-highlight {
    0%, 100% { box-shadow: 0 1px 2px rgba(16, 54, 51, 0.06); }
    50% { box-shadow: 0 0 0 4px rgba(201, 137, 24, 0.25); }
}

.gw-ui-chat-reminder-card-time,
.gw-ui-chat-reminder-card-meta,
.gw-ui-chat-reminder-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gw-ui-chat-reminder-card-time {
    color: #526b68;
    font-size: 12px;
}

.gw-ui-chat-reminder-card-time > i {
    color: #0f766e;
}

.gw-ui-chat-reminder-card-time strong {
    color: #1f2d2b;
    font-size: 13px;
    font-weight: 700;
}

.gw-ui-chat-reminder-status {
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e5edff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
}

.is-due .gw-ui-chat-reminder-status {
    background: #fde9e7;
    color: #a93226;
}

.is-done .gw-ui-chat-reminder-status {
    background: #dff3e7;
    color: #146233;
}

.is-cancelled .gw-ui-chat-reminder-status {
    background: #eef2f1;
    color: #526b68;
}

.gw-ui-chat-reminder-card-content {
    margin: 10px 0;
    color: #1f2d2b;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    white-space: pre-wrap;
    word-break: break-word;
}

.gw-ui-chat-reminder-card-meta {
    color: #7b8f8c;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

.gw-ui-chat-reminder-card-meta > span + span::before {
    content: "·";
    margin-right: 8px;
}

.gw-ui-chat-reminder-source-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #0f766e;
    font-size: 12px;
    text-decoration: underline;
}

.gw-ui-chat-reminder-source-missing {
    color: #7b8f8c;
    font-style: italic;
}

.gw-ui-chat-reminder-card-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef2f1;
}

.gw-ui-chat-reminder-card-actions .btn,
.gw-ui-chat-reminder-snooze {
    min-height: 34px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
}

.gw-ui-chat-reminder-snooze {
    width: auto;
    max-width: 180px;
}

.gw-ui-chat-reminder-cancel {
    margin-left: auto;
    color: #a93226;
}

.gw-ui-chat-reminder-empty {
    display: flex;
    min-height: 190px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    color: #7b8f8c;
    text-align: center;
}

.gw-ui-chat-reminder-empty > i {
    margin-bottom: 4px;
    color: #9ecdc9;
    font-size: 28px;
}

.gw-ui-chat-reminder-empty strong {
    color: #526b68;
    font-size: 14px;
    font-weight: 700;
}

.gw-ui-chat-reminder-empty span {
    max-width: 360px;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

.gw-ui-chat-reminder-toast {
    position: fixed;
    z-index: 2147483200;
    right: 20px;
    bottom: 20px;
    max-width: min(380px, calc(100vw - 32px));
    padding: 12px 16px;
    border: 1px solid #9ecdc9;
    border-radius: 8px;
    background: #f1f9f8;
    box-shadow: 0 10px 30px rgba(16, 54, 51, 0.16);
    color: #0f5f5c;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.gw-ui-chat-reminder-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.gw-ui-chat-reminder-toast.is-error {
    border-color: #efb5ae;
    background: #fde9e7;
    color: #a93226;
}

.gw-ui-chat-reminder-alert-stack {
    position: fixed;
    z-index: 2147483050;
    top: 20px;
    right: 20px;
    display: flex;
    width: min(440px, calc(100vw - 32px));
    flex-direction: column;
    gap: 10px;
    font-family: Arial, Helvetica, sans-serif;
}

.gw-ui-chat-reminder-alert {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
    border: 1px solid #efb5ae;
    border-left: 4px solid #c0392b;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(16, 54, 51, 0.16);
}

.gw-ui-chat-reminder-alert-icon {
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fde9e7;
    color: #c0392b;
    animation: gw-ui-chat-reminder-bell 1.2s ease-in-out 3;
}

@keyframes gw-ui-chat-reminder-bell {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(8deg); }
}

.gw-ui-chat-reminder-alert-body,
.gw-ui-chat-reminder-alert-body strong,
.gw-ui-chat-reminder-alert-body span,
.gw-ui-chat-reminder-alert-body small {
    display: block;
}

.gw-ui-chat-reminder-alert-body strong {
    color: #a93226;
    font-size: 13px;
    font-weight: 700;
}

.gw-ui-chat-reminder-alert-body span {
    margin-top: 3px;
    color: #1f2d2b;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.gw-ui-chat-reminder-alert-body small {
    margin-top: 3px;
    color: #7b8f8c;
    font-size: 12px;
}

.gw-ui-chat-reminder-alert-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
}

.gw-ui-chat-reminder-alert-actions .btn {
    min-height: 34px;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 767px) {
    .gw-ui-chat-reminder-layer {
        align-items: flex-end;
        padding: 0;
    }

    .gw-ui-chat-reminder-modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 12px 12px 0 0;
    }

    .gw-ui-chat-reminder-form {
        max-height: calc(92vh - 72px);
        padding: 16px;
    }

    .gw-ui-chat-reminder-list {
        max-height: calc(92vh - 145px);
        padding: 12px;
    }

    .gw-ui-chat-reminder-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .gw-ui-chat-reminder-tabs {
        align-self: flex-start;
    }

    .gw-ui-chat-reminder-card-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .gw-ui-chat-reminder-card-actions .btn,
    .gw-ui-chat-reminder-snooze {
        width: 100%;
        max-width: none;
    }

    .gw-ui-chat-reminder-cancel {
        margin-left: 0;
    }

    .gw-ui-chat-reminder-alert-stack {
        top: auto;
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gw-ui-chat-reminder-card.is-highlighted,
    .gw-ui-chat-reminder-alert-icon {
        animation: none;
    }

    .gw-ui-chat-reminder-toast {
        transition-duration: 0.01ms;
    }
}

.nv-chat {
    --chat-page-top-offset: 76px;
    --chat-border: #d8e2ec;
    --chat-border-soft: #e8eef5;
    --chat-surface: #ffffff;
    --chat-surface-soft: #f6f8fb;
    --chat-surface-hover: #e7f7f8;
    --chat-primary: #017e84;
    --chat-primary-dark: #00686d;
    --chat-primary-soft: #e6f6f7;
    --chat-primary-border: #8fcfd2;
    --chat-text: #172033;
    --chat-muted: #66748a;
    --chat-own-bg: #e9f7f5;
    --chat-own-border: #a9dcd8;
    --chat-danger: #d94b4b;
    --chat-sidebar-width: clamp(270px, 18vw, 300px);
    --chat-detail-width: clamp(250px, 17vw, 300px);
    color: #172033;
    font-family: inherit;
}

.nv-chat [hidden] {
    display: none !important;
}

.nv-chat-state {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    background: #ffffff;
    padding: 32px;
    text-align: center;
}

.nv-chat-state-warning {
    border-color: #f0c36a;
    background: #fffaf0;
}

.nv-chat-state-title {
    font-size: 16px;
    font-weight: 600;
}

.nv-chat-shell {
    position: relative;
    display: grid;
    grid-template-columns: var(--chat-sidebar-width) minmax(0, 1fr);
    min-height: 0;
    height: calc(100vh - 220px);
    border: 1px solid #d5dfeb;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
}

.nv-chat:not(.nv-chat--popup) .nv-chat-shell {
    position: sticky;
    top: var(--chat-page-top-offset);
    height: calc(100vh - var(--chat-page-top-offset) - 24px);
}

@supports (height: 100dvh) {
    .nv-chat:not(.nv-chat--popup) .nv-chat-shell {
        height: calc(100dvh - var(--chat-page-top-offset) - 24px);
    }
}

.nv-chat-sidebar {
    min-width: 0;
    min-height: 0;
    border-right: 1px solid #d9e1ec;
    background: #f7f9fc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nv-chat-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #d9e1ec;
    background: #ffffff;
}

.nv-chat-profile-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    padding: 0;
}

.nv-chat-profile-avatar:focus {
    outline: 0;
}

.nv-chat-profile-avatar:focus .nv-chat-avatar {
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 3px rgba(1, 126, 132, 0.16);
}

.nv-chat-profile-avatar .nv-chat-avatar {
    display: block;
}

.nv-chat-profile-avatar-icon {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: var(--chat-primary);
    color: #ffffff;
    font-size: 9px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(23, 32, 51, 0.18);
}

.nv-chat-profile-avatar:hover .nv-chat-profile-avatar-icon,
.nv-chat-profile-avatar:focus .nv-chat-profile-avatar-icon {
    background: var(--chat-primary-dark);
}

.nv-chat-profile-avatar.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

.nv-chat-profile [data-role="profile-avatar-input"] {
    display: none !important;
}

.nv-chat-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #d7dde5;
    background: #ffffff;
}

.nv-chat-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chat-primary);
    color: #ffffff;
    font-weight: 700;
}

.nv-chat-avatar-cloud {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chat-primary);
    color: #ffffff;
    font-size: 16px;
}

.nv-chat-profile-text,
.nv-chat-search-result-body,
.nv-chat-conversation-body {
    min-width: 0;
}

.nv-chat-profile-name-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nv-chat-profile-name {
    min-width: 0;
    flex: 1 1 auto;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-chat-profile-name-edit {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--chat-muted);
    padding: 0;
}

.nv-chat-profile-name-edit:hover,
.nv-chat-profile-name-edit:focus {
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
    outline: 0;
}

.nv-chat-profile-name-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px 28px;
    gap: 4px;
    margin-bottom: 4px;
}

.nv-chat-profile-name-form[hidden] {
    display: none;
}

.nv-chat-profile-name-form.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

.nv-chat-profile-name-form .form-control {
    height: 28px;
    min-height: 28px;
    border-radius: 6px;
    font-size: 12px;
    padding: 4px 8px;
}

.nv-chat-profile-name-form .btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    border-radius: 6px;
}

.nv-chat-profile-username {
    color: #66748a;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-chat-sidebar-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px 34px;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #d9e1ec;
    background: #ffffff;
}

.nv-chat-search {
    min-width: 0;
}

.nv-chat-search .form-control {
    height: 34px;
    border-radius: 6px;
}

.nv-chat-sidebar-tools .nv-chat-icon-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 6px;
}

.nv-chat [data-role="background-input"] {
    display: none !important;
}

.nv-chat-search-results {
    max-height: 340px;
    overflow: auto;
    flex-shrink: 0;
    border-bottom: 1px solid #d9e1ec;
    background: #ffffff;
}

.nv-chat-search-results:empty {
    display: none;
}

/* Tieu de nhom ket qua tim (Nhom / Nhan vien / Tin nhan) */
.nv-chat-search-section {
    padding: 9px 12px 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #8a96a8;
    background: #f7f9fc;
    position: sticky;
    top: 0;
}

.nv-chat-search-result-msg .nv-chat-search-result-username {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-chat-sidebar-tools .btn.is-active {
    border-color: var(--chat-primary);
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
}

.nv-chat-group-panel {
    padding: 12px 14px;
    flex-shrink: 0;
    border-bottom: 1px solid #d9e1ec;
    background: #ffffff;
}

.nv-chat-group-panel .form-control {
    height: 36px;
    border-radius: 6px;
}

.nv-chat-group-selected {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    min-height: 42px;
    max-height: 34vh;
    overflow-y: auto;
    margin-top: 10px;
}

.nv-chat-group-selected .nv-chat-muted {
    padding: 6px 0;
}

.nv-chat-member-chip {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    border: 1px solid #cfd8e4;
    border-radius: 6px;
    background: #f5f7fa;
    padding: 4px 6px 4px 10px;
}

.nv-chat-member-chip-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-member-chip-remove {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #dfe6ee;
    color: #405066;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

.nv-chat-member-chip-remove:hover,
.nv-chat-member-chip-remove:focus {
    background: #cfd8e4;
    outline: 0;
}

.nv-chat-group-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.nv-chat-group-buttons .btn {
    border-radius: 6px;
}

.nv-chat-search-result {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-bottom: 1px solid #eef2f6;
    background: #ffffff;
    padding: 10px 14px;
    text-align: left;
}

.nv-chat-search-result:hover,
.nv-chat-search-result:focus {
    background: var(--chat-surface-hover);
    outline: 0;
}

.nv-chat-search-result-name,
.nv-chat-search-result-username {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-chat-search-result-name {
    font-weight: 600;
}

.nv-chat-search-result-username {
    color: #66748a;
    font-size: 12px;
}

.nv-chat-section-title {
    padding: 10px 12px 6px;
    color: #66748a;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.nv-chat-conversations {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 8px;
}

.nv-chat-conversation {
    width: calc(100% - 12px);
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 6px 6px;
    padding: 8px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    text-align: left;
}

.nv-chat-conversation:hover,
.nv-chat-conversation:focus {
    background: #ffffff;
    border-color: #d9e1ec;
    outline: 0;
}

.nv-chat-conversation.is-active {
    background: var(--chat-primary-soft);
    border-color: var(--chat-primary-border);
    box-shadow: inset 3px 0 0 var(--chat-primary);
}

.nv-chat-conversation-top,
.nv-chat-conversation-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nv-chat-conversation-title,
.nv-chat-conversation-preview {
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-chat-conversation-title {
    font-weight: 700;
    color: #172033;
    font-size: 13px;
}

.nv-chat-conversation-time {
    flex: 0 0 auto;
    color: #7a8798;
    font-size: 11px;
}

.nv-chat-conversation-preview {
    color: #66748a;
    font-size: 12px;
}

.nv-chat-unread {
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--chat-primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
}

.nv-chat-thread {
    min-width: 0;
    min-height: 0;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}

.nv-chat-thread-header {
    flex: 0 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid #d9e1ec;
    background: #ffffff;
}

.nv-chat-pinned {
    flex: 0 0 auto;
    display: block;
    border-bottom: 1px solid #d9e1ec;
    background: #f1fbfb;
    padding: 8px 16px;
}

.nv-chat-pinned[hidden] {
    display: none;
}

.nv-chat-pinned-main {
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    color: #172033;
    text-align: left;
    padding: 0;
}

.nv-chat-pinned-main:hover,
.nv-chat-pinned-main:focus {
    color: var(--chat-primary-dark);
    outline: 0;
}

.nv-chat-pinned-main > .fa {
    flex: 0 0 auto;
    color: var(--chat-primary);
}

.nv-chat-pinned-body {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 1px;
}

.nv-chat-pinned-label,
.nv-chat-pinned-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-pinned-label {
    color: var(--chat-primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.nv-chat-pinned-text {
    color: #405066;
    font-size: 13px;
}

.nv-chat-pinned-count {
    color: #66748a;
    font-weight: 700;
}

.nv-chat-pinned-caret {
    transition: transform .18s ease;
}

.nv-chat-pinned.is-open .nv-chat-pinned-caret {
    transform: rotate(180deg);
}

.nv-chat-pinned-list {
    display: grid;
    gap: 6px;
    max-height: 240px;
    overflow: auto;
    margin-top: 8px;
    padding: 6px;
    border: 1px solid #d8e4ef;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.nv-chat-pinned-list[hidden] {
    display: none;
}

.nv-chat-pinned-item {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.nv-chat-pinned-item-main {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 2px;
    border: 0;
    border-radius: 6px;
    background: #f7fafc;
    color: #172033;
    text-align: left;
    padding: 8px 10px;
}

.nv-chat-pinned-item-main:hover,
.nv-chat-pinned-item-main:focus {
    background: #e9f7f7;
    color: var(--chat-primary-dark);
    outline: 0;
}

.nv-chat-pinned-item-title,
.nv-chat-pinned-item-preview,
.nv-chat-pinned-item-time {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-pinned-item-title {
    color: var(--chat-primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.nv-chat-pinned-item-preview {
    color: #172033;
    font-size: 13px;
}

.nv-chat-pinned-item-time {
    color: #66748a;
    font-size: 11px;
}

.nv-chat-pinned-item-unpin.btn {
    flex: 0 0 auto;
    width: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 8px;
}

.nv-chat-pinned-unpin.btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
}

.nv-chat-thread-user {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nv-chat-thread-tools {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid #e1e9f2;
    border-radius: 999px;
    background: #f7fafc;
}

.nv-chat-mobile-back {
    display: none;
}

.nv-chat-message-search {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nv-chat-message-search .form-control {
    width: 190px;
    height: 34px;
    border-radius: 6px;
}

.nv-chat-thread-tools .btn {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #52637a;
    padding: 0;
    box-shadow: none;
    font-size: 14px;
}

.nv-chat-thread-tools .btn:disabled {
    display: none;
}

.nv-chat-thread-tools [data-role="call-audio"],
.nv-chat-thread-tools [data-role="call-video"] {
    border-radius: 50%;
}

.nv-chat-thread-tools [data-role="call-audio"] {
    color: #087f5b;
}

.nv-chat-thread-tools [data-role="call-video"] {
    color: #2f65c8;
}

.nv-chat-thread-tools [data-role="details-toggle"] {
    color: var(--chat-primary-dark);
}

.nv-chat-thread-tools [data-role="call-video"]:not(:disabled) {
    margin-right: 0;
}

.nv-chat-thread-tools [data-role="call-audio"]:hover,
.nv-chat-thread-tools [data-role="call-audio"]:focus {
    background: #e5f6ef;
    color: #087f5b;
    outline: 0;
    box-shadow: none;
}

.nv-chat-thread-tools [data-role="call-video"]:hover,
.nv-chat-thread-tools [data-role="call-video"]:focus {
    background: #e8f0ff;
    color: #2f65c8;
    outline: 0;
    box-shadow: none;
}

.nv-chat-thread-tools [data-role="details-toggle"]:hover,
.nv-chat-thread-tools [data-role="details-toggle"]:focus {
    border-color: var(--chat-primary-border);
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
    outline: 0;
}

.nv-chat-thread-tools .btn.is-active {
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
}

.nv-chat-detail-drawer {
    position: absolute;
    top: 72px;
    right: 0;
    bottom: 0;
    z-index: 4;
    width: var(--chat-detail-width);
    max-width: 88%;
    display: flex;
    flex-direction: column;
    overflow: auto;
    border-left: 1px solid #d9e1ec;
    background: #ffffff;
    box-shadow: -18px 0 34px rgba(23, 32, 51, 0.12);
}

.nv-chat-detail-drawer[hidden] {
    display: none;
}

.nv-chat:not(.nv-chat--popup) .nv-chat-thread.is-details-open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--chat-detail-width);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.nv-chat:not(.nv-chat--popup) .nv-chat-thread.is-details-open .nv-chat-thread-header {
    grid-column: 1 / -1;
    grid-row: 1;
}

.nv-chat:not(.nv-chat--popup) .nv-chat-thread.is-details-open .nv-chat-pinned {
    grid-column: 1;
    grid-row: 2;
}

.nv-chat:not(.nv-chat--popup) .nv-chat-thread.is-details-open .nv-chat-messages {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
}

.nv-chat:not(.nv-chat--popup) .nv-chat-thread.is-details-open .nv-chat-compose {
    grid-column: 1;
    grid-row: 4;
}

.nv-chat:not(.nv-chat--popup) .nv-chat-thread.is-details-open .nv-chat-detail-drawer {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    grid-column: 2;
    grid-row: 2 / 5;
    width: auto;
    max-width: none;
    min-height: 0;
    box-shadow: none;
}

.nv-chat-detail-header {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #e3e9f2;
    background: #ffffff;
}

.nv-chat-detail-section {
    flex: 0 0 auto;
    padding: 12px;
    border-bottom: 1px solid #edf2f7;
}

.nv-chat-detail-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #405066;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.nv-chat-detail-action.btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    font-weight: 700;
}

.nv-chat-detail-action.btn .fa {
    color: var(--chat-primary);
}

.nv-chat-media-section {
    padding-top: 10px;
    background: #ffffff;
}

.nv-chat-detail-tabs {
    position: sticky;
    top: 53px;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    padding: 3px;
    border: 1px solid #d9e1ec;
    border-radius: 7px;
    background: #f6f8fb;
    margin-bottom: 10px;
    box-shadow: 0 8px 14px rgba(23, 32, 51, 0.06);
}

.nv-chat-detail-tabs button {
    min-width: 0;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #405066;
    font-weight: 700;
    padding: 0 5px;
    font-size: 12px;
}

.nv-chat-detail-tabs button:hover,
.nv-chat-detail-tabs button:focus {
    color: var(--chat-primary-dark);
    outline: 0;
}

.nv-chat-detail-tabs button.is-active {
    background: #ffffff;
    color: var(--chat-primary-dark);
    box-shadow: 0 1px 4px rgba(23, 32, 51, 0.12);
}

.nv-chat-detail-tabs span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-tab-panel[hidden] {
    display: none;
}

.nv-chat-asset-more {
    margin-top: 8px;
    border-radius: 6px;
}

.nv-chat-detail-drawer .nv-chat-message-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px;
}

.nv-chat-detail-drawer .nv-chat-message-search .form-control {
    width: 100%;
}

.nv-chat-detail-drawer .nv-chat-message-search .btn {
    min-width: 36px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
}

.nv-chat-sidebar-tools .nv-chat-icon-btn.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

.nv-chat-assets {
    display: grid;
    gap: 6px;
}

.nv-chat-assets .nv-chat-muted {
    padding: 8px 0;
}

.nv-chat-assets-images {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nv-chat-asset-image {
    display: block;
    min-width: 0;
    border: 1px solid #d9e1ec;
    border-radius: 7px;
    overflow: hidden;
    background: #f7f9fc;
}

.nv-chat-asset-image img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.nv-chat-image-viewer {
    position: fixed;
    inset: 0;
    /* Phai cao hon .nv-chat-shell (z-index 10000 tren mobile) neu khong viewer bi khung chat che. */
    z-index: 10060;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 12px;
    padding: 56px 24px 28px;
    background: rgba(14, 20, 32, 0.88);
    backdrop-filter: blur(2px);
}

.nv-chat-image-viewer[hidden] {
    display: none;
}

.nv-chat-image-viewer-close,
.nv-chat-image-viewer-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    line-height: 1;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}

.nv-chat-image-viewer-close:hover,
.nv-chat-image-viewer-close:focus,
.nv-chat-image-viewer-nav:hover,
.nv-chat-image-viewer-nav:focus {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
    outline: 0;
}

.nv-chat-image-viewer-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 18px;
}

.nv-chat-image-viewer-nav {
    width: 52px;
    height: 52px;
    justify-self: center;
    font-size: 20px;
}

.nv-chat-image-viewer-nav:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.nv-chat-image-viewer-figure {
    min-width: 0;
    max-width: min(1120px, 100%);
    max-height: 100%;
    display: grid;
    justify-items: center;
    gap: 12px;
    margin: 0 auto;
}

.nv-chat-image-viewer-img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    object-fit: contain;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.nv-chat-image-viewer-caption {
    max-width: min(720px, 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #ffffff;
    font-size: 14px;
    text-align: center;
}

.nv-chat-image-viewer-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-image-viewer-counter {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.72);
}

.nv-chat-image-viewer-toolbar {
    position: absolute;
    top: 14px;
    left: 16px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 74px);
}

.nv-chat-image-viewer-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    line-height: 1;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    transition: background 0.15s ease;
}

.nv-chat-image-viewer-tool:hover,
.nv-chat-image-viewer-tool:focus {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
    outline: 0;
}

.nv-chat-image-viewer-tool:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.nv-chat-image-viewer-tool[hidden] {
    display: none;
}

.nv-chat-image-viewer-time {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
}

.nv-chat-image-viewer-time[hidden] {
    display: none;
}

.nv-chat-image-viewer-time::before {
    content: "\f017";
    font-family: FontAwesome;
    font-size: 12px;
    opacity: 0.8;
}

.nv-chat-image-viewer-img {
    transition: transform 0.15s ease;
    transform-origin: center center;
    will-change: transform;
}

.nv-chat-image-viewer-img.is-zoomed {
    cursor: grab;
}

.nv-chat-image-viewer-img.is-dragging {
    cursor: grabbing;
    transition: none;
    user-select: none;
}

.nv-chat-asset-file,
.nv-chat-asset-link {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #d9e1ec;
    border-radius: 7px;
    background: #f9fbfd;
    color: #172033;
}

.nv-chat-asset-file:hover,
.nv-chat-asset-file:focus,
.nv-chat-asset-link:hover,
.nv-chat-asset-link:focus {
    border-color: #9fb7c9;
    color: #172033;
    text-decoration: none;
}

.nv-chat-asset-file .fa,
.nv-chat-asset-link .fa {
    flex: 0 0 auto;
    color: var(--chat-primary);
}

.nv-chat-asset-meta {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.nv-chat-asset-name,
.nv-chat-asset-sub {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-asset-name {
    font-weight: 700;
    font-size: 12px;
}

.nv-chat-asset-sub {
    color: #66748a;
    font-size: 11px;
}

.nv-chat-detail-drawer .nv-chat-group-manage {
    flex: 0 0 auto;
    border-bottom: 1px solid #edf2f7;
    padding: 0 12px 12px;
}

.nv-chat-detail-drawer .nv-chat-group-manage-grid,
.nv-chat-detail-drawer .nv-chat-group-member-list {
    grid-template-columns: 1fr;
}

/* Sidebar hep: nut "Chuyen truong nhom"/"Bo thanh vien" xuong hang duoi ten, khong bi cat */
.nv-chat-detail-drawer .nv-chat-group-member {
    flex-wrap: wrap;
    row-gap: 8px;
}

.nv-chat-detail-drawer .nv-chat-group-member-body {
    flex-basis: 55%;
}

.nv-chat-detail-drawer .nv-chat-group-member .btn-xs {
    flex: 1 1 calc(50% - 5px);
    white-space: nowrap;
}

.nv-chat-detail-drawer .nv-chat-inline-form {
    grid-template-columns: minmax(0, 1fr);
}

.nv-chat-detail-drawer .nv-chat-group-manage-footer {
    flex-direction: column;
}

.nv-chat-detail-drawer .nv-chat-group-manage-footer .btn {
    width: 100%;
}

.nv-chat-thread-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-chat-thread-subtitle {
    color: #66748a;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-chat-group-manage {
    flex: 0 0 auto;
    border-bottom: 1px solid #d9e1ec;
    background: #ffffff;
    padding: 14px 18px;
}

.nv-chat-group-avatar-editor {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
}

.nv-chat-group-avatar-editor.is-disabled {
    cursor: not-allowed;
}

.nv-chat-group-avatar-button {
    position: relative;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    padding: 0;
}

.nv-chat-group-avatar-button .nv-chat-avatar {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    display: flex;
}

.nv-chat-group-avatar-preview {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.nv-chat-group-avatar-camera {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: var(--chat-primary);
    color: #ffffff;
    font-size: 10px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(23, 32, 51, 0.18);
}

.nv-chat-group-avatar-button:hover .nv-chat-group-avatar-camera,
.nv-chat-group-avatar-button:focus .nv-chat-group-avatar-camera {
    background: var(--chat-primary-dark);
}

.nv-chat-group-avatar-button:focus {
    outline: 0;
}

.nv-chat-group-avatar-button.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

.nv-chat-group-avatar-editor [data-role="group-avatar-input"] {
    display: none !important;
}

.nv-chat-group-manage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.nv-chat-group-manage-block label {
    display: block;
    color: #405066;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.nv-chat-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.nv-chat-inline-form .form-control,
.nv-chat-group-manage-block .form-control {
    height: 36px;
    border-radius: 6px;
}

.nv-chat-manage-results {
    max-height: 174px;
    overflow: auto;
    margin-top: 8px;
    border: 1px solid #eef2f6;
    border-radius: 6px;
}

.nv-chat-manage-results:empty {
    display: none;
}

.nv-chat-group-member-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.nv-chat-group-member {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #eef2f6;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px;
}

.nv-chat-group-member-body {
    min-width: 0;
    flex: 1 1 auto;
}

.nv-chat-group-member-name,
.nv-chat-group-member-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-chat-group-member-name {
    font-weight: 700;
}

.nv-chat-group-member-meta {
    color: #66748a;
    font-size: 12px;
}

.nv-chat-group-manage-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

/* Banner bao khach dang cho duyet vao hop (hien ngay tren doan chat) */
.nv-chat-guest-banner {
    margin: 10px 16px 0;
    padding: 10px 12px;
    border: 1px solid #f0c36d;
    background: #fff8e6;
    border-radius: 10px;
    font-size: 13px;
    flex-shrink: 0;
}

.nv-chat-guest-banner-head {
    font-weight: 700;
    color: #8a6d1a;
    margin-bottom: 6px;
}

.nv-chat-guest-banner-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.nv-chat-guest-banner-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 20px;
    background: #f7f9fc;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.nv-chat.has-chat-background .nv-chat-messages {
    background-image: linear-gradient(rgba(247, 249, 252, 0.82), rgba(247, 249, 252, 0.82)), var(--chat-background-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.nv-chat-empty {
    height: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    color: #66748a;
}

.nv-chat-empty-title {
    color: #172033;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.nv-chat-empty-text {
    max-width: 360px;
}

.nv-chat-muted {
    padding: 16px;
    color: #66748a;
    font-size: 13px;
}

.nv-chat-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.nv-chat-message.is-me {
    justify-content: flex-end;
}

.nv-chat-message.is-system {
    justify-content: center;
    align-items: center;
    margin: 8px 0 12px;
}

.nv-chat-bubble {
    max-width: min(640px, 76%);
    border: 1px solid #d8e2ec;
    border-radius: 8px;
    background: #ffffff;
    padding: 10px 12px 8px;
    box-shadow: 0 3px 10px rgba(21, 32, 43, 0.06);
}

.nv-chat-message.is-me .nv-chat-bubble {
    border-color: var(--chat-own-border);
    background: var(--chat-own-bg);
}

.nv-chat-message.is-system .nv-chat-bubble {
    max-width: min(560px, 88%);
    border-color: #d8e2ec;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    color: #526176;
    padding: 6px 12px;
    box-shadow: none;
    text-align: center;
}

.nv-chat-system-content {
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.35;
}

.nv-chat-message.is-system .nv-chat-message-time {
    margin-top: 2px;
    text-align: center;
    font-size: 10px;
}

.nv-chat-message.is-highlighted .nv-chat-bubble {
    box-shadow: 0 0 0 2px rgba(1, 126, 132, 0.28), 0 10px 24px rgba(23, 32, 51, 0.12);
}

.nv-chat-message.is-revoked .nv-chat-bubble {
    border-style: dashed;
    background: #f8fafc;
    box-shadow: none;
}

.nv-chat-message.is-me.is-revoked .nv-chat-bubble {
    background: #edf7f7;
}

.nv-chat-message-sender {
    color: var(--chat-primary);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.nv-chat-message-content {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.nv-chat-message-content a {
    color: var(--chat-primary-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.nv-chat-message-content a:hover,
.nv-chat-message-content a:focus {
    color: var(--chat-primary);
}

.nv-chat-message-content code {
    border: 1px solid #d9e1ec;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.72);
    color: #172033;
    font-size: 92%;
    padding: 1px 4px;
}

.nv-chat-message.is-call .nv-chat-bubble {
    min-width: 210px;
}

.nv-chat-call-history {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.nv-chat-call-history-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
    font-size: 13px;
}

.nv-chat-call-history.is-missed .nv-chat-call-history-icon,
.nv-chat-call-history.is-declined .nv-chat-call-history-icon,
.nv-chat-call-history.is-canceled .nv-chat-call-history-icon,
.nv-chat-call-history.is-failed .nv-chat-call-history-icon {
    background: #fff1f2;
    color: #b42318;
}

.nv-chat-call-history-body {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.nv-chat-call-history-title,
.nv-chat-call-history-meta {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-call-history-title {
    color: #172033;
    font-weight: 700;
    line-height: 1.25;
}

.nv-chat-call-history-meta {
    color: #66748a;
    font-size: 12px;
}

.nv-chat-message-quote-line {
    display: inline-block;
    border-left: 3px solid var(--chat-primary);
    color: #405066;
    padding-left: 8px;
}

.nv-chat-message-revoked {
    color: #66748a;
    font-size: 13px;
    font-style: italic;
}

.nv-chat-reply-quote {
    width: 100%;
    display: grid;
    gap: 2px;
    border: 0;
    border-left: 3px solid var(--chat-primary);
    border-radius: 6px;
    background: var(--chat-primary-soft);
    color: #172033;
    text-align: left;
    padding: 7px 9px;
    margin: 0 0 8px;
}

.nv-chat-reply-quote:hover,
.nv-chat-reply-quote:focus {
    background: #e2f3f4;
    outline: 0;
}

.nv-chat-message.is-me .nv-chat-reply-quote {
    background: rgba(255, 255, 255, 0.72);
}

.nv-chat-reply-quote-name,
.nv-chat-reply-quote-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-reply-quote-name {
    color: var(--chat-primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.nv-chat-reply-quote-text {
    color: #405066;
    font-size: 12px;
}

.nv-chat-attachments {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}

.nv-chat-attachment {
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #ffffff;
    color: #172033;
    padding: 10px 12px;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.nv-chat-attachment.is-file:hover,
.nv-chat-attachment.is-file:focus {
    border-color: var(--chat-primary-border);
    box-shadow: 0 6px 16px rgba(23, 32, 51, 0.1);
    transform: translateY(-1px);
    color: #172033;
    text-decoration: none;
    outline: 0;
}

/* Huy hieu icon theo loai tep -> de nhan biet tin nhan dinh kem */
.nv-chat-attachment-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 19px;
    background: #eef2f8;
    color: #5c6b7a;
}

.nv-chat-attachment-icon.is-pdf {
    background: #fdecec;
    color: #e5484d;
}

.nv-chat-attachment-icon.is-doc {
    background: #e8f1fc;
    color: #2b6cb0;
}

.nv-chat-attachment-icon.is-xls {
    background: #e7f6ec;
    color: #2f9e44;
}

.nv-chat-attachment-icon.is-ppt {
    background: #fdeee2;
    color: #e8590c;
}

.nv-chat-attachment-icon.is-zip {
    background: #fbf3e0;
    color: #c2840a;
}

.nv-chat-attachment-icon.is-audio {
    background: #efeafe;
    color: #7048e8;
}

.nv-chat-attachment-icon.is-video {
    background: #e6f6f9;
    color: #1098ad;
}

.nv-chat-attachment.is-image {
    display: block;
    max-width: 320px;
    padding: 6px;
    border-radius: 14px;
    overflow: hidden;
}

.nv-chat-attachment.is-image:hover,
.nv-chat-attachment.is-image:focus {
    border-color: var(--chat-primary-border);
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.14);
    outline: 0;
}

.nv-chat-attachment.is-image img {
    display: block;
    width: 100%;
    max-width: 320px;
    max-height: 240px;
    object-fit: contain;
    border-radius: 9px;
    background: #ffffff;
    transition: transform 0.25s ease;
}

.nv-chat-attachment.is-image:hover img {
    transform: scale(1.02);
}

.nv-chat-attachment-meta {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 2px;
}

.nv-chat-attachment.is-image .nv-chat-attachment-meta {
    padding: 6px 4px 2px;
}

.nv-chat-attachment-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.nv-chat-attachment-size {
    color: #66748a;
    font-size: 12px;
}

.nv-chat-attachment-download {
    flex: 0 0 auto;
    color: #9aa6b6;
    font-size: 15px;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.nv-chat-attachment.is-file:hover .nv-chat-attachment-download,
.nv-chat-attachment.is-file:focus .nv-chat-attachment-download {
    opacity: 1;
    color: var(--chat-primary-dark);
}

.nv-chat-search-heading {
    color: #66748a;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.nv-chat-message-time {
    margin-top: 5px;
    color: #7a8798;
    font-size: 11px;
    text-align: right;
}

.nv-chat-message-read-status {
    margin-top: 2px;
    color: #66748a;
    font-size: 11px;
    font-weight: 600;
    text-align: right;
}

.nv-chat-message-read-status.is-read {
    color: var(--chat-primary-dark);
}

.nv-chat-message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 6px;
}

.nv-chat-message-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    border: 0;
    background: transparent;
    color: #7a8798;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nv-chat-message-action > i {
    font-size: 11px;
}

.nv-chat-message-action:hover,
.nv-chat-message-action:focus {
    color: var(--chat-primary-dark);
    background: var(--chat-primary-soft);
    outline: 0;
}

.nv-chat-revoke-action:hover,
.nv-chat-revoke-action:focus {
    color: #b42318;
    background: rgba(180, 35, 24, 0.1);
}

.nv-chat-pin-action.is-active {
    color: var(--chat-primary-dark);
    background: var(--chat-primary-soft);
    font-weight: 700;
}

/* ===== Tha cam xuc (reactions) ===== */
.nv-chat-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.nv-chat-reactions:empty {
    display: none;
    margin: 0;
}

.nv-chat-message.is-me .nv-chat-reactions {
    justify-content: flex-end;
}

.nv-chat-reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #dbe3ef;
    background: #ffffff;
    border-radius: 999px;
    padding: 1px 8px 1px 6px;
    font-size: 12px;
    line-height: 1.6;
    color: #4a5568;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nv-chat-reaction-chip:hover,
.nv-chat-reaction-chip:focus {
    border-color: var(--chat-primary-border);
    outline: 0;
}

.nv-chat-reaction-chip.is-active {
    border-color: var(--chat-primary-border);
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
    font-weight: 600;
}

.nv-chat-reaction-emoji {
    font-size: 14px;
    line-height: 1;
}

.nv-chat-reaction-count {
    min-width: 8px;
    text-align: center;
}

.nv-chat-reaction-bar {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 6px;
    padding: 4px 6px;
    border: 1px solid #e1e7f0;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(23, 32, 51, 0.12);
    width: max-content;
    max-width: 100%;
}

.nv-chat-message.is-me .nv-chat-reaction-bar {
    margin-left: auto;
}

.nv-chat-reaction-pick {
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.15s ease;
}

.nv-chat-reaction-pick:hover,
.nv-chat-reaction-pick:focus {
    background: var(--chat-primary-soft);
    transform: scale(1.25);
    outline: 0;
}

.nv-chat-mention {
    display: inline;
    border-radius: 4px;
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
    font-weight: 700;
    padding: 0 3px;
}

.nv-chat-mention.is-current {
    background: #fff3cd;
    color: #7a4b00;
}

.nv-chat-compose {
    flex: 0 0 auto;
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 28px) minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 4px;
    row-gap: 5px;
    padding: 6px 9px;
    border-top: 1px solid #d9e1ec;
    background: #ffffff;
}

.nv-chat-reply-compose {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--chat-primary-border);
    border-left: 3px solid var(--chat-primary);
    border-radius: 8px;
    background: var(--chat-primary-soft);
    padding: 8px 10px;
}

.nv-chat-reply-compose[hidden] {
    display: none;
}

.nv-chat-reply-compose-body {
    min-width: 0;
    flex: 1 1 auto;
}

.nv-chat-reply-compose-label {
    color: #405066;
    font-size: 12px;
    margin-bottom: 2px;
}

.nv-chat-reply-compose-label strong {
    color: var(--chat-primary-dark);
}

.nv-chat-reply-compose-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #172033;
    font-size: 13px;
}

.nv-chat-compose .nv-chat-reply-cancel.btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
}

.nv-chat-pending-files {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: flex-start;
    max-height: 96px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #d9e1ec;
    border-radius: 7px;
    background: #f8fbfd;
    padding: 5px;
    scrollbar-width: thin;
}

.nv-chat-pending-files[hidden] {
    display: none;
}

.nv-chat-pending-file {
    min-width: 0;
    width: min(240px, 44vw);
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 6px;
    border: 1px solid #d9e1ec;
    border-radius: 7px;
    background: #ffffff;
    padding: 4px;
}

.nv-chat-pending-file.is-image {
    width: min(260px, 64vw);
    grid-template-columns: 88px minmax(0, 1fr) 24px;
}

.nv-chat-pending-file-thumb {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background: #eef4f8;
    color: #405066;
}

.nv-chat-pending-file.is-image .nv-chat-pending-file-thumb {
    width: 88px;
    height: 68px;
}

.nv-chat-pending-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nv-chat-pending-file-body {
    min-width: 0;
    display: block;
}

.nv-chat-pending-file-name,
.nv-chat-pending-file-size {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-pending-file-name {
    color: #172033;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.nv-chat-pending-file-size {
    color: #66748a;
    font-size: 11px;
    line-height: 1.15;
    margin-top: 1px;
}

.nv-chat-pending-file-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #66748a;
    padding: 0;
}

.nv-chat-pending-file-remove:hover,
.nv-chat-pending-file-remove:focus {
    background: #f1f5f9;
    color: #b42318;
    outline: 0;
}

.nv-chat-compose textarea.form-control {
    grid-column: 1 / -2;
    width: 100%;
    min-height: 38px;
    max-height: 118px;
    resize: none;
    overflow: auto;
    border-color: #cfd8e4;
    border-radius: 7px;
    line-height: 1.4;
    padding: 8px 12px;
    box-shadow: none;
}

.nv-chat-compose.is-expanded textarea.form-control {
    min-height: 120px;
    max-height: 320px;
}

.nv-chat-compose.is-editor-mode textarea.form-control,
.nv-chat-compose.is-expanded textarea.form-control {
    grid-column: 1 / -2;
}

.nv-chat-compose.is-editor-mode .nv-chat-send-btn,
.nv-chat-compose.is-expanded .nv-chat-send-btn {
    grid-column: -2 / -1;
}

.nv-chat-compose textarea.form-control:focus {
    border-color: #8bb8d4;
    box-shadow: 0 0 0 2px rgba(1, 126, 132, 0.14);
}

.nv-chat-compose input[type="file"],
.nv-chat-compose [data-role="file-input"],
.nv-chat-compose [data-role="image-input"] {
    display: none !important;
}

.nv-chat-compose .btn {
    height: 28px;
    min-height: 28px;
    border-radius: 6px;
}

.nv-chat-icon-btn {
    width: 28px;
    min-width: 28px;
    font-size: 13px;
    padding: 0;
    color: #405066;
}

.nv-chat-icon-btn.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

.nv-chat-compose .nv-chat-icon-btn.is-active {
    border-color: var(--chat-primary-border);
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
}

/* Nut cong cu soan tin: kieu ghost bo tron, bo vien boxy cho gon dep */
.nv-chat-compose .nv-chat-icon-btn {
    border: 0;
    background: transparent;
    border-radius: 9px;
    color: #5a6b80;
    font-size: 15px;
    box-shadow: none;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.nv-chat-compose .nv-chat-icon-btn:hover,
.nv-chat-compose .nv-chat-icon-btn:focus {
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
    outline: 0;
    box-shadow: none;
}

.nv-chat-compose .nv-chat-icon-btn:active {
    transform: scale(0.9);
}

.nv-chat-compose .nv-chat-icon-btn[disabled],
.nv-chat-compose .nv-chat-icon-btn:disabled {
    background: transparent;
    color: #b9c2cf;
    box-shadow: none;
    opacity: 1;
}

.nv-chat-call-layer {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.48);
    padding: 18px;
}

.nv-chat-call-layer[hidden] {
    display: none;
}

.nv-chat-call-card {
    width: min(520px, 100%);
    max-height: 100%;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
}

.nv-chat-call-top {
    grid-row: 1;
}

.nv-chat-call-hands {
    grid-row: 2;
}

.nv-chat-call-body {
    grid-row: 3;
}

.nv-chat-call-actions {
    grid-row: 4;
}

.nv-chat-call-top {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--chat-border-soft);
}

.nv-chat-call-peer {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nv-chat-call-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--chat-text);
    font-weight: 700;
}

.nv-chat-call-status {
    color: var(--chat-muted);
    font-size: 12px;
}

.nv-chat-call-top-actions {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nv-chat-call-top-actions .btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 6px;
}

.nv-chat-call-fullscreen.btn.is-active {
    border-color: var(--chat-primary-border);
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
}

.nv-chat-call-floating.btn.is-active {
    border-color: var(--chat-primary-border);
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
}

.nv-chat-call-chat-toggle.btn.is-active {
    border-color: var(--chat-primary-border);
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
}

.nv-chat-call-hand.btn.is-active,
.nv-chat-call-layer [data-role="call-hand-toggle"].is-active {
    border-color: #f5c56b;
    background: #fff7db;
    color: #9a6400;
}

.nv-chat-call-hands {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    border-bottom: 1px solid var(--chat-border-soft);
    background: #fff9e8;
    color: #5f4200;
    font-size: 13px;
    padding: 7px 12px;
}

.nv-chat-call-hands[hidden] {
    display: none;
}

.nv-chat-call-hands i {
    color: #c47b00;
}

.nv-chat-call-hands span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-call-body {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
}

.nv-chat-call-layer.is-call-chat-open .nv-chat-call-body {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.nv-chat-call-layer.is-call-chat-open .nv-chat-call-card {
    width: min(920px, 100%);
}

.nv-chat-call-stage {
    position: relative;
    min-height: 260px;
    overflow: hidden;
    background: #111827;
}

.nv-chat-call-chat {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-left: 1px solid var(--chat-border-soft);
    background: #ffffff;
}

.nv-chat-call-chat[hidden] {
    display: none;
}

.nv-chat-call-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--chat-border-soft);
    padding: 10px 12px;
}

.nv-chat-call-chat-head strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--chat-text);
}

.nv-chat-call-chat-head .btn {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
}

.nv-chat-call-chat-messages {
    min-height: 0;
    overflow: auto;
    padding: 10px;
    background: #f8fbfd;
}

.nv-chat-call-chat-empty {
    color: var(--chat-muted);
    font-size: 13px;
    padding: 12px 4px;
    text-align: center;
}

.nv-chat-call-chat-message {
    margin-bottom: 8px;
}

.nv-chat-call-chat-message.is-me {
    text-align: right;
}

.nv-chat-call-chat-bubble {
    display: inline-block;
    max-width: 92%;
    min-width: 0;
    border: 1px solid #d8e3ee;
    border-radius: 8px;
    background: #ffffff;
    color: var(--chat-text);
    padding: 7px 9px;
    text-align: left;
}

.nv-chat-call-chat-message.is-me .nv-chat-call-chat-bubble {
    border-color: #93d7d2;
    background: #e6fffb;
}

.nv-chat-call-chat-name {
    display: block;
    color: var(--chat-primary-dark);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 3px;
}

.nv-chat-call-chat-text {
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.35;
}

.nv-chat-call-chat-file {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--chat-primary-dark);
    font-size: 12px;
    margin-top: 4px;
}

.nv-chat-call-chat-time {
    color: var(--chat-muted);
    font-size: 11px;
    margin-top: 4px;
}

.nv-chat-call-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    border-top: 1px solid var(--chat-border-soft);
    padding: 10px;
    background: #ffffff;
}

.nv-chat-call-chat-form textarea.form-control {
    min-height: 38px;
    height: 38px;
    resize: none;
}

.nv-chat-call-chat-form .btn {
    min-width: 62px;
    height: 38px;
}

.nv-chat-call-grid {
    position: absolute;
    inset: 0;
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    grid-auto-rows: minmax(118px, 1fr);
    align-content: center;
    justify-content: center;
    align-items: stretch;
    justify-items: stretch;
    gap: 8px;
    padding: 10px;
    overflow: auto;
    background: #111827;
}

.nv-chat-call-layer.is-group-call .nv-chat-call-grid {
    display: grid;
}

.nv-chat-call-grid.is-layout-ready:not(.has-presentation) {
    grid-template-columns: repeat(var(--call-grid-columns), var(--call-grid-tile-width));
    grid-auto-rows: var(--call-grid-tile-height);
}

.nv-chat-call-grid.is-layout-ready:not(.has-presentation) .nv-chat-call-tile {
    width: var(--call-grid-tile-width);
    height: var(--call-grid-tile-height);
    min-height: 0;
}

.nv-chat-call-grid.is-layout-ready:not(.has-presentation) .nv-chat-call-tile video {
    min-height: 0;
}

.nv-chat-call-grid.has-presentation {
    grid-template-columns: repeat(auto-fit, minmax(108px, 126px));
    grid-template-rows: minmax(0, 1fr) 62px;
    grid-auto-rows: 62px;
    align-content: stretch;
    justify-content: center;
}

.nv-chat-call-grid.has-presentation .nv-chat-call-tile.is-presenting {
    order: -1;
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 0;
}

.nv-chat-call-grid.has-presentation .nv-chat-call-tile:not(.is-presenting) {
    width: 126px;
    height: 62px;
    min-height: 0;
}

.nv-chat-call-grid.has-presentation .nv-chat-call-tile video {
    min-height: 0;
}

.nv-chat-call-tile {
    position: relative;
    min-width: 0;
    min-height: 118px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: #0f172a;
}

.nv-chat-call-tile.is-presenting {
    border-color: rgba(20, 184, 166, 0.72);
    box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.32), 0 14px 34px rgba(0, 0, 0, 0.28);
}

.nv-chat-call-tile video {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 118px;
    object-fit: cover;
    background: #0f172a;
}

.nv-chat-call-tile.is-presenting video,
.nv-chat-call-layer.is-presenting .nv-chat-call-remote,
.nv-chat-call-layer.is-local-presenting .nv-chat-call-local {
    object-fit: contain;
    background: #020617;
}

.nv-chat-call-tile-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nv-chat-call-tile-face .nv-chat-avatar {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    font-size: 20px;
}

.nv-chat-call-grid.has-presentation .nv-chat-call-tile:not(.is-presenting) .nv-chat-call-tile-face .nv-chat-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 13px;
}

.nv-chat-call-tile-name {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 7px;
}

.nv-chat-call-grid.has-presentation .nv-chat-call-tile:not(.is-presenting) .nv-chat-call-tile-name {
    left: 6px;
    right: 6px;
    bottom: 5px;
    border-radius: 5px;
    font-size: 11px;
    padding: 3px 6px;
}

.nv-chat-call-present-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 16px);
    border-radius: 6px;
    background: rgba(13, 148, 136, 0.92);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    padding: 5px 7px;
}

.nv-chat-call-hand-badge {
    position: absolute;
    right: 8px;
    top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 16px);
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.95);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    padding: 5px 7px;
}

.nv-chat-call-tile.is-presenting .nv-chat-call-hand-badge {
    top: auto;
    bottom: 36px;
}

.nv-chat-call-guest-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 6px;
    background: rgba(47, 128, 237, 0.95);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    padding: 4px 7px;
}

.nv-chat-call-present-badge span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-call-remote,
.nv-chat-call-local {
    display: block;
    width: 100%;
    height: 100%;
    background: #111827;
    object-fit: cover;
}

.nv-chat-call-local {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 128px;
    height: 96px;
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.nv-chat-call-audio-face {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.nv-chat-call-audio-face .nv-chat-avatar {
    width: 92px;
    height: 92px;
    flex-basis: 92px;
    font-size: 32px;
}

.nv-chat-call-layer.is-audio .nv-chat-call-remote {
    display: none;
}

.nv-chat-call-layer.is-audio .nv-chat-call-audio-face {
    display: flex;
}

.nv-chat-call-layer.is-audio .nv-chat-call-local {
    display: none;
}

.nv-chat-call-layer.is-audio [data-role="call-floating-toggle"],
.nv-chat-call-layer.is-audio [data-role="call-expand-toggle"],
.nv-chat-call-layer.is-audio [data-role="call-fullscreen-toggle"] {
    display: none;
}

.nv-chat-call-layer.is-video .nv-chat-call-audio-face {
    display: none;
}

.nv-chat-call-layer.is-video.is-remote-video-off:not(.is-group-call) .nv-chat-call-remote {
    opacity: 0;
}

.nv-chat-call-layer.is-video.is-remote-video-off:not(.is-group-call) .nv-chat-call-audio-face {
    display: flex;
    background: #111827;
}

.nv-chat-call-layer.is-group-call .nv-chat-call-remote,
.nv-chat-call-layer.is-group-call .nv-chat-call-local,
.nv-chat-call-layer.is-group-call .nv-chat-call-audio-face {
    display: none;
}

.nv-chat-call-layer.is-call-expanded {
    position: fixed !important;
    inset: 28px !important;
    display: flex !important;
    z-index: 2147483646 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    background: rgba(15, 23, 42, 0.58);
    padding: 0 !important;
}

.nv-chat-call-layer.is-call-expanded .nv-chat-call-card {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
    overflow: hidden !important;
    border-radius: 8px;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.nv-chat-call-layer.is-call-expanded .nv-chat-call-body {
    display: grid !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.nv-chat-call-layer.is-call-expanded .nv-chat-call-stage {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: #111827 !important;
}

.nv-chat-call-layer.is-call-expanded .nv-chat-call-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    grid-auto-rows: minmax(150px, 1fr);
    align-content: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 12px;
}

.nv-chat-call-layer.is-call-expanded .nv-chat-call-grid.has-presentation {
    grid-template-columns: repeat(auto-fit, minmax(118px, 136px));
    grid-template-rows: minmax(0, 1fr) 70px;
    grid-auto-rows: 70px;
}

.nv-chat-call-layer.is-call-expanded .nv-chat-call-grid.has-presentation .nv-chat-call-tile.is-presenting {
    min-height: 0;
}

.nv-chat-call-layer.is-call-expanded .nv-chat-call-grid.has-presentation .nv-chat-call-tile:not(.is-presenting) {
    width: 136px;
    height: 70px;
}

.nv-chat-call-layer.is-call-expanded .nv-chat-call-tile,
.nv-chat-call-layer.is-call-expanded .nv-chat-call-tile video {
    min-height: 0;
}

.nv-chat-call-layer.is-call-expanded .nv-chat-call-local {
    width: min(22vw, 176px);
    height: min(16vw, 130px);
}

.nv-chat-call-layer.is-call-floating {
    position: fixed !important;
    left: var(--call-floating-left, calc(100vw - min(520px, calc(100vw - 24px)) - 18px)) !important;
    top: var(--call-floating-top, 72px) !important;
    right: auto !important;
    bottom: auto !important;
    width: min(520px, calc(100vw - 24px)) !important;
    height: min(420px, calc(100vh - 24px)) !important;
    max-width: none !important;
    max-height: none !important;
    z-index: 2147483645 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    background: transparent;
    padding: 0 !important;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-card {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 8px;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-body {
    grid-template-columns: minmax(0, 1fr);
    height: 100% !important;
    min-height: 0 !important;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-chat,
.nv-chat-call-layer.is-call-floating [data-role="call-chat-toggle"] {
    display: none !important;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-top {
    cursor: move;
    padding: 10px;
    user-select: none;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-stage {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    grid-auto-rows: minmax(96px, 1fr);
    gap: 6px;
    padding: 8px;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-grid.has-presentation {
    grid-template-columns: repeat(auto-fit, minmax(88px, 102px));
    grid-template-rows: minmax(0, 1fr) 54px;
    grid-auto-rows: 54px;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-grid.has-presentation .nv-chat-call-tile.is-presenting {
    min-height: 0;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-grid.has-presentation .nv-chat-call-tile:not(.is-presenting) {
    width: 102px;
    height: 54px;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-tile,
.nv-chat-call-layer.is-call-floating .nv-chat-call-tile video {
    min-height: 0;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-local {
    width: 104px;
    height: 78px;
    right: 8px;
    bottom: 8px;
}

.nv-chat-call-layer.is-call-floating .nv-chat-call-actions {
    gap: 6px;
    padding: 8px;
}

.nv-chat-call-layer.is-call-fullscreen,
.nv-chat-call-layer:fullscreen,
.nv-chat-call-layer:-webkit-full-screen,
.nv-chat-call-layer:-ms-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    z-index: 2147483647 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    background: #020617;
    padding: 0 !important;
}

.nv-chat-call-layer.is-call-fullscreen .nv-chat-call-card,
.nv-chat-call-layer:fullscreen .nv-chat-call-card,
.nv-chat-call-layer:-webkit-full-screen .nv-chat-call-card,
.nv-chat-call-layer:-ms-fullscreen .nv-chat-call-card {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
    overflow: hidden !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
}

.nv-chat-call-layer.is-call-fullscreen .nv-chat-call-body,
.nv-chat-call-layer:fullscreen .nv-chat-call-body,
.nv-chat-call-layer:-webkit-full-screen .nv-chat-call-body,
.nv-chat-call-layer:-ms-fullscreen .nv-chat-call-body {
    display: grid !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.nv-chat-call-layer.is-call-fullscreen .nv-chat-call-stage,
.nv-chat-call-layer:fullscreen .nv-chat-call-stage,
.nv-chat-call-layer:-webkit-full-screen .nv-chat-call-stage,
.nv-chat-call-layer:-ms-fullscreen .nv-chat-call-stage {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: #111827 !important;
}

.nv-chat-call-layer.is-call-fullscreen .nv-chat-call-grid,
.nv-chat-call-layer:fullscreen .nv-chat-call-grid,
.nv-chat-call-layer:-webkit-full-screen .nv-chat-call-grid,
.nv-chat-call-layer:-ms-fullscreen .nv-chat-call-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    align-content: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 14px;
}

.nv-chat-call-layer.is-call-fullscreen .nv-chat-call-grid.has-presentation,
.nv-chat-call-layer:fullscreen .nv-chat-call-grid.has-presentation,
.nv-chat-call-layer:-webkit-full-screen .nv-chat-call-grid.has-presentation,
.nv-chat-call-layer:-ms-fullscreen .nv-chat-call-grid.has-presentation {
    grid-template-columns: repeat(auto-fit, minmax(126px, 146px));
    grid-template-rows: minmax(0, 1fr) 76px;
    grid-auto-rows: 76px;
}

.nv-chat-call-layer.is-call-fullscreen .nv-chat-call-grid.has-presentation .nv-chat-call-tile.is-presenting,
.nv-chat-call-layer:fullscreen .nv-chat-call-grid.has-presentation .nv-chat-call-tile.is-presenting,
.nv-chat-call-layer:-webkit-full-screen .nv-chat-call-grid.has-presentation .nv-chat-call-tile.is-presenting,
.nv-chat-call-layer:-ms-fullscreen .nv-chat-call-grid.has-presentation .nv-chat-call-tile.is-presenting {
    min-height: 0;
}

.nv-chat-call-layer.is-call-fullscreen .nv-chat-call-grid.has-presentation .nv-chat-call-tile:not(.is-presenting),
.nv-chat-call-layer:fullscreen .nv-chat-call-grid.has-presentation .nv-chat-call-tile:not(.is-presenting),
.nv-chat-call-layer:-webkit-full-screen .nv-chat-call-grid.has-presentation .nv-chat-call-tile:not(.is-presenting),
.nv-chat-call-layer:-ms-fullscreen .nv-chat-call-grid.has-presentation .nv-chat-call-tile:not(.is-presenting) {
    width: 146px;
    height: 76px;
}

.nv-chat-call-layer.is-call-fullscreen .nv-chat-call-tile,
.nv-chat-call-layer:fullscreen .nv-chat-call-tile,
.nv-chat-call-layer:-webkit-full-screen .nv-chat-call-tile,
.nv-chat-call-layer:-ms-fullscreen .nv-chat-call-tile {
    min-height: 0;
}

.nv-chat-call-layer.is-call-fullscreen .nv-chat-call-tile video,
.nv-chat-call-layer:fullscreen .nv-chat-call-tile video,
.nv-chat-call-layer:-webkit-full-screen .nv-chat-call-tile video,
.nv-chat-call-layer:-ms-fullscreen .nv-chat-call-tile video {
    min-height: 0;
}

.nv-chat-call-layer.is-call-fullscreen .nv-chat-call-local,
.nv-chat-call-layer:fullscreen .nv-chat-call-local,
.nv-chat-call-layer:-webkit-full-screen .nv-chat-call-local,
.nv-chat-call-layer:-ms-fullscreen .nv-chat-call-local {
    width: min(22vw, 180px);
    height: min(16vw, 132px);
}

.nv-chat-call-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--chat-border-soft);
    background: #ffffff;
}

.nv-chat-call-actions .btn {
    min-height: 36px;
    border-radius: 6px;
}

.nv-chat-call-actions .btn > .fa + span {
    margin-left: 6px;
}

.nv-chat-call-layer:not(.is-incoming) [data-role="call-accept"],
.nv-chat-call-layer.is-incoming [data-role="call-end"],
.nv-chat-call-layer.is-ringing [data-role="call-end"],
.nv-chat-call-layer.is-active-call [data-role="call-decline"],
.nv-chat-call-layer.is-ringing [data-role="call-mic-toggle"],
.nv-chat-call-layer.is-ringing [data-role="call-camera-toggle"],
.nv-chat-call-layer.is-ringing [data-role="call-record-toggle"],
.nv-chat-call-layer.is-audio [data-role="call-camera-toggle"] {
    display: none;
}

.nv-chat-call-layer.is-ringing [data-role="call-present-toggle"],
.nv-chat-call-layer.is-audio [data-role="call-present-toggle"] {
    display: none;
}

.nv-chat-call-layer.is-muted [data-role="call-mic-toggle"],
.nv-chat-call-layer.is-camera-off [data-role="call-camera-toggle"] {
    border-color: #d7b1b1;
    background: #fff1f1;
    color: #a83232;
}

.nv-chat-call-expand.btn.is-active {
    border-color: var(--chat-primary-border);
    background: var(--chat-primary-soft);
    color: var(--chat-primary-dark);
}

.nv-chat-call-layer [data-role="call-present-toggle"].is-active {
    border-color: #83d8cd;
    background: #e6fffb;
    color: #00796b;
}

.nv-chat-call-layer [data-role="call-record-toggle"].is-active {
    border-color: #f4b7b7;
    background: #fff1f1;
    color: #b91c1c;
}

.nv-chat-call-layer.is-recording .nv-chat-call-status::after {
    content: " - Đang ghi";
    color: #b91c1c;
    font-weight: 700;
}

.nv-chat-editor-toolbar {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    border: 1px solid #d9e1ec;
    border-radius: 7px;
    background: #f8fbfd;
    padding: 5px;
}

.nv-chat-editor-toolbar[hidden] {
    display: none;
}

/* Bang chon mau chu trong thanh dinh dang */
.nv-chat-color-palette {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 6px;
    margin-top: 2px;
    border-top: 1px solid #e1e7f0;
}

.nv-chat-color-palette[hidden] {
    display: none;
}

.nv-chat-color-swatch {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.nv-chat-color-swatch:hover,
.nv-chat-color-swatch:focus {
    transform: scale(1.18);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
    outline: 0;
}

.nv-chat-bubble mark {
    background: #fff3a0;
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
}

.nv-chat-bubble del {
    opacity: 0.75;
}

/* ===== Trinh xem tai lieu truc tiep (Excel/Word/PDF/text) ===== */
.nv-chat-doc-viewer {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nv-chat-doc-viewer[hidden] {
    display: none;
}

.nv-chat-doc-dialog {
    background: #fff;
    width: 100%;
    max-width: 980px;
    max-height: 92vh;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.nv-chat-doc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex: 0 0 auto;
}

.nv-chat-doc-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.nv-chat-doc-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.nv-chat-doc-body {
    flex: 1 1 auto;
    overflow: auto;
    background: #f3f4f6;
    padding: 12px;
    min-height: 200px;
}

.nv-chat-doc-frame {
    width: 100%;
    height: 80vh;
    border: 0;
    background: #fff;
    border-radius: 6px;
}

.nv-chat-doc-loading,
.nv-chat-doc-error {
    padding: 48px 16px;
    text-align: center;
    color: #6b7280;
}

.nv-chat-doc-text {
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    padding: 14px;
    border-radius: 6px;
    font-size: 13px;
    margin: 0;
    line-height: 1.6;
}

.nv-chat-doc-excel {
    background: #fff;
    border-radius: 6px;
    padding: 8px;
}

.nv-chat-doc-sheets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.nv-chat-doc-sheet {
    border: 1px solid #d1d5db;
    background: #f9fafb;
    border-radius: 5px;
    padding: 3px 12px;
    font-size: 12px;
    cursor: pointer;
}

.nv-chat-doc-sheet.is-active {
    background: var(--chat-primary-soft);
    border-color: var(--chat-primary-border);
    color: var(--chat-primary-dark);
    font-weight: 600;
}

.nv-chat-doc-table-wrap {
    overflow: auto;
}

.nv-chat-doc-table-wrap table {
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}

.nv-chat-doc-table-wrap td,
.nv-chat-doc-table-wrap th {
    border: 1px solid #e5e7eb;
    padding: 4px 9px;
    white-space: nowrap;
}

.nv-chat-doc-word {
    background: #fff;
    padding: 12px;
    border-radius: 6px;
}

.nv-chat-doc-word .docx-wrapper {
    background: transparent !important;
    padding: 0 !important;
}

.nv-chat-doc-word .docx-wrapper > section.docx {
    box-shadow: none !important;
    margin: 0 auto 12px !important;
}

.nv-chat-editor-toolbar .btn {
    width: 30px;
    min-width: 30px;
    height: 28px;
    min-height: 28px;
    border-radius: 6px;
    padding: 0;
}

.nv-chat-emoji-panel {
    position: absolute;
    left: 68px;
    bottom: calc(100% + 8px);
    z-index: 5;
    width: min(340px, calc(100% - 32px));
    max-height: 238px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    overflow: auto;
    border: 1px solid #ccd8e4;
    border-radius: 8px;
    background: #ffffff;
    padding: 8px;
    box-shadow: 0 12px 28px rgba(23, 32, 51, 0.16);
}

.nv-chat-emoji-panel[hidden] {
    display: none;
}

.nv-chat-emoji-item {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 21px;
    line-height: 1;
    padding: 0;
}

.nv-chat-emoji-item:hover,
.nv-chat-emoji-item:focus {
    background: var(--chat-primary-soft);
    outline: 0;
}

.nv-chat-mention-panel {
    position: absolute;
    left: 12px;
    bottom: calc(100% + 8px);
    z-index: 6;
    width: min(360px, calc(100% - 24px));
    max-height: 292px;
    overflow: auto;
    border: 1px solid #ccd8e4;
    border-radius: 8px;
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 14px 32px rgba(23, 32, 51, 0.18);
}

.nv-chat-mention-panel[hidden] {
    display: none;
}

.nv-chat-mention-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--chat-text);
    padding: 7px;
    text-align: left;
}

.nv-chat-mention-item:hover,
.nv-chat-mention-item:focus,
.nv-chat-mention-item.is-active {
    background: var(--chat-primary-soft);
    outline: 0;
}

.nv-chat-mention-body {
    min-width: 0;
    display: block;
}

.nv-chat-mention-name,
.nv-chat-mention-sub {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-mention-name {
    font-weight: 700;
}

.nv-chat-mention-sub {
    color: var(--chat-muted);
    font-size: 12px;
    margin-top: 1px;
}

.nv-chat-send-btn {
    grid-column: -2 / -1;
    min-width: 70px;
    height: 38px;
    min-height: 38px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 11px;
    font-weight: 700;
}

.nv-chat .btn,
.nv-chat button,
.nv-chat a,
.nv-chat .form-control {
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.nv-chat .form-control {
    border-color: var(--chat-border);
    color: var(--chat-text);
    box-shadow: none;
}

.nv-chat .form-control:focus {
    border-color: var(--chat-primary-border);
    box-shadow: 0 0 0 2px rgba(1, 126, 132, 0.14);
}

.nv-chat-shell {
    border-color: var(--chat-border);
    box-shadow: 0 14px 34px rgba(23, 32, 51, 0.10);
}

.nv-chat-sidebar,
.nv-chat-messages {
    background: var(--chat-surface-soft);
}

.nv-chat-profile,
.nv-chat-thread-header,
.nv-chat-compose {
    background: var(--chat-surface);
}

.nv-chat-profile {
    border-bottom-color: var(--chat-border-soft);
}

.nv-chat-sidebar {
    border-right-color: var(--chat-border);
}

.nv-chat-conversation {
    border-radius: 8px;
}

.nv-chat-conversation:hover,
.nv-chat-conversation:focus {
    background: var(--chat-surface);
    border-color: #c9d8e5;
    box-shadow: 0 5px 16px rgba(23, 32, 51, 0.06);
}

.nv-chat-conversation.is-active {
    background: var(--chat-primary-soft);
    border-color: var(--chat-primary-border);
    box-shadow: inset 4px 0 0 var(--chat-primary), 0 8px 18px rgba(1, 126, 132, 0.12);
}

.nv-chat-unread,
.nv-chat-avatar-placeholder {
    background: var(--chat-primary);
}

.nv-chat-message {
    margin-bottom: 12px;
}

.nv-chat-bubble {
    border-color: var(--chat-border);
    background: var(--chat-surface);
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.07);
}

.nv-chat-message.is-me .nv-chat-bubble {
    border-color: var(--chat-own-border);
    background: var(--chat-own-bg);
}

.nv-chat-message-content {
    color: var(--chat-text);
}

.nv-chat-message-time,
.nv-chat-conversation-time,
.nv-chat-thread-subtitle,
.nv-chat-profile-username,
.nv-chat-muted {
    color: var(--chat-muted);
}

.nv-chat-attachment,
.nv-chat-asset-file,
.nv-chat-asset-link {
    border-color: var(--chat-border);
    background: rgba(255, 255, 255, 0.86);
}

.nv-chat-attachment:hover,
.nv-chat-attachment:focus,
.nv-chat-asset-file:hover,
.nv-chat-asset-file:focus,
.nv-chat-asset-link:hover,
.nv-chat-asset-link:focus {
    border-color: #9db9ce;
    box-shadow: 0 8px 18px rgba(23, 32, 51, 0.08);
}

.nv-chat-detail-drawer {
    border-left-color: var(--chat-border);
    box-shadow: -16px 0 32px rgba(23, 32, 51, 0.13);
}

.nv-chat-detail-tabs {
    border-color: var(--chat-border);
    background: var(--chat-surface-soft);
}

.nv-chat-detail-tabs button.is-active {
    color: var(--chat-primary-dark);
}

.nv-chat-send-btn.btn-primary,
.nv-chat .btn-primary {
    border-color: var(--chat-primary);
    background: var(--chat-primary);
}

.nv-chat-send-btn.btn-primary:hover,
.nv-chat .btn-primary:hover,
.nv-chat-send-btn.btn-primary:focus,
.nv-chat .btn-primary:focus {
    border-color: var(--chat-primary-dark);
    background: var(--chat-primary-dark);
}

.nv-chat ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.nv-chat ::-webkit-scrollbar-track {
    background: transparent;
}

.nv-chat ::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c5d1de;
}

.nv-chat ::-webkit-scrollbar-thumb:hover {
    background: #aebdcb;
}

.nv-chat--popup {
    --chat-popup-toggle-size: 40px;
    --chat-popup-bottom-offset: 92px;
    --chat-popup-width: 920px;
    --chat-sidebar-width: clamp(230px, 24vw, 270px);
    --chat-detail-width: clamp(210px, 24vw, 250px);
    position: fixed;
    left: 8px;
    bottom: var(--chat-popup-bottom-offset);
    z-index: 1040;
    width: auto;
}

.nv-chat-popup-toggle {
    position: relative;
    width: var(--chat-popup-toggle-size);
    height: var(--chat-popup-toggle-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--chat-primary);
    color: #ffffff;
    box-shadow: 0 7px 18px rgba(1, 126, 132, 0.24);
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.nv-chat-popup-toggle:hover,
.nv-chat-popup-toggle:focus {
    background: var(--chat-primary-dark);
    color: #ffffff;
    outline: 0;
}

.nv-chat-popup-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--chat-danger);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 0 5px;
}

.nv-chat-popup-badge[hidden] {
    display: none;
}

.nv-chat-popup-panel {
    position: fixed;
    left: 50px;
    top: 20px;
    bottom: 12px;
    width: min(var(--chat-popup-width), calc(100vw - 70px));
    height: auto;
    display: grid;
    grid-template-rows: 48px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #cbd8e6;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(23, 32, 51, 0.22);
}

.nv-chat-popup-resize {
    position: absolute;
    top: 0;
    bottom: 0;
    right: -6px;
    z-index: 5;
    width: 12px;
    cursor: ew-resize;
    touch-action: none;
}

.nv-chat-popup-resize::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 5px;
    width: 2px;
    height: 74px;
    border-radius: 999px;
    background: rgba(1, 126, 132, 0.18);
    transform: translateY(-50%);
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.nv-chat-popup-resize:hover::before,
.nv-chat-popup-resize:focus::before,
.nv-chat.is-popup-resizing .nv-chat-popup-resize::before {
    background: rgba(1, 126, 132, 0.72);
    box-shadow: 0 0 0 3px rgba(1, 126, 132, 0.12);
}

.nv-chat-popup-resize:focus {
    outline: 0;
}

.nv-chat.is-popup-resizing,
.nv-chat.is-popup-resizing * {
    cursor: ew-resize !important;
    user-select: none;
}

.nv-chat-popup-panel[hidden] {
    display: none;
}

.nv-chat-popup-header {
    grid-row: 1;
    position: relative;
    z-index: 2;
    min-height: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #d9e1ec;
    background: #ffffff;
    padding: 0 14px;
}

.nv-chat-popup-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nv-chat-popup-actions a,
.nv-chat-popup-actions button {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfd8e4;
    border-radius: 6px;
    background: #ffffff;
    color: #405066;
    padding: 0;
}

.nv-chat-popup-actions a:hover,
.nv-chat-popup-actions a:focus,
.nv-chat-popup-actions button:hover,
.nv-chat-popup-actions button:focus {
    border-color: #9db6ca;
    background: var(--chat-surface-hover);
    color: var(--chat-primary-dark);
    outline: 0;
    text-decoration: none;
}

.nv-chat--popup .nv-chat-shell {
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    grid-template-columns: var(--chat-sidebar-width) minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.nv-chat--popup .nv-chat-sidebar,
.nv-chat--popup .nv-chat-thread {
    min-height: 0;
    height: 100%;
}

.nv-chat--popup .nv-chat-profile {
    padding: 12px 14px;
}

.nv-chat--popup .nv-chat-messages {
    padding: 14px 16px;
}

.nv-chat--popup .nv-chat-thread-tools {
    gap: 1px;
    padding: 2px;
}

.nv-chat--popup .nv-chat-thread-tools .btn {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    font-size: 13px;
}

.nv-chat--popup .nv-chat-thread.is-details-open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--chat-detail-width);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.nv-chat--popup .nv-chat-thread.is-details-open .nv-chat-thread-header {
    grid-column: 1 / -1;
    grid-row: 1;
}

.nv-chat--popup .nv-chat-thread.is-details-open .nv-chat-pinned {
    grid-column: 1;
    grid-row: 2;
}

.nv-chat--popup .nv-chat-thread.is-details-open .nv-chat-messages {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
}

.nv-chat--popup .nv-chat-thread.is-details-open .nv-chat-compose {
    grid-column: 1;
    grid-row: 4;
}

.nv-chat--popup .nv-chat-thread.is-details-open .nv-chat-detail-drawer {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    grid-column: 2;
    grid-row: 2 / 5;
    width: auto;
    max-width: none;
    min-width: 0;
    min-height: 0;
    box-shadow: none;
}

.nv-chat--popup .nv-chat-detail-header,
.nv-chat--popup .nv-chat-detail-section {
    padding: 10px;
}

.nv-chat--popup .nv-chat-detail-drawer .nv-chat-message-search {
    grid-template-columns: minmax(0, 1fr) 44px;
}

.nv-chat--popup .nv-chat-detail-drawer .nv-chat-message-search [data-role="message-search-clear"] {
    grid-column: 1 / -1;
    width: 100%;
}

.nv-chat--popup .nv-chat-detail-drawer .nv-chat-message-search .btn span {
    display: none;
}

.nv-chat--popup .nv-chat-assets-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nv-chat--popup .nv-chat-compose {
    grid-template-columns: repeat(5, 28px) minmax(0, 1fr) 62px;
    column-gap: 4px;
    row-gap: 5px;
    padding: 7px 8px;
}

.nv-chat--popup .nv-chat-pending-files {
    max-height: 82px;
    padding: 4px;
}

.nv-chat--popup .nv-chat-pending-file {
    width: min(210px, 34vw);
}

.nv-chat--popup .nv-chat-pending-file.is-image {
    width: min(220px, 42vw);
    grid-template-columns: 72px minmax(0, 1fr) 24px;
}

.nv-chat--popup .nv-chat-pending-file.is-image .nv-chat-pending-file-thumb {
    width: 72px;
    height: 56px;
}

.nv-chat--popup .nv-chat-compose .btn {
    min-height: 28px;
    height: 28px;
}

.nv-chat--popup .nv-chat-compose textarea.form-control {
    min-height: 36px;
    height: 36px;
}

.nv-chat--popup .nv-chat-icon-btn {
    width: 28px;
    min-width: 28px;
}

.nv-chat--popup .nv-chat-send-btn {
    min-width: 62px;
    height: 36px;
    min-height: 36px;
    padding: 0 9px;
}

@media (max-width: 767px) {
    .nv-chat {
        --chat-mobile-header-height: 58px;
    }

    /* Nut thao tac tin nhan: chi hien icon tren mobile cho gon, het ngat dong chu */
    .nv-chat-message-actions {
        gap: 4px;
    }

    .nv-chat-message-action {
        padding: 6px 9px;
    }

    .nv-chat-message-action > span {
        display: none;
    }

    .nv-chat-message-action > i {
        font-size: 14px;
    }

    .nv-chat-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
        height: 100vh;
        width: 100%;
        z-index: 10000;
        min-height: 0;
        overflow: hidden;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .nv-chat:not(.nv-chat--popup) .nv-chat-shell {
        position: relative;
        top: auto;
        height: 100vh;
        min-height: 0;
    }

    @supports (height: 100svh) {
        .nv-chat-shell,
        .nv-chat:not(.nv-chat--popup) .nv-chat-shell {
            height: 100svh;
        }
    }

    @supports (height: 100dvh) {
        .nv-chat-shell,
        .nv-chat:not(.nv-chat--popup) .nv-chat-shell {
            height: 100dvh;
            z-index: 10000;
        }
    }

    .nv-chat-sidebar {
        min-height: 0;
        height: 100%;
        border-right: 0;
        border-bottom: 0;
        overflow: hidden;
    }

    .nv-chat-thread {
        height: 100%;
        min-height: 0;
    }

    .nv-chat-shell.is-chat-list .nv-chat-thread,
    .nv-chat-shell:not(.is-chat-active) .nv-chat-thread {
        display: none;
    }

    .nv-chat-shell.is-chat-active .nv-chat-sidebar {
        display: none;
    }

    .nv-chat-shell.is-chat-active .nv-chat-thread {
        display: flex;
    }

    .nv-chat-mobile-back {
        width: 34px;
        min-width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 7px;
        font-size: 18px;
    }

    .nv-chat-thread-header {
        min-height: var(--chat-mobile-header-height);
        align-items: center;
        flex-direction: row;
        gap: 8px;
        padding: 8px 10px;
    }

    .nv-chat-thread-user {
        min-width: 0;
        gap: 8px;
    }

    .nv-chat-thread-user .nv-chat-avatar {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .nv-chat-thread-title {
        font-size: 15px;
        line-height: 1.25;
    }

    .nv-chat-thread-subtitle {
        font-size: 11px;
        line-height: 1.3;
    }

    .nv-chat-thread-tools {
        flex: 0 0 auto;
        width: auto;
        max-width: 148px;
        gap: 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nv-chat-thread-tools::-webkit-scrollbar {
        display: none;
    }

    .nv-chat-thread-tools .btn {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
    }

    .nv-chat-message-search .form-control {
        width: 100%;
    }

    .nv-chat-detail-drawer {
        left: 0;
        width: auto;
        max-width: none;
    }

    .nv-chat:not(.nv-chat--popup) .nv-chat-thread.is-details-open {
        display: flex;
        flex-direction: column;
    }

    .nv-chat:not(.nv-chat--popup) .nv-chat-thread.is-details-open .nv-chat-detail-drawer {
        position: absolute;
        top: var(--chat-mobile-header-height);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 4;
        width: auto;
        max-width: none;
        box-shadow: -18px 0 34px rgba(23, 32, 51, 0.12);
    }

    .nv-chat-detail-drawer {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nv-chat-detail-drawer .nv-chat-message-search {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .nv-chat-detail-drawer .nv-chat-message-search [data-role="message-search-clear"] {
        grid-column: 1 / -1;
    }

    .nv-chat-group-manage-grid,
    .nv-chat-group-member-list {
        grid-template-columns: 1fr;
    }

    .nv-chat-bubble {
        max-width: min(88%, calc(100vw - 68px));
        padding: 9px 10px 7px;
    }

    .nv-chat-messages {
        padding: 12px 10px;
    }

    .nv-chat-message {
        gap: 6px;
        margin-bottom: 8px;
    }

    .nv-chat-message.is-system .nv-chat-bubble {
        max-width: 94%;
        border-radius: 8px;
    }

    .nv-chat-attachment {
        max-width: min(320px, 74vw);
    }

    .nv-chat-attachment.is-image img {
        max-width: 74vw;
        max-height: 210px;
    }

    .nv-chat-compose {
        grid-template-columns: repeat(5, 32px) minmax(0, 1fr) 48px;
        column-gap: 4px;
        row-gap: 5px;
        padding: 6px 8px;
    }

    @supports (padding: max(0px)) {
        .nv-chat-compose {
            padding-bottom: max(6px, env(safe-area-inset-bottom));
        }
    }

    .nv-chat-pending-files {
        max-height: 88px;
    }

    .nv-chat-pending-file {
        width: min(220px, 72vw);
        max-width: none;
        flex: 0 0 auto;
    }

    .nv-chat-pending-file.is-image {
        width: min(236px, 78vw);
        grid-template-columns: 76px minmax(0, 1fr) 24px;
    }

    .nv-chat-pending-file.is-image .nv-chat-pending-file-thumb {
        width: 76px;
        height: 58px;
    }

    .nv-chat-emoji-panel {
        left: 10px;
        right: 10px;
        bottom: calc(100% + 8px);
        width: auto;
        grid-template-columns: repeat(7, 1fr);
    }

    .nv-chat-compose textarea.form-control {
        grid-column: 1 / -2;
        min-height: 40px;
        height: 40px;
        padding: 8px 10px;
    }

    .nv-chat-send-btn {
        grid-column: -2 / -1;
        height: 40px;
        min-height: 40px;
    }

    .nv-chat-compose .btn {
        width: auto;
        min-width: 32px;
        height: 32px;
        min-height: 32px;
    }

    .nv-chat-icon-btn {
        width: 32px;
        min-width: 32px;
    }

    .nv-chat-send-btn span {
        display: none;
    }

    .nv-chat-call-layer {
        padding: 10px;
    }

    .nv-chat-call-layer.is-call-expanded {
        inset: 8px !important;
    }

    .nv-chat-call-layer.is-call-floating {
        left: var(--call-floating-left, 8px) !important;
        top: var(--call-floating-top, 8px) !important;
        width: calc(100vw - 16px) !important;
        height: min(380px, calc(100vh - 16px)) !important;
    }

    .nv-chat-call-layer.is-call-chat-open .nv-chat-call-body {
        position: relative;
        grid-template-columns: minmax(0, 1fr);
    }

    .nv-chat-call-chat {
        position: absolute;
        right: 8px;
        bottom: 8px;
        top: 8px;
        z-index: 3;
        width: min(340px, calc(100% - 16px));
        border: 1px solid var(--chat-border-soft);
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.28);
    }

    .nv-chat-call-chat-form .btn span {
        display: none;
    }

    .nv-chat-call-card {
        width: 100%;
        max-height: 100%;
    }

    .nv-chat-call-top {
        min-height: 56px;
        gap: 8px;
        padding: 10px;
    }

    .nv-chat-call-peer {
        min-width: 0;
        gap: 8px;
    }

    .nv-chat-call-peer .nv-chat-avatar {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .nv-chat-call-title {
        font-size: 14px;
    }

    .nv-chat-call-top-actions {
        flex: 0 0 auto;
        max-width: 154px;
        gap: 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nv-chat-call-top-actions::-webkit-scrollbar {
        display: none;
    }

    .nv-chat-call-top-actions .btn {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
    }

    .nv-chat-call-stage {
        min-height: 230px;
    }

    .nv-chat-call-grid {
        grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
        gap: 6px;
        padding: 8px;
    }

    .nv-chat-call-tile,
    .nv-chat-call-tile video {
        min-height: 104px;
    }

    .nv-chat-call-local {
        width: 96px;
        height: 72px;
        right: 8px;
        bottom: 8px;
    }

    .nv-chat-call-actions .btn {
        flex: 0 0 auto;
        min-width: 42px;
        height: 36px;
        min-height: 36px;
        padding-right: 10px;
        padding-left: 10px;
    }

    .nv-chat-call-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
        overflow-x: auto;
        padding: 8px;
        scrollbar-width: none;
    }

    .nv-chat-call-actions::-webkit-scrollbar {
        display: none;
    }

    .nv-chat-call-actions .btn > .fa + span {
        display: none;
    }

    .nv-chat-call-layer.is-call-fullscreen .nv-chat-call-local,
    .nv-chat-call-layer:fullscreen .nv-chat-call-local,
    .nv-chat-call-layer:-webkit-full-screen .nv-chat-call-local,
    .nv-chat-call-layer:-ms-fullscreen .nv-chat-call-local {
        width: 104px;
        height: 78px;
    }

    .nv-chat-image-viewer {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 6px;
        padding: 52px 10px 18px;
    }

    .nv-chat-image-viewer-close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
    }

    .nv-chat-image-viewer-nav {
        width: 42px;
        height: 42px;
    }

    .nv-chat-image-viewer-img {
        max-height: calc(100vh - 126px);
    }

    .nv-chat-image-viewer-caption {
        max-width: 100%;
        font-size: 13px;
    }

    .nv-chat-image-viewer-toolbar {
        top: auto;
        bottom: 8px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        flex-wrap: nowrap;
        justify-content: center;
        gap: 6px;
        max-width: calc(100% - 16px);
        padding: 4px;
        overflow-x: auto;
        background: rgba(14, 20, 32, 0.55);
        border-radius: 999px;
    }

    .nv-chat-image-viewer-tool {
        flex: 0 0 auto;
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .nv-chat--popup {
        --chat-popup-toggle-size: 38px;
        --chat-popup-bottom-offset: 58px;
        left: 9px;
        bottom: 78px;
        z-index: 10000;
    }

    .nv-chat-popup-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        height: 100vh;
        z-index: 10000;
        max-height: none;
        border-radius: 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
    }

    @supports (height: 100svh) {
        .nv-chat-popup-panel {
            height: 100svh;
        }
    }

    @supports (height: 100dvh) {
        .nv-chat-popup-panel {
            height: 100dvh;
        }
    }

    .nv-chat--popup.is-popup-open .nv-chat-popup-toggle {
        display: none;
    }

    @supports (padding: max(0px)) {
        .nv-chat-popup-panel {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }

    .nv-chat-popup-resize {
        display: none;
    }

    .nv-chat--popup .nv-chat-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .nv-chat--popup .nv-chat-sidebar {
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .nv-chat--popup .nv-chat-profile,
    .nv-chat--popup .nv-chat-section-title {
        display: none;
    }

    .nv-chat--popup .nv-chat-thread {
        height: 100%;
        min-height: 0;
    }

    .nv-chat--popup .nv-chat-thread.is-details-open {
        display: flex;
        flex-direction: column;
    }

    .nv-chat--popup .nv-chat-thread.is-details-open .nv-chat-thread-header,
    .nv-chat--popup .nv-chat-thread.is-details-open .nv-chat-pinned,
    .nv-chat--popup .nv-chat-thread.is-details-open .nv-chat-messages,
    .nv-chat--popup .nv-chat-thread.is-details-open .nv-chat-compose {
        grid-column: auto;
        grid-row: auto;
    }

    .nv-chat--popup .nv-chat-thread.is-details-open .nv-chat-detail-drawer {
        position: absolute;
        top: var(--chat-mobile-header-height);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 4;
        width: auto;
        max-width: none;
        box-shadow: -18px 0 34px rgba(23, 32, 51, 0.12);
    }

    .nv-chat--popup .nv-chat-compose {
        grid-template-columns: repeat(5, 32px) minmax(0, 1fr) 48px;
        padding: 6px 8px;
    }

    .nv-chat--popup .nv-chat-compose .btn {
        min-width: 32px;
        height: 32px;
        min-height: 32px;
    }

    .nv-chat--popup .nv-chat-icon-btn {
        width: 32px;
        min-width: 32px;
    }

    .nv-chat--popup .nv-chat-compose textarea.form-control {
        height: 40px;
        min-height: 40px;
    }

    .nv-chat--popup .nv-chat-send-btn {
        min-width: 48px;
        height: 40px;
        min-height: 40px;
    }
}

/* Nhom ngoai: link moi + phong cho khach */
.nv-chat-external-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nv-chat-external-toggle,
.nv-chat-group-external-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

.nv-chat-group-external-opt {
    margin: 6px 0 2px;
    font-weight: 400;
    font-size: 13px;
}

.nv-chat-external-toggle input[type="checkbox"],
.nv-chat-group-external-opt input[type="checkbox"] {
    margin: 0;
    position: static;
}

.nv-chat-external-link-row label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.nv-chat-external-guest-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.nv-chat-external-guest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid #e6e8ec;
    border-radius: 8px;
}

.nv-chat-external-guest-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.nv-chat-external-guest-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-chat-external-guest-time {
    font-size: 12px;
    color: #8a93a2;
}

.nv-chat-external-guest-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nv-chat-external-guest-badge {
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
}

/* ===== Green World UI: panel hoi thoai va thanh thao tac tin nhan gon ===== */
.nv-chat--popup {
    --chat-detail-width: clamp(276px, 21vw, 304px);
}

/* Gom cac hanh dong cua mot tin nhan thanh mot toolbar nho, giu day du title/aria-label. */
.nv-chat-message-actions {
    width: max-content;
    max-width: 100%;
    margin: 8px 0 0 auto;
    padding: 3px;
    gap: 2px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    border: 1px solid #d8e3e2;
    border-radius: 999px;
    background: #f7faf9;
    box-shadow: 0 1px 2px rgba(16, 54, 51, 0.06);
}

.nv-chat-message-action {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-radius: 999px;
    color: #526b68;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0;
    font-weight: 400;
    line-height: 1;
}

.nv-chat-message-action > span {
    display: none;
}

.nv-chat-message-action > i {
    font-size: 13px;
    line-height: 1;
}

.nv-chat-message-action:hover,
.nv-chat-message-action:focus {
    color: #0f5f5c;
    background: #dff1ef;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.20);
}

.nv-chat-message-action.gw-ui-chat-reminder-action {
    color: #8a5b12;
}

.nv-chat-message-action.gw-ui-chat-reminder-action:hover,
.nv-chat-message-action.gw-ui-chat-reminder-action:focus {
    color: #8a5b12;
    background: #fff0c7;
}

.nv-chat-message-action.nv-chat-revoke-action:hover,
.nv-chat-message-action.nv-chat-revoke-action:focus {
    color: #a93226;
    background: #fde9e7;
}

/* Drawer thong tin: tach thanh cac khoi quan ly ro rang thay vi mot cot control keo dai. */
.nv-chat-detail-drawer {
    scrollbar-width: thin;
    scrollbar-color: #9ecdc9 transparent;
    border-left-color: #d8e3e2;
    background: #f3f7f6;
    box-shadow: -10px 0 24px rgba(16, 54, 51, 0.10);
    color: #1f2d2b;
    font-family: Arial, Helvetica, sans-serif;
}

.nv-chat-detail-drawer::-webkit-scrollbar {
    width: 6px;
}

.nv-chat-detail-drawer::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #9ecdc9;
}

.nv-chat-detail-header {
    min-height: 54px;
    padding: 12px 16px;
    border-bottom-color: #d8e3e2;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(16, 54, 51, 0.04);
}

.nv-chat-detail-header strong {
    position: relative;
    padding-left: 24px;
    color: #1f2d2b;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
}

.nv-chat-detail-header strong::before {
    content: "\f05a";
    position: absolute;
    top: 0;
    left: 0;
    color: #0f766e;
    font-family: FontAwesome;
    font-size: 15px;
    font-weight: 400;
}

.nv-chat-detail-header .btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border-color: #d8e3e2;
    border-radius: 999px;
    background: #ffffff;
    color: #526b68;
}

.nv-chat-detail-header .btn:hover,
.nv-chat-detail-header .btn:focus {
    border-color: #9ecdc9;
    background: #dff1ef;
    color: #0f5f5c;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.20);
}

.nv-chat-detail-section,
.nv-chat-detail-drawer .nv-chat-group-manage {
    margin: 10px;
    padding: 12px;
    border: 1px solid #d8e3e2;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 54, 51, 0.06);
}

.nv-chat-detail-section + .nv-chat-detail-section,
.nv-chat-detail-drawer .nv-chat-group-manage + .nv-chat-detail-section {
    margin-top: 0;
}

.nv-chat-detail-action.btn,
.nv-chat-detail-section [data-role="group-manage-toggle"] {
    min-height: 38px;
    border-color: #b8ccca;
    border-radius: 5px;
    background: #ffffff;
    color: #0f5f5c;
    font-size: 13px;
    font-weight: 700;
}

.nv-chat-detail-action.btn:hover,
.nv-chat-detail-action.btn:focus,
.nv-chat-detail-section [data-role="group-manage-toggle"]:hover,
.nv-chat-detail-section [data-role="group-manage-toggle"]:focus {
    border-color: #0f766e;
    background: #f1f9f8;
    color: #0f5f5c;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.20);
}

.nv-chat-detail-drawer .nv-chat-message-search {
    grid-template-columns: minmax(0, 1fr) 38px;
}

.nv-chat-detail-drawer .nv-chat-message-search .form-control,
.nv-chat-detail-drawer .nv-chat-group-manage-block .form-control {
    height: 38px;
    min-height: 38px;
    border-color: #b8ccca;
    border-radius: 5px;
    color: #1f2d2b;
    font-size: 13px;
    font-weight: 400;
}

.nv-chat-detail-drawer .nv-chat-message-search .form-control:focus,
.nv-chat-detail-drawer .nv-chat-group-manage-block .form-control:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.20);
}

.nv-chat-detail-drawer .nv-chat-message-search .btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-color: #b8ccca;
    border-radius: 5px;
    color: #0f5f5c;
}

.nv-chat-detail-drawer .nv-chat-group-manage {
    display: block;
    border-bottom: 1px solid #d8e3e2;
}

.nv-chat-detail-drawer .nv-chat-group-avatar-editor {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 56px;
    margin: 0 0 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid #eef2f1;
}

.nv-chat-detail-drawer.is-group-manage-open > .gw-ui-chat-background-section {
    display: none;
}

.nv-chat-detail-drawer .gw-ui-chat-background-inline {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    margin: 0;
    padding: 7px 10px;
    border-color: #b8ccca;
    border-radius: 5px;
    color: #0f5f5c;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.nv-chat-detail-drawer .gw-ui-chat-background-inline .fa {
    color: #0f766e;
}

.nv-chat-detail-drawer .gw-ui-chat-background-inline:hover,
.nv-chat-detail-drawer .gw-ui-chat-background-inline:focus {
    border-color: #0f766e;
    background: #f1f9f8;
    color: #0f5f5c;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.20);
}

.nv-chat-detail-drawer .nv-chat-group-avatar-button,
.nv-chat-detail-drawer .nv-chat-group-avatar-button .nv-chat-avatar {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
}

.nv-chat-detail-drawer .nv-chat-detail-section-title {
    margin-bottom: 2px;
    color: #526b68;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    text-transform: none;
}

.nv-chat-detail-drawer .nv-chat-muted {
    color: #7b8f8c;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

.nv-chat-detail-drawer .nv-chat-group-manage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.nv-chat-detail-drawer .nv-chat-group-manage-block label {
    margin-bottom: 6px;
    color: #526b68;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
}

.nv-chat-detail-drawer .nv-chat-inline-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.nv-chat-detail-drawer .nv-chat-inline-form [data-role="manage-save"] {
    min-width: 64px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
}

.nv-chat-detail-drawer .nv-chat-group-member-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.nv-chat-detail-drawer .nv-chat-group-member {
    min-height: 52px;
    padding: 8px;
    gap: 8px;
    flex-wrap: wrap;
    border-color: #d8e3e2;
    border-radius: 8px;
    background: #f7faf9;
}

.nv-chat-detail-drawer .nv-chat-group-member:hover {
    border-color: #9ecdc9;
    background: #f1f9f8;
}

.nv-chat-detail-drawer .nv-chat-group-member .nv-chat-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
}

.nv-chat-detail-drawer .nv-chat-group-member-body {
    min-width: 0;
    flex: 1 1 auto;
    flex-basis: calc(100% - 46px);
}

.nv-chat-detail-drawer .nv-chat-group-member-name {
    color: #1f2d2b;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
}

.nv-chat-detail-drawer .nv-chat-group-member-meta {
    color: #7b8f8c;
    font-size: 11px;
    font-weight: 400;
    line-height: 14px;
}

.nv-chat-detail-drawer .nv-chat-group-member .btn-xs {
    flex: 1 1 calc(50% - 4px);
    width: auto;
    min-width: 0;
    height: 32px;
    min-height: 30px;
    overflow: hidden;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.nv-chat-detail-drawer .nv-chat-group-manage-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef2f1;
}

.nv-chat-detail-drawer .nv-chat-group-manage-footer .btn {
    min-height: 38px;
    border-color: #c0392b;
    border-radius: 5px;
    background: #ffffff;
    color: #a93226;
    font-size: 13px;
    font-weight: 700;
}

.nv-chat-detail-drawer .nv-chat-group-manage-footer .btn:hover,
.nv-chat-detail-drawer .nv-chat-group-manage-footer .btn:focus {
    background: #fde9e7;
    color: #a93226;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.16);
}

.nv-chat-media-section {
    padding-top: 12px;
}

.nv-chat-detail-tabs {
    top: 54px;
    margin-bottom: 12px;
    border-color: #d8e3e2;
    border-radius: 8px;
    background: #eef2f1;
    box-shadow: none;
}

.nv-chat-detail-tabs button {
    height: 34px;
    border-radius: 5px;
    color: #526b68;
    font-size: 12px;
    font-weight: 700;
}

.nv-chat-detail-tabs button.is-active {
    color: #0f5f5c;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 54, 51, 0.08);
}

@media (max-width: 991px) {
    .nv-chat--popup {
        --chat-detail-width: min(320px, 88vw);
    }
}

@media (max-width: 767px) {
    .nv-chat-message-actions {
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nv-chat-message-actions::-webkit-scrollbar {
        display: none;
    }

    .nv-chat-message-action {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
    }

    .nv-chat-detail-section,
    .nv-chat-detail-drawer .nv-chat-group-manage {
        margin-right: 8px;
        margin-left: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nv-chat-message-action,
    .nv-chat-detail-drawer .btn,
    .nv-chat-detail-drawer .form-control {
        transition-duration: 0.01ms;
    }
}
