<!-- SOLIDABILITY-WORLD · part 41 -->
 if (SWGuide.isGuiding()) {
        SWGuide.stop();
      } else {
        SWGuide.startTour();
      }
    });

    // Shared Language Glossary
    document.getElementById('hc-glossary').addEventListener('click', function() {
      if (typeof SWGuide === 'undefined') return;
      SWGuide.showGlossary();
    });

    // Heat view: cycles CHANGE → RISK → OFF (RUNTIME marked UNKNOWN, no telemetry)
    document.getElementById('hc-heat').addEventListener('click', function() {
      if (typeof SWWorld !== 'undefined' && SWWorld.cycleHeatMode) {
        const mode = SWWorld.cycleHeatMode();
        const label = SWWorld.heatLabel();
        this.style.borderColor = mode ? '#ff2222' : '';
        this.style.background = mode ? 'rgba(255,34,34,0.2)' : '';
        if (mode === 'change') {
          narrate(`<b>CHANGE HEAT</b> — red = recently modified. Black = dormant. ` +
            `<span style="color:#888">Source: filesystem mtime. Not runtime activity.</span>`);
        } else if (mode === 'risk') {
          narrate(`<b>RISK HEAT</b> — red = complex + untested. Black = low risk. ` +
            `<span style="color:#888">Source: static analysis. Inferred, not measured.</span>`);
        } else {
          narrate(`Heat view OFF. District colors restored. ` +
            `<span style="color:#888">Runtime heat: UNKNOWN (no telemetry).</span>`);
        }
        setTimeout(clearNarration, 4000);
      }
    });

    // Focus
    document.getElementById('hc-focus').addEventListener('click', () => {
      const room = focusNearest();
      if (!room) {
        // No room in view — try proximity
        const layout = SWWorld.getLayout();
        const player = SWEngine.getPlayer();
        let nearest = null, nd = Infinity;
        layout.rooms.forEach(r => {
          const d = Math.hypot(r.position.x - player.position.x, r.position.z - player.position.z);
          if (d < nd) { nd = d; nearest = r; }
        });
        if (nearest) { focusedRoom = nearest; SWGlass.show(nearest); }
      }
    });

    // Scan
    document.getElementById('hc-scan').addEventListener('click', scan);

    // Navigate to focused room
    document.getElementById('hc-go').addEventListener('click', () => {
      if (focusedRoom) {
        if (!navigateTo(focusedRoom)) {
          console.log('Navigation failed — no path found');
        }
      } else {
        // No focus — prompt to focus first
        document.getElementById('hc-input').placeholder = 'Focus a room first, then tap 🧭';
        document.getElementById('hc-input').focus();
      }
    });

    // Return
    document.getElementById('hc-return').addEventListener('click', () => {
      if (!goReturn()) {
        document.getElementById('hc-input').placeholder = 'No previous location';
      }
    });

    // Natural language (stub — parses simple patterns)
    document.getElementById('hc-input').addEventListener('keydown', e => {
      if (e.key !== 'Enter') return;
      const cmd = e.target.value.toLowerCase();
      e.target.value = '';
      handleCommand(cmd);
    });

    setupLookControls();
  }

  // Natural language command parser (simple pattern matching)
  function handleCommand(cmd) {
    const layout = SWWorld.getLayout();
    if (!layout) return;
    const c = cmd.trim().toLowerCase();

    // "stop" / "stop driving" — immediate halt
    if (/^(stop|stop driving|halt|cancel)$/.test(c)) {
      stopAI();
      return;
    }

    // "show me my website" — human guide tour
    if (/^(show me my website|what is my website|explain my site)$/.test(c)) {
      if (typeof SWGuide !== 'undefined') SWGuide.startTour();
      return;
    }

    // "what does this do" — explain focused/nearest building in plain language
    if (/^(what does this do|explain this|what is this)\??$/.test(c)) {
      const room = focusedRoom || findNearestRoom();
      if (room && typeof SWGuide !== 'undefined') {
        narrate(`<b>${room.label}</b><br><br>${SWGuide.explain(room)}`);
      } else {
        narrate(`Tap a building first, then ask me what it does.`);
      }
      return;
    }

    // "tour" / "guided tour" / "show me around"
    if (/^(tour|guided tour|show me around)$/.test(c)) {
      startTour();
      return;
    }

    // "find problem" / "find a problem" / "find the X problem"
    const problemMatch = c.match(/find (?:the |a )?(.+?)?\s*problem/);
    if (problemMatch) {
      findProblem();
      return;
    }

    // "take me upstairs" / "go upstairs"
    if (/^(take me |go )?upstairs$/.test(c)) {
      goUpstairs();
      return;
    }

    // "drive me to X" / "take me to X" / "go to X" / "show me X" / "navigate to X"
    const destMatch = c.match(/(?:drive me to|take me to|go to|show me|find|navigate to)\s+(.+)/);
    if (destMatch) {
      const query = destMatch[1].trim();
      // Map prototype room names to full-map file searches
      const prototypeMap = {
        'forum & boards': 'forum', 'forum': 'forum',
      