body {
    font-family: Arial, sans-serif;
    background: #f5f7fa;
    display: flex;
    justify-content: center;
    padding-top: 40px;
}

.chat-container {
    width: 600px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.chat-window {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #fefefe;
    transition: max-height 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* User and Assistant message formatting */
.user,
.assistant {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 16px;
    font-size: 0.95em;
    line-height: 1.4;
    white-space: pre-wrap;
}

.user {
    background-color: #d0e7ff;
    align-self: flex-end;
    border-bottom-right-radius: 0;
    margin-left: auto;
    color: #000;
    font-weight: bold;
}

.assistant {
    background-color: #e3ffe4;
    align-self: flex-start;
    border-bottom-left-radius: 0;
    margin-right: auto;
    color: #000;
    font-style: italic;
    font-size: 0.95em;
    max-width: 80%;
    padding: 0px 0px;         /* ↓ tighter padding */
    border-radius: 12px;
    line-height: 1.25;         /* ↓ tighter line spacing */
    white-space: pre-wrap;
}

/* Tighten paragraph spacing */
.assistant p {
    margin: 0;
    padding: 0;
}

/* Input styling */
input[type="text"] {
    width: 80%;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

/* Header styling */
.chat-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.chat-logo {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 4px;
}

.chat-header h1 {
    margin-top: -2px;
}

.chat-intro {
    font-size: 0.8em;
    font-weight: bold;
    color: #333;
    line-height: 1.3;
    margin: 0;
    max-width: 600px;
}

/* Forces phrase to stay together on wide screens */
.no-break {
    white-space: nowrap;
}

/* Responsive override for narrow screens */
@media (max-width: 500px) {
    .no-break {
        white-space: normal;
    }

    .chat-container {
        width: 90%;
    }
}

/* Blog link styling */
.chat-window a {
    color: #0066cc;
    text-decoration: underline;
}

.chat-window a:hover {
    color: #004499;
}

.blog-search {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
}

.blog-search h2 {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
}

.blog-search input[type="text"] {
    width: 70%;
    padding: 10px;
    margin-right: 10px;
}

.blog-output {
    margin-top: 15px;
    background: #f8f8f8;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.blog-output ul {
    margin-top: 10px;
    padding-left: 20px;
}

.blog-output li {
    margin-bottom: 5px;
}

.error {
    color: red;
    font-weight: bold;
}
