.chat-main {
    padding: 8px 8px 8px 0;
}

/* Обновляем стили для Card-based элемента */
.chat-item.card {
    /* Сбрасываем дефолтный фон bootstrap, если нужно,
       или задаем свой базовый темный фон */
    background-color: #060606;
    border: 1px solid #003300; /* Твоя зеленая рамка */
    border-radius: 8px;

    /* Важно для работы z-index при ховере */
    position: relative;
    z-index: 1;
    overflow: visible; /* Чтобы dropdown вылезал за пределы */
    transition: transform 0.15s ease, box-shadow 0.15s ease, z-index 0s;
    --chat-accent: #22c55e;
}

/* Убираем рамку внутри, если она есть у list-group */
.chat-item .card-body {
    padding: 0.5rem 0.75rem; /* Компактные отступы внутри карточки */
}

/* При наведении */
.chat-item.card:hover,
.chat-item.card:focus-within {
    z-index: 1000;
    border-color: var(--chat-accent); /* Подсветка рамки */
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.15);
}

.chat-name {
    color: var(--chat-accent);
}

.name-row i {
    color: var(--chat-accent);
}

.chat-item .fs-4 {
    color: var(--chat-accent);
}

.chat-last {
    font-size: 12px;
    color: var(--chat-accent);
    /* Эти 3 свойства создают троеточие */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    max-width: 100%;
    display: block;
}

.chat-meta {
    min-width: 48px;
}

.chat-actions-btn {
    background: transparent !important;
    border: none !important;
    color: #00ff00 !important; /* Зеленый цвет */
    font-size: 1.5rem;
    line-height: 1;
    padding: 0 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.chat-actions-btn:hover, .chat-actions-btn.show {
    opacity: 1;
    color: #fff !important;
}

/* Убираем стандартную стрелочку (треугольник) Bootstrap */
.chat-actions-btn.dropdown-toggle::after {
    display: none !important;
}

/* Пин (закреп) для карточки */
.chat-pinned.card {
    border-left: 3px solid var(--chat-accent);
    background: rgba(25, 135, 84, 0.05); /* Легкий фон */
}


.chat-has-bg.card {
    background: transparent !important;
}

.chat-has-bg.card::before {
    border-radius: 8px;
    content: "";
    position: absolute;
    inset: 0;

    background-image: var(--chat-bg-url);
    background-size: cover;
    background-position: center;

    filter: saturate(1.2) contrast(1.1);

    /* стекло */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* затемнение */
    background-color: rgb(67 65 65 / 55%);
    background-blend-mode: overlay;

    z-index: -1;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    /* ... остальные твои стили backdrop-filter ... */
}

.chat-has-bg.card .chat-name,
.chat-has-bg.card .chat-last-author,
.chat-has-bg.card .chat-last {
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* Добавляем утилиту для сжатия flex-блоков (обязательно!) */
.min-w-0 {
    min-width: 0 !important;
}

.chat-bg-processing {
    /*filter: blur(2px);*/
    position: relative;
}

.chat-bg-processing::after {
    content: "Обработка…";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {
    .chat-main {
        padding: 3px 3px 3px 0;
    !important;
    }
}

/* ===== АНИМАЦИИ ФОНОВ ЧАТОВ ===== */

/* Пульсация (как в cyberpunk-pulse) */
.chat-animated-pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 35%,
        rgba(255, 0, 128, 0.3),
        transparent 70%);
    mix-blend-mode: screen;
    animation: chat-pulse-glow 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes chat-pulse-glow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Мерцающие частицы */
.chat-animated-particles::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(0, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(0, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 80% 20%, rgba(255, 0, 255, 0.7), transparent);
    background-size: 200px 200px;
    animation: chat-particles-float 8s linear infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes chat-particles-float {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 200px 100px, -200px 150px, 150px -200px; }
}

/* Аврора (северное сияние) */
.chat-animated-aurora::after {
    content: "";
    position: absolute;
    inset: -20%;
    background: linear-gradient(45deg,
        rgba(0, 255, 128, 0.15),
        rgba(0, 200, 255, 0.15),
        rgba(128, 0, 255, 0.15));
    mix-blend-mode: screen;
    filter: blur(20px);
    animation: chat-aurora-wave 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes chat-aurora-wave {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(5%, 5%) rotate(2deg); }
}

/* Матрица (дождь из символов) */
.chat-animated-matrix::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg,
        rgba(0, 255, 0, 0.03) 0px,
        rgba(0, 255, 0, 0.03) 2px,
        transparent 2px,
        transparent 20px);
    animation: chat-matrix-rain 0.5s linear infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes chat-matrix-rain {
    0% { background-position: 0 0; }
    100% { background-position: 0 20px; }
}

/* Волны (ocean) */
.chat-animated-waves::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        transparent 60%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0.05));
    background-size: 100% 200%;
    animation: chat-waves-move 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes chat-waves-move {
    0%, 100% { background-position: 0 0; }
    50% { background-position: 0 20%; }
}

/* Геометрия (вращающиеся фигуры) */
.chat-animated-geometric::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(45deg, transparent 48%, rgba(255,255,255,0.1) 48%, rgba(255,255,255,0.1) 52%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(255,255,255,0.1) 48%, rgba(255,255,255,0.1) 52%, transparent 52%);
    background-size: 60px 60px;
    animation: chat-geo-spin 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes chat-geo-spin {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 60px 60px, -60px -60px; }
}

/* Убираем анимации при reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .chat-animated-pulse::after,
    .chat-animated-particles::before,
    .chat-animated-aurora::after,
    .chat-animated-matrix::after,
    .chat-animated-waves::after,
    .chat-animated-geometric::after {
        animation: none;
    }
}