/* ===== Local Montserrat Font Faces ===== */
@font-face {
    font-family: 'Montserrat';
    src: url('assets/fonts/Montserrat-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('assets/fonts/Montserrat-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('assets/fonts/Montserrat-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('assets/fonts/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('assets/fonts/Montserrat-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('assets/fonts/Montserrat-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Alias for legacy 'Montserrat Thin' references in CSS */
@font-face {
    font-family: 'Montserrat Thin';
    src: url('assets/fonts/Montserrat-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

/* Side Panel for Lead Details */
.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1050;
    /* Above nav, below modal */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.side-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lead-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1060;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.4);
}

.lead-side-panel.active {
    transform: translateX(0);
}

.panel-header {
    padding: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

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

/* Timeline specific styles */
.timeline-track {
    position: relative;
    padding-left: 24px;
    border-left: 2px solid var(--border-light-legacy);
    margin-left: 12px;
    padding-bottom: 150px;
}

.timeline-entry {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -31px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--pure-white);
    border: 2px solid var(--text-gray);
    transition: all 0.2s ease;
}

.timeline-entry:hover .timeline-dot {

    transform: scale(1.2);
}

.timeline-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.timeline-card:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* 3-dot action menu fix */
.action-btn {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-dark);
}

.action-btn svg {
    stroke-width: 2px;
}

:root {
    --primary-orange: #ff6b35;
    --light-orange: #ff9f1c;
    --pure-white: #ffffff;
    --off-white: #f8fafc;
    --text-dark: #0f172a;
    --text-gray: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);

    /* Luxury Portal Imports */
    --luxury-primary: #007bff;
    --luxury-glow: rgba(0, 123, 255, 0.3);
    --luxury-glass: rgba(255, 255, 255, 0.05);
    --luxury-glass-border: rgba(255, 255, 255, 0.1);

    /* Table Variables - Light Mode */
    --table-bg: rgba(0, 0, 0, 0.02);
    --table-border: rgba(0, 0, 0, 0.1);
    --table-header-bg: rgba(0, 0, 0, 0.05);
    --table-header-text: var(--text-dark);
    --table-text: var(--text-dark);
    --table-row-hover: rgba(0, 0, 0, 0.03);
    --table-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* Legacy Compat */
    --border-light-legacy: #e2e8f0;
    --bg-hover: #f1f5f9;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;

}

[contenteditable="true"] {
    caret-color: transparent !important;
}

/* Reset and Base Styles */
input,
textarea,
select {
    font-size: 16px !important;
    /* Force 16px to prevent iOS auto-zoom on focus */
}

/* Navigation */
.dash-sidebar {
    color: #fff;
    width: 100%;
    height: auto;
    position: fixed;
    /* Move up when keyboard is visible */
    bottom: calc(var(--base-bottom-offset, 10px) + var(--keyboard-offset, 0px));
    left: 0;
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), bottom 0.2s ease-out;
    background: transparent;
    z-index: 21000;
    zoom: 0.9;
}

.dash-sidebar>* {
    pointer-events: auto;
    /* Re-enable for children */
}

/* Dock Controls Bar (Process Queue) */
.dock-controls-bar {
    width: 100%;
    padding: 8px 16px 4px 16px;
    z-index: 21001;
    position: relative;
    box-sizing: border-box;
}

.dock-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Slightly more gap */
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
    padding: 4px;
    /* Internal padding to ensure shadows aren't cut by overflow scroll */
    margin: -4px;
}

.dock-controls-row::-webkit-scrollbar {
    display: none;
}

.dock-pill {
    display: inline-flex;
    text-decoration: none;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 38px;
    /* Consistent height matching nav pills */
    border-radius: 20px;
    font-size: 13px;
    /* Slightly larger matching weight */
    font-weight: 700;
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Better shadow */
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.dock-pill.active {
    background: var(--primary-orange) !important;
    color: #fff !important;
}

.dock-pill.active svg {
    opacity: 1;
}

.dock-status-pill {
    gap: 10px;
    padding-left: 14px;
}

.dock-status-pill span {
    color: var(--text-primary);
}

.dock-status-pill .status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dock-select-pill {
    padding: 0 12px;
}

.dock-select-pill select {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: inherit;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    padding: 0 4px;
    -webkit-appearance: none;
    appearance: none;
    height: 100%;
}

.dock-select-pill select option {
    background: #fff;
    color: var(--text-primary);
}

.dock-select-pill svg {
    opacity: 0.8;
}

.dock-action-pill {
    cursor: pointer;
    font-family: inherit;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    gap: 0;
    padding: 0 12px;
}

.dock-action-pill span {
    opacity: 0;
    max-width: 0;
    display: inline-block;
    transition: all 0.4s ease;
    overflow: hidden;
    margin-left: 0;
}

.dock-action-pill:hover span,
.dock-action-pill.active span {
    opacity: 1;
    max-width: 150px;
    margin-left: 8px;
}

.dock-start-pill {
    background: #10b981;
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.dock-start-pill:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
}

.dock-stop-pill {
    background: #fff;
    color: #ef4444;
}

.dock-stop-pill:hover:not(:disabled) {
    background: #fef2f2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.dock-stop-pill:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: var(--text-tertiary);
    box-shadow: none;
}

.dock-status-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    flex-shrink: 1;
    min-width: 0;
}

/* Chatbox Styles */
/* Chatbox Styles */
.dock-chat-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 0 20px;
    /* removed bottom padding initially for smooth collapse */
    display: none;
    /* JS toggles this */
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    zoom: 0.85;
}

.dock-chat-container.active {
    display: block;
    opacity: 1;
    max-height: 500px;
    /* Approximate max height needed */
    padding-bottom: 10px;
    /* Restore padding when active */
    transform: translateY(0);
}

.chat-input-wrapper {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-input-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.chat-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 2px;
}

.chat-textarea {
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 16px;
    /* Increased from 14px to prevent mobile zoom */
    resize: none;
    padding: 8px 4px;
    max-height: 150px;
    overflow-y: auto;
    background: transparent;
    line-height: 1.5;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.chat-textarea::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Webkit */
}

.chat-send-btn,
.chat-attach-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover,
.chat-attach-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.chat-send-btn.active,
.chat-send-btn.stopping {
    background: var(--primary-orange);
    color: white !important;
}

.chat-send-btn.stopping {
    opacity: 0.9;
}

.chat-model-select {
    padding: 2px 5px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: white;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    max-width: 100px;
    height: 24px;
    opacity: 0.6;
}

.chat-model-select:hover {
    border-color: var(--primary-orange);
    background: var(--bg-hover);
}

.chat-model-select:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.1);
}

/* Chat History & Messages */
.chat-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.chat-container.active {
    opacity: 1;
    visibility: visible;
    z-index: 11111;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    padding: 50px 10px;
    padding-bottom: 100px;
    overflow-y: auto;
    max-height: calc(100vh - 110px);
    scrollbar-width: none;
    margin-left: auto;
    margin-right: auto;
    max-width: 70vw;
    padding-bottom: 100px;

    /* UNIVERSAL DARK OVERRIDE - Forcing high contrast light text for black overlay */
    --text-primary: rgba(255, 255, 255, 0.98);
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-tertiary: rgba(255, 255, 255, 0.6);
    --text-main: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.7);
    --pure-white: #ffffff;
    --off-white: rgba(255, 255, 255, 0.9);
    --light-gray: rgba(255, 255, 255, 0.45);
    --table-bg: rgba(255, 255, 255, 0.2);
    --table-border: rgba(255, 255, 255, 0.1);
    --table-header-bg: rgba(255, 255, 255, 0.08);
    --table-header-text: #ffffff;
    --table-text: rgba(255, 255, 255, 0.9);
    --table-row-hover: rgba(255, 255, 255, 0.02);
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out;
    font-family: 'Montserrat Thin';
}

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

.chat-message.bot {
    align-self: flex-start;

}

.message-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgb(255 255 255 / 45%);
    margin-bottom: 4px;
    margin-left: 4px;
}

.chat-message.user .message-label {
    text-align: right;
    margin-right: 4px;
}

.message-bubble {
    padding: 0px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chat-message.user .message-bubble {
    border-bottom-right-radius: 4px;
    background: rgba(255, 107, 53, 0.12);
    border-color: var(--primary-orange);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.bot .message-bubble {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.95);
    /* Universal light text for dark context */
}

.chat-message.bot {
    max-width: 100%;
    color: #ffffff;
}

.message-content {
    word-break: break-word;
    line-height: 1.6;
}

/* Consolidated & Premium Chat Markdown Styling */
.message-content {
    word-break: break-word;
    line-height: 1.6;
}

.message-content p {
    margin: 12px 0;
    line-height: 1.6;
    color: var(--text-secondary, rgba(255, 255, 255, 0.9));
    font-weight: 300;
}

.message-content p strong {
    font-weight: 600;
    color: var(--text-primary, #fff);
}

/* Headings */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
    margin: 24px 0 12px 0;
    color: var(--text-primary, #ffffff);
    font-weight: 600;
    line-height: 1.3;
}

.message-content h2 {
    color: var(--primary-orange);
    font-size: 1.4rem;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.message-content h3 {
    font-size: 1.15rem;
    border-left: 3px solid var(--primary-orange);
    padding-left: 12px;
}

/* Tables (Premium Glassmorphism) */
.message-content table {
    width: 100%;
    margin: 20px 0;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--table-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--table-border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    overflow-x: auto;
    display: block;
    /* For responsiveness */
    backdrop-filter: blur(5px);
    box-shadow: var(--table-shadow, 0 4px 15px rgba(0, 0, 0, 0.2));
}

.message-content th {
    background: var(--table-header-bg, rgba(255, 255, 255, 0.1));
    color: var(--table-header-text, white);
    padding: 12px 15px;
    font-weight: 600;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--table-border, rgba(255, 255, 255, 0.1));
    white-space: nowrap;
}

.message-content td {
    padding: 12px 15px;
    color: var(--table-text, rgba(255, 255, 255, 0.8));
    font-size: 13px;
    border-bottom: 1px solid var(--table-border, rgba(255, 255, 255, 0.05));
    line-height: 1.4;
    min-width: 120px;
}

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

/* Lists */
.message-content ul,
.message-content ol {
    margin: 15px 0;
    padding-left: 24px;
}

.message-content li {
    margin-bottom: 8px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.85));
    line-height: 1.5;
}

/* Blockquote */
.message-content blockquote {
    border-left: 4px solid var(--primary-orange);
    background: rgba(255, 107, 53, 0.05);
    padding: 12px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.7));
}

/* Horizontal Rule */
.message-content hr {
    border: 0;
    border-top: 1px solid var(--border-light, rgba(255, 255, 255, 0.15));
    margin: 28px 0;
}

/* Code */
.message-content code {
    background: var(--bg-hover, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, #ffffff);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
}

.message-content a:-webkit-any-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgb(255 255 255 / 76%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: 10px;
    text-decoration: none;
    cursor: pointer;
    font-family: Montserrat;
    font-weight: 600;
}

/* Thinking Mode UI - Enhanced Glassmorphism */
.thinking-container {
    margin: 12px 0 16px;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.thinking-header {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.thinking-header:hover {
    color: #fff;
}

.thinking-header .thinking-icon {
    display: flex;
    color: var(--primary-orange);
    transition: transform 0.3s ease;
}

.thinking-container.collapsed .thinking-icon {
    transform: rotate(-90deg);
}

.thinking-content {
    padding: 12px 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    line-height: 1.6;
    overflow-y: auto;
    font-family: 'Montserrat Thin';
}

.thinking-container.collapsed .thinking-content {
    display: none;
}

/* AI Thinking Indicator (Typing) */
.ai-thinking-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: var(--primary-orange);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Tool Execution Badge */
.tool-execution-badge {
    margin: 12px 0;
    padding: 10px 14px;
    background: rgba(40, 40, 45, 0.8);
    border: 1px solid rgba(255, 145, 0, 0.2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.3s ease-out;
    max-width: fit-content;
}

.tool-badge-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.tool-icon {
    font-size: 14px;
    filter: drop-shadow(0 0 5px var(--primary-orange));
}

.tool-runner {
    width: 30px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    margin-left: 8px;
}

.tool-runner::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: var(--primary-orange);
    box-shadow: 0 0 10px var(--primary-orange);
    animation: slideRunner 1.5s infinite ease-in-out;
}

@keyframes slideRunner {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Image Gallery Widget */
.image-gallery-grid {
    column-count: 3;
    column-gap: 12px;
    margin: 15px 0;
    width: 100%;
}

@media (max-width: 768px) {
    .image-gallery-grid {
        column-count: 2;
    }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover {
    transform: scale(1.03);
    border-color: var(--primary-orange);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.gallery-item img {
    width: 100%;
    display: block;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.gallery-item:hover img {
    filter: brightness(1.1);
}

/* Lightbox / Image Preview */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 145, 0, 0.3);
}

.lightbox-actions {
    display: flex;
    gap: 15px;
}

.lightbox-btn {
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-download {
    background: var(--primary-orange);
    color: white;
}

.btn-download:hover {
    background: #ff7b00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 123, 0, 0.4);
}

.btn-close {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(5px);
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Message Actions (Copy Button) */
.message-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bot .message-bubble:hover .message-actions {
    opacity: 1;
}

.copy-message-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-gray);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.copy-message-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-orange);
}

.copy-message-btn.copied {
    color: #10b981;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* AI Thinking Indicator */
.ai-thinking-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

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

.ai-thinking-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-orange);
    animation: thinkingPulse 1.4s ease-in-out infinite;
}

.ai-thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinkingPulse {

    0%,
    80%,
    100% {
        opacity: 0.25;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* File Preview Container */
.file-preview-container {
    display: none;
    overflow-x: auto;
    white-space: nowrap;
    padding: 8px 4px 4px 4px;
    gap: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.file-preview-container::-webkit-scrollbar {
    display: none;
}

.file-preview-container.has-files {
    display: flex;
}

html[data-theme="dark"] .file-preview-card {
    background: #05070c;
    border: 1px solid #302f3c;
}

html[data-theme="dark"] .file-preview-icon {
    background: #ff6b36;
    border: 1px solid #302f3c;
}

.file-preview-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 6px 10px;
    min-width: 160px;
    max-width: 220px;
    flex-shrink: 0;
    position: relative;
    transition: background 0.2s ease;
}

.file-preview-card:hover {
    background: #eee;
}

.file-preview-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.file-preview-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
}

.file-preview-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.file-preview-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-size {
    font-size: 10px;
    color: var(--text-tertiary);
}

.file-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    transition: transform 0.15s ease;
    padding: 0;
}

.file-preview-remove:hover {
    transform: scale(1.2);
}



/* Chat Reset Nav Item */
.chat-reset-link {
    color: #ef4444 !important;
}

.chat-reset-link:hover {
    color: #dc2626 !important;
}



.logo-container {
    padding: 20px 0 40px;
    text-align: center;
}

.logo-img {
    height: 40px;
    filter: brightness(0) invert(1);
    /* Make logo white if it's dark */
}

/* Main Content Wrapper to fix Sidebar Overlap */
.tab-content {
    margin-left: 260px;
    /* Width of fixed sidebar */
    width: calc(100% - 260px);
    position: relative;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Specific fix for full screen home */
.radar-full-screen {
    width: 100%;
    /* Relative to parent .tab-content */
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Background handled here */
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.90) 0%, rgba(243, 243, 239, 0.90) 100%),
        url('assets/top3.png') center/cover no-repeat;
    background-size: cover;
    background-position: center;
}



.dash-nav-links {
    list-style: none;
    padding: 0px 20px 10px 20px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.dash-nav-links::-webkit-scrollbar {
    display: none;
}


.dash-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 4px;
    /* Reduced from 10px */
    padding: 8px;
    background: #fff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 34px;
    height: 34px;
    overflow: hidden;
    white-space: nowrap;
}

.dash-nav-link .nav-text {
    opacity: 0;
    max-width: 0;
    display: inline-block;
    transition: all 0.4s ease;
    overflow: hidden;
    margin-left: 0;
}

.dash-nav-link svg {
    min-width: 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.dash-nav-link:hover svg,
.dash-nav-link.active svg {
    opacity: 1;
}

.dash-nav-link:hover,
.dash-nav-link.active {
    width: auto;
    border-radius: 20px;
    padding: 8px 16px;
    justify-content: flex-start;
    gap: 0;
    background-color: var(--primary-orange);
    color: var(--pure-white);
    text-decoration: none !important;
}

.dash-nav-link:hover .nav-text,
.dash-nav-link.active .nav-text {
    opacity: 1;
    max-width: 150px;
    margin-left: 8px;
}






* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat';
}

body {
    font-family: 'Montserrat', sans-serif;
    background: #fafafa;
    color: var(--text-dark);
    line-height: 1.5;
    font-weight: 400;
    transition: filter 0.3s ease;
    margin: 0;
    padding: 0 !important;
    overflow-x: hidden;
}

html[data-theme="dark"] {
    --pure-white: #1e293b;
    --off-white: #0f172a;
    --light-gray: #334155;
    --text-dark: #f8fafc;
    --text-gray: #cbd5e1;
    --text-light: #94a3b8;
    --border-light-legacy: #475569;
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);

    --bg-base: #0f172a;
    --bg-raised: #1e293b;
    --bg-subtle: rgba(255, 255, 255, 0.02);
    --bg-subtler: rgba(255, 255, 255, 0.04);
    --bg-hover: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-lighter: rgba(255, 255, 255, 0.05);

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);

    /* Startup Dashboard overrides */
    --bg-page: #0f172a;
    --bg-gradient: radial-gradient(circle at top left, #1e293b, #0f172a 40%, #020617 80%, #000000);
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --bg-pill: rgba(30, 41, 59, 0.7);
    --bg-pill-active: rgba(51, 65, 85, 0.95);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --border-card: rgba(255, 255, 255, 0.1);
    --border-highlight: rgba(255, 255, 255, 0.2);
    --border-glass: rgba(255, 255, 255, 0.15);

    /* Table Variables - Dark Mode */
    --table-bg: rgba(255, 255, 255, 0.03);
    --table-border: rgba(255, 255, 255, 0.1);
    --table-header-bg: rgba(255, 255, 255, 0.1);
    --table-header-text: var(--text-light);
    --table-text: var(--text-dark);
    --table-row-hover: rgba(255, 255, 255, 0.02);
    --table-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ===============================================
   DARK MODE - Element-Level Overrides
   =============================================== */

/* Body & root */
html[data-theme="dark"] body {
    background: #0f172a;
    color: #f8fafc;
}

html[data-theme="dark"] .branding-logo {
    filter: invert(1);
}

html[data-theme="dark"] .active-avatar {
    background-color: #0f172a !important;
}

/* ── Bottom Navigation Bar (Circle Pills) ────────────── */
html[data-theme="dark"] .dash-nav-link {
    background: #334155 !important;
    color: #94a3b8 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .dash-nav-link svg {
    color: #94a3b8 !important;
    stroke: #94a3b8 !important;
}

html[data-theme="dark"] .dash-nav-link:hover,
html[data-theme="dark"] .dash-nav-link.active {
    background-color: var(--primary-orange, #FF6A3D) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .dash-nav-link:hover svg,
html[data-theme="dark"] .dash-nav-link.active svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

html[data-theme="dark"] .dash-nav-link:hover .nav-text,
html[data-theme="dark"] .dash-nav-link.active .nav-text {
    color: #ffffff !important;
}

/* ── Startup Dashboard / Home Page ────────────────────── */
html[data-theme="dark"] .app-container,
html[data-theme="dark"] .startup-dashboard,
html[data-theme="dark"] #home-content {
    background: #0f172a !important;
}

html[data-theme="dark"] .widget,
html[data-theme="dark"] .glass-card,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .metric-tile {
    background: rgba(30, 41, 59, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
    backdrop-filter: blur(12px);
}

html[data-theme="dark"] .widget-label,
html[data-theme="dark"] .metric-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .widget-value,
html[data-theme="dark"] .metric-value {
    color: #f8fafc !important;
}

html[data-theme="dark"] .greeting-text,
html[data-theme="dark"] .home-greeting {
    color: #f8fafc !important;
}

/* ── Chat Container & Messages ────────────────────────── */
html[data-theme="dark"] .chat-container {
    background: rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .chat-messages,
html[data-theme="dark"] #chat-messages {
    background: rgba(0, 0, 0, 0) !important;
}

html[data-theme="dark"] .chat-input-wrapper,
html[data-theme="dark"] .chat-input-container,
html[data-theme="dark"] .dock-chat-input {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .chat-input-container input,
html[data-theme="dark"] .chat-input-container textarea,
html[data-theme="dark"] #chat-input {
    background: transparent !important;
    color: #f8fafc !important;
    border-color: transparent !important;
}

html[data-theme="dark"] #chat-input::placeholder {
    color: #64748b !important;
}

html[data-theme="dark"] .chat-model-select {
    background: rgba(51, 65, 85, 0.6) !important;
    color: #cbd5e1 !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
}

html[data-theme="dark"] .chat-attach-btn,
html[data-theme="dark"] .chat-send-btn {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .chat-attach-btn:hover,
html[data-theme="dark"] .chat-send-btn:hover {
    color: #f8fafc !important;
}

html[data-theme="dark"] .message-content a:-webkit-any-link {
    color: #1e293c !important;
}

html[data-theme="dark"] .message-bubble {
    color: #f8fafc !important;
}

/* ── Dock Chat (Floating Chat Panel) ──────────────────── */
html[data-theme="dark"] .dock-chat-container {
    background: transparent !important;
}

html[data-theme="dark"] .dock-controls {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* ── Leads Page ───────────────────────────────────────── */
html[data-theme="dark"] .leads-page,
html[data-theme="dark"] .leads-content,
html[data-theme="dark"] .main-content {
    background: #0f172a !important;
}

html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .lead-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .lead-header,
html[data-theme="dark"] .lead-list-header {
    background: #1e293b !important;
    color: #f8fafc !important;
}

/* ── Tables ────────────────────────────────────────────── */
html[data-theme="dark"] .standard-table,
html[data-theme="dark"] table {
    color: #f8fafc;
}

html[data-theme="dark"] .standard-table th {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .standard-table td {
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .standard-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

/* ── Right Sidebar / Lead Panel ───────────────────────── */
html[data-theme="dark"] .right-sidebar,
html[data-theme="dark"] .lead-side-panel {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Fix white CITY metadata table (inline bg:#fff in JS) */
html[data-theme="dark"] .lead-info-table-container {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .lead-info-table-container td {
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .lead-info-table-container tr {
    border-color: #334155 !important;
}

/* All inputs inside the side panel */
html[data-theme="dark"] .lead-side-panel input,
html[data-theme="dark"] .lead-side-panel select,
html[data-theme="dark"] .lead-side-panel textarea {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .lead-side-panel input::placeholder {
    color: #64748b !important;
}


/* ── Process Queue ────────────────────────────────────── */
html[data-theme="dark"] .process-queue-content {
    background: #0f172a !important;
}

html[data-theme="dark"] .console-area,
html[data-theme="dark"] #console-output {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

/* ── Preferences ──────────────────────────────────────── */
html[data-theme="dark"] .pref-nav-item {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .pref-nav-item.active {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #93bbfd !important;
}

html[data-theme="dark"] .pref-nav-item.active .pref-nav-icon {
    color: #93bbfd !important;
}

html[data-theme="dark"] .pref-nav-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

html[data-theme="dark"] .pref-section-title {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .pref-card,
html[data-theme="dark"] .account-card {
    background: rgba(30, 41, 59, 0.6) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: #f8fafc !important;
    backdrop-filter: blur(12px);
}

/* ── Modals, Dropdowns, Overlays ──────────────────────── */
html[data-theme="dark"] .search-overlay,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .action-menu {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .mobileheaderoverlay {
    background: rgba(0, 0, 0, 0.6) !important;
}

/* ── Inputs (global) ──────────────────────────────────── */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #344156;
    color: #f8fafc;
    border-color: #334155;
}

html[data-theme="dark"] input::placeholder {
    color: #64748b;
}

/* ── Filters ──────────────────────────────────────────── */
html[data-theme="dark"] .filter-row input,
html[data-theme="dark"] .filter-row select {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

/* ── Score bars ────────────────────────────────────────── */
html[data-theme="dark"] .score-bar-bg {
    background: #334155 !important;
}

/* ── Timeline cards ───────────────────────────────────── */
html[data-theme="dark"] .timeline-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* ── Query pills ──────────────────────────────────────── */
html[data-theme="dark"] .query-pill {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
}

html[data-theme="dark"] .query-pill.active {
    background: #FF6A3D;
    color: #fff;
    border-color: #FF6A3D;
}

/* ── Typography ───────────────────────────────────────── */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 {
    color: #f8fafc !important;
}

html[data-theme="dark"] p {
    color: #cbd5e1;
}

/* ── Search bar ───────────────────────────────────────── */
html[data-theme="dark"] .search-bar,
html[data-theme="dark"] .lead-search-bar {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .search-bar::placeholder,
html[data-theme="dark"] .lead-search-bar::placeholder {
    color: #64748b !important;
}

/* ── Add Lead button ──────────────────────────────────── */
html[data-theme="dark"] .add-lead-button {
    background: #FF6A3D !important;
    color: #fff !important;
}

/* ── Pagination buttons ───────────────────────────────── */
html[data-theme="dark"] .pagination-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* ── Badge / Status pills ─────────────────────────────── */
html[data-theme="dark"] .status-badge {
    border-color: #475569 !important;
}

/* ── Sidebar logo branding ────────────────────────────── */
html[data-theme="dark"] .radar-branding {
    background: transparent !important;
}

/* ── Scrollbar (Global Dark Mode) ─────────────────────── */
html[data-theme="dark"] {
    scrollbar-color: #334155 #0f172a;
    /* Firefox */
}

html[data-theme="dark"] *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html[data-theme="dark"] *::-webkit-scrollbar-track {
    background: #0f172a;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
    border: 2px solid #0f172a;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb:active {
    background: #64748b;
}

html[data-theme="dark"] *::-webkit-scrollbar-corner {
    background: #0f172a;
}

/* ── Channel selector ─────────────────────────────────── */
html[data-theme="dark"] .channel-selector,
html[data-theme="dark"] .channel-pill {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .channel-pill.active {
    background: #FF6A3D !important;
    color: #fff !important;
}

/* ── Dock Pills (Process Queue Controls) ──────────────── */
html[data-theme="dark"] .dock-pill {
    background: #334155 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .dock-pill.active {
    background: var(--primary-orange) !important;
    color: #fff !important;
}

html[data-theme="dark"] .dock-status-pill span {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .dock-select-pill select {
    color: #fff !important;
}

html[data-theme="dark"] .dock-select-pill select option {
    background: #1e293b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .dock-stop-pill {
    background: #334155 !important;
    color: #f87171 !important;
}

html[data-theme="dark"] .dock-stop-pill:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

html[data-theme="dark"] .dock-controls-bar {
    background: transparent !important;
}

/* ── Lead Widget Cards (Top Stats) ────────────────────── */
html[data-theme="dark"] .lead-widget-card {
    background: rgba(30, 41, 59, 0.7) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: #f8fafc !important;
    backdrop-filter: blur(12px);
}

html[data-theme="dark"] .lead-widget-card .widget-value {
    color: #f8fafc !important;
}

html[data-theme="dark"] .lead-widget-card .widget-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .lead-widget-card .widget-icon {
    color: #64748b !important;
}

html[data-theme="dark"] .lead-widget-card .widget-sub {
    color: #94a3b8 !important;
}

/* ── Action Button Circles (Side Panel) ───────────────── */
html[data-theme="dark"] .action-btn-circle {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .action-btn-circle:hover {
    background: rgba(255, 106, 61, 0.12) !important;
    border-color: #FF6A3D !important;
    color: #FF6A3D !important;
}

/* ── Chat Context Bar ─────────────────────────────────── */
html[data-theme="dark"] .chat-context-bar {
    background: rgba(255, 106, 61, 0.08) !important;
    border-color: rgba(255, 106, 61, 0.2) !important;
}

html[data-theme="dark"] .context-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .context-lead-name {
    color: #f8fafc !important;
}

html[data-theme="dark"] .chat-context-clear {
    color: #94a3b8 !important;
}

/* ── Lead Modal ───────────────────────────────────────── */
html[data-theme="dark"] .lead-modal {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .lead-modal-header {
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .lead-modal-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .lead-modal-close {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .lead-modal-close:hover {
    color: #f8fafc !important;
}

/* ── Form Groups (Modal Forms) ────────────────────────── */
html[data-theme="dark"] .form-group label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .form-group select {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group textarea:focus,
html[data-theme="dark"] .form-group select:focus {
    border-color: #FF6A3D !important;
}

/* ── Submit / Cancel Buttons ──────────────────────────── */
html[data-theme="dark"] .btn-submit {
    background: #FF6A3D !important;
    color: #fff !important;
}

html[data-theme="dark"] .btn-cancel {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .btn-cancel:hover {
    background: #475569 !important;
}

/* ── Close / Action Buttons ───────────────────────────── */
html[data-theme="dark"] .close-action-button {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .close-action-button:hover {
    color: #f8fafc !important;
}

/* ── Lead Search Input ────────────────────────────────── */
html[data-theme="dark"] .lead-search-input {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .lead-search-input::placeholder {
    color: #64748b !important;
}

/* ── Lead Table Container ─────────────────────────────── */
html[data-theme="dark"] .lead-table-container {
    background: #0f172a !important;
    border-color: #334155 !important;
}

/* ── Lead Action Bar ──────────────────────────────────── */
html[data-theme="dark"] .lead-action-bar {
    background: #1e293b00 !important;
    border-color: #33415500 !important;
}

/* ── Side Panel Overlay ───────────────────────────────── */
html[data-theme="dark"] .side-panel-overlay {
    background: rgba(0, 0, 0, 0.5) !important;
}

/* ── Panel Header & Content ───────────────────────────── */
html[data-theme="dark"] .panel-header {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .panel-content {
    background: #1e293b !important;
    color: #f8fafc !important;
}

/* ── Log Console ──────────────────────────────────────── */
html[data-theme="dark"] .log-console {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .log-entry {
    color: #cbd5e1 !important;
    border-color: #1e293b !important;
}

/* ── Process Queue Log Cards (Dark) ──────────────────── */
html[data-theme="dark"] .log-card {
    background: #1e293b !important;
    border-left-color: #475569 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .log-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .log-card.step {
    background: linear-gradient(135deg, #1e293b 0%, #1a1f3a 100%) !important;
}

html[data-theme="dark"] .log-card.info {
    border-left-color: #3b82f6 !important;
}

html[data-theme="dark"] .log-card.success {
    border-left-color: #22c55e !important;
}

html[data-theme="dark"] .log-card.warning {
    border-left-color: #f59e0b !important;
}

html[data-theme="dark"] .log-card.error {
    border-left-color: #ef4444 !important;
}

html[data-theme="dark"] .card-title {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .card-body {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .card-time {
    color: #64748b !important;
}

html[data-theme="dark"] .card-details {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .card-progress {
    background: #334155 !important;
}

html[data-theme="dark"] .toggle-details {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .toggle-details:hover {
    background: #475569 !important;
    border-color: #64748b !important;
}

/* ── Source Items / Web Results (Dark) ────────────────── */
html[data-theme="dark"] .source-item {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .source-item:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* ── Search Groups (Dark) ────────────────────────────── */
html[data-theme="dark"] .search-group {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: #334155 !important;
}

/* ── Pipeline Progress (Dark) ────────────────────────── */
html[data-theme="dark"] .pipeline-progress {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .pipeline-progress-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .pipeline-progress-bar {
    background: #334155 !important;
}

/* ── Collapsible Details (Dark) ──────────────────────── */
html[data-theme="dark"] .details-toggle {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .details-toggle:hover {
    background: #475569 !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .details-content {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .model-output {
    color: #cbd5e1 !important;
}

/* ── Timeline (Dark) ─────────────────────────────────── */
html[data-theme="dark"] .timeline-phase-separator {
    background: #475569 !important;
}

/* ── Badges (Dark) — boost colors for contrast ───────── */
html[data-theme="dark"] .badge-ai,
html[data-theme="dark"] .badge-model {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #a78bfa !important;
    border-color: rgba(139, 92, 246, 0.25) !important;
}

html[data-theme="dark"] .badge-tokens {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}

html[data-theme="dark"] .badge-duration {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #818cf8 !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
}

html[data-theme="dark"] .badge-sources,
html[data-theme="dark"] .badge-success {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
}

html[data-theme="dark"] .badge-company,
html[data-theme="dark"] .badge-info {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.25) !important;
}

/* ── Pipeline Progress ────────────────────────────────── */
html[data-theme="dark"] .pipeline-progress-bar {
    background: #334155 !important;
}

html[data-theme="dark"] .pipeline-progress-label {
    color: #94a3b8 !important;
}

/* ── Toggle Rows (Preferences) ────────────────────────── */
html[data-theme="dark"] .toggle-row {
    border-color: #334155 !important;
}

html[data-theme="dark"] .toggle-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .toggle-desc {
    color: #94a3b8 !important;
}

/* ── Usage Stats ──────────────────────────────────────── */
html[data-theme="dark"] .usage-stat-box {
    background: rgba(30, 41, 59, 0.6) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .usage-stats-grid {
    color: #f8fafc !important;
}

html[data-theme="dark"] .usage-chart-container {
    background: transparent !important;
}

/* ── Scroll Bottom Button ─────────────────────────────── */
html[data-theme="dark"] .scroll-bottom-btn {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .scroll-bottom-btn:hover {
    background: #475569 !important;
    color: #f8fafc !important;
}

/* ── Signout Button ───────────────────────────────────── */
html[data-theme="dark"] .signout-button {
    color: #f87171 !important;
}

/* ── Sub Tags (Run Details) ───────────────────────────── */
html[data-theme="dark"] .sub-tag {
    background: #334155 !important;
    color: #94a3b8 !important;
}

/* ── Sort Icon ────────────────────────────────────────── */
html[data-theme="dark"] .sort-icon {
    color: #64748b !important;
}

/* ── Metrics Grid ─────────────────────────────────────── */
html[data-theme="dark"] .metrics-grid .metric-card {
    background: rgba(30, 41, 59, 0.7) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    backdrop-filter: blur(12px);
}

html[data-theme="dark"] .metric-info .metric-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .metric-info .metric-value {
    color: #f8fafc !important;
}

html[data-theme="dark"] .metric-icon {
    color: #64748b !important;
}

/* ── Rich Run Card (Side Panel) ───────────────────────── */
html[data-theme="dark"] .rich-run-card {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* ── Dock Controls Row ────────────────────────────────── */
html[data-theme="dark"] .dock-controls-row {
    background: transparent !important;
}

/* ── Lead Form ────────────────────────────────────────── */
html[data-theme="dark"] .lead-form {
    background: #1e293b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .lead-form-actions {
    border-color: #334155 !important;
}

/* ── Misc: Links inside dark theme ────────────────────── */
html[data-theme="dark"] a {
    color: #60a5fa;
}

html[data-theme="dark"] a:hover {
    color: #93bbfd;
}



/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 0.5px solid var(--border-light-legacy);
    height: 60px;
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(255, 255, 255, 0.98);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 40px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.logo {
    width: 150px;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-dark);
    text-decoration: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 400;
    transition: color 0.3s ease;
    cursor: pointer;
    outline: none;
}

.nav-links a:focus {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-orange);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-dark);
    cursor: pointer;
    outline: none;
}

.mobile-menu-toggle:focus {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

/* Page System */
.page {
    display: none;
    min-height: 100vh;
    padding-top: 60px;
}

.page.active {
    display: block;
}

/* Better centered chat width */
.chat-messages {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    zoom: 0.9;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Buttons */
.btn-primary {
    background: var(--primary-orange);
    color: white;
    padding: 16px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    outline: none;
}

.btn-primary:focus {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

.btn-primary:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-orange);
    padding: 16px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--primary-orange);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    outline: none;
}

.btn-secondary:focus {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

.btn-secondary:hover {
    background: var(--primary-orange);
    color: white;
}

/* Sections */
.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.section-header p {
    font-size: 20px;
    color: var(--text-gray);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: left;
    container-type: inline-size;
    container-name: card;
}

.glass-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.glass-card .pillar-score {
    font-size: 16px;
    color: var(--primary-orange);
    font-weight: 600;
    margin-bottom: 16px;
    white-space: nowrap;
    max-width: 100%;
}

.glass-card p {
    font-size: 16px;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
    overflow-wrap: break-word;
}

.glass-card .btn-secondary,
.glass-card .btn-primary {
    margin-top: auto;
    align-self: center;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.15);
    border-color: var(--primary-orange);
}

/* Radar Chart */
.radar-container {
    max-width: 600px;
    margin: 60px auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 60px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
}

.radar-chart {
    width: 100%;
    height: 480px;
    position: relative;
}

.radar-svg {
    width: 100%;
    height: 100%;
}

.footer-text {
    margin-top: auto;
    font-size: 0.3em;
    color: #e1e1e1;
    text-align: right;
    padding: 10px;
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 1002;
}

.status-display {
    position: absolute;
    bottom: 115px;
    left: calc(50vw - 300px);
    transform: none;
    text-align: left;
    z-index: 10;
    max-width: 600px;
    right: auto;
}

.score-display {
    position: absolute;
    bottom: 100px;
    left: 100px;
    transform: none;
    text-align: left;
    z-index: 10;
}

.score-number {
    font-size: 80px;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
    line-height: 1;
}

.score-total {
    font-size: 24px;
    color: var(--text-gray);
    font-weight: 400;
    margin-left: 4px;
}

/* Pillars Grid */

/* 3-column look, but implemented as 6 tracks */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 30px;
    margin: 60px 0;
}

/* default: every card = 2 tracks → 3 per row */

/* last two: each take half the row (3 of 6) → equal width, next to each other */
/* Removed to allow 3x3 grid */



.pillar-card {
    grid-column: span 2;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    text-align: left;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    container-type: inline-size;
    container-name: card;
}

.pillar-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(255, 107, 53, 0.2);
    border-color: var(--primary-orange);
}

.pillar-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-orange), var(--light-orange));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: white;
}

.pillar-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.pillar-score {
    font-size: 16px;
    color: var(--primary-orange);
    font-weight: 600;
    margin-bottom: 16px;
    white-space: nowrap;
    max-width: 100%;
}

.pillar-card p {
    font-size: 16px;
    color: var(--text-gray);
    line-height: 1.6;
    flex-grow: 1;
    overflow-wrap: break-word;
    margin-bottom: 20px;
}

/* Features Grid */

.feature-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    text-align: left;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    container-type: inline-size;
    container-name: card;
}

.feature-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 16px;
    color: var(--text-gray);
    line-height: 1.6;
    flex-grow: 1;
    overflow-wrap: break-word;
    margin-bottom: 20px;
}

.feature-card .btn-secondary,
.feature-card .btn-primary {
    margin-top: auto;
    align-self: center;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 8px 0;
    color: var(--text-gray);
    font-size: 14px;
    position: relative;
    padding-left: 20px;
}

.feature-list li::before {
    content: '•';
    color: var(--primary-orange);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Features Grid */
.features2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin: 60px 0;
    align-items: stretch;
    /* keeps heights stable */
}

.feature2-card {
    position: relative;
    overflow: hidden;
    /* prevent overflow during hover */
    border-radius: 16px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    /* move padding inside an inner wrapper if you want (optional) */
    padding: 40px;

    /* make it a stable, isolated paint layer */
    transform: translateZ(0);
    will-change: transform;
    contain: layout paint;
    backface-visibility: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    container-type: inline-size;
    container-name: card;
}



.feature2-card h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.feature2-card p {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

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

.feature2-list li {
    position: relative;
    padding: 8px 0 8px 20px;
}

.feature2-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-orange);
    font-weight: 700;
}

/* Contact Form */
.contact-form {
    max-width: 700px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px;
}

/* Checkbox Consistency */
.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-orange);
    vertical-align: middle;
    margin-right: 8px;
}

.checkbox-label {
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    font-weight: 400;
    vertical-align: middle;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-light-legacy);
    border-radius: 8px;
    font-size: 16px;
    background: var(--pure-white);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-orange);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 80px 40px 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
}

.footer-brand h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-brand p {
    font-size: 16px;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--light-orange);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 12px;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    cursor: pointer;
}

.footer-section a:hover {
    color: var(--light-orange);
}

.footer-bottom {
    border-top: 1px solid #333;
    margin-top: 60px;
    padding-top: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Math Formulas */
.formula {
    background: var(--light-gray);
    border: 1px solid var(--border-light-legacy);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
}



.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.case-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.case-card .btn-secondary,
.case-card .btn-primary {
    margin-top: auto;
    align-self: center;
}

/* AI-friendly structured data attributes - intended for future use */
/* .case-card[data-industry][data-geography][data-location] {} */

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-orange), var(--light-orange));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(255, 107, 53, 0.2);
    border-color: var(--primary-orange);
}

.case-card:hover::before {
    transform: scaleX(1);
}

.case-industry {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-orange);
    font-weight: 600;
    margin-bottom: 12px;
}

.case-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.3;
}

.case-details {
    margin-bottom: 20px;
}

.case-detail {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-gray);
}

.case-detail strong {
    color: var(--text-dark);
    min-width: 90px;
    font-weight: 600;
    font-family: Montserrat;
}

.case-codename {
    background: var(--light-gray);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-dark);
    font-weight: 500;
    display: inline-block;
    margin-top: 8px;
}

.case-location {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light-legacy);
    font-size: 14px;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

.location-icon {
    color: var(--primary-orange);
}


/* Pricing Grid */
main {
    width: 100%;
    /* max-width: 1200px; removed to allow full-width sections */
    /* margin: 0 auto; removed */
    /* padding: 40px 40px 80px; removed */
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.pricing-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    will-change: transform, box-shadow;
    display: flex;
    flex-direction: column;
    container-type: inline-size;
    container-name: card;
}

.pricing-card .btn-primary,
.pricing-card .btn-secondary {
    margin-top: auto;
    align-self: center;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.15);
    border-color: var(--primary-orange);
}

.plan-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    margin-top: 8px;
}

.price-container {
    margin: 24px 0;
}

.price-container::after {
    content: "";
    display: block;
    width: 40px;
    height: 2px;
    background: var(--primary-orange);
    margin: 16px auto;
    border-radius: 2px;
}

.price-original,
.price-old {
    color: var(--text-gray);
    font-size: 16px;
    text-decoration: line-through;
    opacity: 0.8;
}

.pricing-card .badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--primary-orange), var(--light-orange));
    color: #fff;
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.3);
}

.price-current {
    font-size: 56px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
    margin: 8px 0;
}

.price-period {
    font-size: 18px;
    color: var(--text-gray);
    font-weight: 400;
}

.plan-description {
    font-size: 16px;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 32px;
}

.cta-button {
    display: block;
    width: 100%;
    background: var(--primary-orange);
    color: white;
    padding: 18px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    will-change: transform, box-shadow;
    text-align: center;
}

.cta-button:hover {
    background: var(--primary-orange);
    filter: brightness(0.97);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

.cta-note {
    font-size: 12px;
    color: var(--text-gray);
    text-align: center;
    margin-top: 12px;
    font-style: italic;
}

.cta-note-brands {
    font-size: 8px;
    color: var(--text-gray);
    text-align: center;
    font-style: italic;
    margin-top: 0;
}

/* Pro Founder Card */
.pro-founder-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(255, 107, 53, 0.05) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid var(--light-orange);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
}

.pro-founder-card .plan-name {
    font-size: 32px;
    margin-bottom: 16px;
}

.pro-founder-card .plan-description {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 32px;
}

/* Features Grid */
.features-section {
    margin: 80px 0;
    text-align: center;
}

.features-section h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 48px;
}

.features-grid {
    margin: 60px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light-legacy);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-orange), var(--light-orange));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.feature-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Yedni Ecosystem */
.ecosystem-section {
    margin: 80px 0;
    text-align: center;
}

.ecosystem-section h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 48px;
}

.logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 40px;
    align-items: center;
    justify-items: center;
}

.logo-item {
    text-align: center;
}

.logo-item img {
    width: 120px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 12px;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
}

.logo-item img:hover {
    opacity: 1;
    transform: scale(1.03);
}

.logo-item:hover img {
    opacity: 1;
}

.logo-caption {
    font-size: 12px;
    color: var(--text-gray);
    display: flex;
    flex-direction: column;
}

/* FAQ Section */
.faq-section {
    margin: 80px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.faq-section h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 40px;
    text-align: center;
}

.faq-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light-legacy);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 24px;
    background: none;
    border: none;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
}

.faq-question:hover {
    color: var(--primary-orange);
}

.faq-icon {
    transition: transform 0.25s ease;
    line-height: 0;
    display: inline-flex;
    align-items: center;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 24px;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 24px 24px;
}

.faq-answer p {
    color: var(--text-gray);
    line-height: 1.6;
    font-size: 15px;
}

.faq-answer ul {
    margin: 12px 0;
    padding-left: 20px;
    color: var(--text-gray);
}

.faq-answer li {
    margin: 8px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.25s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 48px;
    max-width: 600px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-gray);
    cursor: pointer;
    line-height: 1;
}

.modal h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.modal p {
    font-size: 16px;
    color: var(--text-gray);
    margin-bottom: 24px;
}



/* ===== -INSPIRED DESIGN SYSTEM ===== */
:root {
    font-family: 'Montserrat';
    --primary-orange: #ff6b35;
    --light-orange: #ffb366;
    --pure-white: #ffffff;
    --off-white: #fafafa;
    --light-gray: #f5f5f5;
    --text-dark: #1d1d1f;
    --text-gray: #86868b;
    --text-light: #a1a1a6;
    --border-light-legacy: #d2d2d7;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    /* Color Tokens -  Standard */
    --bg-base: #fafafa;
    /* Light gray page background */
    --bg-raised: #ffffff;
    /* Pure white content */
    --bg-subtle: rgba(0, 0, 0, 0.02);
    --bg-subtler: rgba(0, 0, 0, 0.04);
    --bg-hover: rgba(0, 0, 0, 0.06);

    --text-primary: rgba(0, 0, 0, 0.88);
    --text-secondary: rgba(0, 0, 0, 0.65);
    --text-tertiary: rgba(0, 0, 0, 0.45);

    --border-light: rgba(0, 0, 0, 0.08);
    --border-lighter: rgba(0, 0, 0, 0.06);
    /*  uses 0.06 */

    /* SCOREMAX Brand Accent */
    --accent-primary: #ff6b35;
    --accent-subtle: rgba(255, 107, 53, 0.08);
    --accent-border: rgba(255, 107, 53, 0.2);

    /* Status Colors (Subtle) */
    --success: rgb(16, 185, 129);
    --success-bg: rgba(16, 185, 129, 0.08);
    --warning: rgb(245, 158, 11);
    --warning-bg: rgba(245, 158, 11, 0.08);
    --error: rgb(239, 68, 68);
    --error-bg: rgba(239, 68, 68, 0.08);

    /* Spacing Scale - DOUBLED for  Premium Feel */
    --space-xs: 6px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 40px;
    --space-3xl: 48px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 15px;
    --font-size-lg: 16px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
}

/* Dashboard-specific overrides */
body,
html {
    height: 100%;
    margin: 0;
    background-color: #f8f9fa;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styling - Scoped to avoid conflicts */




/* Logo styling */
.logo-container {
    margin-bottom: 0px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #ff6b36;
}

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

/* Main Content Styling */
/* Main Layout Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-base);
}

.main-content {
    flex: 1;
    display: flex;
    padding: 0;
    overflow: hidden;
    background: var(--bg-base);
    line-height: 1.7;
    width: 100%;
    height: 100vh;
}

.dashboard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    scroll-behavior: smooth;
}

.controls-section {
    background: var(--bg-raised);
    padding: var(--space-md) var(--space-lg);
    border-radius: 12px;
    border: 1px solid var(--border-lighter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

/* Sticky Controls */
.controls-section.sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* Add shadow when sticky if desired, or always */
}

/* Scroll to bottom button */
.scroll-bottom-btn {
    position: fixed;
    bottom: 90px;
    left: 50%;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FF5722;
    /* Primary Orange */
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    /* Ensure on top of everything */
    transform: translateX(-50%) translateY(20px);
}

.scroll-bottom-btn.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0);
}

.scroll-bottom-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 87, 34, 0.4);
    background: #F4511E;
}

.control-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}


/* Right sidebar for stats and runs */
.right-sidebar {
    width: 320px;
    /* Slightly narrower */
    padding: var(--space-md);
    /* Reduced from xl */
    background: rgb(248 249 250);
    backdrop-filter: blur(4px);
    border-left: 0px;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    /* Reduced from xl */
    overflow-y: auto;
    flex-shrink: 0;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    font-size: 0.9em;
    /* Slightly smaller text */
}

.live-status-bar {
    background: var(--bg-raised);
    padding: var(--space-lg) var(--space-xl);
    border-radius: 10px;
    border: 1px solid var(--border-lighter);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    margin-bottom: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #e74c3c;
    /* Default offline red/gray */
    transition: background-color 0.3s ease;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    /* subtle border */
}

.pulse {
    width: 12px;
    height: 12px;
    background-color: #2ecc71;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

/* Visual Log Viewer */
/* Visual Log Viewer */
.log-console {
    background: #f8f9fa;
    padding: 0;
    /* REMOVED PADDING to handle sticky header */
    min-height: 200px;
    position: relative;
    /* For containment */
    overflow-x: hidden;
    /* Ensure no horizontal scroll here either */
    overflow-y: auto;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.log-console::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

/* New container for cards to restore padding */
.log-cards {
    padding: 12px 16px 12px 32px;
    /* Extra left padding for timeline */
    display: flex;
    flex-direction: column;
    gap: 0;
    /* No gap, timeline entries handle spacing */
    position: relative;
}

/* Timeline vertical line */
.log-cards::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: var(--border-lighter);
    border-radius: 1px;
}

/* Timeline Entry - Compact Row */
.timeline-entry {
    position: relative;
    padding: 10px 0;
    /* Slightly more breathing room */
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid transparent;
    transition: background 0.15s ease;
}


/* Timeline Bullet - Level Color */
.timeline-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
    position: absolute;
    left: -18px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border-lighter);
}

.timeline-bullet.info {
    background: #3b82f6;
}

.timeline-bullet.warning {
    background: #f59e0b;
}

.timeline-bullet.error {
    background: #ef4444;
}

.timeline-bullet.success {
    background: #10b981;
}

.timeline-bullet.step {
    background: #8b5cf6;
    /* Violet/Purple for Steps */
    box-shadow: 0 0 0 1px #8b5cf6;
}

.timeline-bullet.default {
    background: #6b7280;
}

/* Step Entry specific styling */
.step-entry .timeline-content {
    font-weight: 600;
    color: var(--text-dark);
}

/* Timeline Type Label */
.timeline-type {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
    flex-shrink: 0;
    min-width: 90px;
    font-weight: 500;
    padding-top: 2px;
}

/* Timeline Content */
.timeline-content {
    flex: 1;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Timeline Time */
.timeline-time {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Stage Divider - for PIPELINE type */
.timeline-entry.stage-divider {
    padding: 12px 0;
    margin: 8px 0;
}

.timeline-entry.stage-divider .timeline-content {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =====================================================
   SEARCH GROUP - Perplexity-style Grouped Results
   ===================================================== */
.search-group {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-lighter);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.search-group.completed {
    opacity: 0.9;
}

.search-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.search-group-icon {
    font-size: 16px;
}

.search-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    padding-bottom: 7px;
}

.search-group-time {
    font-size: 11px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

/* Query Pills - Perplexity style */
.search-queries {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    /* Explicitly horizontal */
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* Force pills to be compact in the queries list */
.search-queries .source-item {
    width: auto;
    flex: 0 1 auto;
    /* Don't grow, shrink if needed */
    max-width: 300px;
    /* Optional cap to prevent super long urls from breaking layout */
    margin: 0;
}

.query-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.query-pill:hover {
    border-color: var(--primary-orange);
    background: rgba(255, 107, 53, 0.08);
    color: var(--primary-orange);
}

.query-pill.active {
    background: var(--primary-orange);
    color: white;
    border-color: var(--primary-orange);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.query-pill.active:hover {
    background: #e55a2b;
}

.markdown-body {
    padding: 0 15px 0 10px;
}

/* Consolidated with .message-content.markdown-body main blocks above */

.sort-icon {
    font-size: 10px;
    margin-left: 4px;
    color: var(--text-tertiary);
    user-select: none;
    display: inline-block;
    width: 12px;
    text-align: center;
}

th[onclick] {
    cursor: pointer;
    transition: background 0.2s;
}

th[onclick]:hover {
    background: rgba(0, 0, 0, 0.03) !important;
}

.query-icon {
    font-size: 15px;
    opacity: 0.7;
    padding: 0 5px 0 15px;
}

/* Sources Section */
.search-sources-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin: 12px 0 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-lighter);
}

.sources-count {
    font-size: 11px;
    color: var(--text-tertiary);
}

.search-sources {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--border-lighter);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.source-item:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.02);
}

.source-icon {
    font-size: 14px;
    opacity: 0.6;
}

.source-title {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-domain {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.source-item-text {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 0;
}

/* Search Notes */
.search-notes {
    margin-top: 8px;
}

.search-note {
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 2px 0;
}

/* Search Summary */
.search-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-lighter);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Legacy compatibility */
.step-card,
.log-card {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    max-width: 100%;
}

.step-title,
.log-content {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Sticky Progress Bar (Dynamic) */
.pipeline-progress.sticky {
    position: sticky;
    top: 0px;
    /* Offset for controls section */
    z-index: 90;
    background: #f8f9fa;
    /* Match log console bg */
    /* REMOVED NEGATIVE MARGINS */
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-lighter);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.visual-log-container {
    display: flex;
    gap: 15px;
}

.log-timeline {
    width: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d2d2d7;
    margin: 4px 0;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.timeline-dot.active {
    background: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.6);
    animation: pulse-dot 2s infinite;
}

.timeline-dot.success {
    background: #2ecc71;
}

.timeline-dot.warning {
    background: #f39c12;
}

.timeline-dot.error {
    background: #e74c3c;
}

.timeline-line {
    width: 2px;
    flex: 1;
    min-height: 20px;
    background: linear-gradient(to bottom, #d2d2d7, transparent);
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

.log-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-content {
    padding: var(--space-2xl);
}

.preferences-content {
    padding: var(--space-2xl);
}

.preferences-content-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-direction: column;
    padding-left: var(--space-2xl);
}

.log-content {
    padding: var(--space-2xl);
}

.log-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #d2d2d7;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

.log-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.log-card.info {
    border-left-color: #3498db;
}

.log-card.success {
    border-left-color: #2ecc71;
}

.log-card.warning {
    border-left-color: #f39c12;
}

.log-card.error {
    border-left-color: #e74c3c;
}

.log-card.step {
    border-left-color: #9b59b6;
    background: linear-gradient(135deg, #ffffff 0%, #f8f3ff 100%);
}

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

.card-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.card-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.95em;
    color: #2c3e50;
}

.card-time {
    color: #95a5a6;
    font-size: 0.85em;
    font-family: 'Consolas', monospace;
}

.card-body {
    color: #555;
    font-size: 0.9em;
    line-height: 1.5;
}

.card-summary {
    margin: 0;
}

.card-details {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85em;
    font-family: 'Consolas', monospace;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.card-details.expanded {
    max-height: 500px;
}

.toggle-details {
    margin-top: 8px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    color: #666;
    transition: all 0.2s;
}

.toggle-details:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.card-progress {
    margin-top: 10px;
    height: 4px;
    background: #ecf0f1;
    border-radius: 2px;
    overflow: hidden;
}

.card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.5s ease;
}

.metrics-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.metric-card {
    background: var(--bg-raised);
    padding: 10px 20px;
    border-radius: 12px;
    /*  standard */
    border: 1px solid var(--border-lighter);
    box-shadow: none;
    /*  often uses NO shadows */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s ease;
}

.metric-card:hover {
    border-color: var(--border-light);
    /* Just border darkens */
}

.metric-info {
    display: flex;
    flex-direction: column-reverse;
    /* Put label on top visually */
    gap: 2px;
    /* Reduced space between label and value */
}

.metric-value {
    font-size: 18px;
    /* Reduced from 24px */
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.3px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.metric-label {
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

.metric-icon {
    font-size: 24px;
    /* Reduced from 32px */
    opacity: 0.3;
}

/* ========================================
           PHASE-BASED LOG UI (-inspired)
           ======================================== */

/* Phase Headers - Minimal & Elegant */
.phase-header {
    background: var(--bg-raised);
    border-left: 3px solid var(--accent-primary);
    padding: var(--space-lg) var(--space-xl);
    border-radius: 12px;
    /*  standard */
    margin: var(--space-xl) 0 var(--space-md) 0;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    border: 1px solid var(--border-lighter);
    border-left-width: 3px;
    box-shadow: none;
    /* No shadow */
    animation: slideIn 0.2s ease;
    transition: all 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.phase-header.initialization {
    border-left-color: #6366f1;
}

.phase-header.research {
    border-left-color: #8b5cf6;
}

.phase-header.analysis {
    border-left-color: #3b82f6;
}

.phase-header.report {
    border-left-color: var(--success);
}

.phase-icon {
    font-size: 24px;
    flex-shrink: 0;
    filter: grayscale(20%) opacity(0.9);
}

.phase-info {
    flex: 1;
}

.phase-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.phase-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    font-weight: var(--font-weight-normal);
}

.phase-status {
    margin-left: auto;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.phase-status.active {
    color: #f97316;
}

.phase-status.completed {
    color: #10b981;
}

/* Step Cards -  Style */
.step-card {
    /*  standard */
    transition: all 0.15s ease;
}



.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

}

.step-number {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.step-title {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    flex: 1;
}

.step-status {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: var(--text-secondary);
}

.step-status.completed {
    color: var(--success);
}

.step-status.running {
    color: #f97316;
    animation: pulse-text 2s infinite;
}

@keyframes pulse-text {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.step-body {
    margin-top: 12px;
}

.step-description {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin-bottom: var(--space-md);
}

/* Badges */
.step-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* Badges -  Style (subtle tinted backgrounds) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    background: var(--bg-subtler);
    color: var(--text-secondary);
    border: 1px solid var(--border-lighter);
}

/* Badge Color Variations - Subtle Tints */
.badge-ai,
.badge-model {
    background: rgba(139, 92, 246, 0.08);
    color: rgb(109, 72, 206);
    border-color: rgba(139, 92, 246, 0.15);
}

.badge-tokens {
    background: rgba(245, 158, 11, 0.08);
    color: rgb(215, 138, 11);
    border-color: rgba(245, 158, 11, 0.15);
}

.badge-duration {
    background: rgba(99, 102, 241, 0.08);
    color: rgb(79, 82, 221);
    border-color: rgba(99, 102, 241, 0.15);
}

.badge-sources,
.badge-success {
    background: rgba(16, 185, 129, 0.08);
    color: rgb(14, 165, 115);
    border-color: rgba(16, 185, 129, 0.15);
}

.badge-company,
.badge-info {
    background: rgba(59, 130, 246, 0.08);
    color: rgb(49, 110, 216);
    border-color: rgba(59, 130, 246, 0.15);
}

/* Pipeline Progress */
.pipeline-progress {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.pipeline-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #6b7280;
}

.pipeline-progress-bar {
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}

.pipeline-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #fb923c);
    transition: width 0.5s ease;
    border-radius: 3px;
}

/* Collapsible Details */
.details-toggle {
    margin-top: 8px;
    padding: 6px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    color: #6b7280;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.details-toggle:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.toggle-icon {
    font-size: 0.7em;
    transition: transform 0.2s;
}

.toggle-icon.expanded {
    transform: rotate(90deg);
}

.details-content {
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 0.85em;
    font-family: 'Consolas', monospace;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.details-content.expanded {
    max-height: 600px;
    overflow-y: auto;
}

.model-output {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #374151;
}

/* Timeline Enhancements */
.timeline-phase-separator {
    width: 20px;
    height: 2px;
    background: #d1d5db;
    margin: 8px 0;
}

.timeline-dot.phase-initialization {
    background: #6366f1;
}

.timeline-dot.phase-research {
    background: #8b5cf6;
}

.timeline-dot.phase-analysis {
    background: #3b82f6;
}

.timeline-dot.phase-report {
    background: #10b981;
}

/* Tab Content */
.tab-content {
    animation: fadeIn 0.3s ease-in;
    display: flex;
    width: 100%;
    padding: 0;
    margin: 0;
    flex-direction: column;

}

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

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

/* Active Runs Table - Professional Style */
.runs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.runs-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-lighter);
}

.runs-table td {
    padding: 10px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-lighter);
}

.runs-table tr:last-child td {
    border-bottom: none;
}

/* Main Content Area adjustments */
.radar-full-screen {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(243, 243, 239, 0.95) 100%),
        url('assets/top3.png') center/cover no-repeat;
    background-size: cover;
    background-position: center;
}

.radar-chart-container {
    width: 90%;
    max-width: 900px;
    height: 80vh;
    /* Takes up most of the height */
    max-height: 800px;
    position: relative;
    z-index: 5;
    margin: 0 auto;
}

.radar-overlay-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through to chart if needed */
}

.score-display h1 {
    font-size: 3rem;
    font-weight: 800;
    margin: 0;
    color: var(--primary-orange);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.status-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 16px;
    background: #fff;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.radar-branding {
    position: absolute;
    bottom: 20px;
    right: 40px;
    text-align: right;

    z-index: 1001;
}

.branding-logo {
    height: 30px;
    margin-bottom: 5px;
}

.radar-branding p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}



/* =========================================
   NEW UI COMPONENTS (Web Fetch & Model)
   ========================================= */



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

/* Markdown Code Styles (Previously Model Content) */
.markdown-body code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e01e5a;
}

.markdown-body pre {
    background: #1e1e1e;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* HTML Code Preview Enhancements */
.code-preview-container {
    position: relative;
    margin: 16px 0;
}

.html-rendered-preview-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: var(--primary-orange, #ff6b35);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

.html-rendered-preview {
    max-width: 100%;
    overflow: hidden;
}

.html-rendered-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: white; /* Contrast for logos with transparent backgrounds */
    padding: 5px;
}


/* Consolidated & Premium Chat Markdown Styling */
.markdown-body {
    word-break: break-word;
    line-height: 1.6;
    color: var(--text-secondary);
}

.markdown-body p {
    margin: 12px 0;
    line-height: 1.6;
    font-weight: 300;
}

.markdown-body p strong {
    font-weight: 600;
}

/* Headings */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    margin: 24px 0 12px 0;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-body h2 {
    font-size: 1.4rem;
    font-weight: 700;
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.markdown-body h3 {
    font-size: 1.15rem;
    border-left: 3px solid var(--primary-orange);
    padding-left: 12px;
}

/* Tables (Premium Glassmorphism) */
.markdown-body table {
    width: 100%;
    max-width: 100%;
    display: table;
    margin: 20px 0;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--table-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--table-border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    overflow-x: auto;
    /* For responsiveness */
    backdrop-filter: blur(5px);
    box-shadow: var(--table-shadow, 0 4px 15px rgba(0, 0, 0, 0.2));
}

.markdown-body th {
    background: var(--table-header-bg, rgba(255, 255, 255, 0.1));
    color: var(--table-header-text, var(--text-light));
    padding: 12px 15px;
    font-weight: 600;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--table-border, rgba(255, 255, 255, 0.1));
    white-space: nowrap;
}

.markdown-body thead {
    width: 100%;
}

.markdown-body tbody {
    width: 100%;
}

.markdown-body tr {
    width: 100%;
}

.markdown-body td {
    padding: 12px 15px;
    font-size: 13px;
    color: var(--table-text, var(--text-dark));
    border-bottom: 1px solid var(--table-border, rgba(255, 255, 255, 0.05));
    line-height: 1.4;
    min-width: 120px;
}

.markdown-body tr:hover td {
    background: var(--table-row-hover, rgba(255, 255, 255, 0.02));
}

/* Lists */
.markdown-body ul,
.markdown-body ol {
    margin: 15px 0;
    padding-left: 24px;
}

.markdown-body li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Blockquote */
.markdown-body blockquote {
    border-left: 4px solid var(--primary-orange);
    background: rgba(255, 107, 53, 0.05);
    padding: 12px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.7));
}

/* Horizontal Rule */
.markdown-body hr {
    border: 0;
    border-top: 1px solid var(--border-light, rgba(255, 255, 255, 0.15));
    margin: 28px 0;
}

/* Code */
.markdown-body code {
    background: var(--bg-hover, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, #ffffff);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
}



/* Compact Validation Timeline (Grayscale Theme) */
.validation-timeline-box {
    position: relative;
    padding-left: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--border-lighter);
    padding-top: 12px;
}

.validation-timeline-box::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 18px;
    bottom: 8px;
    width: 1px;
    background: var(--border-lighter);
}

.validation-timeline-step {
    position: relative;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.validation-timeline-step:last-child {
    margin-bottom: 0;
}

.validation-timeline-dot {
    position: absolute;
    left: -16px;
    top: 5px;
    width: 7px;
    height: 7px;
    background: var(--text-light);
    /* Grayscale dot */
    border: 1.5px solid var(--white);
    border-radius: 50%;
    z-index: 1;
}

.validation-timeline-content {
    flex: 1;
    min-width: 0;
    /* Allow content to shrink and wrap */
}

.validation-timeline-time {
    font-size: 10px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    margin-left: 12px;
    white-space: nowrap;
    padding-top: 1px;
}

.validation-timeline-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.validation-timeline-json {
    margin: 4px 0 0 0;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.02);
    /* Grayscale subtle bg */
    border: 1px solid var(--border-lighter);
    padding: 8px;
    border-radius: 6px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* Login Page Styles */
.login-body {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.90) 0%, rgba(243, 243, 239, 0.90) 100%),
        url('assets/top3.png') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.login-card .logo {
    height: 50px;
    margin-bottom: 25px;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.login-card .subtitle {
    color: var(--text-gray);
    font-size: 15px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.login-card .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-card input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    background: var(--pure-white);
    color: var(--text-dark);
    transition: all 0.3s ease;
    font-family: inherit;
}

.login-card input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.login-card button {
    width: 100%;
    padding: 16px;
    background: var(--primary-orange);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.login-card button:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
}

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

.login-card button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.login-card .footer {
    margin-top: 30px;
    font-size: 12px;
    color: var(--text-gray);
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.login-card .error-msg {
    background: #fef2f2;
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 20px;
    display: none;
    border: 1px solid #fee2e2;
}

/* ========== PREFERENCES SIDEBAR LAYOUT ========== */
.pref-nav-section {
    margin-bottom: 24px;
    border-top: 1px solid var(--border-lighter);
    padding-top: 16px;
    z-index: 1200;
}

.pref-nav-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    padding-left: 12px;
}

.pref-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.pref-nav-item:hover {
    background: var(--bg-raised);
    /* Use theme var */
    color: var(--text-primary);
}

.pref-nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    /* Blue 50 equivalent */
    color: #3b82f6;
    /* Blue 500 */
}

.pref-nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

.pref-nav-item.active .pref-nav-icon {
    opacity: 1;
}

.pref-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.pref-section-block {
    margin-bottom: 32px;
    scroll-margin-top: 20px;
}

/* ========== PREFERENCES OVERRIDES (Process Queue Theme) ========== */

.preferences-content {
    /* Local variables based on Process Queue snippet */
    --bg-raised: #ffffff;
    --border-lighter: #e2e8f0;
    --text-secondary: #64748b;
    --text-primary: #0f172a;
    --text-tertiary: #94a3b8;
    --bg-main: #f8fafc;
    /* Page background override if needed */
    --bg-hover: #f1f5f9;

    --space-lg: 24px;
    --space-md: 16px;
    --font-size-sm: 13px;
    --pref-bg: var(--bg-raised);
    --pref-radius: 12px;
    display: block;
    height: calc(-60px + 100vh);
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-2xl) 0 0 0;
}

[data-theme="dark"] .preferences-content {
    --bg-raised: #1e293b;
    --border-lighter: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --bg-main: #0f172a;
    --bg-hover: #334155;
}

.preferences-content h2 {
    font-size: 20px;
    font-weight: 700;
}

.pref-main-content {
    flex: 1;
    padding: 20px 20px 200px 20px;
    scroll-behavior: smooth;
    display: block;
}

@media (min-width: 1024px) {
    .pref-main-content {
        column-count: 2;
        column-gap: 24px;
    }
}

/* Base Card Style matching Process Queue Widgets */
.preferences-content .pref-card {
    background: var(--pref-bg);
    padding: var(--space-lg);
    border-radius: var(--pref-radius);
    border: 1px solid var(--border-lighter);
    box-shadow: none;
    margin-bottom: 24px;
    display: inline-block;
    width: 100%;
    break-inside: avoid;
}

/* ── Channel Cards Grid ──────────────────────────── */
.channels-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.channels-grid::-webkit-scrollbar {
    height: 4px;
}

.channels-grid::-webkit-scrollbar-track {
    background: transparent;
}

.channels-grid::-webkit-scrollbar-thumb {
    background: var(--border-lighter);
    border-radius: 4px;
}

.channel-card {
    flex: 0 0 75px;
    min-width: 75px;
    border-radius: 12px;
    border: 2px solid var(--border-lighter);
    background: var(--bg-main);
    cursor: pointer;
    transition: all 0.2s ease;
    scroll-snap-align: start;
    overflow: hidden;
    height: 75px;
    /* Square icons */
}

.channel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

.channel-card.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), 0 4px 16px rgba(59, 130, 246, 0.15);
}

.channel-card-pic {
    position: relative;
    width: 100%;
    height: 100%;
    /* Fill the whole card */
    overflow: hidden;
    background: var(--border-lighter);
}

.channel-card-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.channel-card-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    /* Scaled down */
    font-weight: 700;
    color: var(--text-tertiary);
    background: var(--border-lighter);
}

/* Hide handle overlay and info for compact icon look */
.channel-card-handle-overlay,
.channel-card-info {
    display: none !important;
}

/* Name row with inline badges */
.channel-card-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.channel-card-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Inline badges (blue tick + crown) after name */
.channel-inline-badge {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── Profile Card ─────────────────────────────── */
#active-handle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.profile-inline-badge {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.profile-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-lighter);
}

.profile-detail-row:last-child {
    border-bottom: none;
}

.profile-detail-icon {
    color: var(--text-tertiary);
    flex-shrink: 0;
    margin-top: 1px;
}

.profile-detail-icon svg {
    display: block;
}

.profile-detail-label {
    font-size: 12px;
    color: var(--text-tertiary);
    min-width: 60px;
    flex-shrink: 0;
}

.profile-detail-value {
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.profile-detail-value.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

/* ── Dark mode overrides ── */
html[data-theme="dark"] .channel-card {
    background: #0f172a;
    border-color: #334155;
}

html[data-theme="dark"] .channel-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .channel-card-pic {
    background: #1e293b;
}

html[data-theme="dark"] .channel-card-avatar-fallback {
    background: #1e293b;
    color: #64748b;
}

/* Header style matching Process Queue Widget Headers */
.preferences-content .pref-card-header {
    margin: 0 0 var(--space-md) 0;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.preferences-content .pref-card-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.preferences-content .pref-nav-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    color: var(--text-tertiary);
    transition: color 0.15s;
}

.preferences-content .pref-nav-item:hover .pref-nav-icon {
    color: var(--text-primary);
}

.preferences-content .pref-nav-item.active .pref-nav-icon {
    color: inherit;
    /* Will take the active blue/primary color */
}

/* Sidebar styling to match context */
.preferences-content .pref-sidebar {
    background: var(--bg-main);
    border-right: 1px solid var(--border-lighter);
    display: flex;
    flex-direction: column;
    width: 260px;
    padding: 30px 20px;
    overflow-y: auto;
    height: calc(100vh - 100px);
    position: relative;
}

.preferences-content-div {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    padding: 20px;
}

.preferences-content-div a {
    text-decoration: none;
}

.preferences-content .pref-nav-item {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
    text-decoration: none;
}

.preferences-content .pref-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.preferences-content .pref-nav-item.active {
    background: #eff6ff;
    color: #3b82f6;
}

[data-theme="dark"] .preferences-content .pref-nav-item.active {
    background: rgba(59, 130, 246, 0.1);
}

/* Toggles and Rows */
.preferences-content .toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-lighter);
}

.preferences-content .toggle-row:last-child {
    border-bottom: none;
}

.preferences-content .toggle-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.preferences-content .toggle-desc {
    font-size: 10px;
    color: var(--text-tertiary);
    padding-left: 5px;
}

/* Pills matching Process Queue/Search style */
.preferences-content .pref-card {
    background: var(--bg-raised);
    border: 1px solid var(--border-lighter);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: inline-block;
    width: 100%;
    break-inside: avoid;
}

.preferences-content .query-pill {
    background: var(--bg-main);
    border: 1px solid var(--border-lighter);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.preferences-content .query-pill:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.preferences-content .query-pill.active {
    background: #eff6ff;
    color: #3b82f6;
    border-color: #bfdbfe;
    box-shadow: none;
}

[data-theme="dark"] .preferences-content .query-pill.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

/* Buttons */
.preferences-content .btn-secondary {
    border-radius: 6px;
    font-size: 12px;
    padding: 6px 12px;
}

/* iOS Toggle Switch - Scoped */
.preferences-content .toggle-switch {
    width: 40px;
    height: 22px;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.preferences-content .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.preferences-content .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .3s;
    border-radius: 24px;
}

.preferences-content .toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.preferences-content .toggle-switch input:checked+.toggle-slider {
    background-color: #3b82f6;
}

.preferences-content .toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(18px);
}

/* Radio Dot Selector (for mutually exclusive options) */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    cursor: pointer;
}

.radio-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: white;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radio-option.active .radio-dot {
    border-color: #3b82f6;
    background: #3b82f6;
}

.radio-option.active .radio-dot::after {
    content: "";
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.radio-option span {
    font-size: 14px;
    color: var(--text-secondary);
}

.radio-option.active span {
    color: var(--text-primary);
    font-weight: 500;
}

/* =====================================================
   LEAD DASHBOARD — Widget Cards, Table, Modal
   ===================================================== */

/* --- Widget Grid --- */
.lead-widgets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}


.lead-widget-card {
    background: var(--bg-raised, #fff);
    border: 1px solid var(--border-lighter, #e2e8f0);
    border-radius: 12px;
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    transition: all 0.15s ease;
    min-width: 0;
}

.lead-widget-card:hover {
    border-color: var(--border-light, #cbd5e1);
}

/* Top row: label + icon */
.lead-widget-card .widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.lead-widget-card .widget-label {
    font-size: 13px;
    color: var(--text-tertiary, #94a3b8);
    font-weight: 500;
}

.lead-widget-card .widget-icon {
    color: var(--text-tertiary, #94a3b8);
    opacity: 0.5;
    display: flex;
    align-items: center;
}

/* Big number */
.lead-widget-card .widget-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #111);
    line-height: 1;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

/* Mini chart area */
.lead-widget-card .widget-chart {
    height: 60px;
    width: 100%;
    position: relative;
    overflow: hidden;
    margin: 8px 0 4px;
    display: block;
}

.lead-widget-card .widget-chart svg {
    width: 100%;
    height: 100%;
}

/* Bottom pills / sub */
.lead-widget-card .widget-sub {
    font-size: 12px;
    color: var(--text-tertiary, #94a3b8);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.rich-run-card .sub-tag {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: none;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 10px;
}

/* Premium Circular Actions */
.action-btn-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-lighter);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    text-decoration: none;
    z-index: 300000;
}

.action-btn-circle:hover {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    background: #fffaf5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 126, 33, 0.1);
}

.action-btn-circle svg {
    display: block;
}

/* Chat Context Bar Styling */
.chat-context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff8f1;
    border: 1px solid #feeadd;
    border-radius: 8px;
    margin: 5px 4px;
    animation: slideIn 0.3s ease-out;
}

.context-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.context-label {
    color: var(--text-tertiary);
    font-weight: 500;
}

.context-lead-name {
    color: var(--primary-orange);
    font-weight: 600;
}

.chat-context-clear {
    background: transparent;
    border: none;
    padding: 4px;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-context-clear:hover {
    background: #feeadd;
    color: var(--primary-orange);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.lead-widget-card .widget-sub .sub-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.sub-tag.green {
    background: rgba(190, 229, 50, 0.2);
    color: #5a7a1a;
}

.sub-tag.orange {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.sub-tag.blue {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

/* --- Action Bar --- */
.lead-action-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.lead-collection-pills {
    display: flex;
    gap: 4px;
    border-radius: 10px;
}

.lead-collection-pills .pill {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary, #64748b);
    transition: all 0.15s ease;
}

.lead-collection-pills .pill.active {
    background: var(--bg-raised, #fff);
    color: var(--text-primary, #111);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.lead-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-lighter, #e2e8f0);
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary, #111);
    background: var(--bg-raised, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 14px center;
    transition: border-color 0.2s ease;
}

.lead-search-input:focus {
    outline: none;
    border-color: #bef032;
    box-shadow: 0 0 0 3px rgba(190, 229, 50, 0.15);
}

.lead-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--text-primary, #111);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.lead-add-btn:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --- Enhanced Lead Table --- */
.lead-table-container {
    background: var(--bg-raised, #fff);
    border: 1px solid var(--border-lighter, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
}

.standard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.standard-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary, #94a3b8);
    background: linear-gradient(180deg, #ffffff 0%, #fafafae0 100%);
    border-bottom: 1px solid var(--border-lighter, #e2e8f0);
    position: sticky;
    top: 0;
    z-index: 1;
}

.standard-table tbody tr {
    border-bottom: 1px solid var(--border-lighter, #f1f5f9);
    transition: background 0.1s ease;
}

.standard-table tbody tr:hover {
    background: rgba(190, 229, 50, 0.04);
}

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

.standard-table tbody td {
    padding: 14px 16px;
    color: var(--text-primary, #111);
    vertical-align: middle;
}

.standard-table .td-company {
    font-weight: 600;
    width: 30%;
}

.standard-table .td-mono {
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    font-size: 11px;
    width: 7%;
    color: var(--text-tertiary, #94a3b8);
}

.lead-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.lead-status-badge.processed {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.lead-status-badge.pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.lead-collection-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lead-collection-tag.scoremax {
    background: rgba(190, 229, 50, 0.2);
    color: #5a7a1a;
}

.lead-collection-tag.general {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

/* --- Lead Modal --- */
.lead-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.lead-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lead-modal {
    background: #fff;
    border-radius: 20px;
    width: 580px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
}

.lead-modal-overlay.active .lead-modal {
    transform: translateY(0) scale(1);
}

.lead-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-lighter, #e2e8f0);

    padding: 15px 20px 10px 25px;
    background: rgb(255 255 255 / 0%);
    backdrop-filter: blur(4px);
}

.lead-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.lead-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--bg-subtler, #f1f5f9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.lead-modal-close:hover {
    background: #e2e8f0;
}

.lead-form {
    padding: 24px 28px 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.lead-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lead-form .form-group.full-width {
    grid-column: 1 / -1;
}

.lead-form label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lead-form input,
.lead-form select {
    padding: 10px 14px;
    border: 1px solid var(--border-lighter, #e2e8f0);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary, #111);
    background: var(--bg-raised, #fff);
    transition: border-color 0.2s ease;
}

.lead-form input:focus,
.lead-form select:focus {
    outline: none;
    border-color: #bef032;
    box-shadow: 0 0 0 3px rgba(190, 229, 50, 0.15);
}

.lead-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-lighter, #e2e8f0);
    margin-top: 8px;
}

.lead-form-actions button {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.lead-form-actions .btn-cancel {
    background: var(--bg-subtler, #f1f5f9);
    color: var(--text-secondary, #64748b);
}

.lead-form-actions .btn-cancel:hover {
    background: #e2e8f0;
}

.lead-form-actions .btn-submit {
    background: var(--text-primary, #111);
    color: #fff;
}

.lead-form-actions .btn-submit:hover {
    background: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Table empty state */
.lead-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary, #94a3b8);
}

.lead-empty-state svg {
    opacity: 0.2;
    margin-bottom: 16px;
}

.lead-empty-state p {
    font-size: 14px;
    margin: 4px 0;
}

/* Lead table scroll container */
.lead-table-scroll {
    max-height: 42vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.close-action-button {
    display: none;
}

.mobileheaderoverlay {
    display: none;
}

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

.leads-content {
    padding: var(--space-2xl);
}

@media (max-width: 1200px) {
    .lead-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (hover:hover) {
    .feature2-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(255, 107, 53, 0.2);
        border-color: var(--primary-orange);
    }
}

/* Mobile Adjustments for Chat */
@media (max-width: 768px) {

    .standard-table tbody td {
        max-width: 25vw;
    }

    .panel-content {
        zoom: 0.75
    }

    .score-display {
        position: absolute;
        bottom: 60px;
        left: 20px;
        transform: none;
        text-align: left;
        z-index: 10;
    }

    .not-in-mobile {
        display: none;
    }

    .leads-content {
        padding: 50px 20px 100px 20px;
        overflow: auto;
    }

    .panel-header {
        padding: 15px 20px 10px 25px;
        background: rgb(255 255 255 / 0%);
        backdrop-filter: blur(4px);
    }


    .leads-content-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        margin-bottom: 24px;
        flex-direction: column;
        gap: 15px;
        padding: 50px 5px 0px 0px;
    }

    .mobileheaderoverlay {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        height: 70px;
        background: linear-gradient(180deg, #ffffff 0%, #fafafae0 100%);
        color: var(--text-secondary);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        white-space: nowrap;
        flex-shrink: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border: none;
        z-index: 1000;
        width: 100vw;
    }

    .scroll-bottom-btn {

        top: 21px;
        right: 80px;
        width: 36px;
        height: 36px;
    }

    .log-console {
        background: #f8f9fa;
        padding: 0 15px 0 25px;
        min-height: 200px;
        position: relative;
        overflow-x: hidden;
        overflow-y: auto;
        zoom: 0.75;
    }

    .radar-branding {
        position: fixed;
        bottom: auto;
        right: auto;
        text-align: right;
        z-index: 1001;
        left: 18px;
        top: 20px;
    }

    .process-queue-content {
        padding: 70px 0px 150px 0px !important;
    }

    .right-sidebar.open-in-mobile {
        right: 0px !important;
    }

    .right-sidebar.closed-in-mobile {
        right: -100vw !important;
    }

    .close-action-button {
        display: flex;
        position: fixed;
        top: 20px;
        right: 25px;
    }

    .dock-chat-container {
        padding: 0 10px 10px 10px;
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 10px));
        max-width: 100%;
    }

    #chat-sidebar-threads {
        padding-bottom: 50vh !important;
    }

    .right-sidebar {
        width: 100vw;
        padding: var(--space-md);
        background: rgb(248 249 250);
        backdrop-filter: blur(4px);
        border-left: 0;
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
        overflow-y: auto;
        flex-shrink: 0;
        position: fixed;
        right: -100vw;
        top: 0;
        bottom: 0;
        font-size: 0.9em;
        z-index: 100000;
        padding-top: 70px;
        padding-top: 70px;

    }

    .lead-widgets-grid {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .lead-widget-card {
        min-width: 80vw;
        padding: 12px !important;
    }

    .lead-widget-card .widget-value {
        font-size: 28px !important;
        margin-bottom: 4px !important;
    }

    .lead-widget-card .widget-chart {
        height: 40px !important;
        margin: 4px 0 !important;
    }

    .lead-widget-card .widget-sub {
        margin-top: 4px !important;
    }

    /* ── Leads action bar: one row on mobile ──────────── */
    .lead-action-bar {
        flex-wrap: nowrap !important;
        gap: 6px !important;
        margin-bottom: 12px !important;
    }

    .lead-search-input {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        font-size: 12px !important;
        padding: 8px 10px !important;
    }

    /* Refresh button: icon only */
    .lead-action-bar>.query-pill {
        font-size: 0px !important;
        padding: 8px !important;
        min-width: 34px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .lead-action-bar>.query-pill svg {
        width: 14px;
        height: 14px;
    }

    /* Pagination compact */
    #leads-pagination-top {
        gap: 4px !important;
        font-size: 11px !important;
        white-space: nowrap;
    }

    /* Leads table compact headers */
    .lead-table-container .standard-table th,
    .lead-table-container .standard-table td {
        font-size: 11px !important;
        padding: 8px 6px !important;
        white-space: nowrap;
    }

    /* Hide columns on mobile: checkbox(1), founder(3), source(5), logs(7), actions(10) */
    .lead-table-container .standard-table th:nth-child(1),
    .lead-table-container .standard-table td:nth-child(1),
    .lead-table-container .standard-table th:nth-child(3),
    .lead-table-container .standard-table td:nth-child(3),
    .lead-table-container .standard-table th:nth-child(5),
    .lead-table-container .standard-table td:nth-child(5),
    .lead-table-container .standard-table th:nth-child(7),
    .lead-table-container .standard-table td:nth-child(7),
    .lead-table-container .standard-table th:nth-child(10),
    .lead-table-container .standard-table td:nth-child(10) {
        display: none !important;
    }

    /* Company column: truncate long names */
    .lead-table-container .standard-table td.td-company {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .lead-table-container .standard-table td.td-company div {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Score column: hide progress bar, show only number */
    .lead-table-container .standard-table td:nth-child(4) div>div {
        display: none !important;
    }

    /* Date column: compact */
    .lead-table-container .standard-table td.td-mono {
        font-size: 10px !important;
    }

    .radar-chart-container {
        width: 100%;
        height: 100vh;
    }

    .nav-links {
        display: none;
    }

    header {
        padding: 100px 20px 40px;
    }

    main {
        padding: 20px 20px 60px;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

    .logos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .price-current {
        font-size: 48px;
    }

    .pro-founder-card {
        padding: 30px;
    }

    .badge {
        top: -10px;
        font-size: 12px;
        padding: 4px 12px;
    }

    .price-current {
        font-size: 44px;
    }

    .cases-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .case-card {
        padding: 30px;
    }

    .pillars-grid {
        display: flex;
        flex-direction: column;
    }

    .pillar-card {
        grid-column: auto;
    }

    /* Hero Sections */
    .hero {
        /* background: linear-gradient(135deg, var(--pure-white) 0%, var(--off-white) 100%);
            padding: 100px 0;
            text-align: center; */

        background:
            linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(250, 250, 250, 0.9) 100%),
            url('assets/top3.png') center/cover no-repeat;
        padding: 50px 0;
        text-align: center;
        background-attachment: fixed;
        /* gives subtle parallax */
    }

    .marginherotop {
        margin-top: 0;
    }

    .marginherotop .btn-primary {
        margin-bottom: 20px;
        margin-right: 0;

    }

    .marginherotop150 {
        margin-top: 0;
    }

    .hero h1 {
        font-size: clamp(40px, 6vw, 72px);
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 20px;
        letter-spacing: -0.02em;
        line-height: 1.1;
    }

    .hero .tagline {
        font-family: 'Pacifico', cursive;
        font-size: 24px;
        color: var(--primary-orange);
        margin-bottom: 30px;
    }

    .hero p {
        font-size: 14px;
        color: var(--text-gray);
        max-width: 700px;
        margin: 0 auto 20px;
        line-height: 1.6;
    }

    .nav-links {
        display: none;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .container {
        padding: 0 20px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .section-header h2 {
        font-size: 32px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .dash-nav-links {
        justify-content: flex-start;
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 10px;

    }

    .dash-nav-links.chat-active {
        margin-bottom: 5px !important;
    }

    /* Collapse secondary dock pills unless active/hovered */
    .dock-pill {
        width: 38px;
        /* Match height for perfect circle */
        padding: 0 !important;
        justify-content: center;
        overflow: hidden;
        white-space: nowrap;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .dock-pill span {
        display: none;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .dock-pill.active,
    .dock-pill:hover,
    .dock-select-pill {
        width: auto !important;
        padding: 0 16px !important;
        justify-content: flex-start;
    }

    .dock-pill.active span,
    .dock-pill:hover span,
    .dock-select-pill span {
        display: inline;
        opacity: 1;
        margin-left: 0;
    }

    .dock-select-pill {
        gap: 4px !important;
    }

    .dock-select-pill select {
        max-width: 80px;
        font-size: 11px !important;
    }


    .lead-side-panel {
        background: rgb(255 255 255 / 67%);
        backdrop-filter: blur(4px);
        height: 100dvh;
        width: 100vw;
    }

    .lead-modal-overlay {
        position: fixed;
        inset: 0;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        z-index: 2000;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
        padding-top: 5vh;
    }

    .lead-modal {
        background: #fff;
        border-radius: 20px;
        width: 580px;
        max-width: 92vw;
        max-height: 75vh;
        overflow-y: auto;
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
        transform: translateY(20px) scale(0.97);
        transition: transform 0.25s ease;
    }

    .chat-messages {
        max-width: 100vw;
        padding: 0;
        max-height: calc(100vh - 180px);
        padding-top: 50px;
        padding-bottom: 100px;
    }


    .message-content.user p {
        font-family: 'Montserrat';
    }

    .message-content p {
        margin: 0 0 12px 0;
    }

    .message-content li {
        margin-bottom: 6px;
    }

    .message-content ul,
    .message-content ol {
        padding-left: 20px;
    }

    .message-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        zoom: 0.85;
    }

    .preferences-content {
        display: flex;
        padding: 90px 0 0 0;
        overflow: auto;
        flex-direction: column;
    }

    .preferences-content-div {
        display: block;
        max-width: 100%;
        height: 100%;
        margin: 0 auto;
        padding: 10px;
    }

    .preferences-content-header {
        margin: 0;
    }

    .preferences-content .main-content {
        padding-top: 60px;
        width: 100%;
        height: auto;
    }

    .preferences-content .pref-sidebar {
        flex-direction: row;
        width: 100vw;
        height: auto;
        padding: 0 20px;
    }

    .signout-button {
        margin-left: auto;
    }

    .pref-nav-title {
        display: none;
    }

    .pref-nav-item span {
        display: none;
    }

    .pref-nav-section {
        display: flex;
        flex-direction: row;
        border-top: 0;
        padding-top: 25px;
    }

    /* ── Usage Section Mobile Fixes ──────────────────────── */
    .usage-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin: 14px 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .usage-stat-box {
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .usage-chart-container {
        height: 200px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .pref-card-header {
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 12px;
    }

    .pref-main-content {
        padding: 0 12px 180px 12px !important;
        overflow-x: hidden;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .pref-card {
        overflow-x: hidden;
        max-width: calc(100vw - 24px);
        box-sizing: border-box;
    }

    .preferences-content .pref-card table {
        width: 100% !important;
        table-layout: fixed;
    }

    /* Usage history filter row – compact on mobile */
    #card-usage .toggle-row>div {
        flex-wrap: wrap !important;
        flex-direction: row !important;
        gap: 8px !important;
        padding: 8px !important;
        align-items: center !important;
    }

    /* Hide "Start Date" / "End Date" labels */
    #card-usage .toggle-row>div>div>label {
        display: none !important;
    }

    /* Date inputs side by side, equal width */
    #card-usage .toggle-row>div>div {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        overflow: hidden;
        box-sizing: border-box;
    }

    #card-usage .toggle-row>div>div input[type="date"] {
        padding: 6px 4px !important;
        font-size: 11px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }

    /* Compact filter button */
    #card-usage .toggle-row>div>.query-pill {
        font-size: 0px !important;
        padding: 8px 12px !important;
        min-width: 36px;
    }

    #card-usage .toggle-row>div>.query-pill::before {
        content: "⏎";
        font-size: 14px;
    }

    /* Usage table: truncate long run IDs */
    #usage-log-table td:nth-child(2) {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #usage-log-table {
        font-size: 12px;
    }

    #usage-log-table th,
    #usage-log-table td {
        padding: 8px 6px !important;
    }
}

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

/* Chat Sidebar Styles */
.chat-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1051;
    display: flex;
    flex-direction: column;
}



.chat-sidebar.open {
    transform: translateX(0);
}

.chat-sidebar-threads {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    padding-bottom: 50vh;
    /* Firefox */
}

.chat-sidebar-threads::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.chat-thread-item {
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.3);
    /* Frosted glass look */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    min-height: 110px;
    min-width: 300px;
    zoom: 0.9;
}

.chat-thread-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
}

.chat-thread-body{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
    margin-bottom: 4px;
}

html[data-theme="dark"] .chat-thread-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .chat-thread-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}

.chat-thread-item.active {
    background: rgba(255, 107, 53, 0.12);
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 1px var(--primary-orange), 0 8px 24px rgba(255, 107, 53, 0.1);
}

html[data-theme="dark"] .chat-thread-item.active {
    background: rgba(255, 107, 53, 0.15);
    border-color: var(--primary-orange);
    box-shadow: 0 2px 12px rgba(255, 107, 53, 0.2);
}

.chat-thread-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--pure-white);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-thread-company{
    font-size: 10px;
    color: var(--primary-orange);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s ease;
}

.chat-thread-company:hover {
    color: var(--pure-white);
    text-decoration: underline;
}


html[data-theme="dark"] .chat-thread-title {
    color: var(--text-primary);
}

.chat-thread-preview {
    font-size: 11px;
    color: var(--off-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[data-theme="dark"] .chat-thread-preview {
    color: var(--text-secondary);
}

.chat-thread-date {
    font-size: 10px;
    color: var(--light-gray);
    opacity: 0.7;
    margin-top: 4px;
}

html[data-theme="dark"] .chat-thread-date {
    color: var(--dark-gray);
}

/* Chat Thread Internal Layout & Hover Reveals */
.chat-thread-header {
    display: flex;
    justify-content: start;
    align-items: start;
    flex-direction: column;
    width: 100%;
    
}

.chat-thread-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    gap: 4px;
}

.chat-thread-item:hover .chat-thread-actions {
    opacity: 1;
}

.thread-action-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 4px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.thread-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.thread-action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

html[data-theme="dark"] .thread-action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] .thread-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}



.chat-sidebar-toggle-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 4px;
}

.chat-sidebar-toggle-close:hover {
    color: var(--text-primary);
}


@media (max-width: 767px) {
    .mobile-only {
        display: block !important;
    }
}