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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
# -*- coding: utf-8 -*-
"""
theme β€” presentation constants for the Streamlit UI (no logic).

THEME_CSS            : the full Warm Peach page theme (fonts + <style> +
                       the pure-CSS .mobile-block overlay markup).
AI_CREATE_ANIM_HTML  : the "AI is composing" animation card shown while
                       generation blocks on the AI Builder call.
Inject with st.markdown(..., unsafe_allow_html=True).
"""

# AI "creating" animation shown while the document is being written (pure CSS, runs in the
# browser while Python blocks on the AI Builder call + docx render). Ember theme.
AI_CREATE_ANIM_HTML = """
<div class="ai-create-wrap">
  <div class="ai-create-card">
    <div class="ai-orb"><span class="ai-spark">&#10024;</span></div>
    <div class="ai-lines">
      <div class="ai-line"></div>
      <div class="ai-line"></div>
      <div class="ai-line short"></div>
    </div>
    <div class="ai-label">AI&nbsp;กำΰΈ₯ΰΈ±ΰΈ‡ΰΉ€ΰΈ£ΰΈ΅ΰΈ’ΰΈšΰΉ€ΰΈ£ΰΈ΅ΰΈ’ΰΈ‡ΰΉ€ΰΈ­ΰΈΰΈͺΰΈ²ΰΈ£<span class="ai-dots"></span></div>
  </div>
</div>
<style>
  .ai-create-wrap{display:flex;justify-content:center;padding:6px 0 14px;}
  .ai-create-card{width:100%;max-width:430px;padding:22px 24px;
    background:#FFFFFF;
    border:1px solid rgba(242,106,58,.22);border-radius:16px;
    box-shadow:0 18px 40px rgba(214,120,60,.18),0 0 34px rgba(242,106,58,.10);
    display:flex;flex-direction:column;align-items:center;gap:16px;}
  .ai-orb{width:60px;height:60px;border-radius:50%;display:flex;align-items:center;justify-content:center;
    background:radial-gradient(circle at 50% 38%,#FF8A52,#E85D27 60%,#B5471F);
    animation:ai-pulse 1.6s ease-out infinite;}
  .ai-spark{font-size:26px;line-height:1;animation:ai-spin 2.6s linear infinite;
    filter:drop-shadow(0 0 6px rgba(255,180,120,.85));}
  @keyframes ai-pulse{0%{box-shadow:0 0 0 0 rgba(242,106,58,.55);}70%{box-shadow:0 0 0 16px rgba(242,106,58,0);}100%{box-shadow:0 0 0 0 rgba(242,106,58,0);}}
  @keyframes ai-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
  .ai-lines{width:100%;display:flex;flex-direction:column;gap:10px;}
  .ai-line{height:10px;border-radius:6px;
    background:linear-gradient(90deg,rgba(214,128,72,.14) 0%,rgba(245,160,110,.45) 40%,rgba(242,106,58,.85) 50%,rgba(245,160,110,.45) 60%,rgba(214,128,72,.14) 100%);
    background-size:220% 100%;animation:ai-shimmer 1.5s linear infinite;}
  .ai-line:nth-child(2){animation-delay:.25s;}
  .ai-line.short{width:62%;animation-delay:.5s;}
  @keyframes ai-shimmer{0%{background-position:120% 0}100%{background-position:-120% 0}}
  .ai-label{color:#1E3A8A;font-size:14px;font-weight:600;letter-spacing:.2px;}
  .ai-dots::after{content:'';animation:ai-dots 1.4s steps(4,end) infinite;}
  @keyframes ai-dots{0%{content:''}25%{content:'.'}50%{content:'..'}75%{content:'...'}100%{content:''}}
</style>
"""

# Warm Peach CSS Theme (light cream canvas + burnt-orange accents)
THEME_CSS = """
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Sarabun:wght@400;500;600;700&display=swap" rel="stylesheet">

<style>
    /* ─── COLORS ─────────────────────────────────────────────────────
       Page bg       : #FFF4EC β†’ #FCE7D6 (warm peach, coral glow)
       Card surface  : #FFFFFF (white panel)
       Field bg      : #FFFFFF (white input)
       Text primary  : #3E2A1E (espresso brown)
       Text label    : #6E5848 (warm brown)
       Text muted    : #9C8676 (muted brown)
       Primary action: linear-gradient #F26A3A → #E85D27 (orange→rust)
       Accent orange : #F26A3A   Accent rust: #E85D27   Accent ink: #C25A1E
       Step done     : #F26A3A   Step active: orange-tint chip
       Border        : rgba(214, 128, 72, 0.18)
    ──────────────────────────────────────────────────────────────── */

    /* GLOBAL */
    html, body, [class*="css"], .stApp {
        font-family: 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif !important;
        color: #3E2A1E !important;
    }

    /* Page background β€” soft warm peach with coral glow blooms (top-left + bottom-right) */
    /* Background lives on <html> with fixed attachment so it fills the viewport
       uniformly regardless of document scroll. (Putting it on .stApp caused a
       two-tone seam, because .stApp is only viewport-tall while content overflows
       below it.) */
    html {
        background:
            radial-gradient(at 15% 6%, rgba(245, 150, 82, 0.42) 0px, transparent 48%),
            radial-gradient(at 86% 94%, rgba(245, 150, 82, 0.22) 0px, transparent 52%),
            linear-gradient(180deg, #FFF4EC 0%, #FCE7D6 100%) !important;
        background-attachment: fixed !important;
        /* Base colour under the fixed gradient β€” fills any area the fixed image
           doesn't paint (below the first viewport on tall pages) so there's no
           seam at the bottom. */
        background-color: #FCE7D6 !important;
    }
    .stApp { background: transparent !important; }
    /* Solid peach base behind everything β€” the html gradient uses fixed
       attachment and won't paint below the first viewport on tall pages, which
       otherwise shows as a seam at the bottom. */
    body { background-color: #FCE7D6 !important; }

    /* Slim, theme-matched scrollbar. No scrollbar-gutter reservation β€” that left
       an empty gutter on the non-scrolling edge which painted with the native
       white track color (unreachable by ::-webkit-scrollbar-track), showing as a
       white bar. Just a normal right scrollbar with a transparent track + soft
       coral thumb, so there is no white bar on either side. */
    html { scrollbar-color: rgba(242, 106, 58, 0.45) transparent; scrollbar-width: thin; }
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb {
        background: rgba(242, 106, 58, 0.45);
        border-radius: 8px;
    }
    ::-webkit-scrollbar-thumb:hover { background: rgba(242, 106, 58, 0.65); }

    /* Hide Streamlit chrome */
    [data-testid="stToolbar"] { visibility: hidden; height: 0; position: fixed; }
    [data-testid="stDecoration"] { display: none; }
    footer { visibility: hidden; }
    #MainMenu { visibility: hidden; }
    [data-testid="stHeader"] {
        background: transparent !important;
        height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
    }
    [data-testid="stHeader"] > div { background: transparent !important; }

    /* HIDE SIDEBAR ENTIRELY */
    section[data-testid="stSidebar"] {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
    }
    [data-testid="collapsedControl"],
    [data-testid="stSidebarCollapsedControl"],
    button[kind="headerNoPadding"] {
        display: none !important;
    }

    .block-container {
        padding-top: 1.5rem !important;
        padding-bottom: 4rem !important;
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Natural page-level scrolling + centering. Streamlit confines scrolling to
       an inner container (no page scrollbar), which often reads as "can't scroll".
       Let the document scroll instead, and keep .stApp covering the viewport so the
       fixed gradient background still fills the screen. */
    html, body { height: auto !important; overflow-y: auto !important; }
    .stApp {
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
    }
    [data-testid="stAppViewContainer"],
    [data-testid="stMain"] {
        height: auto !important;
        overflow: visible !important;
    }

    /* ─── ANIMATIONS ─────────────────────────────────────────────── */
    @keyframes fadeInUp {
        from { opacity: 0; transform: translateY(20px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    @keyframes pulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(242, 106, 58, 0.4); }
        50%      { box-shadow: 0 0 0 7px rgba(242, 106, 58, 0); }
    }
    @keyframes blob {
        0%, 100% { transform: translate(0, 0) scale(1); }
        33%      { transform: translate(30px, -50px) scale(1.1); }
        66%      { transform: translate(-20px, 20px) scale(0.9); }
    }
    /* Stepper gimmicks: breathing active circle, pop-in checkmark, growing bar */
    @keyframes stepBreathe {
        0%, 100% { transform: scale(1); }
        50%      { transform: scale(1.08); }
    }
    @keyframes stepPop {
        0%   { transform: scale(0.4); opacity: 0; }
        60%  { transform: scale(1.18); opacity: 1; }
        100% { transform: scale(1); }
    }
    @keyframes growX {
        from { transform: scaleX(0); }
        to   { transform: scaleX(1); }
    }
    @keyframes barFlow {
        0%   { background-position: 200% 0; }
        100% { background-position: 0% 0; }
    }

    /* ─── HERO ───────────────────────────────────────────────────── */
    /* Centered hero sitting directly on the peach gradient β€” no panel:
       a floating PTT pill, an eyebrow, a two-tone "Auto Form" wordmark,
       a Thai subtitle, a highlighted description, and a feature line. */
    .hero {
        position: relative;
        background: transparent;
        border: none;
        padding: 0.5rem 1rem 0.5rem;
        margin-bottom: 1.6rem;
        animation: fadeInUp 0.6s ease;
    }
    .hero-content { position: relative; z-index: 2; text-align: center; }
    /* Floating white "access pill" with an orange status dot. */
    .hero-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        background: #FFFFFF;
        border: 1px solid rgba(214, 128, 72, 0.20);
        color: #6E5848;
        padding: 0.5rem 1.15rem;
        border-radius: 999px;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.22em;
        margin-bottom: 1.5rem;
        text-transform: uppercase;
        box-shadow: 0 8px 24px rgba(214, 120, 60, 0.14);
    }
    .hero-badge-dot {
        width: 8px; height: 8px; border-radius: 50%;
        background: #F26A3A;
        box-shadow: 0 0 10px 1px rgba(242, 106, 58, 0.6);
    }
    .hero-eyebrow {
        color: #D98A5B;
        font-size: 0.92rem;
        font-weight: 700;
        letter-spacing: 0.28em;
        text-transform: uppercase;
        margin-bottom: 0.35rem;
    }
    .hero .hero-title {
        text-align: center !important;
        font-size: 5rem !important;
        font-weight: 900 !important;
        margin: 0 0 0.5rem 0 !important;
        letter-spacing: -0.03em !important;
        line-height: 0.98 !important;
        color: #3E2A1E !important;
    }
    .hero .hero-title .accent {
        background: linear-gradient(135deg, #F58A3C 0%, #F26A1F 55%, #E85D1A 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: #F26A1F;
    }
    .hero .hero-subtitle {
        color: #3E2A1E !important;
        text-align: center !important;
        font-size: 1.85rem !important;
        font-weight: 700 !important;
        max-width: 820px;
        margin: 0 auto !important;
        line-height: 1.25;
    }
    .hero .hero-subtitle .hl { color: #F26A1F !important; }
    /* ─── STEPS ──────────────────────────────────────────────────── */
    .steps-wrapper {
        background: #FFFFFF;
        border: 1px solid rgba(214, 128, 72, 0.18);
        border-radius: 16px;
        padding: 1.25rem 1.5rem;
        margin-bottom: 2rem;
        box-shadow: 0 8px 28px rgba(214, 120, 60, 0.12);
        animation: fadeInUp 0.6s ease 0.1s both;
    }
    .steps-row { display: flex; align-items: center; gap: 0; }
    .step { display: flex; align-items: center; gap: 0.7rem; flex: 0 0 auto; }
    .step-circle {
        height: 40px; border-radius: 999px;
        padding: 0 1rem;
        display: flex; align-items: center; justify-content: center;
        gap: 0.3rem;
        font-weight: 700; font-size: 0.95rem; white-space: nowrap;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .step-default .step-circle {
        background: #F7ECE3;
        color: #9C8676;
        border: 2px solid rgba(214, 128, 72, 0.18);
    }
    .step-active .step-circle {
        background: rgba(242, 106, 58, 0.10);
        color: #C25A1E;
        border: 2px solid rgba(242, 106, 58, 0.45);
        box-shadow: 0 4px 16px rgba(242, 106, 58, 0.20);
        animation: stepBreathe 2.6s ease-in-out infinite;
    }
    .step-done .step-circle {
        background: linear-gradient(135deg, #F26A3A 0%, #E85D27 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(242, 106, 58, 0.35);
        animation: stepPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }
    .step-label { font-size: 0.85rem; font-weight: 500; color: #9C8676; white-space: nowrap; }
    .step-active .step-label { color: #3E2A1E; font-weight: 600; }
    .step-done .step-label { color: #C25A1E; font-weight: 600; }

    .step-bar {
        flex: 1; height: 3px;
        background: rgba(214, 128, 72, 0.18);
        margin: 0 1rem; border-radius: 999px;
        overflow: hidden; position: relative;
    }
    .step-bar-fill {
        position: absolute; inset: 0;
        background: linear-gradient(90deg, #F26A3A 0%, #E85D27 100%);
        transform-origin: left;
        transition: transform 0.5s ease;
    }
    .step-bar-fill.empty { transform: scaleX(0); }
    .step-bar-fill.full  {
        transform: scaleX(1);
        background: linear-gradient(90deg, #F26A3A 0%, #E85D27 100%);
        animation: growX 0.6s cubic-bezier(0.65, 0, 0.35, 1) 0.1s both;
    }

    /* ─── CARDS ──────────────────────────────────────────────────── */
    .card-header {
        display: flex; align-items: center; gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
    .card-icon {
        width: 40px; height: 40px;
        border-radius: 12px;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.25rem;
    }
    .card-icon-1 { background: linear-gradient(135deg, rgba(242, 106, 58, 0.3) 0%, rgba(242, 106, 58, 0.18) 100%); }
    .card-icon-2 { background: linear-gradient(135deg, rgba(242, 106, 58, 0.28) 0%, rgba(242, 106, 58, 0.16) 100%); }
    .card-icon-3 { background: linear-gradient(135deg, rgba(232, 93, 39, 0.30) 0%, rgba(232, 93, 39, 0.16) 100%); }
    .card-title {
        font-size: 1.1rem; font-weight: 700; color: #3E2A1E; margin: 0; line-height: 1.2;
    }
    .card-subtitle {
        font-size: 0.8rem; color: #9C8676; margin: 0.15rem 0 0 0; font-weight: 500;
    }

    /* ─── STEP NUMBER BADGES (popup, straddling the card's top-left corner) ── */
    .step-badge {
        position: absolute;
        top: -18px; left: -44px;
        width: 44px; height: 44px;
        border-radius: 14px;                     /* squircle β€” softer, more modern than a full circle */
        display: flex; align-items: center; justify-content: center;
        font-size: 1.4rem; font-weight: 800; color: #FFFFFF;
        border: 3px solid #FFFFFF;               /* white ring β†’ reads as a chip on the card */
        box-shadow: 0 6px 16px rgba(242, 106, 58, 0.35);
        z-index: 5;
        background: linear-gradient(135deg, #F58A3C 0%, #F26A1F 100%);
        animation: stepPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }

    /* ─── STEP CARDS (top-level columns become distinct panels) ──── */
    /* :not(...) excludes nested column rows (e.g. the PO input + button row) */
    [data-testid="stColumn"]:not([data-testid="stColumn"] [data-testid="stColumn"]) {
        position: relative;                      /* anchor for the popup step badges */
        background: #FFFFFF;
        border: 1px solid rgba(214, 128, 72, 0.18);
        border-radius: 18px;
        padding: 1.6rem 1.7rem;
        box-shadow: 0 10px 30px rgba(214, 120, 60, 0.12);
    }
    /* Locked next step: dim the whole panel when its lock marker is rendered */
    [data-testid="stColumn"]:has(.step2-lock) { opacity: 0.5; transition: opacity 0.25s ease; }
    .step2-lock { display: none; }
    .step2-lock-hint {
        display: flex; align-items: center; gap: 0.4rem;
        font-size: 0.82rem; color: #9C8676; font-weight: 600;
        margin: 0 0 0.9rem 0;
    }

    /* ─── VENDOR CARDS ───────────────────────────────────────────── */
    .vendor-card {
        background: linear-gradient(135deg, rgba(242, 106, 58, 0.10) 0%, rgba(232, 93, 39, 0.04) 100%);
        border: 1px solid rgba(242, 106, 58, 0.22);
        padding: 1rem 1.25rem;
        border-radius: 14px;
        margin: 0.6rem 0;
        position: relative;
        overflow: hidden;
        transition: all 0.2s ease;
    }
    .vendor-card:hover {
        transform: translateX(2px);
        box-shadow: 0 4px 16px rgba(242, 106, 58, 0.18);
    }
    .vendor-card::before {
        content: "";
        position: absolute;
        left: 0; top: 0; bottom: 0;
        width: 4px;
        background: linear-gradient(180deg, #F26A3A 0%, #E85D27 100%);
    }
    .vendor-card-label {
        font-size: 0.7rem;
        text-transform: uppercase;
        color: #C25A1E;
        font-weight: 700;
        letter-spacing: 0.06em;
        margin-bottom: 0.4rem;
        display: flex; align-items: center; gap: 0.4rem;
    }
    .vendor-card-value {
        font-size: 1.05rem;
        color: #3E2A1E;
        font-weight: 600;
        line-height: 1.4;
    }

    /* ─── BUTTONS ────────────────────────────────────────────────── */
    .stButton button[kind="primary"] {
        background: linear-gradient(135deg, #F26A3A 0%, #E85D27 100%) !important;
        border: none !important;
        color: #FFFFFF !important;
        box-shadow: 0 4px 14px rgba(242, 106, 58, 0.35) !important;
        font-weight: 700 !important;
        height: 3.25rem !important;
        font-size: 1.05rem !important;
        transition: all 0.3s ease !important;
        border-radius: 999px !important;
    }
    .stButton button[kind="primary"]:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(232, 93, 39, 0.45) !important;
        background: linear-gradient(135deg, #FF8A52 0%, #D2602F 100%) !important;
    }
    .stButton button[kind="secondary"] {
        background: rgba(242, 106, 58, 0.08) !important;
        border: 1.5px solid rgba(242, 106, 58, 0.35) !important;
        color: #C25A1E !important;
        font-weight: 600 !important;
        height: 3rem !important;
        border-radius: 999px !important;
        transition: all 0.2s ease !important;
    }
    .stButton button[kind="secondary"]:hover {
        background: rgba(242, 106, 58, 0.15) !important;
        border-color: #F26A3A !important;
        transform: translateY(-1px);
    }
    /* PO lookup button β€” match the PO input height (both pinned to 3rem via their
       widget keys), bottom-aligned by the column; enlarge the Material check glyph */
    .st-key-po_lookup_btn button { height: 3rem !important; padding: 0 !important; }
    .st-key-po_lookup_btn button p,
    .st-key-po_lookup_btn button span,
    .st-key-po_lookup_btn button [data-testid="stIconMaterial"] {
        font-size: 1.5rem !important;
    }
    .st-key-po_input_widget [data-baseweb="input"],
    .st-key-po_input_widget [data-baseweb="base-input"] {
        height: 3rem !important;
    }
    /* Highlight the "AI" in the generate button: the :violet[AI] markdown span becomes a
       white chip/badge with dark-blue text so it showcases the AI feature.
       NOTE: the selector must out-specify the later '.stButton button[kind="primary"]
       [data-testid="stMarkdownContainer"] span { color:#fff }' rule, or the AI text gets
       forced white-on-white (invisible). Hence the [kind="primary"] + container chain + html body. */
    html body .st-key-generate_btn button[kind="primary"] [data-testid="stMarkdownContainer"] span[style*="color"] {
        color: #1E3A8A !important;   /* dark blue */
        -webkit-text-fill-color: #1E3A8A !important;
        font-weight: 800;
        letter-spacing: .6px;
        padding: 2px 10px;
        border-radius: 8px;
        background: rgba(255, 255, 255, .95);
        box-shadow: 0 0 10px rgba(255, 255, 255, .45), inset 0 0 0 1px rgba(30, 58, 138, .30);
        text-shadow: none;
    }
    .stDownloadButton button {
        background: linear-gradient(135deg, #F26A3A 0%, #E85D27 100%) !important;
        color: #FFFFFF !important;
        border: none !important;
        box-shadow: 0 4px 14px rgba(242, 106, 58, 0.35) !important;
        font-weight: 700 !important;
        height: 3.25rem !important;
        font-size: 1.05rem !important;
        border-radius: 999px !important;
        transition: all 0.3s ease !important;
    }
    .stDownloadButton button:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(232, 93, 39, 0.45) !important;
        background: linear-gradient(135deg, #FF8A52 0%, #D2602F 100%) !important;
    }
    /* Cream buttons render their label inside a stMarkdownContainer <p>, which the
       global markdown rule forces to light text. Re-assert purple on the label text
       and any Material-icon glyph so it stays readable on the cream surface. */
    .stButton button[kind="primary"] [data-testid="stMarkdownContainer"] p,
    .stButton button[kind="primary"] [data-testid="stMarkdownContainer"] span,
    .stDownloadButton button [data-testid="stMarkdownContainer"] p,
    .stDownloadButton button [data-testid="stMarkdownContainer"] span {
        color: #FFFFFF !important;
    }

    /* ─── INPUTS β€” bulletproof dark styling ──────────────────────── */

    /* All input wrappers β€” use SOLID dark color slightly DARKER than card bg
       so inputs look like "indented" surfaces, not flat boxes */
    [data-testid="stTextInput"] > div > div,
    [data-testid="stTextInput"] > div > div > div,
    [data-testid="stTextInput"] [data-baseweb="input"],
    [data-testid="stTextInput"] [data-baseweb="base-input"],
    [data-testid="stTextInput"] [data-baseweb="input"] > div,
    [data-testid="stTextInput"] [data-baseweb="base-input"] > div,
    [data-baseweb="input"],
    [data-baseweb="base-input"],
    [data-baseweb="input"] > div,
    [data-baseweb="base-input"] > div {
        background-color: #FFFFFF !important;  /* clean white field */
        background: #FFFFFF !important;
        border: 1.5px solid rgba(242, 106, 58, 0.25) !important;
        border-radius: 12px !important;
        color: #3E2A1E !important;
        box-shadow: inset 0 1px 2px rgba(214, 120, 60, 0.08) !important;  /* subtle inner shadow */
    }

    /* The actual <input> element β€” transparent so wrapper bg shows through */
    [data-testid="stTextInput"] input,
    [data-baseweb="input"] input,
    [data-baseweb="base-input"] input,
    .stTextInput input,
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"] {
        background-color: transparent !important;
        background: transparent !important;
        color: #3E2A1E !important;
        -webkit-text-fill-color: #3E2A1E !important;
        font-size: 0.95rem !important;
        font-weight: 500 !important;  /* typed text β€” clearly bolder */
        border: none !important;
        caret-color: #F26A3A !important;
        font-style: normal !important;
    }

    /* Placeholder β€” clearly look like a "hint", not real text:
       dim muted-gray, italic, lighter weight */
    [data-testid="stTextInput"] input::placeholder,
    [data-baseweb="input"] input::placeholder,
    .stTextInput input::placeholder,
    input::placeholder,
    textarea::placeholder {
        color: rgba(110, 88, 72, 0.55) !important;  /* muted brown hint */
        font-style: italic !important;
        font-weight: 400 !important;
        opacity: 1 !important;
        -webkit-text-fill-color: rgba(110, 88, 72, 0.55) !important;
    }

    /* Webkit autofill β€” prevent yellow bg */
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus {
        -webkit-text-fill-color: #3E2A1E !important;
        -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset !important;
        box-shadow: 0 0 0 1000px #FFFFFF inset !important;
        background: #FFFFFF !important;
    }

    /* Focus state β€” coral glow on wrapper + subtle lift */
    [data-testid="stTextInput"] > div > div:focus-within,
    [data-baseweb="input"]:focus-within,
    [data-baseweb="base-input"]:focus-within {
        border-color: #F26A3A !important;
        box-shadow:
            0 0 0 4px rgba(242, 106, 58, 0.18),
            inset 0 1px 2px rgba(214, 120, 60, 0.06) !important;
        background-color: #FFF6EF !important;
        background: #FFF6EF !important;
    }

    /* Selectbox β€” same treatment, deep nesting */
    [data-testid="stSelectbox"] > div > div,
    [data-testid="stSelectbox"] > div > div > div,
    [data-testid="stSelectbox"] [data-baseweb="select"],
    [data-testid="stSelectbox"] [data-baseweb="select"] > div,
    [data-baseweb="select"],
    [data-baseweb="select"] > div,
    [data-baseweb="select"] > div > div {
        background-color: #FFFFFF !important;
        background: #FFFFFF !important;
        border: 1.5px solid rgba(242, 106, 58, 0.25) !important;
        border-radius: 12px !important;
        color: #3E2A1E !important;
        cursor: pointer !important;
    }
    [data-baseweb="select"] *,
    [data-baseweb="select"] span,
    [data-baseweb="select"] div {
        color: #3E2A1E !important;
    }
    /* Dropdown arrow β€” soft orange, with a pointer cursor on hover */
    [data-testid="stSelectbox"] svg,
    [data-baseweb="select"] svg {
        fill: #F58A52 !important;
        cursor: pointer !important;
    }
    [data-baseweb="select"] [role="button"],
    [data-baseweb="select"] [aria-label*="open" i],
    [data-testid="stSelectbox"] svg:hover,
    [data-baseweb="select"] svg:hover {
        cursor: pointer !important;
    }
    [data-testid="stSelectbox"] svg:hover,
    [data-baseweb="select"] svg:hover {
        fill: #F26A3A !important;
    }

    /* Selectbox dropdown popover (portaled outside main DOM β€” needs high
       specificity). Dark surface on the whole menu + every wrapper, but the
       rounded frame + shadow live on the listbox ONLY β€” so individual options
       stay flat. (Previously the descendant catch-all applied border/radius/shadow
       to every option, giving the "messy" nested-box look.) */
    html body [data-baseweb="popover"],
    html body [data-baseweb="popover"] > div,
    html body [data-baseweb="popover"] > div > div,
    html body [data-baseweb="popover"] [data-baseweb="menu"],
    html body div[data-baseweb="popover"] *,
    [role="listbox"],
    ul[role="listbox"],
    div[role="listbox"] {
        background: #FFFFFF !important;
        background-color: #FFFFFF !important;
        color: #3E2A1E !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* The single rounded frame: the listbox container only */
    html body [data-baseweb="popover"] [role="listbox"],
    [role="listbox"] {
        border: 1px solid rgba(242, 106, 58, 0.3) !important;
        border-radius: 12px !important;
        box-shadow: 0 12px 30px rgba(214, 120, 60, 0.18) !important;
    }

    /* Each option in the dropdown β€” white bg + dark text */
    html body [data-baseweb="popover"] li,
    html body [data-baseweb="menu"] li,
    html body [role="option"],
    html body ul[role="listbox"] > li,
    li[role="option"] {
        background: #FFFFFF !important;
        background-color: #FFFFFF !important;
        color: #3E2A1E !important;
        -webkit-text-fill-color: #3E2A1E !important;
        padding: 0.55rem 0.85rem !important;
    }
    /* Force inner content of option to inherit dark color */
    html body [data-baseweb="popover"] li *,
    html body [role="option"] *,
    li[role="option"] *,
    li[role="option"] div,
    li[role="option"] span {
        color: #3E2A1E !important;
        -webkit-text-fill-color: #3E2A1E !important;
        background: transparent !important;
        background-color: transparent !important;
    }

    /* Hover state */
    html body [data-baseweb="popover"] li:hover,
    html body [role="option"]:hover,
    li[role="option"]:hover {
        background: rgba(242, 106, 58, 0.12) !important;
        background-color: rgba(242, 106, 58, 0.12) !important;
        color: #C25A1E !important;
    }
    html body [data-baseweb="popover"] li:hover *,
    html body [role="option"]:hover *,
    li[role="option"]:hover * {
        color: #C25A1E !important;
        -webkit-text-fill-color: #C25A1E !important;
    }

    /* Selected option */
    html body [role="option"][aria-selected="true"],
    li[role="option"][aria-selected="true"] {
        background: rgba(242, 106, 58, 0.16) !important;
        background-color: rgba(242, 106, 58, 0.16) !important;
        color: #C25A1E !important;
    }

    /* Scrollbar inside dropdown */
    [data-baseweb="popover"] ul::-webkit-scrollbar,
    [role="listbox"]::-webkit-scrollbar {
        width: 8px;
        background: transparent;
    }
    [data-baseweb="popover"] ul::-webkit-scrollbar-thumb,
    [role="listbox"]::-webkit-scrollbar-thumb {
        background: rgba(242, 106, 58, 0.3);
        border-radius: 4px;
    }

    /* Textarea β€” same treatment */
    .stTextArea textarea,
    [data-baseweb="textarea"] textarea,
    [data-testid="stTextArea"] textarea {
        background-color: #FFFFFF !important;
        background: #FFFFFF !important;
        color: #3E2A1E !important;
        border: 1.5px solid rgba(242, 106, 58, 0.25) !important;
        border-radius: 12px !important;
        -webkit-text-fill-color: #3E2A1E !important;
    }

    /* Radio buttons β€” text color and indicator */
    .stRadio label,
    .stRadio [data-baseweb="radio"] label,
    .stRadio > div > div {
        color: #3E2A1E !important;
    }
    .stRadio [data-baseweb="radio"] div[role="radio"] {
        background-color: #FFFFFF !important;
        border-color: rgba(242, 106, 58, 0.4) !important;
    }
    .stRadio [data-baseweb="radio"] div[role="radio"][aria-checked="true"] {
        background-color: #F26A3A !important;
        border-color: #F26A3A !important;
    }

    /* File uploader */
    [data-testid="stFileUploader"] section,
    [data-testid="stFileUploader"] > div {
        background: rgba(242, 106, 58, 0.04) !important;
        border: 2px dashed rgba(242, 106, 58, 0.3) !important;
        border-radius: 14px !important;
        color: #3E2A1E !important;
    }
    [data-testid="stFileUploader"] button {
        background: rgba(242, 106, 58, 0.12) !important;
        color: #C25A1E !important;
        border: 1px solid rgba(242, 106, 58, 0.3) !important;
    }
    [data-testid="stFileUploader"] small,
    [data-testid="stFileUploader"] span {
        color: #6E5848 !important;
    }

    /* Labels above inputs */
    .stTextInput label,
    .stTextInput label p,
    .stSelectbox label,
    .stSelectbox label p,
    .stRadio label > div:first-child,
    .stFileUploader label {
        font-weight: 600 !important;
        color: #6E5848 !important;
        font-size: 0.85rem !important;
    }

    /* ─── ALERTS ─────────────────────────────────────────────────── */
    .stAlert {
        border-radius: 14px !important;
        border: none !important;
        backdrop-filter: blur(10px);
    }
    [data-testid="stNotificationContentSuccess"] {
        background: rgba(242, 106, 58, 0.15) !important;
        color: #C25A1E !important;
    }
    [data-testid="stNotificationContentInfo"] {
        background: rgba(242, 106, 58, 0.14) !important;
        color: #C25A1E !important;
    }
    /* Warning alert. Streamlit 1.57 paints the colored box on stAlertContainer
       (the old stNotificationContentWarning testid no longer exists); scope to
       warnings only via :has() so success/info/error keep their own colors. */
    [data-testid="stAlertContainer"]:has([data-testid="stAlertContentWarning"]) {
        background: rgba(245, 158, 11, 0.12) !important;
        border: 1px solid rgba(245, 158, 11, 0.35) !important;
        border-left: 4px solid #D97706 !important;
    }
    [data-testid="stAlertContentWarning"],
    [data-testid="stAlertContentWarning"] * {
        color: #B45309 !important;
    }
    [data-testid="stAlertContainer"]:has([data-testid="stAlertContentWarning"]) svg {
        fill: #B45309 !important;
    }
    [data-testid="stNotificationContentError"] {
        background: rgba(239, 68, 68, 0.14) !important;
        color: #DC2626 !important;
    }

    /* ─── EXPANDERS ──────────────────────────────────────────────── */
    .streamlit-expanderHeader,
    [data-testid="stExpander"] summary {
        background: rgba(242, 106, 58, 0.05) !important;
        border-radius: 12px !important;
        color: #6E5848 !important;
        font-weight: 600 !important;
        border: 1px solid rgba(242, 106, 58, 0.14) !important;
    }
    [data-testid="stExpander"] {
        background: transparent !important;
        border: none !important;
    }
    [data-testid="stExpander"] details {
        background: transparent !important;
        border: none !important;
    }
    [data-testid="stExpander"] [data-testid="stExpanderDetails"] {
        background: rgba(242, 106, 58, 0.03) !important;
        border: 1px solid rgba(242, 106, 58, 0.12) !important;
        border-radius: 12px !important;
        padding: 1rem !important;
        margin-top: 0.5rem !important;
    }

    /* ─── SECTION TITLE ──────────────────────────────────────────── */
    .section-title {
        font-size: 0.95rem;
        font-weight: 700;
        color: #3E2A1E;
        margin: 1.25rem 0 0.75rem 0;
        display: flex; align-items: center; gap: 0.5rem;
    }
    .section-title::before {
        content: "";
        width: 4px; height: 18px;
        background: linear-gradient(180deg, #F26A3A 0%, #E85D27 100%);
        border-radius: 2px;
    }

    /* ─── EMPTY STATE ────────────────────────────────────────────── */
    .empty-state {
        text-align: center;
        padding: 2rem 1rem;
        background: rgba(242, 106, 58, 0.04);
        border-radius: 14px;
        border: 2px dashed rgba(242, 106, 58, 0.22);
        margin: 1rem 0;
    }
    .empty-state-icon { margin-bottom: 0.75rem; opacity: 0.7; line-height: 0; }
    .empty-state-text { color: #9C8676; font-size: 0.9rem; margin: 0; }

    /* ─── DIVIDER ─────────────────────────────────────────────────── */
    hr {
        border: none !important;
        height: 1px !important;
        background: linear-gradient(90deg, transparent 0%, rgba(242, 106, 58, 0.25) 50%, transparent 100%) !important;
        margin: 1rem 0 !important;
    }

    /* Captions */
    .caption, .stCaption, [data-testid="stCaptionContainer"] {
        color: #9C8676 !important;
    }

    /* Markdown content (general text) */
    .stMarkdown, .stMarkdown p, [data-testid="stMarkdownContainer"] {
        color: #3E2A1E !important;
    }
    .stMarkdown strong { color: #C25A1E !important; }
    .stMarkdown code {
        background: rgba(242, 106, 58, 0.14) !important;
        color: #C25A1E !important;
        padding: 0.15rem 0.45rem !important;
        border-radius: 6px !important;
    }

    /* Spinner */
    .stSpinner > div {
        border-top-color: #F26A3A !important;
    }

    /* ─── MOBILE / NARROW-SCREEN BLOCK ───────────────────────────────
       The wide two-column form is desktop-only. On a phone-sized viewport,
       cover the whole app with a friendly "not supported on mobile" notice.
       Pure CSS so it shows instantly (no server round-trip / flash) and
       reacts to rotation/resize. Covers the login screen too. */
    .mobile-block { display: none; }
    @media (max-width: 820px) {
        .mobile-block {
            display: flex !important;
            position: fixed; inset: 0; z-index: 2147483647;
            align-items: center; justify-content: center; padding: 28px;
            background:
                radial-gradient(at 18% 8%, rgba(245, 150, 82, 0.42) 0px, transparent 55%),
                radial-gradient(at 85% 92%, rgba(245, 150, 82, 0.22) 0px, transparent 55%),
                linear-gradient(180deg, #FFF4EC 0%, #FCE7D6 100%);
        }
    }
    .mobile-block-card {
        background: #FFFFFF; border: 1px solid rgba(214, 128, 72, 0.18);
        border-radius: 24px; padding: 2.2rem 1.7rem; max-width: 340px; width: 100%;
        text-align: center; box-shadow: 0 24px 60px rgba(214, 120, 60, 0.22);
    }
    .mobile-block-icon {
        width: 72px; height: 72px; margin: 0 auto 1.1rem; border-radius: 20px;
        display: flex; align-items: center; justify-content: center; font-size: 2.1rem;
        background: rgba(242, 106, 58, 0.12); border: 1px solid rgba(242, 106, 58, 0.22);
    }
    .mobile-block-title {
        color: #3E2A1E; font-weight: 800; font-size: 1.3rem; margin-bottom: 0.5rem;
    }
    .mobile-block-text {
        color: #6E5848; font-weight: 600; font-size: 1rem; line-height: 1.55;
    }
    .mobile-block-sub {
        color: #9C8676; font-weight: 500; font-size: 0.82rem; margin-top: 0.9rem;
    }
</style>

<div class="mobile-block">
  <div class="mobile-block-card">
    <div class="mobile-block-icon">πŸ–₯️</div>
    <div class="mobile-block-title">ΰΈΰΈ£ΰΈΈΰΈ“ΰΈ²ΰΉƒΰΈŠΰΉ‰ΰΈ‡ΰΈ²ΰΈ™ΰΈšΰΈ™ΰΈ„ΰΈ­ΰΈ‘ΰΈžΰΈ΄ΰΈ§ΰΉ€ΰΈ•ΰΈ­ΰΈ£ΰΉŒ</div>
    <div class="mobile-block-text">ΰΈ›ΰΈ±ΰΈˆΰΈˆΰΈΈΰΈšΰΈ±ΰΈ™ ΰΈ’ΰΈ±ΰΈ‡ΰΉ„ΰΈ‘ΰΉˆΰΈ£ΰΈ­ΰΈ‡ΰΈ£ΰΈ±ΰΈšΰΈΰΈ²ΰΈ£ΰΉƒΰΈŠΰΉ‰ΰΈ‡ΰΈ²ΰΈ™ΰΉƒΰΈ™ΰΈ‘ΰΈ·ΰΈ­ΰΈ–ΰΈ·ΰΈ­<br>ΰΈ‚ΰΈ­ΰΈ­ΰΈ ΰΈ±ΰΈ’ΰΉƒΰΈ™ΰΈ„ΰΈ§ΰΈ²ΰΈ‘ΰΉ„ΰΈ‘ΰΉˆΰΈͺะดวก</div>
    <div class="mobile-block-sub">Please open Auto Form on a desktop browser.</div>
  </div>
</div>
"""