.chat-app {
    width: 100%;
    max-width: 800px;
    height: 75vh;
    margin: 0 auto;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    background: var(--color-section-bg);
}

.chat-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.chat-subtitle {
    font-size: 13px;
    color: #86868b;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-brand-teal);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-bubble {
    background: var(--color-section-bg);
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    font-size: 15px;
    max-width: 80%;
    line-height: 1.5;
    border: 1px solid var(--color-border);
}

.chat-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: #86868b;
    font-size: 14px;
}

.chat-loading.active {
    display: flex;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--color-brand-teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

:root[saved-theme="dark"] .spinner {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-brand-teal);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.chat-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.chat-form {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 24px;
    border: 1px solid var(--color-border);
    background: var(--color-section-bg);
    font-family: var(--font-text);
    color: var(--color-text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--color-brand-teal);
}

.chat-submit {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-brand-teal);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-submit:hover {
    background: var(--color-link-blue);
}

.chat-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-disclaimer {
    text-align: center;
    font-size: 12px;
    color: #86868b;
    margin-top: 12px;
}

/* Scrollbar Style */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

:root[saved-theme="dark"] .chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}