/* Chat — Phase 2B */

.chat-page {
    max-width: 900px;
    margin: 1.5rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chat-page h1 {
    color: var(--fuse-blue);
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.chat-start textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--grey-300);
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.chat-start textarea:focus {
    outline: 2px solid var(--fuse-blue);
    outline-offset: 1px;
}

.chat-start button {
    margin-top: 0.75rem;
}

.conversation-list {
    list-style: none;
    padding: 0;
}

.conversation-list li {
    padding: 0.75rem;
    border-bottom: 1px solid var(--grey-300);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-list a {
    color: var(--fuse-blue);
    text-decoration: none;
    font-weight: 500;
}

.conversation-list a:hover { text-decoration: underline; }

.conversation-meta {
    color: var(--grey-700);
    font-size: 0.85rem;
}

/* Messages */
.messages {
    margin-bottom: 1.5rem;
    min-height: 200px;
}

.message {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    line-height: 1.55;
}

.message-user {
    background: var(--fuse-light);
    margin-left: 4rem;
}

.message-assistant {
    background: var(--grey-100);
    margin-right: 4rem;
}

.message-streaming .message-content::after {
    content: "▍";
    color: var(--fuse-blue);
    font-weight: 600;
    animation: blink 1s steps(2) infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

.message-role {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--grey-700);
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.message-content {
    color: var(--grey-900);
    white-space: pre-wrap;
}

.message-sources {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--grey-300);
}

.message-sources summary {
    color: var(--fuse-blue);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.message-sources ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
    font-size: 0.85rem;
    color: var(--grey-700);
}

.message-sources li { margin: 0.25rem 0; }

.message-sources a {
    color: var(--fuse-blue);
}

/* Compose form */
.chat-form {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--grey-300);
}

.chat-form textarea {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--grey-300);
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
}

.chat-form textarea:focus {
    outline: 2px solid var(--fuse-blue);
    outline-offset: 1px;
}

.chat-form button:disabled {
    opacity: 0.5;
    cursor: wait;
}
