How do I filter block that are nested under page referenc

I’m using this query by Siferiax to get unplanned tasks from my journal page:

    {:title [:h3 "☑ Unplanned"]
    :query [:find (pull ?b [*])
    :in $ ?day
      [?p :block/journal-day ?d]
      [(< ?d ?day)]
      [?b :block/page ?p]
      [?b :block/marker "TODO"]
      (not [?b :block/scheduled _])
      (not [?b :block/ref _])
    :result-transform (fn [result] (sort-by (fn [r] (get-in r [:block/page :block/journal-day])) result))
    :inputs [:today]
    :table-view? false
    :breadcrumb-show? true
    :collapsed? false


But I would like to filter out (i.e. not show) tasks that reference or are nested under blocked which reference a page (any page, not specific). Is it possible?