#chat-box {
    position: fixed;
    bottom: 150px;
    right: 20px;
    width: 300px;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    border-radius: 10px;
}

#chat-box.collapsed {
    display: none;
}

#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #9a1915;
    color: white;
    padding: 5px 10px;
    border-radius: 10px 10px 0 0;
}

#chat-header h3 {
    margin: 0;
    font-size: 1em;
}

#toggle-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
}

#chat-messages {
    height: 200px;
    overflow-y: scroll;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    flex-grow: 1;
}

.chat-message {
    margin: 5px 0;
    padding: 10px;
    border-radius: 10px;
    max-width: 70%;
    word-wrap: break-word;
    position: relative;
}

.chat-message.user {
    background-color: #e0ffe0;
    align-self: flex-start;
    margin-right: auto;
}

.chat-message.admin {
    background-color: #e0e0ff;
    align-self: flex-end;
    margin-left: auto;
}

#chat-input {
    width: 93%;
    height: 50px;
    margin-bottom: 10px;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #ccc;
}

#send-chat {
    width: 100%;
    background-color: #9a1915;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 10px;
    font-size: 1em;
}

#send-chat:hover {
    background-color: #9a1915;
}

#open-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #9a1915;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.5em;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}


/* Stage 2 chat refinement */
#chat-box,
#chat-header,
.chat-message,
#chat-input,
#send-chat,
#open-chat {
    border-radius: 0 !important;
}

#chat-box {
    border: 1px solid var(--pv-line, #d8d8d8);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

#open-chat {
    width: 58px;
    height: 48px;
    font-size: 1rem;
}

#send-chat:hover,
#open-chat:hover {
    background-color: var(--pv-red-dark, #6b1514);
}

@media (max-width: 430px) {
    #chat-box {
        left: 12px;
        right: 12px;
        bottom: 84px;
        width: auto;
    }

    #open-chat {
        right: 12px;
        bottom: 12px;
    }
}
