/* ============================================================================
   PDFTable - Styles
   Part of Mubsira Analytics
   Professional rewrite: verdict dashboard, table cards, guided flow
   No emojis, no em dashes
   ============================================================================ */

/* ============================================================================
   CSS Variables
   ============================================================================ */
:root {
    --primary: #dc2626;
    --primary-hover: #b91c1c;
    --primary-light: #ef4444;
    --primary-bg: #fef2f2;
    --primary-border: #fecaca;

    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;

    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;

    --info: #2563eb;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    --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;

    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --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);

    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

/* ============================================================================
   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;
}

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

/* ============================================================================
   Navigation (Unified Mubsira Shell)
   ============================================================================ */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background-color: rgba(15, 24, 37, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.02em;
}
.nav-brand .brand-dot { color: #dc2626; }
.nav-brand .brand-sep {
    opacity: 0.3;
    font-weight: 400;
    margin: 0 4px;
}
.nav-brand .brand-app {
    font-weight: 600;
    opacity: 0.85;
}

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

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}
.nav-links a {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: color 0.15s ease;
}
.nav-links a:hover { color: #fff; }

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

.nav-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    transition: background 0.15s;
}
.nav-btn:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.lang-code {
    font-size: 12px;
    font-weight: 600;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    width: 20px;
    height: 2px;
    background: rgba(255,255,255,0.6);
    border-radius: 1px;
    transition: all 0.2s ease;
}

.nav-mobile-only { display: none; }
.nav-pro-link { color: var(--primary-light) !important; font-weight: 500 !important; }

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    text-decoration: none;
    color: var(--text-primary);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 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-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover:not(:disabled) {
    background: #047857;
}

.btn-large {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.btn-icon:hover {
    background: var(--gray-50);
    border-color: var(--border-strong);
}

/* ============================================================================
   Hero Section
   ============================================================================ */
.hero {
    padding: 120px 24px 60px;
    background: var(--bg-page);
}

.hero-container {
    max-width: 720px;
    margin: 0 auto;
}

.hero-content {
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.5;
}

.hero-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-privacy {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    max-width: 560px;
    margin: 0 auto 32px;
}
.hero-privacy svg {
    flex-shrink: 0;
    color: var(--success);
    margin-top: 2px;
}
.privacy-headline {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.privacy-detail {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* ============================================================================
   Sections (shared)
   ============================================================================ */
.section-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.section-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 560px;
    margin: 8px auto 0;
    line-height: 1.6;
}

/* ============================================================================
   How It Works
   ============================================================================ */
.how-it-works {
    padding: 80px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.how-it-works h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.step-card {
    text-align: center;
    padding: 24px 16px;
    position: relative;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 16px;
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-md);
    margin: 0 auto 16px;
    color: var(--primary);
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================================================================
   Engine / Under the Hood Section
   ============================================================================ */
.engine-section {
    padding: 80px 24px;
    background: var(--bg-page);
}

.engine-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.engine-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 48px;
    text-align: left;
}

.engine-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.engine-card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-md);
}

.engine-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    color: var(--primary);
    margin-bottom: 16px;
}

.engine-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.engine-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Engine Comparison Table (real <table>) */
.engine-comparison {
    margin-top: 56px;
    text-align: left;
}

.engine-comparison-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-primary);
}

.engine-comparison-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.engine-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.engine-comparison-table thead th {
    padding: 14px 20px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.engine-th--generic {
    background: var(--gray-100);
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    width: 50%;
}

.engine-th--pdftable {
    background: var(--primary-bg);
    color: var(--primary);
    border-bottom: 2px solid var(--primary-border);
    width: 50%;
}

.engine-comparison-table tbody tr {
    border-top: 1px solid var(--border);
}

.engine-comparison-table tbody tr:first-child {
    border-top: none;
}

.engine-td--generic {
    padding: 14px 20px 14px 32px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
    background: var(--gray-50);
    border-right: 1px solid var(--border);
    position: relative;
    vertical-align: top;
}

.engine-td--generic::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 19px;
    width: 8px;
    height: 2px;
    background: var(--gray-400);
    border-radius: 1px;
}

.engine-td--pdftable {
    padding: 14px 20px 14px 32px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    vertical-align: top;
}

.engine-td--pdftable::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 17px;
    width: 10px;
    height: 6px;
    border-left: 2px solid var(--success);
    border-bottom: 2px solid var(--success);
    transform: rotate(-45deg);
}

/* Engine responsive */
@media (max-width: 768px) {
    .engine-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .engine-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================================
   Limits / Transparency Section
   ============================================================================ */
.limits-section {
    padding: 80px 24px;
    background: var(--bg-page);
}

.limits-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.limits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 40px;
    text-align: left;
}

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

.limits-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.limits-card--yes h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
}

.limits-card--no h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
}

.limits-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.limits-card li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 20px;
    position: relative;
}

.limits-card--yes li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    opacity: 0.6;
}

.limits-card--no li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    background: var(--gray-400);
    border-radius: 50%;
    opacity: 0.6;
}

.limits-promise {
    margin-top: 32px;
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: var(--radius-md);
    padding: 20px 28px;
    text-align: left;
}

.limits-promise p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 500;
}

/* ============================================================================
   App Section
   ============================================================================ */
.app-section {
    padding: 60px 24px 80px;
    background: var(--bg-page);
    min-height: 50vh;
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ============================================================================
   Step Indicator
   ============================================================================ */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.step-indicator-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    transition: all 0.2s;
}

.step-indicator-item.active {
    color: var(--primary);
    background: var(--primary-bg);
}

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

.step-indicator-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text-muted);
    flex-shrink: 0;
}

.step-indicator-item.active .step-indicator-num {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.step-indicator-item.completed .step-indicator-num {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.step-indicator-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}

.step-indicator-line.completed {
    background: var(--success);
}

/* ============================================================================
   Upload Area
   ============================================================================ */
.upload-area {
    max-width: 560px;
    margin: 0 auto;
}

.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 40px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.upload-icon {
    color: var(--primary);
    opacity: 0.7;
}

.upload-zone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-zone p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.upload-format {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.upload-privacy {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}

/* ============================================================================
   Processing Status
   ============================================================================ */
.processing-status {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.status-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Inline spinner for export buttons */
.btn-spinner {
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

.status-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

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

/* ============================================================================
   File Info Bar
   ============================================================================ */
.file-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.file-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

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

.file-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================================================
   Verdict Dashboard
   ============================================================================ */
.verdict-dashboard {
    margin-bottom: 24px;
}

.verdict-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.verdict-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.verdict-card--good .verdict-icon {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.verdict-card--mixed .verdict-icon {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.verdict-card--poor .verdict-icon,
.verdict-card--none .verdict-icon {
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid var(--primary-border);
}

.verdict-body {
    flex: 1;
}

.verdict-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.verdict-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Summary Stats Row */
.summary-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-stat-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================================================
   Table Cards Grid
   ============================================================================ */
.tables-section {
    margin-bottom: 24px;
}

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

.tables-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tables-filter {
    display: flex;
    gap: 6px;
}

.filter-btn {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.table-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.table-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.table-card--fragment {
    opacity: 0.7;
    border-style: dashed;
}

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

.table-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.table-card-quality {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.quality-good {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.quality-fair {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.quality-poor {
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid var(--primary-border);
}

.quality-fragment {
    background: var(--gray-100);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.quality-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.table-card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.table-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.table-card-preview {
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    max-height: 120px;
}

.table-card-preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.table-card-preview th {
    background: var(--gray-100);
    padding: 4px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

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

.table-card-note {
    font-size: 0.78rem;
    color: var(--warning);
    font-weight: 500;
    line-height: 1.4;
    padding: 8px 12px;
    background: var(--warning-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--warning-border);
}

.table-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.table-card-actions .btn {
    flex: 1;
}

/* Fragment toggle */
.fragment-toggle {
    text-align: center;
    margin-top: 8px;
}

.fragment-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.15s;
}
.fragment-toggle-btn:hover {
    color: var(--text-secondary);
    border-color: var(--border-strong);
}

/* ============================================================================
   Detail View (Review a single table)
   ============================================================================ */
.detail-view {
    display: none;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.detail-view.active {
    display: block;
}

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

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.15s;
}
.detail-back:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Detail table label in header */
.detail-table-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-table-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-export-actions {
    display: flex;
    gap: 8px;
}

/* ============================================================================
   Detail Info Panel (replaces generic guidance box)
   ============================================================================ */

/* Detail info panel collapse toggle — hidden on desktop */
.detail-info-collapse-toggle {
    display: none;
}

.info-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
}

.info-panel--good {
    border-left: 4px solid var(--success);
}

.info-panel--fair {
    border-left: 4px solid var(--warning);
}

.info-panel--poor {
    border-left: 4px solid var(--primary);
}

.info-panel-left {
    padding: 20px 24px;
    border-right: 1px solid var(--border);
}

.info-panel-right {
    padding: 20px 24px;
    background: var(--gray-50);
}

.info-panel-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.info-facts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.info-fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-fact .fact-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.info-fact .fact-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.info-fact.fact-good .fact-value { color: var(--success); }
.info-fact.fact-fair .fact-value { color: var(--warning); }
.info-fact.fact-poor .fact-value { color: var(--primary); }
.info-fact.fact-warning .fact-value { color: var(--warning); }
.info-fact.fact-info .fact-value { color: var(--info); }

.guidance-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guidance-list li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 16px;
    position: relative;
}

.guidance-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 4px;
    height: 4px;
    background: var(--info);
    border-radius: 50%;
}

/* Split View */
.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 500px;
}

.split-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 0; /* prevent grid blowout */
}

/* Override for table panel to allow horizontal scroll */
.split-panel--table {
    overflow: visible;
    min-width: 0; /* prevent grid blowout */
}

/* ============================================================================
   Fullscreen Table Mode
   ============================================================================ */
.panel-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-fullscreen-table {
    position: relative;
}

/* Show expand icon, hide collapse icon by default */
.btn-fullscreen-table .icon-collapse {
    display: none;
}
.btn-fullscreen-table .icon-expand {
    display: block;
}

/* In fullscreen mode, swap icons */
.table-fullscreen .btn-fullscreen-table .icon-expand {
    display: none;
}
.table-fullscreen .btn-fullscreen-table .icon-collapse {
    display: block;
}

/* Fullscreen panel state */
.split-panel--table.table-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 400;
    border-radius: 0;
    border: none;
    overflow: hidden;
    background: var(--bg-card);
    animation: tableFullscreenIn 0.25s ease-out;
}

.table-fullscreen .panel-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    z-index: 2;
}

.table-fullscreen .panel-body.table-container {
    padding: 0;
    overflow: hidden;
    height: calc(100vh - 50px);
}

.table-fullscreen .table-wrapper {
    max-height: calc(100vh - 50px);
    max-width: 100vw;
    overflow: auto;
}

/* Prevent body scroll when fullscreen is active */
body.table-fullscreen-active {
    overflow: hidden;
}

@keyframes tableFullscreenIn {
    from {
        opacity: 0.7;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile fullscreen adjustments */
@media (max-width: 768px) {
    .table-fullscreen .panel-header {
        padding: 10px 12px;
        padding-top: max(10px, env(safe-area-inset-top));
    }
    .table-fullscreen .panel-body.table-container {
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
    }
    .table-fullscreen .table-wrapper {
        max-height: calc(100vh - 46px);
        max-height: calc(100dvh - 46px);
    }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--gray-50);
}

.panel-header h3 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.page-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.panel-body {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

/* PDF Canvas */
.pdf-canvas-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: var(--gray-100);
}

#pdfCanvas {
    max-width: 100%;
    height: auto;
    box-shadow: var(--shadow-md);
}

/* Extracted Table */
.table-container {
    padding: 0;
}

.table-wrapper {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 80vh;
    max-width: 100%;
}

.extracted-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.extracted-table thead th {
    position: sticky;
    top: 0;
    background: var(--gray-50);
    border-bottom: 2px solid var(--border-strong);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    z-index: 1;
}

.extracted-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    white-space: nowrap;
    cursor: text;
    transition: background 0.1s;
    position: relative;
}

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

.extracted-table tbody td[contenteditable="true"]:focus {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    background: #fff;
}

/* Uncertain cell highlighting */
.extracted-table tbody td.cell-uncertain {
    background: var(--warning-bg);
    border-left: 3px solid var(--warning);
}

/* Row numbers */
.extracted-table .row-num {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    text-align: right;
    width: 36px;
    padding-right: 8px;
    border-right: 1px solid var(--border);
    user-select: none;
}

/* ============================================================================
   Summary Rows Banner and Styling
   ============================================================================ */
.summary-rows-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 4px;
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: var(--info);
    flex-wrap: wrap;
}

.summary-rows-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-rows-info svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.summary-banner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.summary-rows-toggle {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 4px 10px;
}

.btn-xs {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.btn-outline-muted {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.btn-outline-muted:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
    background: var(--bg-card);
}

.reset-classification-btn svg {
    flex-shrink: 0;
}

/* User override notice */
.user-override-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    margin-bottom: 8px;
    background: var(--success-bg, rgba(16, 185, 129, 0.06));
    border: 1px solid var(--success-border, rgba(16, 185, 129, 0.2));
    border-radius: var(--radius);
    font-size: 0.78rem;
    color: var(--success);
}
.user-override-notice svg {
    flex-shrink: 0;
}

/* Summary separator row */
.summary-separator-row td,
.summary-separator-cell {
    background: var(--warning-bg) !important;
    border-top: 2px solid var(--warning-border);
    color: var(--warning);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 12px !important;
    text-align: center;
}

/* Summary rows (visually distinct from transaction rows) */
.summary-row td,
.summary-row-cell {
    background: var(--warning-bg) !important;
    color: var(--text-muted);
    font-style: italic;
    border-bottom: 1px solid var(--warning-border);
}

.summary-row:hover td {
    background: var(--warning-border) !important;
}

.summary-row-num {
    color: var(--warning) !important;
    font-style: normal !important;
    font-weight: 600;
}

/* ============================================================================
   Row Action Buttons (Move to table / Move to summary)
   ============================================================================ */
.row-action-header {
    width: 40px;
    min-width: 40px;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.row-action-cell {
    width: 40px;
    min-width: 40px;
    padding: 2px 4px !important;
    text-align: center;
    vertical-align: middle;
    background: transparent !important;
    border-left: none !important;
}

.btn-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.68rem;
    font-family: var(--font-sans);
    background: none;
    transition: all 0.18s ease;
    white-space: nowrap;
    opacity: 0.55;
    transform: scale(1);
    position: relative;
}

/* Brighten action buttons on row hover */
tr:hover .btn-row-action {
    opacity: 1;
}

/* Custom tooltip for row action buttons (replaces native title on mobile) */
.btn-row-action[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: var(--gray-800);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.btn-row-action[data-tooltip]:hover::after,
.btn-row-action[data-tooltip]:focus::after {
    opacity: 1;
    transform: translateY(0);
}

/* On small screens, anchor tooltip to left to prevent overflow */
@media (max-width: 768px) {
    .btn-row-action[data-tooltip]::after {
        right: auto;
        left: 0;
        max-width: 150px;
        white-space: normal;
        word-break: break-word;
    }
}

/* Dark theme tooltip */
[data-theme="dark"] .btn-row-action[data-tooltip]::after {
    background: var(--gray-100);
    color: var(--text-primary);
}

.btn-row-action svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

.row-action-label {
    display: none;
}

/* Show label on wider screens */
@media (min-width: 1100px) {
    .row-action-header {
        width: auto;
        min-width: 120px;
    }
    .row-action-cell {
        width: auto;
        min-width: 120px;
    }
    .row-action-label {
        display: inline;
    }
}

/* Move to summary button */
.btn-move-to-summary {
    color: var(--warning);
    border-color: transparent;
}
.btn-move-to-summary:hover {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}

/* Move to table button */
.btn-move-to-table {
    color: var(--success);
    border-color: transparent;
}
.btn-move-to-table:hover {
    background: var(--success-bg, rgba(16, 185, 129, 0.06));
    border-color: var(--success-border, rgba(16, 185, 129, 0.2));
    color: var(--success);
}

/* Visual distinction for user-moved rows */
.row-user-moved-to-table {
    animation: rowMoveHighlight 1.2s ease-out;
}
.row-user-moved-to-table td {
    background: var(--success-bg, rgba(16, 185, 129, 0.04)) !important;
    border-left: 3px solid var(--success) !important;
}
.row-user-moved-to-table td:first-child {
    border-left: 3px solid var(--success) !important;
}

.row-user-moved-to-summary {
    animation: rowMoveHighlight 1.2s ease-out;
}
.row-user-moved-to-summary td {
    border-left: 3px solid var(--info) !important;
}
.row-user-moved-to-summary td:first-child {
    border-left: 3px solid var(--info) !important;
}

/* Row move highlight animation */
@keyframes rowMoveHighlight {
    0% {
        background-color: rgba(37, 99, 235, 0.15);
    }
    100% {
        background-color: transparent;
    }
}

/* Fact text colors in extraction summary */
.fact-good-text {
    color: var(--success);
    font-weight: 500;
}

/* Dark theme adjustments */
[data-theme="dark"] .summary-rows-banner {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .user-override-notice {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .summary-separator-cell,
[data-theme="dark"] .summary-separator-row td {
    background: rgba(217, 119, 6, 0.12) !important;
    border-color: rgba(217, 119, 6, 0.3);
}

[data-theme="dark"] .summary-row td,
[data-theme="dark"] .summary-row-cell {
    background: rgba(217, 119, 6, 0.06) !important;
    border-color: rgba(217, 119, 6, 0.15);
}

[data-theme="dark"] .summary-row:hover td {
    background: rgba(217, 119, 6, 0.15) !important;
}

[data-theme="dark"] .btn-move-to-summary:hover {
    background: rgba(217, 119, 6, 0.12);
}

[data-theme="dark"] .btn-move-to-table:hover {
    background: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .row-user-moved-to-table td {
    background: rgba(16, 185, 129, 0.06) !important;
}

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

/* ============================================================================
   Extraction Summary (replaces raw log)
   ============================================================================ */
.extraction-summary {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.summary-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    transition: background 0.15s;
}
.summary-toggle:hover {
    background: var(--gray-50);
}

.summary-chevron {
    margin-left: auto;
    transition: transform 0.2s;
}

.summary-content {
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
}

.summary-section {
    padding: 16px 0 12px;
}

.summary-section + .summary-section {
    border-top: 1px solid var(--border);
}

.summary-section--muted {
    opacity: 0.7;
}

.summary-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

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

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

.summary-fact .fact-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.summary-fact .fact-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-fact.fact-muted {
    opacity: 0.6;
}

/* Per-table items in extraction summary */
.summary-table-item {
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.summary-table-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.summary-table-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-table-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.summary-table-facts .fact-warning-text {
    color: var(--warning);
    font-weight: 500;
}

.summary-fragment-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================================================================
   Ecosystem Section
   ============================================================================ */
.ecosystem {
    padding: 80px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.ecosystem h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.ecosystem-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    min-width: 100px;
    transition: all 0.2s;
    text-decoration: none;
}

.flow-step--active {
    border-color: var(--primary);
    background: var(--primary-bg);
}
.flow-step--active .flow-icon {
    color: var(--primary);
}

.flow-step span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.flow-step--active span {
    color: var(--primary);
}

.flow-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.flow-arrow {
    color: var(--text-muted);
    opacity: 0.4;
}

/* ============================================================================
   Footer (Unified Mubsira)
   ============================================================================ */
.site-footer {
    background-color: #0f1825;
    padding: 32px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.footer-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.footer-links a {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================================================
   Toast Notifications
   ============================================================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--gray-800);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    max-width: 400px;
}
.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-error {
    background: var(--primary);
}

/* ============================================================================
   Responsive
   ============================================================================ */

/* --- Floating Action Button (mobile restart) --- */
/* ============================================================================
   Collapsible Sections (mobile only)
   ============================================================================ */
/* --- Collapsible toggle button: hidden on desktop --- */
.section-collapse-toggle {
    display: none; /* Hidden on desktop, shown on mobile */
}

.collapse-chevron {
    display: none;
}

.section-collapsible-body {
    /* Always visible on desktop — mobile overrides below */
    display: block;
}

@media (max-width: 768px) {
    .section-collapse-toggle {
        display: block;
        width: 100%;
        background: none;
        border: none;
        cursor: pointer;
        text-align: center;
        padding: 0;
        font-family: var(--font-sans);
        color: var(--text-primary);
        position: relative;
    }

    .section-collapse-toggle h2 {
        margin-bottom: 8px;
    }

    .section-collapse-toggle .section-subtitle {
        margin-bottom: 0;
    }

    .collapse-chevron {
        display: block;
        margin: 12px auto 0;
        color: var(--text-muted);
        transition: transform 0.3s ease;
    }

    .collapsible-section.is-collapsed .collapse-chevron {
        transform: rotate(-90deg);
    }
    .collapsible-section.is-expanded .collapse-chevron {
        transform: rotate(0deg);
    }

    /*
     * Mobile collapsed: hide body completely.
     * We use display:none for reliability (max-height:0 can glitch on some browsers).
     * The JS toggles is-collapsed / is-expanded classes.
     */
    .collapsible-section.is-collapsed .section-collapsible-body {
        display: none !important;
    }

    .collapsible-section.is-expanded .section-collapsible-body {
        display: block !important;
    }

    /*
     * Default state when neither class is set yet (before JS runs):
     * hide by default on mobile so users always see collapsed.
     */
    .collapsible-section:not(.is-expanded) .section-collapsible-body {
        display: none !important;
    }
}

/* ============================================================================
   Floating Back Button (detail view)
   ============================================================================ */
.fab-back {
    display: none;
    position: fixed;
    bottom: 88px;
    right: 24px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gray-700);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0,0,0,0.15);
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.fab-back:hover {
    transform: scale(1.08);
    background: var(--gray-600);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.fab-back:active {
    transform: scale(0.96);
}
.fab-back svg {
    width: 24px;
    height: 24px;
}
.fab-back.fab-visible {
    display: flex !important;
}

/* ============================================================================
   Pro Banner (bottom of page)
   ============================================================================ */
.pro-banner-bottom {
    padding: 40px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}
.pro-banner-bottom .section-container {
    max-width: 680px;
}

/* ============================================================================
   FAB Restart
   ============================================================================ */
.fab-restart {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.35), 0 2px 6px rgba(0,0,0,0.15);
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.fab-restart:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.45), 0 4px 10px rgba(0,0,0,0.2);
}
.fab-restart:active {
    transform: scale(0.96);
}
.fab-restart svg {
    width: 22px;
    height: 22px;
}
/* Show FABs on ALL screens when active */
.fab-restart.fab-visible {
    display: flex !important;
}
.fab-back.fab-visible {
    display: flex !important;
}

@media (max-width: 768px) {
    /* Collapsible: reinforce collapsed/expanded states */
    .collapsible-section.is-collapsed .section-collapsible-body {
        display: none !important;
    }
    .collapsible-section.is-expanded .section-collapsible-body {
        display: block !important;
    }

    /* --- Global containment --- */
    /* Do NOT use overflow-x: hidden/clip on html/body — it clips scrollable child elements */
    html {
        max-width: 100vw;
    }
    body {
        max-width: 100vw;
        width: 100%;
    }
    
    /* --- Nav fixes --- */
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .nav-links.is-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: rgba(15, 24, 37, 0.98);
        padding: 16px 24px;
        gap: 0;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .nav-links.is-open a {
        display: block;
        padding: 10px 0;
        font-size: 14px;
    }
    .nav-mobile-only { display: list-item; }
    .nav-mobile-only.nav-mobile-divider {
        border-top: 1px solid rgba(255,255,255,0.08);
        margin: 8px 0;
        padding: 0;
    }
    .nav-mobile-only.nav-mobile-controls {
        display: flex;
        gap: 8px;
        padding: 8px 0;
    }

    /* --- Hero --- */
    .hero { padding: 100px 16px 36px; }
    .hero-title { font-size: 1.85rem; }
    .hero-tagline { font-size: 1rem; }
    .hero-desc { font-size: 0.88rem; }
    .hero-privacy {
        padding: 16px;
        gap: 12px;
        flex-direction: column;
        text-align: center;
    }
    .hero-privacy svg { margin: 0 auto; }
    .hero-privacy > div { text-align: center; }
    .hero-cta .btn-large {
        width: 100%;
        justify-content: center;
    }

    /* --- Section spacing --- */
    .how-it-works, .engine-section, .limits-section, .ecosystem {
        padding: 48px 16px;
        overflow-x: hidden;
    }
    .how-it-works h2, .engine-section h2, .limits-section h2, .ecosystem h2 {
        font-size: 1.35rem;
    }
    .section-subtitle {
        font-size: 0.88rem;
    }
    .section-container {
        padding: 0 4px;
    }

    /* --- Steps grid --- */
    .steps-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .step-card { padding: 16px 12px; }
    .step-card h3 { font-size: 0.92rem; }
    .step-card p { font-size: 0.82rem; }
    .step-icon { width: 44px; height: 44px; }
    .step-icon svg { width: 22px; height: 22px; }

    /* --- Engine cards --- */
    .engine-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 32px; }
    .engine-card { padding: 20px 16px; }
    .engine-card h3 { font-size: 0.9rem; }
    .engine-card p { font-size: 0.82rem; }

    /* --- Engine comparison table (mobile: stacked rows) --- */
    .engine-comparison { margin-top: 32px; }
    .engine-comparison-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .engine-comparison-table {
        min-width: 0;
        font-size: 0.82rem;
    }
    .engine-comparison-table thead {
        display: none;
    }
    .engine-comparison-table tbody tr {
        display: flex;
        flex-direction: column;
        border-top: 1px solid var(--border);
        padding: 0;
    }
    .engine-comparison-table tbody tr:first-child {
        border-top: none;
    }
    .engine-td--generic {
        background: var(--gray-50);
        border-right: none;
        border-bottom: none;
        padding: 10px 14px 10px 32px;
        font-size: 0.82rem;
        position: relative;
    }
    .engine-td--generic::before {
        left: 14px;
        top: 15px;
    }
    .engine-td--pdftable {
        border-bottom: none;
        padding: 10px 14px 14px 32px;
        font-size: 0.82rem;
        position: relative;
    }
    .engine-td--pdftable::before {
        left: 12px;
        top: 13px;
    }

    /* --- Limits --- */
    .limits-grid { grid-template-columns: 1fr; gap: 12px; }
    .limits-card { padding: 20px 16px; }
    .limits-card li { font-size: 0.84rem; }
    .limits-promise { padding: 16px; }
    .limits-promise p { font-size: 0.85rem; }

    /* --- App section --- */
    .app-section { padding: 40px 0 100px; width: 100%; max-width: 100vw; box-sizing: border-box; overflow-x: hidden; }
    .app-container { width: 100%; max-width: 100%; padding: 0 8px; box-sizing: border-box; overflow: visible; }

    /* Force all results content to stay within viewport but allow internal scrolling */
    #resultsWrapper,
    #detailView {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* contain horizontal overflow at this level */
    }

    /* --- Step indicator (mobile compact) --- */
    .step-indicator {
        gap: 0;
        max-width: 100%;
        margin-bottom: 20px;
    }
    .step-indicator-item {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    .step-indicator-item span:not(.step-indicator-num) {
        display: none;
    }
    .step-indicator-line { width: 24px; }

    /* --- Upload zone --- */
    .upload-zone {
        padding: 40px 20px;
        gap: 10px;
    }
    .upload-zone h3 { font-size: 1rem; }
    .upload-icon svg { width: 36px; height: 36px; }






    /* --- File info bar (stack on mobile) --- */
    .file-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 16px;
    }
    .file-info-left {
        flex-wrap: wrap;
        gap: 6px;
    }
    .file-name {
        font-size: 0.85rem;
        word-break: break-all;
        max-width: 100%;
    }
    .file-info-right {
        width: 100%;
    }
    .file-info-right .btn {
        width: 100%;
        justify-content: center;
    }

    /* --- Verdict dashboard --- */
    .verdict-card {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    .verdict-title { font-size: 1rem; }
    .verdict-desc { font-size: 0.84rem; margin-bottom: 12px; }
    .summary-stats {
        gap: 12px;
        flex-wrap: wrap;
    }
    .summary-stat-value { font-size: 1.1rem; }

    /* --- Table cards --- */
    .tables-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .tables-filter {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .tables-filter::-webkit-scrollbar { display: none; }
    .table-cards-grid { grid-template-columns: 1fr; gap: 12px; width: 100%; box-sizing: border-box; }
    .table-card { 
        padding: 12px; 
        border-radius: 8px; 
        width: 100%; 
        max-width: 100%;
        box-sizing: border-box; 
        overflow: hidden; /* contain child content within card bounds */
    }
    .table-card-header { flex-wrap: wrap; gap: 8px; }
    .table-card-meta { flex-wrap: wrap; gap: 8px 12px; }
    .table-card-preview {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: none;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        border-radius: var(--radius-sm);
    }
    .table-card-preview table {
        min-width: 280px;
        width: max-content;
    }
    .table-card-preview th,
    .table-card-preview td {
        max-width: none;
        overflow: visible;
        text-overflow: unset;
        white-space: nowrap;
        padding: 6px 10px;
    }
    .table-card-actions {
        flex-direction: column;
    }

    /* --- Detail view --- */
    .detail-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .detail-back {
        align-self: flex-start;
    }
    .detail-table-label {
        order: -1;
        margin-bottom: 4px;
    }
    .detail-export-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .detail-export-actions .btn {
        justify-content: center;
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    /* --- Detail info panel --- */
    /* Collapsible toggle for detail info panel on mobile */
    .detail-info-collapse-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 12px 16px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        cursor: pointer;
        margin-bottom: 12px;
        font-family: var(--font-sans);
        -webkit-tap-highlight-color: transparent;
    }
    .detail-info-collapse-toggle.is-open {
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        margin-bottom: 0;
        border-bottom: none;
    }
    .detail-info-collapse-toggle .detail-info-toggle-label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-primary);
    }
    .detail-info-chevron {
        color: var(--text-muted);
        transition: transform 0.3s ease;
        transform: rotate(-90deg);
        flex-shrink: 0;
    }
    .detail-info-collapse-toggle.is-open .detail-info-chevron {
        transform: rotate(0deg);
    }
    /* Collapsed by default on mobile */
    .detail-info-collapsible-body {
        display: none !important;
    }
    .detail-info-collapse-toggle.is-open + .detail-info-collapsible-body {
        display: grid !important;
    }
    /* When JS adds is-hidden, keep hidden */
    .detail-info-collapsible-body.is-hidden {
        display: none !important;
    }

    .info-panel {
        grid-template-columns: 1fr;
        overflow: hidden;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        margin-top: 0;
        margin-bottom: 12px;
    }
    .info-panel-left {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 16px;
    }
    .info-panel-right {
        padding: 16px;
    }
    .info-facts-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .info-fact .fact-value { font-size: 0.85rem; }
    .guidance-list li { font-size: 0.8rem; }

    /* --- Split view (stacked on mobile) --- */
    .split-view {
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: auto;
        overflow: visible;
    }

    /* PDF preview panel */
    .split-panel--pdf {
        max-height: 50vh;
        overflow: hidden;
    }
    .split-panel--pdf .panel-body {
        max-height: 45vh;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Table panel — contain content but allow inner scroll on mobile */
    .split-panel--table {
        max-height: none;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden; /* contain within panel border, .table-wrapper scrolls */
    }
    .split-panel--table .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 10px 12px;
    }
    /* In fullscreen, keep header horizontal even on mobile */
    .split-panel--table.table-fullscreen .panel-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .panel-body.table-container {
        padding: 0;
        overflow: hidden; /* contain content, .table-wrapper handles scrolling */
        width: 100%;
        box-sizing: border-box;
    }
    .table-wrapper {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: none;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .extracted-table {
        min-width: 500px;
        width: max-content;
        font-size: 0.75rem;
    }
    .extracted-table thead th {
        padding: 8px 8px;
        font-size: 0.7rem;
        white-space: nowrap;
    }
    .extracted-table tbody td {
        padding: 6px 8px;
        white-space: nowrap;
        max-width: none;
        overflow: visible;
        text-overflow: unset;
    }
    .extracted-table .row-num {
        width: 28px;
        font-size: 0.65rem;
        padding-right: 4px;
    }

    /* --- Extraction summary --- */
    .extraction-summary {
        margin-top: 12px;
    }
    .summary-toggle {
        padding: 10px 14px;
        font-size: 0.82rem;
    }
    .summary-content {
        padding: 0 12px 12px;
    }
    .summary-facts {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .summary-fact {
        padding: 6px 10px;
    }
    .summary-fact .fact-label { font-size: 0.75rem; }
    .summary-fact .fact-value { font-size: 0.8rem; }
    .summary-table-header { flex-wrap: wrap; }
    .summary-table-facts { font-size: 0.75rem; }

    /* --- Ecosystem (stacked) --- */
    .ecosystem-flow { flex-direction: column; gap: 8px; margin-top: 24px; }
    .flow-step {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 16px;
        min-width: auto;
    }
    .flow-icon { width: 36px; height: 36px; }
    .flow-arrow {
        transform: rotate(90deg);
        opacity: 0.3;
    }

    /* --- Footer --- */
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    /* --- Toast adjustment for FAB --- */
    .toast {
        bottom: 88px;
        right: 16px;
        left: 16px;
        max-width: none;
        text-align: center;
    }

    /* --- Nav upgrade button (hide on mobile, use menu link instead) --- */
    .nav-upgrade-btn {
        display: none;
    }
    .nav-pro-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    /* --- Pro Banner (bottom, stack vertically on mobile) --- */
    .pro-banner-bottom {
        padding: 24px 16px;
    }
    .pro-banner-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 16px;
        gap: 12px;
    }
    .pro-banner-info {
        flex-direction: column;
        gap: 8px;
    }
    .pro-banner-badge {
        align-self: center;
    }
    .pro-banner-text {
        font-size: 0.8rem;
    }
    .pro-banner-price {
        flex-direction: row;
        justify-content: center;
        gap: 6px;
        align-items: baseline;
    }
    .pro-banner-amount {
        font-size: 1.3rem;
    }
    .btn-pro.btn-small {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }

    /* --- License Modal (mobile fullscreen-like) --- */
    .license-modal-overlay {
        padding: 8px;
        align-items: flex-end;
    }
    .license-modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .license-modal-header {
        padding: 16px 16px 0;
    }
    .license-modal-header h3 {
        font-size: 1.05rem;
    }
    .license-modal-body {
        padding: 12px 16px;
    }
    .license-modal-body > p {
        font-size: 0.85rem;
    }
    .license-feature {
        font-size: 0.82rem;
    }
    .license-price-box {
        padding: 12px;
    }
    .license-price-value {
        font-size: 1.6rem;
    }
    .license-btn-buy {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    .license-input {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    .license-modal-footer {
        padding: 10px 16px 16px;
        flex-direction: row;
    }
    .license-modal-footer button {
        flex: 1;
    }

    /* Row reclassification buttons on mobile */
    .summary-rows-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .summary-banner-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .user-override-notice {
        font-size: 0.72rem;
    }
    .row-action-header {
        width: 32px;
        min-width: 32px;
    }
    .row-action-cell {
        width: 32px;
        min-width: 32px;
        padding: 2px !important;
    }
    .btn-row-action {
        padding: 4px;
        opacity: 0.65;
    }
    .btn-row-action svg {
        width: 14px;
        height: 14px;
    }
    .reset-classification-btn {
        font-size: 0.66rem;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .hero { padding: 88px 12px 28px; }
    .hero-title { font-size: 1.55rem; }
    .hero-tagline { font-size: 0.92rem; }
    .hero-desc { font-size: 0.84rem; }

    .steps-grid { grid-template-columns: 1fr; gap: 10px; }

    .step-indicator-line { width: 16px; }
    .step-indicator-item { padding: 5px 8px; }

    .upload-zone { padding: 32px 16px; }

    .detail-export-actions {
        grid-template-columns: 1fr;
    }

    .info-facts-grid {
        grid-template-columns: 1fr;
    }

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

    .extracted-table {
        min-width: 420px;
        font-size: 0.7rem;
    }
    .extracted-table thead th {
        padding: 6px 6px;
        font-size: 0.65rem;
        white-space: nowrap;
    }
    .extracted-table tbody td {
        padding: 5px 6px;
        max-width: none;
    }

    .summary-stats {
        flex-direction: column;
        gap: 8px;
    }

    .flow-step span { font-size: 0.78rem; }

    /* Pro banner small phones */
    .pro-banner-amount { font-size: 1.15rem; }
    .pro-banner-text { font-size: 0.78rem; }
    .pro-banner-terms { font-size: 0.65rem; }

    /* License modal small phones */
    .license-modal-overlay {
        padding: 0;
    }
    .license-modal {
        max-height: 90vh;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
    .license-price-value { font-size: 1.4rem; }
    .license-feature { font-size: 0.78rem; gap: 8px; }
}

/* --- Tablet tweaks --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .engine-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .split-view {
        grid-template-columns: 1fr 1fr;
    }
    .table-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================================
   PRO Badges (table cards + export buttons)
   ============================================================================ */
.table-card-pro-badge {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.btn-pro-tag {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-left: 4px;
    vertical-align: middle;
}

/* ============================================================================
   Nav Upgrade Button + Pro Badge
   ============================================================================ */
.nav-upgrade-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.nav-upgrade-btn:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.nav-pro-badge {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ============================================================================
   Pro Banner (Bottom)
   ============================================================================ */

.pro-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.pro-banner-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pro-banner-badge {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.pro-banner-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pro-banner-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.pro-banner-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.pro-banner-terms {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.btn-pro {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-pro:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
    color: #fff;
}

/* ============================================================================
   License Modal
   ============================================================================ */
.license-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.license-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.25s ease-out;
}

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

.license-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.license-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.license-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    line-height: 1;
}
.license-modal-close:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

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

.license-modal-body > p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.license-features-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.license-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.license-feature svg {
    color: var(--success);
    flex-shrink: 0;
}

.license-price-box {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.license-price-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.license-price-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.license-btn-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
    font-family: var(--font-sans);
}
.license-btn-buy:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
}

.license-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.license-divider::before,
.license-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.license-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    letter-spacing: 0.5px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.license-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.license-error {
       font-size: 0.82rem;
    color: var(--primary);
    font-weight: 500;
    margin-top: 8px;
}

.license-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 24px 20px;
}

.license-btn-secondary {
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.15s;
}
.license-btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--border-strong);
}

.license-btn-primary {
    padding: 8px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.15s;
}
.license-btn-primary:hover {
    background: var(--primary-hover);
}

/* ========== RELATED TOOLS (SEO Internal Linking) ========== */
.related-tools {
    padding: 3rem 1.5rem;
    background: var(--bg-alt, #f8f9fa);
    border-top: 1px solid var(--border, #e2e8f0);
}
.related-tools-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}
.related-tools-inner h2 {
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary, #1a202c);
}
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.related-tool-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--bg-card, #fff);
    text-decoration: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.related-tool-card:hover {
    border-color: var(--accent, #2563eb);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.related-tool-card strong {
    font-size: 1rem;
    color: var(--text-primary, #1a202c);
    margin-bottom: 0.35rem;
}
.related-tool-card span {
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.4;
}
.related-tools-blog {
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
}
.related-tools-blog a {
    color: var(--accent, #2563eb);
    text-decoration: underline;
}

/* Guide Callout Box */
.guide-callout {
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.guide-callout:hover {
    border-color: var(--accent, #2563eb);
    box-shadow: 0 4px 16px rgba(37,99,235,0.12);
}
.guide-callout-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.guide-callout-text {
    flex: 1;
}
.guide-callout-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary, #1e293b);
    margin-bottom: 0.15rem;
}
.guide-callout-text span {
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
}
.guide-callout-arrow {
    font-size: 1.2rem;
    color: var(--accent, #2563eb);
    flex-shrink: 0;
}
[data-theme="dark"] .guide-callout {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-color: #4338ca;
}
[data-theme="dark"] .guide-callout-text strong { color: #e0e7ff; }
[data-theme="dark"] .guide-callout-text span { color: #a5b4fc; }
