/* ═══════════════════════════════════════════════════════════════════════════
   OpenQode IDE - Premium Dark Theme
   A stunning, modern interface for AI-powered coding
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   Design Tokens
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    /* Core Colors */
    --bg-deepest: #0a0b0f;
    --bg-deep: #0f1117;
    --bg-primary: #12141a;
    --bg-elevated: #181b24;
    --bg-surface: #1e222d;
    --bg-hover: #252a38;

    /* Accent Colors - Electric Cyan Theme */
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #06b6d4;
    --accent-glow: rgba(0, 212, 255, 0.15);
    --accent-glow-strong: rgba(0, 212, 255, 0.35);

    /* Gradient Presets */
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    --gradient-surface: linear-gradient(135deg, rgba(30, 34, 45, 0.8) 0%, rgba(24, 27, 36, 0.9) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    --gradient-shine: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);

    /* Text Colors */
    --text-primary: #f0f2f5;
    --text-secondary: #a0a8b8;
    --text-muted: #6b7280;
    --text-accent: #00d4ff;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(0, 212, 255, 0.3);
    --border-glow: rgba(0, 212, 255, 0.5);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.2);
    --shadow-glow-strong: 0 0 60px rgba(0, 212, 255, 0.3);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Base Styles
   ═══════════════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deepest);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
.vscode-body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
        var(--bg-deepest);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Main Shell Layout
   ═══════════════════════════════════════════════════════════════════════════ */
.vscode-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Top Bar - Premium Header
   ═══════════════════════════════════════════════════════════════════════════ */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-xl);
    height: 72px;
    background: var(--gradient-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Logo with Glow Effect */
.logo-cell {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.05em;
    color: var(--bg-deepest);
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.logo-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-shine);
    opacity: 0;
    transition: var(--transition-normal);
}

.logo-cell:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow-strong);
}

.logo-cell:hover::before {
    opacity: 1;
}

.top-left strong {
    font-size: 18px;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-left p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Auth Status Pill */
.auth-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.auth-pill span:first-child {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.auth-pill span:last-child {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Preview Button */
.preview-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.preview-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-normal);
}

.preview-pill:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.preview-pill:hover::before {
    opacity: 0.1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Main Grid Layout
   ═══════════════════════════════════════════════════════════════════════════ */
.main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-xl) var(--space-xl);
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Panel Base Styles
   ═══════════════════════════════════════════════════════════════════════════ */
.left-panel,
.center-panel,
.right-panel {
    background: var(--gradient-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    position: relative;
    /* Allow child elements to scroll, but clip any overflow outside */
    overflow: visible;
}

/* Subtle glow effect on panels */
.left-panel::before,
.center-panel::before,
.right-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.3;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Left Panel - Explorer
   ═══════════════════════════════════════════════════════════════════════════ */
.left-panel {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
}

/* Custom Scrollbar */
.left-panel::-webkit-scrollbar {
    width: 6px;
}

.left-panel::-webkit-scrollbar-track {
    background: transparent;
}

.left-panel::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
}

.left-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.section-title span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Session List */
.session-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.session-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.session-pill .session-icon {
    font-size: 14px;
}

.session-pill:hover {
    background: var(--bg-surface);
    border-color: var(--border-default);
}

.session-pill.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-color: var(--border-accent);
    color: var(--text-primary);
    box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.05);
}

/* File Tree */
.file-tree {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    min-height: 200px;
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.file-tree::-webkit-scrollbar {
    width: 6px;
}

.file-tree::-webkit-scrollbar-track {
    background: transparent;
}

.file-tree::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
}

.file-tree::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* File Tree Items - Antigravity Style */
.file-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin: 2px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.file-tree-item:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(124, 58, 237, 0.05) 100%);
    border-color: var(--border-accent);
}

.file-tree-item:active {
    transform: scale(0.98);
}

.file-tree-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.file-tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.file-tree-item:hover .file-tree-name {
    color: var(--text-primary);
}

/* Selected/Attached file */
.file-tree-item.file-attached {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-color: var(--accent-primary);
}

.file-tree-item.file-attached .file-tree-name {
    color: var(--accent-primary);
    font-weight: 600;
}

/* File Tree Placeholder */
.file-tree-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
}

.file-tree-placeholder svg {
    opacity: 0.5;
}

.file-tree-placeholder p {
    font-size: 13px;
    margin: 0;
}

.file-tree .muted {
    color: var(--text-muted);
    font-style: italic;
}

.file-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Auth Section */
.auth-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

/* ═══════════════════════════════════════════════════════════════════════════
    Accessibility features and keyboard navigation
    ═══════════════════════════════════════════════════════════════════════════ */
/* Focus indicators for keyboard navigation */
*:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-primary);
    color: var(--bg-deepest);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-default: #ffffff;
        --border-subtle: #cccccc;
        --text-primary: #000000;
        --text-secondary: #333333;
        --text-muted: #666666;
        --bg-deepest: #ffffff;
        --bg-deep: #f5f5f5;
        --bg-primary: #eeeeee;
        --bg-surface: #e0e0e0;
        --bg-hover: #d0d0d0;
    }

    .message-bubble.user-bubble {
        background: #000000 !important;
        color: #ffffff !important;
    }

    .message-bubble.assistant-bubble {
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #000000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .loader {
        animation: none;
    }

    .thinking-animation {
        animation: none;
    }

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

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focusable but visually hidden */
.focusable-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focusable-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Accessible file tree navigation */
.file-tree:focus-within {
    border-color: var(--accent-primary);
}

.file-tree>div:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Accessible chat interface */
.message-feed:focus-within {
    border-color: var(--accent-primary);
}

/* Accessible editor */
.editor-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Accessible buttons */
button[aria-disabled="true"],
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Accessible tabs */
.editor-tabs button:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.editor-tabs button[aria-selected="true"] {
    border-bottom: 2px solid var(--accent-primary);
}

/* Accessible modal */
.hidden-modal[aria-hidden="false"] {
    display: flex;
}

.hidden-modal .modal-content:focus {
    outline: none;
}

/* Accessible form controls */
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Improved contrast for text */
.text-low-contrast {
    color: var(--text-muted);
}

.text-medium-contrast {
    color: var(--text-secondary);
}

.text-high-contrast {
    color: var(--text-primary);
}

/* Accessible icons */
.icon-decorative {
    display: none;
}

.icon-informative {
    display: inline-block;
}

/* Better text sizing for accessibility */
@media (min-width: 1200px) {
    html {
        font-size: 16px;
    }
}

@media (min-width: 1400px) {
    html {
        font-size: 18px;
    }
}

/* Accessible loading states */
.loading-overlay[aria-busy="true"] {
    display: flex;
}

/* Accessible notifications */
.notification[role="alert"] {
    border-left: 4px solid;
}

.notification.success[role="alert"] {
    border-left-color: #22c55e;
}

.notification.error[role="alert"] {
    border-left-color: #ef4444;
}

.notification.warning[role="alert"] {
    border-left-color: #f59e0b;
}

.notification.info[role="alert"] {
    border-left-color: #3b82f6;
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-sm);
}

.chat-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    padding: 4px;
    border-radius: var(--radius-full);
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
}

.mode-btn {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.mode-btn:hover {
    color: var(--text-secondary);
}

.mode-btn.active {
    background: var(--gradient-primary);
    color: var(--bg-deepest);
    box-shadow: var(--shadow-sm);
}

/* Chat Layer */
.chat-layer {
    background: var(--bg-deep);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Chat Window States */
.chat-window {
    display: none;
    flex-direction: column;
    gap: var(--space-md);
}

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

/* Chat Note / Model Status */
.chat-note {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.chat-note .tag {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.chat-note strong {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: var(--space-sm);
}

.chat-note-meta {
    display: flex;
    gap: var(--space-sm);
}

.chat-note-meta span {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

/* Message Feed - Telegram/Antigravity Style */
.message-feed {
    flex: 1;
    min-height: 400px;
    max-height: calc(100vh - 380px);
    background: var(--bg-deepest);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    padding: var(--space-lg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.message-feed::-webkit-scrollbar {
    width: 6px;
}

.message-feed::-webkit-scrollbar-track {
    background: transparent;
}

.message-feed::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
}

.message-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: var(--space-xl);
}

/* Code Blocks in Chat - Agentic IDE Styling */
.code-block {
    background: var(--bg-deepest);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
    overflow: hidden;
}

.code-block .code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.code-block .code-language {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
}

.code-block .code-actions {
    display: flex;
    gap: 8px;
}

.code-block .code-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.code-block .code-action-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.code-block .code-action-btn.apply-btn {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.code-block .code-action-btn.apply-btn:hover {
    background: var(--gradient-primary);
    color: var(--bg-deepest);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.code-block pre {
    margin: 0;
    padding: var(--space-md);
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.code-block code {
    color: #e0e6f0;
}

/* Inline code in messages */
.inline-code {
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: var(--accent-primary);
}

/* Chat Input */
.chat-input {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
}

.message-input {
    flex: 1;
    min-height: 80px;
    max-height: 200px;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: var(--transition-fast);
}

.message-input::placeholder {
    color: var(--text-muted);
}

.message-input:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════════════════ */
.ghost-btn,
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: inherit;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.ghost-btn {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-size: 13px;
}

.ghost-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.ghost-btn.mini {
    padding: 6px 12px;
    font-size: 12px;
}

.ghost-btn.full {
    width: 100%;
}

.ghost-btn.circle {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
    font-size: 18px;
}

.primary-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--gradient-primary);
    border: none;
    color: var(--bg-deepest);
    font-size: 13px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition-fast);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.primary-btn:hover::before {
    opacity: 1;
}

.primary-btn:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
    Editor Shell
    ═══════════════════════════════════════════════════════════════════════════ */
.editor-shell {
    background: var(--bg-deep);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    min-height: 400px;
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.editor-toolbar strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.editor-toolbar .muted {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.workspace-controls {
    display: flex;
    gap: var(--space-sm);
}

/* Editor Tabs */
.editor-tabs {
    display: flex;
    gap: var(--space-xs);
    overflow-x: auto;
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.editor-tabs::-webkit-scrollbar {
    height: 4px;
}

.editor-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.editor-tabs::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 2px;
}

.editor-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 8px 8px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    border: 1px solid transparent;
    border-bottom: none;
}

.editor-tabs button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.editor-tabs button.active {
    background: var(--bg-deepest);
    color: var(--text-primary);
    border-color: var(--border-subtle);
    border-bottom: none;
    position: relative;
    top: 1px;
}

.editor-tabs button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--bg-deepest);
}

.editor-tabs button.dirty::before {
    content: '●';
    color: var(--accent-primary);
    font-size: 10px;
}

.editor-tabs button span.close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-sm);
    margin-left: 4px;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.editor-tabs button:hover span.close {
    opacity: 1;
    background: var(--bg-hover);
}

.editor-tabs button span.close:hover {
    background: var(--bg-surface);
    color: var(--accent-primary);
}

/* Editor Textarea - Enhanced */
.editor-textarea {
    width: 100%;
    min-height: 240px;
    height: 300px;
    padding: var(--space-md);
    background: var(--bg-deepest);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: #e0e6f0;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.editor-textarea:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* AI Editing State - Antigravity Effect */
.editor-textarea.ai-editing {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.3), inset 0 0 20px rgba(124, 58, 237, 0.1);
    background: linear-gradient(to bottom, rgba(13, 17, 23, 1), rgba(13, 17, 23, 0.95)),
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 212, 255, 0.03) 10px, rgba(0, 212, 255, 0.03) 20px);
    transition: all 0.3s ease;
}

/* Animated border effect for AI editing */
@keyframes pulse-border {
    0% {
        border-color: var(--accent-primary);
        box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.3);
    }

    50% {
        border-color: #d946ef;
        box-shadow: 0 0 0 4px rgba(217, 70, 239, 0.3);
    }

    100% {
        border-color: var(--accent-primary);
        box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.3);
    }
}

.editor-textarea.ai-editing {
    animation: pulse-border 2s infinite;
}

/* Editor status bar */
.editor-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-surface);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border: 1px solid var(--border-subtle);
    border-top: none;
    font-size: 11px;
    color: var(--text-muted);
}

.editor-status .editor-info {
    display: flex;
    gap: var(--space-md);
}

.editor-status .editor-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Terminal Mini */
.terminal-mini {
    background: var(--bg-deepest);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.terminal-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-heading span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.terminal-output {
    min-height: 120px;
    max-height: 200px;
    padding: var(--space-md);
    background: #0d0e12;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #22d3ee;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.4;
}

.terminal-output::-webkit-scrollbar {
    width: 6px;
}

.terminal-output::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.terminal-input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.terminal-input:focus {
    outline: none;
    border-color: var(--border-accent);
}

.terminal-hint {
    font-size: 11px;
    color: var(--text-muted);
}

/* Editor line numbers (if implemented) */
.editor-with-line-numbers {
    display: flex;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.editor-line-numbers {
    width: 40px;
    background: var(--bg-surface);
    color: var(--text-muted);
    text-align: right;
    padding: var(--space-md) 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    user-select: none;
    overflow: hidden;
}

.editor-line-numbers span {
    display: block;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
    Right Panel - Settings
    ═══════════════════════════════════════════════════════════════════════════ */
.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.panel-title span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Settings categories */
.settings-category {
    margin-bottom: var(--space-lg);
}

.settings-category-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-md);
}

.settings-category-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-category-header svg {
    color: var(--accent-primary);
    width: 16px;
    height: 16px;
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.panel-section>label:first-child {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.panel-section .muted {
    font-size: 12px;
    color: var(--text-muted);
}

/* Select Input */
.panel-section select {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.panel-section select:hover {
    border-color: var(--border-default);
}

.panel-section select:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Range Slider */
.panel-section input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.panel-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.panel-section input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

/* Switch Toggle */
.switch {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    cursor: pointer;
}

.switch input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    transition: var(--transition-fast);
}

.switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.switch input[type="checkbox"]:checked {
    background: var(--gradient-primary);
    border-color: transparent;
}

.switch input[type="checkbox"]:checked::before {
    transform: translateX(20px);
    background: white;
}

.switch span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Panel Tags */
.panel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.panel-tag {
    padding: 6px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.panel-tag:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.panel-tag.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

/* Settings with description */
.setting-with-description {
    margin-bottom: var(--space-md);
}

.setting-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.setting-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

/* Collapsible settings sections */
.settings-section {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.settings-section-header {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-section-header h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-section-content {
    padding: var(--space-md);
    background: var(--bg-deep);
}

.settings-section.collapsed .settings-section-content {
    display: none;
}

.settings-section.collapsed .settings-section-header::after {
    transform: rotate(180deg);
}

/* Settings group */
.settings-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

@media (max-width: 768px) {
    .settings-group {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Status Bar
   ═══════════════════════════════════════════════════════════════════════════ */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-xl);
    background: var(--bg-deep);
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-muted);
}

.status-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Modals
   ═══════════════════════════════════════════════════════════════════════════ */
.hidden-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    animation: fadeIn var(--transition-fast) ease-out;
}

.hidden-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.diff-panel,
.settings-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    width: min(90%, 640px);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp var(--transition-normal) ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.diff-header,
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.diff-header span,
.settings-header strong {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.diff-content {
    min-height: 200px;
    max-height: 400px;
    background: var(--bg-deepest);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #e0e6f0;
    overflow-y: auto;
    margin-bottom: var(--space-md);
}

.diff-footer {
    display: flex;
    justify-content: flex-end;
}

.settings-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
}

.settings-row span:first-child {
    font-size: 13px;
    color: var(--text-secondary);
}

.settings-row span:last-child {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
    Loading Overlay
    ═══════════════════════════════════════════════════════════════════════════ */
.loading-overlay {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    background: rgba(10, 11, 15, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 300;
}

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

.loader {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    animation: spin 1s linear infinite;
    box-shadow: var(--shadow-glow);
}

/* Different loader sizes */
.loader-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.loader-md {
    width: 36px;
    height: 36px;
    border-width: 3px;
}

.loader-lg {
    width: 48px;
    height: 48px;
    border-width: 3px;
}

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

.loading-overlay p {
    font-size: 14px;
    color: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Inline loading indicators */
.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
}

.loading-inline .loader {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading .btn-content {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading skeletons */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position-x: 200%;
    }

    100% {
        background-position-x: -200%;
    }
}

.skeleton-text {
    height: 16px;
    border-radius: var(--radius-sm);
}

.skeleton-line {
    height: 12px;
    margin: 4px 0;
    border-radius: var(--radius-sm);
}

/* Error and success notifications */
.notification {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 320px;
}

.notification.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(22, 163, 74, 0.1) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.notification.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.notification.warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fde047;
}

.notification.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.notification-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    opacity: 0.7;
    transition: var(--transition-fast);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.notification-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Wizard Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 500px;
    max-width: 90vw;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }

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

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-input {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.modal-input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

textarea.modal-input {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
}

.mr-2 {
    margin-right: 8px;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

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

/* Toast container */
.toast-container {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 320px;
}

/* Global error state */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
}

.error-state-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    color: #f87171;
}

.error-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.error-state-message {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    color: var(--accent-primary);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state-message {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

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

.loader {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    animation: spin 1s linear infinite;
    box-shadow: var(--shadow-glow);
}

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

.loading-overlay p {
    font-size: 14px;
    color: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TUI Terminal Styles
   ═══════════════════════════════════════════════════════════════════════════ */
.tui-window {
    background: var(--bg-deepest);
    border-radius: var(--radius-md);
    min-height: 400px;
}

.terminal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-deepest);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.terminal-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.terminal-controls {
    display: flex;
    gap: var(--space-xs);
}

.terminal-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    font-size: 8px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.terminal-btn.minimize {
    background: #fbbf24;
    color: #000;
}

.terminal-btn.maximize {
    background: #22c55e;
    color: #000;
}

.terminal-btn.close {
    background: #ef4444;
    color: #fff;
}

.terminal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    overflow-y: auto;
}

.terminal-output {
    flex: 1;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.terminal-prompt {
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    caret-color: var(--accent-primary);
}

.terminal-cursor {
    color: var(--accent-primary);
    animation: blink 1s step-end infinite;
}

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

.terminal-status-bar {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
}

.status-item {
    color: var(--text-muted);
}

.terminal-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-line.error {
    color: #f87171;
}

.terminal-line.success {
    color: #4ade80;
}

.terminal-line.info {
    color: var(--accent-primary);
}

.terminal-line.ai-response {
    color: #c4b5fd;
}

.terminal-line.welcome-border {
    color: var(--accent-primary);
}

.terminal-line.welcome-title {
    color: var(--text-primary);
    font-weight: 600;
}

.terminal-line.welcome-subtitle {
    color: var(--text-secondary);
}

.terminal-line.welcome-text {
    color: var(--text-muted);
}

.file-link-container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.file-link {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.file-link:hover {
    text-decoration: underline;
}

.folder-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.folder-btn:hover {
    opacity: 1;
}

.inline-code {
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════════════════════════════
    Responsive Design
    ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1400px) {
    .main-grid {
        grid-template-columns: 240px 1fr 280px;
    }
}

@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .left-panel,
    .right-panel {
        position: static;
        max-height: none;
    }

    .left-panel {
        order: 2;
    }

    .center-panel {
        order: 1;
    }

    .right-panel {
        order: 3;
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        height: auto;
        padding: var(--space-md);
        gap: var(--space-md);
    }

    .top-left,
    .top-actions {
        width: 100%;
        justify-content: center;
    }

    .top-actions {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .main-grid {
        padding: var(--space-md);
        gap: var(--space-md);
    }

    .mode-toggle {
        width: 100%;
    }

    .mode-btn {
        flex: 1;
    }

    .chat-input {
        flex-direction: column;
    }

    .input-controls {
        flex-direction: row;
        justify-content: flex-end;
        width: 100%;
    }

    .auth-section {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .auth-pill {
        width: 100%;
        justify-content: center;
    }

    .preview-pill {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile-specific improvements */
@media (max-width: 480px) {
    .top-bar {
        padding: var(--space-sm);
    }

    .logo-cell {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .main-grid {
        padding: var(--space-sm);
        gap: var(--space-sm);
    }

    .left-panel,
    .center-panel,
    .right-panel {
        padding: var(--space-md);
    }

    /* Adjust chat input for small screens */
    .chat-input {
        flex-direction: column;
    }

    .message-input {
        min-height: 100px;
        width: 100%;
    }

    .input-controls {
        width: 100%;
        justify-content: space-between;
    }

    /* Adjust button sizes on small screens */
    .primary-btn,
    .ghost-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 12px;
    }

    /* Adjust file tree for mobile */
    .file-tree {
        min-height: 150px;
        font-size: 11px;
    }

    /* Adjust terminal for mobile */
    .terminal-mini {
        padding: var(--space-sm);
    }

    .terminal-input {
        flex: 1;
        min-width: 100px;
    }

    /* Adjust status bar for mobile */
    .status-bar {
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
        text-align: center;
    }

    .status-left,
    .status-actions {
        justify-content: center;
        width: 100%;
    }

    /* Adjust modal for mobile */
    .diff-panel,
    .settings-panel {
        width: 95%;
        margin: var(--space-md);
        padding: var(--space-md);
    }

    /* Adjust welcome message for mobile */
    .welcome-message {
        padding: var(--space-md);
    }

    .welcome-message h3 {
        font-size: 16px;
    }

    .feature-cards {
        flex-direction: column;
        align-items: center;
    }

    .feature-card {
        width: 100%;
        min-width: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Utility Classes
   ═══════════════════════════════════════════════════════════════════════════ */
.muted {
    color: var(--text-muted);
}

.text-accent {
    color: var(--accent-primary);
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
    Chat Messages - GUI View Styles
    ═══════════════════════════════════════════════════════════════════════════ */

/* Message container layout */
.message-feed .flex {
    display: flex;
    margin-bottom: var(--space-md);
}

.message-feed .justify-end {
    justify-content: flex-end;
}

.message-feed .justify-start {
    justify-content: flex-start;
}

.message-feed .mb-4 {
    margin-bottom: var(--space-md);
}

.message-feed .flex-shrink-0 {
    flex-shrink: 0;
}

/* Message wrapper */
.message-feed .max-w-\[85\%\],
.message-feed [class*="max-w"] {
    max-width: 85%;
    width: auto;
}

/* User messages */
.message-feed .bg-blue-600,
.message-feed [class*="bg-blue"],
.message-feed [class*="from-blue"] {
    background: linear-gradient(135deg, #00796b 0%, #004d40 100%) !important;
    color: white !important;
    border-radius: var(--radius-lg) !important;
    padding: var(--space-md) !important;
    box-shadow: var(--shadow-sm) !important;
}

/* Assistant messages */
.message-feed .bg-white,
.message-feed [class*="bg-gray-700"],
.message-feed .dark\:bg-gray-700 {
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-lg) !important;
    padding: var(--space-md) !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: var(--shadow-sm) !important;
}

/* System messages */
.message-feed .bg-yellow-50,
.message-feed [class*="bg-yellow"],
.message-feed .dark\:bg-yellow-900\/20 {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%) !important;
    color: #fbbf24 !important;
    border-radius: var(--radius-md) !important;
    padding: var(--space-md) !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
}

/* Message text sizing */
.message-feed .text-sm {
    font-size: 14px !important;
    line-height: 1.6 !important;
}

.message-feed .whitespace-pre-wrap {
    white-space: pre-wrap !important;
}

.message-feed .break-words {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

/* Timestamp */
.message-feed .text-xs {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    margin-top: var(--space-xs) !important;
}

.message-feed .text-right {
    text-align: right !important;
}

/* Rounded corners */
.message-feed .rounded-2xl {
    border-radius: var(--radius-lg) !important;
}

.message-feed .rounded-lg {
    border-radius: var(--radius-md) !important;
}

/* Padding utilities */
.message-feed .px-4 {
    padding-left: var(--space-md) !important;
    padding-right: var(--space-md) !important;
}

.message-feed .py-2,
.message-feed .py-3 {
    padding-top: var(--space-sm) !important;
    padding-bottom: var(--space-sm) !important;
}

/* Text colors */
.message-feed .text-white {
    color: white !important;
}

.message-feed .text-gray-900,
.message-feed .dark\:text-white {
    color: var(--text-primary) !important;
}

.message-feed .text-yellow-800,
.message-feed .dark\:text-yellow-200 {
    color: #fbbf24 !important;
}

.message-feed .text-center {
    text-align: center !important;
}

/* Enhanced chat message styling for new message system */
.message-row {
    display: flex;
    width: 100%;
    margin-bottom: 8px;
    animation: fadeInUp 0.2s ease-out;
}

.message-row.user-message {
    justify-content: flex-end;
}

.message-row.assistant-message {
    justify-content: flex-start;
}

.message-row.system-message {
    justify-content: center;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.message-wrapper {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.user-message .message-wrapper {
    align-items: flex-end;
}

.assistant-message .message-wrapper {
    align-items: flex-start;
}

.system-message .message-wrapper {
    align-items: center;
    max-width: 90%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    font-size: 14px;
    line-height: 1.5;
}

.user-bubble {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #00a3d9 100%);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.assistant-bubble {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.system-bubble {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fbbf24;
    text-align: center;
    max-width: 100%;
    border-radius: 12px;
    align-self: center;
}

.message-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.system-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0;
}

.system-icon {
    flex-shrink: 0;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    padding: 0 4px;
    text-align: right;
}

.user-message .message-time {
    text-align: right;
}

.assistant-message .message-time {
    text-align: left;
}

.system-message .message-time {
    text-align: center;
    margin: 4px auto 0;
}

/* Code blocks in messages */
.message-bubble pre {
    background: var(--bg-deepest);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

.message-bubble code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.message-bubble .inline-code {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
}

/* Streaming message indicator */
.message-row.streaming .message-bubble {
    position: relative;
}

.message-row.streaming .message-bubble::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 14px;
    background: var(--accent-primary);
    margin-left: 4px;
    animation: blink 0.8s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* New thinking animation for assistant messages */
.thinking-animation {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 0 !important;
    color: var(--text-muted) !important;
}

.thinking-animation .thinking-icon {
    color: var(--accent-primary) !important;
    animation: pulse-glow 2s ease-in-out infinite !important;
}

.thinking-animation .thinking-text {
    font-size: 14px !important;
    color: var(--text-secondary) !important;
}

.thinking-animation .dots {
    display: flex !important;
    flex-direction: row !important;
    gap: 3px !important;
    margin-left: 4px !important;
}

.thinking-animation .dot {
    display: inline-block !important;
    width: 8px !important;
    height: 8px !important;
    background: var(--accent-primary) !important;
    border-radius: 50% !important;
    animation: dot-bounce 1.4s ease-in-out infinite !important;
}

.thinking-animation .dot:nth-child(1) {
    animation-delay: 0s !important;
}

.thinking-animation .dot:nth-child(2) {
    animation-delay: 0.2s !important;
}

.thinking-animation .dot:nth-child(3) {
    animation-delay: 0.4s !important;
}

@keyframes dot-bounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }

    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SVG Icon Sizing - CRITICAL FIX FOR OVERSIZED ICONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* All SVGs should be constrained by default */
svg {
    max-width: 100%;
    height: auto;
}

/* Inline SVG icons in buttons and messages */
button svg,
.ghost-btn svg,
.primary-btn svg,
.message-feed svg,
.auth-section svg,
.inline svg,
[class*="inline"] svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Slightly larger icons for headers */
.chat-header svg,
.panel-title svg {
    width: 20px !important;
    height: 20px !important;
}

/* Tailwind-style icon classes */
.w-4 {
    width: 16px !important;
}

.h-4 {
    height: 16px !important;
}

.w-5 {
    width: 20px !important;
}

.h-5 {
    height: 20px !important;
}

.w-6 {
    width: 24px !important;
}

.h-6 {
    height: 24px !important;
}

.mr-1 {
    margin-right: 4px !important;
}

.mr-2 {
    margin-right: 8px !important;
}

.ml-1 {
    margin-left: 4px !important;
}

.ml-2 {
    margin-left: 8px !important;
}

/* Inline flex for icon + text combinations */
.inline-flex {
    display: inline-flex !important;
    align-items: center !important;
}

.items-center {
    align-items: center !important;
}

.gap-2 {
    gap: 8px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Authentication Button States
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base auth button styling */
#auth-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--space-sm) !important;
    width: 100% !important;
    padding: var(--space-sm) var(--space-md) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: var(--radius-md) !important;
    transition: var(--transition-fast) !important;
    cursor: pointer !important;
}

/* Authenticated state (green) */
#auth-btn.bg-green-600,
#auth-btn[class*="bg-green"] {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    border: none !important;
    color: white !important;
}

#auth-btn.bg-green-600:hover,
#auth-btn[class*="bg-green"]:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3) !important;
}

/* Unauthenticated state (default primary) */
#auth-btn:not([class*="bg-green"]) {
    background: var(--gradient-primary) !important;
    border: none !important;
    color: var(--bg-deepest) !important;
}

/* Re-authenticate button */
#reauth-btn {
    width: 100% !important;
}

/* Complete auth button */
#complete-auth-btn {
    width: 100% !important;
    margin-top: var(--space-sm) !important;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    border: none !important;
    color: white !important;
    padding: var(--space-sm) var(--space-md) !important;
    border-radius: var(--radius-md) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: var(--transition-fast) !important;
}

#complete-auth-btn:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
}

/* Auth status text colors */
.text-green-600,
.dark\:text-green-400,
.text-green-400 {
    color: #22c55e !important;
}

.text-gray-600,
.dark\:text-gray-400,
.text-gray-400 {
    color: var(--text-muted) !important;
}

.font-medium {
    font-weight: 500 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Code Blocks in Messages
   ═══════════════════════════════════════════════════════════════════════════ */

.code-block {
    background: var(--bg-deepest);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin: var(--space-sm) 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.code-language {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.copy-btn svg {
    width: 14px !important;
    height: 14px !important;
}

.code-block pre {
    margin: 0;
    padding: var(--space-md);
    overflow-x: auto;
}

.code-block code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #e0e6f0;
}

.inline-code {
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: var(--accent-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Typing Indicator & Loading States
   ═══════════════════════════════════════════════════════════════════════════ */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
}

.message-avatar {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-content {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }
}

/* Thinking animation */
.thinking-animation {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
}

.thinking-animation .dots .dot {
    display: inline-block;
    animation: bounce 1s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.text-gray-500 {
    color: var(--text-muted) !important;
}

/* Streaming message indicator */
.streaming {
    position: relative;
}

.streaming::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    animation: streamingPulse 1.5s ease-in-out infinite;
}

@keyframes streamingPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Welcome Message Placeholder
   ═══════════════════════════════════════════════════════════════════════════ */

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.welcome-message svg {
    width: 48px !important;
    height: 48px !important;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Session List Enhancements
   ═══════════════════════════════════════════════════════════════════════════ */

#sessions-list .p-3 {
    padding: var(--space-sm) var(--space-md) !important;
}

#sessions-list .rounded-lg {
    border-radius: var(--radius-md) !important;
}

#sessions-list .cursor-pointer {
    cursor: pointer !important;
}

#sessions-list .transition-colors {
    transition: var(--transition-fast) !important;
}

#sessions-list .mb-2 {
    margin-bottom: var(--space-sm) !important;
}

#sessions-list .bg-blue-50,
#sessions-list .dark\:bg-blue-900\/20 {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%) !important;
    border: 1px solid var(--border-accent) !important;
}

#sessions-list .hover\:bg-gray-50:hover,
#sessions-list .dark\:hover\:bg-gray-700:hover {
    background: var(--bg-hover) !important;
}

#sessions-list .font-medium {
    font-weight: 500 !important;
}

#sessions-list .text-sm {
    font-size: 13px !important;
}

#sessions-list .text-xs {
    font-size: 11px !important;
}

#sessions-list .text-gray-900,
#sessions-list .dark\:text-white {
    color: var(--text-primary) !important;
}

#sessions-list .text-gray-500,
#sessions-list .dark\:text-gray-400 {
    color: var(--text-muted) !important;
}

#sessions-list .mt-1 {
    margin-top: 4px !important;
}

#sessions-list .border {
    border-width: 1px !important;
}

#sessions-list .border-blue-200,
#sessions-list .dark\:border-blue-800 {
    border-color: var(--border-accent) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Focus Ring Utilities
   ═══════════════════════════════════════════════════════════════════════════ */

.focus\:outline-none:focus {
    outline: none !important;
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px var(--accent-glow) !important;
}

.focus\:ring-offset-2:focus {
    box-shadow: 0 0 0 2px var(--bg-deepest), 0 0 0 4px var(--accent-glow) !important;
}

.focus\:ring-green-500:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3) !important;
}

.focus\:ring-blue-500:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Settings Button (if exists in right panel)
   ═══════════════════════════════════════════════════════════════════════════ */

#settings-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

#settings-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
    File Tree - IDE Style
    ═══════════════════════════════════════════════════════════════════════════ */

.file-tree {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    position: relative;
}

.file-tree::-webkit-scrollbar {
    width: 6px;
}

.file-tree::-webkit-scrollbar-track {
    background: transparent;
}

.file-tree::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}

.file-tree::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.file-tree-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 180px;
    color: var(--text-muted);
    text-align: center;
    gap: var(--space-sm);
}

.file-tree-placeholder svg {
    width: 32px !important;
    height: 32px !important;
    opacity: 0.5;
}

.file-tree-placeholder p {
    font-size: 12px;
    margin: 0;
}

/* File Tree Items */
.file-tree>div {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    position: relative;
    border-left: 2px solid transparent;
}

.file-tree>div:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left: 2px solid var(--accent-primary);
    margin-left: -2px;
    padding-left: 14px;
}

.file-tree>div[data-type="dir"] {
    font-weight: 500;
}

.file-tree>div[data-type="dir"]>span:first-child {
    color: var(--accent-primary);
    font-size: 14px;
}

.file-tree>div[data-type="file"]>span:first-child {
    color: var(--text-muted);
    font-size: 10px;
    margin-right: 2px;
}

.file-tree>div[data-type="file"] {
    padding-left: 20px;
}

/* Selected file highlight */
.file-tree>div.selected,
.file-tree .font-semibold {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.1) 100%) !important;
    color: var(--accent-primary) !important;
    font-weight: 500 !important;
    border-left: 2px solid var(--accent-primary) !important;
}

/* Attached/selected for chat context */
.file-tree>div[data-attached="true"] {
    background: rgba(124, 58, 237, 0.15) !important;
    border-left: 2px solid var(--accent-secondary) !important;
}

.file-tree>div[data-attached="true"] span:last-child {
    color: var(--accent-secondary) !important;
    font-weight: 500;
}

/* File/folder icons */
.file-icon,
.folder-icon {
    width: 16px;
    text-align: center;
    font-size: 10px;
}

.folder-icon {
    color: var(--accent-primary);
}

/* File type icons */
.file-tree .file-extension {
    font-size: 10px;
    opacity: 0.7;
    margin-left: auto;
}

/* Tailwind overrides for file tree */
.file-tree .flex {
    display: flex !important;
}

.file-tree .items-center {
    align-items: center !important;
}

.file-tree .space-x-1>*+* {
    margin-left: 4px !important;
}

.file-tree .cursor-pointer {
    cursor: pointer !important;
}

.file-tree .rounded {
    border-radius: var(--radius-sm) !important;
}

.file-tree .px-1 {
    padding-left: 4px !important;
    padding-right: 4px !important;
}

.file-tree .py-0\.5,
.file-tree .py-0 {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

.file-tree .text-gray-500 {
    color: var(--text-muted) !important;
}

.file-tree .text-blue-600,
.file-tree .dark\:text-blue-400 {
    color: var(--accent-primary) !important;
}

.file-tree .hover\:bg-gray-100:hover,
.file-tree .dark\:hover\:bg-gray-700:hover {
    background: var(--bg-hover) !important;
}

/* File tree loading state */
.file-tree.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 23, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.file-tree.loading .loader {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Editor Tabs
   ═══════════════════════════════════════════════════════════════════════════ */

.editor-tabs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm) 0;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.editor-tabs:empty {
    display: none;
}

.editor-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.editor-tabs button:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
}

/* Active tab */
.editor-tabs button.bg-blue-600,
.editor-tabs button[class*="bg-blue"] {
    background: var(--gradient-primary) !important;
    color: var(--bg-deepest) !important;
    border-color: transparent !important;
    font-weight: 600;
}

/* Inactive tabs */
.editor-tabs button.bg-gray-100,
.editor-tabs button[class*="bg-gray"] {
    background: var(--bg-surface) !important;
    color: var(--text-secondary) !important;
}

/* Tab close button */
.editor-tabs button span {
    opacity: 0.6;
    transition: var(--transition-fast);
}

.editor-tabs button:hover span {
    opacity: 1;
}

/* Tailwind overrides for tabs */
.editor-tabs .px-2 {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

.editor-tabs .py-1 {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

.editor-tabs .text-xs {
    font-size: 12px !important;
}

.editor-tabs .rounded {
    border-radius: var(--radius-sm) !important;
}

.editor-tabs .text-white {
    color: var(--bg-deepest) !important;
}

.editor-tabs .text-gray-800,
.editor-tabs .dark\:text-gray-200 {
    color: var(--text-secondary) !important;
}

.editor-tabs .ml-1 {
    margin-left: 4px !important;
}

.editor-tabs .opacity-70 {
    opacity: 0.7 !important;
}

.editor-tabs .hover\:opacity-100:hover {
    opacity: 1 !important;
}

.editor-tabs .hover\:bg-gray-200:hover,
.editor-tabs .dark\:hover\:bg-gray-600:hover {
    background: var(--bg-hover) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Toast Notifications (Error & Success)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base toast styling */
.fixed {
    position: fixed !important;
}

.top-4 {
    top: var(--space-md) !important;
}

.right-4 {
    right: var(--space-md) !important;
}

.z-50 {
    z-index: 50 !important;
}

.max-w-sm {
    max-width: 320px !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Error toast */
[class*="bg-red-50"],
[class*="bg-red-900"] {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-radius: var(--radius-md) !important;
    padding: var(--space-md) !important;
    color: #fca5a5 !important;
    backdrop-filter: blur(10px);
    animation: slideInRight 0.3s ease-out;
}

/* Success toast */
[class*="bg-green-50"],
[class*="bg-green-900"] {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(22, 163, 74, 0.1) 100%) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    border-radius: var(--radius-md) !important;
    padding: var(--space-md) !important;
    color: #86efac !important;
    backdrop-filter: blur(10px);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

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

/* Toast text colors */
.text-red-800,
.dark\:text-red-200 {
    color: #fca5a5 !important;
}

.text-green-800,
.dark\:text-green-200 {
    color: #86efac !important;
}

/* Toast border colors */
.border-red-200,
.dark\:border-red-800 {
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.border-green-200,
.dark\:border-green-800 {
    border-color: rgba(34, 197, 94, 0.3) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AI Response & Thinking Animation - Telegram/Antigravity Style
   ═══════════════════════════════════════════════════════════════════════════ */

/* Thinking animation container - HORIZONTAL INLINE layout */
.thinking-animation {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 0;
    color: var(--text-muted);
}

.thinking-animation .thinking-icon {
    color: var(--accent-primary);
    animation: pulse-glow 2s ease-in-out infinite;
}

.thinking-animation .thinking-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.thinking-animation .dots {
    display: inline-flex !important;
    flex-direction: row !important;
    gap: 3px !important;
    margin-left: 4px;
}

.thinking-animation .dot {
    display: inline-block !important;
    font-size: 18px !important;
    line-height: 1 !important;
    color: var(--accent-primary) !important;
    animation: dot-bounce 1.4s ease-in-out infinite !important;
}

.thinking-animation .dot:nth-child(1) {
    animation-delay: 0s !important;
}

.thinking-animation .dot:nth-child(2) {
    animation-delay: 0.2s !important;
}

.thinking-animation .dot:nth-child(3) {
    animation-delay: 0.4s !important;
}

@keyframes dot-bounce {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Force horizontal layout for thinking animation */
.message-feed .thinking-animation,
.message-bubble .thinking-animation,
[class*="streaming"] .thinking-animation {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 4px 0 !important;
}

.thinking-animation .dots {
    display: inline-flex !important;
    flex-direction: row !important;
    gap: 4px !important;
}

/* Message text styling */
.message-text {
    margin: 0 !important;
    line-height: 1.5 !important;
    font-size: 14px !important;
}

/* Ensure bounce animation is horizontal */
@keyframes bounce {

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

    50% {
        transform: translateY(-4px);
        opacity: 0.6;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Session Pills Enhancement
   ═══════════════════════════════════════════════════════════════════════════ */

.session-pill {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.session-icon {
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Switch Toggle Enhancement
   ═══════════════════════════════════════════════════════════════════════════ */

.switch {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    cursor: pointer;
}

.switch input[type="checkbox"] {
    display: none;
}

.switch-slider {
    width: 40px;
    height: 22px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    position: relative;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.switch-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.switch input[type="checkbox"]:checked+.switch-slider {
    background: var(--gradient-primary);
    border-color: transparent;
}

.switch input[type="checkbox"]:checked+.switch-slider::before {
    transform: translateX(18px);
    background: white;
}

.switch-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Slider Container
   ═══════════════════════════════════════════════════════════════════════════ */

.slider-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.slider-container input[type="range"] {
    flex: 1;
}

.slider-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 30px;
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Panel Tags Enhancement
   ═══════════════════════════════════════════════════════════════════════════ */

.panel-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.panel-tag svg {
    width: 12px !important;
    height: 12px !important;
}

.panel-tag.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Keyboard Shortcuts Section
   ═══════════════════════════════════════════════════════════════════════════ */

.shortcuts-section {
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 11px;
    color: var(--text-muted);
}

.shortcut-item span {
    margin-left: auto;
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Status Bar Enhancement
   ═══════════════════════════════════════════════════════════════════════════ */

.status-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.status-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.status-item svg {
    width: 12px !important;
    height: 12px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Status Badge
   ═══════════════════════════════════════════════════════════════════════════ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.status-badge.online {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.status-badge.online::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Chat Note Enhancement
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-note-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Settings Divider
   ═══════════════════════════════════════════════════════════════════════════ */

.settings-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: var(--space-md) 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Full Width Button
   ═══════════════════════════════════════════════════════════════════════════ */

.primary-btn.full,
.ghost-btn.full {
    width: 100%;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Welcome Message Enhancement
   ═══════════════════════════════════════════════════════════════════════════ */

.welcome-message {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: var(--space-2xl) !important;
    border: 2px dashed var(--border-default) !important;
    border-radius: var(--radius-lg) !important;
    min-height: 200px !important;
    background: transparent !important;
}

.welcome-message svg {
    width: 48px !important;
    height: 48px !important;
    color: var(--text-muted) !important;
    opacity: 0.5 !important;
    margin-bottom: var(--space-md) !important;
}

.welcome-message h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm);
}

.welcome-message p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* Feature cards in welcome */
.feature-cards {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
    justify-content: center;
}

.feature-card {
    padding: var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: center;
    min-width: 120px;
}

.feature-card h3 {
    font-size: 20px;
    margin: 0 0 var(--space-xs);
}

.feature-card p {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TUI Placeholder
   ═══════════════════════════════════════════════════════════════════════════ */

.tui-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Chat Messages - Telegram/Antigravity Style
   ═══════════════════════════════════════════════════════════════════════════ */

/* Message row container */
.message-row {
    display: flex;
    width: 100%;
    margin-bottom: 8px;
    animation: fadeInUp 0.2s ease-out;
}

.message-row.user-message {
    justify-content: flex-end;
}

.message-row.assistant-message {
    justify-content: flex-start;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* Message wrapper */
.message-wrapper {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.user-message .message-wrapper {
    align-items: flex-end;
}

.assistant-message .message-wrapper {
    align-items: flex-start;
}

/* Message bubbles - WhatsApp Style */
.message-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    max-width: fit-content;
}

.user-bubble {
    background: linear-gradient(135deg, #005c4b 0%, #00796b 100%);
    color: #e9edef;
    border-radius: 12px 12px 4px 12px;
}

.assistant-bubble {
    background: #1e2a3a;
    color: #e9edef;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px 12px 12px 4px;
}

.system-bubble {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fbbf24;
    text-align: center;
    max-width: 100%;
    border-radius: 12px;
    margin: 0 auto;
}

/* Message text */
.message-text {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

.system-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.system-icon {
    flex-shrink: 0;
}

/* Message timestamp */
.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.user-message .message-time {
    text-align: right;
}

/* Code blocks in messages */
.message-bubble pre {
    background: var(--bg-deepest);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    overflow-x: auto;
}

.message-bubble code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.message-bubble .inline-code {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* Streaming message indicator */
.message-row.streaming .message-bubble::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 14px;
    background: var(--accent-primary);
    margin-left: 4px;
    animation: blink 0.8s ease-in-out infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}