/* Call Transcript Intelligence - Styles */
/* Forked from apex-compliance-chat, accent: indigo (#6366f1) */

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

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-elevated: #2d333b;
    --border: #30363d;
    --border-subtle: #262c34;
    --text: #f0f6fc;
    --text-secondary: #b1bac4;
    --text-dim: #768390;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-soft: rgba(99, 102, 241, 0.08);
    --success: #3fb950;
    --success-soft: rgba(63, 185, 80, 0.15);
    --warning: #d29922;
    --danger: #f85149;
    --danger-soft: rgba(248, 81, 73, 0.15);
    --info: #58a6ff;
    --console-bg: #0d1117;
    --console-text: #e6edf3;
    --console-accent: #79c0ff;
    --console-success: #56d364;
    --console-warning: #e3b341;
    --console-request: #a5d6ff;
    --console-response: #7ee787;
}

html {
    height: 100%;
    background: var(--bg-primary);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: transparent;
    color: var(--text);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ============================================
   Background
   ============================================ */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #0d1117 0%, #0a0e14 100%);
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.6;
}

.bg-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(99, 102, 241, 0.3) 20%,
        rgba(99, 102, 241, 0.5) 50%,
        rgba(99, 102, 241, 0.3) 80%,
        transparent 100%
    );
}

.bg-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* Header */
.header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(22, 27, 34, 0.95) 100%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    position: relative;
    backdrop-filter: blur(12px);
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 80% 50%, rgba(129, 140, 248, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 5%,
        rgba(99, 102, 241, 0.5) 30%,
        rgba(129, 140, 248, 0.4) 50%,
        rgba(99, 102, 241, 0.5) 70%,
        transparent 95%
    );
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 46px;
    height: 46px;
    background: linear-gradient(145deg, var(--accent) 0%, #4f46e5 50%, #7c3aed 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 20px rgba(99, 102, 241, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: iconGlow 4s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1) inset; }
    50% { box-shadow: 0 6px 28px rgba(99, 102, 241, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15) inset; }
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.logo-text h1 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.logo-text .title-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.logo-subtitle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.subtitle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.subtitle-icon svg {
    width: 12px;
    height: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    position: relative;
    z-index: 1;
}

/* Header Buttons */
.header-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
}

.header-btn.console-toggle.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.header-btn svg {
    width: 15px;
    height: 15px;
    opacity: 0.8;
}

.header-btn:hover svg {
    opacity: 1;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem 0.375rem 0.625rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: all 0.3s ease;
}

.connection-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: all 0.3s ease;
    position: relative;
}

.connection-status.connected {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.connection-status.connected .status-dot {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
    animation: pulse-green 2s ease-in-out infinite;
}

.connection-status.connected .status-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(34, 197, 94, 0.6);
    animation: ripple 2s ease-out infinite;
}

.connection-status.connected .status-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(34, 197, 94, 0.4);
    animation: ripple 2s ease-out 0.5s infinite;
}

@keyframes ripple {
    0% { width: 8px; height: 8px; opacity: 0.6; }
    100% { width: 24px; height: 24px; opacity: 0; }
}

.connection-status.error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.connection-status.error .status-dot {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    animation: pulse-red 1.5s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Layout */
.main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* Left Sidebar */
.sidebar {
    width: 300px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.sidebar-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header h2::before {
    content: '\1F4CA';
    font-size: 1rem;
}

.sidebar-header p {
    font-size: 0.9375rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Dataset Stats */
.dataset-stats {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
}

.stat-row + .stat-row {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-dim);
}

.stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}

.stat-value.stat-danger {
    color: var(--danger);
}

.stat-value.stat-success {
    color: var(--success);
}

.stat-value.stat-warning {
    color: var(--warning);
}

/* Sidebar Quick Queries */
.sidebar-queries {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.sidebar-queries h3 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.875rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.suggestion-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.suggestion-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

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

.suggestion-btn:active {
    transform: translateX(2px);
    background: rgba(99, 102, 241, 0.12);
}

.suggestion-btn .btn-icon {
    font-size: 1rem;
    opacity: 0.7;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.suggestion-btn:hover .btn-icon {
    opacity: 1;
}

.suggestion-btn .btn-text {
    flex: 1;
    line-height: 1.3;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    position: relative;
}

.chat-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(99, 102, 241, 0.03) 25%,
        transparent 50%,
        rgba(99, 102, 241, 0.02) 75%,
        transparent 100%
    );
    background-size: 400% 400%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.chat-area.searching::before {
    opacity: 1;
    animation: searchingGradient 3s ease infinite;
}

@keyframes searchingGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.chat-area::after {
    content: '';
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.chat-area.searching::after {
    opacity: 1;
    animation: subtleSpin 1s linear infinite;
}

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

/* Q&A Scroll Area */
.qa-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Q&A Card */
.qa-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    animation: cardFadeIn 0.6s ease-out;
}

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

.qa-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02), transparent);
    animation: cardShimmer 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cardShimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.qa-card-header {
    padding: 1.25rem 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.qa-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}

.qa-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: iconFloat 3s ease-in-out infinite;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
    }
    50% {
        transform: translateY(-4px);
        box-shadow: 0 12px 35px rgba(99, 102, 241, 0.3);
    }
}

.qa-card-icon svg {
    color: white;
}

.qa-card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.qa-card-header p {
    font-size: 0.875rem;
    color: var(--text-dim);
}

.qa-card-body {
    padding: 1.5rem;
}

.qa-input-section {
    margin-bottom: 1.25rem;
}

.qa-input-section label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.qa-textarea {
    width: 100%;
    min-height: 100px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s;
}

.qa-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.qa-textarea::placeholder {
    color: var(--text-dim);
}

.qa-submit-btn {
    margin-top: 1rem;
    padding: 0.875rem 2rem;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.qa-submit-btn:hover {
    background: var(--accent-hover);
}

.qa-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qa-submit-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.qa-suggestions {
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.qa-suggestions-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.75rem;
}

.qa-suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qa-chip {
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
}

.qa-chip:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--accent);
}

/* Q&A Input Bar */
.qa-input-bar {
    display: none;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.qa-input-bar.visible {
    display: block;
}

.qa-input-bar-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.qa-bar-textarea {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    transition: border-color 0.2s;
}

.qa-bar-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.qa-bar-textarea::placeholder {
    color: var(--text-dim);
}

.qa-bar-btn {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qa-bar-btn:hover {
    background: var(--accent-hover);
}

.qa-bar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages */
.messages {
    flex: 1;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.message-card {
    max-width: 700px;
    margin: 0 auto 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    animation: cardFadeIn 0.3s ease;
}

.message-card.assistant {
    border-color: rgba(99, 102, 241, 0.2);
}

.message-card.user {
    background: var(--bg-primary);
    border-color: var(--border);
}

.message-card-header {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.message-card.assistant .message-card-header {
    background: rgba(99, 102, 241, 0.08);
    border-bottom-color: rgba(99, 102, 241, 0.15);
}

.message-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.message-card.assistant .message-card-title {
    color: var(--accent);
}

.message-card-icon {
    font-size: 1rem;
}

.copy-btn {
    padding: 0.375rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.copy-btn.copied {
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
}

.message-card-body {
    padding: 1.25rem 1.5rem;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text);
    letter-spacing: 0.01em;
}

.message-card-body p { margin-bottom: 1rem; }
.message-card-body p:last-child { margin-bottom: 0; }

.message-card-body ul, .message-card-body ol {
    margin: 1rem 0;
    padding-left: 1.75rem;
}

.message-card-body li {
    margin-bottom: 0.625rem;
    padding-left: 0.25rem;
    color: var(--text-dim);
}

.message-card-body li::marker {
    color: var(--accent);
}

.message-card-body h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.25rem 0 0.5rem 0;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border);
}

.message-card-body h2:first-child { margin-top: 0; }

.message-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin: 1rem 0 0.375rem 0;
}

.message-card-body h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin: 0.75rem 0 0.25rem 0;
}

.message-card-body strong {
    color: var(--accent-hover);
    font-weight: 600;
}

.message-card-body code {
    background: var(--bg-primary);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.2);
}

.message-card-body .md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.message-card-body .md-table th,
.message-card-body .md-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.message-card-body .md-table th {
    background: var(--bg-primary);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.message-card-body .md-table td {
    color: var(--text);
}

.message-card-body .md-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.message-card-body .md-table tbody tr:last-child td {
    border-bottom: none;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    font-size: 0.875rem;
}

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

.loading-dots span {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Search Status Indicators */
.search-status {
    margin-top: 0.75rem;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-dim);
    padding: 0.375rem 0;
    animation: search-fade-in 0.3s ease;
}

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

.search-item .search-icon {
    width: 14px;
    height: 14px;
    color: var(--accent);
    animation: search-pulse 1.5s infinite;
}

@keyframes search-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.search-query {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text);
    background: var(--bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Console Panel */
.console-panel {
    width: 0;
    background: var(--console-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

.console-panel.open {
    width: 420px;
}

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

.console-header h3 {
    color: var(--console-text);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.console-header h3 svg {
    color: var(--console-accent);
}

.console-clear-btn {
    padding: 0.375rem 0.625rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text-dim);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.console-clear-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border);
    color: var(--console-text);
}

.console-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
}

.console-entry {
    margin-bottom: 1rem;
    animation: console-fade-in 0.3s ease;
}

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

.console-entry-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.console-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.console-badge.request {
    background: rgba(129, 140, 248, 0.2);
    color: var(--console-request);
}

.console-badge.response {
    background: rgba(52, 211, 153, 0.2);
    color: var(--console-response);
}

.console-badge.tool {
    background: rgba(251, 191, 36, 0.2);
    color: var(--console-warning);
}

.console-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.console-badge.upload {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.console-timestamp {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.console-json {
    background: var(--bg-tertiary);
    border-radius: 0.375rem;
    padding: 0.75rem;
    overflow-x: auto;
    color: var(--text-dim);
}

.console-json .key { color: var(--console-accent); }
.console-json .string { color: #a5f3fc; }
.console-json .number { color: #fcd34d; }
.console-json .boolean { color: #f472b6; }
.console-json .null { color: var(--text-dim); }

.console-tool-info {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 0.375rem;
    padding: 0.625rem 0.75rem;
    color: #fcd34d;
}

.console-tool-info .tool-name {
    font-weight: 600;
    color: var(--console-warning);
}

.console-tool-info .tool-query {
    color: #fef3c7;
    margin-top: 0.25rem;
}

/* Console stats bar */
.console-stats {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.console-stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.console-stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.console-stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--console-text);
    font-family: 'JetBrains Mono', monospace;
}

.console-stat-value.success {
    color: var(--console-success);
}

/* ============================================
   Demo Footer & Tour Mode
   ============================================ */

.demo-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    opacity: 0.5;
    z-index: 100;
    cursor: default;
    user-select: none;
}

.demo-footer:hover {
    opacity: 0.8;
}

.demo-indicator {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    box-shadow: 0 4px 20px var(--accent-glow);
    animation: demo-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes demo-slide-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.demo-indicator .pulse-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: demo-pulse 1.5s ease-in-out infinite;
}

@keyframes demo-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.demo-indicator button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    margin-left: 8px;
}

.demo-indicator button:hover {
    background: rgba(255,255,255,0.3);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1200px) {
    .console-panel.open {
        width: 350px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }

    .qa-card {
        max-width: 100%;
    }
}

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

    .console-panel {
        display: none;
    }

    .header {
        padding: 0.75rem 1rem;
    }

    .logo-subtitle {
        display: none;
    }

    .logo-text h1 {
        font-size: 1.25rem;
    }

    .header-btn span {
        display: none;
    }

    .header-btn {
        padding: 0.5rem 0.625rem;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 0.625rem 0.875rem;
    }

    .header-left {
        gap: 0.5rem;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
    }

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

    .logo-text h1 {
        font-size: 1.125rem;
    }

    .logo-text .title-accent {
        display: none;
    }

    .header-actions {
        gap: 0.375rem;
    }

    .connection-status {
        padding: 0.25rem 0.5rem;
    }

    .connection-status .status-label {
        display: none;
    }

    .qa-scroll-area {
        padding: 1rem;
    }

    .qa-card-header {
        padding: 1rem;
    }

    .qa-card-header h2 {
        font-size: 1.125rem;
    }

    .qa-card-header p {
        font-size: 0.8125rem;
    }

    .qa-card-icon {
        width: 40px;
        height: 40px;
    }

    .qa-card-body {
        padding: 1rem;
    }

    .qa-textarea {
        min-height: 80px;
        font-size: 0.9375rem;
    }

    .qa-submit-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }

    .qa-suggestion-chips {
        flex-direction: column;
    }

    .qa-chip {
        text-align: center;
    }

    .qa-input-bar {
        padding: 0.875rem 1rem;
    }

    .qa-bar-textarea {
        font-size: 0.9375rem;
    }

    .message-card {
        max-width: 100%;
    }

    .message-card-body {
        padding: 1rem;
        font-size: 0.9375rem;
    }

    .connection-status span:last-child {
        display: none;
    }
}
