orchid-ai 1.3.8 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/orchid-ai.css +1984 -0
  2. package/package.json +19 -131
  3. package/src/components/ChatInput.jsx +92 -0
  4. package/src/components/ChatWindow.jsx +115 -0
  5. package/src/components/Message.jsx +219 -0
  6. package/src/components/visualizations/AiVisualization.jsx +111 -0
  7. package/src/components/visualizations/BarChart.jsx +44 -0
  8. package/src/components/visualizations/DataTable.jsx +31 -0
  9. package/src/components/visualizations/DotChart.jsx +213 -0
  10. package/src/components/visualizations/GroupedBarChart.jsx +90 -0
  11. package/src/components/visualizations/HistogramChart.jsx +95 -0
  12. package/src/components/visualizations/LineChart.jsx +260 -0
  13. package/src/components/visualizations/ScatterPlot.jsx +131 -0
  14. package/src/components/visualizations/StackedBarChart.jsx +84 -0
  15. package/src/components/visualizations/StatCards.jsx +24 -0
  16. package/src/components/visualizations/Timeline.jsx +115 -0
  17. package/src/components/visualizations/chartSchema.js +1167 -0
  18. package/src/components/visualizations/parseChartBlock.js +56 -0
  19. package/src/constants/visualizationInstructions.js +23 -0
  20. package/src/hooks/useOrchidAiChat.js +135 -0
  21. package/src/index.d.ts +124 -0
  22. package/src/index.js +52 -0
  23. package/README.md +0 -262
  24. package/dist/cli/cli/generate-schemas.d.ts +0 -1
  25. package/dist/cli/components/ChatPanel.d.ts +0 -146
  26. package/dist/cli/components/Conversation.d.ts +0 -80
  27. package/dist/cli/components/ErrorBoundary.d.ts +0 -16
  28. package/dist/cli/components/Icon.d.ts +0 -84
  29. package/dist/cli/components/ModelSwitcher.d.ts +0 -25
  30. package/dist/cli/components/SuggestionsPanel.d.ts +0 -27
  31. package/dist/cli/constants.d.ts +0 -353
  32. package/dist/cli/generate-schemas.d.ts +0 -1
  33. package/dist/cli/generate-schemas.js +0 -2698
  34. package/dist/cli/headless.d.ts +0 -19
  35. package/dist/cli/hooks/useAiMerge.d.ts +0 -20
  36. package/dist/cli/hooks/useModelSwitcher.d.ts +0 -68
  37. package/dist/cli/hooks/useResolvedDefaultModel.d.ts +0 -23
  38. package/dist/cli/hooks/useStreamingAI.d.ts +0 -29
  39. package/dist/cli/hooks/useSuggestions.d.ts +0 -48
  40. package/dist/cli/index.d.ts +0 -16
  41. package/dist/cli/server/contextual-service.d.ts +0 -108
  42. package/dist/cli/server/document-processor.d.ts +0 -60
  43. package/dist/cli/server/index.d.ts +0 -14
  44. package/dist/cli/server/intent-detection.d.ts +0 -134
  45. package/dist/cli/server/monastery-analyzer.d.ts +0 -53
  46. package/dist/cli/server/mongodb-rag.d.ts +0 -106
  47. package/dist/cli/server/schema-generator.d.ts +0 -158
  48. package/dist/cli/server/server.d.ts +0 -32
  49. package/dist/cli/server/service.d.ts +0 -267
  50. package/dist/cli/server/training-schema.d.ts +0 -17
  51. package/dist/cli/server/training.d.ts +0 -232
  52. package/dist/cli/server/typescript-analyzer.d.ts +0 -56
  53. package/dist/cli/server/utils.d.ts +0 -197
  54. package/dist/cli/types/types.d.ts +0 -523
  55. package/dist/cli/utils/fileHandler.d.ts +0 -20
  56. package/dist/cli/utils.d.ts +0 -19
  57. package/dist/components/ChatPanel.d.ts +0 -146
  58. package/dist/components/Conversation.d.ts +0 -80
  59. package/dist/components/ErrorBoundary.d.ts +0 -16
  60. package/dist/components/Icon.d.ts +0 -84
  61. package/dist/components/ModelSwitcher.d.ts +0 -25
  62. package/dist/components/SuggestionsPanel.d.ts +0 -27
  63. package/dist/constants.d.ts +0 -353
  64. package/dist/headless.d.ts +0 -19
  65. package/dist/headless.esm.js +0 -1633
  66. package/dist/headless.js +0 -1647
  67. package/dist/hooks/useAiMerge.d.ts +0 -20
  68. package/dist/hooks/useModelSwitcher.d.ts +0 -68
  69. package/dist/hooks/useResolvedDefaultModel.d.ts +0 -23
  70. package/dist/hooks/useStreamingAI.d.ts +0 -29
  71. package/dist/hooks/useSuggestions.d.ts +0 -48
  72. package/dist/index.d.ts +0 -16
  73. package/dist/index.esm.js +0 -3996
  74. package/dist/index.js +0 -4012
  75. package/dist/server/cli/generate-schemas.d.ts +0 -1
  76. package/dist/server/components/ChatPanel.d.ts +0 -146
  77. package/dist/server/components/Conversation.d.ts +0 -80
  78. package/dist/server/components/ErrorBoundary.d.ts +0 -16
  79. package/dist/server/components/Icon.d.ts +0 -84
  80. package/dist/server/components/ModelSwitcher.d.ts +0 -25
  81. package/dist/server/components/SuggestionsPanel.d.ts +0 -27
  82. package/dist/server/constants.d.ts +0 -353
  83. package/dist/server/contextual-service.d.ts +0 -108
  84. package/dist/server/document-processor.d.ts +0 -60
  85. package/dist/server/headless.d.ts +0 -19
  86. package/dist/server/hooks/useAiMerge.d.ts +0 -20
  87. package/dist/server/hooks/useModelSwitcher.d.ts +0 -68
  88. package/dist/server/hooks/useResolvedDefaultModel.d.ts +0 -23
  89. package/dist/server/hooks/useStreamingAI.d.ts +0 -29
  90. package/dist/server/hooks/useSuggestions.d.ts +0 -48
  91. package/dist/server/index.d.ts +0 -14
  92. package/dist/server/index.esm.js +0 -16563
  93. package/dist/server/index.js +0 -16600
  94. package/dist/server/intent-detection.d.ts +0 -134
  95. package/dist/server/monastery-analyzer.d.ts +0 -53
  96. package/dist/server/mongodb-rag.d.ts +0 -106
  97. package/dist/server/schema-generator.d.ts +0 -158
  98. package/dist/server/server/contextual-service.d.ts +0 -108
  99. package/dist/server/server/document-processor.d.ts +0 -60
  100. package/dist/server/server/index.d.ts +0 -14
  101. package/dist/server/server/intent-detection.d.ts +0 -134
  102. package/dist/server/server/monastery-analyzer.d.ts +0 -53
  103. package/dist/server/server/mongodb-rag.d.ts +0 -106
  104. package/dist/server/server/schema-generator.d.ts +0 -158
  105. package/dist/server/server/server.d.ts +0 -32
  106. package/dist/server/server/service.d.ts +0 -267
  107. package/dist/server/server/training-schema.d.ts +0 -17
  108. package/dist/server/server/training.d.ts +0 -232
  109. package/dist/server/server/typescript-analyzer.d.ts +0 -56
  110. package/dist/server/server/utils.d.ts +0 -197
  111. package/dist/server/server.d.ts +0 -32
  112. package/dist/server/service.d.ts +0 -267
  113. package/dist/server/training-schema.d.ts +0 -17
  114. package/dist/server/training.d.ts +0 -232
  115. package/dist/server/types/types.d.ts +0 -523
  116. package/dist/server/typescript-analyzer.d.ts +0 -56
  117. package/dist/server/utils/fileHandler.d.ts +0 -20
  118. package/dist/server/utils/mergeWithAi.d.ts +0 -19
  119. package/dist/server/utils.d.ts +0 -197
  120. package/dist/styles.css +0 -2
  121. package/dist/types/types.d.ts +0 -523
  122. package/dist/utils/fileHandler.d.ts +0 -20
  123. package/dist/utils/mergeWithAi.d.ts +0 -19
  124. package/dist/utils.d.ts +0 -19
package/orchid-ai.css ADDED
@@ -0,0 +1,1984 @@
1
+ /* ── Container ── */
2
+
3
+ .ai-chat-container {
4
+ display: flex;
5
+ flex-direction: column;
6
+ height: 100%;
7
+ flex: 1;
8
+ min-width: 0;
9
+ min-height: 0;
10
+ background: #f9fafb;
11
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
12
+ Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
13
+ color: #1a1a2e;
14
+ }
15
+
16
+ /* ── Header ── */
17
+
18
+ .ai-chat-header {
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ padding: 16px 24px;
23
+ background: #1eaaf1;
24
+ color: #ffffff;
25
+ flex-shrink: 0;
26
+ }
27
+
28
+ .ai-chat-header-inner {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: space-between;
32
+ width: 100%;
33
+ max-width: 768px;
34
+ }
35
+
36
+ .ai-chat-header-left {
37
+ display: flex;
38
+ align-items: center;
39
+ gap: 14px;
40
+ }
41
+
42
+ .ai-chat-logo {
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ width: 42px;
47
+ height: 42px;
48
+ background: rgba(255, 255, 255, 0.12);
49
+ border-radius: 12px;
50
+ }
51
+
52
+ .ai-chat-header h1 {
53
+ font-size: 18px;
54
+ font-weight: 600;
55
+ margin: 0;
56
+ line-height: 1.3;
57
+ }
58
+
59
+ .ai-chat-header p {
60
+ font-size: 13px;
61
+ margin: 0;
62
+ opacity: 0.7;
63
+ }
64
+
65
+ .ai-chat-header-actions {
66
+ display: flex;
67
+ align-items: center;
68
+ gap: 10px;
69
+ }
70
+
71
+ .ai-chat-client-selector select {
72
+ -webkit-appearance: none;
73
+ appearance: none;
74
+ background: rgba(255, 255, 255, 0.15);
75
+ border: 1px solid rgba(255, 255, 255, 0.25);
76
+ border-radius: 8px;
77
+ color: #ffffff;
78
+ font-size: 13px;
79
+ padding: 8px 32px 8px 12px;
80
+ cursor: pointer;
81
+ transition: background 0.2s, border-color 0.2s;
82
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
83
+ background-repeat: no-repeat;
84
+ background-position: right 10px center;
85
+ min-width: 180px;
86
+ max-width: 280px;
87
+ font-family: inherit;
88
+ }
89
+
90
+ .ai-chat-client-selector select:hover {
91
+ background-color: rgba(255, 255, 255, 0.25);
92
+ border-color: rgba(255, 255, 255, 0.4);
93
+ }
94
+
95
+ .ai-chat-client-selector select:focus {
96
+ outline: none;
97
+ border-color: rgba(255, 255, 255, 0.5);
98
+ box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
99
+ }
100
+
101
+ .ai-chat-client-selector select option {
102
+ color: #1a1a2e;
103
+ background: #ffffff;
104
+ }
105
+
106
+ .ai-chat-client-selector.attention-active select {
107
+ animation: selectorPulseA 0.7s ease;
108
+ border-color: rgba(251, 146, 60, 0.95);
109
+ box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.45);
110
+ }
111
+
112
+ @keyframes selectorPulseA {
113
+ 0% {
114
+ transform: translateX(0);
115
+ box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.45);
116
+ }
117
+ 20% {
118
+ transform: translateX(-2px);
119
+ }
120
+ 40% {
121
+ transform: translateX(2px);
122
+ }
123
+ 60% {
124
+ transform: translateX(-1px);
125
+ }
126
+ 80% {
127
+ transform: translateX(1px);
128
+ box-shadow: 0 0 0 6px rgba(251, 146, 60, 0.2);
129
+ }
130
+ 100% {
131
+ transform: translateX(0);
132
+ box-shadow: 0 0 0 0 rgba(251, 146, 60, 0);
133
+ }
134
+ }
135
+
136
+ @keyframes selectorPulseB {
137
+ 0% {
138
+ transform: translateX(0);
139
+ box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.45);
140
+ }
141
+ 20% {
142
+ transform: translateX(-2px);
143
+ }
144
+ 40% {
145
+ transform: translateX(2px);
146
+ }
147
+ 60% {
148
+ transform: translateX(-1px);
149
+ }
150
+ 80% {
151
+ transform: translateX(1px);
152
+ box-shadow: 0 0 0 6px rgba(251, 146, 60, 0.2);
153
+ }
154
+ 100% {
155
+ transform: translateX(0);
156
+ box-shadow: 0 0 0 0 rgba(251, 146, 60, 0);
157
+ }
158
+ }
159
+
160
+ .ai-chat-clear-btn {
161
+ display: flex;
162
+ align-items: center;
163
+ gap: 6px;
164
+ padding: 8px 14px;
165
+ background: rgba(255, 255, 255, 0.1);
166
+ border: 1px solid rgba(255, 255, 255, 0.15);
167
+ border-radius: 8px;
168
+ color: #ffffff;
169
+ font-size: 13px;
170
+ cursor: pointer;
171
+ transition: background 0.2s;
172
+ }
173
+
174
+ .ai-chat-clear-btn:hover {
175
+ background: rgba(255, 255, 255, 0.2);
176
+ }
177
+
178
+ /* ── Chat Window ── */
179
+
180
+ .ai-chat-window {
181
+ flex: 1;
182
+ overflow-y: auto;
183
+ padding: 24px 24px 0;
184
+ display: flex;
185
+ flex-direction: column;
186
+ gap: 20px;
187
+ }
188
+
189
+ .ai-chat-window::-webkit-scrollbar {
190
+ width: 6px;
191
+ }
192
+
193
+ .ai-chat-window::-webkit-scrollbar-track {
194
+ background: transparent;
195
+ }
196
+
197
+ .ai-chat-window::-webkit-scrollbar-thumb {
198
+ background: #d1d5db;
199
+ border-radius: 3px;
200
+ }
201
+
202
+ /* ── Empty State ── */
203
+
204
+ .ai-chat-empty {
205
+ display: flex;
206
+ flex-direction: column;
207
+ align-items: center;
208
+ justify-content: center;
209
+ text-align: center;
210
+ flex: 1;
211
+ padding: 40px 20px;
212
+ color: #6b7280;
213
+ }
214
+
215
+ .ai-chat-empty-icon {
216
+ display: flex;
217
+ align-items: center;
218
+ justify-content: center;
219
+ width: 80px;
220
+ height: 80px;
221
+ background: #f3f4f6;
222
+ border-radius: 50%;
223
+ margin-bottom: 20px;
224
+ color: #9ca3af;
225
+ }
226
+
227
+ .ai-chat-empty h2 {
228
+ font-size: 22px;
229
+ font-weight: 600;
230
+ color: #1a1a2e;
231
+ margin-bottom: 8px;
232
+ }
233
+
234
+ .ai-chat-empty > p {
235
+ font-size: 15px;
236
+ max-width: 420px;
237
+ line-height: 1.5;
238
+ }
239
+
240
+ .ai-chat-suggestions {
241
+ margin-top: 28px;
242
+ text-align: left;
243
+ background: #ffffff;
244
+ border: 1px solid #e5e7eb;
245
+ border-radius: 12px;
246
+ padding: 16px 20px;
247
+ }
248
+
249
+ .ai-chat-suggestions span {
250
+ font-size: 12px;
251
+ font-weight: 600;
252
+ text-transform: uppercase;
253
+ letter-spacing: 0.05em;
254
+ color: #9ca3af;
255
+ }
256
+
257
+ .ai-chat-suggestions ul {
258
+ list-style: none;
259
+ margin-top: 10px;
260
+ display: flex;
261
+ flex-direction: column;
262
+ gap: 8px;
263
+ }
264
+
265
+ .ai-chat-suggestions li {
266
+ font-size: 14px;
267
+ color: #4b5563;
268
+ padding: 8px 12px;
269
+ background: #f9fafb;
270
+ border: 1px solid #e5e7eb;
271
+ border-radius: 8px;
272
+ cursor: pointer;
273
+ transition: background 0.15s, border-color 0.15s, color 0.15s;
274
+ }
275
+
276
+ .ai-chat-suggestions li:hover {
277
+ background: #eef7fe;
278
+ border-color: #1eaaf1;
279
+ color: #1eaaf1;
280
+ }
281
+
282
+ /* ── Messages ── */
283
+
284
+ .ai-chat-message {
285
+ display: flex;
286
+ gap: 12px;
287
+ align-items: flex-start;
288
+ max-width: 768px;
289
+ width: 100%;
290
+ margin-left: auto;
291
+ margin-right: auto;
292
+ animation: fadeIn 0.3s ease;
293
+ }
294
+
295
+ .ai-chat-message.user {
296
+ flex-direction: row-reverse;
297
+ }
298
+
299
+ @keyframes fadeIn {
300
+ from {
301
+ opacity: 0;
302
+ transform: translateY(8px);
303
+ }
304
+ to {
305
+ opacity: 1;
306
+ transform: translateY(0);
307
+ }
308
+ }
309
+
310
+ .ai-chat-avatar {
311
+ flex-shrink: 0;
312
+ width: 34px;
313
+ height: 34px;
314
+ border-radius: 50%;
315
+ display: flex;
316
+ align-items: center;
317
+ justify-content: center;
318
+ font-size: 11px;
319
+ font-weight: 700;
320
+ text-transform: uppercase;
321
+ }
322
+
323
+ .ai-chat-avatar.user {
324
+ background: #3b82f6;
325
+ color: #ffffff;
326
+ }
327
+
328
+ .ai-chat-avatar.assistant {
329
+ background: #1a1a2e;
330
+ color: #ffffff;
331
+ }
332
+
333
+ .ai-chat-bubble {
334
+ max-width: 85%;
335
+ padding: 12px 16px;
336
+ border-radius: 16px;
337
+ font-size: 14px;
338
+ line-height: 1.6;
339
+ word-wrap: break-word;
340
+ -webkit-user-select: text;
341
+ user-select: text;
342
+ }
343
+
344
+ .ai-chat-bubble.user {
345
+ background: #3b82f6;
346
+ color: #ffffff;
347
+ border-bottom-right-radius: 4px;
348
+ }
349
+
350
+ .ai-chat-bubble.assistant {
351
+ position: relative;
352
+ background: #ffffff;
353
+ color: #1f2937;
354
+ border: 1px solid #e5e7eb;
355
+ border-bottom-left-radius: 4px;
356
+ }
357
+
358
+ /* ── Markdown Typography (assistant bubbles) ── */
359
+
360
+ .ai-chat-bubble.assistant p {
361
+ margin: 0 0 8px;
362
+ }
363
+
364
+ .ai-chat-bubble.assistant p:last-child {
365
+ margin-bottom: 0;
366
+ }
367
+
368
+ .ai-chat-bubble.assistant strong {
369
+ font-weight: 600;
370
+ }
371
+
372
+ .ai-chat-bubble.assistant em {
373
+ font-style: italic;
374
+ }
375
+
376
+ .ai-chat-bubble.assistant ul,
377
+ .ai-chat-bubble.assistant ol {
378
+ margin: 4px 0 8px;
379
+ padding-left: 20px;
380
+ }
381
+
382
+ .ai-chat-bubble.assistant li {
383
+ margin-bottom: 4px;
384
+ }
385
+
386
+ .ai-chat-bubble.assistant li:last-child {
387
+ margin-bottom: 0;
388
+ }
389
+
390
+ .ai-chat-bubble.assistant h1,
391
+ .ai-chat-bubble.assistant h2,
392
+ .ai-chat-bubble.assistant h3,
393
+ .ai-chat-bubble.assistant h4 {
394
+ font-weight: 600;
395
+ margin: 12px 0 6px;
396
+ line-height: 1.3;
397
+ }
398
+
399
+ .ai-chat-bubble.assistant h1:first-child,
400
+ .ai-chat-bubble.assistant h2:first-child,
401
+ .ai-chat-bubble.assistant h3:first-child,
402
+ .ai-chat-bubble.assistant h4:first-child {
403
+ margin-top: 0;
404
+ }
405
+
406
+ .ai-chat-bubble.assistant h1 { font-size: 18px; }
407
+ .ai-chat-bubble.assistant h2 { font-size: 16px; }
408
+ .ai-chat-bubble.assistant h3 { font-size: 15px; }
409
+ .ai-chat-bubble.assistant h4 { font-size: 14px; }
410
+
411
+ .ai-chat-bubble.assistant code {
412
+ background: #f3f4f6;
413
+ padding: 1px 5px;
414
+ border-radius: 4px;
415
+ font-size: 13px;
416
+ font-family: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
417
+ }
418
+
419
+ .ai-chat-bubble.assistant pre {
420
+ background: #f3f4f6;
421
+ border-radius: 8px;
422
+ padding: 10px 12px;
423
+ overflow-x: auto;
424
+ margin: 8px 0;
425
+ }
426
+
427
+ .ai-chat-bubble.assistant pre code {
428
+ background: none;
429
+ padding: 0;
430
+ }
431
+
432
+ .ai-chat-bubble.assistant blockquote {
433
+ border-left: 3px solid #d1d5db;
434
+ margin: 8px 0;
435
+ padding: 4px 12px;
436
+ color: #6b7280;
437
+ }
438
+
439
+ .ai-chat-bubble.assistant hr {
440
+ border: none;
441
+ border-top: 1px solid #e5e7eb;
442
+ margin: 12px 0;
443
+ }
444
+
445
+ .ai-chat-bubble.assistant a {
446
+ color: #1eaaf1;
447
+ text-decoration: underline;
448
+ }
449
+
450
+ .ai-chat-bubble.assistant table {
451
+ border-collapse: collapse;
452
+ margin: 8px 0;
453
+ font-size: 13px;
454
+ width: 100%;
455
+ }
456
+
457
+ .ai-chat-bubble.assistant th,
458
+ .ai-chat-bubble.assistant td {
459
+ border: 1px solid #e5e7eb;
460
+ padding: 6px 10px;
461
+ text-align: left;
462
+ }
463
+
464
+ .ai-chat-bubble.assistant th {
465
+ background: #f9fafb;
466
+ font-weight: 600;
467
+ }
468
+
469
+ /* ── AI Visualization Blocks ── */
470
+
471
+ .ai-chart-card {
472
+ margin: 10px 0 4px;
473
+ border: 1px solid #e5e7eb;
474
+ border-radius: 10px;
475
+ background: #f8fbff;
476
+ padding: 12px;
477
+ }
478
+
479
+ .ai-chart-title {
480
+ margin: 0 0 10px;
481
+ font-size: 14px;
482
+ font-weight: 600;
483
+ color: #1f2937;
484
+ }
485
+
486
+ .ai-chart-error {
487
+ color: #b91c1c;
488
+ background: #fef2f2;
489
+ border-color: #fecaca;
490
+ }
491
+
492
+ .ai-chart-debug-pre {
493
+ margin: 8px 0 0;
494
+ padding: 10px;
495
+ max-height: 240px;
496
+ overflow: auto;
497
+ background: #0f172a;
498
+ color: #f8fafc;
499
+ border: 1px solid #334155;
500
+ border-radius: 6px;
501
+ font-size: 12px;
502
+ line-height: 1.5;
503
+ white-space: pre-wrap;
504
+ word-break: break-word;
505
+ font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
506
+ -webkit-font-smoothing: antialiased;
507
+ }
508
+
509
+ /* Win specificity over `.ai-chat-bubble.assistant pre` (light gray) — debug must stay high-contrast */
510
+ .ai-chat-bubble.assistant .ai-chart-debug-pre {
511
+ background: #0f172a !important;
512
+ color: #f8fafc !important;
513
+ border: 1px solid #334155;
514
+ padding: 12px 14px;
515
+ margin: 8px 0 0;
516
+ }
517
+
518
+ .ai-chart-debug-details {
519
+ margin-top: 10px;
520
+ font-size: 12px;
521
+ color: #1f2937;
522
+ }
523
+
524
+ .ai-chart-debug-details summary {
525
+ cursor: pointer;
526
+ font-weight: 600;
527
+ user-select: none;
528
+ }
529
+
530
+ .ai-chart-error .ai-chart-debug-details {
531
+ color: #334155;
532
+ }
533
+
534
+ .ai-chart-error .ai-chart-debug-details summary {
535
+ color: #0f172a;
536
+ }
537
+
538
+ .ai-chart-export-wrap {
539
+ position: relative;
540
+ }
541
+
542
+ .ai-chart-export-actions {
543
+ position: absolute;
544
+ top: 8px;
545
+ right: 8px;
546
+ z-index: 12;
547
+ }
548
+
549
+ .ai-chart-export-btn {
550
+ display: inline-flex;
551
+ align-items: center;
552
+ justify-content: center;
553
+ gap: 0;
554
+ width: 28px;
555
+ height: 28px;
556
+ padding: 0;
557
+ border: 1px solid #e5e7eb;
558
+ border-radius: 999px;
559
+ background: #ffffff;
560
+ color: #6b7280;
561
+ font-size: 12px;
562
+ line-height: 1;
563
+ font-family: inherit;
564
+ cursor: pointer;
565
+ position: relative;
566
+ transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
567
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
568
+ }
569
+
570
+ .ai-chart-export-btn:hover:not(:disabled) {
571
+ background: #f9fafb;
572
+ border-color: #9ca3af;
573
+ color: #1f2937;
574
+ box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
575
+ }
576
+
577
+ .ai-chart-export-label {
578
+ position: absolute;
579
+ top: 50%;
580
+ right: calc(100% + 8px);
581
+ transform: translateY(-50%);
582
+ background: #111827;
583
+ color: #ffffff;
584
+ font-size: 11px;
585
+ font-weight: 600;
586
+ padding: 4px 7px;
587
+ border-radius: 5px;
588
+ white-space: nowrap;
589
+ opacity: 0;
590
+ pointer-events: none;
591
+ transition: opacity 0.15s;
592
+ }
593
+
594
+ .ai-chart-export-btn:hover:not(:disabled) .ai-chart-export-label,
595
+ .ai-chart-export-btn:focus-visible .ai-chart-export-label,
596
+ .ai-chart-export-btn:disabled .ai-chart-export-label {
597
+ opacity: 1;
598
+ }
599
+
600
+ .ai-chart-export-btn:disabled {
601
+ cursor: not-allowed;
602
+ opacity: 0.65;
603
+ }
604
+
605
+ .ai-dot-chart-header {
606
+ display: flex;
607
+ justify-content: flex-start;
608
+ align-items: center;
609
+ margin-bottom: 6px;
610
+ }
611
+
612
+ .ai-dot-axis-label {
613
+ font-size: 11px;
614
+ color: #6b7280;
615
+ text-transform: uppercase;
616
+ letter-spacing: 0.04em;
617
+ font-weight: 600;
618
+ }
619
+
620
+ .ai-dot-axis-footer,
621
+ .ai-line-axis-footer,
622
+ .ai-histogram-axis-footer,
623
+ .ai-scatter-axis-footer {
624
+ display: grid;
625
+ grid-template-columns: minmax(120px, 180px) 1fr;
626
+ gap: 10px;
627
+ margin-top: 4px;
628
+ }
629
+
630
+ .ai-line-axis-footer,
631
+ .ai-histogram-axis-footer,
632
+ .ai-scatter-axis-footer {
633
+ grid-template-columns: 40px 1fr;
634
+ gap: 8px;
635
+ }
636
+
637
+ .ai-dot-axis-footer-track,
638
+ .ai-line-axis-footer-track,
639
+ .ai-histogram-axis-footer-track,
640
+ .ai-scatter-axis-footer-track {
641
+ display: flex;
642
+ justify-content: center;
643
+ }
644
+
645
+ .ai-dot-chart-grid {
646
+ display: flex;
647
+ flex-direction: column;
648
+ gap: 8px;
649
+ }
650
+
651
+ .ai-dot-row {
652
+ display: grid;
653
+ grid-template-columns: minmax(120px, 180px) 1fr;
654
+ gap: 10px;
655
+ align-items: center;
656
+ }
657
+
658
+ .ai-dot-row-label {
659
+ font-size: 12px;
660
+ color: #374151;
661
+ line-height: 1.3;
662
+ }
663
+
664
+ .ai-dot-row-track {
665
+ position: relative;
666
+ height: 18px;
667
+ cursor: crosshair;
668
+ }
669
+
670
+ .ai-dot-row-line {
671
+ position: absolute;
672
+ left: 0;
673
+ right: 0;
674
+ top: 8px;
675
+ border-top: 1px dashed #d1d5db;
676
+ }
677
+
678
+ .ai-dot-point {
679
+ position: absolute;
680
+ top: 3px;
681
+ width: 10px;
682
+ height: 10px;
683
+ margin-left: -5px;
684
+ border-radius: 999px;
685
+ border: 1px solid #ffffff;
686
+ box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.08);
687
+ transition: width 0.12s, height 0.12s, top 0.12s, margin-left 0.12s;
688
+ z-index: 3;
689
+ }
690
+
691
+ .ai-dot-point--hover {
692
+ width: 16px;
693
+ height: 16px;
694
+ top: 0;
695
+ margin-left: -8px;
696
+ z-index: 6;
697
+ box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12);
698
+ }
699
+
700
+ .ai-dot-tooltip {
701
+ position: absolute;
702
+ bottom: 26px;
703
+ transform: translateX(-50%);
704
+ background: #1f2937;
705
+ color: #fff;
706
+ font-size: 11px;
707
+ font-weight: 600;
708
+ padding: 3px 8px;
709
+ border-radius: 5px;
710
+ white-space: nowrap;
711
+ pointer-events: none;
712
+ z-index: 10;
713
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
714
+ }
715
+
716
+ .ai-dot-tooltip::after {
717
+ content: "";
718
+ position: absolute;
719
+ top: 100%;
720
+ left: 50%;
721
+ transform: translateX(-50%);
722
+ border: 4px solid transparent;
723
+ border-top-color: #1f2937;
724
+ }
725
+
726
+ .ai-dot-ticks {
727
+ display: grid;
728
+ grid-template-columns: minmax(120px, 180px) 1fr;
729
+ gap: 10px;
730
+ margin-top: 10px;
731
+ }
732
+
733
+ .ai-dot-ticks-track {
734
+ display: flex;
735
+ justify-content: space-between;
736
+ position: relative;
737
+ }
738
+
739
+ .ai-dot-tick {
740
+ font-size: 11px;
741
+ color: #6b7280;
742
+ line-height: 1;
743
+ }
744
+
745
+ .ai-dot-row-label--hover {
746
+ font-weight: 600;
747
+ color: #1f2937;
748
+ }
749
+
750
+ .ai-crosshair-x {
751
+ position: absolute;
752
+ top: -3px;
753
+ bottom: -3px;
754
+ width: 1px;
755
+ background: rgba(107, 114, 128, 0.4);
756
+ pointer-events: none;
757
+ z-index: 2;
758
+ }
759
+
760
+ .ai-crosshair-y {
761
+ position: absolute;
762
+ left: 0;
763
+ right: 0;
764
+ top: 50%;
765
+ height: 1px;
766
+ background: rgba(107, 114, 128, 0.4);
767
+ pointer-events: none;
768
+ z-index: 2;
769
+ }
770
+
771
+ .ai-crosshair-x-label {
772
+ position: absolute;
773
+ top: 0;
774
+ transform: translateX(-50%);
775
+ font-size: 11px;
776
+ font-weight: 600;
777
+ color: #374151;
778
+ background: #fff;
779
+ padding: 1px 5px;
780
+ border-radius: 4px;
781
+ border: 1px solid #e5e7eb;
782
+ white-space: nowrap;
783
+ pointer-events: none;
784
+ z-index: 3;
785
+ }
786
+
787
+ .ai-dot-legend {
788
+ display: flex;
789
+ flex-wrap: wrap;
790
+ gap: 10px 14px;
791
+ margin-top: 10px;
792
+ }
793
+
794
+ .ai-dot-legend-item {
795
+ display: flex;
796
+ align-items: center;
797
+ gap: 6px;
798
+ font-size: 12px;
799
+ color: #374151;
800
+ }
801
+
802
+ .ai-dot-legend-swatch {
803
+ width: 10px;
804
+ height: 10px;
805
+ border-radius: 999px;
806
+ }
807
+
808
+ .ai-data-table-wrap {
809
+ overflow-x: auto;
810
+ }
811
+
812
+ .ai-data-table {
813
+ width: 100%;
814
+ border-collapse: collapse;
815
+ font-size: 12px;
816
+ }
817
+
818
+ .ai-data-table-th {
819
+ text-align: left;
820
+ padding: 6px 10px;
821
+ font-size: 11px;
822
+ font-weight: 600;
823
+ color: #6b7280;
824
+ text-transform: uppercase;
825
+ letter-spacing: 0.04em;
826
+ border-bottom: 2px solid #e5e7eb;
827
+ white-space: nowrap;
828
+ }
829
+
830
+ .ai-data-table-row:nth-child(even) .ai-data-table-td {
831
+ background: #f3f4f6;
832
+ }
833
+
834
+ .ai-data-table-td {
835
+ padding: 6px 10px;
836
+ color: #374151;
837
+ border-bottom: 1px solid #f3f4f6;
838
+ vertical-align: top;
839
+ }
840
+
841
+ /* ── Bar Chart ── */
842
+
843
+ .ai-bar-chart {
844
+ display: flex;
845
+ flex-direction: column;
846
+ gap: 8px;
847
+ }
848
+
849
+ .ai-bar-row {
850
+ display: grid;
851
+ grid-template-columns: minmax(120px, 180px) 1fr auto;
852
+ gap: 8px;
853
+ align-items: center;
854
+ }
855
+
856
+ .ai-bar-label {
857
+ font-size: 12px;
858
+ color: #374151;
859
+ line-height: 1.3;
860
+ }
861
+
862
+ .ai-bar-row {
863
+ transition: background 0.12s;
864
+ border-radius: 4px;
865
+ padding: 1px 0;
866
+ }
867
+
868
+ .ai-bar-row--hover {
869
+ background: rgba(30, 170, 241, 0.05);
870
+ }
871
+
872
+ .ai-bar-track {
873
+ height: 10px;
874
+ background: #e5e7eb;
875
+ border-radius: 5px;
876
+ overflow: visible;
877
+ position: relative;
878
+ transition: height 0.12s;
879
+ }
880
+
881
+ .ai-bar-row--hover .ai-bar-track {
882
+ height: 14px;
883
+ }
884
+
885
+ .ai-bar-fill {
886
+ height: 100%;
887
+ background: #1eaaf1;
888
+ border-radius: 5px;
889
+ transition: filter 0.12s;
890
+ }
891
+
892
+ .ai-bar-row--hover .ai-bar-fill {
893
+ filter: brightness(0.88);
894
+ }
895
+
896
+ .ai-bar-tooltip {
897
+ position: absolute;
898
+ bottom: calc(100% + 6px);
899
+ transform: translateX(-50%);
900
+ background: #1f2937;
901
+ color: #fff;
902
+ font-size: 11px;
903
+ font-weight: 600;
904
+ padding: 3px 8px;
905
+ border-radius: 5px;
906
+ white-space: nowrap;
907
+ pointer-events: none;
908
+ z-index: 10;
909
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
910
+ }
911
+
912
+ .ai-bar-tooltip::after {
913
+ content: "";
914
+ position: absolute;
915
+ top: 100%;
916
+ left: 50%;
917
+ transform: translateX(-50%);
918
+ border: 4px solid transparent;
919
+ border-top-color: #1f2937;
920
+ }
921
+
922
+ .ai-bar-value {
923
+ font-size: 12px;
924
+ font-weight: 600;
925
+ color: #374151;
926
+ white-space: nowrap;
927
+ min-width: 24px;
928
+ text-align: right;
929
+ }
930
+
931
+ .ai-bar-unit {
932
+ font-weight: 400;
933
+ color: #6b7280;
934
+ }
935
+
936
+ /* ── Line / Multi-series Charts ── */
937
+
938
+ .ai-line-chart,
939
+ .ai-multi-bar-chart {
940
+ display: flex;
941
+ flex-direction: column;
942
+ gap: 10px;
943
+ }
944
+
945
+ .ai-multi-bar-axis-labels {
946
+ display: flex;
947
+ justify-content: flex-start;
948
+ font-size: 11px;
949
+ color: #6b7280;
950
+ font-weight: 600;
951
+ }
952
+
953
+ .ai-multi-bar-axis-footer {
954
+ display: flex;
955
+ justify-content: center;
956
+ margin-top: 4px;
957
+ }
958
+
959
+ .ai-line-plot-wrap {
960
+ display: grid;
961
+ grid-template-columns: 40px 1fr;
962
+ gap: 8px;
963
+ align-items: stretch;
964
+ }
965
+
966
+ .ai-line-y-ticks {
967
+ display: flex;
968
+ flex-direction: column;
969
+ justify-content: space-between;
970
+ align-items: flex-end;
971
+ }
972
+
973
+ .ai-line-y-tick {
974
+ font-size: 11px;
975
+ color: #6b7280;
976
+ line-height: 1;
977
+ }
978
+
979
+ .ai-line-plot {
980
+ position: relative;
981
+ height: 170px;
982
+ }
983
+
984
+ .ai-line-track {
985
+ position: relative;
986
+ height: 200px;
987
+ border-radius: 10px;
988
+ background: linear-gradient(180deg, rgba(30, 170, 241, 0.03), rgba(30, 170, 241, 0.01));
989
+ border: 1px solid #e5e7eb;
990
+ cursor: crosshair;
991
+ overflow: visible;
992
+ }
993
+
994
+ .ai-line-svg {
995
+ position: absolute;
996
+ inset: 0;
997
+ width: 100%;
998
+ height: 100%;
999
+ z-index: 2;
1000
+ }
1001
+
1002
+ .ai-line-gridline {
1003
+ position: absolute;
1004
+ left: 0;
1005
+ right: 0;
1006
+ height: 1px;
1007
+ background: #e5e7eb;
1008
+ pointer-events: none;
1009
+ z-index: 1;
1010
+ }
1011
+
1012
+ .ai-line-point {
1013
+ margin-left: 0;
1014
+ transform: translate(-50%, -50%);
1015
+ }
1016
+
1017
+ .ai-line-point.ai-dot-point--hover {
1018
+ margin-left: 0;
1019
+ }
1020
+
1021
+ .ai-line-tooltip {
1022
+ position: absolute;
1023
+ transform: translate(-50%, calc(-100% - 10px));
1024
+ background: #1f2937;
1025
+ color: #fff;
1026
+ font-size: 11px;
1027
+ font-weight: 600;
1028
+ padding: 3px 8px;
1029
+ border-radius: 5px;
1030
+ white-space: nowrap;
1031
+ pointer-events: none;
1032
+ z-index: 10;
1033
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
1034
+ }
1035
+
1036
+ .ai-line-tooltip::after {
1037
+ content: "";
1038
+ position: absolute;
1039
+ top: 100%;
1040
+ left: 50%;
1041
+ transform: translateX(-50%);
1042
+ border: 4px solid transparent;
1043
+ border-top-color: #1f2937;
1044
+ }
1045
+
1046
+ .ai-line-x-labels {
1047
+ display: grid;
1048
+ grid-template-columns: 40px 1fr;
1049
+ gap: 8px;
1050
+ font-size: 11px;
1051
+ color: #6b7280;
1052
+ min-height: 20px;
1053
+ }
1054
+
1055
+ .ai-line-x-labels-track {
1056
+ position: relative;
1057
+ height: 20px;
1058
+ }
1059
+
1060
+ .ai-line-x-label-item {
1061
+ position: absolute;
1062
+ transform: translateX(-50%);
1063
+ white-space: nowrap;
1064
+ cursor: default;
1065
+ }
1066
+
1067
+ .ai-line-x-label--active {
1068
+ font-weight: 600;
1069
+ color: #374151;
1070
+ }
1071
+
1072
+ .ai-line-x-labels--angled {
1073
+ min-height: 34px;
1074
+ }
1075
+
1076
+ .ai-line-x-labels--angled .ai-line-x-labels-track {
1077
+ height: 34px;
1078
+ }
1079
+
1080
+ .ai-line-x-label-item--angled {
1081
+ transform: translateX(-50%) rotate(-32deg);
1082
+ transform-origin: top center;
1083
+ }
1084
+
1085
+ .ai-line-crosshair-x-label {
1086
+ top: auto;
1087
+ bottom: calc(100% + 6px);
1088
+ background: #1f2937;
1089
+ color: #fff;
1090
+ border: none;
1091
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
1092
+ }
1093
+
1094
+ .ai-line-crosshair-x-label::after {
1095
+ content: "";
1096
+ position: absolute;
1097
+ top: 100%;
1098
+ left: 50%;
1099
+ transform: translateX(-50%);
1100
+ border: 4px solid transparent;
1101
+ border-top-color: #1f2937;
1102
+ }
1103
+
1104
+ .ai-line-legend {
1105
+ display: flex;
1106
+ flex-wrap: wrap;
1107
+ gap: 10px 14px;
1108
+ }
1109
+
1110
+ .ai-line-legend-item {
1111
+ display: flex;
1112
+ align-items: center;
1113
+ gap: 6px;
1114
+ font-size: 12px;
1115
+ color: #374151;
1116
+ }
1117
+
1118
+ .ai-line-legend-swatch {
1119
+ width: 10px;
1120
+ height: 10px;
1121
+ border-radius: 999px;
1122
+ }
1123
+
1124
+ /* ── Histogram / Scatter ── */
1125
+
1126
+ .ai-histogram-chart,
1127
+ .ai-scatter-chart {
1128
+ display: flex;
1129
+ flex-direction: column;
1130
+ gap: 10px;
1131
+ }
1132
+
1133
+ .ai-histogram-track,
1134
+ .ai-scatter-track {
1135
+ position: relative;
1136
+ height: 210px;
1137
+ border-radius: 10px;
1138
+ background: linear-gradient(180deg, rgba(30, 170, 241, 0.03), rgba(30, 170, 241, 0.01));
1139
+ border: 1px solid #e5e7eb;
1140
+ overflow: visible;
1141
+ }
1142
+
1143
+ .ai-histogram-plot-wrap,
1144
+ .ai-scatter-plot-wrap {
1145
+ display: grid;
1146
+ grid-template-columns: 40px 1fr;
1147
+ gap: 8px;
1148
+ align-items: stretch;
1149
+ }
1150
+
1151
+ .ai-histogram-y-ticks,
1152
+ .ai-scatter-y-ticks {
1153
+ display: flex;
1154
+ flex-direction: column;
1155
+ justify-content: space-between;
1156
+ align-items: flex-end;
1157
+ }
1158
+
1159
+ .ai-histogram-y-tick,
1160
+ .ai-scatter-y-tick {
1161
+ font-size: 11px;
1162
+ color: #6b7280;
1163
+ line-height: 1;
1164
+ }
1165
+
1166
+ .ai-histogram-gridline {
1167
+ position: absolute;
1168
+ left: 0;
1169
+ right: 0;
1170
+ height: 1px;
1171
+ background: #e5e7eb;
1172
+ }
1173
+
1174
+ .ai-histogram-bin {
1175
+ position: absolute;
1176
+ bottom: 0;
1177
+ min-width: 1px;
1178
+ border-radius: 4px 4px 0 0;
1179
+ background: #1eaaf1;
1180
+ transform-origin: bottom center;
1181
+ animation: aiHistGrow 340ms ease both;
1182
+ transition: filter 0.14s ease, transform 0.14s ease;
1183
+ }
1184
+
1185
+ .ai-histogram-bin--hover {
1186
+ filter: brightness(0.9);
1187
+ transform: scaleY(1.08);
1188
+ }
1189
+
1190
+ .ai-histogram-tooltip {
1191
+ position: absolute;
1192
+ left: 50%;
1193
+ bottom: calc(100% + 8px);
1194
+ transform: translateX(-50%);
1195
+ background: #1f2937;
1196
+ color: #fff;
1197
+ font-size: 11px;
1198
+ font-weight: 600;
1199
+ padding: 3px 8px;
1200
+ border-radius: 5px;
1201
+ white-space: nowrap;
1202
+ pointer-events: none;
1203
+ z-index: 10;
1204
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
1205
+ }
1206
+
1207
+ .ai-histogram-tooltip::after {
1208
+ content: "";
1209
+ position: absolute;
1210
+ top: 100%;
1211
+ left: 50%;
1212
+ transform: translateX(-50%);
1213
+ border: 4px solid transparent;
1214
+ border-top-color: #1f2937;
1215
+ }
1216
+
1217
+ .ai-histogram-ticks {
1218
+ display: grid;
1219
+ grid-template-columns: 40px 1fr;
1220
+ gap: 8px;
1221
+ font-size: 11px;
1222
+ color: #6b7280;
1223
+ }
1224
+
1225
+ .ai-histogram-ticks-track,
1226
+ .ai-scatter-ticks-track {
1227
+ display: flex;
1228
+ justify-content: space-between;
1229
+ }
1230
+
1231
+ .ai-scatter-gridline {
1232
+ position: absolute;
1233
+ left: 0;
1234
+ right: 0;
1235
+ height: 1px;
1236
+ background: #e5e7eb;
1237
+ }
1238
+
1239
+ .ai-scatter-point {
1240
+ position: absolute;
1241
+ width: 10px;
1242
+ height: 10px;
1243
+ border-radius: 999px;
1244
+ border: 1px solid #fff;
1245
+ box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.08);
1246
+ transform: translate(-50%, -50%);
1247
+ animation: aiScatterPop 260ms ease both;
1248
+ transition: width 0.14s ease, height 0.14s ease, box-shadow 0.14s ease;
1249
+ z-index: 4;
1250
+ }
1251
+
1252
+ .ai-scatter-point--hover {
1253
+ width: 16px;
1254
+ height: 16px;
1255
+ box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12);
1256
+ z-index: 8;
1257
+ }
1258
+
1259
+ .ai-scatter-tooltip {
1260
+ position: absolute;
1261
+ left: 50%;
1262
+ bottom: calc(100% + 8px);
1263
+ transform: translateX(-50%);
1264
+ background: #1f2937;
1265
+ color: #fff;
1266
+ font-size: 11px;
1267
+ font-weight: 600;
1268
+ padding: 3px 8px;
1269
+ border-radius: 5px;
1270
+ white-space: nowrap;
1271
+ pointer-events: none;
1272
+ z-index: 10;
1273
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
1274
+ }
1275
+
1276
+ .ai-scatter-tooltip::after {
1277
+ content: "";
1278
+ position: absolute;
1279
+ top: 100%;
1280
+ left: 50%;
1281
+ transform: translateX(-50%);
1282
+ border: 4px solid transparent;
1283
+ border-top-color: #1f2937;
1284
+ }
1285
+
1286
+ .ai-scatter-ticks {
1287
+ display: grid;
1288
+ grid-template-columns: 40px 1fr;
1289
+ gap: 8px;
1290
+ font-size: 11px;
1291
+ color: #6b7280;
1292
+ }
1293
+
1294
+ @keyframes aiHistGrow {
1295
+ 0% {
1296
+ transform: scaleY(0);
1297
+ opacity: 0.35;
1298
+ }
1299
+ 100% {
1300
+ transform: scaleY(1);
1301
+ opacity: 1;
1302
+ }
1303
+ }
1304
+
1305
+ @keyframes aiScatterPop {
1306
+ 0% {
1307
+ transform: translate(-50%, -50%) scale(0.6);
1308
+ opacity: 0;
1309
+ }
1310
+ 100% {
1311
+ transform: translate(-50%, -50%) scale(1);
1312
+ opacity: 1;
1313
+ }
1314
+ }
1315
+
1316
+ .ai-stacked-bars,
1317
+ .ai-grouped-bars {
1318
+ display: flex;
1319
+ flex-direction: column;
1320
+ gap: 8px;
1321
+ }
1322
+
1323
+ .ai-stacked-row,
1324
+ .ai-grouped-row {
1325
+ display: grid;
1326
+ grid-template-columns: minmax(120px, 180px) 1fr auto;
1327
+ gap: 8px;
1328
+ align-items: center;
1329
+ transition: background 0.12s ease;
1330
+ border-radius: 4px;
1331
+ padding: 1px 0;
1332
+ }
1333
+
1334
+ .ai-stacked-row-label,
1335
+ .ai-grouped-row-label {
1336
+ font-size: 12px;
1337
+ color: #374151;
1338
+ line-height: 1.3;
1339
+ transition: color 0.12s ease, font-weight 0.12s ease;
1340
+ }
1341
+
1342
+ .ai-stacked-row-label--hover,
1343
+ .ai-grouped-row-label--hover {
1344
+ font-weight: 600;
1345
+ color: #1f2937;
1346
+ }
1347
+
1348
+ .ai-stacked-row--hover,
1349
+ .ai-grouped-row--hover {
1350
+ background: rgba(30, 170, 241, 0.05);
1351
+ }
1352
+
1353
+ .ai-stacked-row-track {
1354
+ display: flex;
1355
+ height: 14px;
1356
+ background: #e5e7eb;
1357
+ border-radius: 6px;
1358
+ overflow: visible;
1359
+ }
1360
+
1361
+ .ai-stacked-row-segment {
1362
+ height: 100%;
1363
+ position: relative;
1364
+ transform-origin: left center;
1365
+ animation: aiBarGrow 360ms ease both;
1366
+ transition: filter 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
1367
+ z-index: 1;
1368
+ }
1369
+
1370
+ .ai-stacked-row-segment:hover,
1371
+ .ai-stacked-row--hover .ai-stacked-row-segment {
1372
+ filter: brightness(0.9);
1373
+ transform: scale(1.02, 1.4);
1374
+ box-shadow: 0 1px 4px rgba(17, 24, 39, 0.16);
1375
+ z-index: 3;
1376
+ }
1377
+
1378
+ .ai-stacked-row-total {
1379
+ font-size: 12px;
1380
+ font-weight: 600;
1381
+ color: #374151;
1382
+ white-space: nowrap;
1383
+ min-width: 24px;
1384
+ text-align: right;
1385
+ }
1386
+
1387
+ .ai-grouped-row-group {
1388
+ display: flex;
1389
+ flex-direction: column;
1390
+ gap: 5px;
1391
+ }
1392
+
1393
+ .ai-grouped-bar-item {
1394
+ height: 14px;
1395
+ background: #e5e7eb;
1396
+ border-radius: 7px;
1397
+ overflow: visible;
1398
+ }
1399
+
1400
+ .ai-grouped-bar-fill {
1401
+ height: 100%;
1402
+ border-radius: 7px;
1403
+ position: relative;
1404
+ display: flex;
1405
+ align-items: center;
1406
+ justify-content: flex-end;
1407
+ padding-right: 6px;
1408
+ transform-origin: left center;
1409
+ animation: aiBarGrow 360ms ease both;
1410
+ transition: filter 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
1411
+ }
1412
+
1413
+ .ai-grouped-bar-fill:hover,
1414
+ .ai-grouped-row--hover .ai-grouped-bar-fill {
1415
+ filter: brightness(0.9);
1416
+ transform: scale(1.02, 1.2);
1417
+ box-shadow: 0 1px 4px rgba(17, 24, 39, 0.16);
1418
+ z-index: 3;
1419
+ }
1420
+
1421
+ .ai-grouped-bar-value {
1422
+ font-size: 11px;
1423
+ font-weight: 700;
1424
+ color: #fff;
1425
+ line-height: 1;
1426
+ white-space: nowrap;
1427
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
1428
+ pointer-events: none;
1429
+ }
1430
+
1431
+ .ai-multi-bar-tooltip {
1432
+ position: absolute;
1433
+ left: 50%;
1434
+ bottom: calc(100% + 8px);
1435
+ transform: translateX(calc(-50% + var(--tooltip-shift, 0px)));
1436
+ background: #1f2937;
1437
+ color: #fff;
1438
+ font-size: 11px;
1439
+ font-weight: 600;
1440
+ padding: 3px 8px;
1441
+ border-radius: 5px;
1442
+ white-space: nowrap;
1443
+ pointer-events: none;
1444
+ z-index: 10;
1445
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
1446
+ opacity: 0;
1447
+ visibility: hidden;
1448
+ transition: opacity 0.12s ease;
1449
+ }
1450
+
1451
+ .ai-multi-bar-tooltip::after {
1452
+ content: "";
1453
+ position: absolute;
1454
+ top: 100%;
1455
+ left: 50%;
1456
+ transform: translateX(-50%);
1457
+ border: 4px solid transparent;
1458
+ border-top-color: #1f2937;
1459
+ }
1460
+
1461
+ .ai-stacked-row-segment:hover .ai-multi-bar-tooltip,
1462
+ .ai-grouped-bar-fill:hover .ai-multi-bar-tooltip,
1463
+ .ai-stacked-row--hover .ai-multi-bar-tooltip,
1464
+ .ai-grouped-row--hover .ai-multi-bar-tooltip {
1465
+ opacity: 1;
1466
+ visibility: visible;
1467
+ }
1468
+
1469
+ @keyframes aiBarGrow {
1470
+ 0% {
1471
+ transform: scaleX(0);
1472
+ opacity: 0.35;
1473
+ }
1474
+ 100% {
1475
+ transform: scaleX(1);
1476
+ opacity: 1;
1477
+ }
1478
+ }
1479
+
1480
+ /* ── Stat Cards ── */
1481
+
1482
+ .ai-stat-cards {
1483
+ display: flex;
1484
+ flex-wrap: wrap;
1485
+ gap: 8px;
1486
+ margin: 10px 0 4px;
1487
+ }
1488
+
1489
+ .ai-stat-card {
1490
+ flex: 1 1 80px;
1491
+ background: #f8fbff;
1492
+ border: 1px solid #e5e7eb;
1493
+ border-radius: 10px;
1494
+ padding: 10px 14px;
1495
+ text-align: center;
1496
+ min-width: 72px;
1497
+ }
1498
+
1499
+ .ai-stat-value {
1500
+ font-size: 22px;
1501
+ font-weight: 700;
1502
+ color: #1f2937;
1503
+ line-height: 1;
1504
+ margin-bottom: 5px;
1505
+ }
1506
+
1507
+ .ai-stat-unit {
1508
+ font-size: 13px;
1509
+ font-weight: 400;
1510
+ color: #6b7280;
1511
+ }
1512
+
1513
+ .ai-stat-label {
1514
+ font-size: 11px;
1515
+ color: #6b7280;
1516
+ text-transform: uppercase;
1517
+ letter-spacing: 0.04em;
1518
+ font-weight: 600;
1519
+ }
1520
+
1521
+ .ai-stat-subtitle {
1522
+ font-size: 11px;
1523
+ color: #9ca3af;
1524
+ margin-top: 4px;
1525
+ font-weight: 400;
1526
+ text-transform: none;
1527
+ letter-spacing: normal;
1528
+ line-height: 1.25;
1529
+ }
1530
+
1531
+ .ai-stat-subtitle.ai-stat-trend-up {
1532
+ color: #059669;
1533
+ }
1534
+
1535
+ .ai-stat-subtitle.ai-stat-trend-down {
1536
+ color: #dc2626;
1537
+ }
1538
+
1539
+ /* ── Timeline ── */
1540
+
1541
+ .ai-timeline-grid {
1542
+ display: flex;
1543
+ flex-direction: column;
1544
+ gap: 8px;
1545
+ }
1546
+
1547
+ .ai-timeline-row {
1548
+ display: grid;
1549
+ grid-template-columns: minmax(120px, 180px) 1fr;
1550
+ gap: 10px;
1551
+ align-items: center;
1552
+ }
1553
+
1554
+ .ai-timeline-label {
1555
+ display: flex;
1556
+ flex-direction: column;
1557
+ gap: 1px;
1558
+ }
1559
+
1560
+ .ai-timeline-label-main {
1561
+ font-size: 12px;
1562
+ color: #374151;
1563
+ line-height: 1.3;
1564
+ }
1565
+
1566
+ .ai-timeline-label-sub {
1567
+ font-size: 11px;
1568
+ color: #6b7280;
1569
+ }
1570
+
1571
+ .ai-timeline-track {
1572
+ position: relative;
1573
+ height: 14px;
1574
+ }
1575
+
1576
+ .ai-timeline-track-line {
1577
+ position: absolute;
1578
+ left: 0;
1579
+ right: 0;
1580
+ top: 6px;
1581
+ border-top: 1px dashed #d1d5db;
1582
+ }
1583
+
1584
+ .ai-timeline-bar {
1585
+ position: absolute;
1586
+ top: 2px;
1587
+ height: 10px;
1588
+ border-radius: 5px;
1589
+ min-width: 4px;
1590
+ }
1591
+
1592
+ .ai-timeline-header {
1593
+ display: grid;
1594
+ grid-template-columns: minmax(120px, 180px) 1fr;
1595
+ gap: 10px;
1596
+ margin-bottom: 2px;
1597
+ }
1598
+
1599
+ .ai-timeline-header-track {
1600
+ position: relative;
1601
+ height: 16px;
1602
+ }
1603
+
1604
+ .ai-timeline-today-label {
1605
+ position: absolute;
1606
+ bottom: 0;
1607
+ transform: translateX(-50%);
1608
+ font-size: 11px;
1609
+ font-weight: 700;
1610
+ color: #ef4444;
1611
+ white-space: nowrap;
1612
+ pointer-events: none;
1613
+ }
1614
+
1615
+ .ai-timeline-row {
1616
+ cursor: default;
1617
+ transition: background 0.12s;
1618
+ border-radius: 4px;
1619
+ padding: 1px 0;
1620
+ }
1621
+
1622
+ .ai-timeline-row--hover {
1623
+ background: rgba(0, 0, 0, 0.03);
1624
+ }
1625
+
1626
+ .ai-timeline-row--hover .ai-timeline-bar {
1627
+ height: 14px;
1628
+ top: 0;
1629
+ border-radius: 6px;
1630
+ }
1631
+
1632
+ .ai-timeline-bar-tooltip {
1633
+ position: absolute;
1634
+ bottom: calc(100% + 6px);
1635
+ transform: translateX(-50%);
1636
+ background: #1f2937;
1637
+ color: #fff;
1638
+ font-size: 11px;
1639
+ padding: 3px 8px;
1640
+ border-radius: 5px;
1641
+ white-space: nowrap;
1642
+ pointer-events: none;
1643
+ z-index: 10;
1644
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
1645
+ }
1646
+
1647
+ .ai-timeline-bar-tooltip::after {
1648
+ content: "";
1649
+ position: absolute;
1650
+ top: 100%;
1651
+ left: 50%;
1652
+ transform: translateX(-50%);
1653
+ border: 4px solid transparent;
1654
+ border-top-color: #1f2937;
1655
+ }
1656
+
1657
+ .ai-timeline-today {
1658
+ position: absolute;
1659
+ top: -3px;
1660
+ bottom: -3px;
1661
+ width: 2px;
1662
+ margin-left: -1px;
1663
+ background: #ef4444;
1664
+ border-radius: 1px;
1665
+ z-index: 1;
1666
+ }
1667
+
1668
+ .ai-timeline-ticks {
1669
+ display: grid;
1670
+ grid-template-columns: minmax(120px, 180px) 1fr;
1671
+ gap: 10px;
1672
+ margin-top: 8px;
1673
+ }
1674
+
1675
+ .ai-timeline-ticks-track {
1676
+ display: flex;
1677
+ justify-content: space-between;
1678
+ }
1679
+
1680
+ .ai-timeline-tick {
1681
+ font-size: 11px;
1682
+ color: #6b7280;
1683
+ line-height: 1;
1684
+ }
1685
+
1686
+ .ai-truncation-warning {
1687
+ margin-top: 10px;
1688
+ padding: 8px 10px;
1689
+ border-radius: 7px;
1690
+ background: #fffbeb;
1691
+ border: 1px solid #fde68a;
1692
+ font-size: 12px;
1693
+ color: #92400e;
1694
+ line-height: 1.5;
1695
+ }
1696
+
1697
+ .ai-chart-fallback-wrap {
1698
+ margin: 8px 0;
1699
+ }
1700
+
1701
+ .ai-chart-fallback-note {
1702
+ margin: 0 0 4px;
1703
+ font-size: 11px;
1704
+ color: #b45309;
1705
+ }
1706
+
1707
+ /* ── Message Actions ── */
1708
+
1709
+ .ai-chat-message-actions {
1710
+ display: flex;
1711
+ flex-wrap: wrap;
1712
+ gap: 6px;
1713
+ margin-top: 8px;
1714
+ }
1715
+
1716
+ .ai-chat-action-btn {
1717
+ display: flex;
1718
+ align-items: center;
1719
+ gap: 4px;
1720
+ padding: 4px 8px;
1721
+ background: transparent;
1722
+ border: 1px solid transparent;
1723
+ border-radius: 6px;
1724
+ font-size: 12px;
1725
+ color: #9ca3af;
1726
+ cursor: pointer;
1727
+ transition: color 0.15s, background 0.15s, border-color 0.15s;
1728
+ font-family: inherit;
1729
+ -webkit-user-select: none;
1730
+ user-select: none;
1731
+ }
1732
+
1733
+ .ai-chat-action-btn:hover:not(:disabled) {
1734
+ color: #4b5563;
1735
+ background: #f3f4f6;
1736
+ border-color: #e5e7eb;
1737
+ }
1738
+
1739
+ .ai-chat-copy-btn.copied {
1740
+ color: #16a34a;
1741
+ }
1742
+
1743
+ .ai-chat-action-btn:disabled {
1744
+ cursor: not-allowed;
1745
+ opacity: 0.65;
1746
+ }
1747
+
1748
+ /* ── Status (streaming progress) ── */
1749
+
1750
+ .ai-chat-status-wrap {
1751
+ display: flex;
1752
+ align-items: center;
1753
+ gap: 10px;
1754
+ }
1755
+
1756
+ .ai-chat-status-text {
1757
+ font-size: 13px;
1758
+ color: #6b7280;
1759
+ font-style: italic;
1760
+ animation: aiStatusFadeIn 0.18s ease;
1761
+ }
1762
+
1763
+ @keyframes aiStatusFadeIn {
1764
+ from { opacity: 0; transform: translateY(3px); }
1765
+ to { opacity: 1; transform: translateY(0); }
1766
+ }
1767
+
1768
+ /* ── Typing Indicator ── */
1769
+
1770
+ .ai-chat-typing {
1771
+ display: flex;
1772
+ gap: 5px;
1773
+ padding: 4px 0;
1774
+ }
1775
+
1776
+ .ai-chat-typing span {
1777
+ width: 8px;
1778
+ height: 8px;
1779
+ background: #9ca3af;
1780
+ border-radius: 50%;
1781
+ animation: typing 1.4s infinite;
1782
+ }
1783
+
1784
+ .ai-chat-typing span:nth-child(2) {
1785
+ animation-delay: 0.2s;
1786
+ }
1787
+
1788
+ .ai-chat-typing span:nth-child(3) {
1789
+ animation-delay: 0.4s;
1790
+ }
1791
+
1792
+ @keyframes typing {
1793
+ 0%,
1794
+ 60%,
1795
+ 100% {
1796
+ transform: translateY(0);
1797
+ opacity: 0.4;
1798
+ }
1799
+ 30% {
1800
+ transform: translateY(-6px);
1801
+ opacity: 1;
1802
+ }
1803
+ }
1804
+
1805
+ /* ── Input Area ── */
1806
+
1807
+ .ai-chat-input-form {
1808
+ padding: 16px 24px 20px;
1809
+ border-top: 1px solid #e5e7eb;
1810
+ background: #ffffff;
1811
+ flex-shrink: 0;
1812
+ }
1813
+
1814
+ .ai-chat-input-wrapper {
1815
+ display: flex;
1816
+ align-items: center;
1817
+ position: relative;
1818
+ gap: 10px;
1819
+ max-width: 768px;
1820
+ margin: 0 auto;
1821
+ background: #f9fafb;
1822
+ border: 1px solid #d1d5db;
1823
+ border-radius: 14px;
1824
+ padding: 8px 8px 8px 16px;
1825
+ transition: border-color 0.2s, box-shadow 0.2s;
1826
+ }
1827
+
1828
+ .ai-chat-input-wrapper:focus-within {
1829
+ border-color: #1eaaf1;
1830
+ box-shadow: 0 0 0 3px rgba(30, 170, 241, 0.1);
1831
+ }
1832
+
1833
+ .ai-chat-input-wrapper.disabled-with-reason {
1834
+ border-color: #f59e0b;
1835
+ background: #fffbeb;
1836
+ }
1837
+
1838
+ .ai-chat-input-disabled-hitbox {
1839
+ position: absolute;
1840
+ inset: 0;
1841
+ border: 0;
1842
+ border-radius: inherit;
1843
+ background: transparent;
1844
+ cursor: not-allowed;
1845
+ z-index: 3;
1846
+ }
1847
+
1848
+ .ai-chat-input {
1849
+ flex: 1;
1850
+ border: none;
1851
+ outline: none;
1852
+ background: transparent;
1853
+ font-size: 14px;
1854
+ line-height: 1.4;
1855
+ resize: none;
1856
+ font-family: inherit;
1857
+ color: #1f2937;
1858
+ max-height: 150px;
1859
+ min-height: 22px;
1860
+ padding: 6px 0;
1861
+ position: relative;
1862
+ z-index: 1;
1863
+ }
1864
+
1865
+ .ai-chat-input::placeholder {
1866
+ color: #9ca3af;
1867
+ }
1868
+
1869
+ .ai-chat-send-btn {
1870
+ display: flex;
1871
+ align-items: center;
1872
+ justify-content: center;
1873
+ width: 38px;
1874
+ height: 38px;
1875
+ border: none;
1876
+ border-radius: 10px;
1877
+ background: #1eaaf1;
1878
+ color: #ffffff;
1879
+ cursor: pointer;
1880
+ flex-shrink: 0;
1881
+ transition: background 0.2s, transform 0.1s;
1882
+ position: relative;
1883
+ z-index: 1;
1884
+ }
1885
+
1886
+ .ai-chat-send-btn:hover:not(:disabled) {
1887
+ background: #1890d0;
1888
+ transform: scale(1.05);
1889
+ }
1890
+
1891
+ .ai-chat-send-btn:disabled {
1892
+ background: #d1d5db;
1893
+ cursor: not-allowed;
1894
+ }
1895
+
1896
+ .ai-chat-disclaimer {
1897
+ font-size: 11px;
1898
+ color: #9ca3af;
1899
+ text-align: center;
1900
+ margin-top: 8px;
1901
+ max-width: 768px;
1902
+ margin-left: auto;
1903
+ margin-right: auto;
1904
+ }
1905
+
1906
+ /* ── Loading State ── */
1907
+
1908
+ .ai-chat-loading-state {
1909
+ display: flex;
1910
+ align-items: center;
1911
+ justify-content: center;
1912
+ height: 100%;
1913
+ font-size: 15px;
1914
+ color: #9ca3af;
1915
+ }
1916
+
1917
+ /* ── Print (Single Response) ── */
1918
+
1919
+ @media print {
1920
+ @page {
1921
+ margin: 12mm;
1922
+ }
1923
+
1924
+ /* Hide everything on the page; show only the isolated print section. */
1925
+ body.ai-chat-printing > * {
1926
+ display: none !important;
1927
+ }
1928
+
1929
+ body.ai-chat-printing #ai-cortex-print-section {
1930
+ display: block !important;
1931
+ }
1932
+
1933
+ /*
1934
+ * Kill all CSS animations and transitions inside the print section.
1935
+ * Browsers reset animations during the print reflow, catching elements at
1936
+ * their `from` keyframe (opacity: 0, scale: 0) rather than their final state.
1937
+ * Disabling animations lets elements fall back to their base CSS styles,
1938
+ * which are always the fully-visible final appearance.
1939
+ *
1940
+ * print-color-adjust: exact forces Chrome to render background colours and
1941
+ * images — without it Chrome strips inline background fills (e.g. dot colours
1942
+ * on scatter/dot charts) and the dots appear as white outlines only.
1943
+ */
1944
+ body.ai-chat-printing #ai-cortex-print-section * {
1945
+ animation: none !important;
1946
+ transition: none !important;
1947
+ -webkit-print-color-adjust: exact !important;
1948
+ print-color-adjust: exact !important;
1949
+ }
1950
+
1951
+ /* Clean up the bubble for print */
1952
+ body.ai-chat-printing #ai-cortex-print-section .ai-chat-bubble.assistant {
1953
+ max-width: none;
1954
+ width: 100%;
1955
+ border: none;
1956
+ border-radius: 0;
1957
+ padding: 0;
1958
+ background: #ffffff;
1959
+ color: #111827;
1960
+ box-shadow: none;
1961
+ }
1962
+ }
1963
+
1964
+ /* ── Responsive ── */
1965
+
1966
+ @media (max-width: 640px) {
1967
+ .ai-chat-header {
1968
+ padding: 12px 16px;
1969
+ }
1970
+
1971
+ .ai-chat-window {
1972
+ padding: 16px 16px 0;
1973
+ }
1974
+
1975
+ .ai-chat-input-form {
1976
+ padding: 12px 16px 16px;
1977
+ }
1978
+
1979
+ .ai-dot-row,
1980
+ .ai-dot-ticks {
1981
+ grid-template-columns: 90px 1fr;
1982
+ gap: 8px;
1983
+ }
1984
+ }