← Demos
Web Pages · Demos

Keep the Family Home

Keep the Family Home is an interactive financial planning tool designed to help families evaluate options for inherited homes and farmland. Users can explore property values, ownership arrangements, buyouts, ongoing expenses, and long-term financial outcomes to make more informed decisions about keeping family property.

This tool is intended for educational purposes and does not constitute professional financial, legal, or tax advice.

by Clay Deardorff Nov 19, 2026 18 views 267.7 KB
Sandbox · keep-the-family-home · no access to your account
View source — the whole page is this one file
<!-- Copyright (c) 2026 Clay Deardorff. Released under the MIT License. -->
<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Keep the Family Home & Land</title>
<script>if(!matchMedia("(prefers-reduced-motion: reduce)").matches){document.documentElement.classList.add("launching");window.launchSafety=setTimeout(()=>document.documentElement.classList.remove("launching"),6500)}</script>
<style>
:root{--ink:#173d36;--muted:#61736c;--paper:#f6f5ef;--line:#d9dfd6;--gold:#bf8145}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.55 system-ui,sans-serif}header{padding:20px 5%;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}button{cursor:pointer;background:var(--ink);color:white;border:1px solid var(--ink);padding:10px 17px;border-radius:8px;font:inherit}button.secondary{background:transparent;color:var(--ink)}button:hover{filter:brightness(.9)}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--gold);outline-offset:3px}.brand{font-weight:750}main{max-width:1260px;margin:auto;padding:40px 28px}.eyebrow{text-transform:uppercase;letter-spacing:2px;font-size:12px;font-weight:750;color:#926135}h1{font:clamp(38px,5vw,64px)/1.06 Georgia,serif;max-width:750px;margin:15px 0}h2{font:28px/1.2 Georgia,serif;margin:0 0 18px}h3{margin:0 0 10px}.intro{max-width:740px;color:var(--muted);font-size:18px}.pill{font-size:12px;border:1px solid var(--line);border-radius:30px;padding:5px 10px;display:inline-block}.layout{display:grid;grid-template-columns:380px 1fr;gap:24px;margin-top:32px}.panel,.card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:24px}.panel{margin-bottom:18px}.fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}label{display:block;font-size:13px;font-weight:650}input,select{display:block;width:100%;margin-top:5px;border:1px solid #bac8c0;border-radius:6px;padding:10px;background:#fff;color:var(--ink);font:15px system-ui}small,.note{color:var(--muted);font-size:13px}.span{grid-column:1/-1}.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.card{padding:18px}.card.feature{background:var(--ink);color:white}.feature .note{color:#d2dfd7}.number{font:32px/1.2 Georgia,serif;margin:15px 0 5px}.subnumber{font-size:20px;font-weight:700}.rule{border-top:1px solid var(--line);margin:18px 0}.alert{padding:15px;border-radius:8px;background:#fff1dc;color:#704315;margin:16px 0}.good{background:#e9f2e9;color:#235a36}table{border-collapse:collapse;width:100%;font-size:14px}td,th{text-align:right;padding:12px 7px;border-bottom:1px solid var(--line)}td:first-child,th:first-child{text-align:left}.scroll{overflow:auto}.bar{height:9px;background:#e7e9e1;border-radius:9px;overflow:hidden}.bar i{display:block;height:100%;background:var(--gold)}details{margin-top:14px}summary{cursor:pointer;font-weight:650}footer{font-size:12px;color:var(--muted);margin:30px 0}#status{font-size:13px}#error{color:#9a301d;font-weight:650}ul{padding-left:20px} @media(max-width:1000px){.layout{grid-template-columns:1fr}.cards{grid-template-columns:repeat(3,1fr)}}@media(max-width:620px){main{padding:25px 16px}.cards{grid-template-columns:1fr}.fields{gap:10px}.panel{padding:18px}header{padding:15px}button{padding:8px 12px}}@media print{header button,.inputs, .actions{display:none}.layout{display:block}body{background:white}.panel,.card{break-inside:avoid}details{display:block}}

:root{--ink:#e3edf5;--muted:#a5b6c7;--paper:#08121f;--line:#2b3d50;--gold:#67d6c2}body{background:radial-gradient(ellipse at 85% 0%,#153047 0,transparent 45%),var(--paper)}header{background:#0b1726;position:sticky;top:0;z-index:2}button{background:#68d7c3;color:#071c22;border-color:#68d7c3;font-weight:700}button.secondary{color:#dce8f3;border-color:#42566a;background:#102035}.panel,.card{background:#102031;border-color:#2a3c50;box-shadow:0 12px 30px #02070f22}.card.feature{background:linear-gradient(140deg,#164e55,#112c42);border-color:#4da698}.eyebrow{color:#78d9c7}input,select,textarea{background:#091725;color:#e1edf7;border-color:#3a5067}textarea{width:100%;border-radius:8px;padding:12px;font:inherit;min-height:100px;margin-top:7px}.pill{color:#bad4e3;background:#142538}.alert{background:#342b1b;color:#f2cd8a}.good{background:#123b37;color:#9be3ce}.bar{background:#273c4f}.number{font-variant-numeric:tabular-nums}h1{max-width:850px}a{color:#8be4d2}.hero-grid{display:grid;grid-template-columns:1.4fr 1fr;gap:40px;align-items:center;padding:35px 0}.hero-house{border:1px solid #37566d;background:linear-gradient(140deg,#16394a,#101f33);padding:30px;border-radius:24px}.hero-house svg{width:100%;height:190px}.home-features{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin:30px 0}.home-features .panel{margin:0}.home-features p{font-size:14px;color:var(--muted)}.navlink{color:#c3d5e2;text-decoration:none;font-size:14px;margin-right:18px}.section-label{display:flex;justify-content:space-between;align-items:center;margin-top:50px;border-top:1px solid var(--line);padding-top:28px}.tagline{color:#86dcca;font-size:13px}.sheet{display:none}.gap-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.gap-item{background:#0b1828;border:1px solid var(--line);padding:16px;border-radius:10px}.gap-item strong{font-size:25px;display:block}.step{display:inline-block;background:#203e4b;color:#8ce4d0;border-radius:8px;padding:5px 10px;margin-bottom:12px}.feedback-panel{margin-top:24px}@media(max-width:700px){.hero-grid,.home-features,.gap-grid{grid-template-columns:1fr}.hero-house{display:none}header{position:static}.navlink{display:none}}@media print{body{background:white!important;color:#172b36!important}body>header,main>*:not(#familySheet){display:none!important}.sheet{display:block!important;color:#172b36;padding:10px}.sheet h1{font-size:30px}.sheet p,.sheet td,.sheet th{color:#172b36}.sheet .note{color:#465663}.sheet table{font-size:11px}.sheet td,.sheet th{border-color:#aaa}.sheet h2{font-size:22px}}
.field-help{display:block;font-weight:400;font-size:12px;line-height:1.5;margin-top:7px;color:#afc0cf}.fields{align-items:start}.fields>label{min-width:0}.quick-guide{border-left:3px solid #68d7c3;padding:12px 16px;background:#102b38;margin:15px 0 24px}.quick-guide p{margin:5px 0;font-size:14px}#planner,#family-notes{scroll-margin-top:105px}
:root{--ink:#f1f1ed;--paper:#080808;--muted:#aaa9a2;--line:#30312b;--gold:#c4ff38}body{background:radial-gradient(ellipse at 90% 5%,#252d1033,transparent 50%),#080808;color:var(--ink)}header{background:#0b0c0a;border-color:#2d3025}button{background:#c4ff38;border-color:#c4ff38;color:#111509;border-radius:8px}button.secondary{background:#171813;border-color:#3a3d31;color:#e4e7d8}button:hover{filter:brightness(1.12)}button:focus-visible,input:focus-visible,select:focus-visible{outline-color:#ff8c32}.panel,.card{background:#141510;border-color:#303229;box-shadow:none}.card.feature{background:linear-gradient(145deg,#242d12,#15180e);border-color:#8eaf32}input,select,textarea{background:#090a08;border-color:#45473c;color:#f1f1ed}.hero-house{background:linear-gradient(145deg,#222714,#11120e);border-color:#454c32}.hero-house svg path{stroke:#c4ff38}.hero-house svg circle{fill:#ff8c32}.eyebrow,.tagline,a{color:#c4ff38}.pill{background:#22251b;color:#d4d9c6;border-color:#414833}.step{background:#2e361e;color:#c4ff38}.quick-guide{border-color:#ff8c32;background:#211b13}.alert{background:#2e1015;border:1px solid #ff304c;color:#ffb5c0}.good{background:#222f12;color:#d0ff87}.bar{background:#313426}.bar i{background:#ff8c32}.gap-item{background:#0a0b08}.field-help{color:#b4b6aa}.number{font-family:system-ui;font-weight:650;font-size:32px;letter-spacing:-1px}h1,h2{font-family:system-ui;letter-spacing:-1.3px;font-weight:700}h1{font-size:clamp(40px,5.2vw,70px)}h2{font-size:27px}.hero-grid{min-height:460px}.home-features{margin-top:10px}.navlink{color:#d5d6cc}.wizardbar{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0 24px}.wizardbar button{flex:1;min-width:110px;background:#161711;color:#aaa;border-color:#34362c;font-size:13px;padding:13px 8px}.wizardbar button[aria-current="step"]{background:#c4ff38;color:#121609;border-color:#c4ff38}.wizard-page{animation:reveal .22s ease}.wizard-page .panel{max-width:100%;margin-bottom:18px}.wizard-page[data-step="0"],.wizard-page[data-step="1"],.wizard-page[data-step="2"]{max-width:840px;margin:auto}.wizard-page .fields{gap:20px 30px}.wizard-controls{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:25px 0}.step-caption{color:#ff8c32;font-size:12px;font-weight:750;text-transform:uppercase;letter-spacing:2px}.wizard-note{color:var(--muted);font-size:14px}.optiontabs{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.optiontabs button{background:#161711;color:#c2c5b5;border:1px solid #3c4030;font-size:14px}.optiontabs button[aria-selected="true"]{border-color:#ff8c32;color:#ffad6a;background:#2a1f12}.help-toggle{font-size:12px;color:#b8c69c;font-weight:500;margin:7px 0}.help-toggle summary{font-weight:500}.help-toggle .field-help{margin:8px 0;font-size:13px}.section-label{margin-top:10px;padding-top:10px;border:0}.card{transition:border-color .2s,transform .2s}.card:hover{border-color:#a1be53;transform:translateY(-2px)}#error{color:#ff6d83}.wizard-progress{height:3px;background:#26291c;border-radius:5px;margin-bottom:24px}.wizard-progress i{height:100%;display:block;background:#c4ff38;transition:width .25s}.summary-count{color:#ff9b4b}.layout{display:block}.inputs{display:contents}#status{color:#aaa}.panel h2{line-height:1.25}footer{border-top:1px solid var(--line);padding-top:18px} @keyframes reveal{from{opacity:.4;transform:translateY(6px)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}@media(max-width:620px){.wizardbar{gap:4px}.wizardbar button{min-width:55px;font-size:11px;padding:10px 4px}.wizard-page .fields{grid-template-columns:1fr}.cards{grid-template-columns:1fr}.wizard-controls{position:sticky;bottom:0;background:#0c0d09;padding:12px 0;border-top:1px solid #34362c}.hero-grid{min-height:0}h1{font-size:43px}}@media print{#familySheet{display:block!important}main>*:not(#familySheet){display:none!important}.sheet h1,.sheet h2{font-family:system-ui}}
.takeaway{background:#1d2512;border:1px solid #7fa628;border-left:4px solid #c4ff38;border-radius:12px;padding:20px 24px;margin:18px 0}.takeaway strong{font-size:21px;line-height:1.4}.takeaway p{color:#ccd2be;font-size:14px;margin:10px 0 0}.start-actions{display:flex;gap:10px;flex-wrap:wrap}@media(max-width:620px){header{padding:12px;gap:10px}.brand{font-size:13px}.brand .pill{display:none}header .actions{display:flex;gap:5px;flex-wrap:wrap}header button{font-size:12px;padding:8px 10px}.takeaway{padding:16px}.takeaway strong{font-size:18px}}@media print{@page{size:auto;margin:12mm}main{padding:0!important}.sheet{font-size:12px;line-height:1.4;padding:0}.sheet p{margin:9px 0}.sheet h1{font-size:26px;margin:12px 0}.sheet h2{font-size:19px;margin:14px 0 8px}.sheet td,.sheet th{padding:7px 5px}.sheet .note{font-size:10px}}
/* Property workspace: restrained surfaces, clear hierarchy, vivid state colors. */
body{background:radial-gradient(ellipse at 90% 0%,#30381722,transparent 42%),#080908}header{backdrop-filter:blur(18px);background:#0c0e0cf2}main{max-width:1280px}.hero-grid{gap:60px;padding:50px 0 25px}h1{font-size:clamp(42px,5.3vw,70px);letter-spacing:-3px}.sector-switch{display:inline-flex;padding:5px;background:#161a13;border:1px solid #3b4430;border-radius:14px;gap:5px;margin-top:18px}.sector-switch button{background:transparent;color:#b2baa5;border-color:transparent;padding:11px 24px}.sector-switch button[aria-pressed="true"]{background:#c4ff38;color:#151d08;box-shadow:0 4px 18px #c4ff3818}.panel{border-radius:18px}.hero-house{border-radius:28px;position:relative;overflow:hidden}.hero-house:after{content:'';position:absolute;width:220px;height:220px;right:-120px;top:-110px;border:1px solid #8eaa3433;border-radius:50%;box-shadow:0 0 0 35px #8eaa3410,0 0 0 75px #8eaa3408}.home-features .panel{background:linear-gradient(150deg,#171b13,#10120e)}.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;margin:20px 0}.metric{background:#141810;border:1px solid #343b29;border-radius:17px;padding:20px;min-width:0}.metric .label{font-size:12px;color:#b1b9a5}.metric strong{display:block;font-size:28px;letter-spacing:-1px;margin:12px 0 5px}.metric small{font-size:12px}.metric.highlight{background:linear-gradient(135deg,#2c3914,#171d10);border-color:#769b29}.farm-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.farm-fields{display:grid;grid-template-columns:1fr 1fr;gap:20px}.farm-fields label{min-width:0}.farm-fields .note{font-weight:400;display:block;margin-top:6px}.farmowner{border:1px solid #3d4432;border-radius:12px;padding:18px;margin:15px 0;background:#0d100b}.farm-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:22px 0}.farm-tabs button{background:#171b12;border-color:#414d2e;color:#bbc8a2}.farm-tabs button[aria-selected="true"]{background:#302414;color:#ffb579;border-color:#b07531}.farm-visual{height:10px;border-radius:10px;background:#2b3024;overflow:hidden;margin:15px 0}.farm-visual i{display:block;height:100%;background:linear-gradient(90deg,#c4ff38,#ff8d35)}.farm-step{animation:reveal .2s ease}.farm-kicker{color:#ff9b4b;font-size:12px;text-transform:uppercase;letter-spacing:2px}.farm-note{padding:16px 20px;border:1px solid #4e482e;border-radius:12px;background:#211d12;color:#d8c99d;font-size:13px}.farm-tools{display:flex;gap:8px;flex-wrap:wrap}.farm-tools button{font-size:13px}.mini-stat{display:inline-flex;align-items:center;gap:8px;border:1px solid #3e4a2c;border-radius:50px;padding:7px 12px;color:#d1e0b8;font-size:12px}.mini-stat:before{content:'';background:#c4ff38;width:6px;height:6px;border-radius:50%}#farmError{color:#ff8b9d;font-size:14px}#farmStatus{font-size:13px;color:#acb79b}.annual{color:#ffb175;font-weight:650}.result-intro{max-width:750px;color:#b5bda9}.farm-detail{margin:20px 0}.farm-step h2{margin-top:10px}.farm-help summary{font-size:12px;color:#c0d49e}.farm-help p{font-size:13px;color:#aebd9a}.lease-negative{color:#ff8a9b}.lease-positive{color:#c4ff38}@media(max-width:900px){.metric-grid{grid-template-columns:1fr 1fr}.farm-grid{grid-template-columns:1fr}.hero-grid{gap:25px}}@media(max-width:620px){h1{letter-spacing:-1.8px}.farm-fields{grid-template-columns:1fr}.metric{padding:15px}.metric strong{font-size:23px}.sector-switch{width:100%}.sector-switch button{flex:1;padding:10px}.brand{font-size:12px}.metric-grid{gap:8px}.hero-grid{padding:20px 0}.annual{font-size:12px}}

/* Refined royal blue, forest green, and burnt orange palette. */
:root{--ink:#edf1f5;--paper:#0c1115;--muted:#acb6bf;--line:#303d45;--gold:#c47b42}
body{background:radial-gradient(ellipse at 90% 0%,#183a2c25,transparent 45%),#0c1115;color:var(--ink)}
header{background:#0d141af2;border-color:#2b3840}.brand{color:#edf1f5}
button{background:#345cc5;border-color:#446ed5;color:#fff;box-shadow:none}button.secondary{background:#152029;border-color:#374851;color:#d3dce3}
button:hover{filter:brightness(1.12)}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline-color:#cc8145}
.panel,.card{background:#141e24;border-color:#2f4048}.card.feature{background:linear-gradient(145deg,#1c4231,#172c25);border-color:#3e7258}.card:hover{border-color:#53749a}
input,select,textarea{background:#0e171c;color:#e8edf2;border-color:#40515a}
a{color:#9db8ef}.eyebrow,.tagline{color:#9bb8d6}.pill{background:#1a2a25;border-color:#385343;color:#becfc3}
.hero-house{background:linear-gradient(145deg,#1d3a2d,#131e24);border-color:#3d5a48}.hero-house:after{border-color:#64947722;box-shadow:0 0 0 35px #56896a0c,0 0 0 75px #56896a08}
.hero-house svg path{stroke:#83a991}.hero-house svg circle{fill:#b96530;stroke:#b96530}
.home-features .panel{background:linear-gradient(150deg,#18252a,#131d22)}.step{background:#213d30;color:#a9cab3}.navlink{color:#b9c8d6}
.sector-switch{background:#131f25;border-color:#344650}.sector-switch button{background:transparent;color:#b8c5ce;border-color:transparent}.sector-switch button[aria-pressed="true"]{background:#345cc5;color:white;border-color:#446ed5;box-shadow:none}
.wizardbar button{background:#17232a;color:#acbac3;border-color:#33454e}.wizardbar button[aria-current="step"]{background:#345cc5;color:white;border-color:#446ed5}
.wizard-progress{background:#24333a}.wizard-progress i{background:#4771cf}.step-caption,.farm-kicker,.summary-count{color:#ce8b56}
.optiontabs button,.farm-tabs button{background:#17252c;color:#b8c7cd;border-color:#354c56}.optiontabs button[aria-selected="true"],.farm-tabs button[aria-selected="true"]{background:#234332;color:#d1e4d6;border-color:#53775e}
.takeaway{background:#193327;border-color:#365e47;border-left-color:#527d5e}.takeaway p{color:#bbcec1}
.gap-item{background:#111d24;border-color:#354750}.bar,.farm-visual{background:#29383d}.bar i{background:#b76733}.farm-visual i{background:linear-gradient(90deg,#37654c,#b76733)}
.metric{background:#152127;border-color:#31464f}.metric .label{color:#b6c4cc}.metric.highlight{background:linear-gradient(135deg,#234330,#182c24);border-color:#426c51}.metric small{color:#b5c4bd}
.mini-stat{border-color:#45644d;color:#bfd4c4}.mini-stat:before{background:#6a9778}.farmowner{background:#111e24;border-color:#344a53}
.field-help,.farm-help p{color:#b2c1ca}.help-toggle,.farm-help summary{color:#a8bdce}.annual{color:#d18a54}
.quick-guide{background:#302219;border-color:#b76733}.farm-note{background:#30251c;border-color:#705037;color:#dfbd9b}
.alert{background:#351e22;border-color:#9d4b55;color:#efb1ba}.good{background:#203d2a;color:#b6d9c0}.lease-positive{color:#9cc5a7}.lease-negative,#error,#farmError{color:#efa1ad}
@media(max-width:620px){.wizard-controls{background:#0d171d;border-color:#30444e}}

.property-story{padding:0;background:linear-gradient(150deg,#1b322a,#121e26 70%);border:1px solid #3b554a;box-shadow:0 24px 70px #0004;isolation:isolate}.property-story:after{display:none}.story-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px;border-bottom:1px solid #ffffff0c}.story-label{font-size:10px;color:#bdd0c6;text-transform:uppercase;letter-spacing:1.6px;display:flex;align-items:center;gap:9px}.story-label i{width:6px;height:6px;border-radius:50%;background:#83b39a;box-shadow:0 0 12px #83b39a55}.motion-button{background:#ffffff06!important;border:1px solid #ffffff16!important;color:#b1c0c9!important;font-size:10px;padding:6px 9px;white-space:nowrap;box-shadow:none}.property-scene{height:260px;position:relative;overflow:hidden;background:linear-gradient(180deg,#172b26aa,#14242b)}.property-story .property-scene svg{width:100%;height:100%;position:relative;z-index:1;overflow:visible;transition:opacity .25s}.scene-grid{position:absolute;inset:0;opacity:.16;background-image:linear-gradient(#9eb9ac25 1px,transparent 1px),linear-gradient(90deg,#9eb9ac25 1px,transparent 1px);background-size:28px 28px;transform:perspective(300px) rotateX(20deg) scale(1.2);mask-image:linear-gradient(transparent,#000 40%,transparent)}.scene-halo{position:absolute;width:230px;height:230px;left:calc(50% - 115px);top:10px;background:radial-gradient(circle,#4777b32b,transparent 70%);animation:storyBreathe 7s ease-in-out infinite}.scene-tag{position:absolute;left:22px;bottom:14px;font:9px/1.3 ui-monospace,monospace;letter-spacing:1px;color:#91ab9d;z-index:2}.scene-coordinate{position:absolute;top:16px;left:22px;font:8px/1.9 ui-monospace,monospace;letter-spacing:1px;color:#a6bcb0;z-index:2}.scene-coordinate span{color:#718b7f}.story-content{padding:24px}.story-index{color:#d39360;font:10px/1.3 ui-monospace,monospace;letter-spacing:1.5px}.story-content h3{font-size:25px;line-height:1.2;letter-spacing:-.8px;margin:10px 0}.story-content>p{color:#b1c2bf;font-size:14px;line-height:1.65;min-height:46px;margin:0 0 20px}.story-options{display:flex;gap:6px}.story-options button{flex:1;background:#0f1c22;border:1px solid #3b514d;color:#afc1bb;padding:10px 6px;font-size:11px;white-space:nowrap;transition:background .2s,border-color .2s,transform .2s}.story-options button:hover{transform:translateY(-2px)}.story-options button[aria-selected="true"]{background:#345cc5;border-color:#6387da;color:white}.story-preview{margin-top:16px;padding:12px 0 0;border-top:1px solid #ffffff12;display:flex;gap:12px;align-items:center;min-height:54px}.story-preview>span{color:#d49261;font-size:22px}.story-preview p{font-size:12px;line-height:1.5;margin:0;color:#a6bcb7}.property-story svg .art-line{stroke:#8bb19c;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;fill:none;stroke-dasharray:1;stroke-dashoffset:1;animation:storyDraw 2.2s ease forwards}.property-story svg .art-thin{stroke:#668c7b;stroke-width:1;fill:none;opacity:.5}.property-story svg .art-roof{stroke:#83a9e0!important}.property-story svg .art-fill{fill:#1b392f;stroke:#668c7b;stroke-width:1}.property-story svg .art-window{fill:#be743b33;stroke:#d1935d;stroke-width:1.4;animation:windowLight 6s ease-in-out infinite}.property-story svg .art-sun{fill:#b96b36!important;stroke:none!important;animation:storyBreathe 8s ease-in-out infinite;transform-origin:345px 65px}.property-story svg .art-field{stroke:#6b9981;stroke-width:1.4;stroke-linecap:round;fill:none;stroke-dasharray:1;stroke-dashoffset:1;animation:storyDraw 2.4s .3s ease forwards}.property-story svg .art-dot{fill:#a2bdae;animation:storyDot 4s ease-in-out infinite}.property-story[data-option="1"] .scene-halo{background:radial-gradient(circle,#cc84352b,transparent 70%)}.property-story[data-option="1"] svg .art-roof{stroke:#d39b70!important}.property-story[data-option="2"] .scene-halo{background:radial-gradient(circle,#4f7ddc33,transparent 70%)}.property-story.paused *{animation-play-state:paused!important}@keyframes storyDraw{to{stroke-dashoffset:0}}@keyframes storyBreathe{0%,100%{opacity:.65;transform:scale(.97)}50%{opacity:1;transform:scale(1.04)}}@keyframes windowLight{0%,100%{fill:#be743b25}50%{fill:#be743b66}}@keyframes storyDot{0%,100%{opacity:.4}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.property-story *{animation:none!important;transition:none!important}.property-story svg .art-line,.property-story svg .art-field{stroke-dashoffset:0}.motion-button{display:none}}@media(max-width:700px){.property-story{display:block}.hero-grid{gap:25px}.property-scene{height:220px}.story-top{padding:15px 18px}.story-content{padding:20px}.story-content h3{font-size:24px}.story-label{font-size:9px}.story-content>p{min-height:0}}@media print{.property-story{display:none!important}}

/* Blueprint illustration: aligned front elevations and regular parcel rows. */
.property-story{background:linear-gradient(145deg,#102c59,#0b1c36 72%);border-color:#315b8d;box-shadow:0 24px 65px #0005,0 0 0 1px #75a8ff08 inset}.story-top{background:#0a1b33;border-bottom:1px solid #7db1ff22}.story-label{color:#b2cdf3;font-size:9px;letter-spacing:1.3px}.story-label i{background:#729fe8;box-shadow:0 0 12px #4a82dc44}.property-scene{height:270px;background:linear-gradient(145deg,#11366a,#0d2953 65%,#0d2343);border-bottom:1px solid #7aafff24}.scene-grid{inset:0;opacity:1;background-image:linear-gradient(#9cc9ff18 1px,transparent 1px),linear-gradient(90deg,#9cc9ff18 1px,transparent 1px),linear-gradient(#9cc9ff0a 1px,transparent 1px),linear-gradient(90deg,#9cc9ff0a 1px,transparent 1px);background-size:60px 60px,60px 60px,12px 12px,12px 12px;transform:none;mask-image:none}.scene-halo{background:radial-gradient(circle,#5c93ed25,transparent 70%)}.property-story[data-option="1"] .scene-halo,.property-story[data-option="2"] .scene-halo{background:radial-gradient(circle,#568feb28,transparent 70%)}.scene-coordinate{top:13px;left:17px;color:#b2d0f7;font-size:7px}.scene-coordinate span{color:#7198ca}.scene-tag{left:17px;bottom:auto;top:15px;right:17px;text-align:right;font-size:7px;color:#93b8e8;letter-spacing:.7px}.property-story svg .art-line{stroke:#b3d6ff!important;stroke-width:1.7}.property-story svg .art-roof,.property-story[data-option="1"] svg .art-roof{stroke:#e0edff!important;stroke-width:2}.property-story svg .art-fill{fill:#183d6c55;stroke:#648dbc;stroke-width:1}.property-story svg .art-thin{stroke:#729fce!important;stroke-width:.65;opacity:.6;stroke-dasharray:4 3}.property-story svg .art-window{stroke:#a4c8fa!important;fill:#83b6fa14;animation:blueprintWindow 7s ease-in-out infinite}.property-story svg .art-field{stroke:#a8cbf8!important;stroke-width:1.3}.property-story svg .art-dot{fill:#c2ddff}.property-story svg .blueprint-dim{stroke:#a5c7f1!important;stroke-width:1;fill:none}.property-story svg .blueprint-note{font:6px ui-monospace,monospace;letter-spacing:1.5px;fill:#85a9d4;stroke:none}.story-content{background:linear-gradient(145deg,#102746,#0e2037)}.story-content>p,.story-preview p{color:#b1c5df}.story-index{color:#c48d5b}.story-options button{background:#0c1d33;border-color:#345a86;color:#b8cce4}.story-options button[aria-selected="true"]{background:#345cc5;border-color:#6a91e3;color:#fff}.story-preview{border-color:#80abeb20}.motion-button{border-color:#86afff26!important;background:#19345155!important;color:#bfd4ed!important}@keyframes blueprintWindow{0%,100%{fill:#83b6fa12}50%{fill:#83b6fa35}}@media(max-width:700px){.property-scene{height:245px}.story-label{font-size:8px;letter-spacing:.7px}.story-top{gap:8px}}@media(prefers-reduced-motion:reduce){.property-story svg .art-window{animation:none!important}}

/* A more expressive entrance, with the planner kept calm and task-focused. */
body{background:radial-gradient(ellipse at 70% 3%,#19396445,transparent 45%),#0c1115}.hero-grid{position:relative;gap:50px;grid-template-columns:1.3fr 1fr;padding:35px 0 45px}.hero-grid:before{content:'';position:absolute;inset:-40px -60px;pointer-events:none;z-index:-1;background-image:linear-gradient(#5589cc06 1px,transparent 1px),linear-gradient(90deg,#5589cc06 1px,transparent 1px);background-size:70px 70px;mask-image:radial-gradient(ellipse,#000,transparent 75%)}.hero-grid>div:first-child>h1{font-size:clamp(44px,5.2vw,68px);line-height:1.05;letter-spacing:-2.8px;max-width:720px;margin:25px 0}.headline-accent{background:linear-gradient(110deg,#f0f5ff 5%,#a0c2ff 40%,#6d9aff 65%,#d5e6ff 90%);background-size:220% auto;background-clip:text;-webkit-background-clip:text;color:transparent;animation:titleShimmer 12s ease-in-out infinite}.hero-badge{display:inline-flex;align-items:center;gap:9px;border:1px solid #5f84b337;background:#13263b66;padding:8px 12px;border-radius:40px;font-size:10px;color:#bad1f0;letter-spacing:1.5px}.hero-badge i{width:6px;height:6px;background:#84aef5;border-radius:50%;box-shadow:0 0 12px #629bfaaa}.intro{font-size:17px;max-width:560px;line-height:1.8}.hero-grid>div:first-child>*{animation:entranceUp .65s both}.hero-grid>div:first-child>h1{animation-delay:.08s}.hero-grid>div:first-child>.intro{animation-delay:.16s}.hero-grid>div:first-child>.sector-switch{animation-delay:.24s}.hero-grid>div:first-child>.start-actions{animation-delay:.32s}.hero-grid>div:first-child>.trust-row{animation-delay:.4s}.property-story{animation:entranceUp .85s .15s both;border-radius:22px;transition:box-shadow .3s,border-color .3s}.property-story:hover{border-color:#608ac4;box-shadow:0 26px 75px #0006,0 0 40px #2b60b212}.start-actions>button:first-child{position:relative;overflow:hidden;box-shadow:0 7px 24px #244fa52b;border-color:#648be0;background:linear-gradient(140deg,#426fd9,#2e51b5);padding:13px 20px;transition:transform .2s,box-shadow .2s}.start-actions>button:first-child:after{content:'';position:absolute;top:-50%;left:-90%;height:200%;width:45%;transform:rotate(25deg);background:linear-gradient(90deg,transparent,#ffffff20,transparent);animation:buttonGlint 9s 2s ease infinite;pointer-events:none}.start-actions>button:first-child:hover{transform:translateY(-2px);box-shadow:0 10px 30px #305fd044}.trust-row{display:flex;gap:14px;flex-wrap:wrap;margin-top:20px;color:#91a5bc;font-size:10px;letter-spacing:.2px}.trust-row span{white-space:nowrap}.preflight-link{display:block;margin-top:20px;padding:0;background:none!important;border:0!important;color:#97aabf;font-size:11px;font-weight:400;text-align:left}.preflight-link span{color:#b3c9ef;margin-left:5px}.preflight-link:hover{color:#e1edff}.sector-switch{transition:box-shadow .25s}.sector-switch:focus-within{box-shadow:0 0 0 3px #426bb52b}.sector-switch button{transition:background .25s,color .25s,box-shadow .25s}.sector-switch button[aria-pressed="true"]{background:linear-gradient(145deg,#466ed0,#3456b1);box-shadow:0 3px 10px #0003}.blueprint-scan{position:absolute;inset:0;z-index:2;pointer-events:none;background:linear-gradient(180deg,transparent 0%,#88b7ff06 45%,#9ac4ff28 50%,transparent 51%);transform:translateY(-110%);animation:blueprintScan 10s 2s ease-in-out infinite}.blueprint-orbit{position:absolute;width:180px;height:180px;border:1px solid #83b6ff0d;border-radius:50%;right:-90px;top:-90px;box-shadow:0 0 0 30px #7aabff05,0 0 0 60px #7aabff04;pointer-events:none}.scene-grid{animation:gridFade 1.2s both}.story-options button{transition:background .25s,transform .2s,border-color .2s}.story-content h3,.story-content>p,.story-preview p{animation:contentArrive .25s}.optiontabs button,.farm-tabs button,.wizardbar button{transition:background .2s,border-color .2s,color .2s,transform .2s}.wizardbar button:hover,.optiontabs button:hover,.farm-tabs button:hover{border-color:#7397cb;transform:translateY(-1px)}[role="tabpanel"]{animation:contentArrive .3s ease}.step-help{display:flex;gap:10px;align-items:flex-start;margin:12px 0 20px;padding:12px 15px;border:1px solid #3e628d44;border-radius:10px;background:#11263b66;color:#b7cce5;font-size:12px;line-height:1.6}.step-help b{color:#d2a57c;white-space:nowrap}.home-features .panel{position:relative;overflow:hidden;transition:border-color .3s,transform .3s}.home-features .panel:after{content:'';position:absolute;width:120px;height:120px;border-radius:50%;right:-80px;bottom:-80px;background:#4a7acd12;transition:transform .4s}.home-features .panel:hover{border-color:#486586;transform:translateY(-4px)}.home-features .panel:hover:after{transform:scale(2)}.reveal-panel{opacity:0;transform:translateY(18px);transition:opacity .65s,transform .65s}.reveal-panel.is-visible{opacity:1;transform:none}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,20px);opacity:0;pointer-events:none;z-index:20;border:1px solid #537c64;background:#182e24f5;border-radius:12px;padding:13px 20px;color:#d7ebdf;font-size:13px;box-shadow:0 12px 35px #0005;transition:opacity .2s,transform .2s;max-width:calc(100vw - 30px)}.toast.is-visible{opacity:1;transform:translate(-50%,0)}dialog.starter-dialog{background:#101f30;color:#e1eaf4;border:1px solid #3e5d80;border-radius:20px;max-width:620px;width:calc(100vw - 30px);padding:28px;box-shadow:0 30px 100px #0008}dialog.starter-dialog::backdrop{background:#020a14bb;backdrop-filter:blur(5px)}.starter-dialog h2{font-size:28px}.starter-dialog .dialog-close{float:right;background:#182c41;border-color:#3b536d;color:#cbd9e9;padding:5px 10px}.starter-dialog ul{line-height:1.9;color:#b8c9dd;font-size:14px}.starter-dialog .dialog-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}.starter-dialog .note{color:#a1b7d0}.motion-paused *,.motion-paused *:before,.motion-paused *:after{animation-play-state:paused!important}@keyframes entranceUp{from{opacity:0;transform:translateY(17px)}to{opacity:1;transform:none}}@keyframes titleShimmer{0%,100%{background-position:0% center}50%{background-position:100% center}}@keyframes buttonGlint{0%,70%,100%{left:-90%}88%{left:150%}}@keyframes blueprintScan{0%,15%{transform:translateY(-110%);opacity:0}20%{opacity:1}65%{transform:translateY(110%);opacity:.6}66%,100%{transform:translateY(110%);opacity:0}}@keyframes gridFade{from{opacity:0}to{opacity:1}}@keyframes contentArrive{from{opacity:.45;transform:translateY(5px)}to{opacity:1;transform:none}}@media(max-width:900px){.hero-grid{gap:25px;grid-template-columns:1.2fr 1fr}.hero-grid>div:first-child>h1{font-size:48px;letter-spacing:-2px}}@media(max-width:700px){.hero-grid{grid-template-columns:1fr;padding:20px 0}.hero-grid>div:first-child>h1{font-size:47px;letter-spacing:-2px;margin:22px 0}.intro{font-size:16px}.trust-row{font-size:10px;gap:10px}.preflight-link{margin-bottom:20px}.step-help{font-size:11px}.toast{bottom:90px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.reveal-panel{opacity:1;transform:none}.blueprint-scan{display:none}.hero-grid>div:first-child>*,.property-story{opacity:1;transform:none}}@media print{.toast,.starter-dialog,.step-help{display:none!important}}

/* Full-height introduction; planning controls and features begin below the fold. */
#home>.hero-grid{min-height:calc(100svh - 88px);padding:55px 0 95px;align-items:center;grid-template-columns:1.05fr 1.1fr;gap:45px}.intro-scroll{position:absolute;bottom:23px;left:0;right:0;display:flex;justify-content:center;align-items:center;gap:14px}.intro-scroll button{background:none;border:0;color:#b7ceee;font:10px ui-monospace,monospace;text-transform:uppercase;letter-spacing:2px;display:flex;align-items:center;gap:14px}.intro-scroll i{display:block;width:24px;height:36px;border:1px solid #6686ad;border-radius:15px;position:relative}.intro-scroll i:after{content:'';position:absolute;width:3px;height:7px;background:#a7c9f5;border-radius:4px;left:9px;top:7px;animation:scrollNudge 2.4s ease-in-out infinite}.intro-actions{margin-top:26px;display:flex;align-items:center;gap:18px}.intro-actions button{padding:13px 20px;border-color:#688de1;background:linear-gradient(145deg,#426cd1,#2f51b3)}.intro-actions span{font-size:11px;color:#90a8c6}.hero-grid .property-story{border-radius:24px;transform:none}.hero-grid .property-scene{height:430px;background:radial-gradient(ellipse at center,#1b488b55,transparent 70%),linear-gradient(150deg,#0e2b53,#091c38)}.story-top{min-height:56px}#wireModel{display:none;width:100%;height:100%;position:relative;z-index:1;cursor:grab;touch-action:pan-y}#wireModel.ready{display:block}#wireModel.is-dragging{cursor:grabbing;touch-action:none}.wire-controls{position:absolute;bottom:15px;left:20px;right:20px;display:flex;justify-content:center;align-items:center;gap:12px;z-index:4}.wire-controls button{font-size:10px;padding:5px 9px;background:#17345699;border-color:#577eac44;color:#bdd4ef}.wire-controls span{font:8px ui-monospace,monospace;color:#83a7d4;letter-spacing:1px}.scene-tag{font-size:7px}.blueprint-scan{z-index:2;pointer-events:none}.launch-section{border-top:1px solid #344e6c;padding:65px 0 30px;scroll-margin-top:105px}.launch-title{font-size:36px;letter-spacing:-1.2px;margin:12px 0}.launch-grid{display:grid;grid-template-columns:1fr 1fr;gap:25px;align-items:start;margin-top:30px}.launch-controls{background:linear-gradient(150deg,#152839,#101f2b);border:1px solid #344e60;padding:28px;border-radius:18px}.launch-controls .sector-switch{margin-top:0}.launch-controls .start-actions{margin-top:20px}.launch-controls .start-actions button{flex:1}.launch-story{border:1px solid #344b68;border-radius:18px;overflow:hidden}.launch-story .story-content{padding:28px}.launch-story .story-content>p{min-height:45px}.intro-identifier{display:flex;align-items:center;gap:9px;font:10px ui-monospace,monospace;color:#90b0d6;margin-top:25px;letter-spacing:1px}.intro-identifier:before{content:'';width:24px;height:1px;background:#c08755}.hero-grid>div:first-child>h1{font-size:clamp(46px,5vw,68px)}.tab-motion{animation:tabFlow .25s ease-out}.wizard-page,.farm-step{animation:none}.wizardbar button[aria-current="step"]{box-shadow:0 4px 18px #3a68ca25}.wizard-progress i{transition:width .45s cubic-bezier(.2,.7,.2,1)}details[open]>:not(summary){animation:detailsFlow .25s ease-out}.metric,.card{transition:transform .2s,border-color .2s,box-shadow .2s}.metric:hover{transform:translateY(-3px);border-color:#547cab;box-shadow:0 7px 20px #0002}.home-features{padding:25px 0 35px}.home-features .panel{min-height:190px}@keyframes scrollNudge{0%,100%{transform:translateY(0);opacity:.5}55%{transform:translateY(11px);opacity:1}}@keyframes tabFlow{from{opacity:.3;transform:translateY(8px)}to{opacity:1;transform:none}}@keyframes detailsFlow{from{opacity:.2;transform:translateY(-3px)}to{opacity:1;transform:none}}@media(max-width:1000px){#home>.hero-grid{gap:24px}.hero-grid .property-scene{height:350px}.hero-grid>div:first-child>h1{font-size:52px;letter-spacing:-2px}.intro-actions span{display:none}}@media(max-width:700px){#home>.hero-grid{grid-template-columns:1fr;min-height:calc(100svh - 110px);padding:30px 0 80px;gap:26px}.hero-grid>div:first-child>h1{font-size:43px;margin:18px 0}.hero-grid .intro{font-size:15px;line-height:1.6}.hero-grid .property-scene{height:270px}.hero-grid .property-story{margin-bottom:15px}.intro-identifier{display:none}.intro-actions{margin-top:18px}.intro-actions button{padding:11px 16px}.launch-section{padding-top:40px}.launch-title{font-size:29px}.launch-grid{grid-template-columns:1fr}.launch-controls,.launch-story .story-content{padding:22px}.wire-controls span{font-size:7px}.intro-scroll{bottom:13px}.home-features .panel{min-height:0}}@media(prefers-reduced-motion:reduce){.intro-scroll i:after{animation:none}.wizard-progress i{transition:none}details[open]>:not(summary){animation:none}}@media print{.intro-scroll,.launch-section{display:none!important}}
.global-motion{font-size:11px;padding:8px 10px!important;color:#9cb3cf!important;background:transparent!important;border-color:#40566a!important}@media(max-width:620px){.global-motion{font-size:10px!important;padding:7px!important}}@media(prefers-reduced-motion:reduce){.global-motion{display:none}}.motion-paused *,.motion-paused *:before,.motion-paused *:after{animation:none!important}.motion-paused .art-line,.motion-paused .art-field{stroke-dashoffset:0!important}.motion-paused .reveal-panel{opacity:1!important;transform:none!important}.hero-grid>div:first-child>.sector-switch{margin-top:18px;animation-delay:.22s}.hero-grid>div:first-child>#sectorDescription{max-width:470px;font-size:11px;line-height:1.6;min-height:35px;margin:10px 0 0}.hero-grid .intro-actions{margin-top:18px}.launch-controls h3{font-size:23px;margin:0 0 16px}.hero-grid>div:first-child>h1{font-size:clamp(43px,4.8vw,64px)}@media(max-width:700px){.hero-grid>div:first-child>h1{font-size:42px}.hero-grid>div:first-child>.sector-switch{max-width:350px}.hero-grid>div:first-child>#sectorDescription{font-size:10px}}
/* Phone layout is designed separately from the desktop composition. */
.mobile-tools{display:none}
@media screen and (max-width:700px){
html,body{max-width:100%;overflow-x:clip}body{font-size:15px}header{position:sticky;top:0;z-index:12;padding:11px 15px;min-height:59px;display:flex;flex-wrap:nowrap;gap:10px;background:#0d1722f5}.brand{font-size:12px;line-height:1.3;letter-spacing:-.2px;white-space:normal;min-width:0}.brand .pill{display:none}.mobile-tools{display:block;margin:0;flex:0 0 auto}.mobile-tools>summary{list-style:none;cursor:pointer;background:#182c42;color:#dce7f7;border:1px solid #405975;border-radius:9px;padding:10px 13px;font-size:12px}.mobile-tools>summary::-webkit-details-marker{display:none}.mobile-tools .actions{position:absolute;right:12px;top:calc(100% + 6px);width:min(300px,calc(100vw - 24px));padding:12px;background:#102033;border:1px solid #3d5978;border-radius:13px;box-shadow:0 18px 45px #0008;display:grid;grid-template-columns:1fr 1fr;gap:8px}.mobile-tools .actions button{width:100%;min-height:44px;margin:0;font-size:13px!important}.mobile-tools .global-motion{grid-column:1/-1;font-size:12px!important}.mobile-tools[open]>summary{border-color:#7a9dd8}.mobile-tools .actions input[hidden]{display:none!important}
main{padding:12px 16px 25px;width:100%;min-width:0}main>*{min-width:0}#home>.hero-grid{display:flex;flex-direction:column;align-items:stretch;gap:13px;min-height:0;padding:14px 0 20px;margin:0;width:100%}#home>.hero-grid:before{inset:0;background-size:40px 40px}#home>.hero-grid>div:first-child{display:contents}#home>.hero-grid .hero-badge{order:0;align-self:flex-start;padding:6px 10px;font-size:8px;letter-spacing:1px;margin:0;animation:none}#home>.hero-grid h1{order:1;font-size:clamp(32px,8.7vw,39px)!important;line-height:1.08;letter-spacing:-1.4px!important;margin:0!important;width:100%;animation:none}#home>.hero-grid .intro{order:2;font-size:14px;line-height:1.6;margin:0;max-width:100%;animation:none}#home>.hero-grid .sector-switch{order:3;display:flex;width:100%;max-width:none;margin:0;padding:4px;animation:none}.hero-grid .sector-switch button{min-height:43px;font-size:14px;padding:9px 14px;flex:1}#home>.hero-grid #sectorDescription{order:4;min-height:0;margin:-5px 0 0;font-size:10px;line-height:1.5;width:100%;animation:none}#home>.hero-grid .property-story{order:5;margin:0;width:100%;border-radius:15px;min-width:0;animation:none}#home>.hero-grid .property-scene{height:215px}#home>.hero-grid .story-top{padding:10px 12px;min-height:37px;gap:7px}.story-label{font-size:7px;letter-spacing:.4px;line-height:1.5}.motion-button{font-size:9px;padding:6px 7px}.scene-coordinate{font-size:6px;left:10px;top:10px;letter-spacing:.5px}.scene-tag{font-size:6px;right:10px;top:11px;letter-spacing:0}.wire-controls{bottom:9px;left:10px;right:10px;gap:9px}.wire-controls button{min-height:31px;font-size:9px;padding:6px 8px}.wire-controls span{font-size:7px}#home>.hero-grid .intro-actions{order:6;display:flex;margin:0;width:100%;animation:none}.intro-actions button{width:100%;font-size:14px;min-height:46px;padding:12px}.intro-actions span,.intro-identifier{display:none!important}#home>.hero-grid .intro-scroll{order:7;position:static;inset:auto;display:flex;width:100%;margin:0;height:25px}.intro-scroll button{font-size:8px;letter-spacing:1px;padding:0}.intro-scroll i{display:none}
.launch-section{padding:29px 0 10px;scroll-margin-top:75px;width:100%}.launch-title{font-size:27px}.launch-grid{display:flex;flex-direction:column;gap:16px;margin-top:18px;min-width:0}.launch-controls,.launch-story{width:100%;min-width:0}.launch-controls,.launch-story .story-content{padding:19px}.launch-controls h3{font-size:21px}.launch-controls .start-actions{flex-direction:column}.launch-controls .start-actions button{width:100%;min-height:46px;font-size:14px}.trust-row{font-size:10px;gap:8px 12px;line-height:1.6}.preflight-link{font-size:12px;line-height:1.7}.story-options{gap:5px}.story-options button{min-width:0;white-space:normal;font-size:10px;line-height:1.4;min-height:43px;padding:8px 4px}.story-content h3{font-size:22px}.story-content>p{font-size:13px}.home-features{grid-template-columns:1fr;gap:12px;padding:18px 0}.home-features .panel{min-height:0;margin:0;padding:18px}.home-features .step{margin-bottom:8px}
.section-label{margin-top:9px;padding-top:0;display:block}.section-label h2{font-size:25px;line-height:1.2}.wizardbar{display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;max-width:100%;padding:3px 0 9px;margin:15px 0 8px;scrollbar-width:thin;scrollbar-color:#476b9b transparent;overscroll-behavior-x:contain}.wizardbar button{flex:0 0 auto;min-width:100px;max-width:none;white-space:nowrap;font-size:12px;padding:11px 14px;min-height:44px}.wizard-progress{margin-bottom:14px}.step-help{padding:10px 12px;display:block;font-size:12px;margin:10px 0 17px}.step-help b{display:block;margin-bottom:3px}.wizard-page,.farm-step{max-width:100%;min-width:0}.wizard-page .panel,.farm-step .panel,.farm-step details.panel{padding:17px;margin-bottom:15px;border-radius:13px}.wizard-page .fields,.farm-fields,.fields{grid-template-columns:minmax(0,1fr);gap:18px}.fields>div,.farm-fields>div{min-width:0}label{font-size:13px;line-height:1.5}input,select,textarea{font-size:16px!important;width:100%;min-width:0;min-height:45px;padding:11px;border-radius:8px}textarea{min-height:110px}h2{font-size:24px}h3{font-size:19px}.note{font-size:12px;line-height:1.7}.farm-note{padding:12px 14px;font-size:12px;line-height:1.65}.farmowner{padding:13px}.help-toggle summary,.farm-help summary{padding:5px 0;font-size:12px}.cost-group>summary{line-height:1.6;padding:6px 0;font-size:14px}.cost-group>summary .note{display:block}.wizard-controls{position:sticky;bottom:0;z-index:5;padding:11px 0;margin:18px 0 0;background:#0c1720f5;border-top:1px solid #35506a;gap:10px}.wizard-controls button{min-height:46px;font-size:13px;padding:10px 14px;max-width:65%}.optiontabs,.farm-tabs{flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding-bottom:8px;gap:6px}.optiontabs button,.farm-tabs button{flex:0 0 auto;min-height:43px;white-space:nowrap;font-size:12px;padding:10px 13px}.cards{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}.card{padding:17px}.card .number{font-size:30px;margin:10px 0 4px}.card .rule{margin:12px 0}.card .note{margin:7px 0;font-size:12px}.card .eyebrow{font-size:10px;letter-spacing:1.4px}.subnumber{font-size:19px}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.metric{padding:13px;min-width:0}.metric strong{font-size:clamp(18px,5.1vw,24px);overflow-wrap:anywhere;letter-spacing:-.6px}.metric .label,.metric small{font-size:10px;line-height:1.5}.farm-grid,.gap-grid{grid-template-columns:minmax(0,1fr);gap:10px}.takeaway{padding:16px}.takeaway strong{font-size:18px;line-height:1.5}.takeaway p{font-size:12px;line-height:1.7}.number{overflow-wrap:anywhere}.alert{font-size:12px;line-height:1.7;padding:12px}.farm-tools{flex-direction:column}.farm-tools button{min-height:44px;width:100%;font-size:13px}
/* Wide comparisons become labelled owner cards, rather than tiny scrolling columns. */
.scroll:has(.responsive-table){overflow:visible}.responsive-table{display:block;width:100%;font-size:14px}.responsive-table thead{display:none}.responsive-table tbody{display:block}.responsive-table tr:has(th){display:none}.responsive-table tr:not(:has(th)){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 12px;border:1px solid #385069;border-radius:12px;padding:14px;margin:12px 0;background:#101f2c}.responsive-table td{display:block;text-align:left!important;border:0;padding:0;overflow-wrap:anywhere;min-width:0;line-height:1.5;color:#e4edf7}.responsive-table td:before{content:attr(data-label);display:block;font-size:10px;color:#9db4cb;line-height:1.5;margin-bottom:3px}.responsive-table td:first-child{grid-column:1/-1;font-size:16px;font-weight:700;padding-bottom:9px;border-bottom:1px solid #30465d}.responsive-table td:first-child:before{display:none}.toast{bottom:78px;font-size:12px;width:calc(100% - 30px);text-align:center}dialog.starter-dialog{padding:20px;max-height:85svh;overflow-y:auto}.starter-dialog h2{font-size:25px}.starter-dialog ul{font-size:13px;padding-left:19px}.starter-dialog .dialog-actions{flex-direction:column}.starter-dialog .dialog-actions button{width:100%;min-height:44px}footer{font-size:10px;line-height:1.7;overflow-wrap:anywhere;margin-top:22px}
}
@media screen and (max-width:350px){header{padding:10px 12px}.brand{font-size:11px}.mobile-tools>summary{font-size:11px;padding:9px 10px}main{padding:10px 12px 20px}#home>.hero-grid h1{font-size:31px!important}.hero-badge{font-size:7px!important}.story-label{font-size:6px}.scene-coordinate{font-size:5px}.scene-tag{font-size:5px}.wire-controls{gap:6px}.wire-controls span{display:none}.responsive-table tr:not(:has(th)){grid-template-columns:minmax(0,1fr)}}
@media print{.mobile-tools{display:none!important}}
.preview-help{display:none}.preview-mode .preview-help{display:block;max-width:1200px;margin:15px auto 0;padding:13px 18px;background:#192b40;border:1px solid #3d5d81;border-radius:10px;color:#bdd0e8;font-size:12px;line-height:1.7}.preview-mode header .actions,.preview-mode .wire-controls,.preview-mode .layout,.preview-mode #planner,.preview-mode #status,.preview-mode #error{display:none!important}.property-scene #wireModel.ready{position:absolute;inset:0;width:100%;height:100%}.preview-mode #propertyArt{display:block!important}.preview-mode .property-story .art-line,.preview-mode .property-story .art-field{stroke-dashoffset:0!important}@media(max-width:700px){.preview-mode .preview-help{margin:10px 14px 0;font-size:11px}.preview-mode header{min-height:50px}}@media print{.preview-help{display:none!important}}.property-story svg .static-wire path{stroke:#a9cdf5}.property-story svg .static-wire path[stroke="#c69768"]{stroke:#c69768}.preview-mode *,.preview-mode *:before,.preview-mode *:after{animation:none!important}.preview-mode .reveal-panel{opacity:1!important;transform:none!important}.preview-mode .property-story{opacity:1!important;transform:none!important}</style>
<style id="accessibility-navigation-fixes">
/* Accessible introductory guide: high contrast in both light and dark browsers. */
.guidance-banner{background:#172b3c!important;border:1px solid #587b9d!important;color:#f5f8ff!important;box-shadow:0 8px 28px #0002}
.guidance-banner h3{color:#ffffff!important;font-size:clamp(21px,2vw,26px)!important;font-weight:750!important;line-height:1.3!important;letter-spacing:0!important;margin-bottom:12px!important}
.guidance-banner p{color:#e0eaf4!important;font-size:15px!important;line-height:1.75!important;max-width:950px}
.guidance-steps{gap:12px!important;margin-top:17px!important}
.guidance-steps span{background:#233f56!important;border:1px solid #6689a7!important;color:#ffffff!important;font-size:13px!important;font-weight:600!important;line-height:1.5!important;padding:11px 15px!important;border-radius:10px!important}
@media(max-width:700px){.guidance-banner{padding:20px!important}.guidance-steps span{width:100%}}
</style>
<style>
html.launching body>header,html.launching main{opacity:0;pointer-events:none}
.launch-screen{position:fixed;inset:0;z-index:1000;background:#0c1115;pointer-events:none}
.launch-copy{position:fixed;z-index:1002;margin:0;font-family:inherit;font-weight:700;line-height:1.04;letter-spacing:-.045em;color:#edf3ff;transform-origin:top left;pointer-events:none}
.launch-copy .launch-line{display:block;overflow:hidden;padding-bottom:.1em}
.launch-copy .launch-word{display:block}.launch-copy .launch-accent{color:#a0c2ff}
.launch-skip{position:fixed;z-index:1003;bottom:24px;right:24px;background:transparent;border:1px solid #47668b;border-radius:30px;color:#bed1e9;padding:9px 16px;font:12px system-ui;cursor:pointer}
html.launch-reveal body>header{animation:launchFade .8s .4s both}
html.launch-reveal .hero-grid>div:first-child{animation:launchTextIn 1.1s .1s cubic-bezier(.16,1,.3,1) both}
html.launch-reveal .property-story{animation:launchDiagramIn 1.3s .1s cubic-bezier(.16,1,.3,1) both}
html.launch-reveal .hero-grid>div:first-child>*{animation:none}
/* Keep the original entrance effects from restarting after the launch transition. */
html.launch-complete .hero-grid>div:first-child>*,html.launch-complete .property-story{animation:none}
html.launch-reveal .launch-section,html.launch-reveal .home-features,html.launch-reveal .intro-scroll{animation:launchFade 1s .55s both}
@keyframes launchFade{from{opacity:0}to{opacity:1}}
@keyframes launchTextIn{from{opacity:0;transform:translateX(-70px)}to{opacity:1;transform:none}}
@keyframes launchDiagramIn{from{opacity:0;transform:translateX(160px) scale(.9)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){html.launching body>header,html.launching main{opacity:1;pointer-events:auto}.launch-screen,.launch-copy,.launch-skip{display:none}}
</style>
<style>
/* Warm copper accents for the three introductory feature cards. */
.home-features .panel{background:linear-gradient(150deg,#30231b,#191b1d);border-color:#805438}
.home-features .panel h3{color:#e7b48c}
.home-features .panel p{color:#c7b8ae}
.home-features .step{background:#50321f;color:#edb07c;border:1px solid #91603d}
.home-features .panel:after{background:#ce8b5624}
.home-features .panel:hover{border-color:#ce8b56;box-shadow:0 12px 30px #0003,0 0 22px #ce8b5610}
</style>
<style>
a.feature-link{display:block;text-decoration:none;color:inherit;cursor:pointer}
a.feature-link:focus-visible{outline:3px solid #edb07c;outline-offset:5px}
.feature-link .feature-more{display:block;margin-top:20px;color:#edb07c;font-size:12px;font-weight:650;letter-spacing:.4px}
.feature-detail{max-width:1080px;margin:35px auto 80px;animation:contentArrive .4s ease}
.feature-back{display:inline-block;color:#dfad85;text-decoration:none;margin-bottom:35px;font-size:14px}
.feature-detail h1{font-size:clamp(36px,5vw,62px);line-height:1.08;letter-spacing:-2px;max-width:850px;margin:20px 0}
.feature-detail .detail-intro{color:#b9c9d9;font-size:18px;line-height:1.8;max-width:790px}
.feature-detail .detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:35px 0}
.feature-detail article{padding:26px;border:1px solid #624631;border-radius:16px;background:linear-gradient(145deg,#2c221b,#14202b)}
.feature-detail h2{font-size:21px;color:#e6b18a;margin:0 0 12px}
.feature-detail p,.feature-detail li{color:#bdc8d2;font-size:15px;line-height:1.85}
.feature-detail ul,.feature-detail ol{padding-left:22px}
.feature-detail .detail-example{border-left:3px solid #ce8b56;padding:18px 24px;background:#ce8b560c;border-radius:0 12px 12px 0}
.detail-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:28px}.detail-actions button{background:#714625;border-color:#bb8050;color:#fff0e2}
@media(max-width:700px){.feature-detail{margin-top:20px}.feature-detail .detail-grid{grid-template-columns:1fr;gap:14px}.feature-detail article{padding:20px}.feature-detail .detail-intro{font-size:16px}}
</style><style>
.goal-panel{border-color:#745039;background:linear-gradient(140deg,#2c211a,#142332)}
.goal-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:18px 0}
.goal-options button{background:#152332;border:1px solid #3e5267;color:#cbd8e5;padding:16px 12px;text-align:left;border-radius:12px;line-height:1.5}
.goal-options button[aria-pressed="true"]{border-color:#ce8b56;background:#4a3020;color:#ffe2c9;box-shadow:inset 0 0 0 1px #ce8b56}
.goal-options small{display:block;font-weight:400;color:#b9c3ca;margin-top:5px}
.goal-status,.estimate-notice{padding:13px 16px;border:1px solid #775238;border-radius:10px;background:#332419;color:#e9c6a9;line-height:1.7;font-size:13px}
.unknown-control{display:flex;gap:9px;align-items:center;font-size:12px;color:#d5b69e;margin:8px 0 15px;cursor:pointer}
.unknown-control input{width:17px!important;height:17px;min-height:17px;flex:0 0 17px;margin:0;padding:0}
input.estimate-unknown{border-color:#a67545;background:#2b241e}
.cost-breakdown{margin:20px 0}.cost-breakdown table{width:100%}.cost-breakdown td:last-child,.cost-breakdown th:last-child{text-align:right}
.readiness-row{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap;justify-content:space-between;margin-bottom:18px}.readiness-row strong{color:#edb98e}
.owner-budget{border-top:1px solid #3b4b58;padding:15px 0}.owner-budget:first-of-type{border-top:0}.owner-budget strong{color:#d8e8f7}.budget-good{color:#a9cab3}.budget-short{color:#efb19d}
.next-checks{line-height:1.9;color:#c6d1db}.summary-title{font-size:25px!important}.summary-goal{color:#d5a77f;font-size:13px}.test-tasks li{margin:9px 0}.test-tasks label{display:flex;align-items:flex-start;gap:10px}.test-tasks input{width:18px;min-height:18px;flex:0 0 18px;margin-top:4px}.testing-feedback{min-height:130px}
@media(max-width:700px){.goal-options{grid-template-columns:1fr}.goal-options button{padding:13px}.readiness-row{display:block}.cost-breakdown td{font-size:12px}}
@media print{.unknown-control,.goal-options,.guided-test{display:none!important}}
</style><style>@media print{#familySheet h1,#familySheet h2,#familySheet h3{break-after:avoid}#familySheet .owner-budget{break-inside:avoid}#familySheet .owner-budget strong,#familySheet .readiness-row strong{color:#17313d}#familySheet table{break-inside:auto}#familySheet tr{break-inside:avoid}#familySheet .scroll{overflow:visible}}</style><style>
.feature-orbit{margin:30px 0}.orbit-stage{position:relative}.orbit-heading{max-width:650px;margin:0 auto 25px;text-align:center}.orbit-heading h2{font-size:clamp(28px,3.5vw,44px);line-height:1.12;margin:14px 0}.orbit-heading p{color:#a5b6c7;font-size:14px}
.feature-orbit.is-orbiting{height:240svh;min-height:1500px;position:relative}
.is-orbiting .orbit-stage{position:sticky;top:90px;height:calc(100svh - 110px);min-height:600px;max-height:850px;isolation:isolate}
.is-orbiting .orbit-heading{position:absolute;top:20px;left:50%;transform:translateX(-50%);width:90%;z-index:5;pointer-events:none}
.orbit-ring,.orbit-position{display:none}.is-orbiting .orbit-ring{display:block;position:absolute;left:50%;top:57%;width:76%;height:240px;border:1px solid #ce8b5630;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;box-shadow:0 0 70px #7b9fd508,inset 0 0 50px #ce8b5605}
.is-orbiting .orbit-ring:after{content:'';position:absolute;inset:22px -25px;border:1px dashed #7d9cc221;border-radius:50%}
.is-orbiting .home-features{display:block;position:absolute;inset:0;margin:0;padding:0;perspective:1200px}
.is-orbiting .home-features .feature-link{position:absolute;left:50%;top:57%;width:330px;min-height:260px;margin:0;padding:24px;transform-origin:center;will-change:transform,opacity;transition:border-color .2s,box-shadow .2s;transition-delay:0s!important;background:linear-gradient(145deg,#38291e,#15202a);backface-visibility:hidden}
.is-orbiting .home-features .feature-link:hover{border-color:#e1a979;box-shadow:0 20px 55px #0007}
.is-orbiting .orbit-position{display:flex;position:absolute;bottom:20px;left:0;right:0;align-items:center;justify-content:center;gap:12px;z-index:6}
.orbit-position button{width:40px;height:40px;padding:0;border-radius:50%;background:#152332;border:1px solid #775238;color:#c9a487;font-size:12px}
.orbit-position button[aria-current="step"]{background:#704729;color:#ffe7d3;border-color:#dfa36f;box-shadow:0 0 22px #ce8b5620}
@media(max-width:700px){.feature-orbit.is-orbiting{height:235svh;min-height:1400px}.is-orbiting .orbit-stage{top:76px;height:calc(100svh - 90px);min-height:540px;max-height:850px}.is-orbiting .orbit-heading{top:18px}.orbit-heading p{font-size:12px}.is-orbiting .home-features .feature-link{width:244px;min-height:260px;padding:20px}.is-orbiting .home-features h3{font-size:19px}.is-orbiting .home-features p{font-size:13px}.is-orbiting .orbit-ring{width:88%;height:220px}.is-orbiting .orbit-position{bottom:15px}}
@media print{.feature-orbit.is-orbiting{height:auto;min-height:0}.is-orbiting .orbit-stage{position:static;height:auto;min-height:0}.orbit-ring,.orbit-position{display:none!important}}
</style><style>
/* A level carousel: blue card edges, warm copper content. */
.home-features .panel{border-color:#638fca}
.home-features .panel:hover{border-color:#a4c7ff;box-shadow:0 12px 35px #0004,0 0 24px #6c9fe52b}
a.feature-link:focus-visible{outline-color:#a4c7ff}
.is-orbiting .home-features .feature-link{border:1px solid #709edb;top:58%;background:linear-gradient(145deg,#29241f,#15202a);box-shadow:0 28px 55px #0006,0 0 0 1px #719dd916}
.is-orbiting .home-features .feature-link:hover{border-color:#b0d0ff;box-shadow:0 28px 55px #0007,0 0 30px #6398df25}
.is-orbiting .orbit-ring{top:calc(58% + 180px);height:80px;width:88%;border:0;border-top:1px solid #638fca40;border-radius:50%;background:radial-gradient(ellipse,#719ed51a,transparent 70%);box-shadow:none}
.is-orbiting .orbit-ring:after{inset:14px 30px;border:1px solid #638fca15;transform:scaleY(.5)}
@media(max-width:700px){.is-orbiting .orbit-ring{top:calc(58% + 165px);height:65px;width:100%}}
</style><style>
/* A clockwise wheel viewed head-on; cards remain parallel to the screen. */
.is-orbiting .home-features .feature-link{top:53%}
.is-orbiting .orbit-ring{top:53%;width:480px;height:480px;border:1px solid #638fca38;border-radius:50%;background:radial-gradient(circle,transparent 61%,#719ed509 62%,transparent 72%);box-shadow:0 0 65px #6398df08}
.is-orbiting .orbit-ring:after{inset:24px;border:1px dashed #638fca25;transform:none}
@media(max-width:700px){.is-orbiting .orbit-ring{top:53%;width:320px;height:440px}.is-orbiting .orbit-ring:after{inset:16px}}
</style><style>
/* The wheel hub sits outside the left edge; only its right arc enters view. */
.is-orbiting .orbit-stage{overflow:hidden;overflow:clip}
.is-orbiting .home-features{display:none}
.wheel-titles,.wheel-bodies,.side-wheel-track{display:none}
.is-orbiting .orbit-heading{text-align:left;left:30px;transform:none;max-width:none;top:20px;width:90%}
.is-orbiting .orbit-heading h2{font-size:clamp(28px,3vw,42px);margin:12px 0}.is-orbiting .orbit-heading h2 br{display:none}
.is-orbiting .wheel-titles,.is-orbiting .wheel-bodies{display:block}
.is-orbiting .side-wheel-track{display:block;position:absolute;left:calc(var(--wheel-hub) - var(--wheel-radius));top:calc(var(--wheel-center) - var(--wheel-radius));width:calc(var(--wheel-radius) * 2);height:calc(var(--wheel-radius) * 2);border:1px solid #709edb30;border-radius:50%;pointer-events:none}
.side-wheel-track:after{content:'';position:absolute;inset:24px;border:1px dashed #709edb20;border-radius:50%}
.wheel-titles{position:absolute;inset:0;pointer-events:none;clip-path:inset(185px 0 100px 0)}
.wheel-title{position:absolute;left:0;top:0;display:flex;align-items:center;gap:16px;width:360px;padding:20px 22px;color:#e7b48c;text-decoration:none;background:linear-gradient(130deg,#30251eeb,#13202be8);border:1px solid #709edb;border-radius:15px;transform-origin:0 50%;will-change:transform,opacity;pointer-events:auto;box-shadow:0 15px 45px #0004}
.wheel-title h3{font-size:27px;line-height:1.2;letter-spacing:-.6px;margin:0}.wheel-title .step{margin:0;flex:0 0 auto;background:#50321f;color:#edb07c;border:1px solid #91603d}
.wheel-title[aria-current="step"]{border-color:#a5caff;box-shadow:0 18px 45px #0004,0 0 25px #709edb14}.wheel-title:focus-visible{outline:3px solid #b8d5ff;outline-offset:4px}
.wheel-bodies{position:absolute;left:59%;right:4%;top:39%;height:48%}
.wheel-copy{position:absolute;inset:0 auto auto 0;width:100%;border-top:1px solid #709edb70;padding-top:24px;will-change:opacity,transform}
.wheel-copy p{font-size:18px;line-height:1.85;color:#bdcbd9;margin:22px 0}.wheel-copy>a{display:inline-block;text-decoration:none;color:#edb07c;border-bottom:1px solid #ce8b5655;padding-bottom:7px;font-size:14px;font-weight:650}
@media(max-width:1100px) and (min-width:701px){.wheel-title{width:290px;padding:16px;gap:12px}.wheel-title h3{font-size:22px}.wheel-bodies{left:60%;right:2%}.wheel-copy p{font-size:16px}}
@media(max-width:700px){.is-orbiting .orbit-stage{min-height:690px}.is-orbiting .orbit-heading{left:5px;top:14px;width:96%}.is-orbiting .orbit-heading h2{font-size:27px}.is-orbiting .orbit-heading .eyebrow{font-size:10px}.wheel-titles{clip-path:inset(180px 0 44% 0)}.wheel-title{width:250px;padding:15px;gap:12px}.wheel-title h3{font-size:20px}.wheel-title .step{font-size:11px;padding:5px 7px}.wheel-bodies{left:5px;right:5px;top:61%;height:30%}.wheel-copy{padding-top:15px}.wheel-copy .eyebrow{font-size:9px;letter-spacing:1px}.wheel-copy p{font-size:14px;line-height:1.7;margin:14px 0}.wheel-copy>a{font-size:12px}.is-orbiting .orbit-position{bottom:10px}}
</style><style>
.wheel-copy{transition:opacity .28s ease,transform .38s cubic-bezier(.2,.7,.2,1),visibility .28s;}
.launch-section{padding:36px 0 45px!important;margin:0!important}
.launch-section .launch-grid{display:block!important;max-width:650px;margin:20px 0 0!important}
.launch-section .launch-title{font-size:clamp(28px,3.5vw,42px)!important;margin:0 0 14px!important}
.launch-section .start-actions{margin-top:18px}
.launch-section .trust-row{margin-top:18px;font-size:11px;letter-spacing:.2px}
.launch-section .preflight-link{margin-top:15px}
.feature-orbit{margin-top:0}
@media(prefers-reduced-motion:reduce){.wheel-copy{transition:none}}
</style><style>
#home .intro{max-width:565px}.intro-actions .start-actions{margin-top:0;display:flex;gap:10px;flex-wrap:wrap}.intro-actions .start-actions button{font-size:13px;padding:13px 16px}.intro-actions .start-actions .secondary{background:transparent;border-color:#527398;color:#c6d8ee}.hero-grid .trust-row{font-size:10px;color:#8da4bb;line-height:1.7}.hero-grid .preflight-link{font-size:11px;margin-top:12px}.hero-grid .preflight-link:hover{color:#e1b18a}
.case-banner{border-left:2px solid #719dd9;padding:15px 18px;background:#142334;border-radius:0 12px 12px 0;margin:0 0 18px}.case-banner .eyebrow{font-size:10px}.case-banner p{font-size:14px;color:#bfcedd;line-height:1.75;margin:10px 0}.case-banner button{font-size:11px;padding:7px 12px}
.decision-insight{border:1px solid #775336;border-radius:14px;background:linear-gradient(130deg,#30251b,#17232d);padding:22px;margin:18px 0}.decision-insight h3{font-size:20px;line-height:1.35;color:#e7b48c}.decision-insight p,.summary-meaning p{font-size:14px;line-height:1.8;color:#bfcedd}.decision-insight small,.summary-meaning small{font-size:11px;color:#9fb1c2}.summary-meaning{margin:20px 0;padding:18px 0;border-block:1px solid #3d4e5c}.summary-meaning h3{font-size:17px;color:#e0b48f}
.optional-breakdown>summary,.scenario-panel>summary{cursor:pointer;font-weight:650;font-size:15px;color:#dbe7f2}.optional-breakdown .cost-breakdown{margin-top:24px;margin-bottom:0;padding:0}.scenario-panel[open]>summary{margin-bottom:18px}.launch-start{left:24px;right:auto;background:#315ac2;color:#fff;border-color:#719dd9}.scenario-count{font-size:11px;color:#ba956f;margin-left:6px}
.scenario-save{display:flex;gap:12px;align-items:flex-end;max-width:650px;margin:20px 0 10px}.scenario-save label{flex:1}.scenario-save input{font-size:14px}.scenario-save>button{font-size:12px;min-height:44px;flex-shrink:0}.scenario-save>button:disabled{opacity:.5;cursor:default}.scenario-message{font-size:12px;color:#d7ad87;line-height:1.7;min-height:1em}.scenario-table{width:100%;min-width:620px;border-collapse:collapse}.scenario-table th,.scenario-table td{padding:14px 12px;vertical-align:top;font-size:12px;line-height:1.7;text-align:left;border-bottom:1px solid #354956}.scenario-table th[scope="row"]{min-width:130px;color:#b6c9dd}.scenario-table thead th{color:#e4b58e;min-width:155px}.scenario-table td:nth-child(2){background:#719dd908}.scenario-differences{color:#a7b9ca;font-size:11px!important}.saved-option-actions{display:flex;flex-direction:column;gap:10px;margin:18px 0}.saved-option-actions>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.saved-option-actions span{font-size:13px;min-width:100px;flex:1}.saved-option-actions button{font-size:11px;padding:7px 11px}.scenario-panel .scroll{max-width:100%;overflow:auto}
@media(max-width:700px){.scenario-save{display:block}.scenario-save>button{margin-top:12px;width:100%}.decision-insight{padding:18px}.decision-insight h3{font-size:18px}.hero-grid .preflight-link{margin-bottom:0}.intro-actions .start-actions{gap:8px}.intro-actions .start-actions button{font-size:12px}.scenario-panel{padding:17px}}
@media print{.scenario-panel,.case-banner button,.decision-insight{display:none!important}.summary-meaning p{color:#172b36}}
</style><style>.scenario-swipe{display:none;font-size:11px;color:#9fb4c9}@media(max-width:700px){#home>.hero-grid .intro-actions{order:4}#home>.hero-grid .property-story{order:5}#home>.hero-grid .trust-row{order:6;margin:0}#home>.hero-grid .preflight-link{order:7;margin:0}.scenario-swipe{display:block}}@media print{.scenario-swipe{display:none}}</style><style>/* White, blue and restrained orange throughout the public interface. */
:root{--ink:#193454;--muted:#61748b;--paper:#f7faff;--line:#d9e4f0;--gold:#d18b46}
html{background:#f8fbff}body{background:radial-gradient(ellipse at 75% 0%,#e8f1ff 0,transparent 44%),#f8fbff!important;color:#193454}
header{background:#fffffff5!important;border-color:#d9e4f0;box-shadow:0 2px 15px #294f7e06}.brand{color:#193454}.brand .pill{background:#edf4ff;border-color:#d4e4f8;color:#416997}
h1,h2,h3{color:#17385e}.headline-accent,.launch-copy .launch-accent{background:linear-gradient(110deg,#173e79 5%,#2767c4 40%,#679de6 65%,#214c8a 90%);background-size:220% auto;background-clip:text;-webkit-background-clip:text;color:transparent}.eyebrow,.story-index,.step-caption,.farm-kicker,.summary-count{color:#32649e}
button{background:#2864c4;color:white;border-color:#2864c4;box-shadow:none}button.secondary,header button.secondary{background:#fff;color:#2f5279;border-color:#ccdaeb}button:hover{filter:brightness(.97)}a{color:#2864b7}
.panel,.card{background:#fff!important;color:#193454;border-color:#d8e3ef;box-shadow:0 8px 28px #244e7a06}.panel h2,.panel h3,.card .number,.subnumber,.metric strong{color:#193d68}.panel p,.note,.intro,.field-help,.farm-help p,.step-help,.card .note{color:#62758c}.number{color:#1f528e}
input,select,textarea{background:#fff!important;color:#203c5b!important;border-color:#cbd9e8;box-shadow:none}input::placeholder,textarea::placeholder{color:#8a9caf}.unknown-control{color:#9b672f}input.estimate-unknown{background:#fff9f2!important;border-color:#d7af7a}.help-toggle,.farm-help summary{color:#3e6a9f}.cost-group>summary,.panel>summary{color:#274b73}
.hero-grid:before{opacity:.45}.hero-grid .intro{color:#536e8e}.hero-grid .trust-row{color:#6f859e}.hero-grid .preflight-link{color:#53749c}.hero-grid .preflight-link:hover{color:#ac6d31}.intro-actions .start-actions .secondary{background:#fff;border-color:#b6cce9;color:#2c5b96}.sector-switch{background:#edf4ff;border-color:#c8d9ef}.sector-switch button{color:#46658b;background:transparent;border-color:transparent}.sector-switch button[aria-pressed="true"]{color:#fff;background:#2864c4;box-shadow:0 3px 10px #2864c422}
.launch-screen{background:radial-gradient(ellipse at 50% 45%,#e7f0ff,transparent 70%),#fff}.launch-copy{color:#17385e}.launch-skip{background:#fff;color:#3264a2;border-color:#b9d0ed}.launch-start{background:#2864c4;color:#fff}
/* Keep the wireframe on a blue drawing surface for contrast. */
.property-story{background:linear-gradient(140deg,#14365c,#102844)!important;border-color:#7c9fc9;box-shadow:0 16px 50px #3a6b9d18}.property-story .story-top{background:#102b4b}.property-story .story-label{color:#b9d6fb}.property-story .motion-button,.property-story .wire-controls button{background:#15365a;color:#dbeaff;border-color:#426d9d}.property-story .wire-controls span,.scene-tag,.scene-coordinate{color:#bbd6f9}.property-scene{background:#102b4b}.property-story:hover{border-color:#6999d7;box-shadow:0 16px 50px #3a6b9d22}
.feature-orbit,.orbit-stage{color:#193454}.orbit-heading p{color:#667e99}.side-wheel-track,.side-wheel-track:after{border-color:#4f85c936}.wheel-title{background:linear-gradient(135deg,#fff,#edf4ff);color:#234f83;border-color:#8eb1e2;box-shadow:0 10px 28px #376aa315}.wheel-title h3{color:#234f83}.wheel-title .step{background:#fff1df;color:#a96527;border-color:#e3bd8b}.wheel-title[aria-current="step"]{border-color:#3675c8;box-shadow:0 12px 35px #376aa31c}.wheel-copy{border-top-color:#b8d0ec}.wheel-copy p{color:#526e8d}.wheel-copy>a{color:#ac6d31;border-bottom-color:#e0bb92}.orbit-position button{background:#fff;color:#5c7696;border-color:#c5d7ed}.orbit-position button[aria-current="step"]{background:#2864c4;color:#fff;border-color:#2864c4;box-shadow:0 3px 14px #2864c41a}
.home-features .panel{background:linear-gradient(150deg,#fff,#eef5ff)!important;border-color:#91b4e5}.home-features .panel h3{color:#2b5b94}.home-features .panel p{color:#61758d}.home-features .step{background:#fff0dd;color:#a76429;border-color:#dfb787}.home-features .feature-more{color:#aa6a2d}
.feature-detail h1{color:#193d68}.feature-detail .detail-intro,.feature-detail p,.feature-detail li{color:#5b718b}.feature-detail article{background:linear-gradient(140deg,#fff,#eff5ff);border-color:#d6e2ef}.feature-detail h2{color:#265991}.feature-detail .detail-example{background:#fff6eb;border-left-color:#d28a43}.feature-back{color:#3568a8}.detail-actions button{background:#2864c4;border-color:#2864c4;color:#fff}
.wizardbar button,.optiontabs button,.farm-tabs button{background:#fff;color:#55708e;border-color:#d3dfed}.wizardbar button[aria-current="step"],.optiontabs button[aria-selected="true"],.farm-tabs button[aria-selected="true"]{background:#2864c4;color:#fff;border-color:#2864c4}.wizard-progress,.farm-progress{background:#e1eafa}.wizard-progress i,.farm-progress i{background:#3777d3}.wizard-controls,.farm-tools{background:#f8fbfff5;border-color:#d8e4f1}.step-help{background:#edf4ff;border-color:#d6e3f6;color:#5a7391}.step-help b{color:#ad712f}
.goal-panel{background:linear-gradient(135deg,#fff,#edf4ff)!important;border-color:#c7d9ef}.goal-options button{background:#fff;border-color:#d2dfee;color:#244a76}.goal-options small{color:#70849b}.goal-options button[aria-pressed="true"]{background:#eaf2ff;border-color:#4e86d2;color:#174a8c;box-shadow:inset 0 0 0 1px #4e86d2}.goal-status,.estimate-notice{background:#fff8ee;border-color:#edd4ae;color:#8b612e}
.takeaway{background:#edf5ff;border-color:#c6daf5;border-left-color:#3a7bd4}.takeaway strong,.takeaway h2{color:#204c86}.takeaway p{color:#536e8e}.takeaway .note{color:#6b8099}.readiness-row strong{color:#2a66ad}.summary-goal{color:#a06b31}.decision-insight{background:linear-gradient(130deg,#f1f6ff,#fff)!important;border-color:#c6d9f2}.decision-insight h3,.summary-meaning h3{color:#265c9e}.decision-insight p,.summary-meaning p{color:#56718f}.decision-insight small,.summary-meaning small{color:#7a8ca2}.summary-meaning{border-color:#d9e5f1}.case-banner{background:#edf4ff;border-left-color:#5b8dcd}.case-banner p{color:#536e8f}.owner-budget{border-color:#dce6f1}.owner-budget strong{color:#244d7b}.owner-budget p{color:#5a718b}.budget-good{color:#27715a}.budget-short{color:#ae622e}.next-checks{color:#5a718a}.optional-breakdown>summary,.scenario-panel>summary{color:#2e5684}.scenario-count,.scenario-message{color:#a66b2d}
.scenario-table th,.scenario-table td{border-color:#dae5f1}.scenario-table th[scope="row"]{color:#476c96}.scenario-table thead th{color:#295d9e}.scenario-table td{color:#526e8d}.scenario-table td:nth-child(2){background:#eff5ff}.scenario-differences{color:#6c829d}.scenario-swipe{color:#6a83a0}.saved-option-actions span{color:#335a86}
.metric,.gap-item,.farmowner{background:#f0f5fc;border-color:#d4e0ef;color:#264a74}.metric .label,.metric small{color:#647d99}.farm-note{background:#fff7ec;border-color:#ecd0a8;color:#93662f}.alert,#warnings .alert,#farmWarnings .alert{background:#fff3e6;border-color:#e8c7a2;color:#985e28}.good{background:#eaf6ef;color:#286b50}.lease-positive{color:#277154}.lease-negative,#error,#farmError{color:#ac553b}.bar,.farm-visual{background:#e2eaf5}.bar i,.farm-visual i{background:#4b88d8}
.scroll table,.scroll th,.scroll td{color:#355778;border-color:#dce6f1}.scroll th{color:#2b578b;background:#f2f7fd}.responsive-table td{color:#355778}.responsive-table td:before{color:#7087a1}.responsive-table tr:not(:has(th)){background:#f4f8fe;border-color:#d4e2f2}.responsive-table td:first-child{border-color:#d6e3f2}.scenario-table th{background:#f2f7fd}
.toast{background:#edf6ff;color:#255187;border-color:#a6c5ed;box-shadow:0 10px 30px #376aa31c}dialog.starter-dialog,dialog.example-context{background:#fff;color:#23466e;border-color:#c6d9ef;box-shadow:0 30px 100px #17385e35}dialog.starter-dialog::backdrop,dialog.example-context::backdrop{background:#18385f66;backdrop-filter:blur(5px)}.starter-dialog h2,.starter-dialog ul,.starter-dialog .note{color:#355778}.starter-dialog .dialog-close{background:#eef4fd;color:#3c6596;border-color:#d0deed}footer{color:#6f849b;border-color:#dbe6f2}.preview-help{background:#eff5ff;border-color:#cbdcf2;color:#536f91}
.example-context{border:1px solid;border-radius:20px;width:min(590px,calc(100vw - 32px));padding:28px}.example-context h2{font-size:31px;line-height:1.15;margin:15px 0}.example-context p{color:#5d7590;font-size:15px;line-height:1.8}.example-facts{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0}.example-facts div{background:#f1f6fe;border:1px solid #d6e4f6;border-radius:12px;padding:16px}.example-facts strong{display:block;color:#23558f;font-size:19px;margin-bottom:5px}.example-facts small{color:#6d839d}.example-context .dialog-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:24px}.example-context .fiction-note{font-size:12px;color:#a17039}.example-context .example-question{padding:14px 16px;background:#fff7ec;border-left:2px solid #d58a40;border-radius:0 8px 8px 0;color:#8b6232}
@media(max-width:700px){.example-context{padding:22px}.example-context h2{font-size:27px}.example-context p{font-size:14px}.example-facts{gap:9px}.example-facts div{padding:13px}.wizard-controls{background:#f8fbfff5}.scenario-table tbody tr{background:transparent}.responsive-table td{color:#355778}}
@media print{body{background:white!important}dialog.example-context{display:none!important}#familySheet p,#familySheet td,#familySheet th{color:#17385e!important}.summary-meaning{border-color:#cddbea}}
</style><style>.global-motion{color:#426c9d;background:#fff;border-color:#c5d7ec}.mobile-tools summary{background:#edf4ff;color:#2c5b94;border-color:#c3d7f0}</style><style id="usability-improvements">
/* Give every top-right action a separate, comfortable target. */
header>.actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px 14px;margin-left:auto}
header>.actions button{margin:0;min-height:43px;white-space:nowrap}
header>.actions .global-motion{margin-right:8px}
@media(max-width:700px){header>.actions{display:none!important}.mobile-tools .actions{gap:12px!important}.mobile-tools .actions button{min-height:48px}}
.guidance-banner{border:1px solid #44617b;background:linear-gradient(120deg,#172b3c,#14252d);border-radius:16px;padding:20px 23px;margin:20px 0;color:#e1ecf5}
.guidance-banner h3{font-size:19px;margin:0 0 8px}.guidance-banner p{font-size:14px;color:#b9cad9;margin:0 0 12px;line-height:1.65}
.guidance-steps{display:flex;gap:9px;flex-wrap:wrap}.guidance-steps span{font-size:12px;padding:7px 11px;border:1px solid #425c70;border-radius:20px;background:#101e2b}
.guidance-tip{border-left:3px solid #c47b42;background:#1c292f;padding:12px 15px;margin:12px 0 20px;border-radius:0 8px 8px 0;color:#cbd9e4;font-size:13px;line-height:1.65}
.guidance-tip strong{color:#f0d0b5}.guidance-banner button{margin-top:13px}
@media(max-width:700px){.guidance-banner{padding:16px}.guidance-steps{flex-direction:column}.guidance-steps span{border-radius:8px}}
@media print{.guidance-banner,.guidance-tip{display:none!important}}
</style><header><div class="brand">⌂ &nbsp; Keep the Family Home & Land <span class="pill">Kentucky PFM Challenge</span></div><div class="actions"><button class="secondary global-motion" id="globalMotion" aria-pressed="false" onclick="toggleStoryMotion()" aria-label="Pause page animations">Pause motion</button><button class="secondary" onclick="showWelcome()">Home</button><button id="save">Save plan</button> <button id="open" class="secondary">Open plan</button> <button onclick="preparePrint()" class="secondary">Print</button><input hidden type="file" id="file" accept=".json,application/json,.pdf,application/pdf"></div></header><div class="preview-help" role="note"><strong>File preview</strong> · The house diagram is available here. For calculations, saving, and the rotating model, open this HTML in a full browser on your computer. A phone’s file preview may not run the interactive features.</div>
<main><section id="home"><div class="hero-grid"><div><span class="eyebrow hero-badge"><i></i> Built for Kentucky families</span><h1>Keep the place.<br><span class="headline-accent">Plan what comes next.</span></h1><p class="intro">A home. Farmland. A shared inheritance. See what each choice means for your family—before making a decision.</p><div class="sector-switch" role="group" aria-label="Choose a property planner"><button id="chooseHome" aria-pressed="true" onclick="selectSector('home')">⌂ Home</button><button id="chooseFarm" aria-pressed="false" onclick="selectSector('farm')">▧ Farmland</button></div><p id="sectorDescription" class="note">Home planner · Compare sharing, buying out, or selling a house.</p><div class="start-actions"><button onclick="startSelected(false)">Start with my numbers →</button> <button class="secondary" onclick="startSelected(true)">Try an example</button><button id="resumePlan" class="secondary" onclick="resumeSelected()" hidden>Continue my plan</button></div><div class="trust-row"><span>◈ Private on your device</span><span>↧ Save & return anytime</span><span>○ Works offline</span></div><button class="preflight-link" onclick="openStarterGuide()">Not sure where to start? <span>See what you’ll need ↗</span></button></div><div class="hero-house property-story" id="propertyStory"><div class="story-top"><span class="story-label"><i></i> A shared future / on the drawing board</span><button id="motionButton" class="motion-button" onclick="toggleStoryMotion()" aria-pressed="false" aria-label="Pause page animations">Pause motion</button></div><div class="property-scene"><div class="scene-halo"></div><div class="scene-grid"></div><div class="blueprint-scan" aria-hidden="true"></div><div class="blueprint-orbit" aria-hidden="true"></div><canvas id="wireModel" role="img" aria-label="Interactive 3D wireframe house. Use the rotation buttons below to change the view."></canvas><svg id="propertyArt" viewBox="0 0 440 240" fill="none" role="img" aria-label="Wireframe house with porch, garage, dormer, and chimney"><g class="static-wire" aria-hidden="true"><path d="M159.43 141.89L264.61 155.77" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M264.61 155.77L226.45 181.03" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M226.45 181.03L121.26 167.14" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M121.26 167.14L159.43 141.89" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M159.43 59.35L264.61 73.23" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M264.61 73.23L226.45 98.48" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M226.45 98.48L121.26 84.60" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M121.26 84.60L159.43 59.35" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M159.43 141.89L159.43 59.35" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M264.61 155.77L264.61 73.23" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M226.45 181.03L226.45 98.48" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M121.26 167.14L121.26 84.60" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M155.48 58.83L212.02 27.31" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M212.02 27.31L268.56 73.75" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M117.31 84.08L173.85 52.57" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M173.85 52.57L230.39 99.00" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M212.02 27.31L173.85 52.57" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M155.48 58.83L117.31 84.08" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M268.56 73.75L230.39 99.00" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M260.70 158.36L322.06 166.46" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M322.06 166.46L287.81 189.12" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M287.81 189.12L226.45 181.03" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M226.45 181.03L260.70 158.36" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M260.70 110.21L322.06 118.31" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M322.06 118.31L287.81 140.97" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M287.81 140.97L226.45 132.88" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M226.45 132.88L260.70 110.21" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M260.70 158.36L260.70 110.21" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M322.06 166.46L322.06 118.31" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M287.81 189.12L287.81 140.97" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M226.45 181.03L226.45 132.88" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M256.75 109.69L291.38 87.66" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M291.38 87.66L326.00 118.83" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M222.50 132.36L257.13 110.33" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M257.13 110.33L291.75 141.49" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M291.38 87.66L257.13 110.33" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M256.75 109.69L222.50 132.36" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M326.00 118.83L291.75 141.49" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M132.86 149.14L147.76 151.11" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M147.76 151.11L147.76 131.39" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M147.76 131.39L132.86 129.42" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M132.86 129.42L132.86 149.14" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M140.31 150.13L140.31 130.41" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M132.86 139.28L147.76 141.25" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M200.35 158.05L215.26 160.02" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M215.26 160.02L215.26 140.30" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M215.26 140.30L200.35 138.33" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M200.35 138.33L200.35 158.05" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M207.80 159.03L207.80 139.32" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M200.35 148.19L215.26 150.16" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M132.86 116.13L147.76 118.09" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M147.76 118.09L147.76 98.37" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M147.76 98.37L132.86 96.41" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M132.86 96.41L132.86 116.13" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M140.31 117.11L140.31 97.39" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M132.86 106.27L147.76 108.23" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M200.35 125.03L215.26 127.00" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M215.26 127.00L215.26 107.28" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M215.26 107.28L200.35 105.32" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M200.35 105.32L200.35 125.03" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M207.80 126.02L207.80 106.30" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M200.35 115.17L215.26 117.14" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M167.42 173.47L185.83 175.90" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M185.83 175.90L185.83 130.96" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M185.83 130.96L167.42 128.53" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M167.42 128.53L167.42 173.47" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M176.63 174.68L176.63 129.74" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M148.87 170.79L201.47 177.73" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M201.47 177.73L188.74 186.15" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M188.74 186.15L136.15 179.21" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M136.15 179.21L148.87 170.79" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M148.87 166.20L201.47 173.14" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M201.47 173.14L188.74 181.56" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M188.74 181.56L136.15 174.62" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M136.15 174.62L148.87 166.20" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M148.87 170.79L148.87 166.20" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M201.47 177.73L201.47 173.14" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M188.74 186.15L188.74 181.56" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M136.15 179.21L136.15 174.62" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M145.36 120.34L204.97 128.21" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M204.97 128.21L191.27 143.24" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M191.27 143.24L131.66 135.37" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M131.66 135.37L145.36 120.34" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M138.88 174.20L138.88 133.85" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M187.97 180.68L187.97 140.33" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M144.42 181.39L177.73 185.78" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M177.73 185.78L177.73 183.49" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M177.73 183.49L144.42 179.09" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M144.42 179.09L144.42 181.39" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M141.29 183.46L174.60 187.85" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M174.60 187.85L174.60 185.56" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M174.60 185.56L141.29 181.17" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M141.29 181.17L141.29 183.46" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M234.06 180.41L280.08 186.49" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M280.08 186.49L280.08 148.88" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M280.08 148.88L234.06 142.81" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M234.06 142.81L234.06 180.41" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M234.06 171.24L280.08 177.32" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M234.06 162.07L280.08 168.14" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M234.06 152.90L280.08 158.97" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M256.85 183.42L256.85 145.82" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M237.23 152.04L249.07 153.60" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M249.07 153.60L249.07 148.09" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M249.07 148.09L237.23 146.53" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M237.23 146.53L237.23 152.04" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M243.15 152.82L243.15 147.31" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M237.23 149.28L249.07 150.85" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M260.90 155.16L272.73 156.72" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M272.73 156.72L272.73 151.22" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M272.73 151.22L260.90 149.66" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M260.90 149.66L260.90 155.16" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M266.82 155.94L266.82 150.44" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M260.90 152.41L272.73 153.97" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M167.32 77.27L196.25 81.09" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M196.25 81.09L185.09 88.47" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M185.09 88.47L156.16 84.65" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M156.16 84.65L167.32 77.27" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M167.32 63.06L196.25 66.87" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M196.25 66.87L185.09 74.26" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M185.09 74.26L156.16 70.44" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M156.16 70.44L167.32 63.06" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M167.32 77.27L167.32 63.06" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M196.25 81.09L196.25 66.87" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M185.09 88.47L185.09 74.26" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M156.16 84.65L156.16 70.44" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M163.38 62.53L181.78 52.12" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M181.78 52.12L200.19 67.39" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M152.22 69.92L170.63 59.51" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M170.63 59.51L189.04 74.78" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M181.78 52.12L170.63 59.51" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M163.38 62.53L152.22 69.92" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M200.19 67.39L189.04 74.78" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M164.52 82.24L176.35 83.80" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M176.35 83.80L176.35 74.63" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M176.35 74.63L164.52 73.07" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M164.52 73.07L164.52 82.24" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M170.43 83.02L170.43 73.85" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M164.52 77.66L176.35 79.22" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M167.63 50.73L179.90 52.34" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M179.90 52.34L174.22 56.10" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M174.22 56.10L161.95 54.48" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M161.95 54.48L167.63 50.73" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M167.63 14.04L179.90 15.66" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M179.90 15.66L174.22 19.42" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M174.22 19.42L161.95 17.80" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M161.95 17.80L167.63 14.04" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M167.63 50.73L167.63 14.04" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M179.90 52.34L179.90 15.66" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M174.22 56.10L174.22 19.42" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M161.95 54.48L161.95 17.80" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M166.66 13.75L182.43 15.83" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M182.43 15.83L175.19 20.62" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M175.19 20.62L159.41 18.54" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M159.41 18.54L166.66 13.75" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M166.66 11.00L182.43 13.08" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M182.43 13.08L175.19 17.87" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M175.19 17.87L159.41 15.79" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M159.41 15.79L166.66 11.00" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M166.66 13.75L166.66 11.00" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M182.43 15.83L182.43 13.08" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M175.19 20.62L175.19 17.87" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M159.41 18.54L159.41 15.79" stroke="#c9e1ff" stroke-width="1.5" opacity=".8" fill="none"/><path d="M319.84 151.37L313.58 155.52" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M313.58 155.52L313.58 136.26" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M313.58 136.26L319.84 132.11" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M319.84 132.11L319.84 151.37" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M302.62 162.77L296.36 166.92" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M296.36 166.92L296.36 147.66" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M296.36 147.66L302.62 143.51" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M302.62 143.51L302.62 162.77" stroke="#c69768" stroke-width=".8" opacity=".8" fill="none"/><path d="M145.11 134.98L351.10 162.17" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M351.10 162.17L282.60 207.50" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M282.60 207.50L76.60 180.31" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M76.60 180.31L145.11 134.98" stroke="#82acd8" stroke-width=".8" opacity=".8" fill="none"/><path d="M145.11 134.98L76.60 180.31" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M165.71 137.70L97.20 183.03" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M186.30 140.42L117.80 185.75" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M206.90 143.14L138.40 188.47" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M227.50 145.86L159.00 191.19" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M248.10 148.57L179.60 193.91" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M268.70 151.29L200.20 196.62" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M289.30 154.01L220.80 199.34" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M309.90 156.73L241.40 202.06" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M330.50 159.45L262.00 204.78" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M351.10 162.17L282.60 207.50" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M145.11 134.98L351.10 162.17" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M138.26 139.51L344.25 166.70" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M131.41 144.05L337.40 171.23" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M124.56 148.58L330.55 175.77" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M117.70 153.11L323.70 180.30" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M110.85 157.65L316.85 184.83" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M104.00 162.18L310.00 189.37" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M97.15 166.71L303.15 193.90" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M90.30 171.25L296.30 198.43" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M83.45 175.78L289.45 202.97" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/><path d="M76.60 180.31L282.60 207.50" stroke="#82acd8" stroke-width=".8" opacity=".18" fill="none"/></g></svg><div class="wire-controls"><button aria-label="Rotate model left" onclick="rotateWire(-0.25)">↶</button><span>DRAG TO ROTATE</span><button aria-label="Reset model view" onclick="resetWire()">Reset view</button><button aria-label="Rotate model right" onclick="rotateWire(0.25)">↷</button></div><span class="scene-tag" id="sceneTag">HOME / FAMILY OWNED</span><div class="scene-coordinate" aria-hidden="true">PROPERTY STUDY<br><span>SCHEMATIC / NOT A SURVEY</span></div></div><div class="story-content"><span class="story-index" id="storyIndex">01 / KEEP IT TOGETHER</span><h3 id="storyTitle">Same roots. A shared future.</h3><p id="storyText">Understand what each person would pay to keep a place in the family.</p><div class="story-options" role="tablist" aria-label="Preview the family’s options"><button id="story-tab-0" role="tab" aria-selected="true" aria-controls="storyPreview" data-story="0" onclick="setStoryOption(0)">Keep together</button><button id="story-tab-1" role="tab" aria-selected="false" aria-controls="storyPreview" data-story="1" onclick="setStoryOption(1)">One keeps it</button><button id="story-tab-2" role="tab" aria-selected="false" aria-controls="storyPreview" data-story="2" onclick="setStoryOption(2)">Sell</button></div><div id="storyPreview" class="story-preview" role="tabpanel" aria-labelledby="story-tab-0"><span id="storyIcon" aria-hidden="true">↔</span><p id="storyHint">A clearer view of the bills, before deciding who pays what.</p></div></div></div></div><div class="home-features"><div class="panel"><span class="step">01</span><h3>Choose the property</h3><p>A home or farmland, with a separate set of questions for each.</p></div><div class="panel"><span class="step">02</span><h3>Include every sibling</h3><p>Enter how much each person owns and what they can pay each month.</p></div><div class="panel"><span class="step">03</span><h3>Find the next conversation</h3><p>Explore the gaps, try a temporary plan, and print a shared summary.</p></div></div></section><div id="planner" class="section-label"><h2>Your family’s planning workspace</h2><span class="pill">Full Planning</span></div><p class="note">Start with this fictional example, then enter your own estimates. Dollar amounts are rounded for display.</p><span id="status" role="status">Example plan • Save a copy to keep your work</span><p id="error" role="alert"></p>
<section class="guidance-banner" aria-label="How to use this planner"><h3>New here? Start with these three steps</h3><p>You don't need exact numbers to begin. Use reasonable estimates, then adjust them to see how each option changes what your family could receive or pay.</p><div class="guidance-steps"><span>1 · Enter the property and family details</span><span>2 · Explore keeping, buying out, or selling</span><span>3 · Review and save a summary to discuss</span></div></section><div class="quick-guide"><strong>Three choices, in everyday terms</strong><p><b>Keep it together:</b> You still own the home together and share the bills.</p><p><b>One person keeps it:</b> That person pays the others for their parts of the home. This is called a buyout.</p><p><b>Sell it:</b> Pay off the home loan and selling costs, then split what is left.</p></div><div class="layout"><aside class="inputs"><div class="panel"><h2>1. The home</h2><p class="note" id="modeNotice">These are made-up example numbers. Replace them with your own estimates. All amounts are US dollars.</p><div id="homeFields" class="fields"></div></div><div class="panel"><h2>2. The family</h2><label>Number of owners<select id="count"><option>2</option><option selected>3</option><option>4</option><option>5</option><option>6</option></select></label><p class="note">Enter the percentage of the home each person owns. For example, two equal owners each have 50%. Check these shares with the person handling the estate; this tool cannot work them out for you. Use nicknames instead of full names.</p><div id="owners"></div><label>For the buyout comparison only: who would buy the others’ shares?<select id="buyer"></select></label></div><div class="panel"><h2>How will you split the monthly bills?</h2><label>Choose how to share the costs<select id="split"><option value="ownership">Match each person’s ownership percentage</option><option value="equal">Everyone pays the same amount</option><option value="custom">Choose an amount for each person</option></select></label><p class="note">Check that everyone’s payments add up to the total monthly cost. Paying more does not mean someone owns more of the home.</p><div id="customFields"></div></div><div class="panel"><h2>3. One person keeps the home</h2><div id="loanFields" class="fields"></div><p class="note">A buyout means one person pays the others for their shares and becomes the sole owner. This example uses a new loan to pay off the old home loan and pay the other owners. The interest rate stays the same for the full loan. Fees and repairs are paid separately in cash. This tool cannot tell you whether a lender will approve the loan.</p></div><button id="reset" class="secondary">Restore example</button></aside>
<section><div class="cards"><article class="card"><span class="eyebrow">01 / Keep it together</span><div class="number" id="keepTotal"></div><p class="note">Monthly cost for everyone combined</p><div class="rule"></div><div id="keepUpfront" class="subnumber"></div><p class="note">Repairs needed now, split by how much each person owns</p></article><article class="card"><span class="eyebrow">02 / One person keeps it</span><div class="number" id="buyTotal"></div><p class="note">Monthly cost for the person keeping it</p><div class="rule"></div><div id="buyCash" class="subnumber"></div><p class="note">Cash needed now, including fees and repairs</p></article><article class="card"><span class="eyebrow">03 / Sell</span><div class="number" id="saleTotal"></div><p class="note">Money left to split after selling costs and the home loan</p><div class="rule"></div><div id="saleCost" class="subnumber"></div><p class="note">Selling fees and other costs (home loan paid separately)</p></article></div><div id="warnings"></div><div class="panel" style="margin-top:20px"><h2>What changes for each sibling?</h2><p class="note">Your monthly budget is the most you can put toward this home after paying your other bills and keeping money for living costs and savings.</p><div class="scroll"><table><thead><tr><th>Owner</th><th>Owns</th><th>Pays each month if shared</th><th>Monthly budget</th><th>Gets if sold</th><th>One person keeps it: pays / gets</th></tr></thead><tbody id="comparison"></tbody></table></div><p class="note">Monthly bills follow the split you chose. Money from selling follows each person’s ownership percentage. A buyout uses the home’s value minus the remaining home loan; it does not subtract selling fees because the home is not being sold on the market. Paying different amounts does not change ownership.</p></div><div class="panel"><h2>What would make this fit the budget?</h2><div id="gap"></div></div><div class="panel"><h2>Keep it for now</h2><label>How long until you decide again?<select id="holdMonths"><option value="6">6 months</option><option value="12">12 months</option></select></label><p class="note">What would it cost to keep paying the bills while you decide? This includes the current loan payment, taxes, insurance, upkeep, utilities, and repairs needed now. It assumes no rent is collected and the home’s value stays the same.</p><div id="hold"></div></div><div class="panel"><h2 id="buyerHeading">Can the buyer carry the home?</h2><div id="afford"></div><label style="margin-top:20px">What if another repair comes up? ($)<input id="shock" type="number" min="0" max="10000000" step="100"></label><p id="stress"></p><p class="note">We divide the extra repair by 12 to show its monthly impact. The actual repair bill may be due all at once. This is a what-if example, not a payment plan.</p></div><div id="family-notes" class="panel"><h2>Bring this to the family table</h2><label>Questions and things to double-check<textarea id="notes" maxlength="6000" placeholder="For example: confirm roof repair quote; ask about the mortgage; agree on a valuation."></textarea></label><label style="margin:15px 0">When will you talk about this again?<input id="review" type="date"></label><button onclick="preparePrint()">Print family discussion sheet</button><ul><li>Check who legally owns the home, how much each person owns, what is still owed, and who is allowed to approve a transfer.</li><li>Agree on what the home is worth. Get real prices for insurance, repairs, selling fees, and a new loan.</li><li>If keeping it jointly, discuss who lives there, who pays, and what happens if someone wants out.</li><li>Review legal and tax questions with qualified professionals before acting.</li></ul><details><summary>How the estimates work</summary><p class="note">For the ownership allocation, joint monthly cost = existing principal-and-interest payment + annual property tax ÷ 12 + annual insurance ÷ 12 + monthly maintenance reserve + utilities. Enter principal and interest only to avoid counting escrow twice. HOA dues may be included in the maintenance figure.</p><p class="note">Buyout equity = home value − mortgage balance. Other owners receive their entered shares of that equity. New loan = mortgage balance + buyout payments − buyer’s cash contribution. Buyer monthly cost = new loan payment + the same tax, insurance, maintenance, and utilities. Sale proceeds = home value − mortgage − selling percentage × home value − fixed selling costs. The sale model assumes an as-is sale; immediate repair costs are included only in keep/buyout scenarios. Taxes, estate debts other than the entered mortgage, liens, occupancy payments, and future home-price changes are excluded.</p><p class="note">Fixed loan payment uses P × r ÷ (1 − (1+r)<sup>−n</sup>), where r is annual interest ÷ 1200 and n is years × 12. At 0% interest it is P ÷ n. If the home loan is larger than the home’s value, extra money may be needed to settle the debt. Standard buyout results are not shown.</p></details><details><summary>Privacy, educational use & license</summary><p class="note">Nothing you enter is transmitted. This file makes no external requests and uses no outside services, libraries, tracking, or AI features. Work is held in this tab until you save it as a JSON file. Save files contain the figures and nicknames you enter; keep them private. Browser close warnings may be limited by your browser, especially on mobile.</p><p class="note">For educational use only. Not financial, investment, tax, or legal advice. Estimates do not determine ownership, eligibility for financing, or the best choice for your family. No entry’s calculations or conclusions are endorsed by Globefin or the University of Kentucky.</p><p class="note">Created by Clay Deardorff with AI assistance. Original code; no third-party code used.</p><pre style="white-space:pre-wrap;font-size:11px">MIT License
Copyright (c) 2026 Clay Deardorff

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</pre></details></div><div class="panel"><h2>Kentucky places to start</h2><p><a href="https://www.kyjustice.org/help-near-you" target="_blank" rel="noopener noreferrer">Kentucky Justice Online: help near you ↗</a></p><p class="note">Find the legal aid organization serving your county. Availability and eligibility vary.</p><p><a href="https://kybar.org/For-Public/Lawyer-Referral-Services" target="_blank" rel="noopener noreferrer">Kentucky Bar Association: lawyer referral resources ↗</a></p><p class="note">Use these starting points for questions about legal ownership, handling an inheritance, or owning a home together. This tool is not affiliated with either organization. Links require internet and open external sites; no plan data is attached. Resources checked October 20, 2026.</p></div></section></div><section id="familySheet" class="sheet"></section><footer>Keep the Family Home & Land · Clay Deardorff · Full Planning · Kentucky PFM Challenge 2026<br>For educational use only. Not financial, investment, tax, or legal advice. Save your plan before closing.</footer></main>
<script>
'use strict';
const defaults=()=>({format:'keep-family-home',version:1,activeSector:'home',farm:farmDefaults(),planMode:'example',value:240000,mortgage:60000,payment:500,tax:2400,insurance:1800,maintenance:200,utilities:250,repairs:12000,sellPercent:7,sellFixed:1500,cash:10000,closing:4000,rate:6.5,years:30,shock:6000,availableCash:30000,split:'ownership',custom:[520,390,390],holdMonths:6,notes:'',review:'',feedback:'',scenarioSets:{home:[],farm:[]},goal:'unsure',unknown:{},buyoutEnabled:false,buyer:0,owners:[{name:'Alex',share:40,capacity:1800},{name:'Jordan',share:30,capacity:450},{name:'Sam',share:30,capacity:300}]});
let state=defaults(),dirty=false;let dirtySectors={home:false,farm:false},startedSectors={home:false,farm:false};
const specs=[['value','What could the home sell for? ($)'],['mortgage','Amount still owed on the home ($)'],['payment','Monthly loan payment ($)'],['tax','Property tax per year ($)'],['insurance','Home insurance per year ($)'],['maintenance','Set aside for upkeep each month ($)'],['utilities','Utilities each month ($)'],['repairs','Repairs needed now'],['sellPercent','Selling fees (% of home price)'],['sellFixed','Other costs to sell ($)'],['cash','Cash the buyer puts toward the home ($)'],['closing','Fees to complete the buyout ($)'],['rate','Interest rate on the new loan (%)'],['years','Years to repay the new loan'],['availableCash','Total cash the buyer can use ($)']];
const $=id=>document.getElementById(id),money=n=>new Intl.NumberFormat('en-US',{style:'currency',currency:'USD',maximumFractionDigits:0}).format(n),esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
function payment(p,r,y){const n=y*12,i=r/1200;return p===0?0:i===0?p/n:p*i/(-Math.expm1(-n*Math.log1p(i)))}
function calculate(s){const equity=s.value-s.mortgage,operating=(s.tax+s.insurance)/12+s.maintenance+s.utilities,buyout=equity*(1-s.owners[s.buyer].share/100),needed=s.mortgage+buyout,loan=Math.max(0,needed-s.cash);return {equity,operating,buyout,needed,loan,keep:s.payment+operating,buy:payment(loan,s.rate,s.years)+operating,upfront:Math.min(s.cash,Math.max(0,needed))+s.closing+s.repairs,sale:s.value-s.mortgage-s.value*s.sellPercent/100-s.sellFixed}}
function validate(s,{includeFarm=true}={}){validatePlanningMeta(s);if(s?.buyoutEnabled!==undefined&&typeof s.buyoutEnabled!=='boolean')throw Error('Invalid buyout selection.');if(s&&s.planMode!==undefined&&!['own','example'].includes(s.planMode))throw Error('Invalid plan type.');if(!s||s.format!=='keep-family-home'||s.version!==1)throw Error('This is not a supported Keep the Family Home plan.');for(const [k] of specs.concat([['shock']]))if((s.buyoutEnabled===true||!['cash','closing','rate','years','availableCash','shock'].includes(k))&&(typeof s[k]!=='number'||!Number.isFinite(s[k])||s[k]<0||s[k]>100000000))throw Error('Enter a valid amount for: '+(specs.find(x=>x[0]===k)?.[1]||'unexpected repair'));if(s.sellPercent>100||(s.buyoutEnabled===true&&(s.rate>100||s.years<1||s.years>50||!Number.isInteger(s.years))))throw Error('Check interest, selling percentage, and loan term (1–50 whole years).');if(!['ownership','equal','custom'].includes(s.split)||![6,12].includes(s.holdMonths)||!Array.isArray(s.custom)||s.custom.length!==s.owners?.length||s.custom.some(v=>!Number.isFinite(v)||v<0||v>100000000)||typeof s.notes!=='string'||s.notes.length>6000||typeof s.feedback!=='string'||s.feedback.length>4000||typeof s.review!=='string'||!/^([0-9]{4}-[0-9]{2}-[0-9]{2})?$/.test(s.review))throw Error('Invalid contribution or discussion details.');if(!Array.isArray(s.owners)||s.owners.length<2||s.owners.length>6)throw Error('Use 2–6 owners.');for(const o of s.owners)if(!o||typeof o.name!=='string'||o.name.length>60||!Number.isFinite(o.share)||o.share<0||o.share>100||!Number.isFinite(o.capacity)||o.capacity<0||o.capacity>100000000)throw Error('Invalid owner details.');if(Math.abs(s.owners.reduce((a,o)=>a+o.share,0)-100)>.001)throw Error('The percentages everyone owns must add up to 100%. Check the shares entered for each person.');if(!Number.isInteger(s.buyer)||s.buyer<0||s.buyer>=s.owners.length)throw Error('Choose a valid buyer.');if(includeFarm&&s.farm!==undefined)validateFarm(s.farm);if(s.activeSector!==undefined&&!['home','farm'].includes(s.activeSector))throw Error('Invalid property planner.');return s}
function contribution(s,c,i){return s.split==='equal'?c.keep/s.owners.length:s.split==='custom'?s.custom[i]:c.keep*s.owners[i].share/100}
function normalize(s){if(s&&s.format==='keep-family-home'&&s.version===1){const d=defaults();s={...s};for(const k of ['availableCash','split','holdMonths','notes','review','feedback','planMode','activeSector','farm','buyoutEnabled','goal','unknown','scenarioSets'])if(!(k in s))s[k]=d[k];if(!('custom' in s))s.custom=(s.owners||[]).map(()=>0)}return s}
function mark(sector=state.activeSector||'home'){dirtySectors[sector]=true;dirty=dirtySectors.home||dirtySectors.farm;$('status').textContent='Unsaved changes • Save plan to keep your work';if($('farmStatus'))$('farmStatus').textContent='Unsaved changes • Save both planners before closing'}
const inputHelp={"value": "Your best estimate is fine to start. An appraisal or local sale prices can help you check it.", "mortgage": "The amount needed to fully repay the current home loan. Use 0 if it is paid off.", "payment": "Only the part paying back the loan plus interest. Do not include taxes or insurance here\u2014we add those separately. Use 0 if there is no loan.", "tax": "Use the yearly property tax bill, not a monthly amount.", "insurance": "Use the full yearly price of home insurance.", "maintenance": "Money saved for future repairs and regular upkeep. Add homeowners association fees here too, if any.", "utilities": "Monthly electricity, water, gas, and other home services.", "repairs": "A one-time total for work needed soon, such as a roof repair. Keep future upkeep separate.", "sellPercent": "Fees that depend on the selling price. For example, 7% of $200,000 is $14,000. This is an editable example, not a quoted fee.", "sellFixed": "Other one-time selling costs not already included in the percentage above. The example assumes you sell without doing the repairs first.", "cash": "Money paid from savings to make the new loan smaller. This is part of the total cash available below; do not include fees or repairs in this box.", "closing": "One-time fees for the new loan and ownership change. Get an actual estimate from the lender or professional handling the transfer.", "rate": "The yearly rate a lender quotes. For example, enter 6.5 for 6.5%. The example rate is not an offer.", "years": "How long the new loan lasts. For example, 30 means payments over 30 years.", "availableCash": "All cash the buyer can use for this decision, including money toward the home, fees, and repairs. Leave emergency savings out if they should stay untouched."};
function mount(){for(const group of ['homeFields','loanFields'])$(group).innerHTML=specs.filter((_,i)=>group==='homeFields'?i<10:i>=10).map(([k,l])=>`<label>${l}<input id="${k}" type="number" min="${k==='years'?1:0}" max="${k==='years'?50:k==='rate'||k==='sellPercent'?100:100000000}" step="${k==='years'?1:'any'}" value="${state[k]}" aria-label="${l}" aria-describedby="help-${k}"><small id="help-${k}" class="field-help">${inputHelp[k]}</small></label>`).join('');$('count').value=state.owners.length;$('owners').innerHTML=state.owners.map((o,i)=>`<div class="fields" style="margin:18px 0;padding-top:12px;border-top:1px solid var(--line)"><label class="span">Owner ${i+1} nickname<input data-i="${i}" data-k="name" maxlength="60" value="${esc(o.name)}"></label><label>Owns this much of the home (%)<input type="number" min="0" max="100" step="any" data-i="${i}" data-k="share" value="${o.share}"></label><label>Can pay toward the home each month ($)<input type="number" min="0" max="100000000" step="any" data-i="${i}" data-k="capacity" value="${o.capacity}"></label></div>`).join('');buyerOptions();$('shock').value=state.shock;for(const k of ['split','holdMonths','notes','review','feedback'])if($(k))$(k).value=state[k];$('customFields').innerHTML=state.owners.map((o,i)=>`<label style="margin-top:10px">${esc(o.name||'Owner '+(i+1))} / month ($)<input type="number" min="0" max="100000000" step="any" data-custom="${i}" value="${state.custom[i]}"></label>`).join('');$('customFields').hidden=state.split!=='custom';if($('modeNotice'))$('modeNotice').textContent=state.planMode==='own'?'Your plan starts at zero, with no sample money amounts. Check every cost group. Two owners start at 50% each—replace those shares with the actual shares. A 30-year loan is only a starting setting, not an offer.':'These are made-up example numbers, not estimates for your family. Change them or choose Start with my numbers on Home.';compactHelp();render()}
function buyerOptions(){$('buyer').innerHTML=state.owners.map((o,i)=>`<option value="${i}">${esc(o.name||'Owner '+(i+1))}</option>`).join('');$('buyer').value=state.buyer}
function render(){if($('takeaway'))$('takeaway').textContent='Check the amounts below to see your summary.';try{validate(state,{includeFarm:false});$('error').textContent=''}catch(e){$('error').textContent=e.message+' Results are paused until corrected.';for(const id of ['gap','hold','familySheet'])$(id).textContent='Correct the inputs to update the plan.';for(const id of ['keepTotal','keepUpfront','buyTotal','buyCash','saleTotal','saleCost'])$(id).textContent='—';$('comparison').innerHTML='';$('warnings').innerHTML='';$('afford').textContent='Correct the inputs to compare options.';$('stress').textContent='';return}const c=calculate(state),b=state.owners[state.buyer],valid=c.equity>=0;
$('keepTotal').textContent=money(c.keep);$('keepUpfront').textContent=money(state.repairs);$('buyTotal').textContent=valid?money(c.buy):'Unavailable';$('buyCash').textContent=valid?money(c.upfront):'Owe more than it’s worth';$('saleTotal').textContent=money(c.sale);$('saleCost').textContent=money(state.value*state.sellPercent/100+state.sellFixed);
let warnings=[];const funded=state.owners.reduce((a,o,i)=>a+contribution(state,c,i),0);if(state.split==='custom'&&Math.abs(funded-c.keep)>.01)warnings.push('The amounts you chose '+(funded<c.keep?'leave unpaid bills of ':'add up to more than the monthly bills by ')+money(Math.abs(funded-c.keep))+'.');if(!valid)warnings.push('The home loan is larger than the estimated selling price. There is no remaining home value to split after that debt. A sale may need extra cash to pay what is owed.');if(c.sale<0)warnings.push('Selling leaves an estimated '+money(-c.sale)+' shortfall, not a payout. Who covers it is not determined here.');const short=state.owners.filter((o,i)=>contribution(state,c,i)>o.capacity);if(short.length)warnings.push(short.map(o=>o.name||'An owner').join(', ')+' would pay more than their monthly budget with this split of the bills.');if(state.buyoutEnabled===true&&state.cash>c.needed&&valid)warnings.push('The buyer entered more cash toward the home than is needed. Only '+money(c.needed)+' is used to reduce the loan; the rest is not counted as cash needed now.');$('warnings').innerHTML=warnings.map(w=>'<div class="alert">'+esc(w)+'</div>').join('');
$('comparison').innerHTML=state.owners.map((o,i)=>`<tr><td>${esc(o.name||'Owner '+(i+1))}${state.buyoutEnabled===true&&i===state.buyer?' · selected buyout buyer':''}</td><td>${o.share}%</td><td>${money(contribution(state,c,i))}</td><td>${money(o.capacity)}</td><td>${c.sale>=0?money(c.sale*o.share/100):'Extra cash needed'}</td><td>${!valid?'—':i===state.buyer?'Pays others '+money(c.buyout):money(c.equity*o.share/100)}</td></tr>`).join('');
renderExtras(c,b,valid);$('buyerHeading').textContent='Buyout scenario: could '+(b.name||'the selected buyer')+' afford it?';if(valid){const left=b.capacity-c.buy;$('afford').innerHTML=`<div class="number">${money(Math.abs(left))} / month</div><p>${left>=0?'Left over in':'Over'} the buyer’s monthly budget for this home.</p><div class="bar"><i style="width:${b.capacity?Math.min(100,c.buy/b.capacity*100):100}%"></i></div><p class="note">New loan: ${money(c.loan)} · Loan payment: ${money(payment(c.loan,state.rate,state.years))}/month<br>Taxes, insurance, upkeep, and utilities: ${money(c.operating)}/month<br>Total paid to the other owners: ${money(c.buyout)}<br>Cash needed now: ${money(c.upfront)}. Cash the buyer has available: ${money(state.availableCash)}.</p>`;$('stress').textContent='With an extra '+money(state.shock)+' repair spread over a year, the buyer would need '+money(c.buy+state.shock/12)+'/month—'+money(Math.abs(b.capacity-c.buy-state.shock/12))+(b.capacity>=c.buy+state.shock/12?' below':' above')+' their monthly budget.'}else{$('afford').textContent='The home loan is larger than the home’s estimated value. This tool cannot work out a normal buyout.';$('stress').textContent=''} }

function renderExtras(c,b,valid){
if($('takeaway'))$('takeaway').innerHTML=state.value===0?'<strong>Start with what the home could sell for.</strong><p>Open The home step and enter your estimates. Zero means no cost, so check every cost group before relying on a result.</p>':'<strong>Compare the options for your family.</strong><p><b>Keep it together:</b> About '+money(c.keep)+' per month for everyone combined, plus '+money(state.repairs)+' in repairs needed now.</p>'+(state.buyoutEnabled===true?'<p><b>One person buys out the others:</b> '+(valid?'If '+esc(b.name||'the selected buyer')+' buys the other owners’ shares, this scenario needs '+money(c.upfront)+' upfront and about '+money(c.buy)+' per month.':'A normal buyout is not modeled because the home loan exceeds the estimated home value.')+'</p>':'')+'<p><b>Sell:</b> '+(c.sale>=0?'About '+money(c.sale)+' remains to split after the listed selling costs and home loan.':'About '+money(-c.sale)+' extra is needed to cover the listed selling costs and home loan.')+'</p><p class="note">These are comparisons, not a recommendation. Shared ownership remains an option. The tool does not choose who should own the home.</p>';

const monthlyGap=Math.max(0,c.buy-b.capacity),cashGap=Math.max(0,c.upfront-state.availableCash),operatingGap=Math.max(0,c.operating-b.capacity),factor=payment(1,state.rate,state.years),maxLoan=Math.max(0,b.capacity-c.operating)/factor,extraPrincipal=Math.max(0,c.loan-maxLoan),otherShare=1-b.share/100;
$('gap').innerHTML=valid?`<div class="gap-grid"><div class="gap-item"><span class="note">Extra cash needed now</span><strong>${money(cashGap)}</strong><span class="note">${money(c.upfront)} needed compared with ${money(state.availableCash)} available</span></div><div class="gap-item"><span class="note">Over the monthly budget by</span><strong>${money(monthlyGap)}</strong><span class="note">Compared with what the buyer says they can pay</span></div></div><p>${operatingGap>0?'Even without a home loan, taxes, insurance, upkeep, and utilities are over the budget by '+money(operatingGap)+'/month. A smaller loan alone would not make the home affordable.':extraPrincipal>0?'Borrowing about '+money(extraPrincipal)+' less would bring the estimated monthly cost within the buyer’s budget.':'The estimated monthly cost fits the buyer’s budget.'}</p><p class="note">${extraPrincipal>0&&operatingGap===0?'One example is '+money(extraPrincipal)+' more cash toward the home, plus any extra cash already needed for fees and repairs. '+(extraPrincipal<=c.buyout?'Another example: the other owners could agree to receive '+money(extraPrincipal)+' less in total. That would lower the new loan by the same amount, but those owners would get less money. Everyone affected would need to agree.':'Even if the other owners took no payment for their shares, the monthly cost would still be too high.')+'':''} These examples show how changing a number affects the result. They do not tell anyone what to agree to or whether a lender will approve a loan.</p>`:'The home loan is larger than the home’s estimated value, so this tool cannot work out a normal buyout.';
const holdTotal=c.keep*state.holdMonths+state.repairs;
$('hold').innerHTML=`<div class="number">${money(holdTotal)}</div><p>Total payments over ${state.holdMonths} months, including repairs needed now.</p><div class="scroll"><table><thead><tr><th>Owner</th><th>Pays each month</th><th>Repairs*</th><th>Total for this period</th></tr></thead><tbody>${state.owners.map((o,i)=>`<tr><td>${esc(o.name)}</td><td>${money(contribution(state,c,i))}</td><td>${money(state.repairs*o.share/100)}</td><td>${money(contribution(state,c,i)*state.holdMonths+state.repairs*o.share/100)}</td></tr>`).join('')}</tbody></table></div><p class="note">*Repairs needed now are split by how much each person owns. Some of each loan payment pays down the debt, so total payments are not the same as money lost. If you choose your own payment amounts, check that all the bills are covered.</p>`;
$('familySheet').innerHTML=`<p>KEEP THE FAMILY HOME · CLAY DEARDORFF</p><h1>Family discussion sheet</h1><p>Estimates for discussion only · ${new Date().toLocaleDateString()}${state.review?' · Review: '+esc(state.review):''}</p><p>${state.planMode==='own'?'Your estimates: zero amounts mean no cost. Check every cost before deciding.':'Fictional example—replace these figures before making a family decision.'}</p><p>Home value: ${money(state.value)} · Mortgage payoff: ${money(state.mortgage)} · Repairs needed now: ${money(state.repairs)}</p><h2>Our options</h2><table><tr><th>Keep jointly / month</th><th>Buyout / month</th><th>Money left after selling</th></tr><tr><td>${money(c.keep)}</td><td>${valid?money(c.buy):'Owe more than it’s worth'}</td><td>${money(c.sale)}</td></tr></table><p>Buyout buyer: ${esc(b.name)} · Cash needed: ${valid?money(c.upfront):'—'} · Available: ${money(state.availableCash)} · Extra cash needed now: ${valid?money(cashGap):'—'} · Over monthly budget by: ${valid?money(monthlyGap):'—'}</p><h2>Each person’s position</h2><table><tr><th>Owner</th><th>Ownership</th><th>Joint / month</th><th>Monthly budget</th><th>Gets if sold</th></tr>${state.owners.map((o,i)=>`<tr><td>${esc(o.name)}</td><td>${o.share}%</td><td>${money(contribution(state,c,i))}</td><td>${money(o.capacity)}</td><td>${c.sale>=0?money(c.sale*o.share/100):'Extra cash needed'}</td></tr>`).join('')}</table><p>Temporary hold: ${state.holdMonths} months · Total payments: ${money(holdTotal)}. How monthly bills are split: ${esc({ownership:'By how much each person owns',equal:'Everyone pays the same',custom:'Amounts chosen by the family'}[state.split])}. Paying different amounts does not change ownership.</p><h2>Questions & things to check</h2><p style="white-space:pre-wrap">${esc(state.notes.slice(0,1200)||'No notes yet. Check the home’s value, legal owners, new loan details, repairs, and who pays what.')}</p><h2>Before making a decision</h2><p>Check legal ownership and who can approve a transfer. Get real cost estimates. Discuss who lives there and what happens if someone wants out. Ask qualified professionals about taxes and legal questions.</p><p class="note">Model assumes a new fixed loan for buyout, as-is sale, and unchanged ongoing costs. Taxes, other estate debts and liens, future price changes, and rent are excluded. Repair stress test: ${money(state.shock)} over 12 months. Notes longer than 1,200 characters are shortened on this sheet; the full notes and assumptions remain in the app. Educational use only; not financial, investment, tax, or legal advice. Not a binding agreement or financing approval. Private financial figures—share thoughtfully.</p>`;
}

document.addEventListener('input',e=>{const t=e.target;if(t.dataset.custom!==undefined){state.custom[+t.dataset.custom]=t.value===''?NaN:Number(t.value);mark();render();return}if(['notes','review','feedback'].includes(t.id)){state[t.id]=t.value;mark();render();return}if(t.dataset.k){state.owners[+t.dataset.i][t.dataset.k]=t.dataset.k==='name'?t.value:t.value===''?NaN:Number(t.value);if(t.dataset.k==='name')buyerOptions()}else if(specs.some(([k])=>k===t.id)||t.id==='shock')state[t.id]=t.value===''?NaN:Number(t.value);else return;mark();render()});for(const k of ['split','holdMonths'])$(k).onchange=e=>{state[k]=k==='holdMonths'?Number(e.target.value):e.target.value;$('customFields').hidden=state.split!=='custom';mark();render()};$('buyer').onchange=e=>{state.buyer=Number(e.target.value);mark();render()};$('count').onchange=e=>{const n=Number(e.target.value);state.owners=Array.from({length:n},(_,i)=>({name:state.owners[i]?.name||'Owner '+(i+1),share:i===n-1?100-Math.floor(100/n)* (n-1):Math.floor(100/n),capacity:state.owners[i]?.capacity||0}));state.custom=Array.from({length:n},(_,i)=>state.custom[i]||0);state.buyer=Math.min(state.buyer,n-1);mark();mount()};
function save(){try{validate(state)}catch(e){$('error').textContent='Cannot save: '+e.message;if($('farmError'))$('farmError').textContent='Cannot save: '+e.message;return}const blob=new Blob([JSON.stringify(state,null,2)],{type:'application/json'}),url=URL.createObjectURL(blob),a=document.createElement('a');a.href=url;a.download='family-property-plan.json';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000);dirty=false;dirtySectors={home:false,farm:false};$('status').textContent='Plan download requested • Check your downloads';notifyUI('Plan downloaded. Keep the file somewhere you can find it.');if($('farmStatus'))$('farmStatus').textContent='Both planners saved • Check your downloads'}$('save').onclick=save;document.addEventListener('keydown',e=>{if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==='s'){e.preventDefault();save()}});$('open').onclick=()=>{const input=$('file');input.value='';input.click()};$('file').onchange=async e=>{const f=e.target.files[0];e.target.value='';if(!f)return;try{if(f.name.toLowerCase().endsWith('.pdf')||f.type==='application/pdf')throw Error('This is a PDF report, not an editable plan. Use Save plan to download a .json file, then choose that file here.');if(f.size>1000000)throw Error('Plan file is too large.');const candidate=validate(normalize(JSON.parse(await f.text())));if(dirty&&!confirm('Replace your unsaved plan? Cancel and save first to keep it.'))return;state=structuredClone(candidate);dirtySectors={home:false,farm:false};startedSectors={home:true,farm:true};mount();mountFarm();selectedSector=state.activeSector||'home';if(selectedSector==='farm')showFarmStep(0);else showStep(0);requestAnimationFrame(()=>{const target=document.getElementById('planner');if(target)target.scrollIntoView({block:'start',behavior:'instant'});});notifyUI('Saved plan opened successfully.');dirty=false;$('status').textContent='Plan opened • Changes remain in this tab until saved';if($('farmStatus'))$('farmStatus').textContent='Both planners opened • Save again after making changes'}catch(err){$('error').textContent='Could not open file. Your current work is unchanged. '+err.message;if($('farmError'))$('farmError').textContent=$('error').textContent;alert($('error').textContent)}};$('reset').onclick=()=>{if(dirtySectors.home&&!confirm('Replace unsaved home changes with the example? The farmland draft will be kept.'))return;const preservedFarm=state.farm,preservedScenarios=state.scenarioSets?.farm||[];state=defaults();state.farm=preservedFarm;state.scenarioSets.farm=preservedScenarios;startedSectors.home=true;mark('home');mount()};window.addEventListener('beforeunload',e=>{if(dirty){e.preventDefault();e.returnValue=''}});mount();

let currentStep=0,currentResult=0;
function compactHelp(){document.querySelectorAll('.field-help').forEach(help=>{if(help.closest('details'))return;const label=help.parentElement,wrap=document.createElement('div');label.before(wrap);wrap.append(label);const details=document.createElement('details');details.className='help-toggle';const summary=document.createElement('summary');summary.textContent='What goes here?';details.append(summary,help);wrap.append(details)});groupHomeFields()}
function groupHomeFields(){const root=document.getElementById('homeFields');if(!root||root.querySelector('.cost-group'))return;const groups=[['Regular home costs',['tax','insurance','maintenance','utilities']],['Repairs and selling costs',['repairs','sellPercent','sellFixed']]];for(const [title,keys] of groups){const d=document.createElement('details');d.className='cost-group';d.style.gridColumn='1 / -1';d.innerHTML='<summary>'+title+' <span class="note">— click to edit</span></summary>';const grid=document.createElement('div');grid.className='fields';grid.style.marginTop='18px';for(const key of keys){const field=document.getElementById(key);grid.append(field.closest('label').parentElement)}d.append(grid);root.append(d)}}
function startPlan(example){if(dirtySectors.home&&!confirm('Replace the unsaved home plan? Your farmland draft will be kept. Cancel to keep this home plan.'))return false;startedSectors.home=true;const priorFarm=state.farm,priorFarmScenarios=state.scenarioSets?.farm||[];state=defaults();state.farm=priorFarm||farmDefaults();state.scenarioSets.farm=priorFarmScenarios;if(!example){for(const [k] of specs)if(k!=='years')state[k]=0;state.shock=0;state.planMode='own';state.owners=[{name:'Owner 1',share:50,capacity:0},{name:'Owner 2',share:50,capacity:0}];state.custom=[0,0];state.unknown=Object.fromEntries(specs.filter(([k])=>k!=='years').map(([k])=>[k,true]));state.unknown['capacity:0']=true;state.unknown['capacity:1']=true}mount();mark();$('resumePlan').hidden=false;showStep(0)}
function showWelcome(){if(typeof closeFeatureDetail==='function'){closeFeatureDetail(false);if(location.hash.startsWith('#benefits/'))history.replaceState(null,'','#home')}if($('farmWorkspace'))$('farmWorkspace').hidden=true;document.getElementById('home').hidden=false;document.getElementById('wizard').hidden=true;selectSector('home');scrollToPlanningTop();}

function scrollToPlanningTop(){
  const target=document.getElementById('wizard')&&!document.getElementById('wizard').hidden?document.getElementById('wizard'):document.getElementById('farmWorkspace');
  const jump=()=>{if(!target||target.hidden)return;const header=document.querySelector('body > header');const offset=header&&getComputedStyle(header).position==='sticky'?header.getBoundingClientRect().height+12:12;const top=Math.max(0,target.getBoundingClientRect().top+window.scrollY-offset);window.scrollTo({top,behavior:'instant'});};
  jump();requestAnimationFrame(()=>requestAnimationFrame(jump));
}
const guidanceByStep=[
'**Start here:** Enter the estimated home value, remaining mortgage, and other costs. If you are unsure, use a rough estimate and refine it later.',
'**Who is involved?** Add each family member and their share. Shares should total 100% so the comparison is meaningful.',
'**Optional buyout:** Use this step only if one person wants to keep the property and compensate the others. Otherwise continue to the comparison.',
'**Compare the choices:** Look at the amount each person would receive or owe. Change earlier inputs to test what happens if the value or costs change.',
'**Next steps:** Use the results as a conversation starter, then save or print a copy. This is a planning estimate, not legal or financial advice.'
];
function showStep(n){if(n===2&&state.buyoutEnabled!==true)n=currentStep>2?1:3;state.activeSector='home';selectSector('home');if($('farmWorkspace'))$('farmWorkspace').hidden=true;currentStep=Math.max(0,Math.min(4,n));$('resumePlan').hidden=false;document.getElementById('home').hidden=true;document.getElementById('wizard').hidden=false;document.querySelectorAll('.wizard-page').forEach((p,i)=>p.hidden=i!==currentStep);document.querySelectorAll('[data-gostep]').forEach((b,i)=>{if(i===currentStep)b.setAttribute('aria-current','step');else b.removeAttribute('aria-current')});document.getElementById('backStep').textContent=currentStep===0?'← Home':'← Back';document.getElementById('nextStep').textContent=currentStep===4?'Back to comparison':'Continue →';document.getElementById('stepCaption').textContent='Step '+(currentStep+1)+' of 5';if(document.getElementById('wizardGuidance'))document.getElementById('wizardGuidance').textContent=guidanceByStep[currentStep].replaceAll('**','');document.getElementById('stepProgress').style.width=((currentStep+1)/5*100)+'%';animatePanel(document.querySelector('.wizard-page[data-step="'+currentStep+'"]'));updateStepHelp('home',currentStep);if(window.matchMedia('(max-width:700px)').matches)document.querySelector('[data-gostep="'+currentStep+'"]').scrollIntoView({block:'nearest',inline:'center'});scrollToPlanningTop();}
function showResult(n){currentResult=n;document.querySelectorAll('[data-resultpanel]').forEach((p,i)=>{p.hidden=i!==n;if(i===n)animatePanel(p)});document.querySelectorAll('[data-resulttab]').forEach((b,i)=>{b.setAttribute('aria-selected',i===n?'true':'false');b.tabIndex=i===n?0:-1})}
function buildWizard(){
const main=document.querySelector('main'),home=document.getElementById('home'),layout=document.querySelector('.layout'),aside=layout.querySelector('aside'),right=layout.querySelector('section');
const inputPanels=Array.from(aside.querySelectorAll(':scope > .panel')),resultPanels=Array.from(right.querySelectorAll(':scope > .panel'));
const wizard=document.createElement('section');wizard.id='wizard';wizard.hidden=true;home.after(wizard);
const stepNames=['The home','The family','One keeps it','Compare','Talk it over'];
wizard.innerHTML='<div class="section-label"><div><span id="stepCaption" class="step-caption">Step 1 of 5</span><h2 style="margin:8px 0">A clearer plan, one step at a time.</h2></div></div><nav class="wizardbar" aria-label="Planning steps">'+stepNames.map((name,i)=>'<button type="button" data-gostep="'+i+'">'+(i+1)+'. '+name+'</button>').join('')+'</nav><div class="wizard-progress"><i id="stepProgress" style="width:20%"></i></div>';

const guidanceBox=document.createElement('div');guidanceBox.className='guidance-tip';guidanceBox.id='wizardGuidance';guidanceBox.setAttribute('role','note');wizard.append(guidanceBox);guidanceBox.textContent=guidanceByStep[0].replaceAll('**','');
for(const id of ['status','error'])wizard.append(document.getElementById(id));
const pages=stepNames.map((_,i)=>{const d=document.createElement('div');d.className='wizard-page';d.dataset.step=i;d.hidden=i!==0;wizard.append(d);return d});
pages[0].append(inputPanels[0]);pages[1].append(inputPanels[1],inputPanels[2]);pages[2].append(inputPanels[3]);
const intro=document.createElement('p');intro.className='wizard-note';intro.textContent='Not planning for one person to keep the home? You can skip these estimates and compare sharing or selling.';pages[2].prepend(intro);
const cards=right.querySelector('.cards');const takeaway=document.createElement('div');takeaway.id='takeaway';takeaway.className='takeaway';takeaway.setAttribute('aria-live','polite');pages[3].append(takeaway,cards,document.getElementById('warnings'));
const tabs=document.createElement('div');tabs.className='optiontabs';tabs.setAttribute('role','tablist');tabs.setAttribute('aria-label','Compare your options');const resultNames=['Each person','Make it affordable','Wait 6–12 months','Extra repair'];tabs.innerHTML=resultNames.map((n,i)=>'<button type="button" role="tab" data-resulttab="'+i+'" id="result-tab-'+i+'" aria-controls="result-panel-'+i+'">'+n+'</button>').join('');pages[3].append(tabs);
resultPanels.slice(0,4).forEach((p,i)=>{p.dataset.resultpanel=i;p.id='result-panel-'+i;p.setAttribute('role','tabpanel');p.setAttribute('aria-labelledby','result-tab-'+i);pages[3].append(p)});
pages[4].append(resultPanels[4]);for(const panel of resultPanels.slice(5)){const d=document.createElement('details');d.className='panel';const title=panel.querySelector('h2');const summary=document.createElement('summary');summary.textContent=title.textContent;title.remove();d.append(summary);while(panel.firstChild)d.append(panel.firstChild);pages[4].append(d)}

const controls=document.createElement('div');controls.className='wizard-controls';controls.innerHTML='<button class="secondary" id="backStep">← Home</button><button id="nextStep">Continue →</button>';wizard.append(controls);
const reset=aside.querySelector('#reset');reset.style.marginTop='20px';pages[0].append(reset);
// Remove the old long-page containers once all live controls have been moved.
layout.remove();document.getElementById('planner').remove();document.querySelector('.quick-guide')?.remove();Array.from(main.children).filter(x=>x.tagName==='P'||x.tagName==='SPAN').forEach(x=>x.remove());
document.querySelectorAll('[data-gostep]').forEach(b=>b.onclick=()=>showStep(Number(b.dataset.gostep)));
document.querySelectorAll('[data-resulttab]').forEach(b=>{b.onclick=()=>showResult(Number(b.dataset.resulttab));b.onkeydown=e=>{if(['ArrowLeft','ArrowRight','Home','End'].includes(e.key)){e.preventDefault();const n=e.key==='Home'?0:e.key==='End'?3:(currentResult+(e.key==='ArrowRight'?1:3))%4;showResult(n);document.querySelector('[data-resulttab="'+n+'"]').focus()}}});
document.getElementById('backStep').onclick=()=>currentStep===0?showWelcome():showStep(currentStep-1);document.getElementById('nextStep').onclick=()=>showStep(currentStep===4?3:currentStep+1);
const guide=document.createElement('details');guide.className='panel';guide.innerHTML='<summary>New to this? The three choices explained</summary><p><b>Share it:</b> Everyone keeps their part of the home and shares the bills.</p><p><b>One keeps it:</b> One person pays the others for their shares. This is called a buyout.</p><p><b>Sell it:</b> Pay the home loan and selling fees, then divide what is left.</p>';pages[3].prepend(guide);
showResult(0);compactHelp();render();
}
buildWizard();

function farmDefaults(){return {goal:'unsure',unknown:{},buyoutEnabled:false,mode:'example',acres:80,rentAcres:65,value:480000,debt:40000,payment:400,tax:1800,insurance:900,upkeep:1600,repairs:5000,rentPerAcre:180,collection:100,leaseCosts:800,sellPercent:6,sellFixed:2500,cash:30000,closing:5000,availableCash:45000,rate:6.5,years:20,buyer:0,rentDrop:20,notes:'',owners:[{name:'Alex',share:40,capacity:12000},{name:'Jordan',share:30,capacity:3000},{name:'Sam',share:30,capacity:2000}]}}
function validateFarm(f){validatePlanningMeta(f);if(!f||!['example','own'].includes(f.mode))throw Error('Invalid farmland plan.');for(const k of ['acres','rentAcres','value','debt','payment','tax','insurance','upkeep','repairs','rentPerAcre','collection','leaseCosts','sellPercent','sellFixed','cash','closing','availableCash','rate','years','rentDrop'])if(typeof f[k]!=='number'||!Number.isFinite(f[k])||f[k]<0||f[k]>100000000)throw Error('Check the farmland amount for '+k+'.');if(f.rentAcres>f.acres)throw Error('Acres rented cannot exceed total acres.');if(f.collection>100||f.rentDrop>100||f.rate>100||f.sellPercent>100||f.years<1||f.years>50||!Number.isInteger(f.years))throw Error('Check farmland percentages and loan years.');if(!Array.isArray(f.owners)||f.owners.length<2||f.owners.length>6)throw Error('Use 2–6 landowners.');for(const o of f.owners)if(!o||typeof o.name!=='string'||o.name.length>60||!Number.isFinite(o.share)||o.share<0||o.share>100||!Number.isFinite(o.capacity)||o.capacity<0||o.capacity>100000000)throw Error('Check each landowner’s name, share, and yearly budget.');if(Math.abs(f.owners.reduce((a,o)=>a+o.share,0)-100)>.001)throw Error('Land ownership percentages must add up to 100%.');if(!Number.isInteger(f.buyer)||f.buyer<0||f.buyer>=f.owners.length||typeof f.notes!=='string'||f.notes.length>6000)throw Error('Check the farmland buyer and notes.');return f}
function farmCalc(f){const operating=f.tax+f.insurance+f.upkeep,keep=operating+12*f.payment,rent=f.rentAcres*f.rentPerAcre*f.collection/100,netRent=rent-f.leaseCosts-keep,equity=f.value-f.debt,buyout=equity*(1-f.owners[f.buyer].share/100),need=f.debt+buyout,loan=Math.max(0,need-f.cash),buyAnnual=payment(loan,f.rate,f.years)*12+operating,upfront=Math.min(f.cash,Math.max(0,need))+f.closing+f.repairs,sale=f.value-f.debt-f.value*f.sellPercent/100-f.sellFixed;return {operating,keep,rent,netRent,equity,buyout,need,loan,buyAnnual,upfront,sale,buyAfterRent:buyAnnual+f.leaseCosts-rent,stressNet:rent*(1-f.rentDrop/100)-f.leaseCosts-keep}}
let selectedSector='home',farmStep=0,farmResult=0;
const farmFields=[['acres','Total acres','Include all the land in this plan. Use the deed, survey, or property records to check it.'],['value','What could the whole property sell for? ($)','A total value, not a price per acre. Include buildings only if they belong in this same property valuation.'],['debt','Amount owed against this land ($)','The full payoff amount for the loan included here. Other debts are not automatically included.'],['payment','Current land loan payment per month ($)','Loan and interest only. Taxes and insurance are entered separately. Use 0 if no loan.'],['tax','Property taxes per year ($)','Use the current tax bill. No special assessment, exemption, or tax treatment is assumed.'],['insurance','Insurance per year ($)','Use a quote or renewal for this property and the intended use.'],['upkeep','Upkeep set aside each year ($)','Fences, access roads, drainage, and other regular ownership costs. Not crop-production costs.'],['repairs','Repairs needed now ($)','One-time work paid in cash in the keep and buyout scenarios. Sale assumes no repairs first.'],['rentAcres','Acres you could rent to a farmer','Only the usable acres covered by a cash-rent agreement. This can be less than total acreage.'],['rentPerAcre','Cash rent per rented acre per year ($)','Enter a lease quote or agreed amount. This tool does not estimate market rent.'],['collection','Percent of annual rent you expect to collect (%)','100 means all the rent. A lower figure can represent time without a tenant or missed payments. It is your assumption.'],['leaseCosts','Extra landlord costs per year ($)','Costs for renting out the land not already counted above. Do not count the same cost twice.'],['cash','Buyer cash toward the land ($)','Savings used to reduce the new loan. Fees and repairs are separate.'],['closing','Buyout fees paid now ($)','One-time lender and transfer fees. Use actual quotes when available.'],['availableCash','Total cash the buyer can use ($)','Includes cash toward land, fees, and repairs. Leave out money that should stay in savings.'],['rate','New loan interest rate (%)','Your assumed fixed annual rate, not an offer. Enter 6.5 for 6.5%.'],['years','Years to repay the new loan','1–50 whole years. A lender may offer different terms.'],['sellPercent','Selling fees (% of selling price)','Editable assumption. This is not a quoted fee.'],['sellFixed','Other selling costs ($)','One-time selling costs not already counted in the percentage.'],['rentDrop','What if rental income falls by (%)?','Tests a drop from the rent already adjusted by your collection percentage. Costs stay the same.']];
function farmInputs(keys){return keys.map(k=>{const spec=farmFields.find(x=>x[0]===k);return '<div><label>'+spec[1]+'<input type="number" min="'+(k==='years'?1:0)+'" max="'+(['rate','collection','sellPercent','rentDrop'].includes(k)?100:k==='years'?50:100000000)+'" step="'+(k==='years'?1:'any')+'" data-farm="'+k+'" value="'+state.farm[k]+'"></label><details class="farm-help"><summary>Where do I find this?</summary><p>'+spec[2]+'</p></details></div>'}).join('')}
function selectSector(sector){selectedSector=sector;$('resumePlan').hidden=!startedSectors[sector];updateStoryArt(sector);setStoryOption(storyOption);$('chooseHome').setAttribute('aria-pressed',sector==='home');$('chooseFarm').setAttribute('aria-pressed',sector==='farm');$('sectorDescription').textContent=sector==='farm'?'Farmland planner · Compare keeping, cash renting, buying out, or selling inherited land.':'Home planner · Compare sharing, buying out, or selling a house.'}
function startSelected(example){if(selectedSector==='home')return startPlan(example);if(dirtySectors.farm&&!confirm('Replace the unsaved farmland plan? Your home draft will be kept. Cancel to keep this farmland plan.'))return false;startedSectors.farm=true;state.activeSector='farm';state.farm=farmDefaults();if(state.scenarioSets)state.scenarioSets.farm=[];if(!example){state.farm.mode='own';for(const [k] of farmFields)if(k!=='years')state.farm[k]=0;state.farm.collection=100;state.farm.owners=[{name:'Owner 1',share:50,capacity:0},{name:'Owner 2',share:50,capacity:0}];state.farm.unknown=Object.fromEntries(farmFields.filter(([k])=>!['years','collection','rentDrop'].includes(k)).map(([k])=>[k,true]));state.farm.unknown['capacity:0']=true;state.farm.unknown['capacity:1']=true}mountFarm();mark();showFarmStep(0)}
function resumeSelected(){if(selectedSector==='farm')showFarmStep(farmStep);else showStep(currentStep)}
function showFarmStep(n){farmStep=Math.max(0,Math.min(3,n));state.activeSector='farm';selectedSector='farm';$('home').hidden=true;$('wizard').hidden=true;$('farmWorkspace').hidden=false;$('resumePlan').hidden=false;document.querySelectorAll('[data-farmstep]').forEach((p,i)=>p.hidden=i!==farmStep);document.querySelectorAll('[data-farmnav]').forEach((b,i)=>{if(i===farmStep)b.setAttribute('aria-current','step');else b.removeAttribute('aria-current')});$('farmProgress').style.width=(farmStep+1)/4*100+'%';$('farmBack').textContent=farmStep===0?'← Home':'← Back';$('farmNext').textContent=farmStep===3?'Review land details':'Continue →';renderFarm();animatePanel(document.querySelector('[data-farmstep="'+farmStep+'"]'));updateStepHelp('farm',farmStep);if(window.matchMedia('(max-width:700px)').matches)document.querySelector('[data-farmnav="'+farmStep+'"]').scrollIntoView({block:'nearest',inline:'center'});scrollToPlanningTop();}
function mountFarm(){if(!$('farmWorkspace'))return;const f=state.farm;$('farmLandFields').innerHTML=farmInputs(['acres','value','debt','payment']);$('farmCostFields').innerHTML=farmInputs(['tax','insurance','upkeep','repairs']);$('farmLeaseFields').innerHTML=farmInputs(['rentAcres','rentPerAcre','collection','leaseCosts']);$('farmBuyFields').innerHTML=farmInputs(['cash','closing','availableCash','rate','years']);$('farmSellFields').innerHTML=farmInputs(['sellPercent','sellFixed']);$('farmStressFields').innerHTML=farmInputs(['rentDrop']);$('farmOwnerCount').value=f.owners.length;$('farmOwners').innerHTML=f.owners.map((o,i)=>'<div class="farmowner"><div class="farm-fields"><label>Owner '+(i+1)+' nickname<input maxlength="60" data-fowner="'+i+'" data-fkey="name" value="'+esc(o.name)+'"></label><label>Owns this much of the land (%)<input type="number" min="0" max="100" step="any" data-fowner="'+i+'" data-fkey="share" value="'+o.share+'"></label><label>Can pay toward the land each year ($)<input type="number" min="0" max="100000000" step="any" data-fowner="'+i+'" data-fkey="capacity" value="'+o.capacity+'"></label></div></div>').join('');farmBuyerOptions();$('farmNotes').value=f.notes;renderFarm()}
function farmBuyerOptions(){$('farmBuyer').innerHTML=state.farm.owners.map((o,i)=>'<option value="'+i+'">'+esc(o.name||'Owner '+(i+1))+'</option>').join('');$('farmBuyer').value=state.farm.buyer}
function farmTab(n){farmResult=n;document.querySelectorAll('[data-fresult]').forEach((p,i)=>{p.hidden=i!==n;if(i===n)animatePanel(p)});document.querySelectorAll('[data-ftab]').forEach((b,i)=>{b.setAttribute('aria-selected',i===n?'true':'false');b.tabIndex=i===n?0:-1})}
function renderFarm(){if(!$('farmWorkspace'))return;try{validateFarm(state.farm);$('farmError').textContent=''}catch(e){$('farmError').textContent=e.message+' Results are paused until corrected.';for(const id of ['farmTakeaway','farmMetrics','farmOwnerResults','farmLeaseResults','farmBuyResults','farmStressResults'])$(id).textContent='Check the land details before using these results.';return}const f=state.farm,c=farmCalc(f),b=f.owners[f.buyer];$('farmMode').textContent=f.mode==='example'?'Fictional example • These are made-up values, not Kentucky market estimates.':'Your estimates • Zero means no cost. Check every cost and rate before relying on a result.';
$('farmTakeaway').innerHTML=f.acres===0||f.value===0?'<strong>Start with the acreage and total property value.</strong><p>You do not need to know every number yet. Gather the tax bill, loan statement, upkeep estimates, and any lease quote. Record uncertain figures in your notes.</p>':'<strong>'+f.acres.toLocaleString()+' acres. '+money(c.keep)+' a year to keep it before rent.</strong><p>Your rent assumptions would '+(c.netRent>=0?'leave '+money(c.netRent)+' a year after the listed bills.':'leave '+money(-c.netRent)+' a year of bills for the family to cover.')+' Selling would '+(c.sale>=0?'leave '+money(c.sale)+' to split.':'need '+money(-c.sale)+' extra to cover debt and selling costs.')+'</p>';
$('farmMetrics').innerHTML=[['Keep without rent',c.keep,'per year for everyone'],['Rent it out',Math.abs(c.netRent),c.netRent>=0?'left per year after listed bills':'family pays per year after rent'],['One person buys out',c.equity>=0?c.buyAnnual:null,'per year before rent'],['Sell the land',c.sale,'left after debt and selling costs']].map((x,i)=>'<div class="metric '+''+'"><span class="label">'+x[0]+'</span><strong>'+ (x[1]===null?'Not modeled':money(x[1]))+'</strong><small>'+x[2]+'</small></div>').join('');
let warnings=[];if(c.equity<0)warnings.push('Debt is larger than the land value. A normal buyout cannot be calculated here.');if(c.sale<0)warnings.push('Selling leaves a cash shortfall. This tool does not decide who is responsible for it.');const cannotKeep=f.owners.filter(o=>c.keep*o.share/100>o.capacity);if(cannotKeep.length)warnings.push(cannotKeep.map(o=>o.name||'An owner').join(', ')+' would exceed their yearly land budget when keeping the land without rent.');if(c.equity>=0&&c.buyAnnual>b.capacity)warnings.push((b.name||'The buyer')+' would need '+money(c.buyAnnual-b.capacity)+' more per year than their budget before rent.');if(f.rentAcres===0)warnings.push('No rented acres are entered, so this plan counts no rental income.');$('farmWarnings').innerHTML=warnings.map(w=>'<div class="alert">'+esc(w)+'</div>').join('');
$('farmOwnerResults').innerHTML='<h2>What does each person pay or receive?</h2><p class="note">Yearly amounts follow ownership percentages. Rental money is divided only after the listed annual costs. Repairs needed now are separate.</p><div class="scroll"><table><tr><th>Owner</th><th>Owns</th><th>Budget / year</th><th>Keep: pays / year</th><th>Rent: gets or pays / year</th><th>Sell: gets</th><th>Buyout: pays or gets</th></tr>'+f.owners.map((o,i)=>'<tr><td>'+esc(o.name)+'</td><td>'+o.share+'%</td><td>'+money(o.capacity)+'</td><td>'+money(c.keep*o.share/100)+'</td><td>'+(c.netRent>=0?'Gets ':'Pays ')+money(Math.abs(c.netRent)*o.share/100)+'</td><td>'+(c.sale>=0?money(c.sale*o.share/100):'Cash shortfall')+'</td><td>'+(c.equity<0?'Not modeled':i===f.buyer?'Pays '+money(c.buyout):'Gets '+money(c.equity*o.share/100))+'</td></tr>').join('')+'</table></div><p class="note">Repairs needed now: '+money(f.repairs)+', split by ownership if kept together. Ownership percentages do not automatically change when someone pays more.</p>';
const rentNeeded=f.rentAcres>0&&f.collection>0?(c.keep+f.leaseCosts)/(f.rentAcres*f.collection/100):null;
$('farmLeaseResults').innerHTML='<h2>Can rent cover the bills?</h2><div class="farm-grid"><div><p class="annual">'+money(c.rent)+' expected rent per year</p><p>'+f.rentAcres+' rented acres × '+money(f.rentPerAcre)+' per acre × '+f.collection+'% collected.</p><p>Less '+money(c.keep)+' in regular land costs and loan payments, plus '+money(f.leaseCosts)+' in extra landlord costs.</p></div><div class="takeaway"><strong class="'+(c.netRent>=0?'lease-positive':'lease-negative')+'">'+money(Math.abs(c.netRent))+' '+(c.netRent>=0?'left each year':'needed from the family each year')+'</strong><p>Before income taxes and repairs needed now.</p></div></div><p>'+(rentNeeded===null?'Enter rented acres and a collection percentage above zero to calculate the rent needed to cover annual costs.':'At your collection assumption, rent of about '+money(rentNeeded)+' per rented acre per year would cover the listed annual costs. This is a break-even calculation, not a market rent estimate.')+'</p><div class="farm-visual"><i style="width:'+(c.keep+f.leaseCosts?Math.min(100,c.rent/(c.keep+f.leaseCosts)*100):100)+'%"></i></div><p class="note">Rent may arrive once or twice a year while bills arrive sooner. This compares annual totals and does not guarantee cash will be available when a bill is due. No tenant, lease, or payment is guaranteed.</p>';
$('farmBuyResults').innerHTML='<h2>'+esc(b.name)+' keeps the land</h2>'+(c.equity<0?'<p>A normal buyout is not modeled while the debt exceeds the land value.</p>':'<div class="gap-grid"><div class="gap-item"><span class="note">Cash needed now</span><strong>'+money(c.upfront)+'</strong><p class="note">'+money(Math.max(0,c.upfront-f.availableCash))+' more than available cash</p></div><div class="gap-item"><span class="note">Buyer’s annual cost before rent</span><strong>'+money(c.buyAnnual)+'</strong><p class="note">Budget: '+money(b.capacity)+' per year</p></div></div><p>Other owners receive '+money(c.buyout)+' combined. The new loan would be '+money(c.loan)+'.</p><p>After your rent assumptions, the buyer would '+(c.buyAfterRent>=0?'need to pay '+money(c.buyAfterRent)+' each year.':'have '+money(-c.buyAfterRent)+' left each year.')+' This includes the new loan and listed annual costs, before income taxes.</p><p class="note">This replaces the full existing land loan with a new fixed-rate loan and pays the other owners their shares of value after debt. Fees and repairs are paid in cash. It does not assess lender approval or special agricultural loan terms.</p>');
$('farmStressResults').innerHTML='<h2>What if rent is lower?</h2><p>If expected rental income drops '+f.rentDrop+'% and the listed costs stay the same, the family would '+(c.stressNet>=0?'have '+money(c.stressNet)+' left each year.':'need to cover '+money(-c.stressNet)+' each year.')+'</p><p>For the first year, repairs needed now would also cost '+money(f.repairs)+'.</p><p class="note">This is a cash-rent ownership comparison. It does not estimate harvest revenue, crop yields, equipment costs, livestock income, crop-share leases, farm-business profit, or income taxes.</p>';
}
function buildFarm(){const section=document.createElement('section');section.id='farmWorkspace';section.hidden=true;section.innerHTML='<div class="section-label"><div><span class="farm-kicker">Land & legacy / Farmland planner</span><h2>A future for the family acres.</h2><p class="result-intro">Separate land ownership from running a farming business. Compare annual costs, cash rent, a buyout, and a sale.</p></div></div><nav class="wizardbar" aria-label="Farmland planning steps">'+['The land','The owners','Rent & buyout','Compare'].map((n,i)=>'<button data-farmnav="'+i+'">'+(i+1)+'. '+n+'</button>').join('')+'</nav><div class="wizard-progress"><i id="farmProgress" style="width:25%"></i></div><p id="farmStatus" role="status">Save plan keeps both home and farmland figures in one file.</p><p id="farmError" role="alert"></p><p id="farmMode" class="note"></p>'+ 
'<div class="farm-step" data-farmstep="0"><div class="panel"><h2>1. Start with the land</h2><div class="farm-note">Use only the property in this farmland plan. If a farmhouse is included in the land value, do not add the same house again when comparing totals elsewhere. The two planners are separate scenarios, not a combined estate total.</div><div id="farmLandFields" class="farm-fields" style="margin-top:20px"></div><details class="farm-detail"><summary>Yearly ownership costs and repairs</summary><div id="farmCostFields" class="farm-fields" style="margin-top:20px"></div></details><p class="note">Not sure yet? Look for a loan statement, tax bill, insurance renewal, survey or deed, repair estimates, and a property valuation. Enter tentative figures and record what needs checking.</p></div></div>'+ 
'<div class="farm-step" data-farmstep="1" hidden><div class="panel"><h2>2. Who owns it?</h2><p class="note">Use the actual ownership shares. This tool does not determine inheritance rights. Yearly budgets are what each person can pay after their other living costs.</p><label>Number of landowners<select id="farmOwnerCount">'+[2,3,4,5,6].map(n=>'<option>'+n+'</option>').join('')+'</select></label><div id="farmOwners"></div><label>Who would buy the others’ shares?<select id="farmBuyer"></select></label></div></div>'+ 
'<div class="farm-step" data-farmstep="2" hidden><div class="panel"><h2>3. Rent the land to a farmer</h2><p class="note">This means cash rent paid to the landowners—not money earned from growing or selling crops yourself. All rental figures are annual.</p><div id="farmLeaseFields" class="farm-fields"></div></div><details class="panel"><summary>If one person buys out the others</summary><div id="farmBuyFields" class="farm-fields" style="margin-top:20px"></div></details><details class="panel"><summary>Selling fees and a rent stress test</summary><div id="farmSellFields" class="farm-fields" style="margin-top:20px"></div><div id="farmStressFields" class="farm-fields" style="margin-top:20px"></div></details></div>'+ 
'<div class="farm-step" data-farmstep="3" hidden><div id="farmTakeaway" class="takeaway" aria-live="polite"></div><div id="farmMetrics" class="metric-grid"></div><div id="farmWarnings"></div><div class="farm-tabs" role="tablist" aria-label="Farmland comparisons">'+['Each owner','Rental income','One keeps it','Lower rent'].map((n,i)=>'<button role="tab" id="farmtab-'+i+'" aria-controls="farmresult-'+i+'" data-ftab="'+i+'">'+n+'</button>').join('')+'</div><div class="panel" role="tabpanel" id="farmresult-0" aria-labelledby="farmtab-0" data-fresult="0"><div id="farmOwnerResults"></div></div><div class="panel" role="tabpanel" id="farmresult-1" aria-labelledby="farmtab-1" data-fresult="1" hidden><div id="farmLeaseResults"></div></div><div class="panel" role="tabpanel" id="farmresult-2" aria-labelledby="farmtab-2" data-fresult="2" hidden><div id="farmBuyResults"></div></div><div class="panel" role="tabpanel" id="farmresult-3" aria-labelledby="farmtab-3" data-fresult="3" hidden><div id="farmStressResults"></div></div><details class="panel"><summary>Family notes and questions</summary><label style="margin-top:15px">What do you need to confirm?<textarea id="farmNotes" maxlength="6000" placeholder="Check the tenant’s lease, who maintains fences, ownership shares, and the land value."></textarea></label></details><details class="panel"><summary>Assumptions and limits</summary><p class="note">Annual keep cost = current monthly loan payment × 12 + annual property tax + insurance + upkeep. Expected rent = rented acres × annual rent per acre × collection percentage. Rent left = expected rent minus annual keep cost and extra landlord costs. Repairs needed now are a separate cash cost. Sale = total value minus loan payoff, selling percentage × value, and fixed selling fees. Buyout = the other owners’ shares of value minus debt; a new loan pays off the old loan and funds the buyout after buyer cash. Income taxes, estate debts beyond the entered loan, liens, future value changes, land division, agricultural tax treatments, production income, and business assets are not calculated. No legal or tax outcome is inferred.</p><p class="note">For education only. Estimates are not financial, investment, tax, or legal advice. No calculations or conclusions are endorsed by Globefin or the University of Kentucky.</p></details><div class="farm-tools"><button onclick="preparePrint()">Print farmland summary</button><button class="secondary" onclick="showWelcome()">Switch property planner</button></div></div>'+ 
'<div class="wizard-controls"><button id="farmBack" class="secondary">← Home</button><button id="farmNext">Continue →</button></div>';
$('wizard').after(section);document.querySelectorAll('[data-farmnav]').forEach(b=>b.onclick=()=>showFarmStep(+b.dataset.farmnav));document.querySelectorAll('[data-ftab]').forEach(b=>{b.onclick=()=>farmTab(+b.dataset.ftab);b.onkeydown=e=>{if(['ArrowLeft','ArrowRight','Home','End'].includes(e.key)){e.preventDefault();farmTab(e.key==='Home'?0:e.key==='End'?3:(farmResult+(e.key==='ArrowRight'?1:3))%4);document.querySelector('[data-ftab="'+farmResult+'"]').focus()}}});$('farmBack').onclick=()=>farmStep===0?showWelcome():showFarmStep(farmStep-1);$('farmNext').onclick=()=>showFarmStep(farmStep===3?0:farmStep+1);$('farmOwnerCount').onchange=e=>{const n=+e.target.value,f=state.farm;f.owners=Array.from({length:n},(_,i)=>({name:f.owners[i]?.name||'Owner '+(i+1),share:i===n-1?100-Math.floor(100/n)*(n-1):Math.floor(100/n),capacity:f.owners[i]?.capacity||0}));f.buyer=Math.min(f.buyer,n-1);mark();mountFarm()};$('farmBuyer').onchange=e=>{state.farm.buyer=+e.target.value;mark();renderFarm()};section.addEventListener('input',e=>{const t=e.target;if(t.dataset.farm){state.farm[t.dataset.farm]=t.value===''?NaN:Number(t.value)}else if(t.dataset.fowner!==undefined){state.farm.owners[+t.dataset.fowner][t.dataset.fkey]=t.dataset.fkey==='name'?t.value:t.value===''?NaN:Number(t.value);if(t.dataset.fkey==='name')farmBuyerOptions()}else if(t.id==='farmNotes')state.farm.notes=t.value;else return;mark();renderFarm()});mountFarm();farmTab(0)}
function preparePrint(){if(state.activeSector==='farm'){try{validateFarm(state.farm)}catch(e){$('farmError').textContent=e.message;return}const f=state.farm,c=farmCalc(f);$('familySheet').innerHTML='<p>KEEP THE FAMILY HOME & LAND · CLAY DEARDORFF</p><h1>Farmland discussion sheet</h1><p>'+ (f.mode==='example'?'Fictional example':'Your estimates—check all zero costs')+' · '+new Date().toLocaleDateString()+'</p><p>'+f.acres+' acres · Value: '+money(f.value)+' · Debt: '+money(f.debt)+' · Repairs needed now: '+money(f.repairs)+'</p><h2>Annual cash comparison</h2><p>Keep before rent: '+money(c.keep)+'/year. After cash rent: '+(c.netRent>=0?money(c.netRent)+' left':money(-c.netRent)+' to pay')+'/year. Sale leaves '+money(c.sale)+' after listed costs and debt.</p><p>Rent assumption: '+f.rentAcres+' acres × '+money(f.rentPerAcre)+'/acre/year × '+f.collection+'% collected. Extra landlord costs: '+money(f.leaseCosts)+'/year.</p><h2>Each owner</h2>'+ $('farmOwnerResults').querySelector('table').outerHTML+'<h2>Buyout scenario</h2><p>'+(c.equity<0?'Not modeled: debt exceeds value.':esc(f.owners[f.buyer].name)+' would need '+money(c.upfront)+' cash now and '+money(c.buyAnnual)+'/year before rent. New loan: '+money(c.loan)+'.')+'</p><h2>Questions</h2><p style="white-space:pre-wrap">'+esc(f.notes.slice(0,1200)||'Confirm ownership shares, lease terms, usable acres, land value, and actual loan and cost quotes.')+'</p><p class="note">Annual cash-rent comparison only. Repair costs are separate from recurring annual costs. No crop revenue, production costs, farm-business assets, income taxes, special tax treatments, land division, or future price changes. Home and farmland scenarios are separate; do not double-count a farmhouse. Not financial, investment, tax, or legal advice.</p>'}else{try{validate(state);render()}catch(e){$('error').textContent=e.message;return}}window.print()}
buildFarm();


// Offline, true 3D line geometry projected onto a 2D canvas; no external rendering library.
const wireState={sector:'home',yaw:.42,pitch:.30,drag:false,lastX:0,lastY:0,phase:0,lastTime:0,needsPaint:true,visible:true};
function rotateWire(delta){wireState.yaw+=delta;wireState.needsPaint=true}
function resetWire(){wireState.yaw=.42;wireState.pitch=.30;wireState.phase=0;wireState.needsPaint=true}

function wireGeometry(sector){const lines=[];const line=(a,b,type='main')=>lines.push({a,b,type});const loop=(pts,type='main')=>pts.forEach((p,i)=>line(p,pts[(i+1)%pts.length],type));
function box(x1,x2,y1,y2,z1,z2,type='main'){loop([[x1,y1,z1],[x2,y1,z1],[x2,y1,z2],[x1,y1,z2]],type);loop([[x1,y2,z1],[x2,y2,z1],[x2,y2,z2],[x1,y2,z2]],type);for(const [x,z]of [[x1,z1],[x2,z1],[x2,z2],[x1,z2]])line([x,y1,z],[x,y2,z],type)}
function gable(x1,x2,z1,z2,h,peak,base=0){box(x1,x2,base,h,z1,z2);const x=(x1+x2)/2;for(const z of [z1,z2]){line([x1-.09,h,z],[x,peak,z],'roof');line([x,peak,z],[x2+.09,h,z],'roof')}line([x,peak,z1],[x,peak,z2],'roof');line([x1-.09,h,z1],[x1-.09,h,z2],'roof');line([x2+.09,h,z1],[x2+.09,h,z2],'roof')}
function frontWindow(x,y,z,w=.34,h=.43){loop([[x-w/2,y,z],[x+w/2,y,z],[x+w/2,y+h,z],[x-w/2,y+h,z]],'window');line([x,y,z],[x,y+h,z],'detail');line([x-w/2,y+h/2,z],[x+w/2,y+h/2,z],'detail')}
if(sector==='home'){
// Two-storey main volume, attached garage, front porch, dormer, and chimney.
gable(-1.35,1.05,-.95,1.0,1.8,2.65);gable(1.05,2.45,-.75,1.0,1.05,1.63);
for(const y of [.43,1.15])for(const x of [-.91,.63])frontWindow(x,y,1.012,.34,.43);
loop([[-.29,0,1.015],[.13,0,1.015],[.13,.98,1.015],[-.29,.98,1.015]],'detail');line([-.08,0,1.015],[-.08,.98,1.015],'detail');
// Porch roof slopes away from the front wall; posts align with the deck.
box(-.72,.48,0,.1,1.0,1.65,'detail');loop([[-.8,1.09,1], [.56,1.09,1],[.56,.96,1.7],[-.8,.96,1.7]],'roof');for(const x of [-.68,.44])line([x,.1,1.6],[x,.98,1.6],'detail');for(const z of [1.72,1.88])loop([[-.5,0,z],[.26,0,z],[.26,.05,z],[-.5,.05,z]],'detail');
// Garage door with panel lines and upper glazing.
loop([[1.23,.04,1.014],[2.28,.04,1.014],[2.28,.86,1.014],[1.23,.86,1.014]],'detail');for(const y of [.24,.44,.64])line([1.23,y,1.014],[2.28,y,1.014],'detail');line([1.75,.04,1.014],[1.75,.86,1.014],'detail');for(const x of [1.44,1.98])frontWindow(x,.67,1.02,.27,.12);
// Small front-facing dormer and chimney cap.
gable(-.5,.16,.55,1.12,2.25,2.53,1.94);frontWindow(-.17,2.02,1.13,.27,.20);box(-1.02,-.74,2.12,2.92,-.63,-.34,'detail');box(-1.06,-.70,2.91,2.97,-.67,-.30,'roof');
for(const z of [-.45,.43])loop([[2.462,.37,z-.16],[2.462,.37,z+.16],[2.462,.79,z+.16],[2.462,.79,z-.16]],'window');
loop([[-1.9,-.06,-1.45],[2.8,-.06,-1.45],[2.8,-.06,2.05],[-1.9,-.06,2.05]],'base');for(let x=-1.9;x<2.9;x+=.47)line([x,-.06,-1.45],[x,-.06,2.05],'grid');for(let z=-1.45;z<2.1;z+=.35)line([-1.9,-.06,z],[2.8,-.06,z],'grid');
 }else{
// Precision farm campus: raised survey tile, crop parcels and modern agricultural buildings.
box(-2.35,2.35,-.20,-.09,-1.9,2.2,'base');
for(let x=-2.35;x<2.4;x+=.47)line([x,-.09,-1.9],[x,-.09,2.2],'grid');
for(let z=-1.9;z<2.3;z+=.41)line([-2.35,-.09,z],[2.35,-.09,z],'grid');
// Contemporary long-span barn, standing seam roof and glazed entrance.
gable(-.85,.65,-1.45,.15,1.05,1.65);
for(let z=-1.4;z<=.15;z+=.16){line([-.93,1.05,z],[-.1,1.65,z],'detail');line([-.1,1.65,z],[.73,1.05,z],'detail')}
for(let x=-.78;x<.65;x+=.16)line([x,0,.163],[x,1.05,.163],'detail');
box(-.59,.39,.03,.87,.17,.19,'window');
for(const x of [-.35,-.1,.15])line([x,.03,.195],[x,.87,.195],'window');
line([-.59,.46,.195],[.39,.46,.195],'window');
// Roof-mounted photovoltaic arrays follow the roof plane.
for(let z=-1.31;z<-.12;z+=.28)for(let t=.18;t<.8;t+=.22){const panel=(u,v)=>[-.1+.83*u,1.67-.60*u,v];loop([panel(t,z),panel(t+.18,z),panel(t+.18,z+.22),panel(t,z+.22)],'window')}
// Equipment shed with open bays and a shallow mono-pitch canopy.
box(-2.02,-1.13,0,.62,-1.48,-.48,'detail');
loop([[-2.10,.79,-1.56],[-1.05,.65,-1.56],[-1.05,.65,-.38],[-2.10,.79,-.38]],'roof');
for(const x of [-1.94,-1.55,-1.2])line([x,0,-.36],[x,.66,-.36],'detail');
// Twin grain silos with ring bands, conical caps and ladder rungs.
function silo(cx,cz,r,h){const n=16;for(const y of [.02,.18,.43,.68,h])loop(Array.from({length:n},(_,i)=>[cx+r*Math.cos(i*2*Math.PI/n),y,cz+r*Math.sin(i*2*Math.PI/n)]),'detail');for(let i=0;i<n;i++){const a=i*2*Math.PI/n,x=cx+r*Math.cos(a),z=cz+r*Math.sin(a);line([x,0,z],[x,h,z],'detail');line([x,h,z],[cx,h+.26,cz],'roof')}for(let y=.1;y<h;y+=.12)line([cx-.09,y,cz+r+.025],[cx+.09,y,cz+r+.025],'window')}
silo(1.14,-1.14,.28,1.13);silo(1.83,-1.14,.24,.91);
// Access lane and three dense planted parcels.
for(const x of [-.92,-.65])line([x,.008,.3],[x,.008,2.02],'detail');
for(const [a,b,c,d] of [[-2.12,-1.13,.38,1.98],[-.4,.76,.48,1.98],[1.02,2.15,.15,1.98]]){
loop([[a,0,c],[b,0,c],[b,0,d],[a,0,d]],'base');
for(let x=a+.10;x<b-.03;x+=.14){line([x,.025,c+.08],[x,.025,d-.08],'field');for(let z=c+.14;z<d-.06;z+=.22){line([x,.025,z],[x,.115,z],'field');line([x-.035,.065,z-.035],[x,.115,z],'field');line([x+.035,.065,z+.035],[x,.115,z],'field')}}}
// Split-rail perimeter fence with regular posts.
for(const z of [-1.73,2.08]){for(let x=-2.2;x<=2.21;x+=.44)line([x,0,z],[x,.23,z],'detail');for(const y of [.10,.20])line([-2.2,y,z],[2.2,y,z],'detail')}
for(const x of [-2.2,2.2]){for(let z=-1.73;z<2.1;z+=.42)line([x,0,z],[x,.23,z],'detail');for(const y of [.10,.20])line([x,y,-1.73],[x,y,2.08],'detail')}
}return lines}
function drawWire(time){const canvas=$('wireModel');if(!canvas)return;const ctx=canvas.getContext('2d');if(!ctx)return;const reduced=window.matchMedia('(prefers-reduced-motion: reduce)').matches,paused=document.body.classList.contains('motion-paused');const dt=wireState.lastTime?Math.min(40,time-wireState.lastTime):16;wireState.lastTime=time;
const active=wireState.visible&&!document.hidden;if(active&&!paused&&!reduced&&!wireState.drag){wireState.yaw=(wireState.yaw+dt*.000065)%(Math.PI*2);wireState.needsPaint=true}if(active&&wireState.needsPaint){wireState.needsPaint=false;const rect=canvas.getBoundingClientRect(),W=rect.width,H=rect.height;if(W&&H){const pixel=Math.min(window.devicePixelRatio||1,2);if(canvas.width!==Math.round(W*pixel)||canvas.height!==Math.round(H*pixel)){canvas.width=Math.round(W*pixel);canvas.height=Math.round(H*pixel)}ctx.setTransform(pixel,0,0,pixel,0,0);ctx.clearRect(0,0,W,H);const yaw=wireState.yaw,pitch=wireState.pitch;const scale=Math.min(W/(wireState.sector==='home'?7.2:6.7),H/4.8)*(W<500&&H<300?.78:1);const project=([x,y,z])=>{const rx=x*Math.cos(yaw)-z*Math.sin(yaw),rz=x*Math.sin(yaw)+z*Math.cos(yaw);return [W/2+rx*scale,H*.64-(y*Math.cos(pitch)-rz*Math.sin(pitch))*scale,rz*Math.cos(pitch)+y*Math.sin(pitch)]};
const lines=wireGeometry(wireState.sector).map(l=>({...l,p:project(l.a),q:project(l.b)})).sort((a,b)=>(a.p[2]+a.q[2])-(b.p[2]+b.q[2]));
for(const l of lines){const opacity=Math.max(.3,Math.min(.95,.72+(l.p[2]+l.q[2])*.035));ctx.beginPath();ctx.moveTo(l.p[0],l.p[1]);ctx.lineTo(l.q[0],l.q[1]);ctx.strokeStyle=l.type==='grid'?'rgba(110,162,226,.11)':l.type==='field'?'rgba(128,184,249,.45)':l.type==='roof'?'rgba(205,228,255,'+opacity+')':l.type==='window'?'rgba(202,148,98,.85)':l.type==='base'?'rgba(113,166,230,.55)':'rgba(148,197,252,'+opacity+')';ctx.lineWidth=l.type==='roof'?1.8:l.type==='grid'?.6:l.type==='detail'?1:1.15;ctx.shadowColor=l.type==='roof'?'#83b8ff':'transparent';ctx.shadowBlur=l.type==='roof'?6:0;ctx.stroke()}
ctx.shadowBlur=0;for(const v of [[-1.9,0,-1.5],[1.9,0,-1.5],[1.9,0,1.5],[-1.9,0,1.5]]){const p=project(v);ctx.beginPath();ctx.arc(p[0],p[1],2,0,Math.PI*2);ctx.fillStyle='#94bce8';ctx.fill()}ctx.font='9px ui-monospace,monospace';ctx.fillStyle='#7ea5d2';ctx.textAlign='center';ctx.fillText(wireState.sector==='farm'?'FAMILY LAND / THREE-DIMENSIONAL STUDY':'FAMILY HOME / THREE-DIMENSIONAL STUDY',W/2,H-52);$('propertyArt').setAttribute('hidden','')} }
requestAnimationFrame(drawWire)}
function initializeWire(){const c=$('wireModel');if(!c||!c.getContext('2d'))return;c.classList.add('ready');c.addEventListener('pointerdown',e=>{wireState.drag=true;wireState.lastX=e.clientX;wireState.lastY=e.clientY;c.setPointerCapture(e.pointerId);c.classList.add('is-dragging')});c.addEventListener('pointermove',e=>{if(!wireState.drag)return;wireState.yaw+=(e.clientX-wireState.lastX)*.006;wireState.pitch=Math.max(.18,Math.min(.55,wireState.pitch+(e.clientY-wireState.lastY)*.004));wireState.lastX=e.clientX;wireState.lastY=e.clientY;wireState.needsPaint=true});const stop=()=>{wireState.drag=false;c.classList.remove('is-dragging')};c.addEventListener('pointerup',stop);c.addEventListener('pointercancel',stop);c.addEventListener('lostpointercapture',stop);window.addEventListener('resize',()=>wireState.needsPaint=true);window.matchMedia('(prefers-reduced-motion: reduce)').addEventListener('change',()=>wireState.needsPaint=true);if('IntersectionObserver'in window)new IntersectionObserver(entries=>{wireState.visible=entries[0].isIntersecting;if(wireState.visible)wireState.needsPaint=true},{threshold:.01}).observe(c);requestAnimationFrame(drawWire)}
function animatePanel(el){if(!el||!el.animate||window.matchMedia('(prefers-reduced-motion: reduce)').matches||document.body.classList.contains('motion-paused'))return;el.getAnimations().forEach(a=>a.cancel());el.animate([{opacity:.25,transform:'translateY(9px)'},{opacity:1,transform:'translateY(0)'}],{duration:260,easing:'cubic-bezier(.2,.7,.2,1)'})}

let storyOption=0;
function updateStoryArt(sector){const svg=$('propertyArt');if(!svg)return;const home='<path class="art-fill" d="M112 112L220 48L328 112V196H112Z"/><path pathLength="1" class="art-line art-roof" d="M92 119L220 42L348 119"/><path pathLength="1" class="art-line" d="M112 108V196H328V108M198 196V130H242V196"/><path class="art-window" d="M139 130H171V164H139ZM269 130H301V164H269Z"/><path class="art-thin" d="M155 130V164M139 147H171M285 130V164M269 147H301M220 26V213M78 196H362M112 205V222M328 205V222M112 216H328M103 208V113M337 208V113"/><path class="blueprint-dim" d="M108 212L116 220M324 212L332 220M99 116L107 108M99 192L107 200"/><circle cx="233" cy="163" r="2" fill="#b6d7ff"/><circle class="art-dot" cx="78" cy="196" r="2"/><circle class="art-dot" cx="362" cy="196" r="2"/><text class="blueprint-note" x="220" y="234" text-anchor="middle">HOME / FRONT ELEVATION</text>';
const farm='<path class="art-fill" d="M170 98L220 57L270 98V145H170Z"/><path pathLength="1" class="art-line art-roof" d="M156 103L220 49L284 103"/><path pathLength="1" class="art-line" d="M170 94V145H270V94M203 145V112H237V145M203 112L237 145M237 112L203 145"/><path class="art-window" d="M212 80H228V94H212Z"/><path class="art-thin" d="M220 30V154M156 145H284M160 98V149M280 98V149M160 151H280"/><path pathLength="1" class="art-field" d="M65 163H375L400 214H40ZM127 163L112 214M189 163L184 214M251 163L256 214M313 163L328 214M58 180H383M49 197H392"/><path class="art-thin" d="M40 221V232M400 221V232M40 226H400"/><path class="blueprint-dim" d="M36 222L44 230M396 222L404 230M156 147L164 155M276 147L284 155"/><circle class="art-dot" cx="65" cy="163" r="2"/><circle class="art-dot" cx="375" cy="163" r="2"/><text class="blueprint-note" x="220" y="239" text-anchor="middle">FARMLAND / PARCEL SCHEMATIC</text>';
wireState.sector=sector;wireState.needsPaint=true;$('wireModel').setAttribute('aria-label',sector==='farm'?'Interactive detailed 3D farm with solar-roof barn, grain silos, equipment shed, crop rows and fencing. Use the rotation buttons below to change the view.':'Interactive 3D wireframe house with porch, garage, dormer, and chimney. Use the rotation buttons below to change the view.');svg.innerHTML=sector==='farm'?farm:home;svg.setAttribute('aria-label',sector==='farm'?'Animated illustration of a barn and farmland':'Animated illustration of a family home');$('sceneTag').textContent=sector==='farm'?'FARMLAND / FAMILY OWNED':'HOME / FAMILY OWNED'}
function setStoryOption(n){storyOption=n;animatePanel($('storyPreview'));const farm=selectedSector==='farm';const copy=[['01 / KEEP IT TOGETHER','Same roots. A shared future.',farm?'See what the land costs to keep—and whether cash rent could help.':'Understand what each person would pay to keep a place in the family.','↔',farm?'Compare annual land bills, rent, and each owner’s share.':'A clearer view of the bills, before deciding who pays what.'],['02 / ONE PERSON KEEPS IT','Make room for the next chapter.',farm?'Explore what it would take for one heir to keep the family acres.':'Explore the cash and monthly budget one person would need to keep the home.','⌂','Understand the buyer’s costs and what the other owners would receive.'],['03 / SELL','A different path. A clear picture.',farm?'Understand what each owner could receive after land debt and selling costs.':'See what could remain for each person after the loan and selling costs.','↗','Compare the numbers together, with the assumptions in plain sight.']][n];$('propertyStory').dataset.option=n;$('storyIndex').textContent=copy[0];$('storyTitle').textContent=copy[1];$('storyText').textContent=copy[2];$('storyIcon').textContent=copy[3];$('storyHint').textContent=copy[4];$('storyPreview').setAttribute('aria-labelledby','story-tab-'+n);document.querySelectorAll('[data-story]').forEach((b,i)=>{b.setAttribute('aria-selected',i===n?'true':'false');b.tabIndex=i===n?0:-1})}
function toggleStoryMotion(){const paused=$('propertyStory').classList.toggle('paused');document.body.classList.toggle('motion-paused',paused);$('globalMotion').textContent=paused?'Play motion':'Pause motion';$('globalMotion').setAttribute('aria-pressed',String(paused));$('globalMotion').setAttribute('aria-label',paused?'Play page animations':'Pause page animations');$('motionButton').textContent=paused?'Play motion':'Pause motion';$('motionButton').setAttribute('aria-pressed',String(paused));$('motionButton').setAttribute('aria-label',paused?'Play page animations':'Pause page animations')}
document.querySelectorAll('[data-story]').forEach(b=>b.addEventListener('keydown',e=>{if(['ArrowLeft','ArrowRight','Home','End'].includes(e.key)){e.preventDefault();const n=e.key==='Home'?0:e.key==='End'?2:(storyOption+(e.key==='ArrowRight'?1:2))%3;setStoryOption(n);$('story-tab-'+n).focus()}}));
updateStoryArt('home');setStoryOption(0);

let toastTimer;
function notifyUI(message){const el=$('uiToast');if(!el)return;el.textContent=message;el.classList.add('is-visible');clearTimeout(toastTimer);toastTimer=setTimeout(()=>el.classList.remove('is-visible'),4500)}
function updateStepHelp(sector,n){const id=sector==='farm'?'farmStepHelp':'homeStepHelp';const el=$(id);if(!el)return;const copy=sector==='farm'?['Start with total acres, value, and any land loan. Open yearly costs to add taxes, insurance, and upkeep.','Check who owns what percentage and how much each person can pay each year.','Enter only the acres a farmer could rent. Open buyout and selling details if you want to compare those paths.','These are annual comparisons. Switch tabs to look at each owner, rent, a buyout, or lower rental income.']:['Start with the home’s value and loan. Open the cost groups below to add the rest.','Enter each person’s share and monthly budget, then choose how to split the bills.','This is only for the option where one person pays the others for their shares. You can continue if you only want to compare sharing or selling.','Compare the three choices, then use the tabs to explore costs, affordability, waiting, or an extra repair.','Write down what still needs checking, then print a summary to discuss together.'];el.innerHTML='<b>Your next move</b><span>'+copy[n]+'</span>'}
function openStarterGuide(){const d=$('starterGuide');$('guideProperty').textContent=selectedSector==='farm'?'For farmland':'For a home';$('guideExtra').textContent=selectedSector==='farm'?'Total acreage, usable rented acres, a cash-rent quote or lease, and annual upkeep estimates.':'Monthly utilities, repair estimates, and an estimate of selling fees.';d.showModal()}
function closeStarterGuide(){ $('starterGuide').close() }
function guideExample(){closeStarterGuide();startSelected(true)}
function guideOwn(){closeStarterGuide();startSelected(false)}
const toast=document.createElement('div');toast.id='uiToast';toast.className='toast';toast.setAttribute('role','status');toast.setAttribute('aria-live','polite');document.body.append(toast);
const guide=document.createElement('dialog');guide.id='starterGuide';guide.className='starter-dialog';guide.setAttribute('aria-labelledby','guideTitle');guide.innerHTML='<button class="dialog-close" aria-label="Close starter checklist" onclick="closeStarterGuide()">✕</button><span class="eyebrow" id="guideProperty">For a home</span><h2 id="guideTitle">A little preparation.<br>A much clearer picture.</h2><p class="note">You can try the example first. For your own plan, gather what you can:</p><ul><li>A rough selling value and the amount still owed on the property.</li><li>The property tax bill, insurance renewal, and current loan payment.</li><li>Each owner’s percentage and what they can afford to pay.</li><li id="guideExtra"></li></ul><p class="note">You do not need private account numbers or an address. If a figure is uncertain, use a clearly identified estimate and note what needs checking. Zero is treated as no cost.</p><div class="dialog-actions"><button onclick="guideExample()">Try the example first</button><button class="secondary" onclick="guideOwn()">Start my plan</button></div>';document.body.append(guide);guide.addEventListener('click',e=>{if(e.target===guide){const r=guide.getBoundingClientRect();if(e.clientX<r.left||e.clientX>r.right||e.clientY<r.top||e.clientY>r.bottom)guide.close()}});
for(const sector of ['home','farm']){const container=$(sector==='home'?'wizard':'farmWorkspace');const helper=document.createElement('div');helper.id=sector==='home'?'homeStepHelp':'farmStepHelp';helper.className='step-help';const status=$(sector==='home'?'status':'farmStatus');status.after(helper);updateStepHelp(sector,0)}
if('IntersectionObserver' in window&&!window.matchMedia('(prefers-reduced-motion: reduce)').matches){const observer=new IntersectionObserver(entries=>entries.forEach(e=>{if(e.isIntersecting){e.target.classList.add('is-visible');observer.unobserve(e.target)}}),{threshold:.12});document.querySelectorAll('.home-features .panel').forEach((el,i)=>{el.classList.add('reveal-panel');el.style.transitionDelay=i*90+'ms';observer.observe(el)})}
// Announce changes to the short homepage preview without moving keyboard focus.
$('storyPreview').setAttribute('aria-live','polite');

function scrollToFeatures(){$('plannerLaunch').scrollIntoView({behavior:window.matchMedia('(prefers-reduced-motion: reduce)').matches?'instant':'smooth',block:'start'})}
function arrangeImmersiveIntro(){const hero=document.querySelector('#home>.hero-grid'),left=hero.firstElementChild;const launch=document.createElement('section');launch.id='plannerLaunch';launch.className='launch-section';launch.innerHTML='<span class="eyebrow">YOUR OPTIONS, IN FOCUS</span><h2 class="launch-title">Start with the place.<br><span class="headline-accent">Find a path forward.</span></h2><p class="note">Choose a fictional example or use your own figures. You can switch between home and farmland above.</p><div class="launch-grid"><div class="launch-controls"></div><div class="launch-story"></div></div>';hero.after(launch);const controls=launch.querySelector('.launch-controls');const heading=document.createElement('h3');heading.textContent='Make the next move yours.';controls.append(heading);for(const selector of ['.start-actions','.trust-row','.preflight-link']){const el=left.querySelector(selector);if(el)controls.append(el)}launch.querySelector('.launch-story').append(document.querySelector('.story-content'));const introAction=document.createElement('div');introAction.className='intro-actions';introAction.innerHTML='<button onclick="scrollToFeatures()">Explore the possibilities ↓</button><span>Home & farmland planning</span>';left.append(introAction);const id=document.createElement('div');id.className='intro-identifier';id.textContent='FAMILY PROPERTY / A CLEARER NEXT CHAPTER';left.append(id);const cue=document.createElement('div');cue.className='intro-scroll';cue.innerHTML='<button onclick="scrollToFeatures()"><i aria-hidden="true"></i> Scroll to find your next move</button>';hero.append(cue)}
arrangeImmersiveIntro();initializeWire();

function setupMobileTools(){const header=document.querySelector('header'),actions=header.querySelector('.actions'),menu=document.createElement('details');menu.className='mobile-tools';menu.innerHTML='<summary>Menu ☰</summary>';header.append(menu);const mq=window.matchMedia('(max-width:700px)');const arrange=()=>{if(mq.matches){menu.append(actions);menu.open=false}else{header.insertBefore(actions,menu);menu.open=false}};arrange();mq.addEventListener('change',arrange);actions.addEventListener('click',e=>{if(e.target.closest('button')&&mq.matches)menu.open=false});document.addEventListener('click',e=>{if(menu.open&&!menu.contains(e.target))menu.open=false})}
function labelComparisonTables(){document.querySelectorAll('main table').forEach(table=>{if(table.closest('#familySheet')||table.classList.contains('scenario-table'))return;const headers=Array.from(table.querySelectorAll('tr:first-child th')).map(x=>x.textContent.trim());if(!headers.length)return;table.classList.add('responsive-table');table.querySelectorAll('tr').forEach(row=>Array.from(row.querySelectorAll('td')).forEach((td,i)=>td.setAttribute('data-label',headers[i]||'')))})}
let tableLabelFrame=0;new MutationObserver(()=>{if(tableLabelFrame)return;tableLabelFrame=requestAnimationFrame(()=>{tableLabelFrame=0;labelComparisonTables()})}).observe(document.querySelector('main'),{childList:true,subtree:true});labelComparisonTables();setupMobileTools();
document.documentElement.classList.remove('preview-mode');

function playHeadlineLaunch(){
 const root=document.documentElement;
 if(!root.classList.contains('launching')||!Element.prototype.animate){root.classList.remove('launching');return}
 const backdrop=document.createElement('div');backdrop.className='launch-screen';backdrop.setAttribute('aria-hidden','true');
 const copy=document.createElement('div');copy.className='launch-copy';copy.setAttribute('aria-hidden','true');copy.innerHTML='<span class="launch-line"><span class="launch-word">Keep the place.</span></span><span class="launch-line"><span class="launch-word launch-accent">Plan what comes next.</span></span>';
 const skip=document.createElement('button');skip.className='launch-skip';skip.textContent='Skip intro ↗';const launchStart=document.createElement('button');launchStart.className='launch-skip launch-start';launchStart.textContent='Start planning →';document.body.append(backdrop,copy,skip,launchStart);
 const width=Math.min(innerWidth-48,1250),font=Math.min(110,Math.max(36,width/11.7));
 Object.assign(copy.style,{width:width+'px',fontSize:font+'px',left:Math.max(24,(innerWidth-width)/2)+'px'});
 copy.style.top=Math.max(50,(innerHeight-copy.getBoundingClientRect().height)/2)+'px';
 copy.querySelectorAll('.launch-word').forEach((el,i)=>el.animate([{transform:'translateY(110%)',opacity:0,filter:'blur(8px)'},{transform:'translateY(0)',opacity:1,filter:'blur(0)'}],{duration:1100,delay:150+i*350,easing:'cubic-bezier(.16,1,.3,1)',fill:'both'}));
 let finished=false,timer;
 const cleanup=()=>{if(finished)return;finished=true;clearTimeout(timer);clearTimeout(window.launchSafety);root.classList.remove('launching');backdrop.remove();copy.remove();skip.remove();launchStart.remove();window.removeEventListener('resize',cleanup);document.removeEventListener('keydown',escape);setTimeout(()=>{root.classList.add('launch-complete');root.classList.remove('launch-reveal')},1800)};
 const escape=e=>{if(e.key==='Escape')cleanup()};skip.onclick=cleanup;launchStart.onclick=()=>{cleanup();startSelected(false)};document.addEventListener('keydown',escape);window.addEventListener('resize',cleanup,{once:true});
 timer=setTimeout(()=>{
  if(finished)return;skip.style.display='none';launchStart.style.display='none';
  copy.animate([{transform:'translateX(0)',opacity:1},{transform:'translateX(-'+(innerWidth+100)+'px)',opacity:0}],{duration:950,easing:'cubic-bezier(.65,0,.25,1)',fill:'forwards'});
  backdrop.animate([{opacity:1},{opacity:0}],{duration:1000,delay:250,fill:'forwards'});
  timer=setTimeout(()=>{root.classList.remove('launching');root.classList.add('launch-reveal');timer=setTimeout(cleanup,1300)},450);
 },2400);
}
playHeadlineLaunch();

// Detail views stay in this offline file and support normal browser back navigation.
const featureDetails=[
{slug:'choose-property',label:'01 / CHOOSE THE PROPERTY',title:'Start with the place.<br><span class="headline-accent">See what it really needs.</span>',intro:'A family home and a parcel of farmland can carry the same emotional weight, but their costs and possibilities are different. Choosing the right planner gives your family a useful starting point for the decision ahead.',sections:[
['A clearer picture of the ongoing costs','The home planner brings together the loan, taxes, insurance, utilities, and upkeep as a monthly budget. The farmland planner compares annual land costs and potential cash rent. Matching the model to the property makes it easier to see what keeping it could require.'],
['Compare realistic ways forward','For a home, explore sharing costs, one person buying the others out, or selling. For farmland, look at keeping the land, cash renting eligible acres, a buyout, or a sale. Each scenario uses your estimates so the tradeoffs become easier to discuss.'],
['Separate the property from assumptions','An estimated property value is different from available cash. Debt, recurring bills, immediate repairs, and selling costs each affect the decision differently. Entering them separately helps explain why a valuable property may still be difficult to carry.'],
['Find the information worth checking','You can begin with the fictional example, then replace it with estimates from tax bills, insurance statements, loan balances, and repair quotes. For land, confirm usable rental acres and a rent estimate. A farmhouse included in a land valuation needs particular care to avoid counting it twice.']
],example:'A family home may look manageable until insurance, utilities, and maintenance are added to the loan payment. A farm may have a different pattern: relatively few monthly bills, with annual taxes and uncertain rent collection. The right planner makes those differences visible.',steps:['Choose Home or Farmland on the welcome screen.','Try an example to see how the comparisons work.','Replace estimates with current figures and note anything still uncertain.'],cta:'Explore the property planners'},
{slug:'include-siblings',label:'02 / INCLUDE EVERY SIBLING',title:'Give every owner<br><span class="headline-accent">a place in the conversation.</span>',intro:'A shared property decision works better when everyone can see the same assumptions. Including every owner helps your family compare ownership shares, contributions, and affordability without treating every situation as identical.',sections:[
['Make ownership shares visible','Record each owner and their percentage so the comparisons reflect the shares you enter. Equal shares are a useful example, but they should not be assumed to describe your family. Confirm the actual ownership details before relying on the figures.'],
['Understand affordability person by person','A cost that looks small when split across the family may still exceed one owner’s budget. Entering individual payment capacity helps show where a proposed arrangement could be difficult to sustain and where a different contribution arrangement may need discussion.'],
['Put buyouts in a shared frame','A buyout affects both the person keeping the property and those leaving ownership. The comparison helps the family consider the buyer’s estimated upfront cash and ongoing costs alongside the amounts modeled for the other owners. Financing assumptions and real quotes still need checking.'],
['Reduce avoidable misunderstandings','Working from one set of numbers creates a reference point for questions: Which costs are included? Who could contribute? What happens if a payment is missed? The planner supports that conversation; the family still needs to agree on responsibilities and record any actual arrangement appropriately.']
],example:'Three siblings might own equal shares while having very different budgets. Seeing each person’s capacity alongside their estimated share of the bills can reveal a shortfall before the family commits to an arrangement that is hard to maintain.',steps:['Add every owner and verify the percentages.','Enter a realistic payment capacity for each person.','Compare the results together and identify any shortfall or unresolved responsibility.'],cta:'Explore the family planner'},
{slug:'next-conversation',label:'03 / FIND THE NEXT CONVERSATION',title:'Turn the comparison into<br><span class="headline-accent">a useful next step.</span>',intro:'The most useful result is a clearer conversation about what your family can do next. Comparing the options helps you identify the missing facts, test concerns, and bring a shared set of questions to the people involved.',sections:[
['Compare choices using the same inputs','Keeping, buying out, renting where applicable, and selling involve different demands on cash and ownership. Viewing the modeled results together makes the practical differences easier to explain without relying on a single headline property value.'],
['Explore where the plan feels fragile','Use the available scenario tools to see how changes such as an extra repair or reduced rental income affect the result. These comparisons can help you discuss how much flexibility a plan needs. They are scenarios based on your inputs, rather than predictions of future costs or income.'],
['Turn unknowns into specific questions','Instead of ending with “we need more information,” record what needs checking: a loan balance, repair estimate, rent quote, ownership share, or financing assumption. A precise question is easier to assign to a person and resolve before another family meeting.'],
['Bring a readable summary to the discussion','Use the notes and print tools to create a discussion sheet. Save the plan if you want to return to the same inputs. A shared summary helps owners and any advisers understand what you modeled and which assumptions still need confirmation.']
],example:'If keeping the property appears affordable only when every estimate goes as expected, your next conversation might focus on reserves and responsibilities. If a buyout looks promising but requires more cash than one owner has, the next step might be a financing quote rather than a final decision.',steps:['Review the comparisons and any scenarios relevant to your property.','Write down the assumptions that could change the result.','Save the plan or print a discussion sheet, then agree on who will check each open question.'],cta:'Explore the comparison tools'}
];
const featurePage=document.createElement('section');featurePage.id='featureDetail';featurePage.className='feature-detail';featurePage.hidden=true;featurePage.setAttribute('aria-label','Planning benefits');document.querySelector('main').append(featurePage);
let featureSnapshot=null,featureScroll=0;
document.querySelectorAll('.home-features .panel').forEach((card,i)=>{const link=document.createElement('a');link.className=card.className+' feature-link';link.href='#benefits/'+featureDetails[i].slug;link.innerHTML=card.innerHTML+'<span class="feature-more">Explore the benefits ↗</span>';link.style.transitionDelay=card.style.transitionDelay;card.replaceWith(link);link.classList.add('is-visible')});
function closeFeatureDetail(restoreScroll=true){if(!featureSnapshot)return;featureSnapshot.forEach(([el,hidden])=>el.hidden=hidden);featureSnapshot=null;featurePage.hidden=true;if(restoreScroll)window.scrollTo({top:featureScroll,behavior:'instant'})}
function routeFeatureDetail(){const slug=location.hash.replace('#benefits/',''),index=featureDetails.findIndex(x=>x.slug===slug);if(!location.hash.startsWith('#benefits/')||index<0){closeFeatureDetail();return}const d=featureDetails[index];if(!featureSnapshot){featureScroll=window.scrollY;featureSnapshot=Array.from(document.querySelector('main').children).filter(el=>el!==featurePage).map(el=>[el,el.hidden]);featureSnapshot.forEach(([el])=>el.hidden=true)}featurePage.innerHTML='<a class="feature-back" href="#home">← Back to the overview</a><div class="eyebrow">'+d.label+'</div><h1 tabindex="-1">'+d.title+'</h1><p class="detail-intro">'+d.intro+'</p><div class="detail-grid">'+d.sections.map(([title,text])=>'<article><h2>'+title+'</h2><p>'+text+'</p></article>').join('')+'</div><div class="detail-example"><h2>A situation to think through</h2><p>'+d.example+'</p></div><article style="margin-top:24px"><h2>Put it into practice</h2><ol>'+d.steps.map(text=>'<li>'+text+'</li>').join('')+'</ol></article><div class="detail-actions"><button type="button" id="featureContinue">'+d.cta+' ↓</button><a class="feature-back" href="#benefits/'+featureDetails[(index+1)%3].slug+'" style="margin:10px 0">Next: '+featureDetails[(index+1)%3].label.slice(5)+' →</a></div>';featurePage.hidden=false;window.scrollTo({top:0,behavior:'instant'});featurePage.querySelector('h1').focus({preventScroll:true});document.getElementById('featureContinue').onclick=()=>{closeFeatureDetail(false);history.replaceState(null,'','#home');document.getElementById('plannerLaunch').scrollIntoView({behavior:matchMedia('(prefers-reduced-motion: reduce)').matches?'instant':'smooth'})}}
window.addEventListener('hashchange',routeFeatureDetail);routeFeatureDetail();

// A buyout is a deliberate optional branch of the home planner.
const buyoutChoice=document.createElement('div');buyoutChoice.className='panel';buyoutChoice.innerHTML='<h2>Would you like to explore a buyout?</h2><p class="note">Start by comparing shared ownership and selling. Choose this only if you want to work through one owner purchasing the others’ shares.</p><label style="display:flex;align-items:center;gap:12px"><input id="enableBuyout" type="checkbox" style="width:20px;min-height:20px;flex:0 0 20px">Yes, explore the buyout process</label>';
document.querySelector('.wizard-page[data-step="1"]').append(buyoutChoice);
const buyerLabel=document.getElementById('buyer').closest('label');document.getElementById('loanFields').before(buyerLabel);
document.querySelector('.wizard-page[data-step="2"] .wizard-note').textContent='You chose to explore a buyout. Select a potential buyer and enter the financing estimates to add this option to your comparison.';
document.getElementById('enableBuyout').onchange=e=>{state.buyoutEnabled=e.target.checked;mark();if(!state.buyoutEnabled&&[1,3].includes(currentResult))showResult(0);render();syncBuyoutNavigation()};
function syncBuyoutNavigation(){const enabled=state.buyoutEnabled===true;const order=enabled?[0,1,2,3,4]:[0,1,3,4];document.querySelectorAll('[data-gostep]').forEach(b=>{const n=+b.dataset.gostep;b.hidden=n===2&&!enabled;if(!b.hidden)b.textContent=(order.indexOf(n)+1)+'. '+['The home','The family','Buyout process','Compare','Talk it over'][n]});document.getElementById('stepCaption').textContent='Step '+(order.indexOf(currentStep)+1)+' of '+order.length;document.getElementById('stepProgress').style.width=((order.indexOf(currentStep)+1)/order.length*100)+'%';if(!enabled&&document.getElementById('homeStepHelp')){if(currentStep===1)document.getElementById('homeStepHelp').innerHTML='<b>Your next move</b><span>Enter each owner’s share and budget. Choose the optional buyout process only if your family wants to explore it.</span>';if(currentStep===3)document.getElementById('homeStepHelp').innerHTML='<b>Your next move</b><span>Compare shared ownership and selling, or explore the cost of keeping the home while you decide.</span>'}}
function syncBuyoutView(){const enabled=state.buyoutEnabled===true;document.getElementById('enableBuyout').checked=enabled;document.querySelector('.cards .card:nth-child(2)').hidden=!enabled;document.querySelector('.cards').style.gridTemplateColumns=enabled?'':'repeat(auto-fit,minmax(min(100%,240px),1fr))';
for(const i of [1,3]){const tab=document.querySelector('[data-resulttab="'+i+'"]');tab.hidden=!enabled;document.querySelector('[data-resultpanel="'+i+'"]').hidden=!enabled||currentResult!==i}
if(!enabled&&[1,3].includes(currentResult))showResult(0);
const table=document.getElementById('comparison').closest('table');table.querySelectorAll('tr').forEach(row=>{if(row.children.length===6)row.lastElementChild.hidden=!enabled});
const note=table.closest('.panel').querySelector('.scroll + .note');if(note)note.textContent='Monthly bills follow the split you chose. Money from selling follows each person’s ownership percentage. Paying different amounts does not change ownership.'+(enabled?' A buyout uses the home’s value minus the remaining home loan; it does not subtract selling fees.':'');
// Discussion sheets follow the same selected options as the on-screen results.
if(!enabled){const sheet=document.getElementById('familySheet'),options=sheet.querySelector('table');if(options)options.querySelectorAll('tr').forEach(row=>{if(row.children.length===3)row.children[1].remove()});sheet.querySelectorAll('p').forEach(p=>{if(p.textContent.startsWith('Buyout buyer:'))p.remove();if(p.textContent.startsWith('Model assumes a new fixed loan'))p.textContent='Model assumes an as-is sale and unchanged ongoing costs. Taxes, other estate debts and liens, future price changes, and rent are excluded. Educational estimates for discussion only.'})}
syncBuyoutNavigation()}
const renderWithOptionalBuyout=render;render=function(){renderWithOptionalBuyout();syncBuyoutView()};
const showStepWithOptionalBuyout=showStep;showStep=function(n){showStepWithOptionalBuyout(n);syncBuyoutNavigation()};
// Skip disabled comparison tabs during keyboard navigation.
document.querySelectorAll('[data-resulttab]').forEach(tab=>tab.addEventListener('keydown',e=>{if(state.buyoutEnabled===true||!['ArrowLeft','ArrowRight','Home','End'].includes(e.key))return;e.preventDefault();e.stopImmediatePropagation();const next=e.key==='Home'?0:e.key==='End'?2:currentResult===0?2:0;showResult(next);document.querySelector('[data-resulttab="'+next+'"]').focus()},{capture:true}));
render();

// Planning improvements: explicit goals, missing estimates, transparent totals and discussion summaries.
function validatePlanningMeta(s){if(s&&typeof s==='object')validateScenarioSets(s);if(!s||typeof s!=='object')return;if(s.goal!==undefined&&!['keep','sell','unsure'].includes(s.goal))throw Error('Choose a supported planning goal.');if(s.unknown!==undefined&&(!s.unknown||typeof s.unknown!=='object'||Array.isArray(s.unknown)||Object.entries(s.unknown).some(([k,v])=>k.length>80||typeof v!=='boolean')))throw Error('Invalid missing-estimate information.');if(s.testingNotes!==undefined&&(typeof s.testingNotes!=='string'||s.testingNotes.length>4000))throw Error('Test notes must be under 4,000 characters.');if(s.buyoutEnabled!==undefined&&typeof s.buyoutEnabled!=='boolean')throw Error('Invalid buyout choice.')}
function planningMeta(sector){const s=sector==='farm'?state.farm:state;if(!s.unknown)s.unknown={};if(!s.goal)s.goal='unsure';return s}
const goalNames={keep:'Keep it together',sell:'Explore selling',unsure:'Still deciding'};
const homeKeepKeys=['payment','tax','insurance','maintenance','utilities'];
const homeSaleKeys=['value','mortgage','sellPercent','sellFixed'];
const homeBuyKeys=['value','mortgage','tax','insurance','maintenance','utilities','cash','closing','rate','years','availableCash','repairs'];
const farmKeepKeys=['payment','tax','insurance','upkeep'];
const farmSaleKeys=['value','debt','sellPercent','sellFixed'];
const farmRentKeys=[...farmKeepKeys,'rentAcres','rentPerAcre','collection','leaseCosts'];
const farmBuyKeys=['value','debt','tax','insurance','upkeep','cash','closing','availableCash','rate','years','repairs'];
function hasUnknown(sector,keys){const u=planningMeta(sector).unknown;return keys.some(k=>u[k]===true)}
function fieldTitle(sector,key){if(key.startsWith('capacity:'))return (planningMeta(sector).owners[+key.split(':')[1]]?.name||'Owner')+' — '+(sector==='farm'?'yearly':'monthly')+' budget';const list=sector==='farm'?farmFields:specs;return list.find(x=>x[0]===key)?.[1]||key}
function relevantKeys(sector){const s=planningMeta(sector);return [...new Set((sector==='farm'?[...farmRentKeys,...farmSaleKeys,'acres','repairs',...(s.buyoutEnabled?farmBuyKeys:[])]:[...homeKeepKeys,...homeSaleKeys,'repairs',...(s.buyoutEnabled?homeBuyKeys:[])]).concat(s.owners.map((_,i)=>'capacity:'+i)))]}
function missingKeys(sector){const s=planningMeta(sector);return relevantKeys(sector).filter(k=>s.unknown[k]===true)}
function goalPanel(sector){const box=document.createElement('section');box.className='panel goal-panel';box.id=sector+'GoalPanel';box.innerHTML='<span class="eyebrow">START WITH YOUR FAMILY’S GOAL</span><h2>What would you like to explore?</h2><p class="note">This guides the questions and highlights relevant details. It does not choose an outcome for you. You can change it anytime.</p><div class="goal-options" role="group" aria-label="Planning goal">'+[['keep','Keep it together','Understand the bills and each owner’s share.'],['sell','Explore selling','See what may remain after costs and debt.'],['unsure','Still deciding','Compare the paths before choosing one.']].map(([id,title,desc])=>'<button type="button" data-goal="'+id+'" aria-pressed="false">'+title+'<small>'+desc+'</small></button>').join('')+'</div><p class="goal-status" aria-live="polite"></p>';box.querySelectorAll('[data-goal]').forEach(button=>button.onclick=()=>{planningMeta(sector).goal=button.dataset.goal;mark();sector==='farm'?renderFarm():render()});return box}
document.querySelector('.wizard-page[data-step="0"]').prepend(goalPanel('home'));
document.querySelector('[data-farmstep="0"]').prepend(goalPanel('farm'));
function updateGoal(sector){const s=planningMeta(sector),box=$(sector+'GoalPanel');box.querySelectorAll('[data-goal]').forEach(b=>b.setAttribute('aria-pressed',b.dataset.goal===s.goal));box.querySelector('.goal-status').textContent=s.goal==='keep'?'Focus: confirm recurring bills, immediate repairs, and what each owner can contribute.':s.goal==='sell'?'Focus: confirm the property value, remaining debt, selling fees, and each owner’s proceeds.':'Focus: gather the key estimates, then compare shared ownership and selling'+(sector==='farm'?', with cash rent where applicable.':'.')}
function estimateDescriptor(input){if(input.dataset.farm&&input.dataset.farm!=='years')return {sector:'farm',key:input.dataset.farm};if(input.dataset.fkey==='capacity')return {sector:'farm',key:'capacity:'+input.dataset.fowner};if(input.dataset.k==='capacity')return {sector:'home',key:'capacity:'+input.dataset.i};if(specs.some(([k])=>k===input.id)&&input.id!=='years')return {sector:'home',key:input.id};return null}
function setEstimateValue(desc,value){const s=planningMeta(desc.sector);if(desc.key.startsWith('capacity:'))s.owners[+desc.key.split(':')[1]].capacity=value;else s[desc.key]=value}
function attachUnknownControls(){document.querySelectorAll('input[type="number"]').forEach(input=>{const d=estimateDescriptor(input);if(!d)return;const s=planningMeta(d.sector);let control=input.closest('label').nextElementSibling;if(!control?.classList.contains('unknown-control')){control=document.createElement('label');control.className='unknown-control';const check=document.createElement('input');check.type='checkbox';check.setAttribute('aria-label','Unknown: '+fieldTitle(d.sector,d.key));const text=document.createElement('span');text.textContent='I don’t know yet';control.append(check,text);input.closest('label').after(control);check.onchange=()=>{const current=planningMeta(d.sector);current.unknown[d.key]=check.checked;if(check.checked)setEstimateValue(d,0);input.value=check.checked?'':String(d.key.startsWith('capacity:')?current.owners[+d.key.split(':')[1]].capacity:current[d.key]);mark();d.sector==='farm'?renderFarm():render()}}
const unknown=s.unknown[d.key]===true;control.querySelector('input').checked=unknown;input.classList.toggle('estimate-unknown',unknown);input.placeholder=unknown?'Unknown — enter an estimate':'';input.setAttribute('aria-description',unknown?'Not entered. Affected results are incomplete.':'Entered estimate. Zero means no cost.');if(unknown&&document.activeElement!==input)input.value='';})}
// Clearing an estimate marks it unknown instead of converting it into a free cost.
document.addEventListener('input',e=>{const d=estimateDescriptor(e.target);if(!d)return;const s=planningMeta(d.sector);if(e.target.value===''){s.unknown[d.key]=true;setEstimateValue(d,0);e.stopImmediatePropagation();mark();d.sector==='farm'?renderFarm():render()}else{s.unknown[d.key]=false}},true);
const homeBreakdown=document.createElement('section');homeBreakdown.className='panel cost-breakdown';homeBreakdown.id='homeBreakdown';document.querySelector('.wizard-page[data-step="3"] .cards').after(homeBreakdown);
const homeSummary=document.createElement('section');homeSummary.className='panel';homeSummary.id='homeDiscussionSummary';document.querySelector('.wizard-page[data-step="4"]').prepend(homeSummary);
const farmBreakdown=document.createElement('section');farmBreakdown.className='panel cost-breakdown';farmBreakdown.id='farmBreakdown';$('farmMetrics').after(farmBreakdown);
const farmSummary=document.createElement('section');farmSummary.className='panel';farmSummary.id='farmDiscussionSummary';$('farmWorkspace').querySelector('[data-farmstep="3"]').append(farmSummary);
function estimateCell(sector,keys,value){return hasUnknown(sector,keys)?'<span class="annual">Not entered</span>':money(value)}
function breakdownTable(rows){return '<div class="scroll"><table><thead><tr><th>Cost</th><th>Amount</th></tr></thead><tbody>'+rows.map(([label,value])=>'<tr><td>'+label+'</td><td>'+value+'</td></tr>').join('')+'</tbody></table></div>'}
function readiness(sector){const missing=missingKeys(sector);return '<div class="readiness-row"><div><strong>'+(missing.length?missing.length+' estimate'+(missing.length===1?'':'s')+' still needed':'All key estimates entered')+'</strong><p class="note">'+(missing.length?'Affected totals are incomplete. Unknown amounts are not treated as free.':'Your totals use the estimates you entered; they are not independently verified.')+'</p></div><span class="summary-goal">Goal: '+goalNames[planningMeta(sector).goal]+'</span></div>'}
function sharedOwnerSummary(sector,c){const f=planningMeta(sector),isFarm=sector==='farm',keys=isFarm?farmKeepKeys:homeKeepKeys;return f.owners.map((o,i)=>{const due=isFarm?c.keep*o.share/100:contribution(f,c,i),missingCost=hasUnknown(sector,keys),missingBudget=f.unknown['capacity:'+i]===true,delta=o.capacity-due;return '<div class="owner-budget"><strong>'+esc(o.name||'Owner '+(i+1))+' · '+o.share+'% ownership</strong><p>Shared contribution: '+(missingCost?'Needs complete cost estimates':money(due)+' / '+(isFarm?'year':'month'))+'<br>Budget: '+(missingBudget?'Not entered':money(o.capacity)+' / '+(isFarm?'year':'month'))+'<br>'+(missingCost||missingBudget?'Budget fit cannot be assessed yet.':delta>=0?'<span class="budget-good">'+money(delta)+' within the entered budget.</span>':'<span class="budget-short">'+money(-delta)+' over the entered budget.</span>')+'<br>Immediate repairs: '+estimateCell(sector,['repairs'],f.repairs*o.share/100)+' per owner, based on ownership.</p></div>'}).join('')}
function nextChecks(sector){const missing=missingKeys(sector);if(!missing.length)return '<h3>Your comparison is ready</h3><p class="note">All key estimates have been entered. Use these comparisons and your notes to guide the family discussion.</p>';return '<h3>Missing estimates</h3><p class="note">Only the information below is missing. Enter an estimate, or enter 0 if there is genuinely no cost.</p><ul class="next-checks">'+missing.map(k=>'<li>'+esc(fieldTitle(sector,k).replace(/\s*\(.*?\)/g,''))+'</li>').join('')+'</ul>'}

function homeImprovements(){const s=planningMeta('home');updateGoal('home');attachUnknownControls();$('modeNotice').textContent=s.planMode==='own'?'Your plan: leave uncertain amounts marked “I don’t know yet.” Enter 0 only when there is no cost. Ownership shares and loan terms are starting settings to confirm.':'Fictional example. The numbers are made up; replace them before making a family decision.';if($('error').textContent){homeBreakdown.innerHTML='<h2>Cost breakdown paused</h2><p>Correct the input error above to update the breakdown.</p>';homeSummary.innerHTML='<h2>Summary paused</h2><p>Correct the input error before using the discussion summary.</p>';return}
const c=calculate(s),keepMissing=hasUnknown('home',homeKeepKeys),saleMissing=hasUnknown('home',homeSaleKeys),buyMissing=hasUnknown('home',homeBuyKeys),missing=missingKeys('home');
const line=(title,keys,val)=>[title,estimateCell('home',keys,val)];
homeBreakdown.innerHTML='<h2>Where the monthly total comes from</h2><p class="note">Annual taxes and insurance are divided by 12. Repairs needed now are a separate one-time cost.</p>'+breakdownTable([line('Current loan payment',['payment'],s.payment),line('Property tax ÷ 12',['tax'],s.tax/12),line('Insurance ÷ 12',['insurance'],s.insurance/12),line('Upkeep reserve',['maintenance'],s.maintenance),line('Utilities',['utilities'],s.utilities),['Total shared cost / month',keepMissing?'Incomplete':money(c.keep)],line('Repairs needed now · one time',['repairs'],s.repairs)])+'<h3>Selling calculation</h3>'+breakdownTable([line('Estimated property value',['value'],s.value),line('Less mortgage payoff',['mortgage'],s.mortgage),line('Less percentage selling fees',['value','sellPercent'],s.value*s.sellPercent/100),line('Less other selling costs',['sellFixed'],s.sellFixed),['Net proceeds / shortfall',saleMissing?'Incomplete':money(c.sale)]])+(s.buyoutEnabled&&c.equity<0?'<h3>Optional buyout calculation</h3><p>Not modeled while the mortgage exceeds the estimated property value.</p>':s.buyoutEnabled?'<h3>Optional buyout calculation</h3>'+breakdownTable([line('Payment on the replacement loan',['value','mortgage','cash','rate','years'],payment(c.loan,s.rate,s.years)),line('Taxes, insurance, upkeep and utilities',['tax','insurance','maintenance','utilities'],c.operating),['Buyer’s total / month',buyMissing?'Incomplete':c.equity<0?'Not modeled':money(c.buy)],['Cash now · contribution, fees and repairs',buyMissing?'Incomplete':c.equity<0?'Not modeled':money(c.upfront)]])+ '<p class="note">The replacement loan pays off the existing mortgage and pays the other owners. It is not added to the current loan payment.</p>':'');
$('takeaway').innerHTML=readiness('home')+'<h2 class="summary-title">Your options, side by side</h2><p><b>Keep it together:</b> '+(keepMissing?'Complete the recurring cost estimates to see the monthly total.':money(c.keep)+' / month for all owners combined.')+'</p><p><b>Sell:</b> '+(saleMissing?'Complete the valuation, debt and selling estimates to see proceeds.':c.sale>=0?money(c.sale)+' left to split after listed costs and debt.':money(-c.sale)+' extra needed to cover listed costs and debt.')+'</p>'+(s.buyoutEnabled?'<p><b>Optional buyout:</b> '+(buyMissing?'Complete the buyer and financing estimates.':c.equity<0?'Not modeled while debt exceeds the home value.':esc(s.owners[s.buyer].name)+' would need '+money(c.upfront)+' upfront and '+money(c.buy)+' / month.')+'</p>':'')+'<p class="note">These are comparisons, not a recommendation. Paying different amounts does not change ownership.</p>';
if(keepMissing)$('keepTotal').textContent='Incomplete';if(s.unknown.repairs)$('keepUpfront').textContent='Repairs unknown';if(saleMissing){$('saleTotal').textContent='Incomplete';$('saleCost').textContent='Needs estimates'}if(s.buyoutEnabled&&buyMissing){$('buyTotal').textContent='Incomplete';$('buyCash').textContent='Needs estimates'}
$('comparison').querySelectorAll('tr').forEach((row,i)=>{if(keepMissing)row.children[2].textContent='Needs costs';if(s.unknown['capacity:'+i])row.children[3].textContent='Not entered';if(saleMissing)row.children[4].textContent='Needs sale details';if(s.buyoutEnabled&&buyMissing)row.children[5].textContent='Needs buyout details'});
if(keepMissing||s.unknown.repairs)$('hold').innerHTML='<p class="estimate-notice">Complete recurring costs and immediate repair estimates before comparing the cost of waiting.</p>';
if(s.buyoutEnabled&&(buyMissing||s.unknown['capacity:'+s.buyer])){for(const id of ['gap','afford'])$(id).innerHTML='<p class="estimate-notice">Complete the buyout estimates and selected buyer’s budget before assessing affordability.</p>';$('stress').textContent='Complete the base buyout estimates first.'}
if(missing.length)$('warnings').innerHTML='<div class="estimate-notice">This is an unfinished estimate. Review the missing items in the discussion summary before relying on totals.</div>';
const funding=s.owners.reduce((sum,o,i)=>sum+contribution(s,c,i),0);const fundingNote=!keepMissing&&s.split==='custom'&&Math.abs(funding-c.keep)>.01?'<p class="estimate-notice">Your custom contributions '+(funding<c.keep?'leave '+money(c.keep-funding)+' of monthly bills uncovered.':'exceed monthly bills by '+money(funding-c.keep)+'.')+'</p>':'';
homeSummary.innerHTML=fundingNote+'<span class="eyebrow">BRING THIS TO THE FAMILY TABLE</span><h2>Your family discussion summary</h2>'+readiness('home')+'<h3>Shared ownership: each owner’s position</h3>'+sharedOwnerSummary('home',c)+nextChecks('home')+'<button type="button" onclick="showStep(0)">Review the estimates ↑</button>';
}
// Farmland follows the same explicit buyout choice as the home planner.
const farmOpt=document.createElement('div');farmOpt.className='panel';farmOpt.innerHTML='<h2>Optional buyout process</h2><p class="note">Keep the joint-ownership, rent, and sale comparisons unless you choose to explore one owner buying the others out.</p><label class="unknown-control"><input type="checkbox" id="farmEnableBuyout">Yes, explore the farmland buyout process</label>';document.querySelector('[data-farmstep="1"]').append(farmOpt);const farmBuyerLabel=$('farmBuyer').closest('label');$('farmBuyFields').before(farmBuyerLabel);$('farmEnableBuyout').onchange=e=>{state.farm.buyoutEnabled=e.target.checked;mark();renderFarm()};
function farmImprovements(){const f=planningMeta('farm');updateGoal('farm');attachUnknownControls();$('farmEnableBuyout').checked=f.buyoutEnabled===true;$('farmBuyFields').closest('details').hidden=!f.buyoutEnabled;document.querySelector('[data-ftab="2"]').hidden=!f.buyoutEnabled;if(!f.buyoutEnabled&&farmResult===2)farmTab(0);document.querySelector('[data-fresult="2"]').hidden=!f.buyoutEnabled||farmResult!==2;if($('farmError').textContent){farmBreakdown.textContent='Correct the input error to update the cost breakdown.';farmSummary.textContent='Correct the input error to update the discussion summary.';return}const c=farmCalc(f),keepMissing=hasUnknown('farm',farmKeepKeys),rentMissing=hasUnknown('farm',farmRentKeys),saleMissing=hasUnknown('farm',farmSaleKeys),buyMissing=hasUnknown('farm',farmBuyKeys),missing=missingKeys('farm');$('farmMode').textContent=f.mode==='example'?'Fictional example — replace with your own figures.':'Your estimates — unknown amounts remain incomplete, not free.';
$('farmTakeaway').innerHTML=readiness('farm')+'<h2 class="summary-title">Compare the land options</h2><p>Keep without rent: '+(keepMissing?'Incomplete':money(c.keep)+' / year')+'.</p><p>Cash rent: '+(rentMissing?'Needs costs and rent estimates.':c.netRent>=0?money(c.netRent)+' / year left after listed bills.':money(-c.netRent)+' / year needed from the family.')+'</p><p>Sale: '+(saleMissing?'Needs valuation, debt and selling costs.':c.sale>=0?money(c.sale)+' left to split.':money(-c.sale)+' shortfall.')+'</p><p class="note">Comparisons only. Immediate repairs are separate; no option is selected for your family.</p>';
$('farmMetrics').innerHTML=[['Keep without rent',keepMissing?'Incomplete':money(c.keep),'per year for everyone'],['Rent it out',rentMissing?'Incomplete':money(Math.abs(c.netRent)),c.netRent>=0?'left / year after listed costs':'family pays / year'],...(f.buyoutEnabled?[['Optional buyout',buyMissing?'Incomplete':c.equity<0?'Not modeled':money(c.buyAnnual),'per year before rent']]:[]),['Sell the land',saleMissing?'Incomplete':money(c.sale),'net proceeds / shortfall']].map(([title,val,note])=>'<div class="metric"><span class="label">'+title+'</span><strong>'+val+'</strong><small>'+note+'</small></div>').join('');
const line=(title,keys,val)=>[title,estimateCell('farm',keys,val)];farmBreakdown.innerHTML='<h2>Where the yearly land costs come from</h2>'+breakdownTable([line('Current monthly loan payment × 12',['payment'],f.payment*12),line('Property tax',['tax'],f.tax),line('Insurance',['insurance'],f.insurance),line('Upkeep reserve',['upkeep'],f.upkeep),['Total annual keep cost',keepMissing?'Incomplete':money(c.keep)],line('Repairs needed now · one time',['repairs'],f.repairs)])+'<h3>Cash-rent calculation</h3>'+breakdownTable([line('Expected rent: acres × rent × collection',['rentAcres','rentPerAcre','collection'],c.rent),line('Less annual keep cost',farmKeepKeys,c.keep),line('Less extra landlord costs',['leaseCosts'],f.leaseCosts),['Rent left / family contribution',rentMissing?'Incomplete':money(c.netRent)]])+'<h3>Selling calculation</h3>'+breakdownTable([line('Estimated property value',['value'],f.value),line('Less land debt',['debt'],f.debt),line('Less selling fees',['value','sellPercent','sellFixed'],f.value*f.sellPercent/100+f.sellFixed),['Net proceeds / shortfall',saleMissing?'Incomplete':money(c.sale)]])+'<p class="note">Land figures are annual except the entered monthly loan payment. Repairs are separate cash costs, not recurring expenses.</p>';
const table=$('farmOwnerResults').querySelector('table');if(table)table.querySelectorAll('tr').forEach((row,i)=>{if(row.children.length!==7)return;row.lastElementChild.hidden=!f.buyoutEnabled;if(!i)return;if(f.unknown['capacity:'+(i-1)])row.children[2].textContent='Not entered';if(keepMissing)row.children[3].textContent='Needs costs';if(rentMissing)row.children[4].textContent='Needs rent details';if(saleMissing)row.children[5].textContent='Needs sale details';if(buyMissing)row.children[6].textContent='Needs buyout details'});
if(rentMissing){$('farmLeaseResults').innerHTML='<p class="estimate-notice">Complete land costs, rented acres, rent and collection assumptions to calculate rental cash flow.</p>';$('farmStressResults').innerHTML='<p class="estimate-notice">Complete the base rent and cost estimates before testing lower rent.</p>'}if(f.buyoutEnabled&&buyMissing)$('farmBuyResults').innerHTML='<p class="estimate-notice">Complete the selected buyer’s financing and cost estimates first.</p>';
if(missing.length)$('farmWarnings').innerHTML='<div class="estimate-notice">Some estimates are missing. The discussion summary lists what needs checking.</div>';else if(!f.buyoutEnabled)$('farmWarnings').querySelectorAll('.alert').forEach(a=>{if(a.textContent.includes('before rent.')||a.textContent.includes('normal buyout'))a.remove()});
farmSummary.innerHTML='<h2>Your land discussion summary</h2>'+readiness('farm')+'<h3>Shared ownership: each owner’s position before rent</h3>'+sharedOwnerSummary('farm',c)+nextChecks('farm');
}
const renderBeforeImprovements=render;render=function(){renderBeforeImprovements();homeImprovements()};
const renderFarmBeforeImprovements=renderFarm;renderFarm=function(){renderFarmBeforeImprovements();farmImprovements()};
// Add newly created owners’ budgets to the missing-estimate list for personal plans.
for(const [id,sector]of [['count','home'],['farmOwnerCount','farm']]){const original=$(id).onchange;$(id).onchange=e=>{const oldCount=planningMeta(sector).owners.length;original(e);const f=planningMeta(sector);if((sector==='home'?f.planMode:f.mode)==='own')for(let i=oldCount;i<f.owners.length;i++)f.unknown['capacity:'+i]=true;sector==='home'?render():renderFarm()}}
function syncTestNotes(){document.querySelectorAll('[data-testing-sector]').forEach(el=>{if(document.activeElement!==el)el.value=planningMeta(el.dataset.testingSector).testingNotes||''})}
// Print the same honest, selected comparisons that are shown on screen.
preparePrint=function(){const sector=state.activeSector==='farm'?'farm':'home',f=planningMeta(sector),isFarm=sector==='farm';try{isFarm?validateFarm(f):validate(f,{includeFarm:false})}catch(e){$(isFarm?'farmError':'error').textContent=e.message;return}isFarm?renderFarm():render();const c=isFarm?farmCalc(f):calculate(f),keepKeys=isFarm?farmKeepKeys:homeKeepKeys,saleKeys=isFarm?farmSaleKeys:homeSaleKeys;let html='<p>KEEP THE FAMILY HOME & LAND · FAMILY DISCUSSION SHEET</p><h1>'+(isFarm?'Farmland':'Home')+' comparison</h1><p>'+new Date().toLocaleDateString()+' · '+((isFarm?f.mode:f.planMode)==='example'?'Fictional example':'Your estimates')+'</p>'+readiness(sector)+'<h2>Selected comparisons</h2><p>Keep together: '+(hasUnknown(sector,keepKeys)?'Incomplete':money(c.keep)+' / '+(isFarm?'year':'month'))+'. Immediate repairs: '+(f.unknown.repairs?'Unknown':money(f.repairs))+'.</p><p>Sell: '+(hasUnknown(sector,saleKeys)?'Incomplete':c.sale>=0?money(c.sale)+' left to split':money(-c.sale)+' shortfall')+'.</p>';
if(isFarm)html+='<p>Cash rent: '+(hasUnknown('farm',farmRentKeys)?'Incomplete':money(Math.abs(c.netRent))+(c.netRent>=0?' left':' needed from the family')+' / year')+'.</p>';
if(f.buyoutEnabled)html+='<p>Optional buyout — '+esc(f.owners[f.buyer].name)+': '+(hasUnknown(sector,isFarm?farmBuyKeys:homeBuyKeys)?'Incomplete':c.equity<0?'Not modeled while debt exceeds value':money(c.upfront)+' upfront and '+money(isFarm?c.buyAnnual:c.buy)+' / '+(isFarm?'year before rent':'month'))+'.</p>';
html+='<h2>What these figures show</h2>'+decisionMeaning(sector,f)+'<h2>Each owner’s shared contribution and budget</h2>'+sharedOwnerSummary(sector,c)+'<h2>Cost breakdown</h2>'+$(isFarm?'farmBreakdown':'homeBreakdown').innerHTML+nextChecks(sector)+'<h2>Family notes</h2><p style="white-space:pre-wrap">'+esc((f.notes||'No notes recorded.').slice(0,6000))+'</p>'+(f.review?'<p>Next discussion: '+esc(f.review)+'</p>':'')+'<p>Comparisons are based on entered estimates. Missing items are not treated as zero. Payment differences do not change ownership. Sale proceeds follow entered ownership shares. Immediate repairs are excluded from the as-is sale. No future price changes, income taxes, other estate debts or liens are modeled. '+(isFarm?'Cash-rent comparison only; no crop revenue or farm-business profit.':'No rental income is modeled.')+' Educational discussion tool; not a recommendation or financing approval.</p>';$('familySheet').innerHTML=html+scenarioPrintTables(sector);window.print()};
const mountBeforeImprovements=mount;mount=function(){mountBeforeImprovements();syncTestNotes()};const mountFarmBeforeImprovements=mountFarm;mountFarm=function(){mountFarmBeforeImprovements();syncTestNotes()};

document.querySelectorAll('[data-ftab]').forEach(tab=>tab.addEventListener('keydown',e=>{if(state.farm.buyoutEnabled===true||!['ArrowLeft','ArrowRight','Home','End'].includes(e.key))return;e.preventDefault();e.stopImmediatePropagation();const visible=[0,1,3],at=visible.indexOf(farmResult),n=e.key==='Home'?0:e.key==='End'?3:visible[(at+(e.key==='ArrowRight'?1:2))%3];farmTab(n);document.querySelector('[data-ftab="'+n+'"]').focus()},{capture:true}));

render();renderFarm();syncTestNotes();


// A side-mounted wheel of headings with independently revealed body copy.
function initializeFeatureOrbit(){
 const root=document.querySelector('.home-features');if(!root)return;const cards=Array.from(root.querySelectorAll('.feature-link'));if(cards.length!==3)return;
 const shell=document.createElement('section');shell.className='feature-orbit';shell.setAttribute('aria-label','Explore the three planning features');
 const stage=document.createElement('div');stage.className='orbit-stage';stage.innerHTML='<div class="orbit-heading"><span class="eyebrow">THREE STEPS. A CLEARER PATH.</span><h2>Your next move, <br><span class="headline-accent">in focus.</span></h2><p class="orbit-hint">Scroll to explore each step.</p></div><div class="side-wheel-track" aria-hidden="true"></div><div class="wheel-titles" aria-label="Planning features"></div><div class="wheel-bodies"></div>';
 root.before(shell);shell.append(stage);stage.append(root);
 const titles=cards.map((card,i)=>{const link=document.createElement('a');link.className='wheel-title';link.href=card.getAttribute('href');link.innerHTML='<span class="step">0'+(i+1)+'</span><h3>'+card.querySelector('h3').textContent+'</h3>';stage.querySelector('.wheel-titles').append(link);return link});
 const bodies=cards.map((card,i)=>{const article=document.createElement('article');article.className='wheel-copy';article.innerHTML='<span class="eyebrow">0'+(i+1)+' / '+['A CLEARER STARTING POINT','EVERY OWNER, INCLUDED','FROM NUMBERS TO NEXT STEPS'][i]+'</span><p>'+featureDetails[i].intro+'</p><a href="'+card.getAttribute('href')+'">Explore the benefits ↗</a>';stage.querySelector('.wheel-bodies').append(article);return article});
 const nav=document.createElement('div');nav.className='orbit-position';nav.setAttribute('role','group');nav.setAttribute('aria-label','Bring a feature into focus');nav.innerHTML=titles.map((t,i)=>'<button type="button" aria-label="Focus '+cards[i].querySelector('h3').textContent+'">0'+(i+1)+'</button>').join('');stage.append(nav);
 const mq=matchMedia('(prefers-reduced-motion: reduce)');let frame=0,settleTimer=0,snapTimer=0,snapping=false,touching=false,lastScrollY=scrollY,scrollDirection=1,snapFrame=0,snapEpoch=0;
 const update=()=>{frame=0;if(!shell.classList.contains('is-orbiting')||!shell.getClientRects().length||document.body.classList.contains('motion-paused'))return;const top=parseFloat(getComputedStyle(stage).top)||0,travel=Math.max(1,shell.offsetHeight-stage.offsetHeight),progress=Math.max(0,Math.min(1,(top-shell.getBoundingClientRect().top)/travel)),width=stage.clientWidth,mobile=width<700,radius=mobile?240:Math.min(430,width*.36),hub=mobile?-170:-radius*.52,center=stage.clientHeight*(mobile?.39:.57),active=Math.round(progress*2);
 stage.style.setProperty('--wheel-radius',radius+'px');stage.style.setProperty('--wheel-hub',hub+'px');stage.style.setProperty('--wheel-center',center+'px');
 titles.forEach((title,i)=>{const offset=i-progress*2,angle=offset*Math.PI/3,x=hub+Math.cos(angle)*radius,y=center+Math.sin(angle)*radius,emphasis=Math.max(0,1-Math.abs(offset));title.style.transform='translate('+x.toFixed(2)+'px,'+y.toFixed(2)+'px) translateY(-50%) rotate('+(angle*180/Math.PI).toFixed(2)+'deg) scale('+(.82+emphasis*.18).toFixed(3)+')';title.style.opacity=String(Math.max(.10,1-Math.abs(offset)*.80));title.style.zIndex=String(i===active?20:10);title.setAttribute('aria-current',i===active?'step':'false');
 const alpha=i===active?1:0;bodies[i].style.opacity=String(alpha);bodies[i].style.transform='translateY('+(i===active?0:offset>0?35:-25)+'px)';bodies[i].style.visibility=i===active?'visible':'hidden';bodies[i].style.pointerEvents=i===active?'auto':'none';bodies[i].setAttribute('aria-hidden',i===active?'false':'true');bodies[i].querySelector('a').tabIndex=i===active?0:-1;
 });nav.querySelectorAll('button').forEach((b,i)=>{if(i===active)b.setAttribute('aria-current','step');else b.removeAttribute('aria-current')})};
 const schedule=()=>{if(!frame)frame=requestAnimationFrame(update)};
 const focusStep=i=>{if(!shell.classList.contains('is-orbiting')||document.body.classList.contains('motion-paused'))return;const top=parseFloat(getComputedStyle(stage).top)||0;snapTo(scrollY+shell.getBoundingClientRect().top-top+(shell.offsetHeight-stage.offsetHeight)*i/2)};titles.forEach((title,i)=>title.addEventListener('focus',()=>focusStep(i)));nav.querySelectorAll('button').forEach((b,i)=>b.onclick=()=>focusStep(i));
 const snapTo=target=>{cancelAnimationFrame(snapFrame);clearTimeout(snapTimer);const epoch=++snapEpoch,start=scrollY,begin=performance.now();snapping=true;const tick=now=>{if(epoch!==snapEpoch)return;if(mq.matches||document.body.classList.contains('motion-paused')||!shell.getClientRects().length){snapping=false;return}const t=Math.min(1,(now-begin)/430),ease=1-Math.pow(1-t,3);window.scrollTo({top:start+(target-start)*ease,behavior:'instant'});schedule();if(t<1)snapFrame=requestAnimationFrame(tick);else{window.scrollTo({top:target,behavior:'instant'});lastScrollY=scrollY;snapping=false;snapFrame=0;schedule()}};snapFrame=requestAnimationFrame(tick)};
 const settle=()=>{if(mq.matches||snapping||touching||document.body.classList.contains('motion-paused')||!shell.getClientRects().length)return;const top=parseFloat(getComputedStyle(stage).top)||0,travel=shell.offsetHeight-stage.offsetHeight,offset=top-shell.getBoundingClientRect().top;if(travel<=0||offset<0||offset>travel)return;const step=offset/travel*2,nearest=Math.max(0,Math.min(1,(scrollDirection>0?Math.ceil(step-.008):Math.floor(step+.008))/2)),target=scrollY-offset+nearest*travel;if(Math.abs(target-scrollY)<1)return;snapTo(target)};
 const armSettle=delay=>{clearTimeout(settleTimer);settleTimer=setTimeout(settle,delay)};
 const onScroll=()=>{if(!snapping&&Math.abs(scrollY-lastScrollY)>1)scrollDirection=scrollY>lastScrollY?1:-1;lastScrollY=scrollY;schedule();if(!snapping)armSettle(130)};
 const interrupt=()=>{snapEpoch++;cancelAnimationFrame(snapFrame);snapFrame=0;snapping=false;clearTimeout(snapTimer);clearTimeout(settleTimer)};
 window.addEventListener('wheel',interrupt,{passive:true});window.addEventListener('keydown',e=>{if(['ArrowDown','ArrowUp','PageDown','PageUp','Home','End',' '].includes(e.key)&&!(e.target instanceof Element&&e.target.matches('input,textarea,select')))interrupt()});window.addEventListener('pointerdown',e=>{touching=e.pointerType==='touch';interrupt()},{passive:true});window.addEventListener('pointerup',()=>{touching=false;armSettle(130)},{passive:true});window.addEventListener('pointercancel',()=>{touching=false;armSettle(130)},{passive:true});window.addEventListener('scrollend',()=>{if(!snapping)armSettle(35)},{passive:true});
 const configure=()=>{shell.classList.toggle('is-orbiting',!mq.matches);if(mq.matches)interrupt();else schedule()};window.addEventListener('scroll',onScroll,{passive:true});window.addEventListener('resize',()=>{interrupt();schedule();armSettle(130)});mq.addEventListener('change',configure);new MutationObserver(()=>{schedule();if(!document.body.classList.contains('motion-paused'))armSettle(80)}).observe(document.body,{attributes:true,attributeFilter:['class']});configure();
}
initializeFeatureOrbit();

// A shorter landing page: one introduction, one start area, then the feature wheel.
document.querySelectorAll('.intro-identifier,.hero-badge,.intro-actions>span,.intro-scroll,.scene-coordinate,.blueprint-orbit,.brand .pill').forEach(el=>el.remove());
const oldStory=document.querySelector('.launch-story');if(oldStory)oldStory.hidden=true;
const repeatedHeading=document.querySelector('.launch-controls>h3');if(repeatedHeading)repeatedHeading.remove();
const launchTitle=document.querySelector('.launch-title');if(launchTitle)launchTitle.innerHTML='<span class="headline-accent">Find a path forward.</span>';
const launchIntro=document.querySelector('.launch-section>p');if(launchIntro)launchIntro.textContent='Start with your estimates, or explore a fictional example.';
const trust=document.querySelector('.trust-row');if(trust)trust.textContent='Private on your device · Works offline · Save and return';
const prep=document.querySelector('.preflight-link');if(prep)prep.textContent='What you’ll need ↗';
const sectorNote=document.getElementById('sectorDescription');if(sectorNote)sectorNote.hidden=true;


// Simple family examples and optional saved scenarios; all data stays in the plan file.
function validateScenarioSets(s){if(s.exampleStory!==undefined&&typeof s.exampleStory!=='boolean')throw Error('Invalid example marker.');if(s.scenarioSets===undefined)return;const sets=s.scenarioSets;if(!sets||typeof sets!=='object'||Array.isArray(sets))throw Error('Invalid saved scenarios.');for(const sector of ['home','farm']){if(!Array.isArray(sets[sector])||sets[sector].length>3)throw Error('Keep up to three saved scenarios per property type.');const ids=new Set();for(const entry of sets[sector]){if(!entry||typeof entry.id!=='string'||entry.id.length>80||ids.has(entry.id)||typeof entry.name!=='string'||entry.name.length>40||!entry.name.trim()||!entry.data||typeof entry.data!=='object'||Array.isArray(entry.data)||'scenarioSets'in entry.data||'farm'in entry.data)throw Error('Invalid saved scenario.');ids.add(entry.id);if(sector==='home')validate(entry.data);else validateFarm(entry.data)}}}
function scenarioSets(){if(!state.scenarioSets)state.scenarioSets={home:[],farm:[]};return state.scenarioSets}
function scenarioSnapshot(sector){const source=sector==='farm'?state.farm:state;return structuredClone(Object.fromEntries(Object.entries(source).filter(([key])=>!['farm','scenarioSets','activeSector','testingNotes','feedback'].includes(key))))}
function validateSnapshot(sector,data){if(sector==='home')validate({...data,feedback:data.feedback||''});else validateFarm(data)}
function launchFamilyExample(){const sector=selectedSector;if(sector==='home'){if(startPlan(true)===false)return;state.owners=[{name:'Alex',share:50,capacity:900},{name:'Jordan',share:50,capacity:450}];state.custom=[650,650];state.buyoutEnabled=false;state.goal='keep';state.exampleStory=true;mount();mark();showStep(3)}else{if(startSelected(true)===false)return;state.farm.owners=[{name:'Alex',share:50,capacity:6000},{name:'Jordan',share:50,capacity:3000}];state.farm.buyoutEnabled=false;state.farm.goal='unsure';state.farm.exampleStory=true;mountFarm();mark();showFarmStep(3)}}
// One calm action area, visible without scrolling past the illustration.
const heroLeft=document.querySelector('#home>.hero-grid>div:first-child'),heroActions=heroLeft.querySelector('.intro-actions'),startActions=document.querySelector('.start-actions');
if(heroActions&&startActions){heroActions.replaceChildren(startActions);const demo=startActions.querySelector('button:nth-child(2)');demo.textContent='Explore a family example';demo.onclick=openFamilyExampleContext;const trustLine=document.querySelector('.trust-row');if(trustLine)heroActions.after(trustLine);const prepLink=document.querySelector('.preflight-link');if(prepLink)heroLeft.append(prepLink)}
const audience=heroLeft.querySelector('.intro');if(audience)audience.textContent='For Kentucky families sharing an inherited home or farmland. Compare each owner’s costs before deciding what comes next.';
const launchSection=$('plannerLaunch');if(launchSection)launchSection.hidden=true;
scrollToFeatures=function(){document.querySelector('.feature-orbit').scrollIntoView({behavior:matchMedia('(prefers-reduced-motion: reduce)').matches?'instant':'smooth'})};
// Existing feature detail pages return to the primary action area.
const featureReturnObserver=new MutationObserver(()=>{const back=$('featureContinue');if(back)back.onclick=()=>{closeFeatureDetail(false);history.replaceState(null,'','#home');heroLeft.scrollIntoView({behavior:'smooth',block:'center'})}});featureReturnObserver.observe($('featureDetail'),{childList:true});
for(const breakdown of [homeBreakdown,farmBreakdown]){const wrap=document.createElement('details');wrap.className='panel optional-breakdown';wrap.innerHTML='<summary>How the totals are calculated</summary>';breakdown.before(wrap);wrap.append(breakdown);breakdown.classList.remove('panel')}
const homeCase=document.createElement('aside');homeCase.className='case-banner';homeCase.hidden=true;$('takeaway').before(homeCase);
const farmCase=document.createElement('aside');farmCase.className='case-banner';farmCase.hidden=true;$('farmTakeaway').before(farmCase);
const homeInsight=document.createElement('section');homeInsight.className='decision-insight';$('takeaway').after(homeInsight);
const farmInsight=document.createElement('section');farmInsight.className='decision-insight';$('farmTakeaway').after(farmInsight);
function unknownIn(s,keys){return keys.some(k=>s.unknown?.[k]===true)}
function decisionMeaning(sector,s){const farm=sector==='farm',c=farm?farmCalc(s):calculate(s),keepKeys=farm?farmKeepKeys:homeKeepKeys,period=farm?'year':'month';if(unknownIn(s,keepKeys))return '<h3>A few estimates are still missing.</h3><p>Add the recurring costs to understand what shared ownership would require. Unknown costs are not free.</p>';
const short=s.owners.map((o,i)=>({o,due:farm?c.keep*o.share/100:contribution(s,c,i),unknown:s.unknown?.['capacity:'+i]})).filter(x=>!x.unknown&&x.due>x.o.capacity+.01),budgetUnknown=s.owners.some((_,i)=>s.unknown?.['capacity:'+i]);let heading,text;
if(short.length){heading='The proposed bills exceed '+(short.length===1?'one owner’s budget.':short.length+' owners’ budgets.');text=short.map(x=>esc(x.o.name)+' would need '+money(x.due-x.o.capacity)+' more per '+period).join('; ')+'. This is based on '+(farm?'ownership shares, before rent.':'the contribution split you selected.')}else if(budgetUnknown){heading='The shared cost is known. Some budgets are not.';text='Enter each owner’s available budget to see whether the proposed contributions fit.'}else{heading='The proposed shared bills fit the entered budgets.';text='That covers the recurring '+period+'ly costs only. '+(s.unknown?.repairs?'Immediate repair costs are still unknown.':money(s.repairs)+' of immediate repairs is a separate cash requirement.')}
if(!farm&&s.split==='custom'){const total=s.custom.reduce((a,v)=>a+v,0);if(total<c.keep-.01){heading=money(c.keep-total)+' of monthly bills is uncovered.';text='The custom contributions total '+money(total)+' against '+money(c.keep)+' of recurring costs. Discuss how that gap would be funded.'}}
if(farm&&!unknownIn(s,farmRentKeys))text+=' Under the entered rent assumptions, '+(c.netRent>=0?money(c.netRent)+' remains each year after the listed annual bills.':money(-c.netRent)+' would still be needed from the family each year.');return '<h3>'+heading+'</h3><p>'+text+'</p><small>For discussion—not a recommended decision or financing approval.</small>'}
function scenarioDifferences(sector,current,saved){const keys=(sector==='farm'?farmFields:specs).map(x=>x[0]).filter(k=>current.buyoutEnabled||saved.buyoutEnabled||!['cash','closing','availableCash','rate','years'].includes(k));const changes=[];for(const k of keys){const a=current.unknown?.[k]?'Unknown':current[k],b=saved.unknown?.[k]?'Unknown':saved[k];if(a!==b){const label=fieldTitle(sector,k).replace(/\s*\(.*?\)/g,'');const format=x=>x==='Unknown'?x:['rate','sellPercent','collection','rentDrop'].includes(k)?x+'%':['years','acres','rentAcres'].includes(k)?String(x):money(x);changes.push(esc(label)+': '+esc(format(a))+' → '+esc(format(b)))}}
if(sector==='home'&&current.holdMonths!==saved.holdMonths)changes.push('Temporary hold: '+current.holdMonths+' → '+saved.holdMonths+' months.');if(JSON.stringify(current.owners)!==JSON.stringify(saved.owners))changes.push('Owner shares, names, or budgets differ.');if(current.split!==saved.split||JSON.stringify(current.custom)!==JSON.stringify(saved.custom))changes.push('The contribution split differs.');if(!!current.buyoutEnabled!==!!saved.buyoutEnabled)changes.push('Buyout '+(saved.buyoutEnabled?'included':'not selected')+'.');return changes.length?changes.slice(0,3).join('<br>')+(changes.length>3?'<br>+'+(changes.length-3)+' more changes':''):'Same financial estimates.'}
function snapshotMetrics(sector,s){const farm=sector==='farm',c=farm?farmCalc(s):calculate(s),period=farm?' / year':' / month',keepMissing=unknownIn(s,farm?farmKeepKeys:homeKeepKeys),budgetUnknown=s.owners.some((_,i)=>s.unknown?.['capacity:'+i]);const deficits=s.owners.map((o,i)=>Math.max(0,(farm?c.keep*o.share/100:contribution(s,c,i))-o.capacity));const rows=[['Shared bills',keepMissing?'Incomplete':money(c.keep)+period],['Repairs due now',s.unknown?.repairs?'Unknown':money(s.repairs)+' · one time'],['Owner budget gaps',keepMissing||budgetUnknown?'Needs costs or budgets':deficits.some(v=>v>.01)?deficits.map((v,i)=>v>.01?esc(s.owners[i].name)+': '+money(v)+period:'').filter(Boolean).join('<br>'):'None in the entered recurring budgets'],['Sale proceeds',unknownIn(s,farm?farmSaleKeys:homeSaleKeys)?'Incomplete':money(Math.abs(c.sale))+(c.sale>=0?' left to split':' shortfall')]];
if(!farm)rows.splice(3,0,['Temporary hold · including repairs',keepMissing||s.unknown?.repairs?'Incomplete':money(c.keep*s.holdMonths+s.repairs)+' over '+s.holdMonths+' months']);if(farm)rows.splice(3,0,['Cash rent after bills',unknownIn(s,farmRentKeys)?'Incomplete':money(Math.abs(c.netRent))+(c.netRent>=0?' left / year':' family pays / year')]);rows.push(['Optional buyout',!s.buyoutEnabled?'Not selected':unknownIn(s,farm?farmBuyKeys:homeBuyKeys)?'Incomplete':c.equity<0?'Not modeled':money(c.upfront)+' upfront<br>'+money(farm?c.buyAnnual:c.buy)+period+(farm?' before rent':'')]);return rows}
const scenarioUI={};
function buildScenarioPanel(sector,anchor){const panel=document.createElement('details');panel.className='panel scenario-panel';panel.innerHTML='<summary>Save and compare alternatives <span class="scenario-count"></span></summary><p class="note">Keep up to three versions of this property’s estimates. Compare what changes without losing an option. Included when you download your plan.</p><div class="scenario-save"><label>Option name<input type="text" maxlength="40" placeholder="e.g. Higher repair estimate" aria-label="'+(sector==='farm'?'Farmland':'Home')+' option name"></label><button type="button">Save current option</button></div><p class="scenario-message" role="status"></p><div class="scenario-comparison"></div>';anchor.after(panel);const input=panel.querySelector('input'),message=panel.querySelector('.scenario-message');panel.querySelector('button').onclick=()=>{try{sector==='home'?validate(state,{includeFarm:false}):validateFarm(state.farm);const sets=scenarioSets(),list=sets[sector];if(list.length>=3){message.textContent='Three options saved. Remove one to make room.';return}const data=scenarioSnapshot(sector);if(sector==='home')data.feedback='';validateSnapshot(sector,data);const name=input.value.trim()||'Option '+(list.length+1);list.push({id:Date.now().toString(36)+'-'+Math.random().toString(36).slice(2,8),name,data});input.value='';mark();renderScenarioPanel(sector);message.textContent='“'+name+'” saved. Download your plan to keep it after closing.'}catch(err){message.textContent='Cannot save this option: '+err.message}};scenarioUI[sector]={panel,input,message};return panel}
buildScenarioPanel('home',homeInsight);buildScenarioPanel('farm',farmInsight);
function renderScenarioPanel(sector){const ui=scenarioUI[sector],list=scenarioSets()[sector],current=scenarioSnapshot(sector);ui.panel.querySelector('.scenario-count').textContent=list.length?'('+list.length+'/3)':'';ui.panel.querySelector('.scenario-save button').disabled=list.length>=3;let columns;
try{validateSnapshot(sector,current);columns=[{id:'current',name:'Current estimates',data:current},...list];columns.forEach(x=>validateSnapshot(sector,x.data))}catch(err){ui.panel.querySelector('.scenario-comparison').innerHTML='<p class="note">Correct the input error to compare saved options.</p>';return}
if(!list.length){ui.panel.querySelector('.scenario-comparison').innerHTML='<p class="note">Save an option, change an estimate, then return here to compare.</p>';return}const metrics=columns.map(x=>snapshotMetrics(sector,x.data));const compare=ui.panel.querySelector('.scenario-comparison');compare.innerHTML='<p class="scenario-swipe">Swipe across to compare your saved options.</p><div class="scroll"><table class="scenario-table"><thead><tr><th scope="col">Compare</th>'+columns.map(col=>'<th scope="col">'+esc(col.name)+'</th>').join('')+'</tr></thead><tbody>'+metrics[0].map(([label],i)=>label==='Optional buyout'&&!columns.some(col=>col.data.buyoutEnabled)?'':'<tr><th scope="row">'+label+'</th>'+metrics.map(col=>'<td>'+col[i][1]+'</td>').join('')+'</tr>').join('')+'<tr><th scope="row">Changes from current<br><small>Current → saved</small></th><td>Current version</td>'+list.map(x=>'<td class="scenario-differences">'+scenarioDifferences(sector,current,x.data)+'</td>').join('')+'</tr></tbody></table></div><div class="saved-option-actions">'+list.map(x=>'<div><span>'+esc(x.name)+'</span><button type="button" data-use="'+esc(x.id)+'">Use estimates</button><button type="button" class="secondary" data-remove="'+esc(x.id)+'" aria-label="Remove '+esc(x.name)+'">Remove</button></div>').join('')+'</div><p class="note">A saved option is another set of assumptions, not an agreement. Home comparisons are monthly; land comparisons are annual. Sale proceeds are for all owners combined.</p>';
compare.querySelectorAll('[data-use]').forEach(button=>button.onclick=()=>{const item=scenarioSets()[sector].find(x=>x.id===button.dataset.use);if(!item)return;if(JSON.stringify(current)!==JSON.stringify(item.data)&&!confirm('Replace the current '+(sector==='farm'?'land':'home')+' estimates with “'+item.name+'”? Save the current option first if you want to keep it.'))return;const sets=scenarioSets();if(sector==='home'){const farm=state.farm;state={...structuredClone(item.data),farm,scenarioSets:sets,activeSector:'home'};mount();showStep(3)}else{state.farm=structuredClone(item.data);mountFarm();showFarmStep(3)}mark();scenarioUI[sector].panel.open=true;scenarioUI[sector].message.textContent='Using “'+item.name+'”.'});
compare.querySelectorAll('[data-remove]').forEach(button=>button.onclick=()=>{const sets=scenarioSets();sets[sector]=sets[sector].filter(x=>x.id!==button.dataset.remove);mark();renderScenarioPanel(sector);ui.message.textContent='Saved option removed. Current estimates are unchanged.'})}
function refreshDecisionFeatures(sector){const farm=sector==='farm',s=farm?state.farm:state,caseBox=farm?farmCase:homeCase,insight=farm?farmInsight:homeInsight,error=$(farm?'farmError':'error');caseBox.hidden=!s.exampleStory;if(s.exampleStory)caseBox.innerHTML='<span class="eyebrow">FICTIONAL FAMILY EXAMPLE</span><p>Fictional starting point: '+(farm?'two siblings share farmland, but have different annual budgets. Compare shared costs, cash rent, and selling.':'two siblings inherit equal shares of a home, but have different monthly budgets. Change any estimate to see how the comparison changes.')+'</p><button type="button" class="secondary case-inputs">See the inputs</button>';const see=caseBox.querySelector('button');if(see)see.onclick=()=>farm?showFarmStep(0):showStep(0);insight.hidden=!!error.textContent;if(!error.textContent){insight.innerHTML=decisionMeaning(sector,s);const summary=farm?farmSummary:homeSummary;const first=summary.querySelector('h3');if(first){const block=document.createElement('div');block.className='summary-meaning';block.innerHTML=decisionMeaning(sector,s);first.before(block)}}renderScenarioPanel(sector)}
const renderBeforeDecisionFeatures=render;render=function(){renderBeforeDecisionFeatures();refreshDecisionFeatures('home')};const renderFarmBeforeDecisionFeatures=renderFarm;renderFarm=function(){renderFarmBeforeDecisionFeatures();refreshDecisionFeatures('farm')};
render();renderFarm();


function scenarioPrintTables(sector){const list=scenarioSets()[sector];if(!list.length)return '';const columns=[{name:'Current estimates',data:scenarioSnapshot(sector)},...list],metrics=columns.map(x=>snapshotMetrics(sector,x.data));return '<h2>Saved alternatives</h2><p>Different assumptions for the same property. '+(sector==='farm'?'Land amounts are annual.':'Home amounts are monthly.')+' Repairs and upfront buyout cash are one-time costs.</p><table><thead><tr><th>Compare</th>'+columns.map(c=>'<th>'+esc(c.name)+'</th>').join('')+'</tr></thead><tbody>'+metrics[0].map(([label],i)=>label==='Optional buyout'&&!columns.some(col=>col.data.buyoutEnabled)?'':'<tr><th>'+label+'</th>'+metrics.map(col=>'<td>'+col[i][1]+'</td>').join('')+'</tr>').join('')+'</tbody></table>'}

// Explain the fictional situation before opening its comparison.
const exampleContext=document.createElement('dialog');exampleContext.className='example-context';exampleContext.id='familyExampleContext';exampleContext.setAttribute('aria-labelledby','familyExampleTitle');document.body.append(exampleContext);
function openFamilyExampleContext(){const sector=selectedSector,farm=sector==='farm';exampleContext.innerHTML='<span class="eyebrow">A FICTIONAL FAMILY · '+(farm?'FARMLAND':'HOME')+'</span><h2 id="familyExampleTitle">Meet Alex and Jordan.</h2><p>Two siblings have inherited equal shares of '+(farm?'80 acres of farmland. They want to understand what keeping it, renting it out, or selling it would mean.':'a family home. They would like to keep it together, but they have different amounts available for the bills.')+'</p><div class="example-facts"><div><strong>Alex</strong><small>Can contribute '+(farm?'$6,000 per year':'$900 per month')+'</small></div><div><strong>Jordan</strong><small>Can contribute '+(farm?'$3,000 per year':'$450 per month')+'</small></div></div><p>'+ (farm?'The example land costs $9,100 a year to keep before rent, with $5,000 of immediate repairs.':'The example home costs $1,300 a month to keep, with $12,000 of immediate repairs.')+'</p><p class="example-question">Can both owners cover their share? The next screen compares the costs with their budgets.</p><p class="fiction-note">All figures are made up for learning. You can inspect or change every estimate.</p><div class="dialog-actions"><button type="button" id="openFamilyComparison">See their comparison →</button><button type="button" class="secondary" id="closeFamilyContext">Back</button></div>';exampleContext.querySelector('#closeFamilyContext').onclick=()=>exampleContext.close();exampleContext.querySelector('#openFamilyComparison').onclick=()=>{exampleContext.close();selectedSector=sector;launchFamilyExample()};exampleContext.showModal()}
exampleContext.addEventListener('click',e=>{if(e.target===exampleContext){const rect=exampleContext.getBoundingClientRect();if(e.clientX<rect.left||e.clientX>rect.right||e.clientY<rect.top||e.clientY>rect.bottom)exampleContext.close()}});

</script>
<style>
.recommendation-box{background:linear-gradient(145deg,#173b70,#102945);border:1px solid #5686d5;border-left:5px solid #78adff;border-radius:18px;padding:25px 28px;margin:22px 0 25px;color:#f3f7ff;box-shadow:0 12px 30px #0002}
.recommendation-box .recommendation-label{color:#b8d4ff;font-size:12px;font-weight:750;letter-spacing:1.4px;text-transform:uppercase}
.recommendation-box h2{color:#fff;margin:9px 0 12px;font-size:25px}
.recommendation-box p{color:#e0eafa;font-size:15px;line-height:1.7;margin:9px 0}
.recommendation-box .recommendation-caveat{font-size:12px;color:#c0d3ec;border-top:1px solid #ffffff25;padding-top:13px;margin-top:17px}
@media(max-width:700px){.recommendation-box{padding:19px 17px}.recommendation-box h2{font-size:22px}}
@media print{.recommendation-box{background:#eaf1fc!important;color:#183355!important;border-color:#4774ad!important}.recommendation-box *{color:#183355!important}}
</style>
<script>
// Navigate to the visible step heading after all layout and render changes settle.
// Avoid scrollIntoView on the horizontal step tabs, which can shift the vertical viewport.
scrollToPlanningTop=function(){
 const root=document.getElementById('wizard')&&!document.getElementById('wizard').hidden?document.getElementById('wizard'):document.getElementById('farmWorkspace');
 if(!root||root.hidden)return;
 const move=()=>{if(root.hidden)return;const header=document.querySelector('body > header');const headerHeight=header&&getComputedStyle(header).position==='sticky'?header.getBoundingClientRect().height:0;const top=Math.max(0,root.getBoundingClientRect().top+window.pageYOffset-headerHeight-14);window.scrollTo(0,top)};
 move();requestAnimationFrame(move);setTimeout(move,80);setTimeout(move,240);
};
// Capture step changes from the actual Continue / Back controls, including dynamic steps.
document.addEventListener('click',function(e){const button=e.target.closest('#nextStep,#backStep,#farmNext,#farmBack,[data-gostep],[data-farmnav]');if(!button)return;setTimeout(scrollToPlanningTop,0);setTimeout(scrollToPlanningTop,160)},true);
const homeRecommendation=document.createElement('section');homeRecommendation.className='recommendation-box';homeRecommendation.setAttribute('aria-live','polite');document.getElementById('takeaway').before(homeRecommendation);
const farmRecommendation=document.createElement('section');farmRecommendation.className='recommendation-box';farmRecommendation.setAttribute('aria-live','polite');document.getElementById('farmTakeaway').before(farmRecommendation);
function updateRecommendation(sector){
 const farm=sector==='farm',s=farm?state.farm:state,box=farm?farmRecommendation:homeRecommendation;
 const error=document.getElementById(farm?'farmError':'error');
 if(error&&error.textContent){box.innerHTML='<span class="recommendation-label">Suggested next step</span><h2>Correct the highlighted inputs first</h2><p>The comparison cannot be interpreted until the input errors are resolved.</p>';return}
 const missing=missingKeys(sector),goal=planningMeta(sector).goal,c=farm?farmCalc(s):calculate(s);
 const period=farm?'year':'month';
 let title,description;
 if(missing.length){title='Complete the missing estimates first';description='There '+(missing.length===1?'is one important estimate':'are '+missing.length+' important estimates')+' still missing. Fill '+(missing.length===1?'it':'them')+' in before deciding whether to keep, buy out, rent, or sell. Unknown costs should not be treated as zero.'}
 else{
  const due=s.owners.map((o,i)=>farm?c.keep*o.share/100:contribution(s,c,i));
  const short=s.owners.filter((o,i)=>due[i]>o.capacity+.01);
  if(short.length){title='Discuss affordability before committing to shared ownership';description='The proposed recurring contributions exceed '+(short.length===1?'one family member’s':'some family members’')+' entered budget. Consider adjusting how costs are shared, exploring a buyout, or comparing the sale option.'}
  else if(goal==='sell'){title='Review the sale scenario together';description='Selling appears aligned with the goal you selected. Review estimated proceeds, ownership shares, and transaction costs below before making a decision.'}
  else if(farm&&c.netRent>=0){title='Compare keeping the land with cash renting';description='Under the entered assumptions, annual cash rent covers the listed annual land bills. Review lease risks, repairs, and each owner’s share before choosing.'}
  else if(goal==='keep'){title='Explore keeping the property together';description='The entered recurring contributions fit the family budgets. Review immediate repairs, long-term responsibilities, and the buyout or sale alternatives before committing.'}
  else{title='Compare the options with your family';description='The entered shared costs fit the stated recurring budgets. Compare keeping, '+(farm?'cash renting, ':'')+'buying out, and selling below; the best choice also depends on preferences and risks not captured by the numbers.'}
 }
 box.innerHTML='<span class="recommendation-label">Recommendation · based on your estimates</span><h2>'+title+'</h2><p>'+description+'</p><p class="recommendation-caveat">This is a suggested discussion direction, not a definitive financial, legal, or tax recommendation. The detailed calculations and owner-by-owner data follow below.</p>';
}
const previousRefreshDecisionFeatures=refreshDecisionFeatures;
refreshDecisionFeatures=function(sector){previousRefreshDecisionFeatures(sector);updateRecommendation(sector)};
updateRecommendation('home');updateRecommendation('farm');
</script>

<style id="mobile-polish-fix">
/* Readable guidance in the light interface, including on narrow screens. */
.quick-guide{background:#edf4ff!important;border:1px solid #b9cde7!important;border-left:4px solid #3465ac!important;border-radius:12px!important;color:#23476e!important}
.quick-guide strong,.quick-guide b{color:#183e6b!important}
.quick-guide p{color:#355778!important;line-height:1.65}
@media screen and (max-width:700px){
 .quick-guide{padding:17px 18px!important;margin:14px 0 22px!important}
 .quick-guide strong{font-size:17px!important;line-height:1.4;display:block;margin-bottom:9px}
 .quick-guide p{font-size:14px!important;margin:10px 0!important}
 /* Long tables become individually labeled owner/metric cards. */
 .scroll:has(table.mobile-card-table){overflow:visible!important;max-width:100%}
 table.mobile-card-table{display:block!important;width:100%!important;min-width:0!important;table-layout:auto!important;border:0!important}
 table.mobile-card-table thead{display:none!important}
 table.mobile-card-table tbody{display:block!important;width:100%!important}
 table.mobile-card-table tbody tr{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:12px!important;padding:16px!important;margin:0 0 13px!important;border:1px solid #cbdced!important;border-radius:13px!important;background:#f6faff!important;width:100%!important;min-width:0!important}
 table.mobile-card-table tbody td,table.mobile-card-table tbody th{display:block!important;min-width:0!important;width:auto!important;max-width:100%!important;padding:0!important;border:0!important;text-align:left!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;color:#193e69!important;font-size:14px!important;line-height:1.45!important}
 table.mobile-card-table tbody td::before,table.mobile-card-table tbody th::before{content:attr(data-mobile-label);display:block;color:#667f9c;font-size:11px;font-weight:600;line-height:1.4;margin-bottom:5px}
 table.mobile-card-table tbody tr > :first-child{grid-column:1/-1!important;font-weight:750!important;font-size:17px!important;padding-bottom:10px!important;border-bottom:1px solid #d7e3f0!important}
 table.mobile-card-table tbody tr > :first-child::before{font-size:11px!important}
 .panel:has(#comparison) .note{overflow-wrap:break-word}
}
@media screen and (max-width:380px){table.mobile-card-table tbody tr{grid-template-columns:minmax(0,1fr)!important}}
@media print{table.mobile-card-table{display:table!important}table.mobile-card-table thead{display:table-header-group!important}}
</style>
<script>
// Keep table labels synced when results are recalculated or ownership rows change.
(function(){
 function applyMobileTableLabels(){
  document.querySelectorAll('.scroll table').forEach(table=>{
   const heads=Array.from(table.querySelectorAll('thead tr:first-child th,thead tr:first-child td')).map(h=>h.textContent.trim());
   if(!heads.length)return;
   table.classList.add('mobile-card-table');
   table.querySelectorAll('tbody tr').forEach(row=>{
    Array.from(row.children).forEach((cell,index)=>{
     if(!cell.matches('td,th'))return;
     cell.setAttribute('data-mobile-label',heads[index]||'Value');
    });
   });
  });
 }
 let queued=false;
 const schedule=()=>{if(queued)return;queued=true;requestAnimationFrame(()=>{queued=false;applyMobileTableLabels()})};
 document.addEventListener('DOMContentLoaded',()=>{
  applyMobileTableLabels();
  const observer=new MutationObserver(schedule);
  observer.observe(document.body,{subtree:true,childList:true});
 });
})();
</script>
</html>

Reaches out to

Websites this page contacts when it runs — fonts, chart libraries, data. Found by reading its source.

  • www.kyjustice.org
  • kybar.org

Licence

Published on Globefin under the MIT License. You may copy, change, and reuse this page, including commercially — just keep the notice below with it.

Copyright © 2026 Clay Deardorff. Licensed under the MIT License. Published on Globefin.

Provided as is, without warranty. Any external libraries it loads keep their own licences. Terms →

Sandbox

Scripts run, but the demo has its own throwaway origin. It can't read your session or cookies, can't reach the page around it, and can't navigate your tab. Don't enter real passwords or personal data into any demo.