function calcTaper(){var vol=parseInt(document.getElementById("vol").value)||30000;var days=parseInt(document.getElementById("days").value)||7;var pct=days<=3?0.70:days<=7?0.50:days<=14?0.40:0.30;var taper_vol=Math.round(vol*pct);var daily=Math.round(taper_vol/7);document.getElementById("r1").textContent=taper_vol+"m ("+Math.round(pct*100)+"%)";document.getElementById("r2").textContent=daily+"m/day";document.getElementById("desc").innerHTML="For a "+days+"-day taper, reduce weekly volume to "+Math.round(pct*100)+"% = "+taper_vol+"m over the week (~"+daily+"m/day).
Taper tips: Reduce volume, maintain intensity frequency. Race pace work in final 3-4 days. Sleep 8-10 hours.";document.getElementById("results").style.display="block";}