        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: #fafaf9;
            min-height: 100vh;
            padding: 20px;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.1);
            overflow: hidden;
        }
        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 40px;
            text-align: center;
            position: relative;
        }
        /* Horizontal Navbar Styles */
        .navbar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: #fafaf9;
            box-shadow: 0 2px 10px rgba(0,0,0,0.08);
            z-index: 1000;
            height: 60px;
        }
        .navbar-container {
            max-width: 1200px;
            margin: 0 auto;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
        }
        .navbar-brand {
            display: flex;
            align-items: center;
            gap: 12px;
            text-decoration: none;
            color: #667eea;
            font-size: 1.25rem;
            font-weight: 600;
            transition: all 0.3s ease;
        }
        
        .navbar-brand:hover {
            transform: translateY(-1px);
        }
        
        .navbar-brand svg {
            width: 40px;
            height: 40px;
        }
        
        .navbar-nav {
            display: flex;
            align-items: center;
            gap: 30px;
            list-style: none;
            margin: 0;
            padding: 0;
        }
        .nav-item {
            position: relative;
        }
        .nav-link {
            color: #667eea;
            text-decoration: none;
            padding: 8px 12px;
            border-radius: 6px;
            transition: all 0.3s ease;
            font-size: 0.95rem;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .nav-link:hover {
            color: white;
            background: #667eea;
        }
        .nav-link.active {
            color: white;
            background: #667eea;
        }
        /* Dropdown styles */
        .dropdown {
            position: relative;
        }
        .dropdown-toggle::after {
            content: '▼';
            font-size: 0.7rem;
            margin-left: 4px;
        }
        .dropdown-menu {
            position: absolute;
            top: 100%;
            left: 0;
            background: #fafaf9;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            min-width: 200px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.3s ease;
            margin-top: 8px;
            border: 1px solid rgba(102, 126, 234, 0.1);
            z-index: 1001;
        }
        .dropdown:hover .dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }
        .dropdown-item {
            display: block;
            padding: 12px 20px;
            color: #667eea;
            text-decoration: none;
            transition: all 0.2s ease;
            font-size: 0.9rem;
        }
        .dropdown-item:hover {
            background: #667eea;
            color: white;
        }
        .dropdown-item:first-child {
            border-radius: 8px 8px 0 0;
        }
        .dropdown-item:last-child {
            border-radius: 0 0 8px 8px;
        }
        /* Legal links section */
        .navbar-legal {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-left: auto;
        }
        .navbar-legal a {
            color: #9ca3af;
            text-decoration: none;
            font-size: 0.85rem;
            transition: all 0.3s ease;
        }
        .navbar-legal a:hover {
            color: #6b7280;
        }
        /* Mobile menu button */
        .mobile-menu-btn {
            display: none;
            background: none;
            border: none;
            color: #667eea;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 8px;
        }
        /* Mobile menu */
        .mobile-menu {
            display: none;
            position: fixed;
            top: 60px;
            left: 0;
            right: 0;
            background: #fafaf9;
            max-height: calc(100vh - 60px);
            overflow-y: auto;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            border-top: 1px solid rgba(102, 126, 234, 0.1);
            z-index: 9999;
        }
        .mobile-menu.open {
            display: block;
        }
        .mobile-nav {
            padding: 20px;
        }
        .mobile-nav-item {
            margin-bottom: 10px;
        }
        .mobile-nav-link {
            display: block;
            color: #667eea;
            text-decoration: none;
            padding: 12px 16px;
            border-radius: 6px;
            transition: all 0.3s ease;
        }
        .mobile-nav-link:hover {
            background: #667eea;
            color: white;
        }
        .mobile-nav-link.active {
            background: #667eea;
            color: white;
        }
        .mobile-dropdown {
            margin-top: 8px;
            margin-left: 0;
        }
        .mobile-dropdown-toggle {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            background: none;
            border: none;
            color: #667eea;
            text-align: left;
            cursor: pointer;
            padding: 12px 16px;
            font-size: 0.95rem;
            border-radius: 6px;
            transition: all 0.3s ease;
        }
        .mobile-dropdown-toggle::after {
            content: '▼';
            font-size: 0.7rem;
            transition: transform 0.3s ease;
        }
        .mobile-dropdown-toggle:hover {
            background: rgba(102, 126, 234, 0.1);
        }
        .mobile-dropdown-toggle.open::after {
            transform: rotate(180deg);
        }
        .mobile-dropdown-menu {
            display: none;
            margin-top: 8px;
            margin-left: 20px;
        }
        .mobile-dropdown-menu.open {
            display: block;
        }
        .mobile-legal {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid rgba(102, 126, 234, 0.1);
        }
        /* Adjust body padding for fixed navbar */
        body {
            padding-top: 80px;
        }
        /* Responsive styles */
        @media (max-width: 1024px) {
            .navbar-nav {
                gap: 20px;
            }
            .nav-link {
                font-size: 0.9rem;
                padding: 6px 10px;
            }
        }
        @media (max-width: 768px) {
            .navbar-nav,
            .navbar-legal {
                display: none;
            }
            .mobile-menu-btn {
                display: block;
            }
            .navbar-brand {
                font-size: 1.1rem;
            }
            .navbar-brand svg {
                width: 32px;
                height: 32px;
            }
        }
        .header h1 {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 10px;
        }
        .header p {
            font-size: 1.1rem;
            opacity: 0.9;
        }
        .main-content {
            display: grid;
            grid-template-columns: 300px 1fr 300px;
            gap: 0;
            min-height: 600px;
            position: relative;
            z-index: 1;
        }
        .content-area {
            padding: 40px;
            overflow-x: hidden;
            min-width: 0;
        }
        .left-sidebar, .right-sidebar {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            padding: 20px;
            min-height: 600px;
        }
        .left-sidebar {
            border-right: none;
        }
        .right-sidebar {
            border-left: none;
        }
        .ad-space {
            background: #f0f9ff;
            border: 2px solid #0ea5e9;
            border-radius: 8px;
            padding: 15px;
            text-align: center;
            color: #0369a1;
            margin-bottom: 20px;
            font-weight: 600;
            position: relative;
            overflow: hidden;
        }
        .ad-space::before {
            content: "📢 AD SPACE";
            position: absolute;
            top: 5px;
            right: 5px;
            font-size: 0.7rem;
            background: #0ea5e9;
            color: white;
            padding: 2px 6px;
            border-radius: 3px;
        }
        .mock-ad {
            background: linear-gradient(45deg, #f0f9ff, #e0f2fe);
            border: 2px dashed #0ea5e9;
            padding: 20px;
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            color: #0369a1;
            min-height: 200px;
        }
        .mock-ad.vertical {
            min-height: 600px;
            background: linear-gradient(180deg, #fef3c7, #fde68a);
            border-color: #f59e0b;
            color: #92400e;
        }
        .mock-ad.square {
            min-height: 250px;
            max-height: 250px;
            background: linear-gradient(45deg, #fce7f3, #fbcfe8);
            border-color: #ec4899;
            color: #be185d;
        }
        .mock-ad.horizontal {
            min-height: 90px;
            max-height: 90px;
            background: linear-gradient(90deg, #ecfdf5, #d1fae5);
            border-color: #10b981;
            color: #065f46;
            flex-direction: row;
        }
        .mock-ads-enabled .real-ad {
            display: none !important;
        }
        .mock-ads-enabled .mock-ad {
            display: flex !important;
        }
        .real-ads-enabled .mock-ad {
            display: none !important;
        }
        .real-ads-enabled .real-ad {
            display: block !important;
        }
        .ad-toggle {
            position: fixed;
            top: 20px;
            right: 20px;
            background: #667eea;
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 25px;
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 600;
            z-index: 1000;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        }
        .ad-toggle:hover {
            background: #5b6bc0;
            transform: translateY(-1px);
        }
        .upload-area {
            border: 3px dashed #667eea;
            border-radius: 15px;
            padding: 60px 40px;
            text-align: center;
            background: #f8fafc;
            transition: all 0.3s ease;
            margin-bottom: 30px;
            cursor: pointer;
            width: 100%;
            box-sizing: border-box;
        }
        .upload-area:hover {
            border-color: #764ba2;
            background: #f1f5f9;
            transform: translateY(-2px);
        }
        .upload-area.dragover {
            border-color: #10b981;
            background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
            box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2);
            transform: translateY(-3px) scale(1.02);
            border-style: solid;
        }
        .upload-area.dragover .upload-icon {
            transform: scale(1.2);
            animation: pulse 1s infinite;
        }
        @keyframes pulse {
            0%, 100% {
                opacity: 1;
            }
            50% {
                opacity: 0.7;
            }
        }
        .upload-icon {
            font-size: 3rem;
            margin-bottom: 20px;
            color: #667eea;
        }
        .upload-text {
            font-size: 1.2rem;
            color: #475569;
            margin-bottom: 10px;
            font-weight: 600;
        }
        .upload-subtext {
            color: #64748b;
            font-size: 0.9rem;
        }
        .file-list {
            margin-bottom: 30px;
            width: 100%;
            box-sizing: border-box;
            overflow: hidden;
        }
        .file-item {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            justify-content: between;
            transition: all 0.2s ease;
        }
        .file-item:hover {
            border-color: #667eea;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
        }
        .file-info {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .file-icon {
            width: 32px;
            height: 32px;
            background: #667eea;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 0.8rem;
        }
        .file-details {
            flex: 1;
        }
        .file-name {
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 2px;
        }
        .file-size {
            font-size: 0.8rem;
            color: #64748b;
        }
        .file-controls {
            display: flex;
            gap: 5px;
        }
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }
        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-size: 1.1rem;
            padding: 12px 24px;
        }
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
        }
        .btn-secondary {
            background: #f1f5f9;
            color: #475569;
            border: 1px solid #e2e8f0;
        }
        .btn-secondary:hover {
            background: #e2e8f0;
        }
        .btn-danger {
            background: #fef2f2;
            color: #dc2626;
            border: 1px solid #fecaca;
        }
        .btn-danger:hover {
            background: #fee2e2;
        }
        .btn-small {
            padding: 4px 8px;
            font-size: 0.8rem;
        }
        .progress-container {
            margin: 20px 0;
            display: none;
        }
        /* Preview Section */
        .preview-section {
            margin: 20px 0;
            padding: 20px;
            background: #f9fafb;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            width: 100%;
            box-sizing: border-box;
            overflow: hidden;
        }
        .preview-container {
            position: relative;
            max-height: 300px;
            overflow-y: auto;
            overflow-x: auto;
            background: white;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            padding: 15px;
            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
            width: 100%;
            box-sizing: border-box;
        }
        .preview-content {
            margin: 0;
            white-space: pre-wrap;
            word-wrap: break-word;
            font-size: 0.875rem;
            line-height: 1.5;
            color: #374151;
        }
        .preview-info {
            margin-top: 10px;
            font-size: 0.875rem;
            color: #6b7280;
            text-align: center;
        }
        .progress-bar {
            width: 100%;
            height: 8px;
            background: #e2e8f0;
            border-radius: 4px;
            overflow: hidden;
        }
        .progress-fill {
            height: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            width: 0%;
            transition: width 0.3s ease;
        }
        .progress-text {
            text-align: center;
            margin-top: 10px;
            color: #64748b;
            font-weight: 600;
        }
        .stats {
            background: #f8fafc;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            margin-top: 20px;
        }
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 20px;
        }
        .stat-item {
            text-align: center;
        }
        .stat-number {
            font-size: 1.8rem;
            font-weight: 700;
            color: #667eea;
        }
        .stat-label {
            font-size: 0.9rem;
            color: #64748b;
            margin-top: 5px;
        }
        .output-options {
            margin-bottom: 20px;
        }
        .output-options label {
            display: block;
            margin-bottom: 10px;
            font-weight: 600;
            color: #374151;
        }
        .radio-group {
            display: flex;
            gap: 15px;
            margin-bottom: 15px;
        }
        .radio-option {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .radio-option input[type="radio"] {
            margin: 0;
        }
        .toc-input {
            width: 100%;
            padding: 10px;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-family: inherit;
        }
        .toc-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        .hidden {
            display: none !important;
        }
        .empty-state {
            text-align: center;
            padding: 40px;
            color: #64748b;
        }
        .empty-state-icon {
            font-size: 3rem;
            margin-bottom: 15px;
            opacity: 0.5;
        }
        /* Ad Placeholder Styles */
        .ad-placeholder {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 10px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #94a3b8;
            font-size: 0.875rem;
        }
        /* Processing History Styles */
        .processing-history {
            background: #f8fafc;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            border: 1px solid #e2e8f0;
        }
        .history-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }
        .history-list {
            max-height: 200px;
            overflow-y: auto;
        }
        .history-item {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 12px 15px;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: all 0.2s ease;
            cursor: pointer;
        }
        .history-item:hover {
            border-color: #667eea;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
            transform: translateY(-1px);
        }
        .history-item-info {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .history-icon {
            width: 24px;
            height: 24px;
            background: #667eea;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.7rem;
            font-weight: bold;
        }
        .history-details {
            flex: 1;
        }
        .history-name {
            font-weight: 600;
            color: #1e293b;
            font-size: 0.9rem;
            margin-bottom: 2px;
        }
        .history-meta {
            font-size: 0.75rem;
            color: #64748b;
        }
        .history-actions {
            display: flex;
            gap: 5px;
        }
        .history-repeat-btn {
            background: #667eea;
            color: white;
            border: none;
            padding: 6px 10px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: 600;
            transition: all 0.2s ease;
        }
        .history-repeat-btn:hover {
            background: #5b6bc0;
            transform: translateY(-1px);
        }
        /* Success Analytics Styles */
        .success-analytics {
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            border: 1px solid #0ea5e9;
        }
        .analytics-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 20px;
        }
        .achievement-badge {
            display: flex;
            align-items: center;
            gap: 15px;
            flex: 1;
        }
        .achievement-icon {
            font-size: 2rem;
            animation: bounce 2s infinite;
        }
        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% {
                transform: translateY(0);
            }
            40% {
                transform: translateY(-5px);
            }
            60% {
                transform: translateY(-3px);
            }
        }
        .achievement-text {
            flex: 1;
        }
        .achievement-title {
            font-weight: 700;
            color: #0c4a6e;
            font-size: 1.1rem;
            margin-bottom: 4px;
        }
        .achievement-subtitle {
            color: #0369a1;
            font-size: 0.9rem;
        }
        .stats-mini {
            display: flex;
            gap: 20px;
        }
        .stat-mini {
            display: flex;
            flex-direction: column;
            align-items: center;
            background: rgba(255, 255, 255, 0.8);
            padding: 10px 15px;
            border-radius: 8px;
            border: 1px solid rgba(14, 165, 233, 0.2);
        }
        .stat-mini-number {
            font-size: 1.5rem;
            font-weight: 700;
            color: #0c4a6e;
        }
        .stat-mini-label {
            font-size: 0.75rem;
            color: #0369a1;
            margin-top: 2px;
        }
        @media (max-width: 1200px) {
            .main-content {
                grid-template-columns: 1fr;
            }
            .left-sidebar, .right-sidebar {
                display: none;
            }
        }
        @media (max-width: 768px) {
            body {
                padding: 10px;
            }
            .container {
                border-radius: 10px;
            }
            .header {
                padding: 20px 15px;
            }
            .header h1 {
                font-size: 1.5rem;
                line-height: 1.3;
            }
            .header p {
                font-size: 0.9rem;
            }
            .header svg {
                width: 48px;
                height: 48px;
            }
            .content-area {
                padding: 20px 15px;
            }
            .upload-area {
                padding: 40px 20px;
            }
            .upload-icon {
                font-size: 2.5rem;
            }
            .upload-text {
                font-size: 1rem;
            }
            .btn {
                font-size: 0.9rem;
                padding: 10px 16px;
            }
            .file-item {
                padding: 12px;
            }
            .file-info h4 {
                font-size: 0.9rem;
            }
            .file-info p {
                font-size: 0.75rem;
            }
            .options-section {
                padding: 15px;
            }
            .radio-group {
                gap: 8px;
            }
            footer {
                padding: 20px 15px;
            }
            footer h2 {
                font-size: 1.4rem;
            }
            footer h3 {
                font-size: 1.2rem;
            }
            footer p, footer li {
                font-size: 0.9rem;
            }
            /* Stack buttons on mobile */
            #combineBtn, #clearAllBtn {
                display: block !important;
                width: 100%;
                margin: 10px 0 !important;
            }
            /* Expert Knowledge mobile styling */
            .expert-cards, .expert-resources-grid {
                grid-template-columns: 1fr !important;
            }
            .expert-card {
                padding: 20px !important;
            }
            /* Processing History mobile styles */
            .analytics-container {
                flex-direction: column;
                gap: 15px;
            }
            .achievement-badge {
                text-align: center;
            }
            .achievement-icon {
                font-size: 1.5rem;
            }
            .achievement-title {
                font-size: 1rem;
            }
            .achievement-subtitle {
                font-size: 0.85rem;
            }
            .stats-mini {
                gap: 15px;
                justify-content: center;
            }
            .stat-mini {
                padding: 8px 12px;
            }
            .stat-mini-number {
                font-size: 1.2rem;
            }
            .history-item {
                padding: 10px 12px;
            }
            .history-name {
                font-size: 0.85rem;
            }
            .history-meta {
                font-size: 0.7rem;
            }
            .history-repeat-btn {
                padding: 5px 8px;
                font-size: 0.7rem;
            }
            .expert-card h3 {
                font-size: 1.1rem !important;
            }
            .expert-card p {
                font-size: 0.85rem !important;
            }
            /* Expert section mobile styles */
            section[style*="background: #f8f6ff"] {
                padding: 20px !important;
            }
            section[style*="background: #f8f6ff"] h2 {
                font-size: 1.4rem !important;
            }
            section[style*="background: #f8f6ff"] div[style*="background: white"] {
                padding: 15px !important;
            }
        }
        @media (max-width: 480px) {
            .header h1 {
                font-size: 1.25rem;
            }
            .header p {
                font-size: 0.8rem;
            }
            .header svg {
                width: 40px;
                height: 40px;
            }
            .upload-text {
                font-size: 0.9rem;
            }
            .options-section label {
                font-size: 0.9rem;
            }
            /* Ensure buttons stack properly */
            .btn {
                white-space: normal;
                height: auto;
                min-height: 44px;
            }
        }
