/* Antigravity Studio & Agents Hub Design System with History */
:root {
    --bg-main: #0a0d14;
    --bg-surface: #101522;
    --bg-card: rgba(22, 28, 44, 0.7);
    --bg-card-hover: rgba(30, 39, 62, 0.85);
    --bg-input: #0d121c;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 210, 255, 0.35);
    
    --accent-cyan: #00d2ff;
    --accent-purple: #9d4edd;
    --accent-green: #00f59b;
    --accent-red: #ff4757;
    --accent-amber: #ffb703;
    
    --text-primary: #f0f4fc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 25px rgba(0, 210, 255, 0.2);
    
    --font-sans: 'Cairo', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(157, 78, 221, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(0, 210, 255, 0.08) 0%, transparent 45%);
}

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

/* Header */
.app-header {
    height: 64px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(16, 21, 34, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 20;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mob-drawer-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

.logo-orb {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

.orb-core {
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: var(--radius-full);
    box-shadow: 0 0 8px #ffffff;
}

.brand-text h1 {
    font-size: 1.05rem;
    font-weight: 700;
}

.accent-text {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sub-badge {
    font-size: 0.7rem;
    color: var(--accent-green);
    background: rgba(0, 245, 155, 0.1);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0, 245, 155, 0.2);
    font-weight: 600;
}

/* Nav Tabs */
.nav-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(10, 13, 20, 0.6);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-tab:hover { color: var(--text-primary); }

.nav-tab.active {
    background: var(--bg-card);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 210, 255, 0.3);
}

.tab-counter {
    background: rgba(157, 78, 221, 0.3);
    color: #e9d5ff;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
}

.header-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-toggle-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.35);
    color: #e0f2fe;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-toggle-header-btn:hover {
    background: rgba(0, 210, 255, 0.2);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.25);
}

.header-history-badge {
    background: var(--accent-cyan);
    color: #07090e;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.new-chat-top-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border: none;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.settings-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
}

/* App Main Content & Panels */
.app-main-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-panel {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.tab-panel.active { display: block; }

#panel-chat {
    overflow: hidden !important;
    height: 100%;
    max-height: 100%;
}

#panel-chat.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden !important;
}

/* PANEL 1: Chat Layout */
.chat-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    flex: 1;
}

.chat-sidebar {
    background: rgba(16, 21, 34, 0.55);
    border-inline-end: 1px solid var(--border-subtle);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.btn-new-conversation {
    width: 100%;
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.25), rgba(0, 210, 255, 0.25));
    border: 1px solid rgba(0, 210, 255, 0.4);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.15);
    transition: all 0.2s ease;
}

.btn-new-conversation:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(0, 210, 255, 0.3);
}

.active-agent-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-agent-icon { font-size: 1.4rem; }
.active-agent-info { flex: 1; display: flex; flex-direction: column; }
.active-agent-info strong { font-size: 0.86rem; color: var(--text-primary); }
.active-agent-info span { font-size: 0.72rem; color: var(--text-muted); }

.btn-tiny {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    cursor: pointer;
    font-family: inherit;
}

/* History List Block */
.history-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.section-title-row h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

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

.history-count {
    font-size: 0.72rem;
    color: var(--accent-cyan);
    background: rgba(0, 210, 255, 0.1);
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.btn-clear-all-history {
    background: none;
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--accent-red);
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-clear-all-history:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: var(--accent-red);
}

.conversations-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: 260px;
    padding-inline-end: 2px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 210, 255, 0.4);
    transform: translateX(-2px);
}

.history-item.active-chat {
    background: rgba(0, 210, 255, 0.12);
    border-color: var(--accent-cyan);
}

.history-item-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-right: 4px;
}

.btn-rename-history,
.btn-del-history {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px 5px;
    opacity: 0.45;
    transition: opacity 0.2s, color 0.2s, transform 0.15s;
    font-size: 0.82rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.history-item:hover .btn-rename-history,
.history-item:hover .btn-del-history { 
    opacity: 1; 
}

.btn-rename-history:hover { 
    color: var(--accent-cyan);
    transform: scale(1.18);
    background: rgba(0, 210, 255, 0.12);
}

.btn-del-history:hover { 
    color: var(--accent-red);
    transform: scale(1.18);
    background: rgba(255, 71, 87, 0.12);
}

.history-rename-box {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.history-rename-input {
    flex: 1;
    background: #080c14;
    border: 1px solid var(--accent-cyan);
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.8rem;
    padding: 3px 6px;
    outline: none;
    font-family: inherit;
    min-width: 0;
}

.btn-save-rename {
    background: rgba(0, 230, 118, 0.25);
    border: 1px solid #00e676;
    color: #00e676;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.76rem;
    padding: 2px 6px;
    font-weight: bold;
    line-height: 1.2;
}

.btn-cancel-rename {
    background: rgba(255, 71, 87, 0.25);
    border: 1px solid #ff4757;
    color: #ff4757;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.76rem;
    padding: 2px 6px;
    line-height: 1.2;
}

/* History Item ID Row */
.history-item-id-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    margin-bottom: 2px;
}

.badge-cli-id {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #00d2ff;
    background: rgba(0, 210, 255, 0.12);
    border: 1px solid rgba(0, 210, 255, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    letter-spacing: -0.01em;
    direction: ltr;
    font-weight: 500;
}

.badge-web-id {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 1px 6px;
    border-radius: 4px;
    direction: ltr;
}

.btn-copy-id-item {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.72rem;
    opacity: 0.45;
    transition: opacity 0.2s, transform 0.15s, color 0.2s;
}

.history-item:hover .btn-copy-id-item {
    opacity: 0.85;
}

.btn-copy-id-item:hover {
    opacity: 1;
    color: var(--accent-cyan);
    transform: scale(1.25);
}

.btn-copy-cli-cmd:hover {
    background: rgba(0, 210, 255, 0.35) !important;
    color: #ffffff !important;
    transform: scale(1.03);
}

.sidebar-block h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.quick-prompts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-prompt-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    text-align: right;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-prompt-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-cyan);
}

/* Chat Stream Section */
.chat-stream-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at 50% 50%, rgba(22, 28, 44, 0.3) 0%, transparent 80%);
}

.chat-messages-container {
    flex: 1 1 0;
    min-height: 0;
    height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    scroll-behavior: smooth;
}

.chat-messages-container::-webkit-scrollbar {
    width: 8px;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: rgba(10, 14, 23, 0.7);
    border-radius: 4px;
}

.chat-messages-container::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.35);
    border-radius: 4px;
    border: 1px solid rgba(0, 210, 255, 0.2);
}

.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.6);
}

.welcome-hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-soft);
    margin-bottom: 10px;
}

.hero-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.25);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 10px;
}

.hero-header h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.hero-header p { color: var(--text-secondary); font-size: 0.92rem; max-width: 700px; }

.hero-actions-row { display: flex; gap: 12px; margin-top: 16px; }

.btn-hero-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border: none;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.88rem;
}

.btn-hero-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.88rem;
}

/* Chat Messages */
.message-bubble {
    display: flex;
    gap: 14px;
    width: 100%;
    max-width: 960px;
    min-width: 0;
    box-sizing: border-box;
    animation: fadeIn 0.2s ease-out;
}

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

.message-bubble.user {
    justify-content: flex-start;
}

.message-bubble.user .msg-content-wrapper {
    max-width: 82%;
}

.message-bubble.assistant {
    width: 100%;
    max-width: 960px;
}

.avatar-badge {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.message-bubble.user .avatar-badge { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.message-bubble.assistant .avatar-badge {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

.msg-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    width: 100%;
}

.msg-bubble-body {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.94rem;
    line-height: 1.75;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.message-bubble.user .msg-bubble-body {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.message-bubble.assistant .msg-bubble-body {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
}

.msg-bubble-body p { margin-bottom: 8px; }
.msg-bubble-body p:last-child { margin-bottom: 0; }
.msg-bubble-body pre {
    background: #0b0f19;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    overflow-x: auto;
    margin: 10px 0;
    direction: ltr;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.84rem;
}
.msg-bubble-body a {
    color: #00d2ff;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 3px;
    padding: 1px 4px;
}
.msg-bubble-body a:hover {
    color: #38ef7d;
    background: rgba(0, 210, 255, 0.12);
    text-decoration: none;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.25);
}
.msg-bubble-body code {
    font-family: var(--font-mono);
    background: rgba(0, 210, 255, 0.08);
    color: #00d2ff;
    border: 1px solid rgba(0, 210, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    cursor: pointer;
    transition: all 0.2s ease;
}
.msg-bubble-body code:hover {
    background: rgba(0, 210, 255, 0.22);
    border-color: #00d2ff;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.35);
}
.msg-bubble-body pre code { 
    background: none; 
    padding: 0; 
    border: none; 
    color: inherit; 
    cursor: text; 
    box-shadow: none; 
}

.thought-box {
    background: rgba(16, 21, 34, 0.85);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.25s ease;
}

.thought-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 210, 255, 0.05);
}

.thought-header:hover {
    background: rgba(0, 210, 255, 0.09);
}

.thought-pulse-dot {
    width: 9px;
    height: 9px;
    background: var(--accent-cyan);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulseGlow 1.2s infinite ease-in-out;
}

.thought-pulse-dot.done {
    background: #00f59b;
    animation: none;
    box-shadow: 0 0 8px #00f59b;
}

.thought-pulse-dot.cancelled {
    background: #ff4757;
    animation: none;
    box-shadow: 0 0 8px #ff4757;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.3; transform: scale(0.85); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.4); }
    50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 10px 2px rgba(0, 210, 255, 0.6); }
}

.thought-text {
    flex: 1;
    font-size: 0.84rem;
    color: #e0f2fe;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thought-timer {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--accent-cyan);
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}

.thought-toggle-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.thought-box.open .thought-toggle-arrow {
    transform: rotate(180deg);
}

/* Tools Tray Inside Thought Box */
.thought-tools-tray {
    display: none;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-direction: column;
    gap: 6px;
    background: rgba(10, 14, 23, 0.8);
    max-height: 220px;
    overflow-y: auto;
}

.thought-box.open .thought-tools-tray {
    display: flex;
}

.thought-tool-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.thought-tool-item.active {
    border-color: rgba(0, 210, 255, 0.35);
    color: #e0f2fe;
    background: rgba(0, 210, 255, 0.06);
}

.thought-tool-item.done {
    border-color: rgba(0, 245, 155, 0.25);
    color: #bbf7d0;
}

.tool-item-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
}

.tool-item-body {
    flex: 1;
    overflow: hidden;
}

.tool-item-title {
    font-weight: 600;
    color: #f1f5f9;
    font-size: 0.78rem;
    word-break: break-all;
}

.tool-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Stop Generating Button */
.btn-stop {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.25), rgba(255, 71, 87, 0.5));
    border: 1px solid rgba(255, 71, 87, 0.7);
    color: #ff4757;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 14px rgba(255, 71, 87, 0.3);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-stop:hover {
    background: rgba(255, 71, 87, 0.8);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.6);
    transform: translateY(-1px);
}

/* Chat Input Wrapper */
.chat-input-wrapper {
    flex-shrink: 0;
    padding: 10px 20px 16px 20px;
    background: linear-gradient(to top, var(--bg-main) 90%, transparent);
    z-index: 20;
    width: 100%;
    box-sizing: border-box;
}

.chat-form {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.chat-form:focus-within { border-color: var(--accent-cyan); }

/* Attachment Preview Bar */
.attachment-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 210, 255, 0.08);
    border: 1px dashed rgba(0, 210, 255, 0.4);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.attachment-preview-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--accent-cyan);
}

.attachment-name {
    font-size: 0.82rem;
    color: #e0f2fe;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.attachment-size {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.btn-remove-attachment {
    background: none;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-remove-attachment:hover {
    background: rgba(255, 71, 87, 0.2);
}

.btn-attach {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-attach:hover {
    color: var(--accent-cyan);
    background: rgba(0, 210, 255, 0.1);
}

/* User Message Attachments */
.user-attached-image-wrap {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-attached-thumb {
    max-width: 280px;
    max-height: 200px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 210, 255, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
}

.user-attached-thumb:hover {
    transform: scale(1.02);
}

.user-attached-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.84rem;
}

.user-attached-file-chip a.chip-dl {
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 600;
}

/* Deploy Workflow Button in Chat */
.deploy-workflow-action-bar {
    margin: 8px 0 12px 0;
}

.btn-deploy-wf-direct {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.2), rgba(0, 245, 155, 0.2));
    border: 1px solid rgba(0, 245, 155, 0.5);
    color: #00f59b;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 0 12px rgba(0, 245, 155, 0.2);
}

.btn-deploy-wf-direct:hover {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.35), rgba(0, 245, 155, 0.35));
    border-color: #00f59b;
    box-shadow: 0 0 20px rgba(0, 245, 155, 0.4);
    transform: translateY(-1px);
}

.btn-deploy-wf-direct.deployed-success {
    background: rgba(0, 245, 155, 0.15);
    border-color: #00f59b;
    color: #ffffff;
    cursor: default;
}

.input-controls-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.input-controls-row textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    min-height: 24px;
    line-height: 1.5;
}

.btn-send {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.input-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.btn-text-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    font-family: inherit;
}

/* PANEL 2: Agents Hub Grid */
.agents-hub-container, .workflows-panel-container {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.hub-header h2 { font-size: 1.3rem; }
.hub-header p { color: var(--text-secondary); font-size: 0.88rem; }

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.agent-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
}

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

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.agent-card-icon {
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-card-title { flex: 1; }
.agent-card-title h3 { font-size: 1rem; color: var(--text-primary); }
.agent-card-title span {
    font-size: 0.75rem;
    color: var(--accent-green);
    background: rgba(0, 245, 155, 0.1);
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.agent-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.agent-workflows-box {
    background: rgba(0, 210, 255, 0.04);
    border: 1px dashed rgba(0, 210, 255, 0.25);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agent-workflows-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76rem;
    color: var(--accent-cyan);
    font-weight: 600;
}

.agent-workflows-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.agent-wf-pill {
    background: rgba(0, 210, 255, 0.12);
    border: 1px solid rgba(0, 210, 255, 0.35);
    color: #e0f2fe;
    font-size: 0.74rem;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.agent-wf-pill.empty {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.agent-webhook-box {
    background: #090c12;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.agent-webhook-box code {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-cyan);
    direction: ltr;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-copy-url {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}

.agent-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-chat-with-agent {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border: none;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-delete-agent {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-delete-agent:hover { color: var(--accent-red); }

/* Agent Card Badges & Skills */
.agent-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.agent-model-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(0, 210, 255, 0.1);
    color: #00d2ff;
    border: 1px solid rgba(0, 210, 255, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.agent-session-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.agent-session-badge.isolated {
    background: rgba(0, 245, 155, 0.1);
    color: #00f59b;
    border: 1px solid rgba(0, 245, 155, 0.25);
}
.agent-session-badge.shared {
    background: rgba(168, 85, 247, 0.1);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.25);
}
.agent-session-badge.stateless {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.agent-skills-box {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.agent-skill-pill {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #d8b4fe;
    font-size: 0.73rem;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.2s;
}
.agent-skill-pill:hover {
    background: rgba(168, 85, 247, 0.22);
    border-color: #d8b4fe;
    transform: translateY(-1px);
}

.agent-card-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
}

.btn-agent-action-sm {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.btn-agent-action-sm.chat {
    background: linear-gradient(135deg, #7c3aed, #00d2ff);
    color: #fff;
    grid-column: span 2;
    padding: 8px 12px;
    font-size: 0.84rem;
}
.btn-agent-action-sm.prompt {
    background: rgba(0, 210, 255, 0.1);
    border-color: rgba(0, 210, 255, 0.3);
    color: #00d2ff;
}
.btn-agent-action-sm.prompt:hover {
    background: rgba(0, 210, 255, 0.2);
}
.btn-agent-action-sm.skills {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
    color: #d8b4fe;
}
.btn-agent-action-sm.skills:hover {
    background: rgba(168, 85, 247, 0.2);
}
.btn-agent-action-sm.diagnose {
    background: rgba(0, 245, 155, 0.1);
    border-color: rgba(0, 245, 155, 0.3);
    color: #00f59b;
    grid-column: span 2;
}
.btn-agent-action-sm.diagnose:hover {
    background: rgba(0, 245, 155, 0.2);
}

/* Skills Modal Chips */
.skill-modal-chip {
    background: rgba(168, 85, 247, 0.18);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #f3e8ff;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.skill-modal-chip-remove {
    background: none;
    border: none;
    color: #f87171;
    cursor: pointer;
    font-weight: bold;
    padding: 0 2px;
    font-size: 0.9rem;
    line-height: 1;
}
.skill-modal-chip-remove:hover {
    color: #ef4444;
}

/* Diagnostic Checks in Modal */
.diag-check-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.diag-check-info {
    flex: 1;
}
.diag-check-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.diag-check-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.diag-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.diag-badge.pass {
    background: rgba(0, 245, 155, 0.15);
    color: #00f59b;
    border: 1px solid rgba(0, 245, 155, 0.3);
}
.diag-badge.warn {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.diag-badge.fail {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Workflows Table / List */
.workflows-cards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wf-full-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wf-meta-title h4 { font-size: 0.95rem; }
.wf-meta-title span { font-size: 0.75rem; color: var(--text-muted); }
.wf-actions-col { display: flex; align-items: center; gap: 10px; }

.btn-action-sm {
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid rgba(0, 210, 255, 0.3);
    color: var(--accent-cyan);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-backdrop.open { display: flex; }

.modal-box {
    background: #111624;
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

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

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 75vh;
    overflow-y: auto;
}

.form-row-grid { display: flex; gap: 10px; }
.flex-1 { flex: 1; }
.width-small { width: 90px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 0.82rem; font-weight: 600; display: flex; justify-content: space-between; }
.form-group input, .form-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
}

.tools-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.tool-check-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; cursor: pointer; }

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border: none;
    color: #ffffff;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.88rem;
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.mobile-bottom-nav { display: none; }

/* Responsive (Mobile & Tablets) */
@media (max-width: 820px) {
    .nav-tabs { display: none; }
    .hide-mobile { display: none; }
    .mob-drawer-toggle { display: block; }

    .chat-layout { grid-template-columns: 1fr; }
    
    .chat-sidebar {
        position: fixed;
        top: 64px;
        bottom: 60px;
        right: -100%;
        width: 85%;
        max-width: 320px;
        background: #0d121c;
        border-inline-start: 1px solid var(--border-glow);
        z-index: 60;
        transition: right 0.25s ease-in-out;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
    }

    .chat-sidebar.drawer-open {
        right: 0;
    }

    .mobile-bottom-nav {
        display: flex;
        height: 60px;
        background: rgba(16, 21, 34, 0.95);
        border-top: 1px solid var(--border-subtle);
        backdrop-filter: blur(12px);
        justify-content: space-around;
        align-items: center;
        z-index: 50;
    }

    .mob-nav-btn {
        background: none;
        border: none;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        font-family: inherit;
        font-size: 1.1rem;
        cursor: pointer;
    }

    .mob-nav-btn small { font-size: 0.7rem; }
    .mob-nav-btn.active { color: var(--accent-cyan); }

    .chat-messages-container { padding: 14px 16px; }
    .chat-input-wrapper { padding: 10px 14px 14px 14px; }
    .agents-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   AUTHENTICATION LOCK OVERLAY STYLES
   ========================================================================== */
.auth-lock-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 9, 15, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: authFadeIn 0.35s ease-out;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: linear-gradient(160deg, rgba(16, 23, 38, 0.95), rgba(9, 13, 22, 0.98));
    border: 1px solid rgba(0, 210, 255, 0.35);
    border-radius: 22px;
    padding: 36px 32px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 50px rgba(0, 210, 255, 0.15);
    overflow: hidden;
}

.auth-card-glow {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 140px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.auth-logo-box {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px auto;
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.2), rgba(157, 78, 221, 0.2));
    border: 1px solid rgba(0, 210, 255, 0.4);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(0, 210, 255, 0.2);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.auth-notice-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: #00d2ff;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    margin-bottom: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: right;
}

.auth-input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap .input-icon {
    position: absolute;
    right: 14px;
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.auth-input-wrap input {
    width: 100%;
    background: rgba(13, 18, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 12px 42px 12px 42px;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    outline: none;
    transition: all 0.25s ease;
}

.auth-input-wrap input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.3);
}

.btn-pwd-vis {
    position: absolute;
    left: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    transition: color 0.2s ease;
}

.btn-pwd-vis:hover {
    color: var(--accent-cyan);
}

.auth-error {
    background: rgba(255, 71, 87, 0.12);
    border: 1px solid rgba(255, 71, 87, 0.35);
    color: #ff6b81;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    text-align: center;
    animation: authShake 0.4s ease;
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.btn-auth-submit {
    background: linear-gradient(135deg, #00d2ff 0%, #0077ff 100%);
    border: none;
    border-radius: var(--radius-md);
    padding: 13px 20px;
    color: #050b14;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 210, 255, 0.3);
    transition: all 0.25s ease;
}

.btn-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 210, 255, 0.45);
}

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

.auth-footer-tag {
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Header Active Model Pill */
.header-model-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.25);
    border-radius: var(--radius-full);
    padding: 5px 12px;
    font-size: 0.78rem;
    color: #a5f3fc;
    white-space: nowrap;
}

.header-model-pill .pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00d2ff;
    box-shadow: 0 0 8px #00d2ff;
    animation: pillPulse 2s infinite ease-in-out;
}

@keyframes pillPulse {
    0%, 100% { opacity: 0.6; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.15); }
}

@media (max-width: 768px) {
    .header-model-pill {
        display: none;
    }
    .header-engine-pill {
        display: none;
    }
}

/* Header Engine Pill (SDK / CLI) */
.header-engine-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    padding: 5px 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.25s ease;
}

.header-engine-pill .engine-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00d2ff;
    box-shadow: 0 0 6px #00d2ff;
}

.header-engine-pill.sdk-active {
    background: rgba(0, 245, 155, 0.1);
    border-color: rgba(0, 245, 155, 0.35);
    color: #00f59b;
}

.header-engine-pill.sdk-active .engine-dot {
    background: #00f59b;
    box-shadow: 0 0 8px #00f59b;
}


/* MCP & Active APIs Hub Styling */
.mcp-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.mcp-hub-card {
    background: rgba(16, 22, 34, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
    position: relative;
    backdrop-filter: blur(8px);
}

.mcp-hub-card:hover {
    border-color: rgba(0, 210, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.mcp-hub-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.mcp-hub-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mcp-badge {
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.mcp-badge.online {
    background: rgba(0, 245, 155, 0.15);
    color: #00f59b;
    border: 1px solid rgba(0, 245, 155, 0.35);
}

.mcp-badge.offline {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.35);
}

.mcp-badge.enabled {
    background: rgba(0, 210, 255, 0.15);
    color: #00d2ff;
    border: 1px solid rgba(0, 210, 255, 0.35);
}

.mcp-badge.disabled {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.mcp-hub-desc {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
}

.mcp-meta-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: #94a3b8;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mcp-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    word-break: break-all;
}

.mcp-endpoints-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 6px;
}

.mcp-endpoint-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.mcp-method {
    font-weight: 700;
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 3px;
}
.mcp-method.get { background: rgba(0, 210, 255, 0.2); color: #00d2ff; }
.mcp-method.post { background: rgba(0, 245, 155, 0.2); color: #00f59b; }

.mcp-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Native Tools Grid */
.native-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.native-tool-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.native-tool-card:hover {
    border-color: rgba(0, 210, 255, 0.3);
    background: rgba(0, 210, 255, 0.03);
}

.native-tool-icon {
    font-size: 1.4rem;
}

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

.native-tool-name {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: #00d2ff;
}

.native-tool-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Agent Model Selector Controls */
.agent-model-control-wrap {
    margin: 8px 0;
    padding: 9px 12px;
    background: rgba(13, 18, 28, 0.75);
    border: 1px solid rgba(0, 210, 255, 0.22);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
}

.agent-model-control-wrap:hover,
.agent-model-control-wrap:focus-within {
    border-color: rgba(0, 210, 255, 0.5);
    background: rgba(13, 18, 28, 0.95);
    box-shadow: 0 4px 14px rgba(0, 210, 255, 0.08);
}

.agent-model-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agent-model-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    cursor: pointer;
}

.agent-model-label .model-label-icon {
    font-size: 0.9rem;
}

.agent-model-save-status {
    font-size: 0.73rem;
    font-weight: 600;
    min-height: 16px;
    transition: all 0.2s ease;
}

.agent-model-save-status.saving {
    color: #f59e0b;
}

.agent-model-save-status.success {
    color: #00f59b;
    text-shadow: 0 0 6px rgba(0, 245, 155, 0.4);
}

.agent-model-save-status.error {
    color: #ef4444;
}

.agent-model-select-box {
    position: relative;
    width: 100%;
}

.agent-card-model-select {
    width: 100%;
    background: #090d16;
    color: #00d2ff;
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 6px;
    padding: 7px 11px;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.agent-card-model-select:hover {
    border-color: rgba(0, 210, 255, 0.6);
}

.agent-card-model-select:focus {
    border-color: #00d2ff;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.35);
}

.agent-card-model-select option {
    background: #0c101a;
    color: #f1f5f9;
    padding: 8px 12px;
}

/* Code Block Copy Button */
.btn-copy-code-block {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(13, 18, 28, 0.88);
    border: 1px solid rgba(0, 210, 255, 0.35);
    color: #00d2ff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.65;
    transition: all 0.2s ease;
    z-index: 5;
}

pre:hover .btn-copy-code-block {
    opacity: 1;
}

.btn-copy-code-block:hover {
    background: rgba(0, 210, 255, 0.22);
    border-color: #00d2ff;
    opacity: 1;
}

.btn-copy-code-block.copied {
    border-color: #00f59b;
    color: #00f59b;
    background: rgba(0, 245, 155, 0.18);
}



