  :root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --primary: #0071e3;
    --text: #1d1d1f;
    --text-light: #86868b;
    --radius: 24px;
    --success: #0071e3;
  }

  body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }

  .container {
    width: 90%;
    max-width: 650px;
    background: var(--card);
    padding: 30px;
    border-radius: 32px;
    border: 1px solid #e5e5e7;
    text-align: center;
  }

  header { margin-bottom: 32px; }
  h1 { font-weight: 600; font-size: 2rem; margin: 0; letter-spacing: -0.5px; }
  p { color: var(--text-light); margin: 15px; font-size: 0.95rem; }
  
  .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f2f2f7;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s ease;
  }
  
  .status-badge.ready {
    color: var(--success);
    background: rgba(52, 103, 199, 0.1);
  }

  .pulse-dot {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
  }

  .ready .pulse-dot {
    background: var(--success);
    box-shadow: 0 0 0 rgba(52, 101, 199, 0.4);
    animation: pulse 1.5s infinite;
  }

  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 101, 199, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(52, 199, 89, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
  }

  .workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
  }

  .canvas-box {
    background: #fbfbfd;
    border-radius: var(--radius);
    aspect-ratio: 1/1;
    position: relative;
    border: 1px solid #e5e5e7;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #result-box.is-transparent {
    background-color: #ffffff;
    background-image: 
      linear-gradient(45deg, #eee 25%, transparent 25%), 
      linear-gradient(-45deg, #eee 25%, transparent 25%), 
      linear-gradient(45deg, transparent 75%, #eee 75%), 
      linear-gradient(-45deg, transparent 75%, #eee 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  }

  canvas, img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    z-index: 2;
    border-radius: 8px;
  }

  .placeholder-text {
    font-size: 2rem;
    font-weight: 800;
    color: #e5e5e7;
    letter-spacing: 2px;
    position: absolute;
    z-index: 1;
  }

  .canvas-box:has(canvas[style*="display: block"]) .placeholder-text,
  .canvas-box:has(#magic-loader[style*="display: flex"]) .placeholder-text {
    display: none;
  }

  .label {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-light);
    z-index: 3;
    border: 1px solid rgba(0,0,0,0.05);
  }

  #magic-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 4;
  }

  .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e5e5e7;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin { 100% { transform: rotate(360deg); } }

  .controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
  }

  .btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 14px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }

  .btn-upload { background: #f2f2f7; color: var(--text); position: relative; }
  .btn-upload input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

  .btn-primary { background: var(--primary); color: white; }
  .btn-primary:disabled { background: #ccc; cursor: not-allowed; }
  
  .btn-download { background: var(--success); color: white; display: none; }

  /* WEBSITE MATCHING ALERT STYLES */
  .alert-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
  }
  .alert-card {
    background: var(--card);
    max-width: 400px;
    width: 100%;
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid #e5e5e7;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: slideUp 0.3s ease-out;
  }
  @keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  .alert-card h2 { margin: 0; font-size: 1.5rem; font-weight: 600; }
  .alert-card p { color: var(--text-light); line-height: 1.6; margin: 16px 0 24px; font-size: 0.95rem; }
  .alert-btns { display: flex; gap: 12px; }
  .btn-secondary { background: #f2f2f7; color: var(--text); flex: 1; }

  @media (max-width: 600px) {
    .workspace { grid-template-columns: 1fr; }
    .controls { flex-direction: column; }
    .container { width: 100%; padding: 24px 16px; border-radius: 24px; }
    .canvas-box { aspect-ratio: 4/3; }
    .alert-btns { flex-direction: column-reverse; }
  }