(TMZ) -- Rob Kardashian and Blac Chyna are close to an agreement for custody and child support, but they're not there yet.
Sources familiar with the case tell TMZ, lawyers from both sides as well as Rob and Chyna themselves have been hashing out a joint custody arrangement for months. TMZ was told they are not far apart over the division of physical custody -- each is fine giving the other substantial physical custody.
It's significant because the Dept. of Children and Family Services opened a case even before Rob and Chyna split over her alleged drug use. TMZ was told it's still an open case in L.A. County Dependency Court.
TMZ's sources say Rob believes Chyna can handle parental responsibilities. TMZ was told, however, the Kardashian women are not as understanding and believe there are serious questions about Chyna's fitness because of the drug allegations.
TMZ was told there's something more problematic ... child support. TMZ's sources say Chyna wants a lot ... way more than Rob thinks she deserves, but it appears there's been some movement toward a compromise.
Because there's an open case in Dependency Court, TMZ was told any custody agreement must be signed off by that judge.
Short story ... they're getting a lot closer to hashing things out.