:root {
    --bg-main: #ffffff;
    --bg-sidebar: #f3f4f6;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #e5e7eb;
    --bg-popover: #ffffff;
    --bg-overlay: rgba(249, 250, 251, 0.7);
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --accent-primary: #009c3bd6;
    --accent-secondary: #ffe001;
    --border-color: #e5e7eb;
    --shadow-color: rgba(79, 70, 229, 0.1);
    --bubble-user-bg: var(--accent-primary);
    --bubble-user-text: #ffffff;
    --danger-color: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --chat-form-wrapper: #f0f0f0;
}

html.dark {
    --bg-main: #262525;
    --bg-sidebar: #181818;
    --bg-secondary: #1c1c1c;
    --bg-tertiary: #242424;
    --bg-popover: #1c1c1c;
    --bg-overlay: rgba(18, 18, 18, 0.7);
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-tertiary: #737373;
    --accent-primary: #009c3b4d;
    --accent-secondary: #ffe001;
    --border-color: #2a2a2a26;
    --shadow-color: rgba(129, 140, 248, 0.1);
    --bubble-user-bg: var(--accent-primary);
    --bubble-user-text: #121212;
    --danger-color: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    --chat-form-wrapper: #303030;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", "Roboto", "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    height: var(--app-height, 100vh);
    overflow: hidden;
}

.font-logo {
    font-family: "Exo 2", sans-serif;
}

#chat-form-wrapper {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}
#chat-form-wrapper:focus-within {
    box-shadow: 0 0 0 3px var(--shadow-color);
    border-color: var(--accent-primary);
}

.message-bubble-ai {
    border-radius: 1.25rem 1.25rem 1.25rem 0.5rem;
}
.message-bubble-user {
    background: var(--bubble-user-bg);
    color: var(--bubble-user-text);
    border-radius: 1.25rem 1.25rem 0.5rem 1.25rem;
}

.message-enter {
    animation: message-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.typing-dots {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bg-secondary);
    border-radius: 1.25rem 1.25rem 1.25rem 0.5rem;
}
.typing-dots .dot {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background-color: var(--text-tertiary);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}
.typing-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}
.typing-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}
@keyframes typing-bounce {
    0%,
    80%,
    100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.limit-banner {
    background-color: var(--danger-bg);
    color: var(--danger-color);
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.prose {
    line-height: 1.6;
}
.prose h1,
.prose h2,
.prose h3 {
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    line-height: 1.2;
    font-weight: 600;
    color: var(--text-primary);
}
.prose h1 {
    font-size: 1.8em;
}
.prose h2 {
    font-size: 1.4em;
}
.prose h3 {
    font-size: 1.2em;
}
.prose p {
    margin-top: 0;
    margin-bottom: 1em;
}
.prose ul,
.prose ol {
    margin-top: 0.5em;
    margin-bottom: 1em;
    padding-left: 1.5em;
}
.prose li {
    margin-bottom: 0.4em;
}
.prose li::marker {
    color: var(--text-secondary);
}
.prose strong {
    font-weight: 600;
    color: var(--text-primary);
}
.prose a {
    color: var(--accent-primary);
    text-decoration: none;
}
.prose a:hover {
    text-decoration: underline;
}
.prose code {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    border-radius: 6px;
}
.prose pre {
    margin-top: 1em;
    margin-bottom: 1em;
}
.prose pre code {
    padding: 0;
    background-color: transparent;
    color: inherit;
}
html.dark .prose a {
    color: var(--accent-secondary);
}

.image-placeholder {
    padding: 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
}
.progress-bar-container {
    width: 100%;
    background-color: var(--bg-tertiary);
    border-radius: 9999px;
    height: 8px;
    margin-top: 0.75rem;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--accent-primary);
    border-radius: 9999px;
    transition: width 0.3s ease;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}
.generated-image-container {
    margin-top: 0.75rem;
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    line-height: 0;
}
.interrupted-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ff4d4f;
    font-weight: 500;
    margin-top: 8px;
}