  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px;
  }

  .card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    padding: 36px 40px 40px;
    width: 100%;
    max-width: 560px;
  }

  .brand-header { text-align: center; margin-bottom: 6px; }
  .brand-header img { height: 40px; width: auto; }
  .subtitle { color: #6b7280; font-size: .9rem; margin-bottom: 24px; text-align: center; }

  .brand-footer {
    width: 100%; clear: both;
    margin-top: 36px; padding-top: 20px;
    border-top: 1px solid #f3f4f6;
    display: flex; align-items: center; justify-content: center;
    gap: 10px; flex-wrap: wrap;
  }
  .brand-footer img { height: 22px; width: auto; opacity: .7; }
  .brand-footer span { font-size: .78rem; color: #9ca3af; }

  /* ---- Tabs ---- */
  .tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
    margin-bottom: 28px;
  }
  .tab {
    padding: 9px 6px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: .85rem; font-weight: 600;
    color: #6b7280; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    text-align: center;
  }
  .tab.active { background: #60398a; color: #fff; border-color: #60398a; }
  .tab:not(.active):hover { background: #f7f0fb; color: #60398a; border-color: #d0add8; }

  /* ---- Panels ---- */
  .panel { display: none; }
  .panel.active { display: block; }

  /* ---- Form elements ---- */
  label {
    display: block;
    font-size: .82rem; font-weight: 600;
    color: #374151; margin-bottom: 5px;
  }
  label .opt { font-weight: 400; color: #9ca3af; }

  input[type="text"],
  input[type="url"],
  input[type="email"],
  input[type="tel"],
  input[type="datetime-local"],
  input[type="date"],
  select,
  textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: .93rem;
    color: #111;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
    margin-bottom: 16px;
  }
  input:focus, textarea:focus { border-color: #60398a; }
  textarea { resize: vertical; min-height: 70px; }

  .row { display: flex; gap: 12px; }
  .row > div { flex: 1; }

  .section-title {
    font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    color: #9ca3af; margin: 4px 0 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f3f4f6;
  }

  /* ---- Logo drop ---- */
  .logo-drop {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: border-color .2s, background .2s;
    margin-bottom: 20px;
  }
  .logo-drop:hover, .logo-drop.over { border-color: #60398a; background: #f7f0fb; }
  .logo-drop input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
    width: 100%; height: 100%; margin: 0; padding: 0;
  }
  .logo-drop-text { color: #9ca3af; font-size: .85rem; pointer-events: none; }
  .logo-drop-text strong { color: #60398a; }

  .logo-preview {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
  }
  .logo-preview img {
    width: 44px; height: 44px; object-fit: contain;
    border: 1px solid #e5e7eb; border-radius: 6px; background: #f9fafb;
  }
  .logo-preview span { flex: 1; font-size: .84rem; color: #374151; }
  .logo-preview button {
    background: none; border: none; color: #ef4444; cursor: pointer;
    font-size: .8rem; padding: 4px 8px; border-radius: 6px;
    transition: background .2s;
  }
  .logo-preview button:hover { background: #fee2e2; }

  /* ---- Submit ---- */
  button[type="submit"] {
    width: 100%; padding: 12px;
    background: #60398a; color: #fff;
    border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: background .2s, transform .1s;
  }
  button[type="submit"]:hover { background: #4a2a6e; }
  button[type="submit"]:active { transform: scale(.98); }
  button[type="submit"]:disabled { background: #c4a4d8; cursor: not-allowed; }

  /* ---- Feedback ---- */
  .error {
    display: none; margin-top: 16px;
    padding: 11px 15px; background: #fee2e2;
    color: #b91c1c; border-radius: 8px; font-size: .875rem;
  }

  .result { display: none; margin-top: 28px; text-align: center; }
  .result img {
    max-width: 260px; width: 100%;
    border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 10px; background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
  }

  .dl-group {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; flex-wrap: wrap; margin-top: 14px;
  }
  .download {
    display: inline-block;
    padding: 10px 20px; background: #10b981;
    color: #fff; border-radius: 8px;
    font-weight: 600; text-decoration: none;
    font-size: .9rem; transition: background .2s;
  }
  .download:hover { background: #059669; }

  .download-alt {
    display: inline-block;
    padding: 10px 18px; background: #f9fafb;
    color: #60398a; border: 1.5px solid #d0add8;
    border-radius: 8px; font-weight: 600;
    font-size: .9rem; cursor: pointer;
    transition: background .2s, border-color .2s;
    font-family: inherit;
  }
  .download-alt:hover:not(:disabled) { background: #f7f0fb; border-color: #60398a; }
  .download-alt:disabled { opacity: .5; cursor: not-allowed; }

  /* ---- Appearance section ---- */
  .section-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 24px 0 18px;
    color: #9ca3af; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
  }
  .section-divider::before,
  .section-divider::after {
    content: ''; flex: 1; height: 1px; background: #f3f4f6;
  }

  .color-pair { display: flex; gap: 12px; margin-bottom: 18px; }
  .color-field { flex: 1; }
  .color-input-wrap {
    display: flex; align-items: center; gap: 8px;
    border: 1.5px solid #d1d5db; border-radius: 8px;
    padding: 6px 10px; transition: border-color .2s; cursor: pointer;
  }
  .color-input-wrap:focus-within { border-color: #60398a; }
  .color-input-wrap input[type="color"] {
    width: 28px; height: 28px; padding: 0; border: none;
    border-radius: 4px; cursor: pointer; background: none;
    margin: 0;
  }
  .color-input-wrap span { font-size: .88rem; font-family: monospace; color: #374151; }

  .style-cards { display: flex; gap: 10px; margin-bottom: 18px; }
  .style-card {
    flex: 1; border: 1.5px solid #e5e7eb; border-radius: 10px;
    padding: 12px 10px; cursor: pointer; text-align: center;
    transition: border-color .2s, background .2s;
    user-select: none;
  }
  .style-card input[type="radio"] { display: none; }
  .style-card.selected { border-color: #60398a; background: #f7f0fb; }
  .style-card:hover:not(.selected) { border-color: #d0add8; background: #fafafa; }
  .style-card svg { display: block; margin: 0 auto 6px; }
  .style-card span { font-size: .82rem; font-weight: 600; color: #374151; }
  .style-card.selected span { color: #60398a; }

  .size-select {
    width: 100%; padding: 9px 13px;
    border: 1.5px solid #d1d5db; border-radius: 8px;
    font-size: .93rem; color: #111; outline: none;
    margin-bottom: 20px; transition: border-color .2s;
    background: #fff; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    padding-right: 32px;
  }
  .size-select:focus { border-color: #60398a; }

  .spinner {
    display: inline-block; width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff; border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle; margin-right: 6px;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
