/* ============================================================================
   DataCompare Pro - Premium Modern Design
   Clean, Professional, Trustworthy
   ============================================================================ */

/* ============================================================================
   CSS Variables
   ============================================================================ */
:root {
    /* Primary Brand Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    
    /* Showcase Colors - Salmon Dark & Magenta */
    --salmon-dark: #c75b5b;
    --salmon-medium: #e07878;
    --salmon-light: #f5a8a8;
    --magenta: #d946a8;
    --magenta-dark: #b5399b;
    --magenta-light: #f472c8;
    --showcase-gradient-1: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    --showcase-gradient-2: linear-gradient(135deg, var(--salmon-dark) 0%, var(--magenta) 100%);
    --showcase-glow: rgba(217, 70, 168, 0.4);
    
    /* Status Colors */
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    
    --error: #dc2626;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    
    --info: #0891b2;
    --info-bg: #ecfeff;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Semantic */
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.10), 0 10px 10px rgba(0,0,0,0.04);
    
    /* Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Font */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-page: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-strong: #475569;
    --gray-50: #1e293b;
    --gray-100: #334155;
    --primary-bg: rgba(37, 99, 235, 0.15);
    --success-bg: rgba(5, 150, 105, 0.15);
    --warning-bg: rgba(217, 119, 6, 0.15);
    --error-bg: rgba(220, 38, 38, 0.15);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================================
   Typography
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { color: var(--text-secondary); }

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-large {
    padding: 15px 30px;
    font-size: 15px;
    font-weight: 600;
}

/* ============================================================================
   Header & Navigation
   ============================================================================ */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    background: linear-gradient(135deg, var(--salmon-dark) 0%, var(--magenta-dark) 100%);
    color: white;
    font-size: 13px;
}

.region-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.region-flag { font-size: 14px; }

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-toggle {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: white;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.lang-toggle:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

.theme-toggle {
    background: rgba(255,255,255,0.15);
    border: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: white;
    font-size: 14px;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.25);
}

.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

.keyboard-hint { display: none; }

.privacy-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--success-bg);
    color: var(--success);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid var(--success-border);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 40px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

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

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

.logo-text {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-pro {
    background: linear-gradient(135deg, var(--salmon-dark) 0%, var(--magenta) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-badge {
    background: linear-gradient(135deg, var(--salmon-dark) 0%, var(--magenta) 100%);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(217, 70, 168, 0.25);
}

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

.nav-link {
    padding: 10px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--magenta);
    background: rgba(217, 70, 168, 0.1);
}

/* ============================================================================
   ROTATING HERO SHOWCASE - Salmon Dark & Magenta Theme
   ============================================================================ */
.hero-showcase {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f1a 100%);
    min-height: 100vh;
    overflow: hidden;
    padding: 60px 40px 40px;
}

/* Animated Background Orbs */
.showcase-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.gradient-orb.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--salmon-dark) 0%, transparent 70%);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.gradient-orb.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--magenta) 0%, transparent 70%);
    bottom: -20%;
    left: -10%;
    animation-delay: -7s;
}

.gradient-orb.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--salmon-medium) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(-30px, -20px) scale(1.05); }
}

/* Showcase Container */
.showcase-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
}

/* Left Side - Story Content */
.showcase-left {
    display: flex;
    flex-direction: column;
}

.showcase-badge-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.showcase-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.showcase-badge.pulse {
    background: linear-gradient(135deg, var(--salmon-dark) 0%, var(--magenta-dark) 100%);
    border-color: transparent;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(217, 70, 168, 0.4); }
    50% { box-shadow: 0 0 40px rgba(217, 70, 168, 0.7); }
}

.showcase-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--salmon-light) 0%, var(--magenta-light) 50%, var(--salmon-medium) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.showcase-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 500px;
}

/* Story Counter */
.story-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    margin-bottom: 18px;
}

.counter-icon {
    font-size: 14px;
}

.counter-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.counter-text span {
    color: var(--magenta-light);
    font-weight: 700;
}

/* Story Cards - Rotating */
.story-cards-wrapper {
    position: relative;
    height: 220px;
    margin-bottom: 24px;
}

.story-card {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.story-card.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.story-persona {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.persona-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--salmon-dark) 0%, var(--magenta) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

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

.persona-name {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.persona-company {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.story-problem {
    margin-bottom: 18px;
}

.problem-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--salmon-light);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.story-problem p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-style: italic;
    line-height: 1.5;
}

.story-solution {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.2) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 1px solid rgba(5, 150, 105, 0.3);
    border-radius: var(--radius);
}

.solution-icon {
    font-size: 18px;
}

.solution-text {
    color: #6ee7b7;
    font-size: 14px;
    font-weight: 500;
}

/* Story Navigation */
.story-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    position: relative;
}

.nav-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:hover {
    background: linear-gradient(135deg, var(--salmon-dark) 0%, var(--magenta) 100%);
    border-color: transparent;
    transform: scale(1.1);
}

.nav-arrow.prev {
    margin-right: 6px;
}

.nav-arrow.next {
    margin-left: 6px;
}

/* Autoplay Progress Bar */
.autoplay-progress {
    width: 100%;
    max-width: 300px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 24px;
}

.autoplay-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--salmon-dark) 0%, var(--magenta) 100%);
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
}

.story-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.story-dot:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.2);
}

.story-dot.active {
    background: linear-gradient(135deg, var(--salmon-dark) 0%, var(--magenta) 100%);
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(217, 70, 168, 0.5);
}

.story-progress {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: linear-gradient(90deg, var(--magenta) 0%, var(--salmon-dark) 100%);
    width: 0;
    border-radius: 3px;
    z-index: 1;
    transition: width 0.3s ease;
}

/* Showcase CTA */
.showcase-cta {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.btn-showcase-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 36px;
    background: linear-gradient(135deg, var(--salmon-dark) 0%, var(--magenta) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(217, 70, 168, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-showcase-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--magenta) 0%, var(--salmon-dark) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-showcase-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(217, 70, 168, 0.6);
}

.btn-showcase-primary:hover::before {
    opacity: 1;
}

.btn-showcase-primary .btn-icon,
.btn-showcase-primary .btn-label,
.btn-showcase-primary .btn-arrow {
    position: relative;
    z-index: 2;
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.btn-showcase-primary:hover .btn-arrow {
    transform: translateX(5px);
}

.cta-note {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Right Side - Screenshot Stage */
.showcase-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.screenshot-stage {
    position: relative;
    width: 100%;
    max-width: 580px;
}

.stage-glow {
    position: absolute;
    inset: -30px;
    background: radial-gradient(ellipse at center, var(--showcase-glow) 0%, transparent 70%);
    filter: blur(40px);
    opacity: 0.6;
    animation: glow-pulse 4s infinite ease-in-out;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* Screenshot Window */
.screenshot-window {
    position: relative;
    z-index: 2;
    background: #1e1e2e;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.window-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(180deg, #2a2a3e 0%, #252535 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.window-dots {
    display: flex;
    gap: 8px;
}

.window-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.window-dots .dot.red { background: #ff5f57; }
.window-dots .dot.yellow { background: #ffbd2e; }
.window-dots .dot.green { background: #28c840; }

.window-title {
    flex: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
}

.window-badge {
    background: linear-gradient(135deg, var(--salmon-dark) 0%, var(--magenta) 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    animation: pulse-glow 2s infinite;
}

/* Screenshot Content */
.screenshot-content {
    position: relative;
    min-height: 420px;
    background: #1a1a28;
}

.screenshot-slide {
    position: absolute;
    inset: 0;
    padding: 20px;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.screenshot-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Mock App Styles */
.mock-app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.mock-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.mock-badge {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.mock-badge.success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.mock-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.mock-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.mock-badge.info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* KPI Row */
.mock-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.mock-kpi {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
}

.mock-kpi .kpi-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.mock-kpi .kpi-change {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.mock-kpi.up .kpi-change { color: #4ade80; }
.mock-kpi.down .kpi-change { color: #f87171; }

.mock-kpi .kpi-label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* Mock Table */
.mock-table {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.mock-table .table-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.mock-table .table-row:last-child {
    border-bottom: none;
}

.mock-table .table-row.header {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mock-table .table-row span {
    color: rgba(255, 255, 255, 0.8);
}

.mock-table .table-row .positive { color: #4ade80; font-weight: 600; }
.mock-table .table-row .negative { color: #f87171; font-weight: 600; }

.mock-table .table-row.increase { background: rgba(34, 197, 94, 0.05); }
.mock-table .table-row.decrease { background: rgba(239, 68, 68, 0.05); }

/* Mock Insight */
.mock-insight {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(217, 70, 168, 0.15) 0%, rgba(199, 91, 91, 0.15) 100%);
    border: 1px solid rgba(217, 70, 168, 0.2);
    border-radius: var(--radius);
    color: var(--salmon-light);
    font-size: 13px;
    font-weight: 500;
}

/* Merge Visual for Match & Enrich */
.mock-merge-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
}

.merge-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
}

.merge-file.file-result {
    background: linear-gradient(135deg, rgba(217, 70, 168, 0.2) 0%, rgba(199, 91, 91, 0.2) 100%);
    border-color: var(--magenta);
}

.merge-file .file-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.merge-file .file-count {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

.merge-arrow {
    color: var(--magenta-light);
    font-size: 20px;
    font-weight: bold;
}

.mock-table .table-row .enriched {
    color: var(--magenta-light);
    font-weight: 500;
}

.mock-table .table-row.matched {
    background: rgba(217, 70, 168, 0.05);
}

/* Summary Row for Find Changes */
.mock-summary-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 18px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 24px;
    border-radius: var(--radius);
}

.summary-item.added {
    background: rgba(34, 197, 94, 0.15);
}

.summary-item.modified {
    background: rgba(245, 158, 11, 0.15);
}

.summary-item.removed {
    background: rgba(239, 68, 68, 0.15);
}

.summary-item .count {
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-item.added .count { color: #4ade80; }
.summary-item.modified .count { color: #fbbf24; }
.summary-item.removed .count { color: #f87171; }

.summary-item .label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.mock-table .table-row.modified {
    background: rgba(245, 158, 11, 0.08);
}

.mock-table .table-row.added {
    background: rgba(34, 197, 94, 0.08);
}

.mock-table .old-value {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.4) !important;
}

.mock-table .new-value {
    color: #4ade80 !important;
    font-weight: 600;
}

.mock-table .new-record {
    color: #4ade80;
    font-style: italic;
}

/* Duplicate Visual */
.mock-dupe-visual {
    text-align: center;
    margin-bottom: 18px;
    padding: 20px;
    background: rgba(239, 68, 68, 0.08);
    border-radius: var(--radius);
}

.dupe-stat .dupe-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #f87171;
}

.dupe-stat .dupe-label {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.dupe-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.dupe-bar .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f87171 0%, #ef4444 100%);
    border-radius: 4px;
}

.dupe-percent {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.mock-table.duplicates .table-row.duplicate {
    background: rgba(239, 68, 68, 0.05);
}

.count-badge {
    background: #ef4444;
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
}

/* Chart for Quick Summarize */
.mock-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    height: 140px;
    padding: 20px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 60px;
    height: var(--height);
    background: linear-gradient(180deg, var(--magenta) 0%, var(--salmon-dark) 100%);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: relative;
    transition: all 0.3s ease;
}

.chart-bar:hover {
    filter: brightness(1.2);
    transform: translateY(-5px);
}

.chart-bar .bar-value {
    position: absolute;
    top: -24px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.chart-bar .bar-label {
    position: absolute;
    bottom: -22px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
}

/* Feature Labels */
.feature-labels {
    position: absolute;
    inset: -20px;
    pointer-events: none;
}

.feature-label {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    animation: label-float 6s infinite ease-in-out;
}

.feature-label.label-top-left {
    top: -10px;
    left: -30px;
    animation-delay: 0s;
}

.feature-label.label-top-right {
    top: 40px;
    right: -40px;
    animation-delay: 1.5s;
}

.feature-label.label-bottom-left {
    bottom: 60px;
    left: -50px;
    animation-delay: 3s;
}

.feature-label.label-bottom-right {
    bottom: 10px;
    right: -30px;
    animation-delay: 4.5s;
}

@keyframes label-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Trust Bar */
.showcase-trust {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.trust-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.showcase-trust .trust-logos {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.trust-logo {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    transition: color 0.3s ease;
}

.trust-logo:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Scroll Down Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.scroll-arrow {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.scroll-arrow span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    animation: scroll-bounce 2s infinite;
}

@keyframes scroll-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(8px); }
    60% { transform: translateY(4px); }
}

/* Responsive Showcase */
@media (max-width: 1100px) {
    .showcase-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .showcase-left {
        align-items: center;
    }
    
    .showcase-title {
        font-size: 2.5rem;
    }
    
    .showcase-subtitle {
        max-width: 600px;
    }
    
    .story-cards-wrapper {
        max-width: 500px;
        width: 100%;
    }
    
    .story-nav {
        justify-content: center;
    }
    
    .screenshot-stage {
        max-width: 500px;
    }
    
    .feature-labels {
        display: none;
    }
}

@media (max-width: 600px) {
    .hero-showcase {
        padding: 40px 20px 30px;
    }
    
    .showcase-title {
        font-size: 2rem;
    }
    
    .showcase-badge-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .story-cards-wrapper {
        height: 260px;
    }
    
    .mock-kpi-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .mock-kpi-row .mock-kpi {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .mock-table .table-row {
        grid-template-columns: 1fr 1fr;
        font-size: 10px;
    }
    
    .mock-chart {
        gap: 10px;
    }
    
    .chart-bar {
        width: 40px;
    }
}

/* ============================================================================
   Hero Section
   ============================================================================ */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 60px 48px;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero-title .highlight {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 540px;
}

.hero-cta {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.hero-trust {
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.trust-logos {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.trust-item {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.hero-note {
    font-size: 13px;
    color: var(--text-muted);
}

/* Hero Visual */
.hero-visual {
    display: flex;
    justify-content: center;
}

.demo-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
}

.demo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--border);
}

.demo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.demo-dot.red { background: #ef4444; }
.demo-dot.yellow { background: #f59e0b; }
.demo-dot.green { background: #22c55e; }

.demo-title {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.demo-content {
    padding: 24px;
}

.demo-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.demo-kpi {
    text-align: center;
    padding: 16px 8px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.demo-kpi-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.demo-kpi-value.up { color: var(--success); }
.demo-kpi-value.down { color: var(--error); }

.demo-kpi-label {
    font-size: 11px;
    color: var(--text-muted);
}

.demo-insight {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--success-bg);
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--success);
}

.demo-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

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

/* ============================================================================
   App Section - Main Tool
   ============================================================================ */
.app-section {
    padding: 60px 40px;
    max-width: 1300px;
    margin: 0 auto;
}

.app-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.05);
    overflow: hidden;
    border: 1px solid var(--border);
}

.app-header {
    padding: 36px 40px 28px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--gray-50) 100%);
}

.section-title {
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 500px;
    margin: 0 auto;
}

/* ============================================================================
   Tool Tabs - Clean Navigation
   ============================================================================ */
.tool-tabs {
    display: flex;
    padding: 0;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tool-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 18px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    position: relative;
}

.tool-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary);
    transition: all 0.2s ease;
    transform: translateX(-50%);
}

.tool-tab:hover {
    background: var(--bg-card);
}

.tool-tab:hover::after {
    width: 60%;
}

.tool-tab.active {
    background: var(--bg-card);
    border-bottom-color: transparent;
}

.tool-tab.active::after {
    width: 100%;
    background: var(--primary);
}

.tool-icon {
    font-size: 26px;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.tool-tab:hover .tool-icon {
    transform: scale(1.1);
}

.tool-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.tool-tab.active .tool-name {
    color: var(--primary);
}

.tool-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.tool-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-badge.hot {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.tool-badge.new {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

/* ============================================================================
   File Upload Area
   ============================================================================ */
.upload-area {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    padding: 40px 48px;
    align-items: center;
    background: var(--bg-card);
}

.file-box {
    display: flex;
    flex-direction: column;
}

.file-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 52px 36px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--gray-50) 100%);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.file-dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.file-dropzone:hover {
    border-color: var(--primary);
    background: linear-gradient(180deg, var(--primary-bg) 0%, var(--bg-card) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.file-dropzone:hover::before {
    opacity: 1;
}

.file-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.15);
}

.file-dropzone.has-file {
    display: none;
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--primary);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.file-dropzone:hover .dropzone-icon svg {
    opacity: 1;
    stroke: var(--primary);
}

.file-dropzone:hover .dropzone-icon {
    transform: translateY(-4px);
}

.dropzone-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.file-label-hint {
    font-weight: 400;
    color: var(--text-muted);
}

.dropzone-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.dropzone-link {
    color: var(--primary);
    font-weight: 500;
}

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

.dropzone-trust {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #059669;
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.15);
    border-radius: 20px;
    letter-spacing: 0.01em;
}

.dropzone-trust svg {
    flex-shrink: 0;
    color: #059669;
    opacity: 0.85;
}

[data-theme="dark"] .dropzone-trust {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.2);
}

[data-theme="dark"] .dropzone-trust svg {
    color: #34d399;
}

.dropzone-shortcut {
    display: none;
}

/* File Info (after upload) */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--success-bg) 0%, rgba(167, 243, 208, 0.2) 100%);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.file-details {
    display: flex;
    align-items: center;
    gap: 14px;
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--success);
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.file-rows {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.file-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 10px;
    font-size: 16px;
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

.file-remove:hover {
    background: var(--error-bg);
    color: var(--error);
}

/* VS Divider */
.vs-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    padding: 0 8px;
}

.vs-icon {
    font-size: 28px;
    opacity: 0.8;
}

.vs-text {
    font-size: 14px;
    font-weight: 800;
    color: var(--gray-400);
    letter-spacing: 0.5px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

/* Swap Button Interactive States */
.vs-divider[onclick] {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.vs-divider[onclick]:hover {
    transform: scale(1.05);
}

.vs-divider[onclick]:hover .vs-icon {
    opacity: 1;
    color: var(--primary);
}

.vs-divider[onclick]:hover .vs-text {
    background: var(--primary);
    color: white;
}

.vs-divider[onclick]:active {
    transform: scale(0.95);
}

.vs-divider[onclick]:active .vs-text {
    background: var(--primary-dark, #1d4ed8);
}

/* Swap animation class */
.vs-divider.swapping .vs-icon svg {
    animation: spin-swap 0.5s ease;
}

@keyframes spin-swap {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(180deg); }
}

/* ============================================================================
   Column Selection & Configuration
   ============================================================================ */
.column-selection {
    padding: 48px 48px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.selection-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.selection-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.column-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    max-width: 900px;
    margin: 0 auto 28px;
}

/* When column-selectors contains special UIs, reset the grid */
.column-selectors:has(.summarize-modern),
.column-selectors:has(.find-diff-config),
.column-selectors:has(.merge-info-box),
.column-selectors:has(.compact-wizard),
.column-selectors:has(.match-enrich-config),
.column-selectors:has(.match-enrich-modern),
.column-selectors:has(.metrics-config),
.column-selectors:has(.find-changes-modern) {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}

/* ============================================================================
   Match & Enrich Modern UI - Matches Find Changes styling
   ============================================================================ */
.match-enrich-modern {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Warning card for different table structures */
.warning-card {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 14px 16px;
}

.warning-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #92400e;
    font-size: 14px;
    margin-bottom: 6px;
}

.warning-card .warning-text {
    margin: 0;
    font-size: 13px;
    color: #78350f;
}

/* Mode options - radio button style list */
.mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.mode-option:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.mode-option.selected {
    background: #eff6ff;
    border-color: #3b82f6;
}

.mode-option input {
    display: none;
}

.mode-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.15s;
}

.mode-option.selected .mode-radio {
    border-color: #3b82f6;
}

.mode-option.selected .mode-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #3b82f6;
    border-radius: 50%;
}

.mode-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mode-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.mode-option.selected .mode-title {
    color: #1d4ed8;
}

.mode-desc {
    font-size: 12px;
    color: #6b7280;
}

.column-selectors.inline {
    grid-template-columns: 1fr 1fr;
}

.column-selector label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.column-dropdown {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.column-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg), var(--shadow-sm);
}

/* Compare Button - Modern Style */
.btn-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 500px;
    margin: 36px auto 0;
    padding: 18px 36px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
}

.btn-compare:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-compare:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-icon { font-size: 18px; }

.btn-shortcut {
    display: inline-flex;
    gap: 4px;
    opacity: 0.7;
    font-size: 12px;
}

.btn-shortcut kbd {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

/* ============================================================================
   Metrics Configuration
   ============================================================================ */
.metrics-config {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Tool Explainer Box */
.tool-explainer {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.tool-explainer.highlight {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-color: var(--primary);
}

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

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

.explainer-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.explainer-text {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Examples Section */
.examples-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
}

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

.examples-icon {
    font-size: 20px;
}

.examples-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.examples-grid {
    display: grid;
    gap: 12px;
}

.example-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-main);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.example-card:hover {
    background: var(--primary-bg);
}

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

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

.example-text strong {
    font-size: 14px;
    color: var(--text-primary);
}

.example-text span {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Tool Tip Box (for cross-referencing other tools) */
.tool-tip-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(251, 191, 36, 0.05) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.tool-tip-box .tip-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.tool-tip-box .tip-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tool-tip-box .tip-text strong {
    color: var(--text-primary);
}

.metrics-mode-toggle {
    margin-bottom: 36px;
}

.mode-step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

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

.step-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.step-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.2s ease;
}

.mode-btn:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15);
}

.mode-btn:hover::before {
    background: var(--primary);
}

.mode-btn.active {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.20);
}

.mode-btn.active::before {
    background: var(--primary);
}

.mode-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.mode-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.mode-example {
    font-size: 12px;
    color: var(--primary);
    font-style: italic;
    padding: 6px 10px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: var(--radius-sm);
}

.metrics-mode-options {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 28px;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.metrics-grid {
    display: grid;
    gap: 24px;
}

.metrics-field {
    display: flex;
    flex-direction: column;
}

.metrics-field-full {
    grid-column: 1 / -1;
}

.metrics-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.label-hint {
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Field Step Numbers */
.field-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

/* Field Guidance Text */
.field-guidance {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

/* Value Column Dynamic Guidance */
.value-col-guidance {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    animation: fadeIn 0.2s ease;
}

.value-col-guidance.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(34, 197, 94, 0.03) 100%);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #15803d;
}

.value-col-guidance.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.03) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #1d4ed8;
}

.value-col-guidance.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.03) 100%);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #b45309;
}

.guidance-success,
.guidance-info,
.guidance-warning {
    display: block;
}

/* Data Quality Indicators */
.quality-note {
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 400;
}

.quality-warning {
    color: #b45309;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-block;
    margin-left: 4px;
    padding: 2px 6px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 4px;
}

/* Restricted Aggregation Select */
select.column-dropdown.restricted {
    border-color: rgba(245, 158, 11, 0.4);
    background-color: rgba(245, 158, 11, 0.03);
}

select.column-dropdown option.disabled-option {
    color: var(--text-muted);
    font-style: italic;
}

/* Date Period Cards - Modern Selector */
.date-grouping-section {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(37, 99, 235, 0.01) 100%);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(37, 99, 235, 0.1);
    margin: 8px 0;
}

.date-period-cards {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.date-period-card {
    flex: 1;
    min-width: 90px;
    max-width: 120px;
    cursor: pointer;
}

.date-period-card input[type="radio"] {
    display: none;
}

.period-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    text-align: center;
}

.period-card-content:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.date-period-card input[type="radio"]:checked + .period-card-content {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.04) 100%);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.period-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.period-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.period-example {
    font-size: 11px;
    color: var(--text-muted);
}

.date-period-card input[type="radio"]:checked + .period-card-content .period-name {
    color: var(--primary);
}

/* Table Label Inputs - Modern Style */
.metrics-label-inputs {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.table-label-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.table-label-box:hover {
    border-color: var(--primary-light);
}

.table-label-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.table-label-box.table-a {
    border-left: 4px solid var(--primary);
}

.table-label-box.table-b {
    border-left: 4px solid var(--success);
}

.table-label-prefix {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.metrics-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

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

.label-arrow {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 4px;
}

/* Compare Metrics Button - Modern Primary Style */
.compare-btn.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 32px;
    margin-top: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.compare-btn.primary-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

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

.metrics-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-muted);
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-icon {
    font-weight: 600;
}

.metric-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.metric-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
}

.metric-checkbox:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.metric-checkbox input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.metric-checkbox input:checked + span {
    color: var(--primary);
    font-weight: 500;
}

/* Compatibility Warning - Modern Style */
.metrics-compatibility-warning {
    background: linear-gradient(135deg, var(--warning-bg) 0%, rgba(251, 191, 36, 0.08) 100%);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 28px;
}

.metrics-compatibility-warning.upfront {
    border-left: 4px solid var(--warning);
}

.metrics-compatibility-warning.critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.04) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 4px solid var(--error);
}

.metrics-compatibility-warning.critical .compatibility-header {
    color: var(--error);
}

.compatibility-explain {
    background: rgba(0, 0, 0, 0.03);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin: 10px 0;
    border-left: 3px solid var(--text-muted);
}

[data-theme="dark"] .compatibility-explain {
    background: rgba(255, 255, 255, 0.03);
}

.compatibility-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 15px;
}

.compatibility-icon {
    font-size: 18px;
}

.compatibility-body {
    font-size: 13px;
    line-height: 1.6;
}

.compatibility-body p {
    margin-bottom: 6px;
}

.compatibility-body p:last-child {
    margin-bottom: 0;
}

.compatibility-critical {
    color: var(--error);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.compatibility-note {
    font-style: italic;
    color: var(--text-muted);
}

/* ============================================================================
   Results Section
   ============================================================================ */
.results-section {
    border-top: 1px solid var(--border);
}

.results-header {
    padding: 36px 40px;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--gray-50) 100%);
    border-bottom: 1px solid var(--border);
}

.results-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.results-title-group {
    display: flex;
    align-items: center;
    gap: 18px;
}

.results-icon {
    font-size: 44px;
}

.results-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

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

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

/* ============================================================================
   Decision Summary Card — surfaces the #1 action above everything
   ============================================================================ */
.decision-summary-card {
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    animation: decisionSlideIn 0.4s ease-out;
}

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

.decision-summary-card .decision-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.decision-summary-card .decision-content {
    flex: 1;
    min-width: 0;
}

.decision-summary-card .decision-severity {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-bottom: 6px;
}

.decision-summary-card .decision-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.decision-summary-card .decision-description {
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.85;
    margin-bottom: 12px;
}

.decision-summary-card .decision-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.decision-summary-card .decision-action:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Severity variants */
.decision-summary-card.severity-critical {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    border: 2px solid #FECACA;
}
.decision-summary-card.severity-critical .decision-icon {
    background: #FEE2E2;
    color: #DC2626;
}
.decision-summary-card.severity-critical .decision-severity {
    background: #DC2626;
    color: #fff;
}
.decision-summary-card.severity-critical .decision-title {
    color: #991B1B;
}
.decision-summary-card.severity-critical .decision-description {
    color: #7F1D1D;
}
.decision-summary-card.severity-critical .decision-action {
    background: #DC2626;
    color: #fff;
}
.decision-summary-card.severity-critical .decision-action:hover {
    background: #B91C1C;
}

.decision-summary-card.severity-warning {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border: 2px solid #FDE68A;
}
.decision-summary-card.severity-warning .decision-icon {
    background: #FEF3C7;
    color: #D97706;
}
.decision-summary-card.severity-warning .decision-severity {
    background: #D97706;
    color: #fff;
}
.decision-summary-card.severity-warning .decision-title {
    color: #92400E;
}
.decision-summary-card.severity-warning .decision-description {
    color: #78350F;
}
.decision-summary-card.severity-warning .decision-action {
    background: #D97706;
    color: #fff;
}
.decision-summary-card.severity-warning .decision-action:hover {
    background: #B45309;
}

.decision-summary-card.severity-opportunity {
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border: 2px solid #DDD6FE;
}
.decision-summary-card.severity-opportunity .decision-icon {
    background: #EDE9FE;
    color: #7C3AED;
}
.decision-summary-card.severity-opportunity .decision-severity {
    background: #7C3AED;
    color: #fff;
}
.decision-summary-card.severity-opportunity .decision-title {
    color: #5B21B6;
}
.decision-summary-card.severity-opportunity .decision-description {
    color: #4C1D95;
}
.decision-summary-card.severity-opportunity .decision-action {
    background: #7C3AED;
    color: #fff;
}
.decision-summary-card.severity-opportunity .decision-action:hover {
    background: #6D28D9;
}

.decision-summary-card.severity-positive {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    border: 2px solid #BBF7D0;
}
.decision-summary-card.severity-positive .decision-icon {
    background: #DCFCE7;
    color: #16A34A;
}
.decision-summary-card.severity-positive .decision-severity {
    background: #16A34A;
    color: #fff;
}
.decision-summary-card.severity-positive .decision-title {
    color: #166534;
}
.decision-summary-card.severity-positive .decision-description {
    color: #14532D;
}
.decision-summary-card.severity-positive .decision-action {
    background: #16A34A;
    color: #fff;
}
.decision-summary-card.severity-positive .decision-action:hover {
    background: #15803D;
}

/* Dark theme adjustments */
[data-theme="dark"] .decision-summary-card.severity-critical {
    background: linear-gradient(135deg, rgba(220,38,38,0.12) 0%, rgba(220,38,38,0.06) 100%);
    border-color: rgba(220,38,38,0.3);
}
[data-theme="dark"] .decision-summary-card.severity-critical .decision-title { color: #FCA5A5; }
[data-theme="dark"] .decision-summary-card.severity-critical .decision-description { color: #FECACA; }

[data-theme="dark"] .decision-summary-card.severity-warning {
    background: linear-gradient(135deg, rgba(217,119,6,0.12) 0%, rgba(217,119,6,0.06) 100%);
    border-color: rgba(217,119,6,0.3);
}
[data-theme="dark"] .decision-summary-card.severity-warning .decision-title { color: #FDE68A; }
[data-theme="dark"] .decision-summary-card.severity-warning .decision-description { color: #FEF3C7; }

[data-theme="dark"] .decision-summary-card.severity-opportunity {
    background: linear-gradient(135deg, rgba(124,58,237,0.12) 0%, rgba(124,58,237,0.06) 100%);
    border-color: rgba(124,58,237,0.3);
}
[data-theme="dark"] .decision-summary-card.severity-opportunity .decision-title { color: #DDD6FE; }
[data-theme="dark"] .decision-summary-card.severity-opportunity .decision-description { color: #EDE9FE; }

[data-theme="dark"] .decision-summary-card.severity-positive {
    background: linear-gradient(135deg, rgba(22,163,74,0.12) 0%, rgba(22,163,74,0.06) 100%);
    border-color: rgba(22,163,74,0.3);
}
[data-theme="dark"] .decision-summary-card.severity-positive .decision-title { color: #BBF7D0; }
[data-theme="dark"] .decision-summary-card.severity-positive .decision-description { color: #DCFCE7; }

/* Responsive Decision Card */
@media (max-width: 640px) {
    .decision-summary-card {
        padding: 16px;
        gap: 12px;
    }
    .decision-summary-card .decision-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .decision-summary-card .decision-title {
        font-size: 14px;
    }
    .decision-summary-card .decision-description {
        font-size: 12px;
    }
    .decision-summary-card .decision-action {
        font-size: 11px;
        padding: 5px 12px;
    }
}

/* ============================================================================
   Trend Narrative — plain-English executive summary paragraph
   ============================================================================ */
.trend-narrative {
    padding: 20px 24px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    animation: narrativeReveal 0.5s ease-out 0.15s both;
}

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

.trend-narrative .narrative-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.trend-narrative .narrative-label svg {
    width: 14px;
    height: 14px;
}

.trend-narrative .narrative-text {
    margin: 0;
}

.trend-narrative .narrative-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.trend-narrative .narrative-highlight-up {
    color: #16A34A;
    font-weight: 600;
}

.trend-narrative .narrative-highlight-down {
    color: #DC2626;
    font-weight: 600;
}

[data-theme="dark"] .trend-narrative {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-secondary);
}

/* Responsive Trend Narrative */
@media (max-width: 640px) {
    .trend-narrative {
        padding: 14px 16px;
        font-size: 13px;
        line-height: 1.6;
    }
    .trend-narrative .narrative-label {
        font-size: 10px;
    }
}

/* Accessibility: respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .decision-summary-card,
    .trend-narrative,
    .kpi-card {
        animation: none !important;
    }
}

/* Executive Dashboard */
.executive-dashboard {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

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

.dashboard-header h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.dashboard-date {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.kpi-card {
    padding: 24px;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--gray-50) 100%);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    animation: kpiCardReveal 0.4s ease-out both;
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.1s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.2s; }

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

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 500;
}

.kpi-sublabel {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 8px;
    font-weight: 400;
    opacity: 0.85;
}

.kpi-change {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.kpi-change.positive { 
    color: var(--success); 
    background: var(--success-bg);
}
.kpi-change.negative { 
    color: var(--error); 
    background: var(--error-bg);
}

/* KPI Card Color Variants */
.kpi-card.neutral {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #e2e8f0;
}

.kpi-card.up {
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}
.kpi-card.up .kpi-value {
    color: #15803d;
}
.kpi-card.up .kpi-icon {
    color: #22c55e;
}

.kpi-card.warning {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
}
.kpi-card.warning .kpi-value {
    color: #a16207;
}
.kpi-card.warning .kpi-icon {
    color: #eab308;
}

.kpi-card.down {
    background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}
.kpi-card.down .kpi-value {
    color: #b91c1c;
}
.kpi-card.down .kpi-icon {
    color: #ef4444;
}

.kpi-card.info {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}
.kpi-card.info .kpi-value {
    color: #1d4ed8;
}
.kpi-card.info .kpi-icon {
    color: #3b82f6;
}

/* Smart Insights - Compact Design */
.smart-insights {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
}

.insights-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.insights-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.insights-icon {
    font-size: 16px;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border-left: 3px solid var(--border);
    transition: all 0.2s ease;
}

.insight-item.warning {
    border-left-color: #F59E0B;
    background: rgba(245, 158, 11, 0.05);
}

.insight-item.positive {
    border-left-color: #10B981;
    background: rgba(16, 185, 129, 0.05);
}

.insight-item.negative {
    border-left-color: #EF4444;
    background: rgba(239, 68, 68, 0.05);
}

.insight-item.neutral {
    border-left-color: #6B7280;
    background: var(--gray-50);
}

/* Strategic decision insight types (risk / opportunity / focus) */
.insight-item.critical {
    border-left-color: #DC2626;
    border-left-width: 4px;
    background: rgba(220, 38, 38, 0.06);
}

.insight-item.opportunity {
    border-left-color: #7C3AED;
    border-left-width: 4px;
    background: rgba(124, 58, 237, 0.05);
}

.insight-item.focus {
    border-left-color: #2563EB;
    border-left-width: 4px;
    background: rgba(37, 99, 235, 0.05);
}

.insight-item:last-child {
    margin-bottom: 0;
}

.insight-item .insight-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

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

.insight-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.insight-description {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Results Summary Cards */
.results-summary {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 20px 24px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    transition: all 0.2s ease;
    min-width: 140px;
    max-width: 180px;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-card.primary {
    background: linear-gradient(135deg, var(--primary-bg) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: rgba(37, 99, 235, 0.2);
}

.summary-card.success {
    background: linear-gradient(135deg, var(--success-bg) 0%, rgba(167, 243, 208, 0.3) 100%);
    border-color: rgba(5, 150, 105, 0.2);
}

.summary-card.warning {
    background: linear-gradient(135deg, var(--warning-bg) 0%, rgba(253, 230, 138, 0.3) 100%);
    border-color: rgba(217, 119, 6, 0.2);
}

.summary-icon {
    font-size: 24px;
    display: none;
}

.summary-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.summary-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.summary-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Results Legend */
.results-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-muted);
    justify-content: center;
    flex-wrap: wrap;
}

.results-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.results-legend .legend-item.increase .legend-color { background: var(--success); }
.results-legend .legend-item.decrease .legend-color { background: var(--error); }
.results-legend .legend-item.new-item .legend-color { background: var(--primary); }
.results-legend .legend-item.removed .legend-color { background: var(--warning); }

/* Table Toolbar - Modern Action Bar */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}

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

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

.toolbar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.info-icon {
    font-size: 14px;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn .btn-icon {
    font-size: 16px;
}

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

.toolbar-btn.fullscreen-btn:hover {
    background: var(--gray-100);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.toolbar-btn.download-btn {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.toolbar-btn.download-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
}

.toolbar-btn.download-btn:active {
    transform: translateY(0);
}

/* Results Table Wrapper - for fullscreen */
.results-table-wrapper {
    position: relative;
    transition: all 0.3s ease;
}

.results-table-wrapper.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
}

/* Fullscreen toolbar overlay */
.fullscreen-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border);
}

.results-table-wrapper.fullscreen .fullscreen-header {
    display: flex;
}

.fullscreen-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.fullscreen-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.fullscreen-close-btn:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

/* Hide scrollbar on body when fullscreen */
body.table-fullscreen {
    overflow: hidden;
}

/* Fullscreen button active state */
.toolbar-btn.fullscreen-btn.active {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}

/* Results Table */
.results-table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
    padding: 24px;
    position: relative;
}

/* Custom scrollbar for table container */
.results-table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.results-table-container::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 5px;
}

.results-table-container::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 5px;
}

.results-table-container::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

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

.results-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--gray-100);
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.results-table tbody tr:hover {
    background: var(--gray-50);
}

.results-table .value-up {
    color: var(--success);
    font-weight: 600;
}

.results-table .value-down {
    color: var(--error);
    font-weight: 600;
}

.results-table .value-new {
    color: var(--primary);
    font-weight: 600;
}

.results-table .value-removed {
    color: var(--warning);
    font-weight: 600;
}

/* Row status classes */
.results-table tr.row-increase td:first-child { border-left: 4px solid var(--success); }
.results-table tr.row-decrease td:first-child { border-left: 4px solid var(--error); }
.results-table tr.row-new td:first-child { border-left: 4px solid var(--primary); }
.results-table tr.row-removed td:first-child { border-left: 4px solid var(--warning); }

/* ============================================================================
   Modern Trend Icons (Results Table)
   ============================================================================ */
.trend-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.trend-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.trend-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Trend Up - Green */
.trend-icon-up {
    color: #059669;
}

.trend-icon-up svg {
    filter: drop-shadow(0 1px 2px rgba(5, 150, 105, 0.3));
}

/* Trend Down - Red */
.trend-icon-down {
    color: #dc2626;
}

.trend-icon-down svg {
    filter: drop-shadow(0 1px 2px rgba(220, 38, 38, 0.3));
}

/* Trend New - Blue/Purple */
.trend-icon-new {
    color: #7c3aed;
}

.trend-icon-new svg {
    width: 16px;
    height: 16px;
}

.trend-icon-new .trend-label {
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
}

/* Trend Removed - Orange */
.trend-icon-removed {
    color: #d97706;
}

.trend-icon-removed svg {
    width: 16px;
    height: 16px;
}

.trend-icon-removed .trend-label {
    background: linear-gradient(135deg, #d97706 0%, #ea580c 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
}

/* Trend Same - Gray */
.trend-icon-same {
    color: var(--gray-400);
}

.trend-icon-same svg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
}

/* Metrics table row styles */
.row-metrics.trend-up {
    background: rgba(5, 150, 105, 0.04);
}

.row-metrics.trend-down {
    background: rgba(220, 38, 38, 0.04);
}

.row-metrics.trend-new {
    background: rgba(124, 58, 237, 0.04);
}

.row-metrics.trend-removed {
    background: rgba(217, 119, 6, 0.04);
}

.row-metrics-total {
    background: var(--gray-100) !important;
    border-top: 2px solid var(--gray-300);
    font-weight: 600;
}

.col-trend {
    text-align: center;
    width: 80px;
}

/* Change column colors */
.change-positive {
    color: #059669 !important;
    font-weight: 500;
}

.change-negative {
    color: #dc2626 !important;
    font-weight: 500;
}

/* Dark mode for trend icons */
[data-theme="dark"] .trend-icon-up {
    color: #34d399;
}

[data-theme="dark"] .trend-icon-down {
    color: #f87171;
}

[data-theme="dark"] .trend-icon-new {
    color: #a78bfa;
}

[data-theme="dark"] .trend-icon-removed {
    color: #fbbf24;
}

[data-theme="dark"] .trend-icon-same {
    color: var(--gray-500);
}

[data-theme="dark"] .row-metrics.trend-up {
    background: rgba(52, 211, 153, 0.08);
}

[data-theme="dark"] .row-metrics.trend-down {
    background: rgba(248, 113, 113, 0.08);
}

[data-theme="dark"] .row-metrics.trend-new {
    background: rgba(167, 139, 250, 0.08);
}

[data-theme="dark"] .row-metrics.trend-removed {
    background: rgba(251, 191, 36, 0.08);
}

[data-theme="dark"] .row-metrics-total {
    background: var(--bg-secondary) !important;
    border-top-color: var(--border-color);
}

[data-theme="dark"] .change-positive {
    color: #34d399 !important;
}

[data-theme="dark"] .change-negative {
    color: #f87171 !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-content h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-content p {
    color: var(--text-muted);
}

.results-footer {
    padding: 16px 24px;
    text-align: center;
    background: var(--gray-50);
    border-top: 1px solid var(--border);
}

/* ============================================================================
   Data Quality Panel
   ============================================================================ */
.data-quality-panel {
    padding: 24px 32px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
}

.quality-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

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

.quality-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.quality-scores {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    align-items: start;
}

.quality-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.quality-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.quality-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.quality-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
}

.quality-ring-fill {
    fill: none;
    stroke: var(--success);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.quality-percent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.quality-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.quality-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quality-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-card);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-secondary);
}

.q-icon {
    font-size: 14px;
}

.quality-divider {
    width: 1px;
    background: var(--border);
}

/* ============================================================================
   Data Quality Panel - Compact Modern Design
   ============================================================================ */
.data-quality-panel.compact {
    padding: 16px 24px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
}

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

.quality-header-icon {
    color: var(--primary);
    flex-shrink: 0;
}

.quality-header-compact h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.quality-row {
    display: flex;
    gap: 24px;
}

.quality-file-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.quality-file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quality-file-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.quality-score-compact {
    position: relative;
    width: 40px;
    height: 40px;
}

.quality-ring-compact {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.quality-score-compact .quality-percent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.quality-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.quality-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.quality-stat svg {
    color: var(--gray-400);
    flex-shrink: 0;
}

.quality-stat strong {
    color: var(--text-primary);
    font-weight: 600;
}

.quality-stat.warning-stat {
    color: var(--warning);
}

.quality-stat.warning-stat svg {
    color: var(--warning);
}

.quality-note {
    font-size: 11px;
    color: var(--text-muted);
    padding: 6px 8px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--warning);
}

.quality-note.good {
    border-left-color: var(--success);
    color: var(--success);
}

/* Responsive for compact quality panel */
@media (max-width: 640px) {
    .quality-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* ============================================================================
   Features Section
   ============================================================================ */
.features-section, .usecases-section, .faq-section {
    padding: 80px 48px;
    max-width: 1200px;
    margin: 0 auto;
}

.features-header, .usecases-header {
    text-align: center;
    margin-bottom: 48px;
}

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

.feature-card {
    padding: 36px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 44px;
    margin-bottom: 20px;
    display: inline-block;
    transition: transform 0.25s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-card h3 {
    font-size: 17px;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Use Cases */
.usecases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.usecase-card {
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.usecase-scenario {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.usecase-icon {
    font-size: 28px;
}

.usecase-question {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.usecase-solution {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.usecase-time {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

/* Value Message */
.value-message {
    margin-top: 48px;
    padding: 40px;
    background: var(--primary-bg);
    border-radius: var(--radius-lg);
    text-align: center;
}

.value-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.value-message blockquote {
    font-size: 18px;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.value-context {
    font-size: 14px;
    color: var(--text-muted);
}

/* ============================================================================
   FAQ Section
   ============================================================================ */
.faq-container {
    max-width: 700px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.faq-toggle {
    font-size: 20px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

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

.faq-answer {
    display: none;
    padding-bottom: 20px;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================================================
   Tool Footer (Modern Professional)
   ============================================================================ */
.tool-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 32px 48px;
}

.tool-footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tool-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 24px;
}

.tool-footer-col h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-footer-col h4 svg {
    color: #10b981;
}

.tool-footer-col a {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.15s;
}

.tool-footer-col a:hover {
    color: var(--primary);
}

.footer-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.footer-company-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-company-link:hover {
    color: var(--primary);
}

.footer-company-link svg {
    opacity: 0.7;
}

.footer-privacy-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.footer-format-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.tool-footer-bottom {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.tool-footer-copyright {
    font-size: 12px;
    color: var(--text-secondary);
}

.tool-footer-copyright a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.tool-footer-copyright a:hover {
    color: var(--primary);
}

.tool-footer-legal {
    display: flex;
    gap: 20px;
}

.footer-offline-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

.footer-offline-badge svg {
    color: #10b981;
}

/* Legacy footer - keep for backwards compatibility */
.footer {
    padding: 40px 48px;
    background: var(--gray-900);
    color: white;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

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

.footer-pro {
    color: var(--primary-light);
}

.footer-region {
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.footer-divider {
    margin: 0 8px;
    opacity: 0.5;
}

.footer-tagline {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 8px;
}

.footer-copyright {
    font-size: 12px;
    opacity: 0.5;
}

/* Responsive footer */
@media (max-width: 768px) {
    .tool-footer {
        padding: 24px;
    }
    
    .tool-footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .tool-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================================
   Loading Overlay
   ============================================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: var(--bg-card);
    padding: 40px 60px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================================================
   Modals
   ============================================================================ */
.templates-modal, .shortcuts-panel, .onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.templates-content, .shortcuts-content, .onboarding-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.templates-close, .shortcuts-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
}

.templates-close:hover, .shortcuts-close:hover {
    background: var(--gray-200);
}

.templates-content h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.templates-content > p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.template-card {
    padding: 20px;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

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

.template-icon {
    font-size: 28px;
    margin-bottom: 12px;
    display: block;
}

.template-card h4 {
    font-size: 14px;
    margin-bottom: 6px;
}

.template-card p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Shortcuts */
.shortcuts-content h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.shortcut-row kbd {
    background: var(--gray-200);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

/* Onboarding */
.onboarding-header {
    text-align: center;
    font-size: 32px;
    margin-bottom: 12px;
}

.onboarding-modal h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 8px;
}

.onboarding-tagline {
    text-align: center;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 32px;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.step-content h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-muted);
}

.onboarding-shortcuts {
    margin-bottom: 24px;
}

.onboarding-shortcuts h5 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

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

.shortcut kbd {
    background: var(--gray-200);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.onboarding-start {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.onboarding-remember {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.toast-notification {
    background: var(--gray-900);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    to { transform: rotate(360deg); }
}

.toast-content strong {
    display: block;
    margin-bottom: 4px;
}

.toast-content p {
    font-size: 13px;
    opacity: 0.8;
    color: white;
}


/* ============================================================================
   License Modal - Professional, Discreet
   ============================================================================ */
.license-modal-overlay {
    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: 10000;
    backdrop-filter: blur(4px);
}

.license-modal {
    background: var(--bg-primary, #fff);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    margin: 20px;
    animation: licenseModalIn 0.2s ease-out;
}

@keyframes licenseModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.license-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.license-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.license-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.license-modal-close:hover {
    color: var(--text-primary, #111827);
}

.license-modal-body {
    padding: 24px;
}

.license-modal-body p {
    margin: 0 0 16px 0;
    color: var(--text-secondary, #6b7280);
    font-size: 14px;
    line-height: 1.5;
}

.license-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    color: var(--text-primary, #111827);
    background: var(--bg-secondary, #f9fafb);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.license-input:focus {
    outline: none;
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.license-input.license-input-error {
    border-color: var(--error, #dc2626);
    animation: shake 0.3s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.license-error {
    margin: 12px 0 0 0;
    padding: 10px 12px;
    background: var(--error-bg, #fef2f2);
    border: 1px solid var(--error-border, #fecaca);
    border-radius: var(--radius);
    color: var(--error, #dc2626);
    font-size: 13px;
}

.license-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
    border-radius: 0 0 12px 12px;
}

.license-btn-secondary,
.license-btn-primary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.license-btn-secondary {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-secondary, #6b7280);
}

.license-btn-secondary:hover {
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-primary, #111827);
}

.license-btn-primary {
    background: var(--primary, #2563eb);
    border: 1px solid var(--primary, #2563eb);
    color: white;
}

.license-btn-primary:hover {
    background: var(--primary-hover, #1d4ed8);
    border-color: var(--primary-hover, #1d4ed8);
}

/* Buy License Button - Primary CTA in modal */
.license-btn-buy {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary, #2563eb) 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.license-btn-buy:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Divider in modal */
.license-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted, #9ca3af);
    font-size: 13px;
}

.license-divider::before,
.license-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, #e5e7eb);
}

.license-divider span {
    padding: 0 12px;
}

/* Navbar Upgrade Button */
.nav-upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-left: 8px;
    background: linear-gradient(135deg, var(--primary, #2563eb) 0%, #1d4ed8 100%);
    color: white !important;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.nav-upgrade-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
    color: white !important;
}

/* Hide upgrade button for Pro users (handled by JS) */
.nav-upgrade-btn.hidden {
    display: none;
}

/* Footer Pro link - discreet */
.footer-pro-link {
    color: var(--text-muted, #9ca3af);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.footer-pro-link:hover {
    color: var(--primary, #2563eb);
}

.footer-separator {
    color: var(--text-muted, #9ca3af);
    margin: 0 8px;
    font-size: 10px;
}

/* Dark mode support for license modal */
[data-theme="dark"] .license-modal {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .license-input {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .license-modal-footer {
    background: var(--bg-secondary);
}

/* ============================================================================
   Row Limit Note (Free tier - subtle, non-aggressive)
   ============================================================================ */
.row-limit-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    margin-top: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.row-limit-note .note-text {
    flex: 1;
}

.row-limit-note .unlock-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.row-limit-note .unlock-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Dark mode for row limit note */
[data-theme="dark"] .row-limit-note {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .row-limit-note .note-text {
    color: var(--text-muted);
}

/* ============================================================================
   Preview Button & Modal
   ============================================================================ */

/* Preview Button - appears next to file info */
.preview-data-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 12px;
}

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

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

/* Preview Modal Overlay */
.preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.preview-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Preview Modal Container */
.preview-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.preview-modal-overlay.visible .preview-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--gray-50);
}

.preview-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-modal-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.preview-modal-title .file-badge {
    padding: 4px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.preview-modal-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.preview-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.preview-modal-close:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.preview-modal-close svg {
    width: 18px;
    height: 18px;
}

/* Modal Body - Table Container */
.preview-modal-body {
    flex: 1;
    overflow: auto;
    padding: 0;
}

/* Preview Table */
.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.preview-table th {
    padding: 12px 16px;
    background: var(--gray-100);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

.preview-table td {
    padding: 10px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-table tbody tr:hover {
    background: var(--gray-50);
}

.preview-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.preview-table tbody tr:nth-child(even):hover {
    background: var(--gray-50);
}

/* Row number column */
.preview-table .row-num {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    min-width: 40px;
    background: var(--gray-50);
}

.preview-table th.row-num {
    background: var(--gray-200);
}

/* Modal Footer */
.preview-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--gray-50);
}

.preview-modal-info {
    font-size: 12px;
    color: var(--text-muted);
}

.preview-modal-actions .btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.preview-modal-actions .btn:hover {
    background: var(--primary-hover);
}

/* Dark Theme Adjustments */
[data-theme="dark"] .preview-modal-header,
[data-theme="dark"] .preview-modal-footer {
    background: var(--gray-800);
}

[data-theme="dark"] .preview-table th {
    background: var(--gray-700);
}

[data-theme="dark"] .preview-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .preview-table tbody tr:hover {
    background: var(--gray-700);
}

[data-theme="dark"] .preview-table .row-num {
    background: var(--gray-800);
}

[data-theme="dark"] .preview-table th.row-num {
    background: var(--gray-700);
}

/* Responsive */
@media (max-width: 640px) {
    .preview-modal {
        width: 95%;
        max-height: 90vh;
    }

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

    .preview-data-btn span {
        display: none;
    }

    .preview-data-btn {
        padding: 6px 8px;
        margin-left: 8px;
    }
}

/* ============================================================================
   Quick Re-Run Banner - Subtle & Modern
   ============================================================================ */
.rerun-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(16, 185, 129, 0.06) 100%);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.rerun-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.rerun-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, #10b981 100%);
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
}

.rerun-icon svg {
    width: 16px;
    height: 16px;
}

.rerun-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rerun-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.rerun-desc {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rerun-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.rerun-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

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

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

.rerun-btn.secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.rerun-btn.secondary:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

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

/* Responsive */
@media (max-width: 640px) {
    .rerun-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .rerun-content {
        justify-content: flex-start;
    }

    .rerun-actions {
        justify-content: flex-end;
    }

    .rerun-desc {
        white-space: normal;
    }
}

/* Dark mode */
[data-theme="dark"] .rerun-banner {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .rerun-title {
    color: var(--text-primary);
}

[data-theme="dark"] .rerun-desc {
    color: var(--text-muted);
}

[data-theme="dark"] .rerun-btn.secondary {
    border-color: var(--border);
}

[data-theme="dark"] .rerun-btn.secondary:hover {
    background: var(--gray-700);
    color: var(--text-primary);
}

/* ============================================================================
   Floating Mobile Action Bar
   Shows Restart / Download after files loaded — mobile only
   ============================================================================ */
.mobile-fab {
    display: none;
}

@media (max-width: 768px) {
    .mobile-fab {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9000;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        padding: 10px 16px;
        gap: 8px;
        align-items: center;
        justify-content: center;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .mobile-fab.visible {
        transform: translateY(0);
    }

    .mobile-fab-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px 16px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-card);
        color: var(--text-secondary);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.15s ease;
        flex: 1;
        font-family: var(--font-sans);
    }

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

    .mobile-fab-btn:hover,
    .mobile-fab-btn:active {
        background: var(--gray-50);
    }

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

    .mobile-fab-btn.primary:hover,
    .mobile-fab-btn.primary:active {
        background: var(--primary-hover);
    }

    .mobile-fab-btn.danger {
        color: var(--error);
        border-color: rgba(220, 38, 38, 0.3);
    }

    .mobile-fab-btn.danger:hover,
    .mobile-fab-btn.danger:active {
        background: var(--error-bg);
    }

    /* Add bottom padding to body so content isn't hidden behind FAB */
    body.fab-active {
        padding-bottom: 72px;
    }

    [data-theme="dark"] .mobile-fab {
        background: var(--bg-card);
        border-color: var(--border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }
}

/* ============================================================================
   Collapsible Section Toggle (mobile)
   ============================================================================ */
.section-collapse-toggle {
    display: none;
}

@media (max-width: 768px) {
    .section-collapse-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border: none;
        background: var(--gray-100);
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
        color: var(--text-muted);
        flex-shrink: 0;
    }

    .section-collapse-toggle svg {
        width: 14px;
        height: 14px;
        transition: transform 0.2s ease;
    }

    .section-collapse-toggle.collapsed svg {
        transform: rotate(-90deg);
    }

    .section-collapse-toggle:hover {
        background: var(--gray-200);
        color: var(--text-primary);
    }

    .collapsible-body {
        transition: max-height 0.3s ease, opacity 0.2s ease;
        overflow: hidden;
    }

    .collapsible-body.collapsed {
        max-height: 0 !important;
        opacity: 0;
        margin: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* ============================================================================
   Mobile KPI Compact
   ============================================================================ */
@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .kpi-card {
        padding: 14px 10px;
    }

    .kpi-icon {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .kpi-value {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .kpi-label {
        font-size: 10px;
        letter-spacing: 0.3px;
    }

    .kpi-sublabel {
        font-size: 9px;
        margin-bottom: 4px;
    }

    .kpi-change {
        font-size: 11px;
        padding: 2px 8px;
    }

    .kpi-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* Executive Dashboard compact */
    .executive-dashboard {
        padding: 16px;
        margin-bottom: 16px;
    }

    .dashboard-header {
        margin-bottom: 14px;
        padding-bottom: 10px;
    }

    .dashboard-header h4 {
        font-size: 14px;
    }

    /* Smart Insights compact */
    .smart-insights {
        padding: 14px;
    }

    .insights-header h4 {
        font-size: 13px;
    }

    .insight-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .insight-title {
        font-size: 12px;
    }

    .insight-description {
        font-size: 11px;
    }

    /* Results legend compact */
    .results-legend {
        gap: 8px;
        padding: 10px 16px;
        font-size: 11px;
    }

    .legend-item {
        gap: 4px;
    }

    /* Export buttons — row, not stacked */
    .single-tool-mode .results-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .single-tool-mode .results-actions .btn {
        flex: 0 1 auto;
        padding: 8px 12px;
        font-size: 11px;
        width: auto;
    }
}

@media (max-width: 500px) {
    .kpi-grid {
        gap: 8px;
    }

    .kpi-card {
        padding: 12px 8px;
    }

    .kpi-value {
        font-size: 18px;
    }

    .kpi-label {
        font-size: 9px;
    }

    .kpi-change {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Export buttons — icon only on small phone */
    .single-tool-mode .results-actions .btn span:not([aria-hidden]) {
        display: none;
    }

    .single-tool-mode .results-actions .btn {
        padding: 10px;
        min-width: 40px;
    }
}

/* ============================================================================
   MOBILE FIX — Upload Area & Dropzones
   Stack vertically, reduce padding, fix VS divider
   ============================================================================ */

@media (max-width: 768px) {
    .upload-area {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 20px 16px;
    }

    .file-dropzone {
        padding: 28px 20px;
    }

    .dropzone-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 12px;
    }

    .vs-divider {
        flex-direction: row;
        padding: 12px 0;
    }

    .vs-icon {
        font-size: 20px;
    }

    .vs-icon svg {
        transform: rotate(90deg);
    }

    .vs-text {
        font-size: 12px;
        padding: 6px 12px;
    }

    /* Column Selection — reduce padding, stack selectors */
    .column-selection {
        padding: 28px 16px;
    }

    .column-selectors {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .column-selectors.inline {
        grid-template-columns: 1fr;
        gap: 12px;
    }

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

    .selection-subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }

    /* Config steps — tighter */
    .config-step {
        gap: 12px;
    }

    .compare-mode-selection .mode-buttons {
        flex-direction: column;
    }

    /* Data Quality Panel — tighter padding */
    .data-quality-panel.compact {
        padding: 16px 12px;
    }
}

@media (max-width: 500px) {
    .upload-area {
        padding: 16px 12px;
    }

    .file-dropzone {
        padding: 24px 16px;
    }

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

    .dropzone-text {
        font-size: 12px;
    }

    .dropzone-formats {
        font-size: 11px;
    }

    .dropzone-trust {
        font-size: 10px;
    }

    /* Column Selection — phone */
    .column-selection {
        padding: 20px 12px;
    }

    .selection-title {
        font-size: 16px;
    }

    .column-dropdown {
        font-size: 13px;
        padding: 10px 12px;
    }

    .config-step-num {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .field-hint {
        font-size: 11px;
    }

    .btn-compare {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }
}