File size: 51,363 Bytes
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
09f4904
 
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
09f4904
 
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0462291
 
 
 
 
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0462291
 
 
 
06f00d8
 
0462291
06f00d8
0462291
 
06f00d8
 
 
 
 
0462291
06f00d8
09f4904
0462291
 
 
 
 
 
 
09f4904
 
 
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
09f4904
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
06f00d8
2149323
 
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
34252e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
583dae9
 
 
 
 
 
34252e5
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2149323
 
06f00d8
2149323
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8c15fae
 
 
 
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
09f4904
 
 
 
 
 
 
 
 
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
abe37d5
 
 
 
 
06f00d8
abe37d5
 
06f00d8
 
abe37d5
 
 
 
 
 
 
 
 
 
 
b1d7276
 
 
 
 
 
 
 
a1d23b0
 
 
 
 
 
 
 
abe37d5
 
 
 
 
 
 
 
 
 
 
 
06f00d8
 
 
abe37d5
06f00d8
 
 
abe37d5
 
 
 
 
 
 
 
 
 
 
 
 
 
a2cff27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
abe37d5
 
 
 
 
 
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149897a
 
0462291
149897a
0462291
 
 
 
 
 
 
 
 
 
 
ad0a22b
 
 
0462291
06f00d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cdfb1fd
 
0462291
cdfb1fd
0462291
cdfb1fd
0462291
 
cdfb1fd
0462291
8c15fae
bac03b4
99e2057
cdfb1fd
8c15fae
 
cdfb1fd
0462291
cdfb1fd
0462291
 
 
cdfb1fd
0462291
ba742c0
 
 
 
a1d23b0
 
 
 
8c15fae
 
 
 
99e2057
 
 
 
 
 
8c15fae
cdfb1fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f013877
 
 
 
 
 
 
 
 
 
 
 
 
 
8c15fae
 
99e2057
 
f013877
 
 
 
 
 
 
 
 
 
 
ba742c0
 
 
 
 
a1d23b0
 
 
 
 
149897a
99e2057
149897a
 
 
99e2057
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f013877
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
043404b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bb10dc1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
09f4904
bb10dc1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34252e5
 
 
 
 
 
 
bb10dc1
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
/* ============================================================
   RL-for-LLMs Wiki Reader β€” styles
   Editorial palette borrowed from the project dashboard.
   ============================================================ */

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

:root {
  --bg: #fafafa;
  --bg-soft: #f4f4f4;
  --bg-card: #ffffff;
  --bg-code: #f6f7f9;
  --border: #ddd;
  --border-soft: #eee;
  --ink: #1a1a1a;
  --ink-2: #2a2a2a;
  --ink-3: #444;
  --muted: #555;
  --muted-2: #777;
  --muted-3: #888;
  --muted-4: #999;
  --muted-5: #aaa;
  --accent: #0f3787;        /* deep editorial blue */
  --accent-deep: #0a275f;
  --accent-soft: #dde6f5;
  --accent-hover-row: #c8d6ee;
  --hl-bg: #0f3787;         /* search-hit rectangle */
  --hl-ink: #ffffff;
  --good: #1c7c3f;
  --warn: #9a6b00;
  --danger: #a12d2d;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.03);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", "Helvetica Neue", system-ui, sans-serif;
  --sidebar-w: 280px;
  --aside-w: 248px;
}

[data-theme="dark"] {
  --bg: #15171a;
  --bg-soft: #1b1e22;
  --bg-card: #1e2228;
  --bg-code: #14181d;
  --border: #2e343c;
  --border-soft: #262b31;
  --ink: #e9ecf0;
  --ink-2: #dfe3e8;
  --ink-3: #c4cad2;
  --muted: #aab2bd;
  --muted-2: #8b94a0;
  --muted-3: #79828e;
  --muted-4: #69707b;
  --muted-5: #585f69;
  --accent: #8fb2f0;
  --accent-deep: #b6cdf7;
  --accent-soft: #20304d;
  --accent-hover-row: #28395a;
  --hl-bg: #4f7fe0;
  --hl-ink: #ffffff;
  --good: #6fcf8f;
  --warn: #e0b15a;
  --danger: #e08585;
  --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 2px 10px rgba(0,0,0,0.25);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ── Top bar ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: baseline; gap: 10px; cursor: pointer; min-width: 0; }
.brand .logo {
  font-family: var(--mono); font-weight: 600; font-size: 16px;
  letter-spacing: 0.5px; color: var(--ink); white-space: nowrap;
}
.brand .logo .dot { color: var(--accent); }
.brand .tag {
  font-size: 11.5px; color: var(--muted-2); font-weight: 300;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.counts {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--muted-2); letter-spacing: 0.3px; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.counts .n { color: var(--accent); font-weight: 600; }
.counts .sep { color: var(--muted-4); margin: 0 8px; }
.topbar .spacer { flex: 1 1 auto; }
.toolbar { display: flex; align-items: center; gap: 7px; }
.btn {
  font-family: var(--mono); font-size: 10.5px; font-weight: 400; letter-spacing: 0.4px;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-card); color: var(--muted); cursor: pointer;
  transition: all .15s; white-space: nowrap; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { border-color: var(--muted-3); color: var(--ink); }
.icon-btn { padding: 5px 8px; font-size: 13px; line-height: 1; }
/* internal nav (sources) β€” tinted to read as primary, not an external link */
.btn-sources { background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; font-weight: 500; }
.btn-sources:hover { background: var(--accent-hover-row); color: var(--accent-deep); border-color: transparent; }
.btn-sources.active { background: var(--accent); color: #fff; }
[data-theme="dark"] .btn-sources.active { color: #0b1220; }

/* ── Mobile sidebar toggle ─────────────────────────────── */
.menu-toggle { display: none; }

/* ── Layout ────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 1180px) {
  .layout.has-aside {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--aside-w);
  }
}

/* ── Sidebar (navigation) ──────────────────────────────── */
.sidebar {
  position: sticky; top: 53px; align-self: start;
  height: calc(100vh - 53px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 16px 14px 40px;
  background: var(--bg);
}
/* sidebar section header β€” "Topics" (the first-class citizen) */
.side-head {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--ink-2); margin: 2px 2px 12px;
}

.search-wrap { position: relative; margin-bottom: 16px; }
.search {
  width: 100%; font-family: var(--sans); font-size: 13px;
  padding: 8px 44px 8px 28px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-card); color: var(--ink);
}
.search:focus { outline: none; border-color: var(--accent); }
.search-wrap::before {
  content: "βŒ•"; position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--muted-3); font-size: 15px;
}
/* the ⌘K badge on the search box: click (or ⌘K) β†’ focus the search input */
.search-k {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--muted-3);
  cursor: pointer; transition: all .12s;
}
.search-k:hover { border-color: var(--accent); color: var(--accent-deep); }
/* once a query is entered, the badge becomes a βœ• clear button */
.search-k.is-clear { font-family: var(--sans); font-size: 12px; line-height: 1; padding: 3px 6.5px; }
.search-k.is-clear:hover { background: var(--accent-soft); }

.nav-group { margin-bottom: 14px; }
.nav-group-title {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted-3);
  padding: 4px 8px; margin-bottom: 2px;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-group-title .c { color: var(--muted-4); font-weight: 500; }
.nav-item {
  display: block; padding: 5px 9px; border-radius: 5px;
  font-size: 12.5px; color: var(--ink-3); cursor: pointer;
  line-height: 1.35; transition: background .12s, color .12s;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: var(--bg-soft); color: var(--ink); }
.nav-item.active {
  background: var(--accent-soft); color: var(--accent-deep);
  border-left-color: var(--accent); font-weight: 500;
}
.nav-item .ni-sub {
  display: block; font-family: var(--mono); font-size: 9.5px;
  color: var(--muted-4); margin-top: 1px; letter-spacing: 0.2px;
}
/* content-search: a matched-body excerpt under the topic name, query bolded */
.nav-item .nav-item-title { display: block; }
.nav-item .nav-item-title b { color: var(--accent-deep); font-weight: 600; }
.nav-item .nav-snippets { display: block; margin-top: 2px; }
.nav-item .nav-snippet {
  display: block; margin-top: 2px; padding: 2px 6px; font-size: 11px; line-height: 1.4;
  color: var(--muted-3); font-weight: 400; cursor: pointer;
  border-left: 2px solid var(--border); border-radius: 0 4px 4px 0;
  transition: background .12s, border-color .12s, color .12s;
}
.nav-item .nav-snippet:hover { background: var(--accent-soft); border-left-color: var(--accent); color: var(--ink); }
.nav-item .nav-snippet b { color: var(--accent-deep); font-weight: 600; }
.nav-item .nav-snippet.more { font-style: italic; cursor: default; border-left-color: transparent; color: var(--muted-4); }
.nav-item .nav-snippet.more:hover { background: none; }
.nav-hit-count {
  display: inline-block; margin-left: 5px; padding: 0 5px; font-family: var(--mono);
  font-size: 9px; line-height: 15px; vertical-align: 1px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-deep); font-weight: 600;
}
.nav-empty { color: var(--muted-4); font-size: 11.5px; padding: 8px; font-style: italic; }
.mini-spin { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin-right: 4px;
  border: 1.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }

/* ── Main content ──────────────────────────────────────── */
.main { min-width: 0; padding: 26px 38px 80px; }
@media (max-width: 760px) { .main { padding: 20px 18px 60px; } }

.crumbs {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted-3);
  letter-spacing: 0.3px; margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.crumbs a { color: var(--muted-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--muted-5); }

/* doc header */
/* single reading column for topic articles (no right rail) */
.doc { max-width: 820px; margin: 0 auto; }
.doc .prose { max-width: none; }

/* collapsible disclosures used in the article flow (Contents, Open questions) */
.disclosure { border: 1px solid var(--border); border-radius: 9px; background: var(--bg-card); margin: 14px 0; overflow: hidden; }
.disclosure > summary {
  list-style: none; cursor: pointer; padding: 10px 14px; display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--ink-3);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { color: var(--ink); }
.disclosure > summary::after { content: "β–Έ"; margin-left: auto; color: var(--muted-4); transition: transform .15s; }
.disclosure[open] > summary::after { transform: rotate(90deg); }
.disclosure .disc-ic { color: var(--accent); font-weight: 700; }
.disclosure .disc-n { color: var(--muted-4); font-weight: 500; }
.disclosure.oq-d { border-left: 3px solid var(--accent); }
.disclosure .oq-list, .disclosure .toc { padding: 2px 16px 14px; }
.disclosure .toc { display: block; }
.disclosure .toc a { display: block; font-size: 12.5px; color: var(--muted); padding: 3px 0 3px 10px; border-left: 2px solid var(--border-soft); }
.disclosure .toc a.h3 { padding-left: 22px; font-size: 11.5px; }
.disclosure .toc a:hover { color: var(--accent); border-left-color: var(--accent); }

/* references (sources cited), at the end of the article */
.refs-section { margin: 40px 0 8px; padding-top: 20px; border-top: 1px solid var(--border); }
.refs-h { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 12px; display: flex; align-items: baseline; gap: 8px; }
.refs-h .refs-n { font-size: 11px; color: var(--muted-4); font-weight: 500; }
.refs-list { list-style: decimal; margin: 0 0 0 26px; padding: 0; }
.refs-list li { margin: 5px 0; font-size: 13px; line-height: 1.5; }
.refs-list li::marker { color: var(--muted-4); font-family: var(--mono); font-size: 11px; }
.ref-id { font-family: var(--mono); font-size: 11.5px; color: var(--accent); border-bottom: none; }
.ref-id:hover { border-bottom: 1px solid var(--accent); }
.ref-title { color: var(--ink-3); margin-left: 8px; }
.ref-ext { color: var(--muted-4); border-bottom: none; }
.page-links { margin: 22px 0 0; display: flex; gap: 16px; font-family: var(--mono); font-size: 11px; }
.page-links a { color: var(--muted-3); }
.page-links a:hover { color: var(--accent); }

/* figures β€” images, inline SVG diagrams, generated plots */
.prose .fig { margin: 24px 0; text-align: center; }
.prose .fig img, .prose .fig svg { max-width: 100%; height: auto; }
/* raster/exported-SVG figures get a light matte so plots/diagrams stay legible in dark mode */
.prose .fig img { background: #fff; padding: 12px; border-radius: 8px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.prose .fig figcaption { font-size: 12px; color: var(--muted-2); margin: 10px auto 0; line-height: 1.5; text-align: center; max-width: 640px; }
.prose .fig.fig-broken { display: none; }   /* hide a figure whose image failed to load */

.doc-head { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.doc-kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 8px;
}
.doc-title {
  font-family: var(--mono); font-weight: 600; font-size: 26px; line-height: 1.2;
  color: var(--ink); letter-spacing: -0.2px;
}
.doc-meta-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; }
.doc-authors { font-size: 12.5px; color: var(--muted); }
.doc-sub { font-size: 12px; color: var(--muted-2); font-family: var(--mono); }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.4px;
  padding: 2.5px 8px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--muted); text-transform: uppercase;
  white-space: nowrap;
}
.badge .b-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-4); }
.badge.mat-comprehensive { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.badge.mat-comprehensive .b-dot { background: var(--good); }
.badge.mat-developing { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.badge.mat-developing .b-dot { background: var(--warn); }
.badge.mat-stub { color: var(--muted-2); }
.badge.mat-stub .b-dot { background: var(--muted-4); }
.badge.type { background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; }

/* ── Prose (rendered markdown) ─────────────────────────── */
.prose { font-size: 14.5px; line-height: 1.75; color: var(--ink-2); max-width: 860px; }
.prose > *:first-child { margin-top: 0; }
.prose h1 { display: none; } /* title handled by doc-head */
.prose h2 {
  font-family: var(--mono); font-size: 19px; font-weight: 600; color: var(--ink);
  margin: 34px 0 12px; padding-top: 6px; letter-spacing: -0.1px;
  scroll-margin-top: 70px;
}
.prose h3 {
  font-family: var(--mono); font-size: 15.5px; font-weight: 600; color: var(--ink-2);
  margin: 26px 0 10px; scroll-margin-top: 70px;
}
.prose h4 { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 20px 0 8px; scroll-margin-top: 70px; }
.prose h2 .anchor, .prose h3 .anchor, .prose h4 .anchor {
  opacity: 0; margin-left: 8px; font-size: 0.6em; vertical-align: middle;
  transition: opacity .12s; text-decoration: none; border-bottom: none; cursor: pointer;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 0.55; }
.prose .anchor:hover { opacity: 1 !important; }

/* page-level "copy link" button in the doc header */
.share-btn {
  margin-left: 12px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.4px;
  padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-card);
  color: var(--muted-2); cursor: pointer; transition: all .12s; text-transform: none; vertical-align: middle;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent-deep); }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: var(--bg-card); font-family: var(--mono); font-size: 11.5px;
  padding: 8px 16px; border-radius: 6px; box-shadow: var(--shadow); z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
[data-theme="dark"] #toast { background: var(--accent); color: #0b1220; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* source hovercard */
#hovercard {
  position: fixed; z-index: 250; max-width: 340px; pointer-events: none;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18); padding: 10px 13px;
  opacity: 0; transition: opacity .12s; font-family: var(--sans);
}
#hovercard.show { opacity: 1; }
#hovercard .hc-title { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.35; margin-bottom: 4px; }
#hovercard .hc-authors { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
#hovercard .hc-line { font-size: 11px; color: var(--muted-2); margin-top: 3px; }
#hovercard .hc-id { font-family: var(--mono); font-size: 9.5px; color: var(--muted-4); margin-top: 5px; letter-spacing: 0.2px; }
/* compact acronym-definition variant */
#hovercard.hc-def { max-width: 260px; padding: 8px 11px; }
#hovercard .hc-term { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent); letter-spacing: 0.3px; }
#hovercard .hc-mean { font-size: 12.5px; color: var(--ink); line-height: 1.4; margin-top: 2px; }
.prose p { margin: 12px 0; }
.prose ul, .prose ol { margin: 12px 0 12px 24px; }
.prose li { margin: 5px 0; }
.prose li::marker { color: var(--muted-3); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

.prose a { border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.prose a:hover { border-bottom-color: var(--accent); }

/* inline code & blocks */
.prose code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--bg-code); border: 1px solid var(--border-soft);
  padding: 1px 5px; border-radius: 4px; color: var(--ink);
}
.prose pre {
  background: var(--bg-code); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px; overflow-x: auto; margin: 16px 0;
  font-size: 12.8px; line-height: 1.55;
}
.prose pre code { background: none; border: none; padding: 0; font-size: inherit; color: var(--ink-2); }
/* active-search term highlighting inside the article (cleared with the search) β€”
   a filled rectangle so hits stand out against prose, headings, and inline code */
mark.search-hl {
  background: var(--hl-bg); color: var(--hl-ink);
  font-weight: 600; border-radius: 3px;
  padding: 0.5px 3.5px; margin: 0 0.5px;
  box-shadow: 0 0 0 1px var(--hl-bg);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* blockquote */
.prose blockquote {
  margin: 16px 0; padding: 8px 16px; border-left: 3px solid var(--accent);
  background: var(--bg-soft); color: var(--muted); border-radius: 0 6px 6px 0;
}
.prose blockquote p { margin: 6px 0; }

/* tables */
.prose table {
  border-collapse: collapse; margin: 18px 0; font-size: 13px; width: 100%;
  display: block; overflow-x: auto; box-shadow: var(--shadow); border-radius: 8px;
}
.prose thead { background: var(--bg-soft); }
.prose th {
  text-align: left; font-family: var(--mono); font-weight: 600; font-size: 11px;
  letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted);
  padding: 9px 13px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.prose td { padding: 8px 13px; border-bottom: 1px solid var(--border-soft); color: var(--ink-3); vertical-align: top; }
.prose tbody tr:last-child td { border-bottom: none; }
.prose tbody tr:hover { background: var(--bg-soft); }
.prose td code { white-space: nowrap; }

/* KaTeX */
.prose .katex { font-size: 1.04em; }
.prose .katex-display {
  margin: 18px 0; padding: 6px 4px; overflow-x: auto; overflow-y: hidden;
}
.prose .katex-display > .katex { white-space: nowrap; }
.katex-error { color: var(--danger) !important; font-family: var(--mono); font-size: 0.9em; }

/* ── Citation chips (the signature feature) ────────────── */
.cite {
  display: inline-block; font-family: var(--mono); font-size: 0.74em;
  font-weight: 500; letter-spacing: 0.2px; line-height: 1.3;
  padding: 0.5px 5px; margin: 0 1px; border-radius: 4px; vertical-align: 0.12em;
  background: var(--accent-soft); color: var(--accent-deep);
  border: 1px solid transparent; white-space: nowrap; cursor: pointer;
  transition: background .12s, border-color .12s; border-bottom: none;
}
.cite:hover { background: var(--accent-hover-row); color: var(--accent-deep); border-color: var(--accent); }
.cite.unresolved { background: var(--bg-soft); color: var(--muted-2); }
.cite.unresolved:hover { border-color: var(--muted-4); color: var(--ink-3); }
.cite .cite-mark { opacity: 0.65; margin-right: 2px; }

/* ── Right aside (metadata + TOC) ──────────────────────── */
.aside {
  position: sticky; top: 53px; align-self: start;
  height: calc(100vh - 53px); overflow-y: auto;
  padding: 26px 20px 60px 4px; display: none;
}
@media (min-width: 1180px) { .layout.has-aside .aside { display: block; } }

.panel {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 15px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.panel-title {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.3px; color: var(--muted-3); margin-bottom: 10px;
}
.meta-row { display: flex; gap: 8px; font-size: 12px; margin: 6px 0; line-height: 1.5; }
.meta-row .k {
  flex: 0 0 78px; color: var(--muted-3); font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.3px; padding-top: 1px;
}
.meta-row .v { flex: 1; color: var(--ink-3); min-width: 0; word-break: break-word; }
.meta-row .v a { word-break: break-all; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.chip {
  display: inline-flex; align-items: center; font-family: var(--mono); font-size: 10.5px;
  padding: 2px 7px; border-radius: 5px; background: var(--bg-soft);
  border: 1px solid var(--border-soft); color: var(--muted); cursor: pointer; transition: all .12s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.chip.ext::after { content: "β†—"; margin-left: 4px; opacity: 0.5; font-size: 0.9em; }
.chip.res { background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; }

.toc { line-height: 1.4; }
.toc a {
  display: block; font-size: 12px; color: var(--muted-2); padding: 3px 0 3px 10px;
  border-left: 2px solid var(--border-soft); transition: all .12s;
}
.toc a:hover { color: var(--ink); border-left-color: var(--muted-3); }
.toc a.h3 { padding-left: 22px; font-size: 11.5px; }
.toc a.active { color: var(--accent-deep); border-left-color: var(--accent); font-weight: 500; }

.oq-list { list-style: none; margin: 0 !important; }
.oq-list li {
  font-size: 12px; color: var(--ink-3); padding: 8px 0; border-bottom: 1px solid var(--border-soft);
  line-height: 1.5;
}
.oq-list li:last-child { border-bottom: none; }
.oq-list li::before { content: "?"; color: var(--accent); font-family: var(--mono); font-weight: 600; margin-right: 7px; }

/* ── Home view ─────────────────────────────────────────── */
.home { padding: 40px 38px 80px; max-width: 780px; margin: 0 auto; }
@media (max-width: 760px) { .home { padding: 28px 18px 60px; } }

/* ── Hero + foreword (the "book intro") ────────────────── */
.hero { margin-bottom: 22px; }
.hero h1 {
  font-family: var(--mono); font-weight: 600; font-size: 38px; line-height: 1.1;
  letter-spacing: -0.5px; color: var(--ink); margin-bottom: 14px;
}
.hero h1 .dot { color: var(--accent); }
.hero-tag { font-size: 17px; line-height: 1.5; color: var(--muted); font-weight: 300; max-width: 640px; }

.foreword { margin: 26px 0 24px; }
.foreword p {
  font-size: 15.5px; line-height: 1.72; color: var(--ink-2); font-weight: 300;
  margin: 0 0 14px;
}
.foreword p:last-child { margin-bottom: 0; }
.foreword em { font-style: italic; color: var(--ink); }
.foreword strong { font-weight: 600; color: var(--ink); }
.foreword abbr, .prose abbr { text-decoration: none; border-bottom: 1px dotted var(--muted-4); cursor: help; font-weight: 500; color: var(--ink); }
/* acronym hovers inside article prose β€” subtle (there can be many); inherit color, faint underline */
.prose abbr.ac { font-weight: inherit; color: inherit; border-bottom: 1px dotted var(--muted-5); }
/* in-article Β§N section references */
.prose a.secref {
  color: var(--accent); border-bottom: 1px dotted color-mix(in srgb, var(--accent) 45%, transparent);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.prose a.secref:hover { border-bottom-style: solid; }
/* inline `code` that resolves to a topic β†’ a link, styled like a code chip in accent */
.prose a.topicref { text-decoration: none; border: none; }
.prose a.topicref code {
  color: var(--accent-deep); background: var(--accent-soft); border-color: transparent;
  cursor: pointer; transition: box-shadow .12s;
}
.prose a.topicref:hover code { box-shadow: inset 0 -1px 0 var(--accent); }
.prose a.topicref::after { content: " β†—"; font-size: 0.8em; color: var(--accent); opacity: 0.55; }

/* slim stats line β€” present but subordinate to the narrative */
.home-stats {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0;
  font-family: var(--mono); font-size: 12px; color: var(--muted-2);
  padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 8px; font-variant-numeric: tabular-nums;
}
.home-stats a, .home-stats span { color: var(--muted); text-decoration: none; }
.home-stats a:hover { color: var(--accent); }
.home-stats b { color: var(--accent); font-weight: 600; }
.home-stats .sep { color: var(--muted-4); margin: 0 12px; }

.section-head {
  font-family: var(--mono); font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--ink-3); margin: 34px 0 6px;
  display: flex; align-items: center; gap: 10px;
}
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.section-lead { font-size: 13px; color: var(--muted-2); margin: 0 0 14px; line-height: 1.5; }

/* Start-here featured cards */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 15px 16px; cursor: pointer; transition: all .15s; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.feature-card .fc-cat { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent); }
.feature-card .fc-title { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.feature-card .fc-scope { font-size: 12px; color: var(--muted-2); line-height: 1.45; }

/* latest updates feed */
.updates { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); box-shadow: var(--shadow); overflow: hidden; }
.upd { display: flex; align-items: baseline; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border-soft); text-decoration: none; transition: background .12s; }
.upd:last-child { border-bottom: none; }
.upd:hover { background: var(--bg-soft); }
.upd-kind {
  flex: 0 0 auto; font-family: var(--mono); font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 2px 6px; border-radius: 4px; width: 48px; text-align: center; align-self: center;
  background: var(--bg-soft); color: var(--muted-2); border: 1px solid var(--border-soft);
}
.upd-kind.k-topic { background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; }   /* new topic node */
.upd-kind.k-edit { background: var(--bg-soft); color: var(--muted); border-color: var(--border); }             /* modified */
.upd-kind.k-source { background: none; color: var(--muted-3); }                                                /* new source */
.upd-title { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upd:hover .upd-title { color: var(--accent-deep); }
.upd-meta { flex: 0 0 auto; font-family: var(--mono); font-size: 10px; color: var(--muted-4); display: flex; gap: 8px; align-items: baseline; }
.upd-time { color: var(--muted-3); }
@media (max-width: 640px) { .upd-title { white-space: normal; } .upd-meta { display: none; } }

.built-open {
  margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted-2); line-height: 1.6;
}
.built-open a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); }
.built-open a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.cat-block { margin-bottom: 22px; }
.cat-name {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted-2); margin-bottom: 8px;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 15px 16px; cursor: pointer; transition: all .15s; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; min-height: 84px;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card .c-title { font-family: var(--mono); font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.card .c-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.card .c-id { font-family: var(--mono); font-size: 10px; color: var(--muted-4); letter-spacing: 0.2px; }

/* source rows on home */
.src-row {
  display: flex; align-items: baseline; gap: 12px; padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft); cursor: pointer; transition: background .12s; border-radius: 6px;
}
.src-row:hover { background: var(--bg-soft); }
/* title leads; the id is a de-emphasized reference tag at the end */
.src-row .sr-title { font-size: 13.5px; color: var(--ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-row .sr-year { font-family: var(--mono); font-size: 11px; color: var(--muted-4); white-space: nowrap; }
.src-row .sr-id { font-family: var(--mono); font-size: 10.5px; color: var(--muted-4); white-space: nowrap; flex: 0 0 auto; }

/* ── Sources browser (#/sources, main area) ────────────── */
.src-browser { max-width: 920px; }
.src-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 6px; }
.src-search-wrap { position: relative; flex: 1 1 280px; }
.src-search-wrap::before { content: "βŒ•"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-3); font-size: 15px; }
.src-search { width: 100%; font-family: var(--sans); font-size: 13.5px; padding: 9px 12px 9px 32px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); color: var(--ink); }
.src-search:focus { outline: none; border-color: var(--accent); }
.src-browser .sort-switch { margin: 0; flex: 0 0 auto; width: auto; }
.src-browser .ns-chips { margin: 0 0 10px; }
.src-browser .cov-chips { margin-top: 2px; }
.cov-note { font-size: 12px; color: var(--muted-2); margin: 0 2px 12px; }
.cov-note b { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.src-browser .list-meta { padding: 2px 4px 8px; }

/* ── States ───────────────────────────────────────────── */
.loading, .error-box {
  padding: 40px; text-align: center; color: var(--muted-2); font-family: var(--mono); font-size: 13px;
}
.error-box { color: var(--danger); }
.spinner {
  width: 22px; height: 22px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skel { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border-soft) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%; animation: sh 1.3s infinite; border-radius: 5px; }
@keyframes sh { to { background-position: -200% 0; } }

/* footer */
.foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; color: var(--muted-3); display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted-2); }

/* ── Responsive sidebar ────────────────────────────────── */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 290px; z-index: 100;
    height: 100vh; transform: translateX(-100%); transition: transform .2s;
    box-shadow: var(--shadow); padding-top: 60px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; }
  body.nav-open .nav-scrim { display: block; }
}
@media (min-width: 901px) { .nav-scrim { display: none !important; } }

/* ── Collapsible taxonomy tree (topics sidebar) ────────── */
.nav-cat { margin-bottom: 10px; }
.nav-cat-head {
  display: flex; align-items: baseline; gap: 7px; width: 100%; padding: 5px 6px; cursor: pointer;
  border-radius: 5px; background: none; border: none; text-align: left;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; letter-spacing: 0;
  color: var(--ink); transition: background .12s;
}
.nav-cat-head:hover { background: var(--bg-soft); }
/* fold indicator lives at the far right; points down when open, left when collapsed */
.nav-cat-head .caret { font-size: 18px; line-height: 1; color: var(--muted-2); transition: transform .15s, color .12s; width: 16px; text-align: center; align-self: center; flex: none; order: 3; }
.nav-cat-head:hover .caret { color: var(--ink-3); }
.nav-cat-head.collapsed .caret { transform: rotate(-90deg); }
.nav-cat-head .cat-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; order: 1; }
.nav-cat-head .cat-count { order: 2; }
.nav-cat-head .cat-count {
  font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--muted-4); font-variant-numeric: tabular-nums;
}
.nav-cat-head .cat-count .w { color: var(--accent); font-weight: 600; }
/* items sit visually under their (bolder) heading */
.nav-cat-body { padding-left: 16px; margin-top: 1px; border-left: 1px solid var(--border-soft); margin-left: 9px; }
.nav-cat-body.collapsed { display: none; }
.nav-cat-body .nav-item { font-size: 12.5px; }
/* deeper sub-categories: slightly smaller/muted headers, and less margin so nesting stays compact */
.nav-cat-head.lvl-2 { font-size: 12.5px; }
.nav-cat-head.lvl-3, .nav-cat-head.lvl-4 { font-size: 12px; color: var(--ink-3); }
.nav-cat-body .nav-cat { margin-bottom: 2px; }
/* a node that is itself an article AND has sub-articles: the header label links to
   its own article, and only the caret toggles the sub-articles */
.nav-cat-head.has-page { cursor: default; }
.nav-cat-head .caret { cursor: pointer; }
.nav-cat-head .cat-link { color: inherit; text-decoration: none; cursor: pointer; }
.nav-cat-head .cat-link:hover, .nav-cat-head .cat-link.active { color: var(--accent); }
/* an article-with-children reads like a normal article entry (not a bold category
   header) β€” the right-side caret is the only cue that it also unfolds */
/* an article-with-subpages should be visually identical to a leaf .nav-item β€” same
   weight, colour, and left indent β€” differing ONLY by the fold caret on the right */
.nav-cat-head.has-page { font-weight: 300; font-size: 12.5px; padding: 5px 9px; border-left: 2px solid transparent; }
.nav-cat-head.has-page .cat-link { color: var(--ink-3); font-weight: 300; }
.nav-cat-head.has-page:hover .cat-link { color: var(--ink); }
.nav-cat-head.has-page:has(.cat-link.active) { background: var(--accent-soft); border-left-color: var(--accent); }
.nav-cat-head.has-page .cat-link.active { color: var(--accent-deep); font-weight: 500; }

/* ── Namespace filter chips (sources sidebar) ──────────── */
.ns-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.ns-chip {
  font-family: var(--mono); font-size: 10px; padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--muted-2); cursor: pointer; transition: all .12s;
}
.ns-chip:hover { border-color: var(--muted-3); color: var(--ink); }
.ns-chip.active { background: var(--ink); color: var(--bg-card); border-color: var(--ink); }
[data-theme="dark"] .ns-chip.active { background: var(--accent); border-color: var(--accent); color: #0b1220; }
.ns-chip .c { opacity: 0.6; }
.list-meta {
  font-family: var(--mono); font-size: 10px; color: var(--muted-4); letter-spacing: 0.2px;
  padding: 8px 9px 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.list-meta .hint { color: var(--muted-5); }

/* ── Home: the Contents tree (rollup words + references) ── */
.tree { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); box-shadow: var(--shadow); overflow: hidden; }
.tree-root {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding: 12px 16px;
  border-bottom: 1px solid var(--border); background: var(--bg-soft); font-variant-numeric: tabular-nums;
}
.tree-root b { color: var(--accent); font-weight: 600; }
.tree-cat { border-bottom: 1px solid var(--border-soft); }
.tree-cat:last-child { border-bottom: none; }
.tree-cat-head {
  display: flex; align-items: baseline; gap: 9px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; padding: 10px 16px; transition: background .12s;
}
.tree-cat-head:hover { background: var(--bg-soft); }
/* name fills the row so the fold caret sits at the far right */
.tree-cat-head .tc-name-wrap { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-cat-head .caret { font-size: 11px; color: var(--muted-2); transition: transform .15s, color .12s; width: 12px; text-align: center; align-self: center; flex: none; margin-left: 4px; }
.tree-cat-head:hover .caret { color: var(--ink-3); }
.tree-cat-head.collapsed .caret { transform: rotate(-90deg); }
.tree-cat-head .tc-name { font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.tree-cat-head .tc-frac { font-family: var(--mono); font-size: 10.5px; color: var(--muted-4); font-variant-numeric: tabular-nums; }
.tree-cat-head .tc-frac .w { color: var(--accent); }
.t-count {
  margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted-2);
  font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px;
}
.t-count b { color: var(--ink-3); font-weight: 600; }
.tree-cat-body { padding: 2px 16px 12px 30px; }
.tree-cat-body.collapsed { display: none; }
/* nested sub-categories in the Contents tree: no divider, smaller header, tighter indent */
.tree-cat-body .tree-cat { border-bottom: none; }
.tree-cat-body .tree-cat-head { padding: 6px 8px; }
.tree-cat-head.lvl-2 .tc-name { font-size: 12.5px; }
.tree-cat-head.lvl-3 .tc-name, .tree-cat-head.lvl-4 .tc-name { font-size: 12px; color: var(--ink-2); }
/* article-with-children: header name links to its own article, caret toggles children */
.tree-cat-head.has-page { cursor: default; }
.tree-cat-head .caret { cursor: pointer; }
.tree-cat-head a.tc-name { text-decoration: none; cursor: pointer; }
.tree-cat-head a.tc-name:hover { color: var(--accent); text-decoration: underline; }
/* article-with-children reads exactly like a leaf article row (sans, not bold mono) */
.tree-cat-head.has-page a.tc-name { font-family: var(--sans); font-weight: 300; font-size: 13px; color: var(--ink-2); }
.tree-cat-head.has-page a.tc-name:hover { color: var(--accent-deep); }
/* ...and carries the same green dot as its leaf-article siblings */
.tree-cat-head .tl-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--good); margin-right: 9px; vertical-align: middle; }
.tree-cat-body .tree-cat-body { padding: 2px 8px 8px 22px; }
/* ── file-tree connectors: link subtopics to their parent ── */
.tree-cat-body { position: relative; }
.tree-cat-body > .tree-leaf, .tree-cat-body > .tree-cat { position: relative; }
/* vertical spine β€” one segment per child; they stack into a continuous line */
.tree-cat-body > .tree-leaf::before, .tree-cat-body > .tree-cat::before {
  content: ""; position: absolute; left: -13px; top: 0; bottom: 0; border-left: 1px solid var(--border);
}
/* last child: stop the spine at its own elbow (draws the β”” corner) */
.tree-cat-body > .tree-leaf:last-child::before, .tree-cat-body > .tree-cat:last-child::before {
  bottom: auto; height: 13px;
}
/* horizontal elbow reaching from the spine to the row */
.tree-cat-body > .tree-leaf::after, .tree-cat-body > .tree-cat > .tree-cat-head::after {
  content: ""; position: absolute; left: -13px; top: 13px; width: 11px; border-top: 1px solid var(--border);
}
.tree-cat-body > .tree-cat > .tree-cat-head { position: relative; }
.tree-desc { font-size: 12px; color: var(--muted-2); line-height: 1.5; margin: 0 0 8px; max-width: 640px; }
.tree-leaf {
  display: flex; align-items: baseline; gap: 8px; padding: 4px 6px; border-radius: 5px;
  font-size: 13px; color: var(--ink-2); text-decoration: none; border-bottom: none;
}
a.tree-leaf { cursor: pointer; }
a.tree-leaf:hover { background: var(--bg-soft); color: var(--accent-deep); }
.tree-leaf .tl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); flex: 0 0 auto; align-self: center; }
.tree-leaf .tl-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-leaf.planned { color: var(--muted-4); cursor: default; }
.tree-leaf.planned[title] { cursor: help; }
.tree-leaf .tl-dot.planned { background: none; border: 1px solid var(--muted-5); }
.tree-leaf .tl-tag { margin-left: auto; font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted-5); }
/* inline legend dots in the section lead */
.section-lead .tl-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); vertical-align: middle; margin: 0 2px; }
.section-lead .tl-dot.planned { background: none; border: 1px solid var(--muted-5); }

/* ── Sources sort switch ───────────────────────────────── */
.sort-switch { display: flex; gap: 0; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.sort-opt {
  flex: 1; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.3px; text-transform: uppercase;
  padding: 5px 4px; border: none; background: var(--bg-card); color: var(--muted-2); cursor: pointer;
  border-right: 1px solid var(--border); transition: all .12s;
}
.sort-opt:last-child { border-right: none; }
.sort-opt:hover { color: var(--ink); background: var(--bg-soft); }
.sort-opt.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }

/* ── Cited-by panel (source page) ──────────────────────── */
.cite-loading { font-size: 11.5px; color: var(--muted-3); font-style: italic; padding: 2px 0; }
.citedby-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border-soft); cursor: pointer;
}
.citedby-row:last-child { border-bottom: none; }
.citedby-row .cb-title { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; border-bottom: none; }
.citedby-row:hover .cb-title { color: var(--accent-deep); }
.citedby-row .cb-cat { font-family: var(--mono); font-size: 9px; color: var(--muted-4); text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }

/* ============================================================
   BOOK VIEW (#/book) β€” the whole wiki as one printable document
   ============================================================ */
.book-cta {
  display: flex; align-items: center; gap: 4px; margin: 10px 0 2px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card);
  font-size: 13.5px; color: var(--ink-2); text-decoration: none; transition: all .15s; box-shadow: var(--shadow);
}
.book-cta:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-1px); }
.book-cta .arr { margin-left: auto; color: var(--accent); font-weight: 600; }

body.book-mode .sidebar, body.book-mode .aside { display: none !important; }
body.book-mode .layout { grid-template-columns: 1fr; }
body.book-mode .main { padding: 0; }

.book-toolbar {
  position: sticky; top: 53px; z-index: 40; display: flex; align-items: center; gap: 8px;
  padding: 10px 22px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.book-toolbar .spacer { flex: 1; }
.book-toolbar .bk-hint { font-size: 11.5px; color: var(--muted-3); }
@media (max-width: 640px) { .book-toolbar .bk-hint { display: none; } }

.book { max-width: 760px; margin: 0 auto; padding: 40px 40px 90px; color: var(--ink-2); }
.book .dot { color: var(--accent); }

/* title page */
.book-titlepage { text-align: center; padding: 56px 0 72px; border-bottom: 1px solid var(--border); margin-bottom: 44px; }
.bk-tp-kicker { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--accent); margin-bottom: 22px; }
.bk-tp-title { font-family: var(--mono); font-weight: 600; font-size: 42px; line-height: 1.08; color: var(--ink); margin-bottom: 22px; letter-spacing: -0.5px; }
.bk-tp-sub { font-size: 15px; line-height: 1.62; color: var(--muted); max-width: 540px; margin: 0 auto 34px; font-weight: 300; }
.bk-tp-meta { font-family: var(--mono); font-size: 12px; color: var(--muted-2); line-height: 2; }
.bk-tp-meta b { color: var(--accent); }
.bk-tp-src { color: var(--muted-4); font-size: 11px; }

/* contents */
.book-toc { margin-bottom: 20px; }
.bk-h { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--ink); margin-bottom: 18px; }
.bk-toc-part { margin: 13px 0 3px; }
.bk-toc-part a { font-family: var(--mono); font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; text-decoration: none; }
.bk-toc-num { color: var(--accent); margin-right: 8px; }
.bk-toc-art { padding-left: 28px; margin: 2px 0; }
.bk-toc-art a { font-size: 13px; color: var(--muted); cursor: pointer; text-decoration: none; }
.bk-toc-art a:hover, .bk-toc-part a:hover { color: var(--accent); }

/* parts */
.book-part { padding: 30px 0 10px; border-top: 2px solid var(--ink); margin-top: 44px; }
.bk-part-kicker { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); }
.bk-part-title { font-family: var(--mono); font-size: 30px; font-weight: 600; color: var(--ink); margin: 8px 0 12px; letter-spacing: -0.3px; }
.bk-part-desc { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 560px; }

/* articles */
.book-article { padding: 30px 0; border-top: 1px solid var(--border); }
.bk-art-cat { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted-3); }
.bk-art-title { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--ink); margin: 4px 0 14px; letter-spacing: -0.2px; }
.book-prose h1 { display: block; font-size: 20px; }

/* appendix + colophon */
.book-appendix { padding: 30px 0; border-top: 2px solid var(--ink); margin-top: 44px; }
.bk-appendix-lead { font-size: 13px; color: var(--muted); margin-bottom: 16px; max-width: 560px; }
.bk-refs { display: block; }
.bk-ref { display: grid; grid-template-columns: 150px 1fr; gap: 2px 12px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 12px; }
.bk-ref-id { font-family: var(--mono); color: var(--accent); }
.bk-ref-title { color: var(--ink-3); }
.bk-ref-url { grid-column: 2; font-family: var(--mono); font-size: 10.5px; color: var(--muted-4); }
.book-colophon { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted-3); text-align: center; line-height: 1.6; }

/* ── Print (browser "Save as PDF") ─────────────────────── */
@media print {
  .topbar, .sidebar, .aside, .nav-scrim, .book-toolbar, #hovercard, #toast, .foot, .menu-toggle { display: none !important; }
  html, body { background: #fff; color: #000; }
  .layout, .main, body.book-mode .main { display: block; padding: 0; margin: 0; }
  .book { max-width: none; margin: 0; padding: 0; color: #111; font-size: 10.5pt; }
  @page { size: A4; margin: 18mm 16mm; }
  .book-titlepage { break-after: page; border: none; padding: 30mm 0; margin: 0; }
  .book-toc { break-after: page; }
  .book-part { break-before: page; border-top: none; margin: 0; padding: 0; }
  .book-appendix { break-before: page; border-top: none; margin: 0; }
  .book-article { break-before: page; border-top: none; padding: 0; margin: 0; }   /* each topic starts a fresh page */
  .bk-art-title, .bk-part-title, .prose h2, .prose h3, .bk-art-cat { break-after: avoid; }
  .prose table, .prose pre, .prose blockquote, .katex-display, .bk-ref, .prose li { break-inside: avoid; }
  .book-prose { line-height: 1.5; }
  .book-colophon { break-before: avoid; }
  .prose a, .book a { color: #111; text-decoration: none; }
  .cite { background: none !important; border: none !important; color: #444 !important; font-size: 0.78em; padding: 0 1px; }
  .cite .cite-mark { display: none; }
  a.secref { color: #111; border: none; }
  .prose abbr.ac { border: none; }
  /* single-article print: show collapsed disclosures + drop their chrome */
  .disclosure { border: none; }
  .disclosure > summary { padding-left: 0; }
  .disclosure > summary::after { display: none; }
  .disclosure > *:not(summary) { display: block !important; }
  .page-links { display: none; }
  .prose .fig { break-inside: avoid; }
}