.chat-button {
    position: fixed;
    left: 40vw;
    top: 3vw;
    display: block;
    width: 15vw;
    height: 15vw;
    background-image: url("../img/chat_button.svg");
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    overflow: visible;
    /* важно для дочерних элементов */
}

/* 🔴 Красная точка — реальный элемент внутри кнопки */
.chat-button .unread-badge {
    position: absolute;
    bottom: 7px;
    /* ← было top: -4px */
    right: 4px;
    width: 10px;
    height: 10px;
    background: red;
    border-radius: 50%;
    border: 2px solid white;
    z-index: 1;
    pointer-events: none;
}

.chat {
    position: fixed;
    top: 0;
    left: 0;
    display: block;
    width: 96%;
    height: 98%;
    padding: 2%;
    background-color: rgb(255, 255, 255);
    z-index: 100;
    overflow-x: hidden;
    overflow-y: scroll;
}

.chat .content {
    display: block;
    width: 100%;
    height: auto;
    transition: padding-bottom 0.3s ease;
}

.chat .close-button {
    position: fixed;
    top: 3vw;
    right: 3vw;
    width: 7vw;
    height: 7vw;
    cursor: pointer;
    z-index: 9990;
    background-image: url("/img/close.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.contacts-bar {
    display: flex;
    overflow-x: auto;
    padding: 10px 0;
    gap: 12px;
    border-bottom: 1px solid #eee;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.contacts-bar::-webkit-scrollbar {
    display: none;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
    cursor: pointer;
    position: relative;
}

.contact-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 4px;
}

.contact-name {
    font-size: 12px;
    text-align: center;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-wrap {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.unread-dot {
    width: 8px;
    height: 8px;
    background: red;
    border-radius: 50%;
    margin-bottom: 2px;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
}

/* Chat area */
.chat-area {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: calc(100% - 140px);
}

.message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.message.theirs {
    flex-direction: row;
}

.message.mine {
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.msg-bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    word-break: break-word;
}

.message.theirs .msg-bubble {
    background: #f1f1f1;
    border-top-left-radius: 0;
}

.message.mine .msg-bubble {
    background: #4CAF50;
    color: white;
    border-top-right-radius: 0;
}

/* Input area */
.input-area {
    display: flex;
    padding: 8px;
    gap: 8px;
    border-top: 1px solid #eee;
    background: white;
}

.input-area input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
}

.input-area button {
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}