#jabg-app-wrapper { background: #f4f7f9; padding: 40px 20px; font-family: 'Segoe UI', sans-serif; min-height: 90vh; }
.jabg-main-container { max-width: 1100px; margin: 0 auto; }

/* Step 1: Upload Box */
.jabg-upload-card { background: #fff; border-radius: 24px; padding: 60px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.05); }
.jabg-upload-icon { font-size: 60px; color: #2563eb; margin-bottom: 20px; }
.jabg-drop-area { border: 2px dashed #cbd5e1; padding: 50px; border-radius: 16px; background: #fafafa; margin: 30px 0; transition: 0.3s; }
.jabg-drop-area:hover { border-color: #2563eb; background: #eff6ff; }
.jabg-primary-btn { background: #2563eb; color: #fff; border: none; padding: 15px 40px; border-radius: 50px; font-weight: 700; cursor: pointer; font-size: 18px; box-shadow: 0 8px 15px rgba(37, 99, 235, 0.2); }

/* Step 2: Editor Shell */
.jabg-editor-shell { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.1); }
.jabg-editor-nav { display: flex; align-items: center; padding: 15px 25px; border-bottom: 1px solid #eee; gap: 20px; }
.jabg-toggle-tabs { background: #f1f5f9; padding: 4px; border-radius: 10px; display: flex; }
.jabg-tab-btn { border: none; padding: 8px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; background: none; color: #64748b; }
.jabg-tab-btn.active { background: #fff; color: #1e293b; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

.jabg-editor-body { display: grid; grid-template-columns: 1fr 320px; min-height: 550px; }
.jabg-canvas-area { background: #f8fafc; padding: 40px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.jabg-image-frame { background: url('https://www.transparenttextures.com/patterns/checkerboard.png'); box-shadow: 0 10px 40px rgba(0,0,0,0.1); border-radius: 8px; line-height: 0; position: relative; }
#jabg-main-canvas, #jabg-orig-img { max-width: 100%; max-height: 450px; display: block; border-radius: 8px; }

/* AI Scanning Animation */
.jabg-scan-anim { position: absolute; width: 100%; height: 4px; background: #2563eb; top: 0; left:0; z-index: 10; box-shadow: 0 0 15px #2563eb; display: none; animation: jabgScan 2s infinite linear; }
@keyframes jabgScan { 0% { top: 0; } 100% { top: 100%; } }
.jabg-process-status { position: absolute; top: 20px; background: #fff; padding: 8px 20px; border-radius: 50px; font-weight: 700; color: #2563eb; box-shadow: 0 5px 15px rgba(0,0,0,0.1); display: none; }

/* Sidebar Controls */
.jabg-sidebar { padding: 25px; border-left: 1px solid #eee; display: flex; flex-direction: column; }
.jabg-dl-btn { background: #059669; color: #fff; width: 100%; border: none; padding: 12px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.jabg-dl-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.jabg-control-tabs { display: flex; margin: 20px 0; border-bottom: 2px solid #f1f5f9; }
.jabg-ctrl-tab { flex: 1; border: none; padding: 10px; background: none; cursor: pointer; font-weight: 600; color: #64748b; }
.jabg-ctrl-tab.active { color: #2563eb; border-bottom: 2px solid #2563eb; }

.jabg-scroll-box { flex: 1; overflow-y: auto; }
.jabg-panel { display: none; }
.jabg-panel.active { display: block; }
.jabg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.jabg-item { height: 80px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; background-size: cover; background-position: center; }
.jabg-item:hover { border-color: #2563eb; }
.jabg-item.jabg-transp { background: #eee url('https://img.icons8.com/ios/50/opacity.png') center/20px no-repeat; }
.jabg-picker { width: 100%; height: 50px; border: none; margin-bottom: 15px; cursor: pointer; }

@media (max-width: 850px) { .jabg-editor-body { grid-template-columns: 1fr; } .jabg-sidebar { border-left: none; border-top: 1px solid #eee; } }