<!-- SOLID CITY · part 2881 -->
  var foot = [], elevators = [], standFloors = [], portholes = [];

  /* ---- shared lightweight materials ---- */
  function lam(c, e) { return new T.MeshLambertMaterial({ color: c, emissive: e || 0x000000 }); }
  var M = {
    dark: lam(0x1a2537), steel: lam(0x3a4556),
    glass: new T.MeshLambertMaterial({ color: 0x92c9e8, transparent: true, opacity: 0.36 }),
    gold: lam(0xd8a833, 0x352400),
    white: lam(0xe8e4da), wood: lam(0x6b4a2f),
    titanium: lam(0x232c3d),            /* dark titanium — primary structure */
    silver: lam(0x9aa4b5),              /* brushed silver — columns, treads, trim */
    warmLight: lam(0xffe6b8, 0xffd88a), /* warm interior light strips */
    stone: lam(0x2c3444)                /* finished floor stone */
  };
  function box(parent, w, h, d, x, y, z, mt) {
    var m = new T.Mesh(new T.BoxGeometry(w, h, d), mt); m.position.set(x, y, z); parent.add(m); return m;
  }
  function FP(x, z, w, d, y0, y1) { foot.push([x, z, w, d, y0, y1, 0]); } // [x,z,w,d,y0,y1,rot]
  function SF(x0, x1, z0, z1, y) { standFloors.push({ x0: x0, x1: x1, z0: z0, z1: z1, y: y }); }
  /* ---- REUSABLE ARCHITECTURAL COMPONENTS (refinement pass) ----
     Strict palette: dark titanium, brushed silver, architectural glass, restrained gold.
     All components preserve the caller's FP/SF collision contracts. */

  /* Finished column: plinth base, brushed-silver shaft, capital, restrained gold reveal.
     Meets floor and ceiling cleanly. Caller adds FP. */
  function finishedColumn(g, x, z, h) {
    box(g, 2.0, 0.5, 2.0, x, 0.25, z, M.titanium);   /* base plinth */
    box(g, 1.4, h - 1.0, 1.4, x, h / 2, z, M.silver); /* shaft */
    box(g, 1.9, 0.5, 1.9, x, h - 0.25, z, M.titanium); /* capital */
    box(g, 1.5, 0.1, 1.5, x, h - 0.55, z, M.gold);     /* gold reveal (restrained) */
  }

  /* Finished staircase: treads with nosing, risers, diagonal stringers,
     railing posts + sloped handrail, top landing with finished edge.
     SF entries kept at identical coordinates — movement unchanged. */
  function finishedStair(g, T, cfg, trim) {
    var hw = 18, hd = 18, FH = 8;
    var stx = -hw + 3;
    var n = 16, run = 1.55, rise = FH / n;
    var z0 = -hd + 4, z1 = z0 + (n - 1) * run;
    var y0 = 0.5 * rise, y1 = (n - 0.5) * rise;
    /* treads (brushed silver, nosing overhang) + risers (dark titanium) */
    for (var st = 0; st < n; st++) {
      var sy = (st + 0.5) * rise, sz2 = z0 + st * run;
      box(g, 3.2, 0.16, 1.75, stx, sy + 0.12, sz2 + 0.12, M.silver); /* tread + nosing */
      box(g, 3.0, 0.34, 1.45, stx, sy - 0.05, sz2, M.titanium);     /* riser body */
      SF(cfg.ox + stx - 1.5, cfg.ox + stx + 1.5, cfg.oz + sz2 - 0.75, cfg.oz + sz2 + 0.75, sy + 0.2);
    }
    /* stringers: diagonal support beams flanking the run */
    var dz = z1 - z0, dy = y1 - y0;
    var slopeLen = Math.sqrt(dz * dz + dy * dy);
    var ang = Math.atan2(dy, dz);
    for (var sd = -1; sd <= 1; sd += 2) {
      var str = new T.Mesh(new T.BoxGeometry(0.35, 0.9, slopeLen), M.titanium);
      str.position.set(stx + sd * 1.7, (y0 + y1) / 2 - 0.35, (z0 + z1) / 2);
      str.rotation.x = -ang; g.add(str);
    }
    /* railing: posts + sloped handrail (restrained gold) */
    for (var rp = 0; rp <= 4; rp++) {
      var rz = z0 + (dz * rp) / 4, ry = y0 + (dy * rp) / 4;
      box(g, 0.12, 1.1, 0.12, stx + 1.65, ry + 0.55, rz, M.silver);
    }
    var rail = new T.Mesh(new T.BoxGeometry(0.14, 0.14, slopeLen), trim);
    rail.position.set(stx + 1.65, (y0 + y1) / 2 + 1.12, (z0 + z1) / 2);
    rail.rotation.x = -ang; g.add(rail);
    /* top landing with finished edge trim */
    box(g, 3.4, 0.35, 3.0, stx, y1 + 0.35, z1 + 2.2, M.stone);
    box(g, 3.5, 0.12, 3.1, stx, y1 + 0.55, z1 + 2.2, trim);
    SF(cfg.ox + stx - 1.7, cfg.ox + stx + 1.7, cfg.oz + z1 + 0.7, cfg.oz + z1 + 3.7, y1 + 0.55);
  }

  /* Refined storefront: framed entrance portal, display window with merchandise,
     sign housing with architectural lettering, warm interior light strip,
     intentional fixtures (display tables, wall shelves, feature pedestal). */
  function refinedStorefront(g, T, cfg, sxp, shop, accentMat) {
    var zB = -13; /* back wall z */
    /* finished shell: back + side walls in dark titanium, header with gold reveal */
    box(g, 10.5, 5.4, 0.5, sxp, 2.7, zB, M.titanium);
    box(g, 0.5, 5.4, 8.5, sxp - 5.25, 2.7, zB + 4.25, M.titanium);
    box(g, 0.5, 5.4, 8.5, sxp + 5.25, 2.7, zB + 4.25, M.titanium);
    box(g, 10.5, 0.7, 8.5, sxp, 5.4, zB + 4.25, M.titanium);          /* header */
    box(g, 10.6, 0.14, 8.6, sxp, 5.0, zB + 4.25, M.gold);             /* gold reveal */
    /* entrance portal: framed doorway facing lobby (open front) */
    box(g, 0.45, 4.6, 0.45, sxp - 2.4, 2.3, zB + 8.2, M.silver);
    box(g, 0.45, 4.6, 0.45, sxp + 2.4, 2.3, zB + 8.2, M.silver);
    box(g, 5.25, 0.45, 0.45, sxp, 4.75, zB + 8.2, M.silver);
    box(g, 5.3, 0.1, 0.5, sxp, 4.45, zB + 8.2, M.gold);
    /* display windows: glas