/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

/* CSS Custom Properties - Privacy Blue Palette */
:root {
    --background: hsl(210, 40%, 98%);
    --foreground: hsl(222, 47%, 11%);
    --primary: hsl(215, 90%, 45%);
    --primary-light: hsl(215, 90%, 55%);
    --primary-dark: hsl(215, 90%, 35%);
    --muted: hsl(210, 40%, 96.1%);
    --muted-foreground: hsl(215, 16%, 47%);
    --border: hsl(214.3, 31.8%, 91.4%);
    --card: hsl(0, 0%, 100%);
    --radius: 0.75rem;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--foreground);
    background-color: var(--background);
    padding: 0;
    min-height: 100vh;
}

/* Version bar - moved to corner */
.version-bar {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 50;
    padding: 0;
}

.version-bar .app-version {
    font-size: 0.65rem;
    color: #9ca3af;
}

/* Small auth buttons for header */
.btn-auth-small {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-auth-small:hover {
    background: #2563eb;
}

.btn-logout-small {
    background: none;
    border: 1px solid #cbd5e1;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout-small:hover {
    border-color: #94a3b8;
    color: #475569;
}

.btn-upgrade-small {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upgrade-small:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.container {
    max-width: 896px;
    margin: 0 auto;
    padding: 0 24px 60px;
    background: transparent;
}

/* Full-width header bar */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    height: 64px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Add top padding to body to account for fixed header */
body {
    padding-top: 64px;
}

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

.header-brand-link {
    text-decoration: none;
}

.header-brand-link:hover h1 {
    opacity: 0.8;
}

.header-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.brand-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.header-subtitle {
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

.header-nav {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}

.header-nav a {
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-nav a:hover {
    color: #3b82f6;
    transform: scale(1.05);
}

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

h1 {
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: -0.02em;
}

.app-version {
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.tagline {
    color: #7f8c8d;
    font-size: 0.95rem;
}

h2 {
    color: #34495e;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

h3 {
    color: #34495e;
    font-size: 1.1rem;
    margin: 0;
}

/* ============================================== */
/* TAB NAVIGATION - Replit Style (Text only) */
/* ============================================== */

.tab-nav {
    display: flex;
    justify-content: center;
    gap: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.tab-btn {
    flex: 1;
    padding: 18px 32px;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 400;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--radius);
    position: relative;
    margin: 4px;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-btn.active::after {
    display: none;
}

/* No divider between tabs */
.tab-btn:first-child {
    border-right: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================== */
/* HERO SECTION - Replit Style v7.1 */
/* ============================================== */

.hero-section {
    text-align: center;
    padding: 60px 20px 32px;
    background: transparent;
    margin-bottom: 20px;
    position: relative;
}

/* Background decorative circles */
.hero-section::before,
.hero-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}

.hero-section::before {
    width: 400px;
    height: 400px;
    background: hsl(215, 90%, 45%, 0.08);
    top: -100px;
    left: -150px;
}

.hero-section::after {
    width: 300px;
    height: 300px;
    background: hsl(215, 90%, 45%, 0.06);
    bottom: -50px;
    right: -100px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--muted-foreground);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.hero-badge svg {
    color: var(--primary);
    flex-shrink: 0;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    animation: heroSlideUp 0.6s ease-out;
}

.hero-subtitle {
    animation: heroSlideUp 0.6s ease-out 0.1s both;
}

.trust-indicators {
    animation: heroSlideUp 0.6s ease-out 0.15s both;
}

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

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

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--muted-foreground);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.7;
    font-weight: 400;
}

/* Trust Indicators */
.trust-indicators {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-foreground);
    font-size: 0.85rem;
    font-weight: 400;
}

.trust-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.trust-icon svg {
    width: 18px;
    height: 18px;
}

.trust-text {
    white-space: nowrap;
}

/* Responsive hero */
@media (max-width: 700px) {
    .hero-section {
        padding: 40px 16px 32px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .trust-indicators {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
}

/* ============================================== */
/* PRIVACY BADGE */
/* ============================================== */

.privacy-badge {
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 10px;
}

.privacy-badge::before {
    content: "🔒 ";
}

/* ============================================== */
/* EXAMPLE PREVIEW */
/* ============================================== */

.example-preview {
    margin-top: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.example-preview summary {
    padding: 12px 16px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.9rem;
    color: #3b82f6;
    font-weight: 500;
    user-select: none;
}

.example-preview summary:hover {
    background: #f1f5f9;
}

.example-preview[open] summary {
    border-bottom: 1px solid #e2e8f0;
}

.example-content {
    padding: 16px;
    background: white;
}

.example-before, .example-after {
    margin-bottom: 8px;
}

.example-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.example-before p, .example-after p {
    font-size: 0.9rem;
    color: #334155;
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    line-height: 1.5;
}

.example-arrow {
    text-align: center;
    font-size: 1.2rem;
    color: #94a3b8;
    margin: 8px 0;
}

.tag-person {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.tag-email {
    background: #fef3c7;
    color: #b45309;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.tag-company {
    background: #d1fae5;
    color: #047857;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.tag-date {
    background: #fce7f3;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Responsive for hero and how-it-works */
@media (max-width: 700px) {
    .hero-title {
        font-size: 1.3rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .how-it-works-strip {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        padding: 15px;
    }

    .how-step-text {
        font-size: 0.8rem;
    }
}

/* ============================================== */
/* STEP INDICATOR - Replit Style (with lines) */
/* ============================================== */

.step-indicator-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
    padding: 0;
    background: transparent;
}

.step-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid transparent;
}

.step-inline:hover {
    background: var(--muted);
}

.step-inline.active {
    background: var(--card);
    border: 1px solid var(--border);
}

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

.step-label-inline {
    font-weight: 400;
    color: var(--muted-foreground);
    font-size: 0.9rem;
}

.step-inline.active .step-label-inline {
    color: var(--foreground);
    font-weight: 500;
}

.step-inline.completed .step-label-inline {
    color: var(--muted-foreground);
}

/* Connecting lines between steps */
.step-line {
    display: block;
    width: 48px;
    height: 1px;
    background: var(--border);
    margin: 0 8px;
}

/* Hide old arrow style */
.step-arrow {
    display: none;
}

/* Add step numbers as prefix */
.step-inline::before {
    content: attr(data-step) '.';
    color: var(--muted-foreground);
    font-weight: 400;
    margin-right: 2px;
}

.step-inline.active::before {
    color: var(--foreground);
    font-weight: 500;
}

/* Legacy step indicator (keep for backward compatibility) */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 0.8;
    cursor: pointer;
}

.step.completed:hover {
    opacity: 1;
}

.step.completed:hover .step-number {
    background-color: #2ecc71;
    transform: scale(1.1);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #bdc3c7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.step.active .step-number {
    background-color: #3498db;
}

.step.completed .step-number {
    background-color: #27ae60;
}

.step-label {
    font-weight: 500;
    color: #7f8c8d;
    font-size: 0.95rem;
}

.step.active .step-label {
    color: #2c3e50;
}

.step-connector {
    width: 60px;
    height: 2px;
    background-color: #e0e0e0;
    margin: 0 15px;
}

/* ============================================== */
/* STEP CONTENT */
/* ============================================== */

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

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

.review-header h2 {
    margin-bottom: 0;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* ============================================== */
/* FILE UPLOAD SECTION */
/* ============================================== */

.file-upload-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background-color: #ecf0f1;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-label:hover {
    background-color: #e8f4fc;
    border-color: #3498db;
}

.file-upload-icon {
    font-size: 1.5rem;
}

.file-upload-text {
    font-weight: 500;
    color: #34495e;
}

.file-name {
    color: #27ae60;
    font-weight: 500;
    font-size: 0.9rem;
}

.file-name:empty {
    display: none;
}

.input-divider {
    display: none;
}

/* ============================================== */
/* INPUT TEXTAREA */
/* ============================================== */

.input-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 200px;
    margin-bottom: 15px;
    transition: border-color 0.2s ease;
}

.input-textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* ============================================== */
/* EXPORT BUTTONS */
/* ============================================== */

.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-docx {
    background-color: #2980b9;
}

.btn-docx:hover {
    background-color: #1f6dad;
}

/* ============================================== */
/* PREVIEW CONTAINER (Single Preview) */
/* ============================================== */

.preview-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.preview-header {
    background-color: #34495e;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    color: white;
}

.hint-inline {
    font-size: 0.85rem;
    color: #ecf0f1;
    font-style: italic;
}

.preview-pane {
    padding: 16px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    background-color: white;
    min-height: 300px;
    max-height: 450px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    cursor: text;
    user-select: text;
    line-height: 1.7;
}

.preview-pane:focus {
    outline: 2px solid #3498db;
    outline-offset: -2px;
}

.placeholder-text {
    color: #95a5a6;
    font-style: italic;
    text-align: center;
    padding-top: 40px;
}

/* ============================================== */
/* HIGHLIGHT STYLES */
/* ============================================== */

.highlight {
    background-color: #ffffcc;
    border-bottom: 2px solid #f39c12;
    padding: 2px 0;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.highlight:hover {
    background-color: #fff3cd;
    border-bottom-color: #e67e22;
}

.highlight-EMAIL {
    background-color: #e3f2fd;
    border-bottom-color: #2196f3;
}

.highlight-PHONE {
    background-color: #f3e5f5;
    border-bottom-color: #9c27b0;
}

.highlight-DATE {
    background-color: #fff3e0;
    border-bottom-color: #ff9800;
}

.highlight-ADDRESS {
    background-color: #e8f5e9;
    border-bottom-color: #4caf50;
}

.highlight-COMPANY {
    background-color: #e0f7fa;
    border-bottom-color: #00bcd4;
}

.highlight-NRIC {
    background-color: #ede7f6;
    border-bottom-color: #673ab7;
}

.highlight-PERSON {
    background-color: #ffebee;
    border-bottom-color: #f44336;
}

.highlight-CUSTOM {
    background-color: #e0f2f1;
    border-bottom-color: #009688;
}

/* ============================================== */
/* CONTEXT MENU */
/* ============================================== */

.context-menu {
    position: fixed;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 1000;
    min-width: 280px;
}

.context-menu-header {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: #2c3e50;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.context-menu-section {
    margin-bottom: 12px;
}

.context-menu-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 6px;
    font-weight: 500;
}

.context-menu-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.context-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.context-btn:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.scope-buttons {
    display: flex;
    gap: 8px;
}

.scope-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scope-btn:hover {
    background-color: #ecf0f1;
}

.scope-btn-primary {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.scope-btn-primary:hover {
    background-color: #2980b9;
}

.context-btn-cancel {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f8f9fa;
    cursor: pointer;
    margin-top: 6px;
}

.context-btn-cancel:hover {
    background-color: #e9ecef;
}

/* ============================================== */
/* MANUAL SELECTION CONTROLS */
/* ============================================== */

.manual-selection-controls {
    background-color: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.manual-selection-controls .hint {
    margin-bottom: 10px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-mark {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    transition: background-color 0.2s ease;
}

.btn-mark:hover:not(:disabled) {
    background-color: #2980b9;
}

.btn-mark:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================== */
/* ENTITY MANAGER */
/* ============================================== */

.entity-manager {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.entity-manager h3 {
    margin-bottom: 8px;
}

.entity-manager .legend {
    font-size: 0.8rem;
    color: #64748b;
}

.entity-table-header {
    display: grid;
    grid-template-columns: 50px 80px 1fr 140px 60px 80px;
    gap: 8px;
    padding: 10px 18px;
    background-color: #f1f5f9;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-items: center;
}

.entity-table-header .col-source,
.entity-table-header .col-count {
    text-align: center;
}

.entity-table-header .col-action {
    text-align: right;
}

.entity-list {
    margin-top: 8px;
    min-height: 40px;
    max-height: 300px;
    overflow-y: auto;
}

.entity-item {
    display: grid;
    grid-template-columns: 50px 80px 1fr 140px 60px 80px;
    gap: 8px;
    align-items: center;
    background-color: white;
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
    font-size: 0.85rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
}

.entity-item:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
}

.col-source {
    font-size: 0.9rem;
    text-align: center;
}

.col-type {
    font-weight: 600;
    font-size: 0.75rem;
}

.col-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

.col-value:hover {
    overflow: visible;
    z-index: 10;
}

.col-value:hover code {
    position: absolute;
    left: 0;
    bottom: 100%;
    margin-bottom: 8px;
    background-color: #ffffff;
    color: #1e293b;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    word-break: break-word;
    max-width: 400px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    z-index: 1000;
}

.col-replacement {
    color: #64748b;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-count {
    text-align: center;
}

.col-action {
    text-align: right;
}

.entity-count {
    background-color: #e2e8f0;
    color: #475569;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

.entity-item code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-weight: bold;
}

.entity-item .remove-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
}

.entity-item .remove-btn:hover {
    background-color: #c0392b;
}

/* Entity type colors for border and code text */
.entity-item-EMAIL { border-left-color: #2196f3; }
.entity-item-EMAIL code { color: #2196f3; }
.entity-item-EMAIL .entity-type { color: #2196f3; }

.entity-item-PHONE { border-left-color: #9c27b0; }
.entity-item-PHONE code { color: #9c27b0; }
.entity-item-PHONE .entity-type { color: #9c27b0; }

.entity-item-DATE { border-left-color: #ff9800; }
.entity-item-DATE code { color: #e65100; }
.entity-item-DATE .entity-type { color: #e65100; }

.entity-item-ADDRESS { border-left-color: #4caf50; }
.entity-item-ADDRESS code { color: #2e7d32; }
.entity-item-ADDRESS .entity-type { color: #2e7d32; }

.entity-item-COMPANY { border-left-color: #00bcd4; }
.entity-item-COMPANY code { color: #00838f; }
.entity-item-COMPANY .entity-type { color: #00838f; }

.entity-item-NRIC { border-left-color: #673ab7; }
.entity-item-NRIC code { color: #673ab7; }
.entity-item-NRIC .entity-type { color: #673ab7; }

.entity-item-PERSON { border-left-color: #f44336; }
.entity-item-PERSON code { color: #c62828; }
.entity-item-PERSON .entity-type { color: #c62828; }

.entity-item-CUSTOM { border-left-color: #009688; }
.entity-item-CUSTOM code { color: #00695c; }
.entity-item-CUSTOM .entity-type { color: #00695c; }

.entity-item-TITLE { border-left-color: #795548; }
.entity-item-TITLE code { color: #5d4037; }
.entity-item-TITLE .entity-type { color: #5d4037; }

.entity-item-UEN { border-left-color: #607d8b; }
.entity-item-UEN code { color: #455a64; }
.entity-item-UEN .entity-type { color: #455a64; }

.entity-item-IDENTIFIER { border-left-color: #ff5722; }
.entity-item-IDENTIFIER code { color: #e64a19; }
.entity-item-IDENTIFIER .entity-type { color: #e64a19; }

/* ============================================== */
/* BUTTONS - Replit Style */
/* ============================================== */

.btn-primary,
.btn-secondary {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    width: auto;
    min-width: 200px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px hsl(215, 90%, 45%, 0.3);
}

.btn-primary .btn-icon {
    flex-shrink: 0;
}

.btn-secondary {
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--border);
    margin-right: 10px;
}

.btn-secondary:hover {
    background: var(--muted);
    border-color: var(--muted-foreground);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ============================================== */
/* FORM ELEMENTS */
/* ============================================== */

.input-group,
.output-group,
.vault-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    background-color: #fafafa;
}

textarea:focus {
    outline: none;
    border-color: #3498db;
    background-color: white;
}

textarea[readonly] {
    background-color: #f9f9f9;
    cursor: default;
}

.hint {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 10px;
}

/* ============================================== */
/* FOOTER - Replit Style */
/* ============================================== */

footer {
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.85rem;
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid var(--border);
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 16px 40px;
    }

    header {
        margin: 0 -16px 30px;
        padding: 0 16px;
    }

    .step-indicator {
        flex-wrap: wrap;
        gap: 10px;
    }

    .step-connector {
        display: none;
    }

    .button-group {
        justify-content: center;
    }

    .scope-buttons {
        flex-direction: column;
    }

    .review-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* ============================================== */
/* AUTHENTICATION */
/* ============================================== */

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

.btn-auth {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    letter-spacing: 0.5px;
}

.btn-auth:hover {
    background-color: #2563eb;
}

.btn-auth-secondary {
    background-color: transparent;
    color: #7f8c8d;
    border: 1px solid #bdc3c7;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-auth-secondary:hover {
    background-color: #ecf0f1;
    color: #34495e;
}

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

.user-email {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 400;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-plan {
    background-color: #27ae60;
    color: white;
    font-size: 0.55rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.user-plan.free {
    background-color: #95a5a6;
}

/* Smart Scan Toggle */
.smart-scan-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e3e8ee;
}

.smart-scan-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.smart-scan-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c3e50;
}

.beta-badge {
    display: inline-block;
    background-color: #3498db;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

.smart-scan-hint {
    margin: 8px 0 0 28px;
    font-size: 0.8rem;
    color: #7f8c8d;
    line-height: 1.4;
}

/* AI Progress Bar */
.ai-progress-container {
    margin: 15px 0;
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
}

.ai-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #856404;
}

.ai-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ffc107;
}

.ai-progress-fill {
    height: 100%;
    background-color: #ffc107;
    width: 0%;
    transition: width 0.3s ease;
}

/* General Scanning Progress */
.scan-progress-container {
    margin: 15px 0;
    padding: 20px;
    background-color: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 6px;
}

.scan-progress-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scan-progress-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #c8e6c9;
    border-top: 3px solid #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.scan-progress-content span {
    color: #2e7d32;
    font-weight: 500;
    font-size: 14px;
}

/* Filename Display */
.filename-display {
    margin: 15px 0;
    padding: 10px 15px;
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    font-size: 14px;
    color: #1565c0;
}

/* Login Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 90%;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #475569;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    text-align: center;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 30px;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.login-form input[type="email"] {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input[type="email"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-login-submit {
    padding: 14px 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-login-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 10px;
}

.login-message.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.login-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.modal-footer-text {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 20px;
}

/* Upgrade Modal Styles */
.upgrade-modal-content {
    max-width: 480px;
    padding: 30px 35px;
}

.upgrade-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--primary);
}

.upgrade-modal-icon svg {
    width: 48px;
    height: 48px;
}

.upgrade-info {
    margin-top: 20px;
}

.upgrade-explanation {
    font-size: 0.95rem;
    color: #475569;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 25px;
}

.upgrade-explanation strong {
    color: #1e293b;
}

.upgrade-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upgrade-option {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.upgrade-option h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.upgrade-option-pro {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #3b82f6;
}

.upgrade-option-free {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.upgrade-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
}

.upgrade-price span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
}

.upgrade-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 15px;
    line-height: 1.5;
}

.upgrade-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #94a3b8;
    font-size: 0.8rem;
}

.upgrade-divider::before,
.upgrade-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.btn-upgrade-modal {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upgrade-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-upgrade-modal:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-upgrade-continue {
    width: 100%;
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upgrade-continue:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Cloudflare Turnstile CAPTCHA */
.turnstile-container {
    display: flex;
    justify-content: center;
    margin: 15px 0;
    min-height: 65px;
}

.turnstile-container iframe {
    border-radius: 8px;
}

/* Responsive for upgrade modal */
@media (max-width: 520px) {
    .upgrade-modal-content {
        padding: 25px 20px;
    }
}

/* ============================================== */
/* FAQ PAGE STYLES */
/* ============================================== */

.faq-page {
    padding: 10px 0;
}

.faq-title {
    text-align: center;
    margin-bottom: 30px;
    color: #1e293b;
    font-size: 1.8rem;
}

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

.faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: #cbd5e1;
}

.faq-item.open {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    transition: all 0.2s ease;
}

.faq-question:hover {
    background: #f1f5f9;
}

.faq-item.open .faq-question {
    background: #eff6ff;
    color: #1e40af;
}

.faq-icon {
    font-size: 1.4rem;
    font-weight: 300;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
    color: #3b82f6;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: white;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 20px;
}

.faq-answer p {
    margin-bottom: 12px;
    color: #475569;
    line-height: 1.7;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul {
    margin: 12px 0;
    padding-left: 24px;
    color: #475569;
}

.faq-answer li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.faq-answer strong {
    color: #334155;
}

/* Active nav link */
.nav-active {
    color: #3b82f6 !important;
    font-weight: 600 !important;
}

/* Responsive FAQ */
@media (max-width: 600px) {
    .faq-question {
        padding: 14px 16px;
        font-size: 0.9rem;
    }

    .faq-item.open .faq-answer {
        padding: 16px;
    }

    .faq-title {
        font-size: 1.5rem;
    }
}

/* ============================================== */
/* INPUT CARD - White Background with Dotted Border */
/* ============================================== */

.input-card {
    background: var(--card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    transition: border-color 0.2s ease;
}

.input-card:hover {
    border-color: var(--primary);
}

/* ============================================== */
/* UPLOAD ZONE - Replit Style (Compact) */
/* ============================================== */

.upload-zone {
    margin-bottom: 20px;
}

.upload-zone-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.upload-zone-label:hover {
    border-color: var(--primary);
    background: hsl(215, 90%, 45%, 0.05);
}

.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-shrink: 0;
}

.upload-icon svg {
    width: 20px;
    height: 20px;
    color: var(--muted-foreground);
}

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

.upload-main {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--foreground);
}

.upload-hint {
    display: none;
}

.file-name-badge {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 16px;
    background: hsl(142, 76%, 36%, 0.1);
    color: hsl(142, 76%, 30%);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

.file-name-badge:empty {
    display: none;
}

/* ============================================== */
/* TEXTAREA WITH CHARACTER COUNT - Replit Style */
/* ============================================== */

.textarea-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.textarea-wrapper .input-textarea {
    margin-bottom: 0;
    padding: 20px;
    padding-bottom: 40px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    min-height: 200px;
}

.textarea-wrapper .input-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsl(215, 90%, 45%, 0.1);
}

.textarea-wrapper .input-textarea::placeholder {
    color: var(--muted-foreground);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.char-count {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    pointer-events: none;
}

/* ============================================== */
/* SMART SCAN TOGGLE - Replit Style */
/* ============================================== */

.smart-scan-container {
    margin: 24px 0 32px;
    padding: 0;
    background: transparent;
    border: none;
}

.smart-scan-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.smart-scan-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary);
}

.toggle-switch {
    display: none;
}

.toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--foreground);
}

.smart-scan-hint {
    margin: 6px 0 0 30px;
    font-size: 0.8rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

/* ============================================== */
/* PRO TIP BANNER - v7.0 */
/* ============================================== */

.pro-tip-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 1px solid #fcd34d;
    border-radius: 10px;
    margin-bottom: 20px;
}

.pro-tip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #b45309;
}

.pro-tip-icon svg {
    width: 20px;
    height: 20px;
}

.pro-tip-text {
    font-size: 0.9rem;
    color: #78350f;
    line-height: 1.4;
}

.pro-tip-text strong {
    color: #92400e;
}

/* ============================================== */
/* SINGLE COLUMN REVIEW LAYOUT - v7.2 */
/* ============================================== */

.review-layout-single {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

/* Legacy side-by-side layout (kept for backward compatibility) */
.review-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin-bottom: 20px;
}

.review-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.panel-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
}

.item-count {
    font-size: 0.8rem;
    color: #64748b;
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 12px;
}

.review-panel .preview-pane {
    border-radius: 0;
    min-height: 350px;
    max-height: 450px;
}

/* Entity list compact - simple table layout */
.entity-list-compact {
    max-height: 300px;
    overflow-y: auto;
    padding: 0;
}

.entity-list-compact .entity-table-header {
    display: grid;
    grid-template-columns: 50px 80px 1fr 140px 60px 80px;
    gap: 8px;
    padding: 10px 14px;
    background-color: #f1f5f9;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.entity-list-compact .entity-item {
    display: grid;
    grid-template-columns: 50px 80px 1fr 140px 60px 80px;
    gap: 8px;
    align-items: center;
    background-color: white;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.entity-list-compact .entity-item:hover {
    background-color: #f8fafc;
}

.entity-list-compact .col-source {
    font-size: 0.9rem;
    text-align: center;
}

.entity-list-compact .col-type {
    font-weight: 600;
    font-size: 0.75rem;
}

.entity-list-compact .col-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-list-compact .col-value code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-weight: bold;
}

.entity-list-compact .col-replacement {
    color: #64748b;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entity-list-compact .col-count {
    text-align: center;
}

.entity-list-compact .entity-count {
    background-color: #e2e8f0;
    color: #475569;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

.entity-list-compact .col-action {
    text-align: right;
}

.entity-list-compact .remove-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
}

.entity-list-compact .remove-btn:hover {
    background-color: #c0392b;
}

/* Responsive review layout */
@media (max-width: 900px) {
    .review-layout {
        grid-template-columns: 1fr;
    }

    .review-panel-right {
        order: -1;
    }

    .entity-list-compact {
        max-height: 200px;
    }
}

/* ============================================== */
/* CONTEXTUAL LABELING TOOLBAR - v7.0 */
/* ============================================== */

.labeling-toolbar {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: hsl(215, 90%, 97%);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px hsl(215, 90%, 85%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 95vw;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toolbar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.toolbar-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: white;
}

.toolbar-btn-more {
    background: white;
    border-color: #cbd5e1;
    color: #64748b;
}

.toolbar-more {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

/* ============================================== */
/* REVERT TAB - v7.2 */
/* ============================================== */

.revert-intro {
    text-align: center;
    margin-bottom: 24px;
}

.revert-intro h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--foreground);
}

.revert-intro p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.95rem;
}

.revert-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.revert-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.revert-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.revert-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.revert-card-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
}

.revert-card-title p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.revert-card textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    resize: vertical;
}

/* Revert Output Card */
.revert-output-card {
    background: hsl(215, 90%, 97%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.revert-output-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.revert-output-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    color: var(--primary);
    border: 2px solid var(--primary);
    flex-shrink: 0;
}

.revert-output-title {
    flex: 1;
}

.revert-output-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
}

.revert-output-title p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.revert-output-card textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background: white;
    resize: vertical;
    min-height: 150px;
}

@media (max-width: 768px) {
    .revert-layout {
        grid-template-columns: 1fr;
    }

    .revert-output-header {
        flex-wrap: wrap;
    }
}

/* ============================================== */
/* EXPORT PAGE - v7.2 */
/* ============================================== */

.export-card {
    background: hsl(215, 90%, 97%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

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

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

.export-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.export-header-text h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.export-header-text p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--muted-foreground);
}

.export-header-actions {
    display: flex;
    gap: 10px;
}

.export-header-actions .btn-secondary,
.export-header-actions .btn-primary {
    transition: all 0.2s ease;
}

.export-header-actions .btn-secondary:hover,
.export-header-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.export-output-section textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background: white;
    resize: vertical;
    min-height: 200px;
}

/* Vault Card */
.vault-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.vault-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    flex-wrap: wrap;
    gap: 12px;
}

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

.vault-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fef3c7;
    border-radius: 8px;
    color: #d97706;
}

.vault-header-text h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #92400e;
}

.vault-header-text p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: #b45309;
}

.vault-header-actions {
    display: flex;
    gap: 8px;
}

.vault-header-actions .btn-secondary {
    transition: all 0.2s ease;
}

.vault-header-actions .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vault-content {
    padding: 16px;
}

.vault-content textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: #f8fafc;
    resize: vertical;
    min-height: 120px;
}

/* Responsive export */
@media (max-width: 600px) {
    .export-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .vault-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================== */
/* EMBEDDED FAQ SECTION - v7.0 */
/* ============================================== */

.faq-embedded {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.faq-embedded .faq-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.faq-more-link {
    display: inline-block;
    margin-top: 16px;
    color: #0284c7;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.faq-more-link:hover {
    color: #0369a1;
}

/* ============================================== */
/* HEADER UPDATES - v7.0 Simplified */
/* ============================================== */

.header-subtitle {
    display: none;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: background-color 0.2s ease;
}

a.user-dropdown:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-icon {
    color: #64748b;
    flex-shrink: 0;
}

/* ============================================== */
/* ACCOUNT PAGE - v7.2 */
/* ============================================== */

.account-page {
    padding-top: 20px;
}

.account-not-logged-in {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.account-empty-state {
    text-align: center;
    padding: 40px;
    color: var(--muted-foreground);
}

.account-empty-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.account-empty-state h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    color: var(--foreground);
}

.account-empty-state p {
    margin: 0 0 24px;
    font-size: 0.95rem;
}

.account-title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--foreground);
}

.account-subtitle {
    margin: 0 0 24px;
    color: var(--muted-foreground);
    font-size: 0.95rem;
}

/* Privacy Notice */
.privacy-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: hsl(142, 76%, 96%);
    border: 1px solid hsl(142, 76%, 85%);
    border-radius: var(--radius);
    margin-bottom: 24px;
    color: hsl(142, 76%, 30%);
    font-size: 0.85rem;
}

.privacy-notice svg {
    flex-shrink: 0;
    color: hsl(142, 76%, 40%);
}

/* Account Cards */
.account-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.account-card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
}

.account-card-body {
    padding: 20px;
}

/* Plan Badges */
.plan-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-badge.plan-free {
    background: #e2e8f0;
    color: #64748b;
}

.plan-badge.plan-pro {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.plan-badge.plan-cancelled {
    background: #fef3c7;
    color: #92400e;
}

/* Account Info Rows */
.account-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.account-info-row:last-child {
    border-bottom: none;
}

.account-label {
    color: var(--muted-foreground);
    font-size: 0.9rem;
}

.account-value {
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.9rem;
}

.status-active {
    color: #10b981;
}

.status-cancelled {
    color: #f59e0b;
}

/* Cancelled Notice */
.cancelled-notice {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef3c7;
    border-radius: var(--radius);
    border: 1px solid #fde68a;
}

.cancelled-notice p {
    margin: 0;
    color: #92400e;
    font-size: 0.85rem;
}

/* Upgrade Prompt */
.account-upgrade-prompt {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.account-upgrade-prompt p {
    margin: 0 0 16px;
    color: var(--muted-foreground);
    font-size: 0.9rem;
}

/* Cancel Section */
.account-cancel-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.cancel-info {
    margin: 0 0 12px;
    color: var(--muted-foreground);
    font-size: 0.85rem;
}

/* Cancel Button */
.btn-cancel {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

/* Danger Zone */
.account-card-danger {
    border-color: #fecaca;
}

.account-card-danger .account-card-header {
    background: #fef2f2;
    border-color: #fecaca;
}

.account-card-danger .account-card-header h3 {
    color: #dc2626;
}

.danger-text {
    margin: 0 0 16px;
    color: #64748b;
    font-size: 0.9rem;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 16px;
    color: var(--muted-foreground);
    font-size: 0.95rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    z-index: 10001;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.toast-show {
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    background: #dc2626;
}

.toast-success {
    background: #10b981;
}

/* Modal Styles for Account Page */
.modal-note {
    color: var(--muted-foreground);
    font-size: 0.85rem;
    margin-top: 8px;
}

.modal-warning {
    color: #dc2626;
    font-weight: 500;
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* Responsive Account Page */
@media (max-width: 600px) {
    .account-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .account-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

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

    .modal-actions button {
        width: 100%;
    }
}
