
/* ── Кнопка відкриття ── */
#chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #ff6600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 9999;
    transition: transform .2s, background .2s;
    user-select: none;
}
#chat-toggle:hover { background: #e55a00; transform: scale(1.08); }

/* ── Вікно чату ── */
#chat-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 340px;
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    transition: opacity .2s, transform .2s;
}
#chat-window.chat-hidden {
    display: none;
}

/* ── Шапка ── */
.chat-header {
    background: #ff6600;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
}
.chat-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.chat-header button:hover { opacity: .75; }

/* ── Область повідомлень ── */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8f8f8;
}

/* ── Бульбашки ── */
.chat-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}
.chat-msg--user {
    align-self: flex-end;
    background: #ff6600;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg--assistant {
    align-self: flex-start;
    background: #fff;
    color: #222;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}
.chat-typing {
    color: #aaa;
    font-size: 18px;
    letter-spacing: 4px;
    padding: 6px 13px;
}

/* ── Поле вводу ── */
.chat-input {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    background: #fff;
}
.chat-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
.chat-input input:focus { border-color: #ff6600; }
.chat-input button {
    background: #ff6600;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.chat-input button:hover    { background: #e55a00; }
.chat-input button:disabled { background: #ccc; cursor: default; }

/* ── Мобільна адаптація ── */
@media (max-width: 400px) {
    #chat-window { width: calc(100vw - 24px); right: 12px; bottom: 80px; }
}