/* Design System Variables */
:root {
    /* Colors */
    --bg: #F5F5F5;
    --chat-bg: #F5F5F5;
    --sidebar-bg: #F5F5F5;
    --primary: #0218DE;
    --accent: #6366F1;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --text: #111827;
    --text-strong: #0F172A;
    --text-default: #1F2937;
    --text-subtle: #6B7280;
    --border: #E5E7EB;
    --border-strong: #C7CCE5;
    --surface: #FFFFFF;
    --surface-muted: #F3F4F6;
    
    /* Typography */
    --font-family: 'SF Pro Text', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', monospace;
    --heading: 20px;
    --body: 15px;
    --small: 13px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Effects */
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius: 8px;
    --transition: all 0.2s ease;
}

@font-face {
    font-family: 'Atacama';
    src: url('../font/AtacamaTrial-VF.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* App Header */
.app-header {
    height: 60px;
    background: var(--chat-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    max-width: 1200px;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.logo-text {
    font-family: 'Trebuchet MS', 'Trebuchet', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif;
}

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

.nav-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.login-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid #E5E7EB;
}

.login-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.signup-btn {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.signup-btn:hover {
    background: #0016B8;
    border-color: #0016B8;
    transform: translateY(-1px);
}

.hero-title {
    font-family: 'Atacama', var(--font-family);
    font-variation-settings: 'wght' 700;
}

.logo-icon {
    font-size: 24px;
}

.user-profile {
    display: none;
}

/* Main Container Layout */
.app-container {
    display: flex;
    height: calc(100vh - 60px);
    overflow-x: hidden;
    max-width: 100vw;
}

/* Chat Container (full width now that sidebar is hidden) */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    min-width: 0;
    overflow: hidden;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-lg);
    scroll-behavior: smooth;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    max-width: 880px;
    margin: 0;
    margin-left: 0;
    margin-right: auto;
    width: 100%;
    gap: var(--space-md);
}

/* When hero is hidden, align messages to top */
.chat-messages .hero-section + * {
    margin-top: 0;
}

/* Message Styles */
.message {
    animation: fadeIn 0.3s ease;
    width: 100%;
}

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

.message.full-width {
    width: 100%;
}

.ai-message {
    position: relative;
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
}

.ai-message .avatar {
    display: none;
}

.ai-message .content {
    max-width: 100%;
    width: 100%;
    background: var(--chat-bg);
    border-radius: 12px;
    padding: 20px 24px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: left;
}

.ai-message.full-width .content {
    max-width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    text-align: left;
}

.user-message {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--space-md);
    width: 100%;
}

.user-message .content {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: right;
}

.user-message .avatar {
    display: none;
}

/* Loading Message */
.message.loading .content::after {
    content: '...';
    animation: dots 1.4s infinite;
}

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

/* Taxonomy Card */
.taxonomy-card {
    background: var(--chat-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-bottom: 12px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: 12px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.card-header .icon {
    font-size: 20px;
}

.card-body .description {
    color: var(--text-subtle);
    font-size: var(--small);
    margin-bottom: var(--space-sm);
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.tag {
    display: inline-block;
    background: #EEF2FF;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: var(--small);
}

.tag-more {
    color: var(--text-subtle);
    font-size: var(--small);
    padding: 4px 8px;
}

/* ==================== HERO SECTION ==================== */
.main-content-card {
    background: var(--chat-bg);
    margin: 40px auto;
    max-width: 800px;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.hero-section {
    text-align: center;
    padding: 44px 36px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 52px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 28px 0;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.hero-subtitle {
    font-size: 20px;
    color: #6B7280;
    margin: 0 0 8px 0;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
    font-family: 'Trebuchet MS', 'Trebuchet', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif;
}

.hero-description {
    font-size: 20px;
    color: #6B7280;
    margin: 0 0 12px 0;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0.005em;
    font-family: 'Trebuchet MS', 'Trebuchet', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif;
}

/* ==================== CTA BUTTONS ==================== */
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.cta-primary {
    background: #111827;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cta-primary:hover {
    background: #1F2937;
    transform: translateY(-1px);
}

.cta-secondary {
    background: var(--chat-bg);
    color: #374151;
    border: 1px solid #D1D5DB;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cta-secondary:hover {
    border-color: #9CA3AF;
    transform: translateY(-1px);
}

/* ==================== SEARCH INTERFACE ==================== */
.search-interface {
    width: 100%;
    transition: all 0.3s ease;
    padding: 16px 32px 24px;
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.search-interface.hidden {
    display: none !important;
}

        /* Initial positioning - right under hero section */
.search-interface.initial-position {
    width: 100%;
}

/* When chatbox is moved to bottom */
.search-interface.moved-to-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    max-width: none;
    width: 100%;
    z-index: 1000;
    background: var(--chat-bg);
    border-radius: 0;
    box-shadow: none;
}

.search-container {
    background: var(--chat-bg);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: none;
    overflow: hidden;
    transition: all 0.3s ease;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

/* When moved to bottom, adjust container styling */
.search-interface.moved-to-bottom .search-container {
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 20px 24px 16px;
    gap: 12px;
    border-bottom: 1px solid #F3F4F6;
}

.search-icon {
    color: #9CA3AF;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #111827;
    background: transparent;
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.5;
}

.search-input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

.search-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px 20px;
}

.search-mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #F3F4F6;
    color: #6B7280;
    position: relative;
}

.search-mode-btn.active {
    background: #0218DE;
    color: white;
}

.search-mode-btn:hover:not(.active) {
    background: #E5E7EB;
    color: #374151;
}

.shopify-connect-wrapper {
    position: relative;
}

.search-mode-btn.disabled {
    cursor: not-allowed;
    background: #F9FAFB;
    color: #D1D5DB;
    border: 1px solid #E5E7EB;
    pointer-events: none;
    position: relative;
    filter: grayscale(100%);
}

.search-mode-btn.disabled svg {
    opacity: 0.4;
}

.coming-soon-tag {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: white;
    background: #0218DE;
    border: 1px solid #0218DE;
    border-radius: 999px;
    padding: 2px 8px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(2, 24, 222, 0.3);
}




.new-badge {
    background: #0218DE;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.sample-size-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    margin-top: 4px;
    width: fit-content;
    margin-left: 24px;
    margin-right: auto;
}

.sample-size-selector label {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    margin: 0;
}

.sample-size-range {
    font-size: 11px;
    color: #6B7280;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    gap: 4px;
}

.max-products {
    display: inline-flex;
    align-items: flex-start;
    gap: 2px;
    font-weight: 600;
    font-family: var(--font-family);
    position: relative;
}

.citation-icon {
    display: inline-flex;
    align-items: flex-start;
    cursor: help;
    color: #9CA3AF;
    transition: color 0.2s ease;
    position: relative;
    margin-top: -2px;
    margin-left: 1px;
}

.citation-icon:hover {
    color: #0218DE;
}

.citation-icon svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.citation-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    max-width: 500px;
    white-space: normal;
    z-index: 1000;
    margin-bottom: 4px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.citation-icon:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    pointer-events: none;
}

.sample-size-selector select {
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 6px 12px;
    padding-right: 32px;
    background: #ffffff;
    color: #111827;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4L6 8L10 4' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.sample-size-selector select:focus {
    outline: none;
    border-color: #0218DE;
    box-shadow: 0 0 0 3px rgba(2, 24, 222, 0.1);
}

.sample-size-selector select:hover {
    border-color: #D1D5DB;
}

/* Edit Success Message */
.edit-success-message {
    padding: 16px 0;
    margin-bottom: 20px;
}

.edit-success-message h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.success-text {
    color: #10B981;
    font-size: 14px;
    margin: 0;
}

/* Edit Review Interface */
.edit-review {
    padding: 20px 0;
}

.edit-review-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
}

.edit-review-request {
    font-size: 15px;
    color: #374151;
    margin: 0 0 8px 0;
    font-style: italic;
}

.edit-review-instruction {
    font-size: 13px;
    color: #6B7280;
    margin: 0 0 20px 0;
}

.taxonomy-display {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.taxonomy-section.has-changes {
    border: 2px solid rgba(2, 24, 222, 0.2);
    border-radius: 8px;
    padding: 16px;
    background: rgba(2, 24, 222, 0.02);
}

.category-approval-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    cursor: pointer;
}

.category-approval-toggle-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0218DE;
}

.change-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.change-badge.change-added {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.change-badge.change-removed {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.change-badge.change-modified {
    background: rgba(2, 24, 222, 0.1);
    color: #0218DE;
}

.removed-values {
    display: block;
    font-size: 12px;
    color: #EF4444;
    margin-top: 4px;
    font-style: italic;
}

.taxonomy-label.added-value {
    border-left: 3px solid #10B981;
    background: rgba(16, 185, 129, 0.05);
}

.apply-metadata-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #F9FAFB;
    border-radius: 6px;
    margin: 20px 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.apply-metadata-toggle:hover {
    background: #F3F4F6;
}

.apply-metadata-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0218DE;
}

.apply-metadata-toggle span {
    font-size: 13px;
    color: #374151;
}

.edit-review-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.edit-review-actions .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-review-actions .btn-primary {
    background: #0218DE;
    color: white;
    border: none;
}

.edit-review-actions .btn-primary:hover {
    background: #0015B8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 24, 222, 0.3);
}

.edit-review-actions .btn-secondary {
    background: white;
    color: #6B7280;
    border: 2px solid #E5E7EB;
}

.edit-review-actions .btn-secondary:hover {
    border-color: #0218DE;
    color: #0218DE;
}

.search-action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: #F3F4F6;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: auto;
}

.search-action-btn:hover {
    background: #E5E7EB;
    color: #374151;
}

.search-action-btn.active {
    background: #0218DE;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(2, 24, 222, 0.3);
}

.search-action-btn.active:hover {
    background: #0015B8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(2, 24, 222, 0.4);
}

/* ==================== UPLOADED FILE CARD ==================== */
.uploaded-file-card {
    margin: 16px 0;
}

.file-card {
    background: var(--chat-bg);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e5e5e5;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.file-name {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    flex: 1;
}

.file-type-badge {
    background: #0218DE;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Thought Process Section */
.thought-process {
    background: var(--chat-bg);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin: var(--space-md) 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.thought-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #F5F5F5;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.thought-header:hover {
    background: #F5F5F5;
}

.thought-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.thought-arrow {
    color: #666;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.thought-process.collapsed .thought-arrow {
    transform: rotate(180deg);
}

.thought-content {
    padding: 16px;
    background: var(--chat-bg);
}

.thought-text {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.typing-indicator {
    color: #666;
    font-style: italic;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Sample Proposals */
.sample-proposals {
    margin: var(--space-md) 0;
}

.sample-proposals p {
    color: #333;
    font-size: 14px;
    margin-bottom: 12px;
}

.proposal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.proposal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.proposal-card:hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 16px 28px rgba(99, 102, 241, 0.14);
    transform: translateY(-2px);
}

.proposal-text {
    color: var(--text-default);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

/* Immediate Analysis */
.immediate-analysis {
    margin: var(--space-md) 0;
}

.analysis-intro {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.5;
}

.reading-message {
    color: #666;
    font-size: 14px;
    font-style: italic;
    margin: 16px 0;
    padding: 8px 0;
}

.upload-card {
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.upload-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-title {
    font-size: 19px;
    font-weight: 600;
    color: #111827;
}

.upload-description {
    font-size: 14px;
    color: #4B5563;
}

.search-tabs {
    display: inline-flex;
    gap: 8px;
    padding: 4px;
    background: #F3F4F6;
    border-radius: 999px;
    width: fit-content;
}

.tab-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: #111827;
    color: #FFFFFF;
}

.tab-btn:hover:not(.active) {
    background: rgba(17, 24, 39, 0.08);
}

.upload-mode {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    background: #F9FAFB;
}

.search-icon {
    color: #6B7280;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #111827;
    background: transparent;
    font-family: var(--font-family);
}

.search-input::placeholder {
    color: #9CA3AF;
}

.search-btn {
    background: #4338CA;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: #312E81;
}

.search-btn.ghost {
    background: transparent;
    color: #4338CA;
    border: 1px solid rgba(67, 56, 202, 0.35);
}

.search-btn.ghost:hover {
    background: rgba(67, 56, 202, 0.08);
}

.file-upload-group {
    display: flex;
    justify-content: flex-start;
}

.file-drop-area {
    border: 1px dashed rgba(67, 56, 202, 0.4);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    background: #FFFFFF;
    transition: border 0.2s ease, background 0.2s ease;
}

.file-drop-area:hover,
.file-drop-area.drag-over {
    border-color: #4338CA;
    background: rgba(67, 56, 202, 0.06);
}

.file-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

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

.file-drop-area h3 {
    margin: 0;
    font-size: 17px;
    color: #111827;
    font-weight: 600;
}

.file-drop-area p {
    margin: 0;
    font-size: 13px;
    color: #6B7280;
}

.drop-browse {
    margin-top: 6px;
    border: none;
    background: transparent;
    color: #4338CA;
    font-weight: 600;
    cursor: pointer;
}

/* Chat Input - Claude Style */
.chat-input {
    display: none;
    position: relative;
    padding: 20px 0;
    background: transparent;
    border: none;
    max-width: 70%;
    margin: 0 auto;
    width: 100%;
}

.chat-input.visible {
    display: block;
}

.chat-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--chat-bg);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.chat-input-container:focus-within {
    border-color: #0218DE;
    box-shadow: 0 0 0 3px rgba(2, 24, 222, 0.1);
}

.chat-input textarea {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    resize: none;
    min-height: 52px;
    max-height: 120px;
    transition: all 0.2s ease;
    background: transparent;
    line-height: 1.5;
    padding: 0;
    display: flex;
    align-items: center;
}

.chat-input textarea:focus {
    background: transparent;
}

.chat-input textarea::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

.send-btn {
    width: 40px;
    height: 40px;
    background: #F5F5F5;
    border: none;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.send-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.send-btn.active {
    background: #0218DE;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(2, 24, 222, 0.3);
}

.send-btn.active:hover {
    background: #0015B8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(2, 24, 222, 0.4);
}

.send-btn[disabled],
.send-btn[aria-disabled="true"] {
    background: #9CA3AF;
    color: #FFFFFF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-btn[disabled]:hover,
.send-btn[aria-disabled="true"]:hover {
    background: #9CA3AF;
    transform: none;
    box-shadow: none;
}

.chat-input[data-requires-auth="true"] textarea {
    cursor: pointer;
    color: #6B7280;
}

.chat-input[data-requires-auth="true"] textarea::placeholder {
    color: #9CA3AF;
}

.chat-input[data-requires-auth="true"] .send-btn {
    cursor: pointer;
}

/* Sidebar */
.sidebar {
    display: none;
}

.sidebar-section {
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Jobs List */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.job-item {
    background: var(--chat-bg);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.job-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

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

.job-item.draft .job-status {
    color: var(--text-subtle);
    font-style: italic;
}

/* Settings */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
}

.setting-label {
    color: var(--text-subtle);
    font-size: var(--small);
}

.setting-value {
    font-weight: 500;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.stat-card {
    background: var(--chat-bg);
    padding: var(--space-md);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: var(--small);
    color: var(--text-subtle);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

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

.btn-primary:hover {
    background: #4F46E5;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--chat-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

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

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

.btn-text {
    background: transparent;
    color: var(--primary);
    border: none;
    padding: 4px 8px;
}

.btn-text:hover {
    text-decoration: underline;
}

.icon-edit {
    display: block;
    stroke: currentColor;
}

.btn .icon-edit {
    width: 16px;
    height: 16px;
}

.edit-taxonomy-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 16px;
}

.edit-taxonomy-interface {
    padding: 0;
}

.edit-taxonomy-interface p {
    margin: 0 0 16px 0;
    color: #374151;
    font-size: 14px;
}

.edit-input-container {
    margin: 16px 0;
}

.edit-taxonomy-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 90px;
    background: white;
    color: #111827;
    transition: border-color 0.2s ease;
}

.edit-taxonomy-textarea:focus {
    outline: none;
    border-color: #0218DE;
    box-shadow: 0 0 0 3px rgba(2, 24, 222, 0.1);
}

.edit-taxonomy-textarea::placeholder {
    color: #9CA3AF;
}

.edit-taxonomy-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.edit-taxonomy-actions .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-taxonomy-actions .btn-primary {
    background: #0218DE;
    color: white;
    border: none;
}

.edit-taxonomy-actions .btn-primary:hover {
    background: #0015B8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 24, 222, 0.3);
}

.edit-taxonomy-actions .btn-secondary {
    background: white;
    color: #6B7280;
    border: 2px solid #E5E7EB;
}

.edit-taxonomy-actions .btn-secondary:hover {
    border-color: #0218DE;
    color: #0218DE;
}

.current-taxonomy-preview {
    margin-top: 24px;
    padding: 18px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.preview-title {
    margin: 0 0 14px 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-category {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
}

.category-name {
    font-weight: 500;
    color: #111827;
    margin-right: 8px;
    min-width: 120px;
}

.category-values {
    color: #6B7280;
    flex: 1;
}

.change-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.change-chip svg {
    width: 14px;
    height: 14px;
}

/* Sign-in Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.55);
    z-index: 2000;
    padding: 24px;
}

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

.modal-dialog {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px 28px;
    max-width: 400px;
    width: 100%;
    box-shadow: none;
    position: relative;
    border: 1px solid #f0f0f0;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #333;
    background: #f5f5f5;
}

#signInTitle {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.2;
    font-family: 'Atacama', var(--font-family);
    text-align: center;
}

.modal-subtitle {
    color: #666;
    margin: 0 0 16px 0;
    font-size: 16px;
    line-height: 1.4;
    font-family: 'Trebuchet MS', 'Trebuchet', sans-serif;
    font-weight: 400;
    text-align: center;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-form label {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.modal-form input {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px 18px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
    background: #fafafa;
    color: #333;
}

.modal-form input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(2, 24, 222, 0.1);
}

.modal-form input::placeholder {
    color: #999;
}

.modal-form button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 2px;
    width: 100%;
    text-align: center;
}

.modal-form button:hover {
    background: #0018B8;
    transform: translateY(-1px);
}

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

.modal-error {
    min-height: 18px;
    color: #ff3b30;
    font-size: 13px;
    text-align: left;
    margin-top: 8px;
}

body.modal-open {
    overflow: hidden;
}

/* ==================== TAXONOMY GRID LAYOUT ==================== */
.taxonomy-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.taxonomy-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid #D1D5DB;
    background: var(--chat-bg);
}

.category-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-right: 1px solid #D1D5DB;
    padding: 12px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 0;
    transition: background-color 0.2s;
    text-align: left;
}

.category-name:hover {
    background-color: #F3F4F6;
}

.category-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.category-edit-btn:hover {
    opacity: 1;
}

.category-description {
    font-size: 14px;
    color: var(--text-subtle);
    line-height: 1.4;
    cursor: pointer;
    padding: 8px;
    border-radius: 0;
    transition: background-color 0.2s;
    min-height: 20px;
    text-align: left;
}

.category-description:hover {
    background-color: #F3F4F6;
}

.category-actions {
    margin-top: 8px;
}

.enrich-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.enrich-btn:hover {
    background: #0218DE;
    transform: translateY(-1px);
}

.subcategories-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px;
}

.subcategories-header {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.subcategories-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    text-align: left;
}

.subcategories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subcategory-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--chat-bg);
    border: 1px solid #D1D5DB;
    border-radius: 0;
    position: relative;
    margin-bottom: 1px;
}
.category-metadata {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 6px 0 10px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    background: #eef2ff;
    color: #312e81;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-chip.subtle {
    background: #f3f4f6;
    color: #4b5563;
}

.category-definition-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.subcategory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.subcategory-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.subcategory-code {
    font-weight: 600;
    color: #4b5563;
}

.subcategory-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.empty-subcategories {
    padding: 12px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    background: #f9fafb;
}

.category-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 10px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    background: #eef2ff;
    color: #312e81;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-chip.subtle {
    background: #f3f4f6;
    color: #4b5563;
}

.category-definition-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.subcategory-header {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.subcategory-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.subcategory-code {
    font-weight: 600;
    color: #4b5563;
}

.subcategory-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.empty-subcategories {
    padding: 12px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    background: #f9fafb;
}

.subcategory-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 0;
    transition: background-color 0.2s;
    text-align: left;
}

.subcategory-name:hover {
    background-color: #F3F4F6;
}

.subcategory-edit-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.subcategory-edit-btn:hover {
    opacity: 1;
}

.subcategory-description {
    font-size: 12px;
    color: var(--text-subtle);
    line-height: 1.3;
    cursor: pointer;
    padding: 4px;
    border-radius: 0;
    transition: background-color 0.2s;
    min-height: 16px;
    text-align: left;
}

.subcategory-description:hover {
    background-color: #F3F4F6;
}

.subcategory-delete-btn {
    position: absolute;
    top: 8px;
    right: 28px;
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.subcategory-delete-btn:hover {
    opacity: 1;
}

.add-subcategory-btn {
    padding: 6px 10px;
    background: #f9fafb;
    color: #4b5563;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1px;
}

.add-subcategory-btn:hover {
    background: #e0f2fe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* ==================== CRITERIA LIST LAYOUT ==================== */


.criteria-item:hover {
    background: #FAFAFA;
}

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

.criteria-bar {
    width: 4px;
    flex-shrink: 0;
}

.criteria-bar-0 { background: #8B5CF6; } /* Purple */
.criteria-bar-1 { background: #F59E0B; } /* Orange */
.criteria-bar-2 { background: #3B82F6; } /* Blue */
.criteria-bar-3 { background: #EC4899; } /* Pink */
.criteria-bar-4 { background: #10B981; } /* Green */

.criteria-content {
    flex: 1;
    padding: 20px 24px;
}

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

.criteria-name {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.criteria-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.criteria-icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

.criteria-title-section {
    flex: 1;
}

.criteria-title-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    cursor: pointer;
    transition: color 0.2s;
}

.criteria-title-text:hover {
    color: var(--primary);
}

.criteria-subtitle-text {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
}

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

.criteria-delete-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.criteria-delete-btn:hover {
    background: #DC2626;
    color: white;
    border-color: #DC2626;
}

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


.criteria-description {
    color: #6B7280;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    cursor: pointer;
    transition: color 0.2s;
}

.criteria-description:hover {
    color: var(--primary);
}

.criteria-labels {
    margin-top: 16px;
}

.labels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.labels-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.selection-type-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F3F4F6;
    border-radius: 6px;
    padding: 2px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 500;
}

.toggle-label:hover {
    background: #E5E7EB;
}

.toggle-label input[type="radio"] {
    margin: 0;
    width: 12px;
    height: 12px;
}

.toggle-label input[type="radio"]:checked + .toggle-text {
    color: var(--primary);
    font-weight: 600;
}

.toggle-text {
    color: #6B7280;
    transition: color 0.2s;
}

.labels-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.labels-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.labels-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #EEF2FF;
    color: #312E81;
    border: 1px solid #C7D2FE;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.labels-add-btn:hover {
    background: #4F46E5;
    color: white;
    border-color: #4338CA;
}

.labels-add-icon {
    font-size: 12px;
}

.expand-labels-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #6B7280;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
}

.expand-labels-btn:hover {
    color: var(--primary);
}

.expand-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.labels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    transition: all 0.2s;
}

.label-item:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.label-name {
    cursor: pointer;
    transition: color 0.2s;
    font-weight: 500;
}

.label-name:hover {
    color: var(--primary);
}

.label-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.label-description {
    font-size: 11px;
    color: var(--text-subtle);
}

.label-item.is-editing {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border-color: #cbd5f5;
    box-shadow: 0 6px 18px -8px rgba(15, 23, 42, 0.25);
}

.label-inline-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.label-inline-editor .editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.label-inline-editor .editor-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label-inline-editor .editor-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: #64748b;
}

.label-inline-editor input,
.label-inline-editor textarea {
    width: 100%;
    border: 1px solid #cbd5f5;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    background: white;
    transition: border 0.2s, box-shadow 0.2s;
}

.label-inline-editor input:focus,
.label-inline-editor textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(2, 24, 222, 0.12);
}

.label-inline-editor textarea {
    min-height: 60px;
    resize: vertical;
}

.label-inline-editor .editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.label-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.label-edit-btn,
.label-delete-btn {
    background: none;
    border: none;
    color: #4B5563;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.label-delete-btn .label-delete-text {
    text-decoration: underline;
    font-size: 11px;
}

.label-edit-btn:hover {
    background: #3B82F6;
    color: white;
}

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

.label-delete-btn:hover {
    background: #EF4444;
    color: white;
}

.labels-more {
    display: none;
}

.labels-show-more {
    color: #6B7280;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
    margin-top: 8px;
}

.labels-show-more:hover {
    color: var(--primary);
}

/* ==================== INLINE EDITING ==================== */
.taxonomy-details.edit-mode .editable-field {
    cursor: pointer;
    position: relative;
    border: 1px dashed transparent;
    transition: all 0.2s;
}

.taxonomy-details.edit-mode .editable-field:hover {
    background-color: #F0F9FF;
    border-color: #0218DE;
    border-radius: 4px;
}

.taxonomy-details.edit-mode .editable-field::after {
    content: "✏️";
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.taxonomy-details.edit-mode .editable-field:hover::after {
    opacity: 1;
}

.inline-edit-input {
    width: 100%;
    padding: 4px 8px;
    border: 2px solid #0218DE;
    border-radius: 4px;
    font-size: inherit;
    font-weight: inherit;
    background: var(--chat-bg);
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 24, 222, 0.1);
}

/* ==================== THINKING INTERFACE ==================== */
.thinking-interface {
    background: #F9FAFB;
    border-radius: 8px;
    overflow: hidden;
    margin: 16px 0;
    border: 1px solid #E5E7EB;
    width: 100%;
    text-align: left;
    display: block;
    position: relative;
    left: 0;
    right: auto;
    margin-left: 0;
    margin-right: auto;
}

.thinking-interface.expanded {
    background: #F9FAFB;
    border-radius: 8px;
    overflow: hidden;
    margin: 16px 0;
    border: 1px solid #E5E7EB;
    width: 100%;
    text-align: left;
    display: block;
    position: relative;
    left: 0;
    right: auto;
    margin-left: 0;
    margin-right: auto;
}

/* Make thinking interface always expanded by default */
.thinking-interface {
    /* Force expanded state */
}

.thinking-interface .thinking-content {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
}

.thinking-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    gap: 12px;
}

.thinking-header:hover {
    background-color: #F3F4F6;
}

.thinking-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #6B7280;
}

.thinking-text {
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.thinking-time {
    color: #111827;
    font-weight: 600;
}

.thinking-chevron {
    color: #6B7280;
    font-size: 12px;
    transition: transform 0.2s;
}

.thinking-interface.expanded .thinking-chevron {
    transform: rotate(180deg);
}

.thinking-content {
    max-height: none !important;
    overflow: visible !important;
    transition: max-height 0.3s ease;
    background: #FFFFFF;
    display: block !important;
}

.thinking-interface.expanded .thinking-content {
    display: block;
    max-height: none;
}

.thinking-message {
    padding: 16px;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

/* ==================== ACTION TOOLBAR ==================== */
.action-buttons {
    margin-top: var(--space-sm);
}

.action-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F9FAFB;
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
}

.action-icon-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.action-icon-btn:hover {
    background: #F3F4F6;
    color: #374151;
}

.action-divider {
    width: 1px;
    height: 20px;
    background: #D1D5DB;
    margin: 0 4px;
}

.action-edit-btn {
    background: #0218DE;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-edit-btn:hover {
    background: #0015B8;
    transform: translateY(-1px);
}

/* Modern Results Table */
.results-table {
    width: 100%;
    background: var(--chat-bg);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    font-size: 14px;
}

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

.results-table thead {
    background-color: #f9fafb;
}

.results-table th {
    padding: 8px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.results-table tbody tr {
    background: var(--chat-bg);
    transition: background-color 0.15s ease;
}

.results-table tbody tr:hover {
    background-color: #f9fafb;
}

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

/* Product Table Cells */
.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-image {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.product-details {
    min-width: 0;
}

.product-name {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* Tag Pills */
.tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background-color: rgba(2, 24, 222, 0.1);
    color: #0218DE;
    font-size: 12px;
    font-weight: 500;
    border-radius: 999px;
    white-space: nowrap;
}

.tag-pill.secondary {
    background-color: #fee2e2;
    color: #dc2626;
}

.tag-pill.tertiary {
    background-color: #d1fae5;
    color: #059669;
}

.confidence {
    font-weight: 600;
}

.confidence.high {
    color: var(--success);
}

.confidence.medium {
    color: var(--warning);
}

.confidence.low {
    color: var(--error);
}

/* Progress Container */
.progress-container {
    padding: var(--space-lg);
}

.progress-container h3 {
    margin-bottom: var(--space-md);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    font-size: 14px;
}

.progress-details {
    display: flex;
    gap: var(--space-lg);
    font-size: var(--small);
    color: var(--text-subtle);
}

/* Success Message */
.success-message {
    text-align: center;
    padding: var(--space-lg);
}

.success-message h2 {
    color: var(--success);
    margin-bottom: var(--space-lg);
}

.success-subtext {
    font-size: 13px;
    color: var(--text-subtle);
    margin: 6px 0;
}

.success-subtext.error {
    color: #b91c1c;
}

/* Results Overlay */
.results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.results-container {
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    background: var(--chat-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.results-overlay.fullscreen-active {
    align-items: stretch;
    justify-content: stretch;
}

.results-container.fullscreen {
    width: 100%;
    max-width: none;
    height: 100%;
    border-radius: 0;
}

body.results-fullscreen {
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    gap: var(--space-md);
}

.results-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.results-header .fullscreen-btn,
.results-header .close-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-subtle);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
}

.results-header .fullscreen-btn:hover,
.results-header .close-btn:hover {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.toolbar-left {
    display: flex;
    gap: var(--space-sm);
}

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

.result-count {
    color: var(--text-subtle);
    font-size: 14px;
}

.results-summary-bar {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

.results-summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.summary-card {
    min-width: 160px;
    flex: 1;
    padding: var(--space-md);
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.summary-card-positive {
    border-color: rgba(46, 204, 113, 0.4);
    background: rgba(46, 204, 113, 0.08);
}

.summary-card-warn {
    border-color: rgba(241, 196, 15, 0.4);
    background: rgba(241, 196, 15, 0.08);
}

.summary-card-critical {
    border-color: rgba(231, 76, 60, 0.4);
    background: rgba(231, 76, 60, 0.08);
}

.summary-card-info {
    border-color: rgba(52, 152, 219, 0.4);
    background: rgba(52, 152, 219, 0.08);
}

.summary-value {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-strong);
}

.summary-label {
    font-size: 14px;
    color: var(--text-default);
    margin-top: 4px;
}

.summary-caption {
    font-size: 12px;
    color: var(--text-subtle);
    margin-top: 2px;
}

.quality-report-card {
    margin-top: var(--space-lg);
    background: linear-gradient(135deg, rgba(2, 24, 222, 0.08) 0%, rgba(2, 24, 222, 0.05) 100%);
    border: 1px solid rgba(2, 24, 222, 0.18);
    border-radius: 16px;
    padding: 20px 24px;
    color: var(--text-strong);
    box-shadow: 0 18px 32px rgba(2, 24, 222, 0.08);
}

.quality-report-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.quality-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(2, 24, 222, 0.15);
    color: #0218DE;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.quality-headline {
    font-size: 18px;
    font-weight: 600;
}

.quality-report-body {
    display: grid;
    gap: var(--space-md);
}

.quality-section h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-subtle);
}

.quality-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.55;
}

.quality-list-ordered {
    list-style: decimal;
}

.quality-notes {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.05);
    font-size: 12px;
    color: var(--text-subtle);
    line-height: 1.5;
}

.quality-report-wrapper {
    margin-top: var(--space-lg);
}

.results-limit-note {
    margin-top: var(--space-md);
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.18);
    font-size: 13px;
    color: var(--text-subtle);
}

.bucket-toggle-group {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.results-bucket-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-subtle);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.results-bucket-btn .bucket-label {
    font-weight: 500;
    color: var(--text-default);
}

.results-bucket-btn .bucket-count {
    font-size: 12px;
    color: var(--text-subtle);
}

.results-bucket-btn:hover:not(.disabled) {
    border-color: var(--border-strong);
    color: var(--text-default);
    background: var(--surface);
}

.results-bucket-btn.active {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent);
}

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

.results-search input {
    width: 230px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-default);
    transition: border-color 0.2s ease;
}

.results-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.results-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.results-table-head {
    display: grid;
    grid-template-columns: 70px minmax(220px, 2fr) minmax(260px, 2fr) 180px;
    padding: 12px var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.results-table-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.results-row {
    display: grid;
    grid-template-columns: 70px minmax(220px, 2fr) minmax(260px, 2fr) 180px;
    padding: 16px var(--space-lg);
    border-bottom: 1px solid var(--border);
    gap: var(--space-md);
    align-items: center;
    transition: background 0.2s ease;
}

.results-table-head .results-col-index,
.results-row .results-col-index {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 3;
}

.results-table-head .results-col-product,
.results-row .results-col-product {
    position: sticky;
    left: 70px;
    background: var(--surface);
    z-index: 2;
    box-shadow: 16px 0 24px -20px rgba(15, 23, 42, 0.25);
}

.results-row:hover .results-col-index,
.results-row:hover .results-col-product {
    background: rgba(99, 102, 241, 0.05);
}

.results-row:hover {
    background: rgba(99, 102, 241, 0.05);
}

.results-row-critical {
    background: rgba(231, 76, 60, 0.08);
}

.results-col-index {
    font-weight: 600;
    color: var(--text-subtle);
}

.results-product-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.results-product-card:hover .results-product-media {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.results-product-media {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.results-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.results-product-meta .product-name {
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 4px;
}

.results-product-meta .product-meta {
    font-size: 12px;
    color: var(--text-subtle);
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.product-actions .separator {
    color: var(--border-strong);
}

.text-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}

.text-btn:hover {
    color: var(--accent);
}

.category-pill-group,
.tag-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-default);
    font-size: 12px;
}

.category-pill-low {
    background: rgba(231, 76, 60, 0.12);
    color: #a33a2c;
}

.category-pill-override {
    border: 1px dashed rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.08);
}

.category-more {
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-size: 12px;
    color: var(--text-default);
}

.tag-pill-muted,
.tag-pill.muted {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-subtle);
}

.confidence-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px;
    border-radius: 12px;
    min-width: 140px;
    border: 1px solid transparent;
}

.confidence-badge .badge-icon {
    font-size: 18px;
}

.confidence-badge .badge-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-strong);
}

.confidence-badge .badge-label {
    font-size: 12px;
    color: var(--text-subtle);
}

.confidence-strong {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.4);
}

.confidence-needs_review {
    background: rgba(241, 196, 15, 0.12);
    border-color: rgba(241, 196, 15, 0.4);
}

.confidence-outlier {
    background: rgba(231, 76, 60, 0.12);
    border-color: rgba(231, 76, 60, 0.4);
}

.confidence-critical {
    box-shadow: inset 0 0 0 1px rgba(231, 76, 60, 0.6);
}

.results-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-subtle);
    gap: var(--space-sm);
}

.results-empty-state .empty-illustration {
    font-size: 32px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: var(--space-md);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-default);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-btn.active {
    background: var(--accent);
    color: #ffffff;
    border-color: transparent;
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: var(--text-subtle);
    font-size: 16px;
}

.image-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 40px;
}

.image-preview-dialog {
    background: var(--surface);
    border-radius: 16px;
    max-width: 920px;
    width: min(920px, 100%);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.35);
}

.image-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.image-preview-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.image-preview-close {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-subtle);
    border-radius: 6px;
    width: 32px;
    height: 32px;
}

.image-preview-close:hover {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.image-preview-body {
    padding: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 24px;
    align-items: start;
}

.image-preview-container {
    position: relative;
    overflow: auto;
    max-height: 60vh;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}

.preview-image-full {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    transition: transform 0.2s ease;
    display: block;
}

.preview-image-full.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

.image-preview-body img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
    background: #0f172a;
}

.no-image-preview {
    width: 100%;
    min-height: 360px;
    border-radius: 12px;
    background: var(--surface-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    font-size: 14px;
    font-weight: 500;
}

.image-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-preview-meta h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.image-preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.image-preview-tags .tag-pill {
    background: rgba(99, 102, 241, 0.1);
    border-color: transparent;
}

@media (max-width: 900px) {
    .image-preview-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .chat-container {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .sidebar {
        flex: none;
        height: 40vh;
    }
}

/* Taxonomy Criteria Styles */
.taxonomy-header {
    margin-bottom: var(--space-lg);
    text-align: left;
}

.taxonomy-source {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-subtle);
}

.taxonomy-response {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Taxonomy Summary */
.taxonomy-summary {
    margin-bottom: 24px;
}

.summary-box {
    background: var(--chat-bg);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.summary-text {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.category-highlight-list {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-highlight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 10px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 13px;
}

.category-highlight-item .highlight-name {
    font-weight: 600;
    color: #1f2937;
}

.category-highlight-item .highlight-meta {
    color: #6b7280;
    font-size: 12px;
}

.taxonomy-details {
    margin-top: 16px;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.expand-btn {
    background: #0218DE;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expand-btn:hover {
    background: #0015B8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(2, 24, 222, 0.3);
}

.taxonomy-header h3 {
    margin: 0 0 var(--space-sm) 0;
    color: var(--text);
}

.understanding {
    color: var(--text-subtle);
    font-size: var(--body);
    margin: 0;
    line-height: 1.5;
}

.taxonomy-criteria-container {
    margin: var(--space-lg) 0;
    background: var(--chat-bg);
    border-radius: var(--radius);
    overflow: hidden;
}

.criteria-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #F3F4F6;
    background: #FAFAFA;
}

.criteria-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.criteria-subtitle {
    color: #6B7280;
    font-size: 14px;
    margin: 0;
}

.criteria-list {
    padding: 0;
}

.criteria-item {
    display: flex;
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.2s ease;
    position: relative;
}

.criteria-item:hover {
    background: #FAFAFA;
}

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

.criteria-bar {
    width: 4px;
    flex-shrink: 0;
}

.criteria-bar-0 { background: #8B5CF6; } /* Purple */
.criteria-bar-1 { background: #F59E0B; } /* Orange */
.criteria-bar-2 { background: #3B82F6; } /* Blue */
.criteria-bar-3 { background: #EC4899; } /* Pink */
.criteria-bar-4 { background: #10B981; } /* Green */

.criteria-content {
    flex: 1;
    padding: 20px 24px;
}

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

.criteria-name {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.criteria-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.criteria-icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

.criteria-title-section {
    flex: 1;
}

.criteria-title-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    cursor: pointer;
    transition: color 0.2s;
}

.criteria-title-text:hover {
    color: var(--primary);
}

.criteria-subtitle-text {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
}

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

.criteria-description {
    color: #6B7280;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    cursor: pointer;
    transition: color 0.2s;
}

.criteria-description:hover {
    color: var(--primary);
}

.criteria-labels {
    margin-top: 16px;
}

.labels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.labels-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.labels-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.labels-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #EEF2FF;
    color: #312E81;
    border: 1px solid #C7D2FE;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.labels-add-btn:hover {
    background: #4F46E5;
    color: white;
    border-color: #4338CA;
}

.labels-add-icon {
    font-size: 12px;
}

.expand-labels-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #6B7280;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
}

.expand-labels-btn:hover {
    color: var(--primary);
}

.expand-icon {
    font-size: 10px;
}

.labels-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.label-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    transition: all 0.2s;
}

.label-item:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.label-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #F3F4F6;
    color: #374151;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #E5E7EB;
    transition: all 0.2s;
}

.label-chip:hover {
    background: #E5E7EB;
    border-color: #D1D5DB;
}

.label-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.label-edit-btn,
.label-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4B5563;
}

.label-edit-btn:hover {
    background: #3B82F6;
    color: #ffffff;
}

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

.label-delete-btn .label-delete-text {
    text-decoration: underline;
    font-size: 11px;
}

.label-delete-btn:hover {
    background: #EF4444;
    color: #ffffff;
}

.more-indicator {
    color: #6B7280;
    font-size: 11px;
    font-style: italic;
    padding: 6px 10px;
    background: #F9FAFB;
    border-radius: 16px;
    border: 1px dashed #D1D5DB;
}

.labels-expanded {
    margin-top: 12px;
    padding: 16px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

.labels-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.label-item-expanded {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--chat-bg);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

.label-details {
    flex: 1;
    min-width: 0;
}

.label-value {
    font-size: 10px;
    color: #6B7280;
    font-family: var(--font-mono);
    background: #F3F4F6;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 4px;
}

.label-description {
    font-size: 11px;
    color: #6B7280;
    margin-top: 4px;
    line-height: 1.3;
}

.add-label-btn {
    background: #F3F4F6;
    border: 1px dashed #9CA3AF;
    color: #6B7280;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
}

.add-label-btn:hover {
    background: #E5E7EB;
    border-color: #6B7280;
    color: #374151;
}

.taxonomy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.taxonomy-table thead {
    background: #F8FAFC;
}

.taxonomy-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #E5E7EB;
    white-space: nowrap;
}

.taxonomy-table th svg {
    margin-right: 6px;
    vertical-align: middle;
}

.taxonomy-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: top;
}

.taxonomy-row:hover {
    background: rgba(99, 102, 241, 0.02);
}

.taxonomy-row:last-child td {
    border-bottom: none;
}

/* Category Cell */
.category-cell {
    min-width: 200px;
}

.category-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.category-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.category-details {
    flex: 1;
    min-width: 0;
}

.category-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    cursor: pointer;
    transition: color 0.2s;
}

.category-name:hover {
    color: var(--primary);
}

.category-id {
    font-size: 11px;
    color: #9CA3AF;
    font-family: var(--font-mono);
    background: #F3F4F6;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 4px;
}

/* Type Cell */
.type-cell {
    min-width: 100px;
}

.category-type {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    text-transform: capitalize;
    background: #EEF2FF;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Labels Cell */
.labels-cell {
    min-width: 250px;
}

.labels-container {
    position: relative;
}

.labels-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.label-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #F3F4F6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #E5E7EB;
    transition: all 0.2s;
}

.label-chip:hover {
    background: #E5E7EB;
    border-color: #D1D5DB;
}

.label-edit-btn, .label-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 2px;
    font-size: 10px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.label-edit-btn:hover {
    background: #3B82F6;
    color: white;
    opacity: 1;
}

.label-delete-btn:hover {
    background: #EF4444;
    color: white;
    opacity: 1;
}

.more-indicator {
    color: #6B7280;
    font-size: 11px;
    font-style: italic;
    padding: 4px 8px;
}

.expand-labels-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6B7280;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.expand-labels-btn:hover {
    background: #F3F4F6;
    color: var(--primary);
}

.expand-icon {
    font-size: 10px;
    margin-right: 4px;
}

.labels-expanded {
    margin-top: 12px;
    padding: 12px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
}

.labels-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.label-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--chat-bg);
    border: 1px solid #E5E7EB;
    border-radius: 6px;
}

.label-details {
    flex: 1;
    min-width: 0;
}

.label-value {
    font-size: 10px;
    color: #6B7280;
    font-family: var(--font-mono);
    background: #F3F4F6;
    padding: 2px 4px;
    border-radius: 2px;
    display: inline-block;
    margin-top: 2px;
}

.label-description {
    font-size: 11px;
    color: #6B7280;
    margin-top: 4px;
    line-height: 1.3;
}

.add-label-btn {
    background: #F3F4F6;
    border: 1px dashed #9CA3AF;
    color: #6B7280;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    width: 100%;
}

.add-label-btn:hover {
    background: #E5E7EB;
    border-color: #6B7280;
    color: #374151;
}

/* Description Cell */
.description-cell {
    min-width: 200px;
}

.category-description {
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.2s;
}

.category-description:hover {
    color: var(--primary);
}

/* Actions Cell */
.actions-cell {
    min-width: 120px;
    text-align: center;
}

.enrich-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.enrich-button:hover {
    background: #4F46E5;
    transform: translateY(-1px);
}

.enrich-button:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
    transform: none;
}

.enrich-button svg {
    width: 14px;
    height: 14px;
}

/* Editable Fields */
.editable-field {
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.editable-field:hover {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.editable-field:hover::after {
    content: "✏️";
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.6;
}

/* Inline Edit Input */
.inline-edit-input {
    width: 100%;
    border: 2px solid var(--primary);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: inherit;
    font-family: inherit;
    background: var(--chat-bg);
    outline: none;
}

.inline-edit-save, .inline-edit-cancel {
    margin-left: 4px;
    padding: 2px 6px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
}

.inline-edit-save {
    background: var(--primary);
    color: white;
}

.inline-edit-cancel {
    background: #6B7280;
    color: white;
}

/* Enrichment Modal */
.enrichment-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.suggestion-item:hover {
    background: #F9FAFB;
    border-color: var(--primary);
}

.suggestion-item input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.1);
}

/* Label Edit Modal */
.label-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}


/* Responsive */
@media (max-width: 768px) {
    .taxonomy-table-container {
        margin: var(--space-md) 0;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
    }
    
    .category-cell {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .category-info {
        flex-direction: row;
        align-items: center;
    }
    
    .category-icon {
        font-size: 20px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
/* Thinking/Reasoning Section */
.thinking-section {
    margin: var(--space-md) 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--sidebar-bg);
    overflow: hidden;
}

.thinking-toggle {
    width: 100%;
    padding: var(--space-md);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: var(--small);
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.thinking-toggle:hover {
    background: rgba(0,0,0,0.02);
}

.toggle-icon {
    margin-right: var(--space-sm);
    font-size: 10px;
    transition: transform 0.2s ease;
}

.thinking-content {
    padding: 0 var(--space-md) var(--space-md);
    border-top: 1px solid var(--border);
}

.thinking-block {
    margin-top: var(--space-md);
}

.thinking-block h4 {
    font-size: var(--small);
    font-weight: 600;
    color: var(--text-subtle);
    margin-bottom: var(--space-xs);
}

.thinking-block p {
    font-size: var(--small);
    color: var(--text);
    line-height: 1.5;
}

.taxonomy-hints-card {
    margin-top: var(--space-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: var(--space-xl);
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.taxonomy-hints-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
}

.taxonomy-hints-heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 560px;
}

.taxonomy-hints-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-subtle);
}

.taxonomy-hints-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-strong);
}

.taxonomy-hints-subtitle {
    margin: 0;
    color: var(--text-subtle);
    font-size: 14px;
    line-height: 1.6;
}

.taxonomy-hints-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: var(--surface-muted);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-subtle);
}

.taxonomy-hints-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
}

.taxonomy-hint-section {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.taxonomy-hint-section h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-strong);
}

.taxonomy-hint-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.taxonomy-hint-section ul li {
    position: relative;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-subtle);
}

.taxonomy-hint-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.4);
}

.taxonomy-hint-section p {
    font-size: 13px;
    color: var(--text-subtle);
    margin: 0;
}

.taxonomy-hints-actions {
    display: grid;
    gap: var(--space-lg);
}

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

.strategy-heading {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
    font-weight: 600;
}

@media (min-width: 900px) {
    .taxonomy-hints-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: flex-start;
    }
}

/* Methodology accordion */
.taxonomy-methodology {
    margin: 20px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.methodology-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-strong);
}

.methodology-toggle:hover {
    background: rgba(99, 102, 241, 0.08);
}

.methodology-toggle-icon {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.methodology-toggle.open .methodology-toggle-icon {
    transform: rotate(45deg);
}

.methodology-panel {
    display: none;
    border-top: 1px solid var(--border);
    padding: 18px;
    background: var(--surface);
}

.methodology-panel.open {
    display: block;
}

.methodology-intro {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--text-subtle);
}

.methodology-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--text-default);
}

.methodology-list li strong {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.step-content h5 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.step-content p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.taxonomy-strategy-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 0;
}

.strategy-btn {
    flex: 1 1 200px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-strong);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.strategy-btn:hover,
.strategy-btn:focus {
    background: #0218DE;
    border-color: #0218DE;
    color: white;
    box-shadow: 0 4px 12px rgba(2, 24, 222, 0.3);
}

.strategy-btn:active {
    transform: translateY(1px);
}

.strategy-btn.active {
    background: #0218DE;
    border-color: #0218DE;
    color: white;
    box-shadow: 0 4px 12px rgba(2, 24, 222, 0.3);
}

.scrape-progress {
    margin-top: 16px;
    background: var(--chat-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.final-results-card {
    margin-top: 20px;
    padding: 24px;
    background: var(--chat-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

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

.final-results-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #dcfce7;
    color: #15803d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
}

.final-results-subtitle {
    margin: 4px 0 0;
    color: var(--text-subtle);
    font-size: 14px;
}

.final-results-summary {
    margin: 20px 0;
}

.final-results-card .analytics-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.final-results-card .analytics-label {
    margin-bottom: 4px;
}

.final-results-card .analytics-detail {
    margin-top: 4px;
    color: #4b5563;
}

.final-results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.final-results-actions .btn {
    flex: 1;
    min-width: 180px;
}

.btn-disabled {
    position: relative;
    cursor: not-allowed;
    opacity: 0.75;
    background: #e5e7eb;
    color: #6b7280;
    border-color: #d1d5db;
}

.btn-disabled .btn-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: #000000;
    color: white;
    border: 1px solid #000000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    line-height: 1.2;
}

.btn-disabled:hover,
.btn-disabled:focus {
    opacity: 0.75;
    background: #e5e7eb;
    color: #6b7280;
    border-color: #d1d5db;
}

.btn-disabled .btn-label {
    display: inline-flex;
    align-items: center;
}

.accuracy-summary {
    margin-top: 24px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, rgba(99, 102, 241, 0.02) 100%);
}

.accuracy-summary h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-strong);
}

.accuracy-summary-lede {
    margin: 0 0 14px 0;
    color: #4b5563;
    font-size: 13px;
}

.accuracy-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accuracy-bar {
    display: grid;
    grid-template-columns: 160px 1fr 80px;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.accuracy-bar .bar-label {
    color: #4b5563;
    font-weight: 500;
}

.accuracy-bar .bar-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(203, 213, 225, 0.6);
    overflow: hidden;
}

.accuracy-bar .bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.accuracy-bar .bar-fill.high {
    background: linear-gradient(90deg, #10b981 0%, #22c55e 100%);
}

.accuracy-bar .bar-fill.medium {
    background: linear-gradient(90deg, #f97316 0%, #facc15 100%);
}

.accuracy-bar .bar-fill.low {
    background: linear-gradient(90deg, #f87171 0%, #ef4444 100%);
}

.accuracy-bar .bar-value {
    text-align: right;
    font-weight: 600;
    color: #1f2937;
}

.accuracy-summary + .final-results-actions,
.model-performance-summary + .final-results-actions {
    margin-top: 20px;
}

.model-performance-summary {
    margin-top: 24px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 20px 20px 16px;
}

.analytics-headline {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
}

.analytics-headline strong {
    color: #111827;
}

.model-performance-summary h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-strong);
}

.model-performance-lede {
    margin: 0 0 14px 0;
    font-size: 13px;
    color: #4b5563;
}

.table-scroll {
    overflow-x: auto;
}

.model-performance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.model-performance-table th,
.model-performance-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    white-space: nowrap;
}

.model-performance-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    background: rgba(148, 163, 184, 0.12);
}

.model-performance-table tbody tr:last-child td {
    border-bottom: none;
}

.model-performance-table .aggregate-row td {
    font-weight: 600;
    background: rgba(99, 102, 241, 0.08);
}

.classification-progress-card {
    margin-top: 20px;
    padding: 26px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: var(--text);
    position: relative;
}

.classification-progress-card .progress-card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.classification-progress-card .progress-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 4px;
    color: #4b5563;
    font-size: 13px;
}

.classification-progress-card .progress-eta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    color: #3730a3;
    font-weight: 500;
}

.classification-progress-card .progress-eyebrow {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: #6b7280;
    font-weight: 600;
}

.classification-progress-card h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-strong);
}

.classification-progress-card p {
    margin: 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

.classification-progress-card .progress-chip {
    align-self: flex-start;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 600;
}

.progress-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-checklist + .progress-timeline {
    margin-top: 8px;
}

.progress-timeline {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.18) 0%, rgba(99, 102, 241, 0.08) 100%);
    overflow: hidden;
    position: relative;
    margin-bottom: 6px;
}

.progress-timeline .progress-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6366F1 0%, #A855F7 100%);
    width: 0;
    transition: width 0.6s ease;
}

.progress-timeline .progress-glow {
    position: absolute;
    top: -8px;
    right: -10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.25);
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.45);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.progress-checklist .progress-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 14px;
    color: #4b5563;
}

.progress-checklist .progress-item.status-done {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.28);
    color: #047857;
}

.progress-checklist .progress-item.status-active {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.35);
    color: #1d4ed8;
    font-weight: 600;
}

.progress-checklist .progress-item.status-pending {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.18);
    color: #6b7280;
}

.progress-checklist .progress-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.55);
    color: #f8fafc;
}

.progress-checklist .status-done .progress-icon {
    background: linear-gradient(135deg, #10b981 0%, #22c55e 100%);
    color: #ffffff;
}

.progress-checklist .status-active .progress-icon {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #eff6ff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

.progress-checklist .status-pending .progress-icon {
    background: rgba(148, 163, 184, 0.45);
    color: #0b1220;
}

.review-selection-toolbar {
    margin: 16px 0;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.review-selection-toolbar .review-count {
    font-weight: 500;
    color: var(--text-subtle);
}

.review-selection-toolbar .toolbar-actions {
    display: flex;
    gap: 8px;
}

.preview-category-cell.selected-for-review {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.6);
    background: #eef2ff !important;
}

.scrape-steps {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eceefc;
    color: #312e81;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.progress-step .step-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #4338ca;
    color: #ffffff;
    font-weight: 600;
    font-size: 12px;
}

.progress-step.done {
    background: #dcfce7;
    color: #166534;
}

.progress-step.done .step-indicator {
    background: #16a34a;
}

.progress-step.active {
    background: #dbeafe;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.progress-step.active .step-indicator {
    background: #1d4ed8;
}

.progress-step.error {
    background: #fee2e2;
    color: #b91c1c;
}

.progress-step.error .step-indicator {
    background: #dc2626;
}

.progress-step.pending {
    opacity: 0.6;
}

.scrape-progress-status {
    margin: 0;
    font-size: 13px;
    color: var(--text-subtle);
}

/* Header Selection Interface */
.header-selection {
    background: var(--chat-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}

.header-selection h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.header-selection p {
    font-size: 14px;
    color: var(--text-subtle);
    margin: 0 0 16px 0;
}

.header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.header-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-option:hover {
    border-color: var(--primary);
    background: #f0f4ff;
}

.header-option.selected {
    border-color: var(--primary);
    background: #e0f2fe;
    color: var(--primary);
}

.header-option input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.header-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.header-actions button {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-actions .btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.header-actions .btn-secondary:hover {
    background: #e2e8f0;
}

.header-actions .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.header-actions .btn-primary:hover {
    background: #0015B8;
}

.header-actions .btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Checklist/Todo List Styling */
.todo-list {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.todo-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.todo-list-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.todo-list-icon {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

.todo-list-count {
    background: #e5e7eb;
    color: #374151;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.todo-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.todo-checkbox:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.todo-checkbox.checked {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.todo-checkbox.checked::after {
    content: '✓';
    font-size: 12px;
    font-weight: bold;
}

.todo-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    cursor: pointer;
    padding: 2px 0;
}

.todo-text.completed {
    text-decoration: line-through;
    color: #9ca3af;
}

.todo-status {
    font-size: 12px;
    color: #6b7280;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f3f4f6;
}

.todo-status.completed {
    background: #dcfce7;
    color: #166534;
}

.todo-status.in-progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.todo-status.pending {
    background: #fef3c7;
    color: #92400e;
}

/* Inline Editing for Taxonomy Sections */
.taxonomy-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    transition: all 0.2s ease;
}

.taxonomy-section:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.taxonomy-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.taxonomy-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    color: #374151;
}

.taxonomy-section-meta {
    font-size: 12px;
    color: #6b7280;
    margin-left: 8px;
}

.taxonomy-section-actions {
    display: flex;
    gap: 8px;
}

.taxonomy-action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid;
}

.taxonomy-action-btn.delete {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.taxonomy-action-btn.delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.taxonomy-action-btn.enrich {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0284c7;
}

.taxonomy-action-btn.enrich:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.taxonomy-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
}

.taxonomy-labels-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.taxonomy-labels-title {
    font-weight: 500;
    font-size: 14px;
    color: #374151;
}

.selection-type-toggle {
    display: flex;
    gap: 8px;
    align-items: center;
}

.selection-type-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.selection-type-option:hover {
    background: #f1f5f9;
}

.selection-type-option input[type="radio"] {
    margin: 0;
    width: 14px;
    height: 14px;
    accent-color: #3b82f6;
}

.selection-type-option label {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.taxonomy-labels-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.taxonomy-label {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #0369a1;
    transition: all 0.2s ease;
}

.taxonomy-label:hover {
    background: #bae6fd;
    border-color: #7dd3fc;
}

.taxonomy-label-edit {
    width: 14px;
    height: 14px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.taxonomy-label-edit:hover {
    opacity: 1;
}

.taxonomy-label-delete {
    width: 14px;
    height: 14px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.taxonomy-label-delete:hover {
    opacity: 1;
}

.add-label-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-label-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Inline Edit States */
.taxonomy-label.editing {
    background: white;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.taxonomy-label input[type="text"] {
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: #0369a1;
    outline: none;
    width: 100%;
    min-width: 60px;
}

.taxonomy-label input[type="text"]:focus {
    outline: none;
}

/* Streamlined Scrape Success Design */
.scrape-success-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    transition: all 0.2s ease;
}

.scrape-success-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.scrape-success-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.scrape-success-title h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.scrape-success-title p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.scrape-success-content {
    margin-top: 16px;
}

.scrape-success-description {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

.scrape-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.suggestion-item:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.suggestion-item:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.1);
}

.suggestion-item::before {
    content: none;
}

/* Cursor-style Workflow Design */
.workflow-container {
    margin: var(--space-lg) 0;
    background: transparent;
    border: none;
    padding: 0;
}

.scrape-progress-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--space-xl);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.scrape-progress-meter {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(37, 99, 235, 0.15);
}

.scrape-progress-meter-track {
    display: none;
}

.scrape-progress-meter-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #0b46ff 0%, #26a4ff 100%);
    transition: width 0.4s ease;
}

.scrape-progress-meter-fill.is-error {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.8) 100%);
}

.scrape-progress-card.is-complete {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 18px 36px rgba(16, 185, 129, 0.12);
}

.scrape-progress-card.is-error {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 18px 36px rgba(239, 68, 68, 0.12);
}

.scrape-progress-card.is-error {
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 18px 36px rgba(239, 68, 68, 0.12);
}

.workflow-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    cursor: pointer;
}

.workflow-header:hover .scrape-progress-count {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent);
}

.scrape-progress-heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scrape-progress-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-subtle);
}

.scrape-progress-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-strong);
}

.scrape-progress-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-subtle);
}

.scrape-progress-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.scrape-progress-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: var(--surface-muted);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-subtle);
    transition: all 0.2s ease;
}

.workflow-chevron {
    font-size: 12px;
    color: var(--text-subtle);
    transition: transform 0.2s ease;
    margin-top: 2px;
}

.workflow-header.expanded .workflow-chevron {
    transform: rotate(180deg);
}

.workflow-checklist {
    display: none;
}

.workflow-checklist.show {
    display: block;
}

.scrape-progress-body {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.scrape-progress-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.scrape-step {
    position: relative;
    padding-left: 28px;
}

.scrape-step-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.scrape-step::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.5);
    background: var(--surface);
    transition: all 0.2s ease;
}

.scrape-step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 4px;
    width: 2px;
    height: calc(100% - 20px);
    background: rgba(148, 163, 184, 0.35);
}

.scrape-step:last-child::after {
    display: none;
}

.scrape-step.is-completed::before {
    background: #0218DE;
    border-color: #0218DE;
}

.scrape-step.is-completed::after {
    background: rgba(2, 24, 222, 0.4);
}

.scrape-step.is-active::before {
    border-color: #0218DE;
    box-shadow: 0 0 0 4px rgba(2, 24, 222, 0.15);
}

.scrape-step.has-error::before {
    border-color: rgba(239, 68, 68, 0.7);
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.scrape-step.has-error .scrape-step-label,
.scrape-step.has-error .scrape-step-description {
    color: #b91c1c;
}

.scrape-step.has-error::before {
    border-color: #EF4444;
    background: #EF4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.scrape-step.has-error .scrape-step-label {
    color: #B91C1C;
}

.scrape-progress-error {
    margin-top: var(--space-md);
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(254, 242, 242, 0.9);
    color: #B91C1C;
    font-size: 13px;
    line-height: 1.5;
}

.scrape-progress-note {
    margin-top: var(--space-sm);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-subtle);
    font-size: 12px;
    line-height: 1.4;
}

.scrape-step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-strong);
}

.scrape-step-description {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-subtle);
    line-height: 1.5;
}

.scrape-progress-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.scrape-progress-status {
    margin: 0;
    font-size: 13px;
    color: var(--text-subtle);
}

.scrape-progress-summary {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 14px;
    color: var(--text-default);
}

.scrape-progress-summary-count {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-strong);
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 13px;
}

.workflow-step:hover {
    background: rgba(255, 255, 255, 0.05);
}

.workflow-step.completed {
    background: rgba(34, 197, 94, 0.1);
}

.workflow-step.active {
    background: rgba(59, 130, 246, 0.1);
}

.workflow-step-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.workflow-step-icon.pending {
    background: #333;
    color: #888;
    border: 1px solid #444;
}

.workflow-step-icon.active {
    background: #0218DE;
    color: white;
}

.workflow-step-icon.completed {
    background: #0218DE;
    color: white;
}

.workflow-step-text {
    flex: 1;
    font-size: 13px;
    font-weight: 400;
    color: #cccccc;
    text-decoration: none;
}

.workflow-step.completed .workflow-step-text {
    color: #22c55e;
    text-decoration: line-through;
}

.workflow-step.active .workflow-step-text {
    color: #3b82f6;
}

.workflow-details {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.workflow-details.show {
    display: block;
}

.workflow-details h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 500;
    color: #cccccc;
}

.workflow-details p {
    margin: 0 0 8px 0;
}

.workflow-details ul {
    margin: 6px 0 0 16px;
    list-style: disc;
}

.workflow-details li {
    margin-bottom: 2px;
}

.workflow-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.workflow-action-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid;
}

.workflow-action-btn.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.workflow-action-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.workflow-action-btn.secondary {
    background: #2a2a2a;
    color: #888;
    border-color: #444;
}

.workflow-action-btn.secondary:hover {
    background: #333;
    border-color: #555;
}

/* Expandable Categories */
.taxonomy-hint-section {
    margin-bottom: 20px;
}

.taxonomy-hint-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.taxonomy-hint-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.taxonomy-hint-section li {
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #6b7280;
}

.taxonomy-hint-section li:last-child {
    border-bottom: none;
}

.taxonomy-hint-section li a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.taxonomy-hint-section li a:hover {
    text-decoration: underline;
}

.expand-toggle {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.expand-toggle:hover {
    background: #f1f5f9;
    color: #374151;
}

.expand-toggle .chevron {
    transition: transform 0.2s ease;
    font-size: 10px;
}

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

.category-list {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-list.expanded {
    max-height: none;
}

.category-list.collapsed {
    max-height: 200px;
}

.show-more-overlay {
    position: relative;
    background: linear-gradient(transparent, #f8fafc);
    height: 40px;
    margin-top: -40px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
}

.category-list.expanded .show-more-overlay {
    display: none;
}
.sample-results {
    background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--space-lg);
    box-shadow: var(--shadow);
    margin-top: var(--space-lg);
    width: 100%;
}

.sample-results h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.preview-lede {
    margin: -8px 0 var(--space-sm) 0;
    color: var(--text-subtle);
    font-size: 13px;
}

.review-summary {
    margin: var(--space-md) 0;
    display: flex;
    justify-content: flex-end;
}

.review-summary.resolved {
    opacity: 0.7;
}

.review-summary-btn {
    border: none;
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.review-summary-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
}

.review-summary-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.error-summary {
    margin-top: var(--space-sm);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #7f1d1d;
}

.error-summary pre {
    background: #fff;
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
    max-height: 200px;
    overflow: auto;
    color: #0f172a;
}

.preview-category-cell.pulse-highlight {
    animation: review-pulse 1.2s ease;
}

@keyframes review-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-sm);
}

.preview-toolbar .toolbar-left,
.preview-toolbar .toolbar-right {
    display: flex;
    gap: 8px;
}

.sample-results .results-table.modern {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: var(--surface);
    --preview-index-col-width: 56px;
    --preview-index-padding-x: 16px;
    --preview-index-total-width: calc(var(--preview-index-col-width) + (var(--preview-index-padding-x) * 2));
}

.sample-results .results-table.modern table {
    width: 100%;
    min-width: 960px;
    border-collapse: separate;
    border-spacing: 0;
}

.sample-results.expanded .results-table.modern {
    max-height: 70vh;
    overflow: auto;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
}
.sample-results.expanded {
    width: 100%;
}

.sample-results.expanded .results-table.modern table {
    min-width: 1200px;
}

.sample-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 1600;
    background: rgba(15, 23, 42, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    overflow-y: auto;
}

body.sample-preview-fullscreen {
    overflow: hidden;
}

.sample-preview-overlay .sample-results {
    max-width: 1280px;
    width: 100%;
    max-height: 100%;
    margin: 0;
}

.sample-preview-placeholder {
    display: none;
}

.sample-results .results-table.modern thead th {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 5;
}

.sample-results .results-table.modern thead th.index-header {
    left: 0;
    z-index: 7;
}

.sample-results .results-table.modern .index-header,
.sample-results .results-table.modern .index-cell {
    position: sticky;
    left: 0;
    z-index: 6;
    background: var(--surface);
    width: var(--preview-index-col-width);
    min-width: var(--preview-index-col-width);
    max-width: var(--preview-index-col-width);
    padding-left: var(--preview-index-padding-x);
    padding-right: var(--preview-index-padding-x);
}

.sample-results .results-table.modern .preview-product-header,
.sample-results .results-table.modern .preview-product-cell {
    position: sticky;
    left: 56px;
    background: var(--surface);
    z-index: 4;
    border-right: 2px solid #e5e7eb;
}

.sample-results .results-table.modern thead th.preview-product-header {
    left: 56px;
    z-index: 7;
    background: #f9fafb;
}

.sample-results.unfrozen .results-table.modern .preview-product-header,
.sample-results.unfrozen .results-table.modern .preview-product-cell {
    position: static;
    left: auto;
    box-shadow: none;
}

.sample-results.unfrozen .results-table.modern thead th.preview-product-header {
    left: auto;
}


.preview-info-panel {
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: var(--space-md);
    margin-top: var(--space-sm);
    font-size: 13px;
    color: #374151;
}

.preview-info-panel h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #111827;
}

.preview-info-panel ol {
    margin: 0 0 8px 18px;
    padding: 0;
}

.preview-info-panel li {
    margin-bottom: 4px;
}

.preview-info-panel p {
    margin: 0;
    color: #4B5563;
}

.criteria-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.category-color-chip {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 8px;
}

/* Color classes for category indicators */
.category-color-indicator.color-purple {
    background-color: #8B5CF6;
}

.category-color-indicator.color-orange {
    background-color: #F97316;
}

.category-color-indicator.color-blue {
    background-color: #3B82F6;
}

.category-color-indicator.color-green {
    background-color: #10B981;
}

.category-color-indicator.color-red {
    background-color: #EF4444;
}

.category-color-indicator.color-yellow {
    background-color: #F59E0B;
}

.category-color-indicator.color-pink {
    background-color: #EC4899;
}

.category-color-indicator.color-teal {
    background-color: #14B8A6;
}

.category-color-indicator.color-indigo {
    background-color: #6366F1;
}

.category-color-indicator.color-amber {
    background-color: #F59E0B;
}

/* Category Color Chip - for use as icon replacement */
.category-color-chip {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Image Viewer Styles */
.image-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-viewer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #000;
}

.image-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
}

.image-viewer-close {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.image-viewer-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.image-counter {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.image-viewer-actions {
    display: flex;
    gap: 8px;
}

.image-viewer-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.image-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-viewer-image-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-viewer-prev,
.image-viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 48px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.image-viewer-prev {
    left: 24px;
}

.image-viewer-next {
    right: 24px;
}

.image-viewer-prev:hover,
.image-viewer-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.image-viewer-footer {
    padding: 24px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
}

.image-viewer-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.image-viewer-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.image-label-pill {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Looks Good Button */
.pill-looks-good-btn {
    background: #10B981;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pill-looks-good-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.pill-looks-good-btn:active {
    transform: translateY(0);
}

/* Preview Stats */
.preview-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6B7280;
    margin-left: 16px;
}

.stat-reviews {
    font-weight: 500;
}

.stat-separator {
    color: #D1D5DB;
}

.stat-agreement {
    color: #10B981;
    font-weight: 600;
}

/* Criteria Legend */
.criteria-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding: 12px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}


.results-table.modern {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: var(--space-lg);
    background: var(--chat-bg);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.results-table.modern table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}

.results-table.modern thead {
    background-color: #f9fafb;
}

.results-table.modern th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.results-table.modern td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    background: var(--surface);
}

.results-table.modern tbody tr:hover {
    background-color: #f9fafb;
}


.results-table.modern tbody td.consensus-conflict-cell {
    background-color: #fed7aa !important;
    border-left: 3px solid #f97316 !important;
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.25);
}

.results-table.modern tbody td.consensus-conflict-cell .tag-pill {
    background-color: rgba(249, 115, 22, 0.08);
}

.results-table.modern tbody td.consensus-weak-cell {
    background-color: #fefce8 !important;
    border-left: 3px solid #facc15 !important;
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.25);
}


.needs-review-row {
    background: rgba(254, 249, 195, 0.55);
    box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.25);
}

.results-table.modern tbody tr:last-child td {
    border-bottom: none;
}

.index-header,
.index-cell {
    width: var(--preview-index-col-width, 56px);
    min-width: var(--preview-index-col-width, 56px);
    max-width: var(--preview-index-col-width, 56px);
    text-align: center;
    font-weight: 600;
    color: #6b7280;
    padding-left: var(--preview-index-padding-x, 16px);
    padding-right: var(--preview-index-padding-x, 16px);
}

.preview-product-header {
    min-width: 300px;
    width: 400px;
}

.preview-product-header .column-heading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-product-header svg {
    display: none;
}

.preview-product-cell {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    min-width: 300px;
    width: 400px;
}

.preview-product-cell .product-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    white-space: normal;
    max-width: 280px;
}

.preview-product-cell .product-id {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    word-break: break-all;
    white-space: normal;
    max-width: 280px;
}

.preview-header-cell,
.preview-category-cell {
    min-width: 200px;
    width: 200px;
}

.preview-category-cell {
    padding: 16px;
    vertical-align: top;
}

.preview-category-cell .tag-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preview-category-cell .tag-pill,
.preview-category-cell .vote-pill {
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    line-height: 1.3;
    padding: 6px 12px;
    text-align: left;
}

.analytics-section {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.analytics-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.analytics-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.analytics-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.analytics-label {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
}

.analytics-detail {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* Fix tooltip z-index issues */
.tag-pill-group[title]:hover::after {
    content: attr(title);
    position: absolute;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    max-width: 300px;
    word-wrap: break-word;
    white-space: normal;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    pointer-events: none;
}

/* Enhanced export button styling */
.export-btn {
    position: relative;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.export-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.export-btn .btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.export-btn .btn-subtitle {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    line-height: 1.3;
}


.taxonomy-actions-hint {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.taxonomy-actions-hint p {
    margin-bottom: 8px;
    font-size: 14px;
    color: #4b5563;
}

.taxonomy-actions-hint ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.taxonomy-actions-hint li {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 4px;
}

.taxonomy-actions-hint li strong {
    color: #1f2937;
    font-weight: 600;
}

.taxonomy-sources {
    margin-top: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.sources-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.sources-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.sources-icon {
    font-size: 12px;
    opacity: 0.6;
}

.sources-content {
    padding: 12px 16px;
    background: white;
}

.source-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.source-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #4f46e5;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.source-details {
    flex: 1;
    min-width: 0;
}

.source-url {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 2px;
}

.source-meta {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.product-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
    cursor: zoom-in;
}

.product-thumb.placeholder {
    border: 1px dashed #d1d5db;
}

.product-details {
    min-width: 0;
}

.product-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.consensus-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.consensus-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f3f4f6;
    color: #374151;
}

.consensus-badge.consensus-strong_agreement {
    background: #ecfdf3;
    color: #047857;
}

.consensus-badge.consensus-weak_agreement {
    background: #fef3c7;
    color: #92400e;
}

.consensus-badge.consensus-full_agreement {
    background: #e0f2fe;
    color: #0369a1;
}

.consensus-badge.consensus-conflict {
    background: #fde68a;
    color: #92400e;
}

.consensus-badge.consensus-no_vote,
.consensus-badge.consensus-failed {
    background: #fee2e2;
    color: #b91c1c;
}

.consensus-badge.consensus-user_override {
    background: #dcfce7;
    color: #166534;
}

.overall-confidence {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
}

.model-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.model-chip {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #312e81;
}

.model-chip.neutral {
    background: #f3f4f6;
    color: #4b5563;
}

.model-chip.success {
    background: #ecfdf3;
    color: #065f46;
}

.model-chip.error {
    background: #fee2e2;
    color: #991b1b;
}

.status-icon {
    margin-right: 6px;
    font-weight: 700;
    font-size: 18px;
    opacity: 0.8;
}

.preview-category-cell {
    min-width: 160px;
    max-width: 200px;
}

.preview-category-cell.needs-review {
    background: linear-gradient(0deg, rgba(254, 240, 138, 0.85), rgba(254, 249, 195, 0.85)), #fef9c3;
    border-radius: 12px;
    outline: 1px solid rgba(202, 138, 4, 0.4);
    box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.25);
}

.preview-category-cell.user-override {
    background: linear-gradient(0deg, rgba(220, 252, 231, 0.65), rgba(220, 252, 231, 0.65)), #ecfdf3;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
}

.preview-category-cell.reviewed {
    background: #f3f4f6 !important;
    border-radius: 12px;
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
}

.preview-category-cell.reviewed.low-confidence-cell {
    background: #f3f4f6 !important;
    border-left: 1px solid #e5e7eb !important;
}

.tag-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.classification-error {
    margin-top: 8px;
    font-size: 12px;
    color: #DC2626;
    font-weight: 500;
    flex-basis: 100%;
}

.tag-pill {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 10px;
    background-color: rgba(2, 24, 222, 0.1);
    color: #0218DE;
    font-size: 12px;
    font-weight: 500;
    border-radius: 999px;
    white-space: normal;
    border: 1px solid rgba(2, 24, 222, 0.2);
    max-width: 100%;
    word-break: break-word;
    flex-wrap: nowrap;
    min-width: 0;
}

.tag-pill.notice {
    background-color: rgba(5, 150, 105, 0.12);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.3);
    font-weight: 600;
    cursor: pointer;
}

.preview-category-cell.needs-review .tag-pill.notice {
    background-color: rgba(217, 119, 6, 0.15);
    border-color: rgba(217, 119, 6, 0.4);
    color: #92400e;
}

.tag-pill.notice:hover {
    background-color: rgba(5, 150, 105, 0.2);
}

.preview-category-cell.needs-review .tag-pill.notice:hover {
    background-color: rgba(217, 119, 6, 0.25);
}

.tag-pill.notice.is-open {
    background-color: rgba(5, 150, 105, 0.28);
    border-color: rgba(5, 150, 105, 0.45);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.18);
}

.preview-category-cell.needs-review .tag-pill.notice.is-open {
    background-color: rgba(217, 119, 6, 0.32);
    border-color: rgba(217, 119, 6, 0.48);
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.18);
}

.review-label-dropdown {
    position: absolute;
    z-index: 1400;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
    min-width: 220px;
    max-width: 320px;
    overflow: hidden;
}

.review-label-dropdown-inner {
    display: flex;
    flex-direction: column;
    max-height: 360px;
}

.review-label-dropdown .dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.review-label-dropdown .dropdown-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-strong);
}

.review-label-dropdown .dropdown-close {
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-subtle);
    border-radius: 6px;
    padding: 4px;
}

.review-label-dropdown .dropdown-close:hover,
.review-label-dropdown .dropdown-close:focus {
    background: var(--surface-muted);
    color: var(--text-strong);
    outline: none;
}

.review-label-dropdown .dropdown-search {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.review-label-dropdown .label-dropdown-search {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    background: var(--surface);
    color: var(--text-strong);
}

.review-label-dropdown .label-dropdown-search:focus {
    outline: none;
    border-color: #0218DE;
    box-shadow: 0 0 0 3px rgba(2, 24, 222, 0.12);
}

.review-label-dropdown .dropdown-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    overflow-y: auto;
    max-height: 260px;
    background: var(--surface);
}

.review-label-dropdown .dropdown-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 10px;
    padding: 8px 10px;
    text-align: left;
    font-size: 13px;
    color: var(--text-strong);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.review-label-dropdown .dropdown-option:hover,
.review-label-dropdown .dropdown-option:focus {
    background: rgba(2, 24, 222, 0.08);
    border-color: rgba(2, 24, 222, 0.12);
    outline: none;
}

.review-label-dropdown .dropdown-option .option-label {
    font-weight: 600;
}

.review-label-dropdown .dropdown-option .option-description {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-subtle);
}

.review-label-dropdown .dropdown-empty {
    padding: 16px 12px;
    font-size: 13px;
    color: var(--text-subtle);
    text-align: center;
}

.review-label-dropdown .dropdown-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
}

.review-label-dropdown .dropdown-advanced {
    width: 100%;
    border: 1px solid #0218DE;
    background: #0218DE;
    color: #FFFFFF;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.review-label-dropdown .dropdown-advanced:hover,
.review-label-dropdown .dropdown-advanced:focus {
    background: #0016c4;
    border-color: #0016c4;
    outline: none;
}

/* Multi-label dialog */
.multi-label-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}

.multi-label-dialog {
    background: var(--surface);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.35);
}

.multi-label-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.multi-label-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-strong);
}

.multi-label-close {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-subtle);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multi-label-close:hover {
    color: var(--text-strong);
    background: var(--surface-muted);
}

.multi-label-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.multi-label-body p {
    margin: 0 0 16px 0;
    color: var(--text-subtle);
    font-size: 14px;
}

.multi-label-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.multi-label-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.multi-label-option:hover {
    background: var(--surface-muted);
}

.multi-label-option input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #0218DE;
}

.multi-label-option span {
    font-size: 14px;
    color: var(--text-strong);
}

.multi-label-custom {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.multi-label-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    background: var(--surface);
    color: var(--text-strong);
}

.multi-label-input:focus {
    outline: none;
    border-color: #0218DE;
    box-shadow: 0 0 0 3px rgba(2, 24, 222, 0.1);
}

.multi-label-add {
    padding: 8px 16px;
    background: #0218DE;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.multi-label-add:hover {
    background: #0016c4;
}

.multi-label-selected h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-strong);
}

.multi-label-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    padding: 8px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.multi-label-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.multi-label-actions .btn {
    min-width: 100px;
}

.tag-pill.notice {
    background-color: rgba(5, 150, 105, 0.12);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.3);
    font-weight: 600;
}

.tag-pill .pill-text {
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
    flex: 1 1 auto;
}

.tag-pill .pill-remove-btn {
    background: none;
    border: none;
    color: #0218DE;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    line-height: 16px;
    text-align: center;
    font-size: 12px;
    transition: background 0.2s ease, color 0.2s ease;
    margin-top: 2px;
}

.tag-pill .pill-remove-btn:hover {
    background: rgba(2, 24, 222, 0.12);
    color: #0218DE;
}

.tag-pill.muted .pill-remove-btn {
    display: none;
}

.tag-confidence {
    font-size: 11px;
    color: #0218DE;
    font-weight: 600;
    margin-left: 6px;
}

.tag-pill.muted {
    background-color: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
}

.cell-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.vote-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    padding: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.vote-breakdown.collapsed {
    display: none;
}

.vote-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 999px;
    background: #f9fafb;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.vote-pill.selectable {
    cursor: pointer;
    background: #ffffff;
    transition: background 0.18s ease, transform 0.18s ease;
}

.vote-pill.selectable:hover {
    background: #e0f2fe;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.pill-adjust-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-adjust-btn:hover,
.pill-adjust-btn.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

.pill-resolve-btn {
    background: #047857;
    border: 1px solid rgba(4, 120, 87, 0.35);
    border-radius: 999px;
    padding: 2px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pill-resolve-btn:hover {
    background: #065f46;
    border-color: rgba(4, 120, 87, 0.55);
    box-shadow: 0 2px 6px rgba(6, 95, 70, 0.2);
}

.preview-attention-banner {
    margin: 16px 0 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    font-size: 13px;
    font-weight: 600;
}

.vote-pill.primary {
    border-color: #6366f1;
    color: #4338ca;
}

.vote-pill.override-active {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.vote-pill .vote-count {
    font-weight: 700;
    color: #1f2937;
}

.column-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}


.heading-title {
    font-weight: 600;
    color: #111827;
}

.preview-row-error {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 0;
}

.error-icon {
    font-size: 18px;
    color: #f97316;
}

.error-title {
    font-weight: 600;
    color: #111827;
}

.cell-confidence-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(2, 24, 222, 0.1);
    color: #0218DE;
}

.cell-confidence-chip.high {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.cell-confidence-chip.medium {
    background: rgba(245, 158, 11, 0.12);
    color: #B45309;
}

.cell-confidence-chip.low {
    background: rgba(239, 68, 68, 0.12);
    color: #B91C1C;
}

.cell-confidence-chip.override {
    background: rgba(2, 24, 222, 0.1);
    color: #0218DE;
    border: 1px solid rgba(2, 24, 222, 0.2);
    box-shadow: 0 2px 6px rgba(2, 24, 222, 0.15);
}

.verification-review .action-buttons,
.sample-results .action-buttons {
    margin-top: var(--space-md);
    display: flex;
    gap: var(--space-md);
}

.sample-results-table td:last-child,
.sample-results-table th:last-child {
    text-align: right;
}

@media (max-width: 1024px) {
    .sample-results-table {
        font-size: 14px;
    }

    .sample-results-table th,
    .sample-results-table td {
        padding: 12px;
    }

    .product-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* Claude-Style Analysis Message */
.claude-analysis-message {
    background: var(--chat-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    margin: var(--space-md) 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.file-preview {
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md);
}

.file-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.file-icon {
    font-size: 20px;
    opacity: 0.8;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
    margin-bottom: 4px;
}

.file-type {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.analysis-content {
    padding: var(--space-lg);
}

.thinking-section {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.thinking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.thinking-title {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.thinking-arrow {
    color: var(--text-subtle);
    font-size: 12px;
    cursor: pointer;
}

.thinking-text {
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

.action-section p {
    color: var(--text);
    font-size: 16px;
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.suggestion-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.suggestion-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-card:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(2, 24, 222, 0.1);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.card-action {
    color: var(--text-subtle);
    font-size: 12px;
    font-style: italic;
}

/* Legacy Upload Success Message Styling */
.claude-style-message {
    background: var(--chat-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    margin: var(--space-md) 0;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.thinking-indicator {
    background: var(--sidebar-bg);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

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

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

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

@keyframes thinking-pulse {
    0%, 80%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

.thinking-text {
    color: var(--text-subtle);
    font-size: var(--small);
    font-style: italic;
}

.claude-content {
    padding: var(--space-lg);
    color: var(--text);
}

.file-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.status-text {
    font-size: var(--body);
    color: var(--text);
}

.status-text strong {
    color: var(--text);
    font-weight: 600;
}

.product-count {
    font-size: var(--heading);
    margin-bottom: var(--space-lg);
    color: var(--text);
}

.highlight {
    color: var(--primary);
    font-weight: 600;
    background: rgba(2, 24, 222, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.instruction-text {
    font-size: var(--body);
    color: var(--text);
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.example-suggestions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.suggestion-item {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--small);
    color: var(--text);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.suggestion-item:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.quote {
    color: var(--primary);
    font-weight: 600;
    font-size: 16px;
}

/* Model attribution styling */
.model-attribution-row {
    margin-top: 4px;
    font-size: 12px;
    color: #6B7280;
}

.model-attribution {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 4px;
    background: #F3F4F6;
    color: #6B7280;
}

.model-attribution.success {
    background: #D1FAE5;
    color: #065F46;
}

.model-attribution.error {
    background: #FEE2E2;
    color: #991B1B;
}

/* Clickable thumb styling */
.clickable-thumb {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clickable-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Image modal styling */
.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.image-modal-content {
    background: var(--chat-bg);
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.image-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.image-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.image-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6B7280;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.image-modal-close:hover {
    background-color: #F3F4F6;
}

.image-modal-body {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.expanded-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

/* Disagreement highlighting */
.disagreement-cell {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px solid #F59E0B;
    border-radius: 8px;
    position: relative;
}

.disagreement-cell::before {
    content: "⚠️";
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 12px;
    z-index: 1;
}

/* Low Confidence Styling */
.low-confidence-cell {
    background-color: #fffbe6 !important;
    border-left: 3px solid #fcd34d !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.low-confidence-cell:hover {
    background-color: #fff7cd !important;
}

.low-confidence-cell.confidence-warning {
    background: linear-gradient(135deg, #fff9c4 0%, #fde68a 100%) !important;
    border-left-color: #facc15 !important;
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.3);
}

.low-confidence-cell.confidence-warning:hover {
    background: linear-gradient(135deg, #fff3b0 0%, #fbe38a 100%) !important;
}

.low-confidence-cell.confidence-critical {
    background-color: #fee2e2 !important;
    border-left-color: #f87171 !important;
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35);
}

.low-confidence-cell.confidence-critical:hover {
    background-color: #fecaca !important;
}

.low-confidence-cell.reviewed {
    background-color: #f9fafb !important;
    border-left: 3px solid #d1d5db !important;
    box-shadow: none !important;
}

.low-confidence-cell.reviewed:hover {
    background-color: #f3f4f6 !important;
}

/* Correction interface */
.correction-interface {
    margin-top: 8px;
    padding: 8px;
    background: #FEF3C7;
    border-radius: 6px;
    border: 1px solid #F59E0B;
}

.correction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.disagreement-indicator {
    font-size: 11px;
    font-weight: 600;
    color: #92400E;
}

.correction-toggle {
    background: #F59E0B;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.correction-toggle:hover {
    background: #D97706;
}

.correction-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.correction-option {
    background: var(--chat-bg);
    border: 1px solid #D97706;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.correction-option:hover {
    background: #FEF3C7;
    border-color: #F59E0B;
    transform: translateY(-1px);
}

.correction-label {
    font-weight: 600;
    color: #92400E;
    font-size: 12px;
}

.correction-models {
    font-size: 10px;
    color: #6B7280;
}

/* Correction feedback */
.correction-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 10001;
    animation: slideInRight 0.3s ease;
}

.correction-feedback.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.correction-feedback.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== CLEAN PRODUCT PREVIEW ==================== */
.preview-product-cell {
    padding: 16px;
    border-right: 1px solid #E5E7EB;
}

.product-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.product-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumb.placeholder {
    flex-direction: column;
    gap: 4px;
}

.product-icon {
    font-size: 24px;
    opacity: 0.6;
}

.product-id {
    font-size: 10px;
    color: #6B7280;
    font-weight: 500;
}

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

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.product-id {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 8px;
}

.product-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.consensus-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.consensus-badge.consensus-full_agreement {
    background: #047857;
    color: #f0fdfa;
}

.consensus-badge.consensus-no_vote {
    background: #F3F4F6;
    color: #6B7280;
}

.overall-confidence {
    font-size: 11px;
    color: #6B7280;
    font-weight: 500;
}

.model-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.model-chip {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.model-chip.neutral {
    background: #F3F4F6;
    color: #6B7280;
}

.model-chip.success {
    background: #D1FAE5;
    color: #065F46;
}

.model-chip.error {
    background: #FEE2E2;
    color: #991B1B;
}

/* Category cells */
.preview-category-cell {
    padding: 16px;
    border-right: 1px solid #E5E7EB;
    vertical-align: top;
}

.tag-pill-group {
    margin-bottom: 8px;
}

.tag-pill {
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
}

.tag-pill:not(.muted) {
    background: rgba(2, 24, 222, 0.1);
    color: #0218DE;
    border: 1px solid rgba(2, 24, 222, 0.2);
}

.tag-pill.muted {
    background: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.cell-confidence-chip {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    margin-bottom: 8px;
    display: inline-block;
}

.cell-confidence-chip.high {
    background: #D1FAE5;
    color: #065F46;
}

.vote-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.vote-pill {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid #E5E7EB;
    background: var(--chat-bg);
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-pill:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.vote-pill.primary {
    background: #EFF6FF;
    border-color: #DBEAFE;
    color: #1E40AF;
}

.vote-count {
    margin-left: 4px;
    font-weight: 600;
}
