/* AUREN — App pages 2: Wallet, Explorer (mesh map), Governance, Settings */
const AP2 = window.AURENData;

/* Dotted world map mask — '#' = land. 60 cols × 26 rows, equirectangular. */
const WORLD_MAP = [
  "............................................................",
  ".....####.........................###....####..............",
  "...########.....................########.######...##.......",
  "..###########..............#.##############################",
  ".#############............################################.",
  "..############...........#################################.",
  "...##########...........##################################.",
  "....#########..........####..######################.#####..",
  ".....########.........###.....################.####...##...",
  ".....#######.........###.......#############.........##....",
  "......#####.........###........############................",
  ".......###.........####........###########.....###........",
  ".......##..........####.........#######.......#####........",
  "......###...........###.........#####........#######.......",
  ".....####...........###.........####..........#####...##...",
  ".....####...........###.........###............##....###...",
  ".....####...........###.........##.................#####...",
  "......###...........##..........#..................####....",
  ".......##...........##.............................##......",
  ".......##...........##.....................................",
  "........#...........#......................................",
  "........#..................................................",
  "...........................................................",
  "...............................................##..........",
  "...........................................................",
  "..........................................................."
];

/* ================= WALLET ================= */
function Wallet() {
  const w = AP2.wallet, t = AP2.tokenInfo;
  const [txs] = useState(AP2.transactions);
  const [tab, setTab] = useState('all');
  const shown = tab === 'all' ? txs : txs.filter(x => x.dir === tab);
  const fmtTime = (m) => m < 60 ? m + 'm ago' : Math.floor(m / 60) + 'h ago';
  return (
    <div>
      <PageHead title="Wallet" sub="Balances, settlement & reward history" />
      <div className="wallet-top" style={{ display: 'grid', gridTemplateColumns: '1.3fr 1fr', gap: 18, marginBottom: 20 }}>
        <Panel glow style={{ padding: 28, position: 'relative', overflow: 'hidden' }}>
          <div style={{ position: 'absolute', top: -40, right: -40, width: 200, height: 200, background: 'radial-gradient(circle, rgba(24,224,255,0.14), transparent 70%)' }} />
          <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: 26 }}>
            <div>
              <div className="font-mono" style={{ fontSize: 12, color: 'var(--text-3)', letterSpacing: '.08em', marginBottom: 10 }}>TOTAL BALANCE</div>
              <div className="font-display" style={{ fontSize: 40, fontWeight: 700, color: '#fff', lineHeight: 1 }}>{AP2.fmt.num(w.balance.toFixed(2))} <span style={{ fontSize: 18, color: 'var(--cyan)' }}>AUREN</span></div>
              <div className="font-mono" style={{ fontSize: 14, color: 'var(--text-2)', marginTop: 8 }}>≈ ${AP2.fmt.num((w.balance * t.price).toFixed(2))} USD</div>
            </div>
            <img src="assets/auren-logo.png" style={{ height: 44, width: 44, opacity: 0.9 }} alt="" />
          </div>
          <div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '10px 14px', background: 'var(--surface)', border: '1px solid var(--line)', borderRadius: 'var(--r-sm)', marginBottom: 20 }}>
            <Icon name="wallet" size={15} style={{ color: 'var(--text-3)' }} />
            <span className="font-mono" style={{ fontSize: 12.5, color: 'var(--text-2)', flex: 1, overflow: 'hidden', textOverflow: 'ellipsis' }}>{w.address}</span>
            <button style={{ background: 'none', border: 'none', color: 'var(--cyan)', cursor: 'pointer', fontSize: 11.5, fontFamily: 'var(--font-mono)', fontWeight: 600 }}>COPY</button>
          </div>
          <div style={{ display: 'flex', gap: 10 }}>
            <Button variant="primary" full icon="arrow">Send</Button>
            <Button variant="ghost" full icon="plus">Receive</Button>
            <Button variant="ghost" full icon="staking">Stake</Button>
          </div>
        </Panel>
        <div style={{ display: 'flex', flexDirection: 'column', gap: 14 }}>
          {[['Available', w.balance - w.stakedBalance, 'wallet', 'var(--cyan)'], ['Staked', w.stakedBalance, 'staking', 'var(--violet)'], ['Pending rewards', w.pendingRewards, 'bolt', 'var(--green)']].map(([k, v, ic, col]) => (
            <Panel key={k} style={{ padding: 18, display: 'flex', alignItems: 'center', gap: 16 }}>
              <div style={{ width: 44, height: 44, borderRadius: 11, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgba(255,255,255,0.04)', border: '1px solid var(--line)', color: col }}><Icon name={ic} size={20} /></div>
              <div style={{ flex: 1 }}>
                <div style={{ fontSize: 12.5, color: 'var(--text-3)', fontFamily: 'var(--font-mono)' }}>{k}</div>
                <div className="font-display" style={{ fontSize: 20, fontWeight: 700, color: '#fff' }}>{AP2.fmt.num(v.toFixed(2))}</div>
              </div>
              <span style={{ fontSize: 12, color: 'var(--text-3)', fontFamily: 'var(--font-mono)' }}>AUREN</span>
            </Panel>
          ))}
        </div>
      </div>
      <Panel style={{ padding: 4 }}>
        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '18px 20px 14px' }}>
          <h3 className="font-display" style={{ fontSize: 17, fontWeight: 600, color: '#fff' }}>Settlement history</h3>
          <div style={{ display: 'flex', gap: 6 }}>
            {[['all', 'All'], ['in', 'Received'], ['out', 'Sent']].map(([k, l]) => (
              <button key={k} onClick={() => setTab(k)} style={{ padding: '6px 14px', borderRadius: 100, fontSize: 12.5, fontWeight: 600, cursor: 'pointer', fontFamily: 'var(--font-body)', background: tab === k ? 'rgba(24,224,255,0.12)' : 'transparent', border: '1px solid ' + (tab === k ? 'var(--line-cyan)' : 'var(--line)'), color: tab === k ? 'var(--cyan)' : 'var(--text-2)' }}>{l}</button>
            ))}
          </div>
        </div>
        <div>
          {shown.map((x, i) => (
            <div key={x.id} style={{ display: 'flex', alignItems: 'center', gap: 16, padding: '14px 20px', borderTop: '1px solid var(--line)' }}>
              <div style={{ width: 38, height: 38, borderRadius: 10, display: 'flex', alignItems: 'center', justifyContent: 'center', background: x.dir === 'in' ? 'rgba(61,245,166,0.1)' : 'rgba(255,255,255,0.04)', border: '1px solid ' + (x.dir === 'in' ? 'rgba(61,245,166,0.3)' : 'var(--line)'), color: x.dir === 'in' ? 'var(--green)' : 'var(--text-2)', flexShrink: 0 }}>
                <Icon name={x.dir === 'in' ? 'plus' : 'arrow'} size={17} />
              </div>
              <div style={{ flex: 1, minWidth: 0 }}>
                <div style={{ fontSize: 14, fontWeight: 600, color: '#fff' }}>{x.type}</div>
                <div className="font-mono" style={{ fontSize: 11.5, color: 'var(--text-3)' }}>{x.id} · block {AP2.fmt.num(x.block)}</div>
              </div>
              <div style={{ textAlign: 'right' }}>
                <div className="font-mono" style={{ fontSize: 14.5, fontWeight: 600, color: x.dir === 'in' ? 'var(--green)' : '#fff' }}>{x.dir === 'in' ? '+' : '−'}{x.amount.toFixed(2)}</div>
                <div style={{ fontSize: 11.5, color: 'var(--text-3)', fontFamily: 'var(--font-mono)' }}>{fmtTime(x.time)}</div>
              </div>
              <Badge color={x.status === 'confirmed' ? 'green' : 'amber'} dot={x.status === 'pending'}>{x.status}</Badge>
            </div>
          ))}
        </div>
      </Panel>
    </div>
  );
}

/* ================= EXPLORER (mesh map) ================= */
function NetworkMap() {
  const canvasRef = useRef(null);
  const regions = AP2.regions;
  useEffect(() => {
    const cv = canvasRef.current; if (!cv) return;
    const ctx = cv.getContext('2d');
    let raf, W, H, dpr = Math.min(devicePixelRatio, 2);
    function resize() {
      W = cv.clientWidth; H = cv.clientHeight;
      cv.width = W * dpr; cv.height = H * dpr; ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
    }
    resize();
    const ro = new ResizeObserver(resize); ro.observe(cv);
    // build arcs between nearby regions
    const arcs = [];
    for (let i = 0; i < regions.length; i++)
      for (let j = i + 1; j < regions.length; j++)
        if (Math.random() > 0.55) arcs.push({ a: i, b: j, t: Math.random(), speed: 0.002 + Math.random() * 0.004 });
    let frame = 0;
    function pt(r) { return { x: r.x * W, y: r.y * H }; }
    function draw() {
      frame++;
      ctx.clearRect(0, 0, W, H);
      // dotted world map (land) + faint ocean grid
      const cols = WORLD_MAP[0].length, rows = WORLD_MAP.length;
      const cw = W / cols, ch = H / rows;
      for (let r = 0; r < rows; r++) {
        const line = WORLD_MAP[r];
        for (let c = 0; c < cols; c++) {
          const x = (c + 0.5) * cw, y = (r + 0.5) * ch;
          if (line[c] === '#') {
            ctx.fillStyle = 'rgba(120,180,210,0.22)';
            ctx.beginPath(); ctx.arc(x, y, 1.3, 0, 7); ctx.fill();
          } else {
            ctx.fillStyle = 'rgba(120,160,190,0.045)';
            ctx.beginPath(); ctx.arc(x, y, 0.7, 0, 7); ctx.fill();
          }
        }
      }
      // arcs
      arcs.forEach(arc => {
        const A = pt(regions[arc.a]), B = pt(regions[arc.b]);
        const mx = (A.x + B.x) / 2, my = (A.y + B.y) / 2 - Math.abs(A.x - B.x) * 0.18 - 30;
        ctx.beginPath(); ctx.moveTo(A.x, A.y); ctx.quadraticCurveTo(mx, my, B.x, B.y);
        ctx.strokeStyle = 'rgba(24,224,255,0.10)'; ctx.lineWidth = 1; ctx.stroke();
        // packet
        arc.t += arc.speed; if (arc.t > 1) arc.t -= 1;
        const u = arc.t, iu = 1 - u;
        const px = iu * iu * A.x + 2 * iu * u * mx + u * u * B.x;
        const py = iu * iu * A.y + 2 * iu * u * my + u * u * B.y;
        const grd = ctx.createRadialGradient(px, py, 0, px, py, 5);
        grd.addColorStop(0, 'rgba(143,244,255,1)'); grd.addColorStop(1, 'rgba(24,224,255,0)');
        ctx.fillStyle = grd; ctx.beginPath(); ctx.arc(px, py, 5, 0, 7); ctx.fill();
      });
      // region nodes
      regions.forEach(r => {
        const p = pt(r);
        const pulse = 1 + Math.sin(frame * 0.05 + r.x * 10) * 0.3;
        const rad = 4 + (r.nodes / 2700) * 6;
        const grd = ctx.createRadialGradient(p.x, p.y, 0, p.x, p.y, rad * 4 * pulse);
        grd.addColorStop(0, 'rgba(24,224,255,0.5)'); grd.addColorStop(1, 'rgba(24,224,255,0)');
        ctx.fillStyle = grd; ctx.beginPath(); ctx.arc(p.x, p.y, rad * 4 * pulse, 0, 7); ctx.fill();
        ctx.fillStyle = r.load > 80 ? '#FFC542' : '#8ff4ff'; ctx.beginPath(); ctx.arc(p.x, p.y, rad, 0, 7); ctx.fill();
        ctx.strokeStyle = 'rgba(143,244,255,0.6)'; ctx.lineWidth = 1; ctx.beginPath(); ctx.arc(p.x, p.y, rad + 3, 0, 7); ctx.stroke();
      });
      raf = requestAnimationFrame(draw);
    }
    draw();
    return () => { cancelAnimationFrame(raf); ro.disconnect(); };
  }, []);
  return <canvas ref={canvasRef} style={{ width: '100%', height: '100%', display: 'block' }} />;
}
function Explorer() {
  const s = AP2.networkStats, regions = AP2.regions;
  const [sel, setSel] = useState(null);
  return (
    <div>
      <PageHead title="Network Explorer" sub="The global compute mesh in real time"
        actions={<Badge color="green" dot>All regions nominal</Badge>} />
      <div className="dash-stats" style={{ display: 'grid', gridTemplateColumns: 'repeat(4,1fr)', gap: 16, marginBottom: 18 }}>
        <Stat label="Active nodes" value={s.activeNodes} icon="nodes" sub={{ text: '+182 today', color: 'var(--green)' }} />
        <Stat label="Regions" value={s.regions} icon="globe" />
        <Stat label="Settlement TPS" value={s.tps} icon="route" sub={{ text: 'live', color: 'var(--cyan)' }} />
        <Stat label="Total settled" value={s.totalSettled} prefix="" dec={0} icon="settle" sub={{ text: AP2.fmt.compact(s.totalSettled) + ' AUREN', color: 'var(--text-2)' }} />
      </div>
      <div className="explorer-grid" style={{ display: 'grid', gridTemplateColumns: '1.7fr 1fr', gap: 18 }}>
        <Panel style={{ padding: 0, overflow: 'hidden', position: 'relative', minHeight: 440 }}>
          <div style={{ position: 'absolute', top: 16, left: 18, zIndex: 2 }}>
            <div className="font-mono" style={{ fontSize: 11.5, color: 'var(--cyan)', letterSpacing: '.1em' }}>● LIVE MESH</div>
            <div style={{ fontSize: 12, color: 'var(--text-3)', marginTop: 3, fontFamily: 'var(--font-mono)' }}>{regions.length} regions · {AP2.fmt.compact(s.totalGpus)} GPUs</div>
          </div>
          <div style={{ position: 'absolute', inset: 0 }}><NetworkMap /></div>
        </Panel>
        <Panel style={{ padding: 4, maxHeight: 440, overflowY: 'auto' }}>
          <div style={{ padding: '16px 18px 10px' }}><h3 className="font-display" style={{ fontSize: 16, fontWeight: 600, color: '#fff' }}>Regions</h3></div>
          {regions.sort((a, b) => b.nodes - a.nodes).map(r => (
            <div key={r.id} onClick={() => setSel(r)} style={{ display: 'flex', alignItems: 'center', gap: 14, padding: '13px 18px', borderTop: '1px solid var(--line)', cursor: 'pointer', transition: 'background .2s' }}
              onMouseEnter={e => e.currentTarget.style.background = 'rgba(255,255,255,0.02)'} onMouseLeave={e => e.currentTarget.style.background = 'transparent'}>
              <span style={{ width: 9, height: 9, borderRadius: 9, background: r.load > 80 ? 'var(--amber)' : 'var(--green)', boxShadow: '0 0 8px currentColor', flexShrink: 0 }} />
              <div style={{ flex: 1 }}>
                <div style={{ fontSize: 14, fontWeight: 600, color: '#fff' }}>{r.name}</div>
                <div className="font-mono" style={{ fontSize: 11.5, color: 'var(--text-3)' }}>{AP2.fmt.num(r.nodes)} nodes</div>
              </div>
              <div style={{ width: 60 }}>
                <Progress value={r.load} h={5} color={r.load > 80 ? 'var(--amber)' : 'var(--cyan)'} />
                <div className="font-mono" style={{ fontSize: 10.5, color: 'var(--text-3)', marginTop: 4, textAlign: 'right' }}>{r.load}% load</div>
              </div>
            </div>
          ))}
        </Panel>
      </div>
    </div>
  );
}

/* ================= GOVERNANCE ================= */
function Governance() {
  const [proposals, setProposals] = useState(AP2.proposals);
  const [voted, setVoted] = useState({});
  function vote(id, dir) {
    if (voted[id]) return;
    setVoted(v => ({ ...v, [id]: dir }));
    setProposals(ps => ps.map(p => p.id === id ? { ...p, forV: p.forV + (dir === 'for' ? 250000 : 0), against: p.against + (dir === 'against' ? 250000 : 0) } : p));
  }
  const active = proposals.filter(p => p.status === 'active');
  return (
    <div>
      <PageHead title="Governance" sub="Vote on mesh parameters and treasury"
        actions={<Button variant="primary" size="sm" icon="plus">New proposal</Button>} />
      <div className="dash-stats" style={{ display: 'grid', gridTemplateColumns: 'repeat(4,1fr)', gap: 16, marginBottom: 22 }}>
        <Stat label="Active proposals" value={active.length} icon="governance" sub={{ text: 'open for voting', color: 'var(--cyan)' }} />
        <Stat label="Your voting power" value={8500} suffix=" votes" icon="shield" sub={{ text: 'from staked AUREN', color: 'var(--text-2)' }} />
        <Stat label="Total proposals" value={24} icon="workloads" />
        <Stat label="Participation" value={67.3} suffix="%" dec={1} icon="trend" accent="var(--green)" />
      </div>
      <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
        {proposals.map(p => {
          const total = p.forV + p.against;
          const forPct = total ? (p.forV / total) * 100 : 0;
          const quorumPct = Math.min(100, (total / p.quorum) * 100);
          const v = voted[p.id];
          return (
            <Panel key={p.id} style={{ padding: 24 }}>
              <div style={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: 16, marginBottom: 14, flexWrap: 'wrap' }}>
                <div style={{ flex: 1, minWidth: 240 }}>
                  <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 8 }}>
                    <span className="font-mono" style={{ fontSize: 12, color: 'var(--text-3)' }}>{p.id}</span>
                    <Badge color={p.status === 'active' ? 'cyan' : p.status === 'passed' ? 'green' : 'red'} dot={p.status === 'active'}>{p.status}</Badge>
                    {p.status === 'active' && <span className="font-mono" style={{ fontSize: 12, color: 'var(--amber)' }}>ends {p.ends}</span>}
                  </div>
                  <h3 className="font-display" style={{ fontSize: 18, fontWeight: 600, color: '#fff', marginBottom: 6 }}>{p.title}</h3>
                  <p style={{ fontSize: 13.5, color: 'var(--text-2)', lineHeight: 1.55, maxWidth: 620, textWrap: 'pretty' }}>{p.desc}</p>
                </div>
              </div>
              <div style={{ marginBottom: 16 }}>
                <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 7, fontSize: 12.5 }}>
                  <span style={{ color: 'var(--green)', fontFamily: 'var(--font-mono)', fontWeight: 600 }}>FOR {forPct.toFixed(1)}% · {AP2.fmt.compact(p.forV)}</span>
                  <span style={{ color: 'var(--red)', fontFamily: 'var(--font-mono)', fontWeight: 600 }}>AGAINST {(100 - forPct).toFixed(1)}% · {AP2.fmt.compact(p.against)}</span>
                </div>
                <div style={{ height: 8, borderRadius: 100, overflow: 'hidden', display: 'flex', background: 'rgba(255,92,122,0.25)' }}>
                  <div style={{ width: forPct + '%', background: 'var(--green)', boxShadow: '0 0 10px var(--green)', transition: 'width .6s var(--ease)' }} />
                </div>
                <div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 8, fontSize: 11.5, color: 'var(--text-3)', fontFamily: 'var(--font-mono)' }}>
                  <span>Quorum {quorumPct.toFixed(0)}% of {AP2.fmt.compact(p.quorum)}</span>
                </div>
              </div>
              {p.status === 'active' && (
                <div style={{ display: 'flex', gap: 10 }}>
                  <Button variant={v === 'for' ? 'primary' : 'ghost'} full icon="check" onClick={() => vote(p.id, 'for')}>{v === 'for' ? 'Voted For' : 'Vote For'}</Button>
                  <Button variant={v === 'against' ? 'danger' : 'ghost'} full icon="x" onClick={() => vote(p.id, 'against')}>{v === 'against' ? 'Voted Against' : 'Vote Against'}</Button>
                </div>
              )}
            </Panel>
          );
        })}
      </div>
    </div>
  );
}

/* ================= SETTINGS ================= */
function Settings({ user, onLogout }) {
  const [form, setForm] = useState({ name: user?.name || 'demo', email: user?.email || 'demo@auren.mesh', region: 'Auto (nearest)', payout: 'AUREN' });
  const [notif, setNotif] = useState({ workloads: true, rewards: true, governance: false, security: true });
  const [saved, setSaved] = useState(false);
  function save() { setSaved(true); setTimeout(() => setSaved(false), 1800); }
  return (
    <div>
      <PageHead title="Settings" sub="Account, payout & notification preferences" />
      <div className="settings-grid" style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 18 }}>
        <Panel style={{ padding: 26 }}>
          <h3 className="font-display" style={{ fontSize: 16, fontWeight: 600, color: '#fff', marginBottom: 20 }}>Profile</h3>
          <div style={{ display: 'flex', alignItems: 'center', gap: 16, marginBottom: 24 }}>
            <div style={{ width: 64, height: 64, borderRadius: '50%', background: 'var(--grad-cyan)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#021018', fontWeight: 700, fontFamily: 'var(--font-display)', fontSize: 26 }}>{form.name[0].toUpperCase()}</div>
            <Button variant="ghost" size="sm">Change avatar</Button>
          </div>
          {[['Display name', 'name'], ['Email', 'email']].map(([l, k]) => (
            <div key={k} style={{ marginBottom: 16 }}>
              <label style={{ display: 'block', fontSize: 12.5, color: 'var(--text-2)', marginBottom: 8 }}>{l}</label>
              <input value={form[k]} onChange={e => setForm(f => ({ ...f, [k]: e.target.value }))} style={inputStyle} />
            </div>
          ))}
          <div style={{ marginBottom: 16 }}>
            <label style={{ display: 'block', fontSize: 12.5, color: 'var(--text-2)', marginBottom: 8 }}>Default payout asset</label>
            <select value={form.payout} onChange={e => setForm(f => ({ ...f, payout: e.target.value }))} style={inputStyle}>
              <option>AUREN</option><option>USDC</option><option>ETH</option>
            </select>
          </div>
          <Button variant="primary" icon={saved ? 'check' : undefined} onClick={save}>{saved ? 'Saved' : 'Save changes'}</Button>
        </Panel>
        <div style={{ display: 'flex', flexDirection: 'column', gap: 18 }}>
          <Panel style={{ padding: 26 }}>
            <h3 className="font-display" style={{ fontSize: 16, fontWeight: 600, color: '#fff', marginBottom: 18 }}>Notifications</h3>
            {[['workloads', 'Workload status'], ['rewards', 'Reward payouts'], ['governance', 'Governance proposals'], ['security', 'Security alerts']].map(([k, l]) => (
              <div key={k} style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '12px 0', borderBottom: '1px solid var(--line)' }}>
                <span style={{ fontSize: 14, color: 'var(--text-1)' }}>{l}</span>
                <button onClick={() => setNotif(n => ({ ...n, [k]: !n[k] }))} style={{ width: 44, height: 24, borderRadius: 100, border: 'none', cursor: 'pointer', background: notif[k] ? 'var(--grad-cyan)' : 'var(--surface-3)', position: 'relative', transition: 'background .25s' }}>
                  <span style={{ position: 'absolute', top: 3, left: notif[k] ? 23 : 3, width: 18, height: 18, borderRadius: '50%', background: '#fff', transition: 'left .25s var(--ease)' }} />
                </button>
              </div>
            ))}
          </Panel>
          <Panel style={{ padding: 26 }}>
            <h3 className="font-display" style={{ fontSize: 16, fontWeight: 600, color: '#fff', marginBottom: 8 }}>Security</h3>
            <p style={{ fontSize: 13, color: 'var(--text-2)', marginBottom: 16 }}>Two-factor authentication is recommended for payout accounts.</p>
            <div style={{ display: 'flex', gap: 10 }}>
              <Button variant="ghost" icon="shield">Enable 2FA</Button>
              <Button variant="danger" icon="logout" onClick={onLogout}>Sign out</Button>
            </div>
          </Panel>
        </div>
      </div>
    </div>
  );
}
const inputStyle = { width: '100%', padding: '12px 14px', borderRadius: 'var(--r-sm)', background: 'var(--surface)', border: '1px solid var(--line-2)', color: '#fff', fontSize: 14, fontFamily: 'var(--font-body)', outline: 'none' };

Object.assign(window, { Wallet, NetworkMap, Explorer, Governance, Settings });
