﻿/* ===== MODERN ATAPIC CHAT - ChatGPT/Claude Inspired ===== */

/* Import modern font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Light mode (default) */
:root {
    --primary: #00b3c9;
    --primary-dark: #0090a3;
    --secondary: #00e0d5;
    --success: #16c784;
    --warning: #f59e0b;
    --text-dark: #0a0e27;
    --text-light: #6c7280;
    --text-muted: #9ca3af;
    --bg-white: #ffffff;
    --bg-light: #f7f9fb;
    --bg-card: #ffffff;
    --border: #e6e9ef;
    --border-light: #f1f3f5;
    --shadow-sm: 0 6px 18px rgba(10,14,39,.06);
    --shadow-md: 0 14px 40px rgba(10,14,39,.10);
    --radius: 18px;
    --radius-sm: 12px;
    --sidebar-width: 360px;
    --canvas-width: 420px;
}

/* Dark mode */
[data-theme="dark"] {
    --primary: #00d4e6;
    --primary-dark: #00b3c9;
    --secondary: #00f5e9;
    --success: #1ce89b;
    --warning: #ffb020;
    --text-dark: #ececf1;
    --text-light: #c5c5d2;
    --text-muted: #8e8ea0;
    --bg-white: #212121;
    --bg-light: #2f2f2f;
    --bg-card: #2f2f2f;
    --border: #3e3e4e;
    --border-light: #353541;
    --shadow-sm: 0 6px 18px rgba(0,0,0,.3);
    --shadow-md: 0 14px 40px rgba(0,0,0,.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    background: var(--bg-white);
    height: 100vh;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    display: flex;
    height: 100vh;
    background: var(--bg-white);
}

/* ================================================================
   SECTION: CHAT HEADER - Desktop Top Bar (FIXED)
   ================================================================ */

.chat-header {
    padding: 16px 24px;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-white);
    height: 64px;
}

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

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

/* Home/Dashboard Button */
.header-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border: none;
    border-radius: 999px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.header-home-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
}

.header-home-btn .material-icons {
    font-size: 20px;
}

[data-theme="dark"] .header-home-btn {
    background: var(--bg-card);
    color: var(--text-light);
}

[data-theme="dark"] .header-home-btn:hover {
    background: var(--primary);
    color: white;
}

/* Sidebar Toggle - Rounded, No Border */
.sidebar-toggle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: var(--bg-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .sidebar-toggle:hover {
        background: var(--border);
    }

    .sidebar-toggle .fas,
    .sidebar-toggle i {
        font-size: 16px;
        color: var(--text-dark);
    }

/* Title & Status */
.chat-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 2px rgba(22, 199, 132, 0.2);
}

/* ================================================================
   Desktop List Toggle - Rounded, No Border
   ================================================================ */

.desktop-list-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border: none;
    border-radius: 999px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

    .desktop-list-toggle:hover {
        background: var(--border);
    }

    .desktop-list-toggle .fas,
    .desktop-list-toggle i {
        font-size: 16px;
        color: var(--text-dark);
    }

/* Desktop List Badge */
.desktop-list-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

/* ================================================================
   Token Button - Rounded, No Border
   ================================================================ */

.token-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #00b3c9 0%, #00e0d5 100%);
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 179, 201, 0.25);
}

    .token-button:hover {
        background: linear-gradient(135deg, #0090a3 0%, #00b3c9 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.35);
    }

    .token-button .fas,
    .token-button i {
        font-size: 14px;
    }

/* Dark Mode */
[data-theme="dark"] .sidebar-toggle {
    background: var(--bg-card);
}

    [data-theme="dark"] .sidebar-toggle:hover {
        background: var(--bg-light);
    }

[data-theme="dark"] .desktop-list-toggle {
    background: var(--bg-card);
}

    [data-theme="dark"] .desktop-list-toggle:hover {
        background: var(--bg-light);
    }

[data-theme="dark"] .token-button {
    background: linear-gradient(135deg, #00d4e6 0%, #00f5e9 100%);
}

    [data-theme="dark"] .token-button:hover {
        background: linear-gradient(135deg, #00b3c9 0%, #00d4e6 100%);
    }

/* Mobile - Hide desktop header */
@media (max-width: 768px) {
    .chat-header {
        display: none !important;
    }
}

/* Desktop - Show header */
@media (min-width: 769px) {
    .chat-header {
        display: flex !important;
    }
}

/* Active state when canvas is open */
.canvas-panel:not(.collapsed) ~ .chat-area .desktop-list-toggle {
    background: rgba(0, 179, 201, 0.1);
    border-color: var(--primary);
}

    .canvas-panel:not(.collapsed) ~ .chat-area .desktop-list-toggle .material-icons {
        color: var(--primary);
    }

/* ================================================================
   SECTION: MOBILE TOKEN BADGE - Compact Circular Style
   ================================================================ */
.token-badge {
    position: fixed;
    right: 80px;
    top: 20px;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 179, 201, 0.12);
    border: 1px solid rgba(0, 179, 201, 0.25);
    border-radius: 24px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 179, 201, 0.15);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

    .token-badge:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 179, 201, 0.25);
        background: rgba(0, 179, 201, 0.18);
        border-color: rgba(0, 179, 201, 0.4);
    }

    .token-badge:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 179, 201, 0.25);
        background: rgba(0, 179, 201, 0.18);
        border-color: rgba(0, 179, 201, 0.4);
    }

.token-badge-count {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    letter-spacing: -0.3px;
}

/* ================================================================
   SECTION: MOBILE FLOATING LIST TOGGLE
   ================================================================ */

.floating-list-toggle {
    position: fixed;
    right: 20px;
    top: 20px;
    width: 48px;
    height: 48px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    position: relative;
}

    .floating-list-toggle:hover {
        background: var(--bg-light);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

    .floating-list-toggle .material-icons {
        font-size: 24px;
        color: var(--text-dark);
    }

.floating-list-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-white);
}

/* ================================================================
   SECTION: RESPONSIVE BREAKPOINTS
   ================================================================ */

/* Desktop - Hide mobile controls */
@media (min-width: 769px) {
    .floating-menu-toggle,
    .token-badge,
    .floating-list-toggle {
        display: none !important;
    }

    .chat-header {
        display: flex !important;
    }
}

/* Mobile - Hide desktop controls, show mobile controls */
@media (max-width: 768px) {
    .chat-header {
        display: none !important;
    }

    .floating-menu-toggle,
    .token-badge,
    .floating-list-toggle {
        display: flex;
    }

    .messages-container {
        padding-top: 80px;
    }
}

/* ================================================================
   SECTION: DARK MODE SUPPORT
   ================================================================ */

[data-theme="dark"] .token-button {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 212, 230, 0.3);
}

    [data-theme="dark"] .token-button:hover {
        background: var(--primary-dark);
        box-shadow: 0 4px 12px rgba(0, 212, 230, 0.4);
    }

[data-theme="dark"] .token-badge {
    background: var(--primary);
}

[data-theme="dark"] .desktop-list-toggle {
    background: var(--bg-card);
    border-color: var(--border);
}

    [data-theme="dark"] .desktop-list-toggle:hover {
        background: var(--bg-light);
        border-color: var(--primary);
    }

[data-theme="dark"] .floating-list-toggle {
    background: var(--bg-card);
    border-color: var(--border);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-light);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
}

    .sidebar.collapsed {
        margin-left: calc(var(--sidebar-width) * -1);
    }

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-light);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 20px;
    cursor: pointer;
}

.logo-img {
    height: 36px;
    width: auto;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.new-chat-btn {
    width: 100%;
    padding: 14px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 179, 201, 0.2);
    font-family: 'Inter', sans-serif;
}

    .new-chat-btn:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
    }

/* ===== SIDEBAR NAV SECTIONS - SCROLLABLE ===== */
.nav-scrollable {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

    .nav-scrollable::-webkit-scrollbar {
        width: 4px;
    }

    .nav-scrollable::-webkit-scrollbar-track {
        background: transparent;
    }

    .nav-scrollable::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }

        .nav-scrollable::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

/* ===== CLEAN NAV ITEMS (No icon) ===== */
.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 2px;
}

    .nav-item:hover {
        background: var(--bg-light);
    }

.nav-item-content {
    flex: 1;
    min-width: 0;
}

.nav-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.nav-item-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Remove old nav-item-icon styles if they exist */
.nav-item-icon {
    display: none; /* Hide icons */
}

/* Empty state */
.nav-empty {
    padding: 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 14px;
    padding-left: 6px;
}




/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

    .user-profile:hover {
        background: var(--bg-white);
    }

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

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

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-icon {
    color: var(--text-muted);
    font-size: 20px;
    flex-shrink: 0;
}

/* ===== MAIN CHAT AREA ===== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    min-height: 0;
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    padding: 12px 24px;
    border-bottom: none; /* NO BORDER */
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-white);
    height: 56px; /* Fixed height for consistency */
}

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

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

    .sidebar-toggle:hover {
        background: var(--bg-light);
        border-color: var(--primary);
    }

    .sidebar-toggle .material-icons {
        font-size: 18px;
        color: var(--text-muted);
    }

.chat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.2px;
    line-height: 1;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 2px rgba(22, 199, 132, 0.15);
}

/* Token Display */
.token-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: var(--bg-light);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

    .token-display:hover {
        border-color: var(--primary);
    }

.token-icon {
    font-size: 20px;
    color: var(--primary);
}

.token-info {
    display: flex;
    flex-direction: column;
}

.token-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.token-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.token-add {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

/* ===== MESSAGES ===== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 32px;
    min-height: 0;
}

    .messages-container.has-messages {
        justify-content: flex-start;
    }

.messages-inner {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 80px 40px;
}

.welcome-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-muted, #6b7280);
    margin: 0 0 40px 0;
    max-width: 520px;
    text-align: center;
    line-height: 1.5;
    width: 100%;
}

.example-prompts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.example-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    background: var(--bg-white);
}

    .example-card:hover {
        border-color: var(--primary);
        background: var(--bg-light);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.example-text {
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.6;
    font-weight: 500;
}
/* ===== SIDEBAR NAV DROPDOWNS ===== */
.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

    .nav-section-header:hover {
        background: var(--bg-light);
    }

.nav-section-icon {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.nav-section-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.3s ease;
}

    .nav-section-content.collapsed {
        max-height: 0;
        overflow: hidden;
    }

    .nav-section-content::-webkit-scrollbar {
        width: 4px;
    }

    .nav-section-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .nav-section-content::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }

        .nav-section-content::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }
.nav-item.active {
    background: rgba(0, 179, 201, 0.1);
    border-left: 3px solid var(--primary);
}

    .nav-item.active .nav-item-title {
        color: var(--primary);
        font-weight: 600;
    }
.nav-empty {
    padding: 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ===== VIEW MORE SESSIONS BUTTON ===== */
.sessions-view-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 10px 12px;
    margin-top: 4px;
    background: transparent;
    border: 1px dashed var(--border-color, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sessions-view-more-btn:hover {
    background: rgba(0, 179, 201, 0.08);
    color: var(--primary);
    border-color: var(--primary);
}
.sessions-view-more-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

/* ===== MESSAGE BUBBLES - CHATGPT/CLAUDE STYLE ===== */
.message {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

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

.message.user {
    flex-direction: row-reverse;
    gap: 0;
}

/* AI Message Avatar - Show Logo Only */
/* AI Message Avatar - Completely Hidden (Like User) */
.message.assistant .message-avatar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    visibility: hidden !important;
}

/* User Message Avatar - Completely Hidden */
.message.user .message-avatar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    visibility: hidden !important;
}

.message-content {
    flex: 1;
    max-width: 85%;
}

.message.user .message-content {
    display: flex;
    justify-content: flex-end;
    max-width: 100%;
}

.message-bubble {
    padding: 16px 20px;
    border-radius: var(--radius);
    line-height: 1.7;
    font-size: 16px;
}

.message.assistant .message-bubble {
    background: transparent;
    color: var(--text-dark);
    padding-left: 0;
}

/* ===== Message Formatting (markdown-style) ===== */
.fmt-line {
    margin-bottom: 4px;
}
.fmt-spacer {
    height: 8px;
}
.fmt-header {
    font-weight: 700;
    margin: 12px 0 6px 0;
    line-height: 1.3;
}
h4.fmt-header { font-size: 16px; }
h5.fmt-header { font-size: 15px; }
.fmt-list {
    margin: 6px 0 6px 8px;
    padding-left: 18px;
}
.fmt-list li {
    margin-bottom: 4px;
    line-height: 1.6;
}
ul.fmt-list { list-style-type: disc; }
ol.fmt-list { list-style-type: decimal; }
.fmt-fade-in {
    animation: fmtFadeIn 0.25s ease-out both;
}
@keyframes fmtFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.fmt-code {
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.9em;
}

.message.user .message-bubble {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

/* Lead Cards in Chat */
.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px 0;
    transition: all 0.2s;
}

    .lead-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
        border-color: var(--primary);
    }

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

/* LinkedIn profile picture / initials fallback - sits left of lead-info.
   Kept small and round so it tucks into the existing header layout. */
.lead-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
    border: 1px solid #e4e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    letter-spacing: 0.3px;
}
.lead-avatar-fallback {
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
    color: #1d4ed8;
}

.lead-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.lead-title {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.lead-signal {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--success);
    margin: 12px 0;
    font-weight: 600;
}

.lead-email {
    font-size: 14px;
    color: var(--text-light);
    margin: 8px 0;
    font-weight: 500;
}

.lead-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.lead-btn {
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

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

    .lead-btn.primary {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

        .lead-btn.primary:hover {
            background: var(--primary-dark);
        }

/* ===== INPUT AREA ===== */
.input-area {
    padding: 24px 32px 12px;
    background: var(--bg-white);
    flex-shrink: 0;
}

.input-container {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ================================================================
   SECTION: SCROLL TO BOTTOM ARROW
   ================================================================ */

.scroll-to-bottom-btn {
    position: fixed;
    bottom: 120px;
    right: 50%;
    transform: translateX(50%);
    width: 48px;
    height: 48px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .scroll-to-bottom-btn.show {
        display: flex;
    }

    .scroll-to-bottom-btn:hover {
        background: var(--primary);
        border-color: var(--primary);
        transform: translateX(50%) translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 179, 201, 0.3);
    }

        .scroll-to-bottom-btn:hover .material-icons {
            color: white;
        }

    .scroll-to-bottom-btn .material-icons {
        font-size: 24px;
        color: var(--text-dark);
        transition: color 0.2s;
    }

/* Mobile positioning - keep horizontally centered (don't push to the
   right edge where the send button lives). Bump `bottom` well above
   the 2-row input area we use on phones so the scroll-down button
   doesn't sit on top of the send button. */
@media (max-width: 768px) {
    .scroll-to-bottom-btn {
        bottom: 160px;       /* clears the 2-row input + safe area */
        right: 50%;
        transform: translateX(50%);
    }

        .scroll-to-bottom-btn:hover {
            transform: translateX(50%) translateY(-2px);
        }
}

[data-theme="dark"] .scroll-to-bottom-btn {
    background: var(--bg-card);
    border-color: var(--border);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-white);
    border-radius: 28px;
    border: 1px solid var(--border);
    padding: 14px 16px 14px 28px;
    box-shadow: 0 8px 30px rgba(10, 14, 39, 0.06);
    transition: all 0.2s;
    min-height: 68px;
    position: relative;
}

    .input-wrapper:focus-within {
        border-color: var(--primary);
        box-shadow: 0 8px 30px rgba(0, 179, 201, 0.15);
    }

.input-field {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 17px;
    color: var(--text-dark);
    padding: 14px 0;
    resize: none;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

    .input-field::placeholder {
        color: #b0b5c0;
    }

.send-button {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    outline: none;
    padding: 0;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.12s ease;
}

    .send-button:hover:not(:disabled) {
        background: var(--primary-dark);
        transform: translateY(-1px);
    }

    .send-button:active {
        transform: translateY(0);
    }

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

    .send-button .material-icons {
        font-size: 26px;
        font-weight: 600;
    }

/* ===== VOICE MODE BUTTON ===== */
.voice-mode-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    outline: none;
    padding: 0;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

    .voice-mode-btn:hover {
        background: rgba(0, 0, 0, 0.05);
        color: var(--text-dark);
    }

    .voice-mode-btn.active {
        background: #ef4444;
        color: #fff;
        animation: voicePulse 1.8s ease-in-out infinite;
    }

        .voice-mode-btn.active:hover {
            background: #dc2626;
        }

    .voice-mode-btn.listening {
        background: #ef4444;
        color: #fff;
        animation: voicePulse 0.8s ease-in-out infinite;
    }

@keyframes voicePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

[data-theme="dark"] .voice-mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
}

[data-theme="dark"] .voice-mode-btn.active,
[data-theme="dark"] .voice-mode-btn.listening {
    background: #ef4444;
    color: #fff;
}

/* ===== VOICE TTS SPEAKING OVERLAY ===== */
.voice-tts-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border-radius: 24px;
    z-index: 50;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
}

.voice-tts-overlay.active {
    display: flex;
}

.voice-tts-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 12px;
    animation: ttsPulse 1.4s ease-in-out infinite;
}

.voice-tts-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

@keyframes ttsPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        transform: scale(1.15);
        opacity: 0.85;
        box-shadow: 0 0 0 16px rgba(99, 102, 241, 0);
    }
}

[data-theme="dark"] .voice-tts-overlay {
    background: rgba(30, 30, 30, 0.92);
}

[data-theme="dark"] .voice-tts-label {
    color: #9ca3af;
}

/* ===== FILE UPLOAD BUTTON ===== */
.file-upload-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 2px dashed var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.file-upload-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 179, 201, 0.08);
}

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

.file-upload-btn .material-icons {
    font-size: 22px;
    font-weight: 500;
}

/* File upload button loading state */
.file-upload-btn.uploading {
    border-color: var(--primary);
    color: var(--primary);
    animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--primary); opacity: 1; }
    50% { border-color: var(--secondary); opacity: 0.7; }
}

/* Dark mode file upload */
[data-theme="dark"] .file-upload-btn {
    border-color: var(--border);
    color: var(--text-muted);
}

[data-theme="dark"] .file-upload-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 212, 230, 0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .file-upload-btn {
        width: 36px;
        height: 36px;
    }

    .file-upload-btn .material-icons {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .file-upload-btn {
        width: 32px;
        height: 32px;
    }

    .file-upload-btn .material-icons {
        font-size: 18px;
    }
}

/* Dark Mode Input */
[data-theme="dark"] .input-wrapper {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .input-field {
    color: var(--text-dark);
}

    [data-theme="dark"] .input-field::placeholder {
        color: var(--text-muted);
    }

/* ===== ACTIONS DROPDOWN ===== */
.actions-dropdown-container {
    position: relative;
    flex-shrink: 0;
    margin-right: 4px;
}

.actions-dropdown-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 2px dashed var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.actions-dropdown-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 179, 201, 0.08);
}

.actions-dropdown-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 179, 201, 0.12);
    border-style: solid;
}

.actions-dropdown-btn .material-icons {
    font-size: 22px;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.actions-dropdown-btn.active .material-icons {
    transform: rotate(45deg);
}

.actions-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.actions-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.actions-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.actions-dropdown-item:hover {
    background: var(--bg-hover);
}

.actions-dropdown-item .material-icons {
    font-size: 20px;
    color: var(--primary);
}

.actions-dropdown-item .action-hint {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
}

/* File Attachment Chip - positioned above input when active */
.file-attachment-chip {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 10px;
    background: var(--primary);
    border-radius: 20px;
    flex-shrink: 0;
    max-width: fit-content;
    animation: chipPop 0.15s ease;
    position: absolute;
    top: -44px;
    left: 28px;
    box-shadow: 0 2px 8px rgba(0, 179, 201, 0.3);
}

@keyframes chipPop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.file-attachment-chip .material-icons {
    font-size: 16px;
    color: white;
}

.file-attachment-chip .file-attachment-name {
    font-size: 13px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.file-chip-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 50%;
    transition: all 0.15s ease;
    margin-left: 2px;
}

.file-chip-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

.file-chip-remove .material-icons {
    font-size: 14px;
}

/* Dark mode */
[data-theme="dark"] .actions-dropdown-btn {
    border-color: var(--border);
    color: var(--text-muted);
}

[data-theme="dark"] .actions-dropdown-btn:hover,
[data-theme="dark"] .actions-dropdown-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 212, 230, 0.1);
}

[data-theme="dark"] .actions-dropdown-menu {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .actions-dropdown-item {
    color: var(--text-dark);
}

[data-theme="dark"] .actions-dropdown-item:hover {
    background: var(--bg-hover);
}

[data-theme="dark"] .file-attachment-preview {
    background: rgba(0, 212, 230, 0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .actions-dropdown-btn {
        width: 36px;
        height: 36px;
    }

    .actions-dropdown-btn .material-icons {
        font-size: 20px;
    }

    .actions-dropdown-menu {
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .actions-dropdown-btn {
        width: 32px;
        height: 32px;
    }

    .actions-dropdown-btn .material-icons {
        font-size: 18px;
    }
}

/* ===== CANVAS/LIST BUILDER ===== */
.canvas-panel {
    position: relative; /* anchor the resize handle */
    width: var(--canvas-width);
    background: var(--bg-light);
    border-left: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .canvas-panel.collapsed {
        margin-right: calc(var(--canvas-width) * -1);
    }

.canvas-header {
    padding: 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.canvas-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.canvas-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
}

.canvas-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--border);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.canvas-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

    .canvas-close:hover {
        background: var(--bg-card);
    }

.canvas-actions-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.canvas-action-btn {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
}

    .canvas-action-btn:hover {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }

    .canvas-action-btn .material-icons {
        font-size: 16px;
    }

.canvas-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.canvas-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.canvas-empty-icon {
    font-size: 56px;
    opacity: 0.3;
    margin-bottom: 20px;
}

/* Lead List Items in Canvas */
.canvas-lead-item {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 10px;
    transition: all 0.15s;
    border: 1px solid var(--border);
}

    .canvas-lead-item:hover {
        box-shadow: var(--shadow-sm);
    }

    .canvas-lead-item.selected {
        border-color: var(--primary);
        background: linear-gradient(135deg, rgba(0,179,201,0.05) 0%, rgba(0,224,213,0.05) 100%);
    }

.canvas-lead-header {
    display: flex;
    align-items: start;
    gap: 12px;
}

.canvas-lead-checkbox {
    margin-top: 3px;
}

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

.canvas-lead-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.canvas-lead-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.canvas-lead-email {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.canvas-lead-intent {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 6px;
    font-weight: 700;
}

.intent-high {
    background: rgba(22, 199, 132, 0.15);
    color: var(--success);
}

.intent-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.canvas-footer {
    padding: 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
}

.selected-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.export-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

    .export-btn:hover {
        background: var(--primary-dark);
    }

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

/* ===== MODALS ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

    .modal-overlay.active {
        display: flex;
    }

.modal {
    background: var(--bg-white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 70px rgba(10, 14, 39, 0.4);
}

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

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--bg-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

    .modal-close:hover {
        background: var(--border);
    }

.modal-body {
    padding: 28px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.quick-action {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

    .quick-action:hover {
        border-color: var(--primary);
        background: var(--bg-light);
        color: var(--primary);
    }

/* Theme Toggle */
.theme-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .theme-toggle-btn:hover {
        background: var(--bg-card);
        border-color: var(--primary);
    }

.theme-toggle-left {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 600;
}

.theme-toggle-indicator {
    width: 52px;
    height: 28px;
    background: var(--border);
    border-radius: 999px;
    position: relative;
    transition: all 0.3s;
}

    .theme-toggle-indicator::after {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 22px;
        height: 22px;
        background: white;
        border-radius: 50%;
        transition: all 0.3s;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    }

.theme-toggle-btn.active .theme-toggle-indicator {
    background: var(--primary);
}

    .theme-toggle-btn.active .theme-toggle-indicator::after {
        transform: translateX(24px);
    }

[data-theme="dark"] .theme-toggle-indicator::after {
    background: var(--bg-white);
}

/* ===== MOBILE SIDEBAR BACKDROP & UX FIXES ===== */

/* Backdrop overlay for mobile sidebar */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .sidebar-backdrop.active {
        display: block;
        opacity: 1;
    }

/* Prevent body scroll when sidebar is open on mobile */
body.sidebar-open {
    overflow: hidden;
}

/* Mobile close button inside sidebar (hidden on desktop) */
.sidebar-mobile-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

    .sidebar-mobile-close:hover {
        background: rgba(0, 0, 0, 0.15);
    }

    .sidebar-mobile-close .material-icons {
        font-size: 20px;
        color: var(--text-dark);
    }

/* Desktop (769px and above) - ensure mobile elements are hidden */
@media (min-width: 769px) {
    .sidebar-backdrop {
        display: none !important;
    }

    .sidebar-mobile-close {
        display: none !important;
    }

    body.sidebar-open {
        overflow: auto;
        position: static;
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet (1200px and below) */
@media (max-width: 1200px) and (min-width: 769px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        width: var(--sidebar-width);
    }

    /* Hide backdrop on tablet */
    .sidebar-backdrop {
        display: none !important;
    }

    .sidebar-mobile-close {
        display: none !important;
    }

    .canvas-panel {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    }

    .messages-inner {
        max-width: 750px;
    }

    .input-container {
        max-width: 750px;
    }
}

/* Mobile Landscape / Small Tablet */
@media (max-width: 900px) {
    .chat-header {
        padding: 16px 20px;
    }

    .messages-container {
        padding: 20px;
    }

    .input-area {
        padding: 20px;
    }

    .welcome-title {
        font-size: 36px;
    }

    .welcome-subtitle {
        font-size: 16px;
    }

    .example-prompts {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    /* Sidebar overlay with backdrop */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
        width: 85vw;
        max-width: 320px;
    }

        .sidebar.collapsed {
            margin-left: -100vw;
        }

    /* Show mobile close button */
    .sidebar-mobile-close {
        display: flex !important;
    }

    /* Lock body scroll when sidebar open */
    body.sidebar-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    /* Ensure sidebar toggle is always accessible */
    .sidebar-toggle {
        position: relative;
        z-index: 101;
    }

    .canvas-panel {
        width: 100%;
        --canvas-width: 100%;
    }

    .chat-header {
        padding: 14px 16px;
    }

    .chat-header-left {
        gap: 12px;
    }

    .chat-title {
        font-size: 14px;
    }

    .chat-status {
        display: none;
    }

    .token-display {
        padding: 8px 14px;
    }

    .token-info {
        display: none;
    }

    .token-icon {
        font-size: 22px;
    }

    .messages-container {
        padding: 16px;
    }

    .message {
        gap: 12px;
        margin-bottom: 20px;
    }

        .message.assistant .message-avatar {
            width: 28px;
            height: 28px;
            min-width: 28px;
        }

            .message.assistant .message-avatar::before {
                width: 24px;
                height: 24px;
            }

    .message-content {
        max-width: calc(100% - 40px);
    }

    .message.user .message-content {
        max-width: 100%;
    }

    .message-bubble {
        font-size: 15px;
        padding: 12px 16px;
    }

    .input-area {
        padding: 16px;
    }

    .input-wrapper {
        padding: 10px 12px 10px 20px;
        min-height: 56px;
        border-radius: 24px;
    }

    .input-field {
        font-size: 16px;
        padding: 10px 0;
    }

    .send-button {
        width: 40px;
        height: 40px;
    }

        .send-button .material-icons {
            font-size: 24px;
        }

    .welcome-message {
        padding: 40px 20px;
    }

    .welcome-title {
        font-size: 28px;
    }

    .welcome-subtitle {
        font-size: 15px;
    }

    .example-card {
        padding: 18px;
    }

    .example-text {
        font-size: 14px;
    }

    .lead-card {
        padding: 16px;
    }

    .modal {
        width: 95%;
        max-width: none;
        margin: 20px;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-body {
        padding: 20px;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .welcome-title {
        font-size: 24px;
    }

    .welcome-subtitle {
        font-size: 14px;
    }

    .example-prompts {
        grid-template-columns: 1fr;
    }

    .example-card {
        padding: 16px;
    }

    .message-bubble {
        font-size: 14px;
    }

    .input-wrapper {
        padding: 8px 10px 8px 16px;
    }

    .input-field {
        font-size: 15px;
    }

    .send-button {
        width: 36px;
        height: 36px;
    }

        .send-button .material-icons {
            font-size: 22px;
        }
}
/* ===== IMPROVED MOBILE HEADER - ADD TO YOUR chat.css ===== */

/* ================================================
   FLOATING HAMBURGER MENU (Slides with Sidebar)
   ================================================ */

.floating-menu-toggle {
    position: fixed;
    left: 20px;
    top: 20px;
    width: 48px;
    height: 48px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: none; /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .floating-menu-toggle:hover {
        background: var(--bg-light);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

    .floating-menu-toggle .material-icons {
        font-size: 24px;
        color: var(--text-dark);
        transition: transform 0.3s;
    }

    /* When sidebar is open, move button with it */
    .floating-menu-toggle.sidebar-open {
        left: calc(85vw - 28px); /* Move to right edge of sidebar */
        max-left: calc(320px - 28px);
    }

        .floating-menu-toggle.sidebar-open .material-icons {
            transform: rotate(90deg);
        }

/* ================================================
   CIRCULAR TOKEN BADGE (Like your screenshot)
   ================================================ */

.token-badge {
    position: fixed;
    right: 80px; /* Leave space for list button */
    top: 20px;
    display: none; /* Hidden on desktop */
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 24px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

    .token-badge:hover {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
        border-color: var(--primary);
    }

.token-badge-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .token-badge-icon .material-icons {
        font-size: 16px;
        color: white;
    }

.token-badge-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
}

/* ================================================
   FLOATING LIST TOGGLE (Opens Canvas Panel)
   ================================================ */

.floating-list-toggle {
    position: fixed;
    right: 20px;
    top: 20px;
    width: 48px;
    height: 48px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: none; /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

    .floating-list-toggle:hover {
        background: var(--bg-light);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

    .floating-list-toggle:active {
        background: var(--primary);
    }

        .floating-list-toggle:active .material-icons {
            color: white;
        }

    .floating-list-toggle .material-icons {
        font-size: 24px;
        color: var(--text-dark);
    }

/* Badge on list button (shows count) */
.floating-list-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-white);
}

/* ================================================
   FLOATING HOME BUTTON (Mobile only)
   ================================================ */

.floating-home-btn {
    position: fixed;
    left: 76px;
    top: 20px;
    width: 48px;
    height: 48px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: none; /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-dark);
}

.floating-home-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 6px 16px rgba(0, 179, 201, 0.3);
}

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

.floating-home-btn .material-icons {
    font-size: 22px;
}

/* When sidebar is open, hide home button behind it */
.floating-home-btn.sidebar-open {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-20px);
}

[data-theme="dark"] .floating-home-btn {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-light);
}

[data-theme="dark"] .floating-home-btn:hover {
    background: var(--primary);
    color: white;
}

/* ================================================
   MOBILE RESPONSIVENESS
   ================================================ */

/* Hide desktop header elements on mobile */
@media (max-width: 768px) {
    /* Hide desktop header */
    .chat-header {
        display: none !important;
    }

    /* Show floating controls */
    .floating-menu-toggle,
    .floating-home-btn,
    .token-badge,
    .floating-list-toggle {
        display: flex;
    }

    /* Adjust messages container padding for floating buttons */
    .messages-container {
        padding-top: 80px; /* Make room for floating buttons */
    }

    /* Adjust input area */
    .input-area {
        padding-top: 16px;
    }

    /* Sidebar takes more space on mobile */
    .sidebar {
        width: 85vw;
        max-width: 320px;
    }
}

/* Desktop - hide floating controls, show normal header */
@media (min-width: 769px) {
    .floating-menu-toggle,
    .floating-home-btn,
    .token-badge,
    .floating-list-toggle {
        display: none !important;
    }

    .chat-header {
        display: flex !important;
    }
}

/* ================================================
   DARK MODE SUPPORT
   ================================================ */

[data-theme="dark"] .floating-menu-toggle,
[data-theme="dark"] .token-badge,
[data-theme="dark"] .floating-list-toggle {
    background: var(--bg-card);
    border-color: var(--border);
}

    [data-theme="dark"] .floating-menu-toggle:hover,
    [data-theme="dark"] .floating-list-toggle:hover {
        background: var(--bg-light);
    }

/* ================================================
   ANIMATION FOR SMOOTH SLIDING
   ================================================ */

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.floating-menu-toggle {
    animation: slideIn 0.3s ease-out;
}

/* ================================================
   OPTIONAL: Subtle pulse animation for attention
   ================================================ */

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow: 0 4px 20px rgba(0, 179, 201, 0.3);
    }
}

.floating-list-toggle.has-items {
    animation: pulse 2s infinite;
}

.floating-menu-toggle.sidebar-open .material-icons {
    transform: rotate(0deg) !important;
}

/* Desktop List Toggle Button Styles */
.desktop-list-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

    .desktop-list-toggle:hover {
        background: var(--bg-light);
        border-color: var(--primary);
    }

        .desktop-list-toggle:hover .material-icons {
            color: var(--primary);
        }

    .desktop-list-toggle .material-icons {
        font-size: 18px;
    }

/* Desktop List Badge */
.desktop-list-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 6px;
    min-width: 14px;
    text-align: center;
    line-height: 1;
}

/* Add this to your existing chat-header styles */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

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

/* Hide desktop list toggle on mobile. The header ⚡ "Save as a Play" button
   (.desktop-list-toggle) is the DESKTOP trigger; the ⚡ beside the mic is the
   MOBILE trigger — so each platform shows exactly one. */
@media (max-width: 768px) {
    .desktop-list-toggle {
        display: none;
    }
}
/* The mic-side Save-as-Play icon is mobile-only; on desktop the header ⚡ covers it. */
@media (min-width: 769px) {
    #saveAsPlayInputBtn { display: none !important; }
}

/* Show desktop list toggle only on desktop */
@media (min-width: 769px) {
    .floating-list-toggle {
        display: none !important;
    }
}

/* Optional: Add active state when canvas is open */
.canvas-panel:not(.collapsed) ~ .chat-area .desktop-list-toggle {
    background: var(--primary-light, rgba(0,179,201,0.1));
    border-color: var(--primary, #00b3c9);
}

    .canvas-panel:not(.collapsed) ~ .chat-area .desktop-list-toggle .material-icons {
        color: var(--primary, #00b3c9);
    }

/* ================================================================
   SCROLL TO BOTTOM ARROW BUTTON - Add this to END of chat.css
   ================================================================ */

.scroll-to-bottom-btn {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 50;
    display: none; /* Hidden by default, shown by JS */
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    animation: fadeInUp 0.3s ease;
}

    .scroll-to-bottom-btn:hover {
        background: var(--primary);
        border-color: var(--primary);
        transform: translateX(-50%) translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 179, 201, 0.3);
    }

        .scroll-to-bottom-btn:hover .material-icons {
            color: white;
        }

    .scroll-to-bottom-btn .material-icons {
        font-size: 20px;
        color: var(--text-dark);
        transition: color 0.2s ease;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Dark mode */
[data-theme="dark"] .scroll-to-bottom-btn {
    background: var(--bg-card);
    border-color: var(--border);
}

    [data-theme="dark"] .scroll-to-bottom-btn:hover {
        background: var(--primary);
        border-color: var(--primary);
    }

/* Mobile positioning */
@media (max-width: 768px) {
    .scroll-to-bottom-btn {
        bottom: 100px;
        right: 20px;
        left: auto;
        transform: none;
    }

        .scroll-to-bottom-btn:hover {
            transform: translateY(-2px);
        }
}

/* ===== RESULTS SECTION (COLLAPSIBLE) ===== */
.results-section {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 12px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

    .results-header:hover {
        background: rgba(0, 0, 0, 0.02);
    }

[data-theme="dark"] .results-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.results-icon {
    font-size: 24px;
    color: var(--primary);
}

.results-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.results-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.results-toggle {
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.results-body {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

    .results-body.collapsed {
        max-height: 0;
    }

.results-scroll-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 0 16px 16px 16px;
}

    /* Custom scrollbar for results */
    .results-scroll-container::-webkit-scrollbar {
        width: 8px;
    }

    .results-scroll-container::-webkit-scrollbar-track {
        background: var(--bg-light);
    }

    .results-scroll-container::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }

        .results-scroll-container::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

/* Lead Card Styles (Updated) */
.lead-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

    .lead-card:hover {
        border-color: var(--primary);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.1);
    }

[data-theme="dark"] .lead-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

    [data-theme="dark"] .lead-card:hover {
        border-color: var(--primary);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.2);
    }

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

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

/* "View sources" button on the lead card. Shows when the lead came
   from a post-mining flow (commenter or reactor). Clicking opens the
   sources modal. Uses the app's primary teal so it reads as part of
   the action bar, not as a foreign element. */
.lead-sources-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary, #00b3c9);
    background: rgba(0, 179, 201, 0.08);
    border: 1px solid rgba(0, 179, 201, 0.25);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .12s, border-color .12s;
}
.lead-sources-btn:hover {
    background: rgba(0, 179, 201, 0.14);
    border-color: rgba(0, 179, 201, 0.45);
}
.lead-sources-btn .material-icons { font-size: 14px; }
[data-theme="dark"] .lead-sources-btn {
    background: rgba(0, 212, 230, 0.10);
    border-color: rgba(0, 212, 230, 0.30);
    color: var(--primary, #00d4e6);
}

/* Sources modal - opens on demand when the user clicks "View sources"
   on a lead card that came from comments / reactions. Lists the posts
   that produced the lead pool, each clickable to the LinkedIn original. */
.lead-sources-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: leadSourcesFadeIn .15s ease-out;
}
@keyframes leadSourcesFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.lead-sources-modal {
    width: 92%;
    max-width: 600px;
    max-height: 80vh;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.lead-sources-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary, #00b3c9) 0%, #0090a3 100%);
    color: #fff;
}
.lead-sources-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}
.lead-sources-modal-title .material-icons { font-size: 18px; }
.lead-sources-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .12s;
}
.lead-sources-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}
.lead-sources-modal-body {
    padding: 14px;
    overflow-y: auto;
    flex: 1;
}
.lead-sources-list { display: flex; flex-direction: column; gap: 8px; }
.lead-source-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background-color .12s, border-color .12s;
}
.lead-source-item:hover {
    background: rgba(0, 179, 201, 0.06);
    border-color: rgba(0, 179, 201, 0.35);
}
.lead-source-num {
    flex: 0 0 22px;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: var(--primary, #00b3c9);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lead-source-body { flex: 1; min-width: 0; }
.lead-source-author { font-weight: 600; color: #0f172a; font-size: 13px; }
.lead-source-author-title { font-weight: 400; color: #64748b; font-size: 12px; }
.lead-source-snippet {
    margin-top: 2px;
    color: #334155;
    font-size: 12.5px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.lead-source-snippet-muted { color: #94a3b8; font-size: 11.5px; }
.lead-source-meta { margin-top: 4px; font-size: 11px; color: #64748b; }
.lead-source-open {
    flex: 0 0 16px;
    font-size: 14px !important;
    color: #94a3b8;
    align-self: center;
}
[data-theme="dark"] .lead-sources-modal { background: #1e1e2a; }
[data-theme="dark"] .lead-source-item {
    background: #161620;
    border-color: #3e3e4e;
}
[data-theme="dark"] .lead-source-item:hover {
    background: rgba(0, 212, 230, 0.10);
    border-color: rgba(0, 212, 230, 0.35);
}
[data-theme="dark"] .lead-source-author { color: #e2e8f0; }
[data-theme="dark"] .lead-source-snippet { color: #cbd5e1; }
[data-theme="dark"] .lead-source-meta { color: #94a3b8; }

/* Plan preview block - shows the agentic search plan to the user before
   the search runs. Light, scannable, no provider brand names. */
.plan-preview-card {
    margin: 4px 0 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #f0f9ff 0%, #ecfeff 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    font-size: 13px;
}
.plan-preview-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #0c4a6e;
    margin-bottom: 8px;
}
.plan-preview-header .material-icons { font-size: 16px; color: #0ea5e9; }
.plan-steps { display: flex; flex-direction: column; gap: 6px; }
.plan-step {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.plan-step-num {
    flex: 0 0 22px;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: #0ea5e9;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.plan-step-body { flex: 1; min-width: 0; }
.plan-step-title { font-weight: 500; color: #0f172a; }
.plan-step-methods { font-size: 12px; color: #475569; margin-top: 1px; }
.plan-unmapped {
    margin-top: 10px;
    padding: 8px 10px;
    background: #fef3c7;
    border: 1px dashed #fbbf24;
    border-radius: 8px;
    font-size: 12px;
    color: #78350f;
    display: flex;
    align-items: center;
    gap: 6px;
}
.plan-unmapped .material-icons { font-size: 14px; }
[data-theme="dark"] .plan-preview-card {
    background: #0e2a3a;
    border-color: #1e3a5f;
}
[data-theme="dark"] .plan-preview-header { color: #7dd3fc; }
[data-theme="dark"] .plan-step-title { color: #e2e8f0; }
[data-theme="dark"] .plan-step-methods { color: #94a3b8; }
[data-theme="dark"] .plan-unmapped {
    background: #422006;
    border-color: #92400e;
    color: #fde68a;
}

/* Provenance chips on the lead card. Neutral - provider names never appear,
   the labels here have been translated server-side through ProviderLabelMap. */
.lead-prov-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.lead-prov-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    font-size: 10.5px;
    font-weight: 500;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    line-height: 1.4;
    white-space: nowrap;
}
.lead-prov-chip .material-icons {
    font-size: 11px;
    color: #16a34a;
}
.lead-prov-chip-fresh .material-icons {
    color: #0ea5e9;
}
/* "Verified by N sources" - only renders when AUTO multi-engine merge
   confirms a lead from 2+ independent sources. Stronger color so it
   reads as a quality marker. */
.lead-prov-chip-strong {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
    font-weight: 600;
}
.lead-prov-chip-strong .material-icons { color: #16a34a; }
[data-theme="dark"] .lead-prov-chip-strong {
    background: #052e1a;
    border-color: #14532d;
    color: #86efac;
}
[data-theme="dark"] .lead-prov-chip {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

.lead-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lead-title {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.lead-company {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.lead-intent {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

    .lead-intent.intent-high {
        background: #dcfce7;
        color: #166534;
    }

    .lead-intent.intent-medium {
        background: #fef3c7;
        color: #92400e;
    }

    .lead-intent.intent-low {
        background: #f3f4f6;
        color: #6b7280;
    }

[data-theme="dark"] .lead-intent.intent-high {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

[data-theme="dark"] .lead-intent.intent-medium {
    background: rgba(251, 191, 36, 0.2);
    color: #fde047;
}

[data-theme="dark"] .lead-intent.intent-low {
    background: rgba(156, 163, 175, 0.2);
    color: #d1d5db;
}

.lead-email,
.lead-signal {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lead-description {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 12px;
}

.lead-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lead-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .lead-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
        background: rgba(0, 179, 201, 0.05);
    }

    .lead-btn.primary {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

        .lead-btn.primary:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0, 179, 201, 0.3);
        }

[data-theme="dark"] .lead-btn {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: var(--text-light);
}

    [data-theme="dark"] .lead-btn:hover {
        background: rgba(0, 179, 201, 0.1);
        border-color: var(--primary);
    }

/* Mobile Responsive */
@media (max-width: 768px) {
    .results-scroll-container {
        max-height: 400px;
    }

    .lead-card {
        padding: 12px;
    }

    .lead-actions {
        flex-direction: column;
    }

    .lead-btn {
        width: 100%;
        justify-content: center;
    }
}


/* ===== SEARCH PROGRESS CARD (LOGO SPINNER) ===== */
.search-progress-card {
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 12px;
}

[data-theme="dark"] .search-progress-card {
    background: transparent;
    border-color: none;
}

/* Logo Spinner */
.search-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.search-logo-spin {
    width: 48px;
    height: 48px;
    animation: logoSpin 2s linear infinite;
    filter: drop-shadow(0 4px 12px rgba(0, 179, 201, 0.3));
}

@keyframes logoSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Legacy thinking message text animation */
.thinking-text {
    transition: opacity 0.2s ease-in-out;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* =========================================================================
   THINKING INDICATOR V2 - Typewriter with step log (Claude Code feel)
   ========================================================================= */

.thinking-container-v2 {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
}

.thinking-logo-wrap {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    position: relative;
}

.thinking-logo-pulse {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    animation: thinkingPulse 2s ease-in-out infinite;
}

@keyframes thinkingPulse {
    0%, 100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 2px 6px rgba(0, 179, 201, 0.2)); }
    50% { transform: scale(1.08); opacity: 0.85; filter: drop-shadow(0 4px 14px rgba(0, 179, 201, 0.4)); }
}

.thinking-steps-area {
    flex: 1;
    min-width: 0;
}

.thinking-steps-log {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.thinking-log-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #94a3b8;
    animation: thinkingLogIn 0.3s ease-out;
    line-height: 1.4;
}

.thinking-log-line.thinking-log-fadeout {
    animation: thinkingLogOut 0.2s ease-in forwards;
}

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

@keyframes thinkingLogOut {
    from { opacity: 1; transform: translateY(0); height: auto; }
    to { opacity: 0; transform: translateY(-6px); height: 0; overflow: hidden; }
}

.thinking-current-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.thinking-step-icon {
    font-size: 16px !important;
    color: #6366f1;
    animation: thinkingIconPulse 1.5s ease-in-out infinite;
}

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

.thinking-step-text {
    min-width: 0;
}

.thinking-cursor {
    font-weight: 300;
    color: #6366f1;
    animation: thinkingBlink 0.8s step-end infinite;
    font-size: 16px;
    line-height: 1;
}

@keyframes thinkingBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Dark mode */
[data-theme="dark"] .thinking-container-v2 {
    color: #e8eaed;
}

[data-theme="dark"] .thinking-log-line {
    color: #6b7280;
}

[data-theme="dark"] .thinking-current-step {
    color: #d1d5db;
}

[data-theme="dark"] .thinking-cursor {
    color: #818cf8;
}

[data-theme="dark"] .thinking-step-icon {
    color: #818cf8;
}

/* Agentic step running typewriter */
.agentic-running-typewriter {
    color: inherit;
    font-size: inherit;
}

/* Progress Header */
.search-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

    .search-progress-header:hover {
        background: rgba(0, 179, 201, 0.05);
    }

.search-progress-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #0369a1;
}

[data-theme="dark"] .search-progress-title {
    color: #7dd3fc;
}

.search-progress-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-progress-percent {
    font-size: 13px;
    font-weight: 700;
    color: #00b3c9;
    min-width: 40px;
    text-align: right;
}

.search-progress-toggle-icon {
    font-size: 20px;
    color: #0369a1;
    transition: transform 0.3s;
}

[data-theme="dark"] .search-progress-toggle-icon {
    color: #7dd3fc;
}

/* Progress Line */
.search-progress-line {
    width: 100%;
    height: 6px;
    background: rgba(14, 165, 233, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.search-progress-line-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #00b3c9, #00e0d5);
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Expandable Details */
.search-progress-details {
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

    .search-progress-details.collapsed {
        max-height: 0;
        opacity: 0;
    }

.search-progress-steps {
    padding-top: 8px;
    border-top: 1px solid rgba(14, 165, 233, 0.2);
}

.search-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    font-size: 13px;
    color: #0369a1;
    transition: all 0.3s;
}

[data-theme="dark"] .search-step {
    color: #bae6fd;
}

.search-step.active {
    font-weight: 600;
    background: rgba(0, 179, 201, 0.05);
    border-radius: var(--radius-sm);
}

.search-step.completed {
    opacity: 0.7;
}

.search-step-icon {
    font-size: 18px;
    color: #10b981;
}

.search-step.active .search-step-icon {
    color: #00b3c9;
    animation: pulse 2s infinite;
}

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

    50% {
        opacity: 0.5;
    }
}

/* File Import Search Card */
.file-import-search-card {
    padding: 20px;
    background: transparent;
    border: none;
}

.search-progress-info {
    text-align: center;
    margin-bottom: 16px;
}

.search-progress-main-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.search-progress-subtitle {
    font-size: 13px;
    color: var(--text-light);
    max-width: 400px;
    margin: 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-progress-status {
    margin: 16px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
}

[data-theme="dark"] .search-progress-status {
    background: rgba(0, 0, 0, 0.2);
}

.search-step.pending {
    opacity: 0.5;
}

.search-step.pending .search-step-icon {
    color: var(--text-light);
}

.search-progress-estimate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
    padding-top: 12px;
    border-top: 1px solid rgba(0, 179, 201, 0.15);
}

.search-progress-estimate .material-icons {
    font-size: 16px;
    color: var(--primary);
}

.search-progress-animated {
    animation: progressFill 3s ease-in-out infinite;
}

@keyframes progressFill {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 95%;
    }
}

.rotating-slow {
    animation: spin 2s linear infinite;
}

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

/* ===== STREAMING RESULTS STYLES ===== */
.streaming-results-message .results-summary-card.streaming {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-light, #e6f7f9) 100%);
    border: 1px solid var(--primary);
    animation: streamingPulse 2s ease-in-out infinite;
}

@keyframes streamingPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 179, 201, 0.2);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 179, 201, 0);
    }
}

.streaming-results-message .results-summary-icon.streaming {
    background: var(--primary);
    color: white;
}

.streaming-indicator {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Old streaming-cards definition removed - see below for updated version */

.streaming-card-wrapper {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.streaming-card-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

.streaming-card-wrapper.fade-in {
    animation: fadeInUp 0.4s ease forwards;
}

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

/* Ensure streaming expanded view is always visible during streaming */
.streaming-results-message .results-expanded-view {
    max-height: none !important;
    overflow: visible;
    display: block !important;
}

/* When streaming is complete, allow normal collapse behavior */
.results-expanded-view.collapsed {
    max-height: 0;
    overflow: hidden;
    padding: 0;
}

/* Streaming cards container styling */
.streaming-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 16px;
}

/* Ensure lead cards in streaming container look right */
.streaming-card-wrapper .lead-card {
    margin-bottom: 0;
}

/* Streaming table rows animation */
.streaming-row {
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.streaming-row.visible {
    opacity: 1;
}

.streaming-row.fade-in {
    animation: tableRowFadeIn 0.4s ease forwards;
}

@keyframes tableRowFadeIn {
    from {
        opacity: 0;
        background-color: rgba(99, 102, 241, 0.1);
    }
    to {
        opacity: 1;
        background-color: transparent;
    }
}

/* Table icon styling */
.table-icon {
    font-size: 18px;
    color: #64748b;
    margin-right: 4px;
}

.table-icon:hover {
    color: #6366f1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-logo-spin {
        width: 40px;
        height: 40px;
    }

    .search-progress-header {
        padding: 6px;
    }

    .search-progress-title {
        font-size: 13px;
    }

    .search-step {
        font-size: 12px;
        padding: 6px;
    }
}

/* ===== RESULTS EXPANDABLE SECTION ===== */
.results-expandable-section {
    width: 100%;
}

/* ===== RESULTS SUMMARY CARD (COMPACT VIEW) ===== */
.results-summary-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 0;
}

[data-theme="dark"] .results-summary-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

.results-summary-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.results-summary-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #00b3c9, #00e0d5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .results-summary-icon .material-icons {
        color: white;
        font-size: 24px;
    }

.results-summary-info {
    flex: 1;
}

.results-summary-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.results-summary-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.results-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px; /* SMALLER padding */
    font-size: 13px; /* SMALLER font */
    font-weight: 600;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    width: auto; /* NOT full width */
}

    .results-expand-btn:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 179, 201, 0.3);
    }

    .results-expand-btn .material-icons {
        font-size: 18px;
    }

/* ===== EXPANDED TABLE VIEW ===== */
.results-expanded-view {
    max-height: 800px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
    margin-top: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

    .results-expanded-view.collapsed {
        max-height: 0;
        opacity: 0;
        margin-top: 0;
    }

[data-theme="dark"] .results-expanded-view {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

.results-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

[data-theme="dark"] .results-table-header {
    background: #2a2a2a;
}

.results-table-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

    .results-table-title .material-icons {
        color: var(--primary);
        font-size: 22px;
    }

.results-table-actions {
    display: flex;
    gap: 8px;
}

.results-table-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .results-table-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .results-table-btn.primary {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

        .results-table-btn.primary:hover {
            background: var(--primary-dark);
        }

[data-theme="dark"] .results-table-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

.results-table-btn .material-icons {
    font-size: 16px;
}

/* ===== TABLE STYLES ===== */
.results-table-container {
    max-height: 600px;
    overflow-y: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

    .results-table thead {
        position: sticky;
        top: 0;
        background: var(--bg-light);
        z-index: 10;
    }

[data-theme="dark"] .results-table thead {
    background: #2a2a2a;
}

.results-table th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-dark);
}

.results-table tbody tr:hover {
    background: var(--bg-light);
}

[data-theme="dark"] .results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-lead-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.table-lead-title {
    font-size: 12px;
    color: var(--text-muted);
}

.table-intent-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .table-intent-badge.intent-high {
        background: #dcfce7;
        color: #166534;
    }

    .table-intent-badge.intent-medium {
        background: #fef3c7;
        color: #92400e;
    }

    .table-intent-badge.intent-low {
        background: #f3f4f6;
        color: #6b7280;
    }

[data-theme="dark"] .table-intent-badge.intent-high {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

[data-theme="dark"] .table-intent-badge.intent-medium {
    background: rgba(251, 191, 36, 0.2);
    color: #fde047;
}

[data-theme="dark"] .table-intent-badge.intent-low {
    background: rgba(156, 163, 175, 0.2);
    color: #d1d5db;
}

.table-icon {
    font-size: 18px;
    color: var(--text-muted);
    margin-right: 4px;
    cursor: help;
}

.table-actions {
    display: flex;
    gap: 6px;
}

.table-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .table-action-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .table-action-btn.primary {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }

        .table-action-btn.primary:hover {
            background: var(--primary-dark);
        }

    .table-action-btn .material-icons {
        font-size: 16px;
    }

[data-theme="dark"] .table-action-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

/* ===== TABLE FOOTER ===== */
.results-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

[data-theme="dark"] .results-table-footer {
    background: #2a2a2a;
}

.results-table-footer span {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.results-collapse-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .results-collapse-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

[data-theme="dark"] .results-collapse-btn {
    background: #1a1a1a;
    border-color: #3a3a3a;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .results-table-container {
        max-height: 400px;
    }

    .results-table th,
    .results-table td {
        padding: 8px;
        font-size: 12px;
    }

    .results-table-actions {
        flex-direction: column;
    }

    .results-table-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .table-actions {
        flex-direction: column;
    }
}

/* ===== RESULTS EXPANDABLE SECTION ===== */
.results-expandable-section {
    width: 100%;
}

/* ===== RESULTS SUMMARY CARD (COMPACT) ===== */
.results-summary-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 0;
}

[data-theme="dark"] .results-summary-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

.results-summary-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.results-summary-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #00b3c9, #00e0d5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .results-summary-icon .material-icons {
        color: white;
        font-size: 24px;
    }

.results-summary-info {
    flex: 1;
}

.results-summary-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.results-summary-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.results-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

    .results-expand-btn:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
    }

/* ===== EXPANDED VIEW ===== */
.results-expanded-view {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
    margin-top: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

    .results-expanded-view.collapsed {
        max-height: 0;
        opacity: 0;
        margin-top: 0;
    }

[data-theme="dark"] .results-expanded-view {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

/* ===== VIEW TOGGLE HEADER ===== */
.results-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

[data-theme="dark"] .results-view-header {
    background: #2a2a2a;
}

.results-view-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

    .results-view-title .material-icons {
        color: var(--primary);
        font-size: 22px;
    }

.results-view-toggle {
    display: flex;
    gap: 8px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
}

[data-theme="dark"] .results-view-toggle {
    background: #1a1a1a;
    border-color: #3a3a3a;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .view-toggle-btn:hover {
        color: var(--primary);
    }

    .view-toggle-btn.active {
        background: var(--primary);
        color: white;
    }

    .view-toggle-btn .material-icons {
        font-size: 16px;
    }

/* ===== CARDS VIEW ===== */
.results-cards-view {
    padding: 16px;
}

.results-scroll-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

    /* Custom scrollbar */
    .results-scroll-container::-webkit-scrollbar {
        width: 8px;
    }

    .results-scroll-container::-webkit-scrollbar-track {
        background: var(--bg-light);
    }

    .results-scroll-container::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }

        .results-scroll-container::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

/* ===== TABLE VIEW ===== */
.results-table-view {
    padding: 16px 20px;
}

.results-table-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.results-table-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .results-table-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .results-table-btn.primary {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

        .results-table-btn.primary:hover {
            background: var(--primary-dark);
        }

[data-theme="dark"] .results-table-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

.results-table-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

    .results-table thead {
        position: sticky;
        top: 0;
        background: var(--bg-light);
        z-index: 10;
    }

[data-theme="dark"] .results-table thead {
    background: #2a2a2a;
}

.results-table th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-dark);
}

.results-table tbody tr:hover {
    background: var(--bg-light);
}

[data-theme="dark"] .results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-lead-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.table-lead-title {
    font-size: 12px;
    color: var(--text-muted);
}

.table-intent-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .table-intent-badge.intent-high {
        background: #dcfce7;
        color: #166534;
    }

    .table-intent-badge.intent-medium {
        background: #fef3c7;
        color: #92400e;
    }

    .table-intent-badge.intent-low {
        background: #f3f4f6;
        color: #6b7280;
    }

[data-theme="dark"] .table-intent-badge.intent-high {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

[data-theme="dark"] .table-intent-badge.intent-medium {
    background: rgba(251, 191, 36, 0.2);
    color: #fde047;
}

[data-theme="dark"] .table-intent-badge.intent-low {
    background: rgba(156, 163, 175, 0.2);
    color: #d1d5db;
}

.table-icon {
    font-size: 18px;
    color: var(--text-muted);
    margin-right: 4px;
}

.table-actions {
    display: flex;
    gap: 6px;
}

.table-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .table-action-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .table-action-btn.primary {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }

        .table-action-btn.primary:hover {
            background: var(--primary-dark);
        }

    .table-action-btn .material-icons {
        font-size: 16px;
    }

[data-theme="dark"] .table-action-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

.results-table-footer {
    padding: 12px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ===== COLLAPSE FOOTER ===== */
.results-collapse-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.results-collapse-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .results-collapse-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

[data-theme="dark"] .results-collapse-btn {
    background: #1a1a1a;
    border-color: #3a3a3a;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .results-view-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .results-view-toggle {
        width: 100%;
    }

    .view-toggle-btn {
        flex: 1;
        justify-content: center;
    }

    .results-table-container {
        max-height: 400px;
    }

    .results-scroll-container {
        max-height: 400px;
    }
}


/* ===== SMALLER ACTION BUTTONS ===== */
.results-action-buttons {
    display: flex;
    gap: 8px;
}

.results-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

    .results-action-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
        transform: translateY(-1px);
    }

    .results-action-btn.primary {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

        .results-action-btn.primary:hover {
            background: var(--primary-dark);
            box-shadow: 0 2px 8px rgba(0, 179, 201, 0.3);
        }

    .results-action-btn .material-icons {
        font-size: 18px;
    }

[data-theme="dark"] .results-action-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

/* ===== FULLSCREEN TABLE MODAL ===== */
.results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

    .results-modal.active {
        display: flex;
    }

.results-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.results-modal-content {
    position: relative;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

[data-theme="dark"] .results-modal-content {
    background: #1a1a1a;
}

.results-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

[data-theme="dark"] .results-modal-header {
    background: #2a2a2a;
}

.results-modal-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

    .results-modal-title .material-icons {
        font-size: 32px;
        color: var(--primary);
    }

    .results-modal-title h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
        color: var(--text-dark);
    }

    .results-modal-title p {
        margin: 4px 0 0 0;
        font-size: 13px;
        color: var(--text-muted);
    }

.results-modal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.results-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .results-modal-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .results-modal-btn.primary {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

        .results-modal-btn.primary:hover {
            background: var(--primary-dark);
        }

[data-theme="dark"] .results-modal-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

.results-modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-light);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

    .results-modal-close:hover {
        background: var(--border);
    }

    .results-modal-close .material-icons {
        font-size: 24px;
        color: var(--text-dark);
    }

.results-modal-table-container {
    flex: 1;
    overflow: auto;
    padding: 0;
}

    .results-modal-table-container .results-table {
        width: 100%;
    }

/* Mobile Responsive */
@media (max-width: 768px) {
    .results-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .results-modal-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .results-modal-actions {
        flex-direction: column;
    }

    .results-modal-btn {
        width: 100%;
        justify-content: center;
    }

    .results-action-buttons {
        flex-direction: column;
    }
}
/* Upgrade Modal Styles */
.upgrade-modal {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.billing-toggle-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-light, #f3f4f6);
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.billing-toggle-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light, #6b7280);
    transition: all 0.2s;
}

    .billing-toggle-btn.active {
        background: white;
        color: var(--primary, #00b3c9);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

.save-badge {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-left: 6px;
}

.plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.plans-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

.plan-card-modal {
    background: var(--bg-card, white);
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: all 0.3s;
}

    .plan-card-modal:hover {
        border-color: var(--primary, #00b3c9);
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0, 179, 201, 0.15);
    }

    .plan-card-modal.popular {
        border-color: var(--primary, #00b3c9);
    }

.plan-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary, #00b3c9);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.plan-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text, #111827);
}

.plan-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary, #00b3c9);
}

    .plan-price span {
        font-size: 16px;
        font-weight: 400;
        color: var(--text-light, #6b7280);
    }

.plan-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

    .plan-features li {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 0;
        font-size: 14px;
        color: var(--text, #374151);
    }

        .plan-features li .material-icons {
            font-size: 18px;
            color: #10b981;
        }
/* Plan Select Button - Primary Teal Style */
.plan-select-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #00b3c9, #0891b2);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
}

    .plan-select-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 179, 201, 0.4);
    }

    .plan-select-btn:disabled {
        background: #9ca3af;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .plan-select-btn .material-icons {
        font-size: 18px;
    }

    /* If you want a secondary (outline) style for non-popular plans */
    .plan-select-btn.secondary {
        background: transparent;
        color: var(--primary, #00b3c9);
        border: 2px solid var(--primary, #00b3c9);
        box-shadow: none;
    }

        .plan-select-btn.secondary:hover {
            background: rgba(0, 179, 201, 0.1);
            box-shadow: none;
        }

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary, #00b3c9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

/* Remove button */
.canvas-lead-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.canvas-lead-remove {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.canvas-lead-item:hover .canvas-lead-remove {
    opacity: 1;
}

.canvas-lead-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

.canvas-lead-remove .material-icons {
    font-size: 16px;
}

/* Send email button */
.canvas-lead-email-btn {
    background: transparent;
    border: none;
    color: #00b3c9;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.canvas-lead-item:hover .canvas-lead-email-btn {
    opacity: 1;
}

.canvas-lead-email-btn:hover {
    background: #e0f7fa;
    color: #0090a3;
}

.canvas-lead-email-btn .material-icons {
    font-size: 16px;
}

/* Badges */
.canvas-lead-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.canvas-badge {
    padding: 2px 4px;
    border-radius: 3px;
}

    .canvas-badge .material-icons {
        font-size: 12px;
    }

    .canvas-badge.email {
        background: #dcfce7;
        color: #10b981;
    }

    .canvas-badge.phone {
        background: #dbeafe;
        color: #3b82f6;
    }

    .canvas-badge.linkedin {
        background: #e0f2fe;
        color: #0077b5;
    }

/* Saved list delete */
.saved-list-item {
    display: flex;
    align-items: center;
}

    .saved-list-item .nav-item-content {
        flex: 1;
        cursor: pointer;
    }

.nav-item-delete {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 4px;
    opacity: 0;
    cursor: pointer;
    margin-right: 8px;
}

.saved-list-item:hover .nav-item-delete {
    opacity: 1;
}

.nav-item-delete:hover {
    color: #ef4444;
}

.nav-item-delete .material-icons {
    font-size: 16px;
}

/* Lead detail */
.canvas-lead-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
    padding: 2px 0 0 28px;
}

    .canvas-lead-detail .material-icons {
        font-size: 12px;
    }

/* ===== CANVAS FOOTER WITH SAVE/CLEAR/EXPORT ===== */
.canvas-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.canvas-footer-info {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}

.canvas-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.canvas-footer-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
    background: white;
    color: var(--text-primary, #374151);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

    .canvas-footer-btn:hover:not(:disabled) {
        background: var(--bg-hover, #f3f4f6);
        border-color: var(--primary, #00b3c9);
    }

    .canvas-footer-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .canvas-footer-btn .material-icons {
        font-size: 18px;
    }

    /* Primary button (Save) */
    .canvas-footer-btn.primary {
        background: var(--primary, #00b3c9);
        border-color: var(--primary, #00b3c9);
        color: white;
    }

        .canvas-footer-btn.primary:hover:not(:disabled) {
            background: var(--primary-hover, #0097a7);
            border-color: var(--primary-hover, #0097a7);
        }

    /* Danger button (Clear) */
    .canvas-footer-btn.danger {
        padding: 8px 12px;
        color: #ef4444;
        border-color: #fecaca;
        background: #fef2f2;
    }

        .canvas-footer-btn.danger:hover:not(:disabled) {
            background: #fee2e2;
            border-color: #ef4444;
        }

/* ===== PROMINENT REMOVE BUTTON ON LEAD ITEMS ===== */
.canvas-lead-item {
    position: relative;
    padding: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
    transition: all 0.2s;
}

    .canvas-lead-item:hover {
        border-color: var(--primary, #00b3c9);
        box-shadow: 0 2px 8px rgba(0, 179, 201, 0.1);
    }

.canvas-lead-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

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

.canvas-lead-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.canvas-lead-company {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    margin-top: 2px;
}

.canvas-lead-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.canvas-lead-intent {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

    .canvas-lead-intent.intent-high {
        background: #dcfce7;
        color: #166534;
    }

    .canvas-lead-intent.intent-medium {
        background: #fef3c7;
        color: #92400e;
    }

    .canvas-lead-intent.intent-low {
        background: #fee2e2;
        color: #991b1b;
    }

/* ✅ ALWAYS VISIBLE REMOVE BUTTON */
.canvas-lead-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #fee2e2;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
    /* REMOVED: opacity: 0 - now always visible */
}

    .canvas-lead-remove:hover {
        background: #ef4444;
        color: white;
        transform: scale(1.1);
    }

    .canvas-lead-remove .material-icons {
        font-size: 18px;
    }

/* Contact badges */
.canvas-lead-badges {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.canvas-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
}

    .canvas-badge .material-icons {
        font-size: 12px;
    }

    .canvas-badge.email {
        background: #dcfce7;
        color: #166534;
    }

    .canvas-badge.phone {
        background: #dbeafe;
        color: #1e40af;
    }

    .canvas-badge.linkedin {
        background: #e0f2fe;
        color: #0077b5;
    }

/* Lead detail rows */
.canvas-lead-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted, #6b7280);
    padding: 4px 0 0 28px;
}

    .canvas-lead-detail .material-icons {
        font-size: 12px;
    }

/* Saved list delete button */
.saved-list-item {
    display: flex;
    align-items: center;
    position: relative;
}

    .saved-list-item .nav-item-content {
        flex: 1;
        cursor: pointer;
        padding: 10px 12px;
    }

.nav-item-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    margin-right: 8px;
    opacity: 0;
    transition: all 0.2s;
}

.saved-list-item:hover .nav-item-delete {
    opacity: 1;
}

.nav-item-delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

.nav-item-delete .material-icons {
    font-size: 16px;
}


/* =====================================================
   CSS FIXES FOR CANVAS AND RESULTS - ADD TO END OF FILE
   ===================================================== */

/* ===== FIX: RESULTS SUMMARY ACTIONS (Add All Button) ===== */
.results-summary-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.results-add-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary, #00b3c9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 179, 201, 0.25);
}

    .results-add-all-btn:hover {
        background: var(--primary-dark, #0097a7);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.35);
    }

    .results-add-all-btn .material-icons {
        font-size: 20px;
    }

.results-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    color: var(--text-dark, #374151);
    border: 1px solid var(--border, #d1d5db);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

    .results-expand-btn:hover {
        border-color: var(--primary, #00b3c9);
        color: var(--primary, #00b3c9);
        background: rgba(0, 179, 201, 0.05);
    }

    .results-expand-btn .material-icons {
        font-size: 20px;
    }

[data-theme="dark"] .results-expand-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: var(--text-light, #c5c5d2);
}

[data-theme="dark"] .results-add-all-btn {
    box-shadow: 0 2px 8px rgba(0, 212, 230, 0.3);
}

/* ===== ANALYZE CONTROLS ===== */
.results-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.analyze-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.analyze-count-select {
    padding: 8px 12px;
    border: 1px solid var(--border, #d1d5db);
    border-radius: 8px;
    background: white;
    color: var(--text-dark, #374151);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    min-width: 90px;
    transition: all 0.2s;
}

.analyze-count-select:hover {
    border-color: var(--primary, #00b3c9);
}

.analyze-count-select:focus {
    outline: none;
    border-color: var(--primary, #00b3c9);
    box-shadow: 0 0 0 3px rgba(0, 179, 201, 0.15);
}

.analyze-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.analyze-all-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

.analyze-all-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.analyze-all-btn .material-icons {
    font-size: 16px;
}

[data-theme="dark"] .analyze-count-select {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: var(--text-light, #c5c5d2);
}

[data-theme="dark"] .analyze-all-btn {
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

/* ===== FIX: CANVAS PANEL HEADER ===== */
.canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-light, #f7f9fb);
    border-bottom: 1px solid var(--border-light, #e6e9ef);
}

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

    .canvas-header-left h3,
    .canvas-header h3 {
        font-size: 16px;
        font-weight: 700;
        color: var(--text-dark, #0a0e27);
        margin: 0;
    }

.canvas-count {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--border, #e6e9ef);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* ===== FIX: CANVAS CLOSE BUTTON ===== */
.canvas-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border, #e6e9ef);
    border-radius: 8px;
    background: var(--bg-white, #ffffff);
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    transition: all 0.2s;
}

    .canvas-close-btn:hover {
        background: #fee2e2;
        border-color: #fecaca;
        color: #ef4444;
    }

    .canvas-close-btn .material-icons {
        font-size: 18px;
    }

[data-theme="dark"] .canvas-close-btn {
    background: var(--bg-card, #2f2f2f);
    border-color: var(--border, #3e3e4e);
}

    [data-theme="dark"] .canvas-close-btn:hover {
        background: rgba(239, 68, 68, 0.2);
        border-color: rgba(239, 68, 68, 0.4);
    }

/* ===== FIX: CANVAS ACTIONS BAR ===== */
.canvas-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light, #e6e9ef);
    background: var(--bg-light, #f7f9fb);
}

.canvas-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border, #e6e9ef);
    border-radius: 8px;
    background: var(--bg-white, #ffffff);
    color: var(--text-dark, #374151);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

    .canvas-action-btn:hover {
        background: var(--primary, #00b3c9);
        border-color: var(--primary, #00b3c9);
        color: white;
    }

    .canvas-action-btn .material-icons {
        font-size: 16px;
    }

/* ===== FIX: SELECT ALL CHECKBOX ===== */
.canvas-select-all {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-light, #e6e9ef);
    background: var(--bg-white, #ffffff);
}

.canvas-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark, #374151);
    cursor: pointer;
}

    .canvas-checkbox-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: var(--primary, #00b3c9);
        cursor: pointer;
    }

/* ===== FIX: CANVAS CONTENT AREA ===== */
.canvas-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-white, #ffffff);
}

.canvas-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted, #9ca3af);
}

.canvas-empty-icon {
    font-size: 56px;
    opacity: 0.3;
    margin-bottom: 16px;
    color: var(--text-muted, #9ca3af);
}

/* ===== FIX: CANVAS FOOTER ===== */
.canvas-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light, #e6e9ef);
    background: var(--bg-light, #f7f9fb);
    flex-shrink: 0;
}

.canvas-footer-info {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
}

.canvas-footer-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.canvas-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

    /* Clear button (danger) */
    .canvas-footer-btn.danger {
        padding: 10px 14px;
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #ef4444;
    }

        .canvas-footer-btn.danger:hover:not(:disabled) {
            background: #fee2e2;
            border-color: #ef4444;
        }

    /* Save button (primary) */
    .canvas-footer-btn.primary {
        background: var(--primary, #00b3c9);
        border: 1px solid var(--primary, #00b3c9);
        color: white;
        box-shadow: 0 2px 8px rgba(0, 179, 201, 0.25);
    }

        .canvas-footer-btn.primary:hover:not(:disabled) {
            background: var(--primary-dark, #0097a7);
            border-color: var(--primary-dark, #0097a7);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 179, 201, 0.35);
        }

    /* Export button (default) */
    .canvas-footer-btn:not(.primary):not(.danger) {
        background: var(--bg-white, #ffffff);
        border: 1px solid var(--border, #d1d5db);
        color: var(--text-dark, #374151);
    }

        .canvas-footer-btn:not(.primary):not(.danger):hover:not(:disabled) {
            border-color: var(--primary, #00b3c9);
            color: var(--primary, #00b3c9);
        }

    .canvas-footer-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .canvas-footer-btn .material-icons {
        font-size: 18px;
    }

/* ===== FIX: CANVAS LEAD ITEMS ===== */
.canvas-lead-item {
    position: relative;
    padding: 14px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--bg-white, #ffffff);
    transition: all 0.2s;
}

    .canvas-lead-item:hover {
        border-color: var(--primary, #00b3c9);
        box-shadow: 0 2px 8px rgba(0, 179, 201, 0.1);
    }

    .canvas-lead-item.selected {
        border-color: var(--primary, #00b3c9);
        background: linear-gradient(135deg, rgba(0,179,201,0.05) 0%, rgba(0,224,213,0.05) 100%);
    }

.canvas-lead-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.canvas-lead-checkbox {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary, #00b3c9);
    cursor: pointer;
    flex-shrink: 0;
}

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

.canvas-lead-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.canvas-lead-company {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.canvas-lead-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.canvas-lead-intent {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .canvas-lead-intent.intent-high {
        background: #dcfce7;
        color: #166534;
    }

    .canvas-lead-intent.intent-medium {
        background: #fef3c7;
        color: #92400e;
    }

    .canvas-lead-intent.intent-low {
        background: #fee2e2;
        color: #991b1b;
    }

/* Remove button - ALWAYS VISIBLE */
.canvas-lead-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #fee2e2;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .canvas-lead-remove:hover {
        background: #ef4444;
        color: white;
        transform: scale(1.1);
    }

    .canvas-lead-remove .material-icons {
        font-size: 16px;
    }

/* Contact badges */
.canvas-lead-badges {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.canvas-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

    .canvas-badge .material-icons {
        font-size: 14px;
    }

    .canvas-badge.email {
        background: #dcfce7;
        color: #166534;
    }

    .canvas-badge.phone {
        background: #dbeafe;
        color: #1e40af;
    }

    .canvas-badge.linkedin {
        background: #e0f2fe;
        color: #0077b5;
    }

/* Lead detail rows */
.canvas-lead-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    padding: 6px 0 0 30px;
}

    .canvas-lead-detail .material-icons {
        font-size: 14px;
    }

/* ===== DARK MODE FIXES ===== */
[data-theme="dark"] .canvas-header {
    background: var(--bg-light, #2f2f2f);
    border-color: var(--border, #3e3e4e);
}

[data-theme="dark"] .canvas-count {
    background: var(--bg-card, #2f2f2f);
    border-color: var(--border, #3e3e4e);
    color: var(--text-muted, #8e8ea0);
}

[data-theme="dark"] .canvas-actions {
    background: var(--bg-light, #2f2f2f);
    border-color: var(--border, #3e3e4e);
}

[data-theme="dark"] .canvas-action-btn {
    background: var(--bg-card, #2f2f2f);
    border-color: var(--border, #3e3e4e);
    color: var(--text-light, #c5c5d2);
}

[data-theme="dark"] .canvas-select-all {
    background: var(--bg-card, #212121);
    border-color: var(--border, #3e3e4e);
}

[data-theme="dark"] .canvas-content {
    background: var(--bg-white, #212121);
}

[data-theme="dark"] .canvas-footer {
    background: var(--bg-light, #2f2f2f);
    border-color: var(--border, #3e3e4e);
}

[data-theme="dark"] .canvas-footer-btn:not(.primary):not(.danger) {
    background: var(--bg-card, #2f2f2f);
    border-color: var(--border, #3e3e4e);
    color: var(--text-light, #c5c5d2);
}

[data-theme="dark"] .canvas-lead-item {
    background: var(--bg-card, #2f2f2f);
    border-color: var(--border, #3e3e4e);
}

[data-theme="dark"] .canvas-lead-name {
    color: var(--text-dark, #ececf1);
}

[data-theme="dark"] .canvas-lead-intent.intent-high {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

[data-theme="dark"] .canvas-lead-intent.intent-medium {
    background: rgba(251, 191, 36, 0.2);
    color: #fde047;
}

[data-theme="dark"] .canvas-lead-intent.intent-low {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] .canvas-lead-remove {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

    [data-theme="dark"] .canvas-lead-remove:hover {
        background: #ef4444;
        color: white;
    }

[data-theme="dark"] .canvas-lead-email-btn {
    color: #5eead4;
}

    [data-theme="dark"] .canvas-lead-email-btn:hover {
        background: rgba(0, 179, 201, 0.2);
        color: #00b3c9;
    }

[data-theme="dark"] .canvas-badge.email {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

[data-theme="dark"] .canvas-badge.phone {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

[data-theme="dark"] .canvas-badge.linkedin {
    background: rgba(0, 119, 181, 0.2);
    color: #7dd3fc;
}

/* ===== FIX: SAVED LISTS SIDEBAR ===== */
.saved-list-item {
    display: flex;
    align-items: center;
    position: relative;
    border-radius: var(--radius-sm, 12px);
    transition: all 0.2s;
}

    .saved-list-item:hover {
        background: var(--bg-light, #f7f9fb);
    }

    .saved-list-item .nav-item-content {
        flex: 1;
        cursor: pointer;
        padding: 12px;
        min-width: 0;
    }

.nav-item-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    border-radius: 6px;
    margin-right: 8px;
    opacity: 0;
    transition: all 0.2s;
}

.saved-list-item:hover .nav-item-delete {
    opacity: 1;
}

.nav-item-delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

.nav-item-delete .material-icons {
    font-size: 18px;
}

[data-theme="dark"] .saved-list-item:hover {
    background: var(--bg-card, #2f2f2f);
}

[data-theme="dark"] .nav-item-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ===== CAPACITY CHECK CARD (inline in chat) ===== */
.capacity-check-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 16px;
    max-width: 420px;
}
.capacity-check-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #0d9488;
    margin-bottom: 12px;
}
.capacity-check-header .material-icons { font-size: 18px; }
.capacity-check-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}
.capacity-metric {
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}
.capacity-metric-val { font-size: 18px; font-weight: 700; color: #0f766e; }
.capacity-metric-lbl { font-size: 10px; color: #64748b; text-transform: uppercase; }
.capacity-check-timeline {
    background: #ecfdf5;
    border-left: 3px solid #0d9488;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 8px;
}
.capacity-check-warn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #b45309;
    background: #fffbeb;
    padding: 6px 10px;
    border-radius: 6px;
}
.capacity-check-warn .material-icons { font-size: 16px; color: #f59e0b; }
[data-theme="dark"] .capacity-check-card { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .capacity-metric { background: rgba(15,118,110,0.12); border-color: rgba(15,118,110,0.25); }
[data-theme="dark"] .capacity-metric-val { color: #5eead4; }
[data-theme="dark"] .capacity-check-timeline { background: rgba(15,118,110,0.15); }
[data-theme="dark"] .capacity-check-warn { background: rgba(245,158,11,0.15); color: #fcd34d; }

/* ===== SEND SETTINGS MODAL (Smart Send Scheduler) ===== */
#sendSettingsModal .ss-help {
    color: var(--text-muted, #6b7280);
    font-size: 13px;
    margin: 0 0 16px 0;
    line-height: 1.5;
}
#sendSettingsModal .ss-section {
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding: 14px 0;
}
#sendSettingsModal .ss-section:first-of-type { border-top: none; padding-top: 4px; }
#sendSettingsModal .ss-section h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dark, #111827);
    margin: 0 0 10px 0;
}
#sendSettingsModal .ss-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
#sendSettingsModal .ss-field { margin-bottom: 12px; }
#sendSettingsModal .ss-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
    margin-bottom: 4px;
}
#sendSettingsModal .ss-field input,
#sendSettingsModal .ss-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
    background: var(--bg-card, #fff);
    color: var(--text-dark, #111827);
    font-size: 14px;
}
#sendSettingsModal .ss-field input:focus,
#sendSettingsModal .ss-field select:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
#sendSettingsModal .ss-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    margin-top: 4px;
}
#sendSettingsModal .ss-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-top: 6px;
    color: var(--text-dark, #111827);
    cursor: pointer;
}
#sendSettingsModal .ss-status {
    margin: 10px 0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}
#sendSettingsModal .ss-status-ok {
    background: #ecfdf5;
    color: #065f46;
}
#sendSettingsModal .ss-status-error {
    background: #fef2f2;
    color: #991b1b;
}
#sendSettingsModal .ss-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}
[data-theme="dark"] #sendSettingsModal .ss-section { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] #sendSettingsModal .ss-section h3 { color: #f9fafb; }
[data-theme="dark"] #sendSettingsModal .ss-field input,
[data-theme="dark"] #sendSettingsModal .ss-field select {
    background: #1f2937;
    color: #f9fafb;
    border-color: #374151;
}
[data-theme="dark"] #sendSettingsModal .ss-status-ok { background: rgba(5,150,105,0.2); color: #6ee7b7; }
[data-theme="dark"] #sendSettingsModal .ss-status-error { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* ===== SAVED LIST ACTION BUTTONS (Email / Enroll / Delete) ===== */
.saved-list-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-right: 4px;
}

.saved-list-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    border-radius: 6px;
    opacity: 0;
    transition: all 0.15s;
}

.saved-list-item:hover .saved-list-action-btn {
    opacity: 1;
}

.saved-list-action-btn:hover {
    background: #ccfbf1;            /* brand teal-100 */
    color: #0f766e;                 /* brand teal-700 */
}

.saved-list-action-btn .material-icons {
    font-size: 17px;
}

[data-theme="dark"] .saved-list-action-btn:hover {
    background: rgba(15, 118, 110, 0.2);
    color: #5eead4;
}

/* ===== MOBILE RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
    .canvas-header {
        padding: 12px 16px;
    }

    .canvas-header-left h3 {
        font-size: 14px;
    }

    .canvas-actions {
        padding: 10px 16px;
    }

    .canvas-action-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .canvas-content {
        padding: 12px;
    }

    .canvas-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .canvas-footer-info {
        width: 100%;
        text-align: center;
    }

    .canvas-footer-actions {
        width: 100%;
        justify-content: center;
    }

    .canvas-footer-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .results-summary-actions {
        flex-direction: column;
    }

    .results-add-all-btn,
    .results-expand-btn {
        width: 100%;
        justify-content: center;
    }
}


/* ===== SETTINGS MODAL - COMPLETE STYLES ===== */
.settings-modal-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Mobile/iPad portrait - Send Settings modal goes full-screen with
   a scrollable body so all fields (Send window, Rate limits, Schedule
   cap) remain reachable even when the iOS keyboard is open. */
@media (max-width: 768px) {
    .settings-modal-overlay {
        align-items: stretch;
        padding: 0;
    }
    .settings-modal-container {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        box-shadow: none;
    }
    .settings-modal-header {
        flex-shrink: 0;
        padding: 14px 16px !important;
    }
    .settings-modal-body,
    .settings-modal-container > form,
    .settings-modal-container > .settings-form,
    .settings-modal-container > *:not(.settings-modal-header):not(.settings-modal-footer) {
        flex: 1 1 auto;
        overflow-y: auto;
        padding: 16px !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    .settings-modal-footer {
        flex-shrink: 0;
        border-top: 1px solid rgba(255,255,255,0.08);
        padding: 12px 16px !important;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    /* Inputs that were too wide → let them wrap instead of cutting off */
    .settings-modal-container input,
    .settings-modal-container select {
        min-width: 0;
        max-width: 100%;
        font-size: 16px;    /* iOS won't zoom on focus at >=16 */
    }
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

    .settings-modal-header h2 {
        font-size: 20px;
        font-weight: 700;
        margin: 0;
        color: #1f2937;
    }

.settings-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

    .settings-modal-close:hover {
        background: #e5e7eb;
        color: #1f2937;
    }

.settings-modal-body {
    padding: 24px;
    overflow-y: auto;      /* scroll when content exceeds the 90vh container */
    flex: 1 1 auto;
    min-height: 0;         /* allow the flex child to shrink so overflow kicks in */
}

.settings-section {
    margin-bottom: 24px;
}

    .settings-section:last-child {
        margin-bottom: 0;
    }

.settings-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px 0;
}

/* Settings Row with Toggle */
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 12px;
}

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-icon {
    font-size: 20px;
    color: #6b7280;
}

.settings-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* Toggle Switch */
.settings-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

    .settings-toggle input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.settings-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 26px;
}

    .settings-toggle-slider:before {
        position: absolute;
        content: "";
        height: 20px;
        width: 20px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.3s;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }

.settings-toggle input:checked + .settings-toggle-slider {
    background-color: var(--primary, #00b3c9);
}

    .settings-toggle input:checked + .settings-toggle-slider:before {
        transform: translateX(22px);
    }

/* Account Info Rows */
.settings-info-row {
    display: flex;
    padding: 8px 0;
    font-size: 14px;
}

.settings-info-label {
    color: #6b7280;
    margin-right: 8px;
}

.settings-info-value {
    color: #1f2937;
    font-weight: 500;
}

/* Primary Button (Upgrade) */
.settings-btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: var(--primary, #00b3c9);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

    .settings-btn-primary:hover {
        background: var(--primary-dark, #0097a7);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
    }

/* Logout Button */
.settings-logout-form {
    margin-top: 12px;
}

.settings-btn-logout {
    width: 100%;
    padding: 14px 20px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .settings-btn-logout:hover {
        background: #fee2e2;
        border-color: #f87171;
    }

    .settings-btn-logout .material-icons {
        font-size: 18px;
    }

/* ===== DARK MODE STYLES ===== */
[data-theme="dark"] .settings-modal-container {
    background: #1f2937;
}

[data-theme="dark"] .settings-modal-header {
    border-color: #374151;
}

    [data-theme="dark"] .settings-modal-header h2 {
        color: #f9fafb;
    }

[data-theme="dark"] .settings-modal-close {
    background: #374151;
    color: #9ca3af;
}

    [data-theme="dark"] .settings-modal-close:hover {
        background: #4b5563;
        color: #f9fafb;
    }

[data-theme="dark"] .settings-section-title {
    color: #e5e7eb;
}

[data-theme="dark"] .settings-row {
    background: #374151;
}

[data-theme="dark"] .settings-icon {
    color: #9ca3af;
}

[data-theme="dark"] .settings-label {
    color: #e5e7eb;
}

[data-theme="dark"] .settings-toggle-slider {
    background-color: #4b5563;
}

[data-theme="dark"] .settings-info-label {
    color: #9ca3af;
}

[data-theme="dark"] .settings-info-value {
    color: #f9fafb;
}

[data-theme="dark"] .settings-btn-logout {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
    color: #f87171;
}

    [data-theme="dark"] .settings-btn-logout:hover {
        background: rgba(220, 38, 38, 0.25);
    }

/* ===== CONNECTORS MODAL ===== */
.connectors-modal-container {
    background: var(--bg-white, #fff);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

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

.connectors-modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.connectors-modal-body {
    overflow-y: auto;
    padding: 12px;
    flex: 1;
}

.connector-section {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.connector-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.connector-section-toggle:hover {
    background: var(--bg-light, #f8fafc);
}

.connector-section-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.connector-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark, #1f2937);
}

.connector-count {
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-light, #f1f5f9);
    color: var(--text-muted, #64748b);
    padding: 1px 7px;
    border-radius: 10px;
}

.connector-section-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.connector-add-btn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    font-family: inherit;
    font-weight: 500;
    transition: opacity 0.15s;
}

.connector-add-btn:hover {
    opacity: 0.85;
}

.connector-chevron {
    font-size: 20px;
    color: var(--text-muted, #94a3b8);
    transition: transform 0.2s;
}

.connector-section-toggle.expanded .connector-chevron {
    transform: rotate(180deg);
}

.connector-section-body {
    border-top: 1px solid var(--border, #f1f5f9);
    max-height: 240px;
    overflow-y: auto;
    transition: max-height 0.25s ease;
}

.connector-section-body.collapsed {
    max-height: 0;
    border-top: none;
    overflow: hidden;
}

.connector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    transition: background 0.1s;
}

.connector-row:hover {
    background: var(--bg-light, #f8fafc);
}

.connector-row + .connector-row {
    border-top: 1px solid var(--border, #f8fafc);
}

[data-theme="dark"] .connectors-modal-container {
    background: #1e293b;
}

[data-theme="dark"] .connectors-modal-header {
    border-color: #334155;
}

[data-theme="dark"] .connectors-modal-header h2 {
    color: #f9fafb;
}

[data-theme="dark"] .connector-section {
    border-color: #334155;
}

[data-theme="dark"] .connector-section-toggle:hover {
    background: #0f172a;
}

[data-theme="dark"] .connector-section-title {
    color: #e2e8f0;
}

[data-theme="dark"] .connector-count {
    background: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .connector-section-body {
    border-top-color: #334155;
}

[data-theme="dark"] .connector-row:hover {
    background: #0f172a;
}

[data-theme="dark"] .connector-row + .connector-row {
    border-top-color: #334155;
}

/* ===== SETTINGS MODAL STYLES ===== */
.settings-modal-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

    .settings-modal-header h2 {
        font-size: 20px;
        font-weight: 700;
        margin: 0;
        color: #1f2937;
    }

.settings-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

    .settings-modal-close:hover {
        background: #e5e7eb;
        color: #1f2937;
    }

.settings-modal-body {
    padding: 24px;
    overflow-y: auto;      /* scroll when content exceeds the 90vh container */
    flex: 1 1 auto;
    min-height: 0;         /* allow the flex child to shrink so overflow kicks in */
}

.settings-section {
    margin-bottom: 24px;
}

    .settings-section:last-child {
        margin-bottom: 0;
    }

.settings-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px 0;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 12px;
}

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-icon {
    font-size: 20px;
    color: #6b7280;
}

.settings-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* Toggle Switch */
.settings-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

    .settings-toggle input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.settings-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 26px;
}

    .settings-toggle-slider:before {
        position: absolute;
        content: "";
        height: 20px;
        width: 20px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.3s;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }

.settings-toggle input:checked + .settings-toggle-slider {
    background-color: var(--primary, #00b3c9);
}

    .settings-toggle input:checked + .settings-toggle-slider:before {
        transform: translateX(22px);
    }

/* Account Info */
.settings-info-row {
    display: flex;
    padding: 8px 0;
    font-size: 14px;
}

.settings-info-label {
    color: #6b7280;
    margin-right: 8px;
}

.settings-info-value {
    color: #1f2937;
    font-weight: 500;
}

/* Settings Buttons */
.settings-btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: var(--primary, #00b3c9);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

    .settings-btn-primary:hover {
        background: var(--primary-dark, #0097a7);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
    }

.settings-btn-secondary {
    width: 100%;
    padding: 14px 20px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .settings-btn-secondary:hover {
        background: #e5e7eb;
        border-color: #d1d5db;
    }

    .settings-btn-secondary .material-icons {
        font-size: 18px;
    }

.settings-logout-form {
    margin-top: 12px;
}

.settings-btn-logout {
    width: 100%;
    padding: 14px 20px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .settings-btn-logout:hover {
        background: #fee2e2;
        border-color: #f87171;
    }

    .settings-btn-logout .material-icons {
        font-size: 18px;
    }

/* ===== CHANGE PASSWORD MODAL ===== */
.password-modal-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.password-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

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

.password-modal-back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

    .password-modal-back:hover {
        background: #e5e7eb;
        color: #1f2937;
    }

.password-modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1f2937;
}

.password-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

    .password-modal-close:hover {
        background: #e5e7eb;
        color: #1f2937;
    }

.password-modal-body {
    padding: 24px;
}

/* Password Form */
.password-form-group {
    margin-bottom: 20px;
}

    .password-form-group label {
        display: block;
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 8px;
    }

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

    .password-input-wrapper input {
        width: 100%;
        padding: 12px 48px 12px 16px;
        border: 2px solid #e5e7eb;
        border-radius: 10px;
        font-size: 14px;
        transition: all 0.2s;
        background: white;
        color: #1f2937;
    }

        .password-input-wrapper input:focus {
            outline: none;
            border-color: var(--primary, #00b3c9);
            box-shadow: 0 0 0 3px rgba(0, 179, 201, 0.1);
        }

        .password-input-wrapper input::placeholder {
            color: #9ca3af;
        }

.password-visibility-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

    .password-visibility-toggle:hover {
        color: #6b7280;
    }

    .password-visibility-toggle .material-icons {
        font-size: 20px;
    }

/* Password Strength */
.password-strength-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.password-strength-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: all 0.3s;
}

    .password-strength-fill.weak {
        width: 25%;
        background: #ef4444;
    }

    .password-strength-fill.fair {
        width: 50%;
        background: #f59e0b;
    }

    .password-strength-fill.good {
        width: 75%;
        background: #10b981;
    }

    .password-strength-fill.strong {
        width: 100%;
        background: #059669;
    }

.password-strength-text {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    min-width: 80px;
}

/* Password Requirements */
.password-requirements {
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
}

    .password-requirements .requirement {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 4px 0;
        font-size: 13px;
        color: #6b7280;
    }

        .password-requirements .requirement .material-icons {
            font-size: 16px;
            color: #d1d5db;
        }

        .password-requirements .requirement.met .material-icons {
            color: #10b981;
        }

        .password-requirements .requirement.met span:last-child {
            color: #374151;
        }

/* Password Match */
.password-match-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #10b981;
}

    .password-match-indicator .material-icons {
        font-size: 16px;
    }

/* Status Message */
.password-status-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .password-status-message.success {
        background: #d1fae5;
        color: #065f46;
        border: 1px solid #a7f3d0;
    }

    .password-status-message.error {
        background: #fee2e2;
        color: #991b1b;
        border: 1px solid #fecaca;
    }

/* Submit Button */
.password-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--primary, #00b3c9);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

    .password-submit-btn:hover:not(:disabled) {
        background: var(--primary-dark, #0097a7);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
    }

    .password-submit-btn:disabled {
        background: #d1d5db;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .password-submit-btn .material-icons {
        font-size: 18px;
    }

/* ===== DARK MODE ===== */
[data-theme="dark"] .settings-modal-container,
[data-theme="dark"] .password-modal-container {
    background: #1f2937;
}

[data-theme="dark"] .settings-modal-header,
[data-theme="dark"] .password-modal-header {
    border-color: #374151;
}

    [data-theme="dark"] .settings-modal-header h2,
    [data-theme="dark"] .password-modal-header h2 {
        color: #f9fafb;
    }

[data-theme="dark"] .settings-modal-close,
[data-theme="dark"] .password-modal-close,
[data-theme="dark"] .password-modal-back {
    background: #374151;
    color: #9ca3af;
}

    [data-theme="dark"] .settings-modal-close:hover,
    [data-theme="dark"] .password-modal-close:hover,
    [data-theme="dark"] .password-modal-back:hover {
        background: #4b5563;
        color: #f9fafb;
    }

[data-theme="dark"] .settings-section-title,
[data-theme="dark"] .password-form-group label {
    color: #e5e7eb;
}

[data-theme="dark"] .settings-row {
    background: #374151;
}

[data-theme="dark"] .settings-icon {
    color: #9ca3af;
}

[data-theme="dark"] .settings-label {
    color: #e5e7eb;
}

[data-theme="dark"] .settings-info-label {
    color: #9ca3af;
}

[data-theme="dark"] .settings-info-value {
    color: #f9fafb;
}

[data-theme="dark"] .settings-btn-secondary {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

    [data-theme="dark"] .settings-btn-secondary:hover {
        background: #4b5563;
    }

[data-theme="dark"] .settings-btn-logout {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
    color: #f87171;
}

    [data-theme="dark"] .settings-btn-logout:hover {
        background: rgba(220, 38, 38, 0.25);
    }

[data-theme="dark"] .password-input-wrapper input {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

    [data-theme="dark"] .password-input-wrapper input:focus {
        border-color: var(--primary, #00b3c9);
    }

    [data-theme="dark"] .password-input-wrapper input::placeholder {
        color: #6b7280;
    }

[data-theme="dark"] .password-visibility-toggle {
    color: #6b7280;
}

    [data-theme="dark"] .password-visibility-toggle:hover {
        color: #9ca3af;
    }

[data-theme="dark"] .password-strength-bar {
    background: #4b5563;
}

[data-theme="dark"] .password-requirements {
    background: #374151;
}

    [data-theme="dark"] .password-requirements .requirement {
        color: #9ca3af;
    }

        [data-theme="dark"] .password-requirements .requirement.met span:last-child {
            color: #e5e7eb;
        }

[data-theme="dark"] .password-status-message.success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .password-status-message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

/* ===== EXPORTED LIST ITEMS ===== */
.exported-list-item {
    display: flex !important;
    align-items: center;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
    margin: 2px 0;
}

    .exported-list-item:hover {
        background: var(--bg-light, #f1f5f9);
    }

    .exported-list-item .nav-item-content {
        flex: 1;
        min-width: 0;
        padding: 8px;
        cursor: pointer;
        border-radius: 6px;
    }

        .exported-list-item .nav-item-content:hover {
            background: rgba(0, 179, 201, 0.08);
        }

    .exported-list-item .nav-item-title {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px;
        font-weight: 500;
        color: var(--text-dark, #1f2937);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .exported-list-item .nav-item-title .material-icons {
            font-size: 16px;
            color: var(--primary, #00b3c9);
            flex-shrink: 0;
        }

    .exported-list-item .nav-item-subtitle {
        font-size: 11px;
        color: var(--text-muted, #6b7280);
        margin-top: 2px;
        margin-left: 22px;
    }

    /* ===== ACTION BUTTONS ===== */
    .exported-list-item .nav-item-actions {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .exported-list-item:hover .nav-item-actions {
        opacity: 1;
    }

/* Download Button */
.nav-action-download {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0f7fa;
    border: 1px solid #b2ebf2;
    border-radius: 6px;
    color: #00838f;
    cursor: pointer;
    transition: all 0.2s;
}

    .nav-action-download:hover {
        background: var(--primary, #00b3c9);
        border-color: var(--primary, #00b3c9);
        color: white;
        transform: scale(1.05);
    }

    .nav-action-download .material-icons {
        font-size: 16px;
    }

/* Delete Button */
.nav-action-delete {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    color: #c62828;
    cursor: pointer;
    transition: all 0.2s;
}

    .nav-action-delete:hover {
        background: #ef4444;
        border-color: #ef4444;
        color: white;
        transform: scale(1.05);
    }

    .nav-action-delete .material-icons {
        font-size: 16px;
    }

/* ===== DARK MODE ===== */
[data-theme="dark"] .exported-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .exported-list-item .nav-item-content:hover {
    background: rgba(0, 179, 201, 0.15);
}

[data-theme="dark"] .exported-list-item .nav-item-title {
    color: var(--text-light, #e5e7eb);
}

[data-theme="dark"] .exported-list-item .nav-item-subtitle {
    color: var(--text-muted, #9ca3af);
}

[data-theme="dark"] .nav-action-download {
    background: rgba(0, 179, 201, 0.15);
    border-color: rgba(0, 179, 201, 0.3);
    color: #4dd0e1;
}

    [data-theme="dark"] .nav-action-download:hover {
        background: var(--primary, #00b3c9);
        border-color: var(--primary, #00b3c9);
        color: white;
    }

[data-theme="dark"] .nav-action-delete {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

    [data-theme="dark"] .nav-action-delete:hover {
        background: #ef4444;
        border-color: #ef4444;
        color: white;
    }

/* ===== ALWAYS SHOW BUTTONS ON MOBILE ===== */
@media (max-width: 768px) {
    .exported-list-item .nav-item-actions {
        opacity: 1;
    }
}

/* ===== SETTINGS PROFILE FORM ===== */
.settings-profile-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .settings-form-row label {
        font-size: 13px;
        font-weight: 500;
        color: var(--text-dark, #374151);
    }

    .settings-form-row input {
        padding: 10px 12px;
        border: 2px solid #e5e7eb;
        border-radius: 8px;
        font-size: 14px;
        color: var(--text-dark, #1f2937);
        background: white;
        transition: all 0.2s;
    }

        .settings-form-row input:focus {
            outline: none;
            border-color: var(--primary, #00b3c9);
            box-shadow: 0 0 0 3px rgba(0, 179, 201, 0.1);
        }

        .settings-form-row input::placeholder {
            color: #9ca3af;
        }

.settings-btn-save {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary, #00b3c9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

    .settings-btn-save:hover {
        background: #00a0b5;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
    }

    .settings-btn-save:disabled {
        background: #9ca3af;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .settings-btn-save .material-icons {
        font-size: 18px;
    }

.settings-status {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

    .settings-status.success {
        background: #d1fae5;
        color: #065f46;
    }

    .settings-status.error {
        background: #fee2e2;
        color: #991b1b;
    }

/* ===== SIDEBAR USER SECTION ===== */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #00b3c9), #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

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

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

    .user-plan a {
        color: var(--primary, #00b3c9);
        text-decoration: none;
    }

        .user-plan a:hover {
            text-decoration: underline;
        }

.settings-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .settings-icon-btn:hover {
        background: #e5e7eb;
        color: var(--primary, #00b3c9);
    }

    .settings-icon-btn .material-icons {
        font-size: 20px;
    }

/* ===== DARK MODE ===== */
[data-theme="dark"] .settings-form-row label {
    color: #e5e7eb;
}

[data-theme="dark"] .settings-form-row input {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

    [data-theme="dark"] .settings-form-row input:focus {
        border-color: var(--primary, #00b3c9);
        box-shadow: 0 0 0 3px rgba(0, 179, 201, 0.2);
    }

    [data-theme="dark"] .settings-form-row input::placeholder {
        color: #9ca3af;
    }

[data-theme="dark"] .settings-status.success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

[data-theme="dark"] .settings-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] .sidebar-user {
    background: #111827;
    border-top-color: #374151;
}

[data-theme="dark"] .user-name {
    color: #f9fafb;
}

[data-theme="dark"] .user-plan {
    color: #9ca3af;
}

[data-theme="dark"] .settings-icon-btn {
    background: #374151;
    color: #9ca3af;
}

    [data-theme="dark"] .settings-icon-btn:hover {
        background: #4b5563;
        color: var(--primary, #00b3c9);
    }

/* ===== SETTINGS PROFILE STATUS ===== */
.settings-status {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    margin-top: 8px;
}

    .settings-status.success {
        background: #d1fae5;
        color: #065f46;
    }

    .settings-status.error {
        background: #fee2e2;
        color: #991b1b;
    }

[data-theme="dark"] .settings-status.success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

[data-theme="dark"] .settings-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ===== SETTINGS MODAL OVERLAY FIX ===== */
.settings-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

    .settings-modal-overlay.active {
        display: flex !important;
    }

/* ===== SETTINGS INFO ROW WITH EDIT BUTTON ===== */
.settings-info-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

    .settings-info-row:last-of-type {
        border-bottom: none;
    }

.settings-label {
    font-size: 14px;
    color: #6b7280;
    min-width: 60px;
}

.settings-value {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.settings-edit-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

    .settings-edit-btn:hover {
        background: var(--primary, #00b3c9);
        border-color: var(--primary, #00b3c9);
        color: white;
    }

    .settings-edit-btn .material-icons {
        font-size: 16px;
    }

/* ===== PROFILE EDIT MODAL (MINI MODAL) ===== */
.profile-edit-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

    .profile-edit-overlay.active {
        display: flex !important;
    }

.profile-edit-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.profile-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

    .profile-edit-header h3 {
        font-size: 16px;
        font-weight: 600;
        color: #1f2937;
        margin: 0;
    }

.profile-edit-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

    .profile-edit-close:hover {
        background: #e5e7eb;
        color: #1f2937;
    }

    .profile-edit-close .material-icons {
        font-size: 18px;
    }

.profile-edit-body {
    padding: 20px;
}

.profile-edit-row {
    margin-bottom: 16px;
}

    .profile-edit-row:last-of-type {
        margin-bottom: 0;
    }

    .profile-edit-row label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: #6b7280;
        margin-bottom: 6px;
    }

    .profile-edit-row input {
        width: 100%;
        padding: 10px 14px;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        font-size: 14px;
        color: #1f2937;
        background: #f9fafb;
        transition: all 0.2s;
        box-sizing: border-box;
    }

        .profile-edit-row input:focus {
            outline: none;
            border-color: var(--primary, #00b3c9);
            background: white;
            box-shadow: 0 0 0 3px rgba(0, 179, 201, 0.1);
        }

.profile-edit-status {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

    .profile-edit-status.success {
        background: #d1fae5;
        color: #065f46;
    }

    .profile-edit-status.error {
        background: #fee2e2;
        color: #991b1b;
    }

.profile-edit-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    background: #f9fafb;
    border-top: 1px solid #f0f0f0;
}

.profile-edit-cancel {
    flex: 1;
    padding: 10px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

    .profile-edit-cancel:hover {
        background: #f3f4f6;
        border-color: #d1d5db;
    }

.profile-edit-save {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--primary, #00b3c9);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

    .profile-edit-save:hover {
        background: #00a0b5;
    }

    .profile-edit-save:disabled {
        background: #9ca3af;
        cursor: not-allowed;
    }

    .profile-edit-save .material-icons {
        font-size: 18px;
    }

/* ===== DARK MODE FOR PROFILE EDIT ===== */
[data-theme="dark"] .settings-info-row {
    border-bottom-color: #374151;
}

[data-theme="dark"] .settings-label {
    color: #9ca3af;
}

[data-theme="dark"] .settings-value {
    color: #f9fafb;
}

[data-theme="dark"] .settings-edit-btn {
    border-color: #4b5563;
    color: #9ca3af;
}

[data-theme="dark"] .profile-edit-container {
    background: #1f2937;
}

[data-theme="dark"] .profile-edit-header {
    border-bottom-color: #374151;
}

    [data-theme="dark"] .profile-edit-header h3 {
        color: #f9fafb;
    }

[data-theme="dark"] .profile-edit-close {
    background: #374151;
    color: #9ca3af;
}

    [data-theme="dark"] .profile-edit-close:hover {
        background: #4b5563;
        color: #f9fafb;
    }

[data-theme="dark"] .profile-edit-row label {
    color: #9ca3af;
}

[data-theme="dark"] .profile-edit-row input {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

    [data-theme="dark"] .profile-edit-row input:focus {
        background: #1f2937;
    }

[data-theme="dark"] .profile-edit-footer {
    background: #111827;
    border-top-color: #374151;
}

[data-theme="dark"] .profile-edit-cancel {
    background: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

    [data-theme="dark"] .profile-edit-cancel:hover {
        background: #4b5563;
    }

[data-theme="dark"] .profile-edit-status.success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

[data-theme="dark"] .profile-edit-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ===== WELCOME MESSAGE ===== */
.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    max-width: 720px;
    margin: 0 auto;
}

.welcome-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

/* ===== WELCOME LOGO WITH SLOW SPIN ===== */
.welcome-logo {
    width: 48px;
    height: 48px;
    animation: slowSpin 8s linear infinite;
}

@keyframes slowSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Optional: Pause spin on hover */
.welcome-logo:hover {
    animation-play-state: paused;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin: 0;
    line-height: 1.3;
}

.welcome-greeting {
    color: var(--primary, #00b3c9);
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-muted, #6b7280);
    margin: 0 0 40px 0;
    max-width: 480px;
}

/* ===== WELCOME PROMPT SUGGESTIONS - SINGLE ROW PILLS ===== */
.welcome-examples {
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.examples-label {
    font-size: 10px;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 500;
}

.example-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: center;
}

.example-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    white-space: nowrap;
}

    .example-card:hover {
        background: var(--bg-secondary, #f8fafc);
        border-color: var(--primary, #00b3c9);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.15);
        transform: translateY(-2px);
    }

.example-icon {
    font-size: 16px;
    line-height: 1;
}

.example-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
}

/* Remove these - no longer needed */
.example-content,
.example-desc {
    display: none;
}
/* ===== DARK MODE - WELCOME SECTION ===== */
[data-theme="dark"] .welcome-title {
    color: #f1f5f9;
}

[data-theme="dark"] .welcome-greeting {
    color: var(--primary, #00b3c9);
}

[data-theme="dark"] .examples-label {
    color: #64748b;
}

[data-theme="dark"] .example-card {
    background: #1e293b;
    border-color: #334155;
}

    [data-theme="dark"] .example-card:hover {
        background: #334155;
        border-color: var(--primary, #00b3c9);
    }

[data-theme="dark"] .example-title {
    color: #e2e8f0;
}

[data-theme="dark"] .example-desc {
    color: #64748b;
}

/* =====================================================================
   ANONYMOUS USER STYLES
   Add these to your chat.css file
   ===================================================================== */

/* ========================================
   ANONYMOUS BANNER
   ======================================== */
.anonymous-banner {
    display: none;
    align-items: center;
    padding: 10px 16px;
    margin: 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

    .anonymous-banner.info {
        background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
        color: #0369a1;
    }

    .anonymous-banner.warning {
        background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
        color: #92400e;
    }

[data-theme="dark"] .anonymous-banner.info {
    background: linear-gradient(135deg, #0c4a6e 0%, #1e3a5f 100%);
    color: #7dd3fc;
}

[data-theme="dark"] .anonymous-banner.warning {
    background: linear-gradient(135deg, #78350f 0%, #451a03 100%);
    color: #fcd34d;
}

.anonymous-banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

    .anonymous-banner-content .material-icons {
        font-size: 18px;
    }

    .anonymous-banner-content a {
        color: var(--primary);
        font-weight: 600;
        text-decoration: none;
    }

        .anonymous-banner-content a:hover {
            text-decoration: underline;
        }

/* ========================================
   SIGNUP MODAL
   ======================================== */
.signup-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .signup-modal.active {
        opacity: 1;
        visibility: visible;
    }

.signup-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.signup-modal-content {
    position: relative;
    background: var(--bg-white);
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
    text-align: center;
}

.signup-modal.active .signup-modal-content {
    transform: scale(1) translateY(0);
}

.signup-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

    .signup-modal-close:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

.signup-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #0ea5e9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .signup-modal-icon .material-icons {
        font-size: 32px;
        color: white;
    }

.signup-modal-content h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.signup-modal-content > p {
    margin: 0 0 20px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

.signup-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    text-align: left;
}

    .signup-benefits li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        color: var(--text-secondary);
        font-size: 14px;
    }

        .signup-benefits li .material-icons {
            font-size: 20px;
            color: #10b981;
        }

.signup-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-signup-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-signup-primary:hover {
        background: var(--primary-dark, #2563eb);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    }

    .btn-signup-primary .material-icons {
        font-size: 20px;
    }

.btn-login-secondary {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
}

    .btn-login-secondary:hover {
        color: var(--primary);
        text-decoration: underline;
    }

/* ========================================
   REDACTED LEAD CARD ELEMENTS
   ======================================== */
.lead-redacted {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin-top: 12px;
    background: var(--bg-hover);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

    .lead-redacted .material-icons {
        font-size: 16px;
        color: var(--primary);
    }

/* Blur effect for locked content */
.lead-card.redacted .lead-email,
.lead-card.redacted .lead-linkedin,
.lead-card.redacted .lead-website {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

/* ========================================
   RESULTS SIGNUP PROMPT (in canvas)
   ======================================== */
.results-signup-prompt {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, var(--bg-white) 30%);
    padding: 24px 16px 16px;
}

.results-signup-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

    .results-signup-content .material-icons {
        font-size: 18px;
    }

.btn-small-signup {
    padding: 6px 16px;
    background: white;
    color: var(--primary);
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

    .btn-small-signup:hover {
        background: #f0f9ff;
        transform: translateY(-1px);
    }

/* ========================================
   DISABLED STATE FOR INPUTS
   ======================================== */
.input-field:disabled {
    background: var(--bg-hover);
    cursor: not-allowed;
    opacity: 0.7;
}

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

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .signup-modal-content {
        padding: 24px;
        margin: 16px;
    }

        .signup-modal-content h2 {
            font-size: 20px;
        }

    .signup-benefits li {
        font-size: 13px;
    }

    .anonymous-banner {
        padding: 8px 12px;
        font-size: 12px;
    }

    .anonymous-banner-content {
        flex-wrap: wrap;
        text-align: center;
    }
}


/* Mobile - allow wrap on small screens */
@media (max-width: 768px) {
    .example-cards {
        flex-wrap: wrap;
    }

    .example-card {
        padding: 8px 14px;
    }

    .example-title {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .example-card {
        padding: 8px 12px;
    }

    .example-title {
        font-size: 11px;
    }
}
/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .welcome-message {
        padding: 40px 16px;
    }

    .welcome-header {
        flex-direction: column;
        gap: 8px;
    }

    .welcome-wave {
        font-size: 32px;
    }

    .welcome-title {
        font-size: 22px;
    }

    .welcome-subtitle {
        font-size: 14px;
        margin-bottom: 32px;
    }

    .example-cards {
        flex-wrap: wrap;
        gap: 10px;
    }

    .example-card {
        padding: 14px;
        white-space: normal;
    }

    .example-icon {
        font-size: 24px;
    }

    .example-title {
        font-size: 13px;
    }

    .example-desc {
        font-size: 12px;
    }
}

/* ================================================================ */
/* UPGRADE MODAL WITH TOKEN BUNDLES - ADD TO chat.css              */
/* ================================================================ */

/* Main Tab Toggle (Subscriptions vs Tokens) */
.upgrade-tab-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--bg-light, #f3f4f6);
    border-radius: 12px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

[data-theme="dark"] .upgrade-tab-toggle {
    background: var(--bg-dark, #374151);
}

.upgrade-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .upgrade-tab-btn:hover {
        color: var(--text-primary, #111827);
        background: rgba(0, 179, 201, 0.1);
    }

    .upgrade-tab-btn.active {
        background: var(--primary, #00b3c9);
        color: white;
        box-shadow: 0 2px 8px rgba(0, 179, 201, 0.3);
    }

    .upgrade-tab-btn .material-icons {
        font-size: 18px;
    }

/* Tab Content */
.upgrade-tab-content {
    display: none;
}

    .upgrade-tab-content.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Token Balance Header */
.token-balance-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary, #00b3c9) 0%, #0891b2 100%);
    border-radius: 16px;
    margin-bottom: 24px;
    color: white;
}

.token-balance-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .token-balance-icon .material-icons {
        font-size: 24px;
    }

.token-balance-info {
    flex: 1;
}

.token-balance-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.token-balance-value {
    font-size: 28px;
    font-weight: 700;
}

    .token-balance-value span {
        font-size: 32px;
    }

/* Token Bundles Container */
.token-bundles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Token Bundle Card */
.token-bundle-card {
    background: var(--bg-primary, white);
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .token-bundle-card {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-dark, #374151);
}

.token-bundle-card:hover {
    border-color: var(--primary, #00b3c9);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 179, 201, 0.15);
}

.token-bundle-card.popular {
    border-color: var(--primary, #00b3c9);
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.2);
}

    .token-bundle-card.popular::before {
        content: 'BEST VALUE';
        position: absolute;
        top: 12px;
        right: -32px;
        background: var(--primary, #00b3c9);
        color: white;
        font-size: 10px;
        font-weight: 700;
        padding: 4px 40px;
        transform: rotate(45deg);
    }

.token-bundle-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary, #00b3c9), #0891b2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
}

    .token-bundle-icon .material-icons {
        font-size: 28px;
    }

    .token-bundle-icon i {
        font-size: 24px;
    }

.token-bundle-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 8px;
}

[data-theme="dark"] .token-bundle-name {
    color: var(--text-light, #f9fafb);
}

.token-bundle-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary, #00b3c9);
    line-height: 1;
    margin-bottom: 4px;
}

.token-bundle-unit {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    margin-bottom: 12px;
}

.token-bundle-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
}

[data-theme="dark"] .token-bundle-price {
    color: var(--text-light, #f9fafb);
}

.token-bundle-per-token {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
    margin-bottom: 16px;
}

.token-bundle-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary, #00b3c9), #0891b2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .token-bundle-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 179, 201, 0.4);
    }

    .token-bundle-btn:disabled {
        background: var(--text-muted, #9ca3af);
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .token-bundle-btn .material-icons {
        font-size: 18px;
    }

/* Token Benefits Info */
.token-benefits-info {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 16px;
    background: var(--bg-light, #f9fafb);
    border-radius: 12px;
}

[data-theme="dark"] .token-benefits-info {
    background: var(--bg-dark, #374151);
}

.token-benefit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}

    .token-benefit .material-icons {
        font-size: 18px;
        color: var(--success, #10b981);
    }

/* Loading/Error States */
.token-bundles-loading,
.token-bundles-error {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted, #6b7280);
}

    .token-bundles-error .material-icons {
        font-size: 48px;
        color: #ef4444;
        margin-bottom: 16px;
    }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .upgrade-tab-toggle {
        width: 100%;
    }

    .upgrade-tab-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
    }

        .upgrade-tab-btn .material-icons {
            font-size: 16px;
        }

    .token-bundles-container {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .token-bundle-card {
        padding: 16px;
    }

    .token-bundle-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 12px;
    }

        .token-bundle-icon .material-icons {
            font-size: 22px;
        }

    .token-bundle-amount {
        font-size: 28px;
    }

    .token-bundle-price {
        font-size: 18px;
    }

    .token-benefits-info {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .token-balance-header {
        padding: 16px;
    }

    .token-balance-value {
        font-size: 24px;
    }

        .token-balance-value span {
            font-size: 28px;
        }
}

@media (max-width: 480px) {
    .token-bundles-container {
        grid-template-columns: 1fr;
    }

    .token-bundle-card.popular::before {
        font-size: 9px;
        padding: 3px 35px;
    }
}

/* Settings Modal Header - FIX */
.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

    .settings-modal-header h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 600;
    }

/* Header Actions - Side by Side */
.settings-modal-header-actions {
    display: flex;
    flex-direction: row; /* Force horizontal layout */
    align-items: center;
    gap: 8px;
}

.settings-modal-home,
.settings-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

    .settings-modal-home:hover,
    .settings-modal-close:hover {
        background: var(--bg-light, #f3f4f6);
        color: var(--primary, #00b3c9);
    }

[data-theme="dark"] .settings-modal-home:hover,
[data-theme="dark"] .settings-modal-close:hover {
    background: var(--bg-dark, #374151);
}

.settings-modal-home .material-icons,
.settings-modal-close .material-icons {
    font-size: 22px;
}

/* ============================================================================
   INTENT SYSTEM STYLES - Add to your chat.css
   ============================================================================ */

/* ===== INTENT BADGE ON LEAD CARDS ===== */
.lead-intent-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 12px;
    min-width: 65px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .lead-intent-badge:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .lead-intent-badge .intent-score {
        font-size: 18px;
        font-weight: 700;
        line-height: 1;
    }

    .lead-intent-badge .intent-label {
        font-size: 9px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-top: 2px;
        opacity: 0.9;
    }

/* ===== LEAD SIGNALS ON CARD ===== */
.lead-signals {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0;
    padding: 10px 12px;
    background: var(--bg-light, #f8fafc);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.lead-signal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

    .lead-signal-item .signal-icon {
        flex-shrink: 0;
    }

    .lead-signal-item .signal-text {
        flex: 1;
        line-height: 1.4;
    }

/* ===== LEAD CARD HEADER UPDATE ===== */
.lead-card .lead-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

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

/* ===== GENERIC MODAL ===== */
.generic-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
}

    .generic-modal-overlay.visible {
        opacity: 1;
    }

.generic-modal {
    background: var(--bg-primary, #ffffff);
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.generic-modal-overlay.visible .generic-modal {
    transform: translateY(0) scale(1);
}

.generic-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: var(--bg-light, #f8fafc);
}

    .generic-modal-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: var(--text-primary, #1e293b);
    }

.generic-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    color: var(--text-muted, #64748b);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .generic-modal-close:hover {
        background: var(--bg-primary, #ffffff);
        color: var(--text-primary, #1e293b);
    }

.generic-modal-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

/* ===== INTENT DETAILS CONTENT ===== */
.intent-details-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.intent-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.intent-lead-info h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.intent-lead-info p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted, #64748b);
}

.intent-score-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    border-radius: 16px;
    min-width: 80px;
}

.intent-score-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.intent-score-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.intent-reasoning-section {
    background: var(--bg-light, #f8fafc);
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

    .intent-reasoning-section p {
        margin: 0;
        font-size: 14px;
        line-height: 1.6;
        color: var(--text-primary, #1e293b);
    }

.intent-section {
    margin-top: 8px;
}

    .intent-section h5 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 16px 0;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-muted, #64748b);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

        .intent-section h5 .material-icons {
            font-size: 18px;
            color: var(--primary);
        }

/* ===== INTENT SIGNALS LIST ===== */
.intent-signals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.intent-signal-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-light, #f8fafc);
    border-radius: 12px;
    transition: all 0.2s ease;
}

    .intent-signal-row:hover {
        background: var(--bg-primary, #ffffff);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .intent-signal-row .signal-icon {
        font-size: 20px;
        flex-shrink: 0;
        margin-top: 2px;
    }

.signal-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .signal-details .signal-text {
        font-size: 14px;
        color: var(--text-primary, #1e293b);
        line-height: 1.4;
    }

.signal-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.signal-strength {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    background: var(--bg-primary, #ffffff);
    padding: 2px 8px;
    border-radius: 10px;
}

.signal-time {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

/* ===== INTENT ACTIVITIES TIMELINE ===== */
.intent-activities-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 12px;
    border-left: 2px solid var(--border, #e2e8f0);
    margin-left: 8px;
}

.activity-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    position: relative;
}

    .activity-row:not(:last-child) {
        border-bottom: 1px dashed var(--border, #e2e8f0);
    }

.activity-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: -19px;
    border: 2px solid var(--bg-primary, #ffffff);
    box-shadow: 0 0 0 2px var(--border, #e2e8f0);
}

.activity-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-text {
    font-size: 14px;
    color: var(--text-primary, #1e293b);
    line-height: 1.4;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.activity-engagement {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.engagement-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    background: var(--bg-secondary, #f1f5f9);
    padding: 2px 8px;
    border-radius: 12px;
}

.engagement-stat .material-icons {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

.activity-source-link,
.signal-source-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary, #3b82f6);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.activity-source-link:hover,
.signal-source-link:hover {
    opacity: 1;
}

.activity-source-link .material-icons,
.signal-source-link .material-icons {
    font-size: 16px;
}

.view-all-activity {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #e2e8f0);
    text-align: center;
}

.view-all-activity .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ===== LEAD POSTS LIST ===== */
.lead-posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lead-post-item {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 14px;
    transition: all 0.2s;
}

.lead-post-item:hover {
    border-color: var(--primary, #00b3c9);
    box-shadow: 0 2px 8px rgba(0, 179, 201, 0.1);
}

.post-content-snippet {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary, #1e293b);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.post-engagement {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

.post-engagement .material-icons {
    color: var(--text-muted, #64748b);
}

.post-time {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
}

.post-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary, #00b3c9);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.post-link:hover {
    opacity: 1;
}

.post-link .material-icons {
    font-size: 16px;
}

/* ===== LEAD REACTIONS LIST ===== */
.lead-reactions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lead-reaction-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s;
}

.lead-reaction-item:hover {
    border-color: var(--primary, #00b3c9);
    box-shadow: 0 2px 8px rgba(0, 179, 201, 0.1);
}

.reaction-type-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.reaction-details {
    flex: 1;
    min-width: 0;
}

.reaction-content {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary, #1e293b);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reaction-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reaction-author {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    font-style: italic;
}

.reaction-time {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
}

.reaction-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary, #00b3c9);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.reaction-link:hover {
    opacity: 1;
}

.reaction-link .material-icons {
    font-size: 16px;
}

.view-all-activity .btn .material-icons {
    font-size: 18px;
}

/* ===== SIMPLIFIED INTENT UI ===== */

.intent-quick-links {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.intent-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.intent-link-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.intent-link-btn .material-icons {
    font-size: 16px;
}

.intent-lead-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.intent-summary-section {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
}

.intent-summary-section h5 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.intent-summary-section h5 .material-icons {
    font-size: 18px;
    color: var(--primary);
}

.intent-summary-text {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

/* NEW: Cleaner Intent UI Styles */
.intent-links-section {
    display: flex;
    gap: 10px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.intent-profile-link,
.intent-posts-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.intent-profile-link {
    background: #0077b5;
    color: white;
}

.intent-profile-link:hover {
    background: #005885;
    color: white;
}

.intent-posts-link {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.intent-posts-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Quick access link buttons for LinkedIn sections */
.intent-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.intent-link-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.intent-link-btn .material-icons {
    font-size: 16px;
}

.intent-profile-link .material-icons,
.intent-posts-link .material-icons {
    font-size: 18px;
}

.intent-post-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.intent-post-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.intent-post-item:hover {
    border-color: var(--primary);
    background: white;
}

.intent-post-item .post-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.intent-post-item .post-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.intent-post-item .material-icons {
    font-size: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.intent-post-item:hover .material-icons {
    color: var(--primary);
}

.intent-ai-clean-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.intent-ai-clean-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.intent-ai-clean-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.intent-ai-clean-btn .material-icons {
    font-size: 16px;
}

.rotating {
    animation: rotate 1s linear infinite;
}

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

/* Dark mode support for new intent UI */
[data-theme="dark"] .intent-profile-link {
    background: #0077b5;
}

[data-theme="dark"] .intent-posts-link {
    background: var(--dark-surface);
    color: var(--dark-text);
    border-color: var(--dark-border);
}

[data-theme="dark"] .intent-posts-link:hover {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .intent-link-btn {
    background: var(--dark-surface);
    color: var(--dark-text);
    border-color: var(--dark-border);
}

[data-theme="dark"] .intent-link-btn:hover {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .intent-post-item {
    background: var(--dark-surface);
    color: var(--dark-text);
}

[data-theme="dark"] .intent-post-item:hover {
    background: var(--dark-surface-hover);
    border-color: var(--primary);
}

[data-theme="dark"] .intent-post-item .post-text {
    color: var(--dark-text);
}

[data-theme="dark"] .intent-ai-clean-btn {
    color: var(--primary-light);
    border-color: var(--primary-light);
}

[data-theme="dark"] .intent-ai-clean-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.intent-signal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 6px;
}

.intent-signal-item .signal-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.intent-signal-item .signal-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-dark);
}

.source-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.source-link-icon:hover {
    opacity: 1;
}

.source-link-icon .material-icons {
    font-size: 16px;
}

.intent-activity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.activity-type-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.intent-activity-item .activity-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-dark);
    min-width: 150px;
}

.intent-activity-item .activity-time {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.intent-sources-section {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px;
}

.intent-sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.intent-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 12px;
    transition: all 0.2s;
}

.intent-source-chip:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.intent-source-chip .source-number {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
}

.intent-source-chip:hover .source-number {
    background: white;
    color: var(--primary);
}

.intent-source-chip .source-text {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.intent-source-chip .material-icons {
    font-size: 14px;
    opacity: 0.6;
}

.intent-source-chip:hover .material-icons {
    opacity: 1;
}

.intent-activities-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== SIGNAL CONFIDENCE & SOURCE LINK ===== */
.signal-confidence {
    font-size: 12px;
    font-weight: 600;
    color: var(--success, #16a34a);
    background: rgba(22, 163, 74, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.signal-source-link,
.activity-source-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s;
    flex-shrink: 0;
}

.signal-source-link:hover,
.activity-source-link:hover {
    color: var(--primary);
}

.signal-source-link .material-icons,
.activity-source-link .material-icons {
    font-size: 16px;
}

/* ===== ACTIVITY ROW ===== */
.intent-activity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-light, #f8fafc);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.intent-activity-row:hover {
    background: var(--bg-primary, #ffffff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.activity-type-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.activity-summary {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary, #1e293b);
    line-height: 1.4;
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
}

/* Dark mode for new elements */
[data-theme="dark"] .signal-confidence {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

[data-theme="dark"] .intent-activity-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .intent-activity-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 179, 201, 0.3);
}

[data-theme="dark"] .activity-summary {
    color: #e5e7eb;
}

[data-theme="dark"] .activity-time {
    color: #6b7280;
}

[data-theme="dark"] .intent-quick-links .intent-link-btn {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-light);
}

[data-theme="dark"] .intent-quick-links .intent-link-btn:hover {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .intent-summary-section {
    background: var(--bg-card);
}

[data-theme="dark"] .intent-signal-item,
[data-theme="dark"] .intent-activity-item {
    background: var(--bg-card);
}

[data-theme="dark"] .intent-sources-section {
    background: var(--bg-card);
}

[data-theme="dark"] .intent-source-chip {
    background: var(--bg-light);
    border-color: var(--border);
    color: var(--text-light);
}

[data-theme="dark"] .intent-source-chip:hover {
    background: var(--primary);
    color: white;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] .intent-signal-row {
    background: rgba(255, 255, 255, 0.05);
}

    [data-theme="dark"] .intent-signal-row:hover {
        background: rgba(255, 255, 255, 0.08);
    }

[data-theme="dark"] .intent-reasoning-section {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .signal-strength {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .lead-signals {
    background: rgba(255, 255, 255, 0.05);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .generic-modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }

    .generic-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .intent-header-section {
        flex-direction: column;
    }

    .intent-score-badge {
        align-self: flex-start;
        flex-direction: row;
        gap: 8px;
        padding: 8px 16px;
    }

    .intent-score-number {
        font-size: 20px;
    }

    .intent-score-label {
        margin-top: 0;
    }

    .signal-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .lead-intent-badge {
        padding: 6px 10px;
        min-width: 55px;
    }

        .lead-intent-badge .intent-score {
            font-size: 14px;
        }
}

/* Token Nudge Banner */
.token-nudge-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 16px;
    animation: slideDown 0.3s ease;
}

    .token-nudge-banner.low {
        background: linear-gradient(135deg, #fef3c7, #fde68a);
        border-bottom: 2px solid #f59e0b;
        color: #92400e;
    }

    .token-nudge-banner.empty {
        background: linear-gradient(135deg, #fee2e2, #fecaca);
        border-bottom: 2px solid #ef4444;
        color: #991b1b;
    }

.nudge-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nudge-icon {
    font-size: 24px;
}

.nudge-message {
    font-size: 14px;
    font-weight: 500;
}

.nudge-actions {
    display: flex;
    gap: 8px;
}

.nudge-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

    .nudge-btn.primary {
        background: linear-gradient(135deg, #6366f1, #4f46e5);
        color: white;
    }

    .nudge-btn.dismiss {
        background: transparent;
        color: inherit;
        padding: 8px;
    }

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================================================
   NUDGE & MODAL SYSTEM STYLES - Add to chat.css
   ============================================================================ */

/* ===== TOKEN NUDGE BANNER ===== */
.token-nudge-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 16px;
    flex-wrap: wrap;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.token-nudge-banner.low {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 2px solid #f59e0b;
    color: #92400e;
}

.token-nudge-banner.critical {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    border-bottom: 2px solid #f97316;
    color: #9a3412;
}

.token-nudge-banner.empty {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-bottom: 2px solid #ef4444;
    color: #991b1b;
}

.nudge-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.nudge-icon {
    font-size: 24px;
}

.nudge-message {
    font-size: 14px;
    font-weight: 500;
}

.nudge-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nudge-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

    .nudge-btn .material-icons {
        font-size: 16px;
    }

    .nudge-btn.primary {
        background: linear-gradient(135deg, #6366f1, #4f46e5);
        color: white;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }

        .nudge-btn.primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
        }

.nudge-dismiss {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: all 0.2s;
}

    .nudge-dismiss:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.1);
    }

/* ===== MODAL CONTENT STYLES ===== */
.insufficient-tokens-content,
.usage-limit-content,
.limit-reached-content,
.error-modal-content,
.success-modal-content {
    text-align: center;
    padding: 10px 0;
}

.token-modal-icon,
.usage-modal-icon,
.limit-modal-icon,
.error-modal-icon,
.success-modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.token-modal-icon {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

    .token-modal-icon .material-icons {
        font-size: 36px;
        color: #d97706;
    }

    .token-modal-icon.empty {
        background: linear-gradient(135deg, #fee2e2, #fecaca);
    }

        .token-modal-icon.empty .material-icons {
            color: #dc2626;
        }

.usage-modal-icon {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

    .usage-modal-icon .material-icons {
        font-size: 36px;
        color: #2563eb;
    }

.limit-modal-icon {
    background: linear-gradient(135deg, #fae8ff, #f5d0fe);
}

    .limit-modal-icon .material-icons {
        font-size: 36px;
        color: #a855f7;
    }

.error-modal-icon {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
}

    .error-modal-icon .material-icons {
        font-size: 36px;
        color: #dc2626;
    }

.success-modal-icon {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

    .success-modal-icon .material-icons {
        font-size: 36px;
        color: #16a34a;
    }

/* Modal headings */
.insufficient-tokens-content h3,
.usage-limit-content h3,
.limit-reached-content h3,
.error-modal-content h3,
.success-modal-content h3 {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Token requirement box */
.token-requirement-box {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.token-requirement-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

    .token-requirement-row:not(:last-child) {
        border-bottom: 1px solid var(--border-color);
    }

    .token-requirement-row.needed {
        color: #dc2626;
        font-weight: 600;
    }

.balance-low {
    color: #dc2626;
}

/* Usage stats box */
.usage-stats-box {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 12px;
}

.usage-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.usage-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.usage-stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Limit progress */
.limit-progress-box {
    margin-bottom: 16px;
}

.limit-progress-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.limit-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 4px;
}

.limit-progress-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* Modal messages */
.token-modal-message,
.usage-modal-message,
.limit-modal-message,
.error-modal-message,
.success-modal-message {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Token options */
.token-modal-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.token-option-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

    .token-option-card:hover {
        border-color: var(--primary);
        background: var(--bg-primary);
    }

    .token-option-card > .material-icons {
        font-size: 28px;
        color: var(--primary);
    }

.token-option-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .token-option-info strong {
        font-size: 15px;
        color: var(--text-primary);
    }

    .token-option-info span {
        font-size: 12px;
        color: var(--text-muted);
    }

.token-option-card .arrow {
    color: var(--text-muted);
}

/* Modal actions */
.token-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.token-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

    .token-modal-btn .material-icons {
        font-size: 18px;
    }

    .token-modal-btn.primary {
        background: linear-gradient(135deg, #6366f1, #4f46e5);
        color: white;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    }

        .token-modal-btn.primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
        }

    .token-modal-btn.secondary {
        background: var(--bg-light);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

        .token-modal-btn.secondary:hover {
            background: var(--bg-primary);
            border-color: var(--primary);
        }

/* Modal notes */
.token-modal-note,
.limit-reset-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    background: #f0f9ff;
    border-radius: 8px;
    font-size: 12px;
    color: #0369a1;
}

    .token-modal-note .material-icons,
    .limit-reset-note .material-icons {
        font-size: 16px;
    }

/* Modal divider */
.token-modal-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 12px;
}

    .token-modal-divider::before,
    .token-modal-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border-color);
    }

    .token-modal-divider span {
        padding: 0 16px;
    }

/* Spin animation for loading buttons */
.material-icons.spin {
    animation: spin 1s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

/* ===== DARK MODE ===== */
[data-theme="dark"] .token-nudge-banner.low {
    background: linear-gradient(135deg, #422006, #713f12);
    border-color: #ca8a04;
    color: #fef08a;
}

[data-theme="dark"] .token-nudge-banner.critical {
    background: linear-gradient(135deg, #431407, #7c2d12);
    border-color: #ea580c;
    color: #fed7aa;
}

[data-theme="dark"] .token-nudge-banner.empty {
    background: linear-gradient(135deg, #450a0a, #7f1d1d);
    border-color: #dc2626;
    color: #fecaca;
}

[data-theme="dark"] .token-modal-note,
[data-theme="dark"] .limit-reset-note {
    background: rgba(3, 105, 161, 0.2);
    color: #7dd3fc;
}

[data-theme="dark"] .token-option-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

    [data-theme="dark"] .token-option-card:hover {
        background: rgba(255, 255, 255, 0.1);
    }

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .token-nudge-banner {
        padding: 10px 16px;
    }

    .nudge-message {
        font-size: 13px;
    }

    .usage-stats-box {
        gap: 16px;
    }

    .usage-stat-value {
        font-size: 24px;
    }

    .token-modal-btn {
        padding: 12px 20px;
        font-size: 13px;
    }
}

/* ============================================================================
   TOKEN WARNING STYLES - Add to chat.css
   ============================================================================ */

/* ===== PERSISTENT TOKEN WARNING (Above Input Area) ===== */
.persistent-token-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    margin: 0 0 8px 0;
    border-radius: 10px;
    gap: 12px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.persistent-token-warning.low {
    background: linear-gradient(135deg, #fef9c3, #fef08a);
    border: 1px solid #facc15;
    color: #854d0e;
}

.persistent-token-warning.critical {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    border: 1px solid #fb923c;
    color: #9a3412;
}

.persistent-token-warning.empty {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 1px solid #f87171;
    color: #991b1b;
}

.ptw-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.ptw-icon {
    font-size: 20px;
}

.ptw-text {
    font-size: 13px;
}

    .ptw-text strong {
        font-weight: 600;
    }

.ptw-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

    .ptw-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    }

    .ptw-btn .material-icons {
        font-size: 16px;
    }

/* ===== TOKEN NEEDED MESSAGE (In Chat - Yellow/Orange, NOT Red) ===== */
.token-needed-message {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.token-needed-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    color: #92400e;
}

    .token-needed-header .material-icons {
        font-size: 28px;
    }

    .token-needed-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
    }

.token-needed-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.token-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.token-stat-label {
    font-size: 12px;
    color: #92400e;
    opacity: 0.8;
}

.token-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #92400e;
}

    .token-stat-value.low {
        color: #ea580c;
    }

    .token-stat-value.empty {
        color: #dc2626;
    }

.token-needed-text {
    margin: 0 0 20px;
    font-size: 14px;
    color: #78350f;
    line-height: 1.5;
}

.token-needed-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.token-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

    .token-action-btn .material-icons {
        font-size: 18px;
    }

    .token-action-btn.primary {
        background: linear-gradient(135deg, #6366f1, #4f46e5);
        color: white;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    }

        .token-action-btn.primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
        }

    .token-action-btn.secondary {
        background: white;
        color: #4f46e5;
        border: 2px solid #4f46e5;
    }

        .token-action-btn.secondary:hover {
            background: #f5f3ff;
        }

.token-needed-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    font-size: 12px;
    color: #78350f;
}

    .token-needed-note .material-icons {
        font-size: 16px;
        color: #22c55e;
    }

/* ===== TOP BANNER (Critical/Empty) ===== */
.token-nudge-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 16px;
    flex-wrap: wrap;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.token-nudge-banner.low {
    background: linear-gradient(135deg, #fef9c3, #fef08a);
    border-bottom: 2px solid #facc15;
    color: #854d0e;
}

.token-nudge-banner.critical {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    border-bottom: 2px solid #f97316;
    color: #9a3412;
}

.token-nudge-banner.empty {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-bottom: 2px solid #ef4444;
    color: #991b1b;
}

.nudge-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

    .nudge-content .material-icons {
        font-size: 22px;
    }

.nudge-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nudge-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

    .nudge-btn .material-icons {
        font-size: 16px;
    }

    .nudge-btn.primary {
        background: linear-gradient(135deg, #6366f1, #4f46e5);
        color: white;
    }

        .nudge-btn.primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }

.nudge-dismiss {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

    .nudge-dismiss:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.1);
    }

/* ===== DARK MODE ===== */
[data-theme="dark"] .persistent-token-warning.low {
    background: linear-gradient(135deg, #422006, #713f12);
    border-color: #ca8a04;
    color: #fef08a;
}

[data-theme="dark"] .persistent-token-warning.critical {
    background: linear-gradient(135deg, #431407, #7c2d12);
    border-color: #ea580c;
    color: #fed7aa;
}

[data-theme="dark"] .persistent-token-warning.empty {
    background: linear-gradient(135deg, #450a0a, #7f1d1d);
    border-color: #dc2626;
    color: #fecaca;
}

[data-theme="dark"] .token-needed-message {
    background: linear-gradient(135deg, #422006, #713f12);
    border-color: #ca8a04;
}

[data-theme="dark"] .token-needed-header,
[data-theme="dark"] .token-needed-text {
    color: #fef08a;
}

[data-theme="dark"] .token-stat-label {
    color: #fcd34d;
}

[data-theme="dark"] .token-stat-value {
    color: #fef08a;
}

[data-theme="dark"] .token-needed-stats {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .token-needed-note {
    background: rgba(0, 0, 0, 0.2);
    color: #fcd34d;
}

[data-theme="dark"] .token-nudge-banner.low {
    background: linear-gradient(135deg, #422006, #713f12);
    border-color: #ca8a04;
    color: #fef08a;
}

[data-theme="dark"] .token-nudge-banner.critical {
    background: linear-gradient(135deg, #431407, #7c2d12);
    border-color: #ea580c;
    color: #fed7aa;
}

[data-theme="dark"] .token-nudge-banner.empty {
    background: linear-gradient(135deg, #450a0a, #7f1d1d);
    border-color: #dc2626;
    color: #fecaca;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .persistent-token-warning {
        padding: 8px 12px;
        flex-wrap: wrap;
    }

    .ptw-text {
        font-size: 12px;
    }

    .ptw-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .token-needed-stats {
        gap: 20px;
    }

    .token-needed-actions {
        flex-direction: column;
    }

    .token-action-btn {
        justify-content: center;
        width: 100%;
    }

    .token-nudge-banner {
        padding: 10px 16px;
    }
}

/* ============================================================================
   COMPACT TOKEN NUDGE - Same width as textbox
   Replace the previous .token-input-nudge styles in your chat.css
   ============================================================================ */

/* ===== TOKEN INPUT NUDGE (Matches textbox width) ===== */
.token-input-nudge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    margin: 0 auto 8px auto; /* Center it like the input */
    max-width: 800px; /* Match your input-container max-width */
    width: calc(100% - 32px); /* Account for padding */
    border-radius: 8px;
    font-size: 13px;
    animation: nudgeFadeIn 0.2s ease;
    box-sizing: border-box;
}

@keyframes nudgeFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Low tokens (subtle yellow) */
.token-input-nudge.low {
    background: #fefce8;
    border: 1px solid #fde047;
    color: #854d0e;
}

/* Critical (orange) */
.token-input-nudge.critical {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
}

/* Empty (red) */
.token-input-nudge.empty {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.tin-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tin-icon {
    font-size: 18px;
    opacity: 0.9;
}

.tin-message {
    font-weight: 500;
}

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

.tin-btn {
    padding: 5px 12px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

    .tin-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }

.tin-dismiss {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .tin-dismiss:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.05);
    }

    .tin-dismiss .material-icons {
        font-size: 16px;
    }

/* ===== DARK MODE ===== */
[data-theme="dark"] .token-input-nudge.low {
    background: rgba(254, 240, 138, 0.1);
    border-color: rgba(250, 204, 21, 0.4);
    color: #fde047;
}

[data-theme="dark"] .token-input-nudge.critical {
    background: rgba(253, 186, 116, 0.1);
    border-color: rgba(251, 146, 60, 0.4);
    color: #fdba74;
}

[data-theme="dark"] .token-input-nudge.empty {
    background: rgba(252, 165, 165, 0.1);
    border-color: rgba(248, 113, 113, 0.4);
    color: #fca5a5;
}

[data-theme="dark"] .tin-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .token-input-nudge {
        margin: 0 12px 6px 12px;
        width: calc(100% - 24px);
        padding: 6px 12px;
        font-size: 12px;
    }

    .tin-icon {
        font-size: 16px;
    }

    .tin-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
}

/* ============================================================================
   LOADING STATES CSS - Add to chat.css
   ============================================================================ */

/* ===== BUTTON LOADING STATE ===== */
.canvas-action-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

    .canvas-action-btn.loading .material-icons.spin,
    .material-icons.spin {
        animation: spin 1s linear infinite;
    }

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

    to {
        transform: rotate(360deg);
    }
}

/* ===== INPUT DISABLED STATE ===== */
.input-wrapper.disabled {
    opacity: 0.6;
}

    .input-wrapper.disabled .input-field {
        background: var(--bg-light, #f9fafb);
        cursor: not-allowed;
    }

        .input-wrapper.disabled .input-field:disabled {
            color: var(--text-muted, #9ca3af);
        }

.input-field:disabled::placeholder {
    color: var(--text-muted, #9ca3af);
    font-style: italic;
}

/* ===== SEND BUTTON AS STOP BUTTON ===== */
.send-button.loading {
    background: #ef4444 !important;
    cursor: pointer !important;
}

    .send-button.loading:hover {
        background: #dc2626 !important;
    }

/* ===== DARK MODE ===== */
[data-theme="dark"] .input-wrapper.disabled .input-field {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .input-field:disabled::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .send-button.loading {
    background: #dc2626 !important;
}

    [data-theme="dark"] .send-button.loading:hover {
        background: #b91c1c !important;
    }

/* ============================================================================
   INTENT MODAL - DARK MODE STYLES
   Add this to your chat.css
   ============================================================================ */

/* ===== MODAL CONTAINER ===== */
[data-theme="dark"] .generic-modal {
    background: #1f2937;
    border: 1px solid #374151;
}

[data-theme="dark"] .generic-modal-header {
    background: #111827;
    border-bottom-color: #374151;
}

    [data-theme="dark"] .generic-modal-header h3 {
        color: #f9fafb;
    }

[data-theme="dark"] .generic-modal-close {
    color: #9ca3af;
}

    [data-theme="dark"] .generic-modal-close:hover {
        background: #374151;
        color: #f9fafb;
    }

[data-theme="dark"] .generic-modal-content {
    background: #1f2937;
}

/* ===== INTENT HEADER SECTION ===== */
[data-theme="dark"] .intent-lead-info h4 {
    color: #f9fafb;
}

[data-theme="dark"] .intent-lead-info p {
    color: #9ca3af;
}

/* ===== INTENT SCORE BADGE ===== */
[data-theme="dark"] .intent-score-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

    [data-theme="dark"] .intent-score-badge.high {
        background: rgba(16, 185, 129, 0.15);
        border-color: rgba(16, 185, 129, 0.3);
    }

    [data-theme="dark"] .intent-score-badge.medium {
        background: rgba(245, 158, 11, 0.15);
        border-color: rgba(245, 158, 11, 0.3);
    }

    [data-theme="dark"] .intent-score-badge.low {
        background: rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.3);
    }

[data-theme="dark"] .intent-score-number {
    color: #6ee7b7;
}

[data-theme="dark"] .intent-score-badge.medium .intent-score-number {
    color: #fcd34d;
}

[data-theme="dark"] .intent-score-badge.low .intent-score-number {
    color: #fca5a5;
}

[data-theme="dark"] .intent-score-label {
    color: #9ca3af;
}

/* ===== INTENT REASONING SECTION ===== */
[data-theme="dark"] .intent-reasoning-section {
    background: rgba(0, 179, 201, 0.1);
    border-left-color: #00b3c9;
}

    [data-theme="dark"] .intent-reasoning-section p {
        color: #e5e7eb;
    }

/* ===== INTENT SECTION HEADERS ===== */
[data-theme="dark"] .intent-section h5 {
    color: #9ca3af;
}

    [data-theme="dark"] .intent-section h5 .material-icons {
        color: #00d4e6;
    }

/* ===== INTENT SIGNALS LIST ===== */
[data-theme="dark"] .intent-signals-list {
    background: transparent;
}

[data-theme="dark"] .intent-signal-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

    [data-theme="dark"] .intent-signal-row:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(0, 179, 201, 0.3);
    }

[data-theme="dark"] .signal-details .signal-text {
    color: #e5e7eb;
}

[data-theme="dark"] .signal-strength {
    background: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
}

[data-theme="dark"] .signal-time {
    color: #6b7280;
}

/* Signal icons by type */
[data-theme="dark"] .intent-signal-row .signal-icon {
    color: #fbbf24; /* Default gold/star color */
}

/* ===== INTENT ACTIVITIES TIMELINE ===== */
[data-theme="dark"] .intent-activities-timeline {
    border-left-color: #374151;
}

[data-theme="dark"] .activity-row {
    border-bottom-color: #374151;
}

[data-theme="dark"] .activity-dot {
    border-color: #1f2937;
    box-shadow: 0 0 0 2px #374151;
}

[data-theme="dark"] .activity-text {
    color: #e5e7eb;
}

[data-theme="dark"] .activity-time {
    color: #6b7280;
}

[data-theme="dark"] .engagement-stat {
    background: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
}

[data-theme="dark"] .engagement-stat .material-icons {
    color: #9ca3af;
}

/* ===== LEAD INTENT BADGE (on cards) ===== */
[data-theme="dark"] .lead-intent-badge {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    [data-theme="dark"] .lead-intent-badge.high {
        background: rgba(16, 185, 129, 0.2);
    }

        [data-theme="dark"] .lead-intent-badge.high .intent-score {
            color: #6ee7b7;
        }

    [data-theme="dark"] .lead-intent-badge.medium {
        background: rgba(245, 158, 11, 0.2);
    }

        [data-theme="dark"] .lead-intent-badge.medium .intent-score {
            color: #fcd34d;
        }

    [data-theme="dark"] .lead-intent-badge.low {
        background: rgba(239, 68, 68, 0.2);
    }

        [data-theme="dark"] .lead-intent-badge.low .intent-score {
            color: #fca5a5;
        }

    [data-theme="dark"] .lead-intent-badge .intent-label {
        color: #9ca3af;
    }

/* ===== LEAD SIGNALS ON CARD ===== */
[data-theme="dark"] .lead-signals {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #00d4e6;
}

[data-theme="dark"] .lead-signal-item {
    color: #d1d5db;
}

/* ===== LEAD POSTS LIST (dark mode) ===== */
[data-theme="dark"] .lead-post-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .lead-post-item:hover {
    border-color: rgba(0, 212, 230, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .post-content-snippet {
    color: #e5e7eb;
}

[data-theme="dark"] .post-engagement {
    color: #9ca3af;
}

[data-theme="dark"] .post-engagement .material-icons {
    color: #9ca3af;
}

[data-theme="dark"] .post-time {
    color: #6b7280;
}

[data-theme="dark"] .post-link {
    color: #00d4e6;
}

/* ===== LEAD REACTIONS LIST (dark mode) ===== */
[data-theme="dark"] .lead-reaction-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .lead-reaction-item:hover {
    border-color: rgba(0, 212, 230, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .reaction-content {
    color: #e5e7eb;
}

[data-theme="dark"] .reaction-author {
    color: #6b7280;
}

[data-theme="dark"] .reaction-time {
    color: #6b7280;
}

[data-theme="dark"] .reaction-link {
    color: #00d4e6;
}

/* ============================================================================
   MOBILE RESPONSIVENESS FIXES - Add to END of chat.css
   ============================================================================ */

/* ===== CRITICAL: Prevent horizontal scroll on body ===== */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

.app-container {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ===== MOBILE BREAKPOINT (768px and below) ===== */
@media (max-width: 768px) {

    /* ===== APP CONTAINER - Full width, no overflow ===== */
    .app-container {
        display: flex;
        flex-direction: row;
        width: 100vw;
        max-width: 100vw;
        overflow: hidden;
        position: relative;
    }

    /* ===== CHAT AREA - Always full width on mobile ===== */
    .chat-area {
        flex: 1;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        position: relative;
        z-index: 1;
    }

    /* ===== CANVAS PANEL - Fixed overlay on mobile ===== */
    .canvas-panel {
        position: fixed !important;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        margin-right: 0 !important;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    }

        /* Canvas panel when open */
        .canvas-panel:not(.collapsed) {
            transform: translateX(0);
        }

        /* Canvas panel when collapsed */
        .canvas-panel.collapsed {
            transform: translateX(100%);
            margin-right: 0 !important;
            pointer-events: none;
        }

        .canvas-panel:not(.collapsed) {
            pointer-events: auto;
        }

    /* ===== SIDEBAR - Fixed overlay on mobile ===== */
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85vw !important;
        max-width: 320px !important;
        height: 100vh;
        height: 100dvh;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        margin-left: 0 !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    }

        /* Sidebar when open */
        .sidebar:not(.collapsed) {
            transform: translateX(0);
        }

        /* Sidebar when collapsed */
        .sidebar.collapsed {
            transform: translateX(-100%);
            margin-left: 0 !important;
        }

    /* ===== MESSAGES CONTAINER - Proper spacing ===== */
    .messages-container {
        padding: 80px 16px 16px 16px; /* Top padding for floating buttons */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .messages-inner {
        width: 100%;
        max-width: 100%;
    }

    /* ===== INPUT AREA - Full width, proper positioning ===== */
    .input-area {
        width: 100%;
        max-width: 100%;
        padding: 16px;
        box-sizing: border-box;
        position: relative;
        z-index: 10;
    }

    .input-container {
        width: 100%;
        max-width: 100%;
    }

    .input-wrapper {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .input-field {
        width: 100%;
        min-width: 0; /* Prevents flex item from overflowing */
    }

    /* ===== WELCOME MESSAGE - Prevent overflow ===== */
    .welcome-message {
        padding: 40px 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .welcome-title {
        font-size: 22px;
        word-wrap: break-word;
    }

    .example-cards {
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
    }

    .example-card {
        width: 100%;
        box-sizing: border-box;
    }

    /* ===== MESSAGE BUBBLES - Prevent overflow ===== */
    .message {
        max-width: 100%;
    }

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

    .message-bubble {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* ===== LEAD CARDS - Full width on mobile ===== */
    .lead-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* ===== RESULTS SECTION - Prevent overflow ===== */
    .results-expandable-section,
    .results-summary-card,
    .results-expanded-view {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .results-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ===== FLOATING CONTROLS - Proper positioning ===== */
    .floating-menu-toggle {
        position: fixed;
        left: 16px;
        top: 16px;
        z-index: 1002;
    }

    .token-badge {
        position: fixed;
        right: 72px;
        top: 16px;
        z-index: 999;
    }

    .floating-list-toggle {
        position: fixed;
        right: 16px;
        top: 16px;
        z-index: 999;
    }

    /* ===== SCROLL TO BOTTOM BUTTON =====
       Keep it centered above the input area. Previously `right: 16px`
       + `transform: none` parked it in the corner on top of the send
       button - collision on the 2-row mobile input. */
    .scroll-to-bottom-btn {
        bottom: 160px;
        right: 50%;
        left: auto;
        transform: translateX(50%);
    }

    /* ===== TOKEN INPUT NUDGE - Full width ===== */
    .token-input-nudge {
        width: calc(100% - 32px);
        margin: 0 16px 8px 16px;
        max-width: none;
    }

    /* ===== PERSISTENT TOKEN WARNING ===== */
    .persistent-token-warning {
        width: calc(100% - 32px);
        margin: 0 16px 8px 16px;
        max-width: none;
    }
}

/* ===== EXTRA SMALL DEVICES (480px and below) ===== */
@media (max-width: 480px) {
    .messages-container {
        padding: 72px 12px 12px 12px;
    }

    .input-area {
        padding: 12px;
    }

    .input-wrapper {
        padding: 8px 12px 8px 16px;
        min-height: 52px;
    }

    .welcome-title {
        font-size: 20px;
    }

    .welcome-subtitle {
        font-size: 14px;
    }

    .example-card {
        padding: 14px;
    }

    .example-icon {
        font-size: 22px;
    }

    .example-title {
        font-size: 13px;
    }

    .example-desc {
        font-size: 11px;
    }

    .token-badge {
        right: 64px;
        padding: 8px 14px;
    }

    .token-badge-count {
        font-size: 14px;
    }

    .floating-menu-toggle,
    .floating-list-toggle {
        width: 44px;
        height: 44px;
    }
}

/* ===== LANDSCAPE MODE ON MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .messages-container {
        padding-top: 60px;
    }

    .welcome-message {
        padding: 20px 16px;
    }

    .example-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== FIX: Prevent iOS Safari zoom on input focus ===== */
@media (max-width: 768px) {
    .input-field {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }

    input, textarea, select {
        font-size: 16px !important;
    }
}

/* ===== BACKDROP FOR MOBILE OVERLAYS ===== */
.mobile-overlay-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
}

    .mobile-overlay-backdrop.active {
        display: block;
    }

@media (max-width: 768px) {
    /* Show backdrop when canvas is open */
    .canvas-panel:not(.collapsed) ~ .mobile-overlay-backdrop,
    body.canvas-open .mobile-overlay-backdrop {
        display: block;
    }

    /* Show backdrop when sidebar is open */
    .sidebar:not(.collapsed) ~ .mobile-overlay-backdrop,
    body.sidebar-open .mobile-overlay-backdrop {
        display: block;
    }
}

/* ===== MODALS - Full screen on mobile ===== */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal,
    .modal-container,
    .settings-modal-container,
    .password-modal-container,
    .profile-edit-container,
    .upgrade-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        margin: 0;
    }

    .generic-modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
    }
}
/* ============================================================================
   CENTERED WELCOME SCREEN - Desktop & Mobile
   Add this to the END of your chat.css
   ============================================================================ */

/* ===== CHAT AREA STRUCTURE ===== */
.chat-area {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* ===== MESSAGES CONTAINER ===== */
.messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center when empty */
    overflow-y: auto;
    min-height: 0;
    padding: 24px 32px;
}

    /* Switch to top-align when messages exist */
    .messages-container.has-messages {
        justify-content: flex-start;
    }

.messages-inner {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* ===== WELCOME MESSAGE - Centered ===== */
.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 24px;
    max-width: 720px;
    margin: 0 auto;
}

.welcome-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.welcome-wave {
    font-size: 36px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.welcome-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0 0 32px 0;
    max-width: 480px;
}

.welcome-examples {
    width: 100%;
}

.examples-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.example-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.example-card {
    padding: 10px 16px;
    text-align: center;
}

/* ===== INPUT AREA - Always at bottom ===== */
.input-area {
    flex-shrink: 0;
    padding: 20px 32px 32px;
    background: var(--bg-white);
}

/* ===== MOBILE OVERRIDES ===== */
@media (max-width: 768px) {
    .messages-container {
        padding: 70px 16px 16px;
    }

        .messages-container.has-messages {
            padding-top: 80px;
        }

    .welcome-message {
        padding: 20px 16px;
    }

    .welcome-header {
        gap: 8px;
        margin-bottom: 12px;
    }

    .welcome-wave {
        font-size: 28px;
    }

    .welcome-title {
        font-size: 20px;
    }

    .welcome-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
        display: none; /* Hide on mobile to save space */
    }

    .examples-label {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .example-cards {
        flex-wrap: wrap;
        gap: 8px;
    }

    .example-card {
        padding: 10px 14px;
        white-space: normal;
    }

    .example-title {
        font-size: 12px;
    }

    /* Input glued to the bottom of the dynamic viewport. .chat-area
       already uses height:100dvh so the container shrinks when the iOS
       keyboard opens - the last flex child (.input-area) then naturally
       sits at the new bottom (top of the keyboard). Previously the
       padding-bottom was `max(20px, env(safe-area-inset-bottom))` which
       forced 20px of empty space between the input and the keyboard,
       hence the 'free-flowing' look. We now collapse that gap to ~8px
       when keyboard is open (env safe-area is 0 at that point) and
       still clear the home-bar inset when keyboard is closed. */
    .input-area {
        padding: 10px 16px 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        background: var(--bg-white);
    }
}

/* ===== VERY SMALL SCREENS ===== */
@media (max-width: 380px) {
    .welcome-title {
        font-size: 18px;
    }

    .example-card {
        padding: 10px;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .messages-container {
        padding-top: 50px;
    }

    .welcome-message {
        padding: 12px;
    }

    .example-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== EMPTY / HAS-MESSAGES STATE ===== */
.chat-area.empty-state .messages-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.chat-area.empty-state .input-area {
    flex-shrink: 0;
    background: var(--bg-white);
}

.chat-area.has-messages .input-area {
    flex-shrink: 0;
    background: var(--bg-white);
}

.chat-area.has-messages .welcome-message {
    display: none;
}

/* ============================================
   ANONYMOUS UPGRADE MODAL STYLES
   ============================================ */

.anonymous-upgrade-prompt {
    text-align: center;
    padding: 40px 20px;
    grid-column: 1 / -1;
}

.upgrade-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), #0369a1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(0, 179, 201, 0.3);
}

    .upgrade-icon-wrapper.tokens {
        background: linear-gradient(135deg, #f59e0b, #d97706);
        box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
    }

    .upgrade-icon-wrapper .material-icons {
        font-size: 40px;
        color: white;
    }

.anonymous-upgrade-prompt h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.upgrade-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0 0 32px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* Pricing Preview Card */
.pricing-preview {
    margin-bottom: 32px;
}

.pricing-preview-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    margin: 0 auto;
    position: relative;
}

.preview-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.pricing-preview-card h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 8px 0 12px;
}

.preview-price {
    margin-bottom: 20px;
}

    .preview-price .price-amount {
        font-size: 42px;
        font-weight: 800;
        color: var(--text-primary);
    }

    .preview-price .price-period {
        font-size: 16px;
        color: var(--text-muted);
    }

.preview-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

    .preview-features li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        color: var(--text-secondary);
        font-size: 14px;
    }

    .preview-features .material-icons {
        font-size: 18px;
        color: #22c55e;
    }

/* Token Pricing Info */
.token-pricing-info {
    margin-bottom: 32px;
}

.token-rate {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 12px;
    padding: 16px 24px;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 24px;
}

    .token-rate .rate-amount {
        font-size: 32px;
        font-weight: 800;
        color: #92400e;
    }

    .token-rate .rate-label {
        font-size: 14px;
        color: #b45309;
    }

.token-bundles-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}

.bundle-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 18px;
    transition: all 0.2s ease;
}

    .bundle-preview-item.popular {
        border-color: var(--primary);
        background: rgba(0, 179, 201, 0.05);
    }

    .bundle-preview-item .bundle-tokens {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 14px;
    }

    .bundle-preview-item .bundle-price {
        font-weight: 700;
        color: var(--text-primary);
        font-size: 16px;
    }

    .bundle-preview-item .bundle-savings {
        font-size: 11px;
        font-weight: 600;
        padding: 3px 8px;
        border-radius: 12px;
        background: #dcfce7;
        color: #166534;
    }

    .bundle-preview-item.popular .bundle-savings {
        background: var(--primary);
        color: white;
    }

/* CTA Buttons */
.upgrade-cta-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upgrade-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
}

    .upgrade-cta-primary:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 179, 201, 0.4);
    }

    .upgrade-cta-primary .material-icons {
        font-size: 20px;
    }

.upgrade-cta-secondary {
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .upgrade-cta-secondary:hover {
        color: var(--primary);
    }

/* Dark mode adjustments */
[data-theme="dark"] .token-rate {
    background: linear-gradient(135deg, #422006, #78350f);
}

    [data-theme="dark"] .token-rate .rate-amount {
        color: #fcd34d;
    }

    [data-theme="dark"] .token-rate .rate-label {
        color: #fbbf24;
    }

[data-theme="dark"] .bundle-preview-item .bundle-savings {
    background: #166534;
    color: #dcfce7;
}

[data-theme="dark"] .pricing-preview-card {
    background: var(--bg-secondary);
}

.empty-chats-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: var(--text-muted);
    text-align: center;
}

    .empty-chats-message .material-icons {
        font-size: 32px;
        margin-bottom: 8px;
        opacity: 0.5;
    }

    .empty-chats-message p {
        font-size: 13px;
        margin: 0;
    }

/* ============================================
   UNIFIED MODAL SYSTEM - Add to chat.css
   ============================================ */

/* Base Modal Overlay - Used by ALL modals */
.modal-overlay,
.settings-modal-overlay,
.profile-edit-overlay,
.generic-modal-overlay,
.signup-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

    .modal-overlay.active,
    .settings-modal-overlay.active,
    .profile-edit-overlay.active,
    .generic-modal-overlay.visible,
    .signup-modal.active {
        opacity: 1;
        visibility: visible;
    }

/* Base Modal Container */
.modal-container,
.settings-modal-container,
.profile-edit-container,
.generic-modal,
.signup-modal-content,
.password-modal-container {
    background: var(--bg-primary, white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-container,
.settings-modal-overlay.active .settings-modal-container,
.profile-edit-overlay.active .profile-edit-container,
.generic-modal-overlay.visible .generic-modal,
.signup-modal.active .signup-modal-content {
    transform: scale(1) translateY(0);
}

/* Upgrade Modal Specific */
.upgrade-modal {
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
}

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

        .upgrade-modal .modal-header h2 {
            margin: 0;
            font-size: 20px;
            font-weight: 600;
            color: var(--text-primary);
        }

    .upgrade-modal .modal-close {
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        border-radius: 8px;
        color: var(--text-muted);
        transition: all 0.2s;
    }

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

    .upgrade-modal .modal-body {
        padding: 24px;
        overflow-y: auto;
        flex: 1;
    }

/* Tab Toggle */
.upgrade-tab-toggle {
    display: flex;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.upgrade-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

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

    .upgrade-tab-btn.active {
        background: var(--primary, #00b3c9);
        color: white;
        box-shadow: 0 2px 8px rgba(0, 179, 201, 0.3);
    }

    .upgrade-tab-btn .material-icons {
        font-size: 18px;
    }

/* Tab Content */
.upgrade-tab-content {
    display: none;
}

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

/* Billing Toggle */
.billing-toggle-container {
    display: flex;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

.billing-toggle-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

    .billing-toggle-btn.active {
        background: white;
        color: var(--text-primary);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .billing-toggle-btn .save-badge {
        background: #10b981;
        color: white;
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 10px;
        margin-left: 6px;
    }

/* ============================================
   ANONYMOUS UPGRADE PROMPT - Centered & Clean
   ============================================ */

.anonymous-upgrade-prompt {
    text-align: center;
    padding: 20px 0;
}

.upgrade-icon-wrapper {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), #0369a1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(0, 179, 201, 0.3);
}

    .upgrade-icon-wrapper.tokens {
        background: linear-gradient(135deg, #f59e0b, #d97706);
        box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
    }

    .upgrade-icon-wrapper .material-icons {
        font-size: 36px;
        color: white;
    }

.anonymous-upgrade-prompt h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.upgrade-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 24px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* Pricing Preview Card */
.pricing-preview {
    margin-bottom: 24px;
}

.pricing-preview-card {
    background: var(--bg-secondary);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 24px;
    max-width: 280px;
    margin: 0 auto;
    position: relative;
}

.preview-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.pricing-preview-card h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 8px 0 12px;
}

.preview-price {
    margin-bottom: 16px;
}

    .preview-price .price-amount {
        font-size: 40px;
        font-weight: 800;
        color: var(--text-primary);
    }

    .preview-price .price-period {
        font-size: 16px;
        color: var(--text-muted);
    }

.preview-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

    .preview-features li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 6px 0;
        color: var(--text-secondary);
        font-size: 14px;
    }

    .preview-features .material-icons {
        font-size: 18px;
        color: #22c55e;
    }

/* Token Pricing Info */
.token-pricing-info {
    margin-bottom: 24px;
}

.token-rate {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 12px;
    padding: 16px 24px;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
}

    .token-rate .rate-amount {
        font-size: 28px;
        font-weight: 800;
        color: #92400e;
    }

    .token-rate .rate-label {
        font-size: 14px;
        color: #b45309;
    }

.token-bundles-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

.bundle-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
}

    .bundle-preview-item.popular {
        border-color: var(--primary);
        background: rgba(0, 179, 201, 0.05);
    }

    .bundle-preview-item .bundle-tokens {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 14px;
    }

    .bundle-preview-item .bundle-price {
        font-weight: 700;
        color: var(--text-primary);
        font-size: 15px;
    }

    .bundle-preview-item .bundle-savings {
        font-size: 11px;
        font-weight: 600;
        padding: 3px 8px;
        border-radius: 12px;
        background: #dcfce7;
        color: #166534;
    }

    .bundle-preview-item.popular .bundle-savings {
        background: var(--primary);
        color: white;
    }

/* CTA Buttons */
.upgrade-cta-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upgrade-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
}

    .upgrade-cta-primary:hover {
        background: var(--primary-dark, #0097a7);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 179, 201, 0.4);
    }

    .upgrade-cta-primary .material-icons {
        font-size: 20px;
    }

.upgrade-cta-secondary {
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .upgrade-cta-secondary:hover {
        color: var(--primary);
    }

/* Dark mode adjustments */
[data-theme="dark"] .token-rate {
    background: linear-gradient(135deg, #422006, #78350f);
}

    [data-theme="dark"] .token-rate .rate-amount {
        color: #fcd34d;
    }

    [data-theme="dark"] .token-rate .rate-label {
        color: #fbbf24;
    }

[data-theme="dark"] .bundle-preview-item .bundle-savings {
    background: #166534;
    color: #dcfce7;
}

[data-theme="dark"] .pricing-preview-card {
    background: var(--bg-secondary);
}

[data-theme="dark"] .billing-toggle-btn.active {
    background: var(--bg-tertiary);
}

/* Plans Loading State */
.plans-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

    .plans-loading .spinner {
        width: 32px;
        height: 32px;
        border: 3px solid var(--border-color);
        border-top-color: var(--primary);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        margin-bottom: 12px;
    }

/* Mobile Responsive */
@media (max-width: 768px) {
    .upgrade-modal {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }

        .upgrade-modal .modal-body {
            padding: 16px;
        }

    .anonymous-upgrade-prompt {
        padding: 10px 0;
    }

    .upgrade-icon-wrapper {
        width: 60px;
        height: 60px;
    }

        .upgrade-icon-wrapper .material-icons {
            font-size: 28px;
        }

    .anonymous-upgrade-prompt h3 {
        font-size: 18px;
    }

    .pricing-preview-card {
        padding: 20px 16px;
    }

    .preview-price .price-amount {
        font-size: 32px;
    }
}

/* ============================================
   PLANS SIDE BY SIDE - Same styling as token bundles
   ============================================ */

.plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .plans-container {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .plans-container {
        grid-template-columns: 1fr;
    }
}
/* ============================================
   GLASS BACKDROP FOR ALL MODALS
   ============================================ */

.modal-overlay,
.settings-modal-overlay,
.profile-edit-overlay,
.generic-modal-overlay,
.signup-modal {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Dark mode - slightly darker backdrop */
[data-theme="dark"] .modal-overlay,
[data-theme="dark"] .settings-modal-overlay,
[data-theme="dark"] .profile-edit-overlay,
[data-theme="dark"] .generic-modal-overlay,
[data-theme="dark"] .signup-modal {
    background: rgba(0, 0, 0, 0.7);
}

/* ============================================
   SIGNUP MODAL - DARK MODE
   ============================================ */
[data-theme="dark"] .signup-modal-content {
    background: var(--bg-card, #2f2f2f);
    border: 1px solid var(--border, #3e3e4e);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .signup-modal-content h2 {
    color: var(--text-dark, #ececf1);
}

[data-theme="dark"] .signup-modal-content > p {
    color: var(--text-light, #c5c5d2);
}

[data-theme="dark"] .signup-modal-close {
    color: var(--text-muted, #8e8ea0);
}

[data-theme="dark"] .signup-modal-close:hover {
    background: var(--bg-light, #2f2f2f);
    color: var(--text-dark, #ececf1);
}

[data-theme="dark"] .signup-benefits li {
    color: var(--text-light, #c5c5d2);
}

[data-theme="dark"] .btn-login-secondary {
    color: var(--text-muted, #8e8ea0);
}

[data-theme="dark"] .btn-login-secondary:hover {
    color: var(--primary, #00d4e6);
}

/* Results signup prompt dark mode */
[data-theme="dark"] .results-signup-prompt {
    background: linear-gradient(180deg, transparent 0%, var(--bg-white, #212121) 30%);
}

[data-theme="dark"] .btn-small-signup {
    background: var(--bg-card, #2f2f2f);
    color: var(--primary, #00d4e6);
}


/* ✅ FORCE SCROLL FIX - Add at end of file */
#messagesContainer,
.messages-container {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.chat-area.empty-state .messages-container {
    overflow-y: auto !important; /* Override the hidden */
}

/* ============================================
   UPGRADE MODAL - DARK MODE
   ============================================ */

[data-theme="dark"] .upgrade-modal,
[data-theme="dark"] .modal-container {
    background: #1f2937;
    border: 1px solid #374151;
}

[data-theme="dark"] .modal-header {
    background: #111827;
    border-bottom-color: #374151;
}

    [data-theme="dark"] .modal-header h2 {
        color: #f9fafb;
    }

[data-theme="dark"] .modal-close {
    color: #9ca3af;
    background: transparent;
}

    [data-theme="dark"] .modal-close:hover {
        background: #374151;
        color: #f9fafb;
    }

[data-theme="dark"] .modal-body {
    background: #1f2937;
}

/* Tab Toggle */
[data-theme="dark"] .upgrade-tab-toggle {
    background: #374151;
}

[data-theme="dark"] .upgrade-tab-btn {
    color: #9ca3af;
}

    [data-theme="dark"] .upgrade-tab-btn:hover {
        color: #f9fafb;
    }

    [data-theme="dark"] .upgrade-tab-btn.active {
        background: var(--primary);
        color: white;
    }

/* Billing Toggle */
[data-theme="dark"] .billing-toggle-container {
    background: #374151;
}

[data-theme="dark"] .billing-toggle-btn {
    color: #9ca3af;
}

    [data-theme="dark"] .billing-toggle-btn.active {
        background: #1f2937;
        color: #f9fafb;
    }

/* Plans Container */
[data-theme="dark"] .plans-container {
    background: transparent;
}

[data-theme="dark"] .plan-card-modal {
    background: #374151;
    border-color: #4b5563;
}

    [data-theme="dark"] .plan-card-modal:hover {
        border-color: var(--primary);
    }

    [data-theme="dark"] .plan-card-modal.popular {
        border-color: var(--primary);
        background: rgba(0, 179, 201, 0.1);
    }

[data-theme="dark"] .plan-name {
    color: #f9fafb;
}

[data-theme="dark"] .plan-price {
    color: var(--primary);
}

[data-theme="dark"] .plan-features li {
    color: #d1d5db;
}

/* Signup Prompt */
[data-theme="dark"] .anonymous-upgrade-prompt h3 {
    color: #f9fafb;
}

[data-theme="dark"] .upgrade-subtitle {
    color: #9ca3af;
}

[data-theme="dark"] .pricing-preview-card {
    background: #374151;
    border-color: var(--primary);
}

    [data-theme="dark"] .pricing-preview-card h4 {
        color: #f9fafb;
    }

[data-theme="dark"] .preview-price .price-amount {
    color: #f9fafb;
}

[data-theme="dark"] .preview-price .price-period {
    color: #9ca3af;
}

[data-theme="dark"] .preview-features li {
    color: #d1d5db;
}

[data-theme="dark"] .upgrade-cta-secondary {
    color: #9ca3af;
}

    [data-theme="dark"] .upgrade-cta-secondary:hover {
        color: var(--primary);
    }

/* Token Bundles */
[data-theme="dark"] .token-bundles-container {
    background: transparent;
}

[data-theme="dark"] .token-bundle-card {
    background: #374151;
    border-color: #4b5563;
}

    [data-theme="dark"] .token-bundle-card:hover {
        border-color: var(--primary);
    }

    [data-theme="dark"] .token-bundle-card.popular {
        border-color: var(--primary);
    }

[data-theme="dark"] .token-bundle-name {
    color: #f9fafb;
}

[data-theme="dark"] .token-bundle-price {
    color: #f9fafb;
}

[data-theme="dark"] .token-bundle-unit,
[data-theme="dark"] .token-bundle-per-token {
    color: #9ca3af;
}

[data-theme="dark"] .token-rate {
    background: linear-gradient(135deg, #422006, #78350f);
    border: 1px solid #ca8a04;
}

    [data-theme="dark"] .token-rate .rate-amount {
        color: #fcd34d;
    }

    [data-theme="dark"] .token-rate .rate-label {
        color: #fbbf24;
    }

[data-theme="dark"] .token-bundles-preview .bundle-preview-item {
    background: #374151;
    border-color: #4b5563;
}

    [data-theme="dark"] .token-bundles-preview .bundle-preview-item.popular {
        background: rgba(0, 179, 201, 0.1);
        border-color: var(--primary);
    }

[data-theme="dark"] .bundle-preview-item .bundle-tokens,
[data-theme="dark"] .bundle-preview-item .bundle-price {
    color: #f9fafb;
}

[data-theme="dark"] .bundle-preview-item .bundle-savings {
    background: #166534;
    color: #dcfce7;
}

[data-theme="dark"] .bundle-preview-item.popular .bundle-savings {
    background: var(--primary);
    color: white;
}

/* Token Balance Header */
[data-theme="dark"] .token-balance-header {
    background: linear-gradient(135deg, var(--primary), #0891b2);
}

/* Plans Loading */
[data-theme="dark"] .plans-loading {
    color: #9ca3af;
}

[data-theme="dark"] .spinner {
    border-color: #4b5563;
    border-top-color: var(--primary);
}

/* ============================================
   COMPANY CARD STYLES
   ============================================ */

.company-card {
    background: var(--bg-primary, white);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

    .company-card:hover {
        border-color: var(--primary, #0369a1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

[data-theme="dark"] .company-card {
    background: #1e293b;
    border-color: #334155;
}

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

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

.company-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 6px;
}

.company-local-icon {
    font-size: 16px;
    color: #ef4444;
}

.company-industry {
    font-size: 12px;
    color: var(--primary, #0369a1);
    margin-top: 2px;
    font-weight: 500;
}

.company-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted, #64748b);
    margin-top: 4px;
}

.company-rating {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.rating-stars {
    font-size: 14px;
    font-weight: 600;
    color: #f59e0b;
}

.rating-count {
    font-size: 11px;
    color: var(--text-muted, #64748b);
}

.company-quality-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.company-description {
    font-size: 13px;
    color: var(--text-secondary, #475569);
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-light, #f8fafc);
    border-radius: 8px;
}

[data-theme="dark"] .company-description {
    background: #0f172a;
}

.company-links {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.company-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--primary, #0369a1);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--bg-light, #f1f5f9);
    transition: all 0.2s;
}

    .company-link:hover {
        background: var(--primary, #0369a1);
        color: white;
    }

    .company-link .material-icons {
        font-size: 14px;
    }

.company-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Primary "Find Contacts" button - PROMINENT */
.company-find-contacts-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #00b3c9, #0369a1);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

    .company-find-contacts-btn:hover {
        background: linear-gradient(135deg, #0369a1, #1e40af);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(3, 105, 161, 0.3);
    }

    .company-find-contacts-btn .material-icons {
        font-size: 18px;
    }

/* Bookmark button */
.company-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg-light, #f1f5f9);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.2s;
}

    .company-add-btn:hover {
        background: #fef3c7;
        border-color: #f59e0b;
        color: #f59e0b;
    }

[data-theme="dark"] .company-add-btn {
    background: #334155;
    border-color: #475569;
}

/* Company results summary styling */
.results-summary-card.company-results .results-summary-icon.company {
    background: linear-gradient(135deg, #818cf8, #6366f1);
}

    .results-summary-card.company-results .results-summary-icon.company .material-icons {
        color: white;
    }

/* ============================================ */
/* MOBILE EXAMPLE CARDS - CHAT PAGE            */
/* Add this to the END of your chat.css        */
/* ============================================ */

@media (max-width: 768px) {

    /* Welcome section tighter on mobile */
    .welcome-header {
        padding: 12px 16px 8px !important;
    }

    .welcome-logo {
        width: 44px !important;
        height: 44px !important;
        margin-bottom: 8px !important;
    }

    .welcome-title {
        font-size: 20px !important;
        line-height: 1.35 !important;
    }

    /* Example cards section */
    .welcome-examples {
        margin-bottom: 16px !important;
        padding: 0 12px !important;
    }

    .examples-label {
        font-size: 10px !important;
        margin-bottom: 8px !important;
        letter-spacing: 0.5px;
    }

    /* 2x2 compact grid */
    .example-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        padding: 0 !important;
    }

    /* Individual card - compact vertical layout */
    .example-card {
        padding: 10px 6px !important;
        min-height: auto !important;
        flex-direction: column !important;
        text-align: center !important;
        gap: 4px !important;
        border-radius: 10px !important;
    }

    /* Smaller emoji */
    .example-icon {
        font-size: 18px !important;
        margin-bottom: 2px;
    }

    /* Compact title text */
    .example-title {
        font-size: 10px !important;
        line-height: 1.25 !important;
        font-weight: 500 !important;
    }

    /* Input area tighter */
    .input-area {
        padding: 8px 12px 12px !important;
    }

    .input-field {
        font-size: 16px !important;
        padding: 10px 42px 10px 12px !important;
        min-height: 42px !important;
        border-radius: 20px !important;
    }

    .send-button {
        width: 30px !important;
        height: 30px !important;
        right: 6px !important;
    }

        .send-button .material-icons {
            font-size: 16px !important;
        }
}

/* Extra small screens */
@media (max-width: 480px) {
    .welcome-title {
        font-size: 18px !important;
    }

    .example-icon {
        font-size: 16px !important;
    }

    .example-title {
        font-size: 9px !important;
    }

    .welcome-examples {
        margin-bottom: 12px !important;
    }

    .example-cards {
        gap: 5px !important;
    }

    .example-card {
        padding: 8px 4px !important;
    }
}

/* Landscape mobile - 4 cards in a row */
@media (max-width: 768px) and (orientation: landscape) {
    .welcome-header {
        padding: 8px 16px !important;
    }

    .welcome-title {
        font-size: 18px !important;
    }

    .welcome-logo {
        width: 36px !important;
        height: 36px !important;
    }

    .welcome-examples {
        margin-bottom: 12px !important;
    }

    .example-cards {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .input-area {
        padding: 6px 16px !important;
    }
}


/* ============================================
   COLLAPSIBLE SIDEBAR WITH ICONS
   ============================================ */

:root {
    --sidebar-collapsed-width: 72px;
}

/* ===== SIDEBAR BASE ===== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-collapsed-width);
    background: var(--bg-light);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
    overflow: hidden;
}

    /* When collapsed - show narrow strip */
    .sidebar.collapsed {
        width: var(--sidebar-collapsed-width) !important;
        margin-left: 0; /* Override the old behavior */
    }

/* ===== COLLAPSED ICON STRIP ===== */
.sidebar-collapsed-strip {
    display: none;
    flex-direction: column;
    align-items: center;
    width: var(--sidebar-collapsed-width);
    height: 100%;
    padding: 16px 0;
    background: var(--bg-light);
}

.sidebar.collapsed .sidebar-collapsed-strip {
    display: flex;
}

.sidebar.collapsed .sidebar-full-content {
    display: none;
}

/* Full content wrapper */
.sidebar-full-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

/* ===== COLLAPSED LOGO ===== */
.collapsed-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

    .collapsed-logo img {
        width: 36px;
        height: 36px;
        object-fit: contain;
    }


  




/* ===== COLLAPSED NAV ICONS ===== */
.collapsed-nav-icons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.collapsed-nav-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

    .collapsed-nav-icon:hover {
        background: var(--bg-white);
        color: var(--primary);
    }

    .collapsed-nav-icon .material-icons {
        font-size: 22px;
    }

    /* Tooltip on hover */
    .collapsed-nav-icon::after {
        content: attr(title);
        position: absolute;
        left: 56px;
        top: 50%;
        transform: translateY(-50%);
        background: var(--text-dark);
        color: white;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s;
        z-index: 1000;
        pointer-events: none;
    }

    .collapsed-nav-icon:hover::after {
        opacity: 1;
        visibility: visible;
    }

/* ===== COLLAPSED USER AVATAR ===== */
.collapsed-user {
    margin-top: auto;
    cursor: pointer;
}

.collapsed-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.collapsed-user:hover .collapsed-avatar {
    transform: scale(1.08);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
}

/* Tooltip for user */
.collapsed-user::after {
    content: "Settings";
    position: absolute;
    left: 64px;
    bottom: 20px;
    background: var(--text-dark);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
}

.collapsed-user:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ===== NAV SECTION HEADER WITH ICON ===== */
.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

.nav-section-icon-left {
    font-size: 18px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-section-header:hover .nav-section-icon-left {
    color: var(--primary);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] .sidebar-collapsed-strip {
    background: var(--bg-light);
}

[data-theme="dark"] .collapsed-nav-icon:hover {
    background: var(--bg-card);
}

[data-theme="dark"] .collapsed-nav-icon::after,
[data-theme="dark"] .collapsed-user::after {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

/* ===== MOBILE: Keep original behavior ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        left: 0;
        top: 0;
        bottom: 0;
        width: 85vw !important;
        max-width: 320px !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

        .sidebar:not(.collapsed) {
            transform: translateX(0);
        }

        .sidebar.collapsed {
            transform: translateX(-100%);
            width: 85vw !important;
        }

        /* On mobile, always show full content when open */
        .sidebar .sidebar-collapsed-strip {
            display: none !important;
        }

        .sidebar .sidebar-full-content {
            display: flex !important;
        }
}

/* ===== TABLET: Collapsed strip visible ===== */
@media (min-width: 769px) and (max-width: 1200px) {
    :root {
        --sidebar-collapsed-width: 64px;
    }

    .collapsed-logo img {
        width: 32px;
        height: 32px;
    }

    .collapsed-new-chat,
    .collapsed-nav-icon,
    .collapsed-avatar {
        width: 40px;
        height: 40px;
    }
}



/* ===== EXAMPLE CARDS - UPDATED STRUCTURE ===== */


    .example-card:hover {
        border-color: var(--primary);
        background: var(--bg-hover);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

.example-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.example-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.example-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.example-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Dark mode support */
[data-theme="dark"] .example-card {
    background: var(--bg-secondary);
    border-color: var(--border);
}

    [data-theme="dark"] .example-card:hover {
        background: var(--bg-hover);
        border-color: var(--primary);
    }

/* ============================================ */
/* COLLAPSED LOGIN ICON (for anonymous users)  */
/* ============================================ */
.collapsed-login-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
    margin-bottom: 16px;
}

    .collapsed-login-icon .material-icons {
        color: var(--primary);
        font-size: 22px;
    }

    .collapsed-login-icon:hover {
        background: var(--bg-light);
        border-color: var(--primary);
        transform: scale(1.05);
    }

/* Dark mode */
[data-theme="dark"] .collapsed-login-icon {
    background: #374151;
    border-color: #4b5563;
}

    [data-theme="dark"] .collapsed-login-icon:hover {
        background: #4b5563;
    }



/* ============================================ */
/* COLLAPSED NEW CHAT BUTTON - VERY SMALL      */
/* ============================================ */
.collapsed-new-chat {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    background: var(--primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 6px auto 10px;
}

    .collapsed-new-chat .material-icons {
        color: white;
        font-size: 16px !important;
    }

    .collapsed-new-chat:hover {
        background: var(--primary-dark, #0090a3);
        transform: scale(1.1);
    }

/* Dark mode */
[data-theme="dark"] .collapsed-new-chat {
    background: var(--primary);
}

    [data-theme="dark"] .collapsed-new-chat:hover {
        background: var(--primary-dark, #0090a3);
    }

/* ========================================
   CONTACT ENRICHMENT RESULTS STYLES
   Theme-aware - respects light/dark mode
   ======================================== */

.enrichment-results-container {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    margin: 12px 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.enrichment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-tertiary, #f1f5f9);
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.enrichment-header-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.enrichment-header-title {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    font-size: 15px;
    flex: 1;
}

.enrichment-header-count {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.enrichment-cards {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.enrichment-card {
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.2s ease;
}

    .enrichment-card:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .enrichment-card.success {
        border-left: 3px solid #10b981;
    }

    .enrichment-card.partial {
        border-left: 3px solid #f59e0b;
    }

.enrichment-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.enrichment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0d9488, #0f766e);
}

.enrichment-position-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #0d9488;
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 8px;
    border: 2px solid var(--bg-primary, #ffffff);
}

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

.enrichment-person-name {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enrichment-person-title {
    color: var(--text-secondary, #64748b);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enrichment-status {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

    .enrichment-status.success {
        background: rgba(16, 185, 129, 0.15);
        color: #10b981;
    }

    .enrichment-status.partial {
        background: rgba(245, 158, 11, 0.15);
        color: #f59e0b;
    }

.enrichment-contact-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.enrichment-contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
    border: 1px solid var(--border, #e2e8f0);
}

    .enrichment-contact-row .contact-icon {
        font-size: 14px;
        width: 20px;
        text-align: center;
        flex-shrink: 0;
    }

    .enrichment-contact-row .contact-value {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        flex-wrap: wrap;
    }

.contact-link {
    color: #0d9488;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    word-break: break-all;
}

    .contact-link:hover {
        color: #4f46e5;
        text-decoration: underline;
    }

.confidence-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

    .confidence-badge.high {
        background: rgba(16, 185, 129, 0.15);
        color: #059669;
    }

    .confidence-badge.medium {
        background: rgba(59, 130, 246, 0.15);
        color: #2563eb;
    }

    .confidence-badge.low {
        background: rgba(245, 158, 11, 0.15);
        color: #d97706;
    }

.phone-type-badge {
    font-size: 10px;
    color: var(--text-secondary, #64748b);
    flex-shrink: 0;
}

.copy-btn {
    background: var(--bg-tertiary, #f1f5f9);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    padding: 5px;
    cursor: pointer;
    color: var(--text-secondary, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .copy-btn:hover {
        background: #0d9488;
        color: white;
        border-color: #0d9488;
    }

    .copy-btn.copied {
        background: #10b981;
        color: white;
        border-color: #10b981;
    }

.not-found {
    color: var(--text-muted, #94a3b8);
    font-style: italic;
    font-size: 13px;
}

.enrichment-footer {
    padding: 10px 18px;
    text-align: center;
    color: var(--text-secondary, #64748b);
    font-size: 12px;
    border-top: 1px solid var(--border, #e2e8f0);
    background: var(--bg-tertiary, #f1f5f9);
}

/* Loading animation */
.contact-loading {
    display: flex;
    gap: 4px;
    align-items: center;
}

.loading-dot {
    width: 5px;
    height: 5px;
    background: #0d9488;
    border-radius: 50%;
    animation: loadingPulse 1s ease-in-out infinite;
}

    .loading-dot:nth-child(2) {
        animation-delay: 0.2s;
    }

    .loading-dot:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes loadingPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   DARK MODE OVERRIDES
   ======================================== */
[data-theme="dark"] .enrichment-results-container,
.dark .enrichment-results-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-color: rgba(13, 148, 136, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .enrichment-header,
.dark .enrichment-header {
    background: rgba(13, 148, 136, 0.1);
    border-bottom-color: rgba(13, 148, 136, 0.2);
}

[data-theme="dark"] .enrichment-header-title,
.dark .enrichment-header-title {
    color: #fff;
}

[data-theme="dark"] .enrichment-card,
.dark .enrichment-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

    [data-theme="dark"] .enrichment-card:hover,
    .dark .enrichment-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(13, 148, 136, 0.4);
    }

[data-theme="dark"] .enrichment-person-name,
.dark .enrichment-person-name {
    color: #fff;
}

[data-theme="dark"] .enrichment-person-title,
.dark .enrichment-person-title {
    color: #9ca3af;
}

[data-theme="dark"] .enrichment-position-badge,
.dark .enrichment-position-badge {
    border-color: #1a1a2e;
}

[data-theme="dark"] .enrichment-contact-row,
.dark .enrichment-contact-row {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .contact-link,
.dark .contact-link {
    color: #a5b4fc;
}

    [data-theme="dark"] .contact-link:hover,
    .dark .contact-link:hover {
        color: #c4b5fd;
    }

[data-theme="dark"] .copy-btn,
.dark .copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
}

[data-theme="dark"] .enrichment-footer,
.dark .enrichment-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top-color: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .enrichment-results-container {
        margin: 8px 0;
        border-radius: 12px;
    }

    .enrichment-header {
        padding: 12px 14px;
    }

    .enrichment-cards {
        padding: 10px;
    }

    .enrichment-card {
        padding: 12px;
    }

    .enrichment-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .enrichment-person-name {
        font-size: 13px;
    }

    .enrichment-contact-row {
        padding: 6px 8px;
    }

    .contact-link {
        font-size: 12px;
    }

    .confidence-badge {
        font-size: 9px;
        padding: 1px 5px;
    }
}

/* Fix message spacing */
.messages-inner {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reduced from larger value */
}

    .messages-inner > .enrichment-results-container {
        margin: 8px 0;
    }

/* Ensure assistant messages don't have excessive margins */
.message.assistant {
    margin-bottom: 8px;
}

.message.user {
    margin-bottom: 8px;
}

/* ========================================
   ENRICHMENT CARD ADD BUTTON
   ======================================== */

.enrichment-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.enrichment-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
    color: #0d9488;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .enrichment-add-btn:hover {
        background: #0d9488;
        color: white;
        border-color: #0d9488;
        transform: scale(1.05);
    }

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

    .enrichment-add-btn.added {
        background: #10b981;
        color: white;
        border-color: #10b981;
        cursor: default;
    }

        .enrichment-add-btn.added:hover {
            transform: none;
        }

    .enrichment-add-btn .material-icons {
        font-size: 18px;
    }

/* Dark mode */
[data-theme="dark"] .enrichment-add-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

    [data-theme="dark"] .enrichment-add-btn:hover {
        background: #0d9488;
        border-color: #0d9488;
    }

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #1e293b;
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    max-width: 320px;
}

    .toast.show {
        transform: translateX(0);
        opacity: 1;
    }

    .toast .material-icons {
        font-size: 20px;
    }

.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

    .toast-success .material-icons {
        color: #d1fae5;
    }

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

    .toast-error .material-icons {
        color: #fee2e2;
    }

.toast-info {
    background: linear-gradient(135deg, #0d9488, #0f766e);
}

    .toast-info .material-icons {
        color: #e0e7ff;
    }

/* Mobile positioning */
@media (max-width: 640px) {
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 80px;
    }

    .toast {
        max-width: none;
    }
}


/* ========================================
   ENRICHMENT RESULTS - MINIMAL CLEAN CSS
   Replaces all enrichment styles
   ======================================== */

/* ===== MAIN WRAPPER ===== */
.enrichment-results-wrapper,
.enrichment-results-container {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    margin: 8px 0;
}

[data-theme="dark"] .enrichment-results-wrapper,
[data-theme="dark"] .enrichment-results-container {
    background: #1a1a2e;
    border-color: #2d2d44;
}

/* ===== HEADER ===== */
.enrichment-summary-header,
.enrichment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-light, #f8fafc);
    border-bottom: 1px solid var(--border, #e2e8f0);
}

[data-theme="dark"] .enrichment-summary-header,
[data-theme="dark"] .enrichment-header {
    background: #252538;
    border-bottom-color: #2d2d44;
}

.enrichment-summary-icon,
.enrichment-header-icon {
    width: 32px;
    height: 32px;
    background: var(--primary, #00b3c9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .enrichment-summary-icon .material-icons,
    .enrichment-header-icon .material-icons {
        color: white;
        font-size: 18px;
    }

.enrichment-summary-text {
    flex: 1;
    min-width: 0;
}

.enrichment-summary-title,
.enrichment-header-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark, #1e293b);
}

[data-theme="dark"] .enrichment-summary-title,
[data-theme="dark"] .enrichment-header-title {
    color: #e2e8f0;
}

.enrichment-summary-subtitle,
.enrichment-header-subtitle {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    margin-top: 1px;
}

[data-theme="dark"] .enrichment-summary-subtitle,
[data-theme="dark"] .enrichment-header-subtitle {
    color: #94a3b8;
}

.enrichment-tokens-badge,
.enrichment-header-count {
    padding: 4px 10px;
    background: var(--primary, #00b3c9);
    color: white;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* ===== CARDS CONTAINER - MINIMAL GAP ===== */
.enrichment-cards-container,
.enrichment-cards {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

[data-theme="dark"] .enrichment-cards-container,
[data-theme="dark"] .enrichment-cards {
    background: #1a1a2e;
}

/* ===== INDIVIDUAL CARD ===== */
.enrichment-result-card,
.enrichment-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 10px 12px;
    border-left: 3px solid var(--primary, #00b3c9);
}

[data-theme="dark"] .enrichment-result-card,
[data-theme="dark"] .enrichment-card {
    background: #252538;
    border-color: #2d2d44;
    border-left-color: var(--primary, #00b3c9);
}

.enrichment-result-card:hover,
.enrichment-card:hover {
    border-color: var(--primary, #00b3c9);
}

/* ===== CARD HEADER ===== */
.erc-header,
.enrichment-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.erc-position,
.enrichment-position-badge {
    width: 24px;
    height: 24px;
    background: var(--primary, #00b3c9);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

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

.erc-name,
.enrichment-person-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .erc-name,
[data-theme="dark"] .enrichment-person-name {
    color: #f1f5f9;
}

.erc-company,
.enrichment-person-title {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

[data-theme="dark"] .erc-company,
[data-theme="dark"] .enrichment-person-title {
    color: #94a3b8;
}

/* ===== ADD BUTTON ===== */
.erc-add-btn,
.enrichment-add-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--primary, #00b3c9);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

    .erc-add-btn:hover,
    .enrichment-add-btn:hover {
        background: #0090a3;
    }

    .erc-add-btn.added,
    .enrichment-add-btn.added {
        background: #64748b;
        cursor: default;
    }

    .erc-add-btn .material-icons,
    .enrichment-add-btn .material-icons {
        font-size: 18px;
    }

/* ===== CONTACT ROWS - COMPACT ===== */
.erc-contact-info,
.enrichment-contact-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.erc-contact-row,
.enrichment-contact-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-light, #f8fafc);
    border-radius: 6px;
    font-size: 13px;
}

[data-theme="dark"] .erc-contact-row,
[data-theme="dark"] .enrichment-contact-row {
    background: #1e1e32;
}

/* Found state - subtle green tint */
.erc-contact-row.found,
.enrichment-contact-row.found {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .erc-contact-row.found,
[data-theme="dark"] .enrichment-contact-row.found {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
}

/* Not found state - subtle red tint */
.erc-contact-row.not-found,
.enrichment-contact-row.not-found {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .erc-contact-row.not-found,
[data-theme="dark"] .enrichment-contact-row.not-found {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Icons */
.erc-icon,
.enrichment-contact-row .contact-icon {
    font-size: 16px;
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
    width: 20px;
}

.erc-contact-row.found .erc-icon {
    color: #10b981;
}

.erc-contact-row.not-found .erc-icon {
    color: #ef4444;
}

/* Values */
.erc-value {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.erc-link,
.contact-link {
    color: var(--primary, #00b3c9);
    text-decoration: none;
    font-family: monospace;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .erc-link:hover,
    .contact-link:hover {
        text-decoration: underline;
    }

.erc-not-found,
.not-found-text {
    color: #ef4444;
    font-style: italic;
    font-size: 12px;
}

[data-theme="dark"] .erc-not-found {
    color: #f87171;
}

/* Confidence Badge - simple */
.erc-confidence,
.confidence-badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

    .erc-confidence.high,
    .confidence-badge.high {
        background: rgba(16, 185, 129, 0.15);
        color: #059669;
    }

    .erc-confidence.medium,
    .confidence-badge.medium {
        background: rgba(245, 158, 11, 0.15);
        color: #d97706;
    }

    .erc-confidence.low,
    .confidence-badge.low {
        background: rgba(239, 68, 68, 0.15);
        color: #dc2626;
    }

[data-theme="dark"] .erc-confidence.high {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

[data-theme="dark"] .erc-confidence.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .erc-confidence.low {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Phone Type Badge */
.erc-phone-type,
.phone-type-badge {
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    flex-shrink: 0;
}

[data-theme="dark"] .erc-phone-type {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* Copy Button */
.erc-copy-btn,
.copy-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted, #64748b);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    margin-left: auto;
}

    .erc-copy-btn:hover,
    .copy-btn:hover {
        background: var(--primary, #00b3c9);
        color: white;
    }

    .erc-copy-btn.copied,
    .copy-btn.copied {
        color: #10b981;
    }

    .erc-copy-btn .material-icons,
    .copy-btn .material-icons {
        font-size: 14px;
    }

/* ===== TOAST - Simple ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #1e293b;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 13px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.25s ease;
}

    .toast.show {
        transform: translateX(0);
        opacity: 1;
    }

    .toast .material-icons {
        font-size: 18px;
    }

.toast-success {
    border-left: 3px solid #10b981;
}

    .toast-success .material-icons {
        color: #10b981;
    }

.toast-error {
    border-left: 3px solid #ef4444;
}

    .toast-error .material-icons {
        color: #ef4444;
    }

.toast-info {
    border-left: 3px solid #3b82f6;
}

    .toast-info .material-icons {
        color: #3b82f6;
    }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .enrichment-cards-container {
        padding: 6px;
        gap: 4px;
    }

    .enrichment-result-card {
        padding: 8px 10px;
    }

    .erc-contact-row {
        padding: 5px 8px;
    }

    .erc-value {
        flex-wrap: wrap;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 70px;
    }
}
/* ============================================================================
   FILE IMPORT UI STYLES
   ============================================================================ */

/* File Import Results Card */
.file-import-results .message-content,
.file-import-search-results .message-content {
    max-width: 100%;
}

.file-import-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(0, 179, 201, 0.1), rgba(0, 224, 213, 0.05));
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 15px;
}

.file-import-header .material-icons {
    color: var(--primary);
    font-size: 24px;
}

.file-import-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-light);
}

.file-import-warning .material-icons {
    color: #f59e0b;
    font-size: 18px;
}

/* Companies List */
.file-import-companies-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 16px;
    background: var(--bg-light);
}

.file-import-company-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}

.file-import-company-item:hover {
    background: var(--bg-card);
}

.company-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}

.company-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.company-name {
    font-weight: 500;
    color: var(--text-dark);
}

.company-website {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.company-ambiguous {
    cursor: help;
    font-size: 14px;
}

/* Roles Found Section */
.file-import-roles-found {
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 10px;
    margin-bottom: 16px;
}

.file-import-roles-found p {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.roles-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.role-chip {
    display: inline-block;
    padding: 4px 10px;
    background: var(--success);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.role-chip:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.role-chip.selected {
    background: var(--primary);
    opacity: 0.7;
}

.roles-hint {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-light);
    opacity: 0.7;
    font-style: italic;
}

/* Actions Section */
.file-import-actions {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.file-import-roles-input,
.file-import-location-input {
    margin-bottom: 12px;
}

.file-import-roles-input label,
.file-import-location-input label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 6px;
}

.file-import-roles-input input,
.file-import-location-input input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-dark);
    transition: border-color 0.2s;
}

.file-import-roles-input input:focus,
.file-import-location-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.file-import-button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.file-import-select-all,
.file-import-select-none {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.file-import-select-all:hover,
.file-import-select-none:hover {
    background: var(--bg-light);
    border-color: var(--primary);
}

.file-import-search-btn {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.file-import-search-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.file-import-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.file-import-search-btn .material-icons.rotating {
    animation: spin 1s linear infinite;
}

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

/* Token Info */
.file-import-token-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 8px;
}

.file-import-token-info .material-icons {
    font-size: 16px;
    color: var(--primary);
}

/* ====== People List from File Import ====== */
.file-import-people-list {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 12px;
    background: var(--bg-light);
}

.file-import-person-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.15s;
}

.file-import-person-item:hover {
    background: var(--bg-card);
}

.person-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.person-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.person-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.person-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.person-details {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-industry {
    font-size: 11px;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.person-email {
    font-size: 11px;
    color: var(--text-muted);
}

.person-linkedin-link {
    flex-shrink: 0;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.person-linkedin-link:hover {
    opacity: 1;
    background: rgba(0, 119, 181, 0.08);
}

.file-import-people-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.file-import-people-summary .material-icons {
    font-size: 16px;
    color: var(--primary);
}

/* Person Search Results */
.person-search-results-list {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 12px 0;
}

.person-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.person-search-result:last-child {
    border-bottom: none;
}

.person-search-result.found {
    background: rgba(34, 197, 94, 0.04);
}

.person-search-result.not-found {
    background: rgba(239, 68, 68, 0.03);
    opacity: 0.7;
}

.person-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.person-result-name {
    font-weight: 600;
    font-size: 13px;
}

.person-result-company,
.person-result-title {
    font-size: 12px;
    color: var(--text-muted);
}

.person-result-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.person-linkedin-found {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #0077b5;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 119, 181, 0.08);
}

.person-linkedin-found:hover {
    background: rgba(0, 119, 181, 0.15);
}

.person-not-found-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: var(--text-muted);
}

.person-result-verified-title {
    font-size: 11px;
    color: var(--text-muted);
}

.file-import-header.people-header .material-icons {
    color: #6366f1;
}

[data-theme="dark"] .file-import-people-list {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .file-import-person-item:hover {
    background: var(--bg-light);
}

/* Enhanced Content Detection Summary */
.file-import-detection-summary {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

[data-theme="dark"] .file-import-detection-summary {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(16, 185, 129, 0.08));
    border-color: rgba(34, 197, 94, 0.3);
}

.detection-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #16a34a;
}

[data-theme="dark"] .detection-header {
    color: #4ade80;
}

.detection-header .material-icons {
    font-size: 18px;
}

.detection-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.detection-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

[data-theme="dark"] .detection-item {
    background: rgba(30, 41, 59, 0.8);
}

.detection-item.linkedin {
    color: #0077b5;
    border: 1px solid rgba(0, 119, 181, 0.3);
}

.detection-item.email {
    color: #ea580c;
    border: 1px solid rgba(234, 88, 12, 0.3);
}

.detection-item.phone {
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.detection-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
}

.detection-count {
    white-space: nowrap;
}

.detection-suggestions {
    padding-top: 12px;
    border-top: 1px solid rgba(34, 197, 94, 0.15);
}

.suggestions-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
}

.suggestion-chip .material-icons {
    font-size: 14px;
}

/* LinkedIn Profiles Section */
.file-import-profiles-section {
    background: linear-gradient(135deg, rgba(0, 119, 181, 0.08), rgba(0, 119, 181, 0.03));
    border: 1px solid rgba(0, 119, 181, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

[data-theme="dark"] .file-import-profiles-section {
    background: linear-gradient(135deg, rgba(0, 119, 181, 0.15), rgba(0, 119, 181, 0.08));
    border-color: rgba(0, 119, 181, 0.3);
}

.profiles-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #0077b5;
}

[data-theme="dark"] .profiles-header {
    color: #4da3d9;
}

.profiles-header .material-icons {
    font-size: 18px;
}

.file-import-profiles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.file-import-profile-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    transition: all 0.2s ease;
}

[data-theme="dark"] .file-import-profile-item {
    background: rgba(30, 41, 59, 0.8);
}

.file-import-profile-item:hover {
    background: rgba(0, 119, 181, 0.1);
}

.profile-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    cursor: pointer;
}

.profile-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #0077b5;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.profile-name {
    font-weight: 500;
    color: var(--text-primary);
}

.profile-link {
    display: flex;
    align-items: center;
    color: #0077b5;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.profile-link:hover {
    opacity: 1;
}

.profile-link .material-icons {
    font-size: 16px;
}

.profiles-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 119, 181, 0.15);
}

.profile-select-all,
.profile-select-none {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(0, 119, 181, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #0077b5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-select-all:hover,
.profile-select-none:hover {
    background: rgba(0, 119, 181, 0.1);
}

/* LinkedIn Profile Actions */
.file-import-profile-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.profile-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid rgba(0, 119, 181, 0.3);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #0077b5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-action-btn:hover {
    background: rgba(0, 119, 181, 0.1);
    border-color: #0077b5;
}

.profile-action-btn.primary {
    background: linear-gradient(135deg, #0077b5, #005885);
    border: none;
    color: white;
}

.profile-action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

.profile-action-btn .material-icons {
    font-size: 16px;
}

/* Email Contacts Section */
.file-import-emails-section {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.08), rgba(234, 88, 12, 0.03));
    border: 1px solid rgba(234, 88, 12, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.emails-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #ea580c;
}

.file-import-emails-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.file-import-email-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
}

[data-theme="dark"] .file-import-email-item {
    background: rgba(30, 41, 59, 0.8);
}

.email-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.email-checkbox {
    accent-color: #ea580c;
}

.email-address {
    font-family: monospace;
    font-size: 13px;
    color: var(--text-primary);
}

/* LinkedIn Header Style */
.file-import-header.linkedin-header {
    color: #0077b5;
}

.file-import-header.linkedin-header svg {
    flex-shrink: 0;
}

.file-import-header.email-header {
    color: #ea580c;
}

/* Historical File Upload Display - Paper style */
.file-upload-message {
    background: transparent !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-attachment-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid rgba(0, 179, 201, 0.3);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
}

[data-theme="dark"] .file-attachment-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: rgba(0, 179, 201, 0.4);
}

.file-attachment-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    border-radius: 10px;
    flex-shrink: 0;
    position: relative;
}

.file-attachment-icon::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.3) 50%);
    border-radius: 0 10px 0 0;
}

.file-attachment-icon .material-icons {
    color: white;
    font-size: 22px;
}

.file-attachment-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.file-attachment-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-attachment-info .file-attachment-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-upload-prompt {
    padding: 12px 16px;
    background: var(--primary);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: white;
    font-weight: 500;
}

.historical-file-import-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(0, 179, 201, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
}

.file-import-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--success), var(--primary));
    border-radius: 12px;
    flex-shrink: 0;
}

.file-import-icon .material-icons {
    color: white;
    font-size: 24px;
}

.file-import-info {
    flex: 1;
}

.file-import-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.file-import-subtitle {
    font-size: 13px;
    color: var(--text-light);
}

/* Search Results */
.search-results-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(0, 179, 201, 0.05));
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 15px;
}

.search-results-header .material-icons {
    color: var(--success);
    font-size: 24px;
}

.search-results-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.search-results-summary .material-icons {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.file-import-results-list {
    max-height: 500px;
    overflow-y: auto;
}

.company-result {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.company-result.empty {
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--bg-light);
}

.company-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.people-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 20px;
}

.company-people-list {
    padding: 8px;
}

.company-people-list .result-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}

.company-people-list .result-card:hover {
    background: var(--bg-light);
}

.result-main {
    flex: 1;
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-name {
    font-weight: 500;
    color: var(--text-dark);
}

.result-title {
    font-size: 13px;
    color: var(--text-light);
}

.result-company {
    font-size: 12px;
    color: var(--text-muted);
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-linkedin {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0077b5;
    font-size: 18px;
    border-radius: 8px;
    transition: background 0.15s;
}

.result-linkedin:hover {
    background: rgba(0, 119, 181, 0.1);
}

.add-to-list-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.add-to-list-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.add-to-list-btn .material-icons {
    font-size: 18px;
}

.search-results-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.add-all-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.add-all-btn:hover {
    background: #14a772;
    transform: translateY(-1px);
}

/* Dark Mode File Import */
[data-theme="dark"] .file-import-companies-list {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .file-import-company-item:hover {
    background: var(--bg-light);
}

[data-theme="dark"] .file-import-actions {
    background: var(--bg-card);
}

[data-theme="dark"] .file-import-roles-input input,
[data-theme="dark"] .file-import-location-input input {
    background: var(--bg-light);
    border-color: var(--border);
}

[data-theme="dark"] .company-result {
    border-color: var(--border);
}

[data-theme="dark"] .company-result-header {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .company-people-list .result-card:hover {
    background: var(--bg-card);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .file-import-companies-list {
        max-height: 200px;
    }

    .file-import-button-row {
        flex-direction: column;
    }

    .file-import-search-btn {
        width: 100%;
    }

    .company-people-list .result-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .result-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================ */
/* ENRICHMENT ACTION CARD STYLES (.eac-*)      */
/* ============================================ */

.enrichment-action-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    max-width: 420px;
}

.enrichment-action-card.success {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.enrichment-action-card.partial {
    border-color: rgba(251, 191, 36, 0.3);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

[data-theme="dark"] .enrichment-action-card {
    background: linear-gradient(135deg, #1e1e32 0%, #252542 100%);
    border-color: #3d3d5c;
}

[data-theme="dark"] .enrichment-action-card.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.eac-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.eac-header .eac-icon {
    font-size: 24px;
    color: #6366f1;
}

.eac-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #1e293b);
}

.eac-person {
    margin-bottom: 12px;
}

.eac-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary, #1e293b);
}

.eac-subtitle, .eac-company {
    font-size: 13px;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

.eac-contacts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eac-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.eac-row.found {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.eac-row.not-found {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.15);
}

.eac-row .material-icons {
    font-size: 18px;
    color: var(--text-muted, #64748b);
}

.eac-row.found .material-icons {
    color: #10b981;
}

.eac-row.not-found .material-icons {
    color: #ef4444;
}

.eac-row a {
    color: #6366f1;
    text-decoration: none;
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eac-row a:hover {
    text-decoration: underline;
}

.eac-row .not-found {
    color: #ef4444;
    font-size: 13px;
    font-style: italic;
}

.eac-badge {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border-radius: 4px;
    font-weight: 500;
}

.eac-copy {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #64748b);
    transition: all 0.2s;
}

.eac-copy:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary, #1e293b);
}

.eac-copy .material-icons {
    font-size: 16px;
}

.eac-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

[data-theme="dark"] .eac-row {
    background: rgba(255, 255, 255, 0.03);
    border-color: #3d3d5c;
}

[data-theme="dark"] .eac-row.found {
    background: rgba(16, 185, 129, 0.1);
}

/* ============================================ */
/* DEEP DIVE CARD STYLES (.dd-*)              */
/* ============================================ */

.deep-dive-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0;
    margin: 12px 0;
    max-width: 520px;
    overflow: hidden;
}

[data-theme="dark"] .deep-dive-card {
    background: linear-gradient(135deg, #1e1e32 0%, #252542 100%);
    border-color: #3d3d5c;
}

.dd-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #00b3c9 0%, #0097a7 100%);
    color: white;
}

.dd-icon {
    font-size: 28px;
    opacity: 0.9;
}

.dd-header-content {
    flex: 1;
}

.dd-title {
    font-weight: 600;
    font-size: 14px;
    opacity: 0.85;
}

.dd-person {
    font-weight: 700;
    font-size: 16px;
}

.dd-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

.dd-confidence {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: 8px;
}

.dd-confidence-value {
    font-weight: 700;
    font-size: 18px;
    display: block;
}

.dd-confidence-label {
    font-size: 10px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dd-body {
    padding: 16px;
}

.dd-section {
    margin-bottom: 16px;
}

.dd-section:last-child {
    margin-bottom: 0;
}

.dd-section h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--text-primary, #1e293b);
}

.dd-insights {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dd-insight {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 179, 201, 0.05);
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 3px solid #00b3c9;
}

.dd-insight.confidence-high {
    border-left-color: #10b981;
}

.dd-insight.confidence-medium {
    border-left-color: #f59e0b;
}

.dd-insight.confidence-low {
    border-left-color: #ef4444;
}

.dd-insight-type {
    font-size: 11px;
    font-weight: 600;
    color: #00b3c9;
    text-transform: uppercase;
    white-space: nowrap;
}

.dd-insight-content {
    font-size: 13px;
    color: var(--text-primary, #1e293b);
}

.dd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dd-tag {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(0, 179, 201, 0.1);
    color: #00b3c9;
    border-radius: 12px;
    font-weight: 500;
}

.dd-tags.expertise .dd-tag {
    background: rgba(0, 151, 167, 0.1);
    color: #0097a7;
}

.dd-media {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dd-media li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dd-media li:last-child {
    border-bottom: none;
}

.dd-media a {
    color: #00b3c9;
    text-decoration: none;
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dd-media a:hover {
    text-decoration: underline;
}

.dd-media-type {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    color: var(--text-muted, #64748b);
}

.dd-signals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.dd-signal {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    padding: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
}

.dd-signal .material-icons {
    font-size: 16px;
    color: #00b3c9;
}

.dd-section.starters {
    background: rgba(16, 185, 129, 0.05);
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
}

.dd-starters {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dd-starters li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-primary, #1e293b);
    position: relative;
    padding-left: 16px;
}

.dd-starters li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #10b981;
}

.dd-footer {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.dd-stat {
    font-size: 11px;
    color: var(--text-muted, #64748b);
}

[data-theme="dark"] .dd-section h4 {
    color: var(--text-primary, #e2e8f0);
}

[data-theme="dark"] .dd-insight {
    background: rgba(0, 179, 201, 0.1);
}

/* Body text inside the deep-dive card uses var(--text-primary/-muted) with a
   LIGHT-mode fallback, which the card's dark background doesn't override - so
   the mention text and post titles rendered dark-on-dark. Force readable text. */
[data-theme="dark"] .dd-insight-content,
[data-theme="dark"] .dd-starters li {
    color: #e2e8f0;
}

[data-theme="dark"] .dd-media-type,
[data-theme="dark"] .dd-signal,
[data-theme="dark"] .dd-stat {
    color: #94a3b8;
}

[data-theme="dark"] .dd-tag {
    background: rgba(0, 179, 201, 0.15);
}

[data-theme="dark"] .dd-signal {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .dd-section.starters {
    background: rgba(16, 185, 129, 0.08);
}

[data-theme="dark"] .dd-footer {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .dd-media li {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* ============================================ */
/* BULK DEEP DIVE PROGRESS STYLES (.bdd-*)     */
/* ============================================ */

.bulk-deep-dive-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 12px 0;
    max-width: 520px;
}

[data-theme="dark"] .bulk-deep-dive-card {
    background: linear-gradient(135deg, #1e1e32 0%, #252542 100%);
    border-color: #3d3d5c;
}

.bdd-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.bdd-header-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.bdd-header-text p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted, #64748b);
}

.bdd-progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

[data-theme="dark"] .bdd-progress-bar-container {
    background: rgba(255, 255, 255, 0.1);
}

.bdd-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00b3c9, #0097a7);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.bdd-progress-text {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    text-align: center;
    margin-bottom: 16px;
}

.bdd-profiles-list {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

[data-theme="dark"] .bdd-profiles-list {
    background: rgba(0, 0, 0, 0.2);
}

.bdd-profile-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

[data-theme="dark"] .bdd-profile-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.bdd-status-icon {
    font-size: 18px;
    color: var(--text-muted, #94a3b8);
}

.bdd-status-icon.status-completed {
    color: #10b981;
}

.bdd-status-icon.status-limited {
    color: #f59e0b;
}

.bdd-status-icon.status-failed {
    color: #ef4444;
}

.bdd-status-icon.status-processing {
    color: #00b3c9;
}

.bdd-status-icon.spin {
    animation: spin 1s linear infinite;
}

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

.bdd-profile-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
}

.bdd-profile-company {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

.bdd-more-count {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    text-align: center;
    padding: 8px;
    font-style: italic;
}

.bdd-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    padding: 8px 12px;
    background: rgba(0, 179, 201, 0.08);
    border-radius: 6px;
}

.bdd-note .material-icons {
    font-size: 16px;
    color: #00b3c9;
}

/* Bulk Deep Dive Completion Styles */
.bulk-deep-dive-completion {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(0, 179, 201, 0.08) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 20px;
    max-width: 700px;
}

[data-theme="dark"] .bulk-deep-dive-completion {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(0, 179, 201, 0.12) 100%);
    border-color: rgba(34, 197, 94, 0.4);
}

.bdd-completion-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin-bottom: 16px;
}

.bdd-completion-title .material-icons {
    color: #22c55e;
    font-size: 24px;
}

.bdd-completion-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.bdd-stat {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.bdd-stat.success {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.bdd-stat.limited {
    background: rgba(234, 179, 8, 0.15);
    color: #ca8a04;
}

.bdd-stat.failed {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

[data-theme="dark"] .bdd-stat.success {
    color: #4ade80;
}

[data-theme="dark"] .bdd-stat.limited {
    color: #facc15;
}

[data-theme="dark"] .bdd-stat.failed {
    color: #f87171;
}

.bdd-ai-summary {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

[data-theme="dark"] .bdd-ai-summary {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(148, 163, 184, 0.2);
}

.bdd-summary-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #00b3c9;
    margin-bottom: 12px;
}

.bdd-summary-title .material-icons {
    font-size: 20px;
}

.bdd-summary-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary, #334155);
}

.bdd-summary-content strong {
    color: var(--text-primary, #1e293b);
    font-weight: 600;
}

[data-theme="dark"] .bdd-summary-content {
    color: var(--text-secondary, #94a3b8);
}

[data-theme="dark"] .bdd-summary-content strong {
    color: var(--text-primary, #f1f5f9);
}

.bdd-scroll-hint {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid var(--border, #e2e8f0);
}

/* =============================================
   ANALYSIS PROGRESS CARD (chat-triggered batch analysis)
   ============================================= */
.analysis-progress-card {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e0e7ff;
}
.analysis-progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.analysis-progress-title {
    color: #4338ca;
    flex: 1;
}
.analysis-stop-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.analysis-stop-btn:hover {
    background: #fecaca;
    border-color: #f87171;
}
.analysis-stop-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.analysis-progress-bar-track {
    background: #e0e7ff;
    border-radius: 6px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}
.analysis-progress-bar-fill {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    height: 100%;
    transition: width 0.4s ease;
    border-radius: 6px;
}
.analysis-progress-status {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 8px;
}
.analysis-leads-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 350px;
    overflow-y: auto;
    font-size: 13px;
}
.analysis-lead-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}
.analysis-lead-icon {
    font-size: 16px;
    color: #9ca3af;
    flex-shrink: 0;
}
.analysis-lead-name {
    color: var(--text-primary, #1f2937);
    flex-shrink: 0;
}
.analysis-lead-company {
    color: #6b7280;
    font-size: 12px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.analysis-lead-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}
.analysis-lead-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    transition: all 0.15s ease;
    padding: 0;
}
.analysis-lead-action-btn:hover {
    background: rgba(0,0,0,0.06);
    transform: scale(1.1);
}
.analysis-lead-action-btn:disabled {
    cursor: default;
    opacity: 0.7;
}
.analysis-lead-action-btn:disabled:hover {
    transform: none;
    background: transparent;
}
.analysis-lead-action-btn.linkedin-btn:hover {
    background: rgba(0,119,181,0.1);
}
.analysis-lead-action-btn.add-canvas-btn {
    color: #6366f1;
}
.analysis-lead-action-btn.add-canvas-btn:hover {
    background: rgba(99,102,241,0.1);
}
.analysis-more-text {
    color: #6b7280;
    font-size: 12px;
    padding: 4px 0;
}
.analysis-token-info {
    margin-top: 10px;
    font-size: 12px;
    color: #6b7280;
}

/* Dark mode for analysis progress card */
[data-theme="dark"] .analysis-progress-card {
    background: linear-gradient(135deg, #1e1b4b, #1e293b);
    border-color: #312e81;
}
[data-theme="dark"] .analysis-progress-title {
    color: #a5b4fc;
}
[data-theme="dark"] .analysis-progress-bar-track {
    background: #312e81;
}
[data-theme="dark"] .analysis-progress-status {
    color: #94a3b8;
}
[data-theme="dark"] .analysis-lead-icon {
    color: #64748b;
}
[data-theme="dark"] .analysis-lead-name {
    color: #e2e8f0;
}
[data-theme="dark"] .analysis-lead-company {
    color: #64748b;
}
[data-theme="dark"] .analysis-lead-action-btn:hover {
    background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .analysis-lead-action-btn.linkedin-btn:hover {
    background: rgba(0,119,181,0.2);
}
[data-theme="dark"] .analysis-lead-action-btn.add-canvas-btn {
    color: #818cf8;
}
[data-theme="dark"] .analysis-lead-action-btn.add-canvas-btn:hover {
    background: rgba(129,140,248,0.15);
}
[data-theme="dark"] .analysis-more-text {
    color: #64748b;
}
[data-theme="dark"] .analysis-token-info {
    color: #94a3b8;
}

/* Live analyze lead detail (expandable dropdown) - class-based so dark mode works */
.analysis-lead-detail { background: #f8fafc; color: #334155; }
[data-theme="dark"] .analysis-lead-detail { background: #181f33; color: #cbd5e1; }
[data-theme="dark"] .analysis-lead-chev { color: #64748b; }
.ald-why { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ald-why-badge { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ald-why-text { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .4px; }
.ald-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ald-fact { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; background: rgba(99,102,241,.08); color: #475569; padding: 2px 8px; border-radius: 6px; }
[data-theme="dark"] .ald-fact { background: rgba(255,255,255,.06); color: #cbd5e1; }
.ald-fact .material-icons { font-size: 13px; opacity: .8; }
.ald-flag { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.ald-flag.hiring { background: #dcfce7; color: #166534; }
.ald-flag.otw { background: #dbeafe; color: #1e40af; }
.ald-flag.premium { background: #fef3c7; color: #92400e; }
.ald-reason { font-size: 12px; line-height: 1.5; margin-bottom: 8px; }
.ald-section-h { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; margin: 9px 0 4px; }
.ald-act { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; margin: 3px 0; line-height: 1.45; }
.ald-act-i { font-size: 13px; color: #6366f1; flex-shrink: 0; margin-top: 1px; }
.ald-when { margin-left: auto; font-size: 10px; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }
.ald-src { color: #94a3b8; vertical-align: middle; }
.ald-src .material-icons { font-size: 12px; }
.ald-news { color: #6366f1; text-decoration: none; }
[data-theme="dark"] .ald-news { color: #a5b4fc; }
.ald-muted { font-size: 12px; color: #94a3b8; }
.ald-fail { color: #ef4444; font-size: 12px; padding-top: 4px; }
.ald-actions { margin-top: 10px; }
.ald-add { display: inline-flex; align-items: center; gap: 4px; background: #ede9fe; color: #6366f1; border: none; border-radius: 6px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
[data-theme="dark"] .ald-add { background: rgba(99,102,241,.18); color: #a5b4fc; }
.ald-add .material-icons { font-size: 14px; }

/* =============================================
   ANALYSIS REPORT CARDS (rich per-lead report)
   ============================================= */
.ar-report-card {
    background: var(--bg-primary, #ffffff);
    border-radius: 14px;
    border: 1px solid #e0e7ff;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(99,102,241,0.08);
}
.ar-report-header {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    padding: 16px 20px 12px;
}
.ar-report-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--text-primary, #1f2937);
}
.ar-report-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
    margin-left: 32px;
}
.ar-report-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
}
.ar-summary-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ar-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.ar-badge-high { background: #dcfce7; color: #166534; }
.ar-badge-med { background: #fef3c7; color: #92400e; }
.ar-badge-low { background: #fee2e2; color: #991b1b; }
.ar-summary-tokens {
    font-size: 12px;
    color: #6b7280;
}
/* Toolbar: search, sort, filter */
.ar-toolbar {
    padding: 10px 16px 8px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ar-search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.ar-search-icon {
    position: absolute;
    left: 10px;
    font-size: 18px;
    color: #9ca3af;
    pointer-events: none;
}
.ar-search-input {
    width: 100%;
    padding: 7px 12px 7px 34px;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary, #1f2937);
    background: var(--bg-primary, #fff);
    outline: none;
    transition: border-color 0.15s;
}
.ar-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}
.ar-search-input::placeholder {
    color: #9ca3af;
}
.ar-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ar-sort-control {
    flex-shrink: 0;
}
.ar-sort-select {
    padding: 5px 28px 5px 10px;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-primary, #374151);
    background: var(--bg-primary, #fff);
    cursor: pointer;
    outline: none;
    appearance: auto;
}
.ar-sort-select:focus {
    border-color: #6366f1;
}
.ar-filter-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}
.ar-filter-chip {
    padding: 4px 10px;
    border: 1px solid #e0e7ff;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.ar-filter-chip:hover {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}
.ar-filter-chip.ar-filter-active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}
.ar-results-count {
    display: none;
    padding: 4px 16px;
    font-size: 12px;
    color: #6b7280;
}

.ar-leads-container {
    padding: 8px 12px;
    max-height: 600px;
    overflow-y: auto;
}

/* Individual lead card */
.ar-lead-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin: 6px 0;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.ar-lead-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.ar-lead-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}
.ar-lead-header:hover {
    background: rgba(99,102,241,0.03);
}

/* Score ring */
.ar-lead-score-ring {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--score-bg);
    border: 2.5px solid var(--score-color);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ar-score-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--score-color);
}
.ar-lead-info {
    flex: 1;
    min-width: 0;
}
.ar-lead-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ar-lead-name-row strong {
    font-size: 14px;
    color: var(--text-primary, #1f2937);
}
.ar-intent-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.ar-lead-title {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}
.ar-lead-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.ar-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.ar-badge-hiring { background: #dcfce7; color: #166534; }
.ar-badge-otw { background: #dbeafe; color: #1e40af; }
.ar-badge-premium { background: #fef3c7; color: #92400e; }
.ar-badge-email { background: #f3f4f6; color: #374151; }
.ar-badge-conn { background: #f3f4f6; color: #374151; }

.ar-lead-actions-col {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.ar-expand-icon {
    font-size: 20px;
    color: #9ca3af;
    transition: transform 0.2s ease;
}
.ar-lead-card[data-expanded="true"] .ar-expand-icon {
    transform: rotate(180deg);
}

/* Expandable details section */
.ar-lead-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 14px;
    border-top: 0 solid transparent;
}
.ar-lead-card[data-expanded="true"] .ar-lead-details {
    max-height: 2000px;
    padding: 10px 14px 14px;
    border-top: 1px solid #e5e7eb;
    overflow-y: auto;
}

/* Source links in analysis report */
.ar-source-link {
    color: #6366f1;
    flex-shrink: 0;
    margin-left: 4px;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.ar-source-link:hover { opacity: 1; }
.ar-source-label {
    font-size: 10px;
    color: #94a3b8;
    margin-left: 4px;
    flex-shrink: 0;
}
.ar-dd-group {
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}
.ar-dd-group:last-child { border-bottom: none; }

.ar-section {
    margin-bottom: 10px;
}
.ar-section-title {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Signals */
.ar-signal-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-primary, #374151);
}
.ar-signal-icon {
    flex-shrink: 0;
}
.ar-signal-icon.ar-signal-warning { color: #f59e0b; }
.ar-signal-icon.ar-signal-success { color: #059669; }
.ar-signal-icon.ar-signal-info { color: #3b82f6; }
.ar-signal-icon.ar-signal-primary { color: #6366f1; }
.ar-signal-icon.ar-signal-default { color: #6b7280; }
.ar-signal-text {
    flex: 1;
}
.ar-signal-strength {
    width: 50px;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    flex-shrink: 0;
}
.ar-signal-strength-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

/* Activities */
.ar-activity-item {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}
.ar-activity-time {
    flex-shrink: 0;
    font-size: 11px;
    color: #9ca3af;
    min-width: 70px;
}
.ar-activity-content {
    color: var(--text-primary, #374151);
}

/* Reasoning */
.ar-reasoning p {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

/* Failed section */
.ar-failed-section {
    padding: 8px 20px 12px;
    border-top: 1px solid #fee2e2;
}
.ar-failed-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #991b1b;
    padding: 3px 0;
}

/* Footer */
.ar-report-footer {
    display: flex;
    justify-content: center;
    padding: 8px 20px 12px;
    border-top: 1px solid #f3f4f6;
}
.ar-expand-all-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    background: transparent;
    color: #6366f1;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ar-expand-all-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* =============================================
   ANALYSIS REPORT - DARK MODE
   ============================================= */
[data-theme="dark"] .ar-report-card {
    background: var(--bg-primary, #1a1a2e);
    border-color: #312e81;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
[data-theme="dark"] .ar-report-header {
    background: linear-gradient(135deg, #1e1b4b, #1e293b);
}
[data-theme="dark"] .ar-report-title-row {
    color: #e2e8f0;
}
[data-theme="dark"] .ar-report-subtitle {
    color: #94a3b8;
}
[data-theme="dark"] .ar-report-summary {
    border-bottom-color: #334155;
}
[data-theme="dark"] .ar-summary-tokens {
    color: #94a3b8;
}
[data-theme="dark"] .ar-lead-card {
    border-color: #334155;
}
[data-theme="dark"] .ar-lead-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
[data-theme="dark"] .ar-lead-header:hover {
    background: rgba(129,140,248,0.05);
}
[data-theme="dark"] .ar-lead-name-row strong {
    color: #e2e8f0;
}
[data-theme="dark"] .ar-lead-title {
    color: #94a3b8;
}
[data-theme="dark"] .ar-badge-email,
[data-theme="dark"] .ar-badge-conn {
    background: #1e293b;
    color: #94a3b8;
}
[data-theme="dark"] .ar-expand-icon {
    color: #64748b;
}
[data-theme="dark"] .ar-lead-card[data-expanded="true"] .ar-lead-details {
    border-top-color: #334155;
}
[data-theme="dark"] .ar-signal-item,
[data-theme="dark"] .ar-activity-content {
    color: #cbd5e1;
}
[data-theme="dark"] .ar-signal-strength {
    background: #334155;
}
[data-theme="dark"] .ar-activity-time {
    color: #64748b;
}
[data-theme="dark"] .ar-reasoning p {
    color: #94a3b8;
}
[data-theme="dark"] .ar-failed-section {
    border-top-color: #7f1d1d;
}
[data-theme="dark"] .ar-failed-item {
    color: #fca5a5;
}
[data-theme="dark"] .ar-report-footer {
    border-top-color: #334155;
}
[data-theme="dark"] .ar-toolbar {
    border-bottom-color: #334155;
}
[data-theme="dark"] .ar-search-input {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .ar-search-input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129,140,248,0.15);
}
[data-theme="dark"] .ar-search-input::placeholder {
    color: #64748b;
}
[data-theme="dark"] .ar-search-icon {
    color: #64748b;
}
[data-theme="dark"] .ar-sort-select {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .ar-sort-select:focus {
    border-color: #818cf8;
}
[data-theme="dark"] .ar-filter-chip {
    border-color: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .ar-filter-chip:hover {
    background: rgba(129,140,248,0.1);
    color: #818cf8;
    border-color: #4338ca;
}
[data-theme="dark"] .ar-filter-chip.ar-filter-active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}
[data-theme="dark"] .ar-results-count {
    color: #94a3b8;
}
[data-theme="dark"] .ar-expand-all-btn {
    border-color: #312e81;
    color: #818cf8;
}
[data-theme="dark"] .ar-expand-all-btn:hover {
    background: rgba(129,140,248,0.1);
    border-color: #4338ca;
}

/* Bulk Deep Dive Swiper/Carousel Styles */
.bdd-swiper-container {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 700px;
}

.bdd-swiper-wrapper {
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
}

.bdd-swiper-track {
    display: flex;
    transition: transform 0.3s ease-out;
}

.bdd-swiper-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

.bdd-swiper-card {
    background: linear-gradient(135deg, #00b3c9 0%, #0097a7 100%);
    border-radius: 12px;
    overflow: hidden;
    color: white;
}

.bdd-swiper-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.1);
}

.bdd-swiper-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bdd-swiper-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bdd-swiper-avatar .avatar-fallback {
    font-size: 20px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

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

.bdd-swiper-name {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bdd-swiper-title,
.bdd-swiper-company {
    font-size: 12px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bdd-swiper-confidence {
    text-align: center;
}

.confidence-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: conic-gradient(
        rgba(255, 255, 255, 0.9) var(--confidence, 0%),
        rgba(255, 255, 255, 0.2) var(--confidence, 0%)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.confidence-circle span {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bdd-swiper-body {
    padding: 16px;
    background: var(--bg-primary, white);
    color: var(--text-primary, #1e293b);
    max-height: 250px;
    overflow-y: auto;
}

[data-theme="dark"] .bdd-swiper-body {
    background: var(--bg-secondary, #1e293b);
    color: var(--text-primary, #f1f5f9);
}

.bdd-swiper-section {
    margin-bottom: 12px;
}

.bdd-swiper-section:last-child {
    margin-bottom: 0;
}

.bdd-swiper-section h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-primary, #1e293b);
}

[data-theme="dark"] .bdd-swiper-section h4 {
    color: var(--text-primary, #f1f5f9);
}

.bdd-swiper-insight {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 3px solid #00b3c9;
}

[data-theme="dark"] .bdd-swiper-insight {
    background: rgba(0, 179, 201, 0.1);
}

.bdd-swiper-insight .insight-type {
    font-size: 10px;
    font-weight: 600;
    color: #00b3c9;
    text-transform: uppercase;
    white-space: nowrap;
}

.bdd-swiper-insight .insight-content {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    line-height: 1.4;
}

.bdd-swiper-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bdd-swiper-topics .topic-tag {
    background: linear-gradient(135deg, #00b3c9, #0097a7);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.bdd-swiper-footer {
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.1);
    text-align: center;
}

.bdd-slide-counter {
    font-size: 12px;
    opacity: 0.9;
    color: white;
}

/* Navigation Buttons */
.bdd-swiper-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-primary, #1e293b);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.bdd-swiper-nav:hover:not(:disabled) {
    background: #00b3c9;
    color: white;
}

.bdd-swiper-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

[data-theme="dark"] .bdd-swiper-nav {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary, #f1f5f9);
}

/* Dots Navigation */
.bdd-swiper-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
}

.bdd-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color, #cbd5e1);
    cursor: pointer;
    transition: all 0.2s;
}

.bdd-dot:hover {
    background: #00b3c9;
    opacity: 0.7;
}

.bdd-dot.active {
    background: #00b3c9;
    width: 24px;
    border-radius: 4px;
}

[data-theme="dark"] .bdd-dot {
    background: rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .bdd-dot.active {
    background: #00b3c9;
}

/* Additional swiper card content styles */
.bdd-swiper-about {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
    padding: 10px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
    font-style: italic;
}

[data-theme="dark"] .bdd-swiper-about {
    background: rgba(0, 179, 201, 0.08);
}

.bdd-swiper-starters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bdd-swiper-starters .starter-item {
    font-size: 12px;
    color: var(--text-secondary, #475569);
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(0, 179, 201, 0.08), rgba(0, 151, 167, 0.05));
    border-radius: 8px;
    border-left: 3px solid #00b3c9;
}

.bdd-swiper-media {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 6px;
    margin-bottom: 4px;
}

.bdd-swiper-media .media-type {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    background: #00b3c9;
    padding: 2px 6px;
    border-radius: 4px;
}

.bdd-swiper-media .media-title {
    font-size: 12px;
    color: var(--text-primary, #334155);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bdd-swiper-no-data {
    text-align: center;
    padding: 20px;
    color: var(--text-muted, #94a3b8);
    font-size: 13px;
    font-style: italic;
}

/* ============================================
   ENRICHMENT ACTION CARD - Add to Canvas Button
   ============================================ */

.eac-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 12px;
}

.eac-message {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

.eac-add-to-canvas {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #00b3c9, #0097a7);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eac-add-to-canvas:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
}

.eac-add-to-canvas .material-icons {
    font-size: 18px;
}

.eac-add-to-canvas.added {
    background: #22c55e;
    pointer-events: none;
}

/* ============================================
   BULK ENRICHMENT SWIPER STYLES
   ============================================ */

.bulk-enrichment-results {
    max-width: 100%;
}

.enrich-swiper-header-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(0, 179, 201, 0.1), rgba(0, 151, 167, 0.05));
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid rgba(0, 179, 201, 0.2);
}

.enrich-swiper-header-summary .material-icons {
    font-size: 28px;
    color: #00b3c9;
}

.enrich-summary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.enrich-summary-text strong {
    font-size: 15px;
    color: var(--text-primary, #1e293b);
}

.enrich-summary-text span {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

.enrich-swiper-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary, #f8fafc);
}

.enrich-swiper-nav {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.enrich-swiper-nav:hover:not(:disabled) {
    background: #00b3c9;
    color: white;
}

.enrich-swiper-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.enrich-swiper-wrapper {
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
}

.enrich-swiper-track {
    display: flex;
    transition: transform 0.3s ease;
}

.enrich-swiper-slide {
    flex: 0 0 100%;
    padding: 0 4px;
}

.enrich-swiper-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.enrich-swiper-card.success {
    border-top: 3px solid #22c55e;
}

.enrich-swiper-card.partial {
    border-top: 3px solid #f59e0b;
}

.enrich-swiper-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #00b3c9 0%, #0097a7 100%);
    color: white;
}

.enrich-swiper-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.enrich-swiper-info {
    flex: 1;
}

.enrich-swiper-name {
    font-size: 16px;
    font-weight: 600;
}

.enrich-swiper-title,
.enrich-swiper-company {
    font-size: 12px;
    opacity: 0.9;
}

.enrich-swiper-body {
    padding: 16px;
}

.enrich-contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.enrich-contact-row.found {
    background: rgba(34, 197, 94, 0.08);
}

.enrich-contact-row.not-found {
    background: rgba(239, 68, 68, 0.05);
}

.enrich-contact-row .material-icons {
    font-size: 20px;
    color: #00b3c9;
}

.enrich-contact-row.not-found .material-icons {
    color: #94a3b8;
}

.enrich-contact-row a {
    flex: 1;
    color: #00b3c9;
    text-decoration: none;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.enrich-contact-row .not-found {
    color: #ef4444;
    font-size: 13px;
}

.enrich-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: #22c55e;
    color: white;
    border-radius: 10px;
    font-weight: 500;
}

.enrich-copy {
    padding: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.enrich-copy:hover {
    background: rgba(0, 179, 201, 0.1);
    color: #00b3c9;
}

.enrich-copy .material-icons {
    font-size: 16px;
}

.enrich-swiper-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary, #f8fafc);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.enrich-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #00b3c9, #0097a7);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.enrich-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
}

.enrich-add-btn.added {
    background: #22c55e;
    pointer-events: none;
}

.enrich-slide-counter {
    font-size: 13px;
    color: var(--text-muted, #64748b);
    background: white;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.enrich-swiper-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 0 0 12px 12px;
}

.enrich-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.enrich-dot.active {
    background: #00b3c9;
    transform: scale(1.2);
}

.enrich-dot:hover:not(.active) {
    background: #94a3b8;
}

/* ===============================
   CAROUSEL RESULT STYLES
   =============================== */

/* ===============================
   CAROUSEL RESULT CARD
   =============================== */
.carousel-result-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 640px;
    margin: 16px 0;
    border: 1px solid rgba(0, 179, 201, 0.15);
}

.carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(0, 179, 201, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.carousel-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #00b3c9 0%, #0077b6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-header-icon .material-icons {
    color: #fff;
    font-size: 22px;
}

.carousel-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.carousel-title {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
    line-height: 1.2;
}

.carousel-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.carousel-template {
    background: rgba(0, 179, 201, 0.15);
    color: #00b3c9;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
    border: 1px solid rgba(0, 179, 201, 0.2);
}

.carousel-viewer {
    position: relative;
    display: flex;
    align-items: center;
    padding: 20px 10px;
    background: rgba(0, 0, 0, 0.15);
}

.carousel-nav {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.carousel-nav:hover {
    background: rgba(0, 179, 201, 0.25);
    border-color: rgba(0, 179, 201, 0.4);
}

.carousel-nav .material-icons {
    color: #fff;
    font-size: 22px;
}

.carousel-slides-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.3s ease;
    width: 100%;
}

.carousel-slide.active {
    display: flex;
}

.carousel-image {
    max-width: 100%;
    max-height: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.carousel-slide-info {
    text-align: center;
    padding: 0 20px;
}

.carousel-slide-info .slide-title {
    display: block;
    color: #00b3c9;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.carousel-slide-info .slide-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.4;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-dot.active {
    background: #00b3c9;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(0, 179, 201, 0.4);
}

.carousel-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.45);
}

.carousel-slide-counter {
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    font-weight: 500;
}

/* Unified Action Bar */
.carousel-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
    gap: 12px;
}

.carousel-action-group {
    display: flex;
    gap: 4px;
}

.carousel-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.75);
}

.carousel-action-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.carousel-action-btn .material-icons {
    font-size: 17px;
}

.carousel-action-btn.carousel-post-cta {
    background: linear-gradient(135deg, #0077b5 0%, #005e94 100%);
    color: #fff;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
}

.carousel-action-btn.carousel-post-cta:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

/* Light mode */
body:not(.dark-mode) .carousel-result-card {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body:not(.dark-mode) .carousel-header {
    background: rgba(0, 119, 181, 0.06);
    border-color: #eee;
}

body:not(.dark-mode) .carousel-title {
    color: #1a1a2e;
}

body:not(.dark-mode) .carousel-subtitle {
    color: #888;
}

body:not(.dark-mode) .carousel-viewer {
    background: #f8f9fa;
}

body:not(.dark-mode) .carousel-nav {
    background: #fff;
    border-color: #ddd;
}

body:not(.dark-mode) .carousel-nav .material-icons {
    color: #333;
}

body:not(.dark-mode) .carousel-nav:hover {
    background: rgba(0, 179, 201, 0.1);
    border-color: #00b3c9;
}

body:not(.dark-mode) .carousel-dot {
    background: #ccc;
}

body:not(.dark-mode) .carousel-slide-counter {
    color: #999;
}

body:not(.dark-mode) .carousel-slide-info .slide-text {
    color: #555;
}

body:not(.dark-mode) .carousel-action-bar {
    background: #f8f9fa;
    border-color: #eee;
}

body:not(.dark-mode) .carousel-action-btn {
    background: #eee;
    color: #555;
}

body:not(.dark-mode) .carousel-action-btn:hover {
    background: #ddd;
    color: #222;
}

body:not(.dark-mode) .carousel-action-btn.carousel-post-cta {
    background: linear-gradient(135deg, #0077b5 0%, #005e94 100%);
    color: #fff;
}

/* ===============================
   CAROUSEL POST CARD UI
   =============================== */

.carousel-post-card {
    background: linear-gradient(135deg, #0d3b47 0%, #11495a 50%, #0d3b47 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 720px;
    margin: 16px 0;
    border: 1px solid rgba(20, 170, 170, 0.2);
}

.carousel-post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(20, 170, 170, 0.1);
    border-bottom: 1px solid rgba(20, 170, 170, 0.15);
}

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

.cpc-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0077b5 0%, #005e94 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpc-header-icon .material-icons {
    color: #fff;
    font-size: 22px;
}

.cpc-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cpc-title {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
}

.cpc-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

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

.cpc-pdf-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(231, 76, 60, 0.25);
    transition: all 0.2s ease;
}

.cpc-pdf-badge:hover {
    background: rgba(231, 76, 60, 0.25);
    text-decoration: none;
}

.cpc-pdf-badge .material-icons {
    font-size: 14px;
}

.carousel-post-badge {
    background: rgba(20, 170, 170, 0.2);
    color: #14aaaa;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(20, 170, 170, 0.25);
}

/* Two-column body layout */
.cpc-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0;
    min-height: 280px;
}

.cpc-preview-col {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.15);
}

.cpc-preview-label {
    padding: 10px 14px 6px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.carousel-post-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 14px 12px;
    overflow-y: auto;
    flex: 1;
}

.carousel-post-thumb {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 65px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
    cursor: pointer;
}

.carousel-post-thumb:hover {
    border-color: #14aaaa;
    transform: scale(1.05);
}

.carousel-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-post-thumb .thumb-num {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.cpc-account-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cpc-account-row .material-icons {
    color: #14aaaa;
    font-size: 20px;
    flex-shrink: 0;
}

.carousel-account-select {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 7px 8px;
    color: #fff;
    font-size: 12px;
}

.cpc-editor-col {
    display: flex;
    flex-direction: column;
}

.carousel-post-editor {
    padding: 12px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.carousel-post-editor label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.carousel-post-editor label .material-icons {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
}

.carousel-post-textarea {
    width: 100%;
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    min-height: 200px;
}

.carousel-post-textarea:focus {
    outline: none;
    border-color: #14aaaa;
    box-shadow: 0 0 0 2px rgba(20, 170, 170, 0.15);
}

.carousel-post-actions {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.1);
}

.carousel-post-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-post-btn .material-icons {
    font-size: 17px;
}

.carousel-post-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.carousel-post-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.carousel-post-btn.primary {
    background: linear-gradient(135deg, #0077b5 0%, #005e94 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 119, 181, 0.25);
}

.carousel-post-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 119, 181, 0.35);
    filter: brightness(1.1);
}

.carousel-posted-success {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2ecc71;
    font-weight: 500;
}

.carousel-posted-success .material-icons {
    font-size: 24px;
}

.carousel-post-card.posted {
    border: 2px solid #2ecc71;
}

/* Light mode for post card */
body:not(.dark-mode) .carousel-post-card {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body:not(.dark-mode) .carousel-post-header {
    background: rgba(0, 119, 181, 0.05);
    border-color: #eee;
}

body:not(.dark-mode) .cpc-title {
    color: #1a1a2e;
}

body:not(.dark-mode) .cpc-subtitle {
    color: #888;
}

body:not(.dark-mode) .cpc-preview-col {
    background: #f8f9fa;
    border-color: #eee;
}

body:not(.dark-mode) .cpc-preview-label {
    color: #999;
}

body:not(.dark-mode) .carousel-post-thumb {
    border-color: #ddd;
}

body:not(.dark-mode) .cpc-account-row {
    border-color: #eee;
}

body:not(.dark-mode) .carousel-account-select {
    background: #fff;
    border-color: #ddd;
    color: #333;
}

body:not(.dark-mode) .carousel-post-editor label {
    color: #888;
}

body:not(.dark-mode) .carousel-post-editor label .material-icons {
    color: #aaa;
}

body:not(.dark-mode) .carousel-post-textarea {
    background: #fff;
    border-color: #ddd;
    color: #333;
}

body:not(.dark-mode) .carousel-post-textarea:focus {
    border-color: #0077b5;
    box-shadow: 0 0 0 2px rgba(0, 119, 181, 0.1);
}

body:not(.dark-mode) .carousel-post-actions {
    background: #f8f9fa;
    border-color: #eee;
}

body:not(.dark-mode) .carousel-post-btn.secondary {
    background: #f0f0f0;
    color: #555;
    border-color: #ddd;
}

body:not(.dark-mode) .carousel-post-btn.secondary:hover {
    background: #e0e0e0;
    color: #333;
}

/* Responsive: stack on small screens */
@media (max-width: 600px) {
    .cpc-body {
        grid-template-columns: 1fr;
    }

    .cpc-preview-col {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .carousel-post-thumbnails {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .carousel-post-actions {
        flex-direction: column;
    }

    .carousel-post-btn {
        justify-content: center;
    }
}

/* ===============================
   CAROUSEL EDIT PANEL STYLES
   =============================== */

.carousel-edit-panel {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(20, 170, 170, 0.3);
    padding: 16px;
    margin-top: 8px;
}

.edit-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #14aaaa;
    font-weight: 600;
    margin-bottom: 16px;
}

.edit-panel-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.edit-panel-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.edit-panel-header .material-icons {
    font-size: 20px;
}

.edit-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.edit-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.edit-control label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
}

.edit-control input[type="range"] {
    width: 100%;
    accent-color: #14aaaa;
}

.edit-control input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.edit-control select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}

.edit-control select option {
    background: #1a1a2e;
    color: #fff;
}

.edit-control span {
    color: #14aaaa;
    font-size: 12px;
    font-weight: 500;
}

.edit-panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.edit-btn.primary {
    background: linear-gradient(135deg, #14aaaa 0%, #0d7a7a 100%);
    color: #fff;
}

.edit-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.edit-btn .material-icons {
    font-size: 16px;
}

/* ===============================
   CAROUSEL POST SUCCESS MESSAGE
   =============================== */

.carousel-success-message {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #0d3b47 0%, #145566 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    border-left: 4px solid #2ecc71;
}

.carousel-success-message .success-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(46, 204, 113, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-success-message .success-icon .material-icons {
    font-size: 28px;
    color: #2ecc71;
}

.carousel-success-message .success-content h4 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 16px;
}

.carousel-success-message .success-content p {
    margin: 0 0 12px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.carousel-success-message .view-post-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #14aaaa;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.carousel-success-message .view-post-link:hover {
    background: #0d7a7a;
}

.carousel-success-message .view-post-link .material-icons {
    font-size: 16px;
}

.posted-content-preview {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.posted-content-preview .preview-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.posted-content-preview .preview-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ===============================
   STYLED IMAGE RESULT STYLES
   =============================== */

.styled-image-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-width: 500px;
    margin: 16px 0;
}

.styled-image-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(0, 179, 201, 0.08);
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.styled-image-header .material-icons {
    color: #00b3c9;
    font-size: 24px;
}

.styled-image-title {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    font-size: 16px;
}

.styled-image-template {
    margin-left: auto;
    background: rgba(0, 179, 201, 0.2);
    color: #00b3c9;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    text-transform: capitalize;
}

.styled-image-preview {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.styled-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.styled-image-actions {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    justify-content: center;
    border-top: 1px solid var(--border, #e2e8f0);
}

.styled-image-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.styled-image-btn.download {
    background: linear-gradient(135deg, #00b3c9 0%, #0077b6 100%);
    color: #fff;
}

.styled-image-btn.use-in-post {
    background: var(--card-bg, #fff);
    color: var(--text-primary, #1e293b);
    border: 1px solid var(--border, #e2e8f0);
}

.styled-image-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.3);
}

.styled-image-btn .material-icons {
    font-size: 18px;
}

.styled-image-footer {
    padding: 12px 20px;
    background: var(--bg-secondary, rgba(0, 0, 0, 0.03));
    text-align: center;
}

.styled-image-message {
    color: var(--text-secondary, #64748b);
    font-size: 13px;
}

/* Dark mode - the card vars (--card-bg/--text-primary/--border-color) aren't part
   of chat.css's theme system, so set explicit dark surfaces here. Also covers the
   newsletter card, which reuses .styled-image-card. */
[data-theme="dark"] .styled-image-card {
    background: #2f2f2f;
    border-color: #3e3e4e;
}
[data-theme="dark"] .styled-image-header {
    background: rgba(0, 212, 230, 0.10);
    border-bottom-color: #3e3e4e;
}
[data-theme="dark"] .styled-image-title { color: #ececf1; }
[data-theme="dark"] .styled-image-actions { border-top-color: #3e3e4e; }
[data-theme="dark"] .styled-image-btn.use-in-post {
    background: #2f2f2f;
    color: #ececf1;
    border-color: #3e3e4e;
}
[data-theme="dark"] .styled-image-footer { background: #262626; }
[data-theme="dark"] .styled-image-message { color: #c5c5d2; }

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* =========================================================================
   AGENT & SEQUENCE CARDS IN CHAT
   ========================================================================= */

/* Agent List Grid */
.agent-list-container {
    padding: 16px 0;
}

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

/* Agent Card */
.chat-agent-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #9ca3af;
}

.chat-agent-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.chat-agent-card.active {
    border-left-color: #10b981;
}

.chat-agent-layout {
    display: flex;
    gap: 16px;
}

.chat-agent-robot {
    position: relative;
    flex-shrink: 0;
}

.chat-agent-robot-img {
    width: 80px;
    height: 100px;
    object-fit: contain;
}

.chat-robot-glow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 12px;
    border-radius: 50%;
}

.chat-robot-glow.online {
    background: radial-gradient(ellipse, rgba(16, 185, 129, 0.5) 0%, transparent 70%);
    animation: glow-pulse 2s ease-in-out infinite;
}

.chat-robot-glow.offline {
    background: radial-gradient(ellipse, rgba(156, 163, 175, 0.3) 0%, transparent 70%);
}

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

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

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

.chat-agent-name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.chat-agent-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.chat-agent-type.leads {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.chat-agent-type.posts {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.chat-agent-type.both {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.chat-agent-details {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
}

.chat-agent-details i {
    margin-right: 4px;
    color: #9ca3af;
}

.chat-agent-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.chat-agent-stat {
    text-align: center;
}

.chat-agent-stat .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.chat-agent-stat .stat-label {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
}

.chat-agent-progress {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.chat-agent-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.chat-agent-actions {
    display: flex;
    gap: 8px;
}

.chat-agent-btn {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.chat-agent-btn:hover {
    background: #f3f4f6;
}

.chat-agent-btn.primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
}

.chat-agent-btn.primary:hover {
    transform: scale(1.02);
}

.chat-agent-btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-agent-btn.danger {
    color: #ef4444;
}

.chat-agent-btn.danger:hover {
    background: #fef2f2;
}

/* Agent Preview Card */
.agent-preview-container, .sequence-preview-container {
    padding: 16px 0;
}

.chat-agent-preview-card, .chat-sequence-preview-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px dashed #10b981;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.preview-icon {
    flex-shrink: 0;
}

.preview-robot-img {
    width: 60px;
    height: 75px;
    object-fit: contain;
}

.preview-icon.sequence-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.preview-title h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #1f2937;
}

.preview-badge {
    display: inline-block;
    padding: 2px 10px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.preview-details {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.preview-row i {
    color: #6b7280;
    width: 16px;
    text-align: center;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.preview-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.preview-btn.primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
}

.preview-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.preview-btn.secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.preview-btn.secondary:hover {
    background: #e5e7eb;
}

/* Agent Result Card */
.agent-result-container {
    padding: 16px 0;
}

.chat-agent-result-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.chat-agent-result-card.success {
    border-left: 4px solid #10b981;
}

.chat-agent-result-card.error {
    border-left: 4px solid #ef4444;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.result-header i {
    font-size: 24px;
}

.chat-agent-result-card.success .result-header i {
    color: #10b981;
}

.chat-agent-result-card.error .result-header i {
    color: #ef4444;
}

.result-header h4 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
}

.result-stats {
    display: flex;
    gap: 24px;
    background: #f9fafb;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.result-stat {
    text-align: center;
}

.result-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.result-stat-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
}

.result-message {
    padding: 12px;
    background: #f3f4f6;
    border-radius: 8px;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 16px;
}

.result-actions {
    display: flex;
    gap: 12px;
}

.result-btn {
    padding: 10px 16px;
    border-radius: 8px;
    background: #f3f4f6;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-btn:hover {
    background: #e5e7eb;
}

/* Agent Analysis Card */
.agent-analysis-container {
    padding: 16px 0;
}

.chat-agent-analysis-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.analysis-robot-img {
    width: 50px;
    height: 65px;
    object-fit: contain;
}

.analysis-title h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #1f2937;
}

.analysis-period {
    font-size: 12px;
    color: #6b7280;
}

.analysis-status {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.analysis-status.active {
    background: #d1fae5;
    color: #059669;
}

.analysis-status.paused {
    background: #f3f4f6;
    color: #6b7280;
}

.analysis-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: #f9fafb;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.analysis-stat {
    text-align: center;
}

.analysis-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.analysis-stat-label {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
}

.analysis-logs {
    margin-bottom: 16px;
}

.analysis-logs h5 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #6b7280;
}

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

.log-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 12px;
}

.log-item.success {
    border-left: 3px solid #10b981;
}

.log-item.error {
    border-left: 3px solid #ef4444;
}

.log-time {
    color: #6b7280;
}

.log-status {
    font-weight: 600;
}

.log-item.success .log-status {
    color: #10b981;
}

.log-item.error .log-status {
    color: #ef4444;
}

.log-stats {
    margin-left: auto;
    color: #9ca3af;
}

.analysis-actions {
    display: flex;
    gap: 12px;
}

.analysis-btn {
    padding: 10px 16px;
    border-radius: 8px;
    background: #f3f4f6;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-btn:hover {
    background: #e5e7eb;
}

.analysis-btn.primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.analysis-btn.primary:hover {
    transform: scale(1.02);
}

.analysis-btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sequence List */
.sequence-list-container {
    padding: 16px 0;
}

.sequence-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.chat-sequence-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #6b7280;
    transition: all 0.3s ease;
}

.chat-sequence-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.chat-sequence-card.active {
    border-left-color: #10b981;
}

.chat-sequence-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.chat-sequence-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.chat-sequence-title h4 {
    margin: 0;
    font-size: 15px;
    color: #1f2937;
}

.chat-sequence-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.chat-sequence-status.active {
    background: #d1fae5;
    color: #059669;
}

.chat-sequence-status.draft {
    background: #f3f4f6;
    color: #6b7280;
}

.chat-sequence-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.steps-preview {
    display: flex;
    align-items: center;
    gap: 4px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4285f4;
}

.step-connector {
    width: 8px;
    height: 2px;
    background: #d1d5db;
}

.more-steps {
    font-size: 10px;
    color: #6b7280;
    margin-left: 4px;
}

.steps-count {
    font-size: 12px;
    color: #6b7280;
}

.chat-sequence-actions {
    display: flex;
    gap: 8px;
}

.chat-sequence-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chat-sequence-btn:hover {
    background: #f3f4f6;
}

.chat-sequence-btn.primary {
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    color: white;
    border: none;
}

.chat-sequence-btn.primary:hover {
    transform: scale(1.02);
}

/* Sequence Preview Timeline */
.preview-steps-timeline {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.timeline-step:last-child {
    border-bottom: none;
}

.timeline-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-action {
    display: block;
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.timeline-subject {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.timeline-delay {
    font-size: 12px;
    color: #9ca3af;
}

/* Created Success Cards */
.chat-agent-created-card, .chat-sequence-created-card {
    background: #d1fae5;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.created-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.created-header i {
    font-size: 28px;
    color: #059669;
}

.created-header h4 {
    margin: 0;
    font-size: 18px;
    color: #059669;
}

.chat-agent-created-card p, .chat-sequence-created-card p {
    color: #065f46;
    margin: 0 0 16px 0;
}

.created-actions {
    display: flex;
    justify-content: center;
}

.created-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.created-btn.primary {
    background: #059669;
    color: white;
}

.created-btn.primary:hover {
    background: #047857;
}

/* =========================================================================
   EMAIL DRAFT CARD
   ========================================================================= */

.chat-email-draft-card {
    background: linear-gradient(145deg, #ffffff, #f0faf9);
    border-radius: 16px;
    padding: 0;
    border: 1px solid #99d5cf;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 12px 0;
}

.chat-email-draft-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.15);
}

.ced-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    flex-wrap: wrap;
}

.ced-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ced-title {
    font-weight: 600;
    font-size: 15px;
}

.ced-recipient {
    font-size: 13px;
    opacity: 0.9;
    margin-left: auto;
}

/* Lead search in email card header */
.ced-lead-search-wrap {
    width: 100%;
    margin-top: 8px;
    position: relative;
}

.ced-lead-search {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.ced-lead-search::placeholder {
    color: rgba(255,255,255,0.7);
}

.ced-lead-search:focus {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.2);
}

.ced-lead-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    pointer-events: none;
}

.ced-lead-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}

.ced-lead-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

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

.ced-lead-item:hover {
    background: #f0fdfa;
}

.ced-lead-item-name {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}

.ced-lead-item-detail {
    font-size: 11px;
    color: #64748b;
}

[data-theme="dark"] .ced-lead-results {
    background: #2c3338;
    border-color: #4f5963;
}

[data-theme="dark"] .ced-lead-item:hover {
    background: #3f454c;
}

[data-theme="dark"] .ced-lead-item-name {
    color: #e8eaed;
}

.ced-tone-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.ced-body {
    padding: 20px;
}

.ced-field {
    margin-bottom: 16px;
}

.ced-field:last-child {
    margin-bottom: 0;
}

.ced-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ced-subject-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    background: white;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.ced-subject-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-10);
}

.ced-body-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    color: #374151;
    background: white;
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
    font-family: inherit;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.ced-body-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-10);
}

.ced-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.ced-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.ced-btn.primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.ced-btn.primary:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.ced-btn.secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.ced-btn.secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* =========================================================================
   EMAIL SEND CONFIRMATION MODAL
   ========================================================================= */

.ced-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(2px);
}

.ced-confirm-overlay.visible {
    opacity: 1;
}

.ced-confirm-modal {
    background: white;
    border-radius: 16px;
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.ced-confirm-overlay.visible .ced-confirm-modal {
    transform: scale(1);
}

.ced-confirm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    border-radius: 16px 16px 0 0;
    font-weight: 600;
    font-size: 15px;
}

.ced-confirm-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
}

.ced-confirm-close:hover {
    opacity: 1;
}

.ced-confirm-body {
    padding: 20px;
}

.ced-confirm-field {
    margin-bottom: 14px;
}

.ced-confirm-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ced-confirm-value {
    font-size: 14px;
    color: #1f2937;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.ced-confirm-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: white;
    cursor: pointer;
}

.ced-confirm-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-10);
}

.ced-confirm-preview {
    font-size: 13px;
    color: #374151;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    white-space: pre-wrap;
    line-height: 1.6;
    max-height: 180px;
    overflow-y: auto;
}

.ced-confirm-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    background: #f0fdfa;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ccfbf1;
}

.ced-confirm-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
}

[data-theme="dark"] .ced-confirm-modal {
    background: #2c3338;
}

[data-theme="dark"] .ced-confirm-value,
[data-theme="dark"] .ced-confirm-preview {
    background: #1e2428;
    border-color: #4f5963;
    color: #e8eaed;
}

[data-theme="dark"] .ced-confirm-select {
    background: #1e2428;
    border-color: #4f5963;
    color: #e8eaed;
}

[data-theme="dark"] .ced-confirm-note {
    background: rgba(13, 148, 136, 0.1);
    border-color: rgba(13, 148, 136, 0.2);
    color: #9ca3af;
}

[data-theme="dark"] .ced-confirm-field label {
    color: #9ca3af;
}

[data-theme="dark"] .ced-confirm-actions {
    border-top-color: #3f454c;
}

/* =========================================================================
   LINKEDIN MESSAGE CARD
   ========================================================================= */

.chat-linkedin-msg-card {
    background: linear-gradient(145deg, #ffffff, #f0faf9);
    border-radius: 16px;
    padding: 0;
    border: 1px solid #99d5cf;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 12px 0;
}

.chat-linkedin-msg-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.15);
}

.clm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
}

.clm-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.clm-info {
    flex: 1;
}

.clm-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.clm-recipient {
    font-size: 15px;
    font-weight: 600;
}

.clm-body {
    padding: 20px;
}

.clm-message {
    background: white;
    border: 1px solid #ccfbf1;
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

.clm-char-count {
    margin-top: 8px;
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.clm-char-count.warning {
    color: #f59e0b;
}

.clm-char-count.over {
    color: #ef4444;
    font-weight: 600;
}

.clm-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #ccfbf1;
    background: #f0fdfa;
}

.clm-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.clm-btn.primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.clm-btn.primary:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.clm-btn.secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.clm-btn.secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* =========================================================================
   LINKEDIN COMMENT CARD
   ========================================================================= */

.chat-linkedin-cmt-card {
    background: linear-gradient(145deg, #ffffff, #f0faf9);
    border-radius: 16px;
    padding: 0;
    border: 1px solid #99d5cf;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 12px 0;
}

.chat-linkedin-cmt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.15);
}

.clc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
}

.clc-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.clc-info {
    flex: 1;
}

.clc-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.clc-target {
    font-size: 14px;
    font-weight: 500;
}

.clc-topic {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.clc-body {
    padding: 20px;
}

.clc-comment {
    background: white;
    border: 1px solid #ccfbf1;
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

.clc-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #ccfbf1;
    background: #f0fdfa;
}

.clc-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.clc-btn.primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.clc-btn.primary:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.clc-btn.secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.clc-btn.secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* =========================================================================
   DARK MODE - EMAIL DRAFT, LINKEDIN MSG, LINKEDIN COMMENT
   ========================================================================= */

[data-theme="dark"] .chat-email-draft-card {
    background: linear-gradient(145deg, #2c3338, #1e2428);
    border-color: #3b4f6b;
}

[data-theme="dark"] .ced-body {
    background: transparent;
}

[data-theme="dark"] .ced-label {
    color: #9ca3af;
}

[data-theme="dark"] .ced-subject-input,
[data-theme="dark"] .ced-body-input {
    background: #1e2428;
    border-color: #4f5963;
    color: #e8eaed;
}

[data-theme="dark"] .ced-subject-input:focus,
[data-theme="dark"] .ced-body-input:focus {
    border-color: var(--primary-light);
}

[data-theme="dark"] .ced-actions {
    background: #252a2e;
    border-top-color: #3f454c;
}

[data-theme="dark"] .ced-btn.secondary {
    background: #3f454c;
    border-color: #4f5963;
    color: #e8eaed;
}

[data-theme="dark"] .ced-btn.secondary:hover {
    background: #4f5963;
}

[data-theme="dark"] .chat-linkedin-msg-card {
    background: linear-gradient(145deg, #2c3338, #1e2428);
    border-color: #2d5986;
}

[data-theme="dark"] .clm-message {
    background: #1e2428;
    border-color: #3f454c;
    color: #e8eaed;
}

[data-theme="dark"] .clm-actions {
    background: #252a2e;
    border-top-color: #3f454c;
}

[data-theme="dark"] .clm-btn.secondary {
    background: #3f454c;
    border-color: #4f5963;
    color: #e8eaed;
}

[data-theme="dark"] .clm-btn.secondary:hover {
    background: #4f5963;
}

[data-theme="dark"] .chat-linkedin-cmt-card {
    background: linear-gradient(145deg, #2c3338, #1e2428);
    border-color: #5b3d99;
}

[data-theme="dark"] .clc-comment {
    background: #1e2428;
    border-color: #3f454c;
    color: #e8eaed;
}

[data-theme="dark"] .clc-actions {
    background: #252a2e;
    border-top-color: #3f454c;
}

[data-theme="dark"] .clc-btn.secondary {
    background: #3f454c;
    border-color: #4f5963;
    color: #e8eaed;
}

[data-theme="dark"] .clc-btn.secondary:hover {
    background: #4f5963;
}

/* Dark mode support */
[data-theme="dark"] .chat-agent-card,
[data-theme="dark"] .chat-agent-preview-card,
[data-theme="dark"] .chat-agent-result-card,
[data-theme="dark"] .chat-agent-analysis-card,
[data-theme="dark"] .chat-sequence-card,
[data-theme="dark"] .chat-sequence-preview-card {
    background: #2c3338;
    color: #e8eaed;
}

[data-theme="dark"] .chat-agent-name,
[data-theme="dark"] .preview-title h3,
[data-theme="dark"] .result-header h4,
[data-theme="dark"] .analysis-title h4,
[data-theme="dark"] .chat-sequence-title h4,
[data-theme="dark"] .timeline-subject {
    color: #e8eaed;
}

[data-theme="dark"] .chat-agent-stat .stat-value,
[data-theme="dark"] .result-stat-value,
[data-theme="dark"] .analysis-stat-value {
    color: #e8eaed;
}

[data-theme="dark"] .preview-details,
[data-theme="dark"] .result-stats,
[data-theme="dark"] .analysis-stats,
[data-theme="dark"] .chat-sequence-steps,
[data-theme="dark"] .preview-steps-timeline,
[data-theme="dark"] .logs-list .log-item {
    background: #3f454c;
}

[data-theme="dark"] .chat-agent-btn,
[data-theme="dark"] .chat-sequence-btn,
[data-theme="dark"] .preview-btn.secondary,
[data-theme="dark"] .result-btn,
[data-theme="dark"] .analysis-btn {
    background: #3f454c;
    border-color: #4f5963;
    color: #e8eaed;
}

[data-theme="dark"] .chat-agent-btn:hover,
[data-theme="dark"] .chat-sequence-btn:hover,
[data-theme="dark"] .preview-btn.secondary:hover,
[data-theme="dark"] .result-btn:hover,
[data-theme="dark"] .analysis-btn:hover {
    background: #4f5963;
}

/* =========================================================================
   CAMPAIGN CARDS & PREVIEW STYLES
   ========================================================================= */

/* Campaign List Container */
.chat-campaign-list-container {
    margin: 16px 0;
}

.chat-campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* Individual Campaign Card */
.chat-campaign-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e0e4e8;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chat-campaign-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.15);
    border-color: #0d9488;
}

.campaign-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin-bottom: 8px;
}

.campaign-card-content {
    flex: 1;
}

.campaign-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.campaign-card-subject {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 12px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaign-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.campaign-card-stats .stat {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.campaign-card-stats .stat i {
    color: #0d9488;
}

.campaign-card-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.campaign-card-status.status-draft {
    background: #f1f5f9;
    color: #64748b;
}

.campaign-card-status.status-active,
.campaign-card-status.status-sent {
    background: #dcfce7;
    color: #16a34a;
}

.campaign-card-status.status-completed {
    background: #dbeafe;
    color: #2563eb;
}

.campaign-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.chat-campaign-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #e0e4e8;
    background: #f8f9fa;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.chat-campaign-btn:hover {
    background: #e2e8f0;
}

.chat-campaign-btn.primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    border: none;
}

.chat-campaign-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

/* Campaign Preview Card */
.campaign-preview-container {
    margin: 16px 0;
}

.chat-campaign-preview-card {
    background: linear-gradient(145deg, #ffffff, #f0faf9);
    border-radius: 20px;
    padding: 24px;
    border: 2px solid #0d9488;
    box-shadow: 0 8px 32px rgba(13, 148, 136, 0.15);
}

.chat-campaign-preview-card .preview-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.chat-campaign-preview-card .preview-icon.campaign-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.chat-campaign-preview-card .preview-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

/* Preview Form Styles */
.preview-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.preview-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preview-field label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-field label i {
    color: #0d9488;
    font-size: 12px;
}

.preview-field input,
.preview-field textarea,
.preview-field select {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #e0e4e8;
    background: #ffffff;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.2s;
}

.preview-field input:focus,
.preview-field textarea:focus,
.preview-field select:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.preview-field textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.preview-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.merge-tags-hint {
    margin-top: 4px;
}

.merge-tags-hint small {
    color: #64748b;
    font-size: 11px;
}

.merge-tags-hint code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: #0d9488;
}

/* Outreach Campaign Card (inline in chat) */
.outreach-campaign-card {
    background: linear-gradient(145deg, #ffffff, #f0faf9);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #99d5cf;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
    margin: 12px 0;
    transition: all 0.3s ease;
}

.outreach-campaign-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.15);
}

.outreach-campaign-card .campaign-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    color: #0d9488;
    margin-bottom: 14px;
}

.outreach-campaign-card .campaign-card-header .material-icons {
    font-size: 22px;
    color: #0d9488;
}

.outreach-campaign-card .campaign-card-body {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
}

.outreach-campaign-card .campaign-stat {
    text-align: center;
}

.outreach-campaign-card .campaign-stat .stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.outreach-campaign-card .campaign-stat .stat-label {
    display: block;
    font-size: 12px;
    color: #64748b;
}

.outreach-campaign-card .campaign-card-actions {
    display: flex;
    gap: 8px;
}

.outreach-campaign-card .campaign-action-btn {
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.outreach-campaign-card .campaign-action-btn.primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.outreach-campaign-card .campaign-action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.outreach-campaign-card .campaign-action-btn .material-icons {
    font-size: 16px;
}

/* Campaign Created Success Card */
.chat-campaign-created-card {
    background: linear-gradient(145deg, #dcfce7, #f0fdf4);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    border: 1px solid #86efac;
}

.chat-campaign-created-card .created-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.chat-campaign-created-card .created-header i {
    font-size: 28px;
    color: #16a34a;
}

.chat-campaign-created-card .created-header h4 {
    margin: 0;
    font-size: 18px;
    color: #16a34a;
}

.chat-campaign-created-card p {
    color: #166534;
    margin: 0 0 16px 0;
}

.chat-campaign-created-card .created-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.chat-campaign-created-card .created-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.chat-campaign-created-card .created-btn.primary {
    background: #16a34a;
    color: white;
}

.chat-campaign-created-card .created-btn.primary:hover {
    background: #15803d;
}

.chat-campaign-created-card .created-btn:not(.primary) {
    background: white;
    color: #166534;
    border: 1px solid #86efac;
}

/* Dark mode support for campaigns */
[data-theme="dark"] .chat-campaign-card,
[data-theme="dark"] .chat-campaign-preview-card {
    background: #2c3338;
    color: #e8eaed;
    border-color: #4f5963;
}

[data-theme="dark"] .campaign-card-name,
[data-theme="dark"] .chat-campaign-preview-card .preview-title h3 {
    color: #e8eaed;
}

[data-theme="dark"] .campaign-card-subject,
[data-theme="dark"] .campaign-card-stats .stat,
[data-theme="dark"] .preview-field label {
    color: #a0aec0;
}

[data-theme="dark"] .preview-field input,
[data-theme="dark"] .preview-field textarea,
[data-theme="dark"] .preview-field select {
    background: #3f454c;
    border-color: #4f5963;
    color: #e8eaed;
}

[data-theme="dark"] .chat-campaign-btn {
    background: #3f454c;
    border-color: #4f5963;
    color: #e8eaed;
}

[data-theme="dark"] .chat-campaign-btn:hover {
    background: #4f5963;
}

[data-theme="dark"] .chat-campaign-created-card {
    background: linear-gradient(145deg, #1e3a2d, #2c4a3c);
    border-color: #4ade80;
}

[data-theme="dark"] .chat-campaign-created-card p {
    color: #86efac;
}

[data-theme="dark"] .merge-tags-hint code {
    background: #3f454c;
}

/* =========================================================================
   EDITABLE SEQUENCE STEP STYLES
   ========================================================================= */

.preview-steps-editable {
    margin-bottom: 20px;
}

.preview-steps-editable > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
}

.preview-steps-editable > label i {
    color: #10b981;
    margin-right: 6px;
}

.editable-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #e0e4e8;
}

.editable-step .step-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.editable-step .step-fields {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.editable-step .step-action {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e0e4e8;
    background: white;
    font-size: 13px;
    color: #1e293b;
    min-width: 120px;
}

.editable-step .step-fields > input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e0e4e8;
    background: white;
    font-size: 13px;
    color: #1e293b;
}

.editable-step .step-delay {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.editable-step .step-delay input[type="number"] {
    width: 50px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #e0e4e8;
    background: white;
    font-size: 13px;
    color: #1e293b;
    text-align: center;
}

.editable-step input:focus,
.editable-step select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

/* Sequence Created Success Card */
.chat-sequence-created-card {
    background: linear-gradient(145deg, #dcfce7, #f0fdf4);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    border: 1px solid #86efac;
}

.chat-sequence-created-card .created-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.chat-sequence-created-card .created-header i {
    font-size: 28px;
    color: #16a34a;
}

.chat-sequence-created-card .created-header h4 {
    margin: 0;
    font-size: 18px;
    color: #16a34a;
}

.chat-sequence-created-card p {
    color: #166534;
    margin: 0 0 16px 0;
}

.chat-sequence-created-card .created-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.chat-sequence-created-card .created-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.chat-sequence-created-card .created-btn.primary {
    background: #16a34a;
    color: white;
}

.chat-sequence-created-card .created-btn.primary:hover {
    background: #15803d;
}

.chat-sequence-created-card .created-btn:not(.primary) {
    background: white;
    color: #166534;
    border: 1px solid #86efac;
}

/* Dark mode for editable steps */
[data-theme="dark"] .editable-step {
    background: #3f454c;
    border-color: #4f5963;
}

[data-theme="dark"] .editable-step .step-action,
[data-theme="dark"] .editable-step .step-fields > input[type="text"],
[data-theme="dark"] .editable-step .step-delay input[type="number"] {
    background: #2c3338;
    border-color: #4f5963;
    color: #e8eaed;
}

[data-theme="dark"] .preview-steps-editable > label {
    color: #a0aec0;
}

[data-theme="dark"] .editable-step .step-delay {
    color: #a0aec0;
}

[data-theme="dark"] .chat-sequence-created-card {
    background: linear-gradient(145deg, #1e3a2d, #2c4a3c);
    border-color: #4ade80;
}

[data-theme="dark"] .chat-sequence-created-card p {
    color: #86efac;
}

/* =====================================================================
   🌐 WEB RESEARCH - Progress Card, Results Card, Source Cards
   ===================================================================== */

/* ── Progress Card ── */
.web-research-progress-card {
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fafe 100%);
    border: 1px solid #d0e3f7;
    border-radius: 12px;
    padding: 16px;
    max-width: 480px;
}

.wr-progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.wr-progress-header-text {
    flex: 1;
}

.wr-progress-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a202c;
}

.wr-progress-purpose {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
}

.wr-progress-percent {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary, #4f46e5);
}

.wr-progress-bar-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.wr-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #4f46e5), #7c3aed);
    border-radius: 3px;
    transition: width 0.6s ease;
    position: relative;
}

.wr-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

.wr-progress-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #4a5568;
}

/* Streaming result items during progress */
.wr-progress-results-streaming {
    margin-top: 10px;
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.wr-stream-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    animation: fadeIn 0.3s ease;
}

.wr-stream-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

.wr-stream-text {
    overflow: hidden;
    min-width: 0;
}

.wr-stream-title {
    font-size: 12px;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wr-stream-url {
    font-size: 10px;
    color: #a0aec0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Results Card ── */
.web-research-results-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    max-width: 600px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.wr-results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fafe 100%);
}

.wr-results-icon {
    flex-shrink: 0;
}

.wr-results-header-text {
    flex: 1;
    min-width: 0;
}

.wr-results-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a202c;
}

.wr-results-subtitle {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wr-results-synthesis {
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #2d3748;
    max-height: 400px;
    overflow-y: auto;
    word-break: break-word;
}

/* ── Sources Toggle + Expandable Section ── */
.wr-results-sources-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary, #4f46e5);
    cursor: pointer;
    border-top: 1px solid #f0f0f0;
    user-select: none;
    transition: background 0.15s;
}

.wr-results-sources-toggle:hover {
    background: #f7fafc;
}

.wr-toggle-icon {
    margin-left: auto;
    font-size: 18px;
    transition: transform 0.2s;
}

.wr-results-sources {
    padding: 0 16px 12px;
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

.wr-results-sources.collapsed {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
    opacity: 0;
}

/* ── Source Cards ── */
.wr-source-card {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.wr-source-card:last-child {
    border-bottom: none;
}

.wr-source-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.wr-source-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.wr-source-domain {
    font-size: 11px;
    color: #718096;
}

.wr-analyzed-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    color: #059669;
    background: #d1fae5;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.wr-source-title {
    font-size: 13px;
    margin-bottom: 3px;
}

.wr-source-title a {
    color: #2b6cb0;
    text-decoration: none;
}

.wr-source-title a:hover {
    text-decoration: underline;
}

.wr-source-snippet {
    font-size: 12px;
    color: #718096;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Token Badge ── */
.wr-token-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #d97706;
    background: #fef3c7;
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Synthesis Visual Hierarchy ── */
.wr-section-header {
    display: inline-block;
    font-weight: 700;
    color: var(--primary, #4f46e5);
    margin-top: 6px;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.wr-item-number {
    font-weight: 700;
    color: var(--primary, #4f46e5);
}

.wr-bullet {
    color: var(--primary, #4f46e5);
    font-weight: 600;
}

.wr-line-fade {
    opacity: 0;
    transform: translateY(4px);
    animation: wrLineFadeIn 0.3s ease forwards;
    line-height: 1.5;
}

@keyframes wrLineFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Action Buttons ── */
.wr-results-actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px 14px;
    border-top: 1px solid #f0f0f0;
}

.wr-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.15s;
}

.wr-action-btn:hover {
    background: #f7fafc;
    border-color: var(--primary, #4f46e5);
    color: var(--primary, #4f46e5);
}

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Dark Mode ── */
[data-theme="dark"] .web-research-progress-card {
    background: linear-gradient(135deg, #1a2332 0%, #1e293b 100%);
    border-color: #334155;
}

[data-theme="dark"] .wr-progress-title,
[data-theme="dark"] .wr-results-title {
    color: #e2e8f0;
}

[data-theme="dark"] .wr-progress-purpose,
[data-theme="dark"] .wr-results-subtitle,
[data-theme="dark"] .wr-progress-status {
    color: #94a3b8;
}

[data-theme="dark"] .wr-progress-bar-track {
    background: #334155;
}

[data-theme="dark"] .wr-progress-results-streaming {
    border-top-color: #334155;
}

[data-theme="dark"] .wr-stream-title {
    color: #e2e8f0;
}

[data-theme="dark"] .web-research-results-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .wr-results-header {
    background: linear-gradient(135deg, #1a2332 0%, #1e293b 100%);
    border-bottom-color: #334155;
}

[data-theme="dark"] .wr-results-synthesis {
    color: #cbd5e1;
}

[data-theme="dark"] .wr-results-sources-toggle {
    border-top-color: #334155;
}

[data-theme="dark"] .wr-results-sources-toggle:hover {
    background: #2d3748;
}

[data-theme="dark"] .wr-source-card {
    border-bottom-color: #334155;
}

[data-theme="dark"] .wr-source-title a {
    color: #63b3ed;
}

[data-theme="dark"] .wr-source-snippet {
    color: #94a3b8;
}

[data-theme="dark"] .wr-source-domain {
    color: #94a3b8;
}

[data-theme="dark"] .wr-analyzed-badge {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] .wr-action-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #cbd5e1;
}

[data-theme="dark"] .wr-action-btn:hover {
    background: #374151;
    border-color: var(--primary, #818cf8);
    color: var(--primary, #818cf8);
}

[data-theme="dark"] .wr-results-actions,
[data-theme="dark"] .wr-results-sources-toggle {
    border-top-color: #334155;
}

[data-theme="dark"] .wr-token-badge {
    background: #422006;
    color: #fbbf24;
}

[data-theme="dark"] .wr-section-header {
    color: var(--primary, #818cf8);
}

[data-theme="dark"] .wr-item-number {
    color: var(--primary, #818cf8);
}

[data-theme="dark"] .wr-bullet {
    color: var(--primary, #818cf8);
}

/* ========================================
   AGENTIC MULTI-STEP TASK UI
   ======================================== */

.agentic-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    max-width: 520px;
}

.agentic-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
}

.agentic-header-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
    border-radius: 10px;
    flex-shrink: 0;
}

.agentic-header-text {
    flex: 1;
    min-width: 0;
}

.agentic-header-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    transition: color 0.3s;
}

.agentic-header-goal {
    font-size: 12px;
    color: #64748b;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agentic-token-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: #d97706;
    background: #fef3c7;
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    transition: all 0.3s;
}

.agentic-token-badge.spent {
    color: #059669;
    background: #d1fae5;
}

/* ── Progress Bar ── */
.agentic-progress-bar {
    height: 3px;
    background: #f1f5f9;
    margin: 0 16px 8px;
    border-radius: 2px;
    overflow: hidden;
}

.agentic-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #6366f1), #8b5cf6);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ── Steps Stepper ── */
.agentic-steps {
    padding: 4px 16px 12px;
}

.agentic-step {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    position: relative;
    opacity: 0.55;
    transition: opacity 0.3s, transform 0.3s;
}

.agentic-step[data-status="running"] {
    opacity: 1;
    transform: translateX(2px);
}

.agentic-step[data-status="completed"] {
    opacity: 0.85;
}

.agentic-step[data-status="error"] {
    opacity: 0.85;
}

/* Vertical connector line */
.agentic-step-connector {
    position: absolute;
    left: 16px;
    top: 40px;
    bottom: -8px;
    width: 2px;
    background: #e2e8f0;
}

.agentic-step:last-child .agentic-step-connector {
    display: none;
}

.agentic-step[data-status="completed"] .agentic-step-connector {
    background: #10b981;
}

/* Step indicator circle */
.agentic-step-indicator {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    z-index: 1;
    transition: all 0.3s;
}

.agentic-step[data-status="running"] .agentic-step-indicator {
    background: color-mix(in srgb, var(--step-color) 15%, white);
    border-color: var(--step-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--step-color) 15%, transparent);
}

.agentic-step[data-status="completed"] .agentic-step-indicator {
    background: #d1fae5;
    border-color: #10b981;
}

.agentic-step[data-status="error"] .agentic-step-indicator {
    background: #fee2e2;
    border-color: #ef4444;
}

.agentic-step-icon {
    font-size: 16px;
    color: #94a3b8;
    transition: color 0.3s;
}

.agentic-step[data-status="running"] .agentic-step-icon {
    color: var(--step-color);
}

.agentic-step[data-status="completed"] .agentic-step-icon {
    color: #10b981;
}

.agentic-step[data-status="error"] .agentic-step-icon {
    color: #ef4444;
}

/* Step content */
.agentic-step-content {
    flex: 1;
    min-width: 0;
}

.agentic-step-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.agentic-step-number {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agentic-step-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.agentic-step-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: auto;
    color: #94a3b8;
    background: #f1f5f9;
}

.agentic-step-status-badge.running {
    color: #6366f1;
    background: #ede9fe;
    animation: pulse-subtle 1.5s ease infinite;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.agentic-badge-spinner {
    font-size: 12px !important;
    animation: spin-smooth 1.2s linear infinite;
}

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

.agentic-step-running-msg {
    font-size: 11px;
    color: #6366f1;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    animation: pulse-subtle 1.5s ease infinite;
}

.agentic-step-status-badge.completed {
    color: #059669;
    background: #d1fae5;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.agentic-step-status-badge.error {
    color: #dc2626;
    background: #fee2e2;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.agentic-step-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.3;
}

.agentic-step-result {
    margin-top: 4px;
}

/* Collapsible dropdown toggle */
.agentic-step-details-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    font-size: 11px;
    color: #6366f1;
    padding: 2px 0;
    user-select: none;
    transition: color 0.15s;
}

.agentic-step-details-toggle:hover {
    color: #4f46e5;
}

.agentic-toggle-arrow {
    font-size: 16px !important;
    transition: transform 0.2s ease;
}

.agentic-toggle-label {
    font-weight: 500;
}

/* Collapsed state (default) - hide content */
.agentic-step-details-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

/* Expanded state - show content */
.agentic-step-result.expanded .agentic-step-details-content {
    max-height: 500px;
}

.agentic-step-result.expanded .agentic-toggle-arrow {
    transform: rotate(180deg);
}

.agentic-step-result.expanded .agentic-toggle-label {
    color: #4f46e5;
}

.agentic-step-ai-msg {
    font-size: 12px;
    color: #475569;
    background: #f8fafc;
    border-left: 3px solid #10b981;
    padding: 6px 10px;
    border-radius: 0 6px 6px 0;
    margin-top: 4px;
    line-height: 1.4;
}

.agentic-step-error-msg {
    font-size: 12px;
    color: #dc2626;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    padding: 6px 10px;
    border-radius: 0 6px 6px 0;
    margin-top: 4px;
}

/* ── Summary ── */
.agentic-summary {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
}

.agentic-summary-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}

.agentic-summary-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #64748b;
    padding: 4px 0;
}

/* rotating animation (reuse) */
.rotating-slow {
    animation: rotateSlow 1.5s linear infinite;
}

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

/* ── 🧠 AUTONOMY UI ── */

/* Autonomy badge in header */
.agentic-autonomy-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #fff;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.agentic-autonomy-badge.adapting {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    animation: pulse-autonomy 1s ease-in-out infinite;
}
.agentic-autonomy-badge.complete {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
@keyframes pulse-autonomy {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Confidence score badges */
.agentic-confidence {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
}
.agentic-confidence-high {
    background: #d1fae5;
    color: #065f46;
}
.agentic-confidence-medium {
    background: #fef3c7;
    color: #92400e;
}
.agentic-confidence-low {
    background: #fee2e2;
    color: #991b1b;
}

/* Retry tag */
.agentic-retry-tag {
    font-size: 10px;
    background: #e0f2f1;
    color: #0d9488;
    padding: 1px 5px;
    border-radius: 6px;
    margin-left: 4px;
    cursor: help;
}

/* Retry indicator in details */
.agentic-retry-indicator {
    font-size: 11px;
    color: #8b5cf6;
    margin-left: 6px;
    font-weight: 500;
}

/* Adaptive step marker */
.agentic-step-adaptive {
    border-left: 3px solid #8b5cf6 !important;
    margin-left: -3px;
}
.agentic-step-adaptive .agentic-step-indicator {
    box-shadow: 0 0 0 2px #8b5cf6;
}

/* Skipped step status */
.agentic-step-status-badge.skipped {
    background: #f1f5f9;
    color: #94a3b8;
}
.agentic-step-skipped-msg {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 12px;
    font-style: italic;
    padding: 4px 0;
}
[data-status="skipped"] .agentic-step-indicator {
    opacity: 0.5;
}
[data-status="skipped"] .agentic-step-content {
    opacity: 0.6;
}

/* Quality Gate UI */
.agentic-quality-gate {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    margin: 0 16px 8px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.agentic-quality-gate-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.agentic-quality-gate-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}
.agentic-quality-gate-metrics {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.agentic-qg-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}
.agentic-qg-metric-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}
.agentic-qg-metric-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.agentic-quality-gate-notes {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

/* ── Dark Mode ── */
[data-theme="dark"] .agentic-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* Dark mode autonomy overrides */
[data-theme="dark"] .agentic-confidence-high { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .agentic-confidence-medium { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .agentic-confidence-low { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .agentic-retry-tag { background: #134e4a; color: #5eead4; }
[data-theme="dark"] .agentic-step-skipped-msg { color: #64748b; }
[data-theme="dark"] .agentic-quality-gate { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .agentic-quality-gate-title { color: #e2e8f0; }
[data-theme="dark"] .agentic-qg-metric-value { color: #e2e8f0; }
[data-theme="dark"] .agentic-qg-metric-label { color: #94a3b8; }
[data-theme="dark"] .agentic-quality-gate-notes { color: #94a3b8; }
[data-theme="dark"] .agentic-step-status-badge.skipped { background: #1e293b; color: #64748b; }

[data-theme="dark"] .agentic-header-icon {
    background: linear-gradient(135deg, #312e81 0%, #1e3a5f 100%);
}

[data-theme="dark"] .agentic-header-title {
    color: #e2e8f0;
}

[data-theme="dark"] .agentic-header-goal {
    color: #94a3b8;
}

[data-theme="dark"] .agentic-token-badge {
    background: #422006;
    color: #fbbf24;
}

[data-theme="dark"] .agentic-token-badge.spent {
    background: #064e3b;
    color: #34d399;
}

[data-theme="dark"] .agentic-progress-bar {
    background: #334155;
}

[data-theme="dark"] .agentic-step-connector {
    background: #334155;
}

[data-theme="dark"] .agentic-step-indicator {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .agentic-step-title {
    color: #e2e8f0;
}

[data-theme="dark"] .agentic-step-desc {
    color: #64748b;
}

[data-theme="dark"] .agentic-step-number {
    color: #64748b;
}

[data-theme="dark"] .agentic-step-status-badge {
    color: #64748b;
    background: #1e293b;
}

[data-theme="dark"] .agentic-step-status-badge.running {
    color: #a5b4fc;
    background: #312e81;
}

[data-theme="dark"] .agentic-step-status-badge.completed {
    color: #34d399;
    background: #064e3b;
}

[data-theme="dark"] .agentic-step-status-badge.error {
    color: #fca5a5;
    background: #7f1d1d;
}

[data-theme="dark"] .agentic-step-running-msg {
    color: #a5b4fc;
}

[data-theme="dark"] .agentic-step-details-toggle {
    color: #a5b4fc;
}

[data-theme="dark"] .agentic-step-details-toggle:hover {
    color: #c7d2fe;
}

[data-theme="dark"] .agentic-step-result.expanded .agentic-toggle-label {
    color: #c7d2fe;
}

[data-theme="dark"] .agentic-step-ai-msg {
    background: #0f172a;
    color: #cbd5e1;
    border-left-color: #34d399;
}

[data-theme="dark"] .agentic-step-error-msg {
    background: #1a0000;
    color: #fca5a5;
    border-left-color: #ef4444;
}

[data-theme="dark"] .agentic-summary {
    border-top-color: #334155;
}

[data-theme="dark"] .agentic-summary-content {
    color: #cbd5e1;
}

[data-theme="dark"] .agentic-summary-loading {
    color: #94a3b8;
}

/* ── View Results Button ── */
.agentic-view-results-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--primary, #6366f1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.agentic-view-results-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.agentic-view-results-btn .material-icons {
    font-size: 16px;
}

/* ========================================
   AGENTIC RESULTS MODAL (ARM)
   ======================================== */

.arm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.arm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.arm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.arm-modal {
    position: relative;
    width: 92%;
    max-width: 640px;
    max-height: 85vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.arm-overlay.active .arm-modal {
    transform: translateY(0);
}

.arm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

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

.arm-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.arm-header-subtitle {
    font-size: 12px;
    color: #64748b;
}

.arm-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    transition: background 0.15s;
}

.arm-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* ── Tabs ── */
.arm-tabs-scroll {
    overflow-x: auto;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

.arm-tabs-scroll::-webkit-scrollbar {
    height: 0;
}

.arm-tabs {
    display: flex;
    padding: 0 12px;
    gap: 2px;
    min-width: max-content;
}

.arm-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.arm-tab:hover {
    color: #334155;
}

.arm-tab.active {
    color: var(--tab-color, var(--primary));
    border-bottom-color: var(--tab-color, var(--primary));
}

.arm-tab-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Body / Content ── */
.arm-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

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

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

.arm-ai-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #475569;
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    line-height: 1.5;
}

.arm-empty {
    text-align: center;
    color: #94a3b8;
    padding: 30px;
    font-size: 13px;
}

.arm-error {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #dc2626;
    background: #fef2f2;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* ── Section Headers ── */
.arm-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.arm-query-badge {
    font-size: 11px;
    font-weight: 500;
    color: #6366f1;
    background: #ede9fe;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: auto;
}

/* ── Leads List ── */
.arm-leads-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 400px;
    overflow-y: auto;
}

.arm-lead-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s;
}

.arm-lead-row:hover {
    background: #f8fafc;
}

.arm-lead-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #6366f1;
    background: #ede9fe;
    border-radius: 50%;
    flex-shrink: 0;
}

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

.arm-lead-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.arm-lead-detail {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.arm-lead-badges {
    display: flex;
    gap: 4px;
}

.arm-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
}

.arm-badge.li {
    background: #0a66c2;
}

.arm-add-lead-btn {
    transition: background 0.15s, transform 0.15s;
}

.arm-add-lead-btn:hover {
    background: #c4b5fd !important;
    transform: scale(1.1);
}

.arm-add-lead-btn:disabled {
    cursor: default !important;
    opacity: 0.8;
    transform: none !important;
}

/* ── Synthesis (web research) ── */
.arm-synthesis {
    font-size: 13px;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 16px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

/* ── Sources Grid ── */
.arm-sources-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.arm-sources-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.arm-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 11px;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.arm-source-chip:hover {
    background: #ede9fe;
    border-color: #c7d2fe;
}

.arm-source-icon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Outreach Card ── */
.arm-outreach-stats {
    display: flex;
    gap: 16px;
    margin: 12px 0;
}

.arm-stat {
    text-align: center;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 8px;
    flex: 1;
}

.arm-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.arm-stat-label {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.arm-outreach-actions {
    margin-top: 12px;
}

.arm-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    color: #334155;
    transition: all 0.15s;
}

.arm-action-btn.primary {
    background: var(--primary, #0d9488);
    border-color: var(--primary, #0d9488);
    color: #fff;
}

.arm-action-btn.primary:hover {
    opacity: 0.9;
}

/* ── Carousel Slides ── */
.arm-carousel-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
}

.arm-carousel-slide {
    height: 180px;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── Generated Image ── */
.arm-generated-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 12px;
}

.arm-image-actions {
    margin-bottom: 8px;
}

/* ── Success Card ── */
.arm-success-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 30px;
    text-align: center;
}

.arm-success-text {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.arm-success-detail {
    font-size: 12px;
    color: #64748b;
}

/* ── Enrich Grid ── */
.arm-enrich-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.arm-enrich-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.arm-enrich-item .material-icons {
    font-size: 18px;
    color: #6366f1;
}

.arm-note {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

.arm-generic pre {
    font-size: 11px;
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    max-height: 300px;
}

/* ── Dark Mode ── */
[data-theme="dark"] .agentic-view-results-btn {
    background: #6366f1;
}

[data-theme="dark"] .arm-backdrop {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .arm-modal {
    background: #1e293b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .arm-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .arm-header-title {
    color: #e2e8f0;
}

[data-theme="dark"] .arm-close {
    background: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .arm-close:hover {
    background: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .arm-tabs-scroll {
    border-bottom-color: #334155;
}

[data-theme="dark"] .arm-tab {
    color: #94a3b8;
}

[data-theme="dark"] .arm-tab:hover {
    color: #e2e8f0;
}

[data-theme="dark"] .arm-ai-msg {
    background: #0f172a;
    color: #cbd5e1;
}

[data-theme="dark"] .arm-section-header {
    color: #e2e8f0;
}

[data-theme="dark"] .arm-lead-row:hover {
    background: #0f172a;
}

[data-theme="dark"] .arm-lead-name {
    color: #e2e8f0;
}

[data-theme="dark"] .arm-lead-rank {
    background: #312e81;
    color: #a5b4fc;
}

[data-theme="dark"] .arm-synthesis {
    color: #cbd5e1;
}

[data-theme="dark"] .arm-source-chip {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .arm-source-chip:hover {
    background: #312e81;
    border-color: #4f46e5;
}

[data-theme="dark"] .arm-stat {
    background: #0f172a;
}

[data-theme="dark"] .arm-stat-val {
    color: #e2e8f0;
}

[data-theme="dark"] .arm-enrich-item {
    background: #0f172a;
    color: #cbd5e1;
}

[data-theme="dark"] .arm-generic pre {
    background: #0f172a;
    color: #cbd5e1;
}

[data-theme="dark"] .arm-query-badge {
    background: #312e81;
    color: #a5b4fc;
}

[data-theme="dark"] .arm-success-text {
    color: #e2e8f0;
}

[data-theme="dark"] .arm-action-btn {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

/* ── LinkedIn Post Card in Results Modal ── */
.arm-linkedin-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    margin-top: 8px;
}

.arm-li-header {
    display: flex;
    padding: 12px 16px;
    gap: 10px;
    align-items: flex-start;
}

.arm-li-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.arm-li-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #00b3c9;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

.arm-li-author {
    flex: 1;
    min-width: 0;
}

.arm-li-name {
    font-weight: 600;
    font-size: 13px;
    color: #111;
}

.arm-li-headline {
    font-size: 11px;
    color: #666;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.arm-li-meta {
    font-size: 11px;
    color: #999;
    margin-top: 1px;
}

.arm-li-content {
    padding: 0 16px 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #111;
    white-space: pre-wrap;
    word-break: break-word;
}

.arm-li-image {
    width: 100%;
    border-top: 1px solid #e2e8f0;
}

.arm-li-image img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}

.arm-li-engagement {
    padding: 8px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.arm-li-reactions {
    font-size: 14px;
}

.arm-li-reaction-text {
    font-size: 11px;
    color: #666;
}

.arm-li-buttons {
    display: flex;
    border-top: 1px solid #e2e8f0;
    padding: 2px 8px;
}

.arm-li-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
    border-radius: 4px;
}

/* ── LinkedIn Post Action Bar ── */
.arm-li-action-bar {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.arm-li-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.arm-li-action.copy {
    background: #f1f5f9;
    color: #475569;
}

.arm-li-action.copy:hover {
    background: #e2e8f0;
}

.arm-li-action.open {
    background: #0077b5;
    color: #fff;
}

.arm-li-action.open:hover {
    background: #005f8d;
}

.arm-li-action.edit {
    background: #00b3c9;
    color: #fff;
}

.arm-li-action.edit:hover {
    background: #0090a3;
}

.arm-li-action.post-now {
    background: #22c55e;
    color: #fff;
}

.arm-li-action.post-now:hover {
    background: #16a34a;
}

.arm-li-action:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ── Analyze Leads in Results Modal ── */
.arm-analyze-leads-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.arm-analyze-lead {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.arm-analyze-lead-status {
    flex-shrink: 0;
}

.arm-analyze-lead-info {
    flex: 1;
    min-width: 0;
}

.arm-analyze-lead-name {
    font-weight: 600;
    font-size: 13px;
    color: #111;
}

.arm-analyze-lead-detail {
    font-size: 11px;
    color: #666;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.arm-analyze-lead-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.arm-intent-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
}

.arm-flag-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 10px;
}

.arm-flag-badge.hiring {
    background: #dbeafe;
    color: #1d4ed8;
}

.arm-flag-badge.otw {
    background: #dcfce7;
    color: #166534;
}

.arm-flag-badge.premium {
    background: #fef3c7;
    color: #92400e;
}

.arm-analyze-lead-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Dark Mode for LinkedIn Card & Analyze ── */
[data-theme="dark"] .arm-linkedin-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .arm-li-name {
    color: #f1f5f9;
}

[data-theme="dark"] .arm-li-headline,
[data-theme="dark"] .arm-li-reaction-text {
    color: #94a3b8;
}

[data-theme="dark"] .arm-li-meta {
    color: #64748b;
}

[data-theme="dark"] .arm-li-content {
    color: #e2e8f0;
}

[data-theme="dark"] .arm-li-image,
[data-theme="dark"] .arm-li-engagement,
[data-theme="dark"] .arm-li-buttons {
    border-color: #334155;
}

[data-theme="dark"] .arm-li-btn {
    color: #94a3b8;
}

[data-theme="dark"] .arm-li-action.copy {
    background: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .arm-analyze-lead {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .arm-analyze-lead-name {
    color: #f1f5f9;
}

[data-theme="dark"] .arm-analyze-lead-detail {
    color: #94a3b8;
}

/* ── Anonymous signup banner in results modal ── */
.arm-signup-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #ede9fe 100%);
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.arm-signup-banner > .material-icons {
    font-size: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.arm-signup-banner-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.arm-signup-banner-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
}

.arm-signup-banner-btn {
    margin-left: auto;
    padding: 8px 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

.arm-signup-banner-btn:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

[data-theme="dark"] .arm-signup-banner {
    background: linear-gradient(135deg, #1e293b 0%, #1e1b4b 100%);
    border-color: #334155;
}

[data-theme="dark"] .arm-signup-banner-title {
    color: #f1f5f9;
}

[data-theme="dark"] .arm-signup-banner-sub {
    color: #94a3b8;
}

/* ========================================
   AGENTIC UI - MOBILE RESPONSIVE
   ======================================== */

/* ── Tablet / Small screens (≤768px) ── */
@media (max-width: 768px) {
    /* Plan card: fill available width */
    .agentic-card {
        max-width: 100%;
    }

    .agentic-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 14px 10px;
    }

    .agentic-header-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .agentic-header-icon .material-icons {
        font-size: 20px !important;
    }

    .agentic-header-title {
        font-size: 15px;
    }

    .agentic-header-goal {
        font-size: 13px;
        white-space: normal;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .agentic-token-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    /* Steps */
    .agentic-steps {
        padding: 4px 12px 10px;
    }

    .agentic-step {
        gap: 10px;
    }

    .agentic-step-indicator {
        width: 30px;
        height: 30px;
    }

    .agentic-step-icon {
        font-size: 14px;
    }

    .agentic-step-connector {
        left: 14px;
        top: 36px;
    }

    .agentic-step-title {
        font-size: 14px;
    }

    .agentic-step-number {
        font-size: 10px;
    }

    .agentic-step-desc {
        font-size: 12px;
    }

    .agentic-step-ai-msg,
    .agentic-step-error-msg {
        font-size: 13px;
        padding: 8px 10px;
    }

    .agentic-step-details-toggle {
        font-size: 12px;
        padding: 4px 0;
    }

    /* Summary */
    .agentic-summary {
        padding: 10px 14px;
    }

    .agentic-summary-content {
        font-size: 14px;
    }

    .agentic-view-results-btn {
        font-size: 14px;
        padding: 10px 18px;
        width: 100%;
        justify-content: center;
    }

    /* Results Modal */
    .arm-modal {
        width: 96%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 14px 14px 0 0;
    }

    .arm-overlay {
        align-items: flex-end;
    }

    .arm-header {
        padding: 14px 16px;
    }

    .arm-header-title {
        font-size: 16px;
    }

    .arm-body {
        padding: 14px 16px;
    }

    .arm-tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    .arm-tab-label {
        max-width: 100px;
    }

    .arm-ai-msg {
        font-size: 14px;
        padding: 10px 12px;
    }

    .arm-section-header {
        font-size: 15px;
    }

    /* Leads list */
    .arm-lead-row {
        gap: 8px;
        padding: 10px 8px;
    }

    .arm-lead-name {
        font-size: 14px;
    }

    .arm-lead-detail {
        font-size: 12px;
        white-space: normal;
    }

    /* Sources */
    .arm-source-chip {
        font-size: 12px;
        max-width: 160px;
    }

    /* Synthesis */
    .arm-synthesis {
        font-size: 14px;
        max-height: 250px;
    }

    /* Outreach stats */
    .arm-outreach-stats {
        gap: 8px;
    }

    .arm-stat {
        padding: 8px 10px;
    }

    .arm-stat-val {
        font-size: 16px;
    }

    .arm-stat-label {
        font-size: 11px;
    }

    /* Carousel */
    .arm-carousel-slide {
        height: 150px;
    }

    /* LinkedIn card */
    .arm-li-header {
        padding: 10px 12px;
    }

    .arm-li-avatar img,
    .arm-li-avatar-placeholder {
        width: 38px;
        height: 38px;
    }

    .arm-li-content {
        padding: 0 12px 10px;
        font-size: 14px;
    }

    .arm-li-action-bar {
        gap: 6px;
    }

    .arm-li-action {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Action buttons */
    .arm-action-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Analyze leads */
    .arm-analyze-lead {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .arm-analyze-lead-name {
        font-size: 14px;
    }

    .arm-analyze-lead-detail {
        font-size: 12px;
        white-space: normal;
    }

    .arm-analyze-lead-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Enrich items */
    .arm-enrich-item {
        font-size: 14px;
    }
}

/* ── Small mobile (≤480px) ── */
@media (max-width: 480px) {
    .agentic-header {
        padding: 10px 12px 8px;
    }

    .agentic-header-icon {
        width: 32px;
        height: 32px;
    }

    .agentic-header-icon .material-icons {
        font-size: 18px !important;
    }

    .agentic-token-badge {
        font-size: 10px;
        padding: 2px 6px;
        order: 3;
        margin-left: auto;
    }

    .agentic-steps {
        padding: 2px 10px 8px;
    }

    .agentic-step {
        gap: 8px;
        padding: 6px 0;
    }

    .agentic-step-indicator {
        width: 26px;
        height: 26px;
    }

    .agentic-step-icon {
        font-size: 13px;
    }

    .agentic-step-connector {
        left: 12px;
        top: 32px;
    }

    .agentic-step-header {
        gap: 4px;
    }

    .agentic-step-status-badge {
        font-size: 9px;
        padding: 1px 5px;
    }

    .agentic-summary {
        padding: 8px 12px;
    }

    .agentic-summary-content {
        font-size: 13px;
    }

    .agentic-view-results-btn {
        font-size: 13px;
        padding: 10px 14px;
    }

    /* Results Modal - full screen on small phones */
    .arm-modal {
        width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
    }

    .arm-header {
        padding: 12px 14px;
    }

    .arm-header-title {
        font-size: 15px;
    }

    .arm-header-subtitle {
        font-size: 11px;
    }

    .arm-body {
        padding: 12px 14px;
    }

    .arm-tabs {
        padding: 0 8px;
    }

    .arm-tab {
        padding: 8px 10px;
        font-size: 11px;
    }

    .arm-tab-label {
        max-width: 80px;
    }

    .arm-leads-list {
        max-height: 350px;
    }

    .arm-lead-badges {
        gap: 2px;
    }

    .arm-badge {
        width: 24px;
        height: 24px;
    }

    .arm-source-chip {
        max-width: 140px;
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Outreach stats stack on very small screens */
    .arm-outreach-stats {
        flex-wrap: wrap;
    }

    .arm-stat {
        min-width: calc(50% - 8px);
    }

    /* LinkedIn actions stack */
    .arm-li-action-bar {
        flex-direction: column;
    }

    .arm-li-action {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
    }

    .arm-li-buttons {
        padding: 2px 4px;
    }

    .arm-li-btn {
        font-size: 11px;
        gap: 2px;
    }

    .arm-li-btn .material-icons {
        font-size: 16px !important;
    }

    /* Success card */
    .arm-success-card {
        padding: 20px;
    }

    .arm-success-text {
        font-size: 14px;
    }
}

/* =====================================================================
   📄 DOCUMENT CARD STYLES - Chat-created documents
   ===================================================================== */

/* ===== Document Card - Modern Design ===== */
.arm-doc-card {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 16px;
    overflow: hidden;
    margin: 12px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    max-width: 720px;
    transition: all 0.2s ease;
}

.arm-doc-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.arm-doc-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px 14px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #eaeaea;
}

.arm-doc-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
    max-width: 420px;
}
.ctc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
}
.ctc-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.ctc-info { flex: 1; }
.ctc-title { font-weight: 700; font-size: 15px; }
.ctc-type { font-size: 12px; opacity: 0.85; }
.ctc-priority {
    padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; color: #fff;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.ctc-description {
    padding: 12px 20px;
    font-size: 13px; color: #475569; line-height: 1.5;
    border-bottom: 1px solid #e2e8f0;
}
.ctc-meta {
    padding: 12px 20px;
    display: flex; flex-wrap: wrap; gap: 12px;
}
.ctc-meta-item {
    font-size: 12px; color: #64748b;
    display: flex; align-items: center; gap: 6px;
}
.ctc-meta-item i { color: #0d9488; }
.ctc-status {
    padding: 12px 20px; border-top: 1px solid #e2e8f0;
}
.ctc-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.ctc-badge.success { background: #d1fae5; color: #065f46; }
.ctc-badge.pending { background: #fef3c7; color: #92400e; }

/* ── MEETING JOIN CARD ── */
.chat-meeting-card {
    background: linear-gradient(145deg, #ffffff, #f0f0ff);
    border: 1px solid #a5b4fc;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.10);
    max-width: 420px;
}
.cmc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
}
.cmc-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.cmc-info { flex: 1; }
.cmc-title { font-weight: 700; font-size: 15px; }
.cmc-platform { font-size: 12px; opacity: 0.85; display: flex; align-items: center; gap: 4px; }
.cmc-status-badge {
    padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; color: #fff;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.cmc-status-badge.joining { background: #10b981; }
.cmc-status-badge.already { background: #6366f1; }
.cmc-body {
    padding: 12px 20px;
    display: flex; flex-direction: column; gap: 8px;
}
.cmc-detail {
    font-size: 12px; color: #64748b;
    display: flex; align-items: center; gap: 6px;
}
.cmc-detail i { color: #6366f1; width: 16px; text-align: center; }
.cmc-url { word-break: break-all; }
.cmc-footer {
    padding: 12px 20px; border-top: 1px solid #e2e8f0;
}

/* ── MEETING INFO CARD ── */
.chat-meeting-info-card {
    background: linear-gradient(145deg, #ffffff, #f5f3ff);
    border: 1px solid #c4b5fd;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.08);
    max-width: 480px;
}
.cmi-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
}
.cmi-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.cmi-info { flex: 1; }
.cmi-title { font-weight: 700; font-size: 15px; }
.cmi-time { font-size: 12px; opacity: 0.85; }
.cmi-status {
    padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; color: #fff;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.cmi-section {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
}
.cmi-section:last-child { border-bottom: none; }
.cmi-section-title {
    font-size: 12px; font-weight: 700; color: #6366f1;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex; align-items: center; gap: 6px;
}
.cmi-section-title i { font-size: 13px; }
.cmi-section-content {
    font-size: 13px; color: #475569; line-height: 1.6;
    white-space: pre-wrap;
}
.cmi-transcript {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.cmi-actions {
    padding: 12px 20px;
    display: flex; gap: 8px;
}

/* ── DEAL CARD ── */
.chat-deal-card {
    background: linear-gradient(145deg, #ffffff, #f0faf9);
    border: 1px solid #99d5cf;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
    max-width: 420px;
}
.cdc-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
}
.cdc-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.cdc-info { flex: 1; }
.cdc-title { font-weight: 700; font-size: 15px; }
.cdc-template { font-size: 12px; opacity: 0.85; }
.cdc-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.cdc-body > div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #475569; }
.cdc-body i { color: #0d9488; width: 16px; text-align: center; }
.cdc-stage-count { color: #94a3b8; font-size: 12px; }
.cdc-actions {
    padding: 12px 20px; border-top: 1px solid #e2e8f0;
}
.cdc-btn {
    padding: 8px 16px; border-radius: 8px; border: none;
    cursor: pointer; font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all 0.2s;
}
.cdc-btn.primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
}
.cdc-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3); }

/* ── DEAL LOOKUP CARDS ── */
/* ── DEAL LOOKUP PIPELINE CARDS (redesigned) ── */
.chat-deal-lookup {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    max-width: 700px;
    width: 100%;
}
.cdl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 50%, #115e59 100%);
    color: #fff;
}
.cdl-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cdl-icon {
    font-size: 24px;
    opacity: 0.9;
}
.cdl-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
}
.cdl-subtitle {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
}
.cdl-total-value {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.5px;
}

/* Stats summary row */
.cdl-stats-row {
    display: flex;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.cdl-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-right: 1px solid #e2e8f0;
}
.cdl-stat:last-child { border-right: none; }
.cdl-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #0d9488;
    line-height: 1.2;
}
.cdl-stat-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Deal cards grid - 2 columns */
.cdl-deals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}
@media (max-width: 640px) {
    .cdl-deals-grid { grid-template-columns: 1fr; }
}

/* Individual deal card */
.cdl-deal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cdl-deal-card:hover {
    border-color: #0d9488;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
    transform: translateY(-1px);
}

/* Deal card top: avatar + name + value */
.cdl-deal-top {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cdl-deal-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cdl-deal-info {
    flex: 1;
    min-width: 0;
}
.cdl-deal-name {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.arm-doc-meta {
    font-size: 12px;
    color: #6c757d;
    margin-top: 3px;
}

.arm-doc-preview-container {
    padding: 0;
    border-bottom: 1px solid #eaeaea;
    position: relative;
    max-height: 500px;
    overflow: hidden;
}

.arm-doc-preview-container::after {
    display: none;
}

.arm-doc-preview-iframe {
    display: block;
    border: none;
    border-radius: 0;
    background: #fff;
    max-height: 500px;
}

[data-theme="dark"] .arm-doc-preview-iframe {
    background: #1e1e2e;
}

.arm-doc-preview-empty {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 13px;
    background: #fafafa;
}

.arm-doc-preview-empty::before {
    content: '\f15c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    display: block;
    font-size: 32px;
    margin-bottom: 8px;
    color: #ccc;
}

.arm-doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px;
    background: #fafafa;
}

.arm-doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.arm-doc-btn-primary {
    background: #000;
    color: #fff;
}

.arm-doc-btn-primary:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.arm-doc-btn-secondary {
    background: #fff;
    color: #2c3e50;
    border: 1px solid #eaeaea;
}

.arm-doc-btn-secondary:hover {
    background: #f0f5ff;
    border-color: #3498db;
    text-decoration: none;
    color: #2c3e50;
}

/* Dark mode */
[data-theme="dark"] .arm-doc-card {
    background: #1e1e2e;
    border-color: #333;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

[data-theme="dark"] .arm-doc-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

[data-theme="dark"] .arm-doc-card-header {
    background: linear-gradient(135deg, #1e1e2e 0%, #252538 100%);
    border-bottom-color: #333;
}

[data-theme="dark"] .arm-doc-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

[data-theme="dark"] .arm-doc-title {
    color: #e0e0e0;
}

[data-theme="dark"] .arm-doc-meta {
    color: #888;
}

[data-theme="dark"] .arm-doc-preview-container {
    border-bottom-color: #333;
}

[data-theme="dark"] .arm-doc-preview-container::after {
    display: none;
}

[data-theme="dark"] .arm-doc-actions {
    background: #252538;
}

[data-theme="dark"] .arm-doc-btn-primary {
    background: #3498db;
}

[data-theme="dark"] .arm-doc-btn-primary:hover {
    background: #2980b9;
}

[data-theme="dark"] .arm-doc-btn-secondary {
    background: #2a2a3e;
    color: #ccc;
    border-color: #444;
}

[data-theme="dark"] .arm-doc-btn-secondary:hover {
    background: #333;
    color: #eee;
    border-color: #3498db;
}

.arm-doc-edit-hint {
    padding: 14px 20px 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    border-top: 1px solid #e0e0f0;
    border-radius: 0 0 16px 16px;
}

.arm-doc-hint-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #5b4fc4;
    margin-bottom: 10px;
}

.arm-doc-hint-header .material-icons {
    font-size: 16px;
    color: #7c5ce7;
}

.arm-doc-hint-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.arm-hint-chip {
    display: inline-block;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #d8d0f0;
    border-radius: 20px;
    font-size: 12px;
    color: #5b4fc4;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

.arm-hint-chip:hover {
    background: #7c5ce7;
    color: #fff;
    border-color: #7c5ce7;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124,92,231,0.25);
}

[data-theme="dark"] .arm-doc-edit-hint {
    background: linear-gradient(135deg, #1a1a30 0%, #1e1a2e 100%);
    border-top-color: #333;
}

[data-theme="dark"] .arm-doc-hint-header {
    color: #a78bfa;
}

[data-theme="dark"] .arm-doc-hint-header .material-icons {
    color: #a78bfa;
}

[data-theme="dark"] .arm-hint-chip {
    background: #2a2a40;
    border-color: #3d3660;
    color: #b8a5e8;
}

[data-theme="dark"] .arm-hint-chip:hover {
    background: #7c5ce7;
    color: #fff;
    border-color: #7c5ce7;
}

/* Responsive */
@media (max-width: 600px) {
    .arm-doc-card {
        max-width: 100%;
    }

    .arm-doc-actions {
        flex-direction: column;
    }

    .arm-doc-btn {
        justify-content: center;
    }

    .arm-doc-preview-iframe {
        height: 300px !important;
    }

    .arm-hint-chip {
        font-size: 11px;
        padding: 4px 10px;
    }
}
/* ================================================
   ONBOARDING MODAL
   ================================================ */
#onboardingModal {
    z-index: 10000;
}

#onboardingModal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.onboarding-modal-container {
    background: var(--bg-white, #fff);
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    animation: onboardingSlideUp 0.35s ease-out;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}

.onboarding-modal-container::-webkit-scrollbar {
    width: 5px;
}

.onboarding-modal-container::-webkit-scrollbar-track {
    background: transparent;
    margin: 20px 0;
}

.onboarding-modal-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

.onboarding-modal-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

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

.onboarding-modal-header {
    text-align: center;
    padding: 32px 24px 16px;
}

.onboarding-modal-header .onboarding-logo {
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
}

.onboarding-modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-dark, #1f2937);
}

.onboarding-modal-header p {
    font-size: 14px;
    color: var(--text-muted, #6b7280);
    margin: 0;
    line-height: 1.5;
}

.onboarding-watch-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    background: none;
    border: 1px solid var(--primary, #00b3c9);
    color: var(--primary, #00b3c9);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.onboarding-watch-video-btn:hover { background: rgba(0, 179, 201, .08); }
.onboarding-watch-video-btn .material-icons { font-size: 16px; }

.onboarding-modal-body {
    padding: 16px 24px 28px;
}

.onboarding-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark, #374151);
    margin-bottom: 8px;
}

.onboarding-field label .material-icons {
    font-size: 18px;
    color: var(--primary, #00b3c9);
}

.onboarding-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.onboarding-field input:focus {
    border-color: var(--primary, #00b3c9);
    box-shadow: 0 0 0 3px rgba(0, 179, 201, 0.15);
}

.onboarding-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.onboarding-actions .btn-secondary {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border, #e2e8f0);
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted, #6b7280);
    transition: background 0.2s;
}

.onboarding-actions .btn-secondary:hover {
    background: var(--bg-light, #f8fafc);
}

.onboarding-actions .btn-primary {
    flex: 1;
    padding: 12px;
    border: none;
    background: var(--primary, #00b3c9);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.onboarding-actions .btn-primary:hover {
    background: #0090a3;
}

.onboarding-actions .btn-primary .material-icons {
    font-size: 18px;
}

/* Onboarding loading */
.onboarding-loading {
    text-align: center;
    padding: 32px 0;
}

.onboarding-loading .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border, #e2e8f0);
    border-top-color: var(--primary, #00b3c9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.onboarding-loading p {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark, #374151);
    margin: 0 0 4px;
}

.onboarding-loading small {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}

/* Onboarding results */
.onboarding-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 4px;
}

.onboarding-result-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-light, #f8fafc);
    border-radius: 10px;
}

.result-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    min-width: 100px;
}

.result-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark, #1f2937);
    text-align: right;
}

/* Onboarding review step - editable fields */
.onboarding-results-edit {
    max-height: 46vh;
    overflow-y: auto;
}
.onboarding-edit-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 12px;
    background: var(--bg-light, #f8fafc);
    border-radius: 10px;
    margin-bottom: 10px;
}
.onboarding-edit-row .result-label {
    text-align: left;
    min-width: 0;
}
.ob-edit-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-dark, #1f2937);
    background: var(--bg-primary, #fff);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ob-edit-input:focus {
    border-color: var(--primary, #00b3c9);
    box-shadow: 0 0 0 3px rgba(0, 179, 201, 0.12);
}
textarea.ob-edit-input {
    resize: vertical;
    line-height: 1.4;
}
[data-theme="dark"] .onboarding-edit-row {
    background: rgba(255, 255, 255, 0.03);
}
[data-theme="dark"] .ob-edit-input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

/* Onboarding error */
.onboarding-error {
    text-align: center;
    padding: 24px 0;
}

.onboarding-error p {
    font-size: 14px;
    color: var(--text-muted, #6b7280);
    margin: 12px 0 0;
}

/* Onboarding connect accounts */
.onboarding-connect-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.onboarding-connect-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 12px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    text-align: center;
}

.onboarding-connect-card:hover {
    border-color: var(--primary, #00b3c9);
    box-shadow: 0 4px 12px rgba(0, 179, 201, 0.12);
    background: var(--bg-light, #f8fafc);
}

.connect-card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark, #1f2937);
}

.connect-card-desc {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
}

.onboarding-trust-note {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

/* Onboarding Step 4 - Connect LinkedIn Hero */
.onboarding-connect-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 2px solid #0077b5;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    background: rgba(0, 119, 181, 0.04);
}

.onboarding-connect-hero:hover {
    background: rgba(0, 119, 181, 0.08);
    box-shadow: 0 4px 16px rgba(0, 119, 181, 0.15);
    transform: translateY(-1px);
}

.onboarding-connect-secondary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.onboarding-connect-secondary:hover {
    background: var(--bg-light, #f8fafc);
    border-color: #00b3c9;
}

[data-theme="dark"] .onboarding-connect-hero {
    border-color: #0077b5;
    background: rgba(0, 119, 181, 0.1);
}

[data-theme="dark"] .onboarding-connect-hero:hover {
    background: rgba(0, 119, 181, 0.18);
}

/* "Complete your setup" progress checklist at the top of onboarding Step 4 */
.onboarding-setup-progress {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--bg-light, #f8fafc);
}

.osp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.osp-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark, #1f2937);
}

.osp-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary, #00b3c9);
}

.osp-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--border, #e2e8f0);
    overflow: hidden;
    margin-bottom: 10px;
}

.osp-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary, #00b3c9), var(--primary-light, #00d4e6));
    transition: width 0.35s ease;
}

.osp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.osp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 9px 3px 6px;
    border-radius: 999px;
    border: 1px solid var(--border, #e2e8f0);
    color: var(--text-muted, #6b7280);
    background: #fff;
}

.osp-chip .material-icons {
    font-size: 14px;
    color: var(--text-muted, #94a3b8);
}

.osp-chip.done {
    color: #0e9f6e;
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.08);
}

.osp-chip.done .material-icons {
    color: #10b981;
}

[data-theme="dark"] .onboarding-setup-progress {
    border-color: var(--border-dark, #334155);
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .osp-title {
    color: var(--text-dark, #e2e8f0);
}

[data-theme="dark"] .osp-bar {
    background: #334155;
}

[data-theme="dark"] .osp-chip {
    background: rgba(255, 255, 255, 0.04);
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .osp-chip.done {
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.12);
}

/* Onboarding first-win hero (Step 5) */
.onboarding-firstwin {
    margin-bottom: 18px;
}

.ofw-primary {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(90deg, var(--primary, #00b3c9), var(--primary-light, #00d4e6));
    box-shadow: 0 6px 18px rgba(0, 179, 201, 0.28);
    transition: transform 0.15s, box-shadow 0.2s;
}

.ofw-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 179, 201, 0.38);
}

.ofw-primary .material-icons { font-size: 26px; }
.ofw-primary .ofw-arrow { margin-left: auto; font-size: 20px; opacity: 0.9; }
.ofw-text { display: flex; flex-direction: column; }
.ofw-title { font-size: 15px; font-weight: 700; }
.ofw-sub { font-size: 12px; opacity: 0.92; }

.ofw-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 10px auto 0;
    padding: 6px 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-dark, #0090a3);
}

.ofw-secondary:hover { text-decoration: underline; }

.ofw-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted, #94a3b8);
    font-size: 11px;
    margin: 14px 0 2px;
}

.ofw-divider::before,
.ofw-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border, #e2e8f0);
}

.ofw-divider span { padding: 0 10px; }

[data-theme="dark"] .ofw-secondary { color: var(--primary-light, #00d4e6); }
[data-theme="dark"] .ofw-divider::before,
[data-theme="dark"] .ofw-divider::after { border-top-color: #334155; }

/* Usage-based upsell card (inline, dismissible) */
.usage-upsell-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 14px auto;
    max-width: 680px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(0, 179, 201, 0.35);
    background: linear-gradient(135deg, rgba(0, 179, 201, 0.06), rgba(0, 212, 230, 0.10));
    box-shadow: 0 4px 14px rgba(0, 179, 201, 0.10);
}

.uuc-icon .material-icons { font-size: 26px; color: var(--primary, #00b3c9); }
.uuc-body { flex: 1; min-width: 0; }
.uuc-title { font-size: 14px; font-weight: 700; color: var(--text-dark, #1f2937); margin-bottom: 2px; }
.uuc-msg { font-size: 13px; color: var(--text-secondary, #475569); line-height: 1.4; }
.uuc-actions { display: flex; align-items: center; gap: 6px; }

.uuc-cta {
    white-space: nowrap;
    padding: 8px 14px;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(90deg, var(--primary, #00b3c9), var(--primary-light, #00d4e6));
}

.uuc-cta:hover { filter: brightness(1.05); }

.uuc-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #94a3b8);
    display: inline-flex;
    padding: 4px;
}

.uuc-dismiss .material-icons { font-size: 18px; }

[data-theme="dark"] .usage-upsell-card {
    border-color: rgba(0, 212, 230, 0.4);
    background: linear-gradient(135deg, rgba(0, 179, 201, 0.10), rgba(0, 212, 230, 0.06));
}

[data-theme="dark"] .uuc-title { color: #e2e8f0; }
[data-theme="dark"] .uuc-msg { color: #94a3b8; }

[data-theme="dark"] .onboarding-connect-secondary {
    border-color: #334155;
}

[data-theme="dark"] .onboarding-connect-secondary:hover {
    background: #0f172a;
}

/* Action Plan Dropdown */
.action-plan-container {
    position: relative;
}

.action-plan-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    border-radius: 999px;
    transition: color 0.2s, background 0.2s;
}

.action-plan-toggle:hover {
    color: var(--primary, #00b3c9);
    background: rgba(0, 179, 201, 0.08);
}

.action-plan-toggle.active {
    color: var(--primary, #00b3c9);
}

.action-plan-dropdown {
    display: none;
    position: absolute;
    bottom: 42px;
    left: 0;
    width: 320px;
    max-height: 360px;
    background: var(--bg-white, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow: hidden;
    animation: actionPlanSlideUp 0.2s ease-out;
}

.action-plan-dropdown.open {
    display: block;
}

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

.action-plan-header {
    padding: 10px 14px 6px;
    border-bottom: 1px solid var(--border, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.action-plan-refresh {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}

.action-plan-refresh .material-icons {
    font-size: 16px;
}

.action-plan-refresh:hover {
    color: var(--primary, #00b3c9);
    background: var(--bg-light, #f1f5f9);
}

.action-plan-refresh.spinning .material-icons {
    animation: spin 0.6s linear infinite;
}

.action-plan-list {
    overflow-y: auto;
    max-height: 320px;
    padding: 4px;
}

.action-plan-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.action-plan-item:hover {
    background: var(--bg-light, #f8fafc);
}

.action-plan-item .material-icons {
    font-size: 18px;
    flex-shrink: 0;
}

.action-plan-item-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark, #374151);
    line-height: 1.3;
}

[data-theme="dark"] .action-plan-dropdown {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .action-plan-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .action-plan-item:hover {
    background: #0f172a;
}

[data-theme="dark"] .action-plan-item-text {
    color: #e2e8f0;
}

[data-theme="dark"] .action-plan-refresh:hover {
    background: #334155;
}

.onboarding-connect-card {
    padding: 16px 12px;
}

/* Dark mode */
[data-theme="dark"] .onboarding-modal-container {
    background: #1e293b;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

[data-theme="dark"] .onboarding-modal-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .onboarding-modal-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .onboarding-action-cards {
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

[data-theme="dark"] .onboarding-action-cards::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .onboarding-connect-card {
    border-color: #334155;
}

[data-theme="dark"] .onboarding-connect-card:hover {
    background: #0f172a;
}

[data-theme="dark"] .onboarding-result-row {
    background: #0f172a;
}

[data-theme="dark"] .onboarding-field input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

/* Profile Insights Card (onboarding step 4) */
.onboarding-profile-insights {
    margin: 12px 0;
    padding: 14px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: var(--bg-light, #f8fafc);
}

.profile-insights-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark, #1f2937);
    margin-bottom: 12px;
}

.profile-insights-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-insight-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-white, #fff);
    border-radius: 8px;
    border: 1px solid var(--border, #f1f5f9);
}

.insight-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--primary, #00b3c9);
}

.insight-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 2px;
}

.insight-value {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark, #374151);
    line-height: 1.4;
}

[data-theme="dark"] .onboarding-profile-insights {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .profile-insight-item {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .insight-value {
    color: #e2e8f0;
}

/* Step 5: Goal picker cards */
.onboarding-goal-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* 4-goal layout (Find Leads / Run Outreach / Create Content / Research) - tighter */
.onboarding-goal-grid .onboarding-goal-card {
    padding: 16px 12px;
    gap: 6px;
}
.onboarding-goal-grid .goal-card-desc {
    font-size: 11px;
}

.onboarding-goal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.15s;
    text-align: center;
}

.onboarding-goal-card:hover {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
    background: var(--bg-light, #f8fafc);
    transform: translateY(-2px);
}

.goal-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark, #1f2937);
}

.goal-card-desc {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    line-height: 1.4;
}

[data-theme="dark"] .onboarding-goal-card {
    border-color: #334155;
}

[data-theme="dark"] .onboarding-goal-card:hover {
    background: #0f172a;
    border-color: #6366f1;
}

/* Step 6: Action cards */
.onboarding-action-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}

.onboarding-action-cards::-webkit-scrollbar {
    width: 4px;
}

.onboarding-action-cards::-webkit-scrollbar-track {
    background: transparent;
}

.onboarding-action-cards::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

.onboarding-action-cards::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.onboarding-action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.15s, transform 0.15s;
}

.onboarding-action-card:hover {
    border-color: var(--primary, #00b3c9);
    box-shadow: 0 4px 14px rgba(0, 179, 201, 0.12);
    background: var(--bg-light, #f8fafc);
    transform: translateX(4px);
}

.action-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.action-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-card-desc {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-card-arrow {
    font-size: 18px;
    color: var(--text-muted, #94a3b8);
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.onboarding-action-card:hover .action-card-arrow {
    color: var(--primary, #00b3c9);
    transform: translateX(2px);
}

[data-theme="dark"] .onboarding-action-card {
    border-color: #334155;
}

[data-theme="dark"] .onboarding-action-card:hover {
    background: #0f172a;
    border-color: #00b3c9;
}

/* Trust badges on connect cards */
.connect-card-trust {
    font-size: 10px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 4px;
}

.onboarding-trust-note {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    margin-top: 12px;
    margin-bottom: 0;
    line-height: 1.5;
}

/* LinkedIn section in Step 4 */
.onboarding-linkedin-section {
    margin-bottom: 4px;
}

@media (max-width: 480px) {
    .onboarding-modal-container {
        width: 95%;
        border-radius: 16px;
    }

    .onboarding-modal-header {
        padding: 24px 16px 12px;
    }

    .onboarding-modal-body {
        padding: 12px 16px 24px;
    }

    .action-card-title {
        font-size: 13px;
    }
}

.cdl-deal-template {
    font-size: 11px;
    color: #64748b;
}
.cdl-deal-value {
    font-weight: 700;
    font-size: 15px;
    color: #0d9488;
    white-space: nowrap;
}

/* Stage progress */
.cdl-deal-stage-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cdl-deal-stage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cdl-stage-label {
    font-size: 11px;
    color: #475569;
    font-weight: 500;
}
.cdl-stage-progress-text {
    font-size: 11px;
    font-weight: 700;
}
.cdl-stage-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}
.cdl-stage-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Bottom row: badge + date */
.cdl-deal-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cdl-invoice-badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cdl-invoice-badge.pending { background: #fef3c7; color: #92400e; }
.cdl-invoice-badge.sent { background: #dbeafe; color: #1e40af; }
.cdl-invoice-badge.paid { background: #d1fae5; color: #065f46; }
.cdl-invoice-badge.failed { background: #fee2e2; color: #991b1b; }
.cdl-invoice-badge.overdue { background: #fee2e2; color: #991b1b; }
.cdl-deal-date {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
}

/* Empty state */
.cdl-empty {
    padding: 32px 24px;
    text-align: center;
}
.cdl-empty-icon {
    font-size: 44px;
    color: #cbd5e1;
    margin-bottom: 8px;
}
.cdl-empty-title {
    font-weight: 600;
    font-size: 14px;
    color: #475569;
    margin-bottom: 4px;
}
.cdl-empty-hint {
    font-size: 12px;
    color: #94a3b8;
}

/* ── MOVE DEAL CARD ── */
.chat-move-deal-card {
    background: linear-gradient(145deg, #ffffff, #f0faf9);
    border: 1px solid #99d5cf;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
    max-width: 520px;
}
.cmdc-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
}
.cmdc-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
}
.cmdc-info { flex: 1; }
.cmdc-title { font-weight: 700; font-size: 15px; }
.cmdc-lead { font-size: 12px; opacity: 0.85; }
.cmdc-value { font-weight: 700; font-size: 16px; }
.cmdc-stages {
    display: flex; align-items: center; justify-content: center;
    padding: 20px 16px; gap: 0;
    overflow-x: auto;
}
.cmdc-stage {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; cursor: pointer; padding: 8px 12px;
    border-radius: 8px; transition: all 0.2s;
    min-width: 70px;
}
.cmdc-stage:hover { background: #f0fdfa; }
.cmdc-stage-dot {
    width: 20px; height: 20px; border-radius: 50%;
    border: 3px solid #cbd5e1; background: #fff;
    transition: all 0.2s;
}
.cmdc-stage.completed .cmdc-stage-dot {
    background: #0d9488; border-color: #0d9488;
}
.cmdc-stage.current .cmdc-stage-dot {
    background: #fff; border-color: #0d9488;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.2);
}
.cmdc-stage-name { font-size: 11px; color: #64748b; text-align: center; }
.cmdc-stage.current .cmdc-stage-name { color: #0d9488; font-weight: 700; }
.cmdc-stage-line {
    width: 20px; height: 3px; background: #cbd5e1;
    flex-shrink: 0; margin-top: -14px;
}
.cmdc-current {
    padding: 12px 20px; border-top: 1px solid #e2e8f0;
    font-size: 13px; color: #64748b; text-align: center;
}
.cmdc-current strong { color: #0d9488; }

/* ── DEAL TEMPLATE PREVIEW ── */
.chat-deal-template-card {
    background: linear-gradient(145deg, #ffffff, #f0faf9);
    border: 1px solid #99d5cf;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
    max-width: 520px;
}
.cdtc-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
}
.cdtc-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.cdtc-info { flex: 1; }
.cdtc-title { font-weight: 700; font-size: 15px; }
.cdtc-desc { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.cdtc-badge {
    padding: 4px 10px; border-radius: 20px;
    background: rgba(255,255,255,0.2);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.cdtc-badge.success { background: #d1fae5; color: #065f46; }
.cdtc-badge.error { background: #fee2e2; color: #991b1b; }
.cdtc-body { padding: 16px 20px; }
.cdtc-section { margin-bottom: 16px; }
.cdtc-section:last-child { margin-bottom: 0; }
.cdtc-section-title {
    font-size: 12px; font-weight: 700; color: #0d9488;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.cdtc-stages {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.cdtc-stage {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; background: #f0fdfa;
    border: 1px solid #99d5cf; border-radius: 8px;
    font-size: 13px; color: #0f766e;
}
.cdtc-stage-num {
    width: 20px; height: 20px; border-radius: 50%;
    background: #0d9488; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
}
.cdtc-arrow { color: #94a3b8; font-size: 10px; }
.cdtc-items { display: flex; flex-direction: column; gap: 6px; }
.cdtc-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 8px;
}
.cdtc-item-name { font-size: 13px; color: #1e293b; font-weight: 500; }
.cdtc-item-price { font-size: 13px; color: #0d9488; font-weight: 600; }
.cdtc-actions {
    padding: 12px 20px; border-top: 1px solid #e2e8f0;
    display: flex; gap: 8px;
}
.cdtc-btn {
    padding: 8px 16px; border-radius: 8px; border: none;
    cursor: pointer; font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all 0.2s;
}
.cdtc-btn.primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
}
.cdtc-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3); }
.cdtc-btn.secondary {
    background: #f1f5f9; color: #64748b;
}
.cdtc-btn.secondary:hover { background: #e2e8f0; }
.cdtc-loading {
    font-size: 13px; color: #0d9488;
    display: flex; align-items: center; gap: 8px;
}

/* ── LEAD LOOKUP CARD ── */
.chat-lead-lookup-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    max-width: 520px;
}
.cllc-header {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
}
.cllc-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700;
}
.cllc-info { flex: 1; }
.cllc-name { font-weight: 700; font-size: 16px; }
.cllc-title-company { font-size: 13px; opacity: 0.9; }
.cllc-score-badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px; border-radius: 20px;
    font-size: 14px; font-weight: 700;
}
.cllc-contact-info {
    padding: 14px 20px; border-bottom: 1px solid #e2e8f0;
    display: flex; flex-wrap: wrap; gap: 10px;
}
.cllc-ci {
    font-size: 12px; color: #475569;
    display: flex; align-items: center; gap: 6px;
}
.cllc-ci i { color: #0d9488; }
.cllc-ci a { color: #0d9488; text-decoration: none; }
.cllc-ci a:hover { text-decoration: underline; }
.cllc-section { padding: 14px 20px; border-bottom: 1px solid #f1f5f9; }
.cllc-section:last-child { border-bottom: none; }
.cllc-section-title {
    font-size: 12px; font-weight: 700; color: #0d9488;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.cllc-deal-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0; font-size: 13px;
}
.cllc-deal-name { flex: 1; font-weight: 500; color: #1e293b; }
.cllc-deal-stage {
    padding: 2px 8px; border-radius: 10px;
    background: #f0fdfa; color: #0f766e;
    font-size: 11px; font-weight: 600;
}
.cllc-deal-value { font-weight: 700; color: #0d9488; }
.cllc-task-row {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; font-size: 13px;
}
.cllc-task-status { width: 18px; text-align: center; }
.cllc-task-status.completed { color: #10b981; }
.cllc-task-status.pending { color: #f59e0b; }
.cllc-task-title { flex: 1; color: #1e293b; }
.cllc-task-due { font-size: 11px; color: #94a3b8; }
.cllc-history-row {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; font-size: 13px;
}
.cllc-history-icon { width: 18px; text-align: center; color: #0d9488; }
.cllc-history-title { flex: 1; color: #475569; }
.cllc-history-date { font-size: 11px; color: #94a3b8; }
.cllc-notes {
    font-size: 13px; color: #475569; line-height: 1.5;
    white-space: pre-wrap;
}

/* ── DARK MODE FOR MEETING CARDS ── */
.dark-mode .chat-meeting-card,
.dark-mode .chat-meeting-info-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-color: #334155;
}
.dark-mode .cmc-detail,
.dark-mode .cmi-section-content { color: #94a3b8; }
.dark-mode .cmi-transcript { background: #0f172a; color: #cbd5e1; }
.dark-mode .cmc-footer,
.dark-mode .cmi-section { border-color: #334155; }

/* ── DARK MODE FOR DEAL/TASK/LEAD CARDS ── */
.dark-mode .chat-task-card,
.dark-mode .chat-deal-card,
.dark-mode .chat-deal-lookup,
.dark-mode .chat-move-deal-card,
.dark-mode .chat-deal-template-card,
.dark-mode .chat-lead-lookup-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-color: #334155;
}
.dark-mode .ctc-description,
.dark-mode .cdc-body > div,
.dark-mode .cllc-ci,
.dark-mode .cllc-notes,
.dark-mode .cllc-history-title { color: #94a3b8; }
.dark-mode .ctc-meta-item,
.dark-mode .cdl-deal-template,
.dark-mode .cmdc-current,
.dark-mode .cdl-stage-label,
.dark-mode .cdl-deal-date,
.dark-mode .cllc-task-due,
.dark-mode .cllc-history-date { color: #64748b; }
.dark-mode .cdl-deal-card {
    background: #1e293b; border-color: #334155;
}
.dark-mode .cdl-deal-card:hover {
    border-color: #14b8a6;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
}
.dark-mode .cdl-stats-row { background: #0f172a; border-color: #334155; }
.dark-mode .cdl-stat { border-color: #334155; }
.dark-mode .cdl-stat-value { color: #14b8a6; }
.dark-mode .cdl-stat-label { color: #64748b; }
.dark-mode .cdl-deal-avatar { background: linear-gradient(135deg, #115e59, #0d9488); }
.dark-mode .cdl-deal-template { color: #64748b; }
.dark-mode .cdl-stage-label { color: #94a3b8; }
.dark-mode .cdl-empty-title { color: #94a3b8; }
.dark-mode .cdl-empty-icon { color: #475569; }
.dark-mode .cdl-deal-name,
.dark-mode .cllc-deal-name,
.dark-mode .cllc-task-title,
.dark-mode .cllc-name,
.dark-mode .cdtc-item-name { color: #e2e8f0; }
.dark-mode .ctc-status,
.dark-mode .cdc-actions,
.dark-mode .cdtc-actions,
.dark-mode .cllc-contact-info,
.dark-mode .cllc-section { border-color: #334155; }
.dark-mode .cdtc-stage {
    background: #1e293b; border-color: #334155; color: #14b8a6;
}
.dark-mode .cdtc-item {
    background: #1e293b; border-color: #334155;
}
.dark-mode .cdtc-btn.secondary {
    background: #334155; color: #94a3b8;
}
.dark-mode .cmdc-stage:hover { background: rgba(13, 148, 136, 0.1); }
.dark-mode .cmdc-stage-name { color: #94a3b8; }
.dark-mode .cmdc-stage.current .cmdc-stage-name { color: #14b8a6; }
.dark-mode .cmdc-stage-dot { border-color: #475569; background: #1e293b; }
.dark-mode .cdl-stage-bar { background: #334155; }
.dark-mode .cmdc-stage-line { background: #475569; }

/* =========================================================================
   LEAD ANALYSIS / DEEP DIVE CARD
   ========================================================================= */
.chat-lead-analysis-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
    max-width: 560px;
}
.cla-header {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}
.cla-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700;
}
.cla-info { flex: 1; }
.cla-name { font-weight: 700; font-size: 17px; }
.cla-title-company { font-size: 13px; opacity: 0.9; }
.cla-meta { display: flex; gap: 8px; margin-top: 4px; }
.cla-status-badge {
    padding: 2px 8px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    font-size: 11px; font-weight: 600;
}
.cla-age { font-size: 11px; opacity: 0.8; }
.cla-health-badge {
    padding: 6px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 700; color: #fff;
    white-space: nowrap;
}

/* Metrics grid */
.cla-metrics-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1px; background: #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}
.cla-metric {
    background: #fff; padding: 14px 12px; text-align: center;
}
.cla-metric-value {
    font-size: 20px; font-weight: 800; color: #1e293b;
}
.cla-metric-label {
    font-size: 10px; color: #64748b; text-transform: uppercase;
    letter-spacing: 0.5px; margin-top: 2px;
}

/* Trend row */
.cla-trend-row {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px; color: #475569;
}

/* Sections */
.cla-section { padding: 14px 20px; border-bottom: 1px solid #f1f5f9; }
.cla-section:last-child { border-bottom: none; }
.cla-section-title {
    font-size: 12px; font-weight: 700; color: #6366f1;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.cla-empty { font-size: 13px; color: #94a3b8; font-style: italic; }

/* Deal rows */
.cla-deal-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; font-size: 13px;
}
.cla-deal-info { display: flex; flex-direction: column; gap: 2px; }
.cla-deal-name { font-weight: 600; color: #1e293b; }
.cla-deal-stage {
    font-size: 11px; color: #6366f1;
}
.cla-deal-meta { display: flex; align-items: center; gap: 10px; }
.cla-deal-value { font-weight: 700; color: #6366f1; }
.cla-deal-days {
    font-size: 11px; color: #64748b;
    padding: 2px 6px; border-radius: 6px; background: #f1f5f9;
}
.cla-deal-days.warning { color: #f59e0b; background: #fef3c7; }

/* Task rows */
.cla-task-row {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; font-size: 13px;
}
.cla-task-icon { width: 18px; text-align: center; color: #f59e0b; }
.cla-task-icon.done { color: #10b981; }
.cla-task-icon.overdue { color: #ef4444; }
.cla-task-title { flex: 1; color: #1e293b; }
.cla-task-due { font-size: 11px; color: #94a3b8; }

/* Email rows */
.cla-email-row {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; font-size: 13px;
}
.cla-email-subject { flex: 1; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cla-email-date { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.cla-email-indicators { display: flex; gap: 6px; font-size: 12px; }

/* Footer */
.cla-footer {
    padding: 10px 20px; background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.cla-verified {
    font-size: 11px; color: #10b981;
    display: flex; align-items: center; gap: 6px;
}

/* ── DARK MODE FOR LEAD ANALYSIS CARD ── */
.dark-mode .chat-lead-analysis-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}
.dark-mode .cla-metric { background: #1e293b; }
.dark-mode .cla-metrics-grid { background: #334155; }
.dark-mode .cla-metric-value { color: #e2e8f0; }
.dark-mode .cla-metric-label { color: #64748b; }
.dark-mode .cla-trend-row { background: #0f172a; border-color: #334155; color: #94a3b8; }
.dark-mode .cla-section { border-color: #334155; }
.dark-mode .cla-deal-name,
.dark-mode .cla-task-title,
.dark-mode .cla-name { color: #e2e8f0; }
.dark-mode .cla-email-subject { color: #94a3b8; }
.dark-mode .cla-deal-days { background: #334155; color: #94a3b8; }
.dark-mode .cla-deal-days.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.dark-mode .cla-footer { background: #0f172a; border-color: #334155; }

/* =========================================================================
   ENGAGED LEADS CARD
   ========================================================================= */
.chat-engaged-leads {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.08);
    max-width: 600px;
    width: 100%;
}
.cel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    color: #fff;
}
.cel-header-left { display: flex; align-items: center; gap: 12px; }
.cel-icon { font-size: 24px; opacity: 0.9; }
.cel-title { font-weight: 700; font-size: 16px; line-height: 1.2; }
.cel-subtitle { font-size: 12px; opacity: 0.8; font-weight: 400; }
.cel-stats-row {
    display: flex; gap: 0; border-bottom: 1px solid #e2e8f0; background: #fef2f2;
}
.cel-stat {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 12px 8px; border-right: 1px solid #e2e8f0;
}
.cel-stat:last-child { border-right: none; }
.cel-stat-value { font-size: 18px; font-weight: 700; color: #ef4444; }
.cel-stat-label { font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.cel-leads-list { max-height: 400px; overflow-y: auto; }
.cel-lead-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.cel-lead-row:hover { background: #fef2f2; }
.cel-lead-heat { font-size: 16px; flex-shrink: 0; width: 50px; text-align: center; }
.cel-lead-info { flex: 1; min-width: 0; }
.cel-lead-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cel-lead-company { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cel-lead-metrics { display: flex; gap: 10px; flex-shrink: 0; }
.cel-metric {
    display: flex; align-items: center; gap: 3px;
    font-size: 12px; color: #64748b; font-weight: 500;
}
.cel-lead-status { flex-shrink: 0; }
.cel-status-badge {
    padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; text-transform: uppercase;
    background: #f1f5f9; color: #475569;
}
.cel-status-badge.qualified { background: #d1fae5; color: #065f46; }
.cel-status-badge.contacted { background: #dbeafe; color: #1e40af; }
.cel-status-badge.new { background: #fef3c7; color: #92400e; }
.cel-status-badge.customer { background: #d1fae5; color: #065f46; }
.cel-replied-badge {
    background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
}
.cel-empty { padding: 40px 20px; text-align: center; }

/* Engaged/Filtered Lead Action Buttons */
.cel-lead-actions {
    display: flex; gap: 4px; flex-shrink: 0; margin-left: auto;
}
.cel-action-btn {
    width: 30px; height: 30px; border: none; border-radius: 8px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; text-decoration: none;
}
.cel-action-btn .material-icons { font-size: 16px; }
.cel-email-btn { background: #eff6ff; color: #3b82f6; }
.cel-email-btn:hover { background: #3b82f6; color: #fff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(59,130,246,0.3); }
.cel-email-btn .material-icons { color: #3b82f6; }
.cel-email-btn:hover .material-icons { color: #fff; }
.cel-followup-btn { background: #fef3c7; color: #d97706; }
.cel-followup-btn:hover { background: #d97706; color: #fff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(217,119,6,0.3); }
.cel-followup-btn .material-icons { color: #d97706; }
.cel-followup-btn:hover .material-icons { color: #fff; }
.cel-details-btn { background: #f0fdf4; color: #10b981; }
.cel-details-btn:hover { background: #10b981; color: #fff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.cel-details-btn .material-icons { color: #10b981; }
.cel-details-btn:hover .material-icons { color: #fff; }

/* Filtered leads card action buttons */
.cfl-lead-actions {
    display: flex; gap: 4px; padding: 8px 12px 0; border-top: 1px solid #f1f5f9; margin-top: 8px;
}

/* Dark mode for lead action buttons */
.dark-mode .cel-email-btn { background: rgba(59,130,246,0.15); }
.dark-mode .cel-email-btn:hover { background: #3b82f6; }
.dark-mode .cel-followup-btn { background: rgba(217,119,6,0.15); }
.dark-mode .cel-followup-btn:hover { background: #d97706; }
.dark-mode .cel-details-btn { background: rgba(16,185,129,0.15); }
.dark-mode .cel-details-btn:hover { background: #10b981; }
.dark-mode .cfl-lead-actions { border-top-color: #1e293b; }

/* =========================================================================
   COMPOSE EMAIL MODAL
   ========================================================================= */
.cem-field { margin-bottom: 16px; }
.cem-label {
    display: block; font-size: 12px; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.cem-input, .cem-select, .cem-textarea {
    width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0;
    border-radius: 10px; font-size: 14px; color: #1e293b;
    background: #fff; transition: border-color 0.2s;
    font-family: inherit; box-sizing: border-box;
}
.cem-input:focus, .cem-select:focus, .cem-textarea:focus {
    outline: none; border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.cem-textarea { resize: vertical; min-height: 160px; line-height: 1.6; }
.cem-ai-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.cem-btn-ai {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 8px;
    background: #f8fafc; color: #475569; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.cem-btn-ai:hover { background: #eff6ff; border-color: #3b82f6; color: #3b82f6; }
.cem-btn-ai .material-icons { font-size: 16px; color: #a855f7; }
.cem-hint { font-size: 11px; color: #94a3b8; }
.cem-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 20px; border-top: 1px solid #e2e8f0;
}
.cem-btn-cancel {
    padding: 10px 20px; border: 1px solid #e2e8f0; border-radius: 10px;
    background: #fff; color: #64748b; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.cem-btn-cancel:hover { background: #f1f5f9; }
.cem-btn-send {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 24px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: white;
    font-size: 14px; font-weight: 600; cursor: pointer;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3); transition: all 0.2s;
}
.cem-btn-send:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.4); }
.cem-btn-send .material-icons { font-size: 18px; }

/* Dark mode compose email */
.dark-mode .cem-input, .dark-mode .cem-select, .dark-mode .cem-textarea {
    background: #1e293b; border-color: #334155; color: #e2e8f0;
}
.dark-mode .cem-input:focus, .dark-mode .cem-select:focus, .dark-mode .cem-textarea:focus {
    border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.dark-mode .cem-label { color: #94a3b8; }
.dark-mode .cem-btn-ai { background: #1e293b; border-color: #334155; color: #cbd5e1; }
.dark-mode .cem-btn-ai:hover { background: rgba(59,130,246,0.1); }
.dark-mode .cem-footer { border-top-color: #334155; }
.dark-mode .cem-btn-cancel { background: #1e293b; border-color: #334155; color: #94a3b8; }
.dark-mode .cem-btn-cancel:hover { background: #334155; }

/* "Has More" info banner */
.cel-has-more {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; background: #eff6ff; color: #1e40af;
    font-size: 12px; font-weight: 500; border-top: 1px solid #dbeafe;
}
.cel-has-more .material-icons { font-size: 16px; color: #3b82f6; flex-shrink: 0; }
.dark-mode .cel-has-more { background: rgba(59,130,246,0.1); color: #93c5fd; border-top-color: #1e3a5f; }

/* Card-level Bulk Action Buttons */
.cel-bulk-actions {
    display: flex; gap: 8px; padding: 14px 20px;
    border-top: 1px solid #e2e8f0; background: #fafbfc;
    border-radius: 0 0 16px 16px;
}
.cel-bulk-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 18px; border: none; border-radius: 10px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.2s ease;
}
.cel-bulk-btn .material-icons { font-size: 18px; }
.cel-bulk-btn:disabled { opacity: 0.6; cursor: default; }
.cel-bulk-email {
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: white;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.cel-bulk-email:hover:not(:disabled) {
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}
.cel-bulk-canvas {
    background: #f1f5f9; color: #475569;
    border: 1px solid #e2e8f0;
}
.cel-bulk-canvas:hover:not(:disabled) {
    background: #e2e8f0; transform: translateY(-1px);
}

/* Dark mode bulk actions */
.dark-mode .cel-bulk-actions { background: #1e293b; border-top-color: #334155; }
.dark-mode .cel-bulk-canvas { background: #334155; color: #cbd5e1; border-color: #475569; }
.dark-mode .cel-bulk-canvas:hover:not(:disabled) { background: #475569; }

/* Responsive - stack actions on small screens */
@media (max-width: 480px) {
    .cel-lead-actions { gap: 2px; }
    .cel-action-btn { width: 26px; height: 26px; }
    .cel-action-btn .material-icons { font-size: 14px; }
    .cel-bulk-actions { flex-direction: column; }
    .cel-bulk-btn { justify-content: center; }
}

/* =========================================================================
   TASK LIST CARD
   ========================================================================= */
.chat-task-list {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.08);
    max-width: 520px;
    width: 100%;
}
.ctl-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
}
.ctl-header-left { display: flex; align-items: center; gap: 12px; }
.ctl-icon { font-size: 24px; opacity: 0.9; }
.ctl-title { font-weight: 700; font-size: 16px; }
.ctl-subtitle { font-size: 12px; opacity: 0.8; }
.ctl-tasks { max-height: 400px; overflow-y: auto; }
.ctl-task-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.ctl-task-row:hover { background: #f0fdfa; }
.ctl-task-row.overdue { background: #fef2f2; }
.ctl-task-check { cursor: pointer; flex-shrink: 0; color: #94a3b8; transition: color 0.2s; }
.ctl-task-check:hover { color: #10b981; }
.ctl-task-check .material-icons { font-size: 22px; }
.ctl-task-info { flex: 1; min-width: 0; }
.ctl-task-title { font-weight: 600; font-size: 13px; }
.ctl-task-meta { display: flex; gap: 12px; margin-top: 4px; }
.ctl-task-due, .ctl-task-lead {
    font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 3px;
}
.ctl-task-due.overdue { color: #ef4444; font-weight: 600; }
.ctl-task-badges { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ctl-priority-badge {
    padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700;
    color: #fff; text-transform: uppercase; letter-spacing: 0.5px;
}
.ctl-type-icon { font-size: 18px; color: #94a3b8; }
.ctl-empty { padding: 40px 20px; text-align: center; }

/* =========================================================================
   DOCUMENT READ CARD
   ========================================================================= */
.chat-doc-read-card {
    background: #ffffff;
    border: 1px solid #c7d2fe;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
    max-width: 520px;
    width: 100%;
}
.cdr-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
}
.cdr-icon .material-icons { font-size: 22px; }
.cdr-info { flex: 1; }
.cdr-title { font-weight: 700; font-size: 15px; }
.cdr-meta { font-size: 12px; opacity: 0.85; }
.cdr-toggle { cursor: pointer; opacity: 0.8; transition: opacity 0.2s; }
.cdr-toggle:hover { opacity: 1; }
.cdr-toggle .material-icons { font-size: 24px; }
.cdr-content {
    padding: 16px 20px; border-bottom: 1px solid #e2e8f0;
}
.cdr-body {
    font-size: 13px; color: #475569; line-height: 1.7;
    max-height: 300px; overflow-y: auto; white-space: pre-wrap;
}
.cdr-footer {
    padding: 10px 20px; display: flex; justify-content: space-between; align-items: center;
    background: #f8fafc;
}
.cdr-updated { font-size: 11px; color: #94a3b8; display: flex; align-items: center; gap: 4px; }
.cdr-link {
    font-size: 12px; color: #6366f1; text-decoration: none; font-weight: 600;
    display: flex; align-items: center; gap: 4px;
}
.cdr-link:hover { color: #4f46e5; text-decoration: underline; }

/* =========================================================================
   INBOX CARD
   ========================================================================= */
.chat-inbox-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
    max-width: 600px;
    width: 100%;
}
.cib-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}
.cib-header-left { display: flex; align-items: center; gap: 12px; }
.cib-icon { font-size: 24px; opacity: 0.9; }
.cib-title { font-weight: 700; font-size: 16px; }
.cib-subtitle { font-size: 12px; opacity: 0.8; }
.cib-emails { max-height: 400px; overflow-y: auto; }
.cib-email-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 20px; border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.cib-email-row:hover { background: #eff6ff; }
.cib-email-row.unread { background: #f0f9ff; }
.cib-email-indicator { width: 10px; flex-shrink: 0; padding-top: 6px; }
.cib-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; display: block; }
.cib-email-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.cib-email-info { flex: 1; min-width: 0; }
.cib-email-from {
    font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px;
    flex-wrap: wrap;
}
.cib-lead-tag {
    background: #e0f2f1; color: #0d9488; padding: 1px 6px; border-radius: 8px;
    font-size: 10px; font-weight: 600;
}
.cib-reply-badge {
    background: #d1fae5; color: #065f46; padding: 1px 6px; border-radius: 8px;
    font-size: 10px; font-weight: 600;
}
.cib-email-subject { font-size: 13px; color: #334155; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cib-email-preview { font-size: 12px; color: #94a3b8; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cib-email-time { font-size: 11px; color: #94a3b8; white-space: nowrap; flex-shrink: 0; padding-top: 2px; }
.cib-empty { padding: 40px 20px; text-align: center; }

.cib-email-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.cib-email-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.cib-email-row:hover .cib-email-actions { opacity: 1; }
.cib-row-action {
    background: transparent; border: none; cursor: pointer;
    width: 28px; height: 28px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #64748b;
}
.cib-row-action:hover { background: #e2e8f0; color: #0d9488; }
.cib-row-action .material-icons { font-size: 16px; }

/* Reply email card - "quoted" original block above the draft */
.cre-original {
    background: #f8fafc;
    border-left: 3px solid #0d9488;
    padding: 10px 14px;
    margin: 0 16px 8px;
    border-radius: 0 8px 8px 0;
}
.cre-original-head { font-size: 12px; color: #334155; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cre-original-preview { font-size: 13px; color: #64748b; line-height: 1.5; }

/* Inbox conversation modal */
.inbox-modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.55);
    display: none; align-items: center; justify-content: center; z-index: 3500;
    padding: 20px;
}
.inbox-modal-overlay.open { display: flex; }
.inbox-modal {
    background: white; border-radius: 14px;
    width: 100%; max-width: 820px; max-height: 88vh;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.inbox-modal-head {
    padding: 14px 20px; border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
    background: #f8fafc;
}
.inbox-modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: #0f172a; }
.inbox-modal-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.inbox-modal-close { background: transparent; border: none; cursor: pointer; color: #64748b; font-size: 16px; padding: 4px 8px; }
.inbox-modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; background: #fff; }
.inbox-thread-msg { padding: 12px 14px; border-radius: 10px; margin-bottom: 10px; border: 1px solid #e2e8f0; }
.inbox-thread-msg.outbound { background: #f0fdfa; border-color: #ccfbf1; }
.inbox-thread-msg.inbound  { background: #fff; }
.inbox-thread-meta { font-size: 12px; color: #64748b; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.inbox-thread-who  { font-weight: 600; color: #0f172a; }
.inbox-thread-body { font-size: 14px; color: #334155; line-height: 1.55; white-space: pre-wrap; }
.inbox-modal-foot { border-top: 1px solid #e2e8f0; background: #f8fafc; padding: 12px 20px; display: flex; flex-direction: column; gap: 10px; }
.inbox-reply-textarea {
    width: 100%; min-height: 90px; padding: 10px 12px;
    border: 1px solid #cbd5e1; border-radius: 8px; font: inherit;
    resize: vertical; color: #0f172a;
}
.inbox-foot-actions { display: flex; gap: 8px; justify-content: flex-end; }
.inbox-btn {
    padding: 8px 16px; border-radius: 8px; border: 1px solid #cbd5e1;
    background: white; font-weight: 600; cursor: pointer; font-size: 13px;
    display: inline-flex; align-items: center; gap: 6px;
}
.inbox-btn.primary { background: #0d9488; color: white; border-color: #0d9488; }
.inbox-btn.primary:hover { background: #0f766e; }
.inbox-btn:disabled { opacity: .6; cursor: not-allowed; }

/* =========================================================================
   FILTERED LEADS CARD
   ========================================================================= */
.chat-filtered-leads {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    max-width: 600px;
    width: 100%;
}
.cfl-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}
.cfl-header-left { display: flex; align-items: center; gap: 12px; }
.cfl-icon { font-size: 24px; opacity: 0.9; }
.cfl-title { font-weight: 700; font-size: 16px; }
.cfl-subtitle { font-size: 12px; opacity: 0.8; }
.cfl-filters {
    padding: 10px 20px; display: flex; gap: 6px; flex-wrap: wrap;
    border-bottom: 1px solid #e2e8f0; background: #fffbeb;
}
.cfl-chip {
    background: #fef3c7; color: #92400e; padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.cfl-leads-grid { max-height: 400px; overflow-y: auto; }
.cfl-lead-card {
    padding: 14px 20px; border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.cfl-lead-card:hover { background: #fffbeb; }
.cfl-lead-top { display: flex; align-items: center; gap: 12px; }
.cfl-lead-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #115e59);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.cfl-lead-main { flex: 1; min-width: 0; }
.cfl-lead-name { font-weight: 600; font-size: 13px; }
.cfl-lead-title { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfl-status-badge {
    padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; text-transform: uppercase;
    background: #f1f5f9; color: #475569; flex-shrink: 0;
}
.cfl-status-badge.qualified { background: #d1fae5; color: #065f46; }
.cfl-status-badge.contacted { background: #e0f2f1; color: #0d9488; }
.cfl-status-badge.new { background: #fef3c7; color: #92400e; }
.cfl-status-badge.customer { background: #d1fae5; color: #065f46; }
.cfl-status-badge.proposal { background: #e0f2f1; color: #0d9488; }
.cfl-lead-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; padding-left: 44px; }
.cfl-tag {
    background: #e0f2f1; color: #0d9488; padding: 1px 8px; border-radius: 8px;
    font-size: 10px; font-weight: 600;
}
.cfl-lead-contact { margin-top: 4px; padding-left: 44px; }
.cfl-contact-item {
    font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 3px;
}
.cfl-empty { padding: 40px 20px; text-align: center; }

/* =========================================================================
   DARK MODE - NEW INTELLIGENCE CARDS
   ========================================================================= */
.dark-mode .chat-engaged-leads,
.dark-mode .chat-task-list,
.dark-mode .chat-doc-read-card,
.dark-mode .chat-inbox-card,
.dark-mode .chat-filtered-leads {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-color: #334155;
}
.dark-mode .cel-stats-row { background: #0f172a; border-color: #334155; }
.dark-mode .cel-stat { border-color: #334155; }
.dark-mode .cel-stat-value { color: #f87171; }
.dark-mode .cel-lead-row { border-color: #1e293b; }
.dark-mode .cel-lead-row:hover { background: rgba(239, 68, 68, 0.05); }
.dark-mode .cel-lead-name,
.dark-mode .ctl-task-title,
.dark-mode .cib-email-from,
.dark-mode .cfl-lead-name { color: #e2e8f0; }
.dark-mode .cel-lead-company,
.dark-mode .cel-metric,
.dark-mode .ctl-task-due,
.dark-mode .ctl-task-lead,
.dark-mode .cib-email-preview,
.dark-mode .cib-email-time,
.dark-mode .cfl-lead-title,
.dark-mode .cfl-contact-item,
.dark-mode .cdr-updated { color: #64748b; }
.dark-mode .ctl-task-row { border-color: #1e293b; }
.dark-mode .ctl-task-row:hover { background: rgba(13, 148, 136, 0.05); }
.dark-mode .ctl-task-row.overdue { background: rgba(239, 68, 68, 0.08); }
.dark-mode .ctl-task-check { color: #475569; }
.dark-mode .cib-email-row { border-color: #1e293b; }
.dark-mode .cib-email-row:hover { background: rgba(59, 130, 246, 0.05); }
.dark-mode .cib-email-row.unread { background: rgba(59, 130, 246, 0.08); }
.dark-mode .cib-email-subject { color: #94a3b8; }
.dark-mode .cib-lead-tag { background: #134e4a; color: #5eead4; }
.dark-mode .cdr-content { border-color: #334155; }
.dark-mode .cdr-body { color: #94a3b8; }
.dark-mode .cdr-footer { background: #0f172a; border-color: #334155; }
.dark-mode .cdr-link { color: #818cf8; }
.dark-mode .cfl-filters { background: #1e293b; border-color: #334155; }
.dark-mode .cfl-chip { background: #422006; color: #fbbf24; }
.dark-mode .cfl-lead-card { border-color: #1e293b; }
.dark-mode .cfl-lead-card:hover { background: rgba(245, 158, 11, 0.05); }
.dark-mode .cfl-tag { background: #134e4a; color: #5eead4; }
.dark-mode .cel-status-badge,
.dark-mode .cfl-status-badge { background: #334155; color: #94a3b8; }

/* =====================================================================
   📅 SCHEDULE CARD - Unified schedule timeline (.csq-*)
   ===================================================================== */
.chat-schedule-card {
    background: linear-gradient(145deg, #ffffff, #f0fdfa);
    border: 1px solid #99d5cf;
    border-radius: 16px;
    overflow: hidden;
    max-width: 480px;
    box-shadow: 0 4px 16px rgba(0, 179, 201, 0.08);
}
.csq-header {
    background: linear-gradient(135deg, #00b3c9, #0090a3);
    padding: 16px 20px;
    color: white;
}
.csq-header-left { display: flex; align-items: center; gap: 12px; }
.csq-icon-wrap {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
}
.csq-icon-wrap .material-icons { font-size: 20px; color: white; }
.csq-title { font-weight: 700; font-size: 15px; }
.csq-subtitle { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.csq-timeline { padding: 12px 16px; max-height: 400px; overflow-y: auto; }
.csq-event {
    display: flex; align-items: flex-start; gap: 0; padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.csq-event:last-child { border-bottom: none; }
.csq-time-col { width: 60px; flex-shrink: 0; text-align: right; padding-right: 12px; }
.csq-time { font-size: 13px; font-weight: 700; color: #1e293b; }
.csq-date { font-size: 10px; color: #94a3b8; }
.csq-dot-col {
    display: flex; flex-direction: column; align-items: center;
    width: 20px; flex-shrink: 0; padding-top: 4px;
}
.csq-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #00b3c9; flex-shrink: 0;
}
.csq-dot.csq-task { background: #0d9488; }
.csq-line {
    width: 2px; flex: 1; background: #e2e8f0;
    margin-top: 4px; min-height: 20px;
}
.csq-event:last-child .csq-line { display: none; }
.csq-detail-col { flex: 1; min-width: 0; padding-left: 12px; }
.csq-event-title {
    font-weight: 600; font-size: 13px; color: #1e293b;
    display: flex; align-items: center; gap: 6px;
}
.csq-event-icon { font-size: 16px; color: #00b3c9; }
.csq-task .csq-event-icon { color: #0d9488; }
.csq-event-sub { font-size: 11px; color: #64748b; margin-top: 2px; }
.csq-badges { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.csq-badge {
    padding: 2px 8px; border-radius: 10px;
    font-size: 10px; font-weight: 600;
}
.csq-bot { background: #e0f2f1; color: #0d9488; }
.csq-provider { background: #f1f5f9; color: #64748b; }
.csq-urgent { background: #fef2f2; color: #dc2626; }
.csq-overdue { background: #fef2f2; color: #dc2626; }
.csq-overdue-row { background: rgba(239, 68, 68, 0.03); }
.csq-empty {
    display: flex; align-items: center; gap: 10px;
    padding: 24px; color: #94a3b8; font-size: 13px;
    justify-content: center;
}
.csq-empty .material-icons { font-size: 28px; color: #99d5cf; }

/* =====================================================================
   📊 MEETING SUMMARY CARD (.cms-*)
   ===================================================================== */
.chat-meeting-summary {
    background: linear-gradient(145deg, #ffffff, #f0fdfa);
    border: 1px solid #99d5cf;
    border-radius: 16px;
    overflow: hidden;
    max-width: 520px;
    box-shadow: 0 4px 16px rgba(0, 179, 201, 0.08);
}
.cms-header {
    background: linear-gradient(135deg, #00b3c9, #0090a3);
    padding: 16px 20px;
    color: white;
}
.cms-header-left { display: flex; align-items: center; gap: 12px; }
.cms-icon-wrap {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
}
.cms-icon-wrap .material-icons { font-size: 20px; color: white; }
.cms-title { font-weight: 700; font-size: 15px; }
.cms-subtitle { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.cms-meetings-list { padding: 8px 0; }
.cms-meeting { border-bottom: 1px solid #f1f5f9; }
.cms-meeting:last-child { border-bottom: none; }
.cms-meeting-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; cursor: pointer;
    transition: background 0.15s;
}
.cms-meeting-header:hover { background: rgba(0, 179, 201, 0.04); }
.cms-meeting-left { display: flex; align-items: center; gap: 10px; }
.cms-meeting-icon { font-size: 18px; color: #10b981; }
.cms-meeting-icon[style] { color: #94a3b8; }
.cms-meeting-title { font-weight: 600; font-size: 13px; color: #1e293b; }
.cms-meeting-time { font-size: 11px; color: #64748b; margin-top: 1px; }
.cms-chevron {
    font-size: 20px; color: #94a3b8;
    transition: transform 0.2s;
}
.cms-expanded .cms-chevron { transform: rotate(180deg); }
.cms-meeting-content { padding: 0 16px 12px 44px; }
.cms-hidden { display: none; }
.cms-section { margin-bottom: 10px; }
.cms-section-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; color: #00b3c9;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.cms-section-label .material-icons { font-size: 14px; }
.cms-section-text {
    font-size: 13px; color: #334155;
    line-height: 1.5; white-space: pre-wrap;
}
.cms-no-summary {
    font-size: 12px; color: #94a3b8; font-style: italic;
    padding: 8px 0;
}
.cms-recording-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: #00b3c9; font-size: 12px; font-weight: 600;
    text-decoration: none; margin-top: 4px;
}
.cms-recording-link:hover { text-decoration: underline; }
.cms-recording-link .material-icons { font-size: 16px; }
.cms-empty {
    display: flex; align-items: center; gap: 10px;
    padding: 24px; color: #94a3b8; font-size: 13px;
    justify-content: center; flex-direction: column;
}
.cms-empty .material-icons { font-size: 32px; color: #99d5cf; }

/* =====================================================================
   📧 QUICK EMAIL CARD (.cqe-*)
   ===================================================================== */
.chat-quick-email {
    background: linear-gradient(145deg, #ffffff, #f0fdfa);
    border: 1px solid #99d5cf;
    border-radius: 16px;
    overflow: hidden;
    max-width: 480px;
    box-shadow: 0 4px 16px rgba(0, 179, 201, 0.08);
}
.cqe-header {
    background: linear-gradient(135deg, #00b3c9, #0090a3);
    padding: 16px 20px;
    color: white;
    display: flex; align-items: center; justify-content: space-between;
}
.cqe-header-left { display: flex; align-items: center; gap: 12px; }
.cqe-icon-wrap {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
}
.cqe-icon-wrap .material-icons { font-size: 20px; color: white; }
.cqe-title { font-weight: 700; font-size: 15px; }
.cqe-subtitle { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.cqe-purpose-badge {
    background: rgba(255,255,255,0.2); color: white;
    padding: 4px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 600;
    text-transform: capitalize;
}
.cqe-body { padding: 16px 20px; }
.cqe-field { margin-bottom: 12px; }
.cqe-label {
    display: block; font-size: 11px; font-weight: 700;
    color: #00b3c9; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 4px;
}
.cqe-input {
    width: 100%; padding: 8px 12px;
    border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; color: #1e293b;
    background: white; outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.cqe-input:focus { border-color: #00b3c9; box-shadow: 0 0 0 3px rgba(0,179,201,0.1); }
.cqe-textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; color: #1e293b;
    background: white; outline: none; resize: vertical;
    font-family: inherit; line-height: 1.5;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.cqe-textarea:focus { border-color: #00b3c9; box-shadow: 0 0 0 3px rgba(0,179,201,0.1); }
.cqe-select {
    width: 100%; padding: 8px 12px;
    border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; color: #1e293b;
    background: white; outline: none;
    box-sizing: border-box;
}
.cqe-actions {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 20px; border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.cqe-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; border: none;
    transition: all 0.15s;
}
.cqe-btn .material-icons { font-size: 16px; }
.cqe-btn-copy {
    background: white; color: #00b3c9;
    border: 1px solid #99d5cf;
}
.cqe-btn-copy:hover { background: #f0fdfa; }
.cqe-btn-send {
    background: linear-gradient(135deg, #00b3c9, #0090a3);
    color: white;
}
.cqe-btn-send:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,179,201,0.3); }
.cqe-btn-send:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.cqe-btn-sent { background: #10b981 !important; }
.cqe-no-provider { font-size: 12px; color: #94a3b8; font-style: italic; }

/* =====================================================================
   🚀 ENROLL OUTREACH CARD (.eor-*)
   ===================================================================== */
.chat-enroll-outreach {
    background: linear-gradient(145deg, #ffffff, #fff7ed);
    border: 1px solid #fdba74;
    border-radius: 16px;
    overflow: hidden;
    max-width: 500px;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.08);
}
.eor-header {
    background: linear-gradient(135deg, #f97316, #ea580c);
    padding: 16px 20px;
    color: white;
}
.eor-header-left { display: flex; align-items: center; gap: 12px; }
.eor-icon-wrap {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
}
.eor-icon-wrap .material-icons { font-size: 20px; color: white; }
.eor-title { font-weight: 700; font-size: 15px; }
.eor-subtitle { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.eor-stats {
    display: flex; gap: 0; border-bottom: 1px solid #fed7aa;
    background: #fff7ed;
}
.eor-stat {
    flex: 1; text-align: center; padding: 10px 8px;
    border-right: 1px solid #fed7aa;
}
.eor-stat:last-child { border-right: none; }
.eor-stat-val { display: block; font-weight: 700; font-size: 16px; color: #ea580c; }
.eor-stat-label { display: block; font-size: 10px; color: #9a3412; text-transform: uppercase; letter-spacing: 0.5px; }
.eor-context {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; font-size: 12px; color: #9a3412;
    background: rgba(249, 115, 22, 0.05);
    border-bottom: 1px solid #fed7aa;
}
.eor-context .material-icons { font-size: 16px; color: #f97316; }
.eor-leads-list { max-height: 280px; overflow-y: auto; }
.eor-lead {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.eor-lead:hover { background: rgba(249, 115, 22, 0.03); }
.eor-lead:last-child { border-bottom: none; }
.eor-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white; display: flex; align-items: center;
    justify-content: center; font-size: 13px;
    font-weight: 700; flex-shrink: 0;
}
.eor-lead-info { flex: 1; min-width: 0; }
.eor-lead-name { font-weight: 600; font-size: 13px; color: #1e293b; }
.eor-lead-meta { font-size: 11px; color: #64748b; }
.eor-lead-email { font-size: 11px; color: #94a3b8; }
.eor-status {
    padding: 2px 8px; border-radius: 10px;
    font-size: 10px; font-weight: 600;
    background: #f0fdf4; color: #166534;
}
.eor-actions {
    padding: 12px 16px; border-top: 1px solid #fed7aa;
    background: #fff7ed; text-align: center;
}
.eor-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer; border: none;
    transition: all 0.15s;
}
.eor-btn .material-icons { font-size: 18px; }
.eor-btn-confirm {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}
.eor-btn-confirm:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(249,115,22,0.3); }
.eor-btn-confirm:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.eor-note {
    font-size: 11px; color: #9a3412;
    padding: 0 16px 12px; text-align: center;
}

/* =====================================================================
   DARK MODE - Schedule, Meeting Summary, Quick Email, Enroll Outreach
   ===================================================================== */
.dark-mode .chat-schedule-card,
.dark-mode .chat-meeting-summary,
.dark-mode .chat-quick-email,
.dark-mode .chat-enroll-outreach {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-color: #334155;
}
.dark-mode .csq-event { border-color: #1e293b; }
.dark-mode .csq-time { color: #e2e8f0; }
.dark-mode .csq-date { color: #64748b; }
.dark-mode .csq-event-title { color: #f1f5f9; }
.dark-mode .csq-event-sub { color: #94a3b8; }
.dark-mode .csq-line { background: #334155; }
.dark-mode .csq-bot { background: #134e4a; color: #5eead4; }
.dark-mode .csq-provider { background: #1e293b; color: #94a3b8; }
.dark-mode .csq-empty { color: #64748b; }

.dark-mode .cms-meeting { border-color: #1e293b; }
.dark-mode .cms-meeting-header:hover { background: rgba(0, 179, 201, 0.08); }
.dark-mode .cms-meeting-title { color: #f1f5f9; }
.dark-mode .cms-meeting-time { color: #94a3b8; }
.dark-mode .cms-section-text { color: #cbd5e1; }
.dark-mode .cms-no-summary { color: #64748b; }

.dark-mode .cqe-input,
.dark-mode .cqe-textarea,
.dark-mode .cqe-select {
    background: #1e293b; border-color: #334155; color: #e2e8f0;
}
.dark-mode .cqe-input:focus,
.dark-mode .cqe-textarea:focus { border-color: #00b3c9; }
.dark-mode .cqe-actions { background: #0f172a; border-color: #334155; }
.dark-mode .cqe-btn-copy { background: #1e293b; color: #14b8a6; border-color: #334155; }

.dark-mode .eor-stats { background: #1e293b; border-color: #334155; }
.dark-mode .eor-stat { border-color: #334155; }
.dark-mode .eor-stat-val { color: #fb923c; }
.dark-mode .eor-stat-label { color: #94a3b8; }
.dark-mode .eor-context { background: rgba(249, 115, 22, 0.05); color: #fb923c; border-color: #334155; }
.dark-mode .eor-lead { border-color: #1e293b; }
.dark-mode .eor-lead:hover { background: rgba(249, 115, 22, 0.05); }
.dark-mode .eor-lead-name { color: #f1f5f9; }
.dark-mode .eor-lead-meta { color: #94a3b8; }
.dark-mode .eor-lead-email { color: #64748b; }
.dark-mode .eor-status { background: #064e3b; color: #6ee7b7; }
.dark-mode .eor-actions { background: #0f172a; border-color: #334155; }
.dark-mode .eor-note { color: #94a3b8; }

/* =====================================================================
   BULK LEADS PREVIEW CARD
   ===================================================================== */
.chat-bulk-leads-preview {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    max-width: 520px;
    box-shadow: 0 4px 16px rgba(100, 116, 139, 0.08);
}
.blk-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
}
.blk-header-left { display: flex; align-items: center; gap: 12px; }
.blk-icon-wrap {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.blk-icon-wrap .material-icons { font-size: 20px; color: white; }
.blk-title { font-weight: 700; font-size: 15px; color: #1e293b; }
.blk-subtitle { font-size: 12px; color: #64748b; margin-top: 2px; }
.blk-badge {
    font-size: 11px; font-weight: 600; padding: 4px 10px;
    border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}
.blk-badge-preview { background: #fef3c7; color: #92400e; }
.blk-badge-done { background: #d1fae5; color: #065f46; }
.blk-badge-cancelled { background: #f1f5f9; color: #64748b; }
.blk-summary {
    padding: 10px 20px; font-size: 13px; color: #475569;
    border-bottom: 1px solid #f1f5f9;
}
.blk-counts {
    display: flex; gap: 0; border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}
.blk-count {
    flex: 1; text-align: center; padding: 10px 8px;
    border-right: 1px solid #f1f5f9;
}
.blk-count:last-child { border-right: none; }
.blk-count-val { display: block; font-weight: 700; font-size: 18px; color: #1e293b; }
.blk-count-label { display: block; font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.blk-stats {
    display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid #f1f5f9;
}
.blk-stat {
    flex: 1; min-width: 70px; text-align: center; padding: 8px 6px;
    border-right: 1px solid #f1f5f9;
}
.blk-stat:last-child { border-right: none; }
.blk-stat-val { display: block; font-weight: 700; font-size: 14px; color: #3b82f6; }
.blk-stat-label { display: block; font-size: 10px; color: #64748b; }
.blk-leads-list { max-height: 500px; overflow-y: auto; }
.blk-lead {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.blk-lead:hover { background: #f8fafc; }
.blk-lead-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.blk-lead-info { flex: 1; min-width: 0; }
.blk-lead-name { font-weight: 600; font-size: 13px; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk-lead-meta { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk-lead-detail { display: flex; gap: 4px; flex-shrink: 0; }
.blk-more { padding: 8px 16px; font-size: 12px; color: #64748b; text-align: center; }
.blk-details { max-height: 250px; overflow-y: auto; padding: 0 16px; }
.blk-detail-row {
    display: flex; gap: 8px; align-items: center;
    padding: 6px 0; border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
}
.blk-detail-name { font-weight: 600; min-width: 100px; color: #1e293b; }
.blk-detail-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #f1f5f9; color: #475569; }
.blk-detail-msg { color: #64748b; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk-actions {
    display: flex; gap: 8px; padding: 12px 16px;
    background: #f8fafc; border-top: 1px solid #e2e8f0;
}
.blk-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 10px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    border: none; transition: all 0.2s;
}
.blk-btn .material-icons { font-size: 18px; }
.blk-btn-confirm {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white; flex: 1; justify-content: center;
}
.blk-btn-confirm:hover { box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); transform: translateY(-1px); }
.blk-btn-confirm:disabled { opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: none; }
.blk-btn-confirm.blk-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
.blk-btn-confirm.blk-btn-danger:hover { box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.blk-btn-confirm.blk-btn-done {
    background: linear-gradient(135deg, #10b981, #059669);
    cursor: default;
}
.blk-btn-cancel {
    background: white; color: #64748b;
    border: 1px solid #e2e8f0;
}
.blk-btn-cancel:hover { background: #f8fafc; }
.blk-note {
    font-size: 11px; color: #64748b;
    padding: 0 16px 12px; text-align: center;
}
.blk-done-note {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 12px 16px;
    font-size: 13px; font-weight: 500; color: #059669;
    background: #f0fdf4; border-top: 1px solid #d1fae5;
}

/* Dark mode - Bulk Leads Preview */
[data-theme="dark"] .chat-bulk-leads-preview {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-color: #334155;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .blk-header { border-color: #334155; }
[data-theme="dark"] .blk-title { color: #f1f5f9; }
[data-theme="dark"] .blk-subtitle { color: #94a3b8; }
[data-theme="dark"] .blk-badge-preview { background: #422006; color: #fbbf24; }
[data-theme="dark"] .blk-badge-done { background: #064e3b; color: #34d399; }
[data-theme="dark"] .blk-badge-cancelled { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .blk-summary { color: #cbd5e1; border-color: #334155; }
[data-theme="dark"] .blk-counts { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .blk-count { border-color: #334155; }
[data-theme="dark"] .blk-count-val { color: #f1f5f9; }
[data-theme="dark"] .blk-count-label { color: #94a3b8; }
[data-theme="dark"] .blk-stats { border-color: #334155; }
[data-theme="dark"] .blk-stat { border-color: #334155; }
[data-theme="dark"] .blk-stat-val { color: #60a5fa; }
[data-theme="dark"] .blk-stat-label { color: #94a3b8; }
[data-theme="dark"] .blk-leads-list { scrollbar-color: #334155 transparent; }
[data-theme="dark"] .blk-lead { border-color: #334155; }
[data-theme="dark"] .blk-lead:hover { background: rgba(59, 130, 246, 0.08); }
[data-theme="dark"] .blk-lead-name { color: #f1f5f9; }
[data-theme="dark"] .blk-lead-meta { color: #94a3b8; }
[data-theme="dark"] .blk-lead-detail .material-icons { opacity: 0.8; }
[data-theme="dark"] .blk-more { color: #94a3b8; }
[data-theme="dark"] .blk-detail-row { border-color: #334155; }
[data-theme="dark"] .blk-detail-name { color: #f1f5f9; }
[data-theme="dark"] .blk-detail-status { background: #334155; color: #cbd5e1; }
[data-theme="dark"] .blk-detail-msg { color: #94a3b8; }
[data-theme="dark"] .blk-actions { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .blk-btn-cancel { background: #1e293b; color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .blk-btn-cancel:hover { background: #334155; color: #cbd5e1; }
[data-theme="dark"] .blk-note { color: #94a3b8; }
[data-theme="dark"] .blk-done-note { background: rgba(16, 185, 129, 0.1); color: #34d399; border-color: #064e3b; }
[data-theme="dark"] .blk-note div[style*="background:#e2e8f0"] { background: #1e293b !important; }
[data-theme="dark"] .blk-progress-pct { color: #94a3b8 !important; }

/* Tapi model selector styles are inline in Chat.cshtml */

/* ============================================================
   Floating notification bell - mobile + iPad only
   ============================================================
   The chat page has a desktop .chat-header-right that includes
   a bell, but on mobile/iPad the whole desktop header is hidden
   (line ~2717 `.chat-header { display: none !important }`) and
   replaced with individual floating buttons. That set originally
   had menu/home/token/list but NO bell - the user lost the 'new
   notifications' signal on phones/iPads entirely. Re-skin the
   shared _NotificationBell partial to match the other floating
   controls and slot it in at left:132px, after the home button.
   ============================================================ */
.floating-notification-bell {
    position: fixed;
    left: 132px;       /* menu (20) + 48 + 8 gap + home (48) + 8 gap */
    top: 20px;
    z-index: 999;
    display: none;     /* desktop: hidden by default */
}

@media (max-width: 1024px) {
    /* Show on mobile AND iPad (covers the 769-1024 band too) */
    .floating-notification-bell { display: inline-flex; }
}

/* Re-skin the partial's own elements so it matches the 48x48 pill buttons */
.floating-notification-bell .nb-wrap {
    margin: 0;
    display: inline-flex;
}
.floating-notification-bell .nb-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.floating-notification-bell .nb-btn:hover {
    background: var(--bg-light);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.floating-notification-bell .nb-btn .material-icons,
.floating-notification-bell .nb-btn i {
    font-size: 20px;
}
[data-theme="dark"] .floating-notification-bell .nb-btn {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-light);
}

/* Desktop-only: when the bell is hosted in .floating-notification-bell
   (shouldn't happen on desktop since we moved it to #desktopBellHost,
   but keep a safe anchor). On mobile/iPad the partial's own <=1024px
   rule pins the panel to the viewport (top:76px, left/right:12px) so
   we deliberately do NOT override here - that rule wins cleanly. */
@media (min-width: 1025px) {
    .floating-notification-bell .nb-panel {
        right: auto;
        left: 0;
    }
}

/* When the sidebar opens on mobile it slides over the top-left area -
   hide the bell alongside the home button so the sidebar owns that space. */
.floating-notification-bell.sidebar-open {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-20px);
}

/* ============================================================
   TABLET / iPad responsive layer (769-1024px)
   ============================================================
   Above 768px (our "mobile" breakpoint) but below 1024px the
   desktop sidebar (360px) + message area was too cramped AND
   when I first shipped an overlay-style rule here it hid the
   chat content entirely because the sidebar defaults to NOT
   collapsed on non-phone viewports. Keeping the desktop model
   (sidebar is a column in the flexbox, not an overlay) but
   shrinking it so the chat area has breathing room.
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Narrower sidebar - still inline in the flex row, NOT fixed.
       position:fixed here previously overlaid the chat content and
       blocked taps on iPad (user reported "couldn't click anything"). */
    :root { --sidebar-width: 240px; }
    .sidebar { width: 240px; }
    .sidebar.collapsed { margin-left: -240px; }

    /* Tighter message bubbles so long lines don't blow out the layout */
    .message .message-content { max-width: 82%; }

    /* Campaign review / outreach modal - stop the 900px max from
       fighting the viewport. Clamp to 92vw on iPad widths. */
    .outreach-modal-container,
    .outreach-modal .modal-container,
    .campaign-review-panel {
        width: 92vw !important;
        max-width: 92vw !important;
        max-height: 92vh !important;
        overflow-y: auto;
    }
}

/* ============================================================
   Notification bell - guarantee tap target on every viewport.
   The bell's parent wrapper uses inline-flex which can collapse
   on older iOS Safari; enforce 44x44 and keep it in the header.
   ============================================================ */
.nb-btn,
.notification-bell-btn,
button[data-notification-bell] {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}
@media (max-width: 1024px) {
    /* If anything tries to hide the bell on smaller viewports, undo it. */
    .nb-wrap,
    .notification-bell-wrap { display: inline-flex !important; }
}

/* The global layout (_Layout.cshtml) wraps the bell in
   .floating-header-actions with no CSS rule at all - pin it
   top-right on every page so mobile users always see it. The
   chat page overrides this with its own chat-header-right, so
   we scope this specifically to the layout wrapper. */
.floating-header-actions {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
@media (max-width: 480px) {
    .floating-header-actions { top: 8px; right: 8px; gap: 6px; }
}

/* ============================================================
   Campaign review modal - mobile polish (≤768px)
   ============================================================
   The campaign review/approve modal was unusable in demos: 900px
   max-width clamped to 95% on phones = 95% of 375px = wasted
   16px of chrome but still crammed content. Full-screen on phones.
   ============================================================ */
@media (max-width: 768px) {
    .outreach-modal-container,
    .outreach-modal .modal-container,
    .campaign-review-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    .outreach-modal-overlay,
    .campaign-review-overlay { padding: 0 !important; }

    /* Per-lead cards inside the review table → stack vertically */
    .outreach-lead-row,
    .campaign-review-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    /* Big touch targets for approve/reject */
    .outreach-approve-btn,
    .outreach-reject-btn,
    .campaign-review-approve,
    .campaign-review-reject {
        min-height: 44px;
        font-size: 14px;
    }
}

/* ============================================================
   Mobile chat input row - give textarea a full-width row
   ----------------------------------------------------------------
   On narrow phones the input-wrapper holds 6+ flex children
   ( + button, lightbulb, textarea, Tapi v2 dropdown, mic, send ).
   At 375px viewport the textarea ends up with ~46px of usable
   width, so the long chat input placeholder
   wraps to several lines and the whole row balloons vertically
   - looked like the text was "stacking".
   Fix: at <=480px (true phone portrait) make the wrapper wrap
   so the textarea takes its own full-width row at the top, and
   the buttons flow horizontally below it. Tapi-sel + lightbulb
   compress to icon-only so the bottom row fits comfortably.
   ============================================================ */
@media (max-width: 480px) {
    .input-wrapper {
        flex-wrap: wrap;
        align-items: center;
        padding: 10px 12px;
        gap: 8px;
        border-radius: 20px;
        min-height: 0;
    }

    /* Textarea takes the entire first row */
    .input-wrapper .input-field {
        flex: 1 1 100%;
        min-width: 100%;
        order: 1;
        padding: 8px 4px;
        font-size: 16px;        /* iOS won't zoom on focus at >=16 */
    }

    /* Controls flow horizontally on row 2 */
    .input-wrapper .actions-dropdown-container,
    .input-wrapper .action-plan-container,
    .input-wrapper .tapi-sel,
    .input-wrapper .voice-mode-btn,
    .input-wrapper .send-button,
    .input-wrapper .file-attachment-chip {
        order: 2;
        flex-shrink: 0;
    }

    /* Push send to the right edge of row 2 */
    .input-wrapper .send-button { margin-left: auto; }

    /* Compress Tapi-sel to its label only - caret + label, no extra room hog */
    .input-wrapper .tapi-sel .tapi-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Same treatment for the slightly-wider phones up to 600px so the
   layout stays roomy in landscape-ish portrait modes too. Without
   this, devices like 414px wide were on the edge of the wrap. */
@media (max-width: 600px) and (min-width: 481px) {
    .input-wrapper {
        flex-wrap: wrap;
        gap: 8px;
    }
    .input-wrapper .input-field {
        flex: 1 1 100%;
        min-width: 100%;
        order: 1;
    }
    .input-wrapper .send-button { margin-left: auto; }
}

/* ============================================================
   Team-chat support widget - lift above the chat input on mobile
   ----------------------------------------------------------------
   teamchat.css pins .chat-toggle-button at bottom:15px right:15px,
   which is the same 48x48 corner the send button lives in on the
   chat page. On dashboards and other pages the default position is
   fine (no bottom input), so we ONLY override here (chat.css only
   loads on /chat). Lift it above the 2-row input area and nudge
   off the right edge so it doesn't share the send button's corner.
   ============================================================ */
@media (max-width: 768px) {
    .team-chat-wrapper .chat-toggle-button {
        bottom: 180px !important;
        right: 16px !important;
    }
    /* Expanded panel sits even higher so it doesn't cover the input */
    .team-chat-wrapper.atapic-chat-wrapper,
    .team-chat-wrapper .atapic-chat-wrapper.collapsed {
        bottom: 240px !important;
    }
}

/* =========================================================================
   Multi-platform integration cards (post_*, social_post, crm_*)
   ========================================================================= */
.integration-action-message .integration-action-card {
    background: var(--surface, #fff);
    border-radius: 12px;
    border: 1px solid var(--border, #e5e7eb);
    padding: 12px 16px;
    margin: 8px 0;
    max-width: 560px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.integration-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
}
.integration-card-header .material-icons { font-size: 20px; }
.integration-card-action-label {
    margin-left: auto;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted, #6b7280);
    letter-spacing: .04em;
}
.integration-card-summary { font-size: 14px; margin-bottom: 8px; }
.integration-card-caption {
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0;
    color: var(--text, #1f2937);
    white-space: pre-wrap;
}
.integration-card-hashtags { color: #2563eb; font-size: 13px; margin: 2px 0 8px; }
.integration-card-media {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 8px;
    margin: 8px 0;
    background: #0f172a;
}
.integration-card-account { font-size: 13px; color: var(--text-muted, #6b7280); margin-bottom: 4px; }
.integration-card-targets-label { font-size: 12px; color: var(--text-muted, #6b7280); margin: 6px 0 4px; }
.integration-card-targets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.integration-card-target {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid;
    font-size: 12px;
    font-weight: 500;
}
.integration-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.integration-card-btn {
    border: 0;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.integration-card-btn.primary {
    background: var(--primary, #00b3c9);
    color: #fff;
}
.integration-card-btn.primary:hover { background: var(--primary-dark, #0090a3); }
.integration-card-btn:disabled { opacity: .6; cursor: default; }
.integration-card-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.integration-card-badge.posted    { background: #dcfce7; color: #166534; }
.integration-card-badge.scheduled { background: #fef3c7; color: #92400e; }
.integration-card-badge.preview   { background: #e0f2fe; color: #075985; }
.integration-card-skipped { font-size: 12px; color: #dc2626; margin-top: 6px; }
.integration-card-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; }
.integration-card-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.integration-card-table th, .integration-card-table td { padding: 6px 10px; border-bottom: 1px solid var(--border, #e5e7eb); text-align: left; }
.integration-card-table thead { background: #f8fafc; position: sticky; top: 0; }

[data-theme="dark"] .integration-action-message .integration-action-card {
    background: #1f2937;
    border-color: #374151;
}
[data-theme="dark"] .integration-card-table th,
[data-theme="dark"] .integration-card-table td { border-color: #374151; }
[data-theme="dark"] .integration-card-table thead { background: #111827; }

/* =========================================================================
   Video generation card (generate_video / HeyGen)
   ========================================================================= */
.video-gen-message .video-gen-card {
    background: var(--surface, #fff);
    border-radius: 12px;
    border: 1px solid var(--border, #e5e7eb);
    padding: 12px 14px;
    margin: 8px 0;
    max-width: 560px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.vid-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; }
.vid-header .material-icons { color: #7c3aed; }
.vid-title { flex: 1; }
.vid-status {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}
.vid-status.queue { background: #e0e7ff; color: #3730a3; }
.vid-status.proc  { background: #fef3c7; color: #92400e; }
.vid-status.done  { background: #dcfce7; color: #166534; }
.vid-status.fail  { background: #fee2e2; color: #991b1b; }
.vid-age { color: var(--text-muted, #6b7280); font-size: 12px; }

.vid-player, .vid-thumb, .vid-progress-wrap {
    width: 100%;
    background: #0f172a;
    border-radius: 10px;
    overflow: hidden;
}
.vid-player.landscape, .vid-thumb.landscape, .vid-skeleton.landscape { aspect-ratio: 16 / 9; }
.vid-player.portrait,  .vid-thumb.portrait,  .vid-skeleton.portrait  { aspect-ratio: 9 / 16; max-width: 320px; margin: 0 auto; display: block; }
.vid-player.square,    .vid-thumb.square,    .vid-skeleton.square    { aspect-ratio: 1 / 1; max-width: 420px; }
.vid-skeleton {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #cbd5e1; gap: 12px;
}
.vid-progress-wrap { position: relative; }
.vid-progress-wrap .vid-thumb { display: block; opacity: .6; }
.vid-progress-wrap .vid-spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.vid-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,.25);
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: vidspin 1s linear infinite;
}
@keyframes vidspin { to { transform: rotate(360deg); } }
.vid-progress-wrap.vid-skeleton .vid-spinner { position: static; transform: none; }
.vid-progress-label { font-size: 13px; color: #cbd5e1; }
.vid-script { font-style: italic; color: var(--text-muted, #6b7280); font-size: 13px; margin-top: 8px; padding-left: 10px; border-left: 3px solid #7c3aed; }
.vid-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vid-error { color: #b91c1c; font-size: 13px; margin-top: 8px; }
[data-theme="dark"] .video-gen-message .video-gen-card { background: #1f2937; border-color: #374151; }

/* Chat header model picker - custom glass dropdown beside the "Ready" status.
   Custom (not a native <select>) so the open menu can be styled to match. */
.model-picker-wrap { position: relative; display: inline-flex; margin-left: 8px; }
.model-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: var(--text, #1f2937);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.model-picker-btn:hover { background: rgba(255, 255, 255, 0.7); border-color: var(--primary, #00b3c9); }
.model-picker-icon { font-size: 10px; color: var(--primary, #00b3c9); }
.model-picker-caret { font-size: 8px; opacity: .6; transition: transform .15s; }
.model-picker-wrap.open .model-picker-caret { transform: rotate(180deg); }

.model-picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 150px;
    padding: 5px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 1200;
}
.model-picker-wrap.open .model-picker-menu { display: flex; animation: modelMenuIn .12s ease; }
@keyframes modelMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.model-picker-opt {
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text, #1f2937);
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s;
}
.model-picker-opt:hover { background: rgba(0, 179, 201, 0.12); }
.model-picker-opt.active { background: var(--primary, #00b3c9); color: #fff; }

[data-theme="dark"] .model-picker-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #f3f4f6;
}
[data-theme="dark"] .model-picker-btn:hover { background: rgba(255, 255, 255, 0.14); }
[data-theme="dark"] .model-picker-menu {
    background: rgba(34, 40, 45, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .model-picker-opt { color: #e5e7eb; }
[data-theme="dark"] .model-picker-opt:hover { background: rgba(0, 179, 201, 0.22); }

/* User message image attachment - shown as its own rounded thumbnail ABOVE
   the text bubble (not crammed inside it, not beside it). The base rule lays
   .message.user .message-content out as a row; force a column so the image
   stacks on top of the bubble. */
.message.user .message-content { flex-direction: column; align-items: flex-end; }
.message.user .message-attachment { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.message.user .message-attachment .message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 14px;
    display: block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .message.user .message-attachment .message-image { border-color: rgba(255, 255, 255, 0.1); }

/* Mobile floating model picker - desktop header is hidden < 768px, so this
   sits inline with the other floating icons (menu/home/bell) as a 48x48 pill
   with a brain glyph. Position picks up after the bell at left: 188px (menu 20
   + 48 + 8 + home 48 + 8 + bell 48 + 8). */
.floating-model-picker { display: none; }
@media (max-width: 768px) {
    .floating-model-picker {
        display: inline-flex;
        position: fixed;
        top: 20px;
        left: 188px;
        z-index: 999;
    }
    .floating-model-btn {
        width: 48px;
        height: 48px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--bg-white);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        color: var(--text-dark);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    .floating-model-btn:hover {
        background: var(--bg-light);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }
    .floating-model-btn:active { transform: scale(0.95); }
    .floating-model-btn .fa-brain { font-size: 20px; color: var(--primary, #00b3c9); }
    .floating-model-picker.open .floating-model-btn {
        border-color: var(--primary, #00b3c9);
        box-shadow: 0 6px 16px rgba(0, 179, 201, 0.25);
    }
    .floating-model-picker .model-picker-menu {
        left: 0;
        right: auto;
        top: calc(100% + 8px);
        min-width: 180px;
    }
    .floating-model-picker.open .model-picker-menu { display: flex; }
}
[data-theme="dark"] .floating-model-btn {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-light);
}

/* Vision multi-image attach: thumbnail strip above the input + drop highlight */
.vision-image-strip { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 6px 2px; }
.vision-thumb {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: visible;
    border: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.vision-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 10px; }
.vision-thumb.uploading { opacity: .55; }
.vision-thumb-x {
    position: absolute; top: -7px; right: -7px;
    width: 18px; height: 18px; border-radius: 50%;
    border: 0; background: #111827; color: #fff;
    font-size: 13px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.input-wrapper.vision-drag-over,
#messagesContainer.vision-drag-over {
    outline: 2px dashed var(--primary, #00b3c9);
    outline-offset: -4px;
    background: rgba(0, 179, 201, 0.04);
    border-radius: 14px;
}
[data-theme="dark"] .vision-thumb { border-color: #374151; }
[data-theme="dark"] .vision-thumb-x { background: #e5e7eb; color: #111827; }

/* Sleek thin scrollbar for the Token Pricing modal (replaces the chunky
   default OS scrollbar with arrow buttons). Works in light + dark. */
.tp-scroll { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.55) transparent; }
.tp-scroll::-webkit-scrollbar { width: 8px; }
.tp-scroll::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
.tp-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; }
.tp-scroll::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.85); }
.tp-scroll::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

/* ── Chat-rendered card buttons ─────────────────────────────────────────────
   The chat page doesn't load content-studio.css or Bootstrap CSS, so video
   cards (.cs-btn) and social post cards (Bootstrap .btn utilities) rendered
   inside the chat were unstyled. Scope a shim to the message area only. */
.messages-container .cs-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px;
    border: 1px solid var(--border, #e5e7eb);
    background: #fff; color: var(--text, #1f2937);
    font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.messages-container .cs-btn:hover { background: #f3f4f6; }
.messages-container .cs-btn.primary { background: var(--primary, #00b3c9); color: #fff; border-color: var(--primary, #00b3c9); }
.messages-container .cs-btn.primary:hover { background: var(--primary-dark, #0090a3); }

/* Minimal Bootstrap-utility shim for social post / fan-out cards */
.messages-container .btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 13px; border-radius: 8px; border: 1px solid transparent;
    font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none;
}
.messages-container .btn-sm { padding: 5px 11px; font-size: 13px; }
.messages-container .btn-primary { background: var(--primary, #00b3c9); color: #fff; border-color: var(--primary, #00b3c9); }
.messages-container .btn-success { background: #16a34a; color: #fff; border-color: #16a34a; }
.messages-container .btn-outline-secondary { background: transparent; color: var(--text, #374151); border-color: var(--border, #d1d5db); }
.messages-container .btn-outline-primary { background: transparent; color: var(--primary, #00b3c9); border-color: var(--primary, #00b3c9); }
.messages-container .btn:hover { filter: brightness(0.96); }
.messages-container .btn:disabled { opacity: .55; cursor: default; }
.messages-container .d-flex { display: flex; }
.messages-container .gap-2 { gap: 8px; }
.messages-container .gap-3 { gap: 12px; }
.messages-container .ms-auto { margin-left: auto; }
.messages-container .me-1 { margin-right: 4px; }
.messages-container .mb-1 { margin-bottom: 4px; }
.messages-container .mb-2 { margin-bottom: 8px; }
.messages-container .mb-3 { margin-bottom: 12px; }
.messages-container .mt-2 { margin-top: 8px; }
.messages-container .small { font-size: 12px; }
.messages-container .fw-bold { font-weight: 700; }
.messages-container .text-muted { color: var(--text-muted, #6b7280); }
.messages-container .text-warning { color: #b45309; }
.messages-container .text-success { color: #166534; }
.messages-container .text-danger { color: #dc2626; }
.messages-container .align-self-center { align-self: center; }
[data-theme="dark"] .messages-container .cs-btn { background: #1f2937; color: #f3f4f6; border-color: #374151; }
[data-theme="dark"] .messages-container .btn-outline-secondary { color: #e5e7eb; border-color: #374151; }

/* ── Session "..." actions + pin marker + resizable sidebar ────────────── */
.nav-item { position: relative; }
.session-actions-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border: 0; background: transparent;
    border-radius: 6px;
    color: var(--text-light, #6b7280);
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s ease, background .12s ease;
}
.session-actions-btn .material-icons { font-size: 18px; }
.nav-item:hover .session-actions-btn,
.nav-item.active .session-actions-btn { opacity: 1; }
.session-actions-btn:hover { background: var(--bg-light, rgba(0,0,0,0.06)); color: var(--text-dark, #111827); }

.session-actions-menu {
    position: fixed;
    z-index: 4000;
    min-width: 180px;
    background: var(--bg-white, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06);
    padding: 6px;
    display: flex; flex-direction: column;
}
.session-actions-menu .sa-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: transparent; border: 0; border-radius: 6px;
    color: var(--text-dark, #111827);
    font-size: 13px; font-weight: 500;
    text-align: left; cursor: pointer; width: 100%;
}
.session-actions-menu .sa-item:hover { background: var(--bg-light, #f3f4f6); }
.session-actions-menu .sa-item .material-icons { font-size: 16px; color: var(--text-light, #6b7280); }
.session-actions-menu .sa-item.sa-danger { color: #b91c1c; }
.session-actions-menu .sa-item.sa-danger .material-icons { color: #b91c1c; }
[data-theme="dark"] .session-actions-menu {
    background: var(--bg-card, #1f2937);
    border-color: var(--border, #374151);
    box-shadow: 0 10px 28px rgba(0,0,0,.55);
}
[data-theme="dark"] .session-actions-menu .sa-item { color: var(--text-light, #e5e7eb); }
[data-theme="dark"] .session-actions-menu .sa-item:hover { background: rgba(255,255,255,0.06); }

/* Resizable sidebar: drag the right edge. Hidden when collapsed. */
.sidebar { position: relative; }
.sidebar-resize-handle {
    position: absolute;
    top: 0; right: -3px;
    width: 6px; height: 100%;
    cursor: col-resize;
    z-index: 50;
    background: transparent;
    transition: background .15s ease;
}
/* Opportunity List drag-to-resize (handle on its LEFT edge - panel is right-docked). */
.canvas-resize-handle {
    position: absolute;
    top: 0; left: -3px;
    width: 6px; height: 100%;
    cursor: col-resize;
    z-index: 50;
    background: transparent;
    transition: background .15s ease;
}
.canvas-resize-handle:hover,
.canvas-resize-handle:active { background: rgba(0, 179, 201, 0.35); }
.canvas-panel.collapsed .canvas-resize-handle { display: none; }
@media (max-width: 768px) {
    .canvas-resize-handle { display: none; }
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle:active { background: rgba(0, 179, 201, 0.35); }
.sidebar.collapsed .sidebar-resize-handle { display: none; }
@media (max-width: 768px) {
    /* Mobile uses a fixed-width overlay sidebar - no resize. */
    .sidebar-resize-handle { display: none; }
}

/* ── In-app modal (replaces window.prompt / confirm for chat actions) ── */
.chat-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 5000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: chatModalFade .12s ease;
}
@keyframes chatModalFade { from { opacity: 0; } to { opacity: 1; } }
.chat-modal {
    width: min(420px, 100%);
    background: var(--bg-white, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    padding: 20px 20px 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,.22), 0 4px 12px rgba(0,0,0,.08);
    animation: chatModalIn .14s ease;
}
@keyframes chatModalIn { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.chat-modal-title { font-size: 16px; font-weight: 600; color: var(--text-dark, #111827); margin-bottom: 6px; }
.chat-modal-message { font-size: 13.5px; color: var(--text-light, #6b7280); margin-bottom: 14px; line-height: 1.45; }
.chat-modal-input {
    width: 100%; box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark, #111827);
    background: var(--bg-white, #fff);
    margin-bottom: 16px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.chat-modal-input:focus { border-color: var(--primary, #00b3c9); box-shadow: 0 0 0 3px rgba(0, 179, 201, 0.18); }
.chat-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.chat-modal-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px; font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border, #e5e7eb);
    background: var(--bg-white, #fff);
    color: var(--text-dark, #111827);
    transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.chat-modal-btn:hover { background: var(--bg-light, #f3f4f6); }
.chat-modal-btn:active { transform: scale(0.97); }
.chat-modal-primary { background: var(--primary, #00b3c9); border-color: var(--primary, #00b3c9); color: #fff; }
.chat-modal-primary:hover { background: var(--primary-dark, #0090a3); border-color: var(--primary-dark, #0090a3); }
.chat-modal-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.chat-modal-danger:hover { background: #b91c1c; border-color: #b91c1c; }
[data-theme="dark"] .chat-modal {
    background: var(--bg-card, #1f2937);
    border-color: var(--border, #374151);
    box-shadow: 0 20px 50px rgba(0,0,0,.6);
}
[data-theme="dark"] .chat-modal-title { color: var(--text-light, #f3f4f6); }
[data-theme="dark"] .chat-modal-message { color: var(--text-light, #cbd5e1); }
[data-theme="dark"] .chat-modal-input {
    background: rgba(255,255,255,0.04);
    border-color: var(--border, #374151);
    color: var(--text-light, #f3f4f6);
}
[data-theme="dark"] .chat-modal-btn:not(.chat-modal-primary):not(.chat-modal-danger) {
    background: rgba(255,255,255,0.05);
    border-color: var(--border, #374151);
    color: var(--text-light, #e5e7eb);
}
[data-theme="dark"] .chat-modal-btn:not(.chat-modal-primary):not(.chat-modal-danger):hover { background: rgba(255,255,255,0.1); }

/* Pin marker on pinned sessions - rotated, branded, slightly emphasized. */
.session-pin-mark {
    font-size: 14px !important;
    color: var(--primary, #00b3c9) !important;
    margin-right: 5px;
    vertical-align: middle;
    transform: rotate(35deg);
    display: inline-block;
}
.nav-item[data-is-pinned="1"] {
    background: rgba(0, 179, 201, 0.06);
}
.nav-item[data-is-pinned="1"]:hover { background: rgba(0, 179, 201, 0.12); }
[data-theme="dark"] .nav-item[data-is-pinned="1"] { background: rgba(0, 179, 201, 0.10); }
[data-theme="dark"] .nav-item[data-is-pinned="1"]:hover { background: rgba(0, 179, 201, 0.18); }

/* ── Social preview cards (Tapi multi-platform previews) ───────────────── */
.sp-wrap { margin: 8px 0; }
.sp-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--text-primary, #111827); }
.sp-note { font-size: 12px; color: var(--text-secondary, #6b7280); background: rgba(0,179,201,0.06); border: 1px solid rgba(0,179,201,0.18); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.sp-note a { color: var(--primary, #00b3c9); }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sp-card { background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sp-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.sp-head i { font-size: 18px; }
.sp-name { color: var(--text-primary, #111827); }
.sp-count { margin-left: auto; font-size: 11px; color: var(--text-secondary, #9ca3af); }
.sp-count.over { color: #dc2626; font-weight: 600; }
.sp-media { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; background: #0001; }
.sp-caption { font-size: 13px; line-height: 1.45; color: var(--text-primary, #1f2937); white-space: normal; word-break: break-word; }
.sp-warn { font-size: 11px; color: #b45309; background: #fffbeb; border-radius: 6px; padding: 4px 8px; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.sp-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 8px; padding: 6px 10px; border: 1px solid var(--border, #e5e7eb); background: var(--surface, #fff); color: var(--text-primary, #374151); cursor: pointer; text-decoration: none; }
.sp-btn:hover { filter: brightness(0.97); }
.sp-publish { color: #fff; border: none; }
.sp-connect { color: var(--primary, #00b3c9); border-color: rgba(0,179,201,0.4); }
[data-theme="dark"] .sp-card { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .sp-title, [data-theme="dark"] .sp-name, [data-theme="dark"] .sp-caption { color: #f3f4f6; }
[data-theme="dark"] .sp-btn { background: #111827; color: #e5e7eb; border-color: #374151; }
[data-theme="dark"] .sp-warn { color: #fbbf24; background: rgba(251,191,36,0.08); }
[data-theme="dark"] .sp-media { background: #0f172a; }
.arm-social-preview .sp-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ── Nurture sequence card (Tapi chat-built sequences) ────────────────── */
.seq-card { border: 1px solid var(--border, #e5e7eb); border-radius: 12px; padding: 14px; margin: 8px 0; background: var(--surface, #fff); }
.seq-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.seq-name { font-weight: 700; font-size: 15px; color: var(--text-primary, #111827); }
.seq-desc { font-size: 12px; color: var(--text-secondary, #6b7280); margin-top: 2px; }
.seq-draft-badge { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--primary-dark, #0090a3); background: rgba(0,179,201,0.10); border: 1px solid rgba(0,179,201,0.25); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.seq-steps { border-left: 2px solid rgba(0,179,201,0.25); margin: 4px 0 10px 9px; padding-left: 14px; display: flex; flex-direction: column; gap: 10px; }
.seq-step { display: flex; gap: 10px; position: relative; }
.seq-step-dot { position: absolute; left: -23px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface, #fff); border: 2px solid rgba(0,179,201,0.4); display: flex; align-items: center; justify-content: center; }
.seq-step-dot .material-icons { font-size: 14px; color: var(--primary, #00b3c9); }
.seq-step-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seq-step-order { font-size: 11px; font-weight: 700; color: var(--primary-dark, #0090a3); }
.seq-step-kind { font-size: 11px; text-transform: capitalize; color: var(--text-secondary, #6b7280); }
.seq-wait { font-size: 11px; color: var(--text-secondary, #9ca3af); display: inline-flex; align-items: center; gap: 3px; }
.seq-wait .material-icons { font-size: 13px; }
.seq-wait.seq-now { color: #16a34a; }
.seq-step-title { font-size: 13px; color: var(--text-primary, #1f2937); margin-top: 2px; }
.seq-note { font-size: 12px; color: var(--text-secondary, #6b7280); background: rgba(0,179,201,0.06); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.seq-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.seq-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; border: 1px solid var(--border, #e5e7eb); background: var(--surface, #fff); color: var(--text-primary, #374151); }
.seq-btn .material-icons { font-size: 17px; }
.seq-enroll { background: var(--primary, #00b3c9); color: #fff; border: none; }
.seq-enroll:hover { background: var(--primary-dark, #0090a3); }
[data-theme="dark"] .seq-card { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .seq-name, [data-theme="dark"] .seq-step-title { color: #f3f4f6; }
[data-theme="dark"] .seq-step-dot { background: #1f2937; }
[data-theme="dark"] .seq-btn { background: #111827; color: #e5e7eb; border-color: #374151; }
/* Transaction History tab in the chat upgrade modal */
.chat-tx-empty { text-align: center; padding: 28px; color: #94a3b8; font-size: 14px; }
.chat-tx-list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; padding: 4px; }
.chat-tx-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-light, #e5e7eb); border-radius: 10px; background: var(--bg-white, #fff); }
.chat-tx-main { flex: 1; min-width: 0; }
.chat-tx-desc { font-size: 13px; font-weight: 600; color: var(--text-dark, #111827); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-tx-date { font-size: 11px; color: #94a3b8; }
.chat-tx-amt { font-size: 14px; font-weight: 700; white-space: nowrap; }
.chat-tx-amt.pos { color: #16a34a; }
.chat-tx-amt.neg { color: #dc2626; }
.chat-tx-bal { font-size: 12px; color: #94a3b8; min-width: 60px; text-align: right; }
[data-theme="dark"] .chat-tx-row { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .chat-tx-desc { color: #f3f4f6; }

/* Transaction history pagination (chat upgrade modal) */
.chat-tx-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 4px 4px; }
.chat-tx-page-btn { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; border: 1px solid var(--border-light, #e5e7eb); background: var(--bg-white, #fff); color: var(--text-dark, #374151); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.chat-tx-page-btn .material-icons { font-size: 18px; }
.chat-tx-page-btn:disabled { opacity: .4; cursor: not-allowed; }
.chat-tx-page-label { font-size: 12px; color: #94a3b8; min-width: 56px; text-align: center; }
[data-theme="dark"] .chat-tx-page-btn { background: #111827; color: #e5e7eb; border-color: #374151; }

/* AI image option in the LinkedIn post image editor */
.ai-img-group { border: 1px dashed rgba(0,179,201,0.4); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: rgba(0,179,201,0.05); }
.ai-img-group > label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--primary-dark, #0090a3); margin-bottom: 6px; }
.ai-img-prompt { width: 100%; padding: 8px 10px; border: 1px solid var(--border-light, #e5e7eb); border-radius: 8px; font-size: 13px; margin-bottom: 8px; }
.generate-image-btn.ai-gen { background: var(--primary, #00b3c9); color: #fff; border: none; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.generate-image-btn.ai-gen:hover { background: var(--primary-dark, #0090a3); }
.generate-image-btn.ai-gen:disabled { opacity: .6; cursor: not-allowed; }
.ai-img-hint { display: block; font-size: 11px; color: #94a3b8; margin-top: 6px; }
[data-theme="dark"] .ai-img-prompt { background: #111827; color: #e5e7eb; border-color: #374151; }
.ai-img-ref { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--primary-dark, #0090a3); cursor: pointer; margin-bottom: 8px; }
.ai-img-ref:hover { text-decoration: underline; }

/* =========================================================================
   Always-visible close pinned to the extreme top-right of the team chat panel.
   Pairs with the close (x) in the sidebar header so users can dismiss the
   widget from either side. Anchors to .atapic-chat-wrapper (a positioned
   floating panel). Hidden while collapsed.
   ========================================================================= */
.team-chat-close-x {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 60;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: rgba(0,0,0,.06);
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
}
.team-chat-close-x:hover { background: rgba(0,0,0,.14); color: var(--text-primary, #0f172a); }
[data-theme="dark"] .team-chat-close-x { background: rgba(255,255,255,.10); color: #cbd5e1; }
[data-theme="dark"] .team-chat-close-x:hover { background: rgba(255,255,255,.20); color: #fff; }
.atapic-chat-wrapper.collapsed .team-chat-close-x { display: none; }
/* Keep the conversation header action buttons clear of the floating close. */
.atapic-chat-wrapper .chat-header .chat-actions { padding-right: 32px; }

/* =========================================================================
   "Tapi is working" checklist (chat loading state). Animates a short list of
   action steps so the wait feels like real work, not a dead spinner.
   pending = hollow ring, active = spinning teal ring, done = teal check.
   ========================================================================= */
.tapi-working { padding: 4px 0; }
.tapi-working-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tapi-working-logo { width: 26px; height: 26px; }
.tapi-working-title { font-size: 14px; font-weight: 600; color: var(--text-primary, #1a1d24); }
.tapi-working-steps { list-style: none; margin: 0; padding: 0 0 0 3px; display: flex; flex-direction: column; gap: 7px; }
.tw-step {
    display: flex; align-items: center; gap: 10px;
    font-size: 13.5px; color: var(--text-muted, #94a3b8);
    opacity: .55; transition: color .25s ease, opacity .25s ease;
}
.tw-step .tw-ic {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid currentColor; box-sizing: border-box;
    flex-shrink: 0; position: relative;
}
.tw-step.active { color: var(--primary, #00b3c9); opacity: 1; }
.tw-step.active .tw-ic { border-top-color: transparent; animation: twspin .7s linear infinite; }
.tw-step.done { color: var(--text-secondary, #475569); opacity: 1; }
.tw-step.done .tw-ic { border-color: var(--primary, #00b3c9); background: var(--primary, #00b3c9); animation: none; }
.tw-step.done .tw-ic::after {
    content: ""; position: absolute; left: 4px; top: 1px;
    width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
@keyframes twspin { to { transform: rotate(360deg); } }
[data-theme="dark"] .tapi-working-title { color: #e8eaed; }

/* One-line flip loading state (supersedes the multi-step checklist look above).
   A single status line sits beside the spinning logo and FLIPS to the next as it
   progresses - cleaner and feels more like real work happening. */
.tapi-working { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.tapi-working-logo { width: 26px; height: 26px; flex-shrink: 0; }
.tw-line {
    display: inline-block; font-size: 14px; font-weight: 600;
    color: var(--primary, #00b3c9); transform-origin: center bottom;
    will-change: transform, opacity;
}
.tw-flip { animation: twflipline .42s cubic-bezier(.2,.7,.3,1); }
@keyframes twflipline {
    0%   { opacity: 0; transform: rotateX(-90deg); }
    55%  { opacity: 1; }
    100% { opacity: 1; transform: rotateX(0deg); }
}
[data-theme="dark"] .tw-line { color: var(--primary-light, #00d4e6); }

/* ============ ACTION OUTCOME + FOLLOW-UP CARDS ============
   Persistent receipts for chat actions (cancel/pause/reschedule, follow-up
   lists). Use theme vars so they blend with the conversation in both modes. */
.chat-outcome-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--success, #16c784);
    border-left-width: 4px;
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 460px;
}
.chat-outcome-card.err { border-color: #ef4444; }
.chat-outcome-card .oc-head { display: flex; align-items: center; gap: 8px; }
.chat-outcome-card .oc-head .material-icons { font-size: 20px; color: var(--success, #16c784); }
.chat-outcome-card.err .oc-head .material-icons { color: #ef4444; }
.chat-outcome-card .oc-title { font-size: 14px; font-weight: 600; color: var(--text-dark, #0a0e27); }
.chat-outcome-card .oc-msg { font-size: 13px; color: var(--text-light, #6c7280); margin-top: 6px; }
.chat-outcome-card .oc-link { display: inline-block; margin-top: 8px; color: var(--primary, #00b3c9); font-size: 13px; font-weight: 600; text-decoration: none; }

.chat-fu-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    max-width: 560px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.chat-fu-card .fu-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.chat-fu-card .fu-head .material-icons { color: var(--warning, #f59e0b); }
.chat-fu-card .fu-title { font-size: 14px; font-weight: 700; color: var(--text-dark, #0a0e27); }
.chat-fu-card .fu-count { margin-left: auto; background: var(--warning, #f59e0b); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.chat-fu-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-light, #f1f5f9); }
.chat-fu-row:last-of-type { border-bottom: 0; }
.chat-fu-row .fu-type { color: var(--warning, #f59e0b); font-size: 18px; }
.chat-fu-row .fu-main { flex: 1; min-width: 0; }
.chat-fu-row .fu-name { font-size: 13px; font-weight: 600; color: var(--text-dark, #0a0e27); }
.chat-fu-row .fu-company { font-weight: 400; color: var(--text-light, #6c7280); }
.chat-fu-row .fu-subject { font-size: 12px; color: var(--text-light, #6c7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.chat-fu-row .fu-when { font-size: 12px; color: var(--primary, #00b3c9); white-space: nowrap; }
.chat-fu-row .fu-act {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border, #e2e8f0);
    background: transparent; cursor: pointer; color: var(--text-light, #6c7280); text-decoration: none;
}
.chat-fu-row .fu-act .material-icons { font-size: 16px; }
.chat-fu-row .fu-act:hover { color: var(--primary, #00b3c9); border-color: var(--primary, #00b3c9); }
.chat-fu-row .fu-act.danger:hover { color: #ef4444; border-color: #ef4444; }
.chat-fu-row.cancelled { opacity: .5; }
.chat-fu-row.cancelled .fu-name, .chat-fu-row.cancelled .fu-subject { text-decoration: line-through; }
.chat-fu-card .fu-empty { font-size: 13px; color: var(--text-light, #6c7280); }
.chat-fu-card .fu-foot { display: inline-block; margin-top: 10px; color: var(--primary, #00b3c9); font-size: 13px; font-weight: 600; text-decoration: none; }

[data-theme="dark"] .chat-outcome-card,
[data-theme="dark"] .chat-fu-card { box-shadow: 0 1px 3px rgba(0,0,0,.4); }
