File size: 67,301 Bytes
59885ee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

<iframe src="data:text/html;charset=utf-8,<!DOCTYPE html>

<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>PSDLEF Γ— HIMSS β€” Four-Level Interoperability Framework</title>
<style>
:root{
  --bg:#0d1117; --bg2:#161b22; --bg3:#1c2430; --card:#1a2029; --card2:#202834;
  --text:#e6edf3; --text2:#9da7b3; --text3:#6e7a8a;
  --accent:#58a6ff; --accent2:#7ee787; --warn:#f0883e; --danger:#f85149; --purple:#bc8cff;
  --border:#30363d; --border2:#3d4753;
  --font:'Inter','SF Pro Display',system-ui,-apple-system,sans-serif;
  --mono:'JetBrains Mono','Fira Code',monospace;
  --radius:10px; --radius-lg:16px; --radius-xl:24px;
  --shadow:0 8px 32px rgba(0,0,0,.45); --shadow-sm:0 2px 8px rgba(0,0,0,.3);
  --transition:.35s cubic-bezier(.4,0,.2,1);
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.6;overflow-x:hidden}
::selection{background:var(--accent);color:var(--bg)}
/* Scrollbar */
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:var(--bg2)}
::-webkit-scrollbar-thumb{background:var(--border2);border-radius:4px}
::-webkit-scrollbar-thumb:hover{background:var(--text3)}

/* Layout */
.app{display:flex;min-height:100vh}
.sidebar{width:280px;min-width:280px;background:var(--bg2);border-right:1px solid var(--border);position:fixed;top:0;left:0;bottom:0;z-index:100;display:flex;flex-direction:column;transition:transform var(--transition)}
.sidebar-header{padding:24px 20px;border-bottom:1px solid var(--border)}
.sidebar-header h1{font-size:1.05rem;font-weight:700;letter-spacing:-.02em;line-height:1.3}
.sidebar-header h1 span{color:var(--accent)}
.sidebar-header .sub{font-size:.72rem;color:var(--text3);margin-top:4px;letter-spacing:.04em;text-transform:uppercase}
.sidebar-nav{flex:1;overflow-y:auto;padding:16px 12px}
.sidebar-nav .nav-group{margin-bottom:16px}
.sidebar-nav .nav-group-label{font-size:.68rem;color:var(--text3);text-transform:uppercase;letter-spacing:.1em;padding:8px 8px 6px;font-weight:600}
.nav-link{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;color:var(--text2);font-size:.86rem;font-weight:500;cursor:pointer;border:none;background:none;width:100%;text-align:left;transition:all .2s;text-decoration:none}
.nav-link:hover{background:var(--bg3);color:var(--text)}
.nav-link.active{background:var(--accent);color:#fff;box-shadow:0 2px 12px rgba(88,166,255,.3)}
.nav-link .icon{font-size:1rem;width:20px;text-align:center;flex-shrink:0}
.nav-link .badge{font-size:.64rem;background:var(--warn);color:#000;padding:1px 7px;border-radius:10px;font-weight:700;margin-left:auto}
.sidebar-footer{padding:16px 20px;border-top:1px solid var(--border);font-size:.7rem;color:var(--text3)}
.sidebar-footer .status-dot{display:inline-block;width:7px;height:7px;background:var(--accent2);border-radius:50%;margin-right:6px;animation:pulse 2s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}

/* Main content */
.main{margin-left:280px;flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:50;background:rgba(13,17,23,.85);backdrop-filter:blur(16px);border-bottom:1px solid var(--border);padding:14px 28px;display:flex;align-items:center;gap:16px}
.topbar .breadcrumb{font-size:.78rem;color:var(--text3);display:flex;gap:6px;align-items:center}
.topbar .breadcrumb span{color:var(--text2)}
.topbar .breadcrumb .sep{color:var(--text3)}
.topbar-spacer{flex:1}
.search-wrap{position:relative}
.search-input{background:var(--bg2);border:1px solid var(--border);border-radius:8px;padding:8px 14px 8px 36px;font-size:.82rem;color:var(--text);width:220px;font-family:var(--font);transition:all .25s}
.search-input:focus{outline:none;border-color:var(--accent);width:280px;box-shadow:0 0 0 3px rgba(88,166,255,.15)}
.search-icon{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--text3);font-size:.9rem}
.theme-toggle{background:var(--bg2);border:1px solid var(--border);border-radius:8px;padding:7px 10px;cursor:pointer;font-size:.9rem;transition:all .2s}
.theme-toggle:hover{border-color:var(--accent)}

.content{padding:32px 40px 80px;max-width:1100px;width:100%;margin:0 auto}
.section-page{display:none;animation:fadeIn .45s ease}
.section-page.active{display:block}
@keyframes fadeIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}

/* Typography */
h1.page-title{font-size:2.1rem;font-weight:800;letter-spacing:-.03em;line-height:1.15;margin-bottom:8px}
h2.section-heading{font-size:1.35rem;font-weight:700;letter-spacing:-.01em;margin:32px 0 14px;color:var(--text)}
h3.sub-heading{font-size:1.05rem;font-weight:600;margin:22px 0 10px;color:var(--text2)}
p.lead{font-size:1.05rem;color:var(--text2);line-height:1.7;margin-bottom:20px}
p{color:var(--text2);font-size:.92rem;line-height:1.7;margin-bottom:14px}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
.tag{display:inline-block;font-size:.66rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:3px 10px;border-radius:20px;margin-right:6px;margin-bottom:6px}
.tag.accent{background:rgba(88,166,255,.15);color:var(--accent)}
.tag.green{background:rgba(126,231,135,.15);color:var(--accent2)}
.tag.orange{background:rgba(240,136,62,.15);color:var(--warn)}
.tag.purple{background:rgba(188,140,255,.15);color:var(--purple)}
.tag.red{background:rgba(248,81,73,.15);color:var(--danger)}

/* Cards */
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:24px;margin-bottom:20px;box-shadow:var(--shadow-sm);transition:transform .25s,border-color .25s}
.card:hover{border-color:var(--border2)}
.card.highlight{border-left:3px solid var(--accent)}
.card.danger{border-left:3px solid var(--danger)}
.card.success{border-left:3px solid var(--accent2)}
.card.warn{border-left:3px solid var(--warn)}
.card .card-title{font-size:.95rem;font-weight:700;margin-bottom:8px;display:flex;align-items:center;gap:8px}
.card .card-icon{font-size:1.2rem}

/* Four-Level Interactive Diagram */
.level-diagram{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:28px 0}
.level-card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;cursor:pointer;position:relative;overflow:hidden;transition:all .35s;min-height:180px}
.level-card:hover{transform:translateY(-4px);border-color:var(--accent);box-shadow:var(--shadow)}
.level-card.active{border-color:var(--accent);box-shadow:0 0 0 3px rgba(88,166,255,.2)}
.level-card .level-num{font-size:2.2rem;font-weight:900;color:var(--border2);line-height:1;margin-bottom:8px;transition:color .3s}
.level-card.active .level-num{color:var(--accent)}
.level-card .level-name{font-size:.92rem;font-weight:700;margin-bottom:6px}
.level-card .level-desc{font-size:.76rem;color:var(--text3);line-height:1.5}
.level-card .level-status{position:absolute;top:12px;right:12px;font-size:.62rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;padding:2px 8px;border-radius:10px}
.status-partial{background:rgba(240,136,62,.2);color:var(--warn)}
.status-absent{background:rgba(248,81,73,.2);color:var(--danger)}
.status-failing{background:rgba(248,81,73,.2);color:var(--danger)}
.status-achieved{background:rgba(126,231,135,.2);color:var(--accent2)}
.level-detail{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;margin-top:16px;display:none}
.level-detail.visible{display:block;animation:fadeIn .3s ease}

/* Tables */
.table-wrap{overflow-x:auto;margin:18px 0;border-radius:var(--radius);border:1px solid var(--border)}
table{width:100%;border-collapse:collapse;font-size:.82rem}
thead{background:var(--bg2)}
th{padding:12px 14px;text-align:left;font-weight:600;font-size:.72rem;letter-spacing:.04em;text-transform:uppercase;color:var(--text2);border-bottom:1px solid var(--border)}
td{padding:11px 14px;border-bottom:1px solid var(--border);color:var(--text2);vertical-align:top}
tr:last-child td{border-bottom:none}
tr:hover td{background:rgba(88,166,255,.04)}
.score-cell{font-weight:700;text-align:center;font-family:var(--mono);font-size:.9rem}
.score-0{color:var(--danger)}
.score-1{color:var(--warn)}
.score-2{color:var(--accent)}
.score-3{color:var(--accent2)}

/* Rubric calculator */
.rubric-calculator{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:24px;margin:20px 0}
.rubric-controls{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.rubric-btn{background:var(--bg2);border:1px solid var(--border);border-radius:8px;padding:8px 16px;font-size:.78rem;font-weight:600;cursor:pointer;color:var(--text2);transition:all .2s;font-family:var(--font)}
.rubric-btn:hover{border-color:var(--accent);color:var(--text)}
.rubric-btn.active{background:var(--accent);border-color:var(--accent);color:#fff}
.rubric-score-display{display:flex;gap:20px;align-items:center;margin-top:16px;flex-wrap:wrap}
.rubric-total{font-size:2rem;font-weight:900;font-family:var(--mono)}
.rubric-band{padding:6px 14px;border-radius:8px;font-size:.78rem;font-weight:600}

/* Charts */
.chart-container{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;margin:18px 0}
.chart-title{font-size:.82rem;font-weight:600;color:var(--text2);margin-bottom:12px}
.bar-chart{display:flex;flex-direction:column;gap:8px}
.bar-row{display:flex;align-items:center;gap:12px}
.bar-label{width:160px;font-size:.76rem;color:var(--text2);text-align:right;flex-shrink:0}
.bar-track{flex:1;background:var(--bg3);border-radius:6px;height:22px;overflow:hidden;position:relative}
.bar-fill{height:100%;border-radius:6px;transition:width 1.2s cubic-bezier(.4,0,.2,1);display:flex;align-items:center;justify-content:flex-end;padding-right:8px;font-size:.68rem;font-weight:700;color:#fff;min-width:30px}
.bar-fill.l1{background:linear-gradient(90deg,#58a6ff,#3b82f6)}
.bar-fill.l2{background:linear-gradient(90deg,#7ee787,#22c55e)}
.bar-fill.l3{background:linear-gradient(90deg,#f0883e,#ea580c)}
.bar-fill.l4{background:linear-gradient(90deg,#f85149,#dc2626)}

/* Radar chart */
.radar-svg{width:100%;max-width:500px;margin:0 auto;display:block}

/* Math */
.math-block{background:var(--bg2);border:1px solid var(--border);border-left:3px solid var(--purple);border-radius:var(--radius);padding:16px 20px;margin:16px 0;font-family:var(--mono);font-size:.82rem;color:var(--text);overflow-x:auto;line-height:1.8}
.math-block .comment{color:var(--text3);font-style:italic}

/* Callout */
.callout{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px 24px;margin:20px 0;display:flex;gap:14px;align-items:flex-start}
.callout .callout-icon{font-size:1.3rem;flex-shrink:0;margin-top:2px}
.callout.accent{border-left:3px solid var(--accent)}
.callout.danger{border-left:3px solid var(--danger)}
.callout.success{border-left:3px solid var(--accent2)}
.callout .callout-content p{margin:0;font-size:.85rem}

/* Tabs */
.tabs{display:flex;gap:4px;margin-bottom:16px;border-bottom:1px solid var(--border);overflow-x:auto}
.tab{padding:10px 18px;font-size:.8rem;font-weight:600;cursor:pointer;color:var(--text3);border:none;background:none;border-bottom:2px solid transparent;white-space:nowrap;font-family:var(--font);transition:all .2s}
.tab:hover{color:var(--text)}
.tab.active{color:var(--accent);border-bottom-color:var(--accent)}
.tab-content{display:none}
.tab-content.active{display:block;animation:fadeIn .3s ease}

/* Skeleton loader */
.skeleton{background:linear-gradient(90deg,var(--bg2) 25%,var(--bg3) 50%,var(--bg2) 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:8px;margin-bottom:12px}
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.skeleton.title{height:36px;width:60%}
.skeleton.text{height:14px;width:90%}
.skeleton.text.short{width:60%}
.skeleton.card{height:120px}

/* Modal */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.7);backdrop-filter:blur(6px);z-index:200;display:none;align-items:center;justify-content:center;padding:24px}
.modal-overlay.visible{display:flex}
.modal{background:var(--card);border:1px solid var(--border2);border-radius:var(--radius-xl);max-width:640px;width:100%;max-height:80vh;overflow-y:auto;padding:32px;box-shadow:var(--shadow);animation:modalIn .3s ease}
@keyframes modalIn{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}
.modal h3{font-size:1.2rem;font-weight:700;margin-bottom:12px}
.modal .close-btn{position:absolute;top:16px;right:16px;background:none;border:none;color:var(--text3);font-size:1.4rem;cursor:pointer}
.modal .close-btn:hover{color:var(--text)}

/* Responsive */
@media(max-width:900px){
.sidebar{transform:translateX(-100%)}
.sidebar.open{transform:translateX(0)}
.main{margin-left:0}
.level-diagram{grid-template-columns:1fr 1fr}
.content{padding:20px}
.topbar{padding:10px 16px}
.hamburger{display:block!important}
.bar-label{width:100px;font-size:.68rem}
}
.hamburger{display:none;background:none;border:none;color:var(--text);font-size:1.4rem;cursor:pointer;padding:4px}

/* Print */
@media print{
.sidebar,.topbar,.hamburger{display:none!important}
.main{margin-left:0}
.content{padding:0}
.section-page{display:block!important}
}
</style>

</head>
<body>
<div class='app'>
  <!-- Sidebar -->
  <aside class='sidebar' id='sidebar'>
    <div class='sidebar-header'>
      <h1><span>PSDLEF</span> Γ— HIMSS</h1>
      <div class='sub'>Four-Level Interoperability Framework</div>
    </div>
    <nav class='sidebar-nav' id='sidebarNav'>
      <div class='nav-group'>
        <div class='nav-group-label'>Overview</div>
        <button class='nav-link active' data-section='abstract'><span class='icon'>β—ˆ</span>Abstract</button>
        <button class='nav-link' data-section='introduction'><span class='icon'>πŸ“‹</span>Introduction</button>
      </div>
      <div class='nav-group'>
        <div class='nav-group-label'>Framework</div>
        <button class='nav-link' data-section='four-levels'><span class='icon'>πŸ—οΈ</span>Four Levels <span class='badge'>Interactive</span></button>
        <button class='nav-link' data-section='diagnostic'><span class='icon'>πŸ”¬</span>Diagnostic Analysis</button>
      </div>
      <div class='nav-group'>
        <div class='nav-group-label'>Theoretical Core</div>
        <button class='nav-link' data-section='sil'><span class='icon'>🧠</span>SIL Specification</button>
        <button class='nav-link' data-section='analogy'><span class='icon'>πŸ”—</span>Genomic-SEM Analogy</button>
      </div>
      <div class='nav-group'>
        <div class='nav-group-label'>Methods</div>
        <button class='nav-link' data-section='rubric'><span class='icon'>πŸ“Š</span>Scoring Rubric <span class='badge'>Calculator</span></button>
        <button class='nav-link' data-section='worked-example'><span class='icon'>πŸ“ˆ</span>Worked Example</button>
      </div>
      <div class='nav-group'>
        <div class='nav-group-label'>Discussion</div>
        <button class='nav-link' data-section='implications'><span class='icon'>πŸ’­</span>Implications</button>
        <button class='nav-link' data-section='references'><span class='icon'>πŸ“š</span>References</button>
      </div>
    </nav>
    <div class='sidebar-footer'>
      <span class='status-dot'></span>Framework v1.0 Β· September 2026<br>
      <span style='color:var(--text3)'>Theoretical Paper β€” PSDLEF Program of Research</span>
    </div>
  </aside>

  <!-- Main -->

  <div class='main'>
    <header class='topbar'>
      <button class='hamburger' id='hamburger' aria-label='Toggle sidebar'>☰</button>
      <div class='breadcrumb'>
        <span>PSDLEF Γ— HIMSS</span>
        <span class='sep'>β€Ί</span>
        <span id='breadcrumbCurrent'>Abstract</span>
      </div>
      <div class='topbar-spacer'></div>
      <div class='search-wrap'>
        <span class='search-icon'>πŸ”</span>
        <input type='text' class='search-input' id='searchInput' placeholder='Search framework...' autocomplete='off'>
      </div>
      <button class='theme-toggle' id='themeToggle' title='Toggle theme'>πŸŒ“</button>
    </header>

  </div>
</div>

<!-- Modal -->

<div class='modal-overlay' id='modalOverlay'>
  <div class='modal' id='modalContent'>
    <button class='close-btn' id='modalClose'>βœ•</button>
    <div id='modalBody'></div>
  </div>
</div>

<script>
(function(){
'use strict';

// ── Content Registry ──────────────────────────────────────────────
const sections = {};

sections.abstract = {
  title: 'Abstract',
  render: () => `
    <h1 class='page-title'>A Four-Level Interoperability Framework for Pro&nbsp;Se Disability Adjudication</h1>
    <p class='lead' style='color:var(--text3);font-size:.88rem'>Re-specifying the PSDLEF Litigant-Services Architecture Through HIMSS Interoperability Theory</p>
    <div style='display:flex;gap:6px;flex-wrap:wrap;margin:14px 0 24px'>
      <span class='tag accent'>Theoretical Paper</span>
      <span class='tag purple'>HIMSS Interoperability</span>
      <span class='tag green'>PSDLEF</span>
      <span class='tag orange'>Pro Se Litigation</span>
      <span class='tag red'>SSA Adjudication</span>
    </div>
    <div class='card highlight'>
      <div class='card-title'><span class='card-icon'>βœ‹</span>One-Sentence Thesis</div>
      <p style='margin:0;font-size:.95rem;color:var(--text)'>The American disability-adjudication system is failing <em>not</em> primarily because data is missing, but because the data that <em>does</em> exist β€” medical records, functional assessments, work history, imaging, genomic evidence, lay testimony β€” cannot be made <strong>meaningfully shared</strong> across the actors who must interpret it.</p>
    </div>
    <div class='card'>
      <div class='card-title'><span class='card-icon'>πŸ“„</span>Abstract</div>
      <p>The Pro Se Disability Litigant Empowerment Foundation (PSDLEF) has been proposed as a perpetual purpose trust integrating algorithmic capital stewardship, a Baltimore-based solar-microgrid housing portfolio, and AI-assisted legal advocacy for self-represented disability litigants. The PSDLEF framework specifies <em>what</em> the Foundation builds, but does not specify through <em>what interoperable architecture</em> litigants, evidence, artificial intelligence, federal courts, and the Social Security Administration can establish shared meaning over the same underlying record.</p>
      <p>This paper advances the thesis that the failure of pro se disability adjudication is, at root, an <strong>interoperability failure</strong> β€” and specifically a failure of the <em>semantic</em> and <em>organizational</em> layers as defined by the Healthcare Information and Management Systems Society (HIMSS).</p>
      <p>We re-specify the PSDLEF litigant-services architecture as a four-level interoperability stack, introduce a <strong>Semantic Interoperability Layer (SIL)</strong> as the framework's principal theoretical contribution, and provide methods exhibits that operationalize HIMSS's levels into a scoring rubric and a worked example.</p>
      <p>The contribution is theoretical: a unifying model for evaluating, comparing, and designing AI-assisted disability-litigation systems against an established healthcare informatics standard.</p>
    </div>
    <div style='display:grid;grid-template-columns:1fr 1fr;gap:16px'>
      <div class='card success'>
        <div class='card-title'><span class='card-icon'>🎯</span>Contribution</div>
        <p style='margin:0;font-size:.84rem'>A four-level interoperability model of pro se disability adjudication, applied to PSDLEF, with SIL as the principal new component.</p>
      </div>
      <div class='card warn'>
        <div class='card-title'><span class='card-icon'>πŸ“</span>Methods Exhibits</div>
        <p style='margin:0;font-size:.84rem'>Scoring rubric (Exhibit A) and worked example on PSDLEF modules (Exhibit B).</p>
      </div>
    </div>
  `
};

sections.introduction = {
  title: 'Introduction',
  render: () => `
    <h1 class='page-title'>Introduction</h1>
    <div class='card highlight'>
      <div class='card-title'><span class='card-icon'>⚑</span>The Problem in One Sentence</div>
      <p style='margin:0;font-size:.95rem;color:var(--text)'>The American disability-adjudication system is failing not primarily because data is missing, but because the data that does exist cannot be made <strong>meaningfully shared</strong> across the actors who must interpret it: the claimant, the representative, the AI assistant, the administrative law judge, the Appeals Council, and the federal court.</p>
    </div>
    <h2 class='section-heading'>What This Paper Argues</h2>
    <p>We argue that the analytic language needed to describe and remedy this failure <em>already exists</em> β€” it was developed by the Healthcare Information and Management Systems Society (HIMSS) to diagnose exactly analogous problems in health information technology. HIMSS distinguishes four levels of interoperability: <strong>Foundational, Structural, Semantic,</strong> and <strong>Organizational</strong>.</p>
    <p>In clinical informatics, these levels describe the successive capabilities required to move from a system that can merely transmit a lab result, to a system that can interpret it in the same way as the sender, under a governance regime that authorises and constrains the exchange.</p>
    <div class='callout accent'>
      <span class='callout-icon'>πŸ’‘</span>
      <div class='callout-content'><p><strong>The move:</strong> In pro se disability adjudication, the same four-level decomposition explains β€” and prescribes β€” what is missing. What is absent is a <strong>Semantic Interoperability Layer (SIL)</strong>: a normative, evidence-mapping component that translates heterogeneous disability evidence into a common, adjudicator-legible representation of functional impairment.</p></div>
    </div>
    <h2 class='section-heading'>Scope and Contribution</h2>
    <div class='card'>
      <p style='margin:0'>This is a <strong>theoretical paper</strong>. The contribution is conceptual: a four-level interoperability model of pro se disability adjudication, applied to the PSDLEF framework, with a Semantic Interoperability Layer introduced as the framework's principal new component. Methods are presented as exhibits. We do not present empirical results; we present a model that makes empirical results possible by giving the field a common evaluative vocabulary.</p>
    </div>
  `
};

sections['four-levels'] = {
  title: 'Four Levels',
  render: () => `
    <h1 class='page-title'>The HIMSS Four-Level Interoperability Model</h1>
    <p class='lead'>The working standard for describing how systems exchange data and meaning β€” adapted from clinical informatics to disability adjudication.</p>
    <div class='level-diagram' id='levelDiagram'>
      ${buildLevelCards()}
    </div>
    <div class='level-detail' id='levelDetail'></div>
    <h2 class='section-heading'>Formal Definitions</h2>
    <div class='table-wrap'>
      <table>
        <thead><tr><th>Level</th><th>Name</th><th>Core Capability</th><th>Failure Mode</th></tr></thead>
        <tbody>
          <tr><td><strong>1</strong></td><td>Foundational</td><td>System A can send data to System B</td><td style='color:var(--danger)'>"Pipes open, nothing useful arrives"</td></tr>
          <tr><td><strong>2</strong></td><td>Structural</td><td>Data exchanged in defined format/syntax (HL7 FHIR, C-CDA)</td><td style='color:var(--danger)'>"Receiving system has the file but cannot parse fields"</td></tr>
          <tr><td><strong>3</strong></td><td>Semantic</td><td>Receiving system interprets data with same meaning (SNOMED CT, LOINC, ICD-10)</td><td style='color:var(--danger)'>"Both store 'HbA1c' but disagree on units and reference ranges"</td></tr>
          <tr><td><strong>4</strong></td><td>Organizational</td><td>Governance, policy, trust, consent frameworks across organizations</td><td style='color:var(--danger)'>"Technically perfect exchange, legally blocked"</td></tr>
        </tbody>
      </table>
    </div>
    <div class='callout accent'>
      <span class='callout-icon'>πŸ“</span>
      <div class='callout-content'><p><strong>Hierarchy:</strong> Levels are cumulative β€” each presupposes the prior. Foundational is necessary but insufficient for semantic; semantic is necessary but insufficient for organizational.</p></div>
    </div>
  `,
  init: () => initLevelDiagram()
};

function buildLevelCards(){
  const levels = [
    {num:1, name:'Foundational', desc:'Establishes inter-connectivity requirements for systems to securely communicate data.', status:'Partial', statusClass:'status-partial', color:'#58a6ff'},
    {num:2, name:'Structural', desc:'Defines format, syntax, and organization of data exchange at the data-field level.', status:'Absent', statusClass:'status-absent', color:'#7ee787'},
    {num:3, name:'Semantic', desc:'Provides common underlying models and codification for shared understanding and meaning.', status:'Absent', statusClass:'status-absent', color:'#f0883e'},
    {num:4, name:'Organizational', desc:'Includes governance, policy, social, legal, and organizational considerations.', status:'Failing', statusClass:'status-failing', color:'#f85149'}
  ];
  return levels.map((l,i) => `
    <div class='level-card' data-level='${l.num}' data-detail='${l.num}' style='cursor:pointer'>
      <span class='level-status ${l.statusClass}'>${l.status}</span>
      <div class='level-num' style='color:${l.color}'>${String(l.num).padStart(2,'0')}</div>
      <div class='level-name'>${l.name}</div>
      <div class='level-desc'>${l.desc}</div>
    </div>
  `).join('');
}

const levelDetails = {
  1: {name:'Foundational Interoperability', status:'Partially Achieved', color:'var(--warn)',
    content:`<p>Electronic data exchange between SSA, state Disability Determination Services (DDS), some EHRs, and some federal courts is technically possible. SSA's Electronic Records Express (ERE), Health Information Exchange (HIE) infrastructure, and TEFCA's QHINs provide underlying connectivity.</p>
    <p><strong>Gap:</strong> The "last mile" to the pro se litigant is weak. Claimants submit paper records, paper SSA-827 forms, unstructured PDFs. From the litigant's vantage, the foundational layer feels like a wall of fax machines.</p>
    <div class='callout danger'><span class='callout-icon'>⚠️</span><div class='callout-content'><p><strong>Failure mode:</strong> "Pipes open to the agency's side, closed on the claimant's side."</p></div></div>`},
  2: {name:'Structural Interoperability', status:'Largely Absent', color:'var(--danger)',
    content:`<p>SSA internal data models (DDS disability folder, eView, AC database) are internally structured but <strong>not exposed</strong> in standard interoperable formats to claimants, representatives, or AI tools. There is no FHIR-equivalent API for "give me a claimant's complete disability record in structured form."</p>
    <p><strong>Gap:</strong> A pro se litigant's medical record exported from SSA may be a flat PDF; CE reports are free-text with no field-level structure.</p>
    <div class='callout danger'><span class='callout-icon'>⚠️</span><div class='callout-content'><p><strong>Failure mode:</strong> "Receiving system has the file but cannot parse the fields."</p></div></div>`},
  3: {name:'Semantic Interoperability', status:'Critical Failure', color:'var(--danger)',
    content:`<p><strong>The central problem.</strong> Disability evidence is <em>meaning</em> β€” the meaning of a diagnosis for <em>this claimant's</em> specific functional limitations for <em>this type of work</em>. Three semantic failures:</p>
    <ol style='padding-left:20px;color:var(--text2);font-size:.85rem;line-height:1.7'>
      <li><strong>Diagnostic β†’ functional translation failure</strong>: A DSM-5 or ICD-10 diagnosis is not a work-disability statement.</li>
      <li><strong>Medical-record β†’ legal-issue translation failure</strong>: Same record read by physician (clinical frame), CE provider (adjudicatory frame), DDS (regulatory frame), ALJ (legal frame), court (constitutional frame).</li>
      <li><strong>Genomic / neuroimaging translation failure</strong>: Polygenic risk scores, hippocampal volumes, executive-function latent factors β€” none has an SSA semantic profile.</li>
    </ol>
    <div class='callout danger'><span class='callout-icon'>⚠️</span><div class='callout-content'><p><strong>Failure mode:</strong> "Both systems store 'impairment' but disagree on what counts, how severe, and what work it precludes."</p></div></div>`},
  4: {name:'Organizational Interoperability', status:'Failing', color:'var(--danger)',
    content:`<p>Requires governance, policy, trust, and consent frameworks across organizational boundaries. In disability adjudication, this is the procedural and constitutional regime: APA, Social Security Act, Due Process, Rehabilitation Act Β§504, <em>Mathews v. Eldridge</em>, mandamus remedies.</p>
    <p><strong>The data:</strong> 30,000 deaths-while-pending in FY2023; 60–65% federal-court remand rates; two-thirds of remanded cases ultimately awarded benefits.</p>
    <div class='callout danger'><span class='callout-icon'>⚠️</span><div class='callout-content'><p><strong>Failure mode:</strong> "Technically meaningful records, semantically interpretable, blocked from producing timely legal effect."</p></div></div>`}
};

function initLevelDiagram(){
  const cards = document.querySelectorAll('.level-card');
  const detail = document.getElementById('levelDetail');
  cards.forEach(card => {
    card.addEventListener('click', () => {
      cards.forEach(c => c.classList.remove('active'));
      card.classList.add('active');
      const lv = parseInt(card.dataset.level);
      const d = levelDetails[lv];
      detail.innerHTML = `
        <h3 style='margin-bottom:8px;color:${d.color}'>Level ${lv} β€” ${d.name}</h3>
        <div style='margin-bottom:12px'><span class='tag ${lv===1?'orange':'red'}' style='font-size:.7rem'>${d.status}</span></div>
        ${d.content}
      `;
      detail.classList.add('visible');
    });
  });
  // Auto-select first
  cards[0]?.click();
}

sections.diagnostic = {
  title: 'Diagnostic Analysis',
  render: () => `
    <h1 class='page-title'>Diagnostic: The Current Adjudicatory Stack</h1>
    <p class='lead'>Assessed against the HIMSS four-level model. Data drawn from the Research Portfolio Exhibit, PSDLEF paper, GAO reports, and SSA workload data.</p>
    <div class='table-wrap'>
      <table>
        <thead><tr><th>Level</th><th>HIMSS Health-IT Analogue</th><th>SSA / Pro Se Status</th><th>Principal Failure Mode</th></tr></thead>
        <tbody>
          <tr><td><strong>1</strong></td><td>Two systems connected</td><td><span class='tag orange' style='font-size:.66rem'>Partial</span> Agency-side yes, claimant-side no</td><td>Paper submissions, fax, PDF</td></tr>
          <tr><td><strong>2</strong></td><td>HL7 FHIR / C-CDA</td><td><span class='tag red' style='font-size:.66rem'>Absent</span> No public API, no SSA-specific profile</td><td>Medical records as opaque PDFs</td></tr>
          <tr><td><strong>3</strong></td><td>SNOMED CT / LOINC / ICD-10</td><td><span class='tag red' style='font-size:.66rem'>Largely Absent</span> No shared adjudicator-legible vocabulary for functional impairment</td><td>Diagnosis β‰  work-disability</td></tr>
          <tr><td><strong>4</strong></td><td>TEFCA, QHINs, governance</td><td><span class='tag red' style='font-size:.66rem'>Failing</span> 30,000 deaths/yr, 60–65% remand</td><td>Rights exist but no timely correction</td></tr>
        </tbody>
      </table>
    </div>
    <h2 class='section-heading'>Diagnostic Visualization</h2>
    <div class='chart-container'>
      <div class='chart-title'>SSA Adjudication System β€” Four-Level Maturity</div>
      <div class='bar-chart' id='diagChart'></div>
    </div>
    <div class='callout danger'>
      <span class='callout-icon'>πŸ”΄</span>
      <div class='callout-content'><p><strong>Diagnostic conclusion:</strong> The SSA adjudication system is <strong>Level 1/2 with catastrophic Level 3/4 failure</strong>. PSDLEF is in principle positioned to provide Level 1–4 architecture for pro se litigants β€” but only if its modules are explicitly re-specified in interoperability terms.</p></div>
    </div>
  `,
  init: () => initDiagChart()
};

function initDiagChart(){
  const data = [
    {label:'L1 Foundational', pct:45, color:'l1', score:'Partial'},
    {label:'L2 Structural', pct:20, color:'l2', score:'Absent'},
    {label:'L3 Semantic', pct:10, color:'l3', score:'Absent'},
    {label:'L4 Organizational', pct:15, color:'l4', score:'Failing'}
  ];
  const container = document.getElementById('diagChart');
  if(!container) return;
  container.innerHTML = data.map((d,i) => `
    <div class='bar-row'>
      <div class='bar-label'>${d.label}</div>
      <div class='bar-track'>
        <div class='bar-fill ${d.color}' style='width:0%;transition-delay:${i*150}ms' data-width='${d.pct}'>${d.score}</div>
      </div>
    </div>
  `).join('');
  requestAnimationFrame(() => {
    setTimeout(() => {
      container.querySelectorAll('.bar-fill').forEach(bar => {
        bar.style.width = bar.dataset.width + '%';
      });
    }, 100);
  });
}

sections.sil = {
  title: 'SIL Specification',
  render: () => `
    <h1 class='page-title'>The Semantic Interoperability Layer (SIL)</h1>
    <div class='card highlight'>
      <div class='card-title'><span class='card-icon'>🧠</span>The Principal Theoretical Contribution</div>
      <p style='margin:0;font-size:.95rem;color:var(--text)'>SIL is a normative, evidence-mapping function that takes heterogeneous disability evidence and produces a claimant-specific, adjudicator-legible representation of functional impairment and its work-limiting effects. It is <strong>not</strong> a database, a vocabulary, or a checklist. It is an <strong>interpretive function</strong> β€” closer in form to a latent-variable model than to a data schema.</p>
    </div>
    <h2 class='section-heading'>Formal Specification</h2>
    <p>Notation:</p>
    <div class='math-block'>
      <span class='comment'>// Let i = 1,…,n index pieces of evidence for a given claimant</span><br>
      <span class='comment'>// Let j = 1,…,m index SSA-relevant functional domains</span><br><br>
      E<sub>i</sub> = evidence piece i (type, source, date, content, coded fields)<br>
      X<sub>j</sub> = latent functional capacity in domain j (0–1 scale)<br>
      X = (X<sub>1</sub>, …, X<sub>m</sub>)<sup>⊀</sup> = vector of latent capacities
    </div>
    <h3 class='sub-heading'>Measurement Model</h3>
    <div class='math-block'>
      f<sub>i</sub>(E<sub>i</sub>) = Ξ›<sub>i</sub><sup>⊀</sup>X + Ξ΅<sub>i</sub><br><br>
      <span class='comment'>// f_i extracts measurement-relevant signal from evidence E_i</span><br>
      <span class='comment'>// Ξ›_i = vector of loadings (zero for domains evidence doesn't speak to)</span><br>
      <span class='comment'>// Ξ΅_i = evidence-specific residual</span><br><br>
      <span class='comment'>// Two mapping routes:</span><br>
      <span class='comment'>//   1. Rule-based β€” for evidence with established mappings</span><br>
      <span class='comment'>//   2. Learned β€” for evidence without (genomic, imaging, novel measures)</span>
    </div>
    <h3 class='sub-heading'>Structural Model</h3>
    <div class='math-block'>
      X = BW + ΞΆ<br><br>
      <span class='comment'>// W = overall latent work-disability construct</span><br>
      <span class='comment'>// B = vector of structural loadings</span><br>
      <span class='comment'>// ΞΆ = domain-specific residuals</span><br><br>
      <span class='comment'>// Optional: additional latent constructs (mental-health, physical,</span><br>
      <span class='comment'>// cognitive-executive factors) as simultaneous equations (Bollen 1989)</span>
    </div>
    <h3 class='sub-heading'>Estimation</h3>
    <p style='font-size:.85rem'>Parameters are estimated by minimizing the discrepancy between model-implied and observed cross-evidence consistency matrices. The observed consistency matrix is constructed by pairing each evidence piece with each other piece, coding consistency (concordant / complementary / conflicting / unrelated), and aggregating. Estimation uses diagonally weighted least squares (DWLS) β€” the same estimator as Genomic-SEM β€” adapted to ordinal consistency coding.</p>
    <h3 class='sub-heading'>Downstream Output</h3>
    <div class='table-wrap'>
      <table>
        <thead><tr><th>Output</th><th>Description</th></tr></thead>
        <tbody>
          <tr><td><strong>Ε΄ score</strong></td><td>Estimated work-disability score with confidence interval</td></tr>
          <tr><td><strong>XΜ‚ vector</strong></td><td>Domain-by-domain capacity scores with CIs</td></tr>
          <tr><td><strong>Evidence map</strong></td><td>Machine-readable trace from each claim to underlying source and factor loading</td></tr>
          <tr><td><strong>Consistency report</strong></td><td>Flags concordant, complementary, and conflicting evidence</td></tr>
        </tbody>
      </table>
    </div>
    <h2 class='section-heading'>What SIL Is Not</h2>
    <div style='display:grid;grid-template-columns:1fr 1fr;gap:12px'>
      <div class='card'><p style='margin:0;font-size:.82rem'><strong>βœ—</strong> A decision-making system β€” SIL does not allow or deny benefits. The adjudicator decides.</p></div>
      <div class='card'><p style='margin:0;font-size:.82rem'><strong>βœ—</strong> A black box β€” Every SIL output traces back to underlying evidence and loadings.</p></div>
      <div class='card'><p style='margin:0;font-size:.82rem'><strong>βœ—</strong> A replacement for expertise β€” SIL is a common representation of clinical and vocational inputs.</p></div>
      <div class='card'><p style='margin:0;font-size:.82rem'><strong>βœ—</strong> A one-time model β€” SIL is per-claimant instantiation of a model class; parameters update.</p></div>
    </div>
  `
};

sections.analogy = {
  title: 'Genomic-SEM Analogy',
  render: () => `
    <h1 class='page-title'>SIL ↔ Genomic-SEM: A Structural Parallel</h1>
    <p class='lead'>The analogy is deliberately drawn β€” and we argue it is genuinely illuminating rather than ornamental.</p>
    <div class='table-wrap'>
      <table>
        <thead><tr><th>Component</th><th>Genomic-SEM (Grotzinger 2019)</th><th>SIL (This Paper)</th></tr></thead>
        <tbody>
          <tr><td><strong>Federated evidence</strong></td><td>Multiple GWAS cohorts with different phenotypes, instruments, sample sizes</td><td>Medical encounters, CE reports, work history, genomic findings, imaging, lay testimony</td></tr>
          <tr><td><strong>Covariance object</strong></td><td>Genetic covariance matrix (via LD score regression)</td><td>Cross-evidence consistency matrix (via paired consistency coding)</td></tr>
          <tr><td><strong>Latent construct</strong></td><td>Common genetic factor explaining shared signal across traits</td><td>Functional-impairment factor explaining shared signal across evidence</td></tr>
          <tr><td><strong>Downstream output</strong></td><td>Multivariate GWAS on latent factor</td><td>Adjudicator-readable evidence map</td></tr>
          <tr><td><strong>Estimator</strong></td><td>DWLS on genetic covariance</td><td>DWLS on consistency matrix (adapted to ordinal coding)</td></tr>
        </tbody>
      </table>
    </div>
    <div class='card highlight'>
      <div class='card-title'><span class='card-icon'>πŸ”—</span>Why the Analogy Works</div>
      <p>Both operate on federated evidence β€” data never collected in a common model. Both construct a covariance-like object from pairwise relationships. Both estimate a latent construct that no individual data point directly measures. Both produce a downstream representation usable by the relevant community (statistical geneticists ↔ adjudicators).</p>
      <p style='margin-bottom:0'>The analogies are not perfect β€” disability evidence is much messier than GWAS summary statistics β€” but the <strong>structural parallel is real</strong>, and importing the latent-variable formalism is more than cosmetic.</p>
    </div>
  `
};

sections.rubric = {
  title: 'Scoring Rubric',
  render: () => `
    <h1 class='page-title'>Exhibit A β€” Four-Level Scoring Rubric</h1>
    <p class='lead'>Each level scored 0–3 against five criteria β†’ per-level 0–15 β†’ total 0–60.</p>
    <div class='rubric-calculator' id='rubricCalc'>
      <div class='card-title' style='margin-bottom:12px'>πŸŽ›οΈ Interactive Rubric Calculator</div>
      <div class='rubric-controls' id='rubricControls'>
        <button class='rubric-btn active' data-module='psdlef'>PSDLEF (Overall)</button>
        <button class='rubric-btn' data-module='aidoc'>AI Doc Gen</button>
        <button class='rubric-btn' data-module='neuro'>Neurodiversity + Genomic</button>
        <button class='rubric-btn' data-module='court'>Court Navigation</button>
      </div>
      <div class='table-wrap' style='margin:12px 0 0'>
        <table id='rubricTable'>
          <thead><tr><th>Criterion</th><th>Description</th><th>Score (0–3)</th></tr></thead>
          <tbody id='rubricBody'></tbody>
        </table>
      </div>
      <div class='rubric-score-display' id='rubricScoreDisplay'></div>
    </div>
    <h2 class='section-heading'>Interpretation Bands</h2>
    <div class='table-wrap'>
      <table>
        <thead><tr><th>Score Range</th><th>Interpretation</th></tr></thead>
        <tbody>
          <tr><td class='score-cell score-0'>0–15</td><td>System essentially non-interoperable; cannot support meaningful adjudication</td></tr>
          <tr><td class='score-cell score-1'>16–30</td><td>Foundational and partial structural only; semantic and organizational absent</td></tr>
          <tr><td class='score-cell score-2'>31–45</td><td>Functional for straightforward cases; fails on complex, multimodal evidence</td></tr>
          <tr><td class='score-cell score-3'>46–60</td><td>Capable of supporting full SIL-based pro se litigation model</td></tr>
        </tbody>
      </table>
    </div>
  `,
  init: () => initRubric()
};

const rubricData = {
  psdlef: {
    name: 'PSDLEF (Overall)', scores: [
      ['L1.1 Connectivity', 'One-way upload; some auth', 1],
      ['L1.2 Identity', 'MFA implemented', 2],
      ['L1.3 Consent', 'Digital, revocable', 2],
      ['L1.4 Reliability', 'Designed SLA', 2],
      ['L1.5 Latency', 'Real-time for routine ops', 2],
      ['L2.1 Schema', 'Template-based, partial', 1],
      ['L2.2 Standards', 'No USCDI/FHIR adoption', 0],
      ['L2.3 Imaging/Genomic', 'Ad hoc wrappers', 1],
      ['L2.4 Backward compat', 'Documented migration', 1],
      ['L2.5 Inter-system map', 'Partner-documented', 1],
      ['L3.1 Vocabularies', 'Local codes only', 0],
      ['L3.2 Functional mapping', 'Implicit in narrative', 1],
      ['L3.3 Consistency', 'Manual review only', 0],
      ['L3.4 Provenance', 'Partial trail', 1],
      ['L3.5 Adjudicator legibility', 'Specialist only', 0],
      ['L4.1 Governance', 'Internal policies', 1],
      ['L4.2 Consent regime', 'Digital, granular', 2],
      ['L4.3 Adjudicator engagement', 'Not addressed', 0],
      ['L4.4 Remedy pathway', 'Internal grievance', 1],
      ['L4.5 Equity', 'Designed-in', 2]
    ]
  },
  aidoc: {
    name: 'AI Doc Gen', scores: [
      ['L1.1 Connectivity', 'Web portal, no SSA fetch', 2],
      ['L1.2 Identity', 'MFA', 2],
      ['L1.3 Consent', 'Digital, revocable', 2],
      ['L1.4 Reliability', 'Designed SLA', 2],
      ['L1.5 Latency', 'Real-time doc gen', 2],
      ['L2.1 Schema', 'Template-based', 1],
      ['L2.2 Standards', 'None', 0],
      ['L2.3 Imaging/Genomic', 'None', 0],
      ['L2.4 Backward compat', 'Basic', 1],
      ['L2.5 Inter-system map', 'None', 0],
      ['L3.1 Vocabularies', 'Legal English only', 0],
      ['L3.2 Functional mapping', 'None', 0],
      ['L3.3 Consistency', 'None', 0],
      ['L3.4 Provenance', 'Per-template', 1],
      ['L3.5 Adjudicator legibility', 'Legal prose', 1],
      ['L4.1 Governance', 'Internal', 1],
      ['L4.2 Consent regime', 'Digital', 2],
      ['L4.3 Adjudicator engagement', 'Not addressed', 0],
      ['L4.4 Remedy pathway', 'Grievance', 1],
      ['L4.5 Equity', 'Designed', 2]
    ]
  },
  neuro: {
    name: 'Neurodiversity + Genomic', scores: [
      ['L1.1 Connectivity', 'Intake portal, no EHR', 1],
      ['L1.2 Identity', 'MFA', 2],
      ['L1.3 Consent', 'Granular, auditable', 3],
      ['L1.4 Reliability', 'Not specified', 1],
      ['L1.5 Latency', 'Asynchronous', 1],
      ['L2.1 Schema', 'Free text + JSON', 1],
      ['L2.2 Standards', 'HL7 Genomics where applicable', 1],
      ['L2.3 Imaging/Genomic', 'VCF, DICOM wrappers', 2],
      ['L2.4 Backward compat', 'Basic', 1],
      ['L2.5 Inter-system map', 'EHR partners', 1],
      ['L3.1 Vocabularies', 'SNOMED, HPO', 2],
      ['L3.2 Functional mapping', 'Implicit', 1],
      ['L3.3 Consistency', 'Manual review', 1],
      ['L3.4 Provenance', 'Per-variant, per-claim', 2],
      ['L3.5 Adjudicator legibility', 'No SIL', 0],
      ['L4.1 Governance', 'Consent regime only', 1],
      ['L4.2 Consent regime', 'Granular', 3],
      ['L4.3 Adjudicator engagement', 'Not addressed', 0],
      ['L4.4 Remedy pathway', 'Grievance', 1],
      ['L4.5 Equity', 'Designed + neurodivergent', 3]
    ]
  },
  court: {
    name: 'Court Navigation', scores: [
      ['L1.1 Connectivity', 'Web + SMS, PACER', 2],
      ['L1.2 Identity', 'Lightweight', 1],
      ['L1.3 Consent', 'Basic', 1],
      ['L1.4 Reliability', 'Designed', 2],
      ['L1.5 Latency', 'Real-time', 2],
      ['L2.1 Schema', 'Template', 1],
      ['L2.2 Standards', 'None', 0],
      ['L2.3 Imaging/Genomic', 'None', 0],
      ['L2.4 Backward compat', 'Basic', 1],
      ['L2.5 Inter-system map', 'PACER only', 1],
      ['L3.1 Vocabularies', 'None', 0],
      ['L3.2 Functional mapping', 'None', 0],
      ['L3.3 Consistency', 'None', 0],
      ['L3.4 Provenance', 'None', 0],
      ['L3.5 Adjudicator legibility', 'Procedural prose', 1],
      ['L4.1 Governance', 'Internal', 1],
      ['L4.2 Consent regime', 'Basic', 1],
      ['L4.3 Adjudicator engagement', 'Not addressed', 0],
      ['L4.4 Remedy pathway', 'Grievance', 1],
      ['L4.5 Equity', 'Designed', 2]
    ]
  }
};

function initRubric(){
  const controls = document.getElementById('rubricControls');
  const body = document.getElementById('rubricBody');
  const display = document.getElementById('rubricScoreDisplay');
  let currentModule = 'psdlef';
  function renderRubric(moduleKey){
    const data = rubricData[moduleKey];
    if(!data) return;
    body.innerHTML = data.scores.map(([criterion, desc, score]) => `
      <tr>
        <td style='font-weight:600;color:var(--text);font-size:.78rem'>${criterion}</td>
        <td style='font-size:.78rem'>${desc}</td>
        <td class='score-cell score-${score}'>${score}</td>
      </tr>
    `).join('');
    const perLevel = {1:0,2:0,3:0,4:0};
    data.scores.forEach(([criterion,,score], idx) => {
      perLevel[Math.floor(idx/5)+1] += score;
    });
    const total = Object.values(perLevel).reduce((a,b)=>a+b,0);
    let band = '';
    if(total <= 15){band = 'Non-interoperable';}
    else if(total <= 30){band = 'Foundational/Partial Structural';}
    else if(total <= 45){band = 'Functional for Straightforward Cases';}
    else {band = 'SIL-Capable';}
    const bandColor = total <= 15 ? '#f85149' : total <= 30 ? '#f0883e' : total <= 45 ? '#58a6ff' : '#7ee787';
    display.innerHTML = `
      <div>
        <span style='font-size:.72rem;color:var(--text3);display:block;margin-bottom:2px'>TOTAL SCORE</span>
        <span class='rubric-total'>${total}<span style='font-size:1rem;color:var(--text3)'>/60</span></span>
      </div>
      <div style='flex:1;min-width:200px'>
        <span style='font-size:.72rem;color:var(--text3);display:block;margin-bottom:4px'>PER-LEVEL BREAKDOWN</span>
        <div style='display:flex;gap:4px;height:28px;align-items:flex-end'>
          ${[1,2,3,4].map(l => {
            const pct = (perLevel[l]/15)*100;
            const colors = {1:'#58a6ff',2:'#7ee787',3:'#f0883e',4:'#f85149'};
            return `<div style='flex:1;display:flex;flex-direction:column;align-items:center;gap:2px'>
              <span style='font-size:.62rem;color:var(--text2);font-weight:600'>${perLevel[l]}</span>
              <div style='width:100%;background:var(--bg3);border-radius:4px;height:10px'><div style='width:${pct}%;background:${colors[l]};height:100%;border-radius:4px;transition:width .8s ease'></div></div>
              <span style='font-size:.56rem;color:var(--text3)'>L${l}</span>
            </div>`;
          }).join('')}
        </div>
      </div>
      <div>
        <span style='font-size:.72rem;color:var(--text3);display:block;margin-bottom:2px'>BAND</span>
        <span class='rubric-band' style='background:${bandColor}22;color:${bandColor};border:1px solid ${bandColor}44'>${band}</span>
      </div>
    `;
  }
  controls.querySelectorAll('.rubric-btn').forEach(btn => {
    btn.addEventListener('click', () => {
      controls.querySelectorAll('.rubric-btn').forEach(b => b.classList.remove('active'));
      btn.classList.add('active');
      currentModule = btn.dataset.module;
      renderRubric(currentModule);
    });
  });
  renderRubric(currentModule);
}

sections['worked-example'] = {
  title: 'Worked Example',
  render: () => `
    <h1 class='page-title'>Exhibit B β€” Worked Example</h1>
    <p class='lead'>PSDLEF litigant-services modules scored against the four-level rubric.</p>
    <div class='chart-container'>
      <div class='chart-title'>Module Scores by Level (0–15 per level)</div>
      <div style='display:grid;grid-template-columns:repeat(3,1fr);gap:16px' id='moduleCharts'></div>
    </div>
    <div class='table-wrap'>
      <table>
        <thead><tr><th>Module</th><th>L1 Foundational</th><th>L2 Structural</th><th>L3 Semantic</th><th>L4 Organizational</th><th>Total /60</th><th>Interpretation</th></tr></thead>
        <tbody>
          <tr>
            <td><strong>AI Doc Gen</strong></td>
            <td class='score-cell score-2'>10</td>
            <td class='score-cell score-0'>2</td>
            <td class='score-cell score-0'>2</td>
            <td class='score-cell score-1'>6</td>
            <td class='score-cell'>20</td>
            <td style='font-size:.74rem;color:var(--warn)'>Below functional band</td>
          </tr>
          <tr>
            <td><strong>Neurodiversity + Genomic</strong></td>
            <td class='score-cell score-2'>8</td>
            <td class='score-cell score-1'>6</td>
            <td class='score-cell score-1'>6</td>
            <td class='score-cell score-2'>8</td>
            <td class='score-cell'>28</td>
            <td style='font-size:.74rem;color:var(--warn)'>Below functional band β€” strongest overall</td>
          </tr>
          <tr>
            <td><strong>Court Navigation</strong></td>
            <td class='score-cell score-2'>8</td>
            <td class='score-cell score-0'>3</td>
            <td class='score-cell score-0'>1</td>
            <td class='score-cell score-1'>5</td>
            <td class='score-cell'>17</td>
            <td style='font-size:.74rem;color:var(--warn)'>Below functional band β€” weakest</td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class='card highlight'>
      <div class='card-title'><span class='card-icon'>🎯</span>Highest-Leverage Investments for PSDLEF</div>
      <ol style='padding-left:20px;color:var(--text2);font-size:.85rem;line-height:1.8'>
        <li><strong>Build SIL</strong> β€” Integrate the latent-factor functional-impairment model into the neurodiversity + genomic module first (where the semantic gap is widest).</li>
        <li><strong>Negotiate the adjudicator-engagement protocol</strong> (Level 4) β€” Without this, the semantic layer has no institutional home.</li>
        <li><strong>Define and publish the PSDLEF Evidence Schema</strong> (Level 2) β€” Schema publication creates a reference for partners and benchmarks future adoption.</li>
      </ol>
    </div>
  `,
  init: () => initModuleCharts()
};

function initModuleCharts(){
  const container = document.getElementById('moduleCharts');
  if(!container) return;
  const data = [
    {name:'AI Doc Gen', levels:[10,2,2,6], total:20, color:'#58a6ff'},
    {name:'Neuro + Genomic', levels:[8,6,6,8], total:28, color:'#7ee787'},
    {name:'Court Navigation', levels:[8,3,1,5], total:17, color:'#f0883e'}
  ];
  container.innerHTML = data.map((mod,i) => {
    const maxPerLevel = 15;
    return `
      <div style='background:var(--bg3);border-radius:10px;padding:16px;text-align:center'>
        <div style='font-size:.74rem;font-weight:700;margin-bottom:10px;color:var(--text)'>${mod.name}</div>
        <div style='font-size:1.3rem;font-weight:800;font-family:var(--mono);color:${mod.color};margin-bottom:10px'>${mod.total}/60</div>
        ${[1,2,3,4].map(l => {
          const pct = (mod.levels[l-1]/maxPerLevel)*100;
          return `<div style='display:flex;align-items:center;gap:6px;margin-bottom:4px'>
            <span style='font-size:.56rem;color:var(--text3);width:16px'>L${l}</span>
            <div style='flex:1;background:var(--bg);border-radius:4px;height:8px'><div style='width:${pct}%;background:${mod.color};height:100%;border-radius:4px;transition:width 1s ease ${i*200 + l*100}ms'></div></div>
            <span style='font-size:.56rem;color:var(--text2);width:16px'>${mod.levels[l-1]}</span>
          </div>`;
        }).join('')}
      </div>
    `;
  }).join('');
  requestAnimationFrame(() => {
    setTimeout(() => {
      container.querySelectorAll('[style*="width:0%"]').forEach(el => {
        const style = el.getAttribute('style');
        const match = style.match(/width:(\d+)%/);
        if(match){
          el.style.width = match[1] + '%';
          el.style.transition = 'width .8s ease';
        }
      });
    }, 150);
  });
}

sections.implications = {
  title: 'Implications',
  render: () => `
    <h1 class='page-title'>Implications</h1>
    <h2 class='section-heading'>For PSDLEF Program Design</h2>
    <div class='card'>
      <p style='margin:0'><strong>Build SIL before scaling the AI doc gen module.</strong> Doc gen without SIL produces documents that are pro se-formatted but not semantically interoperable β€” they reproduce the lay vocabulary of the claimant rather than translating into the adjudicator's functional-impairment frame.</p>
    </div>
    <div class='card'>
      <p style='margin:0'><strong>Use the rubric as a portfolio instrument.</strong> The PSDLEF Board can evaluate proposed modules, partner integrations, and grant applications. A partner that does not raise at least Level 1 and Level 4 scores should not be assumed to add semantic value.</p>
    </div>
    <div class='card'>
      <p style='margin:0'><strong>Engage SSA on Levels 2 and 4 before Level 3.</strong> SIL is technically feasible today; deployment is gated by organizational interoperability, not technical capability. The political-organisational engagement is the binding constraint.</p>
    </div>
    <h2 class='section-heading'>For Pro Se Litigation Practice</h2>
    <div class='callout accent'>
      <span class='callout-icon'>🩺</span>
      <div class='callout-content'><p>The four-level model provides a <strong>diagnostic vocabulary</strong> for case-level failures: delay = Level 1 (foundational); records misinterpreted = Level 3 (semantic); valid claim denied three times = Level 4 (organizational). A pro se litigant can identify <em>which level is failing</em> and target the remedy accordingly β€” a forensic use of the framework.</p></div>
    </div>
    <h2 class='section-heading'>Limitations</h2>
    <ul style='padding-left:20px;color:var(--text2);font-size:.85rem;line-height:1.8'>
      <li>Theoretical β€” borrowed from health IT, not empirically validated in disability adjudication.</li>
      <li>SIL formal model at abstraction level comparable to Genomic-SEM spec; estimators and validation are future work.</li>
      <li>Rubric proposed, not validated; worked example illustrative.</li>
      <li>Does not address non-interoperability drivers: understaffing, ALJ hiring, judicial economy, political economy of benefits.</li>
    </ul>
    <h2 class='section-heading'>Future Research</h2>
    <ol style='padding-left:20px;color:var(--text2);font-size:.85rem;line-height:1.8'>
      <li>Empirical validation of the rubric against pro se disability cases with inter-rater reliability.</li>
      <li>SIL pilot on retrospective adjudicated claims, comparing SIL-derived scores to actual outcomes.</li>
      <li>Adjudicator-engagement protocol design with SSA, OHO, and federal courts.</li>
      <li>Standards engagement with HL7, ONC, HIMSS on disability-specific interoperability profiles.</li>
      <li>Cross-jurisdictional comparison: UK PIP, German DRV, Australian DSP.</li>
    </ol>
  `
};

sections.references = {
  title: 'References',
  render: () => `
    <h1 class='page-title'>References</h1>
    <div style='display:flex;flex-direction:column;gap:10px'>
      ${[
        ['Bollen, K. A. (1989). <em>Structural Equations with Latent Variables</em>. Wiley.', ''],
        ['Gelber, A., Moore, T., Pei, Z., & Strand, A. (2023). Disability insurance income saves lives. <em>Journal of Political Economy</em>, 131(11), 3023–3075.', ''],
        ['Grotzinger, A. D., Rhemtulla, M., de Vlaming, R., et al. (2019). Genomic structural equation modelling provides insights into the multivariate genetic architecture of complex traits. <em>Nature Human Behaviour</em>, 3(5), 513–525.', 'tag purple'],
        ['HIMSS. (2024). <em>Interoperability in Healthcare</em>. Healthcare Information and Management Systems Society.', 'tag accent'],
        ['HIMSS. (2024). <em>HIMSS Interoperability Frameworks eBook</em>.', 'tag accent'],
        ['Kenya Ministry of Health. (2019). <em>Kenya Health Information Systems Interoperability Framework (KHISIF)</em>.', ''],
        ['McLaughlin, C. L. (2026). <em>Research Portfolio Exhibit: SSA Deaths While Pending, Administrative Recidivism, and the Prison-Industrial Feedback Loop</em>. (Litigation-support exhibit, prepared pro se.)', 'tag orange'],
        ['ONC. (2024). <em>TEFCA: Trusted Exchange Framework and Common Agreement</em>. Office of the National Coordinator for Health IT.', 'tag accent'],
        ['PSDLEF. (2026). <em>PSDLEF: A Perpetual Framework for Pro Se Disability Litigant Empowerment Through Algorithmic Capital Stewardship and Sustainable Municipal Investment</em>. Working paper.', 'tag green'],
        ['U.S. GAO. (2020). <em>Social Security Disability: Information on Wait Times, Bankruptcies, and Deaths among Applicants Who Appealed Benefit Denials</em> (GAO-20-641R).', ''],
        ['Walker, J., Pan, E., Johnston, D., et al. (2005). The value of health care information exchange and interoperability. <em>Health Affairs</em>, 24(S1), W5-10–W5-18.', ''],
        ['Wolters Kluwer. (2024). <em>Understanding the Four Levels of Interoperability in Healthcare</em>.', 'tag accent']
      ].map(([ref, tag]) => `
        <div class='card' style='padding:14px 18px;margin-bottom:0'>
          ${tag ? `<span class='tag ${tag}' style='font-size:.6rem'>${tag.includes('purple')?'Genomic-SEM':tag.includes('accent')?'HIMSS/ONC':tag.includes('orange')?'Exhibit':tag.includes('green')?'PSDLEF':''}</span>` : ''}
          <p style='margin:0;font-size:.82rem'>${ref}</p>
        </div>
      `).join('')}
    </div>
    <h2 class='section-heading'>Appendices</h2>
    <div class='card'>
      <div class='card-title'>Appendix A β€” HIMSS Level Definitions (Verbatim)</div>
      <p style='font-size:.78rem;color:var(--text2);margin-bottom:6px'><strong>Level 1 β€” Foundational.</strong> Establishes inter-connectivity requirements for systems to securely communicate data to and receive data from another.</p>
      <p style='font-size:.78rem;color:var(--text2);margin-bottom:6px'><strong>Level 2 β€” Structural.</strong> Defines format, syntax, and organization of data exchange (including at data-field level) for interpretation by the receiving system.</p>
      <p style='font-size:.78rem;color:var(--text2);margin-bottom:6px'><strong>Level 3 β€” Semantic.</strong> Provides for common underlying models and codification of data, including data elements with standardized definitions from publicly available value sets, providing shared understanding and meaning.</p>
      <p style='font-size:.78rem;color:var(--text2)'><strong>Level 4 β€” Organizational.</strong> Includes governance, policy, social, legal, and organizational considerations to facilitate secure, seamless, timely communication and use of data. Enables shared consent, trust, and integrated workflows.</p>
    </div>
  `
};

// ── Router / AJAX Simulation ─────────────────────────────────────
const sectionNames = {
  'abstract': 'Abstract',
  'introduction': 'Introduction',
  'four-levels': 'Four Levels',
  'diagnostic': 'Diagnostic Analysis',
  'sil': 'SIL Specification',
  'analogy': 'Genomic-SEM Analogy',
  'rubric': 'Scoring Rubric',
  'worked-example': 'Worked Example',
  'implications': 'Implications',
  'references': 'References'
};

let currentSection = 'abstract';

function navigateTo(sectionKey, updateHash = true){
  if(!sections[sectionKey]) return;
  const container = document.getElementById('sectionContainer');
  const skeleton = document.getElementById('loadingSkeleton');
  currentSection = sectionKey;
  
  // Show loading skeleton (simulating AJAX)
  container.style.display = 'none';
  skeleton.style.display = 'block';
  
  // Simulate network delay for AJAX feel
  setTimeout(() => {
    skeleton.style.display = 'none';
    container.style.display = 'block';
    container.innerHTML = sections[sectionKey].render();
    if(sections[sectionKey].init) sections[sectionKey].init();
    
    // Update breadcrumb
    document.getElementById('breadcrumbCurrent').textContent = sectionNames[sectionKey] || sectionKey;
    
    // Update nav
    document.querySelectorAll('.nav-link').forEach(link => {
      link.classList.toggle('active', link.dataset.section === sectionKey);
    });
    
    // Scroll to top of content
    document.querySelector('.content').scrollIntoView({behavior: 'smooth', block: 'start'});
    
    if(updateHash) {
      history.pushState(null, '', '#' + sectionKey);
    }
  }, 250 + Math.random() * 200);
}

// ── Event Listeners ──────────────────────────────────────────────
document.querySelectorAll('.nav-link').forEach(link => {
  link.addEventListener('click', () => {
    navigateTo(link.dataset.section);
    // Close mobile sidebar
    document.getElementById('sidebar').classList.remove('open');
  });
});

// Hash routing
window.addEventListener('hashchange', () => {
  const hash = window.location.hash.replace('#', '');
  if(hash && sections[hash] && hash !== currentSection) {
    navigateTo(hash, false);
  }
});

// Hamburger
document.getElementById('hamburger').addEventListener('click', () => {
  document.getElementById('sidebar').classList.toggle('open');
});

// Theme toggle (placeholder for light theme)
document.getElementById('themeToggle').addEventListener('click', () => {
  const root = document.documentElement;
  if(root.style.getPropertyValue('--bg') === '#f5f5f5'){
    root.style.setProperty('--bg','#0d1117');
    root.style.setProperty('--bg2','#161b22');
    root.style.setProperty('--bg3','#1c2430');
    root.style.setProperty('--card','#1a2029');
    root.style.setProperty('--card2','#202834');
    root.style.setProperty('--text','#e6edf3');
    root.style.setProperty('--text2','#9da7b3');
    root.style.setProperty('--text3','#6e7a8a');
    root.style.setProperty('--border','#30363d');
    root.style.setProperty('--border2','#3d4753');
  } else {
    root.style.setProperty('--bg','#f5f5f5');
    root.style.setProperty('--bg2','#e8e8e8');
    root.style.setProperty('--bg3','#ddd');
    root.style.setProperty('--card','#fff');
    root.style.setProperty('--card2','#f0f0f0');
    root.style.setProperty('--text','#1a1a1a');
    root.style.setProperty('--text2','#555');
    root.style.setProperty('--text3','#888');
    root.style.setProperty('--border','#ccc');
    root.style.setProperty('--border2','#bbb');
  }
});

// Search
document.getElementById('searchInput').addEventListener('input', (e) => {
  const query = e.target.value.toLowerCase().trim();
  const results = Object.keys(sectionNames).filter(key => {
    const name = sectionNames[key].toLowerCase();
    const content = sections[key]?.render?.()?.toLowerCase() || '';
    return name.includes(query) || content.includes(query);
  });
  // Highlight matching nav links
  document.querySelectorAll('.nav-link').forEach(link => {
    const key = link.dataset.section;
    if(query && results.includes(key)){
      link.style.outline = '1px solid var(--accent)';
      link.style.outlineOffset = '-1px';
    } else {
      link.style.outline = 'none';
    }
  });
  // If exact match, navigate
  if(query && results.length === 1 && query.length > 3){
    // Don't auto-navigate, just show
  }
});

// Modal close
document.getElementById('modalClose').addEventListener('click', () => {
  document.getElementById('modalOverlay').classList.remove('visible');
});
document.getElementById('modalOverlay').addEventListener('click', (e) => {
  if(e.target === e.target.closest('.modal-overlay')){
    document.getElementById('modalOverlay').classList.remove('visible');
  }
});

// ── Initial Load ─────────────────────────────────────────────────
const initialHash = window.location.hash.replace('#','');
navigateTo(initialHash && sections[initialHash] ? initialHash : 'abstract', false);

// Keyboard shortcuts
document.addEventListener('keydown', (e) => {
  if(e.target.tagName === 'INPUT') return;
  const keys = Object.keys(sectionNames);
  const idx = keys.indexOf(currentSection);
  if(e.key === 'ArrowRight' && idx < keys.length - 1){
    navigateTo(keys[idx + 1]);
  }
  if(e.key === 'ArrowLeft' && idx > 0){
    navigateTo(keys[idx - 1]);
  }
  if(e.key === 'Escape'){
    document.getElementById('modalOverlay').classList.remove('visible');
    document.getElementById('sidebar').classList.remove('open');
  }
});

})();
</script>

</body>
</html>" style="width:100%;height:800px;border:2px solid #30363d;border-radius:12px;background:#0d1117"></iframe>