        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        :root {
            --bg-primary: #05070c;
            --bg-secondary: #0c0f17;
            --bg-tertiary: #131623;
            --bg-elevated: #1a1e2c;
            --border-light: #232836;
            --border-glow: #2d3348;
            --text-primary: #edf2ff;
            --text-secondary: #8e9ab0;
            --text-muted: #5a667e;
            --accent-primary: #6366f1;
            --accent-secondary: #8b5cf6;
            --accent-glow: rgba(99, 102, 241, 0.2);
            --success: #10b981;
            --success-bg: rgba(16, 185, 129, 0.12);
            --danger: #ef4444;
            --danger-bg: rgba(239, 68, 68, 0.12);
            --warning: #f59e0b;
        }

        body {
            font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.5;
            min-height: 100vh;
        }

        .header {
            background: rgba(5, 7, 12, 0.95);
            backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--border-light);
            padding: 0.875rem 1rem;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-content {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .logo-section {
            display: flex;
            align-items: baseline;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .logo {
            font-size: 1.25rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .brand {
            font-size: 0.7rem;
            color: var(--text-muted);
        }

        .btn-group {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            align-items: center;
        }

        .btn {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
            padding: 0.5rem 0.875rem;
            border-radius: 10px;
            font-size: 0.8125rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            white-space: nowrap;
        }

        .btn:active {
            transform: scale(0.97);
        }

        .btn-primary {
            background: var(--accent-primary);
            color: white;
            border-color: var(--accent-primary);
        }

        .mode-selector {
            display: flex;
            gap: 0.5rem;
            background: var(--bg-secondary);
            padding: 0.375rem;
            border-radius: 12px;
            border: 1px solid var(--border-light);
        }

        .mode-btn {
            background: transparent;
            border: none;
            padding: 0.375rem 0.875rem;
            border-radius: 8px;
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            color: var(--text-secondary);
            transition: all 0.2s;
            white-space: nowrap;
        }

        .mode-btn.active {
            background: var(--accent-primary);
            color: white;
        }

        .filter-group {
            display: flex;
            gap: 0.5rem;
            background: var(--bg-secondary);
            padding: 0.375rem;
            border-radius: 12px;
            border: 1px solid var(--border-light);
        }

        .filter-chip {
            background: transparent;
            border: none;
            padding: 0.375rem 0.875rem;
            border-radius: 8px;
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            color: var(--text-secondary);
            transition: all 0.2s;
            white-space: nowrap;
        }

        .filter-chip.active {
            background: var(--accent-primary);
            color: white;
        }

        .main {
            max-width: 1400px;
            margin: 0 auto;
            padding: 1rem;
        }

        .input-panel {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        @media (min-width: 768px) {
            .input-panel {
                grid-template-columns: 1fr 1fr;
                gap: 1.5rem;
            }
        }

        .input-card {
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            border-radius: 16px;
            overflow: hidden;
        }

        .input-card:focus-within {
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem 1rem;
            background: var(--bg-tertiary);
            border-bottom: 1px solid var(--border-light);
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .card-header h3 {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .stats-mini {
            display: flex;
            gap: 0.75rem;
            font-size: 0.7rem;
            color: var(--text-muted);
        }

        .stats-mini span {
            font-family: monospace;
        }

        textarea {
            width: 100%;
            min-height: 200px;
            padding: 1rem;
            background: var(--bg-secondary);
            border: none;
            color: var(--text-primary);
            font-family: 'SF Mono', 'Fira Code', monospace;
            font-size: 0.8125rem;
            line-height: 1.6;
            resize: vertical;
            outline: none;
        }

        @media (min-width: 768px) {
            textarea {
                min-height: 300px;
            }
        }

        .diff-section {
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            border-radius: 16px;
            overflow: hidden;
        }

        .diff-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.875rem 1rem;
            background: var(--bg-tertiary);
            border-bottom: 1px solid var(--border-light);
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .stats-detailed {
            display: flex;
            gap: 1.5rem;
            flex-wrap: wrap;
        }

        .stat-card {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }

        .stat-label {
            font-size: 0.7rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stat-value {
            font-size: 1.25rem;
            font-weight: 700;
        }

        .stat-value.add {
            color: var(--success);
        }

        .stat-value.remove {
            color: var(--danger);
        }

        .stat-value.modified {
            color: var(--warning);
        }

        .diff-content {
            padding: 1rem;
            max-height: 500px;
            overflow-y: auto;
            font-family: 'SF Mono', 'Fira Code', monospace;
            font-size: 0.8125rem;
            line-height: 1.6;
        }

        @media (min-width: 768px) {
            .diff-content {
                max-height: 600px;
            }
        }

        .diff-line {
            padding: 0.5rem 0.75rem;
            border-radius: 8px;
            white-space: pre-wrap;
            word-break: break-word;
            display: flex;
            gap: 0.75rem;
            margin-bottom: 0.125rem;
        }

        .diff-marker {
            flex-shrink: 0;
            width: 28px;
            font-weight: 700;
            user-select: none;
            font-family: monospace;
        }

        .diff-text {
            flex: 1;
        }

        .diff-line.context {
            color: var(--text-secondary);
            background: transparent;
        }

        .diff-line.context .diff-marker {
            color: var(--text-muted);
        }

        .diff-line.remove {
            background: var(--danger-bg);
            border-left: 3px solid var(--danger);
            margin-left: -3px;
        }

        .diff-line.remove .diff-marker {
            color: var(--danger);
        }

        .diff-line.add {
            background: var(--success-bg);
            border-left: 3px solid var(--success);
            margin-left: -3px;
        }

        .diff-line.add .diff-marker {
            color: var(--success);
        }

        .diff-line.modified {
            background: rgba(245, 158, 11, 0.12);
            border-left: 3px solid var(--warning);
            margin-left: -3px;
        }

        .diff-line.modified .diff-marker {
            color: var(--warning);
        }

        .inline-diff-del {
            background: rgba(239, 68, 68, 0.4);
            text-decoration: line-through;
            border-radius: 4px;
            padding: 0 2px;
            color: #fca5a5;
        }

        .inline-diff-add {
            background: rgba(16, 185, 129, 0.4);
            border-radius: 4px;
            padding: 0 2px;
            color: #6ee7b7;
        }

        .char-diff-container {
            background: var(--bg-tertiary);
            padding: 1rem;
            border-radius: 12px;
            margin-bottom: 1rem;
        }

        .char-diff-title {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
            text-transform: uppercase;
        }

        .char-diff-content {
            white-space: pre-wrap;
            word-break: break-word;
            line-height: 1.8;
            font-family: 'SF Mono', 'Fira Code', monospace;
            font-size: 0.875rem;
        }

        .empty-state {
            text-align: center;
            padding: 3rem 1rem;
            color: var(--text-muted);
        }

        .empty-state svg {
            width: 80px;
            height: 80px;
            margin-bottom: 1rem;
            opacity: 0.5;
        }

        .report-container {
            margin: 1rem 0;
            display: flex;
            justify-content: flex-end;
        }

        #reportContainer {
            display: none;
        }

        .report-trigger {
            background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
            border: none;
            padding: 0.75rem 1.5rem;
            border-radius: 40px;
            font-weight: 600;
            gap: 0.75rem;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }

        .report-trigger:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(8px);
            z-index: 1000;
            overflow-y: auto;
        }

        .modal.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: var(--bg-secondary);
            border: 1px solid var(--border-glow);
            border-radius: 20px;
            max-width: 1000px;
            width: 90%;
            max-height: 85vh;
            overflow-y: auto;
            margin: 2rem auto;
            position: relative;
        }

        .modal-header {
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--bg-tertiary);
            border-radius: 20px 20px 0 0;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .modal-header h2 {
            font-size: 1.25rem;
            font-weight: 600;
            background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .close-modal {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0 0.5rem;
            transition: all 0.2s;
        }

        .close-modal:hover {
            color: var(--text-primary);
        }

        .report-body {
            padding: 1.5rem;
        }

        .report-section {
            margin-bottom: 2rem;
            page-break-inside: avoid;
        }

        .report-section h3 {
            font-size: 1rem;
            font-weight: 600;
            color: var(--accent-primary);
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border-light);
        }

        .insight-card {
            background: var(--bg-tertiary);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
            border-left: 3px solid var(--accent-primary);
        }

        .insight-title {
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--text-primary);
        }

        .insight-value {
            color: var(--text-secondary);
            font-size: 0.875rem;
            line-height: 1.6;
        }

        .metric-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .metric {
            background: var(--bg-tertiary);
            padding: 1rem;
            border-radius: 12px;
            text-align: center;
        }

        .metric-label {
            font-size: 0.7rem;
            color: var(--text-muted);
            text-transform: uppercase;
            margin-bottom: 0.5rem;
        }

        .metric-value {
            font-size: 1.5rem;
            font-weight: 700;
        }

        .badge {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .badge-low {
            background: rgba(16, 185, 129, 0.2);
            color: var(--success);
        }

        .badge-moderate {
            background: rgba(245, 158, 11, 0.2);
            color: var(--warning);
        }

        .badge-major {
            background: rgba(239, 68, 68, 0.2);
            color: var(--danger);
        }

        .report-diff-preview {
            background: var(--bg-primary);
            border-radius: 8px;
            padding: 1rem;
            font-family: 'SF Mono', monospace;
            font-size: 0.75rem;
            overflow: visible;
            max-height: none;
        }

        @media print {
            .modal-content {
                max-height: none;
                overflow: visible;
            }
            .report-diff-preview {
                overflow: visible;
                max-height: none;
                page-break-inside: auto;
            }
            .diff-line {
                page-break-inside: avoid;
            }
        }

        .branding-footer {
            text-align: center;
            padding: 1rem;
            margin-top: 1rem;
            border-top: 1px solid var(--border-light);
            color: var(--text-muted);
            font-size: 0.75rem;
        }

        .toast {
            position: fixed;
            bottom: 1.5rem;
            left: 50%;
            transform: translateX(-50%);
            background: var(--bg-elevated);
            border: 1px solid var(--border-glow);
            color: var(--text-primary);
            padding: 0.75rem 1.25rem;
            border-radius: 40px;
            font-size: 0.8125rem;
            z-index: 1001;
            animation: slideUp 0.3s ease;
            backdrop-filter: blur(12px);
            max-width: 90%;
            text-align: center;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
        }

        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-tertiary);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border-glow);
            border-radius: 3px;
        }

        .drag-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(99, 102, 241, 0.1);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 999;
            pointer-events: none;
        }

        .drag-overlay.active {
            display: flex;
        }

        .drag-message {
            background: var(--bg-elevated);
            padding: 1.5rem 2rem;
            border-radius: 20px;
            border: 2px dashed var(--accent-primary);
        }