#live_chat {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
}
.chatbox {
    display: flex;
    flex-direction: column;
    position: relative;
    gap: 8px;
    width: 100%;
    max-width: none;
    padding: 8px 16px 16px;
    box-sizing: border-box;
    background: #f5f5f5;
    border-radius: 10px;
    border: 1px solid black;
}
@media (max-width: 640px) {
    #live_chat {
        right: 10px;
        bottom: 10px;
        left: 10px;
    }

    .chatbox {
        max-width: none;
    }
}
.messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 30vh;
    overflow-y: auto;
}
.message {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.message.them {
    align-self: flex-start;
    background: #e0e0e0;
    color: #222;
    border-bottom-left-radius: 4px;
}

.message.me {
    align-self: flex-end;
    background: #007aff;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.chat-input textarea {
    flex: 1;
    resize: none;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 18px;
    font: inherit;
    box-sizing: border-box;
}

.chat-input button {
    align-self: flex-end;
    padding: 8px 14px;
    border: none;
    border-radius: 16px;
    background: #023873;
    color: white;
    cursor: pointer;
}

.chat-header {
    display: flex;
    justify-content: flex-end;
    height: 30px;
}

.closeChat {
    border: none;
    background: transparent;
    font-size: 32px;
    font-weight: bold;
    line-height: 20px;
    color: #666;
    cursor: pointer;
    padding: 0 4px;
}

.closeChat:hover {
    color: #222;
}

.chat-error {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    text-align: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}
.chat-notice {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    background: black;
    color: white;
    text-align: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

#startChat {
    position: fixed;
    right: 20px;
    bottom: 20px;

    padding: 12px 20px;
    border: none;
    border-radius: 24px;

    background: #007aff;
    color: white;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);

    transition:
            background 0.15s ease,
            transform 0.15s ease,
            box-shadow 0.15s ease;
}

#startChat:hover {
    background: #006fe6;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

#startChat:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}