  * { margin: 0; padding: 0; box-sizing: border-box; }
  *:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
  html { scrollbar-width: none; }
  :root {
    --bg: #0c0c0f; --card: #16161a; --card-border: rgba(255,255,255,0.05);
    --text: #ececf1; --text-dim: #a1a1aa; --text-muted: #71717a;
    --blue: #6366f1; --blue-light: #818cf8; --green: #34d399;
    --orange: #fb923c; --red: #f87171; --purple: #a78bfa;
    --cyan: #22d3ee; --pink: #f472b6; --card-hover: #1c1c22;
    --surface-2: #1c1c22; --border-hover: rgba(255,255,255,0.1);
    --noise-opacity: 0.03;
  }
  [data-theme="light"] {
    --bg: #f3f4f8; --card: #ffffff; --card-border: rgba(0,0,0,0.06);
    --text: #1a1c2b; --text-dim: #6b6f85; --text-muted: #9b9fb3;
    --blue: #6366f1; --blue-light: #818cf8; --green: #16a34a;
    --orange: #d97706; --red: #dc2626; --purple: #7c3aed;
    --cyan: #0891b2; --pink: #db2777; --card-hover: #f8f8fb;
    --surface-2: #eaebf0; --border-hover: rgba(0,0,0,0.12);
    --noise-opacity: 0.015;
  }
  [data-theme="light"] .wizard-title { color: #1a1c2b; }
  [data-theme="light"] .provider-card:hover { border-color: var(--blue); background: #f0f0ff; }
  [data-theme="light"] .provider-card.selected { background: #eef0ff; }

  html, body { overflow-x: hidden; }
  body::-webkit-scrollbar { width: 0; background: transparent; }
  body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg); color: var(--text);
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
  }
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    opacity: var(--noise-opacity);
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
  }

  .wizard-container {
    max-width: 700px; width: 100%; position: relative;
  }

  /* Theme toggle */
  .theme-toggle {
    position: fixed; top: 20px; right: 20px;
    background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
    padding: 6px 10px; cursor: pointer; font-size: 1rem; line-height: 1;
    color: var(--text); transition: all 0.2s; z-index: 100;
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
  }
  .theme-toggle:hover { border-color: var(--blue); }

  /* Progress dots */
  .progress-dots {
    display: flex; justify-content: center; gap: 10px; margin-bottom: 32px;
  }
  .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--card-border); transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .dot.active { background: var(--blue); transform: scale(1.3); box-shadow: 0 0 8px rgba(99,102,241,0.4); }
  .dot.done { background: var(--green); transform: scale(1.1); }

  /* Step containers */
  .step {
    display: none; animation: fadeIn 0.4s ease;
  }
  .step.active { display: block; }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Common elements */
  .wizard-title {
    font-size: 2rem; font-weight: 800; color: #fff;
    text-align: center; margin-bottom: 8px; letter-spacing: -0.03em;
  }
  .wizard-subtitle {
    font-size: 1rem; color: var(--text-dim);
    text-align: center; margin-bottom: 32px; line-height: 1.6;
  }
  .wizard-card {
    background: var(--card); border: 1px solid var(--card-border);
    border-radius: 16px; padding: 32px; margin-bottom: 16px;
  }

  /* Welcome step */
  .welcome-logo {
    font-size: 3.5rem; text-align: center; margin-bottom: 16px;
  }

  /* Provider cards grid */
  .providers-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  }
  @media (max-width: 600px) { .providers-grid { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 400px) {
    .wizard-card { padding: 20px 16px; }
    .wizard-title { font-size: 1.3rem; }
  }


  .advanced-toggle {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 12px 0; color: var(--text-dim); font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
    border-top: 1px solid var(--card-border); margin-top: 16px;
    user-select: none;
  }
  .advanced-toggle:hover { color: var(--text); }
  .advanced-toggle .arrow { transition: transform 0.3s; font-size: 0.6rem; }
  .advanced-toggle .arrow.open { transform: rotate(90deg); }
  .advanced-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
  .advanced-content.open { max-height: 1200px; }

  .provider-card {
    background: var(--card); border: 2px solid var(--card-border);
    border-radius: 16px; padding: 20px 16px; text-align: center;
    cursor: pointer; transition: all 0.2s; user-select: none;
  }
  .provider-card:hover { border-color: var(--blue); background: var(--card-hover); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(99,102,241,0.15); }
  .provider-card.selected { border-color: var(--blue); background: rgba(99,102,241,0.08); }
  .provider-card.disabled {
    opacity: 0.35; pointer-events: none; cursor: not-allowed;
    position: relative;
  }
  .provider-card.disabled::after {
    content: 'Already selected as source';
    display: block; font-size: 0.6rem; color: var(--text-muted);
    margin-top: 6px; font-weight: 400;
  }
  .provider-icon { font-size: 2.2rem; margin-bottom: 8px; }
  .provider-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 32px; border-radius: 10px; font-size: 1rem; font-weight: 600;
    border: none; cursor: pointer; transition: all 0.2s; font-family: inherit;
  }
  .btn-primary {
    background: linear-gradient(135deg, #4f46e5, var(--blue)); color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,0.3);
  }
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99,102,241,0.4); filter: brightness(1.1); }
  .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
  .btn-secondary {
    background: var(--card); color: var(--text-dim); border: 1px solid var(--card-border);
  }
  .btn-secondary:hover { border-color: var(--text-dim); color: var(--text); }
  .btn-big {
    width: 100%; padding: 18px; font-size: 1.1rem; border-radius: 10px;
  }
  .btn-connect {
    padding: 10px 20px; border-radius: 10px; font-size: 0.85rem;
  }
  .btn-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 24px;
  }
  .btn-row.center { justify-content: center; }

  /* Form elements */
  .form-group { margin-bottom: 20px; }
  .form-label {
    display: block; font-size: 0.8rem; font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .form-input {
    width: 100%; padding: 12px 16px; border-radius: 10px;
    background: var(--bg); border: 1px solid var(--card-border);
    color: var(--text); font-size: 1rem; font-family: inherit;
    transition: border-color 0.2s;
  }
  .form-input:focus:not(:focus-visible) { outline: none; }
  .form-input:focus { border-color: var(--blue); }
  .form-input::placeholder { color: var(--text-muted); }
  .form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }

  /* Speed radio cards */
  .speed-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  @media (max-width: 500px) { .speed-options { grid-template-columns: 1fr; } }
  .speed-card {
    background: var(--bg); border: 2px solid var(--card-border);
    border-radius: 12px; padding: 14px; text-align: center;
    cursor: pointer; transition: all 0.2s;
  }
  .speed-card:hover { border-color: var(--blue); }
  .speed-card.selected { border-color: var(--blue); background: rgba(99,102,241,0.06); }
  .speed-card input { display: none; }
  .speed-label { font-size: 0.9rem; font-weight: 600; color: var(--text); }
  .speed-desc { font-size: 0.7rem; color: var(--text-dim); margin-top: 4px; }

  /* Connect step */
  .connect-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg); border: 1px solid var(--card-border);
    border-radius: 12px; padding: 16px 20px; margin-bottom: 10px;
  }
  .connect-info { display: flex; align-items: center; gap: 12px; }
  .connect-icon { font-size: 1.5rem; }
  .connect-name { font-weight: 600; font-size: 0.95rem; }
  .connect-status { font-size: 0.75rem; margin-top: 2px; }
  .connect-status.ok { color: var(--green); }
  .connect-status.pending { color: var(--text-muted); }

  .checkmark {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(34,197,94,0.15); border: 2px solid var(--green);
    display: flex; align-items: center; justify-content: center;
    color: var(--green); font-size: 0.9rem; font-weight: 700;
  }

  /* Summary */
  .summary-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid var(--card-border);
  }
  .summary-row:last-child { border-bottom: none; }
  .summary-label { font-size: 0.85rem; color: var(--text-dim); }
  .summary-value { font-size: 0.95rem; font-weight: 600; color: var(--text); }

  /* Loading spinner */
  .spinner {
    width: 18px; height: 18px; border: 2px solid var(--card-border);
    border-top-color: var(--blue); border-radius: 50%;
    animation: spin 0.6s linear infinite; display: inline-block;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* Local path input (shown when Local Folder is selected) */
  .local-path-input {
    margin-top: 12px; display: none;
  }
  .local-path-input.show { display: block; }
