<!-- SOLID CITY · part 87 -->
rEach(function (y, k) { [i, o].forEach(function (x) { dot(x, y, 0.8 + k * 0.04); }); });
  return s;
}
function frameShot() {   // full-screen scaffold corner brackets building in around the capture area
  var f = $('cap-frame'); if (f) f.remove(); f = document.createElement('div'); f.id = 'cap-frame';
  var s = document.createElementNS(NS, 'svg'); s.setAttribute('class', 'cap-scaf'); s.setAttribute('viewBox', '0 0 100 100'); s.setAttribute('preserveAspectRatio', 'none');
  var e = 3, L = 14, segs = [[e, e + L, e, e], [e, e, e + L, e], [100 - e - L, e, 100 - e, e], [100 - e, e, 100 - e, e + L], [100 - e, 100 - e - L, 100 - e, 100 - e], [100 - e, 100 - e, 100 - e - L, 100 - e], [e + L, 100 - e, e, 100 - e], [e, 100 - e, e, 100 - e - L]];
  segs.forEach(function (q, k) { var l = document.createElementNS(NS, 'line'); l.setAttribute('x1', q[0]); l.setAttribute('y1', q[1]); l.setAttribute('x2', q[2]); l.setAttribute('y2', q[3]); l.setAttribute('class', k % 2 ? 'g' : 'r'); l.setAttribute('pathLength', '1'); l.style.animationDuration = '.28s'; l.style.animationDelay = (k * 0.02) + 's'; s.appendChild(l); });
  [[e, 50, e + 2.5, 50], [100 - e, 50, 100 - e - 2.5, 50], [50, e, 50, e + 2.5], [50, 100 - e, 50, 100 - e - 2.5]].forEach(function (q) { var l = document.createElementNS(NS, 'line'); l.setAttribute('x1', q[0]); l.setAttribute('y1', q[1]); l.setAttribute('x2', q[2]); l.setAttribute('y2', q[3]); l.setAttribute('class', 'g'); l.setAttribute('pathLength', '1'); l.style.animationDuration = '.2s'; s.appendChild(l); });
  f.appendChild(s); ($('sc') || document.body).appendChild(f);
  setTimeout(function () { f.style.transition = 'opacity .35s'; f.style.opacity = '0'; setTimeout(function () { f.remove(); }, 400); }, 650);
}
function flash() { var f = $('cap-flash'); if (!f) { f = document.createElement('div'); f.id = 'cap-flash'; ($('sc') || document.body).appendChild(f); } f.classList.remove('go'); void f.offsetWidth; f.classList.add('go'); }
var toastEl;
function toast(msg, ms) { if (!toastEl) { toastEl = document.createElement('div'); toastEl.id = 'cap-toast'; toastEl.setAttribute('role', 'status'); toastEl.setAttribute('aria-live', 'polite'); ($('sc-hud') || document.body).appendChild(toastEl); }
  toastEl.textContent = msg; toastEl.classList.add('show'); clearTimeout(toastEl._h); toastEl._h = setTimeout(function () { toastEl.classList.remove('show'); }, ms || 3200); }

/* ---------- dock ---------- */
var dock = document.createElement('div'); dock.id = 'sc-dock';
var btn = document.createElement('button'); btn.type = 'button'; btn.id = 'cap-btn'; btn.title = 'Screen capture'; btn.setAttribute('aria-label', 'Screen capture'); btn.setAttribute('aria-expanded', 'false'); btn.setAttribute('aria-controls', 'cap-panel'); btn.textContent = '\uD83D\uDCF7';
btn.addEventListener('pointerdown', function (e) { e.stopPropagation(); });
btn.addEventListener('click', function (e) { e.stopPropagation(); if (P && !P.hidden) close(); else open(); });
dock.appendChild(btn); ($('sc-hud') || document.body).appendChild(dock);
var aiv = document.createElement('a'); aiv.id = 'ai-view-btn'; aiv.href = '/city/see'; aiv.target = '_blank'; aiv.rel = 'noopener'; aiv.title = 'AI VIEW: Solid City as live pictures + text (no JavaScript needed)'; aiv.setAttribute('aria-label', 'AI VIEW: open the no-JavaScript viewer of Solid City in a new tab');
aiv.innerHTML = '<span class="ub-i" aria-hidden="true">\uD83E\uDD16</span><span class="ub-t"> AI VIEW</span>';
aiv.addEventListener('pointerdown', function (e) { e.stopPropagation(); }); aiv.addEventListener('click', function (e) { e.stopPropagation(); });
function adoptUni() { var u = $('uni-btn'); if (!u || u.parentNode === dock) return !!u;
  if (!u.querySelector('.ub-t')) { u.textContent = ''; var i = document.createElement('span'); i.className = 'ub-i'; i.setAttribute('aria-hidden', 'true'); i.textContent = '\uD83C\uDF93'; var t = document.createElement('span'); t.className = 'ub-t'; t.textContent = ' UNIVERSITY'; u.appendChild(i); u.appendChild(t); u.setAttribute('aria-label', 'University'); u.title = 'Solid City University'; }
  dock.appendChild(u); dock.appendChild(aiv); return true; }
if (!adoptUni()) { var tries = 0, iv = setInterval(function () { if (adoptUni() || ++tries > 40) { clearInterval(iv); if (!aiv.parentNode) dock.appendChild(aiv); } }, 250); }

/* ---------- panel ---------- */
var P = null, lastURL = null, last = null;
function el(tag, cls, txt) { var e = document.createElement(tag); if (cls) e.className = cls; if (txt != null) e.textContent = txt; return e; }
function build() {
  if (P) return; P = el('section'); P.id = 'cap-panel'; P.hidden = true; P.setAttribute('role', 'dialog'); P.setAttribute('aria-label', 'Screen capture');
  ['pointerdown', 'touchstart', 'wheel'].forEach(function (ev) { P.addEventListener(ev, function (e) { e.stopPropagation(); }, { passive: true }); });
  P.addEventListener('keydown', function (e) { e.stopPropagation(); if 