-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathboost_tuning_guide.html
More file actions
1355 lines (1247 loc) · 54.1 KB
/
boost_tuning_guide.html
File metadata and controls
1355 lines (1247 loc) · 54.1 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">
<title>Boost Plugin Tuning Guide</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Segoe UI', system-ui, sans-serif;
background: #0f1117;
color: #e2e8f0;
padding: 32px 24px;
min-width: 900px;
}
/* ── Header ─────────────────────────────────────────────── */
.header {
text-align: center;
margin-bottom: 40px;
}
.header h1 {
font-size: 2rem;
font-weight: 700;
letter-spacing: -0.5px;
color: #fff;
}
.header h1 span { color: #6ee7b7; }
.header p {
margin-top: 8px;
font-size: 0.95rem;
color: #94a3b8;
}
.version-badge {
display: inline-block;
margin-top: 12px;
padding: 4px 12px;
border-radius: 99px;
font-size: 0.78rem;
font-weight: 600;
background: #1e293b;
border: 1px solid #334155;
color: #94a3b8;
}
.version-badge .v1 { color: #60a5fa; }
.version-badge .v2 { color: #a78bfa; }
/* ── Spectrum legend ─────────────────────────────────────── */
.legend {
display: flex;
justify-content: center;
gap: 24px;
margin-bottom: 32px;
}
.legend-item {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.82rem;
color: #94a3b8;
}
.legend-dot {
width: 12px; height: 12px;
border-radius: 3px;
}
.dot-conservative { background: #3b82f6; }
.dot-neutral { background: #6b7280; }
.dot-aggressive { background: #f97316; }
.dot-default { background: #22c55e; }
/* ── Section grid ────────────────────────────────────────── */
.grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
max-width: 1200px;
margin: 0 auto 20px;
}
.grid-3 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 20px;
max-width: 1200px;
margin: 0 auto 20px;
}
.full-width {
max-width: 1200px;
margin: 0 auto 20px;
}
/* ── Card ────────────────────────────────────────────────── */
.card {
background: #1e293b;
border: 1px solid #2d3748;
border-radius: 12px;
padding: 20px;
}
.card-header {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 16px;
padding-bottom: 12px;
border-bottom: 1px solid #2d3748;
}
.card-icon {
width: 32px; height: 32px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
flex-shrink: 0;
}
.icon-blue { background: #1d4ed8; }
.icon-orange { background: #c2410c; }
.icon-green { background: #15803d; }
.icon-purple { background: #7c3aed; }
.icon-teal { background: #0f766e; }
.icon-yellow { background: #a16207; }
.icon-red { background: #b91c1c; }
.icon-slate { background: #475569; }
.card-title {
font-size: 0.95rem;
font-weight: 700;
color: #f1f5f9;
letter-spacing: 0.2px;
}
.card-subtitle {
font-size: 0.75rem;
color: #64748b;
margin-top: 2px;
}
/* ── Setting row ─────────────────────────────────────────── */
.setting {
margin-bottom: 14px;
}
.setting:last-child { margin-bottom: 0; }
.setting-top {
display: flex;
justify-content: space-between;
align-items: baseline;
margin-bottom: 4px;
}
.setting-name {
font-size: 0.82rem;
font-weight: 600;
color: #cbd5e1;
}
.setting-key {
font-size: 0.7rem;
font-family: 'SF Mono', 'Cascadia Code', monospace;
color: #475569;
}
.setting-desc {
font-size: 0.75rem;
color: #64748b;
margin-bottom: 6px;
line-height: 1.4;
}
/* ── Spectrum bar ────────────────────────────────────────── */
.spectrum-wrap {
position: relative;
height: 22px;
}
.spectrum-bar {
height: 8px;
border-radius: 99px;
background: linear-gradient(to right, #3b82f6 0%, #6b7280 50%, #f97316 100%);
margin-top: 7px;
}
.spectrum-labels {
display: flex;
justify-content: space-between;
font-size: 0.65rem;
color: #475569;
margin-top: 2px;
}
.default-marker {
position: absolute;
top: 0;
transform: translateX(-50%);
display: flex;
flex-direction: column;
align-items: center;
}
.default-pip {
width: 10px; height: 10px;
background: #22c55e;
border-radius: 50%;
border: 2px solid #0f1117;
margin-top: 2px;
}
.default-label {
font-size: 0.62rem;
font-weight: 700;
color: #22c55e;
white-space: nowrap;
margin-top: 0px;
}
/* ── Toggle row ──────────────────────────────────────────── */
.toggle-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 10px;
border-radius: 8px;
margin-bottom: 6px;
font-size: 0.8rem;
}
.toggle-row:last-child { margin-bottom: 0; }
.toggle-name { font-weight: 600; color: #cbd5e1; }
.toggle-desc { font-size: 0.72rem; color: #64748b; margin-top: 1px; }
.badge {
font-size: 0.68rem;
font-weight: 700;
padding: 3px 9px;
border-radius: 99px;
white-space: nowrap;
flex-shrink: 0;
margin-left: 10px;
}
.badge-on-agg { background: #431407; color: #fb923c; border: 1px solid #9a3412; }
.badge-off-agg { background: #1e3a5f; color: #60a5fa; border: 1px solid #1d4ed8; }
.badge-on-cons { background: #1e3a5f; color: #60a5fa; border: 1px solid #1d4ed8; }
.badge-off-cons{ background: #431407; color: #fb923c; border: 1px solid #9a3412; }
.badge-neutral { background: #1e293b; color: #94a3b8; border: 1px solid #334155; }
/* ── Formula box ─────────────────────────────────────────── */
.formula-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
margin-top: 4px;
}
.formula-box {
background: #0f1117;
border: 1px solid #2d3748;
border-radius: 8px;
padding: 12px;
}
.formula-label {
font-size: 0.72rem;
font-weight: 700;
margin-bottom: 6px;
}
.formula-label.v1 { color: #60a5fa; }
.formula-label.v2 { color: #a78bfa; }
.formula-text {
font-family: 'SF Mono', 'Cascadia Code', monospace;
font-size: 0.75rem;
color: #e2e8f0;
line-height: 1.5;
}
.formula-note {
font-size: 0.7rem;
color: #64748b;
margin-top: 6px;
line-height: 1.4;
}
/* ── Step table ──────────────────────────────────────────── */
.step-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 8px;
margin-top: 4px;
}
.step-cell {
background: #0f1117;
border: 1px solid #2d3748;
border-radius: 8px;
padding: 10px;
text-align: center;
}
.step-cell-label {
font-size: 0.7rem;
color: #64748b;
margin-bottom: 4px;
}
.step-cell-value {
font-size: 1rem;
font-weight: 700;
color: #f1f5f9;
}
.step-cell-unit {
font-size: 0.65rem;
color: #475569;
margin-top: 2px;
}
/* ── Summary / guidance ──────────────────────────────────── */
.guidance-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.guidance-box {
border-radius: 8px;
padding: 14px;
}
.guidance-box.conservative { background: #0c1a2e; border: 1px solid #1d4ed8; }
.guidance-box.aggressive { background: #1c0a00; border: 1px solid #c2410c; }
.guidance-box h4 {
font-size: 0.82rem;
font-weight: 700;
margin-bottom: 8px;
}
.guidance-box.conservative h4 { color: #60a5fa; }
.guidance-box.aggressive h4 { color: #fb923c; }
.guidance-box ul {
list-style: none;
padding: 0;
}
.guidance-box li {
font-size: 0.76rem;
color: #94a3b8;
padding: 3px 0;
padding-left: 14px;
position: relative;
line-height: 1.35;
}
.guidance-box.conservative li::before { content: '↓'; position: absolute; left: 0; color: #3b82f6; }
.guidance-box.aggressive li::before { content: '↑'; position: absolute; left: 0; color: #f97316; }
/* ── Warning banner ──────────────────────────────────────── */
.warning {
background: #1c1400;
border: 1px solid #854d0e;
border-radius: 8px;
padding: 12px 16px;
font-size: 0.78rem;
color: #fde047;
display: flex;
gap: 10px;
align-items: flex-start;
margin-top: 0;
}
.warning-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.warning b { color: #fef08a; }
/* ── V2 diff callout ─────────────────────────────────────── */
.v2-diff {
background: #130d27;
border: 1px solid #7c3aed;
border-radius: 8px;
padding: 10px 14px;
font-size: 0.77rem;
color: #c4b5fd;
margin-top: 12px;
}
.v2-diff b { color: #a78bfa; }
/* ── Footer ──────────────────────────────────────────────── */
.footer {
text-align: center;
margin-top: 32px;
font-size: 0.72rem;
color: #334155;
}
/* ── Scenario cards ───────────────────────────────────────── */
.scenario-section-header {
text-align: center;
margin: 48px 0 28px;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}
.scenario-section-header h2 {
font-size: 1.4rem;
font-weight: 700;
color: #fff;
}
.scenario-section-header h2 span { color: #6ee7b7; }
.scenario-section-header p {
font-size: 0.85rem;
color: #64748b;
margin-top: 6px;
}
.scenario-card {
max-width: 1200px;
margin: 0 auto 20px;
border-radius: 14px;
overflow: hidden;
border: 1px solid;
}
.scenario-card.hypo { border-color: #7f1d1d; }
.scenario-card.plateau { border-color: #78350f; }
.scenario-card.stuck { border-color: #1e3a5f; }
.scenario-banner {
padding: 18px 24px;
display: flex;
align-items: flex-start;
gap: 16px;
}
.scenario-card.hypo .scenario-banner { background: #1c0505; }
.scenario-card.plateau .scenario-banner { background: #1c0f00; }
.scenario-card.stuck .scenario-banner { background: #040d1c; }
.scenario-icon {
font-size: 1.8rem;
flex-shrink: 0;
line-height: 1;
margin-top: 2px;
}
.scenario-title {
font-size: 1.05rem;
font-weight: 700;
color: #fff;
margin-bottom: 4px;
}
.scenario-card.hypo .scenario-title { color: #fca5a5; }
.scenario-card.plateau .scenario-title { color: #fcd34d; }
.scenario-card.stuck .scenario-title { color: #93c5fd; }
.scenario-subtitle {
font-size: 0.8rem;
color: #64748b;
line-height: 1.4;
}
.scenario-body {
background: #1e293b;
padding: 20px 24px;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 16px;
}
.scenario-col-title {
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.5px;
text-transform: uppercase;
margin-bottom: 12px;
padding-bottom: 8px;
border-bottom: 1px solid #2d3748;
}
.col-mechanism .scenario-col-title { color: #94a3b8; }
.col-fix .scenario-col-title { color: #6ee7b7; }
.col-avoid .scenario-col-title { color: #f97316; }
.mechanism-text {
font-size: 0.78rem;
color: #94a3b8;
line-height: 1.6;
}
.mechanism-text b { color: #cbd5e1; }
.fix-list {
list-style: none;
padding: 0;
}
.fix-list li {
font-size: 0.78rem;
color: #94a3b8;
padding: 5px 0 5px 14px;
position: relative;
border-bottom: 1px solid #1e293b;
line-height: 1.4;
}
.fix-list li:last-child { border-bottom: none; }
.fix-list li::before {
content: '→';
position: absolute;
left: 0;
color: #6ee7b7;
font-weight: 700;
}
.fix-list li b { color: #f1f5f9; }
.fix-list li .fix-val {
display: inline-block;
margin-top: 3px;
font-family: monospace;
font-size: 0.72rem;
background: #0f1117;
border: 1px solid #334155;
border-radius: 4px;
padding: 1px 6px;
color: #6ee7b7;
}
.fix-priority {
display: inline-block;
font-size: 0.62rem;
font-weight: 700;
padding: 1px 5px;
border-radius: 3px;
margin-left: 4px;
vertical-align: middle;
background: #064e3b;
color: #34d399;
border: 1px solid #059669;
}
.avoid-list {
list-style: none;
padding: 0;
}
.avoid-list li {
font-size: 0.78rem;
color: #94a3b8;
padding: 5px 0 5px 14px;
position: relative;
border-bottom: 1px solid #1e293b;
line-height: 1.4;
}
.avoid-list li:last-child { border-bottom: none; }
.avoid-list li::before {
content: '✕';
position: absolute;
left: 0;
color: #f87171;
font-weight: 700;
font-size: 0.7rem;
}
.avoid-list li b { color: #fca5a5; }
/* Helper */
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
</style>
</head>
<body>
<!-- ══════════════════════════════════════════════════════════ -->
<!-- HEADER -->
<!-- ══════════════════════════════════════════════════════════ -->
<div class="header">
<h1>Boost Plugin <span>Tuning Guide</span></h1>
<p>How each setting controls aggressiveness — and how to adjust them</p>
<div class="version-badge">
<span class="v1">BOOST v1</span>
·
<span class="v2">BOOST V2</span>
— settings shared unless noted
</div>
</div>
<div class="legend">
<div class="legend-item"><div class="legend-dot dot-conservative"></div>More conservative</div>
<div class="legend-item"><div class="legend-dot dot-default"></div>Default value</div>
<div class="legend-item"><div class="legend-dot dot-aggressive"></div>More aggressive</div>
</div>
<!-- ══════════════════════════════════════════════════════════ -->
<!-- ROW 1: Core delivery limits + Dynamic ISF -->
<!-- ══════════════════════════════════════════════════════════ -->
<div class="grid full-width">
<!-- Core Delivery Controls -->
<div class="card">
<div class="card-header">
<div class="card-icon icon-orange">💉</div>
<div>
<div class="card-title">Core Delivery Controls</div>
<div class="card-subtitle">Primary levers for how much insulin Boost delivers</div>
</div>
</div>
<!-- Boost Scale -->
<div class="setting">
<div class="setting-top">
<span class="setting-name">Boost Scale</span>
<span class="setting-key">ApsBoostScale</span>
</div>
<div class="setting-desc">Direct multiplier on calculated Boost insulin. Values ≥ 3.0 disable Boost entirely and fall back to oref1.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar"></div>
<div class="default-marker" style="left: 33%">
<div class="default-pip"></div>
<div class="default-label">1.0</div>
</div>
<div class="spectrum-labels"><span>0.1 (min)</span><span>3.0 disables Boost</span></div>
</div>
</div>
<!-- Max IOB -->
<div class="setting">
<div class="setting-top">
<span class="setting-name">Max IOB</span>
<span class="setting-key">ApsBoostMaxIob</span>
</div>
<div class="setting-desc">IOB ceiling. Above this, Boost falls back to standard oref1. Acts as a hard safety limit.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar"></div>
<div class="default-marker" style="left: 8%">
<div class="default-pip"></div>
<div class="default-label">1.0 U</div>
</div>
<div class="spectrum-labels"><span>0.1 U</span><span>12.0 U</span></div>
</div>
</div>
<!-- Bolus Cap -->
<div class="setting">
<div class="setting-top">
<span class="setting-name">Bolus Cap</span>
<span class="setting-key">ApsBoostBolus</span>
</div>
<div class="setting-desc">Maximum insulin per individual Boost SMB delivery regardless of other calculations.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar"></div>
<div class="default-marker" style="left: 24%">
<div class="default-pip"></div>
<div class="default-label">2.5 U</div>
</div>
<div class="spectrum-labels"><span>0.1 U</span><span>10.0 U</span></div>
</div>
</div>
<!-- Insulin Required % -->
<div class="setting">
<div class="setting-top">
<span class="setting-name">Insulin Required %</span>
<span class="setting-key">ApsBoostInsulinReqPct</span>
</div>
<div class="setting-desc">What fraction of the algorithm's calculated insulin need to actually deliver as an SMB.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar"></div>
<div class="default-marker" style="left: 29%">
<div class="default-pip"></div>
<div class="default-label">50%</div>
</div>
<div class="spectrum-labels"><span>30% (cautious)</span><span>100% (full)</span></div>
</div>
</div>
<!-- Percent Scale -->
<div class="setting">
<div class="setting-top">
<span class="setting-name">Percent Scale Factor</span>
<span class="setting-key">ApsBoostPercentScale</span>
</div>
<div class="setting-desc">Max scale factor when BG is 108–180 mg/dL with rising delta. Only active if Percent Scaling is enabled.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar"></div>
<div class="default-marker" style="left: 33%">
<div class="default-pip"></div>
<div class="default-label">200%</div>
</div>
<div class="spectrum-labels"><span>50%</span><span>500%</span></div>
</div>
</div>
</div>
<!-- Dynamic ISF -->
<div class="card">
<div class="card-header">
<div class="card-icon icon-blue">📐</div>
<div>
<div class="card-title">Dynamic ISF</div>
<div class="card-subtitle">How insulin sensitivity is calculated from TDD and BG</div>
</div>
</div>
<!-- DynISF Velocity -->
<div class="setting">
<div class="setting-top">
<span class="setting-name">BG Impact on ISF</span>
<span class="setting-key">ApsBoostDynIsfVelocity</span>
</div>
<div class="setting-desc">How much current BG level shifts ISF. 0% = constant ISF from TDD only. 100% = ISF scales fully with BG level. <b style="color:#a78bfa">V2: always 100%.</b></div>
<div class="spectrum-wrap">
<div class="spectrum-bar"></div>
<div class="default-marker" style="left: 50%">
<div class="default-pip"></div>
<div class="default-label">100%</div>
</div>
<div class="spectrum-labels"><span>0% (flat)</span><span>100% (BG-reactive)</span></div>
</div>
</div>
<!-- Normal Target -->
<div class="setting">
<div class="setting-top">
<span class="setting-name">DynISF Normal Target</span>
<span class="setting-key">ApsBoostDynIsfNormalTarget</span>
</div>
<div class="setting-desc">Reference BG used in the ISF formula. Lower = more aggressive ISF at a given BG.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar" style="background: linear-gradient(to right, #f97316, #6b7280, #3b82f6)"></div>
<div class="default-marker" style="left: 48%">
<div class="default-pip"></div>
<div class="default-label">99 mg/dL</div>
</div>
<div class="spectrum-labels"><span>70 (aggressive)</span><span>120 (conservative)</span></div>
</div>
</div>
<!-- BG Cap -->
<div class="setting">
<div class="setting-top">
<span class="setting-name">DynISF BG Cap</span>
<span class="setting-key">ApsBoostDynIsfBgCap</span>
</div>
<div class="setting-desc">BG above this is softened: effective BG = cap + (actual − cap) ÷ 3. Prevents extreme ISF at very high BG.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar" style="background: linear-gradient(to right, #f97316, #6b7280, #3b82f6)"></div>
<div class="default-marker" style="left: 55%">
<div class="default-pip"></div>
<div class="default-label">210 mg/dL</div>
</div>
<div class="spectrum-labels"><span>100 (more softening)</span><span>300 (less softening)</span></div>
</div>
</div>
<!-- TDD Adjustment Factor -->
<div class="setting">
<div class="setting-top">
<span class="setting-name">TDD Adjustment Factor</span>
<span class="setting-key">ApsBoostDynIsfAdjustmentFactor</span>
</div>
<div class="setting-desc">Scales the TDD used in ISF calculation. Below 100% = treats you as lower TDD = weaker ISF = less insulin.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar"></div>
<div class="default-marker" style="left: 33%">
<div class="default-pip"></div>
<div class="default-label">100%</div>
</div>
<div class="spectrum-labels"><span>1% (very weak ISF)</span><span>300% (very strong ISF)</span></div>
</div>
</div>
<!-- Formula callout -->
<div class="formula-grid mt8">
<div class="formula-box">
<div class="formula-label v1">BOOST v1 ISF Formula</div>
<div class="formula-text">ISF = 1800 ÷ (TDD × ln(target ÷ div + 1))</div>
<div class="formula-note">TDD is a blended 8h/7D/1D weighted average. Velocity scales BG sensitivity.</div>
</div>
<div class="formula-box">
<div class="formula-label v2">BOOST v2 ISF Formula (Chris Wilson)</div>
<div class="formula-text">ISF = 2300 ÷ (ln(target ÷ div + 1) × TDD² × 0.02)</div>
<div class="formula-note">Squares TDD — more sensitive to TDD changes. Velocity is always 1.0.</div>
</div>
</div>
</div>
</div>
<!-- ══════════════════════════════════════════════════════════ -->
<!-- ROW 2: Activity / Inactivity / Night -->
<!-- ══════════════════════════════════════════════════════════ -->
<div class="grid full-width">
<!-- Activity Detection -->
<div class="card">
<div class="card-header">
<div class="card-icon icon-green">🏃</div>
<div>
<div class="card-title">Activity Detection</div>
<div class="card-subtitle">Step-count thresholds and insulin adjustment when active</div>
</div>
</div>
<p style="font-size:0.77rem; color:#64748b; margin-bottom:12px;">
When ANY threshold below is exceeded, the <b style="color:#cbd5e1">Activity Profile %</b> is applied and BG target is set to 150 mg/dL (if no temp target is active).
</p>
<div class="step-grid">
<div class="step-cell">
<div class="step-cell-label">5-min window</div>
<div class="step-cell-value">420</div>
<div class="step-cell-unit">steps triggers active</div>
</div>
<div class="step-cell">
<div class="step-cell-label">30-min window</div>
<div class="step-cell-value">1,200</div>
<div class="step-cell-unit">steps triggers active</div>
</div>
<div class="step-cell">
<div class="step-cell-label">60-min window</div>
<div class="step-cell-value">1,800</div>
<div class="step-cell-unit">steps triggers active</div>
</div>
</div>
<div class="setting mt12">
<div class="setting-top">
<span class="setting-name">Activity Profile %</span>
<span class="setting-key">ApsBoostActivityPct</span>
</div>
<div class="setting-desc">Applied when active. <100% = more insulin (treats activity as insulin-requiring). >100% = less insulin.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar" style="background: linear-gradient(to right, #f97316, #6b7280, #3b82f6)"></div>
<div class="default-marker" style="left: 36%">
<div class="default-pip"></div>
<div class="default-label">80%</div>
</div>
<div class="spectrum-labels"><span>30% (more insulin)</span><span>150% (less insulin)</span></div>
</div>
</div>
<div class="setting">
<div class="setting-top">
<span class="setting-name">Inactivity Profile %</span>
<span class="setting-key">ApsBoostInactivityPct</span>
</div>
<div class="setting-desc">Applied when steps/hr is below inactivity threshold. >100% = less insulin during sedentary periods.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar" style="background: linear-gradient(to right, #f97316, #6b7280, #3b82f6)"></div>
<div class="default-marker" style="left: 30%">
<div class="default-pip"></div>
<div class="default-label">130%</div>
</div>
<div class="spectrum-labels"><span>100% (no change)</span><span>200% (much less insulin)</span></div>
</div>
</div>
<div class="setting">
<div class="setting-top">
<span class="setting-name">Inactivity Threshold</span>
<span class="setting-key">ApsBoostInactivitySteps</span>
</div>
<div class="setting-desc">Steps per hour below which inactivity mode triggers. Higher = easier to trigger inactivity reduction.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar"></div>
<div class="default-marker" style="left: 50%">
<div class="default-pip"></div>
<div class="default-label">500/hr</div>
</div>
<div class="spectrum-labels"><span>1 steps/hr</span><span>1,000 steps/hr</span></div>
</div>
</div>
</div>
<!-- Night Mode + Sleep-in -->
<div class="card">
<div class="card-header">
<div class="card-icon icon-purple">🌙</div>
<div>
<div class="card-title">Night Mode & Sleep-in</div>
<div class="card-subtitle">SMB suppression near target during sleep hours</div>
</div>
</div>
<div class="toggle-row" style="background:#0f1117; border:1px solid #2d3748">
<div>
<div class="toggle-name">Night Mode</div>
<div class="toggle-desc">Disables SMBs during night window when BG is near target (within BG Offset)</div>
</div>
<span class="badge badge-on-cons">Default: OFF</span>
</div>
<div class="setting mt12">
<div class="setting-top">
<span class="setting-name">Night Mode BG Offset</span>
<span class="setting-key">ApsBoostNightModeBgOffset</span>
</div>
<div class="setting-desc">SMBs suppressed when BG < (profile target + offset). Higher offset = more aggressive suppression zone.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar" style="background: linear-gradient(to right, #f97316, #6b7280, #3b82f6)"></div>
<div class="default-marker" style="left: 30%">
<div class="default-pip"></div>
<div class="default-label">27 mg/dL</div>
</div>
<div class="spectrum-labels"><span>0 (only at target)</span><span>90 mg/dL (wide zone)</span></div>
</div>
</div>
<div class="toggle-row mt8" style="background:#0f1117; border:1px solid #2d3748">
<div>
<div class="toggle-name">Disable Night Mode if COB > 0</div>
<div class="toggle-desc">Allow SMBs during night if carbs on board</div>
</div>
<span class="badge badge-neutral">Default: OFF</span>
</div>
<div class="toggle-row" style="background:#0f1117; border:1px solid #2d3748">
<div>
<div class="toggle-name">Disable Night Mode with Low TT</div>
<div class="toggle-desc">Allow SMBs if a low temp target is active during night window</div>
</div>
<span class="badge badge-neutral">Default: OFF</span>
</div>
<div style="border-top: 1px solid #2d3748; margin: 14px 0;"></div>
<div class="card-title" style="font-size:0.85rem; margin-bottom:10px;">Sleep-in Detection</div>
<div class="setting">
<div class="setting-top">
<span class="setting-name">Sleep-in Hours</span>
<span class="setting-key">ApsBoostSleepInHours</span>
</div>
<div class="setting-desc">Window after Boost start time where sleep-in is detected. If still inactive during this window, inactivity mode continues.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar"></div>
<div class="default-marker" style="left: 11%">
<div class="default-pip"></div>
<div class="default-label">2 hrs</div>
</div>
<div class="spectrum-labels"><span>0 hrs (disabled)</span><span>18 hrs</span></div>
</div>
</div>
<div class="setting">
<div class="setting-top">
<span class="setting-name">Sleep-in Step Threshold</span>
<span class="setting-key">ApsBoostSleepInSteps</span>
</div>
<div class="setting-desc">Steps/hr below which sleep-in is confirmed within the window. Higher = easier to trigger.</div>
<div class="spectrum-wrap">
<div class="spectrum-bar"></div>
<div class="default-marker" style="left: 25%">
<div class="default-pip"></div>
<div class="default-label">250/hr</div>
</div>
<div class="spectrum-labels"><span>1 steps/hr</span><span>1,000 steps/hr</span></div>
</div>
</div>
</div>
</div>
<!-- ══════════════════════════════════════════════════════════ -->
<!-- ROW 3: Toggles + Time Window -->
<!-- ══════════════════════════════════════════════════════════ -->
<div class="grid full-width">
<!-- Feature Toggles -->
<div class="card">
<div class="card-header">
<div class="card-icon icon-teal">⚙️</div>
<div>
<div class="card-title">Feature Toggles</div>
<div class="card-subtitle">Enable/disable major Boost features</div>
</div>
</div>
<div class="toggle-row" style="background:#0f1117; border:1px solid #2d3748">
<div>
<div class="toggle-name">TDD-based ISF</div>
<div class="toggle-desc">Calculates ISF from Total Daily Dose. Required for Boost's dynamic ISF to function. Mandatory for V2.</div>
</div>
<span class="badge badge-on-agg">Default: OFF</span>
</div>
<div class="toggle-row" style="background:#0f1117; border:1px solid #2d3748">
<div>
<div class="toggle-name">TDD Sensitivity Adjustment</div>
<div class="toggle-desc">Adjusts sensitivity using 24h vs 7D TDD ratio (like Autosens). Start with OFF.</div>
</div>
<span class="badge badge-neutral">Default: OFF</span>
</div>
<div class="toggle-row" style="background:#0f1117; border:1px solid #2d3748">
<div>
<div class="toggle-name">Boost Percentage Scaling</div>
<div class="toggle-desc">Scales SMBs when BG is 108–180 mg/dL with rising delta. Uses Percent Scale Factor.</div>
</div>
<span class="badge badge-on-agg">Default: OFF</span>
</div>
<div class="toggle-row" style="background:#0f1117; border:1px solid #2d3748">
<div>
<div class="toggle-name">Circadian ISF</div>
<div class="toggle-desc">Applies time-of-day multiplier to ISF based on circadian polynomial model. Low overnight, peaks afternoon.</div>
</div>
<span class="badge badge-neutral">Default: OFF</span>
</div>
<div class="toggle-row" style="background:#0f1117; border:1px solid #2d3748">
<div>
<div class="toggle-name">High TT Raises Sensitivity</div>
<div class="toggle-desc">When exercise temp target is active, increase ISF (reduce insulin delivery).</div>
</div>
<span class="badge badge-on-cons">Default: OFF</span>
</div>
<div class="toggle-row" style="background:#0f1117; border:1px solid #2d3748">
<div>
<div class="toggle-name">Low TT Lowers Sensitivity</div>
<div class="toggle-desc">When correction temp target is active, decrease ISF (increase insulin delivery).</div>
</div>
<span class="badge badge-on-agg">Default: OFF</span>
</div>
<div class="toggle-row" style="background:#0f1117; border:1px solid #2d3748">
<div>
<div class="toggle-name">Allow Boost with High Temp Target</div>
<div class="toggle-desc">By default, Boost is disabled when a high temp target is set. Enable to override this.</div>
</div>
<span class="badge badge-on-agg">Default: OFF</span>
</div>
</div>
<!-- Time Window + Safety -->