${escapeHtml(title)}

${escapeHtml(title)}

Generated ${escapeHtml(timestamp)}
${inputTable}

Results

${results.innerHTML}

This report is for habit planning only. Adjust goals based on your real schedule.

`; const win = window.open("", "_blank", "width=900,height=700"); if (!win) return; win.document.open(); win.document.write(html); win.document.close(); win.focus(); setTimeout(() => win.print(), 300); }; const buildHowToSection = () => { const section = document.createElement("section"); section.className = "mortgage-details-section"; section.innerHTML = `

How to use this calculator

Define The Habit

Start with a clear habit name that is easy to recognize at a glance. Use a short phrase such as “Morning walk” or “Stretching routine.” Clear naming helps you measure progress without confusion. When the habit is specific, it is easier to spot small wins and build consistency from week to week.

Set Weekly Target

Choose how many sessions you want to complete in a typical week. A modest target that you can hit regularly is more sustainable than a perfect plan you rarely achieve. Use the target sessions field to define the rhythm you want to maintain across a full week.

Log Completed Sessions

Update the completed sessions value as you finish each habit session. This keeps the completion percentage accurate and helps you understand your remaining workload. Accurate logs also make it easier to reflect on what went well during the week and where adjustments are needed.

Track Streak Momentum

Add your current streak in days to see how your consistency is trending. Streaks motivate momentum, but they are most useful when paired with achievable targets. If you miss a day, the goal is to recover quickly rather than obsess over a perfect streak.

Review Weekly Progress

Use the summary metrics to review completion rate, remaining sessions, and the weekly pace required. The summary offers a quick snapshot you can check midweek to decide whether to keep pace or adjust your plan. A small course correction early in the week prevents large catch-up sessions later.

Adjust With Feedback

If you consistently exceed your target, consider increasing difficulty or adding a new habit. If the target feels too hard, reduce it and rebuild confidence. The goal is steady, repeatable progress that fits your real schedule and energy.

`; return section; }; const buildGuideSection = () => { const section = document.createElement("section"); section.className = "mortgage-details-section"; section.innerHTML = `

Goal and Habit Guide

Clarify Desired Outcome

Begin by clarifying why the habit matters. A clear outcome keeps the habit connected to a bigger purpose and makes it easier to stay committed. When the benefit is obvious, you are more willing to protect time for the habit even on busy days.

Use Small Triggers

Pair the habit with a simple trigger, such as completing it after coffee or before a commute. Simple triggers reduce decision fatigue and help habits become automatic. This reduces the chance of missing sessions because you “forgot” or ran out of time.

Design A Back Up

Create a smaller backup version of the habit for low-energy days. For example, a five-minute walk can replace a full workout when time is limited. Backup habits protect your streak and keep the identity of “someone who shows up” intact.

Balance Intensity And Rest

High-intensity habits are harder to repeat daily. If your habit is demanding, keep the target lower or introduce lighter sessions. A well-balanced plan avoids burnout and makes it easier to maintain consistency for multiple weeks.

Track Weekly Patterns

Review which days you tend to miss and adjust your schedule around those friction points. Moving a habit to a different time window can unlock consistency without changing the habit itself. Pattern awareness helps you plan ahead rather than react late in the week.

Celebrate Small Wins

Recognize progress even when the week is not perfect. Completing most sessions still means you are moving forward. Positive reinforcement makes it more likely that you will repeat the habit next week rather than abandoning it due to a minor miss.

Align With Goals

Connect each habit to a larger goal such as energy, productivity, or wellbeing. When the habit aligns with a visible goal, it becomes easier to stay motivated. This alignment also helps you prioritize which habits deserve your time.

Review Monthly Trends

Use the weeks tracked metric to reflect on longer-term performance. If several weeks show a pattern of missed sessions, adjust the habit design rather than blaming willpower. Long-term trends are the most honest feedback for habit success.

Build Consistency Systems

Over time, build simple systems that protect your habit: calendar blocks, reminders, and shared accountability. Systems reduce the need for constant motivation and make habits more durable across changing schedules.

`; return section; }; const buildKeywordsSection = () => { const section = document.createElement("section"); section.className = "mortgage-details-section"; section.innerHTML = `

Related Keywords

`; return section; }; const enhancePage = () => { const attempt = (count) => { const form = document.getElementById("compactCalcForm"); const toolbar = document.querySelector(".result-toolbar"); if (form) { const fieldsToShow = ["habit", "target", "completed", "streakDays", "weeksTracked"]; fieldsToShow.forEach((name) => { const field = form.querySelector(`[name="${name}"]`); const row = field?.closest(".mc-row"); if (row) row.classList.add("gh-force-visible"); }); } if (toolbar && !toolbar.dataset.ghPdfBound) { toolbar.dataset.ghPdfBound = "true"; document.addEventListener( "click", (event) => { const btn = event.target.closest('[data-action="pdf"]'); if (!btn) return; event.preventDefault(); event.stopPropagation(); event.stopImmediatePropagation(); buildPdf(); }, true ); } const main = document.querySelector("main"); if (main && !main.dataset.ghSections) { const hasHowTo = Array.from(main.querySelectorAll(".mortgage-details-section h2")).some( (heading) => heading.textContent.trim().toLowerCase() === "how to use this calculator" ); if (!hasHowTo) { main.appendChild(buildHowToSection()); } const hasGuide = Array.from(main.querySelectorAll(".mortgage-details-section h2")).some((heading) => heading.textContent.trim().toLowerCase().includes("guide") ); if (!hasGuide) { const howToSection = Array.from(main.querySelectorAll(".mortgage-details-section")).find((section) => section.querySelector("h2")?.textContent?.trim().toLowerCase().includes("how to use") ); const guideSection = buildGuideSection(); if (howToSection) { howToSection.insertAdjacentElement("afterend", guideSection); } else { main.appendChild(guideSection); } } const hasKeywords = Array.from(main.querySelectorAll(".mortgage-details-section h2")).some( (heading) => heading.textContent.trim().toLowerCase() === "related keywords" ); if (!hasKeywords) { const faqSection = main.querySelector(".mortgage-faq-section"); const keywordsSection = buildKeywordsSection(); if (faqSection) { faqSection.insertAdjacentElement("beforebegin", keywordsSection); } else { main.appendChild(keywordsSection); } } main.dataset.ghSections = "true"; } const faqList = document.querySelector(".mortgage-faq-list"); if (faqList && !faqList.dataset.ghFaqBound) { const extraFaqs = [ { q: "How many sessions should I plan weekly?", a: "Start with 3–5 sessions, then adjust once consistent." }, { q: "What if I miss a session?", a: "Log it and schedule a lighter recovery session soon." }, { q: "How do I keep a streak alive?", a: "Use a minimum version of the habit on busy days." }, { q: "Can I track more than one habit?", a: "Run the calculator separately for each habit." }, { q: "Should I raise the target quickly?", a: "Increase by one session at a time after two stable weeks." }, ]; const existingItems = Array.from(faqList.querySelectorAll(".mortgage-faq-item")); if (existingItems.length > 15) { existingItems.slice(15).forEach((item) => item.remove()); } const existingCount = Math.min(existingItems.length, 15); const needed = Math.max(0, 15 - existingCount); extraFaqs.slice(0, needed).forEach((item) => { const block = document.createElement("div"); block.className = "mortgage-faq-item"; block.innerHTML = `

${escapeHtml(item.q)}

${escapeHtml(item.a)}

`; faqList.appendChild(block); }); faqList.dataset.ghFaqBound = "true"; } if (count < 12 && (!main || !faqList || !toolbar || !form)) { window.requestAnimationFrame(() => attempt(count + 1)); } }; attempt(0); }; if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", enhancePage); } else { enhancePage(); } })();