body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #1a1d21; /* Dark background */
    color: #e0e0e0; /* Light text */
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align container to top */
    min-height: 100vh;
    padding-top: 20px; /* Add some space at the top */
}

.container {
    width: 100%;
    max-width: 700px; /* Limit width */
    background-color: #282c34; /* Slightly lighter dark */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
}

header h1 {
    margin: 0 0 5px 0;
    color: #61dafb; /* React-like blue */
}

header h2 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 400;
    color: #aaa;
}

.chat-window {
    height: 60vh; /* Fixed height for chat */
    overflow-y: auto; /* Enable scrolling */
    border: 1px solid #444;
    border-radius: 5px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #1e1f22; /* Darker chat background */
    display: flex; /* Needed for scroll behavior */
    flex-direction: column; /* Stack messages */
}

#message-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1; /* Allow list to grow */
}

.message {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 15px; /* Bubble effect */
    max-width: 80%;
    word-wrap: break-word; /* Prevent long words from overflowing */
    line-height: 1.4;
}

.user-message {
    background-color: #007bff; /* Blue for user */
    color: white;
    align-self: flex-end; /* Align user messages to right */
    border-bottom-right-radius: 4px; /* Flatten one corner */
    margin-left: auto; /* Push to right */
}

.agent-message {
    background-color: #495057; /* Gray for agent */
    color: white;
    align-self: flex-start; /* Align agent messages to left */
    border-bottom-left-radius: 4px; /* Flatten one corner */
    margin-right: auto; /* Push to left */
}

.agent-message strong, .user-message strong {
    display: block;
    font-size: 0.8em;
    margin-bottom: 4px;
    opacity: 0.8;
}

.chat-input-area {
    display: flex;
    margin-top: 10px; /* Space above input */
}

#message-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 4px 0 0 4px; /* Combine with button */
    background-color: #333;
    color: #eee;
    font-size: 1em;
    outline: none; /* Remove default outline */
}
#message-input:focus {
     border-color: #007bff;
}


#send-button {
    padding: 10px 15px;
    border: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    border-radius: 0 4px 4px 0; /* Combine with input */
    font-size: 1em;
    transition: background-color 0.2s ease;
}

#send-button:hover {
    background-color: #0056b3;
}

#send-button:disabled {
    background-color: #555;
    cursor: not-allowed;
}
#message-input:disabled {
     background-color: #444;
}

.loading, .error-message {
    text-align: center;
    padding: 8px;
    margin-top: 10px;
    font-style: italic;
    border-radius: 4px;
}

.loading {
    color: #aaa;
}

.error-message {
    color: #ff6b6b; /* Red for errors */
    background-color: #4d2020;
    border: 1px solid #7a3b3b;
    font-style: normal;
    font-weight: bold;
}

footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85em;
    color: #777;
    border-top: 1px solid #444;
    padding-top: 15px;
}