    const vc = cleanVC();
    const payload = {
      name: C.name, recipient_list_id: C.recipient_list_id,
      subject_set_ids: C.subject_set_ids, template_ids: C.template_ids,
      message_type: C.message_type, attach_mode: C.attach_mode,
      attach_pdf: C.attach_mode === "pdf", attach_pdf_template_id: C.attach_mode === "pdf" ? C.attach_pdf_template_id : null,
      attachment_id: (C.attach_mode === "file" || C.attach_mode === "image") ? C.attachment_id : null,
      variable_config: vc, account_ids: C.account_ids,
      rotation_strategy: C.rotation_strategy,
      rotation_weights: C.rotation_strategy === "weighted" ? C.rotation_weights : {},
      subject_rotation: C.subject_rotation, template_sequence_mode: C.template_sequence_mode,
      phone_selection: C.phone_selection, max_per_account: C.max_per_account,
      send_interval_seconds: C.send_interval_seconds,
    payload.rate_per_minute = C.rate_per_minute;
    payload.max_retries = C.max_retries;
    payload.retry_delay_seconds = C.retry_delay_seconds;
    payload.unsubscribe_enabled = C.unsubscribe_enabled;
    payload.preview_sample_size = C.preview_sample_size;
    return payload;
  }

  /* ---------------- wire-up ---------------- */
  $("#btnNew").onclick = () => openWizard(null);
