<!-- SOLIDABILITY-WORLD · part 32 -->
    <span class="code-close" onclick="document.getElementById('code-inspector').classList.remove('visible')">✕</span>
      </div>
      <div class="code-meta">
        <code>${escapeHtml(filePath)}</code>
      </div>
      <div class="code-body"><p class="loading">Loading source...</p></div>
    `;
    codePanel.classList.add('visible');

    try {
      const resp = await fetch(`/api/solidability-world/source?file=${encodeURIComponent(filePath)}`, {
        credentials: 'same-origin'
      });
      if (!resp.ok) {
        const err = await resp.json().catch(() => ({}));
        codePanel.querySelector('.code-body').innerHTML =
          `<p class="note">Source unavailable: ${escapeHtml(err.error || resp.statusText)}</p>`;
        return;
      }
      const data = await resp.json();

      // Build line-numbered code view
      const codeHtml = data.content.map((line, idx) =>
        `<div class="code-line"><span class="line-num">${idx + 1}</span>` +
        `<span class="line-code">${escapeHtml(line) || ' '}</span></div>`
      ).join('');

      codePanel.querySelector('.code-body').innerHTML = `
        <div class="code-info">
          ${data.lines} lines · ${(data.size / 1024).toFixed(1)}KB ·
          modified ${new Date(data.modified).toLocaleDateString()} ·
          <code>${data.hash}</code>
        </div>
        <div class="code-lines">${codeHtml}</div>
      `;
      codePanel.querySelector('.code-meta').innerHTML =
        `<code>${escapeHtml(filePath)}</code> · ${data.lines} lines`;

      // Highlight related functions if room has function data
      if (room.functions && room.functions.length) {
        // Scroll to first function
        const firstFunc = room.functions[0];
        const lineEl = codePanel.querySelectorAll('.code-line')[firstFunc.line - 1];
        if (lineEl) {
          lineEl.classList.add('highlight');
          lineEl.scrollIntoView({ block: 'center' });
        }
      }
    } catch (e) {
      codePanel.querySelector('.code-body').innerHTML =
        `<p class="note">Failed to load source: ${escapeHtml(e.message)}</p>`;
    }
  }

  function closeCodePanel() {
    const p = document.getElementById('code-inspector');
    if (p) p.classList.remove('visible');
  }

  // Public glass: human explanation only. No source, no diagnostics, no jargon.
  function showPublic(room) {
    const info = room.publicInfo;
    panel.innerHTML = `
      <div class="glass-header">
        <h2>${escapeHtml(room.label)}</h2>
        <button class="glass-close" onclick="SWGlass.hide()">✕</button>
      </div>
      <div class="glass-body">
        <div class="glass-section">
          <p style="font-size:16px;color:#e0e0e0;line-height:1.6;">${escapeHtml(info.what)}</p>
        </div>
        <div class="glass-section">
          <h4 style="color:#00ffcc;">What it does</h4>
          <p style="font-size:14px;color:#bbb;line-height:1.6;">${escapeHtml(info.does)}</p>
        </div>
        <div class="glass-section">
          <h4 style="color:#00ffcc;">Why it matters</h4>
          <p style="font-size:14px;color:#bbb;line-height:1.6;"><i>${escapeHtml(info.matters)}</i></p>
        </div>
        ${info.connections > 0 ? `
        <div class="glass-section">
          <p style="font-size:12px;color:#888;">🔗 Connected to ${info.connections} other parts of the site</p>
        </div>` : ''}
      </div>
    `;
    panel.classList.add('visible');
  }

  return { show, hide, search, goBack, loadSource, openCodePanel, closeCodePanel, testSyntax };
})();


===== FILE: public/solidability-world/js/sw-guide.js =====
// Solidability World — Human Guide
// Layer 1: Help humans understand their website in plain language.
// No jargon. No complexity scores. No evidence states.
// Just: what is this, what does it do, why does it matter to you.

const SWGuide = (() => {
  let guiding = false;
  let tourStops = [];
  let currentStop = 0;

  // Shared language: human-meaningful names for key components
  // The world speaks in these terms, not filenames
  function humanName(filePath, label) {
    const f = (filePath || '').toLowerCase();

    if (f === 'server.js') return { icon: '❤️', name: 'The Heart' };
    if (/auth|login|session/.test(f)) return { icon: '🔑', name: 'The Gatekeeper' };
    if (/thread|forum/.test(f)) return { icon: '💬', name: 'The Forum' };
    if (/chat/.test(f) && !/chatlog/.test(f)) return { icon: '💭', name: 'Live Chat' };
    if (/sable|ai\.js/.test(f)) return { icon: '🧠', name: 'The Mind' };
    if (/views/.test(f)) return { icon: '🎨', name: 'What You See' };
    if (/(^|\/)db/.test(f)) return { icon: '💾', name: 'The Memory' };
    if (/upload|media|image/.test(f)) return { icon: '🖼️', name: 'The Gallery' };
    if (/revenue|econom/.test(f)) return { icon: '💰', name: 'The Treasury' };
    if (/admin/.test(f)) return { icon: '⚙️', name: 'The Controls' };
    if (/email|mail/.test(f)) return { icon: '📧', name: 'The Messenger' };

  