-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomcare.html
More file actions
1880 lines (1742 loc) · 93 KB
/
Copy pathcomcare.html
File metadata and controls
1880 lines (1742 loc) · 93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"/>
<title>ComCare — ADRD Caregiver Assistant</title>
<!-- PWA -->
<link rel="manifest" href="/manifest.json"/>
<meta name="theme-color" content="#2e7fa8"/>
<meta name="mobile-web-app-capable" content="yes"/>
<!-- iOS specific -->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="default"/>
<meta name="apple-mobile-web-app-title" content="ComCare"/>
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png"/>
<link href="https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Nunito:wght@300;400;500;600&display=swap" rel="stylesheet"/>
<style>
:root {
--sage: #2e7fa8;
--sage-light: #e8f4fa;
--sage-mid: #90c4dd;
--sage-dark: #1a5472;
--warm: #faf8f3;
--warm-mid: #ede8dc;
--warm-dark: #c9bc9e;
--text: #1e2a30;
--text-mid: #4a5a63;
--text-light: #8a9aa3;
--white: #ffffff;
--danger: #b03a2e;
--danger-light: #fdecea;
--amber: #b07d1a;
--amber-light: #fef6e4;
--green: #2e7a4a;
--green-light: #e8f6ee;
--radius: 14px;
--radius-sm: 8px;
--shadow: 0 2px 12px rgba(0,0,0,0.07);
--shadow-md: 0 4px 24px rgba(0,0,0,0.10);
}
*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:'Nunito',sans-serif;background:var(--warm);color:var(--text);min-height:100vh;display:flex;flex-direction:column;}
/* TOP BAR */
.topbar{background:#f8f6f0;border-bottom:1px solid var(--warm-mid);display:flex;align-items:center;justify-content:space-between;padding:0 24px;height:60px;position:sticky;top:0;z-index:100;}
.brand{display:flex;align-items:center;gap:10px;font-family:'DM Serif Display',serif;font-size:20px;color:var(--sage-dark);}
.brand-icon{width:34px;height:34px;background:var(--sage);border-radius:50%;display:flex;align-items:center;justify-content:center;}
.brand-icon svg{width:18px;height:18px;fill:white;}
.topbar-right{display:flex;align-items:center;gap:12px;}
.backend-badge{display:flex;align-items:center;gap:6px;padding:4px 10px;border-radius:12px;font-size:11px;font-weight:600;background:var(--green-light);color:var(--green);border:1px solid #b6dfc5;}
.backend-badge.azure{background:var(--sage-light);color:var(--sage-dark);border-color:var(--sage-mid);}
.backend-dot{width:6px;height:6px;border-radius:50%;background:currentColor;}
.lang-toggle{display:flex;background:var(--warm);border-radius:20px;padding:3px;gap:2px;}
.lang-btn{padding:4px 14px;border-radius:16px;border:none;cursor:pointer;font-size:13px;font-weight:500;background:transparent;color:var(--text-mid);transition:all .2s;}
.lang-btn.active{background:var(--white);color:var(--sage-dark);box-shadow:0 1px 4px rgba(0,0,0,.12);}
/* LAYOUT */
.app-body{display:flex;flex:1;max-width:1200px;margin:0 auto;width:100%;padding:0 16px;}
/* SIDEBAR */
.sidebar{width:200px;flex-shrink:0;padding:20px 0;display:flex;flex-direction:column;gap:2px;border-right:1px solid var(--warm-mid);background:#f8f6f0;}
.nav-section-label{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--text-light);padding:10px 14px 4px;}
.nav-item{display:flex;align-items:center;gap:10px;padding:9px 14px;border-radius:var(--radius-sm);cursor:pointer;font-size:14px;font-weight:400;color:var(--text-mid);transition:all .2s;border:none;background:transparent;text-align:left;width:100%;}
.nav-item:hover{background:var(--white);color:var(--text);}
.nav-item.active{background:var(--sage-light);color:var(--sage-dark);font-weight:600;border-left:3px solid var(--sage);padding-left:11px;}
.nav-icon{width:20px;height:20px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.nav-icon svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.nav-primary-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--sage);padding:2px 14px;}
.separator{height:1px;background:var(--warm-mid);margin:8px 12px;}
/* MAIN */
.main{flex:1;padding:24px 0 24px 24px;min-width:0;}
.page{display:none;}
.page.active{display:flex;flex-direction:column;gap:20px;}
.page-header h1{font-family:'DM Serif Display',serif;font-size:22px;color:var(--sage-dark);margin-bottom:4px;}
.page-header p{font-size:14px;color:var(--text-light);}
/* CARD */
.card{background:var(--white);border-radius:var(--radius);border:1px solid var(--warm-mid);padding:20px;box-shadow:var(--shadow);}
.card-title{font-family:'DM Serif Display',serif;font-size:15px;color:var(--text);margin-bottom:14px;display:flex;align-items:center;gap:8px;}
.card-title svg{width:16px;height:16px;stroke:var(--sage);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
/* DASHBOARD */
.dash-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;}
.stat-card{background:var(--white);border:1px solid var(--warm-mid);border-radius:var(--radius);padding:16px;display:flex;flex-direction:column;gap:6px;}
.stat-num{font-size:28px;font-weight:600;color:var(--sage);}
.stat-label{font-size:12px;color:var(--text-light);}
.stat-icon{font-size:22px;margin-bottom:4px;}
.dash-info-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.info-card{background:var(--white);border:1px solid var(--warm-mid);border-radius:var(--radius);padding:16px;}
.info-card-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--text-light);margin-bottom:6px;}
.info-card-value{font-size:14px;font-weight:500;color:var(--text);line-height:1.5;}
.info-card-sub{font-size:12px;color:var(--text-mid);margin-top:4px;}
.info-card.highlight{border-color:var(--sage-mid);background:var(--sage-light);}
/* ALERTS */
.alert{background:var(--danger-light);border:1px solid #f5c6c2;border-radius:var(--radius-sm);padding:12px 16px;display:flex;gap:10px;align-items:flex-start;font-size:13px;color:var(--danger);}
.alert svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;flex-shrink:0;margin-top:1px;}
.alert-info{background:var(--amber-light);border-color:#fad5a0;color:var(--amber);}
.alert-success{background:var(--green-light);border-color:#b6dfc5;color:var(--green);}
/* TIMELINE */
.timeline-entry{display:flex;gap:14px;padding:10px 0;border-bottom:1px solid var(--warm-mid);font-size:13px;align-items:flex-start;}
.timeline-entry:last-child{border-bottom:none;}
.tl-dot{width:8px;height:8px;border-radius:50%;background:var(--sage-mid);margin-top:5px;flex-shrink:0;}
.tl-dot.red{background:#e87070;}
.tl-dot.amber{background:#e8aa50;}
.tl-time{color:var(--text-light);font-size:11px;margin-top:2px;}
.tl-title{font-weight:500;}
/* FORMS */
.form-group{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;}
.form-label{font-size:13px;font-weight:500;color:var(--text-mid);}
.form-input,.form-select,.form-textarea{padding:9px 12px;border:1px solid var(--warm-mid);border-radius:var(--radius-sm);font-family:'Nunito',sans-serif;font-size:14px;color:var(--text);background:var(--white);transition:border-color .2s;width:100%;}
.form-input:focus,.form-select:focus,.form-textarea:focus{outline:none;border-color:var(--sage-mid);}
.form-textarea{resize:vertical;min-height:80px;}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.form-hint{font-size:11px;color:var(--text-light);margin-top:-8px;}
/* BUTTONS */
.btn{display:inline-flex;align-items:center;gap:7px;padding:9px 18px;border-radius:var(--radius-sm);font-family:'Nunito',sans-serif;font-size:14px;font-weight:500;cursor:pointer;border:none;transition:all .2s;}
.btn-primary{background:var(--sage);color:white;}
.btn-primary:hover{background:var(--sage-dark);}
.btn-outline{background:transparent;border:1px solid var(--sage-mid);color:var(--sage-dark);}
.btn-outline:hover{background:var(--sage-light);}
.btn-ghost{background:transparent;border:1px solid var(--warm-mid);color:var(--text-mid);}
.btn-ghost:hover{background:var(--warm-mid);}
.btn-danger{background:var(--danger);color:white;}
.btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;}
.btn-sm{padding:6px 12px;font-size:12px;}
/* TAGS */
.tag{display:inline-block;padding:3px 10px;border-radius:12px;font-size:11px;font-weight:500;}
.tag-sage{background:var(--sage-light);color:var(--sage-dark);}
.tag-amber{background:var(--amber-light);color:var(--amber);}
.tag-red{background:var(--danger-light);color:var(--danger);}
.tag-gray{background:var(--warm-mid);color:var(--text-mid);}
.tag-green{background:var(--green-light);color:var(--green);}
/* CHAT */
.chat-wrap{display:flex;flex-direction:column;height:calc(100vh - 170px);min-height:400px;}
.chat-messages{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;background:var(--warm);border-radius:var(--radius) var(--radius) 0 0;border:1px solid var(--warm-mid);border-bottom:none;}
.msg{display:flex;gap:10px;max-width:80%;align-items:flex-start;}
.msg.user{align-self:flex-end;flex-direction:row-reverse;}
.msg-avatar{width:30px;height:30px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;}
.msg-avatar.ai{background:var(--sage-dark);color:white;}
.msg-avatar.user{background:var(--warm-mid);color:var(--text-mid);}
.msg-bubble{padding:10px 14px;border-radius:14px;font-size:14px;line-height:1.6;}
.msg.ai .msg-bubble{background:var(--white);border:1px solid var(--warm-mid);border-top-left-radius:4px;color:var(--text);}
.msg.user .msg-bubble{background:var(--sage);color:white;border-top-right-radius:4px;}
.msg-time{font-size:11px;color:var(--text-light);margin-top:4px;}
.msg.ai .msg-time{text-align:left;}
.msg.user .msg-time{text-align:right;}
/* Inline record draft card in chat */
.record-draft{background:var(--white);border:2px solid var(--sage-mid);border-radius:var(--radius);padding:14px 16px;margin-top:10px;width:100%;max-width:480px;}
.record-draft-header{display:flex;align-items:center;gap:8px;margin-bottom:10px;}
.record-draft-title{font-size:14px;font-weight:700;color:var(--sage-dark);}
.record-draft-badge{font-size:11px;font-weight:500;background:var(--sage-light);color:var(--sage-dark);padding:2px 8px;border-radius:10px;border:1px solid var(--sage-mid);}
.record-draft-fields{display:flex;flex-direction:column;gap:6px;margin-bottom:12px;}
.draft-field{display:grid;grid-template-columns:110px 1fr;gap:6px;align-items:start;font-size:13px;}
.draft-field-label{color:var(--text-light);font-weight:500;padding-top:7px;}
.draft-field input,.draft-field select,.draft-field textarea{padding:6px 9px;border:1px solid var(--warm-mid);border-radius:6px;font-family:'Nunito',sans-serif;font-size:13px;color:var(--text);background:var(--warm);width:100%;}
.draft-field textarea{resize:vertical;min-height:60px;}
.draft-field input:focus,.draft-field select:focus,.draft-field textarea:focus{outline:none;border-color:var(--sage-mid);background:var(--white);}
.record-draft-actions{display:flex;gap:8px;}
.chat-input-area{background:var(--white);border:1px solid var(--warm-mid);border-radius:0 0 var(--radius) var(--radius);padding:12px 16px;}
.suggested-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px;}
.chip{padding:5px 12px;border-radius:16px;border:1px solid var(--sage-mid);background:transparent;color:var(--sage-dark);font-size:12px;cursor:pointer;font-family:'Nunito',sans-serif;transition:all .2s;}
.chip:hover{background:var(--sage-light);}
.chat-input-row{display:flex;gap:10px;align-items:flex-end;}
.chat-input{flex:1;padding:10px 14px;border:1px solid var(--warm-mid);border-radius:var(--radius-sm);font-family:'Nunito',sans-serif;font-size:14px;resize:none;min-height:42px;max-height:120px;color:var(--text);background:var(--warm);}
.chat-input:focus{outline:none;border-color:var(--sage-mid);}
.chat-send{width:40px;height:40px;border-radius:50%;background:var(--sage);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .2s;}
.chat-send:hover{background:var(--sage-dark);}
.chat-send svg{width:16px;height:16px;stroke:white;fill:none;stroke-width:2.5;stroke-linecap:round;}
.typing{display:flex;gap:4px;align-items:center;}
.typing span{width:6px;height:6px;background:var(--sage-mid);border-radius:50%;animation:bounce 1.2s infinite;}
.typing span:nth-child(2){animation-delay:.2s;}
.typing span:nth-child(3){animation-delay:.4s;}
@keyframes bounce{0%,80%,100%{transform:translateY(0);}40%{transform:translateY(-6px);}}
/* RECORD CARDS */
.card-type-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;}
.card-type-btn{background:var(--white);border:1px solid var(--warm-mid);border-radius:var(--radius);padding:16px;cursor:pointer;text-align:left;transition:all .2s;font-family:'Nunito',sans-serif;}
.card-type-btn:hover{border-color:var(--sage-mid);background:var(--sage-light);}
.card-type-btn.selected{border-color:var(--sage);background:var(--sage-light);box-shadow:0 0 0 2px var(--sage-mid);}
.card-type-icon{font-size:22px;margin-bottom:8px;}
.card-type-name{font-size:14px;font-weight:600;color:var(--text);margin-bottom:4px;}
.card-type-desc{font-size:12px;color:var(--text-mid);}
.record-form{display:none;}
.record-form.active{display:block;}
/* Record history */
.record-item{display:flex;gap:14px;align-items:flex-start;padding:14px 0;border-bottom:1px solid var(--warm-mid);}
.record-item:last-child{border-bottom:none;}
.record-avatar{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;background:var(--sage-light);}
.record-content{flex:1;}
.record-title{font-size:14px;font-weight:500;}
.record-meta{font-size:12px;color:var(--text-light);margin-top:2px;}
.record-note{font-size:13px;color:var(--text-mid);margin-top:4px;}
/* VISIT SUMMARY */
.summary-doc{background:var(--white);border:1px solid var(--warm-mid);border-radius:var(--radius);padding:28px;font-size:13px;line-height:1.8;max-width:720px;}
.summary-doc h2{font-family:'DM Serif Display',serif;font-size:18px;color:var(--sage-dark);margin-bottom:4px;}
.summary-doc .summary-meta{font-size:12px;color:var(--text-light);margin-bottom:20px;}
.summary-section{margin-bottom:18px;}
.summary-section-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--text-light);margin-bottom:8px;padding-bottom:4px;border-bottom:1px solid var(--warm-mid);}
.summary-section p,.summary-section li{color:var(--text);margin-bottom:4px;}
.summary-section ul{padding-left:18px;}
/* SETTINGS */
.settings-section{margin-bottom:8px;}
.profile-row{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid var(--warm-mid);font-size:14px;}
.profile-row:last-child{border-bottom:none;}
.profile-key{color:var(--text-mid);}
.profile-val{font-weight:500;}
.backend-toggle{display:flex;gap:12px;margin-bottom:16px;}
.backend-opt{flex:1;padding:12px 16px;border-radius:var(--radius-sm);border:2px solid var(--warm-mid);cursor:pointer;background:var(--white);font-family:'Nunito',sans-serif;text-align:left;transition:all .2s;}
.backend-opt.active{border-color:var(--sage);background:var(--sage-light);}
.backend-opt-name{font-size:14px;font-weight:600;color:var(--text);margin-bottom:2px;}
.backend-opt-desc{font-size:12px;color:var(--text-mid);}
.backend-opt.active .backend-opt-name{color:var(--sage-dark);}
/* UTIL */
.flex{display:flex;}
.flex-between{display:flex;justify-content:space-between;align-items:center;}
.gap-8{gap:8px;}
.gap-12{gap:12px;}
.mt-4{margin-top:4px;}
.mt-8{margin-top:8px;}
.mt-12{margin-top:12px;}
.mt-16{margin-top:16px;}
.text-sm{font-size:13px;}
.text-light{color:var(--text-light);}
.text-mid{color:var(--text-mid);}
.text-sage{color:var(--sage-dark);}
.font-medium{font-weight:500;}
.w-full{width:100%;}
.hidden{display:none!important;}
::-webkit-scrollbar{width:5px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:var(--warm-dark);border-radius:10px;}
/* Checkbox row */
.check-row{display:flex;align-items:center;gap:8px;font-size:14px;cursor:pointer;}
.check-row input{width:16px;height:16px;cursor:pointer;accent-color:var(--sage);}
/* ── CHAT SUMMARIZE BUTTON ──────────────────────────────────────────────────── */
.chat-summarize-bar{display:none;padding:8px 16px 0;background:var(--white);border-top:1px solid var(--warm-mid);}
.chat-summarize-bar.visible{display:flex;align-items:center;gap:10px;}
.btn-summarize{background:var(--sage-light);border:1px solid var(--sage-mid);color:var(--sage-dark);font-size:13px;padding:7px 14px;border-radius:20px;cursor:pointer;font-family:'Nunito',sans-serif;font-weight:600;display:flex;align-items:center;gap:6px;transition:all .2s;}
.btn-summarize:hover{background:var(--sage-mid);color:white;}
.btn-summarize svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;}
.chat-summarize-hint{font-size:12px;color:var(--text-light);}
/* Chat summary card (AI-generated recap inline in chat) */
.chat-summary-card{background:var(--white);border:2px solid var(--sage);border-radius:var(--radius);padding:16px;margin-top:10px;width:100%;}
.chat-summary-card h4{font-family:'DM Serif Display',serif;font-size:14px;color:var(--sage-dark);margin-bottom:8px;}
.chat-summary-card p,.chat-summary-card li{font-size:13px;color:var(--text);line-height:1.6;}
.chat-summary-card ul{padding-left:16px;margin:4px 0;}
.chat-summary-card strong{color:var(--text);}
.summary-actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap;}
/* ── SPECIALTY SELECTOR ─────────────────────────────────────────────────────── */
.specialty-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:16px;}
.specialty-btn{background:var(--white);border:1.5px solid var(--warm-mid);border-radius:var(--radius-sm);padding:12px 10px;cursor:pointer;text-align:center;font-family:'Nunito',sans-serif;transition:all .2s;}
.specialty-btn:hover{border-color:var(--sage-mid);background:var(--sage-light);}
.specialty-btn.active{border-color:var(--sage);background:var(--sage-light);box-shadow:0 0 0 2px var(--sage-mid);}
.specialty-icon{font-size:22px;margin-bottom:4px;}
.specialty-name{font-size:12px;font-weight:600;color:var(--text);}
/* Editable summary */
.summary-editable{width:100%;min-height:300px;padding:20px;border:1px solid var(--warm-mid);border-radius:var(--radius);font-family:'Nunito',sans-serif;font-size:13px;line-height:1.8;color:var(--text);background:var(--white);resize:vertical;}
.summary-editable:focus{outline:none;border-color:var(--sage-mid);}
.edit-hint{font-size:11px;color:var(--text-light);margin-bottom:6px;}
/* ── MOBILE NAV BAR ─────────────────────────────────────────────────────────── */
.mobile-nav{display:none;position:fixed;bottom:0;left:0;right:0;background:#f8f6f0;border-top:1px solid var(--warm-mid);z-index:200;padding:0 8px;padding-bottom:env(safe-area-inset-bottom);}
.mobile-nav-inner{display:flex;justify-content:space-around;align-items:center;height:56px;}
.mobile-nav-btn{display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 12px;border:none;background:transparent;cursor:pointer;color:var(--text-light);font-family:'Nunito',sans-serif;font-size:10px;font-weight:500;border-radius:8px;transition:all .2s;min-width:56px;}
.mobile-nav-btn svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.mobile-nav-btn.active{color:var(--sage-dark);}
.mobile-nav-btn.active svg{stroke:var(--sage);}
.mobile-nav-btn span{font-size:10px;}
/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
/* Hide desktop sidebar, show mobile nav */
.sidebar{display:none;}
.mobile-nav{display:flex;}
/* Layout adjustments */
.app-body{padding:0 12px;padding-bottom:64px;}
.main{padding:16px 0 16px 0;}
.topbar{padding:0 16px;}
/* Chat fills screen height properly on mobile */
.chat-wrap{height:calc(100dvh - 170px);}
/* Stack form rows */
.form-row{grid-template-columns:1fr;}
.dash-grid{grid-template-columns:1fr 1fr;}
.dash-info-grid{grid-template-columns:1fr;}
.card-type-grid{grid-template-columns:1fr;}
.backend-toggle{flex-direction:column;}
/* Larger touch targets */
.btn{padding:10px 18px;}
.chip{padding:7px 14px;font-size:13px;}
.nav-item{padding:12px 14px;}
.form-input,.form-select,.form-textarea{font-size:16px;} /* prevents iOS zoom */
/* Full-width record draft card */
.record-draft{max-width:100%;}
/* Hide page header subtitle on small screens */
.page-header p{display:none;}
/* Summary doc readable on phone */
.summary-doc{padding:16px;}
}
</style>
</head>
<body>
<!-- TOP BAR -->
<div class="topbar">
<div class="brand">
<div class="brand-icon">
<svg viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm0 5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm3 10H9v-1c0-1.7 2.3-2.5 3-2.5s3 .8 3 2.5v1z"/></svg>
</div>
ComCare
</div>
<div class="topbar-right">
<div class="backend-badge" id="backend-badge">
<span class="backend-dot"></span>
<span id="backend-label">Ollama</span>
</div>
<div class="lang-toggle">
<button class="lang-btn active" id="lang-en" onclick="setLang('en')">EN</button>
<button class="lang-btn" id="lang-es" onclick="setLang('es')">ES</button>
</div>
</div>
</div>
<!-- BODY -->
<div class="app-body">
<!-- SIDEBAR -->
<aside class="sidebar">
<div class="nav-primary-label">Primary</div>
<button class="nav-item active" onclick="nav('chat')" id="nav-chat">
<span class="nav-icon"><svg viewBox="0 0 24 24"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/></svg></span>
<span id="nav-chat-label">AI Chat</span>
</button>
<div class="separator"></div>
<div class="nav-section-label">Pages</div>
<button class="nav-item" onclick="nav('dashboard')" id="nav-dashboard">
<span class="nav-icon"><svg viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg></span>
<span id="nav-dashboard-label">Home Dashboard</span>
</button>
<button class="nav-item" onclick="nav('record')" id="nav-record">
<span class="nav-icon"><svg viewBox="0 0 24 24"><path d="M9 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V5a2 2 0 00-2-2h-2M9 3a2 2 0 002 2h2a2 2 0 002-2M9 3a2 2 0 012-2h2a2 2 0 012 2"/></svg></span>
<span id="nav-record-label">Enter a Record</span>
</button>
<button class="nav-item" onclick="nav('summary')" id="nav-summary">
<span class="nav-icon"><svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg></span>
<span id="nav-summary-label">Visit Summary</span>
</button>
<div class="separator"></div>
<button class="nav-item" onclick="nav('settings')" id="nav-settings">
<span class="nav-icon"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"/></svg></span>
<span id="nav-settings-label">Settings</span>
</button>
</aside>
<!-- MAIN -->
<main class="main">
<!-- ── AI CHAT (primary) ── -->
<div class="page active" id="page-chat">
<div class="page-header">
<h1 id="chat-title">AI Chat</h1>
<p id="chat-sub">Talk naturally — ComCare listens and helps you track what matters</p>
</div>
<div class="chat-wrap">
<div class="chat-messages" id="chat-messages">
<div class="msg ai">
<div class="msg-avatar ai">CC</div>
<div>
<div class="msg-bubble" id="welcome-msg">Hello! I'm ComCare. Tell me how things are going — I'll listen, ask a few questions if needed, and help you save important observations for your next doctor visit.</div>
<div class="msg-time">Just now</div>
</div>
</div>
</div>
<div class="chat-input-area">
<div class="suggested-chips" id="chips">
<button class="chip" onclick="sendChip(this)" id="chip1">She's been more confused in the evenings</button>
<button class="chip" onclick="sendChip(this)" id="chip2">He had a near fall today</button>
<button class="chip" onclick="sendChip(this)" id="chip3">Question about her medication</button>
<button class="chip" onclick="sendChip(this)" id="chip4">Help me prepare for the visit</button>
</div>
<div class="chat-summarize-bar" id="summarize-bar">
<button class="btn-summarize" onclick="summarizeChat()">
<svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
Summarize our chat
</button>
<span class="chat-summarize-hint">Re-summarize if you've added more since the last summary</span>
</div>
<div class="chat-input-row">
<textarea class="chat-input" id="chat-input" rows="1" placeholder="Message ComCare…" onkeydown="if(event.key==='Enter'&&!event.shiftKey){event.preventDefault();sendMessage();}"></textarea>
<button class="chat-send" onclick="sendMessage()">
<svg viewBox="0 0 24 24"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
</button>
</div>
</div>
</div>
</div>
<!-- ── HOME DASHBOARD ── -->
<div class="page" id="page-dashboard">
<div class="page-header">
<h1 id="dash-title">Home Dashboard</h1>
<p id="dash-sub">Loading…</p>
</div>
<div class="dash-info-grid">
<div class="info-card highlight">
<div class="info-card-label">💊 Medication tracking today</div>
<div class="info-card-value" id="dash-med">Loading…</div>
<div class="info-card-sub" id="dash-med-sub"></div>
</div>
<div class="info-card highlight">
<div class="info-card-label">📅 Next visit</div>
<div class="info-card-value" id="dash-visit">Loading…</div>
<div class="info-card-sub" id="dash-visit-sub"></div>
</div>
<div class="info-card">
<div class="info-card-label">📋 Recent care notes</div>
<div class="info-card-value" id="dash-notes">No records yet</div>
</div>
<div class="info-card">
<div class="info-card-label">❓ Things to ask at the visit</div>
<div class="info-card-value" id="dash-questions">Add visit questions via Enter a Record</div>
</div>
</div>
<div class="card">
<div class="card-title">
<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
Recent Saved Records
</div>
<div id="dash-records-list">
<div class="text-mid text-sm" style="padding:12px 0;">No records saved yet. Use <strong>AI Chat</strong> or <strong>Enter a Record</strong> to start tracking observations.</div>
</div>
</div>
</div>
<!-- ── ENTER A RECORD ── -->
<div class="page" id="page-record">
<div class="page-header">
<h1 id="rec-title">Enter a Record</h1>
<p id="rec-sub">Choose a record type and fill in the details</p>
</div>
<!-- Step 1: Card type selection -->
<div id="rec-step-1">
<div class="card">
<div class="card-title">Choose a record type</div>
<div class="card-type-grid">
<button class="card-type-btn" onclick="selectCard('care_change')" id="ctype-care_change">
<div class="card-type-icon">🔄</div>
<div class="card-type-name">Care Change</div>
<div class="card-type-desc">New or changed health, behavior, function, sleep, or safety observation</div>
</button>
<button class="card-type-btn" onclick="selectCard('medication')" id="ctype-medication">
<div class="card-type-icon">💊</div>
<div class="card-type-name">Medication / Treatment Question</div>
<div class="card-type-desc">Questions, worries, or confusion about medications or instructions</div>
</button>
<button class="card-type-btn" onclick="selectCard('coordination')" id="ctype-coordination">
<div class="card-type-icon">📋</div>
<div class="card-type-name">Care Coordination Task</div>
<div class="card-type-desc">Follow-up tasks, who handles them, due dates, and status</div>
</button>
<button class="card-type-btn" onclick="selectCard('visit_priority')" id="ctype-visit_priority">
<div class="card-type-icon">🏥</div>
<div class="card-type-name">Visit Question / Priority</div>
<div class="card-type-desc">Questions or priorities to discuss at the next clinical visit</div>
</button>
<button class="card-type-btn" onclick="selectCard('caregiver_support')" id="ctype-caregiver_support">
<div class="card-type-icon">🤝</div>
<div class="card-type-name">Caregiver Support Need</div>
<div class="card-type-desc">Capacity challenges, barriers, and resources needed</div>
</button>
<button class="card-type-btn" onclick="selectCard('what_matters')" id="ctype-what_matters">
<div class="card-type-icon">❤️</div>
<div class="card-type-name">What Matters / Preference</div>
<div class="card-type-desc">Routines, strengths, preferences, and personhood context</div>
</button>
</div>
</div>
</div>
<!-- Step 2: Record forms (shown after selection) -->
<div id="rec-step-2" class="hidden">
<div class="flex-between" style="margin-bottom:16px;">
<div style="font-size:14px;color:var(--text-mid);">
<span id="rec-breadcrumb"></span>
</div>
<button class="btn btn-ghost btn-sm" onclick="backToCardTypes()">← Change type</button>
</div>
<!-- 1. Care Change -->
<div class="record-form card" id="form-care_change">
<div class="card-title">🔄 Care Change</div>
<div class="form-group">
<label class="form-label">Changed / noticed?</label>
<textarea class="form-textarea" id="cc-description" placeholder="Describe the change in health, behavior, function, sleep, eating, or safety…"></textarea>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">First noticed</label>
<input type="date" class="form-input" id="cc-date"/>
</div>
<div class="form-group">
<label class="form-label">Frequency</label>
<select class="form-select" id="cc-frequency">
<option value="">Select…</option>
<option>Once</option><option>Several times</option><option>Daily</option><option>Getting worse</option><option>Unsure</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Stress / severity</label>
<select class="form-select" id="cc-severity">
<option value="">Select…</option>
<option>Mild</option><option>Moderate</option><option>Severe</option><option>Unsure</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Reporter</label>
<select class="form-select" id="cc-reporter">
<option value="">Select…</option>
<option>Observed by me</option><option>PLWD reported</option><option>Other person</option><option>Concern / unsure</option>
</select>
</div>
</div>
<div class="form-group">
<label class="form-label">AI tags (auto-detected category)</label>
<select class="form-select" id="cc-tag">
<option value="">Select…</option>
<option>Health</option><option>Behavior</option><option>Function</option><option>Sleep / Eating</option><option>Safety</option>
</select>
</div>
<div class="form-row">
<div class="form-group">
<label class="check-row"><input type="checkbox" id="cc-sensitive"/> Sensitive — needs careful handling</label>
</div>
<div class="form-group">
<label class="form-label">Visible to</label>
<select class="form-select" id="cc-visibility">
<option>Caregiver only</option><option>Clinician</option><option>Family</option><option>PLWD review</option>
</select>
</div>
</div>
<div class="form-group">
<label class="form-label">Notes</label>
<textarea class="form-textarea" id="cc-notes" placeholder="Any additional context…"></textarea>
</div>
<div class="flex gap-8 mt-12">
<button class="btn btn-primary" onclick="saveRecord('care_change')">
<svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg> Save Record
</button>
<button class="btn btn-ghost" onclick="backToCardTypes()">Cancel</button>
</div>
</div>
<!-- 2. Medication -->
<div class="record-form card" id="form-medication">
<div class="card-title">💊 Medication / Treatment Question</div>
<div class="form-group">
<label class="form-label">Medication or treatment</label>
<input class="form-input" id="med-name" placeholder="Name or instruction…"/>
</div>
<div class="form-group">
<label class="form-label">Concern — what is confusing or worrying?</label>
<textarea class="form-textarea" id="med-concern" placeholder="Describe the question or concern…"></textarea>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">First noticed</label>
<input type="date" class="form-input" id="med-date"/>
</div>
<div class="form-group">
<label class="form-label">Source</label>
<select class="form-select" id="med-source">
<option value="">Select…</option>
<option>PCP</option><option>Neurologist</option><option>Specialist</option><option>Pharmacist</option><option>Hospital</option><option>Family</option><option>Unsure</option>
</select>
</div>
</div>
<div class="form-group">
<label class="form-label">Question to ask clinician or pharmacist</label>
<textarea class="form-textarea" id="med-question" placeholder="What do you want to ask?"></textarea>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Reporter</label>
<select class="form-select" id="med-reporter">
<option value="">Select…</option>
<option>Observed by me</option><option>PLWD reported</option><option>Other</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Visible to</label>
<select class="form-select" id="med-visibility">
<option>Caregiver only</option><option>Clinician</option><option>Family</option><option>PLWD review</option>
</select>
</div>
</div>
<div class="form-group">
<label class="check-row"><input type="checkbox" id="med-sensitive"/> Sensitive — needs careful handling</label>
</div>
<div class="form-group">
<label class="form-label">Notes</label>
<textarea class="form-textarea" id="med-notes"></textarea>
</div>
<div class="flex gap-8 mt-12">
<button class="btn btn-primary" onclick="saveRecord('medication')">
<svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg> Save Record
</button>
<button class="btn btn-ghost" onclick="backToCardTypes()">Cancel</button>
</div>
</div>
<!-- 3. Coordination -->
<div class="record-form card" id="form-coordination">
<div class="card-title">📋 Care Coordination Task</div>
<div class="form-group">
<label class="form-label">Follow-up item — what needs handling?</label>
<textarea class="form-textarea" id="coord-item" placeholder="Describe the task…"></textarea>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Responsible</label>
<select class="form-select" id="coord-responsible">
<option value="">Select…</option>
<option>Me</option><option>PCP</option><option>Specialist</option><option>Pharmacist</option><option>Insurer</option><option>Family</option><option>Agency</option><option>Unsure</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Due date</label>
<input type="date" class="form-input" id="coord-due"/>
</div>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Status</label>
<select class="form-select" id="coord-status">
<option>Needs action</option><option>Waiting</option><option>Overdue</option><option>Done</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Importance</label>
<select class="form-select" id="coord-importance">
<option>Low</option><option>Medium</option><option>High</option>
</select>
</div>
</div>
<div class="form-group">
<label class="check-row"><input type="checkbox" id="coord-sensitive"/> Sensitive — needs careful handling</label>
</div>
<div class="form-group">
<label class="form-label">Notes</label>
<textarea class="form-textarea" id="coord-notes"></textarea>
</div>
<div class="flex gap-8 mt-12">
<button class="btn btn-primary" onclick="saveRecord('coordination')">
<svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg> Save Record
</button>
<button class="btn btn-ghost" onclick="backToCardTypes()">Cancel</button>
</div>
</div>
<!-- 4. Visit Priority -->
<div class="record-form card" id="form-visit_priority">
<div class="card-title">🏥 Visit Question / Priority</div>
<div class="form-group">
<label class="form-label">Ask / discuss — main question or priority</label>
<textarea class="form-textarea" id="vp-question" placeholder="What do you want to discuss at the visit?"></textarea>
</div>
<div class="form-group">
<label class="form-label">Why now? — reason this matters</label>
<textarea class="form-textarea" id="vp-why" placeholder="Why is this a priority?"></textarea>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Priority level</label>
<select class="form-select" id="vp-priority">
<option>Top concern</option><option>If time allows</option><option>Later</option>
</select>
</div>
<div class="form-group">
<label class="form-label">AI topic</label>
<select class="form-select" id="vp-topic">
<option value="">Select…</option>
<option>Planning</option><option>Safety</option><option>Services</option><option>Family comms</option><option>Future planning</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Discuss with PLWD?</label>
<select class="form-select" id="vp-plwd">
<option>Yes</option><option>No</option><option>Unsure</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Visible to</label>
<select class="form-select" id="vp-visibility">
<option>Caregiver only</option><option>Family</option><option>PLWD review</option>
</select>
</div>
</div>
<div class="form-group">
<label class="check-row"><input type="checkbox" id="vp-sensitive"/> Sensitive — needs careful handling</label>
</div>
<div class="form-group">
<label class="form-label">Notes</label>
<textarea class="form-textarea" id="vp-notes"></textarea>
</div>
<div class="flex gap-8 mt-12">
<button class="btn btn-primary" onclick="saveRecord('visit_priority')">
<svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg> Save Record
</button>
<button class="btn btn-ghost" onclick="backToCardTypes()">Cancel</button>
</div>
</div>
<!-- 5. Caregiver Support -->
<div class="record-form card" id="form-caregiver_support">
<div class="card-title">🤝 Caregiver Support Need</div>
<div class="form-group">
<label class="form-label">Challenge — what is hard right now?</label>
<textarea class="form-textarea" id="cs-challenge" placeholder="Describe the challenge or support need…"></textarea>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Impact</label>
<select class="form-select" id="cs-impact">
<option>A little</option><option>Somewhat</option><option>A lot</option><option>Unsure</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Type of help needed</label>
<select class="form-select" id="cs-help">
<option value="">Select…</option>
<option>Emotional</option><option>Practical</option><option>Skills / training</option><option>Family support</option><option>Services</option><option>Legal / financial</option><option>Unsure</option>
</select>
</div>
</div>
<div class="form-group">
<label class="check-row"><input type="checkbox" id="cs-sensitive"/> Sensitive — needs careful handling</label>
</div>
<div class="form-group">
<label class="form-label">Notes</label>
<textarea class="form-textarea" id="cs-notes"></textarea>
</div>
<div class="flex gap-8 mt-12">
<button class="btn btn-primary" onclick="saveRecord('caregiver_support')">
<svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg> Save Record
</button>
<button class="btn btn-ghost" onclick="backToCardTypes()">Cancel</button>
</div>
</div>
<!-- 6. What Matters -->
<div class="record-form card" id="form-what_matters">
<div class="card-title">❤️ What Matters / Preference</div>
<div class="form-group">
<label class="form-label">Remember about this person</label>
<textarea class="form-textarea" id="wm-description" placeholder="Routine, preference, strength, or what matters to them…"></textarea>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Perspective</label>
<select class="form-select" id="wm-perspective">
<option>PLWD</option><option>Caregiver</option><option>Shared</option><option>Unsure</option>
</select>
</div>
<div class="form-group">
<label class="form-label">When relevant</label>
<select class="form-select" id="wm-when">
<option value="">Select…</option>
<option>Morning</option><option>Daytime</option><option>Evening</option><option>Night</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Scenario</label>
<select class="form-select" id="wm-scenario">
<option value="">Select…</option>
<option>Meals</option><option>Personal care</option><option>Leaving home</option><option>Visits</option><option>Other</option>
</select>
</div>
<div class="form-group">
<label class="form-label">AI tag</label>
<select class="form-select" id="wm-tag">
<option value="">Select…</option>
<option>Comfort</option><option>Safety</option><option>Routine</option><option>Preference</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group">
<label class="check-row"><input type="checkbox" id="wm-sensitive"/> Sensitive — needs careful handling</label>
</div>
<div class="form-group">
<label class="form-label">Visible to</label>
<select class="form-select" id="wm-visibility">
<option>Caregiver only</option><option>Clinician</option><option>Family</option><option>PLWD review</option>
</select>
</div>
</div>
<div class="form-group">
<label class="form-label">Notes</label>
<textarea class="form-textarea" id="wm-notes"></textarea>
</div>
<div class="flex gap-8 mt-12">
<button class="btn btn-primary" onclick="saveRecord('what_matters')">
<svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg> Save Record
</button>
<button class="btn btn-ghost" onclick="backToCardTypes()">Cancel</button>
</div>
</div>
</div>
<!-- Record history -->
<div class="card" id="rec-history-card">
<div class="card-title">Saved Records</div>
<div id="rec-history-list">
<div class="text-mid text-sm" style="padding:12px 0;">No records yet.</div>
</div>
</div>
</div>
<!-- ── VISIT SUMMARY ── -->
<div class="page" id="page-summary">
<div class="page-header">
<h1 id="sum-title">Visit Summary</h1>
<p id="sum-sub">Generate a tailored summary for your upcoming appointment</p>
</div>
<!-- Step 1: Specialty -->
<div class="card">
<div class="card-title">
<svg viewBox="0 0 24 24"><path d="M22 12h-4l-3 9L9 3l-3 9H2"/></svg>
Which specialty are you visiting?
</div>
<div class="specialty-grid">
<button class="specialty-btn" data-specialty="Neurology" onclick="selectSpecialty(this)">
<div class="specialty-icon">🧠</div>
<div class="specialty-name">Neurology</div>
</button>
<button class="specialty-btn" data-specialty="Cardiology" onclick="selectSpecialty(this)">
<div class="specialty-icon">❤️</div>
<div class="specialty-name">Cardiology</div>
</button>
<button class="specialty-btn" data-specialty="Primary Care" onclick="selectSpecialty(this)">
<div class="specialty-icon">🏥</div>
<div class="specialty-name">Primary Care</div>
</button>
<button class="specialty-btn" data-specialty="Physical Therapy" onclick="selectSpecialty(this)">
<div class="specialty-icon">🦵</div>
<div class="specialty-name">Physical Therapy</div>
</button>
<button class="specialty-btn" data-specialty="Pharmacy / Medication Review" onclick="selectSpecialty(this)">
<div class="specialty-icon">💊</div>
<div class="specialty-name">Pharmacy / Meds</div>
</button>
<button class="specialty-btn" data-specialty="Social Work / Care Coordination" onclick="selectSpecialty(this)">
<div class="specialty-icon">🤝</div>
<div class="specialty-name">Social Work</div>
</button>
</div>
<div class="form-group">
<label class="form-label">Other / custom specialty</label>
<input type="text" class="form-input" id="sum-specialty-custom" placeholder="e.g. Geriatrics, Oncology…" oninput="clearSpecialtyGrid()"/>
</div>
</div>
<!-- Step 2: Visit details -->
<div class="card">
<div class="card-title">
<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
Visit details
</div>
<div class="form-group">
<label class="form-label">Purpose of this visit</label>
<input type="text" class="form-input" id="sum-purpose" placeholder="e.g. Follow-up on memory decline, review fall risk, adjust medications"/>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Date range</label>
<input type="text" class="form-input" id="sum-range" placeholder="e.g. June 1 – June 19, 2026"/>
</div>
<div class="form-group">
<label class="form-label">Concerns to highlight</label>
<input type="text" class="form-input" id="sum-concerns" placeholder="e.g. Gait instability, evening confusion"/>
</div>
</div>
<div class="form-group">
<label class="form-label">Questions for the provider</label>
<textarea class="form-textarea" id="sum-questions" placeholder="e.g. Should we adjust Donepezil? Is PT an option?" style="min-height:60px;"></textarea>
</div>
<button class="btn btn-primary" onclick="generateSummary()" id="sum-gen-btn">
<svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
Generate Summary
</button>
</div>
<!-- Output (editable) -->
<div id="sum-output" class="hidden">
<div class="flex-between" style="margin-bottom:8px;">
<div class="text-sm text-mid" id="sum-generated-at"></div>
<div class="flex gap-8">
<button class="btn btn-outline btn-sm" onclick="copyReport()">
<svg viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>
Copy
</button>
<button class="btn btn-outline btn-sm" onclick="downloadReport()">
<svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Download
</button>
</div>
</div>
<p class="edit-hint">✏️ You can edit the summary directly below before copying or downloading.</p>
<textarea class="summary-editable" id="sum-editable" spellcheck="true"></textarea>
</div>
</div>
<!-- ── SETTINGS ── -->
<div class="page" id="page-settings">
<div class="page-header">
<h1 id="set-title">Settings</h1>
<p id="set-sub">Configure ComCare for your family</p>
</div>
<!-- AI Backend -->
<div class="card">
<div class="card-title">
<svg viewBox="0 0 24 24"><path d="M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z"/></svg>
AI Backend
</div>
<div class="backend-toggle">
<button class="backend-opt active" id="be-ollama" onclick="selectBackend('ollama')">
<div class="backend-opt-name">🦙 Ollama (Local)</div>
<div class="backend-opt-desc">Private, runs on your machine. No data leaves.</div>
</button>
<button class="backend-opt" id="be-azure" onclick="selectBackend('azure')">
<div class="backend-opt-name">☁️ Azure OpenAI</div>
<div class="backend-opt-desc">Cloud GPT-4o. Requires endpoint + API key.</div>
</button>
</div>
<!-- Ollama config -->
<div id="ollama-config">
<div class="form-row">
<div class="form-group">
<label class="form-label">Ollama URL</label>
<input class="form-input" id="s-ollama-url" placeholder="http://localhost:11434"/>
</div>
<div class="form-group">
<label class="form-label">Model</label>
<input class="form-input" id="s-ollama-model" placeholder="llama3.1:latest"/>
</div>
</div>
</div>
<!-- Azure config -->
<div id="azure-config" class="hidden">
<div class="form-group">
<label class="form-label">Azure OpenAI Endpoint</label>
<input class="form-input" id="s-azure-endpoint" placeholder="https://your-resource.openai.azure.com"/>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">API Key</label>
<input type="password" class="form-input" id="s-azure-key" placeholder="••••••••"/>
</div>
<div class="form-group">
<label class="form-label">Deployment name</label>
<input class="form-input" id="s-azure-deployment" placeholder="gpt-4o"/>
</div>