:root {
      --primary: #2563eb;
      --primary-hover: #1d4ed8;
      --primary-light: rgba(37, 99, 235, 0.08);
      --surface: #ffffff;
      --surface-card: #f8fafc;
      --bg: #ffffff;
      --text: #0f172a;
      --text-muted: #64748b;
      --border: #e2e8f0;
      --radius-lg: 16px;
      --radius-md: 10px;
      --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
      --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.06);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
    }
    header {
      background: #ffffff;
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 100;
      padding: 0.75rem 1.5rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .brand {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      text-decoration: none;
      color: inherit;
    }
    .brand-icon {
      width: 36px;
      height: 36px;
      background: #2563eb;
      color: white;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 1.1rem;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    }
    .brand-title { font-weight: 800; font-size: 1.15rem; color: #0f172a; }
    .brand-badge {
      font-size: 0.75rem;
      background: rgba(37, 99, 235, 0.08);
      color: #2563eb;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 6px;
      border: 1px solid rgba(37, 99, 235, 0.2);
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.15s ease;
    }
    .brand-badge:hover {
      background: rgba(37, 99, 235, 0.15);
      border-color: #2563eb;
    }
    .nav-links { display: flex; align-items: center; gap: 0.85rem; }
    .nav-btn {
      text-decoration: none;
      color: var(--text-muted);
      font-size: 0.88rem;
      font-weight: 600;
      padding: 0.45rem 0.85rem;
      border-radius: 6px;
      transition: all 0.15s ease;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .nav-btn:hover { color: #0f172a; background: #f1f5f9; }
    .nav-btn.active { color: #2563eb; font-weight: 700; }
    .nav-btn.primary {
      background: #2563eb;
      color: white;
      font-weight: 700;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    }
    .nav-btn.primary:hover { background: #1d4ed8; color: white; }

    /* Hero & Tool Workspace */
    .hero-sec {
      max-width: 1080px;
      margin: 1.25rem auto 0.65rem auto;
      padding: 0 1.25rem;
      text-align: center;
    }
    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.78rem;
      font-weight: 700;
      color: #2563eb !important;
      background: #eff6ff !important;
      padding: 4px 12px;
      border-radius: 20px;
      margin-bottom: 0.45rem;
      border: 1px solid #bfdbfe !important;
    }
    .hero-title {
      font-size: 1.95rem;
      font-weight: 800;
      letter-spacing: -0.025em;
      color: #0f172a !important;
      -webkit-text-fill-color: #0f172a !important;
      background: none !important;
      opacity: 1 !important;
      line-height: 1.25;
      margin-bottom: 0.45rem;
    }
    .hero-sub {
      font-size: 0.92rem;
      font-weight: 500;
      color: #334155 !important;
      -webkit-text-fill-color: #334155 !important;
      opacity: 1 !important;
      max-width: 720px;
      margin: 0 auto;
      line-height: 1.55;
    }

    /* Interactive Tool Box & Standard Studio Shell */
    .container {
      max-width: 1080px;
      margin: 0 auto 3rem auto;
      padding: 0 1.25rem;
    }
    .main-card,
    .app-box {
      max-width: 1080px !important;
      width: 100% !important;
      background: #ffffff !important;
      border-radius: var(--radius-lg);
      border: 1px solid var(--border) !important;
      box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.05) !important;
      padding: 1.5rem !important;
      color: #0f172a !important;
      box-sizing: border-box !important;
    }
    .dropzone {
      border: 2px dashed #4f46e5;
      border-radius: var(--radius-md);
      padding: 3.5rem 1.5rem;
      text-align: center;
      cursor: pointer;
      background: rgba(79, 70, 229, 0.05);
      transition: all 0.2s ease;
      position: relative;
    }
    .dropzone:hover {
      border-color: #818cf8;
      background: rgba(79, 70, 229, 0.12);
    }
    .dropzone input {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      width: 100%;
      height: 100%;
    }
    .dropzone-icon {
      width: 56px;
      height: 56px;
      margin: 0 auto 1rem auto;
      color: #818cf8;
    }

    /* Top Upload CTA Banner */
    .top-upload-banner {
      background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #eff6ff 100%);
      border: 2px dashed #10b981;
      border-radius: var(--radius-md);
      padding: 1.25rem 1.75rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1.25rem;
      cursor: pointer;
      margin-bottom: 1.5rem;
      transition: all 0.2s ease;
      box-shadow: 0 4px 15px -3px rgba(16, 185, 129, 0.12);
    }
    .upload-action-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 10px 25px -4px rgba(0,0,0,0.15) !important;
    }
    .upload-action-card.product-card:hover {
      border-color: #059669 !important;
      background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 50%, #e0f2fe 100%) !important;
    }
    .upload-action-card.portrait-card:hover {
      border-color: #c2410c !important;
      background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 50%, #fce7f3 100%) !important;
    }
    .top-upload-banner.dragover {
      border-color: #2563eb;
      background: #eff6ff;
    }
    .top-upload-left {
      display: flex;
      align-items: center;
      gap: 1rem;
    }
    .top-upload-icon-wrap {
      width: 50px;
      height: 50px;
      border-radius: 12px;
      background: #10b981;
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    }
    .top-upload-icon {
      width: 26px;
      height: 26px;
    }
    .top-upload-title {
      font-size: 1.15rem;
      font-weight: 800;
      color: #065f46;
      margin-bottom: 0.2rem;
    }
    .top-upload-subtitle {
      font-size: 0.85rem;
      color: #047857;
      font-weight: 500;
    }
    .btn-primary-upload {
      background: linear-gradient(135deg, #059669 0%, #10b981 100%);
      color: #ffffff;
      border: none;
      padding: 0.75rem 1.6rem;
      border-radius: 10px;
      font-size: 0.95rem;
      font-weight: 800;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
      transition: all 0.2s ease;
      flex-shrink: 0;
    }
    .btn-primary-upload:hover {
      background: linear-gradient(135deg, #047857 0%, #059669 100%);
      box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
      transform: scale(1.02);
    }
    .btn-toolbar-upload {
      background: #2563eb;
      color: white;
      border: none;
      font-size: 0.78rem;
      font-weight: 700;
      padding: 5px 12px;
      border-radius: 6px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: background 0.15s ease;
    }
    .btn-toolbar-upload:hover {
      background: #1d4ed8;
    }
    @media (max-width: 640px) {
      .top-upload-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem 1rem;
      }
      .top-upload-left {
        flex-direction: column;
        gap: 0.6rem;
      }
      .btn-primary-upload {
        width: 100%;
        justify-content: center;
      }
    }

    /* Workspace & Showcase Panel */
    .showcase-wrap {
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
      margin-bottom: 2rem;
    }
    .showcase-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 0.75rem;
      background: #f8fafc;
      padding: 0.75rem 1rem;
      border-radius: var(--radius-md);
      border: 1px solid var(--border);
    }
    .showcase-info {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      flex-wrap: wrap;
    }
    .showcase-badge {
      font-size: 0.75rem;
      font-weight: 800;
      color: #4f46e5;
      background: #eef2ff;
      padding: 3px 10px;
      border-radius: 20px;
      border: 1px solid #c7d2fe;
      white-space: nowrap;
    }
    .showcase-title {
      font-size: 0.88rem;
      font-weight: 700;
      color: #1e293b;
    }
    .showcase-controls {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      flex-wrap: wrap;
    }
    .view-mode-group {
      display: flex;
      background: #e2e8f0;
      padding: 3px;
      border-radius: 8px;
      gap: 2px;
    }
    .view-mode-btn {
      font-size: 0.76rem;
      font-weight: 700;
      padding: 4px 10px;
      border-radius: 6px;
      border: none;
      background: transparent;
      color: #475569;
      cursor: pointer;
      transition: all 0.15s ease;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .view-mode-btn.active {
      background: white;
      color: #0f172a;
      box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    /* AI Laser Light Sweep Showcase (Ultra-lightweight GPU CSS) */
    .ai-scan-stage,
    .ba-slider-container {
      --slider-pos: 50%;
      position: relative;
      width: 100% !important;
      max-width: 480px !important;
      aspect-ratio: 1 / 1 !important;
      margin: 0 auto;
      border-radius: var(--radius-md);
      overflow: hidden;
      box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
      border: 1px solid var(--border);
      user-select: none;
      background: #ffffff;
      cursor: pointer;
    }
    @media (max-width: 640px) {
      .showcase-toolbar { flex-direction: column; align-items: flex-start; }
    }
    .ba-layer {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
    }
    .ai-scan-clean-layer,
    .ba-after-layer {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      background-color: #ffffff;
    }
    .ai-scan-clean-layer canvas, .ai-scan-clean-layer img,
    .ba-after-layer canvas, .ba-after-layer img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      pointer-events: none;
      display: block;
    }
    .ai-scan-text-layer {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: 2;
      animation: aiTextWipe 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
      will-change: clip-path, opacity;
      background: transparent;
    }
    .ai-scan-text-layer img, .ai-scan-text-layer canvas {
      width: 100%;
      height: 100%;
      object-fit: contain;
      pointer-events: none;
      display: block;
    }
    .ba-before-layer {
      z-index: 2;
      clip-path: inset(0 calc(100% - var(--slider-pos, 50%)) 0 0);
      background: transparent;
    }
    .ba-before-layer img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      pointer-events: none;
      display: block;
    }

    /* The AI Sweeping Glowing Light Beam */
    .ai-scan-beam {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 3.5px;
      background: #ffffff;
      z-index: 5;
      pointer-events: none;
      animation: aiBeamSweep 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
      will-change: left, opacity;
      box-shadow: 
        0 0 10px 2px #60a5fa,
        0 0 24px 6px rgba(99, 102, 241, 0.85),
        0 0 48px 12px rgba(168, 85, 247, 0.6);
    }
    .ai-scan-beam-glow {
      position: absolute;
      top: 0;
      bottom: 0;
      right: 100%;
      width: 90px;
      background: linear-gradient(to left, rgba(99, 102, 241, 0.4), rgba(56, 189, 248, 0.15), transparent);
      pointer-events: none;
    }

    /* AI Status Badge */
    .ai-scan-badge {
      position: absolute;
      top: 14px;
      left: 14px;
      padding: 6px 14px;
      border-radius: 20px;
      font-size: 0.78rem;
      font-weight: 700;
      z-index: 10;
      background: rgba(15, 23, 42, 0.78);
      backdrop-filter: blur(10px);
      color: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.2);
      display: flex;
      align-items: center;
      gap: 7px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      pointer-events: none;
    }
    .ai-scan-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #38bdf8;
      box-shadow: 0 0 8px #38bdf8;
      animation: aiDotPulse 1.5s ease-in-out infinite;
    }
    @keyframes aiDotPulse {
      0%, 100% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.4); opacity: 0.6; }
    }
    @keyframes aiTextWipe {
      0%, 15% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
      }
      45% {
        clip-path: inset(0 0 0 100%);
        opacity: 1;
      }
      75% {
        clip-path: inset(0 0 0 100%);
        opacity: 1;
      }
      85% {
        clip-path: inset(0 0 0 100%);
        opacity: 0;
      }
      90% {
        clip-path: inset(0 0 0 0);
        opacity: 0;
      }
      96%, 100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
      }
    }
    @keyframes aiBeamSweep {
      0%, 14% {
        left: 0%;
        opacity: 0;
      }
      15% {
        left: 0%;
        opacity: 1;
      }
      45% {
        left: 100%;
        opacity: 1;
      }
      48%, 100% {
        left: 100%;
        opacity: 0;
      }
    }
    .ba-handle {
      position: absolute;
      top: 0;
      bottom: 0;
      left: var(--slider-pos);
      width: 3px;
      background: #ffffff;
      box-shadow: 0 0 10px rgba(0,0,0,0.5);
      z-index: 10;
      transform: translateX(-50%);
      pointer-events: none;
    }
    .ba-handle-button {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 44px;
      height: 44px;
      background: #ffffff;
      color: #1e293b;
      border-radius: 50%;
      box-shadow: 0 4px 14px rgba(0,0,0,0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 800;
      border: 2.5px solid #4f46e5;
      letter-spacing: -1px;
      transition: transform 0.15s ease, background 0.15s ease;
    }
    .ba-slider-container:hover .ba-handle-button {
      transform: translate(-50%, -50%) scale(1.08);
      background: #f8fafc;
    }
    .ba-badge {
      position: absolute;
      top: 14px;
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 0.78rem;
      font-weight: 700;
      z-index: 5;
      backdrop-filter: blur(8px);
      box-shadow: 0 2px 8px rgba(0,0,0,0.15);
      pointer-events: none;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .ba-badge-left {
      left: 14px;
      background: rgba(15, 23, 42, 0.75);
      color: #f8fafc;
      border: 1px solid rgba(255, 255, 255, 0.2);
    }
    .ba-badge-right {
      right: 14px;
      background: rgba(79, 70, 229, 0.85);
      color: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.25);
    }
    .ba-hint-bar {
      position: absolute;
      bottom: 12px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(15, 23, 42, 0.7);
      color: #f1f5f9;
      padding: 4px 14px;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 600;
      backdrop-filter: blur(6px);
      z-index: 5;
      pointer-events: none;
      border: 1px solid rgba(255,255,255,0.15);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* Clean white transparent checkerboard (Photoshop / Canva industry standard) */
    .checkerboard-pattern,
    .ai-scan-stage.checkerboard-pattern,
    .ai-scan-clean-layer.checkerboard-pattern,
    .ba-slider-container.checkerboard-pattern,
    .canvas-container.checkerboard-pattern {
      background-color: #ffffff !important;
      background-image: 
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%), 
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%), 
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%) !important;
      background-size: 20px 20px !important;
      background-position: 0 0, 0 10px, 10px -10px, -10px 0px !important;
    }

    /* Tab Switcher in Cutout Workspace */
    .cutout-view-tabs {
      display: inline-flex;
      background: #f1f5f9;
      padding: 3px;
      border-radius: 10px;
      border: 1px solid #e2e8f0;
      gap: 3px;
    }
    .cutout-tab-btn {
      padding: 6px 14px;
      font-size: 0.82rem;
      font-weight: 700;
      border: none;
      background: transparent;
      color: #64748b;
      cursor: pointer;
      border-radius: 8px;
      transition: all 0.15s ease;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }
    .cutout-tab-btn.active {
      background: #4f46e5;
      color: #ffffff;
      box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
    }

    /* Single Canvas Workspace (Clean & Focused) */
    #sideBySideContainer {
      display: block;
      width: 100%;
    }
    .preview-split {
      display: flex;
      justify-content: center;
      width: 100%;
    }
    .preview-split .preview-card {
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 auto;
    }
    .preview-card-raw {
      display: none !important;
    }
    @media (max-width: 768px) {
      .hero-title { font-size: 1.8rem; }
    }
    .preview-card {
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      overflow: hidden;
      background: #ffffff;
      box-shadow: 0 2px 8px rgba(0,0,0,0.04);
      display: flex;
      flex-direction: column;
    }
    .preview-header-bar {
      padding: 0.65rem 1rem;
      background: #f8fafc;
      border-bottom: 1px solid #e2e8f0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.84rem;
      font-weight: 700;
    }
    .canvas-container {
      width: 100%;
      max-width: 680px;
      aspect-ratio: 1 / 1;
      height: auto;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      position: relative;
      background-color: #ffffff;
    }
    .canvas-container img, .canvas-container canvas {
      max-height: 100%;
      max-width: 100%;
      object-fit: contain;
      filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
    }

    /* Eraser & Repair Mode Toolbar */
    .eraser-toolbar {
      display: none;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      flex-wrap: wrap;
      background: #f8fafc;
      border: 1px solid #bfdbfe;
      border-radius: 12px;
      padding: 8px 14px;
      margin-bottom: 0.75rem;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
    }
    .eraser-mode-group {
      display: flex;
      background: #e2e8f0;
      padding: 3px;
      border-radius: 8px;
      gap: 3px;
      border: 1px solid #cbd5e1;
    }
    .eraser-btn {
      font-size: 0.78rem;
      font-weight: 700;
      padding: 5px 12px;
      border-radius: 6px;
      border: none;
      background: transparent;
      color: #64748b;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.15s ease;
    }
    .eraser-btn.active-erase {
      background: #ef4444;
      color: #ffffff;
      box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    }
    .eraser-btn.active-restore {
      background: #10b981;
      color: #ffffff;
      box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }
    .eraser-cursor-ring {
      position: absolute;
      border: 2px solid #38bdf8;
      background: rgba(56, 189, 248, 0.15);
      border-radius: 50%;
      pointer-events: none;
      display: none;
      transform: translate(-50%, -50%);
      box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
      z-index: 50;
    }

    /* Mask View Container */
    #maskContainer {
      display: none;
      height: 480px;
      background: #000000;
      border-radius: var(--radius-md);
      overflow: hidden;
      border: 1px solid #1e293b;
      position: relative;
      align-items: center;
      justify-content: center;
    }
    #maskContainer img {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
    }

    /* Background Palette Selector */
    .bg-options {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      flex-wrap: wrap;
      margin: 1.25rem 0;
    }
    .bg-dot {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      cursor: pointer;
      border: 2px solid transparent;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      transition: transform 0.15s ease, border-color 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .bg-dot:hover { transform: scale(1.1); }
    .bg-dot.active {
      border-color: #2563eb;
      transform: scale(1.12);
      box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
    }
    .bg-checker {
      background: repeating-conic-gradient(#cbd5e1 0% 25%, #ffffff 0% 50%) 50% / 8px 8px;
    }

    /* Engine Selector Grid */
    .engine-selector-box {
      margin-bottom: 1.5rem;
      width: 100%;
    }
    .engine-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 0.85rem;
      padding: 0 2px;
      flex-wrap: wrap;
      gap: 8px;
    }
    .engine-label {
      font-size: 0.95rem;
      font-weight: 800;
      color: #0f172a;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .engine-hint {
      font-size: 0.8rem;
      color: var(--text-muted);
    }
    .engine-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      width: 100%;
    }
    @media (max-width: 880px) {
      .engine-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }
    @media (max-width: 480px) {
      .engine-grid {
        grid-template-columns: 1fr;
      }
    }
    .engine-card {
      background: #f8fafc;
      border: 1.5px solid #e2e8f0;
      border-radius: 12px;
      padding: 12px 14px;
      text-align: left;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 4px;
      user-select: none;
      position: relative;
    }
    .engine-card:hover {
      border-color: #cbd5e1;
      background: #f1f5f9;
      transform: translateY(-1px);
    }
    .engine-card.active {
      background: #eff6ff;
      border-color: #2563eb;
      box-shadow: 0 0 0 1px #2563eb, 0 4px 12px rgba(37, 99, 235, 0.12);
    }
    .engine-card-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 4px;
    }
    .engine-name {
      font-size: 0.88rem;
      font-weight: 700;
      color: #1e293b;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .engine-card.active .engine-name {
      color: #1d4ed8;
    }
    .engine-tag {
      font-size: 0.68rem;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 4px;
      white-space: nowrap;
    }
    .tag-pro {
      background: #fef3c7;
      color: #b45309;
      border: 1px solid #fde68a;
    }
    .tag-rec {
      background: #dbeafe;
      color: #1d4ed8;
      border: 1px solid #bfdbfe;
    }
    .tag-hot {
      background: #fce7f3;
      color: #be185d;
      border: 1px solid #fbcfe8;
    }
    .tag-std {
      background: #f1f5f9;
      color: #475569;
      border: 1px solid #e2e8f0;
    }
    .engine-desc {
      font-size: 0.75rem;
      color: #64748b;
      line-height: 1.35;
    }

    .btn-action-group {
      display: flex;
      justify-content: center;
      gap: 1rem;
      flex-wrap: wrap;
    }
    .btn-lg {
      padding: 0.85rem 1.75rem;
      font-size: 1rem;
      font-weight: 700;
      border-radius: var(--radius-md);
      cursor: pointer;
      border: none;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: all 0.15s ease;
    }
    .btn-download {
      background: linear-gradient(135deg, #2563eb, #4f46e5);
      color: white;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }
    .btn-download:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4); }
    .btn-outline {
      background: #ffffff;
      border: 1px solid var(--border);
      color: #334155;
    }
    .btn-outline:hover { background: #f1f5f9; color: #0f172a; }


  
    /* Header Actions & Country Selector */
    .header-actions {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .select-pill {
      padding: 0.42rem 0.75rem;
      border: 1px solid var(--border);
      border-radius: 9999px;
      background: #ffffff;
      font-size: 0.82rem;
      font-weight: 700;
      color: #0f172a;
      outline: none;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
    .country-selector {
      min-width: 82px;
    }

/* White Minimalist Theme Overrides for AI Cutout Tool */
    body, body.dark-theme {
      background: #ffffff !important;
      color: #0f172a !important;
    }
    .main-card,
    .app-box {
      max-width: 1080px !important;
      width: 100% !important;
      background: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
      color: #0f172a !important;
      box-sizing: border-box !important;
    }
    .ba-slider-container {
      width: 100% !important;
      max-width: 100% !important;
    }
    .hero-badge {
      color: #2563eb !important;
      background: #eff6ff !important;
      border: 1px solid #bfdbfe !important;
    }
    .hero-title {
      background: none !important;
      -webkit-background-clip: unset !important;
      -webkit-text-fill-color: #0f172a !important;
      color: #0f172a !important;
      opacity: 1 !important;
    }
    .hero-sub {
      color: #334155 !important;
      -webkit-text-fill-color: #334155 !important;
      opacity: 1 !important;
    }


/* Clean Unified Dropzone Styles */
.clean-dropzone-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto 0.75rem auto;
}
.cutout-mode-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.cutout-type-btn {
  background: #ffffff;
  color: #64748b;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cutout-type-btn:hover {
  color: #0f172a;
  border-color: #2563eb;
}
.cutout-type-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
/* Minimalist In-Canvas Floating Upload (Clean PhotoGov Style) */
.canvas-floating-upload {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  user-select: none;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  width: auto;
  max-width: 90%;
}
.btn-cutout-minimal,
.canvas-floating-upload .btn-cutout-main {
  position: relative;
  overflow: hidden;
  width: auto;
  padding: 9px 24px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-cutout-minimal:hover,
.canvas-floating-upload .btn-cutout-main:hover {
  background: #f8fafc;
  border-color: #2563eb;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}
.btn-cutout-minimal:active,
.canvas-floating-upload .btn-cutout-main:active {
  transform: translateY(0);
}
.btn-upload-svg {
  width: 16px;
  height: 16px;
  stroke: #2563eb;
  flex-shrink: 0;
}
.canvas-floating-upload .upload-specs-hint,
.upload-specs-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 3px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.03em;
}
.canvas-floating-upload.dragover .btn-cutout-minimal,
.canvas-floating-upload.dragover .btn-cutout-main {
  background: #eff6ff;
  border-color: #2563eb;
  transform: scale(1.03);
}

/* Result Canvas Zoom Toolbar */
.canvas-zoom-toolbar {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 3px 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  user-select: none;
}
.zoom-tool-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.zoom-tool-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
.zoom-tool-text {
  font-size: 0.74rem;
  font-family: monospace;
  font-weight: 700;
  color: #38bdf8;
  padding: 0 4px;
  cursor: pointer;
  min-width: 38px;
  text-align: center;
}
.zoom-tool-text:hover {
  text-decoration: underline;
}


.compact-dropzone-sub {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Absolute alignment for BA Slider */
.ba-slider-container .ba-layer canvas,
.ba-slider-container .ba-layer img,
#sliderResultCanvas,
#sliderSourceImg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: block !important;
  pointer-events: none !important;
}

/* Direct Finished Product Display Mode (No slider, full cutout) */
.ba-slider-container.finished-mode,
.ba-slider-stage.finished-mode,
#baSliderContainer.finished-mode {
  cursor: default !important;
  touch-action: auto !important;
}
.ba-slider-container.finished-mode #sliderBeforeLayer,
.ba-slider-container.finished-mode #baHandle,
.ba-slider-container.finished-mode .ba-handle,
.ba-slider-container.finished-mode #baHandleLine,
.ba-slider-container.finished-mode .ba-handle-line,
.ba-slider-container.finished-mode #baHandleBtn,
.ba-slider-container.finished-mode .ba-handle-btn,
.ba-slider-container.finished-mode .ba-badge,
.ba-slider-container.finished-mode .ba-hint-bar,
.ba-slider-container.finished-mode .canvas-floating-upload,
.ba-slider-stage.finished-mode #sliderBeforeLayer,
.ba-slider-stage.finished-mode #baHandleLine,
.ba-slider-stage.finished-mode .ba-handle-line,
.ba-slider-stage.finished-mode #baHandleBtn,
.ba-slider-stage.finished-mode .ba-handle-btn,
.ba-slider-stage.finished-mode .canvas-floating-upload,
#baSliderContainer.finished-mode #sliderBeforeLayer,
#baSliderContainer.finished-mode #baHandleLine,
#baSliderContainer.finished-mode .ba-handle-line,
#baSliderContainer.finished-mode #baHandleBtn,
#baSliderContainer.finished-mode .ba-handle-btn,
#baSliderContainer.finished-mode .canvas-floating-upload {
  display: none !important;
}
.ba-slider-container.finished-mode #sliderAfterLayer,
.ba-slider-stage.finished-mode #sliderAfterLayer,
#baSliderContainer.finished-mode #sliderAfterLayer {
  clip-path: none !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 1 !important;
}

/* In-Canvas Processing Overlay (覆盖在画布正上方) */
.canvas-processing-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 1.5rem;
  text-align: center;
  border-radius: inherit;
  pointer-events: auto;
  user-select: none;
}

.processing-spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid rgba(255, 255, 255, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: cutoutSpinnerSpin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

.processing-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.processing-tip {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 300px;
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Sub-Tool Universal Upload Dropzone (No Dog Demo Slider) */
.sub-dropzone-box {
  background: #ffffff;
  border: 2px dashed #93c5fd;
  border-radius: 16px;
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.04);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  user-select: none;
}
.sub-dropzone-box:hover, .sub-dropzone-box.dragover {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}
.sub-dropzone-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: transform 0.2s ease;
}
.sub-dropzone-box:hover .sub-dropzone-icon-wrap {
  transform: scale(1.08);
  background: #dbeafe;
}
.sub-dropzone-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}
.sub-dropzone-sub {
  font-size: 0.9rem;
  color: #64748b;
  max-width: 440px;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.sub-dropzone-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  transition: all 0.15s ease;
}
.sub-dropzone-btn:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.38);
}
.sub-dropzone-specs {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 500;
}

