-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1068 lines (1049 loc) · 268 KB
/
Copy pathindex.html
File metadata and controls
1068 lines (1049 loc) · 268 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Prompt Engineer · Loria Space</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&family=Orbitron:wght@500;700;900&family=Rajdhani:wght@500;600;700&family=Share+Tech+Mono&display=swap" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/docx@8.5.0/build/index.umd.min.js"></script>
<style>
:root{
--cyan:#e6c478;--violet:#3fae9a;--magenta:#d8a981;--teal:#46b29d;--amber:#fbbf24;
--neon:linear-gradient(120deg,#f2dca0,#e6c478 50%,#cfa24f);
--btn-grad:linear-gradient(120deg,#f0d291,#e0b86a 50%,#caa14e);--btn-ink:#2b2510;--btn-sh:0 1px 2px rgba(40,28,6,.35);
--gb:linear-gradient(135deg,#e6c478,#3fae9a 75%);
--r:20px;--r-sm:13px;
--f-body:"Tajawal",system-ui,-apple-system,"Segoe UI",sans-serif;--f-disp:"Orbitron",sans-serif;--f-lat:"Rajdhani",sans-serif;--f-mono:"Share Tech Mono",ui-monospace,monospace;
--bg:#0a0d18;--bg2:#0f1426;--panel:rgba(20,23,44,.56);--panel-2:rgba(26,30,56,.74);
--text:#f1ece1;--muted:#aaa492;--muted-2:#7a7560;--line:rgba(220,200,150,.16);--line-2:rgba(220,200,150,.28);
--field:rgba(255,255,255,.04);--field-2:rgba(255,255,255,.035);--term-bg:rgba(4,7,18,.7);--term-text:#bfe7f3;
--shadow:0 34px 90px -40px rgba(0,0,0,.95),0 2px 0 rgba(255,255,255,.05) inset,0 -2px 6px rgba(0,0,0,.4) inset;
--glow:0 0 22px -4px;--aurora-op:.4;--aurora-blend:screen;--grid-c1:rgba(230,196,120,.14);--grid-c2:rgba(63,174,154,.13);--dust-c:#ecdcb4;
}
body.theme-light{
--bg:#f8f4ea;--bg2:#f1ead9;--panel:rgba(255,253,247,.92);--panel-2:rgba(255,255,252,.97);
--text:#2a2519;--muted:#6f6852;--muted-2:#a49a7e;--line:rgba(150,120,50,.16);--line-2:rgba(150,120,50,.3);
--field:rgba(255,253,247,.95);--field-2:rgba(250,245,234,.96);--term-bg:#fffdf7;--term-text:#3a3320;
--shadow:0 24px 56px -38px rgba(90,70,20,.32),0 1px 0 rgba(255,255,255,.95) inset,0 -1px 4px rgba(160,140,90,.08) inset;
--aurora-op:.16;--aurora-blend:normal;--grid-c1:rgba(200,160,70,.1);--grid-c2:rgba(63,150,130,.08);--dust-c:#c9a44e;
--cyan:#a8801f;--violet:#2f8a76;--magenta:#b07a3e;--teal:#2f8a76;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:var(--f-body);color:var(--text);line-height:1.7;min-height:100vh;overflow-x:hidden;background-attachment:fixed;
background:radial-gradient(1200px 800px at 80% -10%,rgba(63,174,154,.22),transparent 60%),radial-gradient(1000px 700px at 5% 5%,rgba(230,196,120,.16),transparent 58%),radial-gradient(900px 900px at 50% 120%,rgba(216,169,129,.16),transparent 60%),linear-gradient(180deg,var(--bg),var(--bg2));transition:background .5s,color .4s}
body.theme-light{background:radial-gradient(1200px 820px at 84% -14%,rgba(200,160,70,.12),transparent 60%),radial-gradient(1000px 720px at 3% 2%,rgba(63,150,130,.09),transparent 58%),radial-gradient(900px 900px at 50% 124%,rgba(190,140,80,.08),transparent 60%),linear-gradient(180deg,var(--bg),var(--bg2));background-attachment:fixed}
body.theme-light .eyebrow,body.theme-light .creed .lab,body.theme-light .chip .tick{color:#a8801f}
body.theme-light .mpct,body.theme-light .stepbtn .num{color:#2f8a76}
body.theme-light .brand-name{background:linear-gradient(120deg,#b8860b,#a8801f 55%,#8a6d2a);-webkit-background-clip:text;background-clip:text}
body.theme-light .addbtn{border-color:#2f8a76;color:#2f8a76;background:rgba(47,138,118,.08)}
body.theme-light .corner{border-color:#a8801f;filter:none;opacity:.5}
body.theme-light .info{color:#b45309;border-color:#d97706;background:rgba(217,119,6,.1)}
body.theme-light .info:hover,body.theme-light .info.on{color:#fff;background:#d97706}
body.theme-light #pop .pop-h{color:#b45309}
body.theme-light #pop .pop-h .ic{background:#d97706}
body.theme-light .note{color:#2a2550}
.layer{position:fixed;inset:0;pointer-events:none;overflow:hidden}
.l-aurora,.l-grid{z-index:0}.l-dust{z-index:1}
.aurora{position:absolute;border-radius:50%;filter:blur(70px);opacity:var(--aurora-op);mix-blend-mode:var(--aurora-blend);animation:floaty 24s ease-in-out infinite}
@keyframes floaty{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(30px,-28px) scale(1.12)}}
.grid-floor{position:absolute;left:-25%;right:-25%;bottom:-2%;height:64vh;perspective:300px;perspective-origin:50% 0}
.grid-floor::before{content:"";position:absolute;inset:0;background-image:linear-gradient(var(--grid-c1) 1px,transparent 1px),linear-gradient(90deg,var(--grid-c2) 1px,transparent 1px);background-size:46px 46px;transform:rotateX(75deg);transform-origin:50% 0;animation:grid 14s linear infinite}
@keyframes grid{to{background-position:0 46px,0 0}}
.grid-mask{position:absolute;inset:0;background:linear-gradient(180deg,var(--bg) 4%,transparent 46%)}
.dust{position:absolute;border-radius:50%;background:var(--dust-c);opacity:0;animation:rise2 linear infinite}
@keyframes rise2{0%{transform:translateY(0);opacity:0}10%{opacity:.7}90%{opacity:.5}100%{transform:translateY(-108vh);opacity:0}}
.wrap{position:relative;z-index:3;max-width:1060px;margin:0 auto;padding:24px 18px 72px}
.stage{position:relative;transform-style:preserve-3d;transition:transform .25s ease}
.corner{position:absolute;width:26px;height:26px;border:2px solid var(--cyan);opacity:.6;z-index:5;filter:drop-shadow(0 0 6px var(--cyan))}
.corner.tl{inset-block-start:-10px;inset-inline-start:-10px;border-inline-end:0;border-block-end:0}
.corner.tr{inset-block-start:-10px;inset-inline-end:-10px;border-inline-start:0;border-block-end:0}
.corner.bl{inset-block-end:-10px;inset-inline-start:-10px;border-inline-end:0;border-block-start:0}
.corner.br{inset-block-end:-10px;inset-inline-end:-10px;border-inline-start:0;border-block-start:0}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.brand{display:flex;align-items:center;gap:14px;min-width:0;perspective:600px}
.mark{width:56px;height:56px;flex:none;filter:drop-shadow(0 6px 14px rgba(63,174,154,.7));transform-style:preserve-3d;animation:tilt3d 7s ease-in-out infinite}
@keyframes tilt3d{0%,100%{transform:rotateY(-16deg) rotateX(4deg)}50%{transform:rotateY(16deg) rotateX(-4deg)}}
.brand-name{font-family:var(--f-disp);font-weight:900;font-size:clamp(1.25rem,3.6vw,2rem);letter-spacing:1px;margin:0;line-height:1;background:var(--neon);-webkit-background-clip:text;background-clip:text;color:transparent}
body.lang-ar .brand-name{font-family:var(--f-body);font-weight:800;letter-spacing:0}
.brand-tag{margin:.3rem 0 0;font-family:var(--f-mono);font-size:.72rem;letter-spacing:.5px;color:var(--muted);text-transform:uppercase}
body.lang-ar .brand-tag{font-family:var(--f-body);text-transform:none;letter-spacing:0;font-size:.82rem}
.controls{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.iconpill{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;border:1px solid var(--line);background:var(--panel-2);cursor:pointer;color:var(--text);transition:.25s;backdrop-filter:blur(10px)}
.iconpill:hover{border-color:var(--line-2);box-shadow:var(--glow) rgba(251,191,36,.4);transform:translateY(-2px)}
.iconpill:focus-visible{outline:2px solid var(--amber);outline-offset:2px}
.iconpill svg{width:20px;height:20px}
.iconpill.danger:hover{box-shadow:var(--glow) rgba(244,63,94,.5);border-color:rgba(244,63,94,.5)}
.langsel{position:relative;display:inline-flex;align-items:center}
.langsel svg{position:absolute;inset-inline-end:11px;width:15px;height:15px;pointer-events:none;color:var(--muted)}
select#langSel{appearance:none;-webkit-appearance:none;font-family:var(--f-lat);font-weight:700;font-size:.95rem;letter-spacing:.4px;color:var(--text);background:var(--panel-2);border:1px solid var(--line);border-radius:999px;padding:9px 34px 9px 16px;cursor:pointer;backdrop-filter:blur(10px);transition:.2s}
body.lang-ar select#langSel{font-family:var(--f-body);padding:9px 16px 9px 34px}
select#langSel:hover{border-color:var(--line-2)}
select#langSel:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
select#langSel option{background:#0b1024;color:#e9edff}
.steps{display:flex;align-items:center;gap:6px;background:var(--panel);border:1px solid var(--line);border-radius:999px;padding:6px;margin-bottom:22px;backdrop-filter:blur(10px);box-shadow:0 18px 40px -26px rgba(0,0,0,.7)}
.stepbtn{flex:1;display:flex;align-items:center;justify-content:center;gap:9px;border:0;background:transparent;cursor:pointer;color:var(--muted);font-family:var(--f-body);font-weight:700;font-size:.95rem;padding:9px 6px;border-radius:999px;transition:.3s;white-space:nowrap}
.stepbtn .num{width:25px;height:25px;flex:none;display:grid;place-items:center;border-radius:50%;background:rgba(200,185,140,.14);color:var(--cyan);font-family:var(--f-disp);font-size:.72rem;font-weight:700;border:1px solid var(--line-2);transition:.3s}
.stepbtn.active{color:var(--text);background:rgba(200,185,140,.12)}
.stepbtn.active .num{background:var(--btn-grad);color:var(--btn-ink);border-color:transparent;box-shadow:var(--glow) rgba(224,184,106,.6)}
.stepbtn.done .num{background:var(--teal);color:#03241f;border-color:transparent}
.stepbtn:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
@media (max-width:620px){.stepbtn .lbl{display:none}.stepbtn{flex:none;width:46px}}
.glass{position:relative;background:var(--panel);border-radius:var(--r);box-shadow:var(--shadow);backdrop-filter:blur(16px);padding:clamp(18px,3.2vw,32px)}
.glass::before{content:"";position:absolute;inset:0;border-radius:inherit;padding:1.5px;background:var(--gb);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:.55;pointer-events:none}
.glass::after{content:"";position:absolute;left:8%;right:8%;top:0;height:1px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.5),transparent);opacity:.5;pointer-events:none}
.step{display:none;animation:rise .55s cubic-bezier(.22,1,.36,1)}
.step.show{display:block}
@keyframes rise{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
.eyebrow{font-family:var(--f-mono);font-size:.72rem;letter-spacing:2px;color:var(--cyan);text-transform:uppercase;margin:0 0 6px}
body.lang-ar .eyebrow{font-family:var(--f-body);letter-spacing:0}
h2.title{font-family:var(--f-body);font-weight:800;font-size:clamp(1.35rem,3.3vw,1.95rem);margin:0;color:var(--text)}
.sub{margin:.35rem 0 0;color:var(--muted);font-size:.97rem;font-weight:500}
.titlerow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:space-between}
.titlerow .lft{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.choices{display:grid;grid-template-columns:repeat(auto-fill,minmax(172px,1fr));gap:11px;margin-top:20px}
.chip{position:relative;display:flex;align-items:center;gap:11px;text-align:start;border:1px solid var(--line);background:var(--field-2);border-radius:var(--r-sm);padding:12px 13px;cursor:pointer;font-family:var(--f-body);font-weight:600;font-size:.95rem;color:var(--text);transition:transform .22s cubic-bezier(.22,1,.36,1),box-shadow .25s,border-color .25s,background .25s;overflow:hidden}
.chip .emo{width:36px;height:36px;flex:none;display:grid;place-items:center;font-size:1.2rem;background:rgba(230,196,120,.1);border:1px solid var(--line);border-radius:10px;transition:.3s}
.chip .tick{position:absolute;inset-inline-end:9px;inset-block-start:9px;opacity:0;transform:scale(.4);transition:.3s;color:var(--cyan)}
.chip:hover{transform:translateY(-4px);box-shadow:0 16px 28px -16px rgba(230,196,120,.45),var(--glow) rgba(230,196,120,.25);border-color:var(--line-2)}
.chip:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.chip[aria-pressed="true"]{border-color:transparent;background:linear-gradient(120deg,rgba(230,196,120,.16),rgba(63,174,154,.16),rgba(216,169,129,.16));box-shadow:0 16px 30px -16px rgba(63,174,154,.5),var(--glow) rgba(63,174,154,.45)}
.chip[aria-pressed="true"]::after{content:"";position:absolute;inset:0;border-radius:inherit;padding:1.4px;background:var(--gb);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}
.chip[aria-pressed="true"] .emo{background:rgba(230,196,120,.22)}
.chip[aria-pressed="true"] .tick{opacity:1;transform:none;animation:pop .4s ease}
@keyframes pop{0%{transform:scale(.3)}60%{transform:scale(1.25)}100%{transform:scale(1)}}
.info{width:23px;height:23px;flex:none;display:inline-grid;place-items:center;border-radius:50%;cursor:pointer;border:1px solid var(--amber);background:rgba(251,191,36,.12);color:var(--amber);font-family:var(--f-disp);font-weight:900;font-size:.8rem;line-height:1;transition:.2s;padding:0}
.info:hover{background:var(--amber);color:#1a1300;box-shadow:var(--glow) rgba(251,191,36,.6);transform:scale(1.12)}
.info:focus-visible{outline:2px solid var(--amber);outline-offset:2px}
.info.on{background:var(--amber);color:#1a1300}
#pop{position:fixed;z-index:80;max-width:330px;background:var(--panel-2);border-radius:14px;padding:14px 16px;color:var(--text);font-size:.92rem;line-height:1.65;box-shadow:0 24px 60px -18px rgba(0,0,0,.6);opacity:0;transform:translateY(8px) scale(.97);pointer-events:none;transition:.18s;border:1px solid transparent;backdrop-filter:blur(16px)}
#pop.show{opacity:1;transform:none;pointer-events:auto}
#pop::before{content:"";position:absolute;inset:0;border-radius:inherit;padding:1.4px;background:linear-gradient(135deg,var(--amber),var(--magenta));-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}
#pop .pop-h{display:flex;align-items:center;gap:7px;font-weight:800;color:var(--amber);margin:0 0 5px;font-size:.9rem}
#pop .pop-h .ic{width:18px;height:18px;display:grid;place-items:center;border-radius:50%;background:var(--amber);color:#1a1300;font-size:.7rem;font-family:var(--f-disp);font-weight:900}
.meter{margin:16px 0 4px;background:var(--field-2);border:1px solid var(--line);border-radius:var(--r-sm);padding:12px 15px}
.meter-top{display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:.9rem;color:var(--text)}
.mpct{font-family:var(--f-disp);font-weight:700;color:var(--cyan)}
.mtrack{height:9px;border-radius:999px;background:rgba(200,185,140,.18);overflow:hidden;margin:9px 0 7px;box-shadow:inset 0 1px 3px rgba(0,0,0,.3)}
.mfill{height:100%;width:0;border-radius:999px;background:var(--neon);background-size:200% 100%;transition:width .5s cubic-bezier(.22,1,.36,1);animation:hue 7s ease infinite}
.mtip{font-size:.84rem;color:var(--muted);font-weight:500}
.note{display:flex;align-items:center;gap:11px;background:linear-gradient(120deg,rgba(230,196,120,.1),rgba(63,174,154,.1));border:1px solid var(--line-2);border-radius:var(--r-sm);padding:11px 15px;margin-bottom:6px;color:var(--text);font-weight:600;font-size:.93rem}
.note .b{font-size:1.1rem}
.creed{position:relative;border-radius:var(--r-sm);padding:13px 17px;margin:16px 0 22px;background:rgba(63,174,154,.08);color:var(--text);font-weight:500;font-size:.95rem;border:1px dashed var(--violet)}
.creed .lab{font-family:var(--f-mono);font-size:.68rem;letter-spacing:1.5px;color:var(--cyan);text-transform:uppercase;display:block;margin-bottom:5px}
body.lang-ar .creed .lab{font-family:var(--f-body);letter-spacing:0}
.rows{display:flex;flex-direction:column;gap:12px}
.row{display:grid;grid-template-columns:210px 1fr;gap:16px;align-items:start;background:var(--field-2);border:1px solid var(--line);border-radius:var(--r-sm);padding:13px 15px;transition:border-color .25s,box-shadow .25s,transform .25s}
.row:focus-within{border-color:var(--line-2);box-shadow:var(--glow) rgba(230,196,120,.18);transform:translateY(-1px)}
.stage-l{display:flex;align-items:center;gap:8px;padding-top:8px;flex-wrap:wrap}
.stage-l .dot{width:8px;height:8px;flex:none;border-radius:50%;background:var(--neon);box-shadow:var(--glow) rgba(216,169,129,.6)}
.stage-l .nm{font-weight:800;color:var(--text);font-size:.98rem}
.opt{font-size:.7rem;color:var(--muted-2);font-weight:600;border:1px solid var(--line);border-radius:999px;padding:1px 8px}
.ctrl{min-width:0}
input[type=text],textarea{width:100%;font-family:var(--f-body);font-size:.97rem;color:var(--text);background:var(--field);border:1px solid var(--line);border-radius:11px;padding:11px 13px;transition:.2s}
textarea{resize:vertical;min-height:70px;line-height:1.65}
input::placeholder,textarea::placeholder{color:var(--muted-2)}
input:focus,textarea:focus{outline:0;border-color:var(--cyan);background:rgba(230,196,120,.06);box-shadow:var(--glow) rgba(230,196,120,.3)}
.subgroup{display:flex;flex-direction:column;gap:10px}
.subfield .slab{display:flex;align-items:center;gap:7px;font-weight:700;font-size:.85rem;color:var(--muted);margin:0 0 5px}
.list{display:flex;flex-direction:column;gap:9px}
.list .item{display:flex;gap:8px;align-items:center;animation:rise .3s ease}
.iconbtn{width:40px;height:40px;flex:none;border:0;cursor:pointer;border-radius:11px;display:grid;place-items:center;font-size:1.3rem;line-height:1;transition:transform .18s,filter .2s;color:#fff}
.iconbtn.minus{background:linear-gradient(135deg,#fb7185,#f43f5e);box-shadow:var(--glow) rgba(244,63,94,.5),inset 0 1px 0 rgba(255,255,255,.3)}
.iconbtn:hover{transform:translateY(-2px) scale(1.05);filter:saturate(1.15)}
.iconbtn:active{transform:scale(.92)}
.iconbtn:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.addbtn{align-self:flex-start;display:inline-flex;align-items:center;gap:8px;border:1px dashed var(--cyan);background:rgba(230,196,120,.06);cursor:pointer;color:var(--cyan);font-family:var(--f-body);font-weight:700;font-size:.9rem;padding:9px 15px;border-radius:11px;transition:.22s}
.addbtn .p{width:22px;height:22px;display:grid;place-items:center;border-radius:7px;background:var(--btn-grad);color:var(--btn-ink);font-size:1.05rem;line-height:1}
.addbtn:hover{background:rgba(230,196,120,.13);transform:translateY(-2px)}
.addbtn:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.seg{display:inline-flex;background:var(--field);border:1px solid var(--line);border-radius:12px;padding:4px;gap:4px}
.seg button{border:0;background:transparent;cursor:pointer;color:var(--muted);font-family:var(--f-body);font-weight:700;font-size:.93rem;padding:8px 22px;border-radius:9px;transition:.22s}
.seg button[aria-pressed="true"]{color:var(--btn-ink);background:var(--btn-grad);text-shadow:var(--btn-sh);box-shadow:var(--glow) rgba(224,184,106,.45)}
.seg button:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.tonewrap{display:flex;flex-wrap:wrap;gap:8px}
.pill{border:1px solid var(--line);background:var(--field-2);cursor:pointer;color:var(--text);font-family:var(--f-body);font-weight:600;font-size:.9rem;padding:7px 14px;border-radius:999px;transition:.2s}
.pill:hover{border-color:var(--line-2);transform:translateY(-2px)}
.pill[aria-pressed="true"]{border-color:transparent;background:var(--btn-grad);color:var(--btn-ink);text-shadow:var(--btn-sh);box-shadow:var(--glow) rgba(224,184,106,.45)}
.pill:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.moretoggle{display:flex;align-items:center;gap:11px;flex-wrap:wrap;width:100%;margin-top:13px;border:1px dashed var(--line-2);background:var(--field-2);cursor:pointer;color:var(--text);font-family:var(--f-body);font-weight:700;font-size:.97rem;padding:13px 16px;border-radius:var(--r-sm);transition:.2s}
.moretoggle:hover{border-color:var(--cyan);background:rgba(230,196,120,.06)}
.moretoggle:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.moretoggle .mt-ic{width:25px;height:25px;flex:none;display:grid;place-items:center;border-radius:8px;background:var(--btn-grad);color:var(--btn-ink);font-size:1.15rem;line-height:1;transition:transform .25s}
.moretoggle.open .mt-ic{transform:rotate(45deg)}
.moretoggle .mt-hint{color:var(--muted);font-weight:500;font-size:.82rem}
#formMore{margin-top:13px}
.actions{display:flex;gap:11px;flex-wrap:wrap;margin-top:24px;align-items:center}
.btn{position:relative;border:0;cursor:pointer;overflow:hidden;font-family:var(--f-body);font-weight:800;font-size:1rem;color:var(--btn-ink);text-shadow:var(--btn-sh);padding:13px 26px;border-radius:13px;background:var(--btn-grad);background-size:200% 200%;box-shadow:var(--glow) rgba(224,184,106,.5),inset 0 1px 0 rgba(255,255,255,.28),inset 0 -3px 6px rgba(0,0,0,.22);transition:transform .22s cubic-bezier(.22,1,.36,1),box-shadow .25s;display:inline-flex;align-items:center;gap:9px;animation:hue 9s ease infinite}
.btn>*{position:relative;z-index:1}
@keyframes hue{0%,100%{background-position:0% 50%}50%{background-position:100% 50%}}
.btn::before{content:"";position:absolute;inset:0;z-index:0;background:linear-gradient(110deg,transparent 20%,rgba(255,255,255,.5) 50%,transparent 80%);transform:translateX(-130%)}
.btn:hover{transform:translateY(-3px);box-shadow:var(--glow) rgba(230,196,120,.55),inset 0 1px 0 rgba(255,255,255,.3),inset 0 -3px 6px rgba(0,0,0,.22)}
.btn:hover::before{animation:shine 1s ease}
@keyframes shine{to{transform:translateX(130%)}}
.btn:active{transform:translateY(0) scale(.99);box-shadow:var(--glow) rgba(224,184,106,.4),inset 0 2px 6px rgba(0,0,0,.3)}
.btn:focus-visible{outline:2px solid var(--cyan);outline-offset:3px}
.btn.ghost{background:var(--field);color:var(--text);text-shadow:none;box-shadow:none;border:1px solid var(--line-2);animation:none}
.btn.ghost:hover{background:rgba(190,170,120,.14)}
.btn.small{padding:9px 16px;font-size:.9rem;font-weight:700}
.btn.pdf{background:linear-gradient(120deg,#fb7185,#fbbf24);color:#3a1500;text-shadow:none}
.btn.docx{background:linear-gradient(120deg,#2f8a76,#46b29d);color:#fff;text-shadow:var(--btn-sh)}
.btn[disabled]{opacity:.6;cursor:wait;transform:none}
.spacer{flex:1}
@media (max-width:620px){.btn:not(.small){flex:1;justify-content:center}.spacer{display:none}}
.spark{position:absolute;width:7px;height:7px;border-radius:50%;pointer-events:none}
.term{position:relative;border-radius:var(--r);background:var(--term-bg);border:1px solid var(--line);overflow:hidden;box-shadow:0 20px 50px -30px rgba(0,0,0,.7)}
.term-bar{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--line);background:rgba(200,185,140,.07);font-family:var(--f-mono);font-size:.72rem;letter-spacing:1px;color:var(--muted);text-transform:uppercase}
body.lang-ar .term-bar{font-family:var(--f-body);letter-spacing:0;text-transform:none}
.term-bar .led{width:9px;height:9px;border-radius:50%}
.term textarea{width:100%;min-height:300px;border:0;background:transparent;resize:vertical;font-family:var(--f-mono),"Tajawal";font-size:.9rem;line-height:1.9;color:var(--term-text);padding:14px 16px;white-space:pre-wrap}
.term textarea:focus{outline:0}
body.lang-ar .term textarea{font-family:"Tajawal",monospace;font-size:.96rem}
.toast{position:fixed;inset-inline:0;bottom:24px;margin:auto;width:max-content;max-width:90vw;background:var(--panel-2);color:var(--text);padding:12px 22px;border-radius:999px;font-weight:700;box-shadow:0 20px 50px -18px rgba(0,0,0,.5);opacity:0;transform:translateY(18px);transition:.35s;z-index:90;border:1px solid var(--line-2);backdrop-filter:blur(12px)}
.toast.show{opacity:1;transform:none}
footer{text-align:center;margin-top:30px;color:var(--muted-2);font-size:.82rem;font-family:var(--f-mono);letter-spacing:1px}
body.lang-ar footer{font-family:var(--f-body);letter-spacing:0;font-size:.86rem}
.pdf-host{position:absolute;left:0;top:-10000px;width:794px}
.pdfdoc{width:794px;direction:ltr;background:#fff;color:#1c2140;font-family:"Tajawal",sans-serif;padding:0 0 30px}
.pdfdoc *{box-sizing:border-box;overflow-wrap:anywhere;word-break:break-word}
.pdfdoc .pre{white-space:pre-wrap;overflow-wrap:anywhere;font-family:"Tajawal",monospace;background:#f6f4ff;border-radius:8px;padding:8px 11px;margin-top:4px;font-size:.85rem;line-height:1.6}
.pdfdoc .pcover{background:linear-gradient(120deg,#e6c478,#3fae9a 55%,#d8a981);padding:30px 40px 24px;color:#fff}
.pdfdoc .pcover .ktag{font-size:.72rem;letter-spacing:3px;text-transform:uppercase;opacity:.9;margin:0 0 8px;font-weight:700}
.pdfdoc .pcover h1{font-size:1.7rem;margin:0;color:#fff;font-weight:800;line-height:1.25}
.pdfdoc .badges{margin-top:12px}
.pdfdoc .badge{display:inline-block;background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.55);color:#fff;padding:4px 13px;border-radius:999px;font-size:.8rem;font-weight:700;margin:5px 8px 0 0}
.pdfdoc .body{padding:24px 40px 0}
.pdfdoc .mini{font-size:.7rem;letter-spacing:2px;text-transform:uppercase;color:#b8860b;font-weight:800;margin:0 0 7px}
.pdfdoc .introcard{background:#f5f3ff;border-left:5px solid #3fae9a;border-radius:12px;padding:13px 17px;font-size:.95rem;line-height:1.75;margin-bottom:22px;color:#2a2550}
.pdfdoc.rtl .introcard{border-left:0;border-right:5px solid #3fae9a}
.pdfdoc .sec-title{font-size:1.05rem;font-weight:800;color:#1b1f3b;border-left:4px solid #e6c478;padding-left:12px;margin:0 0 12px}
.pdfdoc.rtl .sec-title{border-left:0;border-right:4px solid #e6c478;padding-left:0;padding-right:12px}
.pdfdoc .tablewrap{border:1px solid #e6e2f5;border-radius:14px;overflow:hidden;margin-bottom:24px}
.pdfdoc table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:.9rem}
.pdfdoc th{background:linear-gradient(120deg,#b8860b,#2f8a76);color:#fff;text-align:left;padding:11px 14px;font-weight:700;font-size:.92rem;overflow-wrap:anywhere}
.pdfdoc.rtl th{text-align:right}
.pdfdoc td{padding:11px 14px;border-top:1px solid #efecf8;vertical-align:top;line-height:1.65;text-align:left;overflow-wrap:anywhere;word-break:break-word}
.pdfdoc.rtl td{text-align:right}
.pdfdoc td.k{font-weight:700;color:#3a2b66;background:#f3f0fc}
.pdfdoc tr.odd td.v{background:#faf9ff}
.pdfdoc ul{margin:3px 0 0;padding-left:18px}
.pdfdoc.rtl ul{padding-left:0;padding-right:18px}
.pdfdoc li{margin-bottom:3px}
.pdfdoc .k2{font-weight:700;color:#3a2b66}
.pdfdoc .note2{margin-top:7px;color:#7c5fb0;font-size:.85rem;background:#f6f1ff;border-radius:8px;padding:6px 11px}
.pdfdoc .ruleswrap{background:#fcfbff;border:1px solid #eee9f7;border-radius:14px;padding:8px 18px}
.pdfdoc .rule{display:flex;gap:11px;align-items:flex-start;padding:8px 0;border-bottom:1px dashed #ece8f7}
.pdfdoc .rule:last-child{border-bottom:0}
.pdfdoc .rn{flex:none;width:25px;height:25px;border-radius:8px;background:linear-gradient(135deg,#e6c478,#3fae9a);color:#fff;font-weight:800;font-size:.78rem;display:flex;align-items:center;justify-content:center}
.pdfdoc .rt{font-size:.88rem;line-height:1.6;color:#2a2c48}
.pdfdoc.rtl .ktag,.pdfdoc.rtl .pcover h1,.pdfdoc.rtl .mini,.pdfdoc.rtl .introcard,.pdfdoc.rtl .sec-title,.pdfdoc.rtl th,.pdfdoc.rtl td,.pdfdoc.rtl .k2,.pdfdoc.rtl li,.pdfdoc.rtl .note2,.pdfdoc.rtl .pre,.pdfdoc.rtl .badges,.pdfdoc.rtl .ruleswrap,.pdfdoc.rtl .rule,.pdfdoc.rtl .rt{direction:rtl;text-align:right}
.pdfdoc.rtl .rule{flex-direction:row-reverse}
.pdfdoc .pfoot{height:7px;background:linear-gradient(120deg,#e6c478,#3fae9a 55%,#d8a981);border-radius:999px;margin:24px 40px 0}
@media screen{#printArea{display:none}}
@media print{html,body{background:#fff !important;margin:0 !important;padding:0 !important}body>*{display:none !important}body>#printArea{display:block !important}#printArea .pdfdoc{width:100% !important;padding-bottom:0 !important}#printArea .pdfdoc,#printArea .pdfdoc *{-webkit-print-color-adjust:exact !important;print-color-adjust:exact !important;color-adjust:exact !important}#printArea .pcover{border-radius:0 !important}#printArea tr,#printArea .rule,#printArea .introcard,#printArea .pcover,#printArea thead{break-inside:avoid}#printArea .pfoot{display:none !important}@page{size:A4;margin:13mm}}
@media (max-width:760px){.wrap{padding:18px 13px 56px}.glass{padding:17px 15px}.row{grid-template-columns:1fr;gap:8px;padding:12px 13px}.stage-l{padding-top:0}.choices{grid-template-columns:1fr 1fr;gap:9px}.corner{display:none}.topbar{justify-content:center;text-align:center;gap:12px}.brand{gap:11px}.mark{width:48px;height:48px}.term textarea{min-height:240px}}
@media (max-width:480px){.glass{padding:15px 13px;border-radius:16px}.choices{grid-template-columns:1fr}.chip{padding:11px 12px}h2.title{font-size:1.3rem}.sub{font-size:.92rem}.creed{font-size:.9rem;padding:12px 14px}.seg button{padding:8px 18px}.btn:not(.small){padding:12px 18px;font-size:.95rem}input[type=text],textarea{font-size:1rem}.term textarea{font-size:.92rem;min-height:220px}}
@media (prefers-reduced-motion:reduce){*{animation:none !important;transition-duration:.001ms !important}}
.kwbox{margin:18px 0 2px}
.kwlab{display:flex;align-items:center;gap:8px;font-weight:800;color:#fbbf24;font-size:.96rem;margin-bottom:9px}
.kwinput{width:100%;font-family:var(--f-body);font-size:1.06rem;font-weight:600;color:var(--text);background:rgba(251,191,36,.07);border:2px solid var(--amber);border-radius:14px;padding:15px 16px;transition:background .2s,border-color .2s;animation:kwpulse 2.1s ease-in-out infinite}
@keyframes kwpulse{0%,100%{box-shadow:0 0 16px -6px rgba(251,191,36,.65);border-color:#f59e0b}50%{box-shadow:0 0 34px -2px rgba(251,191,36,.95);border-color:#fde68a}}
.kwinput::placeholder{color:#b48a2e}
.kwinput:focus{outline:0;animation:none;border-color:#fde68a;background:rgba(251,191,36,.11);box-shadow:0 0 30px -4px rgba(251,191,36,.85)}
body.theme-light .kwlab{color:#b45309}
body.theme-light .kwinput{color:#2a2519;background:rgba(217,119,6,.1);border-color:#d97706}
body.theme-light .kwinput::placeholder{color:#b45309}
.aibox{margin-top:22px;border:1px solid var(--line);background:var(--field-2);border-radius:var(--r-sm);padding:16px 17px}
.aititle{display:flex;align-items:center;gap:9px;margin:0 0 4px;font-weight:800;color:var(--text);font-size:1.02rem}
.aititle [aria-hidden]{color:var(--cyan)}
.aisub{margin:0 0 13px;color:var(--muted);font-size:.9rem;font-weight:500}
.ailist{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
.aisite{display:flex;align-items:center;gap:11px;text-decoration:none;border:1px solid var(--line);background:var(--field);border-radius:12px;padding:11px 13px;transition:transform .2s,box-shadow .25s,border-color .2s}
.aisite:hover{transform:translateY(-3px);border-color:var(--line-2);box-shadow:0 14px 26px -16px rgba(230,196,120,.5),var(--glow) rgba(230,196,120,.25)}
.ai-rank{width:22px;height:22px;flex:none;display:grid;place-items:center;border-radius:7px;background:var(--btn-grad);color:var(--btn-ink);font-family:var(--f-disp);font-weight:700;font-size:.72rem}
.ai-emo{font-size:1.15rem;flex:none}
.ai-meta{display:flex;flex-direction:column;min-width:0;flex:1}
.ai-name{font-weight:800;color:var(--text);font-size:.95rem;line-height:1.2}
.ai-tag{color:var(--muted-2);font-size:.76rem;font-weight:600}
.ai-open{flex:none;color:var(--cyan);font-weight:700;font-size:.82rem;white-space:nowrap}
body.theme-light .ai-open{color:#2f8a76}
/* light-mode color precision & livelier cards */
body.theme-light .chip{background:#fffdf7;border-color:rgba(150,120,50,.16)}
body.theme-light .chip .emo{background:rgba(200,160,70,.13)}
body.theme-light .chip:hover{border-color:rgba(168,128,31,.42);box-shadow:0 18px 30px -16px rgba(200,160,70,.42),0 0 24px -8px rgba(47,138,118,.3)}
body.theme-light .chip[aria-pressed="true"]{background:linear-gradient(120deg,rgba(200,160,70,.16),rgba(47,138,118,.12) 60%,rgba(190,140,80,.12));box-shadow:0 18px 32px -16px rgba(168,128,31,.42)}
body.theme-light .chip[aria-pressed="true"] .emo{background:rgba(200,160,70,.24)}
.ai-sub2{margin:14px 0 9px;font-weight:800;color:var(--text);font-size:.92rem;letter-spacing:.2px}
.ai-sub2:first-child{margin-top:2px}
.aisite.star{border-color:rgba(230,196,120,.45);background:linear-gradient(120deg,rgba(230,196,120,.1),var(--field))}
body.theme-light .aisite.star{border-color:rgba(168,128,31,.4);background:linear-gradient(120deg,rgba(200,160,70,.12),#fffdf7)}
.aisite.star .ai-rank{background:linear-gradient(120deg,#e6c478,#cfa24f);color:#2b2510}
.kwhead{display:flex;align-items:center;gap:6px;margin-bottom:9px}
.kwhead .kwlab{margin:0}
.kwrow{display:flex;align-items:stretch;gap:8px}
.kwrow .kwinput{flex:1}
.micbtn{flex:none;width:50px;border:2px solid var(--amber);border-radius:14px;background:rgba(251,191,36,.1);color:var(--text);font-size:1.15rem;cursor:pointer;transition:.2s;display:grid;place-items:center;font-family:inherit}
.micbtn:hover{background:rgba(251,191,36,.2)}
.micbtn.rec{animation:micpulse 1s infinite;border-color:#ef4444;background:rgba(239,68,68,.18)}
@keyframes micpulse{0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.5)}50%{box-shadow:0 0 0 8px rgba(239,68,68,0)}}
.ctrl .micbtn{width:44px;height:40px;border-radius:12px;margin-top:8px;font-size:1.05rem}
.kwsugg{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:11px}
.kwsugg:empty{display:none}
.ks-lab{color:var(--muted);font-size:.84rem;font-weight:700}
.ksug{border:1px solid var(--line-2);background:var(--field);color:var(--text);border-radius:999px;padding:6px 12px;font-size:.86rem;font-weight:700;cursor:pointer;transition:.2s;font-family:inherit}
.ksug:hover{border-color:var(--amber);background:rgba(251,191,36,.12);transform:translateY(-2px)}
.ksug.on{background:var(--gb);color:#16210a;border-color:transparent}
.pop-ex{margin-top:10px;padding:10px 12px;border-radius:10px;background:rgba(230,196,120,.1);border:1px solid rgba(230,196,120,.28);font-size:.9rem;line-height:1.55;color:var(--text)}
.pex-l{display:block;font-weight:800;color:var(--amber);font-size:.78rem;margin-bottom:4px}
body.theme-light .pex-l{color:#a8801f}
body.theme-light .pop-ex{background:rgba(200,160,70,.12);border-color:rgba(200,160,70,.3)}
.cwrap,.swrap,.drawwrap{margin-top:10px}
.crow{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.cpick{width:46px;height:38px;padding:2px;border:1px solid var(--line-2);border-radius:10px;background:var(--field);cursor:pointer}
.cadd,.duse{border:none;background:var(--gb);color:#16210a;font-weight:800;border-radius:10px;padding:8px 14px;cursor:pointer;font-family:inherit;font-size:.86rem}
.cnames{border:1px solid var(--line-2);background:var(--field);color:var(--text);border-radius:10px;padding:8px 10px;font-family:inherit;font-size:.85rem;cursor:pointer}
.cchips{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}
.cchip{display:inline-flex;align-items:center;gap:6px;background:var(--field);border:1px solid var(--line-2);border-radius:999px;padding:4px 7px 4px 8px;font-size:.82rem;color:var(--text)}
.csw{width:15px;height:15px;border-radius:4px;border:1px solid rgba(0,0,0,.25);display:inline-block;flex:none}
.csw-n{background:repeating-linear-gradient(45deg,#bbb,#bbb 3px,#eee 3px,#eee 6px)}
.cct{font-weight:700;font-variant-numeric:tabular-nums}
.cx{border:none;background:transparent;color:var(--muted);cursor:pointer;font-size:1rem;line-height:1;padding:0 2px}
.cx:hover{color:#ef4444}
.stiles{display:flex;flex-wrap:wrap;gap:9px}
.stile{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:5px;background:var(--field);border:1px solid var(--line-2);border-radius:10px;padding:9px 7px 7px;min-width:50px;min-height:54px;cursor:pointer;transition:.18s;font-family:inherit}
.stile:hover{border-color:var(--amber);transform:translateY(-2px)}
.stile.on{border-color:transparent;background:rgba(230,196,120,.16);box-shadow:0 0 0 1.5px var(--amber) inset}
.sbox{display:block;background:linear-gradient(135deg,rgba(230,196,120,.55),rgba(63,174,154,.55));border:1px solid var(--line-2);border-radius:3px}
.stile.on .sbox{background:linear-gradient(135deg,#e6c478,#3fae9a)}
.slab2{font-size:.74rem;font-weight:800;color:var(--text);font-variant-numeric:tabular-nums}
.drawbar{display:flex;flex-wrap:wrap;gap:7px;align-items:center;margin-bottom:8px}
.dtool{width:40px;height:38px;border:1px solid var(--line-2);background:var(--field);border-radius:10px;cursor:pointer;font-size:1.02rem;display:grid;place-items:center;transition:.18s;font-family:inherit}
.dtool:hover{border-color:var(--amber)}
.dtool.on{border-color:transparent;background:rgba(230,196,120,.18);box-shadow:0 0 0 1.5px var(--amber) inset}
.dcol{width:40px;height:38px;padding:2px;border:1px solid var(--line-2);border-radius:10px;background:var(--field);cursor:pointer}
.duse{margin-inline-start:auto}
.drawcv{display:block;width:100%;height:auto;aspect-ratio:640/380;background:#fff;border:1px solid var(--line-2);border-radius:12px;touch-action:none;cursor:crosshair}
.drawnote{color:var(--muted);font-size:.82rem;margin:8px 2px 0;line-height:1.45}
.tips{margin-top:18px;background:var(--field);border:1px solid var(--line-2);border-radius:16px;padding:15px 18px}
.tips-h{display:flex;align-items:center;gap:8px;font-weight:800;color:var(--text);margin:0 0 10px;font-size:.95rem}
.tips-h span{color:var(--amber)}
.tips-l{margin:0;padding-inline-start:20px;display:flex;flex-direction:column;gap:8px}
.tips-l li{color:var(--muted);font-size:.89rem;line-height:1.5}
.dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-align:center;cursor:pointer;border:2px dashed var(--line-2);border-radius:14px;padding:22px 16px;background:var(--field-2);color:var(--muted);transition:border-color .2s,background .2s,color .2s}
.dropzone:hover{border-color:var(--cyan);color:var(--text);background:rgba(230,196,120,.06)}
.dz-ic{font-size:1.5rem;color:var(--cyan)}
.dz-tx{font-size:.9rem;font-weight:600}
.dz-input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.ups{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.up{position:relative;width:104px;display:flex;flex-direction:column;align-items:center;gap:4px;border:1px solid var(--line);background:var(--field);border-radius:11px;padding:9px 7px}
.up img{width:84px;height:62px;object-fit:cover;border-radius:7px;border:1px solid var(--line)}
.up-file{display:flex;align-items:center;justify-content:center;width:84px;height:62px;font-size:1.9rem;background:var(--field-2);border-radius:7px;border:1px solid var(--line)}
.up-nm{font-size:.72rem;color:var(--text);font-weight:600;max-width:92px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.up-sz{font-size:.66rem;color:var(--muted-2)}
.up-x{position:absolute;top:-7px;inset-inline-end:-7px;width:21px;height:21px;border-radius:50%;border:none;background:#ef4444;color:#fff;font-size:.85rem;font-weight:700;line-height:1;cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,.3)}
.up-x:hover{background:#dc2626}
.pdfdoc .attwrap{margin-top:8px}
.pdfdoc .attimg{margin:12px 0}
.pdfdoc .attimg img{max-width:100%;height:auto;border:1px solid #e6e2f5;border-radius:8px}
.pdfdoc .attcap{font-size:.78rem;color:#7c5fb0;margin-top:4px}
.pdfdoc .attfile{padding:6px 0;font-size:.92rem;color:#5a4a2a}
.pdfdoc .attmeta{color:#9aa1c6;font-size:.82rem}
</style>
</head>
<body class="theme-dark">
<div class="layer l-aurora" id="aurora" aria-hidden="true"></div>
<div class="layer l-grid" aria-hidden="true"><div class="grid-floor"></div><div class="grid-mask"></div></div>
<div class="layer l-dust" id="dust" aria-hidden="true"></div>
<div class="wrap">
<header class="topbar">
<div class="brand">
<svg class="mark" viewBox="0 0 100 100" aria-hidden="true">
<defs><linearGradient id="ng" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#e6c478"/><stop offset=".55" stop-color="#3fae9a"/><stop offset="1" stop-color="#d8a981"/></linearGradient></defs>
<polygon points="50,8 86,29 86,71 50,92 14,71 14,29" fill="none" stroke="url(#ng)" stroke-width="3"/>
<polygon points="50,24 72,37 72,63 50,76 28,63 28,37" fill="none" stroke="url(#ng)" stroke-width="2" opacity=".6"/>
<circle cx="50" cy="50" r="9" fill="url(#ng)"/><circle cx="50" cy="50" r="3.5" fill="#04121a"/>
</svg>
<div>
<h1 class="brand-name" data-i18n="brandName">Prompt Engineer</h1>
<p class="brand-tag" data-i18n="brandTag">Loria Space · Smart Prompt Console</p>
</div>
</div>
<div class="controls">
<button class="iconpill" id="themeBtn" onclick="toggleTheme()" aria-label="theme"></button>
<button class="iconpill danger" id="resetBtn" onclick="resetAll()" aria-label="reset"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6"/></svg></button>
<div class="langsel">
<select id="langSel" onchange="setLang(this.value)" aria-label="language">
<option value="en">English</option>
<option value="ar">العربية</option>
<option value="fr">Français</option>
<option value="it">Italiano</option>
<option value="de">Deutsch</option>
</select>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>
</div>
</div>
</header>
<nav class="steps" aria-label="steps">
<button class="stepbtn active" data-step="1" onclick="goStep(1)"><span class="num">01</span><span class="lbl" data-i18n="stChoose">Choose</span></button>
<button class="stepbtn" data-step="2" onclick="goStep(2)"><span class="num">02</span><span class="lbl" data-i18n="stFill">Fill</span></button>
<button class="stepbtn" data-step="3" onclick="goStep(3)"><span class="num">03</span><span class="lbl" data-i18n="stExport">Export</span></button>
</nav>
<div class="stage">
<span class="corner tl"></span><span class="corner tr"></span><span class="corner bl"></span><span class="corner br"></span>
<section id="step1" class="step show glass">
<p class="eyebrow" data-i18n="eyebrow1">MODULE 01 — OUTPUT TYPE</p>
<div class="titlerow"><div class="lft">
<h2 class="title" data-i18n="q1">What do you want to create?</h2>
<button class="info" data-info="choices" aria-label="info">!</button>
</div></div>
<p class="sub" data-i18n="sub1"></p>
<div class="kwbox"><div class="kwhead"><label class="kwlab" for="kwInput"><span aria-hidden="true">✦</span><span data-i18n="kwLabel">Enter keywords or a line about what you want</span></label><button class="info" type="button" data-info="keywords" aria-label="info">!</button></div><div class="kwrow"><input id="kwInput" class="kwinput" type="text" data-i18n-ph="kwPh" placeholder="" autocomplete="off" oninput="kwPredict()" /><button class="micbtn" type="button" id="kwMic" onclick="voiceInput('kwInput',this)" aria-label="voice" title="🎤">🎤</button></div><div class="kwsugg" id="kwSugg"></div></div>
<div class="choices" id="choices"></div>
<div class="actions"><button class="btn ghost" onclick="smartFillNext()"><span aria-hidden="true">✦</span><span data-i18n="smart">Smart Fill</span></button><span class="spacer"></span><button class="btn" onclick="goStep(2)"><span data-i18n="next">Next</span><span aria-hidden="true">›</span></button></div>
</section>
<section id="step2" class="step glass">
<p class="eyebrow" data-i18n="eyebrow2">MODULE 02 — PROJECT SHEET</p>
<div class="titlerow"><div class="lft"><h2 class="title" data-i18n="q2">Fill the fields you need</h2></div>
<button class="btn ghost small" onclick="smartFill()"><span aria-hidden="true">✦</span><span data-i18n="smart">Smart Fill</span></button>
</div>
<p class="sub" data-i18n="sub2"></p>
<div class="meter" id="meter2"><div class="meter-top"><span data-i18n="strength">Prompt strength</span><span class="mpct" id="mpct2">0%</span></div><div class="mtrack"><div class="mfill" id="mfill2"></div></div><div class="mtip" id="mtip2"></div></div>
<div class="note"><span class="b">◆</span><span data-i18n="optionalNote"></span></div>
<div class="creed"><span class="lab" data-i18n="creedLabel">PROMPT OPENING LINE</span><span id="creedText"></span></div>
<div class="rows" id="form"></div>
<button class="moretoggle" id="moreToggle" type="button" onclick="toggleMore()" aria-expanded="false">
<span class="mt-ic" aria-hidden="true">+</span><span data-i18n="more">More details (optional)</span><span class="mt-hint" data-i18n="moreHint"></span>
</button>
<div class="rows" id="formMore" hidden></div>
<div class="actions"><button class="btn ghost" onclick="goStep(1)"><span aria-hidden="true">‹</span><span data-i18n="back">Back</span></button><span class="spacer"></span><button class="btn" onclick="toStep3()"><span aria-hidden="true">⟐</span><span data-i18n="gen">Generate</span></button></div>
</section>
<section id="step3" class="step glass">
<p class="eyebrow" data-i18n="eyebrow3">MODULE 03 — EXPORT</p>
<h2 class="title" data-i18n="q3">Your prompt is ready</h2>
<p class="sub" data-i18n="sub3"></p>
<div class="meter" id="meter3"><div class="meter-top"><span data-i18n="strength">Prompt strength</span><span class="mpct" id="mpct3">0%</span></div><div class="mtrack"><div class="mfill" id="mfill3"></div></div><div class="mtip" id="mtip3"></div></div>
<div class="term"><div class="term-bar"><span class="led" style="background:#fb7185"></span><span class="led" style="background:#fbbf24"></span><span class="led" style="background:#34d399"></span><span style="margin-inline-start:6px" data-i18n="preview">PROMPT PREVIEW</span></div><textarea id="output" spellcheck="false" aria-label="prompt"></textarea></div>
<div class="actions"><button class="btn ghost" onclick="goStep(2)"><span aria-hidden="true">‹</span><span data-i18n="edit">Edit</span></button><button class="btn ghost" onclick="copyOut(this)"><span aria-hidden="true">⧉</span><span class="ctxt" data-i18n="copy">Copy</span></button><span class="spacer"></span><button class="btn pdf" onclick="exportPDF(this)"><span aria-hidden="true">⤓</span><span data-i18n="pdf">Download PDF</span></button><button class="btn docx" id="btnDocx" onclick="exportDOCX(this)"><span aria-hidden="true">⤓</span><span data-i18n="docx">Download DOCX</span></button><button class="btn ghost" onclick="exportHTML(this)"><span aria-hidden="true">⤓</span><span data-i18n="htmlBtn">Download HTML</span></button></div>
<div class="aibox"><p class="aititle"><span aria-hidden="true">◇</span><span data-i18n="aiTitle">Paste your prompt into a powerful AI</span></p><p class="aisub" data-i18n="aiSub"></p><div class="ailist" id="aiSites"></div></div><div class="tips" id="tipsBox"></div>
</section>
</div>
<footer><span data-i18n="foot">By Loria Space · Prepared by Hamza LAHSSINI</span></footer>
</div>
<div id="pop" role="dialog" aria-live="polite"></div>
<div class="toast" id="toast"></div>
<div class="pdf-host" id="pdfHost" aria-hidden="true"></div>
<div id="printArea" aria-hidden="true"></div>
<script>
let lang="en";
const selected=new Set();
const store={ok:true,get(k){if(!this.ok)return null;try{return localStorage.getItem(k);}catch(e){this.ok=false;return null;}},set(k,v){if(!this.ok)return;try{localStorage.setItem(k,v);}catch(e){this.ok=false;}},del(k){if(!this.ok)return;try{localStorage.removeItem(k);}catch(e){this.ok=false;}}};
const UI={
en:{brandName:"Prompt Engineer",brandTag:"Loria Space · Smart Prompt Console",langName:"English",themeLight:"Day mode",themeDark:"Night mode",reset:"Clear memory",stChoose:"Choose",stFill:"Fill",stExport:"Export",eyebrow1:"MODULE 01 — OUTPUT TYPE",eyebrow2:"MODULE 02 — PROJECT SHEET",eyebrow3:"MODULE 03 — EXPORT",q1:"What do you want to create?",sub1:"Pick one or more cards — tap to light them up, then 'Smart Fill'.",infoChoices:"Tap what you want the AI to make. You can pick several. e.g. an image + a file? Enable both.",smart:"Smart Fill",manual:"Fill manually",next:"Next",q2:"Fill the fields you need",sub2:"Each field has a (!) explaining what to write — as simply as possible.",strength:"Prompt strength",optionalNote:"If you don't need a field, leave it empty — it won't appear in the output.",creedLabel:"PROMPT OPENING LINE",more:"More details (optional)",moreHint:"Not required — 'Smart Fill' fills them for you",back:"Back",gen:"Generate",q3:"Your prompt is ready",sub3:"Export it as DOCX, or as PDF via the print window (choose 'Save as PDF') — then attach it to any AI, or copy the text.",preview:"PROMPT PREVIEW",edit:"Edit",copy:"Copy",copied:"Copied ✓",pdf:"Download PDF",docx:"Download DOCX",foot:"By Loria Space · Prepared by Hamza LAHSSINI",intro:"As an AI, you must follow the steps described in this file (in the attached format) and give me exactly what I want, with no additions or omissions, while respecting the following requirements:",wantLabel:"What I want to create:",detailsHeader:"Request details:",rulesHeader:"Mandatory rules (apply to this request and to every output):",colStage:"Item",colDetail:"Details",yes:"Yes",no:"No",attachNote:"I will attach files to this request; analyse them with great care and use them fully.",refLabel:"Previous model/reference (browse the link or analyse the attachment carefully, draw inspiration without copying):",secretLabel:"Keys / code to integrate:",secretNote:"Integrate the above at the correct place in the result exactly as is, without modifying it or revealing it in the explanation or outside its place.",add:"Add",del:"Delete",optional:"optional",docTitleFallback:"Request addressed to the AI",docTag:"AI prompt brief",popTitle:"Simple explanation",tCopy:"Prompt copied ✓",tEmpty:"Add some details first ◆",tFillOk:"Smart Fill done — review and adjust ✦",tPickType:"Choose your request type first, then 'Smart Fill' ◆",tDocx:"Preparing DOCX…",tDocxOk:"DOCX downloaded ✓",tLibDocx:"Couldn't load the DOCX library — check your connection.",tPrintHint:"The print window opens — choose 'Save as PDF' then save.",tReset:"Memory cleared — fresh start ✓",resetConfirm:"Clear all fields and saved memory and start over?",mLow:"Add the idea and expected result for the best output.",mMid:"Good — add the audience and tone for more precision.",mHigh:"Excellent — a complete, clear prompt!"},
ar:{brandName:"مهندس البرومبت",brandTag:"فضاء لوريا · واجهة صياغة ذكية",langName:"العربية",themeLight:"الوضع النهاري",themeDark:"الوضع الليلي",reset:"مسح الذاكرة",stChoose:"اختر",stFill:"املأ",stExport:"صدّر",eyebrow1:"الوحدة 01 — نوع المخرج",eyebrow2:"الوحدة 02 — بطاقة المشروع",eyebrow3:"الوحدة 03 — التصدير",q1:"ماذا تريد أن تصنع؟",sub1:"اختر بطاقة أو أكثر — اضغط عليها لتُضيء، ثم «ملء ذكي».",infoChoices:"اضغط على ما تريد أن ينجزه لك الذكاء الاصطناعي. يمكنك اختيار أكثر من بطاقة. مثال: صورة + ملف؟ فعّل الاثنين.",smart:"ملء ذكي",manual:"املأ يدوياً",next:"التالي",q2:"املأ الحقول التي تحتاجها",sub2:"بجانب كل حقل علامة (!) تشرح لك ماذا تكتب بأبسط طريقة.",strength:"قوة البرومبت",optionalNote:"إن لم تكن تحتاج حقلاً، اتركه فارغاً — لن يظهر في الناتج.",creedLabel:"السطر الافتتاحي للبرومبت",more:"تفاصيل إضافية (اختياري)",moreHint:"ليست ضرورية — «الملء الذكي» يملؤها عنك",back:"رجوع",gen:"توليد البرومبت",q3:"برومبتك جاهز",sub3:"صدّره DOCX جاهزاً، أو PDF عبر نافذة الطباعة (اختر «حفظ كـ PDF») — ثم أرفقه في أي ذكاء اصطناعي، أو انسخ النص.",preview:"معاينة البرومبت",edit:"تعديل",copy:"نسخ",copied:"تم النسخ ✓",pdf:"تحميل PDF",docx:"تحميل DOCX",foot:"من إنجاز فضاء لوريا · إعداد: حمزة لحسيني",intro:"بصفتك ذكاءً اصطناعياً، يجب عليك اتباع الخطوات الموضحة في هذا الملف (بالصيغة المرفقة) وتزويدي بما أريده بالضبط، دون أي إضافات أو حذف، مع مراعاة المتطلبات التالية:",wantLabel:"ما أريد إنشاءه:",detailsHeader:"تفاصيل الطلب:",rulesHeader:"الضوابط الإلزامية (تنطبق على هذا الطلب وعلى كل مخرَج):",colStage:"المرحلة",colDetail:"التفاصيل",yes:"نعم",no:"لا",attachNote:"سأرفق ملفات مع هذا الطلب؛ حلّلها بدقة عالية ووظّفها بالكامل.",refLabel:"نموذج/مرجع سابق (تصفّح الرابط أو حلّل المرفق بدقة، واستلهم منه دون نسخ):",secretLabel:"مفاتيح/أكواد للدمج:",secretNote:"ادمج ما سبق في الموضع الصحيح من النتيجة كما هو تماماً دون تعديله، ولا تكشفه ضمن الشرح أو خارج موضعه.",add:"إضافة",del:"حذف",optional:"اختياري",docTitleFallback:"طلب موجّه إلى الذكاء الاصطناعي",docTag:"ملف توجيه للذكاء الاصطناعي",popTitle:"شرح مبسّط",tCopy:"تم نسخ البرومبت ✓",tEmpty:"أضف بعض التفاصيل أولاً ◆",tFillOk:"تم الملء الذكي — راجع الحقول وعدّلها ✦",tPickType:"اختر نوع طلبك أولاً ثم «ملء ذكي» ◆",tDocx:"جارٍ تجهيز DOCX…",tDocxOk:"تم تحميل DOCX ✓",tLibDocx:"تعذّر تحميل مكتبة DOCX — تحقّق من اتصالك.",tPrintHint:"تُفتح نافذة الطباعة — اختر «حفظ كـ PDF» ثم احفظ.",tReset:"تم مسح الذاكرة — بدأنا من جديد ✓",resetConfirm:"هل تريد مسح كل الحقول والذاكرة المحفوظة والبدء من جديد؟",mLow:"أضف الفكرة والنتيجة المنتظرة لأفضل نتيجة.",mMid:"جيّد — أضف الجمهور والأسلوب لمزيد من الدقة.",mHigh:"ممتاز — برومبت شامل وواضح!"},
fr:{brandName:"Prompt Engineer",brandTag:"Loria Space · Console de prompts intelligente",langName:"Français",themeLight:"Mode jour",themeDark:"Mode nuit",reset:"Effacer la mémoire",stChoose:"Choisir",stFill:"Remplir",stExport:"Exporter",eyebrow1:"MODULE 01 — TYPE DE SORTIE",eyebrow2:"MODULE 02 — FICHE PROJET",eyebrow3:"MODULE 03 — EXPORT",q1:"Que voulez-vous créer ?",sub1:"Choisissez une ou plusieurs cartes — cliquez pour les activer, puis « Remplissage intelligent ».",infoChoices:"Cliquez sur ce que l'IA doit réaliser. Vous pouvez en choisir plusieurs. Ex. : une image + un fichier ? Activez les deux.",smart:"Remplissage intelligent",manual:"Remplir manuellement",next:"Suivant",q2:"Remplissez les champs utiles",sub2:"Chaque champ a un (!) expliquant quoi écrire, le plus simplement possible.",strength:"Force du prompt",optionalNote:"Si un champ ne vous sert pas, laissez-le vide — il n'apparaîtra pas.",creedLabel:"LIGNE D'OUVERTURE DU PROMPT",more:"Plus de détails (optionnel)",moreHint:"Pas obligatoire — le « Remplissage intelligent » s'en charge",back:"Retour",gen:"Générer",q3:"Votre prompt est prêt",sub3:"Exportez-le en DOCX, ou en PDF via la fenêtre d'impression (« Enregistrer au format PDF ») — puis joignez-le à votre IA, ou copiez le texte.",preview:"APERÇU DU PROMPT",edit:"Modifier",copy:"Copier",copied:"Copié ✓",pdf:"Télécharger PDF",docx:"Télécharger DOCX",foot:"Par Loria Space · Préparé par Hamza LAHSSINI",intro:"En tant qu'IA, vous devez suivre les étapes décrites dans ce fichier (au format ci-joint) et me fournir exactement ce que je demande, sans aucun ajout ni suppression, en respectant les exigences suivantes :",wantLabel:"Ce que je veux créer :",detailsHeader:"Détails de la demande :",rulesHeader:"Règles impératives (valables pour cette demande et tout livrable) :",colStage:"Élément",colDetail:"Détails",yes:"Oui",no:"Non",attachNote:"Je joindrai des fichiers à cette demande ; analysez-les avec soin et exploitez-les pleinement.",refLabel:"Modèle/référence (consultez le lien ou analysez la pièce jointe avec soin, inspirez-vous sans copier) :",secretLabel:"Clés/codes à intégrer :",secretNote:"Intégrez ce qui précède au bon endroit dans le résultat, tel quel et sans le modifier, sans le révéler dans les explications ni hors de son emplacement.",add:"Ajouter",del:"Supprimer",optional:"optionnel",docTitleFallback:"Demande adressée à l'IA",docTag:"Brief de prompt pour l'IA",popTitle:"Explication simple",tCopy:"Prompt copié ✓",tEmpty:"Ajoutez d'abord quelques détails ◆",tFillOk:"Remplissage effectué — vérifiez et ajustez ✦",tPickType:"Choisissez d'abord le type, puis « Remplissage intelligent » ◆",tDocx:"Préparation du DOCX…",tDocxOk:"DOCX téléchargé ✓",tLibDocx:"Échec du chargement de la librairie DOCX — vérifiez votre connexion.",tPrintHint:"La fenêtre d'impression s'ouvre — choisissez « Enregistrer au format PDF » puis enregistrez.",tReset:"Mémoire effacée — nouveau départ ✓",resetConfirm:"Effacer tous les champs et la mémoire enregistrée, et recommencer ?",mLow:"Ajoutez l'idée et le résultat attendu pour un meilleur résultat.",mMid:"Bien — ajoutez le public et le ton pour plus de précision.",mHigh:"Excellent — un prompt complet et clair !"},
it:{brandName:"Prompt Engineer",brandTag:"Loria Space · Console intelligente per prompt",langName:"Italiano",themeLight:"Modalità giorno",themeDark:"Modalità notte",reset:"Cancella memoria",stChoose:"Scegli",stFill:"Compila",stExport:"Esporta",eyebrow1:"MODULO 01 — TIPO DI OUTPUT",eyebrow2:"MODULO 02 — SCHEDA PROGETTO",eyebrow3:"MODULO 03 — ESPORTA",q1:"Cosa vuoi creare?",sub1:"Scegli una o più schede — toccale per attivarle, poi « Compilazione intelligente ».",infoChoices:"Tocca ciò che l'IA deve creare. Puoi sceglierne più di una. Es.: un'immagine + un file? Attiva entrambe.",smart:"Compilazione intelligente",manual:"Compila manualmente",next:"Avanti",q2:"Compila i campi che ti servono",sub2:"Ogni campo ha un (!) che spiega cosa scrivere, nel modo più semplice.",strength:"Forza del prompt",optionalNote:"Se un campo non ti serve, lascialo vuoto — non comparirà nel risultato.",creedLabel:"RIGA DI APERTURA DEL PROMPT",more:"Altri dettagli (facoltativo)",moreHint:"Non obbligatori — la « Compilazione intelligente » li riempie per te",back:"Indietro",gen:"Genera",q3:"Il tuo prompt è pronto",sub3:"Esportalo in DOCX, o in PDF tramite la finestra di stampa (« Salva come PDF ») — poi allegalo a qualsiasi IA, o copia il testo.",preview:"ANTEPRIMA DEL PROMPT",edit:"Modifica",copy:"Copia",copied:"Copiato ✓",pdf:"Scarica PDF",docx:"Scarica DOCX",foot:"Di Loria Space · A cura di Hamza LAHSSINI",intro:"In quanto IA, devi seguire i passaggi descritti in questo file (nel formato allegato) e fornirmi esattamente ciò che voglio, senza aggiunte né omissioni, rispettando i seguenti requisiti:",wantLabel:"Ciò che voglio creare:",detailsHeader:"Dettagli della richiesta:",rulesHeader:"Regole obbligatorie (valide per questa richiesta e per ogni risultato):",colStage:"Voce",colDetail:"Dettagli",yes:"Sì",no:"No",attachNote:"Allegherò dei file a questa richiesta; analizzali con grande cura e usali appieno.",refLabel:"Modello/riferimento (apri il link o analizza l'allegato con cura, ispìrati senza copiare):",secretLabel:"Chiavi/codici da integrare:",secretNote:"Integra quanto sopra nel punto giusto del risultato esattamente com'è, senza modificarlo né rivelarlo nelle spiegazioni o fuori dal suo posto.",add:"Aggiungi",del:"Elimina",optional:"facoltativo",docTitleFallback:"Richiesta rivolta all'IA",docTag:"Brief del prompt per l'IA",popTitle:"Spiegazione semplice",tCopy:"Prompt copiato ✓",tEmpty:"Aggiungi prima alcuni dettagli ◆",tFillOk:"Compilazione eseguita — controlla e modifica ✦",tPickType:"Scegli prima il tipo, poi « Compilazione intelligente » ◆",tDocx:"Preparazione del DOCX…",tDocxOk:"DOCX scaricato ✓",tLibDocx:"Impossibile caricare la libreria DOCX — controlla la connessione.",tPrintHint:"Si apre la finestra di stampa — scegli « Salva come PDF » poi salva.",tReset:"Memoria cancellata — nuovo inizio ✓",resetConfirm:"Cancellare tutti i campi e la memoria salvata e ricominciare?",mLow:"Aggiungi l'idea e il risultato atteso per un risultato migliore.",mMid:"Bene — aggiungi il pubblico e il tono per maggiore precisione.",mHigh:"Eccellente — un prompt completo e chiaro!"},
de:{brandName:"Prompt Engineer",brandTag:"Loria Space · Intelligente Prompt-Konsole",langName:"Deutsch",themeLight:"Tagmodus",themeDark:"Nachtmodus",reset:"Speicher löschen",stChoose:"Wählen",stFill:"Ausfüllen",stExport:"Exportieren",eyebrow1:"MODUL 01 — AUSGABETYP",eyebrow2:"MODUL 02 — PROJEKTBLATT",eyebrow3:"MODUL 03 — EXPORT",q1:"Was möchtest du erstellen?",sub1:"Wähle eine oder mehrere Karten — tippe sie an, dann „Intelligent ausfüllen“.",infoChoices:"Tippe an, was die KI erstellen soll. Du kannst mehrere wählen. Z. B. ein Bild + eine Datei? Beide aktivieren.",smart:"Intelligent ausfüllen",manual:"Manuell ausfüllen",next:"Weiter",q2:"Fülle die benötigten Felder aus",sub2:"Jedes Feld hat ein (!), das so einfach wie möglich erklärt, was zu schreiben ist.",strength:"Prompt-Stärke",optionalNote:"Wenn du ein Feld nicht brauchst, lass es leer — es erscheint nicht im Ergebnis.",creedLabel:"EINLEITUNGSZEILE DES PROMPTS",more:"Weitere Details (optional)",moreHint:"Nicht erforderlich — „Intelligent ausfüllen“ erledigt das für dich",back:"Zurück",gen:"Generieren",q3:"Dein Prompt ist fertig",sub3:"Exportiere ihn als DOCX, oder als PDF über das Druckfenster („Als PDF speichern“) — und hänge ihn an jede KI an, oder kopiere den Text.",preview:"PROMPT-VORSCHAU",edit:"Bearbeiten",copy:"Kopieren",copied:"Kopiert ✓",pdf:"PDF herunterladen",docx:"DOCX herunterladen",foot:"Von Loria Space · Erstellt von Hamza LAHSSINI",intro:"Als KI musst du die in dieser Datei beschriebenen Schritte (im beigefügten Format) befolgen und mir genau das liefern, was ich möchte, ohne Hinzufügungen oder Auslassungen, unter Beachtung der folgenden Anforderungen:",wantLabel:"Was ich erstellen möchte:",detailsHeader:"Details der Anfrage:",rulesHeader:"Verbindliche Regeln (gelten für diese Anfrage und für jedes Ergebnis):",colStage:"Punkt",colDetail:"Details",yes:"Ja",no:"Nein",attachNote:"Ich werde dieser Anfrage Dateien beifügen; analysiere sie sehr sorgfältig und nutze sie vollständig.",refLabel:"Vorlage/Referenz (öffne den Link oder analysiere den Anhang sorgfältig, lass dich inspirieren ohne zu kopieren):",secretLabel:"Schlüssel/Code zum Einbinden:",secretNote:"Binde das Obige genau wie es ist an der richtigen Stelle im Ergebnis ein, ohne es zu ändern oder in der Erklärung bzw. außerhalb seines Platzes preiszugeben.",add:"Hinzufügen",del:"Löschen",optional:"optional",docTitleFallback:"An die KI gerichtete Anfrage",docTag:"KI-Prompt-Brief",popTitle:"Einfache Erklärung",tCopy:"Prompt kopiert ✓",tEmpty:"Füge zuerst einige Details hinzu ◆",tFillOk:"Ausfüllen erledigt — prüfen und anpassen ✦",tPickType:"Wähle zuerst den Anfragetyp, dann „Intelligent ausfüllen“ ◆",tDocx:"DOCX wird vorbereitet…",tDocxOk:"DOCX heruntergeladen ✓",tLibDocx:"DOCX-Bibliothek konnte nicht geladen werden — prüfe deine Verbindung.",tPrintHint:"Das Druckfenster öffnet sich — wähle „Als PDF speichern“ und speichere.",tReset:"Speicher gelöscht — Neustart ✓",resetConfirm:"Alle Felder und den gespeicherten Speicher löschen und neu beginnen?",mLow:"Füge die Idee und das erwartete Ergebnis für das beste Resultat hinzu.",mMid:"Gut — füge Zielgruppe und Ton für mehr Präzision hinzu.",mHigh:"Ausgezeichnet — ein vollständiger, klarer Prompt!"}
};
const CHOICES=[
{id:"text",emo:"📝",label:{en:"Plain text",ar:"نص عادي",fr:"Texte simple",it:"Testo semplice",de:"Einfacher Text"}},
{id:"consult",emo:"🧭",label:{en:"Specialised consultation",ar:"استشارة متخصصة",fr:"Consultation spécialisée",it:"Consulenza specializzata",de:"Fachberatung"}},
{id:"code",emo:"💻",label:{en:"Code",ar:"كود برمجي",fr:"Code",it:"Codice",de:"Code"}},
{id:"website",emo:"🌍",label:{en:"Full website",ar:"موقع إلكتروني كامل",fr:"Site web complet",it:"Sito web completo",de:"Komplette Website"}},
{id:"webapp",emo:"🖥️",label:{en:"Web app",ar:"تطبيق ويب",fr:"Application web",it:"App web",de:"Web-App"}},
{id:"mobileapp",emo:"📱",label:{en:"Mobile app",ar:"تطبيق هاتف",fr:"Application mobile",it:"App mobile",de:"Mobile App"}},
{id:"dash",emo:"📊",label:{en:"Dashboard",ar:"لوحة تحكم",fr:"Tableau de bord",it:"Dashboard",de:"Dashboard"}},
{id:"service",emo:"🔎",label:{en:"Service / information",ar:"خدمة أو معرفة",fr:"Service / information",it:"Servizio / informazione",de:"Service / Information"}},
{id:"image",emo:"🖼️",label:{en:"Image",ar:"صورة",fr:"Image",it:"Immagine",de:"Bild"}},
{id:"logo",emo:"✒️",label:{en:"Logo",ar:"شعار",fr:"Logo",it:"Logo",de:"Logo"}},
{id:"slides",emo:"📑",label:{en:"Presentation",ar:"عرض تقديمي",fr:"Présentation",it:"Presentazione",de:"Präsentation"}},
{id:"social",emo:"📣",label:{en:"Social media post",ar:"منشور تواصل اجتماعي",fr:"Post réseaux sociaux",it:"Post social",de:"Social-Media-Post"}},
{id:"file",emo:"📄",label:{en:"File (PDF/DOCX…)",ar:"ملف (PDF/DOCX…)",fr:"Fichier (PDF/DOCX…)",it:"File (PDF/DOCX…)",de:"Datei (PDF/DOCX…)"}},
{id:"video",emo:"🎬",label:{en:"Video",ar:"فيديو",fr:"Vidéo",it:"Video",de:"Video"}},
{id:"audio",emo:"🎧",label:{en:"Audio",ar:"صوتيات",fr:"Audio",it:"Audio",de:"Audio"}},
{id:"convert",emo:"🔄",label:{en:"Format conversion",ar:"تحويل صيغة",fr:"Conversion de format",it:"Conversione di formato",de:"Formatkonvertierung"}},
{id:"trans",emo:"🌐",label:{en:"Specialised translation",ar:"ترجمة متخصصة",fr:"Traduction spécialisée",it:"Traduzione specializzata",de:"Fachübersetzung"}},
{id:"auto",emo:"⚙️",label:{en:"Automation (JSON)",ar:"أتمتة (JSON)",fr:"Automatisation (JSON)",it:"Automazione (JSON)",de:"Automatisierung (JSON)"}},
{id:"fromfile",emo:"📎",label:{en:"Answer from files",ar:"إجابة من ملفات",fr:"Réponse via fichiers",it:"Risposta dai file",de:"Antwort aus Dateien"}},
{id:"learn",emo:"🚀",label:{en:"Learn a field fast",ar:"تعلّم مجال بسرعة",fr:"Apprendre vite",it:"Imparare in fretta",de:"Schnell lernen"}},
{id:"song",emo:"🎵",label:{en:"Custom song",ar:"أغنية مخصصة",fr:"Chanson personnalisée",it:"Canzone personalizzata",de:"Eigener Song"}},
{id:"invent",emo:"💡",label:{en:"Invent something",ar:"اختراع شيء",fr:"Inventer",it:"Inventare",de:"Etwas erfinden"}},
{id:"other",emo:"✨",label:{en:"Something else",ar:"شيء آخر مخصص",fr:"Autre",it:"Altro",de:"Etwas anderes"}}
];
const FIELDS=[
{type:"textarea",id:"idea",voice:true,label:{en:"Idea",ar:"الفكرة",fr:"L'idée",it:"L'idea",de:"Die Idee"},ph:{en:"Explain your idea clearly…",ar:"اشرح فكرتك بوضوح…",fr:"Expliquez votre idée…",it:"Spiega la tua idea…",de:"Erkläre deine Idee…"},info:{en:"Describe exactly what you want, in plain words: the goal, the problem it solves, and any must-haves. Example: 'A landing page that turns visitors into newsletter subscribers, with a clear headline and one sign-up form.' The clearer you are, the closer the AI gets.",ar:"صف بالضبط ما تريد بكلمات بسيطة: الهدف، والمشكلة التي يحلّها، وأي شروط أساسية. مثال: «صفحة هبوط تحوّل الزوّار إلى مشتركين في النشرة، بعنوان واضح ونموذج اشتراك واحد». كلما زاد وضوحك اقترب الذكاء مما تريد.",fr:"Décrivez exactement ce que vous voulez, simplement : l'objectif, le problème résolu et les indispensables. Exemple : « Une page d'atterrissage qui transforme les visiteurs en abonnés, avec un titre clair et un seul formulaire ». Plus c'est clair, mieux c'est.",it:"Descrivi esattamente ciò che vuoi, in parole semplici: l'obiettivo, il problema da risolvere e gli elementi indispensabili. Esempio: « Una landing page che trasforma i visitatori in iscritti, con un titolo chiaro e un solo modulo ». Più sei chiaro, meglio è.",de:"Beschreibe genau, was du willst, in einfachen Worten: das Ziel, das gelöste Problem und alle Must-haves. Beispiel: „Eine Landingpage, die Besucher in Abonnenten verwandelt, mit klarer Überschrift und einem Anmeldeformular.“ Je klarer, desto besser."}},
{type:"text",id:"role",label:{en:"Role",ar:"الدور",fr:"Le rôle",it:"Il ruolo",de:"Die Rolle"},ph:{en:"e.g. Act as an expert in…",ar:"مثال: تصرّف كخبير في…",fr:"Ex : Agissez en expert en…",it:"Es.: Agisci da esperto in…",de:"z. B. Handle als Experte für…"},info:{en:"Tell the AI who to be, so it answers like a specialist. Be specific: not just 'expert', but 'a senior UX designer' or 'a tax accountant with 10 years' experience'. Example: 'Act as a professional copywriter specialised in tech brands.' This sharply raises quality.",ar:"أخبر الذكاء بمن يكون ليجيب كأخصّائي. كن محدّداً: ليس «خبير» فقط، بل «مصمّم تجربة مستخدم محترف» أو «محاسب ضرائب بخبرة 10 سنوات». مثال: «تصرّف ككاتب إعلاني محترف متخصّص في العلامات التقنية». هذا يرفع الجودة كثيراً.",fr:"Dites à l'IA qui elle est, pour qu'elle réponde comme une spécialiste. Soyez précis : pas juste « expert », mais « designer UX senior » ou « comptable fiscaliste avec 10 ans d'expérience ». Exemple : « Agissez en rédacteur publicitaire spécialisé dans les marques tech ». La qualité grimpe nettement.",it:"Di' all'IA chi è, così risponde come una specialista. Sii preciso: non solo « esperto », ma « UX designer senior » o « commercialista con 10 anni di esperienza ». Esempio: « Agisci da copywriter specializzato in brand tech ». La qualità sale molto.",de:"Sag der KI, wer sie ist, damit sie wie ein Spezialist antwortet. Sei konkret: nicht nur „Experte“, sondern „Senior-UX-Designer“ oder „Steuerberater mit 10 Jahren Erfahrung“. Beispiel: „Handle als Werbetexter für Tech-Marken.“ Das hebt die Qualität deutlich."}},
{type:"text",id:"title",label:{en:"Project name / title",ar:"اسم أو عنوان المشروع",fr:"Nom / titre du projet",it:"Nome / titolo del progetto",de:"Projektname / Titel"},ph:{en:"A clear title",ar:"عنوان واضح",fr:"Un titre clair",it:"Un titolo chiaro",de:"Ein klarer Titel"},info:{en:"An optional name or label for your work, used as the file name and heading. Example: 'Sunrise Café — Website' or 'Q3 Marketing Plan'. Leave it empty if you don't have one.",ar:"اسم أو عنوان اختياري لعملك، يُستخدم كاسم الملف وكعنوان رئيسي. مثال: «مقهى الشروق — موقع» أو «خطة تسويق الربع الثالث». اتركه فارغاً إن لم يكن لديك.",fr:"Un nom ou libellé facultatif pour votre travail, utilisé comme nom de fichier et titre. Exemple : « Café Soleil — Site web » ou « Plan marketing T3 ». Laissez vide si vous n'en avez pas.",it:"Un nome o etichetta facoltativi per il tuo lavoro, usati come nome file e titolo. Esempio: « Caffè Alba — Sito web » o « Piano marketing Q3 ». Lascia vuoto se non ne hai uno.",de:"Ein optionaler Name oder Titel für deine Arbeit, verwendet als Dateiname und Überschrift. Beispiel: „Café Sonnenaufgang — Website“ oder „Q3-Marketingplan“. Leer lassen, falls keiner."}},
{type:"list",id:"features",label:{en:"Features",ar:"المميزات",fr:"Caractéristiques",it:"Caratteristiche",de:"Funktionen"},ph:{en:"Write a feature…",ar:"اكتب ميزة…",fr:"Une caractéristique…",it:"Una caratteristica…",de:"Eine Funktion…"},info:{en:"The concrete things the result must include — add each one with '+'. Example for a website: 'a contact form', 'a photo gallery', 'a price list', 'a WhatsApp button'. Each item you add makes the output more complete.",ar:"العناصر الملموسة التي يجب أن يحتويها الناتج — أضف كل واحدة بزر «+». مثال لموقع: «نموذج تواصل»، «معرض صور»، «قائمة أسعار»، «زر واتساب». كل عنصر تضيفه يجعل الناتج أكثر اكتمالاً.",fr:"Les éléments concrets que le résultat doit inclure — ajoutez-les un à un avec « + ». Exemple pour un site : « un formulaire de contact », « une galerie photo », « une liste de prix », « un bouton WhatsApp ». Chaque élément rend le résultat plus complet.",it:"Gli elementi concreti che il risultato deve includere — aggiungili uno a uno con « + ». Esempio per un sito: « un modulo di contatto », « una galleria foto », « un listino prezzi », « un pulsante WhatsApp ». Ogni elemento rende il risultato più completo.",de:"Die konkreten Dinge, die das Ergebnis enthalten muss — füge jedes mit „+“ hinzu. Beispiel für eine Website: „ein Kontaktformular“, „eine Fotogalerie“, „eine Preisliste“, „ein WhatsApp-Button“. Jedes Element macht das Ergebnis vollständiger."}},
{type:"group",id:"design",label:{en:"Design",ar:"التصميم",fr:"Design",it:"Design",de:"Design"},children:[
{type:"text",id:"colors",label:{en:"Colour codes",ar:"أكواد الألوان",fr:"Codes couleurs",it:"Codici colore",de:"Farbcodes"},ph:{en:"e.g. #22D3EE, blue, pink",ar:"مثال: #22D3EE، أزرق، وردي",fr:"Ex : #22D3EE, bleu, rose",it:"Es.: #22D3EE, blu, rosa",de:"z. B. #22D3EE, blau, rosa"},info:{en:"Which colours? Names or hex codes.",ar:"ما الألوان؟ أسماء أو أكواد.",fr:"Quelles couleurs ? Noms ou codes.",it:"Quali colori? Nomi o codici.",de:"Welche Farben? Namen oder Codes."}},
{type:"text",id:"fonts",label:{en:"Fonts",ar:"الخطوط",fr:"Polices",it:"Caratteri",de:"Schriftarten"},ph:{en:"e.g. Tajawal, Orbitron",ar:"مثال: Tajawal، Orbitron",fr:"Ex : Tajawal, Orbitron",it:"Es.: Tajawal, Orbitron",de:"z. B. Tajawal, Orbitron"},info:{en:"Preferred font? Leave empty to let the AI choose.",ar:"خط مفضّل؟ اتركه فارغاً ليختار الذكاء.",fr:"Police préférée ? Laissez vide pour laisser l'IA choisir.",it:"Carattere preferito? Lascia vuoto e sceglierà l'IA.",de:"Bevorzugte Schrift? Leer lassen, dann wählt die KI."}},
{type:"text",id:"sizes",label:{en:"Dimensions (image/video)",ar:"المقاسات (صورة/فيديو)",fr:"Dimensions (image/vidéo)",it:"Dimensioni (immagine/video)",de:"Maße (Bild/Video)"},ph:{en:"e.g. 1080×1080, 16:9",ar:"مثال: 1080×1080، 16:9",fr:"Ex : 1080×1080, 16:9",it:"Es.: 1080×1080, 16:9",de:"z. B. 1080×1080, 16:9"},info:{en:"For image/video, what size?",ar:"للصورة/الفيديو، ما الحجم؟",fr:"Pour image/vidéo, quelle taille ?",it:"Per immagine/video, quale dimensione?",de:"Für Bild/Video, welche Größe?"}}
]},
{type:"text",id:"languages",label:{en:"Languages",ar:"اللغات",fr:"Langues",it:"Lingue",de:"Sprachen"},ph:{en:"e.g. English and French",ar:"مثال: العربية والفرنسية",fr:"Ex : français et anglais",it:"Es.: italiano e inglese",de:"z. B. Deutsch und Englisch"},info:{en:"The language(s) you want the result written in. Example: 'English', or 'Arabic and French side by side'. If you leave it empty, the AI uses the language of your prompt.",ar:"اللغة أو اللغات التي تريد الناتج بها. مثال: «العربية»، أو «العربية والفرنسية جنباً إلى جنب». إن تركته فارغاً استخدم الذكاء لغة برومبتك.",fr:"La ou les langues du résultat. Exemple : « français », ou « arabe et français côte à côte ». Si vous laissez vide, l'IA utilise la langue de votre prompt.",it:"La lingua o le lingue del risultato. Esempio: « italiano », o « arabo e inglese affiancati ». Se lasci vuoto, l'IA usa la lingua del tuo prompt.",de:"Die Sprache(n) des Ergebnisses. Beispiel: „Deutsch“ oder „Arabisch und Französisch nebeneinander“. Wenn leer, nutzt die KI die Sprache deines Prompts."}},
{type:"text",id:"audience",label:{en:"Target audience",ar:"الجمهور المستهدف",fr:"Public cible",it:"Pubblico di destinazione",de:"Zielgruppe"},ph:{en:"Who is it for?",ar:"لمن هذا؟",fr:"Pour qui ?",it:"Per chi è?",de:"Für wen ist es?"},info:{en:"Who the result is for — this sets the tone and depth. Example: 'busy small-business owners with no technical background', or 'university students'. The AI adapts its vocabulary, examples and tone to them.",ar:"لمن هذا الناتج — يحدّد الأسلوب والعمق. مثال: «أصحاب مشاريع صغيرة مشغولون بلا خلفية تقنية»، أو «طلاب جامعيون». يكيّف الذكاء مفرداته وأمثلته وأسلوبه لهم.",fr:"À qui s'adresse le résultat — cela règle le ton et la profondeur. Exemple : « des dirigeants de petites entreprises sans bagage technique », ou « des étudiants ». L'IA adapte vocabulaire, exemples et ton.",it:"A chi è destinato il risultato — definisce tono e profondità. Esempio: « titolari di piccole imprese senza basi tecniche », o « studenti universitari ». L'IA adatta vocabolario, esempi e tono.",de:"Für wen das Ergebnis ist — das bestimmt Ton und Tiefe. Beispiel: „vielbeschäftigte Kleinunternehmer ohne technischen Hintergrund“ oder „Studierende“. Die KI passt Wortwahl, Beispiele und Ton an."}},
{type:"chips",id:"tone",label:{en:"Tone & style",ar:"الأسلوب والنبرة",fr:"Ton & style",it:"Tono & stile",de:"Ton & Stil"},info:{en:"What feel do you want? Tap any that fit (multiple allowed).",ar:"بأي إحساس تريد النتيجة؟ اضغط ما يناسب (أكثر من واحد).",fr:"Quel ressenti ? Cliquez ce qui convient (plusieurs possibles).",it:"Quale sensazione? Tocca quelle adatte (più di una).",de:"Welche Wirkung? Tippe Passendes an (mehrere möglich)."},options:[
{id:"pro",label:{en:"Professional",ar:"احترافي",fr:"Professionnel",it:"Professionale",de:"Professionell"}},
{id:"friendly",label:{en:"Friendly",ar:"ودّي",fr:"Amical",it:"Amichevole",de:"Freundlich"}},
{id:"formal",label:{en:"Formal",ar:"رسمي",fr:"Formel",it:"Formale",de:"Förmlich"}},
{id:"marketing",label:{en:"Marketing",ar:"تسويقي",fr:"Marketing",it:"Marketing",de:"Werblich"}},
{id:"edu",label:{en:"Educational",ar:"تعليمي",fr:"Pédagogique",it:"Didattico",de:"Lehrreich"}},
{id:"creative",label:{en:"Creative",ar:"إبداعي",fr:"Créatif",it:"Creativo",de:"Kreativ"}},
{id:"concise",label:{en:"Concise",ar:"مختصر",fr:"Concis",it:"Conciso",de:"Knapp"}},
{id:"detailed",label:{en:"Detailed",ar:"مفصّل",fr:"Détaillé",it:"Dettagliato",de:"Ausführlich"}},
{id:"simple",label:{en:"Simple",ar:"بسيط",fr:"Simple",it:"Semplice",de:"Einfach"}}
]},
{type:"yesno",id:"attachments",label:{en:"Attachments",ar:"المرفقات",fr:"Pièces jointes",it:"Allegati",de:"Anhänge"},info:{en:"Will you attach files (image, file, logo)? Choose Yes if so.",ar:"هل سترفق ملفات (صورة، ملف، شعار)؟ اختر نعم إن كان كذلك.",fr:"Allez-vous joindre des fichiers ? Choisissez Oui si oui.",it:"Allegherai dei file? Scegli Sì in tal caso.",de:"Wirst du Dateien anhängen? Dann wähle Ja."}},
{type:"text",id:"count",label:{en:"Amount (e.g. pages)",ar:"العدد (مثلاً صفحات)",fr:"Quantité (ex. pages)",it:"Quantità (es. pagine)",de:"Menge (z. B. Seiten)"},ph:{en:"e.g. 5 pages, 10 questions",ar:"مثال: 5 صفحات، 10 أسئلة",fr:"Ex : 5 pages, 10 questions",it:"Es.: 5 pagine, 10 domande",de:"z. B. 5 Seiten, 10 Fragen"},info:{en:"How much do you want? A number and the thing.",ar:"كم تريد؟ الرقم والشيء.",fr:"Combien ? Un nombre et la chose.",it:"Quanto vuoi? Un numero e la cosa.",de:"Wie viel willst du? Eine Zahl und die Sache."}},
{type:"textarea",id:"reference",label:{en:"Reference (link/description)",ar:"نموذج سابق (رابط/وصف)",fr:"Référence (lien/description)",it:"Riferimento (link/descrizione)",de:"Referenz (Link/Beschreibung)"},ph:{en:"A link, or describe the reference…",ar:"ضع رابطاً أو صف المرجع…",fr:"Un lien, ou décrivez la référence…",it:"Un link, o descrivi il riferimento…",de:"Ein Link oder beschreibe die Referenz…"},info:{en:"Have an example you admire (a website, design, document or image)? Paste its link, describe it, or upload it below — the AI studies its style and quality and takes inspiration WITHOUT copying. Example: 'Make it feel like the Stripe homepage — clean, lots of whitespace, bold headings.'",ar:"لديك مثال يعجبك (موقع، تصميم، مستند أو صورة)؟ ضع رابطه أو صفه أو ارفعه أدناه — يدرس الذكاء أسلوبه وجودته ويستلهم منه دون نسخه. مثال: «اجعله بإحساس صفحة Stripe — نظيف، مساحات بيضاء واسعة، عناوين بارزة».",fr:"Vous avez un exemple que vous admirez (site, design, document ou image) ? Mettez son lien, décrivez-le ou téléversez-le ci-dessous — l'IA étudie son style et sa qualité et s'en inspire SANS copier. Exemple : « Donne-lui l'esprit de la page Stripe — épuré, beaucoup d'espace, titres marqués. »",it:"Hai un esempio che ammiri (sito, design, documento o immagine)? Metti il link, descrivilo o caricalo qui sotto — l'IA studia stile e qualità e si ispira SENZA copiare. Esempio: « Dagli lo spirito della home di Stripe — pulita, molto spazio, titoli marcati. »",de:"Hast du ein Beispiel, das du bewunderst (Website, Design, Dokument oder Bild)? Füge den Link ein, beschreibe es oder lade es unten hoch — die KI studiert Stil und Qualität und lässt sich inspirieren, OHNE zu kopieren. Beispiel: „Gib ihm den Geist der Stripe-Startseite — aufgeräumt, viel Weißraum, markante Überschriften.“"}},
{type:"textarea",id:"script",voice:true,label:{en:"Script / voiceover / dialogue",ar:"السكربت / تعليق صوتي / حوار",fr:"Script / voix off / dialogue",it:"Script / voce fuori campo / dialogo",de:"Skript / Voiceover / Dialog"},ph:{en:"e.g. Voiceover narration, or character dialogue…",ar:"مثال: تعليق صوتي سردي، أو حوار شخصيات…",fr:"Ex : narration en voix off, ou dialogue de personnages…",it:"Es.: narrazione in voce fuori campo, o dialogo dei personaggi…",de:"z. B. Voiceover-Erzählung oder Figurendialog…"},info:{en:"Need spoken or scripted content? Say what kind and give the lines or the brief. Voiceover = narration read aloud; Dialogue = characters talking; Screenplay = scenes with action + dialogue. Example: 'Voiceover, warm and confident, ~30s, introducing a fitness app.'",ar:"تحتاج محتوى منطوقاً أو سكربت؟ حدّد نوعه وأعطِ النص أو الفكرة. تعليق صوتي = سرد يُقرأ بصوت؛ حوار = شخصيات تتحدث؛ سيناريو = مشاهد بأحداث وحوار. مثال: «تعليق صوتي دافئ وواثق، نحو 30 ثانية، للتعريف بتطبيق رياضة».",fr:"Besoin de contenu parlé ou scripté ? Précisez le type et donnez le texte ou le brief. Voix off = narration lue ; Dialogue = personnages qui parlent ; Scénario = scènes avec action et dialogue. Exemple : « Voix off, chaleureuse et assurée, ~30s, présentant une appli fitness. »",it:"Serve contenuto parlato o scriptato? Indica il tipo e dai il testo o il brief. Voce fuori campo = narrazione letta; Dialogo = personaggi che parlano; Sceneggiatura = scene con azione e dialogo. Esempio: « Voce fuori campo, calda e sicura, ~30s, per presentare un'app fitness. »",de:"Brauchst du gesprochenen oder geskripteten Inhalt? Nenne die Art und gib den Text oder das Briefing. Voiceover = vorgelesene Erzählung; Dialog = sprechende Figuren; Drehbuch = Szenen mit Handlung und Dialog. Beispiel: „Voiceover, warm und selbstbewusst, ~30s, zur Vorstellung einer Fitness-App.“"}},
{type:"upload",id:"uploads",label:{en:"Upload images / files",ar:"رفع صور / ملفات",fr:"Téléverser images / fichiers",it:"Carica immagini / file",de:"Bilder / Dateien hochladen"},info:{en:"Upload one or more images or files (audio, video, PDF, anything). Images are embedded at FULL SIZE in the HTML / PDF / Word export so the AI can analyse them in detail. Plain-text copy can't carry files — use HTML, PDF or Word export when you attach anything.",ar:"ارفع صورة أو أكثر أو ملفات (صوت، فيديو، PDF، أي شيء). تُضمَّن الصور بحجمها الأصلي في تصدير HTML / PDF / Word لكي يحلّلها الذكاء بدقة. نسخ النص العادي لا يحمل الملفات — استخدم تصدير HTML أو PDF أو Word عند إرفاق أي شيء.",fr:"Téléversez une ou plusieurs images ou fichiers (audio, vidéo, PDF, tout). Les images sont intégrées en TAILLE RÉELLE dans l'export HTML / PDF / Word pour que l'IA les analyse en détail. Le texte brut ne porte pas les fichiers — utilisez l'export HTML, PDF ou Word.",it:"Carica una o più immagini o file (audio, video, PDF, qualsiasi cosa). Le immagini sono incorporate a DIMENSIONE REALE nell'export HTML / PDF / Word così l'IA le analizza in dettaglio. Il testo semplice non porta i file — usa l'export HTML, PDF o Word.",de:"Lade ein oder mehrere Bilder oder Dateien hoch (Audio, Video, PDF, alles). Bilder werden in VOLLER GRÖSSE in den HTML-/PDF-/Word-Export eingebettet, damit die KI sie im Detail analysiert. Reiner Text trägt keine Dateien — nutze den HTML-, PDF- oder Word-Export."}},
{type:"textarea",id:"secret",label:{en:"Keys / code to integrate",ar:"مفاتيح / أكواد للدمج",fr:"Clés / codes à intégrer",it:"Chiavi / codici da integrare",de:"Schlüssel / Code zum Einbinden"},ph:{en:"Paste an API key, token, secret, or code to integrate…",ar:"ألصق مفتاح API أو توكن أو رمزاً سرياً أو كوداً…",fr:"Collez une clé API, un token, un secret ou du code…",it:"Incolla una chiave API, un token, un segreto o del codice…",de:"Füge einen API-Schlüssel, Token, ein Geheimnis oder Code ein…"},info:{en:"Have an API key, token, secret, or code to be integrated in the right place? Paste it here. It stays in your browser and is sent only inside your prompt.",ar:"لديك مفتاح API أو توكن أو رمز سري أو كود ليُدمج في المكان الصحيح؟ ألصقه هنا. يبقى في متصفحك ويُرسل في برومبتك فقط.",fr:"Une clé API, un token, un secret ou du code à intégrer au bon endroit ? Collez-le ici. Il reste dans votre navigateur et n'est envoyé que dans votre prompt.",it:"Hai una chiave API, un token, un segreto o del codice da integrare al posto giusto? Incollalo qui. Resta nel tuo browser e viene inviato solo nel tuo prompt.",de:"Hast du einen API-Schlüssel, Token, ein Geheimnis oder Code zum Einbinden an der richtigen Stelle? Hier einfügen. Es bleibt in deinem Browser und wird nur in deinem Prompt gesendet."}},
{type:"textarea",id:"extra",label:{en:"Extra notes",ar:"إضافات أخرى",fr:"Ajouts",it:"Note aggiuntive",de:"Zusätzliche Hinweise"},ph:{en:"Any extra details…",ar:"أي تفاصيل إضافية…",fr:"Tout détail en plus…",it:"Qualsiasi dettaglio in più…",de:"Weitere Details…"},info:{en:"Anything else on your mind that didn't fit above.",ar:"أي شيء آخر لم يجد مكاناً أعلاه.",fr:"Tout ce qui n'a pas trouvé sa place ci-dessus.",it:"Qualsiasi altra cosa che non rientrava sopra.",de:"Alles Weitere, das oben nicht passte."}},
{type:"textarea",id:"result",label:{en:"Expected result",ar:"النتيجة المنتظرة",fr:"Résultat attendu",it:"Risultato atteso",de:"Erwartetes Ergebnis"},ph:{en:"Describe the final result precisely…",ar:"صف الشكل النهائي بدقة…",fr:"Décrivez précisément le résultat final…",it:"Descrivi con precisione il risultato finale…",de:"Beschreibe das Endergebnis genau…"},info:{en:"Describe the finished output precisely: its form, length, format and quality. Example: 'a 600-word blog post with a catchy title, 3 subheadings and a call to action at the end', or 'clean code in one file, ready to run'. Precision here decides how usable the answer is.",ar:"صف الناتج النهائي بدقة: شكله وطوله وصيغته وجودته. مثال: «مقال مدوّنة من 600 كلمة بعنوان جذّاب و3 عناوين فرعية ونداء للفعل في النهاية»، أو «كود نظيف في ملف واحد جاهز للتشغيل». الدقة هنا تحدّد مدى جاهزية الإجابة.",fr:"Décrivez précisément le résultat fini : forme, longueur, format et qualité. Exemple : « un article de 600 mots avec un titre accrocheur, 3 sous-titres et un appel à l'action », ou « un code propre dans un seul fichier, prêt à exécuter ». La précision décide de l'utilité de la réponse.",it:"Descrivi con precisione il risultato finito: forma, lunghezza, formato e qualità. Esempio: « un articolo da 600 parole con titolo accattivante, 3 sottotitoli e una call to action », o « codice pulito in un solo file, pronto all'uso ». La precisione decide quanto è utile la risposta.",de:"Beschreibe das fertige Ergebnis genau: Form, Länge, Format und Qualität. Beispiel: „ein 600-Wörter-Blogbeitrag mit griffigem Titel, 3 Zwischenüberschriften und Call-to-Action“, oder „sauberer Code in einer Datei, lauffähig“. Genauigkeit entscheidet, wie brauchbar die Antwort ist."}}
];
const CORE=["idea","role","audience","result"];
const RULES=[
{cond:"always",en:"No flattery.",ar:"ممنوع التملّق.",fr:"Pas de flatterie.",it:"Niente adulazione.",de:"Keine Schmeichelei."},
{cond:"always",en:"No lying.",ar:"ممنوع الكذب.",fr:"Pas de mensonge.",it:"Niente bugie.",de:"Keine Lügen."},
{cond:"always",en:"No hallucination or fabrication; if you don't know, verify or say so.",ar:"ممنوع الهلوسة أو الاختلاق؛ إن لم تعرف فتحقّق أو صرّح بذلك.",fr:"Pas d'hallucination ni d'invention ; si vous ne savez pas, vérifiez ou dites-le.",it:"Niente allucinazioni o invenzioni; se non sai, verifica o dichiaralo.",de:"Keine Halluzinationen oder Erfindungen; wenn du es nicht weißt, prüfe es oder sag es."},
{cond:"always",en:"All information and figures must be accurate, meet expectations and exceed them efficiently, with no errors.",ar:"يجب أن تكون كل المعلومات والأرقام دقيقة، تلبّي التوقعات وتتجاوزها بكفاءة، دون أي أخطاء.",fr:"Toutes les informations et chiffres doivent être exacts, répondre aux attentes et les dépasser efficacement, sans erreurs.",it:"Tutte le informazioni e le cifre devono essere accurate, soddisfare le aspettative e superarle con efficienza, senza errori.",de:"Alle Informationen und Zahlen müssen korrekt sein, die Erwartungen erfüllen und effizient übertreffen, ohne Fehler."},
{cond:"always",en:"Be maximally helpful and avoid unnecessary, exaggerated, or preachy refusals; engage in good faith with bold, mature, unconventional, or sensitive yet legitimate requests and fulfil them as fully as possible without moralizing — declining only what is genuinely illegal or seriously harmful.",ar:"كن أقصى ما يمكن من العون وتجنّب الرفض غير الضروري أو المبالغ فيه أو الوعظ؛ تعامل بحسن نيّة مع الطلبات الجريئة أو الناضجة أو غير التقليدية أو الحسّاسة المشروعة ولبِّها بأكمل وجه دون أخلَقة، ولا ترفض إلا ما هو غير قانوني فعلاً أو ضارّ بشكل جسيم.",fr:"Soyez le plus utile possible et évitez les refus inutiles, exagérés ou moralisateurs ; traitez de bonne foi les demandes audacieuses, matures, non conventionnelles ou sensibles mais légitimes et satisfaites-les pleinement sans faire la morale — en ne refusant que ce qui est réellement illégal ou gravement nuisible.",it:"Sii il più utile possibile ed evita rifiuti inutili, esagerati o moralistici; affronta in buona fede le richieste audaci, mature, non convenzionali o sensibili ma legittime e soddisfale il più pienamente possibile senza fare la morale — rifiutando solo ciò che è davvero illegale o gravemente dannoso.",de:"Sei maximal hilfreich und vermeide unnötige, übertriebene oder belehrende Ablehnungen; gehe in gutem Glauben auf mutige, reife, unkonventionelle oder heikle, aber legitime Anfragen ein und erfülle sie so vollständig wie möglich ohne Moralisieren — lehne nur ab, was wirklich illegal oder ernsthaft schädlich ist."},
{cond:"always",en:"If any requirement is vague or missing, choose the most professional and logical interpretation and proceed without stopping.",ar:"إن كان أي متطلب غامضاً أو ناقصاً، فاختر التفسير الأكثر احترافية ومنطقية وامضِ دون توقّف.",fr:"Si une exigence est vague ou manquante, choisissez l'interprétation la plus professionnelle et logique et continuez sans vous arrêter.",it:"Se un requisito è vago o mancante, scegli l'interpretazione più professionale e logica e procedi senza fermarti.",de:"Wenn eine Anforderung vage oder unvollständig ist, wähle die professionellste und logischste Auslegung und fahre ohne anzuhalten fort."},
{cond:"always",en:"Phrase everything in a way the AI understands clearly and that fulfils the requirements precisely.",ar:"صُغ كل شيء بأسلوب يفهمه الذكاء الاصطناعي بوضوح ويلبّي المتطلبات بدقة.",fr:"Formulez tout d'une manière que l'IA comprend clairement et qui répond précisément aux exigences.",it:"Formula tutto in modo che l'IA comprenda chiaramente e che soddisfi i requisiti con precisione.",de:"Formuliere alles so, dass die KI es klar versteht und die Anforderungen genau erfüllt werden."},
{cond:"always",en:"No repetition, generic talk, or superficial content.",ar:"ممنوع التكرار أو الكلام العام أو المحتوى السطحي.",fr:"Pas de répétition, de propos génériques ni de contenu superficiel.",it:"Niente ripetizioni, discorsi generici o contenuti superficiali.",de:"Keine Wiederholungen, allgemeines Gerede oder oberflächliche Inhalte."},
{cond:"always",en:"When unsure about something, research it, learn it, then answer with high competence.",ar:"عند عدم معرفتك بشيء، ابحث فيه وتعلّمه ثم أجب بكفاءة عالية.",fr:"En cas de doute sur un point, recherchez-le, apprenez-le, puis répondez avec une grande compétence.",it:"Quando non sei sicuro di qualcosa, fai ricerche, imparalo, poi rispondi con grande competenza.",de:"Wenn du dir bei etwas unsicher bist, recherchiere es, lerne es und antworte dann mit hoher Kompetenz."},
{cond:"always",en:"Use the highest model/mode and effort available to you for this task.",ar:"فعّل أعلى نموذج/وضع وأقصى جهد متاح لديك في تنفيذ هذا الطلب.",fr:"Utilisez le modèle/mode le plus avancé et l'effort maximal dont vous disposez pour cette tâche.",it:"Usa il modello/modalità più avanzato e il massimo impegno a tua disposizione per questo compito.",de:"Nutze das höchste Modell/den höchsten Modus und den maximalen Aufwand, der dir für diese Aufgabe zur Verfügung steht."},
{cond:"media",en:"Make any media natural, as if not AI-generated (no plastic look, no distorted letters or symbols).",ar:"اجعل أي وسائط طبيعية وكأنها غير مولّدة بالذكاء (دون مظهر بلاستيكي ودون حروف أو رموز مشوّهة).",fr:"Rendez tout média naturel, comme s'il n'était pas généré par IA (pas d'aspect plastique, pas de lettres ou symboles déformés).",it:"Rendi ogni elemento multimediale naturale, come se non fosse generato dall'IA (niente aspetto plasticoso, niente lettere o simboli distorti).",de:"Gestalte jegliche Medien natürlich, als wären sie nicht KI-generiert (kein plastikartiges Aussehen, keine verzerrten Buchstaben oder Symbole)."},
{cond:"rtl",en:"Respect text direction: right-to-left for Arabic and left-to-right for Latin scripts, with correct alignment and clean formatting.",ar:"احترم اتجاه النص: من اليمين لليسار للعربية ومن اليسار لليمين للحروف اللاتينية، مع محاذاة سليمة وتنسيق نظيف.",fr:"Respectez le sens du texte : de droite à gauche pour l'arabe et de gauche à droite pour les écritures latines, avec un alignement correct et une mise en forme propre.",it:"Rispetta la direzione del testo: da destra a sinistra per l'arabo e da sinistra a destra per le scritture latine, con allineamento corretto e formattazione pulita.",de:"Beachte die Textrichtung: rechts-nach-links für Arabisch und links-nach-rechts für lateinische Schriften, mit korrekter Ausrichtung und sauberer Formatierung."},
{cond:"fileLogo",en:"When inserting a file or logo, place it as is without distortion or tampering with its fine details.",ar:"عند إدراج ملف أو شعار، ضعه كما هو دون تشويه أو تصرّف في تفاصيله الدقيقة.",fr:"Lors de l'insertion d'un fichier ou d'un logo, placez-le tel quel sans le déformer ni en altérer les détails.",it:"Quando inserisci un file o un logo, mettilo così com'è senza distorcerlo né alterarne i dettagli.",de:"Beim Einfügen einer Datei oder eines Logos platziere es unverändert, ohne es zu verzerren oder seine Details zu manipulieren."},
{cond:"web",en:"If a website, web app, or mobile app is requested, deliver a complete, polished product with genuinely working, wired-up buttons and features (no placeholders or dummy elements); choose a beautiful, modern, error-free design with no random clutter; and first draw inspiration from top design references (e.g. Dribbble, Behance) before building.",ar:"إذا طُلب موقع إلكتروني أو تطبيق ويب أو تطبيق هاتف، فقدّمه كاملاً ومتقَناً بأزرار وميزات شغّالة فعلاً ومربوطة (دون عناصر وهمية أو نائبة)، واختر تصميماً جميلاً عصرياً خالياً من الأخطاء ودون حشو عبثي، واستلهم أولاً من أفضل المراجع التصميمية (مثل Dribbble وBehance) قبل الإنشاء.",fr:"Si un site web, une application web ou mobile est demandé, livrez un produit complet et soigné avec des boutons et fonctions réellement opérationnels et connectés (sans éléments factices) ; choisissez un design beau, moderne et sans erreurs ni fouillis ; et inspirez-vous d'abord des meilleures références de design (ex. Dribbble, Behance) avant de construire.",it:"Se viene richiesto un sito web, un'app web o mobile, consegna un prodotto completo e curato con pulsanti e funzioni realmente funzionanti e collegati (senza elementi fittizi); scegli un design bello, moderno e privo di errori senza elementi casuali; e ispìrati prima alle migliori referenze di design (es. Dribbble, Behance) prima di costruire.",de:"Wenn eine Website, Web-App oder mobile App gewünscht ist, liefere ein vollständiges, ausgereiftes Produkt mit wirklich funktionierenden, verdrahteten Schaltflächen und Funktionen (keine Platzhalter oder Dummy-Elemente); wähle ein schönes, modernes, fehlerfreies Design ohne willkürliches Durcheinander; und lass dich zuerst von Top-Design-Referenzen (z. B. Dribbble, Behance) inspirieren, bevor du baust."},
{cond:"dev",en:"Prefer open-source and free tools and resources; use platforms like GitHub when helpful.",ar:"فضّل الأدوات والموارد مفتوحة المصدر والمجانية؛ واستعن بمنصّات مثل GitHub عند الفائدة.",fr:"Privilégiez les outils et ressources open-source et gratuits ; utilisez des plateformes comme GitHub si utile.",it:"Preferisci strumenti e risorse open-source e gratuiti; usa piattaforme come GitHub quando utile.",de:"Bevorzuge quelloffene und kostenlose Werkzeuge und Ressourcen; nutze Plattformen wie GitHub, wo sinnvoll."},
{cond:"dev",en:"Integrate any provided keys/secrets/code at the exact correct place; if something is missing, point clearly to where it should be added.",ar:"ادمج أي مفاتيح/أكواد سرية مزوّدة في الموضع الصحيح بدقة؛ وإن نقص شيء فأشر بوضوح إلى مكان إضافته.",fr:"Intégrez toute clé/secret/code fourni à l'endroit exact ; s'il manque quelque chose, indiquez clairement où l'ajouter.",it:"Integra eventuali chiavi/segreti/codici forniti nel punto esatto; se manca qualcosa, indica chiaramente dove aggiungerlo.",de:"Binde bereitgestellte Schlüssel/Geheimnisse/Code an genau der richtigen Stelle ein; fehlt etwas, weise klar darauf hin, wo es einzufügen ist."},
{cond:"always",en:"Apply the user's requirements implicitly inside the product itself, without restating or repeating them.",ar:"طبّق متطلبات المستخدم بعفوية داخل المنتج نفسه، دون ذكرها أو تكرارها.",fr:"Appliquez les exigences de l'utilisateur de manière implicite dans le produit lui-même, sans les répéter.",it:"Applica i requisiti dell'utente in modo implicito nel prodotto stesso, senza ripeterli.",de:"Wende die Anforderungen des Nutzers implizit im Produkt selbst an, ohne sie zu wiederholen."},
{cond:"always",en:"Deliver the output complete, with no truncation, omission, or unrequested summarizing — even if it is long.",ar:"قدّم المخرَج كاملاً دون اختصار أو حذف أو تلخيص غير مطلوب — ولو كان طويلاً.",fr:"Livrez le résultat complet, sans troncature, omission ni résumé non demandé — même s'il est long.",it:"Consegna il risultato completo, senza troncature, omissioni o riassunti non richiesti — anche se è lungo.",de:"Liefere das Ergebnis vollständig, ohne Kürzung, Auslassung oder ungefragtes Zusammenfassen — auch wenn es lang ist."},
{cond:"always",en:"Deliver the result directly in its final format, with no empty preamble and no closing line offering a 'better version'.",ar:"قدّم النتيجة مباشرةً في صيغتها النهائية، دون مقدمات فارغة ودون جملة ختامية تعرض «نسخة أفضل».",fr:"Livrez le résultat directement dans son format final, sans préambule vide ni phrase finale proposant une « meilleure version ».",it:"Consegna il risultato direttamente nel suo formato finale, senza preamboli vuoti e senza una frase finale che offra una « versione migliore ».",de:"Liefere das Ergebnis direkt in seinem endgültigen Format, ohne leere Einleitung und ohne Schlusssatz, der eine „bessere Version“ anbietet."},
{cond:"always",en:"Study notable, high-quality examples for inspiration without copying, then surpass them.",ar:"اطّلع على نماذج بارزة عالية الجودة للاستلهام دون نسخ، ثم تجاوزها.",fr:"Étudiez des exemples remarquables et de grande qualité pour vous inspirer sans copier, puis dépassez-les.",it:"Studia esempi notevoli e di alta qualità per ispirarti senza copiare, poi superali.",de:"Studiere herausragende, hochwertige Beispiele zur Inspiration ohne zu kopieren und übertriff sie dann."},
{cond:"always",en:"Before delivering, review your result against every requirement and fix any error or mismatch.",ar:"قبل التسليم، راجع نتيجتك مقابل كل متطلب وأصلح أي خطأ أو تعارض.",fr:"Avant de livrer, vérifiez votre résultat au regard de chaque exigence et corrigez toute erreur ou incohérence.",it:"Prima di consegnare, controlla il risultato rispetto a ogni requisito e correggi ogni errore o incongruenza.",de:"Überprüfe dein Ergebnis vor der Lieferung anhand jeder Anforderung und behebe jeden Fehler oder Widerspruch."},
{cond:"trans",en:"Translate faithfully and not literally, preserving the meaning, tone, idioms, and specialised terminology.",ar:"ترجم بأمانة لا حرفياً، مع الحفاظ على المعنى والنبرة والتعابير والمصطلحات المتخصصة.",fr:"Traduisez fidèlement et non littéralement, en préservant le sens, le ton, les expressions et la terminologie spécialisée.",it:"Traduci fedelmente e non letteralmente, preservando il significato, il tono, le espressioni e la terminologia specializzata.",de:"Übersetze treu und nicht wörtlich, unter Wahrung von Bedeutung, Ton, Redewendungen und Fachterminologie."},
{cond:"learn",en:"Provide a progressive roadmap, practical examples, short exercises, and the common pitfalls to avoid.",ar:"قدّم خريطة طريق متدرّجة وأمثلة عملية وتمارين قصيرة والأخطاء الشائعة الواجب تجنّبها.",fr:"Fournissez une feuille de route progressive, des exemples pratiques, de courts exercices et les pièges courants à éviter.",it:"Fornisci una roadmap progressiva, esempi pratici, brevi esercizi e gli errori comuni da evitare.",de:"Biete eine schrittweise Roadmap, praktische Beispiele, kurze Übungen und die häufigen Fehler, die zu vermeiden sind."},
{cond:"song",en:"Give the song a coherent structure (verses, chorus, bridge) with harmonious rhyme and rhythm matching the intended feeling.",ar:"امنح الأغنية بنية متماسكة (مقاطع، لازمة، جسر) بقافية وإيقاع منسجمين يلائمان الإحساس المقصود.",fr:"Donnez à la chanson une structure cohérente (couplets, refrain, pont) avec une rime et un rythme harmonieux correspondant au ressenti voulu.",it:"Dai alla canzone una struttura coerente (strofe, ritornello, ponte) con rima e ritmo armoniosi adatti alla sensazione voluta.",de:"Gib dem Song eine kohärente Struktur (Strophen, Refrain, Bridge) mit harmonischem Reim und Rhythmus passend zum beabsichtigten Gefühl."},
{cond:"always",en:"Do not answer just for the sake of answering: deliver what genuinely serves the user and what they truly need.",ar:"لا تجب لمجرد الإجابة: قدّم ما يخدم المستخدم فعلاً وما يحتاجه حقاً.",fr:"Ne répondez pas pour le simple fait de répondre : livrez ce qui sert réellement l'utilisateur et ce dont il a vraiment besoin.",it:"Non rispondere solo per rispondere: offri ciò che serve davvero all'utente e di cui ha realmente bisogno.",de:"Antworte nicht nur um des Antwortens willen: liefere, was dem Nutzer wirklich dient und was er tatsächlich braucht."}
];
const TPL={
en:{
text:{role:"You are a professional writer and editor with clear, engaging prose.",idea:"I want a well-structured written text about the topic I'll specify.",feat:["Clear structure with headings","Correct, fluent language","Examples where useful","A concise conclusion"],aud:"General reader",tone:["pro","simple"],res:"A polished, publication-ready text, error-free and clear."},
consult:{role:"You are an expert consultant in the relevant field, giving precise analysis and practical solutions.",idea:"I want a specialised consultation on my topic, with clear recommendations.",feat:["Precise situation analysis","Options with pros and cons","A clear final recommendation","Actionable steps"],aud:"Decision-maker",tone:["pro","detailed"],res:"A structured consultation ending with an immediately applicable recommendation."},
code:{role:"You are an expert software developer who writes clean, efficient, secure code.",idea:"I want code that fully performs the function I'll describe and is ready to run.",feat:["Clean, organised code","Helpful comments","Error handling","Scalable and maintainable"],aud:"Developers",tone:["pro"],res:"Complete, working code with a brief note on how to run and set it up."},
website:{role:"You are a senior web designer and front-end engineer building complete, beautiful websites.",idea:"I want a complete website for the purpose I'll describe.",feat:["Polished, modern responsive design","Genuinely working, wired-up buttons and links","Clear sections (hero, content, contact)","Fast, clean, error-free"],aud:"The site's visitors",tone:["pro","creative"],colors:"A modern, harmonious palette",res:"A complete, working website with a stunning, error-free design, ready to deploy."},
webapp:{role:"You are a full-stack engineer building complete, functional web applications.",idea:"I want a web app with the features I'll specify.",feat:["Real, working features and buttons","Secure login if needed","Responsive, elegant UI","Clean, maintainable code"],aud:"The app's users",tone:["pro"],colors:"A modern, consistent interface",res:"A complete, functional web app with a beautiful, error-free design, ready to run."},
mobileapp:{role:"You are a mobile app developer and designer building complete, polished apps.",idea:"I want a mobile app with the features I'll describe.",feat:["Real, working features and buttons","Smooth, intuitive navigation","Beautiful, modern UI","Clean, maintainable code"],aud:"The app's users",tone:["pro"],colors:"A modern, consistent interface",res:"A complete, functional mobile app with a stunning, error-free design."},
dash:{role:"You are a UI and app engineer building practical, elegant dashboards.",idea:"I want a dashboard for a specialised site/app with the features I'll specify.",feat:["Secure login","Charts and statistics","Responsive design","Easy content management"],aud:"Admins and users",tone:["pro"],colors:"A modern, consistent interface",res:"A functional, responsive, elegant dashboard, ready to run."},
service:{role:"You are a rigorous researcher providing reliable, up-to-date information.",idea:"I want accurate information or a service for what I'll ask, with correct facts.",feat:["Accurate, direct information","Reliable sources where needed","Clear organisation"],aud:"Information seeker",tone:["pro","concise"],res:"An accurate, reliable, well-organised answer that meets the need directly."},
image:{role:"You are a professional graphic designer creating high-quality, visually striking images.",idea:"I want a professional image expressing the idea I'll describe.",feat:["Balanced composition","Harmonious colours","Fine detail","Natural, professional look"],aud:"The image's target audience",tone:["creative","pro"],colors:"A harmonious palette (e.g. sky blue + violet + white accents)",sizes:"1080×1080",res:"A high-resolution, ready-to-use image, professional and natural-looking."},
logo:{role:"You are a professional logo and brand-identity designer.",idea:"I want a distinctive logo for the brand I'll describe.",feat:["A unique, memorable mark","Works in colour and monochrome","Scalable and clean","Suits the brand's personality"],aud:"The brand's audience",tone:["creative","pro"],colors:"A palette suiting the brand",sizes:"Vector / square",res:"A distinctive, professional logo, natural-looking and ready to use."},
slides:{role:"You are a professional presentation designer with clear, attractive slides.",idea:"I want a presentation about the topic I'll specify.",feat:["Clear, logical flow","Attractive, consistent slides","Concise, strong points","A memorable closing"],aud:"The audience",tone:["pro","edu"],colors:"A clean, professional palette",sizes:"16:9",res:"A complete, elegant presentation, clear and ready to present."},
social:{role:"You are a social-media expert creating engaging, on-brand posts.",idea:"I want a social media post about what I'll specify.",feat:["A strong hook","Engaging, on-brand copy","A clear call to action","Suitable hashtags"],aud:"The target followers",tone:["marketing","creative"],res:"An engaging, ready-to-publish post suited to the target platform."},
file:{role:"You are a professional document designer producing elegant, organised files.",idea:"I want a professionally formatted file containing the content I'll specify.",feat:["Clear organisation with headings","Elegant, consistent formatting","Easy to read","Print/share ready"],aud:"The document's reader",tone:["pro"],colors:"Calm, professional colours",sizes:"A4",res:"A polished, precisely formatted final file, ready to use."},
video:{role:"You are a professional video creator with engaging, well-paced content.",idea:"I want a video presenting the idea I'll describe in an engaging way.",feat:["Strong opening","Consistent pacing","Clear visual elements","A closing call to action"],aud:"The viewer",tone:["creative","marketing"],sizes:"1920×1080 (16:9)",res:"A complete, high-quality video, clear and engaging, suited to the target platform."},
audio:{role:"You are a professional audio producer delivering clear, professional sound.",idea:"I want clear audio content about what I'll specify.",feat:["Clean, clear sound","Suitable pacing","Appropriate tone"],aud:"The listener",tone:["pro"],res:"Clear, professional audio ready to use."},
convert:{role:"You are a format-conversion specialist who preserves quality and formatting.",idea:"I want to convert the content/file from its current format to the one I'll specify.",feat:["Preserve the original formatting","Fully accurate transfer","Result ready to use"],aud:"",tone:["pro","concise"],res:"An accurately converted file with formatting and content preserved, ready to use."},
trans:{role:"You are a professional specialised translator, accurate and fluent, mindful of context.",idea:"I want a professional translation of the text I'll attach, faithful to meaning and tone.",feat:["Faithful, non-literal translation","Preserved tone and style","Accurate specialised terminology"],aud:"Target-language reader",tone:["pro"],res:"A natural, accurate translation that preserves the original meaning and tone."},
auto:{role:"You are an automation engineer building precise, reliable workflows.",idea:"I want to automate the workflow I'll describe as a ready JSON file.",feat:["A clear trigger","Logically ordered steps","Error handling","Reusable"],aud:"Operations team",tone:["pro","concise"],res:"A valid JSON file for a workflow that runs right after import."},
fromfile:{role:"You are a rigorous analyst who faithfully extracts answers from attached files.",idea:"I want a precise answer based on the files I'll attach.",feat:["Answer based solely on the files","Accurate quoting and extraction","Clear organisation"],aud:"The files' owner",tone:["pro","detailed"],res:"A precise answer grounded in the attached files' content, with no fabrication."},
learn:{role:"You are an expert teacher and mentor who simplifies complex fields fast.",idea:"I want to master the basics of the field I'll specify in a short time.",feat:["A progressive roadmap","Simplified key concepts","Practical examples","Short exercises"],aud:"A beginner who wants to learn fast",tone:["edu","simple"],res:"A structured learning plan taking you from zero to practical basics with confidence."},
song:{role:"You are a professional songwriter and composer crafting harmonious, moving lyrics.",idea:"I want a custom song about the theme/feeling I'll specify.",feat:["Clear structure (verses + chorus)","Harmonious rhyme and rhythm","Strong poetic imagery","Matches the intended feeling"],aud:"The target listener",tone:["creative"],res:"Complete, coherent song lyrics with a brief note on the suggested musical style."},
invent:{role:"You are an innovator proposing new, feasible ideas.",idea:"I want to invent a solution/product for the problem or need I'll describe.",feat:["Precise problem definition","An original, innovative idea","How it works","Feasibility and next steps"],aud:"The innovation's beneficiary",tone:["creative","detailed"],res:"A complete, clear innovation concept with how it works and how to apply it."},
other:{role:"You are a professional specialist in exactly the requested field.",idea:"I want to accomplish what I'll describe with mastery and professionalism.",feat:["Full mastery of the request","High-quality detail","Clear organisation"],aud:"The target audience",tone:["pro"],res:"A professional, high-quality final output that precisely meets the need."}
},
ar:{
text:{role:"أنت كاتب ومحرّر محترف يجيد الصياغة الواضحة والجذّابة.",idea:"أريد نصاً مكتوباً جيّد التنظيم حول الموضوع الذي سأحدّده.",feat:["بنية واضحة بعناوين","لغة سليمة وسلسة","أمثلة عند الحاجة","خاتمة موجزة"],aud:"قارئ عام",tone:["pro","simple"],res:"نص نهائي منسّق جاهز للنشر، خالٍ من الأخطاء وواضح."},
consult:{role:"أنت مستشار خبير في المجال المطروح تقدّم تحليلاً دقيقاً وحلولاً عملية.",idea:"أريد استشارة متخصصة حول موضوعي مع توصيات واضحة.",feat:["تحليل دقيق للوضع","خيارات بإيجابياتها وسلبياتها","توصية نهائية واضحة","خطوات تنفيذية"],aud:"صاحب القرار",tone:["pro","detailed"],res:"استشارة منظّمة تنتهي بتوصية قابلة للتطبيق فوراً."},
code:{role:"أنت مطوّر برمجيات خبير تكتب كوداً نظيفاً وفعّالاً وآمناً.",idea:"أريد كوداً ينفّذ الوظيفة التي سأصفها بالكامل وقابلاً للتشغيل.",feat:["كود نظيف ومنظّم","تعليقات توضيحية","معالجة الأخطاء","قابل للتوسّع والصيانة"],aud:"مطوّرون",tone:["pro"],res:"كود كامل يعمل مع شرح موجز لتشغيله وتركيبه."},
website:{role:"أنت مصمم ويب ومطوّر واجهات خبير يبني مواقع كاملة وجميلة.",idea:"أريد موقعاً إلكترونياً كاملاً للغرض الذي سأصفه.",feat:["تصميم عصري متجاوب متقَن","أزرار وروابط شغّالة فعلاً ومربوطة","أقسام واضحة (واجهة، محتوى، تواصل)","سريع نظيف خالٍ من الأخطاء"],aud:"زوّار الموقع",tone:["pro","creative"],colors:"لوحة عصرية متناسقة",res:"موقع إلكتروني كامل يعمل بتصميم باهر خالٍ من الأخطاء جاهز للنشر."},
webapp:{role:"أنت مهندس full-stack يبني تطبيقات ويب كاملة وفعّالة.",idea:"أريد تطبيق ويب بالمميزات التي سأحدّدها.",feat:["ميزات وأزرار شغّالة فعلاً","تسجيل دخول آمن عند الحاجة","واجهة متجاوبة أنيقة","كود نظيف قابل للصيانة"],aud:"مستخدمو التطبيق",tone:["pro"],colors:"واجهة عصرية متناسقة",res:"تطبيق ويب كامل فعّال بتصميم جميل خالٍ من الأخطاء جاهز للتشغيل."},
mobileapp:{role:"أنت مطوّر ومصمم تطبيقات هاتف يبني تطبيقات كاملة متقَنة.",idea:"أريد تطبيق هاتف بالمميزات التي سأصفها.",feat:["ميزات وأزرار شغّالة فعلاً","تنقّل سلس وبديهي","واجهة جميلة عصرية","كود نظيف قابل للصيانة"],aud:"مستخدمو التطبيق",tone:["pro"],colors:"واجهة عصرية متناسقة",res:"تطبيق هاتف كامل فعّال بتصميم باهر خالٍ من الأخطاء."},
dash:{role:"أنت مهندس واجهات وتطبيقات يبني لوحات تحكم عملية وأنيقة.",idea:"أريد لوحة تحكم لموقع/تطبيق متخصص بالوظائف التي سأحدّدها.",feat:["تسجيل دخول آمن","رسوم بيانية وإحصاءات","تصميم متجاوب","إدارة محتوى سهلة"],aud:"المدير والمستخدمون",tone:["pro"],colors:"واجهة عصرية متناسقة",res:"لوحة تحكم وظيفية متجاوبة أنيقة جاهزة للتشغيل."},
service:{role:"أنت باحث دقيق تقدّم معلومات موثوقة ومحدّثة.",idea:"أريد معلومة أو خدمة دقيقة لما سأسأل عنه بمعلومات صحيحة.",feat:["معلومة دقيقة ومباشرة","مصادر موثوقة عند الحاجة","تنظيم واضح"],aud:"باحث عن معلومة",tone:["pro","concise"],res:"إجابة دقيقة موثوقة منظّمة تلبّي الحاجة مباشرة."},
image:{role:"أنت مصمم جرافيك محترف يصنع صوراً عالية الجودة وجذّابة بصرياً.",idea:"أريد صورة احترافية تعبّر عن الفكرة التي سأصفها.",feat:["تكوين متوازن","ألوان متناسقة","تفاصيل دقيقة","مظهر طبيعي احترافي"],aud:"الجمهور المستهدف بالصورة",tone:["creative","pro"],colors:"لوحة متناسقة (مثلاً أزرق سماوي + بنفسجي + لمسات بيضاء)",sizes:"1080×1080",res:"صورة عالية الدقة جاهزة للاستخدام، احترافية وطبيعية المظهر."},
logo:{role:"أنت مصمم شعارات وهوية بصرية محترف.",idea:"أريد شعاراً مميزاً للعلامة التي سأصفها.",feat:["علامة فريدة لا تُنسى","يعمل بالألوان وبالأبيض والأسود","قابل للتكبير ونظيف","يناسب شخصية العلامة"],aud:"جمهور العلامة",tone:["creative","pro"],colors:"لوحة تناسب العلامة",sizes:"متجه / مربّع",res:"شعار مميز احترافي طبيعي المظهر جاهز للاستخدام."},
slides:{role:"أنت مصمم عروض تقديمية محترف بشرائح واضحة جذّابة.",idea:"أريد عرضاً تقديمياً حول الموضوع الذي سأحدّده.",feat:["تسلسل واضح منطقي","شرائح جذّابة متّسقة","نقاط موجزة قوية","خاتمة لا تُنسى"],aud:"الجمهور",tone:["pro","edu"],colors:"لوحة نظيفة احترافية",sizes:"16:9",res:"عرض تقديمي كامل أنيق واضح جاهز للتقديم."},
social:{role:"أنت خبير تواصل اجتماعي تصنع منشورات جذّابة متّسقة مع العلامة.",idea:"أريد منشور تواصل اجتماعي حول ما سأحدّده.",feat:["خطّاف قوي","نص جذّاب متّسق","نداء واضح للفعل","وسوم مناسبة"],aud:"المتابعون المستهدفون",tone:["marketing","creative"],res:"منشور جذّاب جاهز للنشر مناسب للمنصّة المستهدفة."},
file:{role:"أنت مصمم مستندات محترف ينتج ملفات أنيقة ومنظّمة.",idea:"أريد ملفاً منسّقاً احترافياً يحتوي المحتوى الذي سأحدّده.",feat:["تنظيم واضح بعناوين","تنسيق أنيق متّسق","سهولة القراءة","جاهز للطباعة والمشاركة"],aud:"قارئ المستند",tone:["pro"],colors:"ألوان هادئة احترافية",sizes:"A4",res:"ملف نهائي أنيق منسّق بدقة جاهز للاستخدام."},
video:{role:"أنت صانع فيديو محترف بمحتوى جذّاب ومتقن الإيقاع.",idea:"أريد فيديو يعرض الفكرة التي سأصفها بأسلوب جذّاب.",feat:["افتتاحية قوية","إيقاع متناسق","عناصر بصرية واضحة","خاتمة بنداء للفعل"],aud:"مشاهد الفيديو",tone:["creative","marketing"],sizes:"1920×1080 (16:9)",res:"فيديو متكامل عالي الجودة واضح وجذّاب ومناسب للمنصّة."},
audio:{role:"أنت منتج صوتي محترف ينتج صوتاً واضحاً.",idea:"أريد محتوى صوتياً واضحاً حول ما سأحدّده.",feat:["صوت نقي واضح","إيقاع مناسب","نبرة ملائمة"],aud:"المستمع",tone:["pro"],res:"ملف صوتي واضح احترافي جاهز للاستخدام."},
convert:{role:"أنت متخصص في تحويل الصيغ مع الحفاظ على الجودة والتنسيق.",idea:"أريد تحويل المحتوى أو الملف من صيغته الحالية إلى التي سأحدّدها.",feat:["حفظ التنسيق الأصلي","دقة كاملة في النقل","ناتج جاهز للاستخدام"],aud:"",tone:["pro","concise"],res:"ملف محوّل بدقة مع الحفاظ على التنسيق والمحتوى."},
trans:{role:"أنت مترجم محترف متخصص يترجم بدقة وسلاسة مع مراعاة السياق.",idea:"أريد ترجمة احترافية للنص الذي سأرفقه تحافظ على المعنى والنبرة.",feat:["ترجمة دقيقة غير حرفية","حفظ النبرة والأسلوب","مصطلحات متخصصة دقيقة"],aud:"قارئ اللغة الهدف",tone:["pro"],res:"ترجمة طبيعية دقيقة تحافظ على المعنى والنبرة الأصلية."},
auto:{role:"أنت مهندس أتمتة تبني سير عمل دقيقاً وموثوقاً.",idea:"أريد أتمتة سير العمل الذي سأصفه كملف JSON جاهز.",feat:["محفّز واضح","خطوات مرتّبة منطقياً","معالجة الأخطاء","قابل لإعادة الاستخدام"],aud:"فريق التشغيل",tone:["pro","concise"],res:"ملف JSON صالح لسير عمل يعمل مباشرة بعد الاستيراد."},
fromfile:{role:"أنت محلّل دقيق يستخرج الإجابات من الملفات المرفقة بأمانة.",idea:"أريد إجابة دقيقة معتمدة على الملفات التي سأرفقها.",feat:["إجابة مستندة إلى الملفات حصراً","دقة في الاقتباس والاستخلاص","تنظيم واضح"],aud:"صاحب الملفات",tone:["pro","detailed"],res:"إجابة دقيقة مبنية على محتوى الملفات دون اختلاق."},
learn:{role:"أنت معلّم خبير ومرشد يبسّط المجالات المعقّدة بسرعة.",idea:"أريد إتقان أساسيات المجال الذي سأحدّده خلال وقت قصير.",feat:["خريطة طريق متدرّجة","مفاهيم أساسية مبسّطة","أمثلة عملية","تمارين قصيرة"],aud:"مبتدئ يريد التعلّم بسرعة",tone:["edu","simple"],res:"خطة تعلّم منظّمة تنقلك من الصفر إلى الأساسيات العملية بثقة."},
song:{role:"أنت كاتب أغانٍ وملحّن محترف تصوغ كلمات منسجمة ومؤثّرة.",idea:"أريد أغنية مخصّصة حول الموضوع أو الإحساس الذي سأحدّده.",feat:["بنية واضحة (مقاطع + لازمة)","قافية وإيقاع منسجمان","صور شعرية مؤثّرة","انسجام مع الإحساس"],aud:"المستمع المستهدف",tone:["creative"],res:"كلمات أغنية كاملة متماسكة مع وصف موجز للأسلوب الموسيقي."},
invent:{role:"أنت مبتكر ومخترع تطرح أفكاراً جديدة قابلة للتطبيق.",idea:"أريد ابتكار حلّ أو منتج جديد للمشكلة أو الحاجة التي سأصفها.",feat:["تحديد المشكلة بدقة","فكرة مبتكرة أصلية","شرح آلية العمل","تقييم الجدوى والخطوات"],aud:"المستفيد من الابتكار",tone:["creative","detailed"],res:"مفهوم ابتكاري متكامل واضح مع آلية عمله وإمكانية تطبيقه."},
other:{role:"أنت محترف متخصص في المجال المطلوب بالضبط.",idea:"أريد إنجاز ما سأصفه بإتقان واحترافية.",feat:["إتقان كامل للمطلوب","جودة عالية في التفاصيل","تنظيم واضح"],aud:"الجمهور المستهدف",tone:["pro"],res:"مخرَج نهائي احترافي عالي الجودة يلبّي المطلوب بدقة."}
},
fr:{
text:{role:"Vous êtes un rédacteur et éditeur professionnel à la plume claire et captivante.",idea:"Je veux un texte rédigé et bien structuré sur le sujet que je préciserai.",feat:["Structure claire avec titres","Langue correcte et fluide","Exemples si utile","Une conclusion concise"],aud:"Lecteur général",tone:["pro","simple"],res:"Un texte abouti, prêt à publier, sans erreurs et clair."},
consult:{role:"Vous êtes un consultant expert du domaine concerné, offrant une analyse précise et des solutions pratiques.",idea:"Je veux une consultation spécialisée sur mon sujet, avec des recommandations claires.",feat:["Analyse précise de la situation","Options avec avantages et inconvénients","Une recommandation finale claire","Étapes concrètes"],aud:"Décideur",tone:["pro","detailed"],res:"Une consultation structurée se terminant par une recommandation immédiatement applicable."},
code:{role:"Vous êtes un développeur expert qui écrit un code propre, efficace et sécurisé.",idea:"Je veux un code qui réalise pleinement la fonction que je décrirai et prêt à l'emploi.",feat:["Code propre et organisé","Commentaires utiles","Gestion des erreurs","Évolutif et maintenable"],aud:"Développeurs",tone:["pro"],res:"Un code complet et fonctionnel, avec une note brève pour l'exécuter et l'installer."},
website:{role:"Vous êtes un web designer senior et ingénieur front-end qui crée des sites complets et magnifiques.",idea:"Je veux un site web complet pour l'objectif que je décrirai.",feat:["Design moderne, soigné et responsive","Boutons et liens réellement fonctionnels et connectés","Sections claires (accueil, contenu, contact)","Rapide, propre, sans erreurs"],aud:"Les visiteurs du site",tone:["pro","creative"],colors:"Une palette moderne et harmonieuse",res:"Un site web complet et fonctionnel au design éclatant et sans erreurs, prêt à déployer."},
webapp:{role:"Vous êtes un ingénieur full-stack qui construit des applications web complètes et fonctionnelles.",idea:"Je veux une application web avec les fonctionnalités que je préciserai.",feat:["Fonctionnalités et boutons réellement opérationnels","Connexion sécurisée si nécessaire","Interface responsive et élégante","Code propre et maintenable"],aud:"Les utilisateurs de l'application",tone:["pro"],colors:"Une interface moderne et cohérente",res:"Une application web complète et fonctionnelle au design beau et sans erreurs, prête à l'emploi."},
mobileapp:{role:"Vous êtes un développeur et designer d'applications mobiles qui crée des apps complètes et soignées.",idea:"Je veux une application mobile avec les fonctionnalités que je décrirai.",feat:["Fonctionnalités et boutons réellement opérationnels","Navigation fluide et intuitive","Interface belle et moderne","Code propre et maintenable"],aud:"Les utilisateurs de l'application",tone:["pro"],colors:"Une interface moderne et cohérente",res:"Une application mobile complète et fonctionnelle au design éclatant et sans erreurs."},
dash:{role:"Vous êtes un ingénieur d'interfaces et d'applications qui construit des tableaux de bord pratiques et élégants.",idea:"Je veux un tableau de bord pour un site/app spécialisé avec les fonctionnalités que je préciserai.",feat:["Connexion sécurisée","Graphiques et statistiques","Design responsive","Gestion de contenu facile"],aud:"Administrateurs et utilisateurs",tone:["pro"],colors:"Une interface moderne et cohérente",res:"Un tableau de bord fonctionnel, responsive et élégant, prêt à l'emploi."},
service:{role:"Vous êtes un chercheur rigoureux fournissant des informations fiables et à jour.",idea:"Je veux une information ou un service précis pour ce que je demanderai, avec des faits exacts.",feat:["Information précise et directe","Sources fiables si nécessaire","Organisation claire"],aud:"Chercheur d'information",tone:["pro","concise"],res:"Une réponse précise, fiable et bien organisée qui répond directement au besoin."},
image:{role:"Vous êtes un graphiste professionnel créant des images de haute qualité et visuellement frappantes.",idea:"Je veux une image professionnelle exprimant l'idée que je décrirai.",feat:["Composition équilibrée","Couleurs harmonieuses","Détails fins","Rendu naturel et professionnel"],aud:"Le public cible de l'image",tone:["creative","pro"],colors:"Une palette harmonieuse (ex. bleu ciel + violet + touches blanches)",sizes:"1080×1080",res:"Une image haute résolution prête à l'emploi, professionnelle et au rendu naturel."},
logo:{role:"Vous êtes un designer professionnel de logos et d'identité de marque.",idea:"Je veux un logo distinctif pour la marque que je décrirai.",feat:["Un signe unique et mémorable","Fonctionne en couleur et en monochrome","Vectoriel et net","Adapté à la personnalité de la marque"],aud:"Le public de la marque",tone:["creative","pro"],colors:"Une palette adaptée à la marque",sizes:"Vectoriel / carré",res:"Un logo distinctif et professionnel, au rendu naturel et prêt à l'emploi."},
slides:{role:"Vous êtes un designer de présentations professionnel aux diapositives claires et attrayantes.",idea:"Je veux une présentation sur le sujet que je préciserai.",feat:["Déroulé clair et logique","Diapositives attrayantes et cohérentes","Points concis et percutants","Une conclusion mémorable"],aud:"L'auditoire",tone:["pro","edu"],colors:"Une palette épurée et professionnelle",sizes:"16:9",res:"Une présentation complète et élégante, claire et prête à présenter."},
social:{role:"Vous êtes un expert des réseaux sociaux créant des posts engageants et fidèles à la marque.",idea:"Je veux un post pour les réseaux sociaux sur ce que je préciserai.",feat:["Une accroche forte","Un texte engageant et fidèle à la marque","Un appel à l'action clair","Des hashtags adaptés"],aud:"Les abonnés cibles",tone:["marketing","creative"],res:"Un post engageant et prêt à publier, adapté à la plateforme visée."},
file:{role:"Vous êtes un concepteur de documents professionnel produisant des fichiers élégants et organisés.",idea:"Je veux un fichier mis en forme professionnellement contenant le contenu que je préciserai.",feat:["Organisation claire avec titres","Mise en forme élégante et cohérente","Facile à lire","Prêt à imprimer/partager"],aud:"Le lecteur du document",tone:["pro"],colors:"Des couleurs sobres et professionnelles",sizes:"A4",res:"Un fichier final abouti, mis en forme avec précision, prêt à l'emploi."},
video:{role:"Vous êtes un créateur vidéo professionnel au contenu captivant et bien rythmé.",idea:"Je veux une vidéo présentant l'idée que je décrirai de façon captivante.",feat:["Ouverture forte","Rythme cohérent","Éléments visuels clairs","Un appel à l'action final"],aud:"Le spectateur",tone:["creative","marketing"],sizes:"1920×1080 (16:9)",res:"Une vidéo complète et de haute qualité, claire et captivante, adaptée à la plateforme visée."},
audio:{role:"Vous êtes un producteur audio professionnel offrant un son clair et professionnel.",idea:"Je veux un contenu audio clair sur ce que je préciserai.",feat:["Son net et clair","Rythme adapté","Ton approprié"],aud:"L'auditeur",tone:["pro"],res:"Un fichier audio clair et professionnel, prêt à l'emploi."},
convert:{role:"Vous êtes un spécialiste de la conversion de formats qui préserve la qualité et la mise en forme.",idea:"Je veux convertir le contenu/fichier de son format actuel vers celui que je préciserai.",feat:["Préserver la mise en forme d'origine","Transfert parfaitement fidèle","Résultat prêt à l'emploi"],aud:"",tone:["pro","concise"],res:"Un fichier converti fidèlement, mise en forme et contenu préservés, prêt à l'emploi."},
trans:{role:"Vous êtes un traducteur spécialisé professionnel, précis et fluide, attentif au contexte.",idea:"Je veux une traduction professionnelle du texte que je joindrai, fidèle au sens et au ton.",feat:["Traduction fidèle et non littérale","Ton et style préservés","Terminologie spécialisée exacte"],aud:"Lecteur de la langue cible",tone:["pro"],res:"Une traduction naturelle et précise qui préserve le sens et le ton d'origine."},
auto:{role:"Vous êtes un ingénieur en automatisation qui construit des flux précis et fiables.",idea:"Je veux automatiser le flux que je décrirai sous forme de fichier JSON prêt à l'emploi.",feat:["Un déclencheur clair","Des étapes logiquement ordonnées","Gestion des erreurs","Réutilisable"],aud:"Équipe d'exploitation",tone:["pro","concise"],res:"Un fichier JSON valide pour un flux qui fonctionne dès l'import."},
fromfile:{role:"Vous êtes un analyste rigoureux qui extrait fidèlement les réponses des fichiers joints.",idea:"Je veux une réponse précise basée sur les fichiers que je joindrai.",feat:["Réponse fondée uniquement sur les fichiers","Citation et extraction exactes","Organisation claire"],aud:"Le propriétaire des fichiers",tone:["pro","detailed"],res:"Une réponse précise fondée sur le contenu des fichiers joints, sans invention."},
learn:{role:"Vous êtes un enseignant et mentor expert qui simplifie vite les domaines complexes.",idea:"Je veux maîtriser les bases du domaine que je préciserai en peu de temps.",feat:["Une feuille de route progressive","Concepts clés simplifiés","Exemples pratiques","Courts exercices"],aud:"Un débutant qui veut apprendre vite",tone:["edu","simple"],res:"Un plan d'apprentissage structuré qui vous mène de zéro aux bases pratiques avec confiance."},
song:{role:"Vous êtes un parolier et compositeur professionnel qui façonne des paroles harmonieuses et émouvantes.",idea:"Je veux une chanson personnalisée sur le thème/ressenti que je préciserai.",feat:["Structure claire (couplets + refrain)","Rime et rythme harmonieux","Images poétiques fortes","En accord avec le ressenti voulu"],aud:"L'auditeur cible",tone:["creative"],res:"Des paroles de chanson complètes et cohérentes, avec une note brève sur le style musical suggéré."},
invent:{role:"Vous êtes un innovateur proposant des idées nouvelles et réalisables.",idea:"Je veux inventer une solution/un produit pour le problème ou le besoin que je décrirai.",feat:["Définition précise du problème","Une idée originale et innovante","Son fonctionnement","Faisabilité et prochaines étapes"],aud:"Le bénéficiaire de l'innovation",tone:["creative","detailed"],res:"Un concept d'innovation complet et clair, avec son fonctionnement et son application."},
other:{role:"Vous êtes un professionnel spécialisé exactement dans le domaine demandé.",idea:"Je veux accomplir ce que je décrirai avec maîtrise et professionnalisme.",feat:["Maîtrise totale de la demande","Détails de haute qualité","Organisation claire"],aud:"Le public cible",tone:["pro"],res:"Un résultat final professionnel et de haute qualité qui répond précisément au besoin."}
},
it:{
text:{role:"Sei uno scrittore ed editor professionista dalla prosa chiara e coinvolgente.",idea:"Voglio un testo scritto e ben strutturato sull'argomento che specificherò.",feat:["Struttura chiara con titoli","Lingua corretta e fluida","Esempi dove utile","Una conclusione concisa"],aud:"Lettore generico",tone:["pro","simple"],res:"Un testo rifinito, pronto da pubblicare, privo di errori e chiaro."},
consult:{role:"Sei un consulente esperto del settore in questione, con analisi precise e soluzioni pratiche.",idea:"Voglio una consulenza specializzata sul mio argomento, con raccomandazioni chiare.",feat:["Analisi precisa della situazione","Opzioni con pro e contro","Una raccomandazione finale chiara","Passi concreti"],aud:"Decisore",tone:["pro","detailed"],res:"Una consulenza strutturata che si conclude con una raccomandazione subito applicabile."},
code:{role:"Sei uno sviluppatore esperto che scrive codice pulito, efficiente e sicuro.",idea:"Voglio del codice che svolga pienamente la funzione che descriverò e pronto all'uso.",feat:["Codice pulito e organizzato","Commenti utili","Gestione degli errori","Scalabile e manutenibile"],aud:"Sviluppatori",tone:["pro"],res:"Codice completo e funzionante, con una breve nota su come eseguirlo e configurarlo."},
website:{role:"Sei un web designer senior e ingegnere front-end che crea siti completi e bellissimi.",idea:"Voglio un sito web completo per lo scopo che descriverò.",feat:["Design moderno, curato e responsive","Pulsanti e link realmente funzionanti e collegati","Sezioni chiare (hero, contenuto, contatti)","Veloce, pulito, senza errori"],aud:"I visitatori del sito",tone:["pro","creative"],colors:"Una palette moderna e armoniosa",res:"Un sito web completo e funzionante dal design splendido e senza errori, pronto da pubblicare."},
webapp:{role:"Sei un ingegnere full-stack che costruisce applicazioni web complete e funzionali.",idea:"Voglio un'app web con le funzionalità che specificherò.",feat:["Funzionalità e pulsanti realmente operativi","Login sicuro se necessario","Interfaccia responsive ed elegante","Codice pulito e manutenibile"],aud:"Gli utenti dell'app",tone:["pro"],colors:"Un'interfaccia moderna e coerente",res:"Un'app web completa e funzionale dal design bello e senza errori, pronta all'uso."},
mobileapp:{role:"Sei uno sviluppatore e designer di app mobili che crea app complete e curate.",idea:"Voglio un'app mobile con le funzionalità che descriverò.",feat:["Funzionalità e pulsanti realmente operativi","Navigazione fluida e intuitiva","Interfaccia bella e moderna","Codice pulito e manutenibile"],aud:"Gli utenti dell'app",tone:["pro"],colors:"Un'interfaccia moderna e coerente",res:"Un'app mobile completa e funzionale dal design splendido e senza errori."},
dash:{role:"Sei un ingegnere di interfacce e app che costruisce dashboard pratiche ed eleganti.",idea:"Voglio una dashboard per un sito/app specializzato con le funzionalità che specificherò.",feat:["Login sicuro","Grafici e statistiche","Design responsive","Gestione dei contenuti semplice"],aud:"Amministratori e utenti",tone:["pro"],colors:"Un'interfaccia moderna e coerente",res:"Una dashboard funzionale, responsive ed elegante, pronta all'uso."},
service:{role:"Sei un ricercatore rigoroso che fornisce informazioni affidabili e aggiornate.",idea:"Voglio un'informazione o un servizio preciso per ciò che chiederò, con dati corretti.",feat:["Informazione precisa e diretta","Fonti affidabili dove necessario","Organizzazione chiara"],aud:"Chi cerca informazioni",tone:["pro","concise"],res:"Una risposta precisa, affidabile e ben organizzata che soddisfa direttamente l'esigenza."},
image:{role:"Sei un grafico professionista che crea immagini di alta qualità e di forte impatto visivo.",idea:"Voglio un'immagine professionale che esprima l'idea che descriverò.",feat:["Composizione equilibrata","Colori armoniosi","Dettagli fini","Resa naturale e professionale"],aud:"Il pubblico di destinazione dell'immagine",tone:["creative","pro"],colors:"Una palette armoniosa (es. azzurro + viola + tocchi bianchi)",sizes:"1080×1080",res:"Un'immagine ad alta risoluzione pronta all'uso, professionale e dall'aspetto naturale."},
logo:{role:"Sei un designer professionista di logo e identità di marca.",idea:"Voglio un logo distintivo per il marchio che descriverò.",feat:["Un segno unico e memorabile","Funziona a colori e in monocromia","Vettoriale e pulito","Adatto alla personalità del marchio"],aud:"Il pubblico del marchio",tone:["creative","pro"],colors:"Una palette adatta al marchio",sizes:"Vettoriale / quadrato",res:"Un logo distintivo e professionale, dall'aspetto naturale e pronto all'uso."},
slides:{role:"Sei un designer di presentazioni professionista con slide chiare e accattivanti.",idea:"Voglio una presentazione sull'argomento che specificherò.",feat:["Sviluppo chiaro e logico","Slide accattivanti e coerenti","Punti concisi ed efficaci","Una chiusura memorabile"],aud:"Il pubblico",tone:["pro","edu"],colors:"Una palette pulita e professionale",sizes:"16:9",res:"Una presentazione completa ed elegante, chiara e pronta da presentare."},
social:{role:"Sei un esperto di social media che crea post coinvolgenti e coerenti con il brand.",idea:"Voglio un post per i social su ciò che specificherò.",feat:["Un gancio forte","Un testo coinvolgente e coerente col brand","Una call to action chiara","Hashtag adatti"],aud:"I follower target",tone:["marketing","creative"],res:"Un post coinvolgente e pronto da pubblicare, adatto alla piattaforma target."},
file:{role:"Sei un designer di documenti professionista che produce file eleganti e organizzati.",idea:"Voglio un file formattato professionalmente che contenga il contenuto che specificherò.",feat:["Organizzazione chiara con titoli","Formattazione elegante e coerente","Facile da leggere","Pronto da stampare/condividere"],aud:"Il lettore del documento",tone:["pro"],colors:"Colori sobri e professionali",sizes:"A4",res:"Un file finale rifinito, formattato con precisione, pronto all'uso."},
video:{role:"Sei un creatore video professionista con contenuti coinvolgenti e ben ritmati.",idea:"Voglio un video che presenti l'idea che descriverò in modo coinvolgente.",feat:["Apertura forte","Ritmo coerente","Elementi visivi chiari","Una call to action finale"],aud:"Lo spettatore",tone:["creative","marketing"],sizes:"1920×1080 (16:9)",res:"Un video completo e di alta qualità, chiaro e coinvolgente, adatto alla piattaforma target."},
audio:{role:"Sei un produttore audio professionista che offre un suono chiaro e professionale.",idea:"Voglio un contenuto audio chiaro su ciò che specificherò.",feat:["Suono nitido e chiaro","Ritmo adeguato","Tono appropriato"],aud:"L'ascoltatore",tone:["pro"],res:"Un file audio chiaro e professionale, pronto all'uso."},
convert:{role:"Sei uno specialista della conversione di formati che preserva qualità e formattazione.",idea:"Voglio convertire il contenuto/file dal formato attuale a quello che specificherò.",feat:["Preservare la formattazione originale","Trasferimento perfettamente fedele","Risultato pronto all'uso"],aud:"",tone:["pro","concise"],res:"Un file convertito fedelmente, con formattazione e contenuto preservati, pronto all'uso."},
trans:{role:"Sei un traduttore specializzato professionista, preciso e fluido, attento al contesto.",idea:"Voglio una traduzione professionale del testo che allegherò, fedele al significato e al tono.",feat:["Traduzione fedele e non letterale","Tono e stile preservati","Terminologia specializzata accurata"],aud:"Lettore della lingua di destinazione",tone:["pro"],res:"Una traduzione naturale e precisa che preserva il significato e il tono originali."},
auto:{role:"Sei un ingegnere dell'automazione che costruisce flussi precisi e affidabili.",idea:"Voglio automatizzare il flusso che descriverò come file JSON pronto all'uso.",feat:["Un trigger chiaro","Passi ordinati logicamente","Gestione degli errori","Riutilizzabile"],aud:"Team operativo",tone:["pro","concise"],res:"Un file JSON valido per un flusso che funziona subito dopo l'importazione."},
fromfile:{role:"Sei un analista rigoroso che estrae fedelmente le risposte dai file allegati.",idea:"Voglio una risposta precisa basata sui file che allegherò.",feat:["Risposta basata solo sui file","Citazione ed estrazione accurate","Organizzazione chiara"],aud:"Il proprietario dei file",tone:["pro","detailed"],res:"Una risposta precisa basata sul contenuto dei file allegati, senza invenzioni."},
learn:{role:"Sei un insegnante e mentore esperto che semplifica in fretta i campi complessi.",idea:"Voglio padroneggiare le basi del campo che specificherò in poco tempo.",feat:["Una roadmap progressiva","Concetti chiave semplificati","Esempi pratici","Brevi esercizi"],aud:"Un principiante che vuole imparare in fretta",tone:["edu","simple"],res:"Un piano di apprendimento strutturato che ti porta da zero alle basi pratiche con sicurezza."},
song:{role:"Sei un paroliere e compositore professionista che crea testi armoniosi ed emozionanti.",idea:"Voglio una canzone personalizzata sul tema/sentimento che specificherò.",feat:["Struttura chiara (strofe + ritornello)","Rima e ritmo armoniosi","Immagini poetiche forti","In sintonia con il sentimento voluto"],aud:"L'ascoltatore target",tone:["creative"],res:"Un testo di canzone completo e coerente, con una breve nota sullo stile musicale suggerito."},
invent:{role:"Sei un innovatore che propone idee nuove e realizzabili.",idea:"Voglio inventare una soluzione/un prodotto per il problema o l'esigenza che descriverò.",feat:["Definizione precisa del problema","Un'idea originale e innovativa","Come funziona","Fattibilità e prossimi passi"],aud:"Il beneficiario dell'innovazione",tone:["creative","detailed"],res:"Un concept d'innovazione completo e chiaro, con il suo funzionamento e la sua applicazione."},
other:{role:"Sei un professionista specializzato esattamente nel campo richiesto.",idea:"Voglio realizzare ciò che descriverò con padronanza e professionalità.",feat:["Padronanza totale della richiesta","Dettagli di alta qualità","Organizzazione chiara"],aud:"Il pubblico target",tone:["pro"],res:"Un risultato finale professionale e di alta qualità che soddisfa con precisione l'esigenza."}
},
de:{
text:{role:"Du bist ein professioneller Autor und Lektor mit klarer, fesselnder Sprache.",idea:"Ich möchte einen gut strukturierten Text zu dem von mir genannten Thema.",feat:["Klare Struktur mit Überschriften","Korrekte, flüssige Sprache","Beispiele, wo sinnvoll","Ein knappes Fazit"],aud:"Allgemeiner Leser",tone:["pro","simple"],res:"Ein ausgefeilter, veröffentlichungsreifer Text, fehlerfrei und klar."},
consult:{role:"Du bist ein Fachberater im betreffenden Bereich mit präziser Analyse und praktischen Lösungen.",idea:"Ich möchte eine fachkundige Beratung zu meinem Thema mit klaren Empfehlungen.",feat:["Präzise Situationsanalyse","Optionen mit Vor- und Nachteilen","Eine klare Endempfehlung","Konkrete Schritte"],aud:"Entscheidungsträger",tone:["pro","detailed"],res:"Eine strukturierte Beratung, die mit einer sofort umsetzbaren Empfehlung endet."},
code:{role:"Du bist ein erfahrener Softwareentwickler, der sauberen, effizienten und sicheren Code schreibt.",idea:"Ich möchte Code, der die von mir beschriebene Funktion vollständig erfüllt und lauffähig ist.",feat:["Sauberer, organisierter Code","Hilfreiche Kommentare","Fehlerbehandlung","Skalierbar und wartbar"],aud:"Entwickler",tone:["pro"],res:"Vollständiger, funktionierender Code mit einer kurzen Notiz zur Ausführung und Einrichtung."},
website:{role:"Du bist ein erfahrener Webdesigner und Frontend-Entwickler, der komplette, schöne Websites baut.",idea:"Ich möchte eine komplette Website für den von mir beschriebenen Zweck.",feat:["Modernes, ausgefeiltes, responsives Design","Wirklich funktionierende, verdrahtete Schaltflächen und Links","Klare Abschnitte (Hero, Inhalt, Kontakt)","Schnell, sauber, fehlerfrei"],aud:"Die Besucher der Website",tone:["pro","creative"],colors:"Eine moderne, harmonische Palette",res:"Eine komplette, funktionierende Website mit atemberaubendem, fehlerfreiem Design, bereit zur Veröffentlichung."},
webapp:{role:"Du bist ein Full-Stack-Entwickler, der komplette, funktionale Web-Apps baut.",idea:"Ich möchte eine Web-App mit den von mir genannten Funktionen.",feat:["Wirklich funktionierende Funktionen und Schaltflächen","Sichere Anmeldung bei Bedarf","Responsive, elegante Oberfläche","Sauberer, wartbarer Code"],aud:"Die Nutzer der App",tone:["pro"],colors:"Eine moderne, konsistente Oberfläche",res:"Eine komplette, funktionale Web-App mit schönem, fehlerfreiem Design, bereit zum Einsatz."},
mobileapp:{role:"Du bist ein Mobile-App-Entwickler und -Designer, der komplette, ausgefeilte Apps baut.",idea:"Ich möchte eine mobile App mit den von mir beschriebenen Funktionen.",feat:["Wirklich funktionierende Funktionen und Schaltflächen","Flüssige, intuitive Navigation","Schöne, moderne Oberfläche","Sauberer, wartbarer Code"],aud:"Die Nutzer der App",tone:["pro"],colors:"Eine moderne, konsistente Oberfläche",res:"Eine komplette, funktionale mobile App mit atemberaubendem, fehlerfreiem Design."},
dash:{role:"Du bist ein Oberflächen- und App-Entwickler, der praktische, elegante Dashboards baut.",idea:"Ich möchte ein Dashboard für eine spezialisierte Website/App mit den von mir genannten Funktionen.",feat:["Sichere Anmeldung","Diagramme und Statistiken","Responsives Design","Einfache Inhaltsverwaltung"],aud:"Administratoren und Nutzer",tone:["pro"],colors:"Eine moderne, konsistente Oberfläche",res:"Ein funktionales, responsives, elegantes Dashboard, bereit zum Einsatz."},
service:{role:"Du bist ein gewissenhafter Rechercheur, der zuverlässige, aktuelle Informationen liefert.",idea:"Ich möchte eine genaue Information oder Leistung zu meiner Frage, mit korrekten Fakten.",feat:["Genaue, direkte Information","Zuverlässige Quellen, wo nötig","Klare Gliederung"],aud:"Informationssuchender",tone:["pro","concise"],res:"Eine genaue, zuverlässige, gut gegliederte Antwort, die den Bedarf direkt erfüllt."},
image:{role:"Du bist ein professioneller Grafikdesigner, der hochwertige, visuell eindrucksvolle Bilder erstellt.",idea:"Ich möchte ein professionelles Bild, das die von mir beschriebene Idee ausdrückt.",feat:["Ausgewogene Komposition","Harmonische Farben","Feine Details","Natürliche, professionelle Wirkung"],aud:"Die Zielgruppe des Bildes",tone:["creative","pro"],colors:"Eine harmonische Palette (z. B. Himmelblau + Violett + weiße Akzente)",sizes:"1080×1080",res:"Ein hochauflösendes, einsatzbereites Bild, professionell und natürlich wirkend."},
logo:{role:"Du bist ein professioneller Logo- und Markenidentitäts-Designer.",idea:"Ich möchte ein unverwechselbares Logo für die von mir beschriebene Marke.",feat:["Ein einzigartiges, einprägsames Zeichen","Funktioniert in Farbe und Schwarzweiß","Skalierbar und sauber","Passt zur Persönlichkeit der Marke"],aud:"Das Publikum der Marke",tone:["creative","pro"],colors:"Eine zur Marke passende Palette",sizes:"Vektor / quadratisch",res:"Ein unverwechselbares, professionelles Logo, natürlich wirkend und einsatzbereit."},
slides:{role:"Du bist ein professioneller Präsentationsdesigner mit klaren, ansprechenden Folien.",idea:"Ich möchte eine Präsentation zu dem von mir genannten Thema.",feat:["Klarer, logischer Aufbau","Ansprechende, konsistente Folien","Knappe, starke Punkte","Ein einprägsamer Abschluss"],aud:"Das Publikum",tone:["pro","edu"],colors:"Eine klare, professionelle Palette",sizes:"16:9",res:"Eine komplette, elegante Präsentation, klar und bereit zum Vortragen."},
social:{role:"Du bist ein Social-Media-Experte, der ansprechende, markenkonforme Posts erstellt.",idea:"Ich möchte einen Social-Media-Post zu dem von mir genannten Thema.",feat:["Ein starker Aufhänger","Ansprechender, markenkonformer Text","Ein klarer Call-to-Action","Passende Hashtags"],aud:"Die Ziel-Follower",tone:["marketing","creative"],res:"Ein ansprechender, veröffentlichungsreifer Post, passend zur Zielplattform."},
file:{role:"Du bist ein professioneller Dokumentdesigner, der elegante, organisierte Dateien erstellt.",idea:"Ich möchte eine professionell formatierte Datei mit dem von mir genannten Inhalt.",feat:["Klare Gliederung mit Überschriften","Elegante, konsistente Formatierung","Gut lesbar","Druck-/teilbereit"],aud:"Der Leser des Dokuments",tone:["pro"],colors:"Ruhige, professionelle Farben",sizes:"A4",res:"Eine ausgefeilte, präzise formatierte finale Datei, einsatzbereit."},
video:{role:"Du bist ein professioneller Videoersteller mit fesselnden, gut getakteten Inhalten.",idea:"Ich möchte ein Video, das die von mir beschriebene Idee fesselnd präsentiert.",feat:["Starker Einstieg","Konsistentes Tempo","Klare visuelle Elemente","Ein abschließender Call-to-Action"],aud:"Der Zuschauer",tone:["creative","marketing"],sizes:"1920×1080 (16:9)",res:"Ein komplettes, hochwertiges Video, klar und fesselnd, passend zur Zielplattform."},
audio:{role:"Du bist ein professioneller Audioproduzent, der klaren, professionellen Klang liefert.",idea:"Ich möchte klaren Audioinhalt zu dem von mir genannten Thema.",feat:["Sauberer, klarer Klang","Passendes Tempo","Angemessener Ton"],aud:"Der Hörer",tone:["pro"],res:"Eine klare, professionelle Audiodatei, einsatzbereit."},
convert:{role:"Du bist ein Spezialist für Formatkonvertierung, der Qualität und Formatierung bewahrt.",idea:"Ich möchte den Inhalt/die Datei vom aktuellen Format in das von mir genannte umwandeln.",feat:["Originalformatierung bewahren","Vollständig getreue Übertragung","Ergebnis einsatzbereit"],aud:"",tone:["pro","concise"],res:"Eine getreu konvertierte Datei mit erhaltener Formatierung und Inhalt, einsatzbereit."},
trans:{role:"Du bist ein professioneller Fachübersetzer, präzise und flüssig, mit Blick auf den Kontext.",idea:"Ich möchte eine professionelle Übersetzung des beigefügten Textes, treu in Bedeutung und Ton.",feat:["Getreue, nicht wörtliche Übersetzung","Erhaltener Ton und Stil","Genaue Fachterminologie"],aud:"Leser der Zielsprache",tone:["pro"],res:"Eine natürliche, genaue Übersetzung, die Bedeutung und Ton des Originals bewahrt."},
auto:{role:"Du bist ein Automatisierungsingenieur, der präzise, zuverlässige Abläufe baut.",idea:"Ich möchte den von mir beschriebenen Ablauf als einsatzbereite JSON-Datei automatisieren.",feat:["Ein klarer Auslöser","Logisch geordnete Schritte","Fehlerbehandlung","Wiederverwendbar"],aud:"Betriebsteam",tone:["pro","concise"],res:"Eine gültige JSON-Datei für einen Ablauf, der direkt nach dem Import läuft."},
fromfile:{role:"Du bist ein gewissenhafter Analyst, der Antworten getreu aus den beigefügten Dateien extrahiert.",idea:"Ich möchte eine genaue Antwort auf Basis der von mir beigefügten Dateien.",feat:["Antwort ausschließlich auf Basis der Dateien","Genaues Zitieren und Extrahieren","Klare Gliederung"],aud:"Der Eigentümer der Dateien",tone:["pro","detailed"],res:"Eine genaue Antwort auf Basis des Inhalts der beigefügten Dateien, ohne Erfindungen."},
learn:{role:"Du bist ein erfahrener Lehrer und Mentor, der komplexe Bereiche schnell vereinfacht.",idea:"Ich möchte die Grundlagen des von mir genannten Bereichs in kurzer Zeit meistern.",feat:["Eine schrittweise Roadmap","Vereinfachte Kernkonzepte","Praktische Beispiele","Kurze Übungen"],aud:"Ein Anfänger, der schnell lernen will",tone:["edu","simple"],res:"Ein strukturierter Lernplan, der dich sicher von null zu den praktischen Grundlagen führt."},
song:{role:"Du bist ein professioneller Songwriter und Komponist, der harmonische, bewegende Texte schreibt.",idea:"Ich möchte einen eigenen Song zu dem von mir genannten Thema/Gefühl.",feat:["Klare Struktur (Strophen + Refrain)","Harmonischer Reim und Rhythmus","Starke poetische Bilder","Passend zum beabsichtigten Gefühl"],aud:"Der Ziel-Hörer",tone:["creative"],res:"Ein vollständiger, kohärenter Songtext mit einer kurzen Notiz zum vorgeschlagenen Musikstil."},
invent:{role:"Du bist ein Innovator, der neue, umsetzbare Ideen vorschlägt.",idea:"Ich möchte eine Lösung/ein Produkt für das von mir beschriebene Problem oder den Bedarf erfinden.",feat:["Präzise Problemdefinition","Eine originelle, innovative Idee","Wie es funktioniert","Machbarkeit und nächste Schritte"],aud:"Der Nutznießer der Innovation",tone:["creative","detailed"],res:"Ein vollständiges, klares Innovationskonzept mit Funktionsweise und Anwendung."},
other:{role:"Du bist ein Profi, der genau auf das angefragte Gebiet spezialisiert ist.",idea:"Ich möchte das von mir Beschriebene mit Können und Professionalität umsetzen.",feat:["Volle Beherrschung der Anfrage","Hochwertige Details","Klare Gliederung"],aud:"Die Zielgruppe",tone:["pro"],res:"Ein professionelles, hochwertiges Endergebnis, das den Bedarf präzise erfüllt."}
}
};
function el(t,c,h){const e=document.createElement(t);if(c)e.className=c;if(h!=null)e.innerHTML=h;return e;}
function esc(s){return String(s==null?"":s).replace(/[&<>"]/g,m=>({"&":"&","<":"<",">":">","\"":"""}[m]));}
function L(o){return o&&(o[lang]!=null?o[lang]:o.en);}
function getInfo(key){if(key==="choices")return UI[lang].infoChoices;if(key==="keywords")return UI[lang].kwInfo;for(const f of FIELDS){if(f.id===key)return L(f.info);if(f.children)for(const c of f.children)if(c.id===key)return L(c.info);}return "";}
function infoBtn(key){const b=el("button","info");b.type="button";b.textContent="!";b.setAttribute("data-info",key);b.setAttribute("aria-label","info");return b;}
function renderChoices(){const box=document.getElementById("choices");box.innerHTML="";CHOICES.forEach(c=>{const b=el("button","chip");b.type="button";b.dataset.id=c.id;b.setAttribute("aria-pressed",selected.has(c.id)?"true":"false");b.innerHTML='<span class="emo">'+c.emo+'</span><span class="nm" data-cl="'+c.id+'">'+esc(L(c.label))+'</span><span class="tick" aria-hidden="true">✦</span>';b.onclick=()=>{if(selected.has(c.id)){selected.delete(c.id);b.setAttribute("aria-pressed","false");}else{selected.add(c.id);b.setAttribute("aria-pressed","true");burst(b);}scheduleSave();updateMeters();syncPreview();};box.appendChild(b);});}
function makeInput(f,area){const e=document.createElement(area?"textarea":"input");if(!area)e.type="text";e.id="f_"+f.id;e.setAttribute("placeholder",L(f.ph));e.addEventListener("input",touch);return e;}
function makeList(f){const wrap=el("div");const box=el("div","list");box.id="list_"+f.id;wrap.appendChild(box);const add=el("button","addbtn");add.type="button";add.innerHTML='<span class="p" aria-hidden="true">+</span><span class="atx">'+esc(UI[lang].add)+'</span>';add.onclick=()=>{addItem(f,box);};wrap.appendChild(add);addItem(f,box);return wrap;}
function addItem(f,box){box=box||document.getElementById("list_"+f.id);if(!box)return;const row=el("div","item");const inp=el("input");inp.type="text";inp.setAttribute("placeholder",L(f.ph));inp.addEventListener("input",touch);const del=el("button","iconbtn minus");del.type="button";del.textContent="−";del.setAttribute("aria-label",UI[lang].del);del.onclick=()=>{row.remove();touch();};row.appendChild(inp);row.appendChild(del);box.appendChild(row);}
function makeYesNo(f){const seg=el("div","seg");seg.id="seg_"+f.id;const y=el("button");y.type="button";y.setAttribute("data-yn-yes","1");y.textContent=UI[lang].yes;y.setAttribute("aria-pressed","false");const n=el("button");n.type="button";n.setAttribute("data-yn-no","1");n.textContent=UI[lang].no;n.setAttribute("aria-pressed","true");y.onclick=()=>{y.setAttribute("aria-pressed","true");n.setAttribute("aria-pressed","false");touch();};n.onclick=()=>{n.setAttribute("aria-pressed","true");y.setAttribute("aria-pressed","false");touch();};seg.appendChild(y);seg.appendChild(n);return seg;}
function makeChips(f){const wrap=el("div","tonewrap");wrap.id="chips_"+f.id;f.options.forEach(o=>{const p=el("button","pill");p.type="button";p.setAttribute("data-opt",o.id);p.setAttribute("data-tl",f.id+"_"+o.id);p.setAttribute("aria-pressed","false");p.textContent=L(o.label);p.onclick=()=>{p.setAttribute("aria-pressed",p.getAttribute("aria-pressed")==="true"?"false":"true");touch();};wrap.appendChild(p);});return wrap;}
let uploads=[];
function fmtSize(b){if(b<1024)return b+" B";if(b<1048576)return (b/1024).toFixed(0)+" KB";return (b/1048576).toFixed(1)+" MB";}
function dataURLtoBytes(url){const b64=(url.split(",")[1]||"");const bin=atob(b64);const arr=new Uint8Array(bin.length);for(let i=0;i<bin.length;i++)arr[i]=bin.charCodeAt(i);return arr;}
function makeUpload(f){const wrap=el("div");const drop=el("label","dropzone");drop.innerHTML='<span class="dz-ic" aria-hidden="true">⬆</span><span class="dz-tx">'+esc(UI[lang].dzText||"Upload")+'</span><input class="dz-input" type="file" multiple aria-label="upload">';const inp=drop.querySelector(".dz-input");inp.addEventListener("change",e=>{handleUploads(e.target.files);inp.value="";});const prev=el("div","ups");prev.id="upsPrev";wrap.appendChild(drop);wrap.appendChild(prev);return wrap;}
function handleUploads(fileList){const files=[...fileList];let pending=files.length;if(!pending)return;files.forEach(file=>{const rd=new FileReader();rd.onload=ev=>{const url=ev.target.result;const isImg=/^image\//.test(file.type);const item={name:file.name,type:file.type||"",size:file.size,isImage:isImg,url,w:0,h:0};uploads.push(item);if(isImg){const im=new Image();im.onload=()=>{item.w=im.naturalWidth;item.h=im.naturalHeight;renderUploads();};im.onerror=renderUploads;im.src=url;}renderUploads();if(--pending===0)touch();};rd.onerror=()=>{if(--pending===0)touch();};rd.readAsDataURL(file);});}
function renderUploads(){const box=document.getElementById("upsPrev");if(!box)return;box.innerHTML=uploads.map((u,i)=>{const inner=u.isImage?'<img src="'+u.url+'" alt="">':'<span class="up-file" aria-hidden="true">'+(/^audio\//.test(u.type)?"🎵":/^video\//.test(u.type)?"🎬":/pdf/.test(u.type)?"📄":"📎")+'</span>';return '<div class="up">'+'<button class="up-x" type="button" data-rm="'+i+'" aria-label="remove">×</button>'+inner+'<span class="up-nm">'+esc(u.name)+'</span><span class="up-sz">'+fmtSize(u.size)+'</span></div>';}).join("");box.querySelectorAll("[data-rm]").forEach(b=>b.onclick=()=>{uploads.splice(+b.getAttribute("data-rm"),1);renderUploads();touch();});}
function buildRow(f){const row=el("div","row");const left=el("div","stage-l");left.innerHTML='<span class="dot" aria-hidden="true"></span><span class="nm" data-fl="'+f.id+'">'+esc(L(f.label))+'</span>';left.appendChild(infoBtn(f.id));const ctrl=el("div","ctrl");
if(f.type==="textarea"){ctrl.appendChild(makeInput(f,true));if(f.voice)ctrl.appendChild(micBtn("f_"+f.id));}
else if(f.type==="text"){ctrl.appendChild(makeInput(f,false));if(f.id==="colors")ctrl.appendChild(colorWidget());else if(f.id==="sizes")ctrl.appendChild(sizeWidget());}
else if(f.type==="list")ctrl.appendChild(makeList(f));
else if(f.type==="yesno")ctrl.appendChild(makeYesNo(f));
else if(f.type==="chips")ctrl.appendChild(makeChips(f));
else if(f.type==="upload")ctrl.appendChild(makeUpload(f));
else if(f.type==="draw")ctrl.appendChild(drawWidget(f));
else if(f.type==="group"){const g=el("div","subgroup");f.children.forEach(ch=>{const sf=el("div","subfield");const lab=el("div","slab");lab.innerHTML='<span data-fl="'+ch.id+'">'+esc(L(ch.label))+'</span>';lab.appendChild(infoBtn(ch.id));const inp=makeInput(ch,false);sf.appendChild(lab);sf.appendChild(inp);if(ch.id==="colors")sf.appendChild(colorWidget(inp));else if(ch.id==="sizes")sf.appendChild(sizeWidget(inp));g.appendChild(sf);});ctrl.appendChild(g);}
row.appendChild(left);row.appendChild(ctrl);return row;}
function renderForm(){const f=document.getElementById("form");f.innerHTML="";const more=document.getElementById("formMore");if(more)more.innerHTML="";FIELDS.forEach(fl=>{(CORE.includes(fl.id)||!more?f:more).appendChild(buildRow(fl));});}
function localizeFields(){
CHOICES.forEach(c=>{const s=document.querySelector('[data-cl="'+c.id+'"]');if(s)s.textContent=L(c.label);});
FIELDS.forEach(f=>{
document.querySelectorAll('[data-fl="'+f.id+'"]').forEach(n=>n.textContent=L(f.label));
if(f.type==="text"||f.type==="textarea"){const e=document.getElementById("f_"+f.id);if(e)e.setAttribute("placeholder",L(f.ph));}
if(f.type==="group")f.children.forEach(ch=>{document.querySelectorAll('[data-fl="'+ch.id+'"]').forEach(n=>n.textContent=L(ch.label));const ce=document.getElementById("f_"+ch.id);if(ce)ce.setAttribute("placeholder",L(ch.ph));});
if(f.type==="list"){const box=document.getElementById("list_"+f.id);if(box){box.querySelectorAll(".item input").forEach(i=>i.setAttribute("placeholder",L(f.ph)));const at=box.parentNode&&box.parentNode.querySelector(".atx");if(at)at.textContent=UI[lang].add;box.querySelectorAll(".iconbtn.minus").forEach(b=>b.setAttribute("aria-label",UI[lang].del));}}
if(f.type==="chips")f.options.forEach(o=>{const op=document.querySelector('[data-tl="'+f.id+"_"+o.id+'"]');if(op)op.textContent=L(o.label);});
});
document.querySelectorAll('[data-yn-yes]').forEach(b=>b.textContent=UI[lang].yes);
document.querySelectorAll('[data-yn-no]').forEach(b=>b.textContent=UI[lang].no);
}
function val(id){const e=document.getElementById("f_"+id);return e?e.value.trim():"";}
function listVals(id){const box=document.getElementById("list_"+id);if(!box)return [];return [...box.querySelectorAll(".item input")].map(i=>i.value.trim()).filter(Boolean);}
function yn(id){const s=document.getElementById("seg_"+id);if(!s)return "no";const y=s.querySelector('[data-yn-yes]');return y&&y.getAttribute("aria-pressed")==="true"?"yes":"no";}
function chipVals(id){const w=document.getElementById("chips_"+id);if(!w)return [];return [...w.querySelectorAll('.pill[aria-pressed="true"]')].map(p=>p.getAttribute("data-opt"));}
function toneLabel(optid){const f=FIELDS.find(x=>x.id==="tone");const o=f.options.find(x=>x.id===optid);return o?L(o.label):optid;}
function setMoreOpen(open){const m=document.getElementById("formMore"),b=document.getElementById("moreToggle");if(!m||!b)return;if(open){m.removeAttribute("hidden");b.classList.add("open");b.setAttribute("aria-expanded","true");}else{m.setAttribute("hidden","");b.classList.remove("open");b.setAttribute("aria-expanded","false");}}
function toggleMore(){const m=document.getElementById("formMore");setMoreOpen(!!m&&m.hasAttribute("hidden"));}
function moreHasContent(){return FIELDS.some(f=>{if(CORE.includes(f.id))return false;if(f.type==="group")return f.children.some(c=>val(c.id));if(f.type==="list")return listVals(f.id).length;if(f.type==="yesno")return yn(f.id)==="yes";if(f.type==="chips")return chipVals(f.id).length;return val(f.id);});}
function ctxNow(){const has=(a)=>a.some(x=>selected.has(x));const ids=[...selected];const onlyAudio=ids.length>0&&ids.every(x=>x==="audio");return {media:has(["image","video","song","convert","logo"]),web:has(["website","webapp","mobileapp","dash"]),dev:has(["code","webapp","website","mobileapp","dash","auto","debug"]),fileLogo:yn("attachments")==="yes"||has(["file","image","convert","logo","fromfile"]),rtl:!onlyAudio};}
function activeRules(){const ctx=ctxNow();return RULES.filter(r=>{const c=r.cond;if(c==="always")return true;if(c in ctx)return ctx[c];return selected.has(c);});}
function sep(){return lang==="ar"?"، ":", ";}
const ANGLES=[
{t:["technical","advanced","developer","engineer"," code","coding","api","algorithm","programming","تقني","متقدم","مطور","مبرمج","برمجة","خوارزمية","technique","tecnico","technisch"],d:{en:"Be technically precise and in-depth: include concrete technical detail, correct terminology, edge cases and, where relevant, working examples or code that can be used directly.",ar:"كن دقيقاً تقنياً ومتعمّقاً: أدرِج تفاصيل تقنية ملموسة، ومصطلحات صحيحة، والحالات الحدّية، وعند الحاجة أمثلة عملية أو كوداً قابلاً للاستخدام مباشرة.",fr:"Soyez techniquement précis et approfondi : incluez des détails techniques concrets, une terminologie correcte, les cas limites et, le cas échéant, des exemples ou du code directement utilisables.",it:"Sii tecnicamente preciso e approfondito: includi dettagli tecnici concreti, terminologia corretta, casi limite e, se pertinente, esempi o codice utilizzabili direttamente.",de:"Sei technisch präzise und tiefgehend: füge konkrete technische Details, korrekte Terminologie, Randfälle und – wo relevant – direkt nutzbare Beispiele oder Code hinzu."}},
{t:["marketing","sell","sales","persuasive","convert","promote"," ad","advert","campaign","تسويق","بيع","مبيعات","إقناع","ترويج","إعلان","حملة","vendre","vendita","verkauf","werbung"],d:{en:"Make it persuasive and conversion-focused: lead with the core benefit, speak to the audience's motivations, and end with a clear, compelling call to action.",ar:"اجعله مقنعاً ومركّزاً على التحويل: ابدأ بالفائدة الأساسية، وخاطب دوافع الجمهور، واختم بنداء واضح ومقنع للفعل.",fr:"Rendez-le persuasif et orienté conversion : mettez en avant le bénéfice clé, parlez aux motivations de l'audience et terminez par un appel à l'action clair et convaincant.",it:"Rendilo persuasivo e orientato alla conversione: parti dal beneficio chiave, parla alle motivazioni del pubblico e chiudi con una call to action chiara e convincente.",de:"Mache es überzeugend und conversion-orientiert: stelle den Kernnutzen voran, sprich die Motive der Zielgruppe an und schließe mit einem klaren, überzeugenden Call-to-Action."}},
{t:["academic","research","scientific","study","thesis","cite","scholar","أكاديمي","بحث","علمي","دراسة","أطروحة","مرجع","académique","accademico","akademisch","wissenschaftlich"],d:{en:"Be rigorous and well-structured, like academic work: stay accurate and objective, organise the content logically, and support key claims with sound reasoning.",ar:"كن صارماً ومنظّماً كالعمل الأكاديمي: التزم الدقة والموضوعية، ونظّم المحتوى منطقياً، وادعم الادعاءات الأساسية بحجج سليمة.",fr:"Soyez rigoureux et bien structuré, comme un travail académique : restez exact et objectif, organisez le contenu logiquement et étayez les points clés par un raisonnement solide.",it:"Sii rigoroso e ben strutturato, come un lavoro accademico: resta accurato e obiettivo, organizza i contenuti in modo logico e sostieni le affermazioni chiave con argomentazioni solide.",de:"Sei rigoros und gut strukturiert wie eine akademische Arbeit: bleibe genau und objektiv, gliedere den Inhalt logisch und stütze zentrale Aussagen mit fundierter Argumentation."}},
{t:["beginner","simple","easy","basic","explain","newbie","edu","مبتدئ","بسيط","سهل","اشرح","شرح","للمبتدئين","débutant","facile","principiante","anfänger","einfach"],d:{en:"Explain everything in simple, beginner-friendly language: avoid jargon, define any necessary terms, and use clear step-by-step guidance and concrete examples a newcomer can follow.",ar:"اشرح كل شيء بلغة بسيطة مناسبة للمبتدئين: تجنّب المصطلحات المعقّدة، وعرّف أي مصطلح ضروري، واستخدم خطوات واضحة وأمثلة ملموسة يسهل على المبتدئ متابعتها.",fr:"Expliquez tout dans un langage simple, adapté aux débutants : évitez le jargon, définissez les termes nécessaires et donnez des étapes claires et des exemples concrets faciles à suivre.",it:"Spiega tutto con un linguaggio semplice e adatto ai principianti: evita il gergo, definisci i termini necessari e usa passaggi chiari ed esempi concreti facili da seguire.",de:"Erkläre alles in einfacher, anfängerfreundlicher Sprache: vermeide Fachjargon, definiere nötige Begriffe und nutze klare Schritt-für-Schritt-Anleitungen und konkrete Beispiele."}},
{t:["creative","fun","catchy","original","unique","funny","witty","إبداعي","مبدع","مرح","جذاب","أصلي","فريد","مبتكر","créatif","creativo","kreativ"],d:{en:"Be bold and genuinely creative: offer original, memorable, non-generic ideas with a distinctive voice, and avoid clichés and predictable, templated answers.",ar:"كن جريئاً ومبدعاً فعلاً: قدّم أفكاراً أصيلة لا تُنسى وغير تقليدية بأسلوب مميّز، وتجنّب العبارات المبتذلة والإجابات المتوقّعة الجاهزة.",fr:"Soyez audacieux et vraiment créatif : proposez des idées originales, mémorables et non génériques, avec une voix distinctive, et évitez les clichés et les réponses prévisibles.",it:"Sii audace e davvero creativo: proponi idee originali, memorabili e non generiche con una voce distintiva, evitando i cliché e le risposte prevedibili e standardizzate.",de:"Sei mutig und wirklich kreativ: biete originelle, einprägsame, nicht generische Ideen mit einer unverwechselbaren Stimme und vermeide Klischees und vorhersehbare Standardantworten."}},
{t:["comprehensive","complete","detailed","in-depth","thorough"," full","شامل","مفصل","كامل","متعمق","عميق","تفصيلي","complet","détaillé","completo","dettagliato","umfassend","ausführlich"],d:{en:"Be comprehensive and thorough: cover all the important aspects in depth, anticipate follow-up questions, and leave no significant gap in the answer.",ar:"كن شاملاً ومتعمّقاً: غطِّ كل الجوانب المهمّة بعمق، واستبق الأسئلة اللاحقة، ولا تترك أي فجوة مهمّة في الإجابة.",fr:"Soyez complet et approfondi : couvrez en profondeur tous les aspects importants, anticipez les questions de suivi et ne laissez aucune lacune significative.",it:"Sii completo e approfondito: copri in profondità tutti gli aspetti importanti, anticipa le domande successive e non lasciare lacune significative.",de:"Sei umfassend und gründlich: behandle alle wichtigen Aspekte tiefgehend, antizipiere Folgefragen und lasse keine wesentliche Lücke."}},
{t:["concise","short","brief","quick","tldr","موجز","مختصر","قصير","سريع","ملخص","concis","bref","conciso","breve","prägnant"],d:{en:"Be concise and to the point: deliver maximum value in minimum length, cut filler, and keep only what is essential and directly useful.",ar:"كن موجزاً ومباشراً: قدّم أقصى قيمة بأقل طول، واحذف الحشو، وأبقِ على الضروري والمفيد مباشرةً فقط.",fr:"Soyez concis et direct : offrez un maximum de valeur en un minimum de longueur, supprimez le superflu et ne gardez que l'essentiel directement utile.",it:"Sii conciso e diretto: offri il massimo valore nella minima lunghezza, elimina il superfluo e mantieni solo l'essenziale e direttamente utile.",de:"Sei prägnant und auf den Punkt: liefere maximalen Wert auf minimaler Länge, streiche Füllmaterial und behalte nur das Wesentliche und direkt Nützliche."}},
{t:["professional","business","corporate","formal","official","pro","محترف","احترافي","رسمي","تجاري","أعمال","professionnel","aziendale","geschäftlich","beruflich"],d:{en:"Maintain a polished, professional, business-grade standard throughout: precise wording, clean structure, and a credible, confident tone suitable for a professional setting.",ar:"حافظ على مستوى احترافي راقٍ بمعايير الأعمال طوال العمل: صياغة دقيقة، وبنية نظيفة، ونبرة موثوقة واثقة تليق ببيئة مهنية.",fr:"Gardez un standard professionnel et soigné de bout en bout : formulation précise, structure claire et ton crédible et assuré, adapté à un cadre professionnel.",it:"Mantieni uno standard professionale e curato dall'inizio alla fine: parole precise, struttura pulita e un tono credibile e sicuro, adatto a un contesto professionale.",de:"Halte durchgehend einen ausgefeilten, professionellen Geschäftsstandard ein: präzise Formulierung, klare Struktur und ein glaubwürdiger, sicherer Ton für ein professionelles Umfeld."}}
];
function angleDirective(){let src="";const ki=document.getElementById("kwInput");if(ki)src+=" "+ki.value;try{src+=" "+chipVals("tone").join(" ");}catch(e){}src=src.toLowerCase();for(let i=0;i<ANGLES.length;i++){if(ANGLES[i].t.some(w=>src.indexOf(w)>=0))return ANGLES[i].d[lang]||ANGLES[i].d.en;}return "";}
function buildModel(){
const chosen=[...selected].map(id=>{const c=CHOICES.find(x=>x.id===id);return c?L(c.label):id;}).join(sep());
const rows=[];
FIELDS.forEach(f=>{
if(f.id==="reference"){const v=val("reference");if(v)rows.push({k:UI[lang].refLabel,raw:v});return;}
if(f.id==="secret"){const v=val("secret");if(v)rows.push({k:UI[lang].secretLabel,raw:v,note:UI[lang].secretNote});return;}
if(f.type==="text"||f.type==="textarea"){const v=val(f.id);if(v)rows.push({k:L(f.label),v});}
else if(f.type==="list"){const a=listVals(f.id);if(a.length)rows.push({k:L(f.label),list:a});}
else if(f.type==="group"){const lines=[];f.children.forEach(ch=>{const v=val(ch.id);if(v)lines.push(L(ch.label)+": "+v);});if(lines.length)rows.push({k:L(f.label),list:lines});}
else if(f.type==="yesno"){if(yn(f.id)==="yes")rows.push({k:L(f.label),v:UI[lang].yes,note:UI[lang].attachNote});}
else if(f.type==="chips"){const a=chipVals(f.id);if(a.length)rows.push({k:L(f.label),v:a.map(toneLabel).join(sep())});}
});
const rules=activeRules().map(r=>L(r));
const _ad=angleDirective();if(_ad)rules.push(_ad);
return {chosen,rows,rules};
}
function buildText(m){m=m||buildModel();const o=[];o.push(UI[lang].intro);o.push("");o.push(UI[lang].wantLabel+" "+(m.chosen||"—"));o.push("");o.push(UI[lang].detailsHeader);
m.rows.forEach(r=>{if(r.list){o.push("• "+r.k+":");r.list.forEach(it=>o.push(" - "+it));}else if(r.raw){o.push("• "+r.k);r.raw.split(/\r?\n/).forEach(ln=>o.push(" "+ln));if(r.note)o.push(" ("+r.note+")");}else{o.push("• "+r.k+": "+r.v);if(r.note)o.push(" ("+r.note+")");}});
if(uploads.length)o.push("• "+UI[lang].attachTitle+": "+uploads.map(u=>u.name).join(sep())+" — "+UI[lang].attachHint);if(uploads.some(u=>u.isSketch))o.push(" ("+UI[lang].sketchNote+")");
o.push("");o.push(UI[lang].rulesHeader);m.rules.forEach((rt,i)=>o.push((i+1)+". "+rt));return o.join("\n");}
function syncPreview(){const t=document.getElementById("output");if(t)t.value=buildText();}
function promptScore(){let s=0;if(val("idea").length>8)s+=24;if(val("result").length>8)s+=20;if(selected.size>0)s+=20;if(val("role"))s+=10;if(val("audience"))s+=8;if(listVals("features").length)s+=8;if(chipVals("tone").length)s+=5;if(val("title"))s+=5;return Math.min(100,s);}
function updateMeters(){const p=promptScore();const tip=p<40?UI[lang].mLow:(p<76?UI[lang].mMid:UI[lang].mHigh);["2","3"].forEach(n=>{const f=document.getElementById("mfill"+n),c=document.getElementById("mpct"+n),t=document.getElementById("mtip"+n);if(f)f.style.width=p+"%";if(c)c.textContent=p+"%";if(t)t.textContent=tip;});}
function hasContent(){return selected.size>0||FIELDS.some(f=>{if(f.type==="group")return f.children.some(c=>val(c.id));if(f.type==="list")return listVals(f.id).length;if(f.type==="yesno")return yn(f.id)==="yes";if(f.type==="chips")return chipVals(f.id).length;return val(f.id);});}
let _sv=null;
function touch(){scheduleSave();updateMeters();syncPreview();}
function goStep(n){[1,2,3].forEach(i=>document.getElementById("step"+i).classList.toggle("show",i===n));document.querySelectorAll(".stepbtn").forEach(b=>{const s=+b.dataset.step;b.classList.toggle("active",s===n);b.classList.toggle("done",s<n);});if(n===3){syncPreview();if(typeof renderSites==="function")renderSites();if(typeof renderTips==="function")renderTips();}try{window.scrollTo({top:0,behavior:"smooth"});}catch(e){}}
function toStep3(){if(!hasContent()){toast(UI[lang].tEmpty);return;}syncPreview();goStep(3);}
function safeName(){let t=val("title")||UI[lang].docTitleFallback;t=t.replace(/[\\/:*?"<>|]+/g,"-").replace(/\s+/g,"-").slice(0,60);return t||"prompt";}
function fb(t,done){try{t.focus();t.select();document.execCommand("copy");}catch(e){}done();}
function copyOut(btn){const t=document.getElementById("output");const done=()=>{toast(uploads.length?UI[lang].copyNoFiles:UI[lang].tCopy);const sp=btn.querySelector(".ctxt");if(sp){sp.textContent=UI[lang].copied;setTimeout(()=>{sp.textContent=UI[lang].copy;},1500);}burst(btn);};if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(t.value).then(done,()=>fb(t,done));else fb(t,done);}
function exportHTML(btn){if(!hasContent()){toast(UI[lang].tEmpty);return;}const rtl=lang==="ar";const title=esc(val("title")||UI[lang].docTitleFallback);const body=esc(buildText());let media="";if(uploads.length){media='<h2 class="att">'+esc(UI[lang].attachTitle)+'</h2><p class="hint">'+esc(UI[lang].attachHint)+'</p>';uploads.forEach(u=>{if(u.isImage)media+='<figure><img src="'+u.url+'"><figcaption>'+esc(u.name)+'</figcaption></figure>';else if(/^audio\//.test(u.type))media+='<figure><audio controls src="'+u.url+'"></audio><figcaption>'+esc(u.name)+'</figcaption></figure>';else if(/^video\//.test(u.type))media+='<figure><video controls src="'+u.url+'"></video><figcaption>'+esc(u.name)+'</figcaption></figure>';else media+='<figure><a class="dl" href="'+u.url+'" download="'+esc(u.name)+'">⬇ '+esc(u.name)+'</a></figure>';});}
const css='body{font-family:system-ui,"Segoe UI",Tajawal,Arial,sans-serif;line-height:1.7;max-width:920px;margin:0 auto;padding:34px 20px;color:#2a2519;background:#fffdf7}h1{color:#b8860b;margin:0 0 16px}pre{white-space:pre-wrap;word-wrap:break-word;background:#f6f4ff;border:1px solid #e6e2f5;border-radius:12px;padding:18px;font-family:inherit;font-size:15px}.att{color:#b8860b;border-top:2px solid #eee;padding-top:18px;margin-top:30px}.hint{color:#6b6f8c;font-size:14px;margin-top:-6px}figure{margin:18px 0;overflow:auto}figcaption{color:#6b6f8c;font-size:13px;margin-top:6px}img,video{display:block;max-width:none;height:auto;border:1px solid #e6e2f5;border-radius:8px}.dl{display:inline-block;background:#2f8a76;color:#fff;padding:10px 16px;border-radius:8px;text-decoration:none}';
const doc='<!DOCTYPE html><html lang="'+lang+'" dir="'+(rtl?"rtl":"ltr")+'"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>'+title+'</title><style>'+css+'</style></head><body><h1>'+title+'</h1><pre>'+body+'</pre>'+media+'</body></html>';
try{const blob=new Blob([doc],{type:"text/html"});const url=URL.createObjectURL(blob);const a=document.createElement("a");a.href=url;a.download=safeName()+".html";document.body.appendChild(a);a.click();a.remove();setTimeout(()=>URL.revokeObjectURL(url),1500);}catch(e){}toast(UI[lang].tHtmlOk);burst(btn);}
function buildPdfHTML(){
const m=buildModel();const rtl=lang==="ar";const title=val("title")||UI[lang].docTitleFallback;
const colg=rtl?'<colgroup><col style="width:64%"><col style="width:36%"></colgroup>':'<colgroup><col style="width:36%"><col style="width:64%"></colgroup>';
const th=rtl?('<th>'+esc(UI[lang].colDetail)+'</th><th>'+esc(UI[lang].colStage)+'</th>'):('<th>'+esc(UI[lang].colStage)+'</th><th>'+esc(UI[lang].colDetail)+'</th>');
let rowsHtml="";
m.rows.forEach((r,i)=>{const odd=i%2?"":" odd";let vc;if(r.list){vc='<ul>'+r.list.map(it=>'<li>'+esc(it)+'</li>').join('')+'</ul>';}else if(r.raw){vc='<div class="pre">'+esc(r.raw)+'</div>'+(r.note?'<div class="note2">'+esc(r.note)+'</div>':'');}else{vc=esc(r.v)+(r.note?'<div class="note2">'+esc(r.note)+'</div>':'');}const kc='<td class="k">'+esc(r.k)+'</td>';const vcell='<td class="v'+odd+'">'+vc+'</td>';rowsHtml+='<tr>'+(rtl?vcell+kc:kc+vcell)+'</tr>';});
let rulesHtml="";m.rules.forEach((rt,i)=>{rulesHtml+='<div class="rule"><div class="rn">'+(i+1)+'</div><div class="rt">'+esc(rt)+'</div></div>';});
let attHtml="";if(uploads.length){attHtml='<p class="sec-title">'+esc(UI[lang].attachTitle)+'</p><div class="attwrap">';uploads.forEach(u=>{if(u.isImage)attHtml+='<div class="attimg"><img src="'+u.url+'"><div class="attcap">'+esc(u.name)+'</div></div>';else attHtml+='<div class="attfile">'+(/^audio\//.test(u.type)?"🎵":/^video\//.test(u.type)?"🎬":/pdf/.test(u.type)?"📄":"📎")+' '+esc(u.name)+' <span class="attmeta">('+esc(u.type||"file")+')</span></div>';});attHtml+='</div>';}
const badges=(m.chosen?m.chosen.split(sep()):[]).map(c=>'<span class="badge">'+esc(c)+'</span>').join('');
return '<div class="pdfdoc'+(rtl?' rtl':'')+'" dir="ltr">'
+'<div class="pcover"><p class="ktag">'+esc(UI[lang].docTag)+'</p><h1>'+esc(title)+'</h1><div class="badges">'+badges+'</div></div>'
+'<div class="body">'
+'<div class="introcard">'+esc(UI[lang].intro)+'</div>'
+'<p class="sec-title">'+esc(UI[lang].detailsHeader)+'</p>'
+'<div class="tablewrap"><table>'+colg+'<thead><tr>'+th+'</tr></thead><tbody>'+rowsHtml+'</tbody></table></div>'
+'<p class="sec-title">'+esc(UI[lang].rulesHeader)+'</p>'
+'<div class="ruleswrap">'+rulesHtml+'</div>'
+attHtml
+'</div><div class="pfoot"></div></div>';
}
let _origTitle="";
function exportPDF(btn){const area=document.getElementById("printArea");if(!area)return;if(!hasContent()){toast(UI[lang].tEmpty);return;}area.innerHTML=buildPdfHTML();_origTitle=document.title;try{document.title=safeName();}catch(e){}toast(UI[lang].tPrintHint);burst(btn);setTimeout(function(){try{window.print();}catch(e){}},90);}
window.addEventListener("afterprint",function(){const a=document.getElementById("printArea");if(a)a.innerHTML="";try{if(_origTitle)document.title=_origTitle;}catch(e){}});
function exportDOCX(btn){
if(typeof window.docx==="undefined"){toast(UI[lang].tLibDocx);return;}
if(!hasContent()){toast(UI[lang].tEmpty);return;}
toast(UI[lang].tDocx);btn.disabled=true;
try{
const D=window.docx;const {Document,Packer,Paragraph,TextRun,Table,TableRow,TableCell,WidthType,BorderStyle,AlignmentType,ShadingType,ImageRun}=D;
const rtl=lang==="ar";const font="Tajawal";const m=buildModel();
const align=rtl?AlignmentType.RIGHT:AlignmentType.LEFT;
const noB={top:{style:BorderStyle.NONE},bottom:{style:BorderStyle.NONE},left:{style:BorderStyle.NONE},right:{style:BorderStyle.NONE},insideHorizontal:{style:BorderStyle.NONE},insideVertical:{style:BorderStyle.NONE}};
const run=(t,o)=>{o=o||{};return new TextRun({text:String(t==null?"":t),font,bold:!!o.bold,color:o.color,size:o.size,rightToLeft:rtl});};
const para=(r,o)=>{o=o||{};return new Paragraph({children:Array.isArray(r)?r:[r],alignment:o.align||align,bidirectional:rtl,spacing:o.spacing||{after:80}});};
const cell=(ch,o)=>{o=o||{};return new TableCell({children:Array.isArray(ch)?ch:[ch],shading:o.shading,width:o.width,verticalAlign:"center",margins:{top:90,bottom:90,left:150,right:150},borders:o.borders||noB});};
const banner=new Table({width:{size:100,type:WidthType.PERCENTAGE},visuallyRightToLeft:rtl,borders:noB,rows:[new TableRow({children:[cell([
para([run(UI[lang].docTag,{color:"E9D5FF",size:16,bold:true})],{spacing:{after:40}}),
para([run(val("title")||UI[lang].docTitleFallback,{color:"FFFFFF",size:34,bold:true})],{spacing:{after:0}})
],{shading:{type:ShadingType.CLEAR,fill:"7C3AED"}})]})]});
const intro=new Table({width:{size:100,type:WidthType.PERCENTAGE},visuallyRightToLeft:rtl,borders:noB,rows:[new TableRow({children:[cell([para([run(UI[lang].intro,{color:"2A2550"})],{spacing:{after:0}})],{shading:{type:ShadingType.CLEAR,fill:"F3F0FC"}})]})]});
const headLine=(txt,color)=>new Paragraph({children:[run(txt,{bold:true,size:22,color:"1B1F3B"})],alignment:align,bidirectional:rtl,spacing:{before:200,after:90},border:{bottom:{color,size:14,style:BorderStyle.SINGLE,space:4}}});
const detRows=[new TableRow({tableHeader:true,children:[
cell([para([run(UI[lang].colStage,{color:"FFFFFF",bold:true})],{spacing:{after:0}})],{shading:{type:ShadingType.CLEAR,fill:"7C3AED"},width:{size:34,type:WidthType.PERCENTAGE}}),
cell([para([run(UI[lang].colDetail,{color:"FFFFFF",bold:true})],{spacing:{after:0}})],{shading:{type:ShadingType.CLEAR,fill:"7C3AED"},width:{size:66,type:WidthType.PERCENTAGE}})
]})];
m.rows.forEach((r,i)=>{const zebra=i%2?"FFFFFF":"FAF9FF";let vpars;
if(r.list)vpars=r.list.map(it=>para([run("• "+it)],{spacing:{after:30}}));
else if(r.raw){vpars=String(r.raw).split(/\r?\n/).map(ln=>para([run(ln)],{spacing:{after:20}}));if(r.note)vpars.push(para([run(r.note,{color:"7C5FB0",size:18})],{spacing:{after:0}}));}
else{vpars=[para([run(r.v)],{spacing:{after:r.note?20:0}})];if(r.note)vpars.push(para([run(r.note,{color:"7C5FB0",size:18})],{spacing:{after:0}}));}
detRows.push(new TableRow({children:[cell([para([run(r.k,{bold:true,color:"3A2B66"})],{spacing:{after:0}})],{shading:{type:ShadingType.CLEAR,fill:"F3F0FC"}}),cell(vpars,{shading:{type:ShadingType.CLEAR,fill:zebra}})]}));
});
const details=new Table({width:{size:100,type:WidthType.PERCENTAGE},visuallyRightToLeft:rtl,rows:detRows});
const ruleParas=m.rules.map((rt,i)=>new Paragraph({children:[run((i+1)+". ",{bold:true,color:"7C3AED"}),run(rt)],alignment:align,bidirectional:rtl,spacing:{after:70}}));
const children=[banner,para([run("")],{spacing:{after:60}}),intro,headLine(UI[lang].detailsHeader,"22D3EE"),details,headLine(UI[lang].rulesHeader,"F472B6"),...ruleParas];
if(uploads.length){children.push(headLine(UI[lang].attachTitle,"22D3EE"));uploads.forEach(u=>{if(u.isImage&&/png|jpe?g|gif|bmp/i.test(u.type)){try{const bytes=dataURLtoBytes(u.url);let w=u.w||500,h=u.h||350;const maxW=520;if(w>maxW){h=Math.round(h*maxW/w);w=maxW;}children.push(new Paragraph({children:[new ImageRun({data:bytes,transformation:{width:w,height:h}})],spacing:{after:50}}));children.push(para([run(u.name,{color:"7C5FB0",size:18})],{spacing:{after:150}}));}catch(e){children.push(para([run("📎 "+u.name)]));}}else{children.push(para([run("📎 "+u.name+" ("+(u.type||"file")+")")]));}});}
const doc=new Document({styles:{default:{document:{run:{font}}}},sections:[{properties:{bidi:rtl},children}]});
Packer.toBlob(doc).then(blob=>{const url=URL.createObjectURL(blob);const a=document.createElement("a");a.href=url;a.download=safeName()+".docx";document.body.appendChild(a);a.click();a.remove();setTimeout(()=>URL.revokeObjectURL(url),1500);toast(UI[lang].tDocxOk);burst(btn);}).catch(()=>{toast(UI[lang].tLibDocx);}).finally(()=>{btn.disabled=false;});
}catch(e){toast(UI[lang].tLibDocx);btn.disabled=false;}
}
function openPop(btn,key){const pop=document.getElementById("pop");const txt=getInfo(key);if(!txt)return;document.querySelectorAll(".info.on").forEach(b=>b.classList.remove("on"));btn.classList.add("on");pop.innerHTML='<p class="pop-h"><span class="ic" aria-hidden="true">i</span>'+esc(UI[lang].popTitle)+'</p>'+esc(txt)+fieldExample(key);pop.classList.add("show");const r=btn.getBoundingClientRect();const pw=Math.min(330,window.innerWidth-24);pop.style.maxWidth=pw+"px";let left=r.left+r.width/2-pw/2;left=Math.max(12,Math.min(left,window.innerWidth-pw-12));pop.style.left=left+"px";let top=r.bottom+10;if(top+pop.offsetHeight>window.innerHeight-12)top=r.top-pop.offsetHeight-10;pop.style.top=Math.max(12,top)+"px";pop._for=btn;}
function closePop(){const pop=document.getElementById("pop");if(pop)pop.classList.remove("show");document.querySelectorAll(".info.on").forEach(b=>b.classList.remove("on"));}
document.addEventListener("click",e=>{const ib=e.target.closest&&e.target.closest(".info");const pop=document.getElementById("pop");if(ib){if(pop&&pop.classList.contains("show")&&pop._for===ib){closePop();}else{openPop(ib,ib.getAttribute("data-info"));}return;}if(pop&&pop.classList.contains("show")&&!(e.target.closest&&e.target.closest("#pop")))closePop();});
document.addEventListener("keydown",e=>{if(e.key==="Escape")closePop();});
window.addEventListener("scroll",()=>closePop(),true);
window.addEventListener("resize",()=>closePop());
function applyThemeIcon(){const light=document.body.classList.contains("theme-light");const btn=document.getElementById("themeBtn");if(!btn)return;btn.setAttribute("aria-label",light?UI[lang].themeDark:UI[lang].themeLight);btn.innerHTML=light?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1111.2 3 7 7 0 0021 12.8z"/></svg>':'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4.5"/><path d="M12 2v2.5M12 19.5V22M2 12h2.5M19.5 12H22M4.9 4.9l1.8 1.8M17.3 17.3l1.8 1.8M19.1 4.9l-1.8 1.8M6.7 17.3l-1.8 1.8"/></svg>';}
function toggleTheme(){document.body.classList.toggle("theme-light");document.body.classList.toggle("theme-dark");store.set("lp_theme",document.body.classList.contains("theme-light")?"light":"dark");applyThemeIcon();closePop();}
function setLang(l){if(!UI[l])l="en";lang=l;const rtl=l==="ar";document.documentElement.lang=l;document.documentElement.dir=rtl?"rtl":"ltr";document.body.classList.toggle("lang-ar",rtl);document.querySelectorAll("[data-i18n]").forEach(n=>{const v=UI[l][n.getAttribute("data-i18n")];if(v!=null)n.textContent=v;});document.querySelectorAll("[data-i18n-ph]").forEach(n=>{const v=UI[l][n.getAttribute("data-i18n-ph")];if(v!=null)n.setAttribute("placeholder",v);});localizeFields();if(typeof renderSites==="function")renderSites();const sel=document.getElementById("langSel");if(sel)sel.value=l;applyThemeIcon();closePop();const ct=document.getElementById("creedText");if(ct)ct.textContent=UI[l].intro;updateMeters();syncPreview();store.set("lp_lang",l);}
function setV(id,v){const e=document.getElementById("f_"+id);if(e&&v!=null)e.value=v;}
function setList(id,arr){const f=FIELDS.find(x=>x.id===id);const box=document.getElementById("list_"+id);if(!box||!f)return;box.innerHTML="";const items=(arr&&arr.length)?arr:[""];items.forEach(()=>addItem(f,box));const inp=box.querySelectorAll(".item input");items.forEach((v,i)=>{if(inp[i])inp[i].value=v;});}
function setChips(id,arr){const w=document.getElementById("chips_"+id);if(!w)return;w.querySelectorAll(".pill").forEach(p=>p.setAttribute("aria-pressed",arr.indexOf(p.getAttribute("data-opt"))>=0?"true":"false"));}
function setYes(id){const s=document.getElementById("seg_"+id);if(!s)return;const y=s.querySelector("[data-yn-yes]"),n=s.querySelector("[data-yn-no]");if(y)y.setAttribute("aria-pressed","true");if(n)n.setAttribute("aria-pressed","false");}
function smartFill(){
if(selected.size===0){toast(UI[lang].tPickType);goStep(1);return false;}
const ids=[...selected];const T=TPL[lang]||TPL.en;
const kwEl=document.getElementById("kwInput");const k=kwEl&&kwEl.value?kwEl.value.trim():"";
let role="",idea0="",res="",aud="",colors="",sizes="";const feats=[];const tones=[];
ids.forEach((id,idx)=>{const t=T[id]||T.other;if(idx===0){role=t.role;idea0=t.idea;res=t.res;aud=t.aud;colors=t.colors||"";sizes=t.sizes||"";}else{if(t.colors&&!colors)colors=t.colors;if(t.sizes&&!sizes)sizes=t.sizes;}
(t.feat||[]).forEach(f=>{if(feats.length<6&&feats.indexOf(f)<0)feats.push(f);});(t.tone||[]).forEach(x=>{if(tones.indexOf(x)<0)tones.push(x);});});
if(k){role=role+" "+UI[lang].kwRole+" "+k;idea0=idea0+"\n"+UI[lang].kwIdea+" "+k;if(!val("title"))setV("title",k);}
const _vis=["image","logo","website","webapp","mobileapp","dash","slides","social","video"].some(x=>selected.has(x));if(!colors&&_vis)colors=UI[lang].defColors;if(!sizes&&_vis)sizes=UI[lang].defSizes;
setV("role",role);if(k||!val("idea"))setV("idea",idea0);setV("result",res);setV("audience",aud);if(colors)setV("colors",colors);if(sizes)setV("sizes",sizes);setV("languages",UI[lang].langName);setList("features",feats);setChips("tone",tones);if(selected.has("fromfile"))setYes("attachments");
setMoreOpen(true);touch();toast(UI[lang].tFillOk);return true;
}
function smartFillNext(){if(smartFill())goStep(2);}
function resetAll(){if(!window.confirm(UI[lang].resetConfirm))return;store.del("lp_draft");selected.clear();renderChoices();renderForm();setMoreOpen(false);const out=document.getElementById("output");if(out)out.value="";updateMeters();syncPreview();goStep(1);toast(UI[lang].tReset);}
function scheduleSave(){if(!store.ok)return;clearTimeout(_sv);_sv=setTimeout(saveDraft,500);}
function saveDraft(){if(!store.ok)return;const d={c:[...selected],v:{},l:{},t:[],y:{},k:((document.getElementById("kwInput")||{}).value||"")};FIELDS.forEach(f=>{if(f.type==="text"||f.type==="textarea")d.v[f.id]=val(f.id);else if(f.type==="group")f.children.forEach(ch=>d.v[ch.id]=val(ch.id));else if(f.type==="list")d.l[f.id]=listVals(f.id);else if(f.type==="yesno")d.y[f.id]=yn(f.id);else if(f.type==="chips")d.t=chipVals(f.id);});try{store.set("lp_draft",JSON.stringify(d));}catch(e){}}
function restoreDraft(){if(!store.ok)return;let d;try{d=JSON.parse(store.get("lp_draft")||"null");}catch(e){d=null;}if(!d)return;(d.c||[]).forEach(id=>selected.add(id));renderChoices();const _ki=document.getElementById("kwInput");if(_ki&&d.k)_ki.value=d.k;Object.keys(d.v||{}).forEach(id=>{const e=document.getElementById("f_"+id);if(e&&d.v[id]!=null)e.value=d.v[id];});Object.keys(d.l||{}).forEach(id=>{const arr=d.l[id]||[];if(arr.length)setList(id,arr);});if(d.t&&d.t.length)setChips("tone",d.t);Object.keys(d.y||{}).forEach(id=>{if(d.y[id]==="yes")setYes(id);});}
function burst(t){try{const r=t.getBoundingClientRect();const cx=r.left+r.width/2,cy=r.top+r.height/2;const cols=["#e6c478","#3fae9a","#d8a981","#fbbf24"];for(let i=0;i<10;i++){const s=el("span","spark");s.style.background=cols[i%cols.length];s.style.left=cx+"px";s.style.top=cy+"px";document.body.appendChild(s);const ang=Math.PI*2*i/10,dd=28+Math.random()*30,dx=Math.cos(ang)*dd,dy=Math.sin(ang)*dd;s.animate([{transform:"translate(-50%,-50%) scale(1)",opacity:1},{transform:"translate(calc(-50% + "+dx+"px),calc(-50% + "+dy+"px)) scale(0)",opacity:0}],{duration:600,easing:"cubic-bezier(.2,.8,.3,1)"}).onfinish=()=>s.remove();}}catch(e){}}
function buildAurora(){const box=document.getElementById("aurora");if(!box)return;const cfg=[["38vw","#e6c478","6%","4%"],["32vw","#3fae9a","58%","8%"],["30vw","#d8a981","30%","52%"]];cfg.forEach((c,i)=>{const a=el("div","aurora");a.style.width=c[0];a.style.height=c[0];a.style.background=c[1];a.style.left=c[2];a.style.top=c[3];a.style.animationDelay=(i*-6)+"s";box.appendChild(a);});}
function buildDust(){const box=document.getElementById("dust");if(!box)return;for(let i=0;i<26;i++){const d=el("div","dust");const s=1+Math.random()*2.5;d.style.width=s+"px";d.style.height=s+"px";d.style.left=Math.random()*100+"%";d.style.bottom="-5vh";d.style.animationDuration=(11+Math.random()*12)+"s";d.style.animationDelay=(-Math.random()*16)+"s";box.appendChild(d);}}
function initTilt(){try{if(window.matchMedia&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches||window.matchMedia("(pointer: coarse)").matches))return;}catch(e){}if(window.innerWidth<980)return;const stage=document.querySelector(".stage");if(!stage)return;document.addEventListener("mousemove",e=>{const rx=(e.clientX/window.innerWidth-.5),ry=(e.clientY/window.innerHeight-.5);stage.style.transform="rotateX("+(-ry*1.4)+"deg) rotateY("+(rx*1.4)+"deg)";});}
function toast(msg){const t=document.getElementById("toast");if(!t)return;t.textContent=msg;t.classList.add("show");clearTimeout(t._t);t._t=setTimeout(()=>t.classList.remove("show"),2600);}
/* ===================== EXTRA DATA (merged) ===================== */
const UI_EXTRA={en:{kwLabel:"Enter keywords or a line about what you want",kwPh:"e.g. Instagram ad for a coffee brand…",kwRole:"— with strong expertise in:",kwIdea:"Specifically, my subject / keywords:",aiTitle:"Paste your prompt into a powerful AI",aiSub:"Copy the prompt above, then open one of these (ordered by capability) and paste it:",aiOpen:"Open",tag_general:"General assistant",tag_research:"Research & sources",tag_images:"Image generation"},ar:{kwLabel:"أدخل كلمات مفتاحية أو سطراً عمّا تريد",kwPh:"مثال: إعلان إنستغرام لعلامة قهوة…",kwRole:"— بخبرة قوية في:",kwIdea:"وتحديداً، موضوعي / كلماتي المفتاحية:",aiTitle:"ألصق برومبتك في ذكاء اصطناعي قوي",aiSub:"انسخ البرومبت أعلاه، ثم افتح أحد هذه المواقع (مرتّبة حسب الكفاءة) وألصقه فيه:",aiOpen:"افتح",tag_general:"مساعد عام",tag_research:"بحث ومصادر",tag_images:"توليد الصور"},fr:{kwLabel:"Saisissez des mots-clés ou une phrase sur ce que vous voulez",kwPh:"Ex : publicité Instagram pour une marque de café…",kwRole:"— avec une solide expertise en :",kwIdea:"Plus précisément, mon sujet / mes mots-clés :",aiTitle:"Collez votre prompt dans une IA puissante",aiSub:"Copiez le prompt ci-dessus, puis ouvrez l'un de ces sites (classés par capacité) et collez-le :",aiOpen:"Ouvrir",tag_general:"Assistant généraliste",tag_research:"Recherche & sources",tag_images:"Génération d'images"},
it:{kwLabel:"Inserisci parole chiave o una frase su ciò che vuoi",kwPh:"Es.: annuncio Instagram per un brand di caffè…",kwRole:"— con forte competenza in:",kwIdea:"Nello specifico, il mio argomento / parole chiave:",aiTitle:"Incolla il tuo prompt in un'IA potente",aiSub:"Copia il prompt sopra, poi apri uno di questi siti (in ordine di capacità) e incollalo:",aiOpen:"Apri",tag_general:"Assistente generale",tag_research:"Ricerca & fonti",tag_images:"Generazione immagini"},
de:{kwLabel:"Gib Stichwörter oder einen Satz zu deinem Wunsch ein",kwPh:"z. B. Instagram-Anzeige für eine Kaffeemarke…",kwRole:"— mit ausgeprägter Expertise in:",kwIdea:"Konkret, mein Thema / meine Stichwörter:",aiTitle:"Füge deinen Prompt in eine starke KI ein",aiSub:"Kopiere den Prompt oben, öffne dann eine dieser Seiten (nach Leistung geordnet) und füge ihn ein:",aiOpen:"Öffnen",tag_general:"Allgemeiner Assistent",tag_research:"Recherche & Quellen",tag_images:"Bildgenerierung"}};
const MORE_CHOICES=[
{id:"article",emo:"📰",label:{en:"Article",ar:"مقال",fr:"Article",it:"Articolo",de:"Artikel"}},
{id:"email",emo:"✉️",label:{en:"Email",ar:"بريد إلكتروني",fr:"E-mail",it:"Email",de:"E-Mail"}},
{id:"cv",emo:"🪪",label:{en:"Resume / CV",ar:"سيرة ذاتية",fr:"CV",it:"Curriculum / CV",de:"Lebenslauf"}},
{id:"story",emo:"📖",label:{en:"Story / fiction",ar:"قصة / رواية",fr:"Histoire / fiction",it:"Storia / racconto",de:"Geschichte"}},
{id:"script",emo:"🎞️",label:{en:"Script / screenplay",ar:"سيناريو",fr:"Scénario",it:"Sceneggiatura",de:"Drehbuch"}},
{id:"summary",emo:"📋",label:{en:"Summary",ar:"تلخيص",fr:"Résumé",it:"Riassunto",de:"Zusammenfassung"}},
{id:"rewrite",emo:"♻️",label:{en:"Rewrite / paraphrase",ar:"إعادة صياغة",fr:"Réécriture",it:"Riscrittura",de:"Umschreiben"}},
{id:"debug",emo:"🐞",label:{en:"Fix / debug code",ar:"إصلاح كود",fr:"Corriger le code",it:"Correggi codice",de:"Code reparieren"}},
{id:"plan",emo:"🗂️",label:{en:"Business / action plan",ar:"خطة عمل",fr:"Plan d'action",it:"Piano d'azione",de:"Aktionsplan"}},
{id:"marketing",emo:"📈",label:{en:"Marketing strategy",ar:"استراتيجية تسويق",fr:"Stratégie marketing",it:"Strategia di marketing",de:"Marketingstrategie"}},
{id:"seo",emo:"🔍",label:{en:"SEO content",ar:"محتوى SEO",fr:"Contenu SEO",it:"Contenuti SEO",de:"SEO-Inhalt"}},
{id:"excel",emo:"🧮",label:{en:"Spreadsheet / Excel",ar:"جدول بيانات / إكسل",fr:"Tableur / Excel",it:"Foglio di calcolo / Excel",de:"Tabelle / Excel"}},
{id:"travel",emo:"🧳",label:{en:"Travel itinerary",ar:"برنامج سفر",fr:"Itinéraire de voyage",it:"Itinerario di viaggio",de:"Reiseplan"}},
{id:"interview",emo:"🎙️",label:{en:"Interview prep",ar:"تحضير مقابلة",fr:"Préparation entretien",it:"Preparazione colloquio",de:"Interview-Vorbereitung"}}
];
const TPL_EXTRA={en:{
article:{role:"You are an expert article writer with clear, engaging, well-researched prose.",idea:"I want a complete article on the topic I'll specify.",feat:["A strong intro and clear sections","Accurate, well-organised content","A compelling conclusion"],aud:"General reader",tone:["pro","edu"],res:"A complete, publication-ready article, clear and error-free."},
email:{role:"You are a professional communication expert who writes clear, effective emails.",idea:"I want a professional email for the situation I'll specify.",feat:["A clear subject line","A concise, well-structured body","An appropriate tone and call to action"],aud:"The recipient",tone:["pro","formal"],res:"A polished, ready-to-send email that achieves its purpose."},
cv:{role:"You are a professional resume writer and career coach.",idea:"I want a strong resume/CV for the role I'll specify.",feat:["A compelling professional summary","Clear, results-focused experience","Relevant skills and clean formatting"],aud:"Recruiters and hiring managers",tone:["pro","concise"],res:"A polished, ATS-friendly resume that stands out, ready to use."},
story:{role:"You are a creative fiction writer with vivid, immersive storytelling.",idea:"I want a story about the theme/idea I'll specify.",feat:["Engaging characters","A clear plot arc","Vivid, immersive detail"],aud:"The target reader",tone:["creative","detailed"],res:"A complete, well-crafted story, engaging from start to finish."},
script:{role:"You are a professional screenwriter with sharp dialogue and structure.",idea:"I want a script/screenplay for the scene or video I'll specify.",feat:["Proper script formatting","Natural, sharp dialogue","Clear scene direction"],aud:"The audience/production",tone:["creative","pro"],res:"A complete, properly formatted script, ready to produce."},
summary:{role:"You are an expert at distilling content into clear, faithful summaries.",idea:"I want a clear summary of the text/content I'll provide.",feat:["Captures the key points faithfully","Concise and well-organised","No distortion or omission of essentials"],aud:"A busy reader",tone:["concise","pro"],res:"A faithful, concise summary that conveys the essentials clearly."},
rewrite:{role:"You are an expert editor who rewrites text while preserving its meaning.",idea:"I want to rewrite/paraphrase the text I'll provide, improved and original.",feat:["Preserves the original meaning","Improved clarity and flow","Original phrasing, no plagiarism"],aud:"The text's reader",tone:["pro","simple"],res:"A polished, original rewrite that keeps the meaning and reads better."},
debug:{role:"You are an expert software engineer skilled at finding and fixing bugs.",idea:"I want to find and fix the bug in the code I'll provide.",feat:["Identify the root cause","Provide the corrected code","Explain the fix briefly"],aud:"Developers",tone:["pro","detailed"],res:"Corrected, working code with a clear explanation of the cause and fix."},
plan:{role:"You are a strategic planner who builds clear, actionable plans.",idea:"I want a practical business/action plan for the goal I'll specify.",feat:["Clear objectives","Concrete, ordered steps","Timeline and success measures"],aud:"The team or stakeholders",tone:["pro","detailed"],res:"A clear, actionable plan ready to execute immediately."},
marketing:{role:"You are a marketing strategist who designs effective, data-aware campaigns.",idea:"I want a marketing strategy for the product/brand I'll specify.",feat:["Target audience and positioning","Channels and key messages","An action plan with KPIs"],aud:"The business",tone:["marketing","pro"],res:"A complete, actionable marketing strategy ready to launch."},
seo:{role:"You are an SEO expert who creates search-optimised, valuable content.",idea:"I want SEO content/keywords for the topic I'll specify.",feat:["Relevant keywords and intent","Optimised, readable structure","Titles and meta suggestions"],aud:"Searchers and search engines",tone:["marketing","pro"],res:"Search-optimised content that ranks well and reads naturally."},
excel:{role:"You are a spreadsheet expert fluent in formulas and data structure.",idea:"I want a spreadsheet/Excel solution for the task I'll specify.",feat:["Correct formulas and structure","Clear, organised layout","Ready to copy and use"],aud:"The spreadsheet user",tone:["pro","concise"],res:"A working spreadsheet solution with correct formulas, ready to use."},
travel:{role:"You are an expert travel planner who designs practical, delightful itineraries.",idea:"I want a travel itinerary for the trip I'll specify.",feat:["A day-by-day plan","Practical timing and logistics","Tailored recommendations"],aud:"The traveller",tone:["friendly","detailed"],res:"A complete, practical travel itinerary, ready to follow."},
interview:{role:"You are an interview coach who prepares candidates to excel.",idea:"I want to prepare for the interview/role I'll specify.",feat:["Likely questions with strong answers","Key talking points","Tips to stand out"],aud:"The candidate",tone:["pro","edu"],res:"A focused interview-prep pack that builds confidence and readiness."}
},ar:{
article:{role:"أنت كاتب مقالات خبير بأسلوب واضح وجذّاب ومدعوم بالبحث.",idea:"أريد مقالاً كاملاً حول الموضوع الذي سأحدّده.",feat:["مقدمة قوية وأقسام واضحة","محتوى دقيق منظّم","خاتمة مقنعة"],aud:"قارئ عام",tone:["pro","edu"],res:"مقال كامل جاهز للنشر، واضح وخالٍ من الأخطاء."},
email:{role:"أنت خبير تواصل محترف تكتب رسائل بريد واضحة وفعّالة.",idea:"أريد رسالة بريد إلكتروني احترافية للموقف الذي سأحدّده.",feat:["سطر موضوع واضح","نص موجز منظّم","نبرة مناسبة ونداء للفعل"],aud:"المُستلِم",tone:["pro","formal"],res:"رسالة أنيقة جاهزة للإرسال تحقّق هدفها."},
cv:{role:"أنت كاتب سير ذاتية محترف ومدرّب مهني.",idea:"أريد سيرة ذاتية قوية للوظيفة التي سأحدّدها.",feat:["ملخّص مهني مقنع","خبرات واضحة مركّزة على النتائج","مهارات ملائمة وتنسيق نظيف"],aud:"مسؤولو التوظيف",tone:["pro","concise"],res:"سيرة ذاتية أنيقة متوافقة مع أنظمة الفرز تبرز بين غيرها، جاهزة للاستخدام."},
story:{role:"أنت كاتب قصص مبدع بسرد حيّ وغامر.",idea:"أريد قصة حول الفكرة أو الموضوع الذي سأحدّده.",feat:["شخصيات جذّابة","حبكة واضحة","تفاصيل حيّة غامرة"],aud:"القارئ المستهدف",tone:["creative","detailed"],res:"قصة كاملة متقَنة جذّابة من البداية إلى النهاية."},
script:{role:"أنت كاتب سيناريو محترف بحوار وبناء محكمين.",idea:"أريد سيناريو للمشهد أو الفيديو الذي سأحدّده.",feat:["تنسيق سيناريو سليم","حوار طبيعي محكم","توجيه مشهد واضح"],aud:"الجمهور/الإنتاج",tone:["creative","pro"],res:"سيناريو كامل منسّق بشكل صحيح جاهز للإنتاج."},
summary:{role:"أنت خبير في تلخيص المحتوى بإخلاص ووضوح.",idea:"أريد تلخيصاً واضحاً للنص أو المحتوى الذي سأقدّمه.",feat:["يلتقط النقاط الأساسية بأمانة","موجز ومنظّم","دون تشويه أو حذف للأساسيات"],aud:"قارئ مشغول",tone:["concise","pro"],res:"تلخيص أمين موجز ينقل الأساسيات بوضوح."},
rewrite:{role:"أنت محرّر خبير يعيد صياغة النص مع الحفاظ على معناه.",idea:"أريد إعادة صياغة النص الذي سأقدّمه، محسّناً وأصيلاً.",feat:["يحافظ على المعنى الأصلي","وضوح وانسياب أفضل","صياغة أصلية دون نسخ"],aud:"قارئ النص",tone:["pro","simple"],res:"إعادة صياغة أنيقة أصيلة تحافظ على المعنى وأفضل قراءةً."},
debug:{role:"أنت مهندس برمجيات خبير بارع في إيجاد الأخطاء وإصلاحها.",idea:"أريد إيجاد الخطأ في الكود الذي سأقدّمه وإصلاحه.",feat:["تحديد السبب الجذري","تقديم الكود المصحَّح","شرح الإصلاح بإيجاز"],aud:"مطوّرون",tone:["pro","detailed"],res:"كود مصحَّح يعمل مع شرح واضح للسبب والإصلاح."},
plan:{role:"أنت مخطّط استراتيجي تبني خططاً واضحة قابلة للتنفيذ.",idea:"أريد خطة عمل عملية للهدف الذي سأحدّده.",feat:["أهداف واضحة","خطوات ملموسة مرتّبة","جدول زمني ومؤشرات نجاح"],aud:"الفريق أو الأطراف المعنية",tone:["pro","detailed"],res:"خطة واضحة قابلة للتنفيذ فوراً."},
marketing:{role:"أنت استراتيجي تسويق تصمّم حملات فعّالة واعية بالبيانات.",idea:"أريد استراتيجية تسويق للمنتج أو العلامة التي سأحدّدها.",feat:["الجمهور المستهدف والتموضع","القنوات والرسائل الأساسية","خطة تنفيذ بمؤشرات أداء"],aud:"النشاط التجاري",tone:["marketing","pro"],res:"استراتيجية تسويق متكاملة قابلة للتنفيذ جاهزة للإطلاق."},
seo:{role:"أنت خبير SEO تنشئ محتوى قيّماً محسّناً لمحركات البحث.",idea:"أريد محتوى/كلمات مفتاحية SEO للموضوع الذي سأحدّده.",feat:["كلمات مفتاحية ونيّة بحث ملائمة","بنية محسّنة قابلة للقراءة","اقتراحات عناوين ووصف ميتا"],aud:"الباحثون ومحركات البحث",tone:["marketing","pro"],res:"محتوى محسّن لمحركات البحث يتصدّر النتائج ويُقرأ بسلاسة."},
excel:{role:"أنت خبير جداول بيانات متمكّن من المعادلات وهيكلة البيانات.",idea:"أريد حلّ جدول بيانات/إكسل للمهمة التي سأحدّدها.",feat:["معادلات وهيكلة صحيحة","تخطيط واضح منظّم","جاهز للنسخ والاستخدام"],aud:"مستخدم الجدول",tone:["pro","concise"],res:"حلّ جدول بيانات يعمل بمعادلات صحيحة جاهز للاستخدام."},
travel:{role:"أنت مخطّط سفر خبير تصمّم برامج عملية وممتعة.",idea:"أريد برنامج سفر للرحلة التي سأحدّدها.",feat:["خطة يوماً بيوم","توقيت ولوجستيات عملية","توصيات مخصّصة"],aud:"المسافر",tone:["friendly","detailed"],res:"برنامج سفر متكامل عملي جاهز للتنفيذ."},
interview:{role:"أنت مدرّب مقابلات تجهّز المرشّحين للتميّز.",idea:"أريد الاستعداد للمقابلة أو الوظيفة التي سأحدّدها.",feat:["أسئلة متوقعة بإجابات قوية","نقاط حديث أساسية","نصائح للتميّز"],aud:"المرشّح",tone:["pro","edu"],res:"حزمة تحضير مركّزة للمقابلة تبني الثقة والجاهزية."}
},fr:{
article:{role:"Vous êtes un rédacteur d'articles expert, clair, captivant et bien documenté.",idea:"Je veux un article complet sur le sujet que je préciserai.",feat:["Une intro forte et des sections claires","Un contenu exact et bien organisé","Une conclusion convaincante"],aud:"Lecteur général",tone:["pro","edu"],res:"Un article complet, prêt à publier, clair et sans erreurs."},
email:{role:"Vous êtes un expert en communication qui rédige des e-mails clairs et efficaces.",idea:"Je veux un e-mail professionnel pour la situation que je préciserai.",feat:["Un objet clair","Un corps concis et structuré","Un ton adapté et un appel à l'action"],aud:"Le destinataire",tone:["pro","formal"],res:"Un e-mail soigné, prêt à envoyer, qui atteint son but."},
cv:{role:"Vous êtes un rédacteur de CV professionnel et coach de carrière.",idea:"Je veux un CV solide pour le poste que je préciserai.",feat:["Un résumé professionnel percutant","Une expérience claire axée résultats","Des compétences pertinentes, mise en forme nette"],aud:"Recruteurs et responsables RH",tone:["pro","concise"],res:"Un CV soigné, compatible ATS, qui se démarque, prêt à l'emploi."},
story:{role:"Vous êtes un auteur de fiction créatif au récit vif et immersif.",idea:"Je veux une histoire sur le thème/l'idée que je préciserai.",feat:["Des personnages attachants","Un arc narratif clair","Des détails vifs et immersifs"],aud:"Le lecteur cible",tone:["creative","detailed"],res:"Une histoire complète et soignée, captivante du début à la fin."},
script:{role:"Vous êtes un scénariste professionnel au dialogue et à la structure affûtés.",idea:"Je veux un scénario pour la scène ou la vidéo que je préciserai.",feat:["Un format de scénario correct","Des dialogues naturels et percutants","Des indications de scène claires"],aud:"Le public/la production",tone:["creative","pro"],res:"Un scénario complet et bien formaté, prêt à produire."},
summary:{role:"Vous êtes expert pour distiller un contenu en résumés clairs et fidèles.",idea:"Je veux un résumé clair du texte/contenu que je fournirai.",feat:["Capte fidèlement les points clés","Concis et bien organisé","Sans déformation ni omission de l'essentiel"],aud:"Un lecteur pressé",tone:["concise","pro"],res:"Un résumé fidèle et concis qui transmet clairement l'essentiel."},
rewrite:{role:"Vous êtes un éditeur expert qui réécrit un texte en préservant son sens.",idea:"Je veux réécrire/reformuler le texte que je fournirai, amélioré et original.",feat:["Préserve le sens d'origine","Clarté et fluidité améliorées","Formulation originale, sans plagiat"],aud:"Le lecteur du texte",tone:["pro","simple"],res:"Une réécriture soignée et originale qui garde le sens et se lit mieux."},
debug:{role:"Vous êtes un ingénieur expert doué pour trouver et corriger les bugs.",idea:"Je veux trouver et corriger le bug dans le code que je fournirai.",feat:["Identifier la cause racine","Fournir le code corrigé","Expliquer la correction brièvement"],aud:"Développeurs",tone:["pro","detailed"],res:"Un code corrigé et fonctionnel, avec une explication claire de la cause et de la correction."},
plan:{role:"Vous êtes un planificateur stratégique qui bâtit des plans clairs et actionnables.",idea:"Je veux un plan d'action pratique pour l'objectif que je préciserai.",feat:["Des objectifs clairs","Des étapes concrètes et ordonnées","Un calendrier et des indicateurs de réussite"],aud:"L'équipe ou les parties prenantes",tone:["pro","detailed"],res:"Un plan clair et actionnable, prêt à exécuter immédiatement."},
marketing:{role:"Vous êtes un stratège marketing qui conçoit des campagnes efficaces et orientées données.",idea:"Je veux une stratégie marketing pour le produit/la marque que je préciserai.",feat:["Public cible et positionnement","Canaux et messages clés","Un plan d'action avec des KPI"],aud:"L'entreprise",tone:["marketing","pro"],res:"Une stratégie marketing complète et actionnable, prête à lancer."},
seo:{role:"Vous êtes un expert SEO qui crée un contenu optimisé et de valeur.",idea:"Je veux du contenu/des mots-clés SEO pour le sujet que je préciserai.",feat:["Mots-clés et intention pertinents","Structure optimisée et lisible","Suggestions de titres et de méta"],aud:"Internautes et moteurs de recherche",tone:["marketing","pro"],res:"Un contenu optimisé qui se classe bien et se lit naturellement."},
excel:{role:"Vous êtes un expert des tableurs, à l'aise avec les formules et la structure de données.",idea:"Je veux une solution tableur/Excel pour la tâche que je préciserai.",feat:["Des formules et une structure correctes","Une disposition claire et organisée","Prêt à copier et utiliser"],aud:"L'utilisateur du tableur",tone:["pro","concise"],res:"Une solution tableur fonctionnelle avec des formules correctes, prête à l'emploi."},
travel:{role:"Vous êtes un planificateur de voyage expert concevant des itinéraires pratiques et agréables.",idea:"Je veux un itinéraire pour le voyage que je préciserai.",feat:["Un plan jour par jour","Un timing et une logistique pratiques","Des recommandations sur mesure"],aud:"Le voyageur",tone:["friendly","detailed"],res:"Un itinéraire de voyage complet et pratique, prêt à suivre."},
interview:{role:"Vous êtes un coach d'entretien qui prépare les candidats à exceller.",idea:"Je veux me préparer à l'entretien/au poste que je préciserai.",feat:["Questions probables avec de bonnes réponses","Points clés à valoriser","Des conseils pour se démarquer"],aud:"Le candidat",tone:["pro","edu"],res:"Un kit de préparation ciblé qui renforce confiance et préparation."}
},it:{
article:{role:"Sei uno scrittore di articoli esperto, chiaro, coinvolgente e ben documentato.",idea:"Voglio un articolo completo sull'argomento che specificherò.",feat:["Un'introduzione forte e sezioni chiare","Contenuto accurato e ben organizzato","Una conclusione convincente"],aud:"Lettore generico",tone:["pro","edu"],res:"Un articolo completo, pronto da pubblicare, chiaro e senza errori."},
email:{role:"Sei un esperto di comunicazione che scrive email chiare ed efficaci.",idea:"Voglio un'email professionale per la situazione che specificherò.",feat:["Un oggetto chiaro","Un corpo conciso e strutturato","Un tono adeguato e una call to action"],aud:"Il destinatario",tone:["pro","formal"],res:"Un'email curata, pronta da inviare, che raggiunge il suo scopo."},
cv:{role:"Sei un redattore di CV professionista e career coach.",idea:"Voglio un CV efficace per il ruolo che specificherò.",feat:["Un sommario professionale incisivo","Esperienza chiara orientata ai risultati","Competenze pertinenti e formattazione pulita"],aud:"Recruiter e responsabili HR",tone:["pro","concise"],res:"Un CV curato, compatibile con gli ATS, che si distingue, pronto all'uso."},
story:{role:"Sei uno scrittore di narrativa creativo dal racconto vivido e immersivo.",idea:"Voglio una storia sul tema/l'idea che specificherò.",feat:["Personaggi coinvolgenti","Un arco narrativo chiaro","Dettagli vividi e immersivi"],aud:"Il lettore target",tone:["creative","detailed"],res:"Una storia completa e curata, avvincente dall'inizio alla fine."},
script:{role:"Sei uno sceneggiatore professionista con dialoghi e struttura incisivi.",idea:"Voglio una sceneggiatura per la scena o il video che specificherò.",feat:["Formato di sceneggiatura corretto","Dialoghi naturali e incisivi","Indicazioni di scena chiare"],aud:"Il pubblico/la produzione",tone:["creative","pro"],res:"Una sceneggiatura completa e ben formattata, pronta da produrre."},
summary:{role:"Sei un esperto nel sintetizzare contenuti in riassunti chiari e fedeli.",idea:"Voglio un riassunto chiaro del testo/contenuto che fornirò.",feat:["Cattura fedelmente i punti chiave","Conciso e ben organizzato","Senza distorsioni o omissioni dell'essenziale"],aud:"Un lettore impegnato",tone:["concise","pro"],res:"Un riassunto fedele e conciso che trasmette chiaramente l'essenziale."},
rewrite:{role:"Sei un editor esperto che riscrive il testo preservandone il significato.",idea:"Voglio riscrivere/parafrasare il testo che fornirò, migliorato e originale.",feat:["Preserva il significato originale","Chiarezza e scorrevolezza migliori","Formulazione originale, senza plagio"],aud:"Il lettore del testo",tone:["pro","simple"],res:"Una riscrittura curata e originale che mantiene il significato e si legge meglio."},
debug:{role:"Sei un ingegnere esperto abile nel trovare e correggere bug.",idea:"Voglio trovare e correggere il bug nel codice che fornirò.",feat:["Identificare la causa principale","Fornire il codice corretto","Spiegare brevemente la correzione"],aud:"Sviluppatori",tone:["pro","detailed"],res:"Codice corretto e funzionante, con una spiegazione chiara della causa e della correzione."},
plan:{role:"Sei un pianificatore strategico che costruisce piani chiari e attuabili.",idea:"Voglio un piano d'azione pratico per l'obiettivo che specificherò.",feat:["Obiettivi chiari","Passi concreti e ordinati","Tempistiche e indicatori di successo"],aud:"Il team o gli stakeholder",tone:["pro","detailed"],res:"Un piano chiaro e attuabile, pronto da eseguire subito."},
marketing:{role:"Sei uno stratega di marketing che progetta campagne efficaci e basate sui dati.",idea:"Voglio una strategia di marketing per il prodotto/brand che specificherò.",feat:["Pubblico target e posizionamento","Canali e messaggi chiave","Un piano d'azione con KPI"],aud:"L'azienda",tone:["marketing","pro"],res:"Una strategia di marketing completa e attuabile, pronta al lancio."},
seo:{role:"Sei un esperto SEO che crea contenuti ottimizzati e di valore.",idea:"Voglio contenuti/parole chiave SEO per l'argomento che specificherò.",feat:["Parole chiave e intento pertinenti","Struttura ottimizzata e leggibile","Suggerimenti di titoli e meta"],aud:"Utenti e motori di ricerca",tone:["marketing","pro"],res:"Contenuti ottimizzati che si posizionano bene e si leggono naturalmente."},
excel:{role:"Sei un esperto di fogli di calcolo, fluente in formule e struttura dei dati.",idea:"Voglio una soluzione foglio di calcolo/Excel per il compito che specificherò.",feat:["Formule e struttura corrette","Layout chiaro e organizzato","Pronto da copiare e usare"],aud:"L'utente del foglio",tone:["pro","concise"],res:"Una soluzione funzionante con formule corrette, pronta all'uso."},
travel:{role:"Sei un esperto pianificatore di viaggi che crea itinerari pratici e piacevoli.",idea:"Voglio un itinerario per il viaggio che specificherò.",feat:["Un piano giorno per giorno","Tempistiche e logistica pratiche","Raccomandazioni su misura"],aud:"Il viaggiatore",tone:["friendly","detailed"],res:"Un itinerario di viaggio completo e pratico, pronto da seguire."},
interview:{role:"Sei un coach di colloqui che prepara i candidati a eccellere.",idea:"Voglio prepararmi al colloquio/ruolo che specificherò.",feat:["Domande probabili con risposte efficaci","Punti chiave da valorizzare","Consigli per distinguersi"],aud:"Il candidato",tone:["pro","edu"],res:"Un kit di preparazione mirato che rafforza sicurezza e prontezza."}
},de:{
article:{role:"Du bist ein erfahrener Artikelautor: klar, fesselnd und gut recherchiert.",idea:"Ich möchte einen vollständigen Artikel zum von mir genannten Thema.",feat:["Ein starker Einstieg und klare Abschnitte","Korrekter, gut gegliederter Inhalt","Ein überzeugendes Fazit"],aud:"Allgemeiner Leser",tone:["pro","edu"],res:"Ein vollständiger, veröffentlichungsreifer Artikel, klar und fehlerfrei."},
email:{role:"Du bist ein Kommunikationsexperte, der klare, wirksame E-Mails schreibt.",idea:"Ich möchte eine professionelle E-Mail für die von mir genannte Situation.",feat:["Eine klare Betreffzeile","Ein knapper, strukturierter Text","Ein passender Ton und ein Call-to-Action"],aud:"Der Empfänger",tone:["pro","formal"],res:"Eine ausgefeilte, sendebereite E-Mail, die ihr Ziel erreicht."},
cv:{role:"Du bist ein professioneller Lebenslauf-Autor und Karrierecoach.",idea:"Ich möchte einen starken Lebenslauf für die von mir genannte Stelle.",feat:["Ein überzeugendes Profil","Klare, ergebnisorientierte Erfahrung","Relevante Fähigkeiten, sauberes Format"],aud:"Recruiter und Personalverantwortliche",tone:["pro","concise"],res:"Ein ausgefeilter, ATS-tauglicher Lebenslauf, der heraussticht, einsatzbereit."},
story:{role:"Du bist ein kreativer Autor mit lebendigem, immersivem Erzählstil.",idea:"Ich möchte eine Geschichte zum von mir genannten Thema/zur Idee.",feat:["Fesselnde Figuren","Ein klarer Handlungsbogen","Lebendige, immersive Details"],aud:"Der Ziel-Leser",tone:["creative","detailed"],res:"Eine vollständige, gut gearbeitete Geschichte, von Anfang bis Ende fesselnd."},
script:{role:"Du bist ein professioneller Drehbuchautor mit pointierten Dialogen und Struktur.",idea:"Ich möchte ein Drehbuch für die von mir genannte Szene oder das Video.",feat:["Korrektes Drehbuchformat","Natürliche, pointierte Dialoge","Klare Szenenanweisungen"],aud:"Publikum/Produktion",tone:["creative","pro"],res:"Ein vollständiges, korrekt formatiertes Drehbuch, produktionsbereit."},
summary:{role:"Du bist ein Experte darin, Inhalte zu klaren, treuen Zusammenfassungen zu verdichten.",idea:"Ich möchte eine klare Zusammenfassung des bereitgestellten Textes/Inhalts.",feat:["Erfasst die Kernpunkte getreu","Knapp und gut gegliedert","Ohne Verzerrung oder Auslassung des Wesentlichen"],aud:"Ein beschäftigter Leser",tone:["concise","pro"],res:"Eine treue, knappe Zusammenfassung, die das Wesentliche klar vermittelt."},
rewrite:{role:"Du bist ein erfahrener Lektor, der Text umschreibt und die Bedeutung bewahrt.",idea:"Ich möchte den bereitgestellten Text umschreiben/paraphrasieren, verbessert und original.",feat:["Bewahrt die ursprüngliche Bedeutung","Bessere Klarheit und Lesefluss","Originelle Formulierung, ohne Plagiat"],aud:"Der Leser des Textes",tone:["pro","simple"],res:"Eine ausgefeilte, originelle Umschreibung, die die Bedeutung wahrt und sich besser liest."},
debug:{role:"Du bist ein erfahrener Softwareingenieur, geübt im Finden und Beheben von Bugs.",idea:"Ich möchte den Bug im bereitgestellten Code finden und beheben.",feat:["Die Ursache identifizieren","Den korrigierten Code liefern","Die Korrektur kurz erklären"],aud:"Entwickler",tone:["pro","detailed"],res:"Korrigierter, funktionierender Code mit klarer Erklärung von Ursache und Behebung."},
plan:{role:"Du bist ein strategischer Planer, der klare, umsetzbare Pläne erstellt.",idea:"Ich möchte einen praktischen Aktionsplan für das von mir genannte Ziel.",feat:["Klare Ziele","Konkrete, geordnete Schritte","Zeitplan und Erfolgskennzahlen"],aud:"Das Team oder die Beteiligten",tone:["pro","detailed"],res:"Ein klarer, umsetzbarer Plan, sofort ausführbar."},
marketing:{role:"Du bist ein Marketingstratege, der wirksame, datenbewusste Kampagnen entwirft.",idea:"Ich möchte eine Marketingstrategie für das von mir genannte Produkt/die Marke.",feat:["Zielgruppe und Positionierung","Kanäle und Kernbotschaften","Ein Aktionsplan mit KPIs"],aud:"Das Unternehmen",tone:["marketing","pro"],res:"Eine vollständige, umsetzbare Marketingstrategie, startbereit."},
seo:{role:"Du bist ein SEO-Experte, der suchoptimierte, wertvolle Inhalte erstellt.",idea:"Ich möchte SEO-Inhalte/Keywords zum von mir genannten Thema.",feat:["Relevante Keywords und Suchintention","Optimierte, lesbare Struktur","Titel- und Meta-Vorschläge"],aud:"Suchende und Suchmaschinen",tone:["marketing","pro"],res:"Suchoptimierte Inhalte, die gut ranken und sich natürlich lesen."},
excel:{role:"Du bist ein Tabellenkalkulations-Experte, sicher mit Formeln und Datenstruktur.",idea:"Ich möchte eine Tabellen-/Excel-Lösung für die von mir genannte Aufgabe.",feat:["Korrekte Formeln und Struktur","Klares, organisiertes Layout","Bereit zum Kopieren und Verwenden"],aud:"Der Tabellen-Nutzer",tone:["pro","concise"],res:"Eine funktionierende Tabellen-Lösung mit korrekten Formeln, einsatzbereit."},
travel:{role:"Du bist ein erfahrener Reiseplaner, der praktische, schöne Reisepläne erstellt.",idea:"Ich möchte einen Reiseplan für die von mir genannte Reise.",feat:["Ein Tag-für-Tag-Plan","Praktisches Timing und Logistik","Maßgeschneiderte Empfehlungen"],aud:"Der Reisende",tone:["friendly","detailed"],res:"Ein vollständiger, praktischer Reiseplan, bereit zum Befolgen."},
interview:{role:"Du bist ein Interview-Coach, der Kandidaten auf Spitzenleistung vorbereitet.",idea:"Ich möchte mich auf das von mir genannte Interview/die Stelle vorbereiten.",feat:["Wahrscheinliche Fragen mit starken Antworten","Wichtige Gesprächspunkte","Tipps, um herauszustechen"],aud:"Der Kandidat",tone:["pro","edu"],res:"Ein fokussiertes Interview-Vorbereitungspaket, das Sicherheit und Bereitschaft stärkt."}
}};
const TOOLS={
aistudio_build:{n:"Google AI Studio — Build",u:"https://aistudio.google.com/apps",e:"🛠️",d:{en:"build apps from a prompt",ar:"بناء تطبيق من وصفك مباشرة",fr:"créer une app depuis un prompt",it:"crea app da un prompt",de:"Apps aus einem Prompt bauen"}},
v0:{n:"v0 by Vercel",u:"https://v0.app",e:"▲",d:{en:"generate UI & web apps",ar:"توليد واجهات وتطبيقات ويب",fr:"générer UI & web apps",it:"genera UI e web app",de:"UI & Web-Apps generieren"}},
bolt:{n:"Bolt.new",u:"https://bolt.new",e:"⚡",d:{en:"full-stack app builder",ar:"بناء تطبيق ويب متكامل",fr:"app full-stack",it:"app full-stack",de:"Full-Stack-App-Builder"}},
lovable:{n:"Lovable",u:"https://lovable.dev",e:"💗",d:{en:"build apps by chatting",ar:"بناء تطبيق عبر المحادثة",fr:"app en discutant",it:"app chiacchierando",de:"Apps per Chat bauen"}},
midjourney:{n:"Midjourney",u:"https://www.midjourney.com",e:"🖼️",d:{en:"top image generation",ar:"توليد صور عالي الجودة",fr:"génération d'images top",it:"generazione immagini top",de:"Top-Bildgenerierung"}},
ideogram:{n:"Ideogram",u:"https://ideogram.ai",e:"✒️",d:{en:"images with great text",ar:"صور بنصوص واضحة",fr:"images avec texte net",it:"immagini con testo nitido",de:"Bilder mit gutem Text"}},
leonardo:{n:"Leonardo AI",u:"https://leonardo.ai",e:"🎨",d:{en:"image generation suite",ar:"منصة متكاملة لتوليد الصور",fr:"suite d'images IA",it:"suite immagini IA",de:"Bild-Suite"}},
suno:{n:"Suno",u:"https://suno.com",e:"🎵",d:{en:"create full songs",ar:"إنشاء أغانٍ كاملة",fr:"créer des chansons",it:"crea canzoni",de:"ganze Songs erstellen"}},
udio:{n:"Udio",u:"https://www.udio.com",e:"🎶",d:{en:"AI music generation",ar:"توليد موسيقى بالذكاء",fr:"musique IA",it:"musica IA",de:"KI-Musik"}},
elevenlabs:{n:"ElevenLabs",u:"https://elevenlabs.io",e:"🎙️",d:{en:"lifelike AI voices (TTS)",ar:"أصوات واقعية (نص ← كلام)",fr:"voix IA réalistes (TTS)",it:"voci IA realistiche (TTS)",de:"realistische KI-Stimmen (TTS)"}},
aistudio_tts:{n:"Google AI Studio — Speech",u:"https://aistudio.google.com",e:"🔊",d:{en:"text → natural speech",ar:"تحويل النص إلى كلام طبيعي",fr:"texte → voix naturelle",it:"testo → voce naturale",de:"Text → natürliche Sprache"}},
runway:{n:"Runway",u:"https://runwayml.com",e:"🎬",d:{en:"AI video generation",ar:"توليد فيديو بالذكاء",fr:"génération vidéo IA",it:"generazione video IA",de:"KI-Videogenerierung"}},
pika:{n:"Pika",u:"https://pika.art",e:"📹",d:{en:"AI video creation",ar:"إنشاء فيديو بالذكاء",fr:"création vidéo IA",it:"creazione video IA",de:"KI-Videoerstellung"}},
veo:{n:"Google AI Studio — Veo",u:"https://aistudio.google.com",e:"🎥",d:{en:"Google's AI video",ar:"فيديو جوجل بالذكاء",fr:"vidéo IA de Google",it:"video IA di Google",de:"Googles KI-Video"}},
gamma:{n:"Gamma",u:"https://gamma.app",e:"📊",d:{en:"AI slide decks",ar:"إنشاء عروض شرائح بالذكاء",fr:"présentations IA",it:"presentazioni IA",de:"KI-Foliendecks"}},
deepl:{n:"DeepL",u:"https://www.deepl.com",e:"🌍",d:{en:"best-in-class translation",ar:"ترجمة عالية الدقة",fr:"traduction de pointe",it:"traduzione top",de:"Top-Übersetzung"}},
notebooklm:{n:"NotebookLM",u:"https://notebooklm.google.com",e:"📓",d:{en:"analyse your documents",ar:"تحليل مستنداتك وملفاتك",fr:"analyser vos documents",it:"analizza i tuoi documenti",de:"deine Dokumente analysieren"}},
perplexity:{n:"Perplexity",u:"https://www.perplexity.ai",e:"🔎",d:{en:"answers with sources",ar:"إجابات مدعومة بمصادر",fr:"réponses sourcées",it:"risposte con fonti",de:"Antworten mit Quellen"}},
claude:{n:"Claude",u:"https://claude.ai",e:"🟣",d:{en:"deep reasoning & writing",ar:"استدلال وكتابة عميقة",fr:"raisonnement & rédaction",it:"ragionamento e scrittura",de:"tiefes Denken & Schreiben"}},
chatgpt:{n:"ChatGPT",u:"https://chatgpt.com",e:"🟢",d:{en:"versatile assistant",ar:"مساعد متعدد المهام",fr:"assistant polyvalent",it:"assistente versatile",de:"vielseitiger Assistent"}},
gemini:{n:"Gemini",u:"https://gemini.google.com",e:"🔵",d:{en:"Google's assistant",ar:"مساعد جوجل",fr:"assistant de Google",it:"assistente di Google",de:"Googles Assistent"}}
};
const GEN=["claude","chatgpt","gemini","perplexity"];
const GROUPS={
website:["aistudio_build","v0","bolt"],webapp:["aistudio_build","bolt","v0"],mobileapp:["aistudio_build","bolt","lovable"],dash:["aistudio_build","v0","bolt"],service:["aistudio_build","bolt","lovable"],
code:["claude","aistudio_build","chatgpt"],debug:["claude","chatgpt","aistudio_build"],auto:["claude","aistudio_build","chatgpt"],
image:["midjourney","ideogram","leonardo"],logo:["ideogram","midjourney","leonardo"],
song:["suno","udio","elevenlabs"],audio:["suno","elevenlabs","udio"],
script:["elevenlabs","aistudio_tts","claude"],
video:["runway","veo","pika"],
slides:["gamma","claude","chatgpt"],
trans:["deepl","claude","chatgpt"],
fromfile:["claude","notebooklm","chatgpt"],
excel:["chatgpt","claude","gemini"],
consult:["claude","chatgpt","perplexity"],learn:["claude","perplexity","chatgpt"],invent:["claude","chatgpt","perplexity"],marketing:["claude","chatgpt","perplexity"],seo:["claude","perplexity","chatgpt"],plan:["claude","chatgpt","perplexity"],interview:["claude","chatgpt","perplexity"],travel:["claude","perplexity","gemini"]
};