/* ============================================
   AURA — Premium Sci-Fi Hyper-Observability Console
   ============================================ */

:root {
    --bg-base: #020006; /* Space Obsidian Purple */
    --bg-surface: #06040f; /* Dark Amethyst glass base */
    --bg-elevated: #0d091e;
    --bg-glass: rgba(6, 4, 15, 0.55);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --accent: #00f0ff; /* Neon Cyber Cyan */
    --accent-2: #7d26ff; /* Electric Indigo */
    --accent-3: #ff00c8; /* Cyber Violet */
    --success: #00ff66; /* Neon Emerald */
    --warning: #ffd700; /* Neon Gold */
    --error: #ff0055; /* Cyber Red */
    --border: rgba(167, 139, 250, 0.08); /* Violet border glow */
    --border-hover: rgba(167, 139, 250, 0.18);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.7);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.9);
    --shadow-glow: 0 0 25px rgba(125, 38, 255, 0.25);
    --transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* Animated Background Mesh */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--bg-base);
    background-image:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(125, 38, 255, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 85% 85%, rgba(0, 240, 255, 0.08), transparent),
        radial-gradient(ellipse 40% 50% at 10% 60%, rgba(255, 0, 200, 0.05), transparent);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
    width: 320px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.04), transparent);
    pointer-events: none;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 28px 20px;
    position: relative;
    z-index: 1;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    padding: 0 4px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.logo-icon svg { width: 20px; height: 20px; }

.logo-text h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Status Card */
.status-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    overflow: hidden;
}

.status-card-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--success); }
    50% { opacity: 0.6; box-shadow: 0 0 16px var(--success); }
}

.status-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-card-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
}

.status-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.status-key {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.status-val {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.online-text { color: var(--success) !important; }

/* Section Labels */
.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 8px;
    margin-bottom: 12px;
}

.section-icon {
    width: 14px;
    height: 14px;
}

/* Quick Action Buttons */
.quick-actions {
    flex: 1;
    overflow-y: auto;
}

.quick-actions button {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
    font-family: inherit;
}

.quick-actions button i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: var(--transition);
}

.quick-actions button:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.25);
    color: white;
    transform: translateX(4px);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.08);
}

.quick-actions button i { color: var(--accent); }
.quick-actions button:hover i { color: #7dd3fc; }

.btn-text { display: flex; flex-direction: column; gap: 2px; }
.btn-title { font-size: 13px; font-weight: 600; }
.btn-desc { font-size: 11px; color: var(--text-secondary); }

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.new-session-btn {
    width: 100%;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.15);
    color: var(--accent);
    padding: 12px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.new-session-btn i { width: 16px; height: 16px; }

.new-session-btn:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-name { display: block; font-size: 13px; font-weight: 600; }
.user-role { display: block; font-size: 11px; color: var(--text-muted); }

/* =====================
   CHAT CONTAINER
   ===================== */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header */
.chat-header {
    padding: 18px 32px;
    background: rgba(3, 7, 18, 0.7);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon i { width: 18px; height: 18px; color: var(--accent); }

.chat-header h2 {
    font-size: 15px;
    font-weight: 600;
}

.session-badge {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.header-right {
    display: flex;
    gap: 10px;
}

.header-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.header-chip i { width: 14px; height: 14px; }
.header-chip.region { color: var(--accent-2); }

.header-chip.model {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.2);
    color: var(--accent);
}

.header-chip.live-clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.15);
    background: rgba(52, 211, 153, 0.05);
    letter-spacing: 0.5px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.icon-btn i { width: 16px; height: 16px; }
.icon-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }

/* =====================
   WELCOME HERO
   ===================== */
.welcome-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px 40px;
    animation: fadeIn 0.6s ease-out;
}

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

.welcome-icon {
    width: 80px;
    height: 80px;
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.welcome-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent), var(--accent-2));
    animation: borderSpin 4s linear infinite;
    opacity: 0.3;
    z-index: -1;
}

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

.welcome-hero h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-hero p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 40px;
    max-width: 480px;
}

.welcome-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 600px;
    width: 100%;
}

.wcard {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.wcard i { width: 22px; height: 22px; color: var(--accent); }

.wcard:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* =====================
   MESSAGES
   ===================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    scroll-behavior: smooth;
}

.message {
    max-width: 82%;
    display: flex;
    gap: 16px;
    animation: msgSlide 0.35s ease-out;
}

.message-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message .avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
}

.message .avatar i { width: 16px; height: 16px; }

.message.assistant .avatar {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.message.user .avatar {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--accent);
}

.message-content {
    padding: 18px 22px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.75;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.assistant .message-content {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    border-top-left-radius: 4px;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    font-weight: 500;
    box-shadow: 0 8px 24px -8px rgba(56, 189, 248, 0.4);
    border-top-right-radius: 4px;
}

.intent-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 6px 2px;
}

.intent-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0, 240, 255, 0.18);
    background: rgba(0, 240, 255, 0.06);
    font-size: 10px;
    line-height: 1;
    color: var(--text-secondary);
}

.intent-chip.subtle {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.07);
}

.intent-chip.neon-rule {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.08);
}
.intent-chip.neon-rule em {
    color: rgb(216, 180, 254);
}

.intent-chip.neon-bypass {
    border-color: rgba(234, 179, 8, 0.4);
    background: rgba(234, 179, 8, 0.08);
}
.intent-chip.neon-bypass em {
    color: rgb(253, 224, 71);
}

.intent-chip strong {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.35px;
}

.intent-chip em {
    color: var(--accent);
    font-style: normal;
    font-weight: 700;
}

.intent-hint {
    margin: 0 0 8px 2px;
    font-size: 11px;
    color: rgba(148, 163, 184, 0.86);
    line-height: 1.35;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Markdown Inside Messages */
.message-content h1, .message-content h2, .message-content h3 {
    margin: 18px 0 10px;
    color: var(--text-primary);
}

.message-content h2 { font-size: 18px; }
.message-content h3 { font-size: 15px; color: var(--accent); }

.message-content p { margin: 8px 0; }
.message-content ul, .message-content ol { padding-left: 20px; margin: 8px 0; }
.message-content li { margin: 4px 0; }

.message-content strong { color: var(--text-primary); }
.message-content em { color: var(--text-secondary); }

.message-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(56, 189, 248, 0.3);
}

.message-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* Code Blocks */
.message-content pre {
    background: var(--bg-base) !important;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    margin: 14px 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid var(--border);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}

.message-content code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(56, 189, 248, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}

.message-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Tables */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.message-content th {
    background: rgba(56, 189, 248, 0.06);
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.message-content td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.message-content tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* Blockquotes */
.message-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 16px;
    margin: 12px 0;
    background: rgba(56, 189, 248, 0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

/* =====================
   INPUT AREA
   ===================== */
.chat-input-area {
    padding: 24px 40px 28px;
    background: linear-gradient(to top, var(--bg-base) 50%, transparent);
}

.input-wrapper {
    max-width: 860px;
    margin: 0 auto;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: flex-end;
    padding: 10px 12px 10px 24px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(56, 189, 248, 0.06);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px 0;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    max-height: 180px;
}

textarea::placeholder { color: var(--text-muted); }
textarea:focus { outline: none; }

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

.send-btn i { width: 18px; height: 18px; }

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.4);
}

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

.send-btn.is-loading {
    background: linear-gradient(135deg, var(--error), #dc2626);
    animation: stopPulse 1.5s ease-in-out infinite;
}

.send-btn.is-loading:hover {
    box-shadow: 0 4px 16px rgba(248, 113, 113, 0.4);
}

@keyframes stopPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.disclaimer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* =====================
   TYPING INDICATOR
   ===================== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
}

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

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

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-8px); opacity: 1; }
}

/* =====================
   SWARM PROGRESS PANEL
   ===================== */
.swarm-panel {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    animation: swarmPanelIn 0.3s ease-out;
    overflow: hidden;
}

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

.swarm-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a5b4fc;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.18);
}

.swarm-panel-header .swarm-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
    animation: swarmHeartbeat 1.4s infinite;
    flex-shrink: 0;
}

.swarm-panel-header .swarm-pulse.done {
    background: #22c55e;
    box-shadow: none;
    animation: none;
}

@keyframes swarmHeartbeat {
    0%   { box-shadow: 0 0 0 0 rgba(99,102,241,0.7); }
    70%  { box-shadow: 0 0 0 7px rgba(99,102,241,0); }
    100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}

.swarm-agent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    animation: swarmRowIn 0.25s ease-out;
}

.swarm-agent-row:last-child { border-bottom: none; }

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

.swarm-badge {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    margin-top: 1px;
}

.swarm-badge.queued {
    background: rgba(100,116,139,0.25);
    border: 1px solid rgba(100,116,139,0.5);
    color: #94a3b8;
}

.swarm-badge.running {
    background: rgba(234,179,8,0.2);
    border: 1px solid rgba(234,179,8,0.5);
    color: #fbbf24;
    animation: swarmBadgePulse 1s infinite alternate;
}

@keyframes swarmBadgePulse {
    from { box-shadow: 0 0 0 0 rgba(234,179,8,0.4); }
    to   { box-shadow: 0 0 0 5px rgba(234,179,8,0); }
}

.swarm-badge.done {
    background: rgba(34,197,94,0.2);
    border: 1px solid rgba(34,197,94,0.5);
    color: #4ade80;
    animation: none;
}

.swarm-agent-info {
    flex: 1;
    min-width: 0;
}

.swarm-agent-name {
    font-size: 0.73rem;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.swarm-agent-elapsed {
    font-size: 0.63rem;
    color: #64748b;
    font-weight: 400;
}

.swarm-agent-preview {
    font-size: 0.67rem;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 3.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}



/* =====================
   RIGHT OPS DASHBOARD PANEL
   ===================== */
.right-panel {
    width: 380px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    z-index: 2;
    overflow: hidden;
    flex-shrink: 0;
}

.right-panel.collapsed {
    width: 0;
    border-left: none;
}

.panel-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-refresh-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.panel-refresh-btn:hover {
    color: var(--accent);
    background: rgba(56, 189, 248, 0.08);
}

.panel-refresh-btn i {
    width: 16px;
    height: 16px;
    transition: transform 0.5s ease;
}

.panel-refresh-btn.spinning i {
    animation: spin 1s linear infinite;
}

.panel-tabs {
    display: flex;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    flex-shrink: 0;
}

.tab-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
}

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

.tab-btn.active {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
    color: var(--accent);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.tab-content {
    display: none;
}

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

/* Pipeline Stepper */
.pipeline-stepper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    padding-left: 12px;
}

.pipeline-stepper::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 21px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-2), var(--accent-3));
    opacity: 0.3;
}

.step-item {
    display: flex;
    gap: 16px;
    position: relative;
    animation: fadeIn 0.4s ease-out;
}

.step-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--accent);
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
    flex-shrink: 0;
}

.step-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: var(--transition);
}

.step-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(56, 189, 248, 0.15);
    transform: translateX(2px);
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.step-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.step-number {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.step-service {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 4px;
}

.step-output {
    font-size: 10px;
    color: var(--text-secondary);
}

.step-hosts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.host-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

/* Service Health */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: var(--transition);
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hover);
}

.service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.service-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-badge {
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.healthy {
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    color: var(--success);
}

.status-badge.degraded {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: var(--warning);
}

.status-badge.down {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.2);
    color: var(--error);
}

.service-card-details {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-secondary);
}

/* Tool Runner Panel */
.tool-runner-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 10px 40px;
    transition: var(--transition);
    flex-shrink: 0;
}

.tool-runner-panel.hidden {
    display: none !important;
}

.spinner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: toolPulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes toolPulse {
    0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px var(--accent); }
    50% { transform: scale(1.3); opacity: 0.6; box-shadow: 0 0 16px var(--accent); }
}

.tool-runner-text {
    font-size: 12px;
    color: var(--text-primary);
}

.tool-runner-text code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* =====================
   SCROLLBAR
   ===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.2);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.4); }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 1200px) {
    .right-panel { display: none !important; }
}

@media (max-width: 900px) {
    .sidebar { display: none; }
    .chat-messages { padding: 24px 16px; }
    .chat-input-area { padding: 16px; }
    .chat-header { padding: 14px 16px; }
    .welcome-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   BEAUTIFIED & PREMIUM SRE STYLING ADDITIONS
   ============================================ */

/* Animated drifting mesh background */
.bg-mesh {
    animation: meshDrift 25s ease-in-out infinite alternate;
}

@keyframes meshDrift {
    0% {
        background-position: 0% 0%;
        filter: hue-rotate(0deg);
    }
    50% {
        background-position: 5% 10%;
        filter: hue-rotate(8deg);
    }
    100% {
        background-position: 10% 20%;
        filter: hue-rotate(15deg);
    }
}

/* Premium HSL glowing custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(3, 7, 18, 0.4);
}
::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.12);
    border-radius: 100px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: var(--transition);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.35);
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* Copy Code Block Buttons */
.code-block-wrapper {
    position: relative;
    margin: 16px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.code-block-wrapper:hover {
    border-color: rgba(56, 189, 248, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.03);
}

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

.copy-code-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.copy-code-btn:hover {
    color: white;
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
    transform: scale(1.05);
}

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

/* Interactive Card Glows & Dynamic Transitions */
.status-card {
    transition: var(--transition);
}
.status-card:hover {
    border-color: rgba(56, 189, 248, 0.2);
    box-shadow: 0 8px 32px rgba(3, 7, 18, 0.8), var(--shadow-glow);
    transform: translateY(-2px);
}

.quick-actions button {
    position: relative;
    overflow: hidden;
}
.quick-actions button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.quick-actions button:hover::after {
    transform: translateX(100%);
}

.step-card {
    position: relative;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.3) !important;
    backdrop-filter: blur(8px);
    transition: var(--transition);
}
.step-card:hover {
    background: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4), 0 0 15px rgba(56, 189, 248, 0.05);
    transform: translateX(4px);
}

.service-card {
    position: relative;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.3) !important;
    backdrop-filter: blur(8px);
    transition: var(--transition);
}
.service-card:hover {
    background: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4), 0 0 15px rgba(56, 189, 248, 0.05);
    transform: translateY(-2px);
}

/* Smooth fade-in animation for markdown blockquotes and lists */
.message-content blockquote {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-left-width: 4px;
    transition: var(--transition);
}
.message-content blockquote:hover {
    border-left-color: var(--accent-2);
    background: rgba(129, 140, 248, 0.06);
}

/* =======================================================
   MODERN WEB GUIDANCE: ADVANCED SCROLL AFFORDANCE & MOTION
   ======================================================= */

/* Container Scroll-State Declarations */
.chat-messages {
    container-type: scroll-state;
    position: relative;
}

.panel-body {
    container-type: scroll-state;
    position: relative;
}

/* Sticky Scroll Indicator Gradients */
.scroll-indicator {
    position: sticky;
    left: 0;
    right: 0;
    height: 32px;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 100;
}

.scroll-indicator-top {
    top: 0;
    background: linear-gradient(to bottom, rgba(3, 7, 18, 0.95), transparent);
    margin-bottom: -32px;
}

.scroll-indicator-bottom {
    bottom: 0;
    background: linear-gradient(to top, rgba(3, 7, 18, 0.95), transparent);
    margin-top: -32px;
}

/* Query Scroll-State to toggle indicator visibility dynamically */
@container scroll-state(scrollable: top) {
    .scroll-indicator-top {
        opacity: 1;
    }
}

@container scroll-state(scrollable: bottom) {
    .scroll-indicator-bottom {
        opacity: 1;
    }
}

/* Scroll-Driven Reveal Animations (View Timeline) */
@media (prefers-reduced-motion: no-preference) {
    @supports ((animation-timeline: view()) and (animation-range: entry)) {
        @keyframes msg-scroll-reveal {
            from {
                opacity: 0;
                transform: translateY(24px) scale(0.96);
                filter: blur(2px);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
                filter: blur(0);
            }
        }

        /* Dynamically fade & scale messages as they enter the scrollport */
        .chat-messages > .message {
            view-timeline: --msgTimeline block;
            animation: msg-scroll-reveal auto cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
            animation-timeline: --msgTimeline;
            animation-range: entry 0% entry 22%;
        }

        @keyframes card-scroll-reveal {
            from {
                opacity: 0.5;
                transform: scale(0.97);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        /* Dynamically animate stepper cards as they are scrolled in */
        .step-item {
            view-timeline: --stepTimeline block;
            animation: card-scroll-reveal auto linear;
            animation-timeline: --stepTimeline;
            animation-range: entry 0% entry 15%;
        }
    }
}

/* =======================================================
   PREMIUM UI ENHANCEMENTS: MODALS, TERMINALS, & TELEMETRY
   ======================================================= */

/* --- Glassmorphic Details Modal (Native Dialog) --- */
.details-modal {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), var(--shadow-glow);
    max-width: 620px;
    width: 90%;
    margin: auto;
    padding: 0;
    color: var(--text-primary);
    overflow: hidden;
}

.details-modal::backdrop {
    background: rgba(3, 7, 18, 0.65);
    backdrop-filter: blur(8px);
    transition: display 0.3s allow-discrete, overlay 0.3s allow-discrete, background-color 0.3s ease-out;
}

/* Modal Open State Transitions using @starting-style */
.details-modal[open] {
    opacity: 1;
    transform: scale(1);

    @starting-style {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
}

.details-modal {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
    transition: opacity 0.3s, transform 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;
}

.details-modal[open]::backdrop {
    background: rgba(3, 7, 18, 0.65);
    @starting-style {
        background: rgba(3, 7, 18, 0);
    }
}

/* Respect user prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .details-modal, .details-modal[open] {
        transform: none !important;
        transition-duration: 0.1s !important;
    }
    .details-modal[open] @starting-style {
        transform: none !important;
    }
}

.modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.4);
}

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

.modal-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    font-size: 14px;
}

/* Modal Internal Sections styling */
.modal-sect {
    margin-bottom: 20px;
}

.modal-sect:last-child {
    margin-bottom: 0;
}

.modal-sect-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-kv-card {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.modal-kv-label {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.modal-kv-val {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-kv-val.code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent);
}

.modal-desc-text {
    line-height: 1.5;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.2);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.modal-hosts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-host-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.modal-host-name {
    color: var(--text-primary);
}

.modal-host-ip {
    color: var(--accent);
}

.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.modal-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.35);
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}


/* --- Slide-up Retro Log Terminal Drawer --- */
.terminal-drawer {
    position: fixed;
    bottom: 0;
    left: 320px; /* Aligns perfectly alongside sidebar */
    right: 0;
    background: rgba(3, 7, 18, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(56, 189, 248, 0.2);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.terminal-drawer.collapsed {
    height: 48px;
    transform: translateY(0);
}

.terminal-drawer.expanded {
    height: 380px;
    transform: translateY(0);
}

.drawer-header {
    height: 48px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    cursor: pointer;
    user-select: none;
}

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

.drawer-header-left h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.2px;
}

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

@keyframes terminal-glow-pulse {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.4)); opacity: 0.8; }
    50% { filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.9)); opacity: 1; }
}

.telemetry-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: beacon-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes beacon-ping {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(3.5); opacity: 0; }
}

.drawer-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.terminal-btn.clear:hover {
    color: var(--error);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #e2e8f0;
}

/* Monospace output formatting */
.terminal-output {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.term-line {
    word-break: break-all;
    border-left: 2px solid transparent;
    padding-left: 8px;
}

.term-line.system {
    color: var(--text-secondary);
    border-left-color: var(--text-muted);
}

.term-line.info {
    color: #38bdf8; /* cyan */
    border-left-color: rgba(56, 189, 248, 0.4);
}

.term-line.success {
    color: var(--success);
    border-left-color: rgba(52, 211, 153, 0.4);
}

.term-line.warn {
    color: var(--warning);
    border-left-color: rgba(251, 191, 36, 0.4);
}

.term-line.error {
    color: var(--error);
    border-left-color: rgba(248, 113, 113, 0.4);
    font-weight: 500;
}

.term-line.command {
    color: var(--accent-2); /* indigo */
    font-weight: 500;
    border-left-color: rgba(129, 140, 248, 0.4);
}


/* --- Ingestion Telemetry & Charting styles --- */
.telemetry-section {
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.kpi-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
}

.kpi-card.purple::before {
    background: var(--accent-2);
}

.kpi-card.cyan::before {
    background: var(--accent);
}

.kpi-card.violet::before {
    background: var(--accent-3);
}

.kpi-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.kpi-change {
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--accent); }

.kpi-change svg { width: 12px; height: 12px; }

.chart-container-wrapper {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
    min-height: 220px;
}

/* Interactive elements enhancements */
.step-item, .service-card {
    cursor: pointer;
    transition: var(--transition);
}

.step-item:hover, .service-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.25);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.05);
}

/* Adjust scroll heights when drawer is active */
.chat-messages {
    padding-bottom: 64px !important;
}

/* =======================================================
   AURA V3 SCI-FI HUD & CORE VISUALIZATIONS
   ======================================================= */

/* AI Core HUD Visualizer */
.ai-core-visualizer {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-core-visualizer.large {
    width: 140px;
    height: 140px;
    margin-bottom: 24px;
}

.ai-core-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 12px rgba(125, 38, 255, 0.45));
    animation: core-breath 4s ease-in-out infinite;
}

/* Core rotations and speed multipliers */
.core-ring {
    transform-origin: center;
    transition: stroke-dashoffset 1s ease-in-out;
}

.core-inner {
    animation: core-spin-cw 8s linear infinite;
}

.core-middle {
    animation: core-spin-ccw 14s linear infinite;
}

.core-outer {
    animation: core-spin-cw 25s linear infinite;
}

/* Fast/Reasoning states */
.ai-core-svg.speed-fast .core-inner {
    animation-duration: 2.5s;
}
.ai-core-svg.speed-fast .core-middle {
    animation-duration: 4s;
}
.ai-core-svg.speed-fast .core-outer {
    animation-duration: 7s;
}
.ai-core-svg.speed-fast {
    filter: drop-shadow(0 0 20px rgba(255, 0, 200, 0.75));
}

@keyframes core-spin-cw {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes core-spin-ccw {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes core-breath {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(125, 38, 255, 0.45)); }
    50% { transform: scale(1.03); filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.65)); }
}

.core-center-glow {
    position: absolute;
    width: 22%;
    height: 22%;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 30%, var(--accent) 70%);
    box-shadow: 0 0 18px #ffffff, 0 0 35px var(--accent-3);
    z-index: 2;
    animation: core-breath-center 4s ease-in-out infinite;
}

.ai-core-visualizer.large .core-center-glow {
    width: 24%;
    height: 24%;
}

@keyframes core-breath-center {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

.welcome-core-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}


/* --- Interactive SVG Network Pipeline Map --- */
.svg-network-container {
    width: 100%;
    position: relative;
    padding: 10px 4px;
    background: rgba(6, 4, 15, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.svg-network-map {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

/* Connecting neon lines */
.network-path-glow {
    stroke: var(--accent-2);
    opacity: 0.25;
    filter: blur(2px);
}

.network-path {
    stroke: rgba(167, 139, 250, 0.25);
    stroke-width: 1.5;
    stroke-linecap: round;
}

/* Neon flowing packets */
.network-flow-packet {
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 10 180;
    animation: flow-packet-dash 4s linear infinite;
}

@keyframes flow-packet-dash {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -200; }
}

/* Nodes styling */
.network-node {
    cursor: pointer;
    transition: var(--transition);
}

.network-node-ring {
    stroke: var(--border);
    fill: #06040f;
    transition: var(--transition);
}

.network-node-glow {
    fill: var(--accent-2);
    opacity: 0.15;
    filter: blur(4px);
    transition: var(--transition);
}

.network-node-dot {
    fill: var(--accent-2);
    transition: var(--transition);
}

/* Node States: Active & Hover */
.network-node:hover .network-node-ring {
    stroke: var(--accent);
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.65));
}

.network-node:hover .network-node-dot {
    fill: var(--accent);
}

.network-node.healthy .network-node-dot { fill: var(--success); }
.network-node.healthy .network-node-glow { fill: var(--success); }
.network-node.degraded .network-node-dot { fill: var(--warning); }
.network-node.degraded .network-node-glow { fill: var(--warning); }
.network-node.down .network-node-dot { fill: var(--error); }
.network-node.down .network-node-glow { fill: var(--error); }

.network-node-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    font-weight: 600;
    fill: var(--text-secondary);
    text-anchor: middle;
    transition: var(--transition);
    pointer-events: none;
}

.network-node:hover .network-node-text {
    fill: var(--text-primary);
}

/* =======================================================
   ENVIRONMENT SWITCHER & MULTI-ENV PIPELINE STYLES
   ======================================================= */

.pipeline-env-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(10, 14, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 3px 4px;
    gap: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.env-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.02em;
}

.env-pill-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.env-pill-dot {
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    display: inline-block;
}

.env-pill-dot.uat {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.env-pill-dot.prod {
    background: #c084fc;
    box-shadow: 0 0 6px #c084fc;
}

.env-pill-btn.active#envPillUat {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.env-pill-btn.active#envPillProd {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
    border-color: rgba(192, 132, 252, 0.45);
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.25);
}

.env-pill-btn.active#envPillDual {
    background: rgba(0, 240, 255, 0.15);
    color: #38bdf8;
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* PROD SVG Theme Styling */
.prod-theme .network-path-glow {
    stroke: #c084fc;
    opacity: 0.35;
    filter: blur(3px);
}

.prod-theme .network-path {
    stroke: rgba(192, 132, 252, 0.35);
    stroke-width: 1.5;
}

.prod-theme .network-flow-packet {
    stroke: #ec4899;
    stroke-width: 2.2;
    filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.8));
    animation: flow-packet-dash 3.2s linear infinite;
}

.prod-theme .network-node:hover .network-node-ring {
    stroke: #c084fc;
    filter: drop-shadow(0 0 10px rgba(192, 132, 252, 0.75));
}

.prod-theme .network-node:hover .network-node-dot {
    fill: #ec4899;
}

.prod-theme .network-node.healthy .network-node-dot { fill: #c084fc; }
.prod-theme .network-node.healthy .network-node-glow { fill: #c084fc; }

/* Dual Comparison Layout */
.dual-tracks-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.track-box {
    background: rgba(8, 12, 22, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.track-box:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
}

.track-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.track-badge.uat {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.track-badge.prod {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.35);
}

.track-meta {
    color: var(--text-secondary);
    font-size: 0.72rem;
    display: flex;
    gap: 12px;
}

.track-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.track-meta strong {
    color: var(--text-primary);
}

/* Parity Matrix Card */
.parity-matrix-card {
    background: rgba(8, 12, 22, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: 6px;
}

.parity-matrix-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #38bdf8;
}

.parity-table-wrapper {
    overflow-x: auto;
}

.parity-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

.parity-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.parity-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    vertical-align: middle;
}

.parity-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.parity-stage-cell {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.parity-pill {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin: 2px;
}

.parity-pill.uat {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.parity-pill.prod {
    background: rgba(192, 132, 252, 0.12);
    color: #d8b4fe;
    border: 1px solid rgba(192, 132, 252, 0.25);
}

/* ==========================================================================
   LIVE RABBITMQ QUEUE & BACKLOG MONITOR STYLES
   ========================================================================== */

.rabbitmq-monitor-card {
    background: rgba(13, 17, 28, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    transition: all 0.3s ease;
}

.rabbitmq-monitor-card.prod-theme {
    border-color: rgba(192, 132, 252, 0.3);
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.1);
}

.rmq-broker-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.rmq-broker-pill.prod {
    background: rgba(192, 132, 252, 0.12);
    color: #c084fc;
    border-color: rgba(192, 132, 252, 0.35);
}

.rmq-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}

@media (max-width: 900px) {
    .rmq-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.rmq-stat-tile {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
}

.rmq-stat-tile:hover {
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(15, 23, 42, 0.75);
    transform: translateY(-1px);
}

.rabbitmq-monitor-card.prod-theme .rmq-stat-tile:hover {
    border-color: rgba(192, 132, 252, 0.4);
}

.rmq-tile-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rmq-tile-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.2;
}

.rmq-tile-value.healthy {
    color: #34d399;
}

.rmq-tile-value.warning {
    color: #fbbf24;
}

.rmq-tile-value.critical {
    color: #f87171;
}

.rmq-tile-sub {
    font-size: 0.68rem;
    color: #64748b;
}

.rmq-queues-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rmq-queues-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
}

.rmq-queues-table th {
    text-align: left;
    padding: 9px 12px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.rmq-queues-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #cbd5e1;
    vertical-align: middle;
}

.rmq-queues-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.rmq-qname {
    font-weight: 700;
    color: #e2e8f0;
}

.rmq-qstage {
    color: #38bdf8;
    font-size: 0.7rem;
}

.rabbitmq-monitor-card.prod-theme .rmq-qstage {
    color: #c084fc;
}

.rmq-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rmq-status-badge.healthy {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.rmq-status-badge.warning {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.35);
}

.rmq-status-badge.critical {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: pulseCritical 1.5s infinite alternate;
}

@keyframes pulseCritical {
    from { box-shadow: 0 0 4px rgba(239, 68, 68, 0.2); }
    to { box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
}



/* --- CRT Retro scanline drawer overlay --- */
.crt-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 40%, rgba(3, 1, 10, 0.8) 100%);
    z-index: 1002;
    pointer-events: none;
}

.crt-scanlines {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%);
    background-size: 100% 4px;
    z-index: 1001;
    pointer-events: none;
    opacity: 0.45;
    animation: crt-flicker 0.15s infinite;
}

@keyframes crt-flicker {
    0% { opacity: 0.43; }
    50% { opacity: 0.47; }
    100% { opacity: 0.43; }
}

.terminal-drawer.expanded .drawer-body {
    text-shadow: 0 0 4px rgba(0, 240, 255, 0.4);
}

/* Neon styled assistant bubbles */
.message.assistant {
    background: rgba(13, 9, 30, 0.5) !important;
    border: 1px solid rgba(167, 139, 250, 0.06);
    box-shadow: inset 0 0 12px rgba(125, 38, 255, 0.05);
}

.message.user {
    background: rgba(0, 240, 255, 0.03) !important;
    border: 1px solid rgba(0, 240, 255, 0.08);
}

/* =======================================================
   AURA V4 SRE FLIGHT DECK LAYOUT & STRUCTURAL GRID
   ======================================================= */

.flight-deck-container {
    display: grid;
    grid-template-rows: 64px 1fr;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: transparent;
}

/* ROW 1: HEADER BEZEL */
.header-bezel {
    grid-row: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    background: rgba(6, 4, 15, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo-text h1 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-3) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-logo-text span {
    font-size: 9px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

/* Center Ticker Bezel */
.header-center {
    flex: 1;
    max-width: 45%;
    margin: 0 32px;
}

.ticker-bezel {
    background: rgba(2, 0, 6, 0.65);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.ticker-pulse-light {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    flex-shrink: 0;
    animation: core-breath 2s infinite;
}

.ticker-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--accent);
    text-shadow: 0 0 4px rgba(0, 240, 255, 0.3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-badge {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
}

.header-badge.clock {
    font-family: 'JetBrains Mono', monospace;
    border-color: rgba(0, 240, 255, 0.15);
    color: var(--accent);
}

.header-badge.model {
    border-color: rgba(255, 0, 200, 0.15);
    color: var(--accent-3);
}

.header-action-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.header-action-btn:hover {
    background: rgba(255, 0, 85, 0.1);
    color: var(--error);
    border-color: rgba(255, 0, 85, 0.2);
}


/* ROW 2: MAIN TACTICAL DECK */
.main-deck {
    grid-row: 2;
    display: grid;
    grid-template-columns: 55fr 6px 45fr;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* RESIZE HANDLE */
.deck-resizer {
    width: 6px;
    cursor: col-resize;
    background: var(--border);
    transition: background 0.15s ease;
    z-index: 10;
    position: relative;
    align-self: stretch;
    flex-shrink: 0;
}
.deck-resizer:hover, .deck-resizer.active {
    background: var(--primary) !important;
    box-shadow: 0 0 8px var(--primary);
}

/* LEFT PANEL: OBSERVABILITY DECK */
.obs-deck {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px 16px 14px;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
}

/* OBSERVABILITY VIEWPORT PANE (Right of Activity Rail) */
.obs-viewport-pane {
    flex: 1;
    min-width: 0;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.deck-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.deck-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(6, 4, 15, 0.35);
}

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

.deck-icon {
    width: 16px;
    height: 16px;
}

.deck-icon.glow-cyan { color: var(--accent); filter: drop-shadow(0 0 4px var(--accent)); }
.deck-icon.glow-success { color: var(--success); filter: drop-shadow(0 0 4px var(--success)); }
.deck-icon.glow-purple { color: var(--accent-3); filter: drop-shadow(0 0 4px var(--accent-3)); }

.deck-card-header h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.deck-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.deck-badge.neon-cyan {
    background: rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.15);
    color: var(--accent);
}

.deck-badge.neon-purple {
    background: rgba(255, 0, 200, 0.05);
    border-color: rgba(255, 0, 200, 0.15);
    color: var(--accent-3);
}

.silent-refresh-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.silent-refresh-btn:hover {
    color: var(--accent);
}

.deck-card-body {
    padding: 16px 20px;
    flex: 1;
    overflow-y: auto;
}

.pipeline-help-panel {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(2, 0, 6, 0.45);
    padding: 12px;
}

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

.pipeline-help-header i {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

.pipeline-help-header h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-primary);
}

.pipeline-help-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 6px;
}

.pipeline-help-line.support {
    color: var(--warning);
}

.pipeline-help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.pipeline-help-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    font-size: 11px;
    color: var(--text-secondary);
}

.pipeline-help-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.pipeline-help-badge.linear {
    color: var(--accent);
    border-color: rgba(0, 240, 255, 0.22);
    background: rgba(0, 240, 255, 0.08);
}

.pipeline-help-badge.support {
    color: var(--warning);
    border-color: rgba(255, 215, 0, 0.2);
    background: rgba(255, 215, 0, 0.08);
}

/* Double sub-grid in left panel */
.deck-card-grid-two {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.deck-card-grid-two .deck-card {
    min-height: 0;
}


/* RIGHT PANEL: SRE CHAT DECK */
.chat-deck {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    height: 100%;
    min-height: 0; /* Flexbox shrink fix */
    overflow: hidden;
    border-left: 1px solid var(--border);
    background: rgba(6, 4, 15, 0.45);
    backdrop-filter: blur(8px);
}

.chat-messages {
    grid-row: 2;
    flex: 1 1 0% !important; /* Force grow/shrink and enable active scrolling */
    min-height: 0 !important;
    overflow-y: auto !important;
    padding-bottom: 12px !important;
}

.tool-runner-panel {
    grid-row: 3;
}

.chat-ops-rail {
    grid-row: 4;
}

.chat-input-area {
    grid-row: 5;
    position: sticky;
    bottom: 0;
    padding: 10px 16px 14px !important;
    background: linear-gradient(180deg, rgba(6, 4, 15, 0.25) 0%, rgba(6, 4, 15, 0.96) 24%, rgba(6, 4, 15, 0.98) 100%) !important;
    border-top: 1px solid var(--border) !important;
    position: relative;
    z-index: 8;
    flex-shrink: 0 !important; /* Never shrink input area */
    box-shadow: 0 -8px 22px rgba(0, 0, 0, 0.45);
}

.chat-compose-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(0, 240, 255, 0.22);
    background: rgba(0, 240, 255, 0.08);
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.chat-compose-label i {
    width: 12px;
    height: 12px;
}

.chat-ops-rail {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(2, 0, 6, 0.82);
    backdrop-filter: blur(8px);
}

.chat-ops-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.chat-ops-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.chat-ops-btn:hover {
    color: var(--text-primary);
    border-color: rgba(167, 139, 250, 0.2);
    background: rgba(167, 139, 250, 0.08);
}

.chat-ops-btn.accent {
    border-color: rgba(0, 240, 255, 0.25);
    color: var(--accent);
}

.chat-ops-status {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 36ch;
}

.chat-ops-rail .terminal-cmd-bar {
    display: none;
}

.chat-input-area .input-wrapper {
    background: rgba(2, 0, 6, 0.65) !important;
    border: 1px solid rgba(0, 240, 255, 0.2) !important;
    border-radius: var(--radius-md) !important;
    padding: 10px 10px 10px 16px !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55) !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.chat-input-area textarea {
    flex: 1 !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    resize: none !important;
    outline: none !important;
    padding: 6px 0 !important;
    min-height: 24px;
    max-height: 120px !important;
    line-height: 1.4 !important;
}

.chat-input-area textarea::placeholder {
    color: rgba(148, 163, 184, 0.95);
}

.chat-input-area .send-btn {
    width: 42px;
    height: 42px;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.22);
}

.chat-deck-header {
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: rgba(6, 4, 15, 0.55);
    border-bottom: 1px solid var(--border);
}

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

.chat-deck-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-3);
    filter: drop-shadow(0 0 4px var(--accent-3));
}

.chat-deck-header h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.chat-session-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}


/* ROW 3: SRE RETRO DIAGNOSTIC DRAWER */
/* Terminal drawer removed from DOM; keep space focused on primary workflows. */

.drawer-quick-actions {
    padding: 8px 20px;
    border-bottom: 1px solid rgba(167, 139, 250, 0.12);
    background: rgba(6, 4, 15, 0.58);
}

/* Quickbar short-cuts */
.playbook-quickbar {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.qbar-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: var(--transition);
}

.qbar-btn:hover {
    background: rgba(167, 139, 250, 0.08);
    color: var(--text-primary);
    border-color: rgba(167, 139, 250, 0.2);
}

.qbar-btn svg {
    width: 12px;
    height: 12px;
}

/* Responsive fixes and adjustments */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding-right: 6px;
}

.service-card {
    background: rgba(30, 41, 59, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    min-height: 54px;
}

.service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.service-card-name {
    font-weight: 600;
    font-size: 12px;
    line-height: 1.3;
    display: block;
}

.status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    line-height: 1.2;
}

.service-card-details {
    font-size: 11px;
    line-height: 1.35;
}

/* --- Terminal Command Bar styling (Compact Glass) --- */
.terminal-cmd-bar {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    padding: 8px 20px;
    background: rgba(6, 4, 15, 0.65);
    border-bottom: 1px solid rgba(167, 139, 250, 0.15);
    font-size: 12px;
}

.cmd-bar-modes {
    display: flex;
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(2, 0, 6, 0.5);
}

.mode-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.mode-tab:hover {
    color: var(--text-primary);
    background: rgba(167, 139, 250, 0.05);
}

.mode-tab.active {
    color: var(--accent);
    background: rgba(0, 240, 255, 0.1);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.cmd-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    flex: 1;
    min-width: 0;
    transition: opacity 0.3s ease;
}

.cmd-section.hidden {
    display: none;
}

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

.input-group.flex-grow {
    flex: 1;
}

.input-group label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 1320px) {
    .drawer-header-left h3 {
        font-size: 12px;
    }

    .terminal-cmd-bar {
        gap: 10px;
    }

    .cmd-section {
        gap: 10px;
    }

    .cyber-input {
        width: 120px;
    }

    .chat-ops-rail .drawer-quick-actions {
        padding: 6px 12px;
    }

    .chat-ops-rail .terminal-cmd-bar {
        padding: 8px 12px;
    }
}

@media (max-width: 1024px) {
    .chat-ops-header {
        flex-wrap: wrap;
    }

    .chat-ops-status {
        margin-left: 0;
        max-width: 100%;
    }
}

@media (max-width: 1440px) {
    .main-deck {
        grid-template-columns: 52fr 6px 48fr;
    }

    .obs-deck {
        padding: 12px 14px 14px 16px;
        gap: 12px;
    }

    .deck-card-body {
        padding: 12px 14px;
    }

    .chart-container-wrapper {
        min-height: 200px;
    }
}

@media (max-width: 1180px) {
    .main-deck {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
        overflow-y: auto;
    }

    .deck-resizer {
        display: none !important;
    }

    .chat-deck {
        border-left: none;
        border-top: 1px solid var(--border);
        min-height: 46vh;
    }

    .header-center {
        max-width: 40%;
        margin: 0 16px;
    }
}

@media (max-width: 900px) {
    .header-center {
        display: none;
    }

    .header-bezel {
        padding: 0 12px;
    }

    .header-right {
        gap: 8px;
    }

    .header-badge {
        padding: 5px 8px;
        font-size: 10px;
    }

    .obs-deck {
        padding: 10px;
    }

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

    .chat-input-area {
        padding: 8px 10px 10px !important;
    }

    .chat-compose-label {
        font-size: 9px;
        margin-bottom: 6px;
    }

    .chat-input-area .input-wrapper {
        padding: 8px 8px 8px 12px !important;
    }

    .chat-input-area textarea {
        font-size: 13px !important;
    }
}

/* Cyber inputs/selects */
.cyber-select {
    background: rgba(2, 0, 6, 0.7);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 4px 10px;
    font-family: inherit;
    font-size: 11.5px;
    outline: none;
    transition: var(--transition);
    cursor: pointer;
}

.cyber-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.2);
}

.cyber-input {
    background: rgba(2, 0, 6, 0.7);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 4px 10px;
    font-family: inherit;
    font-size: 11.5px;
    outline: none;
    transition: var(--transition);
    width: 140px;
}

.cyber-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.2);
}

.cyber-textarea {
    background: rgba(2, 0, 6, 0.5);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    outline: none;
    resize: none;
    height: 24px;
    line-height: 1.4;
    width: 100%;
}

.cyber-btn {
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.cyber-btn.primary {
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.3);
    color: var(--accent);
}

.cyber-btn.primary:hover {
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.cyber-btn.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.cyber-btn.success:hover {
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* --- Floating Hover Network Tooltip styling --- */
.network-tooltip-card {
    position: absolute;
    z-index: 9999;
    width: 320px;
    background: rgba(6, 4, 15, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 240, 255, 0.15);
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.95);
}

.network-tooltip-card.visible {
    opacity: 1;
    transform: scale(1);
}

.network-tooltip-card.hidden {
    display: none;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 240, 255, 0.05);
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.tooltip-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.tooltip-status-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.tooltip-status-pill.healthy {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.tooltip-status-pill.degraded {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.tooltip-status-pill.down {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.tooltip-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 10.5px;
    line-height: 1.4;
}

.tooltip-row .label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.tooltip-row .value {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
    word-break: break-all;
}

/* Glowing transitions when hovering over stages in the SVG Network map */
.network-node {
    cursor: pointer;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.network-node:hover {
    filter: drop-shadow(0 0 8px var(--accent)) drop-shadow(0 0 12px var(--accent-3));
}


/* =========================================================================
   CHAT HISTORY SLIDE-OVER (v4.1)
   ========================================================================= */
.header-action-btn.danger-action:hover {
    border-color: var(--error);
    color: var(--error);
    box-shadow: 0 0 14px rgba(255, 0, 85, 0.35);
}

.chat-history-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at left, rgba(125, 38, 255, 0.22), rgba(0, 0, 0, 0.7));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 90;
    animation: fade-in 0.22s ease;
}
.chat-history-overlay.hidden { display: none; }

@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes slide-in-left {
    from { transform: translateX(-110%); opacity: 0 }
    to   { transform: translateX(0); opacity: 1 }
}

.chat-history-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(420px, 92vw);
    background: linear-gradient(180deg, rgba(13, 9, 30, 0.96), rgba(6, 4, 15, 0.96));
    border-right: 1px solid rgba(0, 240, 255, 0.18);
    box-shadow: 14px 0 60px rgba(125, 38, 255, 0.25), 2px 0 0 rgba(0, 240, 255, 0.05);
    z-index: 100;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: slide-in-left 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-history-panel.hidden { display: none; }

.chat-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 12px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}
.chat-history-title {
    display: flex; align-items: center; gap: 10px;
}
.chat-history-title h3 {
    margin: 0;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: linear-gradient(90deg, var(--accent), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.chat-history-title i { color: var(--accent); width: 18px; height: 18px; }

.chat-history-close {
    background: rgba(148, 163, 184, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
    width: 32px; height: 32px;
    border-radius: 8px;
    display: grid; place-items: center;
    cursor: pointer;
    transition: all 0.18s ease;
}
.chat-history-close:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.chat-history-search {
    position: relative;
    padding: 12px 18px;
}
.chat-history-search i {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    color: var(--text-muted);
}
.chat-history-search input {
    width: 100%;
    background: rgba(6, 4, 15, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: var(--text-primary);
    padding: 10px 12px 10px 36px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.chat-history-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.12);
}

.chat-history-actions {
    padding: 4px 18px 12px;
}
.chat-history-new {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(125, 38, 255, 0.22));
    border: 1px solid rgba(0, 240, 255, 0.35);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.18s ease;
}
.chat-history-new:hover {
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.35), inset 0 0 12px rgba(125, 38, 255, 0.2);
    transform: translateY(-1px);
}
.chat-history-new i { width: 15px; height: 15px; }

.chat-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-history-list::-webkit-scrollbar { width: 6px; }
.chat-history-list::-webkit-scrollbar-thumb {
    background: rgba(125, 38, 255, 0.35);
    border-radius: 3px;
}

.chat-history-item {
    position: relative;
    padding: 11px 12px 11px 14px;
    border-radius: 10px;
    background: rgba(6, 4, 15, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.08);
    cursor: pointer;
    transition: all 0.18s ease;
    overflow: hidden;
}
.chat-history-item::before {
    content: "";
    position: absolute;
    left: 0; top: 12%; bottom: 12%;
    width: 2px;
    background: transparent;
    border-radius: 2px;
    transition: background 0.18s ease;
}
.chat-history-item:hover {
    border-color: rgba(0, 240, 255, 0.3);
    background: rgba(13, 9, 30, 0.85);
}
.chat-history-item:hover::before {
    background: linear-gradient(180deg, var(--accent), var(--accent-3));
}
.chat-history-item.active {
    border-color: rgba(0, 240, 255, 0.5);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(125, 38, 255, 0.12));
    box-shadow: inset 0 0 14px rgba(125, 38, 255, 0.15);
}
.chat-history-item.active::before {
    background: linear-gradient(180deg, var(--accent), var(--accent-3));
    box-shadow: 0 0 8px var(--accent);
}

.chat-history-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.chat-history-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}
.chat-history-item-meta .turn-count {
    color: var(--accent);
}
.chat-history-item-meta .date {
    color: var(--text-secondary);
}
.chat-history-item-meta .active-pill {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(0, 255, 102, 0.18);
    color: var(--success);
    border: 1px solid rgba(0, 255, 102, 0.35);
}

.chat-history-item-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.chat-history-item:hover .chat-history-item-actions,
.chat-history-item:focus-within .chat-history-item-actions {
    opacity: 1;
}
.chat-history-item-actions button {
    width: 24px; height: 24px;
    display: grid; place-items: center;
    background: rgba(6, 4, 15, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.chat-history-item-actions button:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.chat-history-item-actions button.delete:hover {
    color: var(--error);
    border-color: var(--error);
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.3);
}
.chat-history-item-actions button i { width: 12px; height: 12px; }

.chat-history-rename-input {
    width: 100%;
    background: rgba(6, 4, 15, 0.9);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 6px 8px;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.12);
}
.chat-history-rename-input:focus { outline: none; }

.chat-history-empty {
    padding: 36px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.chat-history-empty i {
    width: 28px; height: 28px;
    color: rgba(125, 38, 255, 0.45);
    display: block;
    margin: 0 auto 10px;
}

.chat-history-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}
.chat-history-clear-all {
    background: transparent;
    border: 1px solid rgba(255, 0, 85, 0.25);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    letter-spacing: 0.04em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
}
.chat-history-clear-all:hover {
    color: var(--error);
    border-color: var(--error);
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.25);
}
.chat-history-clear-all i { width: 12px; height: 12px; }

/* Polish: session badge in header gets a soft pulse */
.chat-session-badge {
    transition: all 0.2s ease;
}
.chat-session-badge.fresh {
    animation: badge-pulse 1.2s ease 1;
}
@keyframes badge-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.45); }
    100% { box-shadow: 0 0 0 14px rgba(0, 240, 255, 0); }
}

@media (max-width: 720px) {
    .chat-history-panel { width: 100vw; border-right: none; }
}

/* =========================================================================
   UX POLISH v4.2 — copy btn, kbd hints, jump-to-bottom, clickable badge
   ========================================================================= */
.chat-session-badge.clickable {
    cursor: pointer;
    transition: all 0.18s ease;
}
.chat-session-badge.clickable:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.kbd-hint kbd {
    display: inline-block;
    padding: 2px 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    background: rgba(6, 4, 15, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-bottom-width: 2px;
    border-radius: 4px;
    line-height: 1;
}

/* Chat-messages relative for absolute children (jump pill) */
.chat-messages { position: relative; }

.jump-to-bottom {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(125, 38, 255, 0.25));
    border: 1px solid var(--accent);
    color: var(--text-primary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 240, 255, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.jump-to-bottom:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.jump-to-bottom:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 24px rgba(0, 240, 255, 0.55);
    transform: translateX(-50%) translateY(-2px);
}
.jump-to-bottom i { width: 13px; height: 13px; }

/* Message copy button */
.message {
    position: relative;
}
.message-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    background: rgba(6, 4, 15, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
    z-index: 2;
}
.message:hover .message-copy-btn,
.message-copy-btn:focus {
    opacity: 1;
}
.message-copy-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}
.message-copy-btn.copied {
    color: var(--success);
    border-color: var(--success);
    opacity: 1;
}
.message-copy-btn i { width: 13px; height: 13px; }

@media (max-width: 720px) {
    .kbd-hint { display: none; }
}

/* =======================================================
   AURA PREMIUM VISUAL EFFECTS & MICRO-INTERACTIONS
   ======================================================= */

/* Custom Cybernetic Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(6, 4, 15, 0.45);
    border-left: 1px solid rgba(148, 163, 184, 0.05);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-3) 100%);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
}

/* Premium Frosted Glass SATURATE */
.deck-card, .chat-deck, .header-bezel, .chat-ops-rail {
    backdrop-filter: blur(20px) saturate(180%) !important;
}

/* Neon Focus Border Glows */
.chat-input-area .input-wrapper {
    transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}
.chat-input-area .input-wrapper:focus-within {
    border-color: var(--accent) !important;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.4), inset 0 0 4px rgba(0, 240, 255, 0.05) !important;
}

/* Core Visualizer listen feedback animation */
@keyframes pulse-listen {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* collapsible SRE reasoning accordion */
details {
    background: rgba(6, 4, 15, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    transition: var(--transition);
}

details[open] {
    border-color: rgba(167, 139, 250, 0.2);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.03);
}

summary {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    transition: var(--transition);
}

summary::-webkit-details-marker {
    display: none;
}

summary::before {
    content: "▶";
    font-size: 8px;
    transition: transform 0.2s ease;
    display: inline-block;
    color: var(--accent);
}

details[open] summary::before {
    transform: rotate(90deg);
}

summary:hover {
    color: var(--text-primary);
}

/* =======================================================
   SLIDE-OUT OBSERVABILITY HUD SIDEBAR
   ======================================================= */

.telemetry-sidebar {
    position: fixed;
    top: 64px; /* below the header bezel */
    left: -400px;
    width: 380px;
    height: calc(100vh - 64px);
    background: rgba(6, 4, 15, 0.88);
    backdrop-filter: blur(30px) saturate(180%) !important;
    border-right: 1px solid rgba(148, 163, 184, 0.1);
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
}

.telemetry-sidebar.open {
    left: 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 240, 255, 0.03);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

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

.sidebar-header-title h2 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-close-btn:hover {
    color: var(--accent);
    background: rgba(0, 240, 255, 0.08);
}

.sidebar-close-btn svg {
    width: 16px;
    height: 16px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Custom scrollbars inside sidebar content */
.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

/* Sidebar Trigger Tab (Floating Bezel on Left) */
.sidebar-trigger-tab {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: rgba(6, 4, 15, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-left: none;
    border-radius: 0 8px 8px 0;
    width: 24px;
    height: 80px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.sidebar-trigger-tab:hover {
    width: 28px;
    color: var(--accent);
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 3px 0 15px rgba(0, 240, 255, 0.15);
}

.sidebar-trigger-tab svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.sidebar-trigger-tab.open {
    left: 380px;
    border-left: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 0 8px 8px 0;
    color: var(--accent);
}

.sidebar-trigger-tab.open svg {
    transform: rotate(180deg);
}

/* Make Observability Deck Canvas Card expand to full height when cards are in sidebar */
.obs-deck .deck-card {
    flex: 1;
    height: 100%;
}

.obs-deck .deck-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* =======================================================
   INGESTION ACTIVE TRACE CANVAS HIGHLIGHTS
   ======================================================= */

.network-node.blocked-trace .network-node-glow {
    animation: trace-pulse-glow 1.2s infinite alternate !important;
    transform-origin: center;
}

.network-node.blocked-trace.down .network-node-glow {
    fill: var(--error) !important;
}

.network-node.blocked-trace.degraded .network-node-glow {
    fill: var(--warning) !important;
}

.network-node.blocked-trace .network-node-ring {
    stroke: var(--accent) !important;
    stroke-width: 2px !important;
    animation: trace-ring-shimmer 1.2s infinite alternate !important;
}

@keyframes trace-pulse-glow {
    0% {
        opacity: 0.25;
    }
    100% {
        opacity: 0.95;
    }
}

@keyframes trace-ring-shimmer {
    0% {
        opacity: 0.6;
        stroke-width: 1.5px;
    }
    100% {
        opacity: 1;
        stroke-width: 3px;
    }
}


/* =======================================================
   SRE BLAST RADIUS VISUALIZATION STYLES
   ======================================================= */

/* Dependency Background Paths */
.dependency-path {
    stroke: rgba(167, 139, 250, 0.08);
    stroke-width: 1px;
    fill: none;
    transition: stroke 0.4s ease, stroke-width 0.4s ease, opacity 0.4s ease;
}

/* Dimmed elements when tracing blast radius */
.network-node.blast-dimmed,
.network-path.blast-dimmed,
.network-path-glow.blast-dimmed,
.network-flow-packet.blast-dimmed,
.dependency-path.blast-dimmed {
    opacity: 0.15 !important;
    filter: grayscale(80%);
}

/* Trace Highlight Paths */
.dependency-path.blast-impact-path {
    stroke: var(--error) !important;
    stroke-width: 2px !important;
    stroke-dasharray: 4, 4;
    animation: flow-dash-error 1.5s linear infinite;
    opacity: 1 !important;
}

.dependency-path.blast-upstream-path {
    stroke: var(--accent) !important;
    stroke-width: 1.5px !important;
    stroke-dasharray: 4, 4;
    animation: flow-dash-accent 2s linear infinite;
    opacity: 1 !important;
}

/* Animations for flowing dashed lines */
@keyframes flow-dash-error {
    to {
        stroke-dashoffset: -20;
    }
}

@keyframes flow-dash-accent {
    to {
        stroke-dashoffset: 20;
    }
}

/* Blast Source Node (The Outage Origin) */
.network-node.blast-source .network-node-glow {
    fill: var(--warning) !important;
    opacity: 0.95 !important;
    animation: blast-source-glow 1s infinite alternate;
}

.network-node.blast-source .network-node-ring {
    stroke: var(--warning) !important;
    stroke-width: 3px !important;
}

.network-node.blast-source .network-node-dot {
    fill: #ffffff !important;
}

@keyframes blast-source-glow {
    0% {
        transform: scale(0.95);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.15);
        opacity: 0.95;
    }
}

/* Blast Impacted Nodes (Downstream) */
.network-node.blast-impacted .network-node-glow {
    fill: var(--error) !important;
    opacity: 0.8 !important;
    animation: blast-impact-glow 1.2s infinite alternate;
}

.network-node.blast-impacted .network-node-ring {
    stroke: var(--error) !important;
    stroke-width: 2.5px !important;
    stroke-dasharray: 3, 3;
    animation: trace-ring-shimmer 1.2s infinite alternate !important;
}

@keyframes blast-impact-glow {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.85;
    }
}

/* Blast Upstream Nodes (Root-cause dependencies) */
.network-node.blast-upstream .network-node-glow {
    fill: var(--accent) !important;
    opacity: 0.6 !important;
}

.network-node.blast-upstream .network-node-ring {
    stroke: var(--accent) !important;
    stroke-width: 2px !important;
}

/* Tracing Legend Header Button */
#blastRadiusToggle {
    transition: all 0.3s ease;
}

#blastRadiusToggle.active {
    background: rgba(251, 191, 36, 0.15) !important;
    border-color: var(--warning) !important;
    color: var(--warning) !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}


/* =======================================================
   SRE INCIDENT POST-MORTEMS HUD CARD
   ======================================================= */

.incident-search-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.incident-search-wrapper .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

.incident-search-wrapper input {
    width: 100%;
    padding: 8px 12px 8px 30px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

.incident-search-wrapper input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.15);
}

.incidents-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}

.incidents-list::-webkit-scrollbar {
    width: 3px;
}

.incident-item-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
}

.incident-item-card:hover {
    background: rgba(251, 191, 36, 0.04);
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateX(2px);
}

.incident-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.incident-item-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--warning);
    font-weight: 700;
}

.similarity-score-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.similarity-score-badge.high {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.08);
}

.similarity-score-badge.med {
    color: var(--warning);
    border-color: rgba(251, 191, 36, 0.2);
    background: rgba(251, 191, 36, 0.08);
}

.similarity-score-badge.low {
    color: var(--text-secondary);
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.incident-item-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.incident-item-desc {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =======================================================
   PREDICTIVE INGESTION BACKLOG ALERT BANNER
   ======================================================= */

.predictive-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(30, 30, 50, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(250, 204, 21, 0.25);
    animation: predictiveSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    transition: all 0.4s ease;
}

.predictive-alert.hidden {
    display: none;
}

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

/* Severity states */
.predictive-alert.warning {
    border-color: rgba(250, 204, 21, 0.4);
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.1),
                inset 0 0 20px rgba(250, 204, 21, 0.03);
}

.predictive-alert.critical {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15),
                inset 0 0 20px rgba(239, 68, 68, 0.05);
    animation: predictiveSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1),
               predictiveCriticalPulse 2s ease-in-out infinite;
}

@keyframes predictiveCriticalPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.15),
                    inset 0 0 20px rgba(239, 68, 68, 0.05);
    }
    50% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.3),
                    inset 0 0 30px rgba(239, 68, 68, 0.08);
    }
}

.predictive-alert.draining {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.08),
                inset 0 0 15px rgba(16, 185, 129, 0.03);
}

.predictive-alert.healthy {
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: none;
}

/* Icon */
.predictive-alert-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

/* Content block */
.predictive-alert-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.predictive-alert-label {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
}

.predictive-alert-text {
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.predictive-alert.warning .predictive-alert-text {
    color: #facc15;
}

.predictive-alert.critical .predictive-alert-text {
    color: #ef4444;
}

.predictive-alert.draining .predictive-alert-text {
    color: #10b981;
}

/* Meta column (ETA + progress bar) */
.predictive-alert-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    min-width: 80px;
}

.predictive-alert-eta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.predictive-alert.warning .predictive-alert-eta {
    color: #facc15;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
}

.predictive-alert.critical .predictive-alert-eta {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.predictive-alert.draining .predictive-alert-eta {
    color: #10b981;
    text-shadow: 0 0 6px rgba(16, 185, 129, 0.35);
}

/* Progress bar representing utilization */
.predictive-alert-bar {
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.1);
    overflow: hidden;
}

.predictive-alert-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #818cf8, #a78bfa);
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.4s ease;
    width: 0%;
}

.predictive-alert.warning .predictive-alert-bar-fill {
    background: linear-gradient(90deg, #facc15, #f59e0b);
}

.predictive-alert.critical .predictive-alert-bar-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.predictive-alert.draining .predictive-alert-bar-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}


/* =======================================================
   OBSERVABILITY DECK VERTICAL SLIM ACTIVITY RAIL
   ======================================================= */

.obs-rail-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 66px;
    flex-shrink: 0;
    padding: 10px 4px;
    background: rgba(13, 10, 26, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    z-index: 5;
    position: relative;
}
.obs-rail-nav::-webkit-scrollbar {
    display: none;
}

.obs-rail-nav .obs-tab-btn {
    width: 56px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 2px;
    background: none;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    flex-shrink: 0;
}

.obs-rail-nav .obs-tab-btn span {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.1px;
    text-transform: uppercase;
    max-width: 54px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
    opacity: 0.85;
    text-align: center;
}

.obs-rail-nav .obs-tab-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.obs-rail-nav .obs-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.08);
}
.obs-rail-nav .obs-tab-btn:hover svg {
    transform: scale(1.08);
}

/* Tooltip on Hover */
.obs-rail-nav .obs-tab-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: rgba(10, 14, 28, 0.95);
    color: #f1f5f9;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 10px rgba(0, 240, 255, 0.08);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    z-index: 1000;
}
.obs-rail-nav .obs-tab-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Active Pill indicator on left edge */
.obs-rail-nav .obs-tab-btn::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
    transition: all 0.22s ease;
}

.obs-rail-nav .obs-tab-btn.active::before {
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* Active State Styles */
.obs-rail-nav .obs-tab-btn.active {
    color: var(--accent);
    background: rgba(0, 240, 255, 0.09);
    border-color: rgba(0, 240, 255, 0.22);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.08), inset 0 0 8px rgba(0, 240, 255, 0.03);
}

.obs-rail-nav .obs-tab-btn.active .tab-icon {
    filter: drop-shadow(0 0 6px var(--accent));
}

.obs-rail-nav .obs-tab-btn[data-tab="rabbitmq-tab"].active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.09);
    border-color: rgba(56, 189, 248, 0.25);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.09);
}

.obs-rail-nav .obs-tab-btn[data-tab="health-tab"].active {
    color: #34d399;
    background: rgba(52, 211, 153, 0.09);
    border-color: rgba(52, 211, 153, 0.25);
    box-shadow: 0 0 16px rgba(52, 211, 153, 0.09);
}

.obs-rail-nav .obs-tab-btn[data-tab="throughput-tab"].active,
.obs-rail-nav .obs-tab-btn[data-tab="telemetry-tab"].active {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.09);
    border-color: rgba(192, 132, 252, 0.25);
    box-shadow: 0 0 16px rgba(192, 132, 252, 0.09);
}

.obs-rail-nav .obs-tab-btn[data-tab="watchdog-tab"].active {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.09);
    border-color: rgba(251, 146, 60, 0.25);
    box-shadow: 0 0 16px rgba(251, 146, 60, 0.09);
}

.obs-rail-nav .obs-tab-btn[data-tab="scorecards-tab"].active {
    color: #818cf8;
    background: rgba(129, 140, 248, 0.09);
    border-color: rgba(129, 140, 248, 0.25);
    box-shadow: 0 0 16px rgba(129, 140, 248, 0.09);
}

.obs-rail-nav .obs-tab-btn[data-tab="incidents-tab"].active {
    color: var(--warning);
    background: rgba(250, 204, 21, 0.08);
    border-color: rgba(250, 204, 21, 0.22);
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.08);
}

/* =======================================================
   OBSERVABILITY DECK TAB SYSTEM (HORIZONTAL / LEGACY FALLBACK)
   ======================================================= */

.obs-tabs-nav {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: rgba(15, 10, 30, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    margin-bottom: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.obs-tabs-nav::-webkit-scrollbar {
    display: none;
}

.obs-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    background: none;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.obs-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.06);
}

/* Active State Styles */
.obs-tab-btn.active {
    color: var(--accent);
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.06),
                inset 0 0 8px rgba(0, 240, 255, 0.02);
}

.obs-tab-btn.active .tab-icon {
    filter: drop-shadow(0 0 6px var(--accent));
}

.obs-tab-btn[data-tab="rabbitmq-tab"].active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.08);
}

.obs-tab-btn[data-tab="health-tab"].active {
    color: #34d399;
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.25);
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.08);
}

.obs-tab-btn[data-tab="throughput-tab"].active,
.obs-tab-btn[data-tab="telemetry-tab"].active {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.08);
    border-color: rgba(192, 132, 252, 0.25);
    box-shadow: 0 0 15px rgba(192, 132, 252, 0.08);
}

.obs-tab-btn[data-tab="watchdog-tab"].active {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.08);
    border-color: rgba(251, 146, 60, 0.25);
    box-shadow: 0 0 15px rgba(251, 146, 60, 0.08);
}

.obs-tab-btn[data-tab="scorecards-tab"].active {
    color: #818cf8;
    background: rgba(129, 140, 248, 0.08);
    border-color: rgba(129, 140, 248, 0.25);
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.08);
}

.obs-tab-btn[data-tab="incidents-tab"].active {
    color: var(--warning);
    background: rgba(250, 204, 21, 0.06);
    border-color: rgba(250, 204, 21, 0.2);
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.06);
}

/* Icon dimensions */
.obs-tab-btn svg {
    width: 14px;
    height: 14px;
}

/* Tab contents controls */
.obs-tab-content {
    display: none;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.obs-tab-content.active {
    display: flex;
    animation: tabFadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Card full height expansions */
.flex-grow-card {
    flex: 1 !important;
    height: 100% !important;
    min-height: 0;
}

.flex-grow-card .deck-card-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.obs-deck {
    overflow-y: hidden !important; /* Managed individually by tabs */
}

/* Custom scrollbar overrides inside tab containers */
#rabbitmq-tab,
#health-tab,
#throughput-tab,
#watchdog-tab,
#telemetry-tab {
    overflow-y: auto;
    padding-right: 4px;
}

#rabbitmq-tab::-webkit-scrollbar,
#health-tab::-webkit-scrollbar,
#throughput-tab::-webkit-scrollbar,
#watchdog-tab::-webkit-scrollbar,
#telemetry-tab::-webkit-scrollbar {
    width: 4px;
}

#rabbitmq-tab::-webkit-scrollbar-thumb,
#health-tab::-webkit-scrollbar-thumb,
#throughput-tab::-webkit-scrollbar-thumb,
#watchdog-tab::-webkit-scrollbar-thumb,
#telemetry-tab::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.15);
    border-radius: 2px;
}

/* Playbook Execution UI Components */
.playbook-run-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playbook-run-btn:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.playbook-run-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.playbook-run-btn code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
    margin: 0 2px;
    color: #38bdf8;
}

.terminal-output-box {
    margin-top: 6px;
    padding: 10px;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.4;
    color: #cbd5e1;
    background: #0f172a;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-output-box.running {
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.terminal-output-box.success {
    border-color: rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.terminal-output-box.error {
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

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


