graph TD
A[Start] --> B[Input: Amazon/Etsy URL]
B --> C[Subagent 1: Listing Data Extractor]
C --> C1[Extract HTML Content]
C1 --> C2[Parse Title, Bullets, Description]
C2 --> C3[Extract Main Image URL]
C3 --> D[Structured Data Output]
D --> E[Subagent 2: Keyword & Image Analysis]
E --> E1[Analyze Image via Vision API]
E1 --> E2[Extract Design Elements]
E2 --> E3[Check Trademarks]
E3 --> E4[Generate Safe Keywords List]
E4 --> F[Keywords & Image Description]
F --> G[Subagent 3: Design Generator]
G --> G1[Generate Design via Ideogram API]
G1 --> G2[Remove Background]
G2 --> G3[Upscale to 4500x5400]
G3 --> G4[Verify 300 DPI]
G4 --> H[Final PNG Image]
F --> I[Subagent 4: Listing Creator]
I --> I1[Generate Title ≤60 chars]
I1 --> I2[Create Bullets ≤200 chars]
I2 --> I3[Write Description ≤1000 chars]
I3 --> I4[Final Trademark Check]
I4 --> J[Listing Text File]
H --> K[Package Outputs]
J --> K
K --> L[Create ZIP File]
L --> M[Generate API Usage Report]
M --> N[End]