A score with its own engine
Four weighted components, renormalised over whatever your night actually measured, rather than scoring an unmeasured component as zero. Duration is penalised in both directions, and a ceiling stops good efficiency rescuing a five hour night.
Sleep need is dynamic: a 7:45 base, plus yesterday's training load, plus repayment on a 14 night rolling debt, plus a flag when your resting heart rate or breathing rate has drifted off your own baseline.