.attached-media-container {
    display: flex;
    overflow-x: auto;
    max-width: 100%;
    gap: 10px;
}

.attached-media-container img {
    max-width: 50px;
    max-height: 50px;
    border-radius: 10px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    border-radius: 50%;
    padding: 2px 5px;
}

.chat-input-container {
    /* Включаем Grid и задаём 2 строки:
       1) для блока с прикреплёнными файлами (auto),
       2) для кнопок и textarea (auto) */
    display: grid;
    grid-template-columns: 40px 1fr 40px; /* 3 колонки: левая кнопка, текст, правая кнопка */
    grid-template-rows: auto auto;       /* 2 строки: сверху превью, снизу поле ввода */
    gap: 10px;                           /* Отступы между ячейками */
    align-items: center;                 /* Выравнивание по вертикали */
    padding: 10px;
    background: var(--card);
    /* border-top: 1px solid #1C1C1C; */
    border-radius: 20px; /* При желании можно скруглить общий контейнер */
}
.chat-input-container.drag-over {
  border: 2px dashed #888;
  background-color: rgba(100,100,100,0.1);
}


/* 1) Превью прикреплённых файлов (первая строка, во всю ширину) */
.attached-media-container {
    grid-column: 1 / 4; /* занимает все три колонки */
    grid-row: 1 / 2;    /* первая строка */
    display: flex;
    flex-direction: row;
    overflow-x: auto;   /* Горизонтальная прокрутка, если фото много */
    max-width: 100%;

}

/* Стили превью внутри attached-media-container */
.attached-media-container > div {
    position: relative;
    margin-right: 8px;
    margin-top: 5px;
}
.attached-media-container img,
.attached-media-container video {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}
/* Кнопка удаления (крестик) - абсолютное позиционирование */
.attached-media-container button {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 15px;
    height: 15px;
    border: none;
    border-radius: 50%;
    background: #cfcfcfe2;
    color: #000000;
    cursor: pointer;
    font-size: 15px;
    line-height: 10px;
    text-align: center;
    padding: 0;
}

/* 3) Поле ввода (вторая строка, второй столбец) */
#message-input {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    resize: none;
    overflow: hidden; /* или auto, если хотите внутренний скролл */
    padding: 10px 15px;
    border: none;
    outline: none;
    border-radius: 15px;
    background: var(--white);
    color: #000000;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    min-height: 26px;
    max-height: 120px;
    white-space: pre-wrap;
    word-wrap: break-word;
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-y: auto;
}

/* Скрываем скроллбар у textarea (по желанию) */
#message-input::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    #message-input {
        border-radius: 15px;
    }

    .chat-input-container {
        border-radius: 15px;
        padding-top: 3px;
        grid-template-columns: 35px 73%;
    }
}