    :root {
      --bg: #ffffff;
      --surface: #f8fafc;
      --text: #1e293b;
      --muted: #64748b;
      --border: #e2e8f0;
      --primary: #2563eb;
      --primary-hover: #1d4ed8;
      --primary-glow: rgba(37, 99, 235, 0.4);
      --success: #10b981;
      --danger: #ef4444;
      --warning: #f59e0b;
      --radius: 12px;
      --radius-lg: 16px;
      --shadow: 0 4px 20px rgba(0,0,0,0.08);
      --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
      --transition: all 0.2s ease;
    }
    
    .dark {
      --bg: #0f172a;
      --surface: #1e2937;
      --text: #f8fafc;
      --muted: #9ca3af;
      --border: #334155;
      --primary: #3b82f6;
      --primary-hover: #2563eb;
      --primary-glow: rgba(59, 130, 246, 0.5);
      --shadow: 0 4px 20px rgba(0,0,0,0.25);
      --shadow-lg: 0 10px 30px rgba(0,0,0,0.35);
    }
    
    * { box-sizing: border-box; margin: 0; padding: 0; }
    html, body { 
      font-family: 'Inter', sans-serif; 
      background: var(--bg); 
      color: var(--text);
      min-height: 100vh; 
      overflow-x: hidden;
      line-height: 1.4;
    }
    
    .skip-link {
      position: absolute;
      top: -40px;
      left: 0;
      background: var(--primary);
      color: white;
      padding: 8px 16px;
      z-index: 10000;
      text-decoration: none;
      font-weight: 600;
      border-radius: 0 0 8px 0;
    }
    .skip-link:focus { top: 0; }
    
    nav { 
      background: var(--bg); 
      border-bottom: 1px solid var(--border); 
      height: 65px; 
      position: sticky; 
      top: 0; 
      z-index: 1000; 
    }
    .nav-container { 
      max-width: 1400px; 
      margin: 0 auto; 
      display: flex; 
      align-items: center; 
      justify-content: space-between; 
      padding: 0 20px; 
      height: 100%; 
    }
    .nav-left { display: flex; align-items: center; gap: 20px; }
    .logo { 
      display: flex; 
      align-items: center; 
      gap: 10px; 
      font-weight: 800; 
      font-size: 1.4rem; 
      text-decoration: none; 
      color: var(--text); 
    }
    .all-tools-btn { 
      display: flex; 
      align-items: center; 
      gap: 8px; 
      background: #eff6ff; 
      color: #1e40af; 
      border: none; 
      padding: 8px 16px; 
      border-radius: 8px; 
      font-weight: 600; 
      font-size: 0.95rem; 
      cursor: pointer; 
      transition: var(--transition); 
    }
    .dark .all-tools-btn { background: #1e3a8a; color: white; }
    .all-tools-btn:hover { background: #dbeafe; }
    
    .nav-right { display: flex; align-items: center; gap: 12px; }
    
    .language-selector { position: relative; }
    .lang-btn { 
      background: none; 
      border: 1px solid var(--border); 
      padding: 8px 12px; 
      border-radius: 8px; 
      font-weight: 500; 
      color: var(--text); 
      cursor: pointer; 
      display: flex; 
      align-items: center; 
      gap: 6px;
    }
    .lang-btn:hover { background: var(--surface); }
    .lang-dropdown { 
      position: absolute; 
      top: 100%; 
      right: 0; 
      background: var(--surface); 
      border: 1px solid var(--border); 
      border-radius: 8px; 
      box-shadow: var(--shadow-lg); 
      display: none; 
      min-width: 160px; 
      z-index: 100; 
      margin-top: 4px;
    }
    .lang-dropdown.show { display: block; }
    .lang-option { 
      padding: 10px 16px; 
      cursor: pointer; 
      color: var(--text); 
    }
    .lang-option:hover { background: var(--bg); color: var(--primary); }
    .lang-option.active { background: rgba(37,99,235,0.1); color: var(--primary); font-weight: 600; }
    
    .theme-toggle { 
      position: relative; 
      width: 52px; 
      height: 28px; 
      background: #e2e8f0; 
      border-radius: 50px; 
      cursor: pointer; 
      transition: background 0.3s; 
      border: none; 
      overflow: hidden; 
    }
    .dark .theme-toggle { background: #3b82f6; }
    .theme-toggle::after { 
      content: ''; 
      position: absolute; 
      top: 3px; 
      left: 3px; 
      width: 22px; 
      height: 22px; 
      background: white; 
      border-radius: 50%; 
      transition: transform 0.3s ease; 
      box-shadow: 0 2px 4px rgba(0,0,0,0.2); 
    }
    .dark .theme-toggle::after { transform: translateX(24px); }
    .theme-toggle i { 
      position: absolute; 
      top: 50%; 
      transform: translateY(-50%); 
      font-size: 14px; 
      transition: opacity 0.2s; 
      z-index: 2; 
    }
    .sun-icon { left: 8px; color: #f59e0b; }
    .moon-icon { right: 8px; color: #e0f2fe; opacity: 0; }
    .dark .sun-icon { opacity: 0; }
    .dark .moon-icon { opacity: 1; }
    
    .menu-btn { 
      background: none; 
      border: none; 
      font-size: 1.4rem; 
      color: var(--text); 
      cursor: pointer; 
      padding: 8px; 
      border-radius: 8px; 
      display: block; 
    }
    .menu-btn:hover { background: var(--surface); }
    #mobile-menu { 
      display: none; 
      position: fixed; 
      top: 65px; 
      left: 0; 
      width: 100%; 
      background: var(--surface); 
      border-bottom: 1px solid var(--border); 
      padding: 20px; 
      z-index: 999; 
      box-shadow: var(--shadow-lg); 
    }
    #mobile-menu a { 
      display: block; 
      padding: 12px 0; 
      text-decoration: none; 
      color: var(--text); 
      font-weight: 500; 
      border-bottom: 1px solid var(--border); 
    }
    #mobile-menu a:hover { color: var(--primary); }
    .show { display: block !important; }
    
    main { 
      display: flex; 
      max-width: 1400px; 
      margin: 0 auto; 
      min-height: calc(100vh - 130px); 
      padding: 15px 20px;
    }
    .content-area { 
      flex: 1; 
      padding: 15px; 
      display: flex; 
      flex-direction: column; 
    }
    .content-area.full-width {
      max-width: 100%;
    }
    .sidebar { 
      width: 320px; 
      padding: 20px; 
      border-left: 1px solid var(--border); 
      flex-shrink: 0; 
      display: flex; 
      flex-direction: column; 
      gap: 16px; 
    }
    @media (max-width: 1024px) { 
      .sidebar { display: none; } 
    }
    @media (max-width: 768px) { 
      .all-tools-btn { display: none; }
      .content-area { padding: 10px; }
      nav { height: 60px; }
    }
    
    /* HERO - Only visible on initial state */
    .hero { 
      text-align: center; 
      padding: 4px 0 10px; 
      margin-bottom: 6px;
    }
    .hero h1 { 
      font-size: 1.9rem; 
      font-weight: 800; 
      letter-spacing: -0.03em; 
      margin: 0 0 6px; 
    }
    .hero h1 span { 
      background: linear-gradient(135deg, var(--primary), #60a5fa);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .hero p { 
      color: var(--text);
      font-size: 0.95rem; 
      max-width: 600px; 
      margin: 0 auto; 
      font-weight: 500;
    }
    
    .trust-badges {
      display: flex;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
      margin: 10px 0;
      font-size: 0.8rem;
      color: var(--text);
      font-weight: 500;
    }
    .trust-badges span {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      background: var(--surface);
      border-radius: 20px;
      border: 1px solid var(--border);
    }
    .trust-badges i { color: var(--success); font-size: 0.85rem; }
    
    /* DROP ZONE */
    #drop-zone { 
      border: 3px dashed var(--border); 
      border-radius: var(--radius-lg); 
      padding: 60px 40px; 
      text-align: center; 
      cursor: pointer; 
      transition: var(--transition); 
      background: var(--surface);
      margin: 10px 0;
    }
    #drop-zone:hover, #drop-zone.drag-over { 
      border-color: var(--primary); 
      background: rgba(37, 99, 235, 0.04);
      transform: translateY(-2px);
    }
    #drop-zone.active-drop {
      border-style: solid;
      border-color: var(--primary);
      background: rgba(37, 99, 235, 0.08);
    }
    #drop-zone .upload-icon { 
      font-size: 3.5rem; 
      color: var(--primary); 
      margin-bottom: 20px; 
      display: block;
    }
    #drop-zone p { 
      font-size: 1.2rem; 
      font-weight: 700; 
      color: var(--text); 
      margin: 0 0 8px; 
    }
    #drop-zone .subtitle { 
      color: var(--muted); 
      font-size: 0.9rem; 
      display: block; 
      margin: 12px 0 20px; 
    }
    #drop-zone .paste-hint {
      background: rgba(37,99,235,0.1);
      color: var(--primary);
      padding: 6px 14px;
      border-radius: 20px;
      font-size: 0.85rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 16px;
    }
    .upload-buttons {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      margin-top: 8px;
    }
    #select-btn-trigger { 
      background: var(--primary); 
      color: white; 
      border: none; 
      padding: 14px 36px; 
      font-size: 1.05rem; 
      font-weight: 700; 
      border-radius: 10px; 
      cursor: pointer; 
      box-shadow: 0 8px 20px rgba(37,99,235,0.35); 
      transition: var(--transition); 
      display: inline-flex;
      align-items: center;
      gap: 10px;
    }
    #select-btn-trigger:hover { 
      transform: translateY(-2px); 
      box-shadow: 0 12px 25px rgba(37,99,235,0.45); 
      background: var(--primary-hover);
    }
    .folder-btn {
      background: var(--bg);
      color: var(--primary);
      border: 2px solid var(--primary);
      width: 48px;
      height: 48px;
      border-radius: 10px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
      transition: var(--transition);
    }
    .folder-btn:hover {
      background: var(--primary);
      color: white;
      transform: translateY(-2px);
    }
    input[type="file"] { display: none; }

    
    /* WORKSPACE */
    #workspace { 
      display: none; 
      flex: 1; 
      min-height: 0;
      animation: fadeIn 0.3s ease;
    }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
    
    .workspace-layout {
      display: grid;
      grid-template-columns: 1fr 360px;
      gap: 20px;
      align-items: start;
    }
    @media (max-width: 1024px) {
      .workspace-layout {
        grid-template-columns: 1fr;
      }
    }
    
    .workspace-main {
      min-width: 0;
    }
    
    .workspace-header { 
      display: flex; 
      justify-content: space-between; 
      align-items: center; 
      margin-bottom: 14px; 
    }
    .workspace-header h3 { 
      margin: 0; 
      font-size: 1.05rem; 
      font-weight: 700; 
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .workspace-header h3 i { color: var(--primary); }
    
    .header-actions { 
      display: flex; 
      gap: 10px; 
      align-items: center; 
    }
    
    .add-files-btn {
      background: var(--primary);
      color: white;
      border: none;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
      transition: var(--transition);
      box-shadow: 0 2px 8px rgba(37,99,235,0.3);
    }
    .add-files-btn:hover {
      background: var(--primary-hover);
      transform: scale(1.1) rotate(90deg);
    }
    
    .clear-btn {
      background: none;
      border: 1px solid var(--danger);
      color: var(--danger);
      padding: 6px 12px;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 600;
      font-size: 0.85rem;
      transition: var(--transition);
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .clear-btn:hover {
      background: var(--danger);
      color: white;
    }

    .grid-container { 
      display: grid; 
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
      gap: 14px; 
      padding: 4px;
      margin-bottom: 12px;
    }
    
    @media (max-width: 600px) {
      .grid-container { 
        grid-template-columns: repeat(2, 1fr);
      }
    }
    
    .file-card { 
      background: var(--surface); 
      border: 1px solid var(--border); 
      border-radius: 12px; 
      padding: 12px; 
      position: relative; 
      cursor: grab; 
      transition: var(--transition); 
    }
    .file-card:hover { 
      transform: translateY(-3px); 
      box-shadow: var(--shadow-lg); 
      border-color: var(--primary);
    }
    .file-card.dragging { opacity: 0.5; }
    
    .thumbnail-box { 
      width: 100%; 
      aspect-ratio: 3/4; 
      background: #e2e8f0; 
      border-radius: 8px; 
      overflow: hidden; 
      margin-bottom: 8px; 
      display: flex; 
      align-items: center; 
      justify-content: center; 
    }
    .dark .thumbnail-box { background: #334155; }
    .thumbnail-box canvas { width: 100%; height: 100%; object-fit: cover; }
    .thumbnail-box i { font-size: 2rem; color: var(--muted); }
    
    .card-info { 
      font-size: 0.75rem; 
      font-weight: 600; 
      white-space: nowrap; 
      overflow: hidden; 
      text-overflow: ellipsis; 
      margin-bottom: 2px; 
      color: var(--text);
    }
    .card-meta { 
      font-size: 0.65rem; 
      color: var(--muted); 
      display: flex;
      justify-content: space-between;
    }
    
    .remove-btn { 
      position: absolute; 
      top: -8px; 
      right: -8px; 
      background: var(--danger); 
      color: white; 
      border: none; 
      width: 24px; 
      height: 24px; 
      border-radius: 50%; 
      cursor: pointer; 
      display: flex; 
      align-items: center; 
      justify-content: center; 
      font-size: 0.7rem; 
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
      transition: var(--transition);
    }
    .remove-btn:hover { transform: scale(1.1); }

    /* TOOL OPTIONS PANEL - Sticky, aligned with workspace top */
    .tool-options-panel {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px;
      position: sticky;
      top: 85px;
    }
    
    .options-title { 
      font-size: 1.1rem; 
      font-weight: 700; 
      margin: 0 0 16px; 
      display: flex; 
      align-items: center; 
      gap: 8px;
      color: var(--text);
    }
    .options-title i { color: var(--primary); }
    
    .mode-grid { 
      display: grid; 
      grid-template-columns: 1fr;
      gap: 10px; 
      margin-bottom: 16px; 
    }
    .mode-option {
      position: relative;
    }
    .mode-option input {
      position: absolute;
      opacity: 0;
      width: 0;
      height: 0;
    }
    .mode-option label {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 14px;
      background: var(--bg);
      border: 2px solid var(--border);
      border-radius: 10px;
      cursor: pointer;
      transition: var(--transition);
      font-weight: 500;
      font-size: 0.9rem;
    }
    .mode-option input:checked + label {
      border-color: var(--primary);
      background: rgba(37,99,235,0.06);
      box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
    }
    .mode-option label:hover {
      border-color: var(--primary-hover);
    }
    .mode-option label i {
      width: 24px;
      height: 24px;
      background: var(--surface);
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary);
      font-size: 0.9rem;
    }
    
    .conditional-input {
      margin: 12px 0;
      padding: 12px;
      background: var(--bg);
      border-radius: 8px;
      border: 1px solid var(--border);
      display: none;
    }
    .conditional-input.active { display: block; }
    .conditional-input label {
      display: block;
      font-weight: 600;
      margin-bottom: 6px;
      color: var(--text);
      font-size: 0.9rem;
    }
    .conditional-input input {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 6px;
      font-size: 0.95rem;
      background: var(--surface);
      color: var(--text);
    }
    .conditional-input input:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
    }
    .conditional-input .hint {
      font-size: 0.8rem;
      color: var(--muted);
      margin-top: 4px;
    }
    
    .merge-toggle {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 10px;
      background: rgba(16,185,129,0.08);
      border: 1px solid rgba(16,185,129,0.3);
      border-radius: 8px;
      margin: 12px 0;
      font-size: 0.9rem;
    }
    .merge-toggle input {
      width: 16px;
      height: 16px;
      cursor: pointer;
      margin-top: 2px;
    }
    .merge-toggle i { color: var(--success); margin-top: 2px; }
    
    #action-btn { 
      background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); 
      color: white; 
      border: none; 
      padding: 14px 32px; 
      border-radius: 10px; 
      font-weight: 700; 
      cursor: pointer; 
      display: inline-flex; 
      align-items: center;
      justify-content: center;
      gap: 10px; 
      font-size: 1.05rem; 
      box-shadow: 0 6px 20px var(--primary-glow);
      transition: var(--transition);
      width: 100%;
      margin-top: 12px;
    }
    #action-btn:hover { 
      transform: translateY(-2px); 
      box-shadow: 0 8px 25px var(--primary-glow);
      background: var(--primary-hover);
    }
    #action-btn:disabled {
      opacity: 0.65;
      cursor: not-allowed;
      transform: none;
    }
    
    /* SUCCESS SCREEN */
    #success-screen {
      display: none;
      animation: fadeIn 0.4s ease;
      max-width: 800px;
      margin: 0 auto;
      width: 100%;
    }
    
    .success-header {
      text-align: center;
      margin-bottom: 24px;
    }
    
    .success-icon-large {
      width: 72px;
      height: 72px;
      background: linear-gradient(135deg, #d1fae5, #a7f3d0);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 16px;
      animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
    }
    @keyframes popIn {
      0% { transform: scale(0) rotate(-10deg); opacity: 0; }
      100% { transform: scale(1) rotate(0); opacity: 1; }
    }
    .success-icon-large i {
      font-size: 2.2rem;
      color: var(--success);
    }
    
    .success-header h2 {
      font-size: 1.7rem;
      font-weight: 800;
      margin: 0 0 10px;
      color: var(--text);
    }
    
    .success-meta {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 14px;
      flex-wrap: wrap;
    }
    
    .success-time {
      color: var(--primary);
      font-weight: 700;
      font-size: 1rem;
    }
    
    .performance-badge-inline {
      background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
      color: #92400e;
      padding: 6px 14px;
      border-radius: 20px;
      font-weight: 600;
      font-size: 0.85rem;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: 1px solid #fbbf24;
    }
    .dark .performance-badge-inline {
      background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
      color: #fef3c7;
      border-color: #f59e0b;
    }
    
    /* ACTION BUTTONS - 3 side by side */
    .action-buttons-row {
      display: flex;
      gap: 12px;
      justify-content: center;
      flex-wrap: wrap;
      margin: 20px 0 24px;
    }
    
    .btn-download-all {
      background: linear-gradient(135deg, var(--success), #059669);
      color: white;
      border: none;
      padding: 14px 28px;
      border-radius: 10px;
      font-weight: 700;
      font-size: 1rem;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(16,185,129,0.35);
      transition: var(--transition);
    }
    .btn-download-all:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(16,185,129,0.45);
    }
    
    .btn-download-individual {
      background: var(--primary);
      color: white;
      border: none;
      padding: 14px 28px;
      border-radius: 10px;
      font-weight: 700;
      font-size: 1rem;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(37,99,235,0.35);
      transition: var(--transition);
    }
    .btn-download-individual:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(37,99,235,0.45);
    }
    
    .btn-start-over {
      background: none;
      border: 2px solid var(--border);
      color: var(--text);
      padding: 14px 28px;
      border-radius: 10px;
      font-weight: 700;
      font-size: 1rem;
      cursor: pointer;
      transition: var(--transition);
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .btn-start-over:hover {
      border-color: var(--primary);
      color: var(--primary);
      background: rgba(37,99,235,0.05);
    }
    
    /* RELATED TOOLS - Now comes before file list */
    .related-tools-section {
      margin: 24px 0 30px;
      padding: 24px 0;
      border-top: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
    }
    .related-tools-section h3 {
      font-size: 1.15rem;
      font-weight: 700;
      margin: 0 0 16px;
      text-align: center;
      color: var(--text);
    }
    .related-tools-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
    }
    .related-tool-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      text-decoration: none;
      color: var(--text);
      transition: var(--transition);
    }
    .related-tool-card:hover {
      border-color: var(--primary);
      transform: translateY(-2px);
      box-shadow: var(--shadow);
    }
    .related-tool-icon {
      width: 42px;
      height: 42px;
      background: var(--bg);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary);
      font-size: 1.1rem;
      flex-shrink: 0;
    }
    .related-tool-info {
      flex: 1;
    }
    .related-tool-name {
      font-weight: 600;
      font-size: 0.9rem;
      margin-bottom: 2px;
    }
    .related-tool-desc {
      font-size: 0.78rem;
      color: var(--muted);
    }
    
    /* FILE LIST BOX - Now comes after related tools */
    .download-section {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px;
      margin-bottom: 30px;
    }
    
    .download-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
    }
    
    .download-header h3 {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--text);
      margin: 0;
    }
    
    .file-count-badge {
      background: var(--primary);
      color: white;
      padding: 4px 14px;
      border-radius: 20px;
      font-size: 0.85rem;
      font-weight: 600;
    }
    
    .file-list {
      max-height: 300px;
      overflow-y: auto;
    }
    .file-list::-webkit-scrollbar { width: 6px; }
    .file-list::-webkit-scrollbar-track { background: var(--bg); border-radius: 3px; }
    .file-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    
    .file-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 8px;
      margin-bottom: 8px;
      transition: var(--transition);
    }
    .file-item:hover {
      border-color: var(--primary);
      transform: translateX(4px);
      box-shadow: var(--shadow);
    }
    .file-item-info {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
      min-width: 0;
    }
    .file-item-icon {
      width: 40px;
      height: 40px;
      background: rgba(37,99,235,0.1);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary);
      flex-shrink: 0;
    }
    .file-item-details {
      flex: 1;
      min-width: 0;
    }
    .file-item-name {
      font-weight: 600;
      font-size: 0.95rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--text);
    }
    .file-item-size {
      font-size: 0.8rem;
      color: var(--muted);
    }
    .download-single-btn {
      background: var(--success);
      color: white;
      border: none;
      padding: 8px 16px;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 600;
      font-size: 0.85rem;
      transition: var(--transition);
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    .download-single-btn:hover {
      background: #0da271;
      transform: translateY(-1px);
    }
    
    /* PROGRESS OVERLAY */
    #processing-overlay { 
      display: none; 
      position: fixed; 
      inset: 0; 
      background: rgba(255,255,255,0.96); 
      z-index: 2000; 
      flex-direction: column; 
      align-items: center; 
      justify-content: center; 
      text-align: center; 
      padding: 20px; 
    }
    .dark #processing-overlay { background: rgba(15, 23, 42, 0.96); }
    
    #processing-overlay h2 { 
      margin: 0 0 20px; 
      font-size: 1.5rem; 
      color: var(--text); 
      font-weight: 700;
    }
    
    .progress-wrapper { 
      width: 100%; 
      max-width: 450px; 
      height: 10px; 
      background: var(--border); 
      border-radius: 10px; 
      overflow: hidden; 
      margin: 20px 0;
      position: relative;
    }
    #progress-bar { 
      width: 0%; 
      height: 100%; 
      background: linear-gradient(90deg, var(--primary), #60a5fa); 
      transition: width 0.3s ease;
      position: relative;
      overflow: hidden;
    }
    #progress-bar::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
      animation: shimmer 1.5s infinite;
    }
    @keyframes shimmer {
      0% { transform: translateX(-100%); }
      100% { transform: translateX(100%); }
    }
    
    #status-msg { 
      color: var(--muted); 
      font-size: 0.95rem; 
      margin: 8px 0; 
    }
    #time-estimate { 
      color: var(--primary); 
      font-weight: 600; 
      font-size: 0.9rem; 
      margin-top: 4px; 
    }
    
    .cancel-btn {
      background: var(--danger);
      color: white;
      border: none;
      padding: 10px 28px;
      border-radius: 8px;
      font-weight: 600;
      cursor: pointer;
      margin-top: 16px;
      transition: var(--transition);
    }
    .cancel-btn:hover {
      background: #dc2626;
    }
    
    .sidebar-box { 
      background: var(--surface); 
      border: 1px solid var(--border); 
      border-radius: var(--radius-lg); 
      padding: 16px; 
    }
    .sidebar-box h3 { 
      margin: 0 0 12px; 
      font-size: 1rem; 
      font-weight: 700; 
      display: flex; 
      align-items: center; 
      gap: 8px;
      color: var(--text);
    }
    .sidebar-box h3 i { color: var(--primary); }
    .sidebar-box p { 
      margin: 0 0 10px; 
      font-size: 0.85rem; 
      color: var(--muted); 
      line-height: 1.4; 
    }
    .sidebar-box ul { 
      margin: 0; 
      padding-left: 18px; 
      color: var(--muted);
      font-size: 0.85rem;
    }
    .sidebar-box li { 
      margin-bottom: 8px; 
      line-height: 1.4; 
    }
    .sidebar-box li strong { 
      color: var(--text); 
      font-weight: 600;
    }
    
    .related-tools-sidebar { margin-top: 4px; }
    .related-tools-sidebar h4 { 
      margin: 0 0 10px; 
      font-size: 0.95rem; 
      font-weight: 700; 
      color: var(--text); 
    }
    .related-item { 
      display: flex; 
      align-items: center; 
      gap: 10px; 
      padding: 10px 12px; 
      border-radius: 8px; 
      text-decoration: none; 
      color: var(--text); 
      border: 1px solid var(--border); 
      transition: var(--transition);
      margin-bottom: 8px;
      font-weight: 500;
      font-size: 0.9rem;
    }
    .related-item:hover { 
      background: var(--bg); 
      border-color: var(--primary);
      transform: translateX(4px);
    }
    .r-icon { 
      width: 32px; 
      height: 32px; 
      background: var(--bg); 
      border-radius: 6px; 
      display: flex; 
      align-items: center; 
      justify-content: center; 
      color: var(--primary);
      font-size: 0.9rem;
      flex-shrink: 0;
    }
    
    footer { 
      text-align: center; 
      padding: 28px 20px; 
      color: var(--muted); 
      font-size: 0.85rem; 
      border-top: 1px solid var(--border); 
      background: var(--surface); 
    }
    footer a { 
      color: var(--muted); 
      text-decoration: none; 
      margin: 0 8px; 
    }
    footer a:hover { color: var(--primary); }
    
    .hidden { display: none !important; }
    
    @media (max-width: 1024px) {
      .workspace-layout {
        grid-template-columns: 1fr;
      }
      .tool-options-panel {
        position: static;
      }
      .action-buttons-row {
        flex-direction: column;
        align-items: stretch;
      }
      .action-buttons-row button {
        justify-content: center;
      }
    }

/* File count badge for add button */
.add-files-btn {
  position: relative;
}
.add-files-btn .file-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* For responsive grid and thumbnails */
.grid-container-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.file-card-responsive {
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
}

.thumbnail-box-responsive {
  width: 100%;
  aspect-ratio: 200/280; /* Maintain consistent ratio */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

.thumbnail-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .grid-container-responsive {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .workspace-layout {
    flex-direction: column;
  }
  
  .split-panel {
    width: 100%;
  }
}

/* Split button styling to match Merge button */
#split-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border: none;
  padding: 16px 48px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.15rem;
  box-shadow: 0 6px 20px var(--primary-glow);
  transition: var(--transition);
  animation: pulse 2s infinite;
  width: 100%;
  margin-top: 8px;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 20px var(--primary-glow); }
  50% { box-shadow: 0 6px 25px var(--primary-glow), 0 0 15px var(--primary-glow); }
}
#split-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow), 0 0 20px var(--primary-glow);
  animation: none;
}
#split-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  animation: none;
  transform: none;
}

.btn-split-another {
  background: none;
  border: 2px solid var(--border);
  color: var(--text);
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.btn-split-another:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

/* === POWERED BY - Always at bottom-left of drop zone === */
#drop-zone { position: relative; }
.powered-by-wrapper {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 10;
  pointer-events: none; /* Let clicks pass through to drop zone */
}
.powered-by-wrapper .powered-by {
  pointer-events: auto;
  font-size: 0.7rem;
  opacity: 0.85;
}

/* === SUCCESS SCREEN - Mobile Optimization === */
.success-screen-mobile-ready {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding: 16px;
  box-sizing: border-box;
}

/* Action buttons: stack on mobile */
.action-buttons-mobile {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
@media (max-width: 600px) {
  .action-buttons-mobile {
    flex-direction: column;
    align-items: stretch;
  }
  .action-buttons-mobile button {
    width: 100%;
    justify-content: center;
  }
}

/* Related tools: horizontal scroll on mobile */
.related-tools-mobile-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.related-tools-mobile-scroll .related-tool-card {
  flex: 0 0 auto;
  width: 160px;
  scroll-snap-align: start;
}

/* File list: mobile-friendly */
.file-list-mobile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  overflow-x: hidden;
}
.file-list-mobile .file-item {
  width: 100%;
  box-sizing: border-box;
}

/* Prevent horizontal scroll globally on mobile */
@media (max-width: 768px) {
  body, html {
    overflow-x: hidden;
    width: 100%;
  }
  #content-area {
    overflow-x: hidden;
  }
}

/* === UNIFORM THUMBNAILS === */
.grid-container-uniform {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll */
  overflow-y: auto;   /* Enable vertical scroll */
  padding: 8px 4px;
  -webkit-overflow-scrolling: touch; /* Smooth iOS scroll */
  scroll-behavior: smooth;
}

.file-card-uniform {
  width: 100%;
  max-width: 180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.thumbnail-box-uniform {
  width: 160px;
  height: 224px; /* Fixed: 160 * 1.4 (A4 ratio) */
  background: #f8f9fa;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  flex-shrink: 0; /* Prevent shrinking */
}

.thumbnail-canvas-uniform {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* === MOBILE OPTIMIZATIONS === */
@media (max-width: 768px) {
  /* Ensure body never scrolls horizontally */
  body, html, #content-area, .workspace-layout {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
  }
  
  /* Grid: tighter spacing on mobile */
  .grid-container-uniform {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 4px 2px;
  }
  
  .thumbnail-box-uniform {
    width: 140px;
    height: 196px; /* 140 * 1.4 */
  }
  
  .file-card-uniform {
    max-width: 150px;
  }
  
  /* Make workspace scrollable vertically */
  .workspace-main {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Ensure split panel doesn't push content off-screen */
  .workspace-layout {
    flex-direction: column;
    gap: 16px;
  }
  
  .split-panel {
    width: 100%;
    order: 2; /* Options below grid on mobile */
  }
  
  .workspace-main {
    order: 1;
  }
}

/* Mobile Related Tools - visible only on mobile, stacked below drop zone */
.mobile-related-tools {
  display: none; /* Hidden on desktop */
  padding: 20px;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 12px;
  margin: 20px auto;
  max-width: 600px;
}

.mobile-related-tools h4 {
  margin-bottom: 16px;
  font-size: 1.1rem;
  color: var(--text-primary, #1a1a1a);
}

.mobile-related-tools .related-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: white;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary, #1a1a1a);
  border: 1px solid var(--border-color, #e5e7eb);
  transition: all 0.2s;
}

.mobile-related-tools .related-item:hover {
  border-color: var(--primary, #2563eb);
  transform: translateX(4px);
}

.mobile-related-tools .r-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light, #dbeafe);
  border-radius: 8px;
  margin-right: 12px;
  color: var(--primary, #2563eb);
}

/* Show mobile related tools only on mobile */
@media (max-width: 768px) {
  .mobile-related-tools {
    display: block;
  }
  
  .sidebar {
    display: none !important; /* Hide sidebar completely on mobile */
  }
}

/* Hide mobile related tools on desktop */
@media (min-width: 769px) {
  .mobile-related-tools {
    display: none !important;
  }
}

/* --- MOBILE RELATED TOOLS (2x2 GRID & NIGHT MODE FIX) --- */

/* Wrapper: Hidden on Desktop, Visible on Mobile */
.mobile-related-wrapper {
  display: none;
}

/* Enable Grid on Mobile */
@media (max-width: 768px) {
  .mobile-related-wrapper {
    display: block;
    margin: 20px auto;
    padding: 16px;
    max-width: 100%;
    /* Uses theme variables for background to fix Night Mode */
    background-color: var(--bg-secondary, #f8f9fa); 
    border-radius: 12px;
  }

  .mobile-related-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: var(--text-primary, #1a1a1a);
    text-align: center;
  }

  /* The Grid: 2 Columns */
  .mobile-related-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns */
    gap: 12px;
  }

  /* Individual Cards */
  .mobile-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 8px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid var(--border-color, #e5e7eb);
    transition: transform 0.2s;
    
    /* Uses theme variables for background to fix Night Mode */
    background-color: var(--bg-card, #ffffff); 
    color: var(--text-primary, #1a1a1a);
  }

  .mobile-tool-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary, #2563eb);
  }

  .mobile-tool-card .tool-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--primary, #2563eb);
  }

  .mobile-tool-card span {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
  }
}

/* --- MOBILE RELATED TOOLS FIX --- */

/* Hide on Desktop */
.mobile-related-wrapper {
  display: none;
}

/* Show on Mobile & Fix Layout */
@media (max-width: 768px) {
  .mobile-related-wrapper {
    display: block;
    width: 100%; /* Full width like drop box */
    padding: 20px 16px; /* Match drop box padding */
    margin: 0 auto;
    background-color: transparent; /* Remove white background */
    box-sizing: border-box;
  }

  .mobile-related-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: var(--text-primary, #1a1a1a); /* Default text color */
    text-align: left; /* Align with drop box content */
  }

  /* 2x2 Grid Layout */
  .mobile-related-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 Columns */
    gap: 12px;
    width: 100%;
  }

  /* Card Styling */
  .mobile-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 8px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid var(--border-color, #e5e7eb);
    transition: transform 0.2s;
    
    /* Light Mode Colors */
    background-color: var(--bg-card, #ffffff);
    color: var(--text-primary, #1a1a1a);
  }

  .mobile-tool-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary, #2563eb);
  }

  .mobile-tool-card .tool-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--primary, #2563eb);
  }

  .mobile-tool-card span {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
  }

  /* --- DARK MODE FIXES --- */
  
  /* 1. Make Related Tools Dark */
  .dark .mobile-related-wrapper {
    background-color: transparent;
  }

  .dark .mobile-related-title {
    color: #ffffff; /* White text in dark mode */
  }

  .dark .mobile-tool-card {
    background-color: #1e293b; /* Dark Slate Blue */
    border-color: #334155;
    color: #ffffff; /* White text */
  }

  .dark .mobile-tool-card:hover {
    border-color: #60a5fa; /* Lighter blue on hover */
  }

  /* 2. Make "Powered by Sofuro Engine" Visible */
  .dark .powered-by-wrapper .powered-by {
    color: #ffffff !important; /* Force white text */
    opacity: 0.8;
  }
  
  .dark .powered-by-wrapper .powered-by a {
    color: #60a5fa !important; /* Light blue link */
  }
}

/* === SUCCESS SCREEN - BACK BUTTON & CONTINUE TO SECTION === */

/* Back Button (iLovePDF Style) */
.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  border: 2px solid var(--border-color, #e5e7eb);
  background: var(--bg-secondary, #f8f9fa);
  color: var(--text-primary, #1a1a1a);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  background: var(--primary, #2563eb);
  color: white;
  border-color: var(--primary, #2563eb);
  transform: translateX(-3px);
}

.dark .btn-back {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
}

.dark .btn-back:hover {
  background: #3b82f6;
  border-color: #3b82f6;
}

/* Success Actions Container */
.success-actions {
  display: flex;
  gap: 12px;
  align-items: stretch;
  justify-content: center;
  margin-bottom: 32px;
}

/* Continue To Section */
.continue-to-section {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 16px;
  padding: 24px;
  margin: 32px 0;
}

.dark .continue-to-section {
  background: #0f172a;
}

.continue-to-section h3 {
  margin: 0 0 20px 0;
  font-size: 1.2rem;
  color: var(--text-primary, #1a1a1a);
  font-weight: 600;
}

.dark .continue-to-section h3 {
  color: #ffffff;
}

/* Continue Tools Grid */
.continue-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.continue-tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: var(--bg-card, #ffffff);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary, #1a1a1a);
  transition: all 0.2s;
  cursor: pointer;
  text-align: center;
}

.dark .continue-tool-card {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
}

.continue-tool-card:hover {
  border-color: var(--primary, #2563eb);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.dark .continue-tool-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.continue-tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 1.5rem;
}

/* Icon Colors */
.continue-tool-icon.compress { background: #dbeafe; color: #2563eb; }
.continue-tool-icon.merge { background: #dcfce7; color: #16a34a; }
.continue-tool-icon.rotate { background: #fef3c7; color: #d97706; }
.continue-tool-icon.convert { background: #fce7f3; color: #db2777; }
.continue-tool-icon.image { background: #e0e7ff; color: #4f46e5; }
.continue-tool-icon.excel { background: #d1fae5; color: #059669; }
.continue-tool-icon.protect { background: #fee2e2; color: #dc2626; }
.continue-tool-icon.unlock { background: #fef9c3; color: #ca8a04; }
.continue-tool-icon.ppt { background: #fed7aa; color: #ea580c; }
.continue-tool-icon.word { background: #bfdbfe; color: #2563eb; }
.continue-tool-icon.jpg { background: #ddd6fe; color: #7c3aed; }
.continue-tool-icon.organize { background: #ccfbf1; color: #0d9488; }
.continue-tool-icon.remove { background: #fecaca; color: #dc2626; }
.continue-tool-icon.pages { background: #f5d0fe; color: #a21caf; }
.continue-tool-icon.watermark { background: #e0f2fe; color: #0284c7; }
.continue-tool-icon.crop { background: #f1f5f9; color: #475569; }
.continue-tool-icon.repair { background: #fef3c7; color: #d97706; }
.continue-tool-icon.ocr { background: #e7e5e4; color: #57534e; }
.continue-tool-icon.sign { background: #dbeafe; color: #2563eb; }
.continue-tool-icon.redact { background: #fee2e2; color: #991b1b; }

.dark .continue-tool-icon.compress { background: rgba(37, 99, 235, 0.2); }
.dark .continue-tool-icon.merge { background: rgba(22, 163, 74, 0.2); }
.dark .continue-tool-icon.rotate { background: rgba(217, 119, 6, 0.2); }
.dark .continue-tool-icon.convert { background: rgba(219, 39, 119, 0.2); }
.dark .continue-tool-icon.image { background: rgba(79, 70, 229, 0.2); }
.dark .continue-tool-icon.excel { background: rgba(5, 150, 105, 0.2); }
.dark .continue-tool-icon.protect { background: rgba(220, 38, 38, 0.2); }
.dark .continue-tool-icon.unlock { background: rgba(202, 138, 4, 0.2); }

.continue-tool-card span {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
}

/* Show More Button */
.btn-show-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 2px dashed var(--border-color, #e5e7eb);
  border-radius: 12px;
  color: var(--text-secondary, #6b7280);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.dark .btn-show-more {
  border-color: #334155;
  color: #94a3b8;
}

.btn-show-more:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.05);
}

.dark .btn-show-more:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.btn-show-more i {
  transition: transform 0.3s;
}

.btn-show-more.expanded i {
  transform: rotate(180deg);
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .success-actions {
    flex-wrap: wrap;
  }
  
  .btn-back {
    width: 48px;
    height: 48px;
  }
  
  .continue-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .continue-tool-card {
    padding: 14px 8px;
  }
  
  .continue-tool-icon {
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .success-actions {
    flex-direction: column;
  }
  
  .btn-back,
  .btn-download-all,
  .btn-download-individual {
    width: 100%;
    justify-content: center;
  }
  
  .continue-tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}


/* Drag handle for sortable cards */
.drag-handle {
  position: absolute;
  top: 8px;
  left: 8px;
  cursor: grab;
  color: #999;
  padding: 4px;
  z-index: 2;
}
.drag-handle:active {
  cursor: grabbing;
}
.sortable-ghost {
  opacity: 0.4;
  background: #e2e8f0;
}
.sortable-drag {
  box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
  transform: rotate(2deg);
}

/* Settings button per card */
.settings-btn {
  position: absolute;
  top: 8px;
  right: 32px;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 0.75rem;
  z-index: 2;
}
.settings-btn:hover {
  background: rgba(37, 99, 235, 0.8);
}

/* Page range badge */
.page-range-badge {
  background: #2563eb;
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 4px;
  text-align: center;
}

/* Merge panel */
.merge-panel {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid var(--border);
}
.merge-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}
.merge-option label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 0.85rem;
}
.merge-option select,
.merge-option input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
}
.merge-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 15px;
}
.merge-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

/* Full width workspace */
.workspace-full {
  width: 100% !important;
}

@media (max-width: 768px) {
  .merge-options-grid {
    grid-template-columns: 1fr;
  }
  .merge-toggles {
    flex-direction: column;
  }
}