{"slug":"roof-repair-estimate","lang":"en","category":"Roofing","subcategory":"roofing costs","ui":{"inputs":[{"name":"task__leak_repair","label":"Find and fix a roof leak","type":"select","required":true,"default_value":"pro","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__leak_repair","label":"Number of leaks to fix","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__leak_repair":["pro","diy"]}},{"name":"task__shingle_repair","label":"Replace missing or damaged shingles","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__shingle_repair","label":"Number of damaged areas","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__shingle_repair":["pro","diy"]}},{"name":"task__chimney_flashing","label":"Chimney flashing","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__chimney_flashing","label":"Number of repairs","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__chimney_flashing":["pro","diy"]}},{"name":"task__valley_repair","label":"Roof valley repair","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__valley_repair","label":"Number of valleys to repair","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__valley_repair":["pro","diy"]}},{"name":"task__skylight_leak","label":"Skylight leak","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__skylight_leak","label":"Number of repairs","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__skylight_leak":["pro","diy"]}},{"name":"task__vent_boot","label":"Roof vent or pipe boot","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__vent_boot","label":"Number of repairs","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__vent_boot":["pro","diy"]}},{"name":"task__ridge_cap","label":"Ridge capping","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__ridge_cap","label":"Number of repairs","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__ridge_cap":["pro","diy"]}},{"name":"task__dormer","label":"Dormer repair","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__dormer","label":"Number of repairs","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__dormer":["pro","diy"]}},{"name":"task__fascia_soffit","label":"Fascia and soffit repair (one damaged section)","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__fascia_soffit","label":"Number of repairs","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__fascia_soffit":["pro","diy"]}},{"name":"task__truss","label":"Repair a damaged truss in place (sistering or repair plates)","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__truss","label":"Number of trusses to repair","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__truss":["pro","diy"]}},{"name":"task__rafter_tail","label":"Replace a rotted rafter tail","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__rafter_tail","label":"Number of rafter tails","type":"number","required":true,"default_value":1,"min":0.1,"max":1000,"unit":"units","help":"Enter the size in units.","show_if":{"task__rafter_tail":["pro","diy"]}},{"name":"task__eaves","label":"Eaves repair (per linear ft)","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__eaves","label":"Length of eaves to repair","type":"number","required":true,"default_value":20,"min":0.1,"max":10000,"unit":"ft","help":"Enter the size in linear feet.","show_if":{"task__eaves":["pro","diy"]}},{"name":"task__decking_repair","label":"Replace rotted roof decking (per sq ft)","type":"select","required":true,"default_value":"skip","options":[{"value":"skip","label":"Skip this task"},{"value":"pro","label":"Hire a pro"},{"value":"diy","label":"DIY (materials only)"}]},{"name":"quantity__decking_repair","label":"Decking area to replace","type":"number","required":true,"default_value":64,"min":0.1,"max":100000,"unit":"sq ft","help":"Enter the size in square feet.","show_if":{"task__decking_repair":["pro","diy"]}},{"name":"roof_material","label":"Roofing material","type":"select","required":true,"default_value":"asphalt","options":[{"value":"asphalt","label":"Asphalt shingles"},{"value":"metal","label":"Metal"},{"value":"tile","label":"Clay or ceramic tile"},{"value":"slate","label":"Slate"}]},{"name":"roof_pitch","label":"Roof pitch","type":"select","required":true,"default_value":"standard","options":[{"value":"standard","label":"Walkable (up to about 7/12)"},{"value":"steep","label":"Steep (steeper than 7/12, needs fall protection)"}]},{"name":"state","label":"Location (state or metro area)","type":"select","required":true,"default_value":"US","options":[{"value":"US","label":"National average"},{"value":"AL","label":"Alabama (AL)"},{"value":"AK","label":"Alaska (AK)"},{"value":"AZ","label":"Arizona (AZ)"},{"value":"AR","label":"Arkansas (AR)"},{"value":"CA","label":"California (CA)"},{"value":"CO","label":"Colorado (CO)"},{"value":"CT","label":"Connecticut (CT)"},{"value":"DE","label":"Delaware (DE)"},{"value":"FL","label":"Florida (FL)"},{"value":"GA","label":"Georgia (GA)"},{"value":"HI","label":"Hawaii (HI)"},{"value":"ID","label":"Idaho (ID)"},{"value":"IL","label":"Illinois (IL)"},{"value":"IN","label":"Indiana (IN)"},{"value":"IA","label":"Iowa (IA)"},{"value":"KS","label":"Kansas (KS)"},{"value":"KY","label":"Kentucky (KY)"},{"value":"LA","label":"Louisiana (LA)"},{"value":"ME","label":"Maine (ME)"},{"value":"MD","label":"Maryland (MD)"},{"value":"MA","label":"Massachusetts (MA)"},{"value":"MI","label":"Michigan (MI)"},{"value":"MN","label":"Minnesota (MN)"},{"value":"MS","label":"Mississippi (MS)"},{"value":"MO","label":"Missouri (MO)"},{"value":"MT","label":"Montana (MT)"},{"value":"NE","label":"Nebraska (NE)"},{"value":"NV","label":"Nevada (NV)"},{"value":"NH","label":"New Hampshire (NH)"},{"value":"NJ","label":"New Jersey (NJ)"},{"value":"NM","label":"New Mexico (NM)"},{"value":"NY","label":"New York (NY)"},{"value":"NC","label":"North Carolina (NC)"},{"value":"ND","label":"North Dakota (ND)"},{"value":"OH","label":"Ohio (OH)"},{"value":"OK","label":"Oklahoma (OK)"},{"value":"OR","label":"Oregon (OR)"},{"value":"PA","label":"Pennsylvania (PA)"},{"value":"RI","label":"Rhode Island (RI)"},{"value":"SC","label":"South Carolina (SC)"},{"value":"SD","label":"South Dakota (SD)"},{"value":"TN","label":"Tennessee (TN)"},{"value":"TX","label":"Texas (TX)"},{"value":"UT","label":"Utah (UT)"},{"value":"VT","label":"Vermont (VT)"},{"value":"VA","label":"Virginia (VA)"},{"value":"WA","label":"Washington (WA)"},{"value":"WV","label":"West Virginia (WV)"},{"value":"WI","label":"Wisconsin (WI)"},{"value":"WY","label":"Wyoming (WY)"},{"value":"DC","label":"District of Columbia (DC)"},{"value":"M10420","label":"Akron, OH (metro)"},{"value":"M10580","label":"Albany-Schenectady-Troy, NY (metro)"},{"value":"M10740","label":"Albuquerque, NM (metro)"},{"value":"M10900","label":"Allentown-Bethlehem-Easton, PA-NJ (metro)"},{"value":"M11260","label":"Anchorage, AK (metro)"},{"value":"M12060","label":"Atlanta-Sandy Springs-Alpharetta, GA (metro)"},{"value":"M12260","label":"Augusta-Richmond County, GA-SC (metro)"},{"value":"M12420","label":"Austin-Round Rock-San Marcos, TX (metro)"},{"value":"M12540","label":"Bakersfield-Delano, CA (metro)"},{"value":"M12580","label":"Baltimore-Columbia-Towson, MD (metro)"},{"value":"M12940","label":"Baton Rouge, LA (metro)"},{"value":"M13820","label":"Birmingham-Hoover, AL (metro)"},{"value":"M14260","label":"Boise City, ID (metro)"},{"value":"M14460","label":"Boston-Cambridge-Newton, MA-NH (metro)"},{"value":"M14860","label":"Bridgeport-Stamford-Norwalk, CT (metro)"},{"value":"M15380","label":"Buffalo-Cheektowaga, NY (metro)"},{"value":"M15980","label":"Cape Coral-Fort Myers, FL (metro)"},{"value":"M16700","label":"Charleston-North Charleston, SC (metro)"},{"value":"M16740","label":"Charlotte-Concord-Gastonia, NC-SC (metro)"},{"value":"M16860","label":"Chattanooga, TN-GA (metro)"},{"value":"M16980","label":"Chicago-Naperville-Elgin, IL-IN-WI (metro)"},{"value":"M17140","label":"Cincinnati, OH-KY-IN (metro)"},{"value":"M17410","label":"Cleveland, OH (metro)"},{"value":"M17820","label":"Colorado Springs, CO (metro)"},{"value":"M17900","label":"Columbia, SC (metro)"},{"value":"M18140","label":"Columbus, OH (metro)"},{"value":"M18580","label":"Corpus Christi, TX (metro)"},{"value":"M19100","label":"Dallas-Fort Worth-Arlington, TX (metro)"},{"value":"M19660","label":"Deltona-Daytona Beach-Ormond Beach, FL (metro)"},{"value":"M19740","label":"Denver-Aurora-Lakewood, CO (metro)"},{"value":"M19780","label":"Des Moines-West Des Moines, IA (metro)"},{"value":"M19820","label":"Detroit-Warren-Dearborn, MI (metro)"},{"value":"M21340","label":"El Paso, TX (metro)"},{"value":"M22020","label":"Fargo, ND-MN (metro)"},{"value":"M23060","label":"Fort Wayne, IN (metro)"},{"value":"M23420","label":"Fresno, CA (metro)"},{"value":"M24340","label":"Grand Rapids-Wyoming-Kentwood, MI (metro)"},{"value":"M24660","label":"Greensboro-High Point, NC (metro)"},{"value":"M24860","label":"Greenville-Anderson-Greer, SC (metro)"},{"value":"M25420","label":"Harrisburg-Carlisle, PA (metro)"},{"value":"M25540","label":"Hartford-West Hartford-East Hartford, CT (metro)"},{"value":"M26420","label":"Houston-The Woodlands-Sugar Land, TX (metro)"},{"value":"M26900","label":"Indianapolis-Carmel-Anderson, IN (metro)"},{"value":"M27140","label":"Jackson, MS (metro)"},{"value":"M27260","label":"Jacksonville, FL (metro)"},{"value":"M28140","label":"Kansas City, MO-KS (metro)"},{"value":"M28940","label":"Knoxville, TN (metro)"},{"value":"M29460","label":"Lakeland-Winter Haven, FL (metro)"},{"value":"M29540","label":"Lancaster, PA (metro)"},{"value":"M29620","label":"Lansing-East Lansing, MI (metro)"},{"value":"M29740","label":"Las Cruces, NM (metro)"},{"value":"M29820","label":"Las Vegas-Henderson-Paradise, NV (metro)"},{"value":"M30460","label":"Lexington-Fayette, KY (metro)"},{"value":"M31080","label":"Los Angeles-Long Beach-Anaheim, CA (metro)"},{"value":"M31140","label":"Louisville/Jefferson County, KY-IN (metro)"},{"value":"M31540","label":"Madison, WI (metro)"},{"value":"M31700","label":"Manchester-Nashua, NH (metro)"},{"value":"M32820","label":"Memphis, TN-MS-AR (metro)"},{"value":"M33100","label":"Miami-Fort Lauderdale-West Palm Beach, FL (metro)"},{"value":"M33340","label":"Milwaukee-Waukesha, WI (metro)"},{"value":"M33460","label":"Minneapolis-St. Paul-Bloomington, MN-WI (metro)"},{"value":"M33660","label":"Mobile, AL (metro)"},{"value":"M33700","label":"Modesto, CA (metro)"},{"value":"M34980","label":"Nashville-Davidson-Murfreesboro-Franklin, TN (metro)"},{"value":"M35300","label":"New Haven, CT (metro)"},{"value":"M35620","label":"New York-Newark-Jersey City, NY-NJ-PA (metro)"},{"value":"M35840","label":"North Port-Bradenton-Sarasota, FL (metro)"},{"value":"M36100","label":"Ocala, FL (metro)"},{"value":"M36420","label":"Oklahoma City, OK (metro)"},{"value":"M36540","label":"Omaha, NE-IA (metro)"},{"value":"M36740","label":"Orlando-Kissimmee-Sanford, FL (metro)"},{"value":"M37100","label":"Oxnard-Thousand Oaks-Ventura, CA (metro)"},{"value":"M37340","label":"Palm Bay-Melbourne-Titusville, FL (metro)"},{"value":"M37860","label":"Pensacola-Ferry Pass-Brent, FL (metro)"},{"value":"M37980","label":"Philadelphia-Camden-Wilmington, PA-NJ-DE-MD (metro)"},{"value":"M38060","label":"Phoenix-Mesa-Chandler, AZ (metro)"},{"value":"M38300","label":"Pittsburgh, PA (metro)"},{"value":"M38940","label":"Port St. Lucie, FL (metro)"},{"value":"M38860","label":"Portland-South Portland, ME (metro)"},{"value":"M38900","label":"Portland-Vancouver-Hillsboro, OR-WA (metro)"},{"value":"M39300","label":"Providence-Warwick, RI-MA (metro)"},{"value":"M39340","label":"Provo-Orem-Lehi, UT (metro)"},{"value":"M39580","label":"Raleigh-Cary, NC (metro)"},{"value":"M39900","label":"Reno, NV (metro)"},{"value":"M40060","label":"Richmond, VA (metro)"},{"value":"M40140","label":"Riverside-San Bernardino-Ontario, CA (metro)"},{"value":"M40380","label":"Rochester, NY (metro)"},{"value":"M40900","label":"Sacramento-Roseville-Folsom, CA (metro)"},{"value":"M41420","label":"Salem, OR (metro)"},{"value":"M41620","label":"Salt Lake City-Murray, UT (metro)"},{"value":"M41700","label":"San Antonio-New Braunfels, TX (metro)"},{"value":"M41740","label":"San Diego-Chula Vista-Carlsbad, CA (metro)"},{"value":"M41860","label":"San Francisco-Oakland-Berkeley, CA (metro)"},{"value":"M41940","label":"San Jose-Sunnyvale-Santa Clara, CA (metro)"},{"value":"M42220","label":"Santa Rosa-Petaluma, CA (metro)"},{"value":"M42340","label":"Savannah, GA (metro)"},{"value":"M42540","label":"Scranton--Wilkes-Barre, PA (metro)"},{"value":"M42660","label":"Seattle-Tacoma-Bellevue, WA (metro)"},{"value":"M43340","label":"Shreveport-Bossier City, LA (metro)"},{"value":"M43620","label":"Sioux Falls, SD (metro)"},{"value":"M44060","label":"Spokane-Spokane Valley, WA (metro)"},{"value":"M41180","label":"St. Louis, MO-IL (metro)"},{"value":"M44700","label":"Stockton, CA (metro)"},{"value":"M45060","label":"Syracuse, NY (metro)"},{"value":"M45300","label":"Tampa-St. Petersburg-Clearwater, FL (metro)"},{"value":"M45780","label":"Toledo, OH (metro)"},{"value":"M45940","label":"Trenton-Princeton, NJ (metro)"},{"value":"M46060","label":"Tucson, AZ (metro)"},{"value":"M46140","label":"Tulsa, OK (metro)"},{"value":"M46520","label":"Urban Honolulu, HI (metro)"},{"value":"M47260","label":"Virginia Beach-Norfolk-Newport News, VA-NC (metro)"},{"value":"M47900","label":"Washington-Arlington-Alexandria, DC-VA-MD-WV (metro)"},{"value":"M48620","label":"Wichita, KS (metro)"},{"value":"M49180","label":"Winston-Salem, NC (metro)"},{"value":"M49340","label":"Worcester, MA-CT (metro)"},{"value":"M49660","label":"Youngstown-Warren, OH (metro)"}],"help":"Labor costs vary by state and metro area (a metro area replaces the state figure); material costs are assumed nationwide."}]},"logic_script":"var QTY_MAX = {\"sq_ft\":100000,\"square\":1000,\"each\":1000,\"linear_ft\":10000,\"hour\":2000};\nvar QTY_MAX_LABEL = {\"sq_ft\":\"100,000\",\"square\":\"1,000\",\"each\":\"1,000\",\"linear_ft\":\"10,000\",\"hour\":\"2,000\"};\nvar UNIT_ONE = {\"sq_ft\":\"sq ft\",\"square\":\"roofing square (100 sq ft)\",\"each\":\"unit\",\"linear_ft\":\"linear ft\",\"hour\":\"hour\",\"project\":\"project\"};\nvar UNIT_MANY = {\"sq_ft\":\"sq ft\",\"square\":\"roofing squares\",\"each\":\"units\",\"linear_ft\":\"linear ft\",\"hour\":\"hours\",\"project\":\"projects\"};\nfunction selOpt(mod, value) {\n  for (var i = 0; i < mod.options.length; i++) { if (mod.options[i].value === value) return mod.options[i]; }\n  for (var i = 0; i < mod.options.length; i++) { if (mod.options[i].value === mod.default) return mod.options[i]; }\n  return null;\n}\nfunction applyMods(itemId, qty, steps) {\n  var matProd = 1, laborProd = 1, addM = [0, 0, 0], addL = [0, 0, 0];\n  var mods = data.modifiers || [];\n  for (var i = 0; i < mods.length; i++) {\n    var m = mods[i];\n    if (m.kind === 'qty_tier' && m.applies_to.indexOf(itemId) !== -1) {\n      var tier = null;\n      for (var ti = 0; ti < m.tiers.length; ti++) { if (qty >= m.tiers[ti].min_qty && (!tier || m.tiers[ti].min_qty > tier.min_qty)) tier = m.tiers[ti]; }\n      if (tier) {\n        var tl = tier.labor_mult !== undefined ? tier.labor_mult : 1;\n        var tm = tier.material_mult !== undefined ? tier.material_mult : 1;\n        laborProd *= tl; matProd *= tm;\n        var tparts = [];\n        if (tl !== 1) tparts.push('labor x' + tl);\n        if (tm !== 1) tparts.push('materials x' + tm);\n        steps.push(m.label + ': ' + tier.min_qty + ' or more qualifies (' + tparts.join(', ') + ')' + (tier.basis === 'reasoned' ? ' (estimate adjustment' + (tier.rationale ? ': ' + tier.rationale : '') + ')' : '') + '.');\n      }\n      continue;\n    }\n    if (m.kind !== 'select' || m.applies_to.indexOf(itemId) === -1) continue;\n    var val = inputs[m.id]; if (val === undefined || val === null || val === '') val = m.default;\n    var opt = selOpt(m, val);\n    if (!opt) continue;\n    var lm = opt.labor_mult !== undefined ? opt.labor_mult : 1;\n    var mm = opt.material_mult !== undefined ? opt.material_mult : 1;\n    laborProd *= lm; matProd *= mm;\n    if (opt.add) {\n      var per = opt.add.per === 'qty' ? qty : 1;\n      var lsA = opt.add.labor_share;\n      addM[0] += opt.add.low * (1 - lsA) * per; addM[1] += opt.add.mid * (1 - lsA) * per; addM[2] += opt.add.high * (1 - lsA) * per;\n      addL[0] += opt.add.low * lsA * per; addL[1] += opt.add.mid * lsA * per; addL[2] += opt.add.high * lsA * per;\n    }\n    if (opt.value !== m.default) {\n      steps.push(m.label + ': ' + opt.label + (opt.basis === 'reasoned' ? ' (estimate adjustment' + (opt.rationale ? ': ' + opt.rationale : '') + ')' : '') + '.');\n    }\n  }\n  return { matProd: matProd, laborProd: laborProd, addM: addM, addL: addL };\n}\n// Un paso de cantidad/info: acc <op> (by x scale). \"by\" numerico o id de un valor de \"vals\".\nfunction stepApply(acc, st, vals) {\n  var by = typeof st.by === 'number' ? st.by : vals[st.by];\n  if (st.scale !== undefined) by = by * st.scale;\n  if (st.op === 'mul') return acc * by;\n  if (st.op === 'div') return acc / by;\n  if (st.op === 'add') return acc + by;\n  return acc - by;\n}\n// Entrada compartida (data.shared_inputs) por id.\nfunction sharedById(id) {\n  var list = data.shared_inputs || [];\n  for (var i = 0; i < list.length; i++) { if (list[i].id === id) return list[i]; }\n  return null;\n}\n// Devuelve { found, qty, invalidField }: found=false = itemId no tiene DerivedQty (usar la\n// cantidad manual de siempre); found=true, qty=null = SI tiene, pero el resultado no es un numero\n// utilizable (entradas extremas -> overflow a Infinity, o <= 0): antes se dejaba pasar y\n// aparecia 'Infinity'/el guion largo en steps/footprint (el fuzzing de validateToolLogic lo\n// detecta como salida invalida sin marcar el campo culpable, CA bloqueante).\nfunction derivedFor(itemId, steps) {\n  var mods = data.modifiers || [];\n  for (var i = 0; i < mods.length; i++) {\n    var m = mods[i];\n    if (m.kind !== 'derived' || m.item !== itemId) continue;\n    var vals = {};\n    // Entradas: primero las compartidas (campo shared__<id>, una sola vez en la UI), luego las propias.\n    var specs = [];\n    var sh = m.shared || [];\n    for (var q = 0; q < sh.length; q++) { var si = sharedById(sh[q]); specs.push({ id: sh[q], field: 'shared__' + sh[q], def: si ? si.default : 1 }); }\n    for (var j = 0; j < m.inputs.length; j++) { specs.push({ id: m.inputs[j].id, field: m.id + '__' + m.inputs[j].id, def: m.inputs[j].default }); }\n    for (var j = 0; j < specs.length; j++) {\n      var raw = inputs[specs[j].field];\n      // Campo ausente (p. ej. un test_case que no lo nombra): valor por defecto. Presente pero no\n      // numérico o ≤ 0 (\"abc\", vacío): se señala en su campo; antes se sustituía en silencio por el\n      // valor por defecto y el usuario no veía el error (smoke-test de painting, 29/09).\n      if (raw === undefined || raw === null) { vals[specs[j].id] = specs[j].def; continue; }\n      var v = lib.numEn(raw);\n      if (!isFinite(v) || v <= 0) return { found: true, qty: null, invalidField: specs[j].field };\n      vals[specs[j].id] = v;\n    }\n    var acc = vals[specs[0].id];\n    for (var k = 0; k < m.steps.length; k++) acc = stepApply(acc, m.steps[k], vals);\n    if (m.round === 'ceil') acc = Math.ceil(acc);\n    if (!isFinite(acc) || acc <= 0) return { found: true, qty: null, invalidField: specs[0].field };\n    steps.push(m.label + ': ' + lib.round(acc, 2) + ' ' + m.unit + '.');\n    return { found: true, qty: acc, invalidField: null };\n  }\n  return { found: false, qty: null, invalidField: null };\n}\n// Salidas informativas (modifiers kind 'info') de la partida: parten de su cantidad final y no\n// cambian el coste. \"by\" numerico, id de un select con valores numericos o input (propio o\n// compartido) de su DerivedQty. Devuelve una lista { label, unit, value }.\nfunction infoValuesFor(itemId, qty) {\n  var out = [];\n  var mods = data.modifiers || [];\n  for (var i = 0; i < mods.length; i++) {\n    var m = mods[i];\n    if (m.kind !== 'info' || m.item !== itemId) continue;\n    var vals = {};\n    for (var j = 0; j < mods.length; j++) {\n      var d = mods[j];\n      if (d.kind === 'select') { var sv = inputs[d.id]; vals[d.id] = Number((sv === undefined || sv === null || sv === '') ? d.default : sv); }\n      else if (d.kind === 'derived' && d.item === itemId) {\n        var dsh = d.shared || [];\n        for (var k = 0; k < dsh.length; k++) {\n          var sv2 = inputs['shared__' + dsh[k]]; var sdef = sharedById(dsh[k]);\n          vals[dsh[k]] = (sv2 === undefined || sv2 === null) ? (sdef ? sdef.default : 1) : lib.numEn(sv2);\n        }\n        for (var k = 0; k < d.inputs.length; k++) {\n          var iv = inputs[d.id + '__' + d.inputs[k].id];\n          vals[d.inputs[k].id] = (iv === undefined || iv === null) ? d.inputs[k].default : lib.numEn(iv);\n        }\n      }\n    }\n    var acc = qty;\n    for (var s = 0; s < m.steps.length; s++) acc = stepApply(acc, m.steps[s], vals);\n    if (m.round === 'ceil') acc = Math.ceil(acc);\n    if (!isFinite(acc)) continue;\n    out.push({ label: m.label, unit: m.unit, value: acc });\n  }\n  return out;\n}\nfunction infoRowsFor(itemId, qty, result, steps) {\n  var rows = infoValuesFor(itemId, qty);\n  for (var r = 0; r < rows.length; r++) {\n    result[rows[r].label] = lib.round(rows[r].value, 2) + ' ' + rows[r].unit;\n    steps.push(rows[r].label + ': ' + lib.round(rows[r].value, 2) + ' ' + rows[r].unit + '.');\n  }\n}\n// Cobro minimo (data.minimum_charge): low/mid/high nunca bajan de esas cifras (no aplica si todo es\n// DIY). Lo que se sube se cuenta como mano de obra para que Materials + Labor cuadre con el total.\nfunction applyMin(t, allDiy, steps) {\n  var mc = data.minimum_charge;\n  if (!mc || allDiy) return t;\n  var low = Math.max(t.low, mc.low), mid = Math.max(t.mid, mc.mid), high = Math.max(t.high, mc.high);\n  if (mid !== t.mid) {\n    steps.push('Minimum charge: most contractors bill at least ' + lib.usd(mc.mid) + ' for a job like this, so the typical cost is raised from ' + lib.usd(t.mid) + ' to ' + lib.usd(mid) + '.');\n  } else if (low !== t.low || high !== t.high) {\n    steps.push('Minimum charge: the low and high estimates are raised to ' + lib.usd(low) + ' and ' + lib.usd(high) + '.');\n  }\n  return { low: low, mid: mid, high: high, matMid: t.matMid, labMid: t.labMid + (mid - t.mid), savedLabor: t.savedLabor };\n}\nfunction ratioFor(state) {\n  var ratio = 1, place = 'the U.S. (national average)';\n  if (table && table.rows) { for (var r = 0; r < table.rows.length; r++) { if (table.rows[r][0] === state) { ratio = Number(table.rows[r][2]); if (state !== 'US') place = String(table.rows[r][1]); break; } } }\n  if (!isFinite(ratio) || ratio <= 0) ratio = 1;\n  return { ratio: ratio, place: place };\n}\nfunction computeItem(item, qty, qMult, ratio, diyAllowed, diy, steps) {\n  var mods = applyMods(item.id, qty, steps);\n  var ls = item.labor_share;\n  var baseLow = qty * item.low * qMult, baseMid = qty * item.mid * qMult, baseHigh = qty * item.high * qMult;\n  var matLow = baseLow * (1 - ls) * mods.matProd + mods.addM[0];\n  var matMid = baseMid * (1 - ls) * mods.matProd + mods.addM[1];\n  var matHigh = baseHigh * (1 - ls) * mods.matProd + mods.addM[2];\n  var labLow = baseLow * ls * mods.laborProd * ratio + mods.addL[0] * ratio;\n  var labMid = baseMid * ls * mods.laborProd * ratio + mods.addL[1] * ratio;\n  var labHigh = baseHigh * ls * mods.laborProd * ratio + mods.addL[2] * ratio;\n  var doDiy = diyAllowed && diy;\n  return {\n    low: doDiy ? matLow : matLow + labLow, mid: doDiy ? matMid : matMid + labMid, high: doDiy ? matHigh : matHigh + labHigh,\n    matMid: matMid, labMid: doDiy ? 0 : labMid, savedLabor: labMid\n  };\n}\nif (!data.items.length) return { result: 'No tasks available.', footprint: 'No cost data available.', invalid: 'task__' };\nvar rf = ratioFor(inputs.state);\nvar ratio = rf.ratio, place = rf.place;\nvar totalLow = 0, totalMid = 0, totalHigh = 0, totalMat = 0, totalLab = 0, totalSaved = 0;\nvar anySelected = false, anyDiy = false, anyPro = false;\nvar infoTotals = {}, infoOrder = [];\nvar steps = [];\nfor (var idx = 0; idx < data.items.length; idx++) {\n  var it = data.items[idx];\n  var task = inputs['task__' + it.id];\n  if (!task || task === 'skip') continue;\n  anySelected = true;\n  var derivedSteps = [];\n  var derived = derivedFor(it.id, derivedSteps);\n  var qty;\n  if (derived.found) {\n    if (derived.qty === null) return { result: 'Enter valid measurements greater than 0 for ' + it.label + '.', footprint: 'Waiting for valid measurements.', invalid: derived.invalidField };\n    qty = derived.qty;\n  } else {\n    qty = it.unit === 'project' ? 1 : lib.numEn(inputs['quantity__' + it.id]);\n    if (!isFinite(qty) || qty <= 0) return { result: 'Enter a project size greater than 0 for ' + it.label + '.', footprint: 'Waiting for a valid project size.', invalid: 'quantity__' + it.id };\n    if (QTY_MAX[it.unit] && qty > QTY_MAX[it.unit]) return { result: 'Enter ' + QTY_MAX_LABEL[it.unit] + ' ' + UNIT_MANY[it.unit] + ' or less.', footprint: 'Waiting for a valid project size.', invalid: 'quantity__' + it.id };\n  }\n  var itemDiyOk = it.diy_allowed !== false;\n  var diy = itemDiyOk && task === 'diy';\n  if (diy) anyDiy = true; else anyPro = true;\n  var modSteps = [];\n  var comp = computeItem(it, qty, 1, ratio, itemDiyOk, diy, modSteps);\n  totalLow += comp.low; totalMid += comp.mid; totalHigh += comp.high; totalMat += comp.matMid; totalLab += comp.labMid; if (diy) totalSaved += comp.savedLabor; // solo lo que de verdad haces tú (antes sumaba también la mano de obra de las tareas en pro)\n  var unitQty = qty === 1 ? (UNIT_ONE[it.unit] || it.unit) : (UNIT_MANY[it.unit] || it.unit);\n  steps = steps.concat(derivedSteps);\n  var unitOneS = UNIT_ONE[it.unit] || it.unit;\n  var unitPrice = it.mid < 100 ? 2 : 0;\n  steps.push(it.label + ': national typical price ' + lib.usd(it.mid, unitPrice) + ' per ' + unitOneS + ' (range ' + lib.usd(it.low, unitPrice) + ' to ' + lib.usd(it.high, unitPrice) + ').');\n  steps.push(it.label + ' (' + (diy ? 'DIY, materials only' : 'pro') + '): ' + qty + ' ' + unitQty + ' x ' + lib.usd(it.mid, unitPrice) + ' = ' + lib.usd(qty * it.mid) + ' before adjustments.');\n  steps = steps.concat(modSteps);\n  steps.push(it.label + ' (' + (diy ? 'DIY' : 'pro') + ') after ' + (diy ? 'materials adjustments' : 'the regional labor factor and adjustments') + ': ' + lib.usd(comp.mid) + ' (range ' + lib.usd(comp.low) + ' to ' + lib.usd(comp.high) + ').');\n  // Salidas informativas: las de igual etiqueta de todas las tareas activas se suman.\n  var taskInfo = infoValuesFor(it.id, qty);\n  for (var ii = 0; ii < taskInfo.length; ii++) {\n    var infoKey = taskInfo[ii].label;\n    if (!infoTotals[infoKey]) { infoTotals[infoKey] = { unit: taskInfo[ii].unit, value: 0 }; infoOrder.push(infoKey); }\n    infoTotals[infoKey].value += taskInfo[ii].value;\n  }\n}\nif (!anySelected) return { result: 'Select at least one task.', footprint: 'Waiting for at least one task.', invalid: 'task__' + data.items[0].id };\nvar minSteps = [];\nvar grand = applyMin({ low: totalLow, mid: totalMid, high: totalHigh, matMid: totalMat, labMid: totalLab, savedLabor: totalSaved }, !anyPro, minSteps);\ntotalLow = grand.low; totalMid = grand.mid; totalHigh = grand.high; totalLab = grand.labMid;\nvar result = {\n  'Typical cost': lib.usd(totalMid),\n  'Low estimate': lib.usd(totalLow),\n  'High estimate': lib.usd(totalHigh),\n  'Materials': lib.usd(totalMat),\n  'Labor': lib.usd(totalLab)\n};\nif (anyDiy) result['DIY labor savings'] = lib.usd(totalSaved);\nfor (var io = 0; io < infoOrder.length; io++) {\n  var infoRow = infoTotals[infoOrder[io]];\n  result[infoOrder[io]] = lib.round(infoRow.value, 2) + ' ' + infoRow.unit;\n  steps.push('Total for all selected tasks, ' + infoOrder[io] + ': ' + lib.round(infoRow.value, 2) + ' ' + infoRow.unit + '.');\n}\nsteps = steps.concat(minSteps);\nif (inputs.state && inputs.state !== 'US') {\n  steps.push('Labor wages in ' + place + ' are adjusted with the BLS regional factor for this trade.');\n}\nsteps.push('Total for all selected tasks: ' + lib.usd(totalMid) + ' (range ' + lib.usd(totalLow) + ' to ' + lib.usd(totalHigh) + ').');\nvar footprint = 'Selected tasks in ' + place + ': typical cost ' + lib.usd(totalMid) + '.';\nreturn { result: result, footprint: footprint, steps: steps };","reference_table":{"caption":"Regional labor cost adjustment (state or metro area wage vs. the national average, BLS OEWS)","headers":["Location","Name","Labor cost factor"],"rows":[["US","National average",1],["AL","Alabama",0.8232],["AK","Alaska",1.1773],["AZ","Arizona",0.8703],["AR","Arkansas",0.7874],["CA","California",1.1596],["CO","Colorado",0.9661],["CT","Connecticut",1.178],["DE","Delaware",0.9508],["FL","Florida",0.8406],["GA","Georgia",0.8332],["HI","Hawaii",1.0566],["ID","Idaho",0.934],["IL","Illinois",1.3356],["IN","Indiana",1.0287],["IA","Iowa",0.8956],["KS","Kansas",0.918],["KY","Kentucky",0.8717],["LA","Louisiana",0.908],["ME","Maine",0.9236],["MD","Maryland",1.0602],["MA","Massachusetts",1.2554],["MI","Michigan",1.0569],["MN","Minnesota",1.2542],["MS","Mississippi",0.7788],["MO","Missouri",0.9687],["MT","Montana",0.9806],["NE","Nebraska",0.8244],["NV","Nevada",0.9883],["NH","New Hampshire",1.0977],["NJ","New Jersey",1.2793],["NM","New Mexico",0.8252],["NY","New York",1.1928],["NC","North Carolina",0.8605],["ND","North Dakota",1.0413],["OH","Ohio",0.9575],["OK","Oklahoma",0.8449],["OR","Oregon",1.058],["PA","Pennsylvania",0.9713],["RI","Rhode Island",1.0936],["SC","South Carolina",0.8631],["SD","South Dakota",0.808],["TN","Tennessee",0.8039],["TX","Texas",0.8118],["UT","Utah",0.8872],["VT","Vermont",0.9689],["VA","Virginia",0.8861],["WA","Washington",1.1846],["WV","West Virginia",0.8786],["WI","Wisconsin",0.9986],["WY","Wyoming",0.8545],["DC","District of Columbia",1.1823],["M10420","Akron, OH",1.0036],["M10580","Albany-Schenectady-Troy, NY",1.1765],["M10740","Albuquerque, NM",0.8495],["M10900","Allentown-Bethlehem-Easton, PA-NJ",1.0334],["M11260","Anchorage, AK",1.1778],["M12060","Atlanta-Sandy Springs-Alpharetta, GA",0.8564],["M12260","Augusta-Richmond County, GA-SC",0.7762],["M12420","Austin-Round Rock-San Marcos, TX",0.8614],["M12540","Bakersfield-Delano, CA",1.049],["M12580","Baltimore-Columbia-Towson, MD",1.0282],["M12940","Baton Rouge, LA",0.9023],["M13820","Birmingham-Hoover, AL",0.8523],["M14260","Boise City, ID",0.9641],["M14460","Boston-Cambridge-Newton, MA-NH",1.2098],["M14860","Bridgeport-Stamford-Norwalk, CT",1.3471],["M15380","Buffalo-Cheektowaga, NY",1.1144],["M15980","Cape Coral-Fort Myers, FL",0.8153],["M16700","Charleston-North Charleston, SC",0.9838],["M16740","Charlotte-Concord-Gastonia, NC-SC",0.8789],["M16860","Chattanooga, TN-GA",0.7692],["M16980","Chicago-Naperville-Elgin, IL-IN-WI",1.3934],["M17140","Cincinnati, OH-KY-IN",0.9656],["M17410","Cleveland, OH",1.0198],["M17820","Colorado Springs, CO",0.9262],["M17900","Columbia, SC",0.7795],["M18140","Columbus, OH",0.9503],["M18580","Corpus Christi, TX",0.7152],["M19100","Dallas-Fort Worth-Arlington, TX",0.8529],["M19660","Deltona-Daytona Beach-Ormond Beach, FL",0.8462],["M19740","Denver-Aurora-Lakewood, CO",0.996],["M19780","Des Moines-West Des Moines, IA",0.9322],["M19820","Detroit-Warren-Dearborn, MI",1.1371],["M21340","El Paso, TX",0.6596],["M22020","Fargo, ND-MN",1.0432],["M23060","Fort Wayne, IN",0.9383],["M23420","Fresno, CA",1.0781],["M24340","Grand Rapids-Wyoming-Kentwood, MI",0.9921],["M24660","Greensboro-High Point, NC",0.8655],["M24860","Greenville-Anderson-Greer, SC",0.9104],["M25420","Harrisburg-Carlisle, PA",0.9169],["M25540","Hartford-West Hartford-East Hartford, CT",1.1748],["M26420","Houston-The Woodlands-Sugar Land, TX",0.7934],["M26900","Indianapolis-Carmel-Anderson, IN",0.9942],["M27140","Jackson, MS",0.7736],["M27260","Jacksonville, FL",0.8399],["M28140","Kansas City, MO-KS",1.0131],["M28940","Knoxville, TN",0.7539],["M29460","Lakeland-Winter Haven, FL",0.8509],["M29540","Lancaster, PA",0.9401],["M29620","Lansing-East Lansing, MI",0.984],["M29740","Las Cruces, NM",0.7079],["M29820","Las Vegas-Henderson-Paradise, NV",0.9616],["M30460","Lexington-Fayette, KY",0.8782],["M31080","Los Angeles-Long Beach-Anaheim, CA",1.1505],["M31140","Louisville/Jefferson County, KY-IN",0.9469],["M31540","Madison, WI",1.028],["M31700","Manchester-Nashua, NH",1.081],["M32820","Memphis, TN-MS-AR",0.8249],["M33100","Miami-Fort Lauderdale-West Palm Beach, FL",0.8316],["M33340","Milwaukee-Waukesha, WI",1.0072],["M33460","Minneapolis-St. Paul-Bloomington, MN-WI",1.3058],["M33660","Mobile, AL",0.7972],["M33700","Modesto, CA",1.1061],["M34980","Nashville-Davidson-Murfreesboro-Franklin, TN",0.8908],["M35300","New Haven, CT",1.1459],["M35620","New York-Newark-Jersey City, NY-NJ-PA",1.3271],["M35840","North Port-Bradenton-Sarasota, FL",0.8885],["M36100","Ocala, FL",0.789],["M36420","Oklahoma City, OK",0.7914],["M36540","Omaha, NE-IA",0.8426],["M36740","Orlando-Kissimmee-Sanford, FL",0.8445],["M37100","Oxnard-Thousand Oaks-Ventura, CA",1.1269],["M37340","Palm Bay-Melbourne-Titusville, FL",0.8452],["M37860","Pensacola-Ferry Pass-Brent, FL",0.8077],["M37980","Philadelphia-Camden-Wilmington, PA-NJ-DE-MD",1.048],["M38060","Phoenix-Mesa-Chandler, AZ",0.8896],["M38300","Pittsburgh, PA",0.9622],["M38940","Port St. Lucie, FL",0.8743],["M38860","Portland-South Portland, ME",0.9625],["M38900","Portland-Vancouver-Hillsboro, OR-WA",1.1495],["M39300","Providence-Warwick, RI-MA",1.1054],["M39340","Provo-Orem-Lehi, UT",0.8581],["M39580","Raleigh-Cary, NC",0.894],["M39900","Reno, NV",1.0335],["M40060","Richmond, VA",0.8612],["M40140","Riverside-San Bernardino-Ontario, CA",1.0882],["M40380","Rochester, NY",1.0134],["M40900","Sacramento-Roseville-Folsom, CA",1.1453],["M41420","Salem, OR",1.006],["M41620","Salt Lake City-Murray, UT",0.9083],["M41700","San Antonio-New Braunfels, TX",0.7755],["M41740","San Diego-Chula Vista-Carlsbad, CA",1.1226],["M41860","San Francisco-Oakland-Berkeley, CA",1.2764],["M41940","San Jose-Sunnyvale-Santa Clara, CA",1.3215],["M42220","Santa Rosa-Petaluma, CA",1.2021],["M42340","Savannah, GA",0.8067],["M42540","Scranton--Wilkes-Barre, PA",0.9644],["M42660","Seattle-Tacoma-Bellevue, WA",1.2597],["M43340","Shreveport-Bossier City, LA",0.8873],["M43620","Sioux Falls, SD",0.8037],["M44060","Spokane-Spokane Valley, WA",1.1285],["M41180","St. Louis, MO-IL",1.1161],["M44700","Stockton, CA",1.1056],["M45060","Syracuse, NY",1.1109],["M45300","Tampa-St. Petersburg-Clearwater, FL",0.8359],["M45780","Toledo, OH",0.9585],["M45940","Trenton-Princeton, NJ",1.318],["M46060","Tucson, AZ",0.7853],["M46140","Tulsa, OK",0.9933],["M46520","Urban Honolulu, HI",1.0437],["M47260","Virginia Beach-Norfolk-Newport News, VA-NC",0.8165],["M47900","Washington-Arlington-Alexandria, DC-VA-MD-WV",1.0647],["M48620","Wichita, KS",0.8483],["M49180","Winston-Salem, NC",0.8708],["M49340","Worcester, MA-CT",1.468],["M49660","Youngstown-Warren, OH",0.9202]]},"cost_data":{"trade":"roofing","version":"v4","country":"us","currency":"USD","retrieved_at":"2026-09-29","labor_soc":"47-2181","items":[{"id":"leak_repair","label":"Find and fix a roof leak","unit":"each","low":350,"mid":900,"high":1970,"labor_share":0.65,"sources":[{"label":"Fixr - Cost to Repair a Roof Leak","url":"https://www.fixr.com/costs/repair-roof-leaks","quote":"Roof leak repair costs an average of $800, and most projects total between $350 and $1,500.","retrieved_at":"2026-09-28","low":350,"high":1500},{"label":"ConsumerAffairs - Cost to Repair a Roof Leak","url":"https://www.consumeraffairs.com/homeowners/cost-to-repair-a-roof-leak.html","quote":"On average, repairing a roof leak costs between $390 and $1,970.","retrieved_at":"2026-09-28","low":390,"high":1970},{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Holes and leaks ($100–$1,500):","retrieved_at":"2026-09-29","low":100,"high":1500},{"label":"The Roofing Brief - How Much to Repair a Roof","url":"https://theroofingbrief.com/how-much-to-repair-a-roof/","quote":"Most roof leak repairs run $300 to $800","retrieved_at":"2026-10-03","low":300,"high":800},{"label":"Roof River City - Roof Leak Repair Cost","url":"https://roofrivercity.com/roof-leak-repair-cost/","quote":"Most homeowners pay between $392 and $1,913 for roof leak repairs.","retrieved_at":"2026-10-03","low":392,"high":1913}],"default_qty":1,"qty_label":"Number of leaks to fix","default_task":"pro","unit_name":"leak"},{"id":"shingle_repair","label":"Replace missing or damaged shingles","unit":"each","low":150,"mid":350,"high":700,"labor_share":0.7,"sources":[{"label":"Angi - How Much Does Roof Shingle Repair Cost?","url":"https://www.angi.com/articles/how-much-does-roof-shingle-repair-cost.htm","quote":"Shingle replacement, $100–$700.","retrieved_at":"2026-09-28","low":100,"high":700},{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Shingle damage: ($50–$800)","retrieved_at":"2026-09-28","low":50,"high":800},{"label":"The Roofing Brief - How Much to Repair a Roof","url":"https://theroofingbrief.com/how-much-to-repair-a-roof/","quote":"missing shingle $200-$500","retrieved_at":"2026-10-03","low":200,"high":500},{"label":"Roof River City - Roof Leak Repair Cost","url":"https://roofrivercity.com/roof-leak-repair-cost/","quote":"Shingle replacement costs range from $200 to $500 for up to five shingles.","retrieved_at":"2026-10-03","low":200,"high":500},{"label":"PrequalifyRoof - Roof Repair Cost","url":"https://prequalifyroof.com/guides/roof-repair-cost/","quote":"Replacing one to three shingles runs $150 to $400","retrieved_at":"2026-10-03","low":150,"high":400}],"default_qty":1,"qty_label":"Number of damaged areas","default_task":"skip","unit_name":"area"},{"id":"chimney_flashing","label":"Chimney flashing","unit":"each","low":200,"mid":400,"high":800,"labor_share":0.75,"default_qty":1,"qty_label":"Number of repairs","unit_name":"repair","default_task":"skip","sources":[{"label":"Connecteam - Roof Repair Cost Calculator","url":"https://connecteam.com/free-tools/free-roof-repairing-cost-calculator/","quote":"Chimney Flashing ($200–$500, 4 hours)","retrieved_at":"2026-09-29","low":200,"high":500},{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Chimney or roof flashing ($200–$500):","retrieved_at":"2026-09-29","low":200,"high":500},{"label":"Roof River City - Roof Leak Repair Cost","url":"https://roofrivercity.com/roof-leak-repair-cost/","quote":"Minor chimney flashing repairs cost $300 to $800.","retrieved_at":"2026-10-03","low":300,"high":800}]},{"id":"valley_repair","label":"Roof valley repair","unit":"each","low":300,"mid":700,"high":1500,"labor_share":0.7,"sources":[{"label":"Angi - How Much Does Roof Shingle Repair Cost?","url":"https://www.angi.com/articles/how-much-does-roof-shingle-repair-cost.htm","quote":"Valley repair, $300–$1,000.","retrieved_at":"2026-09-28","low":300,"high":1000},{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Roof valley ($300–$1,000)","retrieved_at":"2026-09-28","low":300,"high":1000},{"label":"Connecteam - Roof Repair Cost Calculator","url":"https://connecteam.com/free-tools/free-roof-repairing-cost-calculator/","quote":"Valley Repair ($600–$1000, 6 hours)","retrieved_at":"2026-09-29","low":600,"high":1000},{"label":"The Roofing Brief - How Much to Repair a Roof","url":"https://theroofingbrief.com/how-much-to-repair-a-roof/","quote":"valley repair $600-$2,200","retrieved_at":"2026-10-03","low":600,"high":2200}],"default_qty":1,"qty_label":"Number of valleys to repair","default_task":"skip","unit_name":"valley"},{"id":"skylight_leak","label":"Skylight leak","unit":"each","low":225,"mid":500,"high":800,"labor_share":0.7,"default_qty":1,"qty_label":"Number of repairs","unit_name":"skylight","default_task":"skip","sources":[{"label":"Connecteam - Roof Repair Cost Calculator","url":"https://connecteam.com/free-tools/free-roof-repairing-cost-calculator/","quote":"Skylight Leak ($450–$800, 3 hours)","retrieved_at":"2026-09-29","low":450,"high":800},{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Skylights ($300–$800):","retrieved_at":"2026-09-29","low":300,"high":800},{"label":"Roof River City - Roof Leak Repair Cost","url":"https://roofrivercity.com/roof-leak-repair-cost/","quote":"Leaking skylights need $225 to $800 in repairs.","retrieved_at":"2026-10-03","low":225,"high":800},{"label":"Colony Roofers - How Much Does It Cost to Repair a Roof","url":"https://colonyroofers.com/learningcenter/how-much-does-it-cost-to-repair-a-roof","quote":"will usually on run you $300 - $500","retrieved_at":"2026-10-03","low":300,"high":500}]},{"id":"vent_boot","label":"Roof vent or pipe boot","unit":"each","low":100,"mid":250,"high":550,"labor_share":0.7,"default_qty":1,"qty_label":"Number of repairs","unit_name":"vent","default_task":"skip","sources":[{"label":"Connecteam - Roof Repair Cost Calculator","url":"https://connecteam.com/free-tools/free-roof-repairing-cost-calculator/","quote":"Vent Repair ($150–$250, 2 hours)","retrieved_at":"2026-09-29","low":150,"high":250},{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Roof vents ($75–$250):","retrieved_at":"2026-09-29","low":75,"high":250},{"label":"Colony Roofers - How Much Does It Cost to Repair a Roof","url":"https://colonyroofers.com/learningcenter/how-much-does-it-cost-to-repair-a-roof","quote":"These repairs are fairly easy though, and typically only cost from $75 - $250.","retrieved_at":"2026-10-03","low":75,"high":250},{"label":"The Roofing Brief - How Much to Repair a Roof","url":"https://theroofingbrief.com/how-much-to-repair-a-roof/","quote":"Pipe boot or vent flashing replacement: $150 to $450 installed","retrieved_at":"2026-10-03","low":150,"high":450},{"label":"Roof River City - Roof Leak Repair Cost","url":"https://roofrivercity.com/roof-leak-repair-cost/","quote":"A cracked pipe boot replacement costs $250 to $550.","retrieved_at":"2026-10-03","low":250,"high":550}]},{"id":"ridge_cap","label":"Ridge capping","unit":"each","low":250,"mid":500,"high":750,"labor_share":0.7,"default_qty":1,"qty_label":"Number of repairs","unit_name":"repair","default_task":"skip","sources":[{"label":"Connecteam - Roof Repair Cost Calculator","url":"https://connecteam.com/free-tools/free-roof-repairing-cost-calculator/","quote":"Ridge Capping ($550–$750, 4 hours)","retrieved_at":"2026-09-29","low":550,"high":750},{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Ridge capping ($250–$750):","retrieved_at":"2026-09-29","low":250,"high":750},{"label":"Colony Roofers - How Much Does It Cost to Repair a Roof","url":"https://colonyroofers.com/learningcenter/how-much-does-it-cost-to-repair-a-roof","quote":"For these kinds of repairs, expect to pay between $250 - $750.","retrieved_at":"2026-10-03","low":250,"high":750},{"label":"Total Foundation and Roofing Repair - Ridge Cap Repair Cost","url":"https://totalfoundationandroofingrepair.com/blog/roof-ridge-cap-repair-cost/","quote":"Roof ridge cap repair cost typically ranges from $200 to $750","retrieved_at":"2026-10-03","low":200,"high":750}]},{"id":"dormer","label":"Dormer repair","unit":"each","low":250,"mid":700,"high":1000,"labor_share":0.7,"default_qty":1,"qty_label":"Number of repairs","unit_name":"dormer","default_task":"skip","sources":[{"label":"Connecteam - Roof Repair Cost Calculator","url":"https://connecteam.com/free-tools/free-roof-repairing-cost-calculator/","quote":"Dormer Repair ($650–$1000, 5 hours)","retrieved_at":"2026-09-29","low":650,"high":1000},{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Dormer ($250–$1,000):","retrieved_at":"2026-09-29","low":250,"high":1000},{"label":"Colony Roofers - How Much Does It Cost to Repair a Roof","url":"https://colonyroofers.com/learningcenter/how-much-does-it-cost-to-repair-a-roof","quote":"repairs cost an average of $250 - $1000","retrieved_at":"2026-10-03","low":250,"high":1000}]},{"id":"fascia_soffit","label":"Fascia and soffit repair (one damaged section)","unit":"each","low":300,"mid":900,"high":1700,"labor_share":0.7,"default_qty":1,"qty_label":"Number of repairs","unit_name":"repair","default_task":"skip","sources":[{"label":"Connecteam - Roof Repair Cost Calculator","url":"https://connecteam.com/free-tools/free-roof-repairing-cost-calculator/","quote":"Fascia/Soffits ($1250–$1700, 5 hours)","retrieved_at":"2026-09-29","low":1250,"high":1700},{"label":"Colony Roofers - How Much Does It Cost to Repair a Roof","url":"https://colonyroofers.com/learningcenter/how-much-does-it-cost-to-repair-a-roof","quote":"Repairs to this part of your roofing system typically run between $300 - $1500.","retrieved_at":"2026-10-03","low":300,"high":1500}]},{"id":"truss","label":"Repair a damaged truss in place (sistering or repair plates)","unit":"each","low":300,"mid":550,"high":800,"labor_share":0.7,"default_qty":1,"qty_label":"Number of trusses to repair","unit_name":"truss","default_task":"skip","sources":[{"label":"Upgraded Home - Roof Truss Repair Cost","url":"https://upgradedhome.com/roof-truss-repair-cost/","quote":"In-place truss repairs typically cost between $300 and $800 per truss","retrieved_at":"2026-10-03","low":300,"high":800},{"label":"Hunker - Cost of Repairing a Roof Truss","url":"https://www.hunker.com/13415899/cost-of-repairing-a-roof-truss/","quote":"Fixing roof structures generally starts at between $350 and $800.","retrieved_at":"2026-10-03","low":350,"high":800}]},{"id":"rafter_tail","label":"Replace a rotted rafter tail","unit":"each","low":200,"mid":300,"high":400,"labor_share":0.7,"default_qty":1,"qty_label":"Number of rafter tails","unit_name":"rafter tail","default_task":"skip","sources":[{"label":"Litespeed Construction - Cost to Replace Rotted Rafter Tails","url":"https://litespeedconstruction.com/how-much-should-it-cost-to-replace-rotted-rafter-tails-when-im-replacing-my-roof/","quote":"between $200 to $400 per rafter tail for replacement","retrieved_at":"2026-10-05","low":200,"high":400},{"label":"Total Foundation & Roofing Repair - Rafter Repair Costs","url":"https://totalfoundationandroofingrepair.com/blog/cracked-rafters-and-your-wallet-what-to-expect-for-repair-costs/","quote":"$200 – $400 per tail","retrieved_at":"2026-10-05","low":200,"high":400}]},{"id":"eaves","label":"Eaves repair (per linear ft)","unit":"linear_ft","low":6,"mid":13,"high":20,"labor_share":0.7,"default_qty":20,"qty_label":"Length of eaves to repair","default_task":"skip","sources":[{"label":"The Roofing Brief - Roof Eaves Repair","url":"https://theroofingbrief.com/roof-eaves-repair/","quote":"Roof eaves repair runs about $6 to $20 per linear foot","retrieved_at":"2026-09-29","low":6,"high":20},{"label":"EMC Remodeling - Roof Eaves Repair Cost","url":"https://emcremodelingroofing.com/roof-eaves-repair-cost-guide/","quote":"Complete eaves repair: $6-$20 per linear foot","retrieved_at":"2026-09-29","low":6,"high":20}]},{"id":"decking_repair","label":"Replace rotted roof decking (per sq ft)","unit":"sq_ft","low":2,"mid":5,"high":8,"labor_share":0.6,"sources":[{"label":"Fixr - How Much Does a Roof Replacement Cost?","url":"https://www.fixr.com/costs/roof-replacement","quote":"Replacing roof decking costs $2 to $8 per sq. ft.","retrieved_at":"2026-09-28","low":2,"high":8},{"label":"Angi - How Much Does It Cost to Shingle a Roof?","url":"https://www.angi.com/articles/how-much-does-it-cost-to-shingle-a-roof.htm","quote":"Roof decking repairs: $2–$5 per sq. ft.","retrieved_at":"2026-09-28","low":2,"high":5},{"label":"O'Connor Roofing - Cost to Redeck a Roof","url":"https://oconnorroofingbuffalo.com/blogs/cost-to-redeck-a-roof/","quote":"The cost to redeck a roof generally ranges from $2 to $5 per square foot","retrieved_at":"2026-10-03","low":2,"high":5},{"label":"Weather Shield Roofers - Roof Decking Cost","url":"https://weathershieldroofers.com/blog/roof-decking-types-cost-replacement/","quote":"$2 to $5 per square foot. Spot replacement of a few damaged sheets","retrieved_at":"2026-10-03","low":2,"high":5}],"default_qty":64,"qty_label":"Decking area to replace","default_task":"skip"}],"diy_allowed":true,"mode":"sum","modifiers":[{"kind":"select","id":"roof_material","label":"Roofing material","applies_to":["leak_repair","shingle_repair","chimney_flashing","valley_repair","skylight_leak","vent_boot","ridge_cap","dormer"],"default":"asphalt","options":[{"value":"asphalt","label":"Asphalt shingles","basis":"sourced","labor_mult":1,"material_mult":1,"sources":[{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Asphalt shingles $4.25–$8.25 $975","retrieved_at":"2026-09-28"}]},{"value":"metal","label":"Metal","basis":"sourced_ratio","labor_mult":1.64,"material_mult":1.64,"rationale":"Average repair cost for standing seam metal ($1,600) divided by the average for asphalt shingles ($975), both from This Old House.","sources":[{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Standing seam metal tiles $10–$17.05 $1,600","retrieved_at":"2026-09-28"}]},{"value":"tile","label":"Clay or ceramic tile","basis":"sourced_ratio","labor_mult":1.03,"material_mult":1.03,"rationale":"Average repair cost for clay or ceramic tile ($1,000) divided by the average for asphalt shingles ($975), both from This Old House.","sources":[{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Clay or ceramic tiles $12–$24.75 $1,000","retrieved_at":"2026-09-28"}]},{"value":"slate","label":"Slate","basis":"sourced_ratio","labor_mult":1.846,"material_mult":1.846,"rationale":"Average slate repair ($1,800) divided by asphalt shingles ($975), This Old House.","sources":[{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair","quote":"Slate tiles $12–$22 $1,800","retrieved_at":"2026-09-29"}]}]},{"kind":"select","id":"roof_pitch","label":"Roof pitch","applies_to":["leak_repair","shingle_repair","chimney_flashing","valley_repair","skylight_leak","vent_boot","ridge_cap","dormer","fascia_soffit","decking_repair","eaves"],"default":"standard","options":[{"value":"standard","label":"Walkable (up to about 7/12)","basis":"sourced","labor_mult":1,"material_mult":1,"sources":[{"label":"Gorilla Roofing - Roofing Labor Costs","url":"https://www.gorillaroofing.com/resources/roofing-labor-costs-overview/","quote":"Anything steeper than about 7/12 needs fall protection and slows the crew down.","retrieved_at":"2026-09-28"}]},{"value":"steep","label":"Steep (steeper than 7/12, needs fall protection)","basis":"sourced","labor_mult":1.375,"material_mult":1,"rationale":"Midpoint of the 25-50% extra labor quoted for steep roofs.","sources":[{"label":"Gorilla Roofing - Roofing Labor Costs","url":"https://www.gorillaroofing.com/resources/roofing-labor-costs-overview/","quote":"Expect 25–50% more labor on a steep roof.","retrieved_at":"2026-09-28"}]}]}],"minimum_charge":{"low":150,"mid":300,"high":500,"sources":[{"label":"PrequalifyRoof - Roof Repair Cost","url":"https://prequalifyroof.com/guides/roof-repair-cost/","quote":"A service-call minimum of roughly $300 to $500 sets the floor","retrieved_at":"2026-09-29"},{"label":"The Roofing Brief - How Much to Repair a Roof","url":"https://theroofingbrief.com/how-much-to-repair-a-roof/","quote":"Service call minimum runs $150 to $350 in most regions","retrieved_at":"2026-09-29"},{"label":"Roof River City - Roof Leak Repair Cost","url":"https://roofrivercity.com/roof-leak-repair-cost/","quote":"many set a minimum fee of $150-$300 even for small repairs","retrieved_at":"2026-09-29"}]}},"cost_data_ref":{"trade":"roofing","version":"v4"},"price_date":"2026-09","figures":[{"src":"/assets/img/tools/roof-pitch-walkable-vs-steep.svg","alt":"Three roof pitches drawn to scale: 4/12 is walkable, 8/12 and 12/12 are steep","caption":"Roof pitch is rise over 12 inches of run. Up to 7/12 crews can walk the roof; steeper roofs need extra safety gear and labor.","width":720,"height":360},{"src":"/assets/img/tools/roof-parts-diagram.svg","alt":"Diagram of roof parts: ridge, valley, eaves, vent boot, chimney flashing, skylight, decking, soffit and fascia","caption":"Common repair spots: ridge, valleys, flashing around the chimney, vent boots and skylights, plus the decking, soffit and fascia at the eaves.","width":720,"height":360}],"title":"Roof Repair Estimate Calculator","description":"Estimate the cost of common roof repairs, from fixing leaks and replacing shingles to repairing flashing and decking. Adjust for your local area, roof pitch, and materials.","seo_title":"Roof Repair Estimate Calculator: Free Cost Estimates","seo_description":"Get a free roof repair estimate. Calculate typical costs for fixing leaks, replacing shingles, and flashing based on your local area and roof type.","seo_footprint":{"text_intro":"When dealing with roof damage, getting an accurate roof repair estimate is the first step to protecting your home from further structural issues. Whether you need a quick fix for a skylight leak, shingle replacement, or extensive truss repair, this roof repair estimate calculator helps you anticipate the costs. It factors in local labor rates across the US, roof pitch, and materials like asphalt, metal, tile, or slate to provide a realistic cost breakdown. Ignoring a small leak can lead to rotted roof decking or damaged fascia and soffits, so estimating your roof repair costs early allows you to budget effectively and hire the right professional.","faq":[{"question":"How much should it cost to fix a roof?","answer":"The cost depends heavily on the type of repair and the materials involved. For example, a typical roof leak repair averages $1,100, while minor fixes like replacing a vent boot or a few damaged shingles might cost around $300 to $350. Major structural work, such as a truss repair, can reach up to $3,000."},{"question":"How many estimates should I get for a roof repair?","answer":"It is generally recommended to get at least three free estimates for roof repair from licensed and insured roofing contractors. This allows you to compare labor rates, material markups, and the specific scope of work proposed to ensure you are getting a fair and accurate price for your local market."},{"question":"Is $30,000 too much for a roof?","answer":"For a standard roof repair, $30,000 is exceptionally high. An estimate of that size usually indicates a complete roof replacement on a large home, the use of premium materials like natural slate or high-end metal, or extensive structural rebuilding of trusses and decking, rather than a simple repair job."},{"question":"How much does it cost to fix roof damage?","answer":"Fixing roof damage varies by the extent and location of the issue. A standard leak repair is typically around $1,100, repairing a roof valley averages $650, and fixing a skylight leak is about $600. Repairing fascia and soffits can average $1,500. Costs will adjust based on your local labor rates, roof pitch, and whether you have asphalt, metal, tile, or slate."},{"question":"Can I save money with a DIY roof repair?","answer":"Yes, DIY repairs save entirely on labor costs. For instance, a standard leak repair that costs $1,100 professionally might only cost $385 in materials if you do it yourself, saving you $715 in labor. However, working on a roof carries significant safety risks, especially on steep pitches, and improper repairs can lead to more costly water damage later."}],"how_to_use_steps":["Select the specific repair tasks you need, such as fixing a leak, replacing shingles, or repairing chimney flashing.","Enter the quantity or size for each selected task.","Choose your roofing material and roof pitch.","Select your state or metro area to adjust labor costs to your local market.","Review the typical cost, low and high estimates, and the breakdown of materials and labor."]},"content_sections":[{"heading":"Understanding Your Roof Repair Estimate","paragraphs":["A comprehensive roof repair cost estimate breaks down the expenses into materials and labor. Labor costs fluctuate significantly depending on your location and the complexity of the job. For instance, working on a steep roof pitch (steeper than 7/12) requires extra fall protection and slows down the work, increasing the labor portion of your estimate.","Materials also vary widely; standard asphalt shingles are the most common and cost-effective, while repairing metal, clay tile, or slate roofs requires specialized materials and expertise that drive up the overall price."]},{"heading":"Common Roof Repairs and Costs","paragraphs":["Different parts of your roof are prone to specific types of damage over time. Flashing around chimneys, vent boots, and skylights often degrades due to weather exposure, leading to leaks. Based on national averages, a typical chimney flashing repair costs around $350, a vent boot repair is about $300, and fixing a skylight leak averages $600.","If the damage extends to the roof's structure, costs increase significantly. Repairing a roof valley averages $650, while major structural work like fixing a truss can cost $3,000, and repairing a rafter tail averages $2,000."]},{"heading":"Worked Example: Sample Roof Repair Estimate","paragraphs":["Let's look at a sample estimate for roof repair to understand how the costs break down. Suppose you need to hire a pro to fix one standard roof leak on a walkable asphalt roof, using the national average labor rate. The typical cost for this job is $1,100.","This total is divided into $385 for materials and $715 for labor. Depending on the severity of the leak and any hidden damage discovered during the repair, the low estimate could be $350, while a high estimate might reach $3,000. If you were to do this exact same repair yourself (DIY), you would only pay the $385 for materials, resulting in a DIY labor savings of $715."]},{"heading":"Factors That Affect Your Estimate","paragraphs":["Several variables influence the final price of fixing roof damage beyond just the type of repair. Your geographic location heavily impacts the labor rate. Metro areas with a higher cost of living will see higher labor charges than rural areas or the national average.","Additionally, the extent of the damage matters; replacing a few missing shingles might only cost $350, but if water has penetrated the surface, you may also need to replace rotted roof decking or repair the eaves, which adds to the total square footage or linear footage of the project."]}],"sources":[{"label":"U.S. Bureau of Labor Statistics (BLS), Occupational Employment and Wage Statistics","url":"https://www.bls.gov/oes/"},{"label":"Fixr - Cost to Repair a Roof Leak","url":"https://www.fixr.com/costs/repair-roof-leaks"},{"label":"ConsumerAffairs - Cost to Repair a Roof Leak","url":"https://www.consumeraffairs.com/homeowners/cost-to-repair-a-roof-leak.html"},{"label":"This Old House - Cost of Roof Repair","url":"https://www.thisoldhouse.com/roofing/cost-of-roof-repair"}],"default_output":{"result":{"Typical cost":"$900","Low estimate":"$350","High estimate":"$1,970","Materials":"$315","Labor":"$585"},"footprint":"Selected tasks in the U.S. (national average): typical cost $900.","steps":["Find and fix a roof leak: national typical price $900 per unit (range $350 to $1,970).","Find and fix a roof leak (pro): 1 unit x $900 = $900 before adjustments.","Find and fix a roof leak (pro) after the regional labor factor and adjustments: $900 (range $350 to $1,970).","Total for all selected tasks: $900 (range $350 to $1,970)."]},"status":"published","reviewed_at":"2026-10-05","verification_note":"rafter_tail por cola de cabio (05/10)"}