@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: hsl(222, 47%, 6%);
    color: hsl(210, 40%, 96%);
    font-size: 14px;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}

/* Legacy container - kept for backward compatibility */
.container.legacy {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    background: hsl(0, 0%, 12%);
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.banner-box {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.branding-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 1rem;
}

/* .brand-switcher is defined in the header section below */

.brand-logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.brand-name {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(210, 40%, 90%);
    font-family: 'Inter', system-ui, sans-serif;
}

.brand-dropdown {
    position: relative;
    margin-left: auto;
}

.brand-switcher-btn {
    background: hsl(222, 30%, 14%);
    border: 1px solid hsl(222, 30%, 18%);
    color: hsl(210, 40%, 90%);
    padding: 0.4rem 0.75rem;
    border-radius: 0.625rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-family: 'Inter', system-ui, sans-serif;
    transition: all 0.2s;
}

.brand-switcher-btn:hover {
    background: hsl(222, 30%, 16%);
    border-color: hsl(186, 100%, 50%);
    color: hsl(186, 100%, 50%);
}

.dropdown-arrow {
    font-size: 0.7rem;
}

.brand-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: hsl(222, 44%, 10%);
    border: 1px solid hsl(222, 30%, 18%);
    border-radius: 0.625rem;
    min-width: 200px;
    box-shadow: 0 8px 24px hsl(222, 47%, 4% / 0.4);
    z-index: 1000;
    backdrop-filter: blur(20px);
}

.brand-list {
    max-height: 300px;
    overflow-y: auto;
}

.brand-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    color: hsl(210, 40%, 90%);
    border-bottom: 1px solid hsl(222, 30%, 18%);
    font-size: 0.875rem;
    font-family: 'Inter', system-ui, sans-serif;
    transition: all 0.2s;
}

.brand-item:hover {
    background: hsl(222, 30%, 14%);
    color: hsl(186, 100%, 50%);
}

.brand-item.active {
    background: hsl(222, 30%, 16%);
    color: hsl(186, 100%, 50%);
    font-weight: 600;
}

.brand-actions {
    padding: 0.5rem;
    border-top: 1px solid hsl(222, 30%, 18%);
}

.brand-action-btn {
    width: 100%;
    padding: 0.5rem;
    background: hsl(222, 30%, 14%);
    border: 1px solid hsl(222, 30%, 18%);
    color: hsl(210, 40%, 90%);
    border-radius: 0.625rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    transition: all 0.2s;
}

.brand-action-btn:hover {
    background: hsl(222, 30%, 16%);
    border-color: hsl(186, 100%, 50%);
    color: hsl(186, 100%, 50%);
}

.auth-section {
    display: flex;
    gap: 0.5rem;
}

/* auth-btn base - overridden by .auth-btn-outline / .auth-btn-primary */
.auth-btn {
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.25rem;
    margin: 0;
    line-height: 1.2;
}

.search-mode {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 0.3rem;
    font-weight: 500;
}

.search-mode span {
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 0.2rem;
    margin-left: 0.3rem;
}

.search-mode .mode-semantic {
    color: hsl(0, 0%, 30%);
    background: hsla(0, 0%, 50%, 0.2);
}

/* Ontology mode removed - only semantic router is supported */

.metrics-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.metric-period {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.period-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.metric-label {
    font-size: 0.7rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.metric-value {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
}

.token-breakdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
}

.token-item {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.token-item.total {
    margin-left: 0.3rem;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.token-label {
    font-size: 0.65rem;
    opacity: 0.7;
    text-transform: uppercase;
}

.token-value {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
}

.metric-divider {
    opacity: 0.4;
    font-size: 1rem;
    padding: 0 0.75rem;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.main-content {
    display: flex;
    flex: 1;
    gap: 1rem;
    padding: 1rem;
    overflow: hidden;
    min-height: 0; /* Allow flex child to shrink */
    order: 1; /* Main content first */
}

.pane {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.pane-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(0, 0%, 22%);
}

/* Chat Pane */
.chat-pane {
    min-width: 400px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeIn 0.3s ease-in;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

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

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

.bot-message {
    align-self: flex-start;
    align-items: flex-start;
}

.message-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7f8c8d;
    padding: 0 0.75rem;
    text-transform: none;
    letter-spacing: 0;
}

.user-message .message-sender {
    color: hsl(0, 0%, 75%);
    text-align: right;
}

.bot-message .message-sender {
    color: #95a5a6;
    text-align: left;
}

.message-content {
    padding: 0.875rem 1.125rem;
    border-radius: 12px;
    line-height: 1.6;
    text-align: left;
}

.user-message .message-content {
    background: hsl(0, 0%, 35%);
    color: white;
    text-align: left;
}

.bot-message .message-content {
    background: #ecf0f1;
    color: hsl(0, 0%, 22%);
    text-align: left;
}

.message-content p,
.message-content div {
    margin: 0;
    white-space: pre-line !important; /* Preserve line breaks - force override */
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

.attach-button {
    padding: 0.75rem 0.9rem;
    background: #ecf0f1;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-button:hover {
    background: #e0e4e7;
}

.attach-button:active {
    transform: scale(0.97);
}

.chat-file-input {
    display: none;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: hsl(0, 0%, 75%);
}

.send-button {
    padding: 0.75rem 1.5rem;
    background: hsl(0, 0%, 35%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.send-button:hover {
    background: hsl(0, 0%, 28%);
}

.send-button:active {
    transform: scale(0.98);
}

.send-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Data Pane */
.data-pane {
    min-width: 500px;
}

.data-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #95a5a6;
    font-size: 0.9375rem;
}

/* Table Styles - Dark Mode */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid var(--border-border);
}

.data-table thead {
    background: var(--bg-secondary);
    color: var(--text-foreground);
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-foreground);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-border);
    transition: background 0.2s;
    background: var(--bg-card);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

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

.data-table td {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: var(--text-foreground);
}

.data-table td:first-child {
    font-weight: 500;
    color: var(--text-foreground);
}

/* Text Response */
.text-response {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    line-height: 1.6;
    color: hsl(0, 0%, 22%);
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #95a5a6;
}

.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar,
.data-content::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.data-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb,
.data-content::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.data-content::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Token Usage Footer - Moved to bottom */
.token-usage-footer {
    background: hsl(0, 0%, 22%);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    order: 3; /* Ensure it's at the bottom */
}

.token-usage-section {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.token-usage-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.token-usage-label {
    font-weight: 600;
    font-size: 0.75rem;
    opacity: 0.9;
    min-width: 120px;
}

.token-usage-group .token-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    opacity: 0.85;
}

.token-usage-group .token-item span:first-child {
    opacity: 0.7;
    font-size: 0.7rem;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 4rem;  /* below the fixed header */
    left: 0;
    width: 100%;
    height: calc(100% - 4rem);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;  /* below header (z-index: 50) so nav links stay clickable */
    pointer-events: none;  /* let clicks pass through to the page behind */
}

.auth-modal-content {
    pointer-events: auto;
    background: var(--bg-card, hsl(222, 44%, 8%));
    border: 1px solid var(--border-border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease-out;
    font-family: 'Inter', system-ui, sans-serif;
}

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

.auth-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-border);
    position: relative;
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-foreground);
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    text-align: center;
}

.auth-modal-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted-foreground);
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-foreground);
}

.auth-modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
    text-align: center;
}

.auth-section-email {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-section-email h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: hsl(0, 0%, 22%);
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-border);
}
.auth-tab {
    padding: 0.625rem 1.25rem;
    border: none;
    background: none;
    color: var(--text-muted-foreground);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s;
    font-family: 'Inter', system-ui, sans-serif;
}
.auth-tab:hover { color: var(--text-foreground); }
.auth-tab.active { color: var(--text-foreground); border-bottom-color: var(--bg-primary); }

.auth-subtitle {
    margin: 0 0 0.5rem 0;
    color: var(--text-muted-foreground);
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
}

.auth-privacy-note {
    margin: 0 0 0.75rem 0;
    color: var(--text-muted-foreground);
    font-size: 0.7rem;
    text-align: center;
    opacity: 0.7;
}

.auth-password-wrap { margin-top: 0; width: 100%; max-width: 320px; }
.auth-password-wrap .auth-input { margin: 0; max-width: none; }
.auth-password-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
    line-height: 1.4;
}

#emailAuthForm {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.auth-input {
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--border-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-foreground);
    transition: border-color 0.2s, background 0.2s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--bg-primary);
    background: var(--bg-background);
}

.auth-input::placeholder {
    color: var(--text-muted-foreground);
}

.auth-submit-btn {
    padding: 0.75rem 1.25rem;
    margin-top: 0.75rem;
    background: var(--bg-primary);
    color: #0a0f1a;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 700;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    align-self: center;
    min-width: 200px;
}

.auth-submit-btn:hover {
    opacity: 0.9;
}

.auth-submit-btn:active {
    transform: scale(0.98);
}

.auth-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    padding: 0 1rem;
    color: #95a5a6;
    font-size: 0.9rem;
}

.auth-section-oauth h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: hsl(0, 0%, 22%);
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: hsl(0, 0%, 22%);
}

.oauth-btn:hover {
    border-color: hsl(0, 0%, 75%);
    background: #f8f9fa;
}

.oauth-btn:active {
    transform: scale(0.98);
}

.oauth-btn svg {
    flex-shrink: 0;
}

.oauth-google {
    border-color: hsl(0, 0%, 45%);
}

.oauth-google:hover {
    background: hsl(0, 0%, 97%);
}

.oauth-apple {
    border-color: #000;
}

.oauth-apple:hover {
    background: #f5f5f5;
}


.oauth-note {
    margin: 0;
    padding: 0.75rem;
    background: hsl(0, 0%, 22%);
    border: 1px solid hsl(0, 0%, 40%);
    border-radius: 6px;
    color: hsl(0, 0%, 70%);
    font-size: 0.85rem;
    text-align: center;
}

/* Anonymous User Prompt */
.anonymous-prompt {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.prompt-text {
    color: hsl(0, 0%, 50%);
    font-size: 0.8rem;
    font-style: italic;
}

/* Brand Setup Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: hsl(0, 0%, 22%);
    font-size: 0.9rem;
}

.form-group textarea.auth-input {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.file-input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.file-input:hover {
    border-color: hsl(0, 0%, 75%);
}

.file-input:focus {
    outline: none;
    border-color: hsl(0, 0%, 75%);
}

.file-hint {
    display: block;
    margin-top: 0.25rem;
    color: #7f8c8d;
    font-size: 0.8rem;
}

/* FAQ Section (Demo Page) */
.faq-section {
    background: linear-gradient(135deg, hsl(0, 0%, 12%) 0%, hsl(0, 0%, 18%) 100%);
    padding: 1.5rem 2rem;
    border-top: 3px solid rgba(255, 255, 255, 0.1);
    display: none; /* Hidden by default, shown for demo users */
    flex-shrink: 0;
    order: 2; /* Between main content and footer */
}

.faq-section.visible {
    display: block;
}

.faq-header {
    text-align: left;
    margin-bottom: 1.5rem;
    color: white;
}

.faq-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.faq-categories {
    display: flex;
    gap: 2rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    max-width: 1400px;
}

.faq-category {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.faq-category-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.95;
    text-align: left;
}

.faq-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: hsl(0, 0%, 22%);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.faq-item:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.faq-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Reduce font sizes throughout */
.pane-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.chat-input {
    font-size: 1rem;
}

.message-content {
    font-size: 1rem;
    line-height: 1.6;
}

.token-usage-footer {
    font-size: 0.75rem;
}

.brand-name {
    font-size: 1rem;
}

/* auth-btn sizing handled by .auth-btn-outline / .auth-btn-primary */

/* ============================================
   NEW DEMO PAGE LAYOUT - Matching React Component
   ============================================ */

/* Root Layout - Dark Mode */
.app-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-background);
    overflow: hidden;
}

/* Header - Matching React component (bg-background/80 backdrop-blur-xl border-b border-border/50 py-4) */
.main-header {
    z-index: 50;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: hsl(var(--background) / 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid hsl(var(--border) / 0.5);
    padding: 1rem 0; /* py-4 = 1rem */
    flex-shrink: 0;
    box-shadow: 0 2px 8px hsl(222, 47%, 4% / 0.3);
}

.header-content {
    width: 100%;
    max-width: 1400px; /* container 2xl */
    margin: 0 auto;
    padding: 0 2rem; /* container padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    z-index: 1;
    flex-shrink: 0;
}

.main-header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    transition: opacity 0.2s;
}

.main-header-logo:hover {
    opacity: 0.8;
}

.main-header-logo-img {
    display: block;
    height: 2.5rem; /* size="md" = h-10 = 40px */
    width: auto;
    object-fit: contain;
}

/* Navigation links - Matching React component (text-sm text-muted-foreground hover:text-foreground) */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem; /* gap-8 = 2rem */
    /* Positioned by justify-between on parent, no flex:1 needed */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-nav-link {
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    font-family: 'Inter', system-ui, sans-serif;
}

.header-nav-link:hover {
    color: hsl(var(--foreground));
}

.header-nav-link.active {
    color: hsl(var(--foreground));
    font-weight: 500;
}

.main-header-user {
    font-size: 0.9rem;
    font-weight: 600;
    color: hsl(210, 40%, 90%);
    white-space: nowrap;
    margin-left: 1rem;
    flex-shrink: 0;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Brand switcher (shown when authenticated, replaces nav) */
.brand-switcher {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    flex: 1;
    margin-left: 1rem;
}

/* Subtitle bar removed - integrated into header design */

/* Auth buttons */
.auth-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    z-index: 1;
}

.auth-btn-outline {
    background: transparent;
    border: 1px solid hsl(222, 30%, 18%);
    color: hsl(210, 40%, 90%);
    padding: 0.5rem 1.25rem;
    border-radius: 0.625rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'Inter', system-ui, sans-serif;
}

.auth-btn-outline:hover {
    border-color: hsl(186, 100%, 50%);
    background: hsl(222, 30%, 14%);
    color: hsl(186, 100%, 50%);
}

.auth-btn-primary {
    background: hsl(var(--primary));
    border: 1px solid hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    padding: 0.375rem 0.75rem; /* size="sm" - smaller padding */
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem; /* text-sm */
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'Inter', system-ui, sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    line-height: 1.25rem;
}

.auth-btn-primary:hover {
    background: hsl(var(--primary-glow));
    border-color: hsl(var(--primary-glow));
    transform: translateY(-1px);
}

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

/* ---- Header responsive breakpoints ---- */

/* Tablets and small laptops */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
        gap: 1rem;
    }

    .header-nav {
        gap: 1.5rem;
    }

    .header-nav-link {
        font-size: 0.85rem;
    }

    .main-header-logo-img {
        height: 2rem; /* h-8 = 32px for tablet */
    }

    .auth-btn-outline,
    .auth-btn-primary {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
}

/* Phones */
@media (max-width: 480px) {
    .header-content {
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

    .header-nav {
        display: none; /* Hide nav on mobile */
    }

    .header-left {
        gap: 0.5rem;
    }

    .main-header-logo-img {
        height: 1.75rem; /* Smaller for mobile */
    }

    .auth-btn-outline,
    .auth-btn-primary {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}

.spent-wrapper {
    position: relative;
}

.spent-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
    color: var(--text-muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.spent-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-foreground);
}

.demo-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 0.375rem;
    border: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
    color: var(--text-muted-foreground);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.demo-icon-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-foreground);
}

.spent-caret {
    opacity: 0.8;
    font-size: 0.7rem;
}

.spent-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 420px;
    max-width: 80vw;
    border-radius: 0.75rem;
    border: 1px solid var(--border-border);
    background: var(--bg-background);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 100;
}

.spent-popover-header {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
}

.spent-popover-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-foreground);
}

.spent-popover-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
    margin-top: 0.1rem;
}

.spent-popover-section {
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.spent-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.6rem 0.65rem;
    border-radius: 0.6rem;
    border: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
}

.spent-label {
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
    font-weight: 700;
}

.spent-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
}

.spent-values strong {
    color: var(--text-foreground);
    font-weight: 700;
    margin-left: 0.25rem;
}

.spent-popover-footer {
    padding: 0.6rem 0.9rem;
    border-top: 1px solid var(--border-border);
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
    background: var(--bg-secondary-alpha);
}

.spent-popover-footer .muted {
    opacity: 0.9;
}

/* Ad Spend View */
.ad-spend-view {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 480px;
    max-width: 85vw;
    border-radius: 0.75rem;
    border: 1px solid var(--border-border);
    background: var(--bg-background);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 1000;
}

.ad-spend-header {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
}

.ad-spend-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-foreground);
}

.ad-spend-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
    margin-top: 0.1rem;
}

.ad-spend-containers {
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ad-spend-container {
    border-radius: 0.5rem;
    border: 1px solid var(--border-border);
    background: var(--bg-secondary);
    overflow: hidden;
}

.ad-spend-container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
}

.ad-spend-period {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ad-spend-total {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.ad-spend-channels {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.ad-spend-channel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: var(--bg-secondary-alpha);
    border: 1px solid var(--border-border);
    transition: background 0.15s;
}

.ad-spend-channel:hover {
    background: hsl(222, 30%, 16%);
}

.ad-spend-channel-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.ad-spend-channel-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-foreground);
    white-space: nowrap;
}

.ad-spend-channel-percentage {
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
    font-variant-numeric: tabular-nums;
}

.ad-spend-channel-amount {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}

.ad-spend-loading,
.ad-spend-error,
.ad-spend-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
}

.ad-spend-error {
    color: var(--text-destructive);
}

/* Main Content Wrapper */
.main-content-wrapper {
    flex: 1;
    padding-top: 0; /* No extra padding needed - header is sticky */
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow flex shrink */
}

/* Demo Section */
.demo-section {
    position: relative;
    padding: 0.25rem 0 0;
    padding-bottom: 1.5rem;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Background Effects - Dark Mode */
.background-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, var(--bg-primary-alpha), transparent);
    pointer-events: none;
}

.background-blur {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1000px;
    height: 600px;
    background: var(--bg-primary-alpha);
    border-radius: 50%;
    filter: blur(150px);
    pointer-events: none;
}

/* Container */
.container {
    max-width: 1440px; /* wider page content */
    margin: 0 auto;
    padding: 0 1rem; /* less side padding */
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Demo Hero Section - Matching features page hero (shrunk by half) */
.demo-hero {
    text-align: center;
    padding: 0.75rem 0 0.5rem; /* Reduced by half */
    margin-bottom: 0.375rem; /* Reduced by half */
    flex-shrink: 0;
}

.demo-hero-title {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif; /* font-display */
    font-size: 1.125rem; /* Reduced by half from text-4xl */
    font-weight: 700; /* font-bold */
    line-height: 1.1; /* leading-[1.1] */
    letter-spacing: -0.025em; /* tracking-tight */
    color: hsl(var(--foreground));
    margin: 0;
    text-wrap: balance;
}

@media (min-width: 640px) {
    .demo-hero-title {
        font-size: 1.5rem; /* Reduced by half from sm:text-5xl */
    }
}

/* Demo Header Section */
.demo-header-section {
    max-width: 48rem;
    margin: 0 auto 3rem;
    text-align: center;
}

.demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
    padding: 0.5rem 1rem; /* px-4 py-2 */
    border-radius: 9999px; /* rounded-full */
    background: var(--bg-primary-alpha);
    border: 1px solid var(--bg-primary-alpha-20);
    margin-bottom: 1.5rem; /* mb-6 */
}

.demo-badge-dot {
    width: 8px; /* w-2 */
    height: 8px; /* h-2 */
    border-radius: 50%;
    background: var(--text-primary);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.demo-badge-text {
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    color: var(--text-primary);
}

.demo-title {
    font-size: 2.25rem; /* text-3xl */
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-foreground);
    line-height: 1.2;
}

@media (min-width: 640px) {
    .demo-title {
        font-size: 2.5rem; /* sm:text-4xl */
    }
}

/* Gradient text utility - matches Variant Labs design system */
.gradient-text {
    background: linear-gradient(135deg, hsl(186, 100%, 50%) 0%, hsl(186, 100%, 70%) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.demo-subtitle {
    font-size: 1.125rem; /* text-lg */
    color: var(--text-muted-foreground);
    line-height: 1.6;
    text-wrap: balance;
}

/* Demo Container */
.demo-container {
    max-width: 100rem; /* expand demo container further */
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

/* Demo Header Bar - Dark Mode */
.demo-header-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-border);
    border-radius: 0.75rem 0.75rem 0 0;
    gap: 0.5rem;
    min-height: 3rem;
}

.demo-header-bar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.demo-header-bar .demo-brand-logo {
    flex-shrink: 0;
}

.demo-header-bar .demo-brand-logo-img {
    height: 36px;
    max-width: 120px;
}

/* Panel title: centered in remaining space */
.demo-panel-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-header-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
    justify-content: flex-end;
}

.vl-logo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-foreground);
}

.demo-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-brand-logo-img {
    height: 48px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

/* Demo brand selector dropdown */
.demo-brand-selector {
    position: relative;
}

.demo-brand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
    color: var(--text-muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.demo-brand-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-foreground);
}

.demo-brand-caret {
    opacity: 0.7;
    font-size: 0.65rem;
}

.demo-brand-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 170px;
    background: var(--bg-background);
    border: 1px solid var(--border-border);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 60;
    overflow: hidden;
}

.demo-brand-option {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-border);
    color: var(--text-foreground);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}

.demo-brand-option:last-child {
    border-bottom: none;
}

.demo-brand-option:hover {
    background: var(--bg-secondary);
}

.demo-brand-option.active {
    background: var(--bg-primary-alpha);
    color: var(--text-primary);
}

/* (demo-header-center removed — nav is a direct child of header-bar now) */

.demo-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    background: var(--bg-primary-alpha);
    border: 1px solid var(--bg-primary-alpha-20);
}

.demo-mode-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-primary);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.demo-mode-text {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* (demo-header-right removed — icons are direct children of header-bar now) */

.demo-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.demo-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
    color: var(--text-muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.demo-nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-foreground);
}

.demo-nav-item.active {
    background: var(--bg-primary-alpha);
    color: var(--text-primary);
    border-color: var(--bg-primary-alpha-20);
}

.demo-nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-border);
    color: var(--text-muted-foreground);
    font-size: 0.7rem;
    font-weight: 700;
}

.demo-nav-item.active .demo-nav-count {
    background: transparent;
    border-color: var(--bg-primary-alpha-20);
    color: var(--text-primary);
}

.demo-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* gap-3 */
    font-size: 0.75rem; /* text-xs */
    color: var(--text-muted-foreground);
    margin-right: 1rem; /* mr-4 */
}

.demo-stats strong {
    color: var(--text-foreground);
    font-weight: 600;
}

.stats-active {
    color: var(--text-primary) !important;
}

.stats-divider {
    opacity: 0.5;
}

.fullscreen-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem; /* gap-1 */
    padding: 0.375rem 0.75rem; /* px-3 py-1.5 */
    background: transparent;
    border: none;
    border-radius: 0.375rem; /* rounded-md */
    font-size: 0.75rem; /* text-xs */
    color: var(--text-muted-foreground);
    cursor: pointer;
    transition: background 0.2s;
}

.fullscreen-btn:hover {
    background: var(--bg-secondary);
}

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

/* Demo Panels - 4 Column Layout: FAQ | Chat | Explorer | Debug */
.demo-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--bg-background);
    border-left: 1px solid var(--border-border);
    border-right: 1px solid var(--border-border);
    border-bottom: 1px solid var(--border-border);
    border-radius: 0 0 0.75rem 0.75rem;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

@media (min-width: 1024px) {
    .demo-panels {
        grid-template-columns: 240px 0.95fr 1.25fr; /* FAQ | Chat | Explorer (no debug) */
    }
    body.debug-panel-enabled .demo-panels {
        grid-template-columns: 220px 0.9fr 1.1fr 240px; /* + Debug */
    }
}

@media (min-width: 1280px) {
    .demo-panels {
        grid-template-columns: 260px 0.95fr 1.35fr;
    }
    body.debug-panel-enabled .demo-panels {
        grid-template-columns: 240px 0.9fr 1.2fr 280px;
    }
}

.demo-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.faq-panel {
    border-right: 1px solid var(--border-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-panel {
    border-right: 1px solid var(--border-border);
}

.data-panel {
    display: none;
}

@media (min-width: 1024px) {
    .data-panel {
        display: flex;
    }
}

/* Debug panel (4th column): only visible when server is started with --debug */
.debug-panel-column {
    border-left: 1px solid var(--border-border);
    display: none;
}

@media (min-width: 1024px) {
    body.debug-panel-enabled .debug-panel-column {
        display: flex;
    }
}

.debug-panel-content-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.debug-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
}

.debug-chain-section {
    flex-shrink: 0;
}

.debug-chain-list {
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.debug-chain-list .chain-item {
    display: inline;
}

.debug-chain-list .chain-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin: 0 0.15rem;
}

.debug-placeholder {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.debug-observability-section {
    flex-shrink: 0;
}

.debug-events-list {
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.debug-events {
    list-style: none;
    margin: 0;
    padding: 0;
}

.debug-event {
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--border-border);
}

.debug-event:last-child {
    border-bottom: none;
}

.debug-event--span {
    color: var(--text-secondary);
}

.debug-event--llm_usage {
    color: var(--text-primary);
}

.debug-event--error {
    color: var(--text-error, #c53030);
}

.debug-raw-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.debug-raw-section .debug-section-title {
    margin-bottom: 0.35rem;
}

.debug-raw-json {
    flex: 1;
    min-height: 80px;
    margin: 0;
    padding: 0.5rem 0.6rem;
    font-size: 0.65rem;
    font-family: ui-monospace, monospace;
    background: var(--bg-elevated);
    border: 1px solid var(--border-border);
    border-radius: 6px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-secondary);
}

/* Chat Messages in Demo Panel - Updated for new structure */
.demo-panel .chat-messages-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Legacy support - remove old chat-messages styles */
.demo-panel .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.demo-panel .attach-button {
    padding: 0.75rem 0.9rem;
    background: hsl(0, 0%, 96%);
    border: 1px solid hsl(0, 0%, 85%);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-panel .attach-button:hover {
    background: hsl(0, 0%, 92%);
}

.demo-panel .chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid hsl(0, 0%, 85%);
    border-radius: 8px;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s;
}

.demo-panel .chat-input:focus {
    border-color: hsl(0, 0%, 20%);
}

.demo-panel .send-button {
    padding: 0.75rem 1.5rem;
    background: hsl(0, 0%, 35%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.demo-panel .send-button:hover {
    background: hsl(0, 0%, 28%);
}

/* Data Content in Demo Panel */
.demo-panel .data-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.demo-panel .empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: hsl(0, 0%, 50%);
    font-size: 0.9375rem;
}

/* CTA Section - Dark Mode */
.demo-cta {
    text-align: center;
    margin-top: 2.5rem; /* mt-10 */
}

.cta-text {
    font-size: 0.875rem; /* text-sm */
    color: var(--text-muted-foreground);
    margin-bottom: 1rem; /* mb-4 */
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
    padding: 0.75rem 1.5rem; /* px-6 py-3 */
    background: var(--bg-primary);
    color: white;
    border: none;
    border-radius: 8px; /* rounded-lg */
    font-size: 1rem; /* text-base */
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.cta-button:hover {
    background: hsl(0, 0%, 28%);
}

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

/* FAQ Panel - Dark Mode */
/* Unified single-line panel header (FAQ, Chat, Data Explorer) */
.panel-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
    flex-shrink: 0;
    min-height: 0;
}

.panel-header-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-foreground);
    margin: 0;
    white-space: nowrap;
    line-height: 1;
}

.panel-header-sep {
    color: var(--text-muted-foreground);
    opacity: 0.5;
    font-size: 0.75rem;
    line-height: 1;
}

.panel-header-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted-foreground);
    margin: 0;
    white-space: nowrap;
    line-height: 1;
}

/* Legacy aliases kept for any remaining references */
.faq-panel-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
}

.faq-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.faq-panel .faq-category {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 260px;
    min-width: 0;
    padding: 0;
    border: none;
    background: none;
    backdrop-filter: none;
    border-radius: 0;
}

.faq-panel .faq-category-title {
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;
    color: var(--text-muted-foreground);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.faq-panel .faq-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* gap-2 */
}

.faq-panel .faq-item {
    background: var(--bg-secondary-alpha);
    border: 1px solid var(--border-border);
    color: var(--text-foreground);
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    border-radius: 0.5rem; /* rounded-lg */
    font-size: 0.75rem; /* text-xs */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.faq-panel .faq-item:hover {
    background: var(--bg-secondary);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.faq-panel .faq-item:active {
    transform: scale(0.98);
}

/* Legacy FAQ Section (removed from bottom) */
.faq-section {
    display: none !important;
}

/* Recipes Dropdown (inside FAQ panel header) */
/* Guide dropdown (replaces FAQ panel for authenticated users) */
.guide-dropdown-wrapper {
    position: relative;
    margin-left: auto;
}
.guide-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 260px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--bg-background);
    border: 1px solid var(--border-border);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 60;
}
.guide-dropdown-section-title {
    padding: 0.45rem 0.75rem 0.2rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted-foreground);
    opacity: 0.7;
}
.guide-dropdown-section-title:not(:first-child) {
    border-top: 1px solid var(--border-border);
    margin-top: 2px;
    padding-top: 0.5rem;
}
.guide-dropdown-sibling {
    position: relative;
}

/* When FAQ panel is collapsed, hide it and use 2-column grid */
.demo-panels.faq-collapsed .faq-panel {
    display: none;
}
@media (min-width: 1024px) {
    .demo-panels.faq-collapsed {
        grid-template-columns: 1fr 1.35fr;
    }
    body.debug-panel-enabled .demo-panels.faq-collapsed {
        grid-template-columns: 1fr 1.2fr 280px;
    }
}
@media (min-width: 1280px) {
    .demo-panels.faq-collapsed {
        grid-template-columns: 1fr 1.4fr;
    }
    body.debug-panel-enabled .demo-panels.faq-collapsed {
        grid-template-columns: 1fr 1.3fr 280px;
    }
}

.recipes-dropdown-wrapper {
    position: relative;
    margin-left: auto;
}

.recipes-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
    color: var(--text-muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.recipes-dropdown-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-foreground);
}

.recipes-caret {
    opacity: 0.7;
    font-size: 0.65rem;
}

.recipes-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--bg-background);
    border: 1px solid var(--border-border);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 60;
    overflow: hidden;
}

.recipes-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-border);
    color: var(--text-foreground);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}

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

.recipes-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.recipes-divider {
    border-top: 1px solid var(--border-border);
}

/* Footer - Dark Mode */
.token-usage-footer {
    background: var(--bg-secondary);
    color: var(--text-foreground);
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    border-top: 1px solid var(--border-border);
    flex-shrink: 0;
}

.token-usage-section {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.token-usage-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.token-usage-label {
    font-weight: 600;
    font-size: 0.75rem;
    opacity: 0.9;
    min-width: 120px;
}

.token-usage-group .token-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    opacity: 0.85;
}

.token-usage-group .token-item span:first-child {
    opacity: 0.7;
    font-size: 0.7rem;
}

/* Scrollbar Styling for Demo Panels - Dark Mode */
.demo-panel .faq-panel-content::-webkit-scrollbar,
.demo-panel .chat-messages-wrapper::-webkit-scrollbar,
.demo-panel .chat-messages::-webkit-scrollbar,
.demo-panel .data-content::-webkit-scrollbar {
    width: 8px;
}

.demo-panel .faq-panel-content::-webkit-scrollbar-track,
.demo-panel .chat-messages-wrapper::-webkit-scrollbar-track,
.demo-panel .chat-messages::-webkit-scrollbar-track,
.demo-panel .data-content::-webkit-scrollbar-track {
    background: var(--bg-background);
}

.demo-panel .faq-panel-content::-webkit-scrollbar-thumb,
.demo-panel .chat-messages-wrapper::-webkit-scrollbar-thumb,
.demo-panel .chat-messages::-webkit-scrollbar-thumb,
.demo-panel .data-content::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.demo-panel .faq-panel-content::-webkit-scrollbar-thumb:hover,
.demo-panel .chat-messages-wrapper::-webkit-scrollbar-thumb:hover,
.demo-panel .chat-messages::-webkit-scrollbar-thumb:hover,
.demo-panel .data-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted-foreground);
}

/* ============================================
   FOOTER - Matching CombinatreeFooter Component
   ============================================ */
.main-footer {
    display: none;
}

.footer-container {
    max-width: 1400px; /* container 2xl */
    margin: 0 auto;
    padding: 0 1.5rem; /* px-6 */
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center; /* centered on mobile */
    gap: 0.5rem; /* gap-2 */
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
}

.footer-logo-link {
    display: flex;
    align-items: center;
    gap: 0.625rem; /* gap-2.5 = 0.625rem (10px) */
    transition: opacity 0.2s;
    text-decoration: none;
}

.footer-logo-link:hover {
    opacity: 0.8;
}

.footer-logo-icon {
    flex-shrink: 0;
    width: 28px; /* size="sm" icon = 28px */
    height: 28px;
    display: block;
    vertical-align: middle;
}

.footer-logo-text {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif; /* font-display */
    font-weight: 600; /* font-semibold */
    font-size: 1.125rem; /* text-lg = 18px for size="sm" */
    letter-spacing: -0.025em; /* tracking-tight */
    line-height: 1.75rem; /* Match text-lg line height */
    white-space: nowrap;
    display: inline-flex;
    align-items: baseline;
}

.footer-logo-text-normal {
    color: hsl(var(--foreground));
}

.footer-logo-text-gradient {
    background: linear-gradient(135deg, hsl(186, 100%, 50%) 0%, hsl(186, 100%, 70%) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-copyright {
    font-size: 0.75rem; /* text-xs */
    color: hsl(var(--muted-foreground));
}

.footer-tagline {
    display: none; /* hidden on mobile */
    font-size: 0.75rem; /* text-xs */
    color: hsl(var(--muted-foreground));
}

/* Tablet and desktop - show tagline and space-between layout */
@media (min-width: 640px) {
    .footer-content {
        justify-content: space-between; /* sm:justify-between */
    }
    
    .footer-tagline {
        display: block; /* sm:block */
    }
}

/* ============================================
   NEW DEMO CHAT COMPONENT STYLES - DARK MODE
   ============================================ */

/* Variant Labs Design System CSS Variables - Matching Tailwind Config */
:root {
    /* Core backgrounds */
    --background: 222 47% 6%;
    --foreground: 210 40% 96%;

    /* Cards & surfaces */
    --card: 222 44% 8%;
    --card-foreground: 210 40% 96%;

    --popover: 222 44% 10%;
    --popover-foreground: 210 40% 96%;

    /* Primary - Electric Cyan */
    --primary: 186 100% 50%;
    --primary-foreground: 222 47% 6%;
    --primary-glow: 186 100% 60%;

    /* Secondary - Muted slate */
    --secondary: 222 30% 14%;
    --secondary-foreground: 210 40% 90%;

    /* Muted elements */
    --muted: 222 30% 16%;
    --muted-foreground: 215 20% 55%;

    /* Accent - Warm Coral for CTAs */
    --accent: 12 90% 60%;
    --accent-foreground: 0 0% 100%;
    --accent-glow: 12 90% 70%;

    /* Destructive */
    --destructive: 0 84% 60%;
    --destructive-foreground: 210 40% 98%;

    /* Borders & inputs */
    --border: 222 30% 18%;
    --input: 222 30% 14%;
    --ring: 186 100% 50%;

    --radius: 0.625rem;

    /* Legacy variables for backward compatibility */
    --bg-background: hsl(222, 47%, 6%);
    --bg-card: hsl(222, 44%, 8%);
    --bg-secondary: hsl(222, 30%, 14%);
    --bg-secondary-alpha: hsla(222, 30%, 14%, 0.3);
    --border-border: hsl(222, 30%, 18%);
    --text-foreground: hsl(210, 40%, 96%);
    --text-muted-foreground: hsl(215, 20%, 55%);
    --text-primary: hsl(210, 40%, 96%);
    --bg-primary: hsl(186, 100%, 50%);
    --bg-primary-alpha: hsla(186, 100%, 50%, 0.25);
    --bg-primary-alpha-20: hsla(186, 100%, 50%, 0.3);
    --bg-accent: hsl(12, 90%, 60%);
    --bg-accent-alpha: hsla(12, 90%, 60%, 0.2);
}

/* Chat Panel Container - Dark Mode */
.demo-panel.chat-panel {
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg-card) !important;
    border-radius: 0.75rem !important;
    border: 1px solid var(--border-border) !important;
    overflow: hidden !important;
}

/* Chat Header - Dark Mode */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header-icon {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    background: var(--bg-primary-alpha);
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.chat-header-text {
    display: flex;
    flex-direction: column;
}

.chat-header-title {
    font-size: 0.875rem; /* text-sm */
    font-weight: 600;
    color: var(--text-foreground);
    margin: 0;
    line-height: 1.2;
}

.chat-header-subtitle {
    font-size: 0.75rem; /* text-xs */
    color: var(--text-muted-foreground);
    margin: 0;
    line-height: 1.2;
}

.chat-header-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    background: var(--bg-primary-alpha);
    border: 1px solid var(--bg-primary-alpha-20);
}

.chat-badge-dot {
    width: 8px; /* w-2 */
    height: 8px; /* h-2 */
    border-radius: 50%;
    background: var(--text-primary);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.chat-badge-text {
    font-size: 0.75rem; /* text-xs */
    color: var(--text-primary);
    font-weight: 500;
}

/* Messages Wrapper - Better space usage */
.chat-messages-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem; /* py-5 px-5 */
    display: flex;
    flex-direction: column;
    gap: 1rem; /* space-y-4 */
}

/* Message Styles - Dark Mode */
.message {
    display: flex;
    gap: 0.75rem; /* gap-3 */
    max-width: 80%;
}

.message.bot-message {
    justify-content: flex-start;
}

.message.user-message {
    justify-content: flex-end;
    align-self: flex-end;
    margin-left: auto;
}

.message-avatar {
    display: none;
}

.bot-avatar {
    background: var(--bg-primary-alpha);
}

.user-avatar {
    background: var(--bg-accent-alpha);
    color: var(--text-muted-foreground);
}

.message-content {
    border-radius: 0.75rem; /* rounded-xl */
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.5;
}

.bot-content {
    background: var(--bg-secondary-alpha);
    color: var(--text-foreground);
}

.user-content {
    background: var(--bg-primary);
    color: white;
}

.message-text {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Quick Queries - Dark Mode */
.quick-queries {
    padding: 1.25rem 1.25rem 0.75rem; /* px-5 pb-3 */
    border-top: 1px solid var(--border-border);
}

.quick-queries-label {
    font-size: 0.75rem; /* text-xs */
    color: var(--text-muted-foreground);
    margin: 0 0 0.5rem 0; /* mb-2 */
}

.quick-queries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* gap-2 */
}

.quick-query-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    border-radius: 0.5rem; /* rounded-lg */
    background: var(--bg-secondary-alpha);
    border: 1px solid var(--border-border);
    font-size: 0.75rem; /* text-xs */
    color: var(--text-muted-foreground);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-query-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-foreground);
    border-color: var(--border-border);
}

.quick-query-btn svg:first-of-type {
    color: var(--text-primary);
    flex-shrink: 0;
    width: 14px; /* w-3.5 */
    height: 14px; /* h-3.5 */
}

.quick-query-btn svg:last-of-type {
    opacity: 0.5;
    flex-shrink: 0;
    width: 12px; /* w-3 */
    height: 12px; /* h-3 */
}

/* Chat Input Area - textarea with send button */
.chat-input-area {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-border);
    background: var(--bg-background);
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    gap: 0.35rem;
}

.chat-textarea {
    width: 100%;
    resize: none;
    border: none;
    background: transparent;
    color: var(--text-foreground);
    font-size: 0.75rem;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    padding: 0.25rem 0;
    box-sizing: border-box;
}

.chat-textarea::placeholder {
    color: var(--text-muted-foreground);
    font-size: 0.75rem;
}

.chat-input-actions {
    display: flex;
    justify-content: flex-end;
}

.chat-input-actions .send-button {
    padding: 0.3rem 0.75rem;
    background: hsl(0, 0%, 35%);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: background 0.15s;
}

.chat-input-actions .send-button:hover:not(:disabled) {
    background: hsl(0, 0%, 28%);
}

.chat-input-actions .send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Legacy wrappers (kept for JS compatibility) */
.chat-input-wrapper {
    display: none;
}

/* Typing Indicator - Dark Mode */
.typing-indicator {
    display: flex;
    gap: 0.75rem; /* gap-3 */
    justify-content: flex-start;
    padding: 1.25rem; /* p-5 */
}

.typing-indicator .message-avatar {
    background: var(--bg-primary-alpha);
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 0.25rem; /* gap-1 */
    padding: 0.75rem 1rem; /* px-4 py-3 */
    background: var(--bg-secondary-alpha);
    border-radius: 0.75rem; /* rounded-xl */
}

.typing-dot {
    width: 8px; /* w-2 */
    height: 8px; /* h-2 */
    border-radius: 50%;
    background: var(--text-muted-foreground);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) {
    animation-delay: 0ms;
}

.typing-dot:nth-child(2) {
    animation-delay: 150ms;
}

.typing-dot:nth-child(3) {
    animation-delay: 300ms;
}

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

/* Hide quick queries when there are multiple messages */
.chat-messages-wrapper:has(.message:nth-child(2)) ~ .quick-queries {
    display: none;
}

/* Data Panel - Dark Mode */
.data-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Data panel is now “just the view” (no internal header/metrics) */
.demo-panel.data-panel .data-content-wrapper {
    padding: 0.75rem !important;
}

.demo-panel.data-panel .data-tab-section {
    gap: 0.75rem !important;
}

.demo-panel.data-panel .data-context-label {
    margin: 0 !important;
    padding: 0 0.25rem;
}

/* Make Data Explorer styles win vs legacy rules */
.demo-panel.data-panel .data-panel-header,
.demo-panel.data-panel .data-metrics-section,
.demo-panel.data-panel .data-content-wrapper,
.demo-panel.data-panel .data-metric-card,
.demo-panel.data-panel .leaderboard-entry,
.demo-panel.data-panel .experiment-card {
    background-clip: padding-box;
}

.demo-panel.data-panel .data-metrics-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
}

.demo-panel.data-panel .data-metric-card {
    display: flex !important;
    flex-direction: column !important;
    padding: 0.75rem !important;
    border-radius: 0.5rem !important;
    background: var(--bg-secondary-alpha) !important;
    border: 1px solid var(--border-border) !important;
}

/* Data Panel Header */
.data-panel-header {
    padding: 1rem 1.25rem; /* px-5 py-4 */
    border-bottom: 1px solid var(--border-border);
    background: var(--bg-secondary-alpha);
}

.data-panel-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem; /* mb-4 */
}

.data-panel-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* gap-3 */
}

.data-panel-icon {
    width: 2rem; /* w-8 */
    height: 2rem; /* h-8 */
    border-radius: 0.5rem; /* rounded-lg */
    background: var(--bg-accent-alpha);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted-foreground);
}

.data-panel-header-text {
    display: flex;
    flex-direction: column;
}

.data-panel-title {
    font-size: 0.875rem; /* text-sm */
    font-weight: 600;
    color: var(--text-foreground);
    margin: 0;
    line-height: 1.2;
}

.data-panel-subtitle {
    font-size: 0.75rem; /* text-xs */
    color: var(--text-muted-foreground);
    margin: 0;
    line-height: 1.2;
}

/* Data Panel Tabs */
.data-panel-tabs {
    display: flex;
    gap: 0.5rem; /* gap-2 */
}

.data-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    border-radius: 0.5rem; /* rounded-lg */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted-foreground);
}

.data-tab:hover {
    color: var(--text-foreground);
    background: var(--bg-secondary);
}

.data-tab.active {
    background: var(--bg-primary-alpha);
    color: var(--text-primary);
    border-color: var(--bg-primary-alpha-20);
}

.data-tab svg {
    width: 16px; /* w-4 */
    height: 16px; /* h-4 */
    flex-shrink: 0;
}

/* Metrics Section */
.data-metrics-section {
    border-bottom: 1px solid var(--border-border);
}

.data-metrics-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem; /* px-5 py-3 */
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-foreground);
}

.data-metrics-toggle:hover {
    background: var(--bg-secondary-alpha);
}

.data-metrics-toggle-left {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
}

.data-metrics-toggle-left svg {
    width: 16px; /* w-4 */
    height: 16px; /* h-4 */
    color: var(--text-muted-foreground);
}

.data-metrics-toggle-text {
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
}

.data-metrics-chevron {
    width: 16px; /* w-4 */
    height: 16px; /* h-4 */
    color: var(--text-muted-foreground);
    transition: transform 0.2s;
}

.data-metrics-toggle.expanded .data-metrics-chevron {
    transform: rotate(180deg);
}

.data-metrics-content {
    padding: 0 1.25rem 1rem; /* px-5 pb-4 */
}

.data-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem; /* gap-3 */
}

.data-metric-card {
    padding: 0.75rem; /* p-3 */
    border-radius: 0.5rem; /* rounded-lg */
    background: var(--bg-secondary-alpha);
    border: 1px solid var(--border-border);
}

.data-metric-label {
    font-size: 0.75rem; /* text-xs */
    color: var(--text-muted-foreground);
    margin: 0 0 0.25rem 0; /* mb-1 */
}

.data-metric-value {
    font-size: 1.25rem; /* text-xl */
    font-weight: 700;
    color: var(--text-foreground);
    margin: 0;
    line-height: 1.2;
}

.data-metric-primary {
    color: var(--text-primary);
}

.data-metric-accent {
    color: var(--text-muted-foreground);
}

/* Content Area */
.data-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem; /* p-5 */
}

/* Explorer: scrollable stack of views (wallpaper + appended table views) */
.explorer-views-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    min-height: 0;
    padding: 0.75rem 1rem;
}

.explorer-view {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-border);
    padding-bottom: 1rem;
}

.explorer-view:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.explorer-view--wallpaper {
    min-height: 0;
}

.explorer-view-content {
    min-height: 0;
}

.explorer-view-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.segment-select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}
.segment-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Recipe cards */
.recipe-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recipe-overview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-border);
    border-radius: 6px;
    padding: 0.75rem;
}

.recipe-overview-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.recipe-steps {
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
    padding-left: 1.25rem;
    line-height: 1.6;
}

.recipe-steps strong {
    color: var(--text-foreground);
}

.recipe-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-border);
    border-radius: 6px;
    padding: 0.75rem;
    transition: border-color 0.15s;
}

.recipe-card:hover {
    border-color: var(--bg-primary-alpha-20);
}

.recipe-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.recipe-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-foreground);
}

.recipe-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.recipe-badge--paid {
    background: rgba(99, 179, 237, 0.15);
    color: rgb(99, 179, 237);
}

.recipe-badge--organic {
    background: rgba(104, 211, 145, 0.15);
    color: rgb(104, 211, 145);
}

.recipe-card-setup {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.recipe-card-when {
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.recipe-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 0.75rem;
    margin-bottom: 0.5rem;
}

.recipe-detail {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.7rem;
    color: var(--text-muted-foreground);
}

.recipe-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.recipe-card-tips {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.recipe-tip {
    font-size: 0.7rem;
    color: var(--text-muted-foreground);
    padding-left: 0.75rem;
    position: relative;
}

.recipe-tip::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}
.csv-download-btn {
    background: none;
    border: 1px solid var(--border-border, #d1d5db);
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 5px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    transition: color 0.15s, border-color 0.15s;
}
.csv-download-btn:hover {
    color: var(--text-foreground);
    border-color: var(--text-foreground, #374151);
}
.csv-download-btn svg {
    width: 13px;
    height: 13px;
}

.data-tab-content {
    display: none;
}

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

/* Content placeholder cards (data pane) */
.content-placeholder {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 1280px) {
    .content-placeholder {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 0.75rem;
        align-items: start;
    }
}

.content-placeholder-card {
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: var(--bg-secondary-alpha);
    border: 1px solid var(--border-border);
}

.content-placeholder-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-foreground);
    margin-bottom: 0.25rem;
}

.content-placeholder-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted-foreground);
    margin-bottom: 0.75rem;
}

.sparkline-placeholder {
    height: 140px;
    border-radius: 0.5rem;
    border: 1px dashed var(--border-border);
    background:
        linear-gradient(180deg, transparent, var(--bg-primary-alpha)),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 18px,
            var(--border-border) 18px,
            var(--border-border) 19px
        );
    opacity: 0.8;
}

/* More compact table styling for placeholders */
.data-table.data-table-compact th,
.data-table.data-table-compact td {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.data-table.data-table-fill {
    width: 100%;
}

.data-panel .data-tab-section {
    height: 100%;
}

.data-panel .data-table.data-table-fill {
    height: 100%;
}

.data-tab-section {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* space-y-4 */
}

.data-context-label {
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    color: var(--text-muted-foreground);
    margin: 0 0 0.5rem 0; /* mb-2 */
}

/* Leaderboard List */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem; /* Reduced spacing between entries */
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Reduced from gap-4 to gap-2 */
    padding: 0.5rem 0.75rem; /* Reduced vertical padding */
    border-radius: 0.5rem; /* rounded-lg */
    background: var(--bg-secondary);
    border: 1px solid var(--border-border);
    cursor: pointer;
    transition: all 0.2s;
}

.leaderboard-entry:hover {
    background: hsl(222, 30%, 16%);
}

.leaderboard-rank {
    width: 1.5rem; /* Reduced from w-8 to w-6 */
    height: 1.5rem; /* Reduced from h-8 to h-6 */
    border-radius: 0.375rem; /* rounded-md */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem; /* Reduced from text-sm to text-xs */
    flex-shrink: 0;
}

.leaderboard-rank.rank-1 {
    background: var(--bg-primary-alpha);
    color: var(--text-primary);
}

.leaderboard-rank.rank-2 {
    background: var(--bg-accent-alpha);
    color: var(--text-muted-foreground);
}

.leaderboard-rank.rank-other {
    background: var(--bg-secondary);
    color: var(--text-muted-foreground);
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem; /* Tight spacing between content-id and experiments */
}

.leaderboard-content-id {
    font-size: 0.8125rem; /* Slightly smaller than text-sm */
    font-weight: 500;
    color: var(--text-foreground);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.leaderboard-experiments {
    font-size: 0.6875rem; /* Smaller than text-xs */
    color: var(--text-muted-foreground);
    margin: 0;
    line-height: 1.2;
}

.leaderboard-stats {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.125rem; /* Tight spacing between score and confidence */
    align-items: flex-end;
}

.leaderboard-score {
    font-size: 0.8125rem; /* Slightly smaller than text-sm */
    font-weight: 600;
    color: var(--text-foreground);
    margin: 0;
    line-height: 1.2;
}

.leaderboard-confidence {
    font-size: 0.6875rem; /* Smaller than text-xs */
    color: var(--text-muted-foreground);
    margin: 0;
    line-height: 1.2;
}

/* Experiments List */
.experiments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* space-y-3 */
}

/* Experiment card list */
.experiment-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}

/* Experiment card — matches content-card treatment */
.experiment-card {
    border: 1px solid var(--border-border);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.experiment-card:hover {
    border-color: var(--text-muted-foreground);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* Header: name left, status right */
.experiment-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.experiment-card-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status badge (reuse existing classes) */
.experiment-status {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
    flex-shrink: 0;
}

.experiment-status.active {
    background: var(--bg-primary-alpha);
    color: var(--text-primary);
    border-color: var(--bg-primary-alpha-20);
}

.experiment-status.completed {
    background: hsla(0, 0%, 35%, 0.25);
    color: hsl(0, 0%, 85%);
    border-color: hsla(0, 0%, 45%, 0.3);
}

.experiment-status.draft {
    background: var(--bg-secondary);
    color: var(--text-muted-foreground);
    border-color: var(--border-border);
}

/* Context line: channel badge + text */
.experiment-card-context {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.experiment-card-context-text {
    font-size: 11px;
    color: var(--text-muted-foreground);
}

/* Info tiles (4-col grid, reuse metrics-tile) */
.experiment-info-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

/* Subtitle line inside metrics tiles (e.g. date range under duration) */
.metrics-tile__sub {
    font-size: 9px;
    color: var(--text-muted-foreground);
    line-height: 1.3;
    opacity: 0.8;
}

/* Variants section */
.experiment-variants-section {
    margin-bottom: 8px;
}

.experiment-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted-foreground);
    margin-bottom: 4px;
}

/* Individual variant row */
.experiment-variant-row {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-border);
    background: var(--bg-secondary);
    margin-bottom: 3px;
}

.experiment-variant-row--winner {
    border-left: 3px solid var(--text-primary, hsl(186, 100%, 50%));
}

.experiment-variant-role {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted-foreground);
    margin-bottom: 1px;
}

.experiment-variant-body {
    font-size: 12px;
    line-height: 1.4;
}

.experiment-variant-headline {
    font-weight: 600;
    color: var(--text-foreground);
}

.experiment-variant-desc {
    color: var(--text-muted-foreground);
}

/* Leader badge */
.experiment-leader-badge {
    display: inline-block;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary, hsl(186, 100%, 50%));
    background: var(--bg-primary-alpha, hsla(186, 100%, 50%, 0.1));
    padding: 1px 7px;
    border-radius: 9999px;
}

/* Compact metrics grid inside experiment variant rows */
.experiment-variant-metrics .content-card-metrics {
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin-top: 4px;
}
.experiment-variant-metrics .metrics-tile {
    padding: 2px 4px;
}
.experiment-variant-metrics .metrics-tile__label {
    font-size: 8px;
}
.experiment-variant-metrics .metrics-tile__value {
    font-size: 10px;
}

/* Channel accent borders on experiment cards */
.experiment-card--ig {
    border-left: 3px solid hsl(326, 70%, 55%);
}
.experiment-card--google {
    border-left: 3px solid hsl(217, 89%, 61%);
}
.experiment-card--meta {
    border-left: 3px solid #1877F2;
}
.experiment-card--yt {
    border-left: 3px solid #FF0000;
}
.experiment-card--seo {
    border-left: 3px solid #059669;
}

/* Results section */
.experiment-results-section {
    margin-top: 4px;
}

.experiment-results-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

/* Hoverable content rows */
.content-row-hoverable {
    cursor: default;
    transition: background 0.15s;
}
.content-row-hoverable:hover {
    background: var(--bg-secondary-alpha);
}
.content-cell-id {
    font-family: monospace;
    font-size: 0.7rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.text-muted {
    color: var(--text-muted-foreground);
    font-style: italic;
}

/* ---- Channel preview popover ---- */
.content-preview-popover {
    position: fixed;
    z-index: 9999;
    width: 300px;
    max-height: 420px;
    overflow: auto;
    background: var(--card, #fff);
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
    pointer-events: none;
}

/* -- Instagram Organic mockup -- */
.preview-ig {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #262626;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
.preview-ig-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
}
.preview-ig-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #dbdbdb;
}
.preview-ig-user {
    font-weight: 600;
    font-size: 13px;
}
.preview-ig-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f5f0eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.preview-ig-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.preview-ig-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px 12px 10px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,.45) 40%, rgba(0,0,0,.65) 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    align-items: flex-end;
    min-height: 50%;
}
.preview-ig-actions {
    display: flex;
    gap: 14px;
    padding: 8px 12px 4px;
    color: #262626;
}
.preview-ig-actions svg {
    width: 20px;
    height: 20px;
}
.preview-ig-caption {
    padding: 2px 12px 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #262626;
}
.preview-ig-caption strong {
    font-weight: 600;
    margin-right: 4px;
}
.preview-ig-type {
    padding: 0 12px 10px;
    font-size: 10px;
    color: #8e8e8e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* -- Google Search Ads mockup -- */
.preview-gsa {
    font-family: Arial, sans-serif;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
}
.preview-gsa-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #202124;
    background: #f1f3f4;
    border-radius: 3px;
    padding: 1px 6px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}
.preview-gsa-url {
    font-size: 12px;
    color: #202124;
    margin-bottom: 2px;
}
.preview-gsa-headline {
    font-size: 18px;
    color: #1a0dab;
    line-height: 1.3;
    margin-bottom: 4px;
    cursor: pointer;
}
.preview-gsa-desc {
    font-size: 13px;
    color: #4d5156;
    line-height: 1.45;
}

/* -- Meta Ads preview -- */
.preview-meta {
    background: #fff;
    color: #1c1e21;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.preview-meta-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 6px;
}
.preview-meta-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.preview-meta-header-text {
    display: flex;
    flex-direction: column;
}
.preview-meta-user {
    font-weight: 600;
    font-size: 13px;
    color: #050505;
}
.preview-meta-sponsored {
    font-size: 11px;
    color: #65676b;
}
.preview-meta-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}
.preview-meta-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.preview-meta-body {
    padding: 8px 12px 4px;
}
.preview-meta-headline {
    font-weight: 600;
    font-size: 14px;
    color: #050505;
    margin-bottom: 2px;
}
.preview-meta-desc {
    font-size: 13px;
    color: #65676b;
    line-height: 1.4;
}
.preview-meta-cta {
    margin: 8px 12px 12px;
    padding: 6px 16px;
    background: #e4e6eb;
    color: #050505;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
}

/* -- YouTube preview -- */
.preview-yt {
    background: #0f0f0f;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    font-family: 'Roboto', Arial, sans-serif;
}
.preview-yt-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #272727;
}
.preview-yt-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.preview-yt-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.85;
    pointer-events: none;
}
.preview-yt-info {
    padding: 10px 12px 12px;
}
.preview-yt-title {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 6px;
    color: #f1f1f1;
}
.preview-yt-channel {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.preview-yt-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}
.preview-yt-channel span {
    font-size: 12px;
    color: #aaa;
}
.preview-yt-meta {
    font-size: 12px;
    color: #aaa;
    padding-left: 32px;
}

/* -- Generic fallback -- */
.preview-generic {
    padding: 16px;
}
.preview-generic-headline {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}
.preview-generic-desc {
    font-size: 13px;
    color: var(--text-muted-foreground);
    line-height: 1.45;
}

/* Empty State */
.demo-panel .empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted-foreground);
    font-size: 0.9375rem; /* text-sm */
}

/* Explorer: brand profile as cards (one card per fact, no categorization) */
.explorer-cards-wrap {
    padding: 0.75rem;
    overflow: auto;
}
.explorer-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.explorer-card {
    background: var(--bg-secondary-alpha);
    border: 1px solid var(--border-border);
    border-radius: 8px;
    padding: 0.75rem;
    min-height: 56px;
    font-size: 0.8125rem;
    line-height: 1.4;
}
.explorer-card__label {
    display: block;
    font-weight: 600;
    color: var(--text-muted-foreground);
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.explorer-card__label:empty {
    display: none;
}
.explorer-card__value {
    color: var(--text-primary);
    word-break: break-word;
}

/* Draft profile header (badge + hint row) */
.draft-profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.75rem 0;
}
.draft-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.draft-badge--confirmed {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}
.draft-hint {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-muted-foreground);
}

/* Draft card styling: dashed border, amber tint, left accent bar */
.explorer-card--draft {
    border: 1px dashed rgba(245, 158, 11, 0.4);
    border-left: 3px solid #f59e0b;
    background: rgba(245, 158, 11, 0.04);
    animation: draftCardIn 0.3s ease-out both;
}

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

/* Account summary header */
.account-summary-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.75rem 0;
}

/* Plan tier badges */
.plan-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.plan-badge--free {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}
.plan-badge--pro {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}
.plan-badge--enterprise {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Brand profile header container (banner + metadata side by side) */
.brand-profile-header-container {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

/* Brand profile banner image */
.brand-profile-banner-wrap {
    flex: 0 0 auto;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-border);
    padding: 12px 14px;
    min-width: 0;
    min-height: 120px;
}

.brand-profile-banner {
    max-width: 200px;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Condensed metadata card */
.explorer-card--metadata {
    flex: 1 1 auto;
    background: var(--bg-primary-alpha);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 12px 14px;
    min-width: 0;
    min-height: 120px;
    display: flex;
    align-items: flex-start;
}

.explorer-card__metadata {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.8;
    word-break: break-word;
    width: 100%;
}

.explorer-card__metadata > div {
    margin-bottom: 0.5rem;
}

.explorer-card__metadata > div:last-child {
    margin-bottom: 0;
}

.explorer-card__metadata-label {
    font-weight: 600;
    color: var(--text-muted-foreground);
    margin-right: 0.25rem;
}

/* Dev debug panel (bottom of page) */
.debug-panel-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    font-family: ui-monospace, monospace;
}
.debug-panel-toggle {
    display: block;
    width: 100%;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: var(--text-muted-foreground);
    cursor: pointer;
    text-align: left;
}
.debug-panel-toggle:hover {
    background: var(--bg-secondary-alpha);
    color: var(--text-primary);
}
.debug-panel {
    max-height: 220px;
    overflow: auto;
    background: #1a1d23;
    border: 1px solid var(--border-border);
    border-bottom: none;
    padding: 0.5rem 0.75rem;
}
.debug-panel-content {
    margin: 0;
    font-size: 0.7rem;
    line-height: 1.4;
    color: #a0aec0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ===== Content Cards ===== */
.content-card-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
}
.content-card {
    border: 1px solid var(--border-border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
}
.content-card:hover {
    border-color: var(--text-muted-foreground);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* Top row: rank, badges, experiment, score */
.content-card-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.content-card-rank {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted-foreground);
    min-width: 24px;
}
.content-card-experiment {
    font-size: 11px;
    color: var(--text-muted-foreground);
}
.content-card-score {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

/* Channel badge (colored pill) */
.channel-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    color: #fff;
    background: #6b7280;
    line-height: 1.4;
    white-space: nowrap;
}
.channel-badge--ig {
    background: #8B5CF6;
}
.channel-badge--google {
    background: #3B82F6;
}
.channel-badge--meta {
    background: #1877F2;
}
.channel-badge--yt {
    background: #FF0000;
}
.channel-badge--display {
    background: #2563EB;
}
.channel-badge--seo {
    background: #059669;
}

/* Role badge */
.role-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    line-height: 1.4;
    white-space: nowrap;
}
.role-badge--content {
    background: #1f2937;
    color: #f9fafb;
}

/* Body: headline + description */
.content-card-body {
    margin-bottom: 6px;
}
.content-card-headline {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.content-card-desc {
    font-size: 12px;
    color: var(--text-muted-foreground);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Score bar */
.content-card-bar {
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.score-bar-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
}
.score-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--bg-secondary, #1f2937);
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #8B5CF6, #3B82F6);
    transition: width 0.3s ease;
}

/* Overall score badge in top row */
.overall-score-badge {
    background: linear-gradient(135deg, #8B5CF6, #3B82F6);
    color: #fff !important;
    padding: 1px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Intent scores row — 4 tiles */
.intent-scores-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 4px;
}
.intent-tile {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 3px 6px 4px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
}
.intent-tile__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
}
.intent-tile__label {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted-foreground);
    line-height: 1.2;
}
.intent-tile__rank {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted-foreground);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.intent-tile__rank--leader {
    color: #a78bfa;
}
.intent-tile__value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}
.intent-tile__bar {
    height: 3px;
    border-radius: 1.5px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
    margin-top: 1px;
}
.intent-tile__fill {
    height: 100%;
    border-radius: 1.5px;
    background: linear-gradient(90deg, #8B5CF6, #3B82F6);
    transition: width 0.3s ease;
}

/* Untested label */
.content-card-untested {
    font-size: 11px;
    color: var(--text-muted-foreground);
    opacity: 0.6;
    margin-top: 2px;
}

/* ---- Leaderboard weight controls ---- */
.lb-weights {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    margin: 0 8px 4px;
    border: 1px solid var(--border-border);
    border-radius: 8px;
    background: var(--bg-secondary);
}
.lb-weights__title {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted-foreground);
    white-space: nowrap;
    flex-shrink: 0;
}
.lb-weight-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.lb-weight-ctrl__label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted-foreground);
    white-space: nowrap;
}
.lb-weight-ctrl__slider {
    flex: 1;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    outline: none;
    min-width: 40px;
}
.lb-weight-ctrl__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8B5CF6;
    cursor: pointer;
    border: none;
}
.lb-weight-ctrl__slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8B5CF6;
    cursor: pointer;
    border: none;
}
.lb-weight-ctrl__val {
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted-foreground);
    min-width: 18px;
    text-align: right;
}
.lb-weights__reset {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted-foreground);
    background: transparent;
    border: 1px solid var(--border-border);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
}
.lb-weights__reset:hover {
    color: var(--text-primary);
    border-color: var(--text-muted-foreground);
}

/* Metrics grid (Content tab cards) */
.content-card-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 6px;
}
.metrics-tile {
    display: flex;
    flex-direction: column;
    padding: 4px 6px;
    border-radius: 6px;
    background: var(--bg-secondary, #f3f4f6);
}
.metrics-tile__label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted-foreground);
    line-height: 1.3;
}
.metrics-tile__value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

/* SEO preview (organic search result) */
.preview-seo {
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    font-family: Arial, sans-serif;
}
.preview-seo-url {
    font-size: 12px;
    color: #202124;
    margin-bottom: 4px;
    color: #059669;
}
.preview-seo-headline {
    font-size: 18px;
    color: #1a0dab;
    margin-bottom: 6px;
    line-height: 1.3;
    cursor: pointer;
}
.preview-seo-headline:hover {
    text-decoration: underline;
}
.preview-seo-desc {
    font-size: 13px;
    color: #4d5156;
    line-height: 1.5;
}

/* Google Display Ads preview */
.preview-display {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    font-family: Arial, sans-serif;
}
.preview-display-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
}
.preview-display-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}
.preview-display-brand {
    font-size: 13px;
    font-weight: 600;
    color: #202124;
    flex: 1;
}
.preview-display-ad-badge {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #f59e0b;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}
.preview-display-body {
    padding: 14px;
}
.preview-display-headline {
    font-size: 16px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 6px;
    line-height: 1.3;
}
.preview-display-desc {
    font-size: 13px;
    color: #5f6368;
    line-height: 1.5;
}
.preview-display-cta {
    display: block;
    text-align: center;
    padding: 10px 14px;
    background: #2563EB;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    cursor: pointer;
}
.preview-display-cta:hover {
    background: #1d4ed8;
}

/* Password reset confirmation */
.auth-magic-sent { text-align: center; padding: 1.5rem 0; color: var(--text-foreground); }
.magic-link-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.magic-link-subtext { color: var(--text-muted-foreground); font-size: 0.8rem; margin-top: 0.5rem; }

/* Verification code entry */
.auth-code-entry { text-align: center; padding: 0.75rem 0; color: var(--text-foreground); }
.auth-code-entry p { color: var(--text-muted-foreground); font-size: 0.85rem; }
.auth-code-entry strong { color: var(--text-foreground); }
.code-input {
    display: block; margin: 0.75rem auto; width: 180px; padding: 10px 14px;
    font-size: 1.5rem; font-weight: 700; letter-spacing: 0.3em; text-align: center;
    border: 1px solid var(--border-border); border-radius: var(--radius);
    background: var(--bg-secondary); color: var(--text-foreground);
    font-family: 'Inter', monospace;
    outline: none; transition: border-color 0.2s;
}
.code-input:focus { border-color: var(--bg-primary); background: var(--bg-background); }
.code-error { color: hsl(0, 84%, 60%); font-size: 0.8rem; margin: 0.5rem 0; }
.code-dev-hint { color: var(--text-muted-foreground); font-size: 0.75rem; margin: 0.25rem 0; }
.auth-submit-btn--secondary {
    background: transparent;
    border: 1px solid var(--border-border);
    color: var(--text-muted-foreground);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Inter', system-ui, sans-serif;
    margin-top: 0.5rem;
    transition: background 0.15s, color 0.15s;
}
.auth-submit-btn--secondary:hover { background: var(--bg-secondary); color: var(--text-foreground); }
.auth-link-btn {
    background: none;
    border: none;
    color: var(--text-muted-foreground);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: inline-block;
    transition: color 0.15s;
}
.auth-link-btn:hover { color: var(--text-foreground); }

/* Chat gate overlay */
.chat-gate-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-background, hsl(222, 47%, 6%));
    opacity: 0.92;
    z-index: 10;
    border-radius: 8px;
}
.chat-gate-overlay p { color: var(--text-muted-foreground, #aaa); margin-bottom: 1rem; font-size: 0.95rem; }

/* Prompt limit banner */
.prompt-limit-banner {
    text-align: center;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--text-muted-foreground, hsl(215, 20%, 55%));
    border-top: 1px solid var(--border-border, hsl(215, 28%, 17%));
    background: var(--bg-background, hsl(222, 47%, 6%));
    flex-shrink: 0;
}
.prompt-limit-banner.warning {
    color: #d97706;
    border-top-color: #fbbf24;
}
