/* ═══════════════════════════════════════════════════════════
   OMNISCIENT — Chat UI
   ═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    --bg-color: #050505;
    --sidebar-bg: rgba(10, 10, 10, 0.75);
    --border-color: rgba(255, 255, 255, 0.06);
    --text-primary: #ededed;
    --text-secondary: #777;
    --gold: #d4af37;
    --gold-dim: rgba(212, 175, 55, 0.12);
    --gold-hover: rgba(212, 175, 55, 0.2);
    --gold-glow: rgba(212, 175, 55, 0.3);
    --input-bg: rgba(14, 14, 14, 0.85);
    --hover-bg: rgba(255, 255, 255, 0.04);
    --bubble-ai-bg: rgba(212, 175, 55, 0.02);
    --glass-bg: rgba(12, 12, 12, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur: 16px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Base ── */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Ambient Background ── */
.ambient-bg {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    background:
        radial-gradient(ellipse 600px 600px at 30% 30%, rgba(212, 175, 55, 0.055) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 70% 70%, rgba(212, 175, 55, 0.035) 0%, transparent 70%);
}

/* ── Selection & Scrollbar ── */
::selection {
    background: rgba(212, 175, 55, 0.3);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.25);
}

/* ── Focus ── */
*:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.4);
    outline-offset: 2px;
}

/* ── Typography ── */
h1,
h2,
h3,
.welcome-title {
    font-family: 'Playfair Display', serif;
}

/* ── App Layout ── */
#app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    position: relative;
    z-index: 1;
}

/* ═══ Login Screen ═══ */

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.login-box {
    text-align: center;
    width: 320px;
    padding: 2.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.6s ease;
}

.login-box h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
    margin-bottom: 0.5rem;
}

.login-box p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.login-box input:focus {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.1);
    outline: none;
}

.btn {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-base);
}

.btn:hover {
    background: #e6c55c;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.96);
    box-shadow: none;
}

.error-msg {
    color: #f85149;
    font-size: 0.85rem;
    margin-top: 0.75rem;
    text-align: center;
}

/* ═══ Sidebar ═══ */

#sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: none;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    position: relative;
}

#sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(212, 175, 55, 0.12) 30%, rgba(212, 175, 55, 0.12) 70%, transparent);
    pointer-events: none;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo .icon {
    color: var(--gold);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gold-dim);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.15);
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    opacity: 0.9;
}

.sidebar-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    color: var(--text-primary);
    padding: 0.7rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.sidebar-btn:hover {
    background: var(--hover-bg);
    border-left-color: rgba(212, 175, 55, 0.25);
    padding-left: 1.15rem;
}

.sidebar-btn.active {
    background: var(--gold-dim);
    border-left-color: var(--gold);
    color: var(--gold);
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 1rem 0 0;
    border-top: 1px solid var(--border-color);
}

/* ═══ Main Content ═══ */

#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* ═══ Chat Container ═══ */

#chat-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    overscroll-behavior-y: contain;
}

/* ═══ Welcome Screen ═══ */

#welcome-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 800px;
    margin: auto;
    text-align: center;
    animation: fadeIn 0.8s ease;
}

#welcome-screen.visible {
    display: flex;
}

.welcome-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold-dim) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.12), 0 0 60px rgba(212, 175, 55, 0.04);
}

.welcome-icon svg {
    filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.3));
}

.welcome-icon::after {
    content: '';
    position: absolute;
    inset: -24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    background: linear-gradient(120deg,
            #c4993a 0%,
            #f0d97a 20%,
            #d4af37 40%,
            #f5e6a3 60%,
            #d4af37 80%,
            #c4993a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 500px;
    line-height: 1.6;
    letter-spacing: 0.2px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

.suggestion-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: left;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
}

.suggestion-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(212, 175, 55, 0.15);
    transform: translateY(-2px);
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ═══ Messages ═══ */

#messages-area {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 2rem;
}

.message {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    animation: messageSpring 0.4s ease both;
    line-height: 1.7;
    min-width: 0;
}

.message.user {
    background: linear-gradient(135deg, #1c1c1c 0%, #151515 100%);
    align-self: flex-end;
    max-width: 80%;
    border-radius: 18px 18px 4px 18px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.message.ai {
    background: var(--bubble-ai-bg);
    align-self: flex-start;
    width: 100%;
    border-left: 2px solid rgba(212, 175, 55, 0.12);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Avatar ── */
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: box-shadow var(--transition-base);
}

.user .avatar {
    display: none;
}

.ai .avatar {
    background: var(--gold-dim);
    color: var(--gold);
    font-size: 1.2rem;
}

.message.ai:has(.typing-indicator) .avatar {
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

/* ── Message Content ── */
.message-content {
    flex: 1;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

/* ═══ Markdown Styling ═══ */

.markdown-body {
    line-height: 1.7;
}

.markdown-body p {
    margin-bottom: 0.75rem;
}

.markdown-body p:last-child {
    margin-bottom: 0;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.markdown-body li {
    margin-bottom: 0.3rem;
}

.markdown-body pre {
    background: #000;
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid rgba(212, 175, 55, 0.08);
}

.markdown-body code {
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.07);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-family: 'Playfair Display', serif;
    background: linear-gradient(135deg, var(--gold), #f0d97a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.markdown-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.markdown-body a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    transition: border-color var(--transition-fast);
}

.markdown-body a:hover {
    border-bottom-color: var(--gold);
}

.markdown-body blockquote {
    border-left: 3px solid rgba(212, 175, 55, 0.25);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: rgba(212, 175, 55, 0.03);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.markdown-body hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(212, 175, 55, 0.2), transparent);
    margin: 2rem 0;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.markdown-body th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid rgba(212, 175, 55, 0.15);
    color: var(--gold);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.markdown-body td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.markdown-body tr:hover td {
    background: var(--hover-bg);
}

/* ═══ Code Block Wrapper ═══ */

.code-block-wrapper {
    border: 1px solid rgba(212, 175, 55, 0.08);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 1rem 0;
}

.code-block-wrapper pre {
    margin: 0;
    border: none;
    border-radius: 0;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.7rem;
}

.code-block-header .language-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
}

.code-block-header .copy-code-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.65rem;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
    letter-spacing: 0.3px;
}

.code-block-header .copy-code-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: rgba(212, 175, 55, 0.2);
}

/* ═══ Agent Details (Thought Process & Tools) ═══ */

.agent-details {
    margin-bottom: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.agent-details summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
}

.agent-details summary:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.agent-details[open] summary {
    border-bottom: 1px solid var(--glass-border);
}

.agent-details-content {
    padding: 1rem;
    font-size: 0.9rem;
    color: #a0a0a0;
}

.tool-call {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.tool-call:last-child {
    margin-bottom: 0;
}

.tool-call-header strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gold);
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}

.tool-call-args pre {
    margin: 0 0 0.5rem;
    padding: 0;
    background: transparent;
    border: none;
}

.tool-call-response summary {
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    user-select: none;
    display: inline-flex;
    align-items: center;
    transition: color var(--transition-fast);
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
}

.tool-call-response summary:hover {
    color: var(--text-primary);
}

.tool-call-response pre {
    margin: 0.5rem 0 0;
    padding: 0;
    background: transparent;
    border: none;
    max-height: 300px;
    overflow-y: auto;
}

.tool-call-loading {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.35rem 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.04) 50%, transparent 100%);
    background-size: 200% 100%;
}

.tool-call code {
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.8rem;
    color: #888;
}

/* ═══ Input Area ═══ */

.input-container {
    padding: 0 2rem 2rem;
    background: linear-gradient(0deg, var(--bg-color) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#chat-form {
    width: 100%;
    max-width: 800px;
    position: relative;
}

.input-wrapper {
    background: var(--input-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.input-wrapper:focus-within {
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.08),
        0 0 20px rgba(212, 175, 55, 0.06),
        0 4px 30px rgba(0, 0, 0, 0.5);
}

#message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    padding: 0.5rem;
    max-height: 200px;
    outline: none;
    line-height: 1.5;
}

#message-input::placeholder {
    color: var(--text-secondary);
}

#send-btn {
    background: var(--gold);
    color: #000;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
    margin-bottom: 0.25rem;
}

#send-btn:hover:not(:disabled) {
    background: #e6c55c;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

#send-btn:active:not(:disabled) {
    transform: scale(0.92);
    box-shadow: none;
}

#send-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: #444;
    cursor: not-allowed;
}

.feature-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
    margin-bottom: 0.25rem;
}

.feature-btn:hover {
    color: var(--gold);
    background: var(--gold-dim);
}

/* ═══ Image / File Previews ═══ */

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 8px;
    width: 100%;
}

.image-preview-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.image-preview-item:hover {
    border-color: rgba(212, 175, 55, 0.25);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.1);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: background var(--transition-fast);
}

.image-preview-item .remove-btn:hover {
    background: #f85149;
}

.message-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.text-file-preview {
    width: auto;
    padding: 0 16px 0 12px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    height: 36px;
    border: 1px solid var(--glass-border);
    position: relative;
}

.file-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.file-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-file-preview .remove-btn {
    top: -6px;
    right: -6px;
}

/* ═══ Misc ═══ */

.disclaimer {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    text-align: center;
    opacity: 0.5;
}

.notice-banner {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gold);
    background: rgba(212, 175, 55, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    animation: fadeIn 0.4s ease;
}

/* ═══ Typing Indicator ═══ */

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    opacity: 0.6;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

/* ═══ Sidebar Session Wrapper ═══ */

.sidebar-session-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 4px;
}

.sidebar-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.sidebar-delete-btn:hover {
    opacity: 1;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.sidebar-session-wrapper .sidebar-btn {
    flex-grow: 1;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   KEYFRAMES
   ═══════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes messageSpring {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }

    50% {
        opacity: 1;
        transform: translateY(-3px);
    }

    75% {
        transform: translateY(1px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ambientDrift {
    0% {
        transform: translate(0%, 0%);
    }

    25% {
        transform: translate(8%, -4%);
    }

    50% {
        transform: translate(-4%, 6%);
    }

    75% {
        transform: translate(-6%, -3%);
    }

    100% {
        transform: translate(3%, 5%);
    }
}

@keyframes sunGlow {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.12), 0 0 60px rgba(212, 175, 55, 0.04);
    }

    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.22), 0 0 80px rgba(212, 175, 55, 0.08);
    }
}

@keyframes sunRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes sunRaysRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    from {
        background-position: 0% center;
    }

    to {
        background-position: 200% center;
    }
}

@keyframes logoGlow {

    0%,
    100% {
        box-shadow: 0 0 6px rgba(212, 175, 55, 0.1);
    }

    50% {
        box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
    }
}

@keyframes avatarPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.2);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(212, 175, 55, 0);
    }
}

@keyframes inputGlow {

    0%,
    100% {
        box-shadow:
            0 0 0 1px rgba(212, 175, 55, 0.08),
            0 0 20px rgba(212, 175, 55, 0.06),
            0 4px 30px rgba(0, 0, 0, 0.5);
    }

    50% {
        box-shadow:
            0 0 0 1px rgba(212, 175, 55, 0.12),
            0 0 28px rgba(212, 175, 55, 0.09),
            0 4px 30px rgba(0, 0, 0, 0.5);
    }
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@keyframes toolShimmer {
    from {
        background-position: -200% 0;
    }

    to {
        background-position: 200% 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .ambient-bg {
        animation: none;
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    #app {
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100%;
    }

    #sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        border-right: none;
        border-bottom: none;
        padding: 0.75rem 1rem;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
    }

    #sidebar::after {
        top: auto;
        left: 0;
        width: 100%;
        height: 1px;
        background: linear-gradient(to right, transparent, rgba(212, 175, 55, 0.12) 30%, rgba(212, 175, 55, 0.12) 70%, transparent);
    }

    .sidebar-header {
        margin-bottom: 0;
    }

    .logo h1 {
        display: none;
    }

    .sidebar-btn {
        width: auto;
        padding: 0.5rem;
        margin: 0;
        border-left: none;
        border-radius: var(--radius-sm);
    }

    .sidebar-btn:hover {
        padding-left: 0.5rem;
    }

    .btn-text {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }

    #main-content {
        flex: 1;
        min-height: 0;
    }

    #chat-container {
        padding: 1rem;
    }

    .welcome-icon {
        width: 60px;
        height: 60px;
        font-size: 2.25rem;
    }

    .welcome-icon::after {
        inset: -16px;
    }

    .welcome-title {
        font-size: 2.25rem;
    }

    .welcome-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .suggestions-grid {
        grid-template-columns: 1fr;
    }

    .message {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .message.user {
        max-width: 90%;
    }

    .message.ai {
        max-width: 100%;
    }

    .input-container {
        padding: 0 1rem 1rem;
        flex-shrink: 0;
        background: var(--bg-color);
    }

    .input-wrapper {
        padding: 0.5rem;
        border-radius: var(--radius-md);
    }

    #message-input {
        padding: 0.25rem 0.5rem;
        font-size: 16px;
    }

    #send-btn {
        width: 32px;
        height: 32px;
    }
}