/* Mic toggle: same row as Clear History, inside chat footer */
.chat-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

#chatContainer #startButton {
    position: static !important;
    bottom: auto !important;
    right: auto !important;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: red;
    border: none;
    cursor: pointer;
    z-index: auto;
}

#chatContainer #clearHistory {
    position: static !important;
    bottom: auto !important;
    right: auto !important;
    color: #666;
    font-size: 12px;
    text-decoration: underline;
    z-index: auto;
    white-space: nowrap;
}

#chatContainer {
    position: fixed;
    bottom: 80px;
    right: 40px;
    width: 300px;
    height: 500px;
    background: #ececec;
    color: #1f2933;
    border: 1px solid #b8c8cf;
    border-radius: 15px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    z-index: 1000;
}

#chatContainer[style*="display: block"],
#chatContainer[style*="display:block"] {
    display: flex !important;
    flex-direction: column !important;
}

.chat-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chat-footer {
    flex-shrink: 0;
    padding: 6px 10px 8px;
    text-align: right;
    border-top: 1px solid #e8e8e8;
    background: #f9f9f9;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

#chatTitle {
    background: #d9e9ec;
    color: #0f1f2e;
    padding: 10px 15px;
    border-bottom: 1px solid #c3d2d8;
    font-weight: bold;
    position: relative;
    flex-shrink: 0;
    z-index: 1002;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

#closeButton {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #5c6770;
    padding: 5px;
    z-index: 10050;
}

#chatContent {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 10px;
    background: #ececec;
    color: #2b333b;
}

#chatContent .chat-message:last-child {
    margin-bottom: 20px;
}

#chatContent::-webkit-scrollbar {
    width: 8px;
}

#chatContent::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

#chatContent::-webkit-scrollbar-track {
    background: transparent;
}

.chat-message {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 15px;
    max-width: 85%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    color: #2a3138;
}

.user-message {
    background-color: #d8f1c4;
    color: #254027;
    margin-left: auto;
    text-align: right;
    border-bottom-right-radius: 5px;
}

.agent-message {
    background-color: #dedede;
    color: #2a3138;
    margin-right: auto;
    text-align: left;
    border-bottom-left-radius: 5px;
}

.login-feedback {
    font-size: .92rem;
}
