File size: 76,593 Bytes
f462b1c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Chahua Markdown Video Studio</title>
    
    <!-- Local Stylesheets (Offline-first) -->
    <script src="./vendor/tailwind.js"></script>
    <link rel="stylesheet" href="../../assets/fonts/fonts.css">
    <link rel="stylesheet" href="./css/style.css">
</head>
<body>
    <main class="min-h-screen flex flex-col lg:flex-row gap-6 p-4 lg:p-8">
        <!-- Left Panel - Video Stage -->
        <section class="flex-1 flex flex-col gap-6">
            <!-- Header -->
            <header class="flex flex-col md:flex-row md:items-center md:justify-between gap-4">
                <div>
                    <h1 class="text-3xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent">
                        Markdown Video Studio
                    </h1>
                    <p class="text-slate-400 mt-1 flex items-center gap-2">
                        Markdown-first authoring · Unified timeline engine
                        <span class="security-badge">Enterprise Security</span>
                    </p>
                </div>
                <div class="flex items-center gap-3">
                    <span id="statusPill" class="status-pill online">Ready</span>
                    <button id="securityBtn" class="btn-secondary px-3 py-2 text-sm" title="View Security Stats">
                         Security
                    </button>
                </div>
            </header>

            <!-- Video Stage -->
            <div class="stage-frame" id="stageFrame">
                <div id="stage">
                    <!-- Pause Overlay -->
                    <div id="pauseOverlay" class="pause-overlay hidden">
                        <div class="pause-indicator">
                            <div class="pause-icon"></div>
                            <div class="pause-text">PAUSED</div>
                            <div class="pause-hint">Click or press Space to resume</div>
                            <div class="pause-hint" style="margin-top: 0.5rem; opacity: 0.6;">Press ESC to stop</div>
                        </div>
                    </div>

                    <!-- Navigation Controls -->
                    <div id="navControls" class="nav-controls hidden">
                        <button id="prevSlideBtn" class="nav-btn nav-btn-prev" title="Previous Slide (←)">
                            <span class="nav-arrow"></span>
                        </button>
                        <button id="nextSlideBtn" class="nav-btn nav-btn-next" title="Next Slide (→)">
                            <span class="nav-arrow"></span>
                        </button>
                        <div id="slideCounter" class="slide-counter">1 / 1</div>
                    </div>

                    <!-- Exit Presentation Mode Button -->
                    <button id="exitPresentationBtn" class="exit-presentation-btn hidden" title="Exit Presentation Mode (ESC)">
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <line x1="18" y1="6" x2="6" y2="18"></line>
                            <line x1="6" y1="6" x2="18" y2="18"></line>
                        </svg>
                    </button>

                    <!-- Stop Preview Button -->
                    <button id="stopPreviewBtn" class="stop-preview-btn hidden" title="Stop Preview">
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <rect x="6" y="6" width="12" height="12"></rect>
                        </svg>
                    </button>

                    <!-- Stop Export Button -->
                    <button id="stopExportBtn" class="stop-export-btn hidden" title="Stop Export">
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <rect x="6" y="6" width="12" height="12"></rect>
                        </svg>
                    </button>

                    <!-- Fullscreen Button -->
                    <button id="fullscreenBtn" class="fullscreen-btn hidden" title="Toggle Fullscreen (F)">
                        <span class="fullscreen-icon"></span>
                    </button>

                    <!-- Slide Edit Button (Presentation Mode) -->
                    <button id="editSlideBtn" class="edit-slide-btn hidden" title="Edit Current Slide (E)">
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path>
                            <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path>
                        </svg>
                    </button>

                    <!-- Save Slide Edit Button (shown after editing) -->
                    <button id="saveSlideBtn" class="save-slide-btn hidden" title="Save Slide Changes (Ctrl+S)">
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"></path>
                            <polyline points="17 21 17 13 7 13 7 21"></polyline>
                            <polyline points="7 3 7 8 15 8"></polyline>
                        </svg>
                    </button>

                    <!-- Cancel Edit Button -->
                    <button id="cancelEditBtn" class="cancel-edit-btn hidden" title="Cancel Changes (ESC)">
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <line x1="18" y1="6" x2="6" y2="18"></line>
                            <line x1="6" y1="6" x2="18" y2="18"></line>
                        </svg>
                    </button>

                    <!-- Position Controls -->
                    <div id="positionControls" class="position-controls hidden">
                        <button id="toggleSafeZoneBtn" class="position-control-btn" title="แสดง/ซ่อน Safe Zone">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
                                <path d="M3 9h18M9 21V9"></path>
                            </svg>
                        </button>
                        <button id="toggleSnapGridBtn" class="position-control-btn" title="Snap to Grid">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <circle cx="12" cy="12" r="1"></circle>
                                <circle cx="12" cy="6" r="1"></circle>
                                <circle cx="12" cy="18" r="1"></circle>
                                <circle cx="6" cy="12" r="1"></circle>
                                <circle cx="18" cy="12" r="1"></circle>
                                <circle cx="6" cy="6" r="1"></circle>
                                <circle cx="6" cy="18" r="1"></circle>
                                <circle cx="18" cy="6" r="1"></circle>
                                <circle cx="18" cy="18" r="1"></circle>
                            </svg>
                        </button>
                        <button id="resetPositionsBtn" class="position-control-btn" title="รีเซ็ตตำแหน่งทั้งหมด">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <polyline points="1 4 1 10 7 10"></polyline>
                                <polyline points="23 20 23 14 17 14"></polyline>
                                <path d="M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"></path>
                            </svg>
                        </button>
                        <button id="exportSettingsBtn" class="position-control-btn" title="ส่งออกการตั้งค่า">
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
                                <polyline points="7 10 12 15 17 10"></polyline>
                                <line x1="12" y1="15" x2="12" y2="3"></line>
                            </svg>
                        </button>
                    </div>

                    <!-- Position Indicator -->
                    <div id="positionIndicator" class="position-indicator">
                        X: <span id="posX">0</span> | Y: <span id="posY">0</span>
                    </div>
                    
                    <div class="gradient-backdrop"></div>

                    <div id="slideContainer" class="flex flex-col gap-12">
                        <div class="scene active" data-scene="intro">
                            <span class="badge">intro</span>
                            <h2 data-bind="intro.title" class="text-4xl md:text-6xl font-bold mt-4 text-center max-w-3xl">
                                Markdown Video Studio
                            </h2>
                            <p data-bind="intro.subtitle" class="text-lg md:text-2xl text-slate-300 mt-6 text-center max-w-2xl">
                                Define every slide, timing, and asset straight from your markdown deck.
                            </p>
                            <div class="mt-10 flex flex-wrap items-center justify-center gap-3 text-xs uppercase tracking-wider text-slate-400">
                                <span> Markdown-driven timeline</span>
                                <span> Unified preview & export</span>
                                <span> Extensible components</span>
                            </div>
                        </div>

                        <div class="scene" data-scene="body">
                            <span class="badge">timeline</span>
                            <div class="w-full max-w-4xl mx-auto bg-slate-900/60 rounded-2xl border border-slate-800/70 p-6">
                                <h3 class="text-2xl font-semibold text-slate-300 mb-4">Live Timeline</h3>
                                <ul id="timelinePreview" class="space-y-3 text-slate-200 text-sm">
                                    <li class="flex items-start justify-between gap-3">
                                        <span class="font-semibold">Slide 1 · Intro</span>
                                        <span class="opacity-70">00:00 → 00:05</span>
                                    </li>
                                    <li class="flex items-start justify-between gap-3">
                                        <span class="font-semibold">Slide 2 · Agenda</span>
                                        <span class="opacity-70">00:05 → 00:15</span>
                                    </li>
                                    <li class="flex items-start justify-between gap-3">
                                        <span class="font-semibold">Slide 3 · Demo</span>
                                        <span class="opacity-70">00:15 → 00:35</span>
                                    </li>
                                </ul>
                                <p class="text-xs text-slate-500 mt-4">
                                    Timeline updates whenever the markdown deck changes.
                                </p>
                            </div>
                        </div>

                        <div class="scene" data-scene="outro">
                            <div class="flex flex-col items-center text-center gap-6 max-w-3xl mx-auto">
                                <span class="badge">outro</span>
                                <h3 data-bind="outro.title" class="text-4xl md:text-5xl font-bold">
                                    Render from Markdown
                                </h3>
                                <p data-bind="outro.tagline" class="text-slate-300 text-lg md:text-xl">
                                    Export consistent videos without ever leaving your markdown workflow.
                                </p>
                                <div class="flex gap-4 mt-4">
                                    <span class="px-6 py-3 rounded-full bg-gradient-to-r from-blue-500 to-purple-600 text-white font-semibold">
                                        Powered by Timeline Engine
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Controls -->
            <div class="flex flex-wrap items-center gap-3">
                <button id="syncMarkdownBtn" class="btn-secondary">
                     Sync Markdown
                </button>
                <button id="presentationModeBtn" class="btn-primary">
                     Presentation Mode
                </button>
                <button id="previewBtn" class="btn-primary">
                     Preview Timeline
                </button>
                <button id="recordWebMBtn" class="btn-primary">
                     Export Video
                </button>
                <button id="resetBtn" class="btn-secondary" title="Reset to initial state">
                     Reset
                </button>
            </div>

            <!-- Progress Bar -->
            <div id="progressContainer" class="hidden">
                <div class="progress-bar">
                    <div id="progressBar" class="progress-bar-fill" style="width: 0%"></div>
                </div>
                <p id="progressText" class="text-sm text-slate-400 mt-2">Processing...</p>
            </div>

            <!-- Status Log -->
            <div id="statusLog" class="text-sm text-slate-400 bg-slate-900/60 border border-slate-800/60 rounded-xl px-4 py-3">
                <strong>Ready:</strong> Configure your video and click render to start.
            </div>
        </section>

        <!-- Right Panel - Configuration -->
        <aside class="config-panel w-full lg:w-96 xl:w-[32rem] rounded-2xl p-6 space-y-6 overflow-y-auto max-h-[92vh]">
            <!-- Tabs -->
            <div class="flex border-b border-slate-700">
                <button class="tab-button" data-tab="markdown">Markdown</button>
                <button class="tab-button" data-tab="timeline">Timeline</button>
                <button class="tab-button" data-tab="export">Export</button>
                <button class="tab-button" data-tab="presentation">Settings</button>
            </div>

            <!-- Tab: Markdown -->
            <div class="tab-content active" data-tab-content="markdown">
                <section class="space-y-4">
                    <header>
                        <h3 class="text-base font-semibold text-white">Markdown Deck</h3>
                        <p class="text-xs text-slate-400 mt-1">Author your timeline, scenes, and narration directly in markdown.</p>
                    </header>
                    <div class="flex flex-wrap gap-2">
                        <button id="loadMarkdownSample" class="btn-tertiary text-xs px-3 py-2">Load Sample Deck</button>
                        <button id="importMarkdownBtn" class="btn-tertiary text-xs px-3 py-2">Import Markdown</button>
                        <button id="openWorkspaceBtn" class="btn-tertiary text-xs px-3 py-2">Open Workspace Folder</button>
                    </div>
                    <label class="block">
                        <span class="text-sm text-slate-300 mb-2 block">Markdown Source</span>
                        <div id="markdownDropZone" class="markdown-drop-zone">
                            <textarea id="markdownEditor" rows="18" class="w-full font-mono text-sm" placeholder="---\ntitle: Launch Update\nslides:\n  - id: intro\n    duration: 5s\n    transition: fade\n    content: |\n      # Chahua Markdown Video Studio\n      Elevate your markdown into motion\n---"></textarea>
                            <div class="drop-overlay hidden">
                                <div class="drop-content">
                                    <div class="drop-icon"></div>
                                    <div class="drop-text">Drop Markdown file here</div>
                                    <div class="drop-hint">Supports .md, .markdown, .txt</div>
                                </div>
                            </div>
                        </div>
                    </label>
                    <div id="markdownDiagnostics" class="hidden text-xs bg-slate-800/40 border border-slate-600/40 text-slate-300 rounded-lg p-3"></div>
                    <div id="markdownSummary" class="text-xs text-slate-400 bg-slate-800/60 border border-slate-700/60 rounded-lg p-3">
                        Awaiting markdown sync.
                    </div>
                </section>
            </div>

            <!-- Tab: Timeline -->
            <div class="tab-content" data-tab-content="timeline">
                <section class="space-y-4">
                    <header>
                        <h3 class="text-base font-semibold text-white">Timeline Overview</h3>
                        <p class="text-xs text-slate-400 mt-1">Review parsed scenes, tracks, and media assets.</p>
                    </header>
                    <div class="bg-slate-900/60 border border-slate-800/60 rounded-xl p-4 space-y-3">
                        <div class="flex items-center justify-between text-xs text-slate-400">
                            <span>Total Duration</span>
                            <span id="timelineTotal">00:00</span>
                        </div>
                        <div class="divide-y divide-slate-800" id="timelineSceneList">
                            <div class="py-3 flex flex-col gap-1">
                                <div class="flex items-center justify-between text-sm text-slate-200">
                                    <span>Slide 1 · Intro</span>
                                    <span>5s</span>
                                </div>
                                <p class="text-xs text-slate-500">transition: fade · narration: none</p>
                            </div>
                            <div class="py-3 flex flex-col gap-1">
                                <div class="flex items-center justify-between text-sm text-slate-200">
                                    <span>Slide 2 · Agenda</span>
                                    <span>10s</span>
                                </div>
                                <p class="text-xs text-slate-500">transition: slide-left · narration: intro.mp3</p>
                            </div>
                        </div>
                    </div>
                    <section class="space-y-3">
                        <h4 class="text-sm font-semibold text-white">Asset Checklist</h4>
                        <ul id="assetChecklist" class="space-y-2 text-xs text-slate-400 bg-slate-900/60 border border-slate-800/60 rounded-xl p-3">
                            <li class="flex items-center justify-between">
                                <span>intro-bg.png</span>
                                <span class="status-pill pending">pending</span>
                            </li>
                            <li class="flex items-center justify-between">
                                <span>voiceover/intro.mp3</span>
                                <span class="status-pill online">available</span>
                            </li>
                        </ul>
                    </section>
                </section>
            </div>

            <!-- Tab: Export -->
            <div class="tab-content" data-tab-content="export">
                <section class="space-y-4">
                    <header>
                        <h3 class="text-base font-semibold text-white">Export Settings</h3>
                        <p class="text-xs text-slate-400 mt-1">Applied to both preview renderer and headless export jobs.</p>
                    </header>
                    <label class="block">
                        <span class="text-sm text-slate-300 mb-2 block">Resolution</span>
                        <select data-config="video.resolution" class="w-full">
                            <option value="1920x1080">1920x1080 (Full HD)</option>
                            <option value="1280x720">1280x720 (HD)</option>
                            <option value="3840x2160">3840x2160 (4K)</option>
                        </select>
                    </label>
                    <label class="block">
                        <span class="text-sm text-slate-300 mb-2 block">Frame Rate (FPS)</span>
                        <select data-config="video.fps" class="w-full">
                            <option value="30">30 FPS</option>
                            <option value="60" selected>60 FPS</option>
                            <option value="120">120 FPS</option>
                        </select>
                    </label>
                    <label class="block">
                        <span class="text-sm text-slate-300 mb-2 block">Quality</span>
                        <input type="range" min="0.1" max="1" step="0.05" data-config="video.quality" value="0.95" class="w-full">
                        <span id="qualityValue" class="text-xs text-slate-400">95%</span>
                    </label>
                    <label class="block">
                        <span class="text-sm text-slate-300 mb-2 block">Accent Color</span>
                        <input type="color" data-config="theme.accent" value="#60a5fa" class="w-full h-12">
                    </label>
                    <div class="border-t border-slate-700 pt-4 space-y-3 text-xs text-slate-400">
                        <div class="flex items-center justify-between">
                            <span>Estimated Render Time</span>
                            <span id="renderEta"></span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span>Headless Renderer</span>
                            <span id="rendererBackend">Pending selection</span>
                        </div>
                    </div>
                </section>
            </div>

            <!-- Tab: Presentation Settings -->
            <div class="tab-content" data-tab-content="presentation">
                <section class="space-y-4">
                    <header>
                        <h3 class="text-base font-semibold text-white">Presentation Settings</h3>
                        <p class="text-xs text-slate-400 mt-1">Configure fonts, colors, and animations. Settings are automatically saved to localStorage.</p>
                    </header>

                    <!-- Settings Legend -->
                    <div class="bg-slate-800/30 border border-slate-700/40 rounded-lg p-3 space-y-2">
                        <h4 class="text-xs font-semibold text-slate-200 flex items-center gap-2">
                            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
                            </svg>
                            Settings Legend
                        </h4>
                        <div class="grid grid-cols-2 gap-2 text-xs">
                            <div class="flex items-center gap-2">
                                <div class="w-3 h-3 bg-slate-500/50 rounded-sm"></div>
                                <span class="text-slate-300">Slide Content</span>
                            </div>
                            <div class="flex items-center gap-2">
                                <div class="w-3 h-3 bg-slate-600/50 rounded-sm"></div>
                                <span class="text-slate-300">UI Elements</span>
                            </div>
                        </div>
                        <p class="text-xs text-slate-400 pt-1">
                            <span class="font-semibold text-slate-300">Content</span> settings affect slide content (text, headings, lists).
                            <span class="font-semibold text-slate-300">UI</span> settings affect UI (navigation, overlays).
                        </p>
                    </div>

                    <!-- Preset Selector -->
                    <div class="space-y-2 pb-2">
                        <label class="block text-sm font-medium text-slate-300">Preset</label>
                        <select id="presetSelector" class="w-full px-3 py-2 bg-slate-900/60 border border-slate-700/60 rounded-lg text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            <option value="default">Default</option>
                            <option value="professional">Professional</option>
                            <option value="minimal">Minimal</option>
                            <option value="creative">Creative</option>
                        </select>
                        <p class="text-xs text-slate-500">Load a preset to quickly configure all settings below.</p>
                    </div>

                    <!-- Configuration Management -->
                    <div class="space-y-2 pb-3 border-b border-slate-800/60">
                        <label class="block text-sm font-medium text-slate-300">Configuration</label>
                        <div class="grid grid-cols-3 gap-2">
                            <button id="exportConfigBtn" class="px-3 py-2 bg-slate-800/40 hover:bg-slate-700/50 border border-slate-600/40 rounded-lg text-slate-300 text-xs font-medium transition-colors flex items-center justify-center gap-2">
                                <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"/>
                                </svg>
                                Export
                            </button>
                            <button id="importConfigBtn" class="px-3 py-2 bg-slate-800/40 hover:bg-slate-700/50 border border-slate-600/40 rounded-lg text-slate-300 text-xs font-medium transition-colors flex items-center justify-center gap-2">
                                <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"/>
                                </svg>
                                Import
                            </button>
                            <button id="resetConfigBtn" class="px-3 py-2 bg-slate-800/40 hover:bg-slate-700/50 border border-slate-600/40 rounded-lg text-slate-300 text-xs font-medium transition-colors flex items-center justify-center gap-2">
                                <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
                                </svg>
                                Reset
                            </button>
                        </div>
                        <p class="text-xs text-slate-500">
                            Your settings are automatically saved to localStorage. Export creates a JSON backup file.
                        </p>
                    </div>

                    <!-- Font Settings (Collapsible) -->
                    <details class="settings-section border-t border-slate-800/60 pt-3" open>
                        <summary class="text-sm font-semibold text-slate-300 cursor-pointer hover:text-slate-200 flex items-center gap-2 pb-3">
                            <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
                                <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
                            </svg>
                            <span>Fonts</span>
                        </summary>
                        <div class="space-y-3 pl-5">
                        <p class="text-xs text-slate-500 bg-slate-800/30 border border-slate-700/40 rounded p-2">
                            <span class="font-semibold text-slate-300">Applies to:</span> All headings (H1-H6), body text, and code blocks in slides
                        </p>
                        
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Heading Font <span class="text-slate-600">(H1, H2, H3)</span></label>
                            <select id="fontHeading" class="w-full px-3 py-2 bg-slate-900/60 border border-slate-700/60 rounded-lg text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                <!-- Options populated by JS -->
                            </select>
                        </div>

                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Body Font <span class="text-slate-600">(Paragraphs, Lists)</span></label>
                            <select id="fontBody" class="w-full px-3 py-2 bg-slate-900/60 border border-slate-700/60 rounded-lg text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                <!-- Options populated by JS -->
                            </select>
                        </div>

                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Code Font <span class="text-slate-600">(Code Blocks)</span></label>
                                <select id="fontCode" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                <!-- Options populated by JS -->
                            </select>
                        </div>
                        </div>
                    </details>

                    <!-- Color Settings (Collapsible) -->
                    <details class="settings-section border-t border-slate-800/60 pt-3">
                        <summary class="text-sm font-semibold text-slate-300 cursor-pointer hover:text-slate-200 flex items-center gap-2 pb-3">
                            <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
                                <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
                            </svg>
                            <span>Colors</span>
                        </summary>
                        <div class="space-y-3 pl-5">
                        <p class="text-xs text-slate-500 bg-slate-800/30 border border-slate-700/40 rounded p-2">
                            <span class="font-semibold text-slate-300">Applies to:</span> Headings, links, accents, background, and all text colors in slides
                        </p>
                        
                        <div class="grid grid-cols-2 gap-3">
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Primary <span class="text-slate-600">(H1, Links)</span></label>
                                <input type="color" id="colorPrimary" class="w-full h-10 bg-slate-900/60 border border-slate-700/60 rounded-lg cursor-pointer">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Accent <span class="text-slate-600">(Highlights)</span></label>
                                <input type="color" id="colorAccent" class="w-full h-10 bg-slate-900/60 border border-slate-700/60 rounded-lg cursor-pointer">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Background <span class="text-slate-600">(Slide BG)</span></label>
                                <input type="color" id="colorBackground" class="w-full h-10 bg-slate-900/60 border border-slate-700/60 rounded-lg cursor-pointer">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Text <span class="text-slate-600">(Body Text)</span></label>
                                <input type="color" id="colorText" class="w-full h-10 bg-slate-900/60 border border-slate-700/60 rounded-lg cursor-pointer">
                            </div>
                        </div>
                        </div>
                    </details>

                    <!-- Animations (Collapsible) -->
                    <details class="settings-section border-t border-slate-800/60 pt-3">
                        <summary class="text-sm font-semibold text-slate-300 cursor-pointer hover:text-slate-200 flex items-center gap-2 pb-3">
                            <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
                                <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
                            </svg>
                            <span>Animations <span class="text-xs font-normal text-slate-500">(Slide Content)</span></span>
                        </summary>
                        <div class="space-y-3 pl-5">
                        <p class="text-xs text-slate-500 bg-slate-800/30 border border-slate-700/40 rounded p-2">
                            <span class="font-semibold text-slate-300">Applies to:</span> Slide transitions and animation timing
                        </p>
                        
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Slide Transition</label>
                            <select id="animationTransition" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                <option value="fade">Fade</option>
                                <option value="slide">Slide</option>
                                <option value="none">None</option>
                            </select>
                        </div>

                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Duration (seconds)</label>
                            <input type="number" id="animationDuration" min="0.1" max="2" step="0.1" value="0.6" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                        </div>
                        </div>
                    </details>

                    <!-- UI & Visual Effects (Collapsible) -->
                    <details class="settings-section border-t border-slate-800/60 pt-3">
                        <summary class="text-sm font-semibold text-slate-300 cursor-pointer hover:text-slate-200 flex items-center gap-2 pb-3">
                            <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
                                <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
                            </svg>
                            <span>UI & Visual Effects</span>
                        </summary>
                        <div class="space-y-3 pl-5">
                        <p class="text-xs text-slate-500 bg-slate-800/30 border border-slate-700/40 rounded p-2">
                            <span class="font-semibold text-slate-300">Applies to:</span> UI elements (navigation, overlays, backdrops) - NOT slide content
                        </p>
                        <h4 class="text-sm font-semibold text-slate-300">UI & Visual Effects</h4>
                        <p class="text-xs text-slate-500">Control overlay, navigation, and backdrop effects</p>
                        
                        <!-- Preview Opacity -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Preview Slide Opacity</label>
                            <input type="number" id="previewOpacity" min="0" max="1" step="0.05" value="0.68" class="w-full px-3 py-2 bg-slate-900/60 border border-slate-700/60 rounded-lg text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            <p class="text-xs text-slate-500">Opacity of next slide preview (0-1)</p>
                        </div>

                        <!-- Overlay Settings -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Pause Overlay</label>
                            <div class="grid grid-cols-2 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Blur (px)</label>
                                    <input type="number" id="overlayBlur" min="0" max="20" step="1" value="8" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Border Width (px)</label>
                                    <input type="number" id="navBorderWidth" min="1" max="5" step="1" value="2" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                            </div>
                        </div>

                        <!-- Backdrop Effects -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Gradient Backdrop Effect</label>
                            <div class="grid grid-cols-2 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Spread (%)</label>
                                    <input type="number" id="backdropSpread" min="50" max="100" step="5" value="70" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Blur (px)</label>
                                    <input type="number" id="backdropBlur" min="0" max="100" step="10" value="60" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                            </div>
                        </div>
                        </div>
                    </details>

                    <!-- Border & Accent Widths (Collapsible) -->
                    <details class="settings-section border-t border-slate-800/60 pt-3">
                        <summary class="text-sm font-semibold text-slate-300 cursor-pointer hover:text-slate-200 flex items-center gap-2 pb-3">
                            <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
                                <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
                            </svg>
                            <span>Border & Accent Widths</span>
                        </summary>
                        <div class="space-y-3 pl-5">
                        <p class="text-xs text-slate-500 bg-slate-800/30 border border-slate-700/40 rounded p-2">
                            <span class="font-semibold text-slate-300">Applies to:</span> Border thickness of headings, blockquotes, images, tables, and links in slides
                        </p>
                        
                        <div class="grid grid-cols-2 gap-3">
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Heading Border</label>
                                <input type="number" id="headingBorderWidth" min="1" max="8" step="1" value="4" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Blockquote Border</label>
                                <input type="number" id="blockquoteBorderWidth" min="1" max="8" step="1" value="4" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Image Border</label>
                                <input type="number" id="imageBorderWidth" min="0" max="6" step="1" value="2" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Link Underline</label>
                                <input type="number" id="linkUnderlineWidth" min="1" max="5" step="1" value="2" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Table Border</label>
                                <input type="number" id="tableBorderWidth" min="1" max="4" step="1" value="1" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">HR Border</label>
                                <input type="number" id="hrBorderWidth" min="1" max="5" step="1" value="2" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                        </div>
                        </div>
                    </details>

                    <!-- Font Sizes (Collapsible) -->
                    <details class="settings-section border-t border-slate-800/60 pt-3">
                        <summary class="text-sm font-semibold text-slate-300 cursor-pointer hover:text-slate-200 flex items-center gap-2 pb-3">
                            <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
                                <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
                            </svg>
                            <span>Font Sizes</span>
                        </summary>
                        <div class="space-y-3 pl-5">
                        <p class="text-xs text-slate-500 bg-slate-800/30 border border-slate-700/40 rounded p-2">
                            <span class="font-semibold text-slate-300">Applies to:</span> All heading and text sizes in slide content
                        </p>
                        <p class="text-xs text-slate-500">Adjust responsive font sizes using clamp(min, base vw, max)</p>
                        
                        <!-- H1 Size -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">H1 Heading (rem)</label>
                            <div class="grid grid-cols-3 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Min</label>
                                    <input type="number" id="fontSizeH1Min" min="1" max="5" step="0.25" value="1.75" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Base vw</label>
                                    <input type="number" id="fontSizeH1Base" min="1" max="10" step="0.5" value="4.5" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Max</label>
                                    <input type="number" id="fontSizeH1Max" min="1" max="8" step="0.25" value="3" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                            </div>
                        </div>

                        <!-- H2 Size -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">H2 Heading (rem)</label>
                            <div class="grid grid-cols-3 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Min</label>
                                    <input type="number" id="fontSizeH2Min" min="1" max="4" step="0.25" value="1.5" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Base vw</label>
                                    <input type="number" id="fontSizeH2Base" min="1" max="8" step="0.5" value="3.5" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Max</label>
                                    <input type="number" id="fontSizeH2Max" min="1" max="6" step="0.25" value="2.5" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                            </div>
                        </div>

                        <!-- Body Text Size -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Body Text (rem)</label>
                            <div class="grid grid-cols-3 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Min</label>
                                    <input type="number" id="fontSizeTextMin" min="0.8" max="3" step="0.1" value="1.1" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Base vw</label>
                                    <input type="number" id="fontSizeTextBase" min="1" max="5" step="0.2" value="1.8" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Max</label>
                                    <input type="number" id="fontSizeTextMax" min="0.8" max="4" step="0.1" value="1.6" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                            </div>
                        </div>

                        <!-- Line Height -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Line Height</label>
                            <div class="grid grid-cols-2 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Heading</label>
                                    <input type="number" id="lineHeightHeading" min="1" max="2.5" step="0.05" value="1.3" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Body</label>
                                    <input type="number" id="lineHeightBody" min="1" max="3" step="0.05" value="1.7" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                            </div>
                        </div>
                        </div>
                    </details>

                    <!-- Typography & Layout (Collapsible) -->
                    <details class="settings-section border-t border-slate-800/60 pt-3">
                        <summary class="text-sm font-semibold text-slate-300 cursor-pointer hover:text-slate-200 flex items-center gap-2 pb-3">
                            <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
                                <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
                            </svg>
                            <span>Typography & Layout</span>
                        </summary>
                        <div class="space-y-3 pl-5">
                        <p class="text-xs text-slate-500 bg-slate-800/30 border border-slate-700/40 rounded p-2">
                            <span class="font-semibold text-slate-300">Applies to:</span> Spacing, indentation, and alignment of slide content
                        </p>
                        <h4 class="text-sm font-semibold text-slate-300">Typography & Layout</h4>
                        <p class="text-xs text-slate-500">Control paragraph spacing, indentation, and text alignment</p>
                        
                        <!-- Paragraph Spacing -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Paragraph Spacing</label>
                            <div class="grid grid-cols-2 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Before (rem)</label>
                                    <input type="number" id="paragraphBefore" min="0" max="3" step="0.25" value="0.5" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">After (rem)</label>
                                    <input type="number" id="paragraphAfter" min="0" max="3" step="0.25" value="1" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                            </div>
                        </div>

                        <!-- Heading Spacing -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Heading Spacing</label>
                            <div class="grid grid-cols-2 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Before (rem)</label>
                                    <input type="number" id="headingBefore" min="0" max="4" step="0.25" value="1.5" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">After (rem)</label>
                                    <input type="number" id="headingAfter" min="0" max="3" step="0.25" value="0.75" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                            </div>
                        </div>

                        <!-- Indentation -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Indentation (rem)</label>
                            <div class="grid grid-cols-2 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">First Line</label>
                                    <input type="number" id="indentFirst" min="0" max="3" step="0.25" value="0" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Blockquote</label>
                                    <input type="number" id="indentBlockquote" min="0" max="4" step="0.25" value="1.5" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                            </div>
                        </div>

                        <!-- List Indent & Text Align -->
                        <div class="grid grid-cols-2 gap-3">
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">List Indent (rem)</label>
                                <input type="number" id="listIndent" min="0" max="4" step="0.25" value="1.5" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Text Align</label>
                                <select id="textAlign" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                    <option value="left">Left</option>
                                    <option value="center">Center</option>
                                    <option value="right">Right</option>
                                    <option value="justify">Justify</option>
                                </select>
                            </div>
                        </div>
                        </div>
                    </details>

                    <!-- Page Indicator Settings (Collapsible) -->
                    <details class="settings-section border-t border-slate-800/60 pt-3">
                        <summary class="text-sm font-semibold text-slate-300 cursor-pointer hover:text-slate-200 flex items-center gap-2 pb-3">
                            <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
                                <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
                            </svg>
                            <span>Page Indicator</span>
                        </summary>
                        <div class="space-y-3 pl-5">
                        <p class="text-xs text-slate-500 bg-slate-800/30 border border-slate-700/40 rounded p-2">
                            <span class="font-semibold text-slate-300">Applies to:</span> Page numbers display (e.g., "1 / 3") - UI element only
                        </p>
                        
                        <div class="grid grid-cols-2 gap-3">
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Position Top (px)</label>
                                <input type="number" id="pageIndicatorTop" min="0" max="100" step="4" value="16" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Position Right (px)</label>
                                <input type="number" id="pageIndicatorRight" min="0" max="100" step="4" value="16" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Font Size (rem)</label>
                                <input type="number" id="pageIndicatorFontSize" min="0.5" max="2" step="0.125" value="0.875" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Opacity (0-1)</label>
                                <input type="number" id="pageIndicatorOpacity" min="0" max="1" step="0.05" value="0.7" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Padding X (px)</label>
                                <input type="number" id="pageIndicatorPaddingX" min="0" max="40" step="2" value="12" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">Padding Y (px)</label>
                                <input type="number" id="pageIndicatorPaddingY" min="0" max="20" step="2" value="4" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2 col-span-2">
                                <label class="block text-xs font-medium text-slate-400">Background Color (rgba)</label>
                                <input type="text" id="pageIndicatorBgColor" value="rgba(22, 78, 99, 0.5)" placeholder="rgba(22, 78, 99, 0.5)" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                            </div>
                            <div class="space-y-2 col-span-2">
                                <label class="block text-xs font-medium text-slate-400">Text Color (hex)</label>
                                <input type="color" id="pageIndicatorTextColor" value="#a5f3fc" class="w-full h-10 bg-slate-900/60 border border-slate-700/60 rounded cursor-pointer">
                            </div>
                        </div>
                        </div>
                    </details>

                    <!-- Smart List Column Settings (Collapsible) -->
                    <details class="settings-section border-t border-slate-800/60 pt-3">
                        <summary class="text-sm font-semibold text-slate-300 cursor-pointer hover:text-slate-200 flex items-center gap-2 pb-3">
                            <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
                                <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
                            </svg>
                            <span>Smart List Columns</span>
                        </summary>
                        <div class="space-y-3 pl-5">
                        <p class="text-xs text-slate-500 bg-slate-800/30 border border-slate-700/40 rounded p-2">
                            <span class="font-semibold text-slate-300">Applies to:</span> Lists in slide content - automatic column layout on large screens
                        </p>
                        
                        <div class="space-y-3">
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">2-Column Threshold (items)</label>
                                <input type="number" id="smartListTwoColumn" min="3" max="20" step="1" value="6" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                <p class="text-xs text-slate-500 mt-1">Lists with this many items or more will display in 2 columns</p>
                            </div>
                            <div class="space-y-2">
                                <label class="block text-xs font-medium text-slate-400">3-Column Threshold (items)</label>
                                <input type="number" id="smartListThreeColumn" min="6" max="30" step="1" value="12" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                <p class="text-xs text-slate-500 mt-1">Lists with this many items or more will display in 3 columns</p>
                            </div>
                        </div>
                        
                        <div class="text-xs text-slate-400 bg-slate-800/30 border border-slate-700/40 rounded-lg p-2.5 mt-3">
                            <span class="font-semibold text-slate-300">Note:</span> Column layout only applies on large screens and in presentation mode.
                        </div>
                        </div>
                    </details>

                    <!-- Content Layout & Positioning (Collapsible) -->
                    <details class="settings-section border-t border-slate-800/60 pt-3">
                        <summary class="text-sm font-semibold text-slate-300 cursor-pointer hover:text-slate-200 flex items-center gap-2 pb-3">
                            <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
                                <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
                            </svg>
                            <span>Content Layout & Positioning</span>
                        </summary>
                        <div class="space-y-3 pl-5">
                        <p class="text-xs text-slate-500 bg-slate-800/30 border border-slate-700/40 rounded p-2">
                            <span class="font-semibold text-slate-300">Applies to:</span> Slide content padding and alignment on different screen sizes
                        </p>
                        
                        <!-- Content Padding -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Content Padding (px)</label>
                            <div class="grid grid-cols-3 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Small</label>
                                    <input type="number" id="contentPaddingSmall" min="0" max="100" step="4" value="40" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Large</label>
                                    <input type="number" id="contentPaddingLarge" min="0" max="120" step="4" value="48" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Ultra</label>
                                    <input type="number" id="contentPaddingUltra" min="0" max="150" step="4" value="64" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                </div>
                            </div>
                            <p class="text-xs text-slate-500 mt-1">Padding around slide content for different screen sizes</p>
                        </div>

                        <!-- Content Alignment -->
                        <div class="space-y-2">
                            <label class="block text-xs font-medium text-slate-400">Content Alignment</label>
                            <div class="grid grid-cols-2 gap-2">
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Horizontal</label>
                                    <select id="contentAlignHorizontal" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                        <option value="flex-start">Left (Start)</option>
                                        <option value="center" selected>Center</option>
                                        <option value="flex-end">Right (End)</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="block text-xs text-slate-500 mb-1">Vertical</label>
                                    <select id="contentAlignVertical" class="w-full px-2 py-1.5 bg-slate-900/60 border border-slate-700/60 rounded text-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-slate-500/50">
                                        <option value="flex-start">Top (Start)</option>
                                        <option value="center" selected>Center</option>
                                        <option value="flex-end">Bottom (End)</option>
                                    </select>
                                </div>
                            </div>
                            <p class="text-xs text-slate-500 mt-1">How content is aligned on large screens and in presentation mode</p>
                        </div>
                        
                        <div class="text-xs text-slate-400 bg-slate-800/30 border border-slate-700/40 rounded-lg p-2.5 mt-3">
                            <span class="font-semibold text-slate-300">Tip:</span> Use center/center for traditional presentations, or flex-start/flex-start for document-style layouts.
                        </div>
                        </div>
                    </details>

                    <!-- Action Buttons -->
                    <div class="flex gap-3 border-t border-slate-800/60 pt-4 mt-4">
                        <button id="saveSettingsBtn" class="flex-1 px-4 py-2.5 bg-slate-700 hover:bg-slate-600 text-white font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-slate-500/50 flex items-center justify-center gap-2">
                            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"/>
                            </svg>
                            Save Settings
                        </button>
                        <button id="resetSettingsBtn" class="flex-1 px-4 py-2.5 bg-slate-800/50 hover:bg-slate-700/60 border border-slate-600/40 text-slate-300 font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-slate-500/50 flex items-center justify-center gap-2">
                            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
                            </svg>
                            Reset to Default
                        </button>
                    </div>

                    <!-- Status -->
                    <div class="text-xs text-slate-400 bg-slate-800/30 border border-slate-700/40 rounded-lg p-3">
                        <span class="font-semibold text-slate-300">Live Preview:</span> All changes apply <strong class="text-slate-200">instantly</strong> as you adjust settings!
                        <br>
                        <span class="text-slate-500 mt-1 block">Tip: Hover over any setting to see highlighted elements on stage.</span>
                        <br>
                        <span class="text-slate-500 mt-1 block"> Click "Save to Frontmatter" to persist settings to your markdown file.</span>
                    </div>

                    <!-- Legacy Template Support -->
                    <details class="border-t border-slate-800/60 pt-4">
                        <summary class="text-xs font-medium text-slate-400 cursor-pointer hover:text-slate-300">Legacy Template Support</summary>
                        <div class="mt-3 space-y-2">
                            <p class="text-xs text-slate-500">For backward compatibility with older decks using <code class="text-slate-400">template:</code> field.</p>
                            <div id="templatesContainer" class="grid grid-cols-2 gap-2 mt-2"></div>
                        </div>
                    </details>
                </section>
            </div>
        </aside>
    </main>

    <!-- External Scripts -->
    <script type="module" src="./js/app.js"></script>
</body>
</html>