I like the term "Speculative Fiction." It covers basically anything where you're asking "what if this were true?" and finding a story in that world, whether the "what if this were true" is a speculation of What Could Be or Something That Could Never Be.
Ultimately where you draw that line depends on whom you're drawing the line for, I think. In a literary sense, I consider the difference between sci-fi and fantasy to fall more in the purpose of the work. Like.... sci-fi is often about society. It's a projection of where our technology and social changes will take us. What kind of world might we build if we're not careful (a warning), what kind of world could we build with the knowledge we have (a vision). There's science advances involved, but sci-fi is really about right now -- it's very obvious that Star Trek is about the 60s and 70s and not the 2200s.
Fantasy, by contrast, feels to me like an attempt to remove that specificity. When I was talking to a sci-fi loving friend about Why I Write Fantasy, I struggled to explain it in words, but the best I could come up with is that I want to write about people, in general. I want to write about shy people or people with a horrible past or people who feel alone or people who meet and manipulate and hurt and apologise and forgive each other. But if I write about a kid in Chicago, I have to know a lot about Chicago, and if I get it wrong, or if you already have feelings about Chicago, you'll get distracted and you'll miss the Person inside that I'm trying to write about. So a fantasy world is a way to remove that, to remove the specificity of Time and Place and Exact Situation, and to focus on other elements you wanted to focus on without distraction.
So, in a Literary sense, I'd see Fantasy as something that seeks to resonate with people in an internal way, while Sci-fi is a more external exploration of our society through the lens of the future and of where that society might take us. But of course, seen that way, you might get some.... weird categorisations. You might end up with a world of magic that's actually an examination of society. You might end up with a fully scientific world that it turns out had nothing to say about society at all and just wanted to see aliens smooch.
So then, if you're drawing the lines for readers, that's different -- if you're interested in fantasy, will you like this work? In that case, I find the trappings end up actually being more important. Is there a bunch of sciency stuff? It's sci-fi. Is there a bunch of fantastical magic? It's fantasy. Is the aesthetic futuristic? It's sci-fi. Is the aesthetic rustic or medieval? It's fantasy. That feels too simple but like......... I dunno man, if I'm looking for a fantasy story that's what I'm looking for. It's okay if the fantasy story has robots in it, but I want them to be fantasy robots. If I'm looking for sci-fi it's okay if there's some handwavium in there, I just want it to handwaved competently and to fit. Star Trek and Star Wars both have handwaving, but one has a mystical aesthetic while the other doesn't, and that means one of them feels more sci-fi than the other.
Because, I feel like 9 times out of 10 it's not really "I'm looking for a story with a lot of scientific explanations" or "I'm looking for a story with a more universal, fairytale sort of plot" -- you're looking in that genre because it's easier for you to relate to that world, for whatever reason; the trappings of that world resonate with you when the trappings of the other don't. And so once you get riiiiiiiight on the line between the two, you might as well just call it "sci-fi/fantasy" because it's going to be super individual -- folks are gonna have to look at the story to determine whether it hits the tropes that turn their brain off or if it hits the tropes that resonate with them.
s-so uh, this got long but, thanks for reading my new novel about the contrasts of sci-fi and fantasy that I apparently decided to write today, i hope iT MADE SENSE,