<!-- SOLID CITY · part 3654 -->
 dz < 150 * 150) {
    H.saidHouse = true;
    A.help('🏠 THE PILOT HOUSE — the nation\'s first dwelling, in Ward 2. Its door is glass; walk in, stand on its floor, examine its foundations. Nine more lawful houses now stand beside it.', 8);
  }
  for (var w in STREET) {
    if (H.saidStreet[w]) continue;
    var st = STREET[w], sx = S.p.x - st.x, sz = S.p.z - st.z;
    if (sx * sx + sz * sz < 130 * 130) { H.saidStreet[w] = true; A.help(st.line || ('🏘 ' + st.name + ' STREET — dwellings of the nation stand along this path, each founded on sampled ground, each floor under standing law.'), 7); }
  }
  var clx = S.p.x + 912, clz = S.p.z + 768;
  if (!H.saidClimb && clx * clx + clz * clz < 90 * 90) { H.saidClimb = true; A.help('🧗 THE CLIMB — a test segment of the authorized W4–W5 high road: a separate permission class, surveyed station by station, cresting where Ward 4\'s own path already touches the high ground.', 7); }
  var w6x = S.p.x + 1127, w6z = S.p.z + 524;
  if (!H.saidW6 && w6x * w6x + w6z * w6z < 70 * 70) { H.saidW6 = true; A.help('🛤 THE WARD 6 LINK — the South Ward touches the Long Road here, on a surveyed line, at the corridor\'s edge.', 7); }
  for (var k in LINK_MID) {
    if (H.saidJoin[k]) continue;
    var m = LINK_MID[k], jx = S.p.x - m.x, jz = S.p.z - m.z;
    if (jx * jx + jz * jz < 60 * 60) { H.saidJoin[k] = true; A.help('🛤 A join in the nation\'s road — the wards are one network here. This link was measured to three hundredths of a millimetre of its constructed surface.', 7); }
  }
}
function wallSolids(house) {
  var mesh = house.mesh, st = house.stand;
  var c = Math.cos(mesh.rotation.y), s = Math.sin(mesh.rotation.y);
  (house.solids.source || []).forEach(function (w) {
    var p = w.geometry.parameters, ly = w.position.y;
    if (p.height < 1 && ly > st.center[1] + 2) return; // the lintel — above the door, no standing law
    var len = Math.max(p.width, p.depth), dep = Math.min(p.width, p.depth);
    var n = Math.max(1, Math.ceil(len / 0.9)), cw = len / n;
    var hx = cw / 2 * Math.abs(c) + dep / 2 * Math.abs(s), hz = cw / 2 * Math.abs(s) + dep / 2 * Math.abs(c);
    for (var i = 0; i < n; i++) {
      var off = -len / 2 + cw * (i + 0.5);
      var lx = w.position.x + (p.width >= p.depth ? off : 0), lz = w.position.z + (p.width >= p.depth ? 0 : off);
      var wx = mesh.position.x + lx * c + lz * s, wz = mesh.position.z - lx * s + lz * c;
      A.solids.push({ x0: wx - hx, x1: wx + hx, z0: wz - hz, z1: wz + hz, y0: ly - p.height / 2 - 0.03, y1: ly + p.height / 2 + 0.03, wardHouseWall: true });
    }
  });
}
function raiseHouse(house) {
  A.scene.add(house.mesh);
  var roofTop = null, floorMesh = null, roofMesh = null;
  house.mesh.children.forEach(function (ch) {
    var p = ch.geometry && ch.geometry.parameters;
    if (!p) return;
    if (p.width >= 8.7 && Math.abs(p.height - 0.28) < 0.01) { roofTop = ch.position.y + p.height / 2; roofMesh = ch; }
    if (p.width >= 7.5 && p.height >= 0.2 && p.height <= 0.6 && Math.abs(ch.position.y + p.height / 2 - house.stand.center[1]) < 0.05) floorMesh = ch;
  });
  H.houses.push({ stand: house.stand, roofTop: roofTop, cx: house.plot.cx, cz: house.plot.cz, ward: house.plot.ward });
  var label = (house.id || ('W' + house.plot.ward)) + ' @ (' + Math.round(house.plot.cx) + ', ' + Math.round(house.plot.cz) + ')';
  regAudit('HOUSE FLOOR — ' + label, floorMesh, topAware(house.stand.center[1]), 'slab');
  if (roofMesh && roofTop) regAudit('HOUSE ROOF — ' + label, roofMesh, topAware(roofTop), 'slab');
  wallSolids(house);
  return roofTop;
}
function load() {
  Promise.all([
    import('/city/ward-houses.js?v=20261013a'),
    import('/city/ward-joins.js?v=20261013a'),
    import('/city/wards.js?v=20261013a'),
    fetch('/city/city.js').then(function (r) { return r.text(); })
  ]).then(function (r) {
    var seg = r[3].slice(r[3].indexOf('var SEED'), r[3].indexOf('function mulberry'));
    var gnd = new Function(seg + '; return groundAt;')();
    var isAllowed = r[2].isAllowedSolidCity(gnd);
    // THE MULTIPLICATION — every lawful house the searcher found, raised.
    var table = [], pilot = null, occupied = [];
    [2, 3, 5].forEach(function (ward) {
      var res = r[0].createWardHouses({ THREE: A.THREE, groundAt: gnd, isAllowed: isAllowed, ward: ward });
      res.accepted.forEach(function (house) {
        raiseHouse(house);
        var m = r[0].measureWardHouse(house, gnd);
        table.push('W' + ward + ' @ (' + Math.round(house.plot.cx) + ', ' + Math.round(house.plot.cz) + ') floor ' + m.floorY.toFixed(2)); occupied.push({ cx: house.plot.cx, cz: house.plot.cz });
        if (ward === 2 && !pilot) pilot = house;
      });
    });
    // WARD 4 — the two surveyed gate plots, raised through the surveyed-plot adapter under the shipped law.
    var w4 = r[0].createSurveyedWardHouses({ THREE: A.THREE, groundAt: gnd, isAllowed: isAllowed, occupiedFootprints: occupied, plots: [
      { id: 'W4-A', ward: 4, cx: -924