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

    :root {
      --bg: #0e0e12;
      --surface: #16161d;
      --surface2: #1e1e28;
      --border: #2a2a38;
      --text: #e8e8f0;
      --text-muted: #7a7a9a;
      --accent: #7c3aed;
      --accent-hover: #6d28d9;
      --accent-soft: rgba(124,58,237,0.12);
      --radius: 12px;
      --radius-sm: 8px;
      --font: 'Poppins', system-ui, -apple-system, sans-serif;
      --sl-deep: #0c070f;
      --sl-dark: #150a1a;
      --sl-base: #1a0f20;
      --sl-medium: #2a1530;
      --sl-accent: #3a2540;
      --sl-g1: #4a2560;
      --sl-g2: #5a3570;
      --sl-g3: #6a3590;
      --sl-g4: #7a45a0;
      --sl-orange: #e7762b;
      --sl-text-light: #e0d0f0;
    }

    body {
      font-family: var(--font);
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* ── Top bar ── */
    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 24px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 100;
    }
    .topbar-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      text-decoration: none;
    }
    .sinapsialab-gradient-link {
      color: transparent;
      background: linear-gradient(90deg, #ec4899 0%, #facc15 50%, #3b82f6 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
      text-decoration: none;
      font-weight: 700;
      position: relative;
      filter: drop-shadow(0 1px 8px rgba(236, 72, 153, 0.2));
    }
    .sinapsialab-gradient-link::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: -2px;
      height: 1px;
      background: linear-gradient(90deg, #ec4899 0%, #facc15 50%, #3b82f6 100%);
      opacity: 0;
      transition: opacity 0.2s;
    }
    .sinapsialab-gradient-link:hover::after {
      opacity: 1;
    }
    .topbar-logo {
      height: 36px;
      width: auto;
      display: block;
      object-fit: contain;
      filter: brightness(1.05);
    }
    .topbar-name { font-weight: 700; font-size: 15px; color: var(--text); }
    .topbar-tool { font-size: 13px; color: var(--text-muted); padding-left: 10px; border-left: 1px solid var(--border); margin-left: 6px; }
    .topbar-actions { display: flex; gap: 10px; align-items: center; }

    .btn {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 8px 16px;
      border-radius: var(--radius-sm);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      transition: all 0.15s;
    }
    .btn-primary {
      background: var(--accent);
      color: white;
    }
    .btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
    .btn-ghost {
      background: transparent;
      color: var(--text-muted);
      border: 1px solid var(--border);
    }
    .btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
    .btn svg { flex-shrink: 0; }

    /* ── Main layout ── */
    .app-body {
      display: grid;
      grid-template-columns: 420px 1fr;
      flex: 1;
      min-height: 0;
      height: calc(100vh - 57px);
    }

    /* ── Form panel ── */
    .form-panel {
      background: var(--surface);
      border-right: 1px solid var(--border);
      overflow-y: auto;
      padding: 24px;
      display: flex;
      flex-direction: column;
      gap: 28px;
    }
    .form-panel::-webkit-scrollbar { width: 5px; }
    .form-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

    .section-label {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      color: var(--text-muted);
      margin-bottom: 14px;
    }

    .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
    .field:last-child { margin-bottom: 0; }
    .field label { font-size: 13px; font-weight: 600; color: var(--text); }
    .field label span.opt { font-weight: 400; color: var(--text-muted); font-size: 12px; }

    input[type="text"],
    input[type="url"],
    textarea {
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text);
      border-radius: var(--radius-sm);
      padding: 9px 12px;
      font-size: 13px;
      font-family: var(--font);
      transition: border-color 0.15s;
      outline: none;
      width: 100%;
    }
    input[type="text"]:focus,
    input[type="url"]:focus,
    textarea:focus { border-color: var(--accent); }
    textarea { resize: vertical; min-height: 70px; }
    input::placeholder, textarea::placeholder { color: var(--text-muted); }

    /* Logo upload */
    .logo-upload-area {
      border: 2px dashed var(--border);
      border-radius: var(--radius);
      padding: 20px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      background: var(--surface2);
      position: relative;
    }
    .logo-upload-area:hover { border-color: var(--accent); background: var(--accent-soft); }
    .logo-upload-area.has-image { padding: 12px; }
    .logo-upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
    .logo-preview-img {
      width: 72px; height: 72px;
      border-radius: 50%;
      object-fit: cover;
      border: 2px solid var(--border);
      display: block;
      margin: 0 auto 8px;
    }
    .logo-upload-text { font-size: 13px; color: var(--text-muted); }
    .logo-upload-text strong { color: var(--accent); }
    .logo-upload-icon { font-size: 24px; margin-bottom: 6px; display: block; }
    .logo-remove-btn {
      background: none;
      border: none;
      color: #ef4444;
      font-size: 12px;
      cursor: pointer;
      margin-top: 4px;
      text-decoration: underline;
      display: block;
      width: 100%;
    }

    /* ── Themes ── */
    .themes-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }
    .theme-card {
      border-radius: var(--radius-sm);
      border: 2px solid transparent;
      cursor: pointer;
      overflow: hidden;
      transition: all 0.15s;
    }
    .theme-card:hover { transform: translateY(-2px); }
    .theme-card.active { border-color: var(--accent); }
    .theme-swatch {
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }
    .theme-dot { width: 10px; height: 10px; border-radius: 50%; }
    .theme-label {
      font-size: 11px;
      text-align: center;
      padding: 4px;
      font-weight: 600;
      letter-spacing: 0.3px;
    }

    /* Custom colors */
    .custom-colors-section { display: none; }
    .custom-colors-section.visible { display: block; }
    .color-pickers-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .color-picker-item { display: flex; flex-direction: column; gap: 5px; }
    .color-picker-item label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
    .color-picker-row {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 5px 8px;
    }
    input[type="color"] {
      width: 28px;
      height: 28px;
      padding: 2px;
      border: none;
      background: none;
      cursor: pointer;
      border-radius: 4px;
      flex-shrink: 0;
    }
    .color-hex-input {
      background: none;
      border: none;
      color: var(--text);
      font-size: 12px;
      font-family: monospace;
      width: 70px;
      padding: 0;
      outline: none;
    }

    /* ── Links ── */
    .links-list { display: flex; flex-direction: column; gap: 10px; }
    .link-card {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 14px;
      transition: border-color 0.15s;
    }
    .link-card:hover { border-color: var(--text-muted); }
    .link-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }
    .link-number {
      font-size: 11px;
      font-weight: 700;
      color: var(--accent);
      background: var(--accent-soft);
      padding: 2px 8px;
      border-radius: 20px;
    }
    .link-remove-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 16px;
      line-height: 1;
      padding: 2px 6px;
      border-radius: 4px;
      transition: color 0.15s;
    }
    .link-remove-btn:hover { color: #ef4444; }
    .link-fields { display: flex; flex-direction: column; gap: 8px; }
    .link-fields input, .link-fields textarea {
      font-size: 13px;
    }

    .add-link-btn {
      width: 100%;
      padding: 10px;
      background: var(--accent-soft);
      border: 2px dashed var(--accent);
      color: var(--accent);
      border-radius: var(--radius);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .add-link-btn:hover { background: rgba(124,58,237,0.2); }
    .add-link-btn:disabled { opacity: 0.4; cursor: not-allowed; }

    .links-count-badge {
      font-size: 11px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 2px 8px;
      color: var(--text-muted);
      margin-left: auto;
    }

    /* ── Preview panel ── */
    .preview-panel {
      background: #0a0a0e;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .preview-topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 20px;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
    }
    .preview-title {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .preview-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
    .preview-modes { display: flex; gap: 6px; }
    .preview-mode-btn {
      background: none;
      border: 1px solid var(--border);
      color: var(--text-muted);
      font-size: 12px;
      border-radius: 6px;
      padding: 4px 10px;
      cursor: pointer;
      transition: all 0.15s;
    }
    .preview-mode-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

    .preview-container {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      overflow: auto;
    }

    .phone-frame {
      width: 375px;
      height: 650px;
      border-radius: 36px;
      border: 10px solid #222;
      overflow: hidden;
      box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px #333;
      flex-shrink: 0;
      background: #111;
      position: relative;
      transition: all 0.3s;
    }
    .phone-frame.desktop-mode {
      width: 100%;
      max-width: 780px;
      height: 600px;
      border-radius: 16px;
      border-width: 8px;
    }

    .preview-frame {
      width: 100%;
      height: 100%;
      border: none;
      background: white;
    }

    /* Empty state */
    .preview-empty {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
      color: var(--text-muted);
      gap: 10px;
      font-size: 14px;
    }
    .preview-empty svg { opacity: 0.3; }

    /* Drag handle (decorative) */
    .phone-notch {
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      width: 60px;
      height: 5px;
      background: #333;
      border-radius: 10px;
      z-index: 10;
      pointer-events: none;
    }

    /* Section divider */
    .section-divider { border: none; border-top: 1px solid var(--border); margin: 0; }

    /* Download bar at bottom of form */
    .form-actions {
      padding: 16px 0 4px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .generate-btn {
      width: 100%;
      padding: 13px;
      background: var(--accent);
      color: white;
      border: none;
      border-radius: var(--radius);
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .generate-btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(124,58,237,0.35); }
    .publish-btn {
      appearance: none;
      -webkit-appearance: none;
      width: 100%;
      padding: 12px;
      background: linear-gradient(135deg, var(--sl-orange) 0%, #cf6320 55%, var(--sl-g3) 100%);
      color: #fff6ee;
      border: none;
      border-radius: var(--radius);
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      box-shadow: 0 8px 20px rgba(231, 118, 43, 0.18);
      text-align: center;
      font-family: var(--font);
    }
    .publish-btn:hover {
      background: linear-gradient(135deg, #f08a47 0%, #de6d27 55%, #7b43a4 100%);
      transform: translateY(-1px);
      box-shadow: 0 10px 24px rgba(231, 118, 43, 0.28);
    }
    .publish-btn[disabled] {
      cursor: not-allowed;
      opacity: 0.65;
      transform: none;
      box-shadow: none;
    }
    .netlify-status {
      display: none;
      border-radius: 16px;
      padding: 14px;
      line-height: 1.35;
      border: 1px solid transparent;
      position: relative;
      overflow: hidden;
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    }
    .netlify-status.show {
      display: block;
    }
    .netlify-status::before {
      content: '';
      position: absolute;
      inset: 0;
      pointer-events: none;
      background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
    }
    .netlify-status.info {
      color: #ffe9dc;
      background: linear-gradient(135deg, rgba(231, 118, 43, 0.24), rgba(106, 53, 144, 0.16));
      border-color: rgba(231, 118, 43, 0.45);
    }
    .netlify-status.success {
      color: var(--sl-text-light);
      background: linear-gradient(135deg, rgba(106, 53, 144, 0.34), rgba(42, 21, 48, 0.96));
      border-color: rgba(122, 69, 160, 0.55);
    }
    .netlify-status.error {
      color: #ffdede;
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(42, 21, 48, 0.9));
      border-color: rgba(239, 68, 68, 0.46);
    }
    .netlify-status-card {
      position: relative;
      z-index: 1;
      display: flex;
      align-items: flex-start;
      gap: 12px;
    }
    .netlify-status-icon {
      width: 38px;
      height: 38px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.14);
      font-size: 18px;
    }
    .netlify-status-body {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex: 1;
    }
    .netlify-status-kicker {
      font-size: 10px;
      letter-spacing: 1.1px;
      text-transform: uppercase;
      opacity: 0.82;
      font-weight: 700;
    }
    .netlify-status-title {
      font-size: 15px;
      font-weight: 700;
      line-height: 1.2;
    }
    .netlify-status-text {
      font-size: 12px;
      opacity: 0.92;
    }
    .netlify-status-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 6px;
    }
    .netlify-status-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 34px;
      padding: 8px 12px;
      border-radius: 999px;
      text-decoration: none;
      font-size: 12px;
      font-weight: 700;
      color: #fff7f0;
      background: linear-gradient(135deg, var(--sl-orange) 0%, #cf6320 55%, var(--sl-g3) 100%);
      box-shadow: 0 8px 18px rgba(231, 118, 43, 0.24);
      transition: transform 0.18s ease, box-shadow 0.18s ease;
      word-break: break-word;
    }
    .netlify-status-link:hover {
      transform: translateY(-1px);
      box-shadow: 0 12px 24px rgba(231, 118, 43, 0.28);
    }
    .form-note { font-size: 11px; color: var(--text-muted); text-align: center; }
    .form-note a { color: var(--accent); text-decoration: none; }

    /* ── Mobile tab bar ── */
    .mobile-tabs {
      display: none;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
    }
    .mobile-tab-btn {
      flex: 1;
      padding: 12px;
      background: none;
      border: none;
      color: var(--text-muted);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      border-bottom: 3px solid transparent;
      transition: all 0.15s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .mobile-tab-btn.active {
      color: var(--text);
      border-bottom-color: var(--accent);
    }

    /* ── Responsive ── */
    @media (max-width: 767px) {
      .topbar { padding: 10px 16px; }
      .topbar-logo { height: 30px; }
      .topbar-name { font-size: 14px; }
      .topbar-tool { display: none; }
      .topbar-actions .btn span { display: none; }
      .topbar-actions .btn { padding: 8px 10px; }

      .mobile-tabs { display: flex; }

      .app-body {
        grid-template-columns: 1fr;
        height: auto;
        min-height: calc(100vh - 100px);
      }
      .form-panel {
        display: none;
        height: auto;
        overflow-y: visible;
        border-right: none;
      }
      .form-panel.tab-active { display: flex; }
      .preview-panel {
        display: none;
        height: calc(100vh - 100px);
      }
      .preview-panel.tab-active { display: flex; }

      .phone-frame {
        width: 100%;
        max-width: 340px;
        height: 560px;
        border-radius: 28px;
        border-width: 8px;
      }
      .phone-frame.desktop-mode {
        max-width: 100%;
        height: 500px;
        border-radius: 12px;
      }
      .preview-container { padding: 16px; }
    }

    @media (min-width: 768px) {
      .form-panel { display: flex !important; }
      .preview-panel { display: flex !important; }
    }
