/* Alki · The AI Conductor Premium Theme System v2.0 */

:root {
    --bg-darkest: #050508;
    --bg-darker: #0c0d14;
    --bg-glass: rgba(12, 13, 20, 0.45);
    
    /* Harmonic Accent Colors */
    --accent-purple: #a855f7;
    --accent-cyan: #06b6d4;
    --accent-indigo: #6366f1;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;

    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-glass: rgba(255, 255, 255, 0.04);
    --border-glass-active: rgba(99, 102, 241, 0.25);
    --glow-shadow: 0 0 35px rgba(99, 102, 241, 0.12);
}

/* Base resets & styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-darkest);
    color: var(--text-primary);
    font-family: var(--font-family);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    position: relative;
}

/* IDE Workspace Header */
.ide-header.glass-element {
    flex-shrink: 0;
    height: 50px;
    background: #0c0d14;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 10;
}

.ide-header .logo-title {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Three-Panel IDE Desktop Grid Layout */
.ide-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr 380px;
    height: calc(100vh - 50px);
    background: #090a0f;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.ide-sidebar.glass-element,
.ide-editor-workspace.glass-element,
.ide-copilot.glass-element {
    border-radius: 0;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: none;
    backdrop-filter: none;
    background: #0c0d14;
    height: 100%;
}

.ide-copilot.glass-element {
    border-right: none;
    background: #090a0f;
}

.ide-sidebar.glass-element:hover,
.ide-editor-workspace.glass-element:hover,
.ide-copilot.glass-element:hover {
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

/* File Explorer Sidebar Panel */
.sidebar-section {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.sidebar-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.explorer-section {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
}

.explorer-tree {
    flex: 1;
    overflow-y: auto;
}

.explorer-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.explorer-item {
    margin: 0.15rem 0;
}

.explorer-label {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.explorer-label:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.explorer-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
    width: 16px;
    display: inline-flex;
    justify-content: center;
}

.explorer-name {
    font-family: inherit;
    font-weight: 400;
}

.folder-contents {
    margin-left: 1.15rem;
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    padding-left: 0.25rem;
}

.folder-contents.collapsed {
    display: none;
}

/* Main Tabbed Code Editor area */
.ide-editor-workspace {
    background: #11121d;
    display: flex;
    flex-direction: column;
}

.editor-tabs-bar {
    display: flex;
    flex-direction: row;
    background: #0c0d14;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    height: 38px;
    align-items: center;
    overflow-x: auto;
    flex-shrink: 0;
}

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

.editor-tab {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    background: #090a0f;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background 0.2s, color 0.2s;
}

.editor-tab:hover {
    background: #11121d;
    color: var(--text-primary);
}

.editor-tab.active {
    background: #11121d;
    color: var(--text-primary);
    font-weight: 500;
}

.editor-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-indigo);
}

.tab-close-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, color 0.2s;
    margin-left: 0.5rem;
}

.tab-close-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.placeholder-tab {
    cursor: default;
    background: #11121d;
}

/* Document content viewer area */
.artifact-content.scrollable-panel {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #11121d;
}

/* Collapsible Retro terminal panel at the bottom */
.terminal-panel {
    background: #090a0f;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    transition: height 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    height: 180px;
    flex-shrink: 0;
}

.terminal-panel.expanded {
    height: 380px;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0c0d14;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 0.4rem 1.25rem;
    height: 32px;
    cursor: pointer;
    user-select: none;
}

.terminal-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-icon {
    font-size: 0.95rem;
}

.terminal-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
}

.terminal-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
    outline: none;
}

.terminal-action-btn:hover {
    color: var(--text-primary);
}

.terminal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.terminal-scroller {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.25rem;
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #e2e8f0;
}

.terminal-stdout {
    margin-bottom: 0.4rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-prompt-bar {
    display: flex;
    align-items: center;
    padding: 0.45rem 1.25rem;
    background: #0c0d14;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    gap: 0.65rem;
}

.terminal-prompt-prefix {
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-cyan);
    user-select: none;
}

.terminal-prompt-bar .input-glow-wrapper {
    padding: 0.25rem 0.5rem 0.25rem 1rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.05);
}

.terminal-prompt-bar #chat-input {
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 0.82rem;
}

.terminal-body .slash-suggest-menu {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 1.25rem;
    right: 1.25rem;
    z-index: 100;
}

/* AI Copilot Side Pane Tabs */
.copilot-tabs-bar {
    display: flex;
    flex-direction: row;
    height: 38px;
    background: #0c0d14;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    align-items: center;
    padding: 0 0.5rem;
    gap: 0.25rem;
    flex-shrink: 0;
}

.copilot-tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.76rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.copilot-tab-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.copilot-tab-btn.active {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--text-primary);
}

.copilot-chat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(255, 255, 255, 0.005);
    flex-shrink: 0;
}

.copilot-chat-header h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.copilot-header-icon {
    font-size: 1rem;
}

/* Premium Markdown document rendering inside editor panel */
.markdown-rendered-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.4rem;
}

.markdown-rendered-container h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 1.25rem;
    margin-bottom: 0.6rem;
}

.markdown-rendered-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.markdown-rendered-container h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.85rem;
    margin-bottom: 0.4rem;
}

.markdown-rendered-container p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
}

.markdown-rendered-container hr.markdown-hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 1.5rem 0;
}

.markdown-rendered-container a.markdown-link {
    color: var(--accent-indigo);
    text-decoration: none;
    border-bottom: 1px dashed rgba(99, 102, 241, 0.4);
    transition: color 0.2s, border-color 0.2s;
}

.markdown-rendered-container a.markdown-link:hover {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.markdown-rendered-container blockquote {
    background: rgba(255, 255, 255, 0.015);
    border-left: 3px solid var(--accent-indigo);
    padding: 0.65rem 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.markdown-rendered-container blockquote p {
    margin-bottom: 0;
    color: var(--text-primary);
}

.markdown-rendered-container ul, 
.markdown-rendered-container ol {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.markdown-rendered-container li {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.markdown-rendered-container li.checked-task {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Glass element styles */
.glass-element {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.glass-element:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--glow-shadow);
}

/* LEFT PANEL: Chat Pane */
.chat-pane {
    height: 100%;
}

/* Header Styling */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.015);
}

.logo-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.logo-badge {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    color: #ffffff;
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-top: 0.2rem;
}

/* Connection status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 99px;
    transition: all 0.3s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-amber);
    box-shadow: 0 0 10px var(--accent-amber);
    transition: all 0.3s ease;
}

.status-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

/* Connected State overrides */
.status-badge.connected .status-dot {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 12px var(--accent-emerald);
    animation: blink 2.5s infinite ease-in-out;
}
.status-badge.connected .status-text {
    color: var(--text-primary);
}

/* Offline State overrides */
.status-badge.offline .status-dot {
    background-color: var(--accent-red);
    box-shadow: 0 0 12px var(--accent-red);
    animation: blink 1s infinite ease-in-out;
}
.status-badge.offline .status-text {
    color: var(--accent-red);
}

/* Offline Sync Banner */
.sync-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border-bottom: 1px solid rgba(245, 158, 11, 0.15);
    padding: 0.75rem 2rem;
    font-size: 0.85rem;
    color: var(--accent-amber);
    font-weight: 400;
    transform: translateY(-100%);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sync-banner.active {
    transform: translateY(0);
    max-height: 60px;
    opacity: 1;
}

.sync-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(245, 158, 11, 0.2);
    border-top: 2px solid var(--accent-amber);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

/* Messages Pane */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar,
.scrollable-panel::-webkit-scrollbar {
    width: 5px;
}
.messages-container::-webkit-scrollbar-track,
.scrollable-panel::-webkit-scrollbar-track {
    background: transparent;
}
.messages-container::-webkit-scrollbar-thumb,
.scrollable-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
}
.messages-container::-webkit-scrollbar-thumb:hover,
.scrollable-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Loading state */
.loading-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.loading-ring {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(99, 102, 241, 0.15);
    border-top: 3px solid var(--accent-indigo);
    border-radius: 50%;
    animation: spin 1.2s infinite linear;
}

/* Chat bubble aesthetics */
.message-bubble {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    padding: 1.1rem 1.4rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: slideUp 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.1) both;
}

/* User Message */
.message-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
    border-bottom-right-radius: 4px;
}

/* Alki (AI) Message */
.message-bubble.alki {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    font-weight: 300;
}

/* Markdown parsing output layout */
.message-bubble p {
    margin-bottom: 0.65rem;
}
.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul, .message-bubble ol {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
}
.message-bubble li {
    margin-bottom: 0.35rem;
}
.message-bubble li:last-child {
    margin-bottom: 0;
}

.message-bubble strong {
    font-weight: 600;
}

/* Inner Code Formatting */
.message-bubble code {
    font-family: Consolas, Monaco, monospace;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    color: var(--accent-cyan);
}

.message-bubble pre {
    font-family: Consolas, Monaco, monospace;
    font-size: 0.82rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0.85rem 0;
    overflow-x: auto;
}

.message-bubble pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

/* Bubble timestamp */
.bubble-meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
    text-align: right;
    font-weight: 400;
}

.message-bubble.alki .bubble-meta {
    color: var(--text-muted);
}

/* Console Footer with Floating Slash Menu Container */
.console-footer {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.015);
    position: relative;
}

/* Floating Slash Auto-Suggest dropdown */
.slash-suggest-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 2rem;
    right: 2rem;
    background: rgba(8, 9, 14, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass-active);
    border-radius: 16px;
    box-shadow: 0 10px 45px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 100;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.slash-suggest-menu.active {
    display: flex;
}

.slash-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.01);
    transition: background-color 0.2s;
}

.slash-item:last-child {
    border-bottom: none;
}

.slash-cmd {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-indigo);
    font-family: monospace;
}

.slash-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.slash-item.active, .slash-item:hover {
    background-color: rgba(99, 102, 241, 0.08);
}
.slash-item.active .slash-cmd, .slash-item:hover .slash-cmd {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

/* Interactive Input wrapper styling */
.input-glow-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.015);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.input-glow-wrapper:focus-within {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
}

#chat-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 300;
    resize: none;
    height: 24px;
    max-height: 180px;
    overflow-y: auto;
    line-height: 1.5;
    padding-top: 6px;
    padding-bottom: 6px;
}

#chat-input::placeholder {
    color: var(--text-muted);
}

#send-btn {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    border: none;
    outline: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

#send-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

#send-btn:active {
    transform: scale(0.96);
}

#send-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.send-icon {
    width: 16px;
    height: 16px;
    fill: #ffffff;
    transform: translateX(1px);
}

/* RIGHT PANEL: Artifacts Pane */
.artifact-pane {
    height: 100%;
}

.artifact-header {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 2rem 1.25rem 2rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.015);
}

.artifact-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.artifact-tabs {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.85rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    padding: 0.35rem 0.8rem;
    border-radius: 99px;
    font-size: 0.76rem;
    cursor: pointer;
    font-weight: 400;
    transition: all 0.25s ease;
    font-family: var(--font-family);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.tab-btn.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.35);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.artifact-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Artifact Markdown Formats */
.artifact-content h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
}

.artifact-content h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.artifact-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.artifact-content p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-weight: 300;
}

.artifact-content blockquote {
    background: rgba(255, 255, 255, 0.01);
    border-left: 3.5px solid var(--accent-indigo);
    padding: 0.65rem 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}
.artifact-content blockquote p {
    margin-bottom: 0;
    color: var(--text-primary);
}

.artifact-content ul, .artifact-content ol {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.artifact-content li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.4rem;
    font-weight: 300;
}

/* Gorgeous checked list checklist */
.artifact-content li.checked-task {
    text-decoration: line-through;
    color: var(--text-muted);
}

.artifact-content pre {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.78rem;
}

.artifact-content pre code {
    color: var(--text-primary);
}

/* Placeholders */
.artifact-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 4rem 1.5rem;
    font-weight: 300;
}

.placeholder-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.3;
}

.artifact-placeholder p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Professional IDE Collapsible Tool Cards styling */
.message-bubble.alki-tool {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.006);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 90%;
    padding: 0.85rem 1.15rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.message-bubble.alki-tool:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

/* Tool Hues mapping */
.message-bubble.alki-tool.command { border-left-color: var(--accent-cyan); }
.message-bubble.alki-tool.directory { border-left-color: var(--accent-amber); }
.message-bubble.alki-tool.file-view { border-left-color: var(--accent-purple); }
.message-bubble.alki-tool.code-edit { border-left-color: var(--accent-indigo); }
.message-bubble.alki-tool.search { border-left-color: var(--accent-pink); }
.message-bubble.alki-tool.plan { border-left-color: var(--accent-emerald); }

/* Tool Header */
.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    width: 100%;
}

.tool-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.tool-icon {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.tool-header-title {
    color: var(--text-primary);
}

/* Tool Status Badges */
.tool-meta-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tool-status-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.tool-status-badge.success {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.08);
}

.tool-status-badge.failed {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.08);
}

.tool-status-badge.running {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--accent-amber);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.08);
    animation: blink 2s infinite ease-in-out;
}

.tool-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
}

.tool-header:hover .tool-chevron {
    color: var(--text-secondary);
}

.message-bubble.alki-tool.expanded .tool-chevron {
    transform: rotate(180deg);
}

/* Tool details */
.tool-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin 0.3s ease;
    width: 100%;
}

.message-bubble.alki-tool.expanded .tool-details {
    max-height: 500px;
    opacity: 1;
    margin-top: 0.75rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.03);
    padding-top: 0.75rem;
}

.tool-details pre {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 380px;
    overflow-y: auto;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes blink {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive grid modifications */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 400px;
        height: auto;
        max-height: none;
        overflow-y: auto;
        padding: 2rem 1rem;
    }
    body {
        overflow-y: auto;
        height: auto;
    }
    .glass-element {
        height: 600px;
    }
}

/* ==========================================================================
   Alki v3.0 Premium Core Upgrade Styles (En Üst Nokta)
   ========================================================================== */

/* 1. Header controls and Sound Toggle */
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.control-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.4rem 0.85rem;
    border-radius: 99px;
    font-size: 0.72rem;
    cursor: pointer;
    font-family: var(--font-family);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.control-btn.muted {
    border-color: rgba(239, 68, 68, 0.15);
    color: var(--text-muted);
}
.control-btn.muted:hover {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

/* 2. Microphone Input Button inside Chat Bar */
.input-icon-btn {
    background: none;
    border: none;
    outline: none;
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-right: 0.35rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 1.15rem;
}

.input-icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-cyan);
    transform: scale(1.1);
}

.input-icon-btn.recording {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulse-recording 1.5s infinite alternate ease-in-out;
    color: var(--accent-red);
}

@keyframes pulse-recording {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(239, 68, 68, 0.2); }
    100% { transform: scale(1.1); box-shadow: 0 0 15px rgba(239, 68, 68, 0.6); }
}

/* 3. Clickable File Path Tags */
.file-link-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    margin: 0 0.15rem;
    font-weight: 500;
}

.file-link-tag:hover {
    background: rgba(6, 182, 212, 0.18);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
    transform: translateY(-1px);
}

.file-link-tag::before {
    content: "📂";
    font-size: 0.75rem;
}

/* 4. Interactive Quick Reply Pill Buttons */
.quick-reply-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.quick-reply-pill {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 500;
    font-family: var(--font-family);
}

.quick-reply-pill:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.45);
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

/* 5. Live Tool Execution Banner at the bottom of the chat */
.live-execution-banner {
    background: rgba(8, 9, 14, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 12px;
    padding: 0.65rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(6, 182, 212, 0.05);
    animation: pulse-execution-border 2s infinite alternate ease-in-out, slideUp 0.3s ease;
    margin: 0.5rem 0;
    width: 100%;
}

@keyframes pulse-execution-border {
    0% { border-color: rgba(6, 182, 212, 0.15); }
    100% { border-color: rgba(6, 182, 212, 0.45); }
}

.exec-text-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.exec-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: blink 1s infinite ease-in-out;
}

.exec-running-spinner {
    width: 12px;
    height: 12px;
    border: 1.5px solid rgba(6, 182, 212, 0.2);
    border-top: 1.5px solid var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
}

/* 6. Floating Copy & Run Commands Action Bar inside Code Blocks */
.code-block-wrapper {
    position: relative;
    margin: 0.85rem 0;
}

.code-block-wrapper pre {
    margin: 0 !important;
}

.code-action-bar {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.35rem;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(-2px);
    z-index: 5;
}

.code-block-wrapper:hover .code-action-bar {
    opacity: 1;
    transform: translateY(0);
}

.code-action-btn {
    background: rgba(12, 13, 20, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 0.72rem;
    transition: all 0.2s ease;
}

.code-action-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.45);
    color: var(--text-primary);
    transform: scale(1.05);
}

/* 7. New Tab: 📂 File Viewer */
.file-viewer-path-header {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-path-text {
    font-family: Consolas, Monaco, monospace;
    color: var(--accent-cyan);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
}

.file-viewer-actions {
    display: flex;
    gap: 0.5rem;
}

.file-viewer-code-container {
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.file-viewer-code-container pre {
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 1.5rem !important;
    max-height: 520px;
    overflow-y: auto;
}

/* Text-to-speech speak button inside chat bubbles */
.speech-btn {
    background: none;
    border: none;
    outline: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
}

.speech-btn:hover {
    color: var(--accent-indigo);
    transform: scale(1.15);
}

.bubble-meta-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    width: 100%;
}

.message-bubble.user .speech-btn {
    color: rgba(255, 255, 255, 0.5);
}
.message-bubble.user .speech-btn:hover {
    color: #ffffff;
}

/* Premium Project Selector Dropdown Styling */
.project-selector-wrapper {
    margin-top: 0.35rem;
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 260px;
}

.project-dropdown {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    padding: 0.45rem 2rem 0.45rem 0.85rem !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    outline: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    width: 100% !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.project-dropdown:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(6, 182, 212, 0.4) !important;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

.project-dropdown:focus {
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
    background: rgba(15, 23, 42, 0.9) !important; /* Dark solid option panel background */
}

/* Dropdown list option styling override (for standard browser dropdown lists) */
.project-dropdown option {
    background: #0f172a;
    color: var(--text-primary);
    padding: 0.5rem;
    font-size: 0.85rem;
}

/* Custom interactive cyan caret element inside wrapper */
.project-selector-wrapper::after {
    content: "▼";
    font-size: 0.65rem;
    color: var(--accent-cyan);
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: transform 0.2s ease;
}

.project-selector-wrapper:hover::after {
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

/* ==========================================================================
   Alki IDE v4.0 Workspace System Styles (Full Three-Panel Split Grid Layout)
   ========================================================================== */

/* Header Override */
.ide-header {
    height: 55px;
    min-height: 55px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
    border-radius: 0; /* Align flat to top */
    z-index: 10;
    background: rgba(12, 13, 20, 0.7);
}

.ide-header .header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ide-header .logo-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.ide-header .logo-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
}

/* IDE Split Panel Grid Layout */
.ide-grid {
    display: grid;
    grid-template-columns: 250px 1fr 380px;
    height: calc(100vh - 55px);
    width: 100vw;
    background: transparent;
    z-index: 1;
    overflow: hidden;
}

/* Sidebar panel */
.ide-sidebar {
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    border-right: 1px solid var(--border-glass);
    background: rgba(8, 9, 14, 0.5);
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.sidebar-section {
    padding: 0 1rem;
}

.sidebar-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.project-selector-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0;
}

.project-dropdown {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 0.78rem !important;
    padding: 0.35rem 1.8rem 0.35rem 0.65rem !important;
}

/* File explorer tree styles */
.explorer-tree {
    margin-top: 0.5rem;
}

.explorer-list {
    list-style: none;
    padding-left: 0;
}

.explorer-item {
    margin: 0.25rem 0;
}

.explorer-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    user-select: none;
}

.explorer-label:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.explorer-icon {
    font-size: 0.9rem;
    width: 1rem;
    text-align: center;
}

.explorer-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-contents {
    padding-left: 0.75rem;
    margin-left: 0.5rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.folder-contents.collapsed {
    display: none;
}

/* Center Editor Panel Workspace */
.ide-editor-workspace {
    border-radius: 0;
    border: none;
    background: rgba(5, 5, 8, 0.3);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-right: 1px solid var(--border-glass);
}

/* Editor tabs bar */
.editor-tabs-bar {
    display: flex;
    height: 35px;
    min-height: 35px;
    background: rgba(12, 13, 20, 0.75);
    border-bottom: 1px solid var(--border-glass);
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.editor-tabs-bar::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.editor-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.85rem;
    height: 100%;
    border-right: 1px solid var(--border-glass);
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(12, 13, 20, 0.4);
    transition: all 0.2s ease;
    user-select: none;
    border-bottom: 2px solid transparent;
}

.editor-tab:hover {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.editor-tab.active {
    background: rgba(5, 5, 8, 0.4);
    color: var(--text-primary);
    border-bottom-color: var(--accent-indigo);
    font-weight: 500;
}

.tab-title {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-close-icon {
    font-size: 0.85rem;
    width: 14px;
    height: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.tab-close-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.placeholder-tab {
    cursor: default;
    border-bottom-color: transparent !important;
}

/* Editor Viewport Content styling */
.artifact-content.scrollable-panel {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
}

.artifact-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.artifact-placeholder h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.artifact-placeholder p {
    font-size: 0.85rem;
    max-width: 420px;
    line-height: 1.5;
}

/* Tab contents styles - code or rendered markdown */
.file-viewer-path-header {
    margin-bottom: 1rem;
}

.file-viewer-code-container pre {
    max-height: none !important; /* Full height scroll under panel container */
}

/* Collapsible Integrated CLI Terminal Console */
.terminal-panel {
    border-top: 1px solid var(--border-glass);
    background: rgba(5, 5, 8, 0.9);
    display: flex;
    flex-direction: column;
    height: 240px; /* Default height */
    min-height: 50px;
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
}

/* Toggle expansion states */
.terminal-panel.collapsed {
    height: 50px !important;
}

.terminal-panel.expanded {
    height: 480px !important;
}

.terminal-header {
    height: 50px;
    min-height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    background: rgba(12, 13, 20, 0.95);
    border-bottom: 1px solid var(--border-glass);
    cursor: pointer;
    user-select: none;
}

.terminal-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-icon {
    font-size: 1rem;
}

.terminal-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.terminal-controls {
    display: flex;
    align-items: center;
}

.terminal-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.terminal-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.terminal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.terminal-scroller {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent-emerald);
    line-height: 1.5;
}

.terminal-stdout {
    color: var(--text-secondary);
}

.terminal-prompt-bar {
    display: flex;
    align-items: center;
    height: 50px;
    min-height: 50px;
    border-top: 1px solid var(--border-glass);
    background: rgba(12, 13, 20, 0.95);
    padding: 0 1.5rem;
    gap: 0.75rem;
}

.terminal-prompt-prefix {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent-indigo);
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
}

.terminal-prompt-bar .input-glow-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    transition: all 0.3s ease;
}

.terminal-prompt-bar .input-glow-wrapper:focus-within {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
    background: rgba(0, 0, 0, 0.2);
}

.terminal-prompt-bar input[type="text"] {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    padding: 0.25rem 0.5rem;
}

.terminal-prompt-bar input[type="text"]::placeholder {
    color: var(--text-muted);
}

.terminal-prompt-bar button {
    background: var(--accent-indigo);
    border: none;
    outline: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-prompt-bar button:hover {
    background: #4f46e5;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

/* Floating Autocomplete Slash Suggestions */
.slash-suggest-menu {
    position: absolute;
    bottom: 55px;
    left: 95px;
    width: 320px;
    background: rgba(12, 13, 20, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.slash-suggest-menu.active {
    display: flex;
}

.slash-item {
    display: flex;
    flex-direction: column;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.slash-item:last-child {
    border-bottom: none;
}

.slash-item:hover, .slash-item.active {
    background: rgba(99, 102, 241, 0.12);
}

.slash-cmd {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent-cyan);
    font-weight: 600;
}

.slash-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* Panel 3 AI Copilot Chat & Workspace Status Sidebar */
.ide-copilot {
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-right: none;
    border-left: 1px solid var(--border-glass);
    background: rgba(8, 9, 14, 0.5);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Copilot Tab buttons */
.copilot-tabs-bar {
    display: flex;
    height: 40px;
    min-height: 40px;
    background: rgba(12, 13, 20, 0.8);
    border-bottom: 1px solid var(--border-glass);
}

.copilot-tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-bottom: 2px solid transparent;
}

.copilot-tab-btn:hover {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.copilot-tab-btn.active {
    background: rgba(5, 5, 8, 0.3);
    color: var(--text-primary);
    border-bottom-color: var(--accent-cyan);
}

.copilot-chat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.01);
}

.copilot-chat-header h3 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.copilot-header-icon {
    font-size: 0.95rem;
}

/* Copilot Chat Message Container */
.ide-copilot .messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ide-copilot .message-bubble {
    max-width: 100% !important; /* Take full sidebar width */
}

/* Responsive grid modifications for IDE mode */
@media (max-width: 1200px) {
    .ide-grid {
        grid-template-columns: 200px 1fr 340px;
    }
}

@media (max-width: 992px) {
    .ide-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 250px 1fr 380px;
        height: auto;
        overflow-y: auto;
    }
    .ide-sidebar, .ide-editor-workspace, .ide-copilot {
        height: 600px;
        border: 1px solid var(--border-glass);
        border-radius: 12px;
        margin: 0.5rem 1rem;
    }
    body {
        overflow-y: auto;
        height: auto;
    }
}

/* =========================================================================
   PROJECTS TREE VIEW & NESTED SIDEBAR STYLES
   ========================================================================= */

.projects-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-action-btn {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-cyan);
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.sidebar-action-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
    transform: translateY(-1px);
}

.projects-tree-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* Scrollbar styling for projects tree */
.projects-tree-container::-webkit-scrollbar {
    width: 4px;
}
.projects-tree-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.project-group-node {
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
    overflow: hidden;
    transition: all 0.2s ease;
}

.project-group-node:hover {
    border-color: rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
}

.project-group-header {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    user-select: none;
    gap: 0.5rem;
}

.project-group-chevron {
    font-size: 0.65rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    width: 10px;
    text-align: center;
}

.project-group-chevron.expanded {
    transform: rotate(90deg);
}

.project-group-icon {
    font-size: 0.9rem;
}

.project-group-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.project-group-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.project-group-header:hover .project-group-actions {
    opacity: 1;
}

.project-action-icon {
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.15rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.project-action-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.project-group-content {
    padding: 0.25rem 0.5rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.project-group-content.collapsed {
    display: none;
}

/* Collapsible sub-sections: Chat history & File Explorer */
.sub-section-node {
    margin-top: 0.25rem;
    border-radius: 6px;
    overflow: hidden;
}

.sub-section-header {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.sub-section-header:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.sub-section-chevron {
    font-size: 0.55rem;
    transition: transform 0.2s ease;
    width: 8px;
    text-align: center;
}

.sub-section-chevron.expanded {
    transform: rotate(90deg);
}

.sub-section-content {
    padding-left: 0.5rem;
    margin-left: 0.25rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.04);
}

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

/* Chat Items under Chat History */
.chat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-item-node {
    margin: 0.2rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    gap: 0.4rem;
}

.chat-item-node:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.chat-item-node.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.08);
}

.chat-item-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    overflow: hidden;
}

.chat-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    flex-shrink: 0;
}

.chat-item-node.active .chat-item-dot {
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: active-glow 2s infinite ease-in-out;
}

@keyframes active-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.chat-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item-actions {
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-item-node:hover .chat-item-actions {
    opacity: 1;
}

/* Glass Project Assignment Dropdown Menu */
.project-assign-dropdown {
    position: absolute;
    z-index: 1000;
    background: rgba(18, 18, 29, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.1);
    min-width: 160px;
    max-width: 240px;
    overflow: hidden;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    animation: dropdown-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdown-fade-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.project-assign-dropdown-header {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.3rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 0.2rem;
}

.project-assign-dropdown-item {
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.project-assign-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.25);
    color: var(--text-primary);
}

.project-assign-dropdown-item.active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    font-weight: 500;
}

/* --- MULTIMODAL IMAGE UPLOAD & ATTACHMENT UPGRADES --- */

.terminal-prompt-bar {
    height: auto !important;
    min-height: 50px !important;
    padding: 0.5rem 1.5rem !important;
}

.terminal-prompt-bar #attach-btn {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-right: 4px !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.terminal-prompt-bar #attach-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    transform: scale(1.05) !important;
}

.terminal-prompt-bar .attach-icon {
    width: 18px !important;
    height: 18px !important;
    fill: var(--text-muted) !important;
    transition: fill 0.2s ease !important;
}

.terminal-prompt-bar #attach-btn:hover .attach-icon {
    fill: var(--accent-indigo) !important;
}

/* Image Preview Container styles */
.image-preview-container {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    margin-bottom: 6px;
    width: 100%;
    align-items: center;
}

.image-preview-card {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.image-preview-card:hover {
    transform: scale(1.05);
}

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

.image-preview-card .remove-preview-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    transition: background 0.2s ease;
    z-index: 10;
}

.image-preview-card .remove-preview-btn:hover {
    background: rgba(239, 68, 68, 1);
}

/* Image Attachment inside chat bubble */
.attached-image-wrap {
    margin-top: 8px;
    display: inline-block;
    max-width: 100%;
}

.attached-image {
    max-width: 240px;
    max-height: 180px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.attached-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

/* Glassmorphic Lightbox / Modal for Image full screen view */
.image-lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(12, 13, 20, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
    pointer-events: none;
}

.image-lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.image-lightbox-modal img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-lightbox-modal.active img {
    transform: scale(1);
}

/* Approval Toast Animations */
@keyframes slide-up-toast {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slide-down-toast-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(30px) scale(0.95); }
}

