:root {
    color-scheme: light;

    /* Demo portal aligned color palette */
    --bg: #f8f9fa;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --surface-muted: #f8f9fa;
    --surface-subtle: #f1f3f4;

    /* Borders & dividers */
    --border: #e8eaed;
    --border-strong: #dadce0;
    --border-subtle: #f1f3f4;

    /* Typography */
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-quaternary: #d1d5db;
    --text-muted: #e5e7eb;

    /* Brand & accent colors */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #dbeafe;
    --accent-strong: #1d4ed8;

    /* Semantic colors */
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fee2e2;

    /* Interactive states */
    --hover-overlay: rgba(15, 23, 42, 0.04);
    --pressed-overlay: rgba(15, 23, 42, 0.08);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-crisp: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.12);

    /* Typography system */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border radius scale */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
    scroll-behavior: smooth;
}

.dashboard {
    display: flex;
    min-height: 100vh;
    justify-content: center;
}


.main-pane {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    background: transparent;
    overflow-x: hidden;
    padding: 0 var(--space-6);
}

.main-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-8);
    padding: var(--space-6) 0 0;
}

.brand-inline {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.brand-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-xl);
    background: var(--surface-subtle);
    padding: var(--space-2);
}

.brand-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-subtitle {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-weight: 500;
}

.project-selector {
    position: relative;
}

.project-dropdown {
    appearance: none;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-5) var(--space-3) var(--space-4);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 180px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 16px;
}

.project-dropdown:hover {
    border-color: var(--accent);
    background-color: var(--surface);
}

.project-dropdown:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-form {
    display: flex;
    gap: var(--space-1);
    background: var(--surface);
    padding: var(--space-1);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-crisp);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.search-form:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--accent-light);
}

.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: var(--space-3) var(--space-4);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.search-form input:focus {
    outline: none;
}

.search-form input::placeholder {
    color: var(--text-quaternary);
    font-weight: 400;
}

.search-form button {
    border: none;
    border-radius: var(--radius-full);
    padding: var(--space-3) var(--space-6);
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.search-form button:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.search-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.search-form button.loading {
    background: var(--accent);
    cursor: wait;
}

.search-form button.loading:hover {
    background: var(--accent);
    transform: none;
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: var(--space-2);
}

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

.results-pane.searching {
    position: relative;
    overflow: hidden;
}

.search-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(250, 251, 252, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: fadeIn 0.2s ease-out;
}

.search-loading-content {
    text-align: center;
    padding: var(--space-8);
}

.search-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-4);
}

.search-loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modern Login page styles */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
}

.login-content {
    padding: var(--space-8);
}

.login-brand {
    text-align: center;
    margin-bottom: var(--space-8);
}

.brand-logo {
    margin-bottom: var(--space-4);
}

.login-logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-light) 0%, rgba(59, 130, 246, 0.1) 100%);
    padding: var(--space-2);
}

.login-brand h1 {
    margin: 0 0 var(--space-2);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.login-brand p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.login-messages {
    margin-bottom: var(--space-6);
}

.login-message {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
}

.login-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.input-group {
    position: relative;
}

.login-input {
    width: 100%;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--surface);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.login-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.login-input::placeholder {
    color: var(--text-quaternary);
    font-weight: 400;
}

.login-submit {
    padding: var(--space-4);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(59, 130, 246, 0.3),
        0 2px 6px rgba(59, 130, 246, 0.2);
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.login-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-submit:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-strong) 100%);
    box-shadow:
        0 6px 16px rgba(59, 130, 246, 0.4),
        0 3px 8px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.login-submit:hover::before {
    left: 100%;
}

.login-submit:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(59, 130, 246, 0.3),
        0 1px 4px rgba(59, 130, 246, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .login-container {
        padding: var(--space-3);
    }

    .login-content {
        padding: var(--space-6);
    }

    .login-brand h1 {
        font-size: 1.25rem;
    }
}

.user-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.profile-chip {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-full);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 0.8rem;
    box-shadow: var(--shadow-sm);
}

.logout-btn {
    background: var(--surface-muted);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-2);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: var(--surface);
    border-color: var(--error);
    color: var(--error);
}

.page-header {
    margin: 0 0 var(--space-8);
    text-align: center;
    padding: var(--space-8) 0;
}

.page-header h1 {
    margin: 0 0 var(--space-2);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.page-header p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-tertiary);
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto;
    opacity: 0.88;
    letter-spacing: 0.005em;
    line-height: 1.5;
}

.flash-messages {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.flash {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 500;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.flash.success {
    color: var(--success);
    background: var(--success-light);
    border-color: var(--success);
}

.flash.error {
    color: var(--error);
    background: var(--error-light);
    border-color: var(--error);
}

.hero {
    margin: 0 var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-8);
    padding: var(--space-10) var(--space-10);
    border-radius: var(--radius-2xl);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.hero h1 {
    margin: 0 0 var(--space-3);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.hero p {
    margin: 0;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.hero-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
    background: var(--surface-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-5) var(--space-6);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.content-wrapper {
    margin: 0 0 var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.results-pane {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-5);
    margin-bottom: var(--space-1);
}

.results-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.results-meta {
    margin: var(--space-1) 0 0;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
}

.summary-pill {
    background: var(--accent-light);
    color: var(--accent);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 300px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: var(--shadow-sm);
}

.quotes {
    display: grid;
    gap: var(--space-4);
}

.quote {
    background: var(--surface);
    border-radius: 16px;
    padding: var(--space-5) var(--space-6);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.quote:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}


.quote header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.quote header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.015em;
    line-height: 1.4;
}

.quote .expert-meta {
    margin-top: 2px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.3;
}

.quote .meta {
    margin-top: var(--space-2);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.experts-header[data-visible="false"] {
    display: none;
}

.relevance-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.7rem;
    border: 1px solid rgba(59, 130, 246, 0.15);
    line-height: 1.2;
}

.copy-btn {
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    font-weight: 500;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.copy-btn[data-copied="true"] {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.quote-body p {
    margin: var(--space-1) 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

.quote-body p.primary {
    font-weight: 600;
    color: var(--text-primary);
}

.quote-body p.context {
    color: var(--text-quaternary);
}

.quote-body .speaker {
    font-weight: 600;
    margin-right: 0.35rem;
    color: var(--text-secondary);
}

.speaker-block {
    margin: var(--space-1) 0;
    line-height: 1.5;
    font-size: 0.9rem;
}
.sentence {
    display: inline;
    padding: 0.05rem 0.2rem;
    border-radius: 4px;
}
.sentence.primary {
    background: var(--accent-light);
    color: var(--text-primary);
    font-weight: 600;
}
.sentence.context {
    color: var(--text-tertiary);
}

/* Enhanced quote styling for better readability */
.quote-body .speaker {
    font-weight: 600;
    margin-right: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.sentence.primary {
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-primary);
    font-weight: 500;
}

.sentence.context {
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Better visual hierarchy */
.quote header {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-4);
}


.empty-card,
.empty-state-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    padding: var(--space-12) var(--space-8);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.empty-state-card h2 {
    margin: 0 0 var(--space-4);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.empty-state-card p {
    font-size: 0.95rem;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin: 0 0 var(--space-6);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.sidebar-card {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    padding: var(--space-6) var(--space-6);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transition: all 0.15s ease;
}

.sidebar-card:hover {
    box-shadow: var(--shadow-xl);
}

.sidebar-card h3 {
    margin: 0 0 var(--space-5);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.expert-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.expert-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius-lg);
    transition: all 0.15s ease;
}

.expert-item:hover {
    background: var(--hover-overlay);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: var(--shadow-sm);
}

.expert-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.expert-role {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.empty-note {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-align: center;
    font-style: italic;
}

.sidebar-card.notice {
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
}

.experts-header {
    padding: var(--space-8) 0;
    margin-bottom: var(--space-8);
    text-align: center;
}

.experts-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
}

.experts-count {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.experts-categories {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid var(--border-subtle);
    letter-spacing: -0.01em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.05),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.category-pill:hover {
    background: var(--surface-muted);
    border-color: var(--border);
    color: var(--text-primary);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

/* Expert List Section - Perplexity Level */
.experts-list-section {
    margin-top: var(--space-10);
}

.experts-list-section h3 {
    margin: 0 0 var(--space-8);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    text-align: center;
}

.experts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-3);
    max-width: 1000px;
    margin: 0 auto;
}

.expert-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    color: inherit;
    text-decoration: none;
}


.expert-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    letter-spacing: -0.01em;
    overflow: hidden;
}

.expert-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

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

.expert-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: var(--space-1);
}

.expert-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-bottom: var(--space-1);
    font-weight: 500;
}

.expert-category {
    display: inline-block;
    padding: 1px var(--space-2);
    background: var(--surface-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Legacy styles - keeping for any remaining usage */
.experts-footer {
    margin-top: var(--space-6);
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border);
}

.experts-avatars {
    display: flex;
    gap: var(--space-1);
    align-items: center;
}

.avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: var(--shadow-sm);
}

.avatar-mini.more {
    background: var(--surface-muted);
    color: var(--text-tertiary);
    border-color: var(--border);
}

.flash.success,
.flash.error { font-weight: 500; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Expert header - no animations */

/* Enhanced responsive design */
@media (max-width: 840px) {
    .main-pane {
        max-width: none;
        padding: 0 var(--space-4);
    }
    .main-header {
        grid-template-columns: 1fr;
        padding: var(--space-4) 0 0;
        gap: var(--space-4);
    }
    .search-form { width: 100%; }
    .user-actions { display: none; }
    .quote {
        padding: var(--space-4) var(--space-5);
        gap: var(--space-3);
    }
    .experts-summary {
        flex-direction: column;
        align-items: center;
        gap: var(--space-3);
    }
    .experts-categories {
        justify-content: center;
    }
    .experts-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: var(--space-3);
    }
    .expert-card {
        padding: var(--space-3);
    }
    .expert-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .main-pane {
        padding: 0 var(--space-3);
    }
    .main-header {
        padding: var(--space-3) 0 0;
    }
    .quote {
        padding: var(--space-3) var(--space-4);
        gap: var(--space-2);
    }
    .brand-inline {
        gap: var(--space-2);
    }
    .brand-icon img {
        width: 32px;
        height: 32px;
    }
    .brand-title {
        font-size: 0.9rem;
    }
    .brand-subtitle {
        font-size: 0.75rem;
    }
}

.ai-answer-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--space-6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: var(--space-6);
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-answer-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--border-strong);
}

.ai-answer-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.ai-answer-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ai-answer-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ai-answer-spinner.active {
    opacity: 1;
}

.ai-answer-container {
    position: relative;
}

.ai-answer-body {
    line-height: 1.5;
    font-size: 0.95rem;
    color: var(--text-primary);
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    position: relative;
}

.ai-answer-body.expanded {
    max-height: none;
}

.ai-answer-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--surface));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-answer-body.has-overflow::after {
    opacity: 1;
}

.ai-answer-body.expanded::after {
    opacity: 0;
}

.ai-answer-expand {
    display: none;
    align-items: center;
    justify-content: center;
    margin: var(--space-3) auto 0;
    padding: var(--space-2) var(--space-3);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    width: fit-content;
}

.ai-answer-expand:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
}

.ai-answer-expand svg {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.ai-answer-expand.expanded svg {
    transform: rotate(180deg);
}

.ai-answer-card[data-query=""] {
    display: none;
}
  

ul {
    margin: 0;
}

ul li {
    margin: 0;
    padding: 0;
    line-height: 1.3; /* tighten vertical spacing */
  }

/* NEW: streaming placeholder */
.streaming-placeholder {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    padding: var(--space-8);
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: var(--text-tertiary);
}
