<!-- SOLID CITY · part 2570 -->
le = '#c9a44a'; cx2.lineWidth = 5; cx2.strokeRect(10, 10, 1004, 140);
        cx2.fillStyle = '#e8c86a'; cx2.textAlign = 'center'; cx2.textBaseline = 'middle';
        var fs = 64; cx2.font = 'bold ' + fs + 'px Georgia, serif';
        while (cx2.measureText(p.name).width > 940 && fs > 26) { fs -= 4; cx2.font = 'bold ' + fs + 'px Georgia, serif'; }
        cx2.fillText(p.name, 512, 84);
        var tex = new T.CanvasTexture(cv);
        var m = new T.Mesh(new T.PlaneGeometry(11, 1.72), new T.MeshBasicMaterial({ map: tex, side: T.DoubleSide }));
        m.position.set(p.x, gy + 2.45, p.z); m.rotation.y = p.ry;
        extras.push(m);
      } catch (e) {}
    });
  }

  /* ================= BUILD ================= */
  /* THE RAIL TAKES A BODY (the King's finding, 2026-10-13 ~23:34).
   * The smith draws a silver rail on the downhill edge of every
   * bench road and registers nothing for it — the King walked
   * through it at 189 m. Now each station-to-station run of rail
   * registers a body in the footprint list: 0.3 m thick, from just
   * under the edge to just above the rail band, on the side the
   * smith's own upSide verdict names. Lawful gaps are kept: the
   * junction braids (11 m from a junction heart, both ends
   * judged), every driveway mouth (4.5 m), and anywhere a chord
   * would cut inside 3.95 m of any built centreline. */
  function railBodies() {
    var JX = [[945, -1487.5], [915, -1285], [430, -1065]];
    ['B1', 'B2', 'C', 'S'].forEach(function (nm) {
      var rd = smithRoads[nm]; if (!rd || !rd.stations) return;
      var sd = -(rd.upSide || 1), sts = rd.stations;
      var run = null; // a straight run of rail, merged into one body
      function flush() {
        if (!run) return;
        var dx = run.x1 - run.x0, dz = run.z1 - run.z0;
        foot.push([(run.x0 + run.x1) / 2, (run.z0 + run.z1) / 2, Math.hypot(dx, dz) + 0.25, 0.3, run.y0, run.y1, Math.atan2(-dz, dx)]);
        run = null;
      }
      for (var i = 0; i < sts.length - 1; i++) {
        var A = sts[i], B = sts[i + 1];
        var ca = sd < 0 ? A.L : A.R, cb = sd < 0 ? B.L : B.R;
        var pa = [ca[0] + sd * A.rx * 0.62, ca[1], ca[2] + sd * A.rz * 0.62];
        var pb = [cb[0] + sd * B.rx * 0.62, cb[1], cb[2] + sd * B.rz * 0.62];
        var mx = (pa[0] + pb[0]) / 2, mz = (pa[2] + pb[2]) / 2, skip = false;
        /* the braid-head lesson (first audit): a body whose ENDS
         * reach into a junction braid, or whose chord cuts any
         * carriageway — its own road's bend included — walls the
         * very road it guards. Both ends are judged: 11 m from a
         * junction heart, 4.5 m from a driveway mouth, and never
         * inside 3.95 m of any built centreline. */
        var ends = [pa, pb];
        for (var e2 = 0; e2 < 2 && !skip; e2++) {
          for (var j = 0; j < JX.length && !skip; j++) if (Math.hypot(ends[e2][0] - JX[j][0], ends[e2][2] - JX[j][1]) < 11) skip = true;
          if (!skip && segDistToRoad(ends[e2][0], ends[e2][2]).d < 3.95) skip = true;
        }
        for (var k = 0; k < driveMouths.length && !skip; k++) if (Math.hypot(mx - driveMouths[k][0], mz - driveMouths[k][1]) < 4.5) skip = true;
        if (skip) { flush(); continue; }
        var y0 = Math.min(pa[1], pb[1]) - 0.12, y1 = Math.max(pa[1], pb[1]) + 0.7;
        if (run) {
          var adx = pb[0] - run.x1, adz = pb[2] - run.z1, rdx = run.x1 - run.x0, rdz = run.z1 - run.z0;
          var turn = Math.abs(Math.atan2(-adz, adx) - Math.atan2(-rdz, rdx));
          /* runs stay under 2.6 m: the placer splits entries into
           * cells of half the length, and a 1.3 m cell's bounding
           * box hugs a hairpin's curve where a 2.5 m cell's corners
           * reached half a metre into the road (the body gate
           * counted 80 car pushes over 0.6 m at the coarse grain) */
          if (turn > 0.055 || Math.hypot(run.x1 - run.x0, run.z1 - run.z0) > 2.6) flush();
        }
        if (!run) run = { x0: pa[0], z0: pa[2], x1: pb[0], z1: pb[2], y0: y0, y1: y1 };
        else { run.x1 = pb[0]; run.z1 = pb[2]; if (y0 < run.y0) run.y0 = y0; if (y1 > run.y1) run.y1 = y1; }
      }
      flush();
    });
  }
  /* THE ROAD TAKES A BODY (the King's word, 2026-10-13 ~23:41:
   * "I think you should put it on — this way you can raycast
   * everything to see them"). Until now the road was a floor and
   * nothing else: stood upon, invisible to every collision ray —
   * the Survey Camera's stopAt found open air where a road
   * embankment stands. Now, wherever an edge stands over falling
   * ground (drop >= 1.0 m outboard), a body is registered under
   * the edge line: 1.1 m thick, buried 0.6 under the outboard
   * ground, and topped 0.5 m BELOW the surface — the collision
   * step forgives any body whose top is a metre under the feet,
   * so no one on the road or climbing its bank ever feels it,
   * while every ray and every approach from the side meets the
   * road as a solid 