export type Placement = 'auto' | 'below' | 'above' | 'left' | 'right'

export interface StepDef {
  id: string
  title: string
  body: string
  /** Chain another step to fire after this one is dismissed. */
  next?: string
  placement?: Placement
  /** Primary button label. Defaults to "Continue". */
  ctaLabel?: string
  /**
   * Fallback CSS selector used to resolve the anchor element when a step is
   * triggered via chaining (no explicit anchor passed). Optional — if not set
   * and no anchor is provided, the step renders centered with no spotlight.
   */
  anchorSelector?: string
}

/**
 * Tutorial step registry. To add a new step:
 *   1. Add an entry here.
 *   2. In the host component that owns the anchor element, call
 *      `tutorial.maybeShow('your-id', anchorRefOrSelectorFn)`.
 */
export const stepRegistry: Record<string, StepDef> = {
  // ── Forced 3-step intro ──────────────────────────────────────────────────
  'setup-parent-pin': {
    id: 'setup-parent-pin',
    title: 'Welcome! Set up your parent PIN',
    body: 'Tap your avatar to set up a 4–6 digit PIN. The PIN keeps parent mode (where you add chores and rewards) safe from little fingers.',
    placement: 'below',
    ctaLabel: 'Continue',
  },
  'create-child': {
    id: 'create-child',
    title: 'Add your child',
    body: "Let's add your kiddo. Tap the + button to create a profile — you can pick a fun avatar together.",
    placement: 'above',
    ctaLabel: 'Continue',
    anchorSelector: '.fab',
  },
  'parent-children-list': {
    id: 'parent-children-list',
    title: 'Your children',
    body: 'This is your children list. Each card shows one of your kids — their photo, age, and points. Tap + to add a new child.',
    placement: 'above',
    next: 'child-points',
    ctaLabel: 'Continue',
    anchorSelector: '.fab',
  },
  'child-points': {
    id: 'child-points',
    title: 'Points',
    body: 'This is how many points your child has earned. They spend these on rewards you assign. Tap the child card to see their details and manage assignments.',
    placement: 'below',
    next: 'child-click',
    ctaLabel: 'Continue',
    anchorSelector: '.points',
  },
  'child-click': {
    id: 'child-click',
    title: 'Tap a child',
    body: 'Tap any child card to open their page. There you can assign chores, kindness acts, rewards, routines, and penalties.',
    placement: 'below',
    next: 'child-kebab',
    ctaLabel: 'Continue',
    anchorSelector: '.card',
  },
  'create-chore': {
    id: 'create-chore',
    title: 'Create your chore',
    body: 'Tap + to add a chore — give it a name, choose points, and pick a picture so your child can spot it easily.',
    placement: 'above',
    ctaLabel: 'Continue',
  },

  // ── Create-flow JIT hints ────────────────────────────────────────────────
  'edit-chore-name': {
    id: 'edit-chore-name',
    title: 'Chore Name',
    body: 'Give the chore a short, clear name your child will understand — like "Clean your room" or "Feed the dog".',
    placement: 'below',
    next: 'edit-chore-points',
    ctaLabel: 'Continue',
    anchorSelector: 'input#name',
  },
  'edit-chore-points': {
    id: 'edit-chore-points',
    title: 'Points',
    body: 'How many points is this chore worth? Bigger or harder chores can be worth more. Your child spends these points on rewards.',
    placement: 'below',
    next: 'edit-chore-image',
    ctaLabel: 'Continue',
    anchorSelector: 'input#points',
  },
  'edit-chore-image': {
    id: 'edit-chore-image',
    title: 'Pick a Picture',
    body: 'Choose an image so your child can spot this chore easily. Tap + to pick from your photos or the camera to take a new one.',
    placement: 'above',
    anchorSelector: '.picker',
  },
  'create-chore-image-photo': {
    id: 'create-chore-image-photo',
    title: 'Choose a photo',
    body: 'Tap + to pick a picture from your device. A clear photo helps younger kids recognize each chore.',
    placement: 'above',
  },
  'create-chore-image-camera': {
    id: 'create-chore-image-camera',
    title: 'Take a photo',
    body: 'Tap the camera to snap a new picture. A clear photo helps younger kids recognize each chore.',
    placement: 'above',
  },
  // ── Schedule modal — Specific Days chain ─────────────────────────────────
  'schedule-days-chips': {
    id: 'schedule-days-chips',
    title: 'Pick the days',
    body: 'Tap one or more days to schedule this chore or routine. You can choose a single day or several — whatever fits your week.',
    placement: 'below',
    next: 'schedule-days-deadline',
    ctaLabel: 'Continue',
    anchorSelector: '.day-chips',
  },
  'schedule-days-deadline': {
    id: 'schedule-days-deadline',
    title: 'Set a deadline',
    body: 'This is the time your child needs to finish by. Tap "Clear" to remove the deadline — then it can be done anytime that day.',
    placement: 'auto',
    next: 'schedule-days-exception',
    ctaLabel: 'Continue',
    anchorSelector: '.default-deadline-row',
  },
  'schedule-days-exception': {
    id: 'schedule-days-exception',
    title: 'Different time for one day?',
    body: 'If one day needs a different deadline, tap "Set different time" for that day. Useful for early-dismissal days or busy afternoons.',
    placement: 'auto',
    next: 'schedule-enable-toggle',
    ctaLabel: 'Continue',
    anchorSelector: '.exception-row',
  },

  // ── Schedule modal — Every X Days chain ──────────────────────────────────
  'schedule-interval-frequency': {
    id: 'schedule-interval-frequency',
    title: 'How often?',
    body: 'Set how many days pass between each time this chore or routine appears. Every 1 day means daily; every 7 days means weekly.',
    placement: 'below',
    next: 'schedule-interval-start',
    ctaLabel: 'Continue',
    anchorSelector: '.stepper',
  },
  'schedule-interval-start': {
    id: 'schedule-interval-start',
    title: 'Start date',
    body: 'Pick the first day this chore or routine is expected. The schedule counts forward from here.',
    placement: 'below',
    next: 'schedule-interval-deadline',
    ctaLabel: 'Continue',
    anchorSelector: '[data-tutorial="schedule-interval-start"]',
  },
  'schedule-interval-deadline': {
    id: 'schedule-interval-deadline',
    title: 'Set a deadline',
    body: 'This is the time your child needs to finish by. Tap "Clear" to remove the deadline — then it can be done anytime that day.',
    placement: 'auto',
    next: 'schedule-enable-toggle',
    ctaLabel: 'Continue',
    anchorSelector: '.interval-time-row',
  },

  // ── Schedule modal — shared final step ───────────────────────────────────
  'schedule-enable-toggle': {
    id: 'schedule-enable-toggle',
    title: 'Enable or pause',
    body: 'Toggle this switch to turn the schedule on or off. When paused, the chore or routine is expected every day with no schedule restrictions.',
    placement: 'auto',
    anchorSelector: '.schedule-toggle-row',
  },

  // ── List-view help (triggered via ? button) ──────────────────────────────
  'list-chore-help': {
    id: 'list-chore-help',
    title: 'Create your chore',
    body: 'Tap the + button to add a new chore. Give it a name, choose points, and pick a picture so your child can spot it easily.',
    placement: 'above',
    next: 'list-edit-hint',
    ctaLabel: 'Continue',
    anchorSelector: '.fab',
  },
  'list-kindness-help': {
    id: 'list-kindness-help',
    title: 'Create your kindness act',
    body: 'Tap the + button to add a new kindness act. Give it a name, choose points, and pick a picture so your child can spot it easily.',
    placement: 'above',
    next: 'list-edit-hint',
    ctaLabel: 'Continue',
    anchorSelector: '.fab',
  },
  'list-penalty-help': {
    id: 'list-penalty-help',
    title: 'Create your penalty',
    body: 'Tap the + button to add a new penalty. Give it a name, choose points, and pick a picture so your child can spot it easily.',
    placement: 'above',
    next: 'list-edit-hint',
    ctaLabel: 'Continue',
    anchorSelector: '.fab',
  },
  'list-reward-help': {
    id: 'list-reward-help',
    title: 'Create your reward',
    body: 'Tap the + button to add a new reward. Give it a name, choose a cost, and pick a picture so your child can spot it easily.',
    placement: 'above',
    next: 'list-edit-hint',
    ctaLabel: 'Continue',
    anchorSelector: '.fab',
  },
  'list-routine-help': {
    id: 'list-routine-help',
    title: 'Create your routine',
    body: 'Tap the + button to add a new routine. Give it a name, choose points, and pick a picture so your child can spot it easily.',
    placement: 'above',
    next: 'list-edit-hint',
    ctaLabel: 'Continue',
    anchorSelector: '.fab',
  },
  'list-edit-hint': {
    id: 'list-edit-hint',
    title: 'Edit items',
    body: 'Tap any item in the list to open it and make changes — rename it, adjust points, or swap the picture.',
    placement: 'below',
    next: 'list-delete-hint',
    ctaLabel: 'Continue',
    anchorSelector: '.list-item, .routine-item',
  },

  'create-kindness': {
    id: 'create-kindness',
    title: 'Kindness tasks',
    body: 'Kindness tasks reward thoughtful behavior — sharing, helping a sibling, saying please. Give it a name and points.',
    placement: 'auto',
  },
  'edit-kindness-name': {
    id: 'edit-kindness-name',
    title: 'Kindness Act Name',
    body: 'Give it a clear name your child will understand — like "Share your toys" or "Help a friend."',
    placement: 'below',
    next: 'edit-kindness-points',
    ctaLabel: 'Continue',
    anchorSelector: 'input#name',
  },
  'edit-kindness-points': {
    id: 'edit-kindness-points',
    title: 'Points',
    body: 'How many points is this kindness worth? These work just like chore points — your child saves them up for rewards.',
    placement: 'below',
    next: 'edit-kindness-image',
    ctaLabel: 'Continue',
    anchorSelector: 'input#points',
  },
  'edit-kindness-image': {
    id: 'edit-kindness-image',
    title: 'Pick a Picture',
    body: 'Choose a fun image so your child can spot this kindness act easily. Tap + or the camera to add one.',
    placement: 'above',
    anchorSelector: '.picker',
  },

  // ── Penalty form chain ───────────────────────────────────────────────────
  'edit-penalty-name': {
    id: 'edit-penalty-name',
    title: 'Penalty Name',
    body: 'Give the penalty a clear name your child will understand — like "No screen time" or "Early bedtime."',
    placement: 'below',
    next: 'edit-penalty-points',
    ctaLabel: 'Continue',
    anchorSelector: 'input#name',
  },
  'edit-penalty-points': {
    id: 'edit-penalty-points',
    title: 'Points',
    body: 'How many points does this penalty cost? When the rule is broken, these points are taken away.',
    placement: 'below',
    next: 'edit-penalty-image',
    ctaLabel: 'Continue',
    anchorSelector: 'input#points',
  },
  'edit-penalty-image': {
    id: 'edit-penalty-image',
    title: 'Pick a Picture',
    body: 'Choose an image so your child can spot this penalty easily. Tap + or the camera to add one.',
    placement: 'above',
    anchorSelector: '.picker',
  },

  // ── Reward form chain ────────────────────────────────────────────────────
  'edit-reward-name': {
    id: 'edit-reward-name',
    title: 'Reward Name',
    body: 'Give the reward a name your child will get excited about — like "Movie night" or "Ice cream treat."',
    placement: 'below',
    next: 'edit-reward-description',
    ctaLabel: 'Continue',
    anchorSelector: 'input#name',
  },
  'edit-reward-description': {
    id: 'edit-reward-description',
    title: 'Description',
    body: 'Add a quick description so you remember the details — like "Pick the movie together" or "Any flavor they want."',
    placement: 'below',
    next: 'edit-reward-cost',
    ctaLabel: 'Continue',
    anchorSelector: 'input#description',
  },
  'edit-reward-cost': {
    id: 'edit-reward-cost',
    title: 'Cost',
    body: 'How many points does this reward cost? Make it feel achievable — small rewards can cost less, big ones more.',
    placement: 'below',
    next: 'edit-reward-image',
    ctaLabel: 'Continue',
    anchorSelector: 'input#cost',
  },
  'edit-reward-image': {
    id: 'edit-reward-image',
    title: 'Pick a Picture',
    body: 'Choose a fun image so your child can spot this reward easily. Tap + or the camera to add one.',
    placement: 'above',
    anchorSelector: '.picker',
  },

  // ── Child form chain ─────────────────────────────────────────────────────
  'edit-child-name': {
    id: 'edit-child-name',
    title: "Child's Name",
    body: "Enter your child's name or nickname — whatever they like to be called.",
    placement: 'below',
    next: 'edit-child-age',
    ctaLabel: 'Continue',
    anchorSelector: 'input#name',
  },
  'edit-child-age': {
    id: 'edit-child-age',
    title: 'Age',
    body: 'How old is your child? This helps tailor the experience to their level.',
    placement: 'below',
    next: 'edit-child-image',
    ctaLabel: 'Continue',
    anchorSelector: 'input#age',
  },
  'edit-child-image': {
    id: 'edit-child-image',
    title: 'Pick a Picture',
    body: 'Choose a photo or avatar so your child can recognize their profile. Tap + or the camera to add one.',
    placement: 'above',
    anchorSelector: '.picker',
  },

  // ── Routine form chain ───────────────────────────────────────────────────
  'edit-routine-name': {
    id: 'edit-routine-name',
    title: 'Routine Name',
    body: 'Give the routine a name your child will understand — like "Morning routine" or "Bedtime checklist."',
    placement: 'below',
    next: 'edit-routine-points',
    ctaLabel: 'Continue',
    anchorSelector: 'input#name',
  },
  'edit-routine-points': {
    id: 'edit-routine-points',
    title: 'Points',
    body: 'How many points is the whole routine worth? Your child earns these when they finish every step.',
    placement: 'below',
    next: 'edit-routine-image',
    ctaLabel: 'Continue',
    anchorSelector: 'input#points',
  },
  'edit-routine-image': {
    id: 'edit-routine-image',
    title: 'Pick a Picture',
    body: 'Choose an image so your child can spot this routine easily. Tap + or the camera to add one.',
    placement: 'above',
    next: 'create-routine-add-task',
    ctaLabel: 'Continue',
    anchorSelector: '.picker',
  },

  'create-penalty': {
    id: 'create-penalty',
    title: 'Penalties',
    body: 'Penalties subtract points when rules are broken. Use them sparingly — they work best alongside lots of positive tasks.',
    placement: 'auto',
  },
  'create-routine': {
    id: 'create-routine',
    title: 'Routines',
    body: 'Routines bundle a sequence of small tasks — like a bedtime routine. Add each task below, and your child checks them off one by one.',
    placement: 'auto',
  },
  'create-routine-add-task': {
    id: 'create-routine-add-task',
    title: 'Add tasks to the routine',
    body: 'Tap to add each step. Order them the way you want your child to do them — they can be reordered later by dragging.',
    placement: 'above',
    next: 'routine-task-reorder',
    ctaLabel: 'Continue',
    anchorSelector: '.add-task-trigger',
  },
  'routine-task-reorder': {
    id: 'routine-task-reorder',
    title: 'Reorder tasks',
    body: 'Drag the handle up or down to change the order your child sees the tasks in.',
    placement: 'auto',
    next: 'routine-task-edit',
    ctaLabel: 'Continue',
    anchorSelector: '[data-tutorial="routine-task-reorder"]',
  },
  'routine-task-edit': {
    id: 'routine-task-edit',
    title: 'Edit a task',
    body: 'Tap Edit to change a task name or picture. Useful for fixing typos or updating the look.',
    placement: 'auto',
    next: 'routine-task-delete',
    ctaLabel: 'Continue',
    anchorSelector: '[data-tutorial="routine-task-edit"]',
  },
  'routine-task-delete': {
    id: 'routine-task-delete',
    title: 'Delete a task',
    body: 'Tap Delete to remove a task from the routine. This does not delete the routine itself — just this step.',
    placement: 'auto',
    anchorSelector: '[data-tutorial="routine-task-delete"]',
  },
  'create-reward': {
    id: 'create-reward',
    title: 'Create your first reward',
    body: 'Rewards are what your child can spend points on — screen time, treats, a special outing. Tap + to add one.',
    placement: 'above',
  },

  // ── Per-tab / navigation hints ───────────────────────────────────────────
  'notification-click': {
    id: 'notification-click',
    title: 'Tap to review',
    body: 'We ping you when a chore is finished or a reward is requested. Tap a notification to jump straight to it and approve or reject.',
    placement: 'below',
  },

  // ── Per-child view ───────────────────────────────────────────────────────
  'select-child': {
    id: 'select-child',
    title: "This is your child's page",
    body: 'Here you can assign chores, rewards, and routines, see their points, and review their progress. Scroll down to see each section.',
    placement: 'auto',
    next: 'assign-chore',
    ctaLabel: 'Continue',
  },
  'assign-chore': {
    id: 'assign-chore',
    title: 'Assign chores',
    body: 'Tap to pick which chores this child does. Assigned chores show up in their view. You can give the same chore to multiple kids.',
    placement: 'above',
    next: 'assign-kindness',
    ctaLabel: 'Continue',
    anchorSelector: '.assign-buttons button:nth-child(1)',
  },
  'assign-kindness': {
    id: 'assign-kindness',
    title: 'Assign kindness acts',
    body: 'Kindness acts reward thoughtful behavior — sharing, helping, saying please. Tap to pick which ones this child can do.',
    placement: 'above',
    next: 'assign-reward',
    ctaLabel: 'Continue',
    anchorSelector: '.assign-buttons button:nth-child(4)',
  },
  'assign-reward': {
    id: 'assign-reward',
    title: 'Assign rewards',
    body: "Pick which rewards this child can spend points on. They'll only see rewards you assign here.",
    placement: 'above',
    next: 'assign-routine',
    ctaLabel: 'Continue',
    anchorSelector: '.assign-buttons button:nth-child(3)',
  },
  'assign-routine': {
    id: 'assign-routine',
    title: 'Assign routines',
    body: 'Routines you assign show up on this child’s page as a checklist they can work through, step by step.',
    placement: 'above',
    next: 'assign-penalty',
    ctaLabel: 'Continue',
    anchorSelector: '.assign-buttons button:nth-child(2)',
  },
  'assign-penalty': {
    id: 'assign-penalty',
    title: 'Assign penalties',
    body: 'Penalties subtract points when rules are broken. Use them sparingly — they work best alongside lots of positive tasks.',
    placement: 'above',
    next: 'item-kebab-overview',
    ctaLabel: 'Continue',
    anchorSelector: '.assign-buttons button:nth-child(5)',
  },

  // ── Generic kebab overview (entity-type agnostic) ────────────────────────
  'item-kebab-overview': {
    id: 'item-kebab-overview',
    title: 'Quick actions',
    body: 'Each item has a menu with quick actions. Tap the three dots on any item to edit points, change schedules, extend deadlines, or reset.',
    placement: 'auto',
  },

  // ── Assignment list hints ────────────────────────────────────────────────
  'assign-chore-list': {
    id: 'assign-chore-list',
    title: 'Pick chores',
    body: 'Tap any chore to check or uncheck it. Checked chores are assigned to this child and show up in their view.',
    placement: 'below',
    next: 'assign-submit',
    ctaLabel: 'Continue',
    anchorSelector: '.list-item, .routine-item',
  },
  'assign-kindness-list': {
    id: 'assign-kindness-list',
    title: 'Pick kindness acts',
    body: 'Tap any kindness act to check or uncheck it. Checked acts are assigned to this child and show up in their view.',
    placement: 'below',
    next: 'assign-submit',
    ctaLabel: 'Continue',
    anchorSelector: '.list-item, .routine-item',
  },
  'assign-penalty-list': {
    id: 'assign-penalty-list',
    title: 'Pick penalties',
    body: 'Tap any penalty to check or uncheck it. Checked penalties are assigned to this child and show up in their view.',
    placement: 'below',
    next: 'assign-submit',
    ctaLabel: 'Continue',
    anchorSelector: '.list-item, .routine-item',
  },
  'assign-reward-list': {
    id: 'assign-reward-list',
    title: 'Pick rewards',
    body: 'Tap any reward to check or uncheck it. Checked rewards are assigned to this child and show up in their view.',
    placement: 'below',
    next: 'assign-submit',
    ctaLabel: 'Continue',
    anchorSelector: '.list-item, .routine-item',
  },
  'assign-routine-list': {
    id: 'assign-routine-list',
    title: 'Pick routines',
    body: 'Tap any routine to check or uncheck it. Checked routines are assigned to this child and show up in their view.',
    placement: 'below',
    next: 'assign-submit',
    ctaLabel: 'Continue',
    anchorSelector: '.list-item, .routine-item',
  },
  'assign-submit': {
    id: 'assign-submit',
    title: 'Save your picks',
    body: 'When you are happy with the selection, tap Submit to save. Tap Cancel to leave without changing anything.',
    placement: 'above',
    anchorSelector: '.actions .btn-primary',
  },

  // ── List management hints ────────────────────────────────────────────────
  'list-delete-hint': {
    id: 'list-delete-hint',
    title: 'Delete items',
    body: 'Tap the red X on any item you created to delete it. Deleting also removes it from any child it was assigned to.',
    placement: 'auto',
    anchorSelector: '.delete-btn',
  },

  // ── Kebab menus ──────────────────────────────────────────────────────────
  'child-kebab': {
    id: 'child-kebab',
    title: 'Quick actions',
    body: 'Tap the three dots on any child card to open the menu. From here you can edit the child\'s name or photo, clear their points back to zero, or remove them entirely.',
    placement: 'below',
    anchorSelector: '.kebab-btn',
  },
  'chore-kebab-overview': {
    id: 'chore-kebab-overview',
    title: 'Chore actions',
    body: 'Tap the three dots on any chore for quick actions. You can edit points, change the schedule, extend the deadline when a chore is late, or reset a completed chore.',
    placement: 'auto',
  },
  'chore-kebab-menu': {
    id: 'chore-kebab-menu',
    title: 'Chore actions',
    body: 'Edit the points or change the schedule for this chore. Tap Continue to see each option.',
    placement: 'auto',
    next: 'chore-edit-points',
    ctaLabel: 'Continue',
    anchorSelector: '.kebab-menu',
  },
  'chore-edit-points': {
    id: 'chore-edit-points',
    title: 'Edit points',
    body: 'Change how many points this chore is worth. Higher points for harder chores.',
    placement: 'auto',
    next: 'chore-schedule',
    ctaLabel: 'Continue',
    anchorSelector: '[data-tutorial~="chore-edit-points"]',
  },
  'chore-schedule': {
    id: 'chore-schedule',
    title: 'Change schedule',
    body: 'Open the schedule to change which days this chore appears or adjust the deadline.',
    placement: 'auto',
    anchorSelector: '[data-tutorial="chore-schedule"]',
  },
  'kebab-edit-points-cost': {
    id: 'kebab-edit-points-cost',
    title: 'Change points or cost',
    body: 'You can change how many points a chore, routine, reward, or other item is worth — or what a reward costs — at any time from this menu.',
    placement: 'auto',
    anchorSelector: '[data-tutorial="kebab-edit-points-cost"]',
  },
  'point-editor-help': {
    id: 'point-editor-help',
    title: 'Edit points or cost',
    body: 'Enter a new value to change how many points this chore, routine, or reward is worth — or what this reward costs — just for this child.',
    placement: 'auto',
    anchorSelector: 'input#custom-value',
  },
  'chore-kebab-extend-time': {
    id: 'chore-kebab-extend-time',
    title: 'Extend the deadline',
    body: 'When a chore runs late, this option lets you give your child more time for the rest of today only — no need to reschedule.',
    placement: 'auto',
    anchorSelector: '[data-tutorial="chore-extend-time"]',
  },
  'chore-kebab-reset': {
    id: 'chore-kebab-reset',
    title: 'Reset a completed chore',
    body: 'Already-completed today? Reset lets your child do it again today (points are kept). Useful for chores you want done twice.',
    placement: 'auto',
    anchorSelector: '[data-tutorial="chore-reset"]',
  },
  'routine-kebab-menu': {
    id: 'routine-kebab-menu',
    title: 'Routine actions',
    body: 'Edit the routine, adjust points, or change the schedule. Tap Continue to see each option.',
    placement: 'auto',
    next: 'routine-edit',
    ctaLabel: 'Continue',
    anchorSelector: '.kebab-menu',
  },
  'routine-edit': {
    id: 'routine-edit',
    title: 'Edit routine',
    body: 'Open the routine to add, remove, or reorder the tasks inside it.',
    placement: 'auto',
    next: 'routine-edit-points',
    ctaLabel: 'Continue',
    anchorSelector: '[data-tutorial="routine-edit"]',
  },
  'routine-edit-points': {
    id: 'routine-edit-points',
    title: 'Edit points',
    body: 'Change how many points the whole routine is worth. Your child earns these when they finish every step.',
    placement: 'auto',
    next: 'routine-schedule',
    ctaLabel: 'Continue',
    anchorSelector: '[data-tutorial~="routine-edit-points"]',
  },
  'routine-schedule': {
    id: 'routine-schedule',
    title: 'Change schedule',
    body: 'Open the schedule to adjust when this routine appears.',
    placement: 'auto',
    anchorSelector: '[data-tutorial="routine-schedule"]',
  },
  'routine-extend-time': {
    id: 'routine-extend-time',
    title: 'Extend the deadline',
    body: 'When a routine runs late, give your child more time for the rest of today — no need to reschedule.',
    placement: 'auto',
    anchorSelector: '[data-tutorial="routine-extend-time"]',
  },
  'routine-reset': {
    id: 'routine-reset',
    title: 'Reset',
    body: 'Already done today? Reset lets your child do the routine again today.',
    placement: 'auto',
    anchorSelector: '[data-tutorial="routine-reset"]',
  },

  // ── Child-mode tour (parent learns to teach) ─────────────────────────────
  'child-mode-overview': {
    id: 'child-mode-overview',
    title: 'What your child sees',
    body: "This is your child's home screen. They tap their own card to see their chores, routines, and rewards — just like you've been setting up.",
    placement: 'auto',
    anchorSelector: '.grid',
  },

  // ── Status badges ────────────────────────────────────────────────────────
  'status-too-late': {
    id: 'status-too-late',
    title: 'Too late',
    body: 'This chore passed its deadline today. You can extend it from the kebab menu, or let it expire and try again tomorrow.',
    placement: 'auto',
  },
  'status-pending': {
    id: 'status-pending',
    title: 'Waiting for your review',
    body: 'Pending means your child marked this done and is waiting for you to give it a thumbs-up. Tap to approve or reject.',
    placement: 'auto',
  },
}
