.ng-chat {
    --ng-chat-primary: #d6665f;
    --ng-chat-primary-dark: #bb4f49;
    --ng-chat-bg: #ffffff;
    --ng-chat-shell: #f6f7f9;
    --ng-chat-border: #d7dde4;
    --ng-chat-text: #2f3640;
    --ng-chat-muted: #76808d;
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(92vw, 370px);
    z-index: 1100;
    font-family: 'Poppins', sans-serif;
}

.ng-chat__toggle {
    width: 100%;
    border: 0;
    color: #fff;
    background: linear-gradient(140deg, var(--ng-chat-primary), var(--ng-chat-primary-dark));
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
    position: relative;
}

.ng-chat__toggle.ng-chat__toggle--alert {
    animation: ng-chat-pulse 1.4s ease-in-out infinite;
}

.ng-chat__toggle-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
}

.ng-chat__toggle-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #db2f4f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.ng-chat__panel {
    margin-top: 10px;
    background: var(--ng-chat-bg);
    border: 1px solid var(--ng-chat-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.ng-chat__header {
    background: linear-gradient(160deg, #484f5b, #646d7c);
    color: #fff;
    padding: 10px 12px;
}

.ng-chat__title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.ng-chat__subtitle {
    margin: 0;
    font-size: 11px;
    opacity: 0.85;
}

.ng-chat__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: var(--ng-chat-shell);
    border-bottom: 1px solid var(--ng-chat-border);
}

.ng-chat__tab {
    border: 0;
    padding: 9px;
    font-size: 12px;
    color: var(--ng-chat-muted);
    background: transparent;
    font-weight: 600;
}

.ng-chat__tab.active {
    color: var(--ng-chat-primary-dark);
    background: #fff;
}

.ng-chat__body {
    padding: 10px;
}

.ng-chat__conversation {
    max-height: 280px;
    min-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--ng-chat-border);
    background: #fbfcfd;
    border-radius: 10px;
    padding: 10px;
}

.ng-chat__message {
    margin-bottom: 10px;
    line-height: 1.25;
}

.ng-chat__meta {
    font-size: 11px;
    color: var(--ng-chat-muted);
    margin-bottom: 3px;
}

.ng-chat__bubble {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 10px;
    background: #e9edf2;
    color: var(--ng-chat-text);
    font-size: 13px;
    max-width: 85%;
    word-break: break-word;
}

.ng-chat__message.mine {
    text-align: right;
}

.ng-chat__message.mine .ng-chat__bubble {
    background: #ffe5e2;
    border: 1px solid #f6c4bf;
}

.ng-chat__private-controls {
    margin-bottom: 8px;
}

.ng-chat__dropdown {
    position: relative;
}

.ng-chat__dropdown-btn {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid var(--ng-chat-border);
    border-radius: 6px;
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    color: var(--ng-chat-text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ng-chat__dropdown-btn::after {
    content: '▾';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--ng-chat-muted);
    font-size: 12px;
}

.ng-chat__dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--ng-chat-border);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    z-index: 9999;
    max-height: 240px;
    overflow-y: auto;
}

.ng-chat__group {
    border-bottom: 1px solid var(--ng-chat-border);
}

.ng-chat__group:last-child {
    border-bottom: none;
}

.ng-chat__group-header {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ng-chat-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fdf0ef;
    border-left: 3px solid var(--ng-chat-primary);
}

.ng-chat__group-header::before {
    content: '▸';
    font-size: 10px;
    transition: transform 0.15s;
    display: inline-block;
}

details.ng-chat__group[open] > .ng-chat__group-header::before {
    transform: rotate(90deg);
}

.ng-chat__group-items {
    padding: 2px 0;
}

.ng-chat__dropdown-item {
    padding: 7px 14px;
    font-size: 13px;
    color: var(--ng-chat-text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ng-chat__dropdown-item:hover {
    background: #f0f3f7;
}

.ng-chat__dropdown-empty {
    padding: 12px 14px;
    font-size: 12px;
    color: var(--ng-chat-muted);
}

.ng-chat__status {
    min-height: 18px;
    font-size: 11px;
    color: var(--ng-chat-muted);
    margin: 6px 0 2px;
}

.ng-chat__composer {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.ng-chat__composer input {
    flex: 1;
    border: 1px solid var(--ng-chat-border);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 13px;
    margin: 0;
}

.ng-chat__composer button {
    border: 0;
    border-radius: 8px;
    padding: 9px 12px;
    color: #fff;
    background: var(--ng-chat-primary);
    font-weight: 600;
}

.ng-chat__empty {
    color: var(--ng-chat-muted);
    text-align: center;
    padding: 35px 8px;
    font-size: 12px;
}

@keyframes ng-chat-pulse {
    0% {
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(219, 47, 79, 0.35);
    }
    70% {
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25), 0 0 0 11px rgba(219, 47, 79, 0);
    }
    100% {
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(219, 47, 79, 0);
    }
}

@media (max-width: 768px) {
    .ng-chat {
        right: 10px;
        bottom: 10px;
        width: min(92vw, 370px);
    }

    .ng-chat__conversation {
        min-height: 235px;
        max-height: 235px;
    }
}
