summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/style.css
blob: 5ef04b0e33c1359218395368f8b0be08f862e2df (plain) (blame)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
/* MeshBay Web Client — Phase 9.6 */

/* ── Theme variables ──────────────────────────────────────────────────────── */

:root, .theme-light {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-raised: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-dim: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #0ea5e9;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --accent-text: #ffffff;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --success: #22c55e;
  --nav-bg: #0f172a;
  --nav-text: #e2e8f0;
  /* One step down from sky-400 towards sky-500: the wordmark sat brighter than
     the picture beside it, which made the two read as different materials. */
  --nav-brand: #23b1f0;
  --sidebar-bg: #f1f5f9;
  --sidebar-hover: #e2e8f0;
  /* Used with a literal fallback in a handful of rules before they were
     defined here — same values, so nothing moves; now themeable, and the
     names in those rules are real. */
  --warn: #d97706;
  --accent-bg: rgba(59, 130, 246, 0.1);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.theme-dark {
  --bg-base: #0f172a;
  --bg-surface: #1e293b;
  --bg-raised: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --border: #334155;
  --warn: #f59e0b;
  --accent-bg: rgba(59, 130, 246, 0.18);
  --error-bg: #450a0a;
  --nav-bg: #020617;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ── Metrics ──────────────────────────────────────────────────────────────── */

/* Not a palette: these are the layout's own numbers, so they sit outside the
   theme blocks and neither theme overrides them.

   `--nav-h` is the height of `.nav`, which is `position: sticky` at the top of
   every page — the offset everything else pins beneath. The other two are
   *measured* at runtime by sticky.js and published onto the page's root
   element, which shadows the value declared here. They are declared anyway, and
   as `0px` rather than as nothing: an undefined custom property invalidates the
   whole `calc()` that names it (test_css_variables.py has the story), so
   without these a toolbar would silently lose its `top` — and lose it exactly
   in the window between the first paint and the first measurement, which is
   also the window a screenshot is most likely to catch. At `0px` the band pins
   directly under the navigation bar instead, which is where it belongs when
   there is nothing above it. */
:root {
  --nav-h: 52px;
  --chrome-h: 0px;
  --toolbar-h: 0px;
  /* Published by the music bar while it is on screen (sticky.js). */
  --music-bar-h: 0px;
  /* Published by the indexing dock, which sits on top of the music bar. */
  --index-dock-h: 0px;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* A tapped button keeps real DOM focus on mobile Chrome/Safari the way a
   click never does on desktop — there's no mouse to move away afterward, so
   the browser's own default focus ring (never reset anywhere in this file)
   is what stayed visibly "pressed" until something else was tapped (found
   live, 2026-08-26 — the nav hamburger has no :hover rule of its own at all,
   so the ring was the only thing that could have been showing). `:focus-
   visible` still shows it for real keyboard navigation — this only clears
   the leftover from a pointer/touch interaction, never accessibility. */
:focus:not(:focus-visible) { outline: none; }

/* A third, separate mechanism from :hover/:focus above, found live
   2026-08-26 (screenshots): Android Chrome's own tap-highlight flash —
   never disabled anywhere in this file — filled a tapped round button
   (music-player-btn's "next", which carries no state class at all) with a
   solid colour that stayed until another element was tapped. Left at its
   default, this shade is drawn from the OS accent colour on many Android
   builds, which is why it read as "the app's own blue", not an obviously
   foreign highlight. Unrelated to real hover/focus — safe to kill outright. */
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Cross-group search page ──────────────────────────────────────────────── */

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-raised);
  /* A pinned band keeps this gap: `--band-margin` is both the margin in
     the flow and the width of the opaque ring the band paints around
     itself once pinned, so the two can never disagree (style.css,
     "Sticky chrome"). */
  --band-margin: 12px;
  margin-bottom: var(--band-margin);
}
.search-bar .icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-dim); }
.search-bar input {
  border: none; outline: none; background: transparent;
  flex: 1; font-size: 0.95em; color: var(--text);
  min-width: 0;
}
.search-bar input::placeholder { color: var(--text-dim); }
.search-bar:focus-within { border-color: var(--border-focus); }
.search-bar-clear {
  background: none; border: none; padding: 2px; cursor: pointer;
  color: var(--text-dim); display: flex; align-items: center;
}
.search-bar-clear:hover { color: var(--text); }
.search-bar-clear .icon { width: 14px; height: 14px; }

.search-progress {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85em; color: var(--text-dim); margin-bottom: 12px;
}
.search-progress-bar {
  flex: 1; height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.search-progress-fill {
  height: 100%; background: var(--accent);
  transition: width 0.3s;
}
.search-unreachable {
  font-size: 0.8em; color: var(--text-dim); margin-bottom: 8px;
}

.view-toggle {
  display: flex; gap: 0; flex-shrink: 0; margin-left: auto;
}
.view-toggle button {
  padding: 6px 12px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim);
  cursor: pointer; border-radius: 0; display: flex;
  align-items: center; gap: 4px; font-size: 0.85em;
}
.view-toggle button:first-child { border-radius: 6px 0 0 6px; }
.view-toggle button:last-child { border-radius: 0 6px 6px 0; }
.view-toggle button + button { margin-left: -1px; }
.view-toggle button.active {
  background: var(--accent-bg, rgba(59, 130, 246, 0.1));
  color: var(--accent); border-color: var(--accent);
  z-index: 1;
}
.view-toggle .icon { width: 16px; height: 16px; }

.search-media-list {
  display: flex; flex-direction: column; gap: 2px;
}
.search-media-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.search-media-row:hover { background: var(--bg-raised); }
.search-media-icon {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-raised); border-radius: 4px; color: var(--text-dim);
}
.search-media-icon .icon { width: 18px; height: 18px; }
.search-media-info { flex: 1; min-width: 0; }
.search-media-title {
  font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.search-media-meta {
  font-size: 0.8em; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-media-section {
  font-size: 0.75em; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 12px 10px 4px;
}
.search-media-row .badge { flex-shrink: 0; font-size: 0.78em; }
.search-media-show { opacity: 0.85; }

/* ── Icons ────────────────────────────────────────────────────────────────── */

/* Sized in em and stroked in currentColor, so an icon inherits the size and
   colour of whatever it sits next to and needs no rule of its own. Only the
   places that want a fixed size say so below. */
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
  flex-shrink: 0;
}
.icon.flip { transform: rotate(180deg); }

/* ── Navigation ───────────────────────────────────────────────────────────── */

.nav {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left, .nav-right { display: flex; align-items: center; gap: 12px; }

.nav-brand {
  color: var(--nav-brand);
  font-weight: 700;
  /* 22px measured in the application. 1.15em was lettering sized for plain
     text and read as a caption beside the picture; 1.45em overshot. */
  font-size: 1.375em;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; }

/* The M is a picture standing in for a letter, so it is sized in `em` and
   follows the wordmark rather than being pinned to a pixel height.

   Sized by measuring the running application, twice. At 1.35em of the old
   font size it rendered 25px against a 29px line box — *smaller* than the
   letters beside it, so the wordmark read as unchanged. At 1.9em it was 35px
   against 29px, which overshot the other way. The pair is now set together:
   the picture leads, the lettering follows a little behind it. */
.nav-brand {
  display: inline-flex;
  align-items: center;
}
.nav-brand-m {
  /* **In pixels, not `em` — and that is the point.** Written in `em` this was
     a fraction of the lettering's size, so every adjustment to the text moved
     the picture too and the pair could never be settled: making the words
     bigger made the M bigger by the same stroke, and the ratio never changed.
     Two independent things need two independent numbers.

     30px against 22px of lettering. */
  height: 30px;
  width: auto;
  /* Positive, deliberately. The glyph this replaces carried its own side
     bearing and an image has none, so without this the picture sits flush
     against the "e". */
  margin-right: 4px;
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--nav-text);
  font-size: 1.4em;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.nav-user { color: var(--text-dim); font-size: 0.9em; }

/* ── User Menu ──────────────────────────────────────────────────────────── */

.user-menu-wrap { position: relative; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--nav-text);
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85em;
  transition: background 0.12s;
}
.user-menu-trigger:hover { background: rgba(255, 255, 255, 0.15); }

.user-menu-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8em;
  flex-shrink: 0;
}
.user-menu-avatar.lg { width: 36px; height: 36px; font-size: 0.95em; }

.user-menu-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-caret { font-size: 0.7em; color: rgba(255,255,255,0.5); }

.user-menu-dropdown {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 120;
  /* The language submenu expands to ten entries inside this dropdown, which
     overruns a short viewport. Clip horizontally as before, scroll vertically
     rather than hiding the last languages where nothing can reach them. */
  max-height: calc(100vh - 72px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 0;
}

.user-menu-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 8px;
}
.user-menu-uname { font-weight: 600; font-size: 0.9em; color: var(--text); }
.user-menu-role { font-size: 0.75em; color: var(--text-dim); text-transform: capitalize; }

.user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

.user-menu-section-label {
  padding: 6px 14px 2px;
  font-size: 0.7em; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); font-weight: 600;
}

.user-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 14px;
  background: none; border: none; border-radius: 0;
  color: var(--text); font-size: 0.85em;
  cursor: pointer; text-align: left;
}
.user-menu-item:hover { background: var(--bg-raised); }
.user-menu-logout { color: var(--error); }

.umi-icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-secondary); }
.umi-arrow { margin-left: auto; width: 13px; height: 13px; color: var(--text-dim); }
.umi-check { margin-left: auto; width: 14px; height: 14px; color: var(--accent); }
.user-menu-caret { width: 13px; height: 13px; color: var(--nav-text); opacity: 0.8; }
.user-menu-sub { padding-left: 32px; }

.nav-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--nav-text);
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
  text-decoration: none;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.18); text-decoration: none; }

/* ── Layout ───────────────────────────────────────────────────────────────── */

.layout { display: flex; min-height: calc(100vh - 52px); }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */

/* Pinned under the navigation bar at the window's height, so the legal link at
   its foot is at the bottom of the window whatever the page's length — on a
   long file list it would otherwise be at the bottom of the page. It stops
   above the music bar, which is pinned to the bottom of the window too. */
.sidebar {
  position: sticky;
  top: var(--nav-h);
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  width: 240px;
  height: calc(100vh - var(--nav-h) - var(--music-bar-h) - var(--index-dock-h));
  /* The visible viewport where the browser has the unit: on a phone or tablet
     `100vh` is the height with the address bar hidden, which leaves the foot of
     the list under the bar while it shows. The line above is the fallback. */
  height: calc(100dvh - var(--nav-h) - var(--music-bar-h) - var(--index-dock-h));
  /* Reaching either end of the list must not start scrolling the page behind. */
  overscroll-behavior: contain;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 16px 0 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-legal {
  margin-top: auto;
  padding: 10px 20px 12px;
  color: var(--text-dim);
  font-size: 0.75em;
}
.sidebar-legal:hover { color: var(--accent); }

.sidebar-section { padding: 0 12px; margin-bottom: 24px; }

.sidebar-heading {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 4px 8px;
  margin-bottom: 4px;
  font-weight: 600;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.12s;
}
/* A group entry: the name+dot on one line, the @owner on a subordinate line
   under it — so the status dot sits in front of the name, not floating
   between the name and the owner. */
.sidebar-item.sidebar-group {
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
}
.si-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sidebar-owner {
  margin-left: 16px;                 /* clear the 8px dot + 8px gap */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8em;
  color: var(--text-dim);
}
.sidebar-item.active .sidebar-owner { color: inherit; opacity: 0.75; }
.sidebar-item:hover { background: var(--sidebar-hover); text-decoration: none; }
.sidebar-item.active { background: var(--accent); color: var(--accent-text); }

.sidebar-empty {
  padding: 8px 12px;
  color: var(--text-dim);
  font-size: 0.85em;
  font-style: italic;
}

/* ── Main content ─────────────────────────────────────────────────────────── */

.main {
  flex: 1;
  padding: 24px 32px;
  max-width: 960px;
  min-width: 0;
}

.main h2 { font-size: 1.25em; margin-bottom: 16px; }

.page-message {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ── Page center (login / register) ───────────────────────────────────────── */

.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 52px);
  padding: 24px;
}

/* A centring page already reserves the whole viewport below the header, so the
   main column's own padding is added on top of it and the page overflows by
   exactly that much — 48px, and a scrollbar on sign-in at every window size.
   Measured, not deduced: `.page-center` ended at 795 and `main` at 819.
   The page brings its own 24px, so dropping main's here changes nothing
   visible and removes the duplicated arithmetic rather than adding more.
   `max-width` goes too: signed out there is no sidebar, so the 960px column sat
   at the left of the window and a "centred" form was centred in that — at
   x=290 in a 1440px window. */
.main:has(> .page-center) { padding: 0; max-width: none; }

/* ── Sticky chrome ────────────────────────────────────────────────────────── */

/* Files, Videos, Music and Photos are read by scrolling, and until now the
   controls that steer that reading went with the first screenful: which
   application, where in the tree, which filter, which column sorts. They pin
   under the navigation bar instead, in three bands, on the two pages that show
   those applications — a group (`group-page.js`) and Search (`search-page.js`),
   both of which mark their root `.sticky-chrome`:

     .nav                     52px, already sticky, --nav-h
     .group-tabs / .search-bar    which application / what is being searched
     the application's toolbar    where in the tree, the filter, the actions
     .file-table th               the column heads

   The group's name and description are deliberately *not* in the stack. They
   say nothing a reader needs while walking a directory, and the height they
   would cost is height the list does not get.

   Each band pins below the ones above it, so its `top` is their heights added
   up — heights that change with the window (`.video-toolbar` wraps on a phone,
   by design), with the state (naming a folder grows the toolbar; `hideFilter`
   shrinks it) and with the theme's font. sticky.js measures them and publishes
   `--chrome-h` and `--toolbar-h`; everything here reads those rather than
   repeating a number that would be right in one file and wrong in another.

   `>` throughout, and not by accident: a band publishes its height onto its
   own parent, so these rules and sticky.js are asserting the same structural
   fact — these elements are children of the page root. Nest one deeper and
   both stop applying, rather than the stylesheet pinning something the script
   is no longer measuring.

   `.file-toolbar` is also the toolbar of the public directory
   (`explore-page.js`), which is not one of these pages and is left alone. */

.sticky-chrome > .group-tabs,
.sticky-chrome > .search-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 30;
}

.sticky-chrome > .file-toolbar,
.sticky-chrome > .video-toolbar,
.sticky-chrome > .photo-toolbar,
.sticky-chrome > .photo-album-bar {
  position: sticky;
  top: calc(var(--nav-h) + var(--chrome-h));
  z-index: 20;
}

.sticky-chrome > .file-table th {
  position: sticky;
  top: calc(var(--nav-h) + var(--chrome-h) + var(--toolbar-h));
  z-index: 10;
}

/* A pinned band has the list running underneath it and must be opaque, which
   most of these were not: only `.search-bar` and `.file-toolbar` came with a
   surface of their own. So the bare bands take the page colour outright. */
.sticky-chrome > .group-tabs,
.sticky-chrome > .video-toolbar,
.sticky-chrome > .photo-toolbar,
.sticky-chrome > .photo-album-bar,
.sticky-chrome > .file-table th {
  background: var(--bg-base);
}

/* **The gap a band keeps when it pins.** In the flow every band is followed by
   a margin — 16px under the tab bar, 12px under the search field and the file
   toolbar, 14px under the media ones. Pinning absorbs it: the band below stops
   at the bottom edge of the band above and the two come into contact. Reported
   on both counts, and they are the same fault — two rounded panels flush
   against each other in Files read as *encastrés*, and the row of controls in
   Videos/Music/Photos reads as glued to the tab bar.

   So each band paints its own margin as a ring of page colour around itself,
   and the band below pins past it: `--chrome-h`/`--toolbar-h` are published by
   sticky.js as **height plus that margin**, which is why the ring and the
   offset can never disagree — they are the same number, declared once beside
   the component's own `margin-bottom` and nowhere else. The pinned layout is
   then pixel-identical to the flow layout, so nothing shifts at the moment a
   band pins.

   The ring must be exactly the margin, not more: it is painted at the band's
   own z-index, above every band below it, so a ring wider than the gap would
   paint page colour over the top of the next band down. It is also what covers
   the four transparent corners a border radius leaves, where a row's rule
   sliding past would read as a flicker nobody can reproduce. */
.sticky-chrome > .group-tabs,
.sticky-chrome > .search-bar,
.sticky-chrome > .file-toolbar,
.sticky-chrome > .video-toolbar,
.sticky-chrome > .photo-toolbar,
.sticky-chrome > .photo-album-bar {
  box-shadow: 0 0 0 var(--band-margin) var(--bg-base);
}

/* **And the same gap above the first one.** The ring is painted on all four
   sides, which is what the corners need — so a band has to have
   `--band-margin` of clearance above it too, or it paints page colour over
   whatever is there. Every band but the first has that for free: what sits
   above it is the band it pins under, at a higher z-index, and a ring cannot
   paint over that. The first has the page's own content above it, and nothing
   was making the two agree — the join-code form under a group's title leaves
   12px, the tab bar's ring is 16px, and the form was handed back with the
   bottom 4px of its field and its button painted over. The same 4px went off
   the bottom of the "could not reach this node" banner, which is the other
   thing that stands between the title and the tabs.

   Only the first band, and that is the whole of the rule rather than an
   economy: the gap *between* two bands is the upper one's `--band-margin` and
   nothing else — it is the number `--chrome-h` carries and the offset the
   lower one pins at. A margin-top on a lower band would collapse to the
   larger of the pair and win wherever it was bigger, which is most widths,
   leaving the flow a couple of pixels wider than the pinned layout. Measured,
   in every media view at every phone width, the moment this rule was written
   for all six.

   `* +`, so this is the gap between two elements and not a margin the band
   always carries: as a first child — the Search page's field is one — a
   margin-top would collapse through the page root and take the whole page
   down with it. Between siblings the two margins collapse to the larger of
   the pair, so every place that already leaves enough is untouched, and only
   what was being painted over moves. */
.sticky-chrome > * + .group-tabs,
.sticky-chrome > * + .search-bar {
  margin-top: var(--band-margin);
}

/* ── Cards ────────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-card { width: 100%; max-width: 380px; }
.login-card h2 { text-align: center; margin-bottom: 20px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }

.login-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85em;
  color: var(--text-dim);
}

/* ── Welcome (sign-in page, browser only) ─────────────────────────────────── */

/* What MeshBay is on the left, the form on the right and level with the
   title; stacked, form first, once the text would be narrower than the form.
   The form comes first in the markup (first on a phone, first to the
   keyboard) and `row-reverse` is what moves it right. Headings are
   `.welcome-pitch .welcome-h` rather than a bare class so they outrank
   `.main h2`. */
.welcome {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  justify-content: center;
  gap: 96px;
  width: 100%;
  max-width: 1180px;
}
.welcome > .login-card { flex: 0 0 380px; }

.welcome-pitch {
  flex: 1 1 0;
  min-width: 0;
  max-width: 660px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}
.welcome-pitch p { margin-bottom: 10px; }

.welcome-apps, .welcome-uses, .welcome-never { list-style: none; }

.welcome-title {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 1.9em;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.welcome-lead { font-size: 1.05em; }

.welcome-apps { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.welcome-apps li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.88em;
}
.welcome-apps .icon { color: var(--accent); }

.welcome-e2e {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--accent-bg);
  color: var(--text);
}
.welcome-e2e .icon { margin-top: 0.3em; color: var(--accent); }

.welcome-pitch .welcome-h {
  margin: 18px 0 8px;
  color: var(--text-dim);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.welcome-uses { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.welcome-uses li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  font-size: 0.92em;
  line-height: 1.45;
}
.welcome-use-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 17px;
}

.welcome-hub {
  margin-top: 18px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  font-size: 0.92em;
}
.welcome-pitch .welcome-hub .welcome-h { margin-top: 0; }
.welcome-pitch .welcome-hub-never { margin-bottom: 6px; color: var(--text); font-weight: 600; }
.welcome-never { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.welcome-never li { display: flex; align-items: flex-start; gap: 8px; }
.welcome-never .icon { margin-top: 0.3em; color: var(--success); }
.welcome-pitch .welcome-hub-free {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}

.welcome-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 14px;
}
.welcome-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.95em;
  font-weight: 600;
}
.welcome-cta:hover { background: var(--accent-hover); text-decoration: none; }
.welcome-legal { color: var(--text-secondary); font-size: 0.9em; }
.welcome-legal:hover { color: var(--accent); }

@media (max-width: 1000px) {
  .welcome { flex-direction: column; align-items: center; gap: 36px; }
  .welcome > .login-card { flex: none; }
  .welcome-pitch { flex: none; width: 100%; max-width: 520px; }
}
@media (max-width: 520px) {
  .welcome-title { font-size: 1.6em; }
  .welcome-uses { grid-template-columns: 1fr; }
}

/* ── Form elements ────────────────────────────────────────────────────────── */

input[type="text"],
input[type="password"],
input[type="email"] {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.95em;
  width: 100%;
  transition: border-color 0.15s;
}
input:focus { outline: none; border-color: var(--border-focus); }

button {
  padding: 10px 20px;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 6px;
  font-size: 0.95em;
  cursor: pointer;
  transition: background 0.15s;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */

.error-msg {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85em;
}

/* The middle state: the hub is still sending what somebody is waiting on,
   but not what a newcomer needs. `--warn` already exists in both themes. */
.warn-msg {
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85em;
}

.success-msg {
  background: #16a34a20;
  color: var(--success);
  border: 1px solid var(--success);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85em;
}

.settings-hint {
  font-size: 0.85em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* ── Group cards (9.7 prep) ───────────────────────────────────────────────── */

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.group-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.group-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.group-card h3 { font-size: 1em; margin-bottom: 4px; }

.badge {
  display: inline-block;
  background: var(--bg-raised);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75em;
}
.badge-ok { background: #16a34a20; color: var(--success); }
.badge-err { background: var(--error-bg); color: var(--error); }

/* ── Group page header ───────────────────────────────────────────────────── */

.group-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.group-header h2 { margin-bottom: 0; }

/* ── Group tabs ──────────────────────────────────────────────────────────── */

.group-tabs {
  display: flex;
  gap: 0;
  /* A pinned band keeps this gap: `--band-margin` is both the margin in
     the flow and the width of the opaque ring the band paints around
     itself once pinned, so the two can never disagree (style.css,
     "Sticky chrome"). */
  --band-margin: 16px;
  margin-bottom: var(--band-margin);
  border-bottom: 2px solid var(--border);
}

.group-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 18px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 0;
  transition: color 0.12s, border-color 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.group-tab:hover { color: var(--text); background: none; }
.group-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-icon { width: 22px; height: 22px; }

.group-mute-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  margin-left: auto;
}
.group-mute-btn:hover { color: var(--text); }
.group-mute-btn .icon { width: 20px; height: 20px; }

/* ── Chat panel ──────────────────────────────────────────────────────────── */

.chat-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  /* Overwritten from JS with the space actually left below the group header,
     which varies with the description and the buttons. These two are the value
     used for the first paint and the fallback if that never runs. `dvh` rather
     than `vh` so a phone's collapsing URL bar does not add a scrollbar. */
  height: calc(100dvh - 260px);
  min-height: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-empty {
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  padding: 40px 16px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 75%;
}

.chat-msg-own {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-sender {
  font-size: 0.72em;
  color: var(--text-dim);
  margin-bottom: 2px;
  padding-left: 10px;
  font-weight: 600;
}

.chat-bubble {
  background: var(--bg-raised);
  padding: 8px 12px;
  border-radius: 12px 12px 12px 4px;
  font-size: 0.9em;
  line-height: 1.45;
  word-break: break-word;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-bubble-own {
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 12px 12px 4px 12px;
}

.chat-text { white-space: pre-wrap; }

/* Link unfurl card. Sits on its own line inside the bubble and carries its
   own surface colours so it stays readable inside an own-message bubble too. */
.chat-link-preview {
  flex: 0 0 100%;
  display: flex;
  gap: 10px;
  margin-top: 4px;
  padding: 8px;
  max-width: 380px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-base);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
}
.chat-link-preview:hover { background: var(--bg-surface); }
.clp-img {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-surface);
}
.clp-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.clp-site {
  font-size: 0.7em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.clp-title {
  font-weight: 600;
  font-size: 0.9em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clp-desc {
  font-size: 0.82em;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-time {
  font-size: 0.65em;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.chat-bubble-own .chat-time { color: rgba(255, 255, 255, 0.6); }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}

.chat-input {
  flex: 1;
  resize: none;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.9em;
  font-family: inherit;
  line-height: 1.4;
  min-height: 38px;
  max-height: 100px;
}
.chat-input:focus { outline: none; border-color: var(--border-focus); }

.chat-send {
  align-self: flex-end;
  padding: 8px 16px;
  font-size: 0.85em;
  border-radius: 8px;
  white-space: nowrap;
}

/* ── File toolbar ────────────────────────────────────────────────────────── */

/* One bar, three groups: what you can add on the left, where you are in the
   middle, what you can do with what is here on the right. It used to be four
   controls of three different heights sitting in a row. */
.file-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  /* A pinned band keeps this gap: `--band-margin` is both the margin in
     the flow and the width of the opaque ring the band paints around
     itself once pinned, so the two can never disagree (style.css,
     "Sticky chrome"). */
  --band-margin: 12px;
  margin-bottom: var(--band-margin);
  padding: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-wrap: wrap;
}
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.toolbar-group.right { margin-left: auto; }

.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;               /* the icon and the word are not the same word */
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.83em;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.tb-btn:hover { border-color: var(--accent); color: var(--accent); }
.tb-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tb-btn:disabled:hover { border-color: var(--border); color: var(--text); }
.tb-btn .icon { width: 15px; height: 15px; }
/* Square, for a toolbar button whose name is in its tooltip rather than
   beside it. The horizontal padding goes; the height does not, so it lines up
   with the labelled buttons next to it. */
.tb-btn-icon { padding: 0; width: 32px; justify-content: center; gap: 0; }

/* Naming a new folder, in the toolbar. Not `window.prompt`, which throws in
   Electron — and an inline field can put the node's refusal next to the input
   rather than after a dialog has closed. */
.tb-mkdir { display: inline-flex; align-items: center; gap: 6px; }
.tb-mkdir-input {
  height: 32px; width: 170px; padding: 0 9px;
  border: 1px solid var(--border-focus); border-radius: 6px;
  background: var(--bg-surface); color: var(--text);
  font-family: inherit; font-size: 0.83em;
}
.tb-mkdir-input:focus { outline: none; }
.tb-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.tb-btn.primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.tb-btn.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
  border-color: var(--accent);
  color: var(--accent);
}

/* The filter is a field, not a button, and should not pretend otherwise. */
.tb-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-dim);
  /* A flex item defaults to min-width:auto and refuses to shrink below its
     content — which is how a 150px field pushed the toolbar off a phone. */
  min-width: 0;
}
.tb-search:focus-within { border-color: var(--border-focus); }
.tb-search .icon { width: 14px; height: 14px; flex-shrink: 0; }
.tb-search input {
  border: none;
  background: none;
  outline: none;
  padding: 0;
  width: 150px;
  min-width: 0;
  font-size: 0.83em;
  color: var(--text);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 0.85em;
  min-width: 0;
  flex-wrap: wrap;
}
.crumb {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--accent);
  padding: 2px 4px;
  border-radius: 4px;
}
.crumb:hover { background: var(--bg-raised); text-decoration: none; }
.crumb-sep { color: var(--text-dim); }
.crumb-refresh {
  background: none;
  border: 0;
  font: inherit;
  color: var(--text-secondary);
}
.crumb-refresh:hover:not(:disabled) { color: var(--text); }
.crumb-refresh:disabled { cursor: default; }
.crumb-refresh.spinning .icon { animation: spin 0.8s linear infinite; }


/* ── File table ──────────────────────────────────────────────────────────── */

.file-table {
  width: 100%;
  /* Separated, with no spacing, rather than collapsed. A collapsed border is
     shared between two cells and so belongs to the table rather than to either
     of them — it stays where the table's flow put it while a `position:
     sticky` column head moves away, so the head loses its rule the moment it
     pins. Only the bottom edge of any cell here carries a border, so nothing
     was being shared and the drawn result is the same single line; it now
     travels with the head. */
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9em;
}

.file-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
}

.file-table th.sortable { cursor: pointer; }
.file-table th.sortable:hover { color: var(--text); }

.file-row td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.file-row:hover { background: var(--bg-raised); }
.dir-row { cursor: pointer; }
.dir-row td { font-weight: 500; }

/* Every cell whose text is a name somebody else chose.
   
   A table column is never narrower than its widest cell's minimum, and a name
   with no spaces in it — `Rage_Against_The_Machine_Discography_1992-2000_FLAC`,
   `musique_de_la_maison_2024` — is one unbreakable word. Left to itself such a
   cell sets the column's minimum to the whole string and the table grows past
   the window: measured on a phone at 390px, a 527px table from a folder name
   and a 442px one from a group name. That is not merely ugly. **On Android a
   document wider than the screen takes everything `position: sticky` out of
   the visible area with it** — the navigation bar included — so the reported
   symptom was "the header does not stay", and the cause was a table column.

   Both cells used to be bare `<td>`s: `.file-name` was on a file's name and on
   nothing else, so a *folder* row and the Search page's group column had no
   wrapping rule at all. `test_sticky_header.py::test_no_view_scrolls_sideways`
   measures the page against its window in both engines and at three widths. */
.file-name,
.td-group {
  word-break: break-word;
  min-width: 0;
}
/* The column heads are `white-space: nowrap` like every other one; the group
   head is two syllables and never needed the exception. */
.file-table th.td-group { white-space: normal; }
/* Where a search result lives, under its name; click to open that folder
   and clear the filter. */
.file-loc {
  display: block;
  margin-top: 2px;
  font-size: 0.78em;
  color: var(--text-dim);
  cursor: pointer;
}
.file-loc:hover { color: var(--accent); text-decoration: underline; }
.file-size { white-space: nowrap; color: var(--text-secondary); }
.file-type { color: var(--text-dim); }
.file-date { white-space: nowrap; color: var(--text-dim); }
.file-empty {
  text-align: center;
  padding: 24px 12px !important;
  color: var(--text-dim);
  font-style: italic;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── File action menu ───────────────────────────────────────────────────── */

.file-actions-cell {
  position: relative;
  width: 40px;
}

.file-menu-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 1.1em;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}
.file-menu-btn:hover { background: var(--bg-raised); border-color: var(--accent); color: var(--accent); }

.file-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 30;
  min-width: 130px;
  padding: 4px 0;
  overflow: hidden;
}
.file-menu button {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.85em;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}
.file-menu button:hover { background: var(--bg-raised); }

/* ── File link (clickable name) ─────────────────────────────────────────── */

.file-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.file-link:hover { text-decoration: underline; }

/* ── File preview overlay ───────────────────────────────────────────────── */

.preview-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: calc(100vh - 100px);
  padding: 40px 20px 20px;
}

.preview-image {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 4px;
}

.preview-text-wrap {
  width: min(90vw, 900px);
  max-height: calc(100vh - 100px);
  overflow: auto;
  padding: 60px 20px 20px;
}

.preview-text {
  background: var(--bg-surface);
  color: var(--text);
  padding: 20px;
  border-radius: 8px;
  font-size: 0.85em;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  margin: 0;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  tab-size: 4;
}

/* ── Chat attachment ────────────────────────────────────────────────────── */

.chat-attach {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 1.2em;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.chat-attach:hover { background: var(--bg-raised); color: var(--accent); }

.chat-attachment {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-att-img, .chat-att-file {
  font-weight: 500;
  font-size: 0.88em;
}
.chat-att-thumb {
  max-width: 200px;
  max-height: 200px;
  border-radius: 6px;
  object-fit: contain;
  display: block;
  cursor: pointer;
}
.chat-att-size {
  font-size: 0.75em;
  color: var(--text-dim);
}
.chat-bubble-own .chat-att-size { color: rgba(255, 255, 255, 0.6); }

.file-menu button { display: flex; align-items: center; gap: 8px; }
.file-menu button.danger { color: var(--error); }
.file-menu button.danger:hover { background: var(--error-bg); }
.fmi { font-size: 0.9em; width: 16px; text-align: center; flex-shrink: 0; }

/* ── Download button + progress ──────────────────────────────────────────── */

.dl-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 0.9em;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.dl-btn:hover { background: var(--bg-raised); border-color: var(--accent); }
.dl-btn:disabled { opacity: 0.3; cursor: not-allowed; }



.dl-progress {
  flex: 1;
  height: 6px;
  background: var(--bg-raised);
  border-radius: 3px;
  overflow: hidden;
}

.dl-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s;
}


/* ── Settings page ───────────────────────────────────────────────────────── */

.settings-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.settings-heading {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.settings-row + .settings-row {
  border-top: 1px solid var(--border);
}

.settings-label {
  font-size: 0.9em;
  color: var(--text);
}
.settings-label input[type="number"] {
  display: block;
  width: 90px;
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.95em;
}
/* A number that sits beside its label rather than under it — the mail bounds
   are a column of short values, and one input per line reads as a table. */
.settings-number {
  width: 110px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.95em;
  text-align: right;
}
.settings-number:disabled {
  opacity: 0.6;
}

.settings-label input[type="password"],
.settings-label input[type="text"],
.settings-label select {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.95em;
}

.settings-value {
  font-size: 0.9em;
  color: var(--text-secondary);
}

/* Collapsible settings sections (2026-08-24) — every section but a form
   someone might be mid-typing into (invite, pair-operator, approve-device,
   left as plain .settings-section blocks). Reuses .video-flat-chevron for
   the rotate-on-open animation rather than declaring a near-duplicate. */
.settings-collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}
.settings-collapsible-header .settings-heading { margin-bottom: 0; }
.settings-collapsible-body { margin-top: 12px; }
/* The header button stretches; the action (an app's on/off switch) keeps its
   own width at the end, and its own click. */
.settings-collapsible-bar { display: flex; align-items: center; gap: 12px; }
.settings-collapsible-bar .settings-collapsible-header { flex: 1 1 auto; min-width: 0; }
.settings-collapsible-action { flex: 0 0 auto; }

/* One app's settings pane, inside its section. */
.app-settings > .settings-row:first-child { margin-top: 0; }
/* The Save button of an app's settings pane.
 *
 * It was `btn btn-small btn-secondary`, and there is no `.btn` rule at all —
 * so it inherited `.btn-secondary`: no background, a transparent border, dim
 * grey text. Enabled, it already looked like a disabled control; disabled, it
 * was the same thing at 40% opacity. "You cannot always click Save, you do not
 * notice, and it does not work" was one sentence describing all of that.
 *
 * It looks like a button now, and a disabled one looks disabled. */
.app-save {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; margin-top: 4px;
  border: 1px solid var(--accent); border-radius: 6px;
  background: var(--accent); color: var(--accent-text);
  font-family: inherit; font-size: 0.83em; cursor: pointer;
}
.app-save:hover:not(:disabled) { background: var(--accent-hover); }
/* No transition on the enabled/disabled swap. It animates a colour change that
   coincides with a text-colour change, which reads as a flicker — and it made
   the state genuinely hard to observe: a measurement taken during it reports a
   transparent background on a button that is not transparent. */
.app-save:disabled {
  background: none; color: var(--text-dim);
  border-color: var(--border); opacity: 1; cursor: default;
}
/* Why it is inert, beside it — a disabled control that explains itself is the
   difference between "nothing changed" and "this is broken". */

.app-settings-sub {
  margin: 18px 0 4px; font-size: 0.9em; font-weight: 600;
  padding-top: 12px; border-top: 1px solid var(--border);
}

.settings-meta-title {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
  font-size: 1.1em;
  color: var(--text);
}
.settings-meta-title .icon { width: 16px; height: 16px; }
.settings-meta-badge {
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text-dim);
}
.settings-meta-badge.on { background: var(--accent); color: #fff; }

/* A modern on/off switch — replaces a checkbox or a "Turn on/off" button
   wherever the setting is a straight binary. */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9em;
  color: var(--text);
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch-track {
  position: relative;
  width: 38px;
  height: 21px;
  border-radius: 11px;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
}
.toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s;
}
.toggle-switch input:checked + .toggle-switch-track { background: var(--accent); }
.toggle-switch input:checked + .toggle-switch-track .toggle-switch-thumb {
  transform: translateX(17px);
}
.toggle-switch input:focus-visible + .toggle-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-switch-disabled { opacity: 0.5; cursor: default; }

/* A sub-block within a merged settings section (Directories: shared roots,
   Videos root, Music root, all under one CollapsibleSection). */
.settings-root-row { padding: 10px 0; }
.settings-root-row + .settings-root-row { border-top: 1px solid var(--border); }
.settings-root-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.settings-root-row-title .icon { width: 15px; height: 15px; color: var(--text-dim); }
.settings-root-row-title h4 {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* Photos app's root add/remove list (docs/photos.md §2.2) — a set, unlike
   the Videos/Music single-value picker above. */
.settings-root-list { list-style: none; margin: 4px 0 8px; padding: 0; }
.settings-root-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.88em;
}
.settings-root-list-item .link-btn { padding: 2px; }
.settings-root-list-item .icon { width: 14px; height: 14px; }

.settings-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.9em;
  cursor: pointer;
  min-width: 180px;
}
.settings-select:focus { outline: none; border-color: var(--border-focus); }

/* ── Video player overlay ─────────────────────────────────────────────────── */

.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.video-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 20px;
  z-index: 210;
}

.video-title {
  color: #e2e8f0;
  font-size: 0.9em;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.video-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #e2e8f0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.video-close:hover { background: rgba(255, 255, 255, 0.25); }
.video-close.dl-active { background: rgba(34, 197, 94, 0.25); pointer-events: none; }
.video-close.cast-active { background: rgba(59, 130, 246, 0.35); }
.video-close.cast-active:hover { background: rgba(59, 130, 246, 0.5); }
.cast-url-input {
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px; color: #e2e8f0; font-size: 0.75em; font-family: inherit;
  padding: 4px 8px; min-width: 0; flex: 1; max-width: 420px;
  cursor: text; outline: none;
}
.cast-url-input:focus { border-color: rgba(59, 130, 246, 0.6); }
.cast-wrapper { display: inline-block; }
.cast-picker {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 100;
  background: rgba(28, 28, 32, 0.97); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px; padding: 4px 0; min-width: 230px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.cast-picker-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 14px; background: none; border: none;
  color: #e2e8f0; font-size: 0.82em; cursor: pointer; text-align: left;
  font-family: inherit;
}
.cast-picker-item:hover { background: rgba(255, 255, 255, 0.09); }
.cast-picker-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.cast-picker-scanning { color: #94a3b8; cursor: default; }
.cast-picker-scanning:hover { background: none; }
.cast-picker-empty { color: #64748b; cursor: default; font-style: italic; }
.cast-picker-empty:hover { background: none; }
.cast-picker-sep { height: 1px; margin: 4px 10px; background: rgba(255,255,255,0.1); }
.cast-status-label {
  color: #94a3b8; font-size: 0.78em; display: flex; align-items: center;
  max-width: 420px; overflow: hidden; white-space: nowrap;
}

.video-container {
  width: 100%;
  max-width: min(90vw, 1280px);
  max-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-container video {
  width: 100%;
  max-height: calc(100vh - 120px);
  border-radius: 4px;
  outline: none;
}

/* Where the film was picked up again. Sits over the picture rather than
   pushing it down, and clears itself once the viewer is watching. */
.video-container { position: relative; }

.video-resumed {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  font-size: 0.85rem;
  pointer-events: auto;
  animation: video-resumed-fade 6s forwards;
}

@keyframes video-resumed-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

.video-resumed .linklike {
  background: none;
  border: 0;
  padding: 0;
  color: #7dd3fc;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.video-loading-label {
  font-size: 0.95em;
}

.video-progress-bar {
  width: min(400px, 80vw);
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.video-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.15s;
}

.video-progress-text {
  font-size: 0.8em;
  color: #64748b;
}

.video-error {
  color: var(--error);
  font-size: 0.9em;
  text-align: center;
  max-width: 400px;
}


.play-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--success);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 0.85em;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 4px;
}
.play-btn:hover { background: var(--bg-raised); border-color: var(--success); }
.play-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Admin panel ─────────────────────────────────────────────────────────── */

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
}

.admin-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.9em;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-card .stat-label {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-top: 4px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.admin-search {
  flex: 1;
  min-width: 180px;
  max-width: 300px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.9em;
}
.admin-search:focus { outline: none; border-color: var(--border-focus); }

.admin-select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.85em;
  cursor: pointer;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
}
.admin-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:hover { background: var(--bg-raised); }
.admin-table .admin-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-dim);
  font-style: italic;
}

/* Two things this cell has to do: hold a row of buttons, and stay as tall as
   the rest of its row even when it is empty — the group owner cannot be
   removed, and neither can your own account in the admin table.

   `display: flex` did the second one and broke the first. **A flex <td> stops
   being a table cell**: it no longer stretches to the height of its row, so
   its bottom border is drawn wherever its own content ends. Measured, in a row
   whose other cells were `top 76, height 40`, the actions cell came out
   `top 77, height 30` — its rule nine pixels above the rest, which is the
   staggered lines across the members table.

   So the cell goes back to being a table cell, and an empty one is held open
   by a zero-width strut the height of a button. Reported as "un décalage sur
   les lignes du tableau listant les membres". */
.admin-actions {
  white-space: nowrap;
}
.admin-actions::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 30px;
  vertical-align: middle;
}
.admin-actions > * { vertical-align: middle; }
.admin-actions > * + * { margin-left: 6px; }

/* ── Group settings sections ──────────────────────────────────────────────
   The group tab was three forms and a table, each laid out with inline styles
   on the element that needed it, which is why no two of them lined up. These
   are the pieces they all wanted. */

/* An input and its button. Wraps rather than overflowing on a phone, and the
   input takes the slack so the button keeps its size. */
.form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.form-row input {
  flex: 1;
  min-width: 160px;
}

/* A pairing or invitation code: typed one character at a time, off a screen or
   a piece of paper, so it is spaced and unambiguous. */
.code-input,
.code-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.code-display {
  font-size: 1.4em;
  letter-spacing: 2px;
  margin: 6px 0;
}

.settings-subform {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.device-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.device-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.device-row:last-child { border-bottom: none; }
.device-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}
.device-meta {
  color: var(--text-secondary);
  font-size: 0.85em;
  flex: 1;
  min-width: 0;
}

.badge-owner {
  background: var(--accent);
  color: var(--accent-text);
}

.admin-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.82em;
  cursor: pointer;
  white-space: nowrap;
}
.admin-btn:hover { border-color: var(--accent); color: var(--accent); }
.admin-btn.danger { color: var(--error); }
.admin-btn.danger:hover { border-color: var(--error); }
.admin-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Used in four places and never defined, so it rendered as a bare browser
   button next to styled ones. Same shape as .admin-btn, quieter. */
.btn-secondary {
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: none;
  color: var(--text-secondary);
  font-size: 0.82em;
  cursor: pointer;
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--border); color: var(--text); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* Text that acts as a button: the "add a description" affordance should not
   compete with the group's name for attention. */
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 0.8em;
  cursor: pointer;
}
.link-btn:hover { color: var(--accent); }

/* The header is a flex row, so a textarea in it collapses to its content
   width unless told otherwise. */
.group-desc-edit { margin: 4px 0 6px; width: min(460px, 60vw); min-width: 260px; }
.group-desc-edit textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85em;
  resize: vertical;
}
.group-desc-edit textarea:focus { outline: none; border-color: var(--border-focus); }
.group-desc-edit div { display: flex; gap: 6px; margin-top: 4px; }

.settings-choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  cursor: pointer;
}
.settings-choice input { margin-top: 3px; flex-shrink: 0; }
.settings-choice strong { display: block; font-size: 0.88em; color: var(--text); }
.settings-choice .settings-hint { display: block; margin-top: 2px; }

/* A pasted address can be longer than the bubble; breaking it is better than
   a message that scrolls sideways. */
.chat-link {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}
.chat-bubble-own .chat-link { color: inherit; }

/* ── Transfers widget ────────────────────────────────────────────────────── */

/* Green while transfers are running: the count in the badge says how many, but
   the colour is what is readable without looking at it. Back to the ordinary
   nav colour the moment the last one finishes. */
@keyframes pulse-green {
  0%, 100% { color: #86efac; }
  50% { color: #15803d; }
}
.transfer-btn.active .icon { animation: pulse-green 2s ease-in-out infinite; }

.transfer-wrap { position: relative; display: flex; align-items: center; }
.transfer-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.transfer-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  width: 330px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  padding: 6px;
}
.transfer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.85em;
  color: var(--text);
  padding: 4px 6px 6px;
  border-bottom: 1px solid var(--border);
}
.transfer-item { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.transfer-item:last-child { border-bottom: none; }
.transfer-line { display: flex; align-items: center; gap: 6px; }
.transfer-kind { color: var(--text-dim); display: flex; }
.transfer-name {
  flex: 1;
  font-size: 0.82em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.transfer-name {
  /* `--link` is not defined here; the palette's link colour is `--accent`. */
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.transfer-cancel {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 2px;
  display: flex;
}
.transfer-cancel:hover { color: var(--error); }
/* Same shape as cancel, and beside it: pausing and cancelling are the two
   things a person does to a transfer, and one of them is not destructive. */
.transfer-pause {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 2px;
  display: flex;
}
.transfer-pause:hover { color: var(--accent); }
/* Not a button: there is nothing to click. Dimmer than the cancel beside it,
   and it carries its explanation in a tooltip rather than in the row, which
   would be four lines of prose in a panel that has none. */
.transfer-nopause {
  color: var(--text-dim);
  opacity: .45;
  padding: 0 2px;
  display: flex;
  cursor: help;
}
/* A paused bar keeps its fill -- what was written is still on disk -- but stops
   looking like something in progress. */
.dl-fill.dl-paused { background: var(--text-dim); }
.transfer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72em;
  color: var(--text-dim);
  margin-top: 3px;
}
.transfer-failed { color: var(--error); }

/* ── File selection ──────────────────────────────────────────────────────── */

.sel-cell { width: 28px; text-align: center; }
.sel-cell input { cursor: pointer; }
.actions-wrap { position: relative; display: inline-flex; margin-left: 8px; }
/* Anchored to the right edge: the button sits at the end of the toolbar, so a
   menu opening leftwards is a menu half off the screen. */
.actions-wrap .file-menu { top: calc(100% + 4px); right: 0; left: auto; }
.actions-wrap .file-menu button { white-space: nowrap; }
.admin-btn.active { border-color: var(--accent); color: var(--accent); }

.admin-role-select {
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.85em;
  cursor: pointer;
}

.admin-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  min-width: 340px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}

.admin-detail-card h3 {
  margin-bottom: 16px;
  font-size: 1.1em;
}

.admin-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9em;
}
.admin-detail-row + .admin-detail-row {
  border-top: 1px solid var(--border);
}
.admin-detail-label { color: var(--text-secondary); }
.admin-detail-value { font-weight: 500; }

.admin-load-more {
  display: block;
  margin: 16px auto;
  padding: 8px 24px;
}

.blocklist-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.blocklist-form input {
  flex: 1;
  min-width: 180px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.9em;
}
.blocklist-form input:focus { outline: none; border-color: var(--border-focus); }

/* ── Overlay (mobile sidebar backdrop) ────────────────────────────────────── */

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 52px;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
}
.overlay.visible { display: block; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  /* No tray to minimise into on a narrow layout, and the nav has the
     hamburger to fit here. The capability already keeps this out of any
     browser; this is the app's own window dragged narrow. */
  .nav-tray { display: none; }

  .sidebar {
    position: fixed;
    left: -240px;
    top: 52px;
    height: calc(100vh - 52px - var(--music-bar-h) - var(--index-dock-h));
    height: calc(100dvh - 52px - var(--music-bar-h) - var(--index-dock-h));
    z-index: 50;
    transition: left 0.2s;
    box-shadow: none;
  }
  .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }

  .main { padding: 16px; }
  .page-center { padding: 16px; }
  .th-type, .td-type { display: none; }
  .th-date, .td-date { display: none; }
  /* And the group column, on the same grounds as those two: there is no room
     for it, and the name column is what a phone is short of. Nothing is lost
     with it. Search's Files view re-roots every result under a folder named
     after its group, so you are always inside exactly one group and the
     breadcrumb above the table already says which — the column repeated it on
     every row. */
  .td-group { display: none; }

  /* The toolbar's three groups each take a line rather than competing for one.
     `margin-left: auto` on the right-hand group is what pushed it off the
     screen once it no longer fitted. */
  .toolbar-group,
  .toolbar-group.right { width: 100%; margin-left: 0; }
  .tb-search { flex: 1 1 120px; }
  .tb-search input { width: 100%; }
  /* The actions sit on their own line under the toggle, and wrap within it. */
  .tb-actions { width: 100%; }

  /* video-app.js's toolbar isn't built from .toolbar-group (nothing else in
     it needs a right-hand group), so it never got the row-per-group
     treatment above — mode buttons + the All/Movies/Series control left no
     room at all for the filter field once both were on the same line. */
  .video-toolbar { flex-wrap: wrap; }
  .video-toolbar .tb-search { flex-basis: 100%; margin-left: 0; }

  /* ── Shared directories: not a table on a phone ────────────────────────
     Four columns — name, Writable, Removable, and the eject/remove pair —
     have a combined minimum of about 440px, and none of it is padding that
     can be squeezed: the two switches are 90px apiece by design and the
     buttons are touch targets. On a 390px screen that is ~100px hanging off
     the right, with the two buttons the first thing to go over the edge.
     Reported from a phone, with short directory names, so no amount of
     wrapping the *name* would have helped.

     So the row stops being a row. The head goes (each switch carries its own
     label instead, see `.sdt-col-toggle .toggle-switch-label`), the name
     takes a line of its own, and the two switches sit under it with the
     actions pushed to the right margin:

         📁 Musique
         [•] Writable   [•] Removable        ⏏  ✕

     Everything that was on screen is still on screen, and nothing is
     truncated. The rules are scoped to `.shared-directories-table` on
     purpose: `folder-tree.js` borrows `.shared-dirs-tbl` for a two-column
     list — a name and one button — which fits a phone as it is, and stacking
     it would only make it taller. */
  .shared-directories-table .shared-dirs-tbl,
  .shared-directories-table .shared-dirs-tbl tbody,
  .shared-directories-table .shared-dirs-tbl tr,
  .shared-directories-table .shared-dirs-tbl td { display: block; }
  .shared-directories-table .shared-dirs-tbl thead { display: none; }

  /* Two rows, not three. Left to wrap, the eject/remove pair ends up alone on
     a line of its own under the switches — legible, but a third of the height
     for two buttons, and they read as belonging to nothing. A grid puts them
     back beside the name they act on, which is where they were:

       ┌──────────────────────────┬────────┐
       │ 📁 Musique               │  ⏏  ✕  │
       ├──────────────────────────┴────────┤
       │ [•] Writable   [•] Removable      │
       └───────────────────────────────────┘

     The switches are not placed: they fall into the second row on their own,
     so a group with one switch (the create-group page has no Removable) or
     none needs no rule of its own. */
  .shared-directories-table .shared-dirs-tbl tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 16px;
    padding: 10px 0;
  }
  .shared-directories-table .shared-dirs-tbl td { padding: 0; }
  /* The separator moves to the row: with the cells turned into blocks, a
     border on each of them draws four lines instead of one. */
  .shared-directories-table .shared-dirs-tbl tbody tr + tr td { border-top: none; }
  .shared-directories-table .shared-dirs-tbl tbody tr + tr {
    border-top: 1px solid var(--border);
  }

  .shared-directories-table .sdt-col-dir {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  /* No longer a single truncated line: it has the width of the row to itself
     and there is no column left to protect from it. */
  .shared-directories-table .sdt-col-path {
    grid-column: 1 / -1;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .shared-directories-table .sdt-col-toggle {
    width: auto;
    min-width: 0;
    text-align: left;
  }
  .shared-directories-table .sdt-col-toggle .toggle-switch {
    justify-content: flex-start;
    gap: 8px;
  }
  .shared-directories-table .sdt-col-toggle .toggle-switch-label { display: inline; }
  /* Beside the name, against the right margin, exactly where the wide layout
     puts them. */
  .shared-directories-table .sdt-col-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  /* Every pixel here is one the conversation does not get. */
  .group-header { margin-bottom: 10px; gap: 8px; }
  .group-tabs { --band-margin: 10px; }
  /* Six tabs at 18px of padding a side come to 380px, plus the main column's
     own 32px — wider than a 360px phone, and a page wider than the screen is
     what takes every pinned band out of the visible area on Android. They
     share the row instead of each claiming a fixed width, which also means a
     seventh application costs nothing: the icon is what identifies a tab, the
     padding around it never did. */
  .group-tab { flex: 1 1 0; min-width: 0; padding: 10px 0; }
  .chat-messages { padding: 12px; }

  /* The transfers panel stops hanging off its button.
     It is 330 px wide and anchored to the button's right edge, but that button
     is not at the right edge of the screen — the bell and the user menu come
     after it. So the panel extended past the left of the viewport: measured at
     138 px lost on a 320 px screen, 98 px at 360. What is cut is the left-hand
     side, which is where the file names are, so what remained was a strip of
     progress bars belonging to nothing.
     Anchoring to the viewport instead of to the button is the only thing that
     helps: capping the width does not, since the overflow comes from where the
     right edge is pinned. */
  .transfer-panel {
    position: fixed;
    top: 52px;
    right: 8px;
    /* Full width on a phone, and no wider than the desktop panel on a tablet,
       where stretching it across 768 px would be silly. Both edges are pinned
       to the viewport, so the width follows from the screen rather than from
       where the button happens to sit. */
    left: max(8px, calc(100vw - 428px));
    width: auto;
    max-height: calc(100vh - 68px);
  }
}

/* ── Minimise to tray ────────────────────────────────────────────────────── */

/* Monochrome on purpose: it sits next to the bell, and the bell's badge is the
   only thing in this corner allowed to pull the eye. Inherits --nav-text like
   every other nav control, so it follows the theme rather than carrying its own
   colour, and the glyph is a stroked `currentColor` icon with nothing to tint. */
.nav-tray {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 4px;
  margin-right: 2px;
  color: var(--nav-text);
  cursor: pointer;
  border-radius: 6px;
  opacity: 0.75;
}
.nav-tray:hover,
.nav-tray:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* ── Notification bell ───────────────────────────────────────────────────── */

.nav-notif {
  position: relative;
  /* --text is the page's text colour and the nav is dark: the emoji bell was
     coloured so it showed anyway, a stroked one would have been invisible. */
  color: var(--nav-text);
  text-decoration: none;
  font-size: 1.25rem;
  margin-right: 4px;
}
.notif-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  /* `--danger` is not one of this stylesheet's variables — the palette calls
     it `--error`. The declaration was invalid, so the unread-count badge had
     white text on no background at all. Pre-existing; found while fixing four
     more of the same in the folder picker. */
  background: var(--error);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 700;
}

/* ── Notification feed ───────────────────────────────────────────────────── */

.notif-feed {
  margin-bottom: 24px;
}
.notif-feed h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  /* `--radius` was never defined — 8px is what the other cards use. */
  border-radius: 8px;
  background: var(--bg-surface);
  margin-bottom: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
}
.notif-item:hover {
  background: var(--bg-raised);
}
.notif-unread {
  /* `--primary` is not defined here either; it is `--accent`. */
  border-left: 3px solid var(--accent);
  font-weight: 600;
}
.notif-kind {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  white-space: nowrap;
}
.notif-text {
  flex: 1;
  font-size: 0.9rem;
}
.notif-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── Create Group page ───────────────────────────────────────────────────── */




.form-field { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.82em;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}





.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.95em;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}
.form-textarea:focus { outline: none; border-color: var(--border-focus); }
.form-char-count { text-align: right; font-size: 0.75em; color: var(--text-dim); margin-top: 4px; }

.group-desc {
  font-size: 0.85em;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.group-card-desc {
  font-size: 0.8em;
  color: var(--text-dim);
  line-height: 1.3;
  margin: 4px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* PDF preview: fills the overlay, scrolls in its own viewer. */
.preview-pdf {
  width: min(1000px, 92vw);
  height: 82vh;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
}

/* Irreversible actions look like it. */
.btn-danger {
  background: var(--error);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
}
.btn-danger:hover { filter: brightness(1.1); }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

.notif-feed h3 { display: flex; align-items: center; justify-content: space-between; }
.notif-purge { font-size: 0.8em; padding: 4px 10px; }


/* ── Presence ──────────────────────────────────────────────────────────────
   Three states, and the third is deliberately not a colour: "unknown" must
   not read as a verdict. Colour alone never carries the meaning — each dot
   also has a title and an aria-label, since red and green are exactly the
   pair most colour-blind readers cannot separate. */

.presence {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.presence-online  { background: var(--success); }
.presence-offline { background: var(--error); }
.presence-unknown { background: transparent; border-color: var(--text-dim); }
/* The node is scanning this group's files right now (initial import, or a
   directory just added) — a state, not a verdict, so it pulses rather than
   sitting on a fixed color; green at rest, green again once scanning stops
   (driven by IndexProgress.scanning, guaranteed to turn back off — see
   daemon.py _progress_pusher and webrtc_server.py's handshake ack). */
.presence-indexing {
  background: var(--success);
  animation: presence-indexing-pulse 1.6s ease-in-out infinite;
}
@keyframes presence-indexing-pulse {
  0%, 100% { background: var(--success); }
  50%      { background: #f59e0b; }
}

.sidebar-item-name {
  overflow: hidden;
  min-width: 0;
}

/* Group name + its @owner handle, on one line. Names are unique only per owner
   account, so the handle is what tells two "photos" groups apart. */
.gn { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.gn-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gn-owner {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8em;
  font-weight: 400;
  color: var(--text-dim);
  flex-shrink: 0;
}
h2 .gn-owner, h3 .gn-owner { font-size: 0.55em; }
/* A card's h3 is reset to 1em (unlike a page heading, which is much larger),
   so the 0.55em above would render the @host at about half the body size —
   smaller than the name, as intended, but past the point of being readable.
   0.8em is the same ratio the standalone .gn-owner uses. */
.group-card h3 .gn-owner { font-size: 0.8em; }

/* ── Chat: paging and orientation ─────────────────────────────────────────── */

.chat-older-row { display: flex; justify-content: center; padding: 4px 0 10px; }

.chat-older-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-secondary);
  font-size: 0.8em;
  cursor: pointer;
}
.chat-older-btn:hover:not(:disabled) { background: var(--bg-surface); color: var(--text); }
.chat-older-btn:disabled { opacity: 0.6; cursor: default; }
.chat-older-icon { width: 13px; height: 13px; transform: rotate(180deg); }

.chat-start {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75em;
  padding: 2px 0 12px;
}

/* A rule with the date sitting on it — cheaper to scan than a date on every
   bubble, which is why the per-message stamp stays as just a time. */
.chat-day, .chat-unread {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 6px;
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.chat-day::before, .chat-day::after,
.chat-unread::before, .chat-unread::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.chat-day { color: var(--text-dim); }
.chat-day span, .chat-unread span { white-space: nowrap; }
.chat-unread { color: var(--accent); }
.chat-unread::before, .chat-unread::after { background: var(--accent); opacity: 0.4; }

/* Consecutive messages from one person: tighten the gap instead of repeating
   the name, so a burst reads as one turn in the conversation. */
.chat-msg-tight { margin-top: -2px; }

.chat-jump {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 72px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8em;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}
.chat-jump:hover { color: var(--text); }
.chat-jump.unread {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.chat-jump-icon { width: 13px; height: 13px; }


/* ── File toolbar actions ─────────────────────────────────────────────────────
   These replaced a dropdown labelled "Actions (n)". With at most four verbs,
   hiding them behind a menu cost a click and a guess about what was inside. */

.tb-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.tb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.tb-icon-btn:hover:not(:disabled) {
  background: var(--bg-raised);
  color: var(--text);
  border-color: var(--accent);
}
/* Present but inert: the bar shows what exists here, and greys out what this
   selection cannot do. `not-allowed` rather than `default` so the reason is
   legible before the click. */
.tb-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.tb-icon-btn .icon { width: 16px; height: 16px; }
.tb-icon-btn.danger { color: var(--error); }
.tb-icon-btn.danger:hover:not(:disabled) {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}


/* ── Choice lists ─────────────────────────────────────────────────────────────
   Replaces two side-by-side <button> panels. They carried the selection in a
   border colour and nothing else: a button conveys no chosen/not-chosen state
   to a screen reader, and side by side they read as two independent actions
   rather than one either/or. A radio group says exactly one of these, is
   navigable with the arrow keys, and can be labelled. */

.choice-list { display: flex; flex-direction: column; gap: 8px; }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-base);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.choice:hover { border-color: var(--accent); }
.choice.selected { border-color: var(--accent); background: var(--bg-raised); }
.choice:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.choice input[type="radio"] {
  margin: 3px 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.choice-icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.choice.selected .choice-icon { color: var(--accent); }

.choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-title { font-size: 0.9em; font-weight: 600; color: var(--text); }
.choice-desc { font-size: 0.82em; color: var(--text-secondary); line-height: 1.4; }

.btn-primary {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* A root whose volume is absent. Its files stay listed — they are frozen, not
   deleted — so the row has to carry the difference. */
.root-offline {
  font-size: 0.85em;
  font-weight: 500;
  color: var(--warn, #d97706);
  margin-left: 6px;
}
.dir-row .root-offline { white-space: nowrap; }

/* ── Node management (D5) ────────────────────────────────────────────────── */

/* Deliberately no width of its own. It used to be `max-width: 700px`, which
   put the six-column audit table — timestamp, event, user, IP, group, detail —
   into a box narrower than the table, so it scrolled sideways inside the page
   while 260px of `.main` sat empty beside it. The Node page is a settings-
   shaped page and takes `.main`'s width like Settings, Profile and the
   create-group wizard. The class stays as the anchor for the test that says
   so. */

.node-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.node-group-stale {
  opacity: 0.65;
  border-color: var(--warn, #d97706);
}
.node-group-danger {
  border-color: var(--error, #dc2626);
}
.node-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.node-group-header h3 { font-size: 1.05em; margin: 0; }
.node-group-stats {
  display: flex;
  gap: 12px;
  font-size: 0.85em;
  color: var(--text-secondary);
}
.node-warn { color: var(--warn, #d97706); font-weight: 500; }

.node-roots-header { margin-bottom: 8px; }

/* Shared directories table */
.shared-dirs-tbl { width: 100%; border-collapse: collapse; border: none; }
.shared-dirs-tbl th {
  text-align: left; font-size: 0.78em; font-weight: 500;
  color: var(--text-dim); padding: 0 12px 6px 0;
  text-transform: uppercase; letter-spacing: 0.04em;
  border: none;
}
.shared-dirs-tbl td { padding: 7px 12px 7px 0; border: none; vertical-align: middle; }
.shared-dirs-tbl tbody tr + tr td { border-top: 1px solid var(--border); }
.sdt-col-dir { min-width: 140px; }
/* The path is the only thing separating two libraries whose folders happen to
   share a basename, so it is shown — truncated, because it is usually long and
   rarely the thing being read. */
.sdt-col-path {
  color: var(--text-dim); font-size: 0.85em;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.sdt-add-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.sdt-add-input {
  flex: 1 1 auto; min-width: 0; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-surface); color: var(--text);
  font-family: inherit; font-size: 0.9em;
}
.sdt-col-toggle { width: 90px; text-align: center; }
.sdt-col-toggle th { text-align: center; }
.sdt-col-toggle .toggle-switch { justify-content: center; }
/* The switch carries its own label for the phone layout below, where there is
   no column head to read it from. Wherever the head *is* there, it would be
   the same word twice on every row. */
.sdt-col-toggle .toggle-switch-label { display: none; }
.sdt-col-actions { white-space: nowrap; text-align: right; }
.sdt-action-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 7px; cursor: pointer; font-size: 0.85em; color: var(--text-dim);
  line-height: 1; vertical-align: middle;
}
.sdt-action-btn + .sdt-action-btn { margin-left: 6px; }
.sdt-action-btn:hover:not(:disabled) { background: var(--bg-raised); color: var(--text); }
.sdt-action-btn:disabled { opacity: 0.3; cursor: default; }
.sdt-action-danger:hover:not(:disabled) { color: var(--error); border-color: var(--error); }
.sdt-dir-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.sdt-dir-name .icon { width: 16px; height: 16px; flex-shrink: 0; }
.sdt-row-ejected { opacity: 0.5; }
.sdt-row-unavail { opacity: 0.6; }
.root-eject-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 6px; cursor: pointer; font-size: 0.85em; color: var(--text-dim);
  line-height: 1;
}
.root-eject-btn:hover { background: var(--bg-raised); }
.root-eject-btn { margin-left: 8px; }
/* An ejected root in the Files table: still listed, deliberately — its files
   are frozen, not gone — but not somewhere you can walk into. */
.file-row.root-ejected { opacity: 0.5; }
.file-row.root-ejected td:not(.sel-cell) { cursor: default; }

/* The paperclip with no writable directory to write to. Shown rather than
   hidden, so the reason is discoverable instead of the control just being
   absent. */
.chat-attach-off { opacity: 0.35; cursor: not-allowed; }

.node-root {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
}
.node-root + .node-root { border-top: 1px solid var(--border); }
.node-root-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.node-root-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.node-root-name .icon { width: 16px; height: 16px; flex-shrink: 0; }
.node-root-badge {
  font-size: 0.75em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-text);
}
.node-root-badge-warn {
  background: var(--warn, #d97706);
  color: #fff;
}
.node-root-kind {
  font-size: 0.8em;
  color: var(--text-dim);
}
.node-root-unavailable { opacity: 0.6; }

.node-message {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--bg-raised);
  border-radius: 6px;
}

.btn-small {
  padding: 4px 10px;
  font-size: 0.82em;
  border-radius: 5px;
}

.node-roots > .btn-small { margin-top: 8px; }

.node-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.node-header h2 { margin-bottom: 0; }

.node-service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-raised);
}
.node-service-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
}
.node-service-actions { display: flex; gap: 8px; }
.node-service .error-msg { flex-basis: 100%; margin: 0; }

.node-section { margin-top: 16px; }
.node-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.node-hint {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin: 4px 0;
}

.node-table {
  width: 100%;
  font-size: 0.85em;
  border-collapse: collapse;
  margin-top: 4px;
}
.node-table th {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
}
.node-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}
.node-table-scroll {
  overflow-x: auto;
  margin-top: 4px;
}
/* Audit rows: keep the fixed-shape columns on one line (the IP must never be
   clipped); only the free-text detail column wraps. */
.node-table-audit td,
.node-table-audit th { white-space: nowrap; }
.node-table-audit td:last-child,
.node-table-audit th:last-child {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 16ch;
  max-width: 48ch;
}
.node-audit-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.node-deny-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.85em;
}
.node-deny-entry + .node-deny-entry { border-top: 1px solid var(--border); }

.node-attach-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-width: 400px;
}
.node-attach-form label {
  font-size: 0.82em;
  color: var(--text-secondary);
  margin-top: 4px;
}
.node-attach-form input,
.node-attach-form select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.9em;
  cursor: pointer;
}
.node-attach-form select option {
  background: var(--bg-base);
  color: var(--text);
}
.node-attach-dir-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.node-attach-dir-row input { flex: 1; }

.node-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}
.node-setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: default;
}
.node-setting-label {
  font-size: 0.85em;
  color: var(--text-secondary);
}
.node-setting-value {
  font-size: 0.85em;
  font-weight: 500;
}
.node-setting-input {
  display: flex;
  align-items: center;
  gap: 6px;
}
.node-setting-input input[type="number"] {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-base);
  color: var(--text);
  font-size: 0.85em;
  text-align: right;
}
.node-setting-input input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.node-setting-unit {
  font-size: 0.8em;
  color: var(--text-secondary);
}
.node-settings-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* ── STUN server list ─────────────────────────────────────────────────────── */
.stun-server-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}
.stun-server-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.stun-server-url {
  font-family: monospace;
  font-size: 0.85em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stun-server-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.btn-icon {
  min-width: 28px;
  padding: 2px 6px;
  font-size: 0.75em;
  line-height: 1;
}
.stun-add-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.stun-add-row input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-base);
  color: var(--text);
  font-family: monospace;
  font-size: 0.85em;
}

/* ── Create Group Wizard ──────────────────────────────────────────────────── */

.wizard-root {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 8px;
}
.wizard-root + .wizard-root { margin-top: 6px; }
.wizard-root-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.wizard-root-name { font-weight: 500; }
.wizard-root-path {
  font-size: 0.82em;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wizard-root-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.wizard-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9em;
}
.wizard-step-icon {
  width: 20px;
  text-align: center;
  font-weight: 600;
}
.wizard-step-done .wizard-step-icon { color: var(--success); }
.wizard-step-running .wizard-step-icon { color: var(--accent); }
.wizard-step-error .wizard-step-icon { color: var(--error); }
.wizard-step-pending { opacity: 0.5; }

/* ── Indexing progress (Create Group wizard, and "add a directory" in
   Settings) — bytes-based, not file-count-based; see the two call sites of
   platform.watchIndexProgress. ── */
.index-progress {
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9em;
}
.index-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 8px;
}
.index-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}
.index-progress-label { font-weight: 600; }
.index-progress-dir {
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warning-msg {
  padding: 10px 14px;
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  font-size: 0.85em;
}

/* ── Videos app (video-app.js) ──────────────────────────────────────────────── */

.video-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  /* A pinned band keeps this gap: `--band-margin` is both the margin in
     the flow and the width of the opaque ring the band paints around
     itself once pinned, so the two can never disagree (style.css,
     "Sticky chrome"). */
  --band-margin: 14px;
  margin-bottom: var(--band-margin);
}
.video-toolbar .tb-search { margin-left: auto; }

/* The page arrows (pager.js): pushed to the right edge, just before the filter
   when there is one — on a phone the filter wraps onto its own line and the
   arrows stay with the controls. */
.video-toolbar .tb-pager { margin-left: auto; }
.video-toolbar .tb-pager + .tb-search { margin-left: 0; }
.tb-pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Dropping files onto Files (files-app.js). Fixed and click-through: the drag
   events belong to the window, and nothing pinned may move while it shows. */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  outline: 3px dashed var(--accent);
  outline-offset: -12px;
}
.drop-overlay.refused {
  background: color-mix(in srgb, var(--text-dim) 10%, transparent);
  outline-color: var(--border);
}
.drop-overlay-label {
  max-width: min(90vw, 480px);
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text);
  text-align: center;
  word-break: break-word;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.tb-pager-range {
  font-size: 0.83em;
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* All/Movies/Series — a segmented control, not three separate .tb-btn: the
   three are mutually exclusive (unlike the view-mode buttons, which read
   fine standalone), and grouping them under one shared border is what says
   so at a glance. */
.tb-typefilter {
  display: inline-flex;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.tb-typefilter button {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  border: none;
  background: var(--bg-surface);
  color: var(--text-dim);
  font-size: 0.83em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.tb-typefilter button + button { border-left: 1px solid var(--border); }
.tb-typefilter button:hover { color: var(--accent); }
.tb-typefilter button.active {
  background: var(--accent);
  color: var(--accent-text);
}

/* Mode A — poster grid */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.video-tile-slot {
  min-height: 260px;
}

.video-card {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  transition: border-color 0.12s, transform 0.12s;
}
.video-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.video-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  background: var(--bg-surface);
}

.video-poster-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-poster-slot { display: contents; }

.video-thumb {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  background: var(--bg-surface);
}
.video-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.video-thumb-empty .icon { width: 28px; height: 28px; }

.video-card-info { padding: 8px 10px; }
.video-card-title {
  font-size: 0.88em;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-card-sub {
  font-size: 0.78em;
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-card-group,
.music-card-group,
.photo-card-group {
  font-size: 0.72em;
  color: var(--accent);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-group-badge {
  margin-left: auto;
  flex-shrink: 0;
}

/* Detail modal — sits inside the existing .video-overlay */

.video-detail {
  width: min(720px, 92vw);
  max-height: calc(100vh - 100px);
  margin-top: 60px;
  background: var(--bg-surface);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* A multi-season show: one size, one position, every season.
   Everything above the episode list is already a fixed height (three lines of
   synopsis, two of cast), so the last thing that could move the season picker
   is the list itself — the body scrolled as a whole, and a season with twice
   the episodes pushed the modal to its max height. That moved the modal as
   well as its contents: `.video-overlay` centres its child, so the taller
   season *started higher up the screen*, title bar and all. A constant height
   settles both — centred, a box of constant height is centred in the same
   place — which is why this is a `height` and not a `max-height`. Scoped to multi-season shows on purpose: a movie or a
   single-season show has no season to switch to, and a fixed height would buy
   it nothing but empty space. Capped at 760px so a tall desktop window does
   not turn a six-episode season into a mostly empty column. */
.video-detail.video-detail-steady { height: min(calc(100vh - 100px), 760px); }
.video-detail.video-detail-steady .video-detail-body { overflow: hidden; }
.video-detail.video-detail-steady .video-season-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Reserved whether or not this particular season overflows: without it a
     scrolling season is a scrollbar narrower than a non-scrolling one, which
     re-wraps the file path above it and shifts everything below by a line —
     the same jump by a different route. */
  scrollbar-gutter: stable;
}
.video-detail .video-top-bar {
  position: static;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.video-detail .video-title { color: var(--text); }
.video-detail .video-close { background: var(--bg-surface); color: var(--text); }
.video-detail .video-close:hover { background: var(--border); }

.video-detail-body {
  padding: 16px 20px;
  overflow-y: auto;
  /* A column so the episode list can be given the leftover height and scroll
     inside it. Safe against the usual flex surprise — `* { margin: 0 }` at the
     top of this file means there are no collapsing margins here to lose. */
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* The synopsis, and why it is not a -webkit-line-clamp.
   Three lines, the third ending in "… Read more" rather than at the right
   margin: line-clamp only ever puts its ellipsis at the end of the last line,
   and cannot leave room for anything after it. A float can — .video-detail-
   overview.clamped::before is a zero-width float two lines tall, so the
   toggle floated after it (clear: right) lands on line three and shortens
   that line box alone. The toggle is written before the text in video-app.js
   for the same reason: a float only pushes the line boxes that follow it.
   `.reserved` pins the same three lines from below for a multi-season show,
   so the height is a constant and not a range: min and max are the same
   number on purpose. A season whose synopsis runs two lines and one whose
   synopsis runs twelve must put the season menu, and every episode under it,
   at exactly the same place — anything less and the thing just clicked is no
   longer under the pointer. Three lines is what makes that constant cheap:
   at five, a short synopsis sat over three blank lines.
   +2px absorbs the sub-pixel line height that otherwise clips the last
   line's descenders. */
.video-overview-wrap { --ov-lh: 1.5em; --ov-lines: 3; }
.video-detail-overview {
  font-size: 0.9em;
  color: var(--text);
  line-height: 1.5;
}
.video-detail-overview.clamped {
  overflow: hidden;
  max-height: calc(var(--ov-lh) * var(--ov-lines) + 2px);
}
/* The same number as the max-height above, deliberately: clamped from above
   and pinned from below is a constant, and a constant is the whole point. */
.video-detail-overview.clamped.reserved {
  min-height: calc(var(--ov-lh) * var(--ov-lines) + 2px);
}
/* Only when there is actually something to expand. `overflow: hidden` above
   makes this a block formatting context, so it *contains* the float and grows
   to its height — a one-line movie synopsis with the spacer always present
   would stand two lines tall for no reason. `.has-more` is set by the measure
   that decides to render the toggle at all. */
.video-detail-overview.clamped.has-more::before {
  content: '';
  float: right;
  width: 0;
  height: calc(var(--ov-lh) * (var(--ov-lines) - 1));
}
.video-overview-toggle {
  float: right;
  clear: right;
  padding: 0 0 0 6px;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}
.video-overview-toggle:hover { text-decoration: underline; }
.video-overview-toggle.standalone {
  float: none;
  display: inline-block;
  padding: 0;
  margin-top: 4px;
  font-size: 0.9em;
}
.video-detail-facts {
  font-size: 0.82em;
  color: var(--text-dim);
  margin-top: 6px;
}
/* Two lines, ellipsised at the end of the second. A ten-name cast and a
   three-name one must not give the modal two different heights — and unlike
   the synopsis there is nothing to expand to, so the plain line clamp is the
   right tool here. */
.video-detail-cast {
  font-size: 0.82em;
  color: var(--text-secondary);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.video-detail-source {
  font-size: 0.78em;
  color: var(--text-dim);
  margin-top: 6px;
  word-break: break-all;
}
.video-detail-tmdbref { white-space: nowrap; }
.video-detail-nomatch {
  font-size: 0.85em;
  color: var(--warn, #d98324);
  margin-bottom: 4px;
}
.video-card-unmatched { outline: 1px dashed var(--warn, #d98324); outline-offset: -1px; }
.video-admin-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.video-card-flag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 8px;
  font-size: 0.8em;
  font-weight: 700;
  color: var(--warn, #d98324);
  border: 1px solid var(--warn, #d98324);
  cursor: help;
}

.video-season-list { margin-top: 14px; }
.video-season { margin-bottom: 14px; }
.video-season-header {
  font-weight: 600;
  font-size: 0.85em;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.video-episode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85em;
  cursor: pointer;
  text-align: left;
  margin-bottom: 4px;
}
.video-episode-row:hover { border-color: var(--accent); color: var(--accent); }
.video-episode-row .icon { width: 14px; height: 14px; flex-shrink: 0; }
.video-episode-thumb-slot { width: 64px; height: 40px; flex-shrink: 0; }
.video-episode-thumb {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: var(--bg-raised);
}
.video-episode-thumb.video-thumb-empty { border: 1px solid var(--border); }
.video-episode-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-episode-meta {
  color: var(--text-dim);
  font-size: 0.9em;
  flex-shrink: 0;
}

/* Mode B — flat list */

.video-flat-list { display: flex; flex-direction: column; gap: 4px; }

.video-flat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.video-flat-row:hover { background: var(--bg-raised); }

.video-flat-thumb-slot { width: 64px; height: 40px; flex-shrink: 0; }
.video-flat-thumb {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: var(--bg-raised);
}
.video-flat-thumb.video-thumb-empty { border: 1px solid var(--border); }

.video-flat-info { min-width: 0; flex: 1; }
.video-flat-title {
  font-size: 0.88em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-flat-sub { font-size: 0.78em; color: var(--text-dim); margin-top: 1px; }

.video-flat-folder { border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-bottom: 4px; }
.video-flat-chevron { transition: transform 0.12s; flex-shrink: 0; }
.video-flat-chevron.open { transform: rotate(180deg); }
.video-flat-season { padding-left: 24px; margin-bottom: 8px; }
.video-flat-season .video-season-header { margin: 6px 0 4px; }

/* Season picker — docs/mediacenter.md §5.4's per-season overview view.
   Was a row of pills with `overflow-x: auto`: a show with a dozen seasons hid
   most of them behind a horizontal scrollbar, worst on the narrow screens that
   can least afford it. One trigger and a menu is one row high whatever the
   season count, so nothing below it moves either. The menu is absolutely
   positioned inside .video-detail-body, which scrolls — the picker sits near
   the top of that body, so the panel opens over the episode list rather than
   past the bottom of the scroll area. */
.video-season-menu { position: relative; margin: 10px 0; }
.video-season-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.85em;
  cursor: pointer;
  text-align: left;
}
.video-season-trigger:hover { border-color: var(--accent); color: var(--accent); }
.video-season-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-season-caret { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-dim); }

/* Fixed to the viewport, with left/width/top-or-bottom/max-height supplied by
   placeSeasonPanel() in video-app.js — see the comment there. Absolutely
   positioned inside the modal it was clipped by the modal's own
   `overflow: hidden` whenever the seasons outran the room under the picker. */
.video-season-options {
  position: fixed;
  z-index: 240;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 4px 0;
  /* Twenty-five seasons will not fit a phone: the panel scrolls, the modal
     behind it does not have to. The inline max-height narrows this further to
     whatever room the trigger actually has. */
  max-height: 320px;
  overflow-y: auto;
}
.video-season-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 14px;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--text);
  font-size: 0.85em;
  text-align: left;
  cursor: pointer;
}
.video-season-option:hover { background: var(--bg-raised); }
.video-season-option.active { color: var(--accent); }
.video-season-option-count { color: var(--text-dim); font-size: 0.85em; flex-shrink: 0; }

/* No own margin/size: it sits in .video-admin-actions next to the plain
   .admin-btn "Re-match", and any extra here made the two different sizes. */
.video-fix-match { font-size: 0.82em; }

/* Operator search-and-correct overlay, layered on top of the detail modal.
   Must beat .video-overlay's own z-index: 200 — both are position: fixed,
   so without an explicit higher value here this one loses the stacking
   order despite being the later sibling in the DOM. */
.video-search-overlay { z-index: 210; }
.video-search-panel { max-width: 480px; }
.video-search-form { display: flex; gap: 8px; }
.video-search-form input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text);
}
.video-search-hint { font-size: 0.78em; color: var(--text-dim); margin: 6px 0 2px; }
.video-search-error { font-size: 0.85em; color: var(--error); }
.video-search-results { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.video-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  text-align: left;
  cursor: pointer;
}
.video-search-result:hover:not(:disabled) { border-color: var(--accent); background: var(--bg-raised); }
.video-search-result:disabled { opacity: 0.5; cursor: not-allowed; }
.video-search-result-thumb { width: 46px; height: 68px; flex-shrink: 0; }
.video-search-result-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/* ── Music app (docs/musicbay.md) ─────────────────────────────────────────
   Reuses .video-overlay/.video-top-bar/.video-title/.video-close, .tb-btn/
   .tb-search, .video-flat-list/.video-flat-row/.video-flat-info/
   .video-flat-title/.video-flat-sub/.video-flat-folder/.video-flat-chevron
   and .video-thumb-empty as-is for a *folder* row (artist/album headers) —
   that part of Videos' flat list genuinely fits. A *track* row does not:
   it reuses .music-track-row (Mode A's own tracklist style) instead, and
   the tree gets its own .music-flat-children for indent/nesting, which
   Videos' single-level flat list never needed. Also genuinely different
   from Videos: album art is square, not 2:3; there is a persistent player
   bar; grouping is artist -> album, not movie/show. */

.music-artist-section { margin-bottom: 22px; }
.music-artist-heading {
  font-size: 0.95em;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text);
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.music-tile-slot { min-height: 200px; }

.music-card {
  /* The dots button floats over the cover's top-right corner. */
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  transition: border-color 0.12s, transform 0.12s;
}
.music-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.music-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--bg-surface);
}
/* The drawn-CD placeholder (DiscPlaceholder, music-app.js) — sized relative
   to the tile so it scales with .music-grid's auto-fill columns instead of
   one fixed px value, and never clipped by the square tile's own overflow. */
.music-disc-empty {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  overflow: hidden;
}
.music-disc-svg { width: 82%; height: 82%; }

.music-card-info { padding: 8px 10px; }
.music-card-title {
  font-size: 0.88em;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-card-sub {
  font-size: 0.78em;
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Detail modal — sits inside the shared .video-overlay */

.music-detail {
  width: min(560px, 92vw);
  max-height: calc(100vh - 100px);
  margin-top: 60px;
  background: var(--bg-surface);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.music-detail .video-top-bar {
  position: static;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.music-detail .video-title { color: var(--text); }
.music-detail .video-close { background: var(--bg-surface); color: var(--text); }
.music-detail .video-close:hover { background: var(--border); }

.music-queue-now-playing {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-queue-now-playing-title { font-weight: 600; color: var(--accent); }
.music-queue-now-playing-artist { color: var(--text-dim); }

.music-detail-body { padding: 16px 20px; overflow-y: auto; }
.music-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.music-detail-cover {
  width: 96px;
  height: 96px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-raised);
}
.music-detail-cover.music-disc-empty {
  width: 96px;
  height: 96px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-raised);
}
.music-detail-meta { min-width: 0; }
.music-detail-artist { font-weight: 600; font-size: 0.95em; }
.music-detail-date { font-size: 0.8em; color: var(--text-dim); margin: 2px 0 8px; }

.music-tracklist { display: flex; flex-direction: column; gap: 2px; }
.music-track-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85em;
  cursor: pointer;
  text-align: left;
}
/* The row holds two controls — play it, and its menu — so it is a div, and
   the play action is the button inside it. A button cannot contain another
   button: the browser reparents the inner one and the row comes apart.
   music-player.js's queue panel has no menu and is still a plain button, which
   is why `cursor` stays on the row rather than moving to the child. */
.music-track-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.music-track-row:hover { background: var(--bg-raised); border-color: var(--border); }
.music-track-row.active { border-color: var(--accent); color: var(--accent); }
.music-track-no { width: 24px; flex-shrink: 0; color: var(--text-dim); text-align: right; }
.music-track-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-track-duration { color: var(--text-dim); font-size: 0.9em; flex-shrink: 0; }

/* Mode B — flat list. .video-flat-thumb-slot's sizing is reused verbatim;
   only the empty-box icon differs, so it gets a name of its own. */
.music-flat-thumb {
  width: 64px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid var(--border);
}
/* A folder's expanded contents — artist -> album -> track. Videos' own flat
   list never needed this (one level, folders of episodes, no further
   nesting) so there was nothing to reuse: every depth used to sit flush
   left, indistinguishable from its parent except by which chevron happened
   to be open. The rule line gives the eye a rail to follow down the tree;
   it nests for free (each level wraps its own children in one more of
   these), so an artist with a real album inside it reads as two visible
   steps in, not one. */
.music-flat-children {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* A touch tighter vertically than Mode A's tracklist rows
   (.music-track-row, reused as the base) — this one already sits behind
   up to two levels of indent, so it gives a little of its own padding
   back rather than compounding with the rail. */
.music-flat-track { padding: 5px 8px; }

/* ── Persistent player bar (docs/musicbay.md §2.3) ────────────────────────
   `position: sticky`, not `fixed` — deliberately: CLAUDE.md's own history
   records more than one layout bug from a fixed-position element quietly
   double-reserving space against a page that also sized itself against the
   viewport. Sticky stays in normal flow, so it never needs a height this
   stylesheet has to know about anywhere else. */
.music-player-bar {
  position: sticky;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ── Indexing dock (index-dock.js) ────────────────────────────────────────
   Sticky for the music bar's reason. It is rendered right before that bar, so
   `bottom: var(--music-bar-h)` stacks it on top when both are pinned, and it
   publishes its own height as `--index-dock-h` for the sidebar to stop above
   the two of them. */
.index-dock {
  position: sticky;
  bottom: var(--music-bar-h);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}
.index-dock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.index-dock-main {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.index-dock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85em;
}
.index-dock-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.index-dock-meta {
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.index-dock-bar { display: block; margin: 6px 0 0; }
.index-dock-bar .index-progress-fill { display: block; }
.index-dock-done .index-progress-fill { background: var(--success); }
/* Walking the tree, or waiting for another root: no percentage to show yet,
   and a bar parked at 0 % reads as stuck. */
.index-dock-indeterminate { animation: index-dock-sweep 1.4s ease-in-out infinite; }
@keyframes index-dock-sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(340%); }
}
.index-dock-next {
  display: block;
  margin-top: 4px;
  font-size: 0.78em;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.index-dock-hide {
  flex-shrink: 0;
  display: inline-flex;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
}
.index-dock-hide:hover { background: var(--bg-surface); }
.index-dock-hide .icon { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .index-dock-head { flex-direction: column; gap: 2px; }
  .index-dock-title,
  .index-dock-meta { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .index-dock-indeterminate { animation: none; }
}

.music-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 160px;
}
.music-player-icon { width: 20px; height: 20px; color: var(--text-dim); flex-shrink: 0; }
.music-player-text { min-width: 0; }
.music-player-title {
  font-size: 0.85em;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-player-sub {
  font-size: 0.75em;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-player-transport {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.music-player-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
/* (hover: hover) — a tap on a touchscreen fires a synthetic hover that
   never gets a "pointer left" to end it, so next/prev/shuffle stayed
   highlighted as if still being pressed until some other element was
   tapped (found live on mobile Chrome, 2026-08-26; not reproducible on
   desktop, which actually has a mouse to move away with). Scoped to
   devices that can genuinely hover — real hover behaviour is unaffected. */
@media (hover: hover) {
  .music-player-btn:hover { background: var(--bg-surface); color: var(--text); }
}
.music-player-btn.active { color: var(--accent); }
.music-player-btn .icon { width: 16px; height: 16px; }
.music-player-play {
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: var(--accent-text);
}
@media (hover: hover) {
  .music-player-play:hover { background: var(--accent-hover); color: var(--accent-text); }
}
.music-player-play:disabled { opacity: 0.6; cursor: not-allowed; }
.music-repeat-badge {
  position: absolute;
  bottom: 1px;
  right: 1px;
  font-size: 0.55em;
  font-weight: 700;
  line-height: 1;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 50%;
  width: 11px;
  height: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-player-seek {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 2 1 200px;
  min-width: 120px;
}
.music-player-time { font-size: 0.75em; color: var(--text-dim); flex-shrink: 0; width: 34px; }
.music-player-time:last-child { text-align: right; }
.music-player-seek input[type="range"] { flex: 1; }

.music-player-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.music-player-volume .icon { width: 16px; height: 16px; color: var(--text-dim); }
.music-player-volume input[type="range"] { width: 80px; }

.music-player-extra { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

.music-player-error { flex-basis: 100%; font-size: 0.78em; color: var(--error); }

@media (max-width: 640px) {
  .music-player-bar { gap: 8px; }
  .music-player-seek { order: 4; flex-basis: 100%; }
  .music-player-volume { display: none; }
}

/* ── Photos app (photos-app.js, docs/photos.md) ───────────────────────────── */

.photo-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  /* A pinned band keeps this gap: `--band-margin` is both the margin in
     the flow and the width of the opaque ring the band paints around
     itself once pinned, so the two can never disagree (style.css,
     "Sticky chrome"). */
  --band-margin: 14px;
  margin-bottom: var(--band-margin);
}
.photo-toolbar .tb-search { margin-left: auto; }

/* Open-album title bar: name + year on the left, two big monochrome
   icon-only actions (back, zip) on the right — same row, same size as a
   group tab's own icon (.tab-icon, 22px) so they read as "app-level"
   controls rather than small inline buttons. */
.photo-album-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  /* A pinned band keeps this gap: `--band-margin` is both the margin in
     the flow and the width of the opaque ring the band paints around
     itself once pinned, so the two can never disagree (style.css,
     "Sticky chrome"). */
  --band-margin: 16px;
  margin-bottom: var(--band-margin);
}
.photo-album-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.photo-album-heading-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.photo-album-heading-title {
  font-weight: 600;
  font-size: 1.15em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-album-heading-year { font-size: 0.85em; color: var(--text-dim); flex-shrink: 0; }

.photo-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 7px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-icon-btn:hover { color: var(--text); background: var(--bg-surface); }
.photo-icon-btn-icon { width: 22px; height: 22px; }

/* .tb-btn's own chevron is drawn pointing down; rotated here to read as
   "back" (left) without a second icon in icon.js. */
.photo-back-icon { transform: rotate(90deg); }

/* Landing view — one card per album (a directory containing images) */

.photo-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.photo-album-tile-slot { min-height: 190px; }

.photo-album-card {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  transition: border-color 0.12s, transform 0.12s;
}
.photo-album-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.photo-album-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--bg-surface);
}
/* MediaThumb (video-app.js) always adds its own .video-thumb-empty class
   for the placeholder state, whatever `cls` is passed — that global rule
   already centers the icon; only the square sizing above is Photos-specific. */
.photo-album-cover.video-thumb-empty .icon,
.photo-tile-thumb.video-thumb-empty .icon { width: 24px; height: 24px; }

.photo-album-info { padding: 8px 10px; }
.photo-album-title {
  font-size: 0.86em;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-album-sub { font-size: 0.75em; color: var(--text-dim); margin-top: 2px; }

/* Open-album view — a grid of the album's own photos */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.photo-tile-slot { min-height: 110px; }
.photo-tile {
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--border);
}
.photo-tile:hover { border-color: var(--accent); }
.photo-tile-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--bg-surface);
}

/* Lightbox — sits inside the shared .video-overlay/.video-top-bar/.video-title/
   .video-close, same as music-app.js's detail modal reuses them. */

/* Scoped to .photo-lightbox specifically — .video-top-bar itself stays
   transparent everywhere else that reuses it (VideoPlayer, the video/music
   detail modals), where nothing zooms underneath it. */
.photo-lightbox .video-top-bar {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
  padding-bottom: 24px;
}

.photo-lightbox-body {
  /* Bounded strictly between the top bar and the info strip, rather than
     the full-viewport height it used to take — a zoomed-in image, larger
     than the window, painted straight through that space (nothing ever
     reserved it) and sat visually behind the zoom controls, which had only
     a faint translucent highlight of their own to read against a bright,
     busy photo. Positioning the image area below the bar's own real,
     opaque strip (below) is what actually keeps them apart, not z-index —
     the buttons were never behind the image in stacking order, just hard
     to see in front of it. */
  position: absolute;
  top: 60px;
  bottom: 44px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
}
.photo-nav {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #e2e8f0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-nav:hover { background: rgba(255, 255, 255, 0.22); }
.photo-nav:disabled { opacity: 0.3; cursor: default; }
.photo-nav-icon { width: 20px; height: 20px; }
.photo-nav-prev-icon { transform: rotate(90deg); }
.photo-nav-next-icon { transform: rotate(-90deg); }

.photo-lightbox-image-slot {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* A zoomed-in image is routinely larger than the viewport — this is what
     makes it pannable instead of just clipped. Harmless when the image
     fits (fit-to-window, or zoomed below 100%): no scrollbar appears. */
  overflow: auto;
}
/* flex centering (align-items/justify-content: center) plus overflow:auto
   is a well-known trap: the browser centers overflowing content by
   shifting it, but the "leading" half of that overflow — here, the top of
   a zoomed-in photo — sits outside the range the scrollport actually
   exposes, so it can never be scrolled into view at all. Reported live as
   "unusable" (the top of the photo was gone, with no way to reach it).
   Switching to top/left alignment for the zoomed state fixes exactly that:
   the top-left corner is always where the image starts, and scrolling
   down/right reaches the rest — the same convention most image viewers
   use once you're past fit-to-window anyway. */
.photo-lightbox-image-slot.zoomed {
  align-items: flex-start;
  justify-content: flex-start;
}
.photo-lightbox-image {
  /* Relative to the now-properly-bounded slot (.photo-lightbox-body's
     top/bottom insets), not a guessed viewport fraction — correct at any
     window size without re-tuning a magic number. */
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* An explicit pixel size (photos-app.js's imgStyle) replaces the
   fit-to-window constraints above — object-fit has nothing left to do
   once both dimensions are set directly. */
.photo-lightbox-image.zoomed {
  max-width: none;
  max-height: none;
  object-fit: initial;
  display: block;
}

/* Zoom controls sit in the dark lightbox chrome (.video-top-bar), not the
   app's light Settings/toolbar chrome — .photo-icon-btn's own colors
   (meant for the light chrome elsewhere in Photos) are overridden here to
   match .video-close's existing treatment instead. */
.photo-zoom-controls { display: flex; align-items: center; gap: 2px; }
.photo-zoom-controls .photo-icon-btn {
  color: #e2e8f0;
  padding: 5px;
  border-radius: 4px;
}
.photo-zoom-controls .photo-icon-btn:hover { background: rgba(255, 255, 255, 0.15); }
.photo-zoom-controls .photo-icon-btn.active { background: rgba(255, 255, 255, 0.18); }
.photo-zoom-controls .photo-icon-btn:disabled { opacity: 0.35; cursor: default; }
.photo-zoom-controls .photo-icon-btn:disabled:hover { background: none; }
.photo-zoom-controls .photo-icon-btn-icon { width: 18px; height: 18px; }
.photo-icon-btn-text { font-size: 0.72em; font-weight: 600; padding: 5px 8px; }
.photo-zoom-percent {
  font-size: 0.75em;
  color: #94a3b8;
  min-width: 38px;
  text-align: center;
  flex-shrink: 0;
}

.photo-lightbox-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 20px;
  color: #cbd5e1;
  font-size: 0.78em;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
}
.photo-lightbox-count { color: #94a3b8; }

/* ── Folder tree picker (folder-tree.js) ─────────────────────────────────── */

.ftp-backdrop {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.ftp-panel {
  background: var(--bg-surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  width: min(520px, 100%); max-height: min(70vh, 640px);
  display: flex; flex-direction: column; padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.ftp-panel:focus { outline: none; }
.ftp-title { margin: 0 0 8px; font-size: 1em; }
/* The tree is the only part that scrolls: the title, the selection and the
   buttons stay put, so OK never travels off-screen in a deep library. */
.ftp-tree, .ftp-children { list-style: none; margin: 0; padding: 0; }
.ftp-tree {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 0; margin: 8px 0;
}
.ftp-row { display: flex; align-items: center; gap: 2px; }
.ftp-row.chosen { background: var(--bg-raised); }
/* 0.4 was low enough that a greyed-out root read as an artefact rather than
   a disabled control — the names were barely legible in the screenshot that
   prompted this. */
.ftp-row.blocked { opacity: 0.55; }
.ftp-twisty {
  flex: 0 0 auto; width: 20px; height: 20px; padding: 0;
  background: none; border: none; color: var(--text-dim);
  font-family: inherit; font-size: 0.95em; line-height: 1; cursor: pointer;
}
.ftp-twisty:disabled { cursor: default; opacity: 0; }
.ftp-label {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: inherit;
  font: inherit; text-align: left; padding: 3px 6px; cursor: pointer;
}
.ftp-label:disabled { cursor: not-allowed; }
.ftp-label .icon { width: 15px; height: 15px; flex-shrink: 0; }
.ftp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftp-badge {
  flex: 0 0 auto; margin-left: 8px;
  font-size: 0.72em; padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--border); background: var(--bg-raised);
  color: var(--text-dim); white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.ftp-badge.rw { color: var(--accent); border-color: currentColor; }
.ftp-badge.warn { color: var(--error); border-color: currentColor; }
.ftp-check { margin-left: auto; flex: 0 0 auto; }
.ftp-selection {
  display: flex; flex-wrap: wrap; gap: 4px;
  max-height: 84px; overflow-y: auto; margin-bottom: 10px;
}
.ftp-chip {
  font-size: 0.82em; padding: 2px 6px; border-radius: 3px;
  background: var(--bg-raised); border: 1px solid var(--border);
}
.ftp-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* An app's chosen folders. Deliberately not a .settings-row: that is a
   space-between flex row, and a label, a hint and a list laid out inside one
   end up spread across a single line in source order. */
.folder-field { padding: 8px 0; }
.folder-field-head { margin-bottom: 6px; }
.folder-field-label {
  margin: 0 0 2px; font-size: 0.9em; font-weight: 600; color: var(--text);
}
.folder-field-head .settings-hint { margin-bottom: 0; }
/* Borrows .shared-dirs-tbl so the two lists of directories on this page read
   as the same kind of thing. */
.folder-field-tbl { margin-bottom: 8px; }
.folder-field-tbl .sdt-col-dir { font-size: 0.9em; }
.folder-field-actions { display: flex; align-items: center; gap: 10px; }

/* HelloWorld (docs/refactor-groups.md §4.1) — the reference app, hidden
   behind ?dev=1. Deliberately plain: it exists to prove the plumbing, and
   anything decorative here would be a second thing to keep working. */
.hw-list { list-style: none; margin: 12px 0 0; padding: 0; }
.hw-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.hw-item .icon { width: 15px; height: 15px; flex-shrink: 0; }
.hw-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-size { flex: 0 0 auto; color: var(--text-dim); font-size: 0.85em; }

/* A chat message this client could not open. Deliberately visible rather than
   hidden: a conversation quietly missing messages is worse than a gap, because
   nobody can notice what they were never shown. */
.chat-bubble-unreadable {
  background: var(--bg-raised);
  border: 1px dashed var(--border);
  color: var(--text-secondary);
}
.chat-unreadable {
  font-style: italic;
  opacity: 0.75;
}

/* "This account is using a key you have not seen before." Deliberately quiet:
   it is a notice, not an error, and it appears on a message that is otherwise
   perfectly readable. An alarm here would be clicked through. */
.chat-key-changed {
  font-size: 0.82em;
  color: var(--warn);
  margin-bottom: 2px;
}

/* A transfer waiting for a slot. Deliberately not a progress bar at 0%: it is
   not stalled and nothing is wrong, and a bar that never moves is exactly how a
   queue comes to look like a hang. The stripes say "not yet", not "broken". */
.dl-progress.dl-waiting {
  background-color: var(--bg-raised);
  background-image: repeating-linear-gradient(
    45deg,
    var(--accent-bg) 0 8px,
    transparent 8px 16px);
  animation: dl-waiting-slide 1.1s linear infinite;
}
@keyframes dl-waiting-slide {
  from { background-position: 0 0; }
  to   { background-position: 22.6px 0; }
}
/* The state has to survive without the motion: someone who asked for less of it
   still needs to see that this row is waiting rather than stopped. */
@media (prefers-reduced-motion: reduce) {
  .dl-progress.dl-waiting { animation: none; }
}

/* ── Transfers panel (grouped) ───────────────────────────────────────────── */

.transfer-head-title { font-weight: 600; }
.transfer-head-summary {
  margin-left: auto;
  margin-right: .5rem;
  font-size: .85em;
  color: var(--text-dim);
  /* Never wraps to a second line: it is the one part of the header that grows
     with what is happening, and a header that changes height as transfers come
     and go pushes every row under it. */
  white-space: nowrap;
}
.transfer-group + .transfer-group { border-top: 1px solid var(--border); }
.transfer-group-head {
  padding: .35rem .6rem .2rem;
  font-size: .78em;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
}
/* Finished rows recede rather than disappear: somebody who just downloaded
   three files wants to see that all three are there. */
.transfer-item.transfer-done .transfer-name,
.transfer-item.transfer-cancelled .transfer-name { color: var(--text-dim); }

/* Announced, not shown. The transfers panel needs a live region that says what
   changed state without drawing anything — used with aria-live, so it must
   stay in the accessibility tree: `display: none` would remove it from there
   too and announce nothing at all, which is the usual way this is got wrong. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Pop-up menus (menu.js) ────────────────────────────────────────────────
   One panel, opened at a point, for right-click on a cover and for the dots
   button beside a track. `position: fixed` because the coordinates come from
   a pointer or a `getBoundingClientRect()` — both viewport-relative, and an
   absolutely-positioned panel would be offset by whatever happens to be
   scrolled. menu.js measures and flips it; nothing here knows where it goes.
   docs/playlists.md §10.1. */

.ctx-menu {
  position: fixed;
  /* Above everything, modals included: this menu is opened *from* the album
     detail overlay, and `.video-overlay` is itself `position: fixed` at 200.
     Equal values would leave it to DOM order, which is not a decision. */
  z-index: 300;
  min-width: 220px;
  max-width: calc(100vw - 16px);
  /* A playlist's tracklist expands inside this panel rather than flying out
     sideways, so it can be far taller than the window. Same answer the
     account menu's language list already has. */
  max-height: calc(100vh - 16px);
  overflow-x: hidden;
  overflow-y: auto;
  /* Wheeling past the last track must not carry on into the page behind: that
     scroll is a real page scroll, and a page scroll closes this menu on
     purpose (menu.js). Without this, reaching the end of a long tracklist
     dismisses the menu, which is the same symptom the scroll handler was just
     fixed for, arriving by a different door. */
  overscroll-behavior: contain;
  padding: 4px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9em;
  text-align: left;
  cursor: pointer;
}
.ctx-menu-item:hover:not(:disabled) { background: var(--sidebar-hover); }
.ctx-menu-item:disabled { color: var(--text-dim); cursor: default; }
.ctx-menu-item.danger { color: var(--error); }

.ctx-menu-icon { width: 16px; height: 16px; flex-shrink: 0; }
.ctx-menu-label {
  flex: 1;
  /* A track title is arbitrarily long and the panel is not: one line, cut,
     rather than a menu as wide as the longest filename in the library. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ctx-menu-hint { color: var(--text-dim); font-size: 0.85em; flex-shrink: 0; }
.ctx-menu-caret {
  width: 14px; height: 14px; flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.15s;
}
.ctx-menu-caret.flip { transform: rotate(180deg); }

.ctx-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

.ctx-menu-empty {
  padding: 8px 14px;
  color: var(--text-dim);
  font-size: 0.85em;
}

/* The dots button on a cover or a track row. Revealed on hover where there is
   a pointer to hover with, and permanently visible where there is not — a
   touchscreen has no hover state, and this is the *only* way in there. */
.ctx-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px; height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s;
}
.ctx-dots svg { width: 18px; height: 18px; }
.ctx-dots:hover { background: var(--sidebar-hover); color: var(--text); }
.ctx-dots:focus-visible { opacity: 1; outline: 2px solid var(--border-focus); }
.music-card:hover .ctx-dots,
.music-track-row:hover .ctx-dots { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .ctx-dots { opacity: 1; }
}

/* On a cover, floated over the top-right corner rather than taking a row of
   its own — the grid's tiles are sized by their art. */
.music-card-dots {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  backdrop-filter: blur(2px);
}
.music-card-dots:hover { background: rgba(0, 0, 0, 0.75); color: #fff; }

/* A flat folder row expands on click; its menu button sits in the same row and
   must not take the whole width with it. */
.video-flat-row .ctx-dots { margin-left: auto; }
.video-flat-row .ctx-dots + .video-flat-chevron { margin-left: 8px; }

/* "Play all" and the album's menu, side by side under the cover. */
.music-detail-actions { display: flex; align-items: center; gap: 6px; }
.music-detail-actions .ctx-dots { opacity: 1; }

/* ── Playlists (playlist-menu.js) ─────────────────────────────────────────
   docs/playlists.md §10.3. One button in Music's sticky toolbar, and the two
   small surfaces behind it: a field for naming a playlist, and a one-line
   result that clears itself. */

.playlist-modal { max-width: 420px; }
.playlist-modal-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.playlist-modal-body input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-base);
  color: var(--text);
  font: inherit;
}
.playlist-modal-body input:focus {
  outline: none;
  border-color: var(--border-focus);
}
.playlist-modal-error { color: var(--error); font-size: 0.85em; }
.playlist-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* The result of an action, said once and then gone. Not a dialog: adding an
   album to a playlist is not a thing anyone should have to dismiss. Fixed
   above the player bar, which is itself pinned to the bottom — `--music-bar-h`
   is published by the bar and is 0 when there is no bar. */
.playlist-note {
  position: fixed;
  left: 50%;
  bottom: calc(var(--music-bar-h, 0px) + 16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 250;
  max-width: calc(100vw - 32px);
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 0.85em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A run of single-album artists, pooled into one grid so five of them fill one
   row instead of spending five (music-app.js `albumSections`).

   Each cell keeps its artist's name above the cover, in the same type as a
   multi-album artist's heading. Dropping it — the first version of this — made
   scrolling alternate between artists written large and artists written small,
   which is a worse problem than the whitespace it saved. */
.music-artist-pool { margin-bottom: 22px; }
.music-pool-cell { display: flex; flex-direction: column; min-width: 0; }
/* One line, clipped. A cell is about 170px wide, and a heading that wrapped to
   two lines would push its own cover below the others on its row — the grid
   stretches the cell, it does not align what is inside it. */
.music-pool-heading {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}