-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
3498 lines (3278 loc) · 294 KB
/
Copy pathindex.html
File metadata and controls
3498 lines (3278 loc) · 294 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- The script-src hash allows exactly one inline script: the live-reload
snippet VS Code Live Server injects during local dev. Production pages
have no inline scripts. -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'sha256-vvt4KWwuNr51XfE5m+hzeNEGhiOfZzG97ccfqGsPwvE='; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; font-src 'self'; img-src 'self' data: blob: https:; media-src 'self' blob:; frame-src https://www.youtube-nocookie.com; connect-src 'self' https: wss:; base-uri 'self'; form-action 'self'">
<meta name="referrer" content="strict-origin-when-cross-origin">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>Pombo - Own Your Communications</title>
<link rel="canonical" href="https://app.pombo.cc/">
<meta name="description" content="Pombo is a peer-to-peer (p2p) messaging and social media app, built on open infrastructure instead of a company's servers. Your people. Your rules. Your money.">
<!-- Favicons -->
<link rel="icon" type="image/svg+xml" href="/favicon/favicon.svg">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png">
<link rel="shortcut icon" href="/favicon/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
<link rel="manifest" href="/favicon/site.webmanifest">
<!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:title" content="Pombo — Own Your Communications">
<meta property="og:description" content="Your people. Your rules. Your money. Communities, direct messages and paid channels that belong to you.">
<meta property="og:image" content="https://app.pombo.cc/favicon/og-banner.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:type" content="image/png">
<meta property="og:url" content="https://app.pombo.cc">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Pombo — Own Your Communications">
<meta name="twitter:description" content="Your people. Your rules. Your money. Communities, direct messages and paid channels that belong to you.">
<meta name="twitter:image" content="https://app.pombo.cc/favicon/og-banner.png">
<!-- Framing defense for hosts without header support (GitHub Pages).
Crawler-facing metadata is declared above it on purpose: the guard
calls window.stop(), which aborts parsing at this point.
See js/frame-guard.js -->
<script src="./js/frame-guard.js"></script>
<meta name="theme-color" content="#000000">
<!-- Android: additional theme colors for dark mode detection -->
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#000000">
<meta name="color-scheme" content="dark">
<!-- iOS PWA -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Pombo">
<meta name="apple-mobile-web-app-status-bar" content="black-translucent">
<!-- PWA Capabilities & Features -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="msapplication-starturl" content="/">
<meta name="msapplication-TileColor" content="#FF6B35">
<meta name="msapplication-config" content="/favicon/browserconfig.xml">
<!-- Performance & Offline Support -->
<link rel="prefetch" href="./js/app.bundle.js">
<link rel="prefetch" href="./js/vendor.bundle.js?v=20260806i">
<!-- Inter: self-hosted, @font-face lives in css/components.css -->
<link rel="preload" href="./fonts/inter-latin.woff2" as="font" type="font/woff2" crossorigin>
<!-- Tailwind CSS (built from src/styles/input.css) -->
<link href="./css/output.css" rel="stylesheet">
<!-- Component styles (extracted for maintainability) -->
<link href="./css/components.css" rel="stylesheet">
<!-- Vendor Bundle: Streamr Client + Ethers.js + QRCode -->
<script src="./js/vendor.bundle.js?v=20260806i"></script>
</head>
<body class="h-screen overflow-hidden">
<!-- Global header spans full width -->
<!-- z-40: above the mobile sidebar/chat layers (z-30/35) so the bell dropdown
paints over them, but below the settings/contacts modals (z-50), which
must cover the header on mobile. -->
<header class="bg-[#09090b] border-b border-white/[0.01] h-14 flex items-center justify-between px-5 flex-shrink-0 relative z-40">
<!-- Left side: Logo and brand -->
<div class="flex items-center gap-3">
<!-- Logo -->
<span class="header-logo-wrap">
<img src="favicon/favicon.svg" alt="Pombo" class="w-12 h-12 header-logo">
<span class="network-dot" role="status" aria-label="Connecting to the network" title="Connecting…"></span>
</span>
<!-- Pombo name -->
<div class="flex flex-col">
<span class="text-[17px] font-extrabold text-white tracking-tight leading-tight">Pombo</span>
</div>
</div>
<!-- Right side: Wallet controls -->
<div class="flex items-center gap-3">
<!-- Guest label (shown alongside Connect button when in guest mode) -->
<div id="wallet-info" class="text-sm text-white/40 cursor-pointer hover:text-white/80 transition font-mono hidden" title="Click to copy address">Not Connected</div>
<!-- Connect button (shown when not connected or guest) -->
<button id="connect-wallet" class="bg-[#F6851B] hover:bg-[#e5780f] text-white h-9 px-3.5 rounded-xl text-sm font-medium transition-all duration-200 flex items-center gap-1.5">
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"/>
</svg>
Create Account
</button>
<!-- Create Channel button (shown in explore view for authenticated users) -->
<button id="header-create-channel-btn" class="hidden px-4 py-1.5 bg-[#F6851B]/15 hover:bg-[#F6851B]/25 text-white border border-[#F6851B]/30 text-sm font-medium rounded-xl transition-all duration-200 items-center gap-1.5 hover:shadow-lg hover:shadow-[#F6851B]/10" title="Create Channel">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.5v15m7.5-7.5h-15"/>
</svg>
</button>
<div id="global-sync-indicator" class="global-sync-indicator hidden" aria-live="polite" aria-hidden="true">
<span class="global-sync-spinner" aria-hidden="true"></span>
<span id="global-sync-text" class="global-sync-text">Syncing your data</span>
</div>
<!-- Wallet: the token balances of this account. Sits beside the
bell and follows the same visibility rules. -->
<div id="wallet-btn-wrapper" class="hidden relative">
<button id="wallet-btn" class="w-9 h-9 bg-white/[0.05] hover:bg-white/[0.1] border border-white/[0.08] rounded-xl flex items-center justify-center transition" title="Wallet">
<svg class="w-[18px] h-[18px] text-white/70" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M21 12a2.25 2.25 0 00-2.25-2.25H15a3 3 0 11-6 0H5.25A2.25 2.25 0 003 12m18 0v6a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 9m18 0V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v3"/>
</svg>
</button>
</div>
<!-- Notification bell: channel invites + active transfers.
Desktop: beside the account button. Mobile: the header slot
Create Channel uses in Explore, but shown in the Chats view
instead (components.css owns the visibility rules). -->
<div id="notif-bell-wrapper" class="hidden relative">
<button id="notif-bell-btn" class="relative w-9 h-9 bg-white/[0.05] hover:bg-white/[0.1] border border-white/[0.08] rounded-xl flex items-center justify-center transition" title="Notifications">
<svg class="w-[18px] h-[18px] text-white/70" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"/>
</svg>
<span id="notif-bell-badge" class="hidden absolute -top-1 -right-1 min-w-[16px] h-4 px-1 bg-[#F6851B] rounded-full text-[9px] font-bold text-white flex items-center justify-center">0</span>
</button>
<div id="notif-bell-dropdown" class="hidden absolute top-full right-0 mt-1.5 w-[320px] bg-[#16161b] border border-white/[0.1] rounded-xl py-1 shadow-2xl z-50">
<div class="px-3.5 py-2 flex items-center justify-between">
<span class="text-[10px] font-semibold tracking-widest text-white/35">CHANNEL INVITES</span>
<div class="flex items-center gap-1.5 text-[10px] font-medium">
<button id="notif-invites-mode-pending" class="text-white/70 transition">Pending</button>
<span class="text-white/20">·</span>
<button id="notif-invites-mode-all" class="text-white/30 hover:text-white/50 transition">All</button>
</div>
</div>
<div id="notif-invites-list"></div>
<div class="mx-3 my-1 border-t border-white/[0.08]"></div>
<div class="px-3.5 py-2 flex items-center justify-between">
<span class="text-[10px] font-semibold tracking-widest text-white/35">TRANSFERS</span>
<button id="notif-transfers-inactive" class="text-[10px] font-medium text-white/30 hover:text-white/50 transition">Show inactive</button>
</div>
<div id="notif-transfers-list" class="pb-1"></div>
</div>
</div>
<!-- Desktop: Unified account dropdown (hidden on mobile) -->
<div id="desktop-account-wrapper" class="hidden md:relative">
<button id="desktop-account-btn" class="bg-white/[0.05] hover:bg-white/[0.1] border border-white/[0.08] text-white/70 hover:text-white px-3 py-0 rounded-xl text-sm font-medium transition-all duration-200 flex items-center gap-2">
<div id="desktop-account-avatar" class="rounded-full overflow-hidden flex-shrink-0" style="width:38px;height:38px"></div>
<span id="desktop-account-name" class="max-w-[140px] truncate font-mono text-[14px]">Not Connected</span>
<svg class="w-3 h-3 text-white/30 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
</svg>
</button>
<!-- Dropdown menu -->
<div id="desktop-account-dropdown" class="hidden absolute top-full right-0 mt-1.5 min-w-[200px] bg-[#16161b] border border-white/[0.1] rounded-xl p-1.5 shadow-2xl z-50" style="transform-origin: top right;">
<div id="desktop-dropdown-address" class="px-3 py-2 text-[11px] text-white/40 font-mono border-b border-white/[0.06] mb-1"></div>
<button id="switch-wallet" class="hidden w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-[13px] text-white/60 hover:bg-white/[0.06] transition text-left">
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"/>
</svg>
Switch Account
</button>
<button id="desktop-join-id-btn" class="w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-[13px] text-white/60 hover:bg-white/[0.06] transition text-left">
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5l-3.9 19.5m-2.1-19.5l-3.9 19.5"/>
</svg>
Direct Join - #ID
</button>
<button id="sync-devices-btn" class="w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-[13px] text-white/60 hover:bg-white/[0.06] transition text-left">
<svg class="w-4 h-4 flex-shrink-0 sync-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"/>
</svg>
<span class="sync-btn-text">Sync Devices</span>
</button>
<button id="disconnect-wallet" class="w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-[13px] text-red-400 hover:bg-white/[0.06] transition text-left">
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"/>
</svg>
Disconnect
</button>
</div>
</div>
</div>
</header>
<!-- App Container - Full Height -->
<div class="flex app-container">
<!-- Sidebar - Channel List (Full Height) -->
<aside id="sidebar" class="sidebar w-80 lg:w-[380px] bg-[#09090b] flex flex-col flex-shrink-0">
<!-- Channel Controls -->
<div class="px-3 pb-2 space-y-2.5 pt-4 sidebar-top">
<!-- Explore mode switch (desktop only, mobile uses pill nav) -->
<div class="hidden md:block">
<div class="text-center text-[10px] font-medium uppercase tracking-widest text-white/30 mb-1.5">Explore</div>
<div class="flex explore-mode-switch">
<button id="browse-channels-btn" class="explore-mode-btn">
<svg id="browse-btn-icon" class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z"/>
</svg>
<span id="browse-btn-text">Threads</span>
</button>
<button id="browse-livestreams-btn" class="explore-mode-btn" title="Coming soon" disabled>
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.75 10.5l4.72-2.362A1 1 0 0122 9v6a1 1 0 01-1.53.862L15.75 13.5m-9.75 6h6a2.25 2.25 0 002.25-2.25v-8.5A2.25 2.25 0 0012 6.5H4.5A2.25 2.25 0 002.25 8.75v8.5A2.25 2.25 0 004.5 19.5z"/>
</svg>
<span>Live</span>
<span class="explore-mode-soon">SOON</span>
</button>
</div>
</div>
<!-- Channel Filter Tabs -->
<div class="flex items-center mt-3 border-b border-white/[0.06] channel-filter-tabs">
<button data-channel-filter="all" class="channel-filter-tab flex-1 py-2.5 text-[10px] font-medium uppercase tracking-widest transition-all text-[#F6851B] border-b-2 border-[#F6851B] -mb-px">
All
</button>
<button data-channel-filter="personal" class="channel-filter-tab flex-1 py-2.5 text-[10px] font-medium uppercase tracking-widest transition-all text-white/30 hover:text-white/50 border-b-2 border-transparent -mb-px">
Personal
</button>
<button data-channel-filter="community" class="channel-filter-tab flex-1 py-2.5 text-[10px] font-medium uppercase tracking-widest transition-all text-white/30 hover:text-white/50 border-b-2 border-transparent -mb-px">
Communities
</button>
</div>
</div>
<!-- Channel List -->
<div id="channel-list" class="flex-1 overflow-y-auto space-y-1.5 py-2">
<!-- Channels will be dynamically added here -->
<div class="p-4 text-center text-white/25 text-sm">
No channels yet
</div>
</div>
<!-- DM Inbox Setup Button (hidden by default, shown for non-guests without inbox) -->
<div id="dm-inbox-setup" class="hidden flex justify-center px-4 pt-3 pb-32 md:pb-3">
<button id="open-dm-btn" class="px-5 py-2.5 bg-[#F6851B]/15 hover:bg-[#F6851B]/25 text-white border border-[#F6851B]/30 text-sm font-medium rounded-xl transition-all duration-200 inline-flex items-center gap-2 hover:shadow-lg hover:shadow-[#F6851B]/10">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
</svg>
Create DM Inbox
</button>
</div>
<!-- New DM Button (hidden by default, shown when inbox is ready) -->
<div id="dm-new-btn-wrap" class="hidden flex justify-center px-4 pt-3 pb-32 md:pb-3">
<button id="new-dm-btn" class="px-5 py-2.5 bg-[#F6851B]/15 hover:bg-[#F6851B]/25 text-white border border-[#F6851B]/30 text-sm font-medium rounded-xl transition-all duration-200 inline-flex items-center gap-2 hover:shadow-lg hover:shadow-[#F6851B]/10">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.5v15m7.5-7.5h-15"/>
</svg>
New DM
</button>
</div>
<!-- Shown while the inbox probe is in flight. Carries the New DM
label, hidden, so the pill keeps that button's size -->
<div id="dm-checking-wrap" class="hidden flex justify-center px-4 pt-3 pb-32 md:pb-3">
<div class="relative px-5 py-2.5 bg-[#F6851B]/15 border border-[#F6851B]/30 text-sm font-medium rounded-xl inline-flex items-center gap-2">
<svg class="w-4 h-4 invisible" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.5v15m7.5-7.5h-15"/>
</svg>
<span class="invisible">New DM</span>
<span class="absolute inset-0 flex items-center justify-center">
<span class="w-5 h-5 border-2 border-white/25 border-t-white rounded-full animate-spin"></span>
</span>
</div>
</div>
<!-- Desktop Sidebar Footer (hidden on mobile, replaced by pill) -->
<div id="sidebar-footer-desktop" class="p-3 border-t border-white/[0.06] space-y-0.5">
<button id="contacts-btn-desktop" class="w-full px-3 py-2.5 rounded-xl text-sm text-white/40 hover:text-white hover:bg-white/[0.06] transition-all duration-200 flex items-center gap-2.5">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"></path>
</svg>
Contacts
</button>
<button id="settings-btn-desktop" class="w-full px-3 py-2.5 rounded-xl text-sm text-white/40 hover:text-white hover:bg-white/[0.06] transition-all duration-200 flex items-center gap-2.5">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
Settings
</button>
</div>
</aside>
<!-- Mobile: Floating Connect button (shown for guests) -->
<div id="sidebar-connect-float" class="hidden">
<button id="sidebar-connect-btn" class="bg-[#F6851B] hover:bg-[#e5780f] text-white px-5 py-2.5 rounded-2xl text-sm font-semibold transition-all duration-200 flex items-center gap-2 shadow-lg shadow-[#F6851B]/25">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"/>
</svg>
Create Account
</button>
</div>
<!-- Mobile: Pill nav (hidden for guests) -->
<div id="mobile-pill-nav" class="hidden">
<div class="pill-nav-inner">
<button id="pill-chats-btn" class="pill-nav-item" data-pill-tab="chats">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 11L12 3l9 8M5 10.5V20a1 1 0 001 1h12a1 1 0 001-1v-9.5M10 21v-5h4v5"/>
</svg>
<span>Home</span>
</button>
<div class="pill-nav-item pill-settings-wrapper" data-pill-tab="explore">
<button id="pill-explore-btn" class="pill-settings-btn">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="9" stroke-width="1.5"/>
<path stroke-width="1.5" stroke-linejoin="round" fill="currentColor" d="M15.02 8.98l-2.1 4.14-4.14 2.1 2.1-4.14 4.14-2.1z"/>
</svg>
<span>Explore</span>
</button>
<!-- Explore dropdown (appears above pill) -->
<div id="pill-explore-dropdown" class="pill-settings-dropdown hidden">
<button id="pill-explore-threads-btn" class="pill-dropdown-item">
<svg class="w-4 h-4 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z"/></svg>
Threads
</button>
<button id="pill-explore-livestreams-btn" class="pill-dropdown-item pill-dropdown-item-locked" disabled>
<svg class="w-4 h-4 text-white/25" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.75 10.5l4.72-2.362A1 1 0 0122 9v6a1 1 0 01-1.53.862L15.75 13.5m-9.75 6h6a2.25 2.25 0 002.25-2.25v-8.5A2.25 2.25 0 0012 6.5H4.5A2.25 2.25 0 002.25 8.75v8.5A2.25 2.25 0 004.5 19.5z"/></svg>
<span class="flex-1">Live Streams</span>
<span class="pill-dropdown-soon">SOON</span>
</button>
</div>
</div>
<button id="contacts-btn" class="pill-nav-item" data-pill-tab="contacts">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"/>
</svg>
<span>Contacts</span>
</button>
<div class="pill-nav-item pill-settings-wrapper" data-pill-tab="settings">
<button id="settings-btn" class="pill-settings-btn">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
</svg>
<span>Settings</span>
</button>
<!-- Settings dropdown (appears above pill) -->
<div id="pill-settings-dropdown" class="pill-settings-dropdown hidden">
<button class="pill-dropdown-item" data-settings-tab="profile">
<svg class="w-4 h-4 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"/></svg>
Account
</button>
<button class="pill-dropdown-item" data-settings-tab="devicesync">
<svg class="w-4 h-4 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"/></svg>
Device Sync
</button>
<button class="pill-dropdown-item" data-settings-tab="notifications">
<svg class="w-4 h-4 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"/></svg>
Notifications
</button>
<button class="pill-dropdown-item" data-settings-tab="api">
<svg class="w-4 h-4 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"/></svg>
API
</button>
<button class="pill-dropdown-item" data-settings-tab="linkpreviews">
<svg class="w-4 h-4 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"/></svg>
Content
</button>
<hr class="border-white/[0.06] my-0.5">
<button class="pill-dropdown-item" data-settings-tab="privacy">
<svg class="w-4 h-4 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"/></svg>
Privacy
</button>
<button class="pill-dropdown-item" data-settings-tab="security">
<svg class="w-4 h-4 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"/></svg>
Security
</button>
<button class="pill-dropdown-item" data-settings-tab="repair">
<svg class="w-4 h-4 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"/></svg>
DM Inbox
</button>
<hr class="border-white/[0.06] my-0.5">
<button class="pill-dropdown-item" data-settings-tab="about">
<svg class="w-4 h-4 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"/></svg>
About
</button>
</div>
</div>
<!-- Profile avatar button -->
<div class="pill-nav-item pill-profile-wrapper" data-pill-tab="profile">
<button id="pill-profile-btn" class="pill-profile-avatar" title="Profile">
<svg class="w-5 h-5 text-white/50" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"/>
</svg>
</button>
<!-- Profile dropdown (appears above pill) -->
<div id="pill-profile-dropdown" class="pill-profile-dropdown hidden">
<div id="pill-profile-address" class="pill-dropdown-address"></div>
<div id="pill-profile-accounts" class="pill-dropdown-accounts"></div>
<button id="pill-join-id-btn" class="pill-dropdown-item">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5l-3.9 19.5m-2.1-19.5l-3.9 19.5"/>
</svg>
Direct Join - #ID
</button>
<button id="pill-sync-devices-btn" class="pill-dropdown-item">
<svg class="w-4 h-4 sync-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"/>
</svg>
<span class="sync-btn-text">Sync Devices</span>
</button>
<button id="pill-disconnect-btn" class="pill-dropdown-item pill-dropdown-disconnect">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"/>
</svg>
Disconnect
</button>
</div>
</div>
</div>
</div>
<!-- Right Content Area (Chat) -->
<div id="chat-area" class="chat-area flex-1 flex flex-col min-w-0">
<!-- Main Chat Area -->
<main class="flex-1 flex flex-col bg-[#0f0f12] overflow-hidden">
<!-- Chat Header -->
<div id="chat-header" class="bg-[#0b0b0e] border-b border-white/[0.04] px-2 py-1.5 flex items-center">
<!-- Close button (mobile: left side) -->
<button id="close-channel-btn" class="hidden p-2 hover:bg-white/10 rounded-xl transition text-white/30 hover:text-white mobile-close-btn" title="Close channel">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.75 19.5L8.25 12l7.5-7.5"/>
</svg>
</button>
<!-- Channel thumbnail (between back button and name) -->
<div id="current-channel-thumb" class="hidden flex-shrink-0 mr-2 ml-1"></div>
<!-- Left: Channel name -->
<div class="flex-1 min-w-0">
<div class="flex items-center gap-2">
<h2 id="current-channel-name" class="text-lg font-semibold truncate">Explore Channels</h2>
<button id="channel-menu-btn" class="hidden p-1 hover:bg-white/10 rounded transition text-white/30 hover:text-white/70 desktop-channel-menu-btn" title="Channel options">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/>
</svg>
</button>
</div>
<!-- Starts hidden: the app opens on Explore, which has no
channel info to show and hides this anyway. Leaving it
in made the first paint taller than the view that
replaced it. Opening a channel restores it. -->
<div class="hidden flex items-center gap-1.5 text-sm text-white/30 min-h-[20px]">
<span id="current-channel-info" class="inline-flex items-center"></span>
<span id="online-separator" class="hidden leading-none">·</span>
<div class="relative inline-flex items-center">
<button id="online-header" class="hidden items-center gap-1 hover:text-white/70 transition">
<span id="online-users-count">0</span>
<span class="online-word">Online</span>
<span class="online-connecting">Connecting…</span>
</button>
<div id="online-users-list" class="absolute top-full left-0 mt-1 w-56 bg-[#1e1e1e] border border-white/10 rounded-xl p-3 z-20 hidden max-h-48 overflow-y-auto">
<div class="text-white/30 text-sm text-center">No one online</div>
</div>
</div>
</div>
</div>
<!-- Right: Action buttons -->
<div id="chat-header-right" class="flex-1 flex items-center justify-end space-x-3">
<div class="flex space-x-2">
<!-- Create Channel. Desktop only, and only in the Explore
view: mobile has its own in the global header
(#header-create-channel-btn). components.css owns the
visibility rules, so no Tailwind display class here. -->
<button id="new-channel-btn" class="px-4 py-2 bg-[#F6851B]/15 hover:bg-[#F6851B]/25 text-white border border-[#F6851B]/30 text-sm font-medium rounded-xl transition-all duration-200 items-center gap-1.5 hover:shadow-lg hover:shadow-[#F6851B]/10" title="Create Channel">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.5v15m7.5-7.5h-15"/>
</svg>
<span>Create</span>
</button>
<!-- Join button (shown in preview mode) -->
<button id="join-channel-btn" class="hidden px-4 py-2 bg-[#F6851B]/15 hover:bg-[#F6851B]/25 text-white border border-[#F6851B]/30 text-sm font-medium rounded-xl transition-all duration-200 flex items-center gap-1.5 hover:shadow-lg hover:shadow-[#F6851B]/10" title="Add to My Channels">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.5v15m7.5-7.5h-15"/>
</svg>
<span>Join</span>
</button>
<button id="invite-users-btn" class="p-2 hover:bg-white/10 rounded-xl transition hidden" title="Invite Users">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"></path>
</svg>
</button>
<!-- Channel menu button (mobile: kebab menu on right side) -->
<button id="channel-menu-btn-mobile" class="hidden p-2 hover:bg-white/10 rounded-xl transition text-white/30 hover:text-white mobile-channel-menu-btn" title="Channel options">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"/>
</svg>
</button>
<!-- Close button (desktop: right side) -->
<button id="close-channel-btn-desktop" class="hidden p-2 hover:bg-white/10 rounded-xl transition text-white/30 hover:text-white desktop-close-btn" title="Close channel">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
</div>
</div>
<!-- Messages Area (with overlay pinned banner) -->
<div class="messages-wrapper">
<div id="subscription-banner" class="subscription-banner hidden">
<svg id="subscription-banner-icon-clock" class="subscription-banner-icon hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
<svg id="subscription-banner-icon-alert" class="subscription-banner-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
<svg id="subscription-banner-icon-gavel" class="subscription-banner-icon hidden" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path d="M1 21h12v2H1zM5.245 8.07l2.83-2.827 14.14 14.142-2.828 2.828zM12.317 1l5.657 5.656-2.83 2.83-5.654-5.66zM3.825 9.485l5.657 5.657-2.828 2.828-5.657-5.657z"/>
</svg>
<span id="subscription-banner-text" class="subscription-banner-text"></span>
<button id="subscription-banner-renew" class="subscription-banner-renew">Renew</button>
<button id="subscription-banner-dismiss" class="subscription-banner-dismiss" title="Dismiss" aria-label="Dismiss subscription warning">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<div id="pinned-banner" class="pinned-banner hidden" role="button" tabindex="0" title="Jump to pinned message">
<svg class="pinned-banner-icon" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path d="M16 12V4h1V2H7v2h1v8l-2 2v2h5v6l1 1 1-1v-6h5v-2l-2-2z"/>
</svg>
<div class="pinned-banner-body">
<div class="pinned-banner-name" id="pinned-banner-name"></div>
<div class="pinned-banner-text" id="pinned-banner-text"></div>
</div>
<div class="pinned-banner-actions">
<span id="pinned-banner-count" class="pinned-banner-count hidden"></span>
<button id="pinned-banner-close" class="pinned-banner-close" title="Dismiss" aria-label="Dismiss pinned message">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
</div>
<div id="history-status-strip" class="hidden"></div>
<div id="messages-area" class="flex-1 overflow-y-auto p-4 messages-area">
</div>
<!-- Typing Indicator -->
<div id="typing-indicator" class="typing-row hidden">
<span id="typing-users"></span> typing
<span class="typing-dot"></span>
<span class="typing-dot"></span>
<span class="typing-dot"></span>
</div>
</div>
<!-- Reply Bar -->
<div id="reply-bar" class="reply-bar">
<div class="reply-bar-info">
<span class="reply-bar-label">Replying to <span id="reply-to-name" class="reply-bar-name"></span></span>
<span id="reply-to-text" class="reply-bar-text"></span>
</div>
<span id="reply-bar-close" class="reply-bar-close" title="Cancel reply">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</span>
</div>
<!-- Edit Bar -->
<div id="edit-bar" class="reply-bar">
<div class="reply-bar-info">
<span class="reply-bar-label">Editing message</span>
</div>
<span id="edit-bar-close" class="reply-bar-close" title="Cancel edit">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</span>
</div>
<!-- Message Input -->
<div id="message-input-container" class="bg-[#0b0b0e] border-t border-white/[0.04] p-3 pb-4 hidden">
<div class="relative flex items-center gap-2">
<!-- Emoji Picker -->
<div id="emoji-picker" class="emoji-picker"></div>
<!-- Attach Button -->
<div class="relative input-btn-wrapper">
<button id="attach-btn" class="input-button text-white/30 hover:text-white transition" title="Attach">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M18.375 12.739l-7.693 7.693a4.5 4.5 0 01-6.364-6.364l10.94-10.94A3 3 0 1119.5 7.372L8.552 18.32m.009-.01l-.01.01m5.699-9.941l-7.81 7.81a1.5 1.5 0 002.112 2.13"/>
</svg>
</button>
<!-- Attach Menu -->
<div id="attach-menu" class="hidden absolute bottom-12 left-0 bg-[#16161b] border border-white/10 rounded-xl py-1 z-50 min-w-[150px] shadow-xl">
<!-- File: opens a transport submenu -->
<div class="relative">
<button id="attach-file-btn" class="attach-parent w-full text-left px-4 py-2 hover:bg-white/[0.08] text-sm flex items-center gap-2 text-white" aria-haspopup="true" aria-expanded="false">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5A3.375 3.375 0 0 0 10.125 2.25H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/>
</svg>
<span class="flex-1">File</span>
<svg class="w-3 h-3 text-white/30" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m8.25 4.5 7.5 7.5-7.5 7.5"/>
</svg>
</button>
<div id="attach-file-submenu" class="hidden absolute left-full top-0 ml-1 bg-[#16161b] border border-white/10 rounded-xl py-1 shadow-xl min-w-[150px] z-50">
<button id="send-file-mesh-btn" class="w-full text-left px-4 py-2 hover:bg-white/[0.08] text-sm text-white">P2P</button>
<button id="send-file-storage-btn" class="w-full text-left px-4 py-2 hover:bg-white/[0.08] text-sm text-white">Storage</button>
</div>
</div>
<!-- Video: same transport choice -->
<div class="relative">
<button id="attach-video-btn" class="attach-parent w-full text-left px-4 py-2 hover:bg-white/[0.08] text-sm flex items-center gap-2 text-white" aria-haspopup="true" aria-expanded="false">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"/>
</svg>
<span class="flex-1">Video</span>
<svg class="w-3 h-3 text-white/30" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m8.25 4.5 7.5 7.5-7.5 7.5"/>
</svg>
</button>
<div id="attach-video-submenu" class="hidden absolute left-full top-0 ml-1 bg-[#16161b] border border-white/10 rounded-xl py-1 shadow-xl min-w-[150px] z-50">
<button id="send-video-mesh-btn" class="w-full text-left px-4 py-2 hover:bg-white/[0.08] text-sm text-white">P2P</button>
<button id="send-video-storage-btn" class="w-full text-left px-4 py-2 hover:bg-white/[0.08] text-sm text-white">Storage</button>
</div>
</div>
<!-- Image: stored on the channel stream, no transport choice -->
<button id="send-image-btn" class="w-full text-left px-4 py-2 hover:bg-white/[0.08] text-sm flex items-center gap-2 text-white">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"/>
</svg>
<span class="flex-1">Image</span>
</button>
</div>
</div>
<!-- Emoji Button -->
<button id="emoji-btn" class="input-button text-white/30 hover:text-white transition input-btn-wrapper" title="Emoji">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</button>
<!-- Hidden File Inputs -->
<input type="file" id="image-input" class="hidden" accept="image/jpeg,image/png,image/gif,image/webp">
<input type="file" id="video-input" class="hidden" accept="video/mp4,video/webm,video/quicktime">
<input type="file" id="file-input" class="hidden">
<!-- Input (contenteditable so Android keyboards can commit images/GIFs) -->
<div
id="message-input"
contenteditable="true"
role="textbox"
aria-multiline="true"
aria-label="Type a message"
data-placeholder="Type a message..."
spellcheck="true"
autocapitalize="sentences"
class="flex-1 bg-white/[0.05] text-white px-4 py-3 rounded-2xl focus:outline-none focus:ring-1 focus:ring-white/10 border border-white/[0.08] text-sm transition-all duration-200 overflow-y-auto min-h-[44px] max-h-[120px] leading-5 break-words whitespace-pre-wrap"
></div>
<!-- Send Button: transparent, dark-orange arrow icon -->
<button id="send-message-btn" class="bg-transparent w-9 h-9 transition flex items-center justify-center p-0" aria-label="Send message">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6.5 w-6.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5" />
</svg>
</button>
</div>
</div>
</main>
</div>
</div>
<!-- Modal: New Channel -->
<div id="new-channel-modal" class="hidden fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4 md:p-4">
<div class="bg-[#111113] rounded-2xl w-[640px] max-w-[95vw] shadow-2xl border border-white/[0.06] overflow-hidden flex flex-col max-h-[95vh] md:max-h-[90vh]">
<!-- Header -->
<div class="flex items-center justify-between px-6 py-4 border-b border-white/5 flex-shrink-0">
<button id="cancel-channel-btn" class="modal-close-btn text-white/40 hover:text-white/80 transition p-1 -ml-1 md:order-2 md:ml-0 md:-mr-1">
<svg class="w-5 h-5 icon-back" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.75 19.5L8.25 12l7.5-7.5"/>
</svg>
<svg class="w-5 h-5 icon-close hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
<h3 class="text-lg font-medium text-white/90 md:order-1">Create Channel</h3>
</div>
<div class="flex flex-1 min-h-0 overflow-hidden">
<!-- Sidebar: Channel Type -->
<div class="w-40 bg-[#0a0a0a] border-r border-white/5 py-3 flex flex-col flex-shrink-0">
<div class="px-3 mb-2">
<span class="text-[10px] font-medium text-white/30 uppercase tracking-wider">Type</span>
</div>
<nav class="space-y-1 px-2 flex-1">
<button type="button" data-tab="public" class="channel-tab w-full flex items-center gap-2.5 px-3 py-2.5 rounded-lg text-sm text-left transition-all bg-white/10 text-white">
<svg class="w-4 h-4 text-white/60" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
<span>Open</span>
</button>
<button type="button" data-tab="password" class="channel-tab w-full flex items-center gap-2.5 px-3 py-2.5 rounded-lg text-sm text-left transition-all text-white/60 hover:text-white/90 hover:bg-white/5">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"/></svg>
<span>Protected</span>
</button>
<button type="button" data-tab="closed" class="channel-tab w-full flex items-center gap-2.5 px-3 py-2.5 rounded-lg text-sm text-left transition-all text-white/60 hover:text-white/90 hover:bg-white/5">
<svg class="w-4 h-4" viewBox="0 0 320 512" fill="currentColor"><path d="M311.9 260.8L160 353.6 8 260.8 160 0l151.9 260.8zM160 383.4L8 290.6 160 512l152-221.4-152 92.8z"/></svg>
<span>Closed</span>
</button>
<button type="button" data-tab="gated" class="channel-tab w-full flex items-center gap-2.5 px-3 py-2.5 rounded-lg text-sm text-left transition-all text-white/60 hover:text-white/90 hover:bg-white/5">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"/></svg>
<span>Gated</span>
</button>
<button type="button" data-tab="paid" class="channel-tab w-full flex items-center gap-2.5 px-3 py-2.5 rounded-lg text-sm text-left transition-all text-white/60 hover:text-white/90 hover:bg-white/5">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
<span>Paid</span>
</button>
</nav>
</div>
<!-- Content Panel -->
<div class="flex-1 p-5 overflow-y-auto">
<div class="space-y-5">
<!-- One wrapper for every tab content: the panel's
space-y margins land on later siblings even when
hidden, pushing every tab but the first down -->
<div>
<!-- Tab Content: Public -->
<div id="tab-public" class="channel-tab-content space-y-4">
<div class="p-4 bg-white/5 rounded-xl border border-white/5">
<p class="text-sm text-white/50 leading-relaxed">
Open channel that anyone can discover and join. Messages are visible to all participants.
</p>
</div>
<input type="hidden" name="channel-type" value="public" class="channel-type-input">
</div>
<!-- Tab Content: Password (description only) -->
<div id="tab-password" class="channel-tab-content hidden space-y-4">
<div class="p-4 bg-white/5 rounded-xl border border-white/5">
<p class="text-sm text-white/50 leading-relaxed">
Password protected channel. Only users with the correct password can join and read messages.
</p>
</div>
<input type="hidden" name="channel-type" value="password" class="channel-type-input">
</div>
<!-- Tab Content: Closed (description only) -->
<div id="tab-closed" class="channel-tab-content hidden space-y-4">
<div class="p-4 bg-white/5 rounded-xl border border-white/5">
<p class="text-sm text-white/50 leading-relaxed">
Private channel with on-chain verified membership. Each member is authorized by account address.
</p>
</div>
<input type="hidden" name="channel-type" value="closed" class="channel-type-input">
</div>
<!-- Tab Content: Gated (token/NFT holding) -->
<div id="tab-gated" class="channel-tab-content hidden space-y-4">
<div class="p-4 bg-white/5 rounded-xl border border-white/5">
<p class="text-sm text-white/50 leading-relaxed">
Access follows an on-chain asset: anyone holding the token or NFT can join, read and write. Selling the asset cuts new access.
</p>
</div>
<input type="hidden" name="channel-type" value="gated" class="channel-type-input">
</div>
<!-- Tab Content: Paid (subscription) -->
<div id="tab-paid" class="channel-tab-content hidden space-y-4">
<div class="p-4 bg-white/5 rounded-xl border border-white/5">
<p class="text-sm text-white/50 leading-relaxed">
Subscription channel: members pay a fixed price in an ERC-20 token for a period of access. Payments go in full, directly to your wallet.
</p>
</div>
<input type="hidden" name="channel-type" value="paid" class="channel-type-input">
</div>
</div>
<!-- Channel Name (common for all tabs) -->
<div>
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Channel Name</label>
<input
type="text"
id="channel-name-input"
placeholder="e.g. World News"
class="w-full bg-white/5 border border-white/10 text-white px-4 py-3 rounded-xl text-sm focus:outline-none focus:border-white/30 transition placeholder:text-white/20"
/>
</div>
<!-- Password field (shown only for Password tab) -->
<div id="password-field-section" class="hidden">
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Password</label>
<div class="relative">
<input
type="password"
id="channel-password-input"
name="channel-password"
placeholder="Enter a password"
autocomplete="off"
data-lpignore="true"
data-1p-ignore="true"
data-form-type="other"
spellcheck="false"
style="-webkit-text-security: disc;"
class="w-full bg-white/5 border border-white/10 text-white px-4 py-3 pr-10 rounded-xl text-sm focus:outline-none focus:border-white/30 transition placeholder:text-white/20"
/>
<button type="button" id="channel-password-toggle" class="absolute right-2.5 top-1/2 -translate-y-1/2 text-white/25 hover:text-white transition">
<svg class="w-4 h-4" id="channel-pw-eye-open" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
</svg>
<svg class="w-4 h-4 hidden" id="channel-pw-eye-off" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"/>
</svg>
</button>
</div>
<!-- Confirm step: opens on password field focus, closes once it matches -->
<div id="password-confirm-section" class="hidden mt-3 space-y-3">
<div class="p-3 bg-amber-500/5 rounded-xl border border-amber-500/10">
<p class="text-xs text-amber-400/80 flex items-center gap-2">
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"/></svg>
<span>Use a strong password — anyone who has it can join this channel.</span>
</p>
</div>
<div class="relative">
<input
type="password"
id="channel-password-confirm-input"
name="channel-password-confirm"
placeholder="Confirm password"
autocomplete="off"
data-lpignore="true"
data-1p-ignore="true"
data-form-type="other"
spellcheck="false"
style="-webkit-text-security: disc;"
class="w-full bg-white/5 border border-white/10 text-white px-4 py-3 rounded-xl text-sm focus:outline-none focus:border-white/30 transition placeholder:text-white/20"
/>
</div>
</div>
</div>
<!-- Closed-tab fields -->
<div id="closed-fields-section" class="hidden space-y-5">
<div>
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Member Addresses</label>
<textarea
id="channel-members-input"
placeholder="0x1234... 0x5678... 0xabcd..."
rows="3"
class="w-full bg-white/5 border border-white/10 text-white px-4 py-3 rounded-xl text-sm focus:outline-none focus:border-white/30 transition resize-none font-mono placeholder:text-white/20"
></textarea>
</div>
</div>
<!-- Gated fields (shown only for Gated tab) -->
<div id="gated-fields-section" class="hidden space-y-5">
<div>
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Asset Type</label>
<div class="flex gap-2">
<button type="button" data-gate-asset="token" class="gate-asset-tab flex-1 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/10 text-white border border-white/10">
Token
</button>
<button type="button" data-gate-asset="nft" class="gate-asset-tab flex-1 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/5 text-white/50 border border-white/5 hover:bg-white/10 hover:text-white/70">
NFT
</button>
</div>
</div>
<div>
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Token</label>
<div id="gate-token-presets" class="flex gap-2">
<button type="button" data-token-preset="pol" class="gate-token-preset-tab flex-1 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/10 text-white border border-white/10">
POL
</button>
<button type="button" data-token-preset="usdc" class="gate-token-preset-tab flex-1 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/5 text-white/50 border border-white/5 hover:bg-white/10 hover:text-white/70">
USDC
</button>
<button type="button" data-token-preset="data" class="gate-token-preset-tab flex-1 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/5 text-white/50 border border-white/5 hover:bg-white/10 hover:text-white/70">
DATA
</button>
<button type="button" data-token-preset="custom" class="gate-token-preset-tab flex-1 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/5 text-white/50 border border-white/5 hover:bg-white/10 hover:text-white/70">
Custom
</button>
</div>
<input
type="text"
id="gate-token-input"
placeholder="0x…"
spellcheck="false"
class="hidden w-full mt-2 bg-white/5 border border-white/10 text-white px-4 py-3 rounded-xl text-sm focus:outline-none focus:border-white/30 transition font-mono placeholder:text-white/20"
/>
<p class="text-xs text-white/30 mt-2" id="gate-token-hint">Gates on the member's native POL balance.</p>
</div>
<div id="gate-min-balance-field">
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Minimum Balance</label>
<input
type="text"
id="gate-min-balance-input"
placeholder="e.g. 100"
inputmode="decimal"
class="w-full bg-white/5 border border-white/10 text-white px-4 py-3 rounded-xl text-sm focus:outline-none focus:border-white/30 transition placeholder:text-white/20"
/>
<p class="text-xs text-white/30 mt-2">Balance a member must hold to read and write.</p>
</div>
</div>
<!-- Paid fields (shown only for Paid tab) -->
<div id="paid-fields-section" class="hidden space-y-5">
<div>
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Payment Token</label>
<div id="paid-token-presets" class="flex gap-2">
<button type="button" data-token-preset="pol" class="paid-token-preset-tab flex-1 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/5 text-white/50 border border-white/5 hover:bg-white/10 hover:text-white/70">
POL
</button>
<button type="button" data-token-preset="usdc" class="paid-token-preset-tab flex-1 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/10 text-white border border-white/10">
USDC
</button>
<button type="button" data-token-preset="data" class="paid-token-preset-tab flex-1 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/5 text-white/50 border border-white/5 hover:bg-white/10 hover:text-white/70">
DATA
</button>
<button type="button" data-token-preset="custom" class="paid-token-preset-tab flex-1 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/5 text-white/50 border border-white/5 hover:bg-white/10 hover:text-white/70">
Custom
</button>
</div>
<input
type="text"
id="paid-token-input"
placeholder="0x… (e.g. USDC)"
spellcheck="false"
class="hidden w-full mt-2 bg-white/5 border border-white/10 text-white px-4 py-3 rounded-xl text-sm focus:outline-none focus:border-white/30 transition font-mono placeholder:text-white/20"
/>
<p class="text-xs text-white/30 mt-2" id="paid-token-hint">Subscribers pay in USDC.</p>
</div>
<div class="flex gap-3">
<div class="flex-1">
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Price</label>
<input
type="text"
id="paid-price-input"
placeholder="e.g. 5"
inputmode="decimal"
class="w-full bg-white/5 border border-white/10 text-white px-4 py-3 rounded-xl text-sm focus:outline-none focus:border-white/30 transition placeholder:text-white/20"
/>
</div>
<div class="flex-1">
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Period (days)</label>
<input
type="number"
id="paid-duration-input"
value="30"
min="1"
class="w-full bg-white/5 border border-white/10 text-white px-4 py-3 rounded-xl text-sm focus:outline-none focus:border-white/30 transition placeholder:text-white/20"
/>
</div>
</div>
</div>
<!-- Author visibility (all gated variants; immutable after creation) -->
<div id="author-visibility-section" class="hidden">
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Identity on the wire</label>
<div class="flex gap-2">
<label class="flex-1 cursor-pointer">
<input type="radio" name="author-visibility" id="gate-wire-identity-sealed" class="peer sr-only" checked>
<span class="flex items-center justify-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/5 text-white/50 border border-white/5 peer-checked:bg-white/10 peer-checked:text-white peer-checked:border-white/10">
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"/></svg>
Sealed
</span>
</label>
<label class="flex-1 cursor-pointer">
<input type="radio" name="author-visibility" id="gate-wire-identity-visible" class="peer sr-only">
<span class="flex items-center justify-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium transition bg-white/5 text-white/50 border border-white/5 peer-checked:bg-white/10 peer-checked:text-amber-400/90 peer-checked:border-white/10">
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m-18.716-2.253A8.959 8.959 0 003 12c0 .778.099 1.533.284 2.253"/></svg>
Visible
</span>
</label>
</div>
<p id="author-visibility-caption" class="text-xs text-white/30 mt-2">Full author privacy. Removed members can pollute storage until you reset the key with a paid on-chain action.</p>
</div>
<!-- Divider -->
<div class="border-t border-white/5"></div>
<!-- Visible Channel Fields (shown when visibility is ON) -->
<div id="visible-fields" class="hidden space-y-4">
<div>
<label class="block text-xs font-medium text-white/80 uppercase tracking-wider mb-2">Description</label>
<textarea
id="channel-description-input"
placeholder="What's this channel about?"
rows="2"
maxlength="200"
class="w-full bg-white/5 border border-white/10 text-white px-4 py-3 rounded-xl text-sm focus:outline-none focus:border-white/30 transition resize-none placeholder:text-white/20"
></textarea>
</div>
<div class="flex gap-3">
<div class="flex-1">
<label class="block text-xs font-medium text-white/40 uppercase tracking-wider mb-2">Language</label>