/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #1a1b23;
    color: #e5e7eb;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Left Sidebar Navigation */
.sidebar {
    width: 80px;
    min-width: 80px;
    height: 100vh;
    background-color: #252631;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    border-right: 1px solid #3d3e4f;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 0; }

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 0;
    margin: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #9ca3af;
    position: relative;
    border-left: 4px solid transparent;
}

.nav-item:hover {
    background-color: #7c3aed;
    color: #ffffff;
}

.nav-item.active {
    background-color: #4b5563;
    color: #ffffff;
    border-left-color: #8b5cf6;
}

.nav-item.active:hover {
    background-color: #4b5563;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
}

.nav-spacer {
    flex: 1;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #1a1b23;
}

/* Top Header */
.header {
    height: 32px;
    border-bottom: 1px solid #3d3e4f;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #252631;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #e5e7eb;
    display: none;
}

/* Content */
.content {
    flex: 1;
    padding: 32px 48px;
    overflow-y: auto;
}

/* Knowledge Bases Styles */
.rag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.rag-title {
    font-size: 28px;
    font-weight: 600;
    color: #e5e7eb;
}

.create-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: #8b5cf6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.create-button:hover {
    background-color: #7c3aed;
}

.create-button svg {
    width: 16px;
    height: 16px;
}

/* Search */
.search-container {
    margin-bottom: 24px;
}

.search-wrapper {
    position: relative;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: #8b5cf6;
}

.search-input::placeholder {
    color: #9ca3af;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #3d3e4f;
    margin-bottom: 24px;
}

.tab {
    padding: 12px 16px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab:hover {
    color: #e5e7eb;
}

.tab.active {
    color: #ffffff;
    border-bottom-color: #8b5cf6;
}

/* Knowledge Bases Table */
.rag-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.rag-table thead th {
    text-align: left;
    padding: 12px 16px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.rag-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.rag-table tbody tr:hover td {
    background-color: #2d2e3f;
}

.rag-table tbody td {
    padding: 16px;
    background-color: #252631;
    border: 1px solid #3d3e4f;
    transition: background-color 0.2s ease;
    vertical-align: middle;
}

.rag-table tbody tr td:first-child {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.rag-table tbody tr td:last-child {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.rag-table tbody tr td:not(:first-child):not(:last-child) {
    border-left: none;
    border-right: none;
}

.checkbox-cell {
    width: 40px;
    text-align: center;
    vertical-align: middle;
}

.checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.status-cell {
    width: 50px;
    text-align: center;
    vertical-align: middle;
}

.status-icon {
    width: 16px;
    height: 16px;
    color: #8b5cf6;
}

.env-name {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.database-badge, .chunker-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.database-badge {
    background-color: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.chunker-badge {
    background-color: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.tech-icon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.milvus-icon {
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"%3E%3Cpath fill="%2333b5e5" d="M150,200 L150,450 Q150,480 180,480 L270,480 Q280,480 290,470 L450,300 L610,470 Q620,480 630,480 L720,480 Q750,480 750,450 L750,200 Q750,150 700,150 L600,150 Q580,150 565,165 Q535,195 500,230 Q450,280 450,280 Q450,280 400,230 Q365,195 335,165 Q320,150 300,150 L200,150 Q150,150 150,200 Z M450,360 Q480,390 480,390 Q490,380 500,370 L570,300 L500,230 Q490,220 480,210 Q480,210 450,240 L380,300 L450,360 Z M850,300 L780,360 Q770,370 770,380 Q770,390 780,400 L850,460 Q860,470 870,460 Q880,450 870,440 L820,400 L870,360 Q880,350 870,340 Q860,330 850,340 Z M50,300 L120,240 Q130,230 130,220 Q130,210 120,200 L50,140 Q40,130 30,140 Q20,150 30,160 L80,200 L30,240 Q20,250 30,260 Q40,270 50,260 Z"%3E%3C/path%3E%3C/svg%3E');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 0;
}

.chroma-icon {
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"%3E%3Ccircle cx="170" cy="256" r="150" fill="%234285f4"/%3E%3Ccircle cx="342" cy="256" r="150" fill="%23ff6b6b"/%3E%3Ccircle cx="256" cy="170" r="150" fill="%23ffd93d"/%3E%3C/svg%3E');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 0;
}

.actions-cell {
    width: 120px;
    vertical-align: middle;
}

.actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-button {
    width: 32px;
    height: 32px;
    background-color: #374151;
    border: none;
    border-radius: 6px;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-button:hover {
    background-color: #4b5563;
    color: #e5e7eb;
}

.action-button.delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.sources-cell {
    width: 80px;
    text-align: center;
}

.sources-count {
    display: inline-block;
    padding: 2px 8px;
    background-color: #374151;
    color: #9ca3af;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background-color: #252631;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #3d3e4f;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #e5e7eb;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #e5e7eb;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.form-section {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-color: #8b5cf6;
}

.tiles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tile {
    padding: 16px;
    background-color: #2d2e3f;
    border: 2px solid #3d3e4f;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tile:hover {
    border-color: #8b5cf6;
    background-color: #374151;
}

.tile.selected {
    border-color: #8b5cf6;
    background-color: rgba(139, 92, 246, 0.1);
}

.tile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.tile-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.milvus-logo {
    background-color: transparent;
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.milvus-logo::before {
    content: '';
    width: 32px;
    height: 32px;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"%3E%3Cpath fill="%2333b5e5" d="M150,200 L150,450 Q150,480 180,480 L270,480 Q280,480 290,470 L450,300 L610,470 Q620,480 630,480 L720,480 Q750,480 750,450 L750,200 Q750,150 700,150 L600,150 Q580,150 565,165 Q535,195 500,230 Q450,280 450,280 Q450,280 400,230 Q365,195 335,165 Q320,150 300,150 L200,150 Q150,150 150,200 Z M450,360 Q480,390 480,390 Q490,380 500,370 L570,300 L500,230 Q490,220 480,210 Q480,210 450,240 L380,300 L450,360 Z M850,300 L780,360 Q770,370 770,380 Q770,390 780,400 L850,460 Q860,470 870,460 Q880,450 870,440 L820,400 L870,360 Q880,350 870,340 Q860,330 850,340 Z M50,300 L120,240 Q130,230 130,220 Q130,210 120,200 L50,140 Q40,130 30,140 Q20,150 30,160 L80,200 L30,240 Q20,250 30,260 Q40,270 50,260 Z"%3E%3C/path%3E%3C/svg%3E');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.chroma-logo {
    background-color: transparent;
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chroma-logo::before {
    content: '';
    width: 28px;
    height: 28px;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"%3E%3Ccircle cx="170" cy="256" r="150" fill="%234285f4"/%3E%3Ccircle cx="342" cy="256" r="150" fill="%23ff6b6b"/%3E%3Ccircle cx="256" cy="170" r="150" fill="%23ffd93d"/%3E%3C/svg%3E');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.docling-logo {
    background: linear-gradient(135deg, #ff9500, #ffb800);
}

.huggingface-logo {
    background: linear-gradient(135deg, #00b4d8, #0096c7);
}

.tile-title {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.tile-description {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #3d3e4f;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-secondary {
    background-color: #374151;
    color: #e5e7eb;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-primary {
    background-color: #8b5cf6;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #7c3aed;
}

.btn-primary:disabled {
    background-color: #6b7280;
    cursor: not-allowed;
}

/* Chat UI Styles */
.chat-layout {
    display: flex;
    height: 100vh;
    background-color: #1a1b23;
}

.chat-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1a1b23 0%, #1e1f2b 100%);
    border-right: 1px solid #3d3e4f;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
}

.chat-sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.chat-sidebar-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-sidebar-title {
    font-size: 20px;
    font-weight: 600;
    color: #e5e7eb;
    margin: 0;
    letter-spacing: -0.02em;
}

.new-chat-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #8b5cf6;
    color: #ffffff;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    background: #7c3aed;
    transform: scale(1.05);
}

.new-chat-btn:active {
    transform: scale(0.95);
}

.chat-section-header {
    padding: 16px 16px 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Custom Scrollbar for Chat Sessions */
.chat-sessions-list::-webkit-scrollbar {
    width: 6px;
}

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

.chat-sessions-list::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

.chat-sessions-list::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

.chat-session-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 2px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    position: relative;
}

.chat-session-item:hover {
    background: rgba(139, 92, 246, 0.08);
}

.chat-session-item.active {
    background: rgba(139, 92, 246, 0.15);
}

.chat-session-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-session-title {
    font-size: 13px;
    font-weight: 500;
    color: #e5e7eb;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-session-item.active .chat-session-title {
    font-weight: 600;
    color: #ffffff;
}

.chat-session-preview {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-session-item:hover .chat-session-preview {
    color: #a78bfa;
}

.chat-session-item.active .chat-session-preview {
    color: #c4b5fd;
}

.chat-session-time {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    min-width: fit-content;
}

.chat-session-item:hover .chat-session-time {
    color: #9ca3af;
}

.chat-session-item.active .chat-session-time {
    color: #a78bfa;
}

.chat-sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.delete-chats-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 8px;
    width: 100%;
}

.delete-chats-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1b23 0%, #252631 100%);
    position: relative;
    overflow: visible;
}

/* Conversation Header */
.conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(26, 27, 35, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.conversation-title-section {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-size: 18px;
    font-weight: 600;
    color: #e5e7eb;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-subtitle {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.conversation-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.conversation-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

.conversation-action-btn:active {
    transform: scale(0.95);
}

.conversation-delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.chat-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.chat-tool-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-tool-btn:hover {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-color: #8b5cf6;
    color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.model-selector {
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.model-selector:hover {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.model-selector:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Knowledge Selector Styles */
.knowledge-selector-wrapper {
    position: relative;
}

.knowledge-selector-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 200px;
}

.knowledge-selector-button:hover {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.knowledge-selector-button.open {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.knowledge-selector-current {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.knowledge-icon-small {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

.chevron-icon {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    transition: transform 0.3s ease;
}

.knowledge-selector-button.open .chevron-icon {
    transform: rotate(180deg);
}

.knowledge-selector-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.knowledge-selector-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.knowledge-panel-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.knowledge-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.knowledge-panel-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.knowledge-options {
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.knowledge-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    width: 100%;
    text-align: left;
}

.knowledge-option:last-child {
    margin-bottom: 0;
}

.knowledge-option:hover {
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    border-color: #8b5cf6;
    transform: translateX(2px);
}

.knowledge-option.selected {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #8b5cf6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.knowledge-option-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f3f4f6;
}

.knowledge-option-icon svg {
    width: 18px;
    height: 18px;
    color: #6b7280;
}

.knowledge-option-icon.milvus-icon,
.knowledge-option-icon.chroma-icon {
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.knowledge-option-content {
    flex: 1;
    min-width: 0;
}

.knowledge-option-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 2px;
}

.knowledge-option-desc {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

.knowledge-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.knowledge-sources {
    font-size: 11px;
    color: #9ca3af;
}

.knowledge-option-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.knowledge-option.selected .knowledge-option-check {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
}

.knowledge-option-check svg {
    width: 12px;
    height: 12px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.knowledge-option.selected .knowledge-option-check svg {
    opacity: 1;
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0 24px;
    background: transparent;
    position: relative;
    overflow: visible;
}

.chat-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
}

.chat-empty-state {
    text-align: center;
    max-width: 800px;
    width: 100%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-icon-large {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    color: #d1d5db;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.chat-suggestions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
    width: 100%;
    max-width: 800px;
}

.chat-suggestion {
    padding: 16px 20px;
    border: 1px solid #4b5563;
    border-radius: 12px;
    background: linear-gradient(135deg, #374151 0%, #2d2e3f 100%);
    color: #e5e7eb;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.chat-suggestion::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-suggestion:hover {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.chat-suggestion:hover::before {
    opacity: 1;
}

.chat-suggestion-title {
    font-weight: 600;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.chat-suggestion-desc {
    font-size: 12px;
    color: #9ca3af;
    position: relative;
    z-index: 1;
}

/* Chat Messages */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 32px;
    max-width: 100%;
    width: 100%;
    margin: 0;
    overflow-y: auto;
    overflow-x: visible;
    z-index: 1;
    scroll-behavior: smooth;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.3) 0%, rgba(124, 58, 237, 0.3) 100%);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.5) 0%, rgba(124, 58, 237, 0.5) 100%);
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.message-content:has(.message-bubble > .tool-usage-indicator:only-child) {
    align-items: center;
}

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

.user-message .message-content {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #8b5cf6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 5px;
}

.message-avatar svg {
    width: 14px;
    height: 14px;
    color: #ffffff;
}

.message-bubble {
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

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

.message-bubble code {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

.message-bubble code.inline-code {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.message-bubble a {
    color: #a78bfa;
    text-decoration: none;
    border-bottom: 1px solid rgba(167, 139, 250, 0.3);
    transition: all 0.2s ease;
}

.message-bubble a:hover {
    color: #c4b5fd;
    border-bottom-color: #c4b5fd;
}

.assistant-message .message-bubble {
    background: transparent;
    border: none;
    color: #e5e7eb;
    border-radius: 8px;
}

.user-message .message-bubble {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #e5e7eb;
    border-radius: 8px;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    padding: 0 12px;
    opacity: 0.7;
    display: none;
}

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

/* Tool Usage Indicator */
.tool-usage-wrapper {
    width: 100%;
    max-width: none;
}

.tool-usage-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin: 0;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    font-size: 11px;
    color: #a78bfa;
    margin-bottom: 0;
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-usage-indicator:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
}

.tool-usage-indicator.expanded {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.5);
}

.tool-usage-indicator.processing {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.2);
    opacity: 0.8;
}

.tool-usage-indicator.processing .loading-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

.tool-chevron {
    transition: transform 0.2s ease;
}

.tool-usage-indicator.expanded .tool-chevron {
    transform: rotate(90deg);
}

.tool-usage-indicator svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.tool-details-panel {
    margin: 0;
    padding: 0 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 6px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: scaleY(0.95);
    transform-origin: top;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s ease,
                margin 0.3s ease,
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.tool-details-panel.expanded {
    max-height: 1000px;
    opacity: 1;
    padding: 0;
    margin: 8px 0 0;
    transform: scaleY(1);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3),
                0 4px 12px rgba(139, 92, 246, 0.15);
}

/* Tool Tabs */
.tool-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.tool-details-panel.expanded .tool-tabs {
    opacity: 1;
    transform: translateY(0);
}

.tool-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-tab:hover {
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.05);
}

.tool-tab.active {
    color: #a78bfa;
    border-bottom-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
}

.tool-tab-content {
    padding: 12px;
}

.tool-tab-pane {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tool-tab-pane.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.tool-details-panel.expanded .tool-tab-pane.active {
    animation: fadeInTab 0.3s ease 0.2s both;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-detail-code {
    font-size: 11px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    color: #e5e7eb;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    margin: 0;
    line-height: 1.5;
    white-space: pre;
}

.tool-detail-code::-webkit-scrollbar {
    height: 6px;
}

.tool-detail-code::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.tool-detail-code::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

.tool-detail-code::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

.message-bubble:has(.tool-usage-wrapper) {
    padding: 0;
    max-width: 100%;
    width: 100%;
}

.message-content:has(.message-bubble > .tool-usage-wrapper) {
    align-items: center;
    width: 100%;
    max-width: 100%;
}

.message-content:has(.message-bubble > .tool-usage-wrapper) .message-avatar {
    display: none;
}

.chat-message:has(.tool-usage-wrapper) {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* Message List */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding-left: 10px;
    border-left: 2px solid rgba(139, 92, 246, 0.2);
}

.message-list-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 12px;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.message-list-item:hover {
    background: transparent;
}

.message-list-item strong {
    color: #a78bfa;
    font-weight: 600;
    font-size: 11px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.message-meta {
    font-size: 10px;
    color: #9ca3af;
    opacity: 0.7;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

/* Thinking Bubble & Tool Execution */
.thinking-bubble {
    background: transparent !important;
    border: none !important;
    animation: thinkingPulse 2s ease-in-out infinite;
    padding: 4px 0 !important;
}

@keyframes thinkingPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.tool-execution-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-left: 2px solid rgba(139, 92, 246, 0.3);
    padding-left: 12px;
    margin: 4px 0;
}

.tool-execution-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-execution-icon svg {
    width: 12px;
    height: 12px;
    color: #a78bfa;
}

.tool-execution-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.tool-execution-name {
    font-size: 11px;
    color: #e5e7eb;
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.tool-execution-status {
    font-size: 11px;
    color: #9ca3af;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

/* Tool Badges */
.message-tools {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 4px;
    font-size: 10px;
    color: #9ca3af;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.tool-badge svg {
    opacity: 0.6;
    flex-shrink: 0;
}

/* Loading Dots Animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.loading-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #a78bfa;
    animation: loadingDots 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes loadingDots {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    30% {
        transform: scale(1.4);
        opacity: 1;
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 18px 22px !important;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9ca3af;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.typing-indicator-message {
    animation: typingSlideIn 0.3s ease-out;
}

@keyframes typingSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-input-area {
    padding: 12px 32px 16px;
    background: transparent;
    position: relative;
}

.chat-input-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.chat-input-wrapper {
    display: flex;
    flex-direction: column;
    background: #2d2e3f;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px 14px;
    gap: 8px;
    transition: all 0.2s ease;
    background-image: 
        linear-gradient(#2d2e3f, #2d2e3f),
        linear-gradient(90deg, #a78bfa, #8b5cf6, #7c3aed);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.chat-input-wrapper:focus-within {
    background-image: 
        linear-gradient(#343545, #343545),
        linear-gradient(90deg, #a78bfa, #8b5cf6, #7c3aed);
}

/* Main Input Area (Top Section) */
.chat-input-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

/* Context Metadata (Top Right) */
.chat-context-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 4px 0;
}

.context-size {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    white-space: nowrap;
}

.context-progress {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.context-progress-bar {
    height: 100%;
    background: #8b5cf6;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Bottom Controls Row */
.chat-input-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 4px;
}

.chat-input-field {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #e5e7eb;
    background: transparent;
    resize: none;
    min-height: 20px;
    max-height: 120px;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.chat-input-field:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.chat-input-field::placeholder {
    color: #6b7280;
}

.chat-send-btn {
    width: 28px;
    height: 28px;
    background: #8b5cf6;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.chat-send-btn svg {
    width: 14px;
    height: 14px;
}

.chat-send-btn:hover {
    background: #7c3aed;
    transform: scale(1.05);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    background: #4b5563;
    cursor: not-allowed;
    transform: none;
}

/* Chat Attachments Area - Attached above chat input */
.chat-attachments-area {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 24px;
    right: 24px;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    pointer-events: none;
}

.chat-attachments-area > * {
    pointer-events: auto;
}

.chat-attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(45, 46, 63, 0.98);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    animation: attachmentSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.2s ease;
    max-width: 500px;
    margin: 0 auto;
    cursor: pointer;
}

@keyframes attachmentSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-attachment-item:hover {
    background: rgba(45, 46, 63, 1);
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateY(-1px);
}

.chat-attachment-item:active {
    transform: translateY(0);
}

.chat-attachment-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.chat-attachment-icon svg {
    color: #a78bfa;
}

.chat-attachment-icon.flow-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
}

.chat-attachment-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-attachment-name {
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-attachment-meta {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-attachment-action {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chat-attachment-action:hover {
    background: rgba(139, 92, 246, 0.25);
    color: #c4b5fd;
}

.chat-attachment-action:active {
    transform: scale(0.95);
}

.chat-attachment-close {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chat-attachment-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.chat-attachment-close:active {
    transform: scale(0.9);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .chat-sidebar {
        width: 240px;
    }
    
    .chat-suggestions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .chat-sidebar {
        display: none;
    }
    
    .conversation-header {
        padding: 12px 16px;
    }
    
    .conversation-title {
        font-size: 16px;
    }
    
    .conversation-subtitle {
        font-size: 12px;
    }
    
    .conversation-action-btn {
        width: 32px;
        height: 32px;
    }
    
    .chat-input-area {
        padding: 12px 16px 16px;
    }
    
    .chat-content {
        padding: 32px 0 16px;
    }
    
    .chat-messages {
        padding: 12px 16px;
    }
    
    .chat-message:has(.tool-usage-wrapper) {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .tool-usage-indicator {
        margin: 0;
    }
    
    .tool-details-panel {
        margin: 0;
    }
    
    .tool-details-panel.expanded {
        margin: 8px 0 0;
    }
    
    .message-bubble {
        max-width: 100%;
    }
    
    .chat-attachments-area {
        left: 12px;
        right: 12px;
        bottom: calc(100% + 6px);
    }
    
    .chat-attachment-item {
        padding: 8px 10px;
        gap: 8px;
        max-width: calc(100% - 24px);
    }
    
    .chat-attachment-icon {
        width: 28px;
        height: 28px;
    }
    
    .chat-attachment-name {
        font-size: 12px;
    }
    
    .chat-attachment-meta {
        font-size: 10px;
    }
    
    .chat-input-wrapper {
        padding: 10px 12px;
    }
    
    .chat-input-main {
        gap: 8px;
    }
    
    .chat-input-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .context-size {
        font-size: 10px;
    }
    
    .context-progress {
        width: 50px;
    }
}

/* Loading animation for messages */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.message-loading {
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 12px;
    height: 60px;
}

/* Smooth transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus states */
button:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Flow Export Modal Styles */
.flow-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.flow-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.flow-modal {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.flow-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 16px 16px 0 0;
}

.flow-modal-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.flow-modal-breadcrumb span:last-child {
    color: #1f2937;
    font-weight: 500;
}

.flow-modal-breadcrumb svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

.flow-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.flow-modal-close:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.flow-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px 24px;
    background: #ffffff;
}

.flow-modal-body::-webkit-scrollbar {
    width: 8px;
}

.flow-modal-body::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.flow-modal-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.flow-modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.flow-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.flow-info-box {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
}

.flow-info-box p {
    font-size: 13px;
    line-height: 1.6;
    color: #1e40af;
    margin: 0 0 8px 0;
}

.flow-info-box p:last-child {
    margin-bottom: 0;
}

.flow-info-box strong {
    font-weight: 600;
}

.flow-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.flow-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.flow-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    letter-spacing: -0.01em;
}

.flow-form-input,
.flow-form-select,
.flow-form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    color: #1f2937;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.flow-form-input:focus,
.flow-form-select:focus,
.flow-form-textarea:focus {
    background: #ffffff;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.flow-form-input::placeholder,
.flow-form-textarea::placeholder {
    color: #9ca3af;
}

.flow-form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.flow-form-textarea.large {
    min-height: 120px;
}

.flow-form-select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 40px;
}

.flow-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 0 0 16px 16px;
}

.flow-btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.flow-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.flow-btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.flow-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.flow-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

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

/* Responsive adjustments for flow modal */
@media (max-width: 768px) {
    .flow-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .flow-modal-body {
        padding: 24px 16px;
    }
    
    .flow-form-row {
        grid-template-columns: 1fr;
    }
    
    .flow-modal-title {
        font-size: 20px;
    }
}

/* Flow Create Page Styles */
.flow-create-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.flow-create-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.flow-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.flow-breadcrumb-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.flow-breadcrumb-link:hover {
    color: #8b5cf6;
}

.flow-breadcrumb-current {
    color: #1f2937;
    font-weight: 500;
}

.flow-breadcrumb svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

.flow-close-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.flow-close-btn:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.flow-create-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 32px;
}

.flow-create-content::-webkit-scrollbar {
    width: 8px;
}

.flow-create-content::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.flow-create-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.flow-create-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.flow-create-container {
    max-width: 900px;
    margin: 0 auto;
}

.flow-create-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.flow-create-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.flow-create-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Input Fields Styles */
.input-fields-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.input-fields-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.detect-input-fields-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #4b5563;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.detect-input-fields-btn:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.detect-input-fields-btn svg {
    width: 14px;
    height: 14px;
}

.add-input-field-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
}

.add-input-field-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.add-input-field-btn svg {
    width: 14px;
    height: 14px;
}

.input-fields-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border: 1px solid #fbbf24;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
}

.input-fields-info svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
    color: #d97706;
}

.input-fields-info code {
    background: rgba(217, 119, 6, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    color: #b45309;
}

.input-fields-table-container {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.input-fields-table {
    width: 100%;
    border-collapse: collapse;
}

.input-fields-table thead {
    background: #f9fafb;
}

.input-fields-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.input-fields-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.input-fields-table tbody tr:last-child {
    border-bottom: none;
}

.input-fields-table tbody tr:hover {
    background: #f9fafb;
}

.input-fields-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #374151;
}

.input-field-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.input-field-type-badge[data-type="text"] {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    color: #1e40af;
}

.input-field-type-badge[data-type="number"] {
    background: linear-gradient(135deg, #d1fae5 0%, #d1f2eb 100%);
    color: #065f46;
}

.input-field-type-badge[data-type="boolean"] {
    background: linear-gradient(135deg, #fce7f3 0%, #fdf2f8 100%);
    color: #9f1239;
}

.input-field-type-badge[data-type="enum"] {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    color: #92400e;
}

.input-field-type-badge svg {
    width: 14px;
    height: 14px;
}

.input-field-description {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-field-description strong {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.input-field-description span {
    font-size: 13px;
    color: #6b7280;
}

.input-field-required-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
    color: #dc2626;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-top: 4px;
}

.input-field-default-value {
    font-size: 13px;
    color: #6b7280;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.input-field-actions {
    display: flex;
    gap: 6px;
}

.input-field-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.input-field-action-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.input-field-action-btn.edit:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    border-color: #3b82f6;
    color: #1e40af;
}

.input-field-action-btn.delete:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
    border-color: #ef4444;
    color: #dc2626;
}

.input-fields-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    text-align: center;
}

.input-fields-empty svg {
    color: #d1d5db;
    margin-bottom: 16px;
}

.input-fields-empty p {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}

.input-fields-empty-hint {
    font-size: 13px;
    color: #9ca3af;
}

/* Compact Input Fields Section */
.input-fields-empty.compact {
    padding: 32px 24px;
}

.input-fields-empty.compact svg {
    margin-bottom: 12px;
}

.input-fields-empty.compact p {
    font-size: 13px;
    margin-bottom: 6px;
}

.input-fields-empty.compact .input-fields-empty-hint {
    font-size: 12px;
}

.input-fields-table-container.compact {
    max-height: 250px;
    overflow-y: auto;
}

.input-fields-table-container.compact::-webkit-scrollbar {
    width: 6px;
}

.input-fields-table-container.compact::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.input-fields-table-container.compact::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.input-fields-table-container.compact::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Input Field Modal Styles */
.input-field-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-field-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.input-field-modal {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-field-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 16px 16px 0 0;
}

.input-field-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.input-field-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.input-field-modal-close:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.input-field-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #ffffff;
}

.input-field-modal-body::-webkit-scrollbar {
    width: 6px;
}

.input-field-modal-body::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.input-field-modal-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.input-field-modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.input-field-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-field-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-field-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.required {
    color: #dc2626;
}

.input-field-form-input,
.input-field-form-select,
.input-field-form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    color: #1f2937;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.input-field-form-input:focus,
.input-field-form-select:focus,
.input-field-form-textarea:focus {
    background: #ffffff;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-field-form-textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}

.input-field-form-select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
}

/* Field Type Tiles */
.field-type-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.field-type-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: #f9fafb;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
    min-height: 85px;
}

.field-type-tile:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.field-type-tile.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.field-type-tile.active svg {
    stroke: #ffffff;
}

.field-type-tile.active span {
    color: #ffffff;
}

.field-type-tile svg {
    stroke: #6b7280;
    transition: all 0.2s ease;
}

.field-type-tile span {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
}

.input-field-form-hint {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.input-field-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
}

.input-field-form-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8b5cf6;
}

.input-field-checkbox-wrapper span {
    font-size: 14px;
    color: #374151;
    user-select: none;
}

.input-field-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 0 0 16px 16px;
}

/* Prompt Editor Container */
.prompt-editor-container {
    position: relative;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    width: 320px;
    max-height: 250px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    animation: popoverFadeIn 0.15s ease-out;
}

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

.autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.1s ease;
    border-bottom: 1px solid #f3f4f6;
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 100%);
}

.autocomplete-item:active {
    background: linear-gradient(135deg, #ddd6fe 0%, #ede9fe 100%);
}

.autocomplete-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.autocomplete-field-name {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.autocomplete-field-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.autocomplete-field-type[data-type="text"] {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    color: #1e40af;
}

.autocomplete-field-type[data-type="number"] {
    background: linear-gradient(135deg, #d1fae5 0%, #d1f2eb 100%);
    color: #065f46;
}

.autocomplete-field-type[data-type="boolean"] {
    background: linear-gradient(135deg, #fce7f3 0%, #fdf2f8 100%);
    color: #9f1239;
}

.autocomplete-field-type[data-type="enum"] {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    color: #92400e;
}

.autocomplete-field-desc {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-empty {
    padding: 16px 14px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

/* Selection Field Menu */
.selection-field-menu {
    position: fixed;
    display: none;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    min-width: 280px;
    max-width: 320px;
    max-height: 400px;
    overflow: hidden;
}

.selection-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    border-bottom: 1px solid transparent;
}

.selection-menu-btn:hover {
    background: #f9fafb;
}

.selection-menu-btn.create-new {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 8px 8px 0 0;
}

.selection-menu-btn.create-new:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.selection-menu-btn.create-new svg {
    stroke: #ffffff;
}

.selection-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.selection-menu-fields {
    max-height: 300px;
    overflow-y: auto;
}

.selection-menu-fields::-webkit-scrollbar {
    width: 6px;
}

.selection-menu-fields::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.selection-menu-fields::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.selection-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border-radius: 6px;
    flex-shrink: 0;
}

.selection-field-icon svg {
    width: 16px;
    height: 16px;
    stroke: #6b7280;
}

.selection-field-icon[data-type="text"] {
    background: #dbeafe;
}

.selection-field-icon[data-type="text"] svg {
    stroke: #2563eb;
}

.selection-field-icon[data-type="number"] {
    background: #d1fae5;
}

.selection-field-icon[data-type="number"] svg {
    stroke: #059669;
}

.selection-field-icon[data-type="boolean"] {
    background: #fef3c7;
}

.selection-field-icon[data-type="boolean"] svg {
    stroke: #d97706;
}

.selection-field-icon[data-type="enum"] {
    background: #fce7f3;
}

.selection-field-icon[data-type="enum"] svg {
    stroke: #db2777;
}

.selection-field-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.selection-field-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.selection-field-desc {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Run Flow Modal Styles */
.run-flow-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.run-flow-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.run-flow-modal {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.run-flow-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 16px 16px 0 0;
}

.run-flow-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.run-flow-modal-close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.run-flow-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.run-flow-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #ffffff;
}

.run-flow-modal-body::-webkit-scrollbar {
    width: 6px;
}

.run-flow-modal-body::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.run-flow-modal-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.run-flow-modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.run-flow-modal-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.run-flow-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.run-flow-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.run-flow-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.required-badge {
    font-size: 11px;
    font-weight: 600;
    color: #dc2626;
    background: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.run-flow-input,
.run-flow-select {
    width: 100%;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    color: #1f2937;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.run-flow-input:focus,
.run-flow-select:focus {
    background: #ffffff;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.run-flow-input.error,
.run-flow-select.error {
    border-color: #dc2626;
    background: #fef2f2;
}

.run-flow-select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
}

.run-flow-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.run-flow-checkbox-wrapper:hover {
    background: #f3f4f6;
}

.run-flow-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8b5cf6;
}

.run-flow-checkbox-wrapper span {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.run-flow-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 0 0 16px 16px;
}

.flow-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.flow-btn-secondary {
    background: #ffffff;
    color: #374151;
    border: 1.5px solid #d1d5db;
}

.flow-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.flow-btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

.flow-btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.flow-btn-primary svg {
    width: 14px;
    height: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .flow-create-content {
        padding: 24px 16px;
    }
    
    .flow-create-header {
        padding: 16px 20px;
    }
    
    .flow-create-title {
        font-size: 24px;
    }
    
    .input-field-modal {
        width: 95%;
    }
    
    .autocomplete-dropdown {
        max-height: 200px;
    }
    
    .selection-field-menu {
        min-width: 240px;
        max-width: 280px;
    }
    
    .selection-menu-btn.create-new {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Input Tools and Model Selector Styles */
.input-tools-selector-wrapper,
.input-model-selector-wrapper,
.input-knowledge-selector-wrapper {
    position: relative;
}

.input-tools-selector-btn,
.input-model-selector-btn,
.input-knowledge-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 6px;
    color: #a78bfa;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.input-tools-selector-btn:hover,
.input-model-selector-btn:hover,
.input-knowledge-selector-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.input-tools-selector-btn.open,
.input-model-selector-btn.open,
.input-knowledge-selector-btn.open {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
}

.input-tools-selector-btn svg,
.input-model-selector-btn svg,
.input-knowledge-selector-btn svg {
    flex-shrink: 0;
}

.input-tools-count,
.input-knowledge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #8b5cf6;
    color: #ffffff;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
}

.input-chevron-icon {
    width: 12px;
    height: 12px;
    color: #a78bfa;
    transition: transform 0.2s ease;
}

.input-model-selector-btn.open .input-chevron-icon,
.input-knowledge-selector-btn.open .input-chevron-icon {
    transform: rotate(180deg);
}

/* Tools Panel */
.input-tools-panel,
.input-model-panel,
.input-knowledge-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 320px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-tools-panel.open,
.input-model-panel.open,
.input-knowledge-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.input-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.input-panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 2px 0;
}

.input-panel-header p {
    font-size: 11px;
    color: #6b7280;
    margin: 0;
}

/* Auto-select Toggle */
.tools-auto-select {
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.auto-select-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.auto-select-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #8b5cf6;
}

.auto-select-label {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
    user-select: none;
}

/* Filter Tools */
.tools-filter {
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
}

.filter-icon {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    flex-shrink: 0;
}

.filter-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: #1f2937;
}

.filter-input::placeholder {
    color: #9ca3af;
}

/* MCP Server Groups */
.mcp-server-group {
    border-bottom: 1px solid #e5e7eb;
}

.mcp-server-group:last-child {
    border-bottom: none;
}

.mcp-server-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #ffffff;
    transition: all 0.2s ease;
}

.mcp-server-header:hover {
    background: #f9fafb;
}

.mcp-server-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #8b5cf6;
    flex-shrink: 0;
}

.mcp-server-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.mcp-server-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mcp-server-icon svg {
    width: 18px;
    height: 18px;
    color: #6b7280;
}

.mcp-server-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.mcp-server-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.mcp-server-desc {
    font-size: 11px;
    color: #6b7280;
}

.mcp-server-chevron {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.mcp-server-main.expanded .mcp-server-chevron {
    transform: rotate(180deg);
}

/* MCP Server Tools List */
.mcp-server-tools {
    display: none;
    padding: 4px 16px 8px 50px;
    background: #fafafa;
}

.mcp-server-tools.expanded {
    display: block;
}

.input-tools-options,
.input-model-options,
.input-knowledge-options {
    padding: 0;
    max-height: 450px;
    overflow-y: auto;
}

/* Tool Option */
.input-tool-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    width: 100%;
    text-align: left;
}

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

.input-tool-option:hover {
    background: #f3f4f6;
}

.input-tool-option.selected {
    background: #ede9fe;
}

.input-tool-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f3f4f6;
}

.input-tool-icon svg {
    width: 18px;
    height: 18px;
    color: #374151;
}

.input-tool-option.selected .input-tool-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.input-tool-option.selected .input-tool-icon svg {
    color: #ffffff;
}

.input-tool-content {
    flex: 1;
    min-width: 0;
}

.input-tool-name {
    font-size: 12px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 1px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.input-tool-desc {
    font-size: 10px;
    color: #9ca3af;
}

.input-tool-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.input-tool-option.selected .input-tool-check {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
}

.input-tool-check svg {
    width: 12px;
    height: 12px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.input-tool-option.selected .input-tool-check svg {
    opacity: 1;
}

/* Model Panel */
.input-model-panel {
    min-width: 280px;
}

.input-model-group {
    padding: 8px 0;
}

.input-model-group:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.input-model-group-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px 6px;
}

.input-model-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 4px 2px;
    width: calc(100% - 8px);
    text-align: left;
}

.input-model-option:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.input-model-option.selected {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #8b5cf6;
}

.input-model-info {
    flex: 1;
    min-width: 0;
}

.input-model-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 2px;
}

.input-model-desc {
    font-size: 11px;
    color: #6b7280;
}

.input-model-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.input-model-option.selected .input-model-check {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
}

.input-model-check svg {
    width: 10px;
    height: 10px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.input-model-option.selected .input-model-check svg {
    opacity: 1;
}

/* Knowledge Options */
.input-knowledge-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 4px 2px;
    width: calc(100% - 8px);
    text-align: left;
}

.input-knowledge-option:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.input-knowledge-option.selected {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #8b5cf6;
}

.input-knowledge-info {
    flex: 1;
    min-width: 0;
}

.input-knowledge-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 2px;
}

.input-knowledge-desc {
    font-size: 11px;
    color: #6b7280;
}

.input-knowledge-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.input-knowledge-option.selected .input-knowledge-check {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
}

.input-knowledge-check svg {
    width: 10px;
    height: 10px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.input-knowledge-option.selected .input-knowledge-check svg {
    opacity: 1;
}

/* Chat input wrapper uses flex layout with gap defined above */

/* Tools Sidebar (Right) */
.tools-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #252631 0%, #1e1f2b 100%);
    border-left: 1px solid #3d3e4f;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tools-sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-left: none;
}

.tools-sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid #3d3e4f;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(139, 92, 246, 0.05);
}

.tools-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
    margin: 0;
}

.tools-toggle-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tools-toggle-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #e5e7eb;
}

/* Auto-select Section */
.tools-auto-select-section {
    padding: 12px 16px;
    border-bottom: 1px solid #3d3e4f;
    background: rgba(139, 92, 246, 0.05);
}

.tools-auto-select-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.tools-auto-select-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8b5cf6;
}

.tools-auto-select-label {
    font-size: 12px;
    font-weight: 500;
    color: #c4b5fd;
    user-select: none;
}

/* Search Bar */
.tools-search-section {
    padding: 12px 16px;
    border-bottom: 1px solid #3d3e4f;
    background: rgba(0, 0, 0, 0.2);
}

.tools-search-wrapper {
    position: relative;
}

.tools-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.tools-search-input {
    width: 100%;
    padding: 8px 10px 8px 32px;
    background: rgba(37, 38, 49, 0.8);
    border: 1px solid #3d3e4f;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 12px;
    outline: none;
    transition: all 0.2s ease;
}

.tools-search-input:focus {
    border-color: #8b5cf6;
    background: rgba(37, 38, 49, 1);
}

.tools-search-input::placeholder {
    color: #6b7280;
}

.tools-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.tools-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.tools-sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.tools-sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

.tools-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

.mcp-server-section {
    margin-bottom: 12px;
    border: 1px solid #3d3e4f;
    border-radius: 8px;
    background: rgba(37, 38, 49, 0.5);
    overflow: hidden;
}

.mcp-server-header-item {
    padding: 12px;
    background: rgba(139, 92, 246, 0.08);
    border-bottom: 1px solid #3d3e4f;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mcp-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8b5cf6;
    flex-shrink: 0;
}

.mcp-server-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
}

.mcp-server-label svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.mcp-server-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.mcp-server-name {
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
}

.mcp-server-desc {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 400;
}

.mcp-tools-list {
    padding: 8px 12px 12px 12px;
}

.tool-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-item:hover {
    background: rgba(139, 92, 246, 0.1);
}

.tool-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #8b5cf6;
    flex-shrink: 0;
    margin-top: 2px;
}

.tool-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.tool-name {
    font-size: 12px;
    color: #9ca3af;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    line-height: 1.3;
}

.tool-description {
    font-size: 10px;
    color: #6b7280;
    line-height: 1.3;
}

.tool-item:has(.tool-checkbox:checked) {
    background: rgba(139, 92, 246, 0.15);
}

.tool-item:has(.tool-checkbox:checked) .tool-name {
    color: #c4b5fd;
    font-weight: 500;
}

.tool-item:has(.tool-checkbox:checked) .tool-description {
    color: #9ca3af;
}

/* No Results */
.tools-no-results {
    padding: 40px 20px;
    text-align: center;
}

.tools-no-results svg {
    color: #4b5563;
    margin-bottom: 12px;
}

.tools-no-results p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.tools-sidebar-footer {
    padding: 16px;
    border-top: 1px solid #3d3e4f;
    background: rgba(0, 0, 0, 0.2);
}

.tools-count-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #c4b5fd;
}

.tools-count-badge span {
    font-size: 16px;
    font-weight: 700;
    color: #a78bfa;
}

/* Responsive adjustments for input selectors */
@media (max-width: 768px) {
    .input-tools-selector-btn,
    .input-model-selector-btn,
    .input-knowledge-selector-btn {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .input-tools-panel,
    .input-model-panel,
    .input-knowledge-panel {
        min-width: 280px;
        max-width: calc(100vw - 40px);
    }
    
    .tools-sidebar {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
    }
}

/* ================================
   MCP Catalog Styles
   ================================ */

.mcp-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.mcp-card {
    background: linear-gradient(145deg, #2d2e3f 0%, #252631 100%);
    border: 1px solid #3d3e4f;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.mcp-card:hover {
    transform: translateY(-4px);
    border-color: #8b5cf6;
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15),
                0 4px 12px rgba(0, 0, 0, 0.3);
}

.mcp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 20px 0;
}

.mcp-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mcp-card-icon svg {
    width: 100%;
    height: 100%;
}

/* Brand-specific icon backgrounds */
.mcp-card-icon.rhel-icon {
    background: linear-gradient(135deg, #CC0000 0%, #8B0000 100%);
}

.mcp-card-icon.openshift-icon {
    background: linear-gradient(135deg, #DB212E 0%, #A30000 100%);
}

.mcp-card-icon.github-icon {
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
}

.mcp-card-icon.ansible-icon {
    background: linear-gradient(135deg, #1A1918 0%, #000 100%);
}

.mcp-card-icon.podman-icon {
    background: linear-gradient(135deg, #892CA0 0%, #46237A 100%);
}

.mcp-card-icon.kubernetes-icon {
    background: linear-gradient(135deg, #326CE5 0%, #1D4ED8 100%);
}

.mcp-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mcp-card-status.installed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.15) 100%);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.mcp-card-status.available {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.15) 100%);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.mcp-card-status.disabled {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.2) 0%, rgba(75, 85, 99, 0.15) 100%);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Internal/Business Badge */
.internal-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.15) 0%, rgba(234, 88, 12, 0.1) 100%);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.internal-badge svg {
    width: 12px;
    height: 12px;
}

/* Internal badge for MCP cards - positioned in header */
.mcp-card-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* Internal badge variant for skills table */
.skill-internal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.15) 0%, rgba(234, 88, 12, 0.1) 100%);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-left: 8px;
}

.skill-internal-badge svg {
    width: 10px;
    height: 10px;
}

/* Internal MCP icon styling */
.mcp-card-icon.internal-icon {
    background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
}

.mcp-card-icon.accounting-icon {
    background: linear-gradient(135deg, #0891B2 0%, #0E7490 100%);
}

.mcp-card-icon.sap-icon {
    background: linear-gradient(135deg, #0066B3 0%, #004E8C 100%);
}

.mcp-card-icon.french-gov-icon {
    background: linear-gradient(135deg, #000091 0%, #000066 100%);
}

/* Skill icon variants for internal */
.skill-icon.internal {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
}

.skill-icon.french-gov {
    background: linear-gradient(135deg, #000091, #1e3a8a);
    color: #ffffff;
}

.skill-icon.accounting {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    color: #ffffff;
}

.mcp-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mcp-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 10px 0;
    letter-spacing: -0.01em;
}

.mcp-card-description {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.6;
    margin: 0 0 16px 0;
    flex: 1;
}

.mcp-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mcp-card-version {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    background: rgba(107, 114, 128, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.mcp-card-tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
}

.mcp-card-tools svg {
    color: #a78bfa;
}

.mcp-card-footer {
    padding: 16px 20px;
    border-top: 1px solid #3d3e4f;
    background: rgba(0, 0, 0, 0.15);
}

.mcp-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.mcp-card-btn.configure {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(124, 58, 237, 0.1) 100%);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.mcp-card-btn.configure:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(124, 58, 237, 0.2) 100%);
    border-color: #8b5cf6;
    transform: translateY(-1px);
}

.mcp-card-btn.install {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.mcp-card-btn.install:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.mcp-card-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* MCP Details Page Styles */
.mcp-details-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.mcp-details-header {
    padding: 24px 32px;
    background: linear-gradient(180deg, #252631 0%, #1e1f2b 100%);
    border-bottom: 1px solid #3d3e4f;
}

.mcp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.mcp-breadcrumb a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mcp-breadcrumb a:hover {
    color: #a78bfa;
}

.mcp-breadcrumb svg {
    width: 14px;
    height: 14px;
    color: #6b7280;
}

.mcp-breadcrumb span {
    color: #e5e7eb;
    font-weight: 500;
}

.mcp-details-hero {
    display: flex;
    align-items: center;
    gap: 24px;
}

.mcp-details-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.mcp-details-icon svg {
    width: 100%;
    height: 100%;
}

.mcp-details-info {
    flex: 1;
}

.mcp-details-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.mcp-details-subtitle {
    font-size: 14px;
    color: #9ca3af;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.mcp-details-version {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    background: rgba(107, 114, 128, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.mcp-details-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mcp-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mcp-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.mcp-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background: #4b5563;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mcp-toggle.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.mcp-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mcp-toggle.active .mcp-toggle-knob {
    transform: translateX(24px);
}

.mcp-details-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.mcp-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.mcp-config-section {
    background: linear-gradient(145deg, #2d2e3f 0%, #252631 100%);
    border: 1px solid #3d3e4f;
    border-radius: 16px;
    padding: 24px;
}

.mcp-config-section.full-width {
    grid-column: 1 / -1;
}

.mcp-config-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.mcp-config-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mcp-config-section-title svg {
    width: 20px;
    height: 20px;
    color: #a78bfa;
}

.mcp-form-group {
    margin-bottom: 20px;
}

.mcp-form-group:last-child {
    margin-bottom: 0;
}

.mcp-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mcp-form-input {
    width: 100%;
    padding: 12px 16px;
    background: #1a1b23;
    border: 1px solid #3d3e4f;
    border-radius: 10px;
    color: #e5e7eb;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mcp-form-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.mcp-form-input::placeholder {
    color: #6b7280;
}

.mcp-form-input.code {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
}

.mcp-env-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mcp-env-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mcp-env-item .mcp-form-input {
    flex: 1;
}

.mcp-env-item .mcp-form-input:first-child {
    max-width: 200px;
}

.mcp-env-remove {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: #f87171;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mcp-env-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.mcp-add-env-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px dashed rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    color: #a78bfa;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.mcp-add-env-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.5);
}

/* MCP Tools List */
.mcp-tools-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mcp-tool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #3d3e4f;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.mcp-tool-item:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.3);
}

.mcp-tool-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
    cursor: pointer;
}

.mcp-tool-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    color: #a78bfa;
}

.mcp-tool-info {
    flex: 1;
}

.mcp-tool-name {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 2px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.mcp-tool-description {
    font-size: 12px;
    color: #9ca3af;
}

/* MCP Save Actions */
.mcp-save-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: linear-gradient(180deg, #1e1f2b 0%, #252631 100%);
    border-top: 1px solid #3d3e4f;
}

.mcp-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #f87171;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mcp-delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.mcp-save-group {
    display: flex;
    gap: 12px;
}

.mcp-cancel-btn {
    padding: 12px 24px;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 10px;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mcp-cancel-btn:hover {
    background: #4b5563;
}

.mcp-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.mcp-save-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* Responsive MCP Styles */
@media (max-width: 1024px) {
    .mcp-config-grid {
        grid-template-columns: 1fr;
    }
    
    .mcp-config-section.full-width {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .mcp-catalog-grid {
        grid-template-columns: 1fr;
    }
    
    .mcp-details-header {
        padding: 20px;
    }
    
    .mcp-details-hero {
        flex-direction: column;
        text-align: center;
    }
    
    .mcp-details-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .mcp-toggle-wrapper {
        justify-content: center;
    }
    
    .mcp-details-content {
        padding: 20px;
    }
    
    .mcp-save-actions {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }
    
    .mcp-save-group {
        width: 100%;
    }
    
    .mcp-cancel-btn,
    .mcp-save-btn {
        flex: 1;
    }
}

/* ==========================================
   Global Status Bar (Bottom of Application)
   ========================================== */

.global-status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: linear-gradient(180deg, #1e1f29 0%, #1a1b23 100%);
    border-top: 1px solid #3d3e4f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 1000;
    font-size: 12px;
}

.status-bar-left,
.status-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    cursor: default;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.status-bar-item svg {
    opacity: 0.7;
}

.status-bar-item.openshift-status {
    cursor: pointer;
    background: rgba(238, 0, 0, 0.08);
    border: 1px solid transparent;
}

.status-bar-item.openshift-status:hover {
    background: rgba(238, 0, 0, 0.15);
    border-color: rgba(238, 0, 0, 0.3);
    color: #e5e7eb;
}

.status-bar-item.openshift-status svg {
    color: #EE0000;
    opacity: 1;
}

.status-bar-item.openshift-status.connected {
    background: rgba(34, 197, 94, 0.1);
}

.status-bar-item.openshift-status.connected:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.status-bar-item.openshift-status.connected svg {
    color: #22c55e;
}

.status-bar-item.openshift-status.connected .status-bar-dot {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.status-bar-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6b7280;
    flex-shrink: 0;
}

/* Adjust main content for status bar */
.app-container {
    padding-bottom: 28px;
}

.main-content {
    min-height: calc(100vh - 28px);
}

/* Pulse animation for connected state */
@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
    50% { box-shadow: 0 0 10px rgba(34, 197, 94, 0.8); }
}

.status-bar-item.openshift-status.connected .status-bar-dot {
    animation: pulse-green 2s infinite;
}

/* OpenShift AI Modal */
.openshift-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.openshift-modal-overlay.show {
    display: flex;
}

.openshift-modal {
    background: linear-gradient(145deg, #2d2e3f 0%, #252631 100%);
    border: 1px solid #3d3e4f;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.openshift-modal-header {
    padding: 24px;
    border-bottom: 1px solid #3d3e4f;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.openshift-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #EE0000 0%, #CC0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.openshift-modal-icon svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

.openshift-modal-header-info h2 {
    font-size: 18px;
    font-weight: 600;
    color: #e5e7eb;
    margin: 0 0 4px 0;
}

.openshift-modal-header-info p {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

.openshift-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.openshift-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

.openshift-modal-body {
    padding: 24px;
}

.openshift-form-group {
    margin-bottom: 20px;
}

.openshift-form-group:last-child {
    margin-bottom: 0;
}

.openshift-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.openshift-form-input {
    width: 100%;
    padding: 12px 16px;
    background: #1a1b23;
    border: 1px solid #3d3e4f;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.openshift-form-input:focus {
    outline: none;
    border-color: #EE0000;
    box-shadow: 0 0 0 3px rgba(238, 0, 0, 0.15);
}

.openshift-form-input::placeholder {
    color: #6b7280;
}

.openshift-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #3d3e4f;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.openshift-modal-cancel {
    padding: 10px 20px;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.openshift-modal-cancel:hover {
    background: #4b5563;
}

.openshift-modal-submit {
    padding: 10px 24px;
    background: linear-gradient(135deg, #EE0000 0%, #CC0000 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.openshift-modal-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(238, 0, 0, 0.3);
}

.openshift-modal-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Internal assets visibility */
.internal-asset {
    display: none;
}

body.openshift-connected .internal-asset {
    display: flex;
}

/* For table rows */
tr.internal-asset {
    display: none;
}

body.openshift-connected tr.internal-asset {
    display: table-row;
}

/* Internal tab visibility */
.tab.internal-tab {
    display: none;
}

body.openshift-connected .tab.internal-tab {
    display: inline-flex;
}

/* ==========================================
   Agent Feed Panel (Status Bar Drawer)
   ========================================== */

.agent-feed-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 28px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1500;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.agent-feed-overlay.show {
    display: block;
    opacity: 1;
}

.agent-feed-panel {
    position: fixed;
    bottom: 28px;
    left: 0;
    right: 0;
    height: 75vh;
    max-height: calc(100vh - 56px);
    background: linear-gradient(180deg, #21222e 0%, #1a1b25 100%);
    border-top: 1px solid #3d3e4f;
    z-index: 1501;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.agent-feed-panel.show {
    transform: translateY(0);
    pointer-events: auto;
}

.agent-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 12px;
    border-bottom: 1px solid #2d2e3f;
    flex-shrink: 0;
}

.agent-feed-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-feed-title {
    font-size: 16px;
    font-weight: 700;
    color: #e5e7eb;
    letter-spacing: -0.01em;
}

.agent-feed-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #34d399;
}

.agent-feed-badge .feed-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    animation: pulse-green 2s infinite;
}

.agent-feed-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s ease;
}

.agent-feed-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

.agent-feed-tabs {
    display: flex;
    gap: 2px;
    padding: 0 24px;
    border-bottom: 1px solid #2d2e3f;
    flex-shrink: 0;
}

.agent-feed-tab {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.agent-feed-tab:hover {
    color: #9ca3af;
}

.agent-feed-tab.active {
    color: #c4b5fd;
    border-bottom-color: #8b5cf6;
}

.agent-feed-stream {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

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

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

.agent-feed-stream::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.2);
    border-radius: 3px;
}

/* Feed card */
/* ── Feed Card ─────────────────────────────────── */
.feed-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
}

.feed-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.feed-card.needs-input {
    border-left: 2px solid #f59e0b;
    background: rgba(245, 158, 11, 0.03);
}

.feed-card.needs-input:hover {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    border-left-color: #f59e0b;
}

/* ── Card top row: progress ring + content + actions ── */
.feed-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.feed-card-info {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

/* ── Progress ring ── */
.feed-progress-ring {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    position: relative;
}

.feed-progress-ring svg {
    width: 44px;
    height: 44px;
    transform: rotate(-90deg);
}

.feed-progress-ring .ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 3;
}

.feed-progress-ring .ring-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.feed-progress-ring .ring-fill.running { stroke: #60a5fa; }
.feed-progress-ring .ring-fill.waiting { stroke: #f59e0b; }
.feed-progress-ring .ring-fill.paused { stroke: #6b7280; }
.feed-progress-ring .ring-fill.completed { stroke: #4ade80; }

.feed-progress-ring .ring-fill.running {
    animation: ring-glow-blue 2.5s ease-in-out infinite;
}

@keyframes ring-glow-blue {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(96, 165, 250, 0.3)); }
    50% { filter: drop-shadow(0 0 5px rgba(96, 165, 250, 0.6)); }
}

.feed-progress-ring .ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    transform: none;
}

.feed-progress-ring .ring-center.running { color: #93c5fd; }
.feed-progress-ring .ring-center.waiting { color: #fcd34d; }
.feed-progress-ring .ring-center.completed { color: #86efac; }

.feed-progress-ring .ring-check {
    width: 18px;
    height: 18px;
    stroke: #4ade80;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Completed cards: visually recede */
.feed-card[data-feed-status="completed"] {
    opacity: 0.6;
}

.feed-card[data-feed-status="completed"]:hover {
    opacity: 0.85;
}

/* ── Title & meta ── */
.feed-card-title-row {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.feed-card-goal {
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 2px;
}

.feed-card-meta .feed-status-label {
    font-weight: 500;
}

.feed-card-meta .feed-status-label.running { color: #93c5fd; }
.feed-card-meta .feed-status-label.waiting { color: #fcd34d; }
.feed-card-meta .feed-status-label.paused { color: #9ca3af; }
.feed-card-meta .feed-status-label.completed { color: #6b7280; }

.feed-card-meta .feed-meta-sep {
    color: #374151;
}

.feed-card-meta .feed-card-steps {
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.feed-card-time {
    color: #4b5563;
}

/* ── Context line (project + branch) — subdued ── */
.feed-card-context-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #4b5563;
    margin-top: 2px;
}

.feed-card-context-line .ctx-sep {
    color: #374151;
    margin: 0 2px;
}

.feed-card-context-line .ctx-branch {
    color: #6b7280;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 10px;
}

/* ── Card controls (pause/resume) ── */
.feed-card-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-top: 2px;
}

.feed-ctrl-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.feed-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    border-color: rgba(255, 255, 255, 0.12);
}

.feed-ctrl-btn svg {
    width: 12px;
    height: 12px;
}

/* ── Activity line ── */
.feed-card-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin-top: 8px;
    margin-left: 58px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border-left: 2px solid rgba(96, 165, 250, 0.3);
    font-size: 12px;
    color: #9ca3af;
}

.feed-card-activity svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.5;
}

.feed-card-activity .activity-spinner {
    animation: spin 1.8s linear infinite;
    opacity: 0.7;
}

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

.feed-card-activity-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #9ca3af;
}

/* ── Question section — warm amber, not red ── */
.feed-card-question {
    margin-top: 10px;
    margin-left: 58px;
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.03);
    overflow: hidden;
}

.feed-card-question-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.05);
    border-bottom: 1px solid rgba(245, 158, 11, 0.1);
}

.feed-card-question-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(245, 158, 11, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feed-card-question-icon svg {
    width: 12px;
    height: 12px;
    stroke: #f59e0b;
}

.feed-card-question-label {
    font-size: 11px;
    font-weight: 600;
    color: #fcd34d;
    letter-spacing: 0.01em;
}

.feed-card-question-body {
    padding: 10px 12px;
}

.feed-card-question-text {
    font-size: 12.5px;
    color: #d1d5db;
    line-height: 1.55;
    margin-bottom: 10px;
}

.feed-card-question-text code {
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    font-size: 11px;
    color: #c4b5fd;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.feed-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.feed-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.feed-action-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.feed-action-btn.primary {
    background: rgba(96, 165, 250, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.feed-action-btn.primary:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: rgba(96, 165, 250, 0.35);
}

.feed-action-btn.secondary {
    background: rgba(255, 255, 255, 0.04);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.feed-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
}

.feed-action-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.feed-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.18);
}

/* ── Quick reply input ── */
.feed-reply-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.feed-reply-input {
    flex: 1;
    padding: 7px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease;
}

.feed-reply-input:focus {
    border-color: rgba(96, 165, 250, 0.35);
}

.feed-reply-input::placeholder {
    color: #4b5563;
}

.feed-reply-send {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.15);
    color: #93c5fd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.feed-reply-send:hover {
    background: rgba(96, 165, 250, 0.2);
}

.feed-reply-send svg {
    width: 13px;
    height: 13px;
}

/* ── Status bar active state when feed is open ── */
.status-bar-item.agents-status.feed-open {
    background: rgba(139, 92, 246, 0.2) !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
}

.status-bar-item.agents-status.feed-open span {
    color: #c4b5fd !important;
}

/* ── Feed empty state ── */
.feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #4b5563;
}

.feed-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.feed-empty-text {
    font-size: 14px;
    color: #6b7280;
}

/* ── Agent Feed Page ── */
body.agent-feed-page .main-content {
    padding: 0;
}

body.agent-feed-page .main-content > .header {
    display: none;
}

/* ── Tasks Page: full-bleed three-panel layout ── */
body.tasks-page .main-content {
    padding: 0;
}

body.tasks-page .main-content > .header {
    display: none;
}

/* ── AI Assets Page ── */
body.ai-assets-page .content {
    padding: 32px 48px;
}
