/* ---------- cities with no POP of yours yet ---------- */
function popsSection(){const F=UI.popF||{},q=popStdQuote(),cost=c=>popCost(c)+(q?q.cost:0),mo=c=>popMo(c)+(q?q.mo:0);
const all=CITIES.filter(C=>cityOn(C.id)&&!S.pops[C.id]);
let h=`
${tr('unbuilt_pops.cities_without_a_pop_n',{n:all.length})} `;
if(!all.length)return h+`
${tr('unbuilt_pops.you_have_a_pop_in_every')}
`;
h+=`${tr('unbuilt_pops.every_city_where_you_could_still')}
`;
const sk=UI.popSort||'eye',dir=UI.popDir||-1,val=C=>sk==='name'?C.name.toLowerCase():sk==='cost'?cost(C.id):eyeP(C.id);
h+=`${tr('unbuilt_pops.region')} ${tr('unbuilt_pops.all_regions')} ${Object.keys(REG).map(r=>`${esc(REG[r])} `).join('')}
`;
h+=`${[['eye',tr('common.eyeballs')],['cost',tr('common.cost')],['name',tr('common.name')]].map(([k,l])=>btn(l+(sk===k?(dir>0?' ▲':' ▼'):''),'popsSort',{k},sk===k?'pink sm':'ghost sm')).join('')}
`;
const rows=all.filter(C=>!F.reg||C.reg===F.reg).sort((a,b)=>{const A=val(a),B=val(b);return (AB?1:0)*dir||a.name.localeCompare(b.name);});
if(!rows.length)return h+` ${tr('unbuilt_pops.nothing_left_to_build_in_this')}
`;
h+=rows.slice(0,listN('pops')).map(C=>{const ix=ixName(C.id);return `${esc(C.name)} ${esc(REG[C.reg])}
${tr('city_panel.g_of_eyeballs',{g:fmtG(eyeP(C.id))})}${ix?` · ${tr('city_panel.ix_ix',{ix:esc(ix)})}`:''} · ${tr('unbuilt_pops.cost_then_mo',{cost:fmt$(cost(C.id)),mo:fmt$(mo(C.id))})}
${C.cn&&!cnOk()?`
${tr('unbuilt_pops.needs_a_license_first')}
`:''}
${btn(tr('common.open'),'popGo',{city:C.id},'ghost sm')}
`;}).join('');
return h+listMore('pops',rows.length,n=>trn('unbuilt_pops.n_more_city',n))+``;}