@m6d/cortex-angular 0.11.1 → 0.12.0

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.
@@ -24,7 +24,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
24
24
 
25
25
  // dist/fesm2022/m6d-cortex-angular.mjs
26
26
  import * as i0 from "@angular/core";
27
- import { ChangeDetectionStrategy as ChangeDetectionStrategy2, Component, DestroyRef, Directive, ElementRef, EnvironmentInjector, Injectable, InjectionToken, Injector, NgZone, Pipe, TemplateRef, ViewEncapsulation as ViewEncapsulation2, afterNextRender, afterRenderEffect, computed, contentChildren, createEnvironmentInjector, effect, inject, input, output, runInInjectionContext, signal, untracked, viewChild } from "@angular/core";
27
+ import { ChangeDetectionStrategy as ChangeDetectionStrategy2, Component, DestroyRef, Directive, ElementRef, EnvironmentInjector, Injectable, InjectionToken, Injector, NgZone, Pipe, TemplateRef, ViewEncapsulation as ViewEncapsulation2, afterNextRender, afterRenderEffect, computed, contentChildren, createEnvironmentInjector, effect, inject, input, linkedSignal, output, runInInjectionContext, signal, untracked, viewChild } from "@angular/core";
28
28
  import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
29
29
 
30
30
  // src/internal/wire/index.ts
@@ -36,15 +36,22 @@ var ATTACHMENT_MIME_TYPES = [
36
36
  "application/pdf"
37
37
  ];
38
38
  var ATTACHMENT_MAX_BYTES = 10 * 1024 * 1024;
39
+ var ATTACHMENT_FILENAME_MAX_LENGTH = 255;
39
40
  var MAX_ATTACHMENTS_PER_MESSAGE = 5;
40
- function checkAttachmentPolicy(contentType, sizeBytes) {
41
- if (!ATTACHMENT_MIME_TYPES.some((type) => type === contentType))
41
+ function checkAttachmentPolicy(file) {
42
+ if (!ATTACHMENT_MIME_TYPES.some((type) => type === file.type))
42
43
  return "type";
43
- if (sizeBytes > ATTACHMENT_MAX_BYTES)
44
+ if (file.size > ATTACHMENT_MAX_BYTES)
44
45
  return "size";
46
+ if (file.name.length > ATTACHMENT_FILENAME_MAX_LENGTH)
47
+ return "name";
45
48
  return "ok";
46
49
  }
47
50
  var STATEMENT_TOOLS = ["executeCode", "queryDataset", "describeDataset"];
51
+ function toolCallMetadataOf(part) {
52
+ const metadata = part.metadata;
53
+ return metadata?.cortex ?? undefined;
54
+ }
48
55
  function toUiMessage(message) {
49
56
  return { ...message, role: message.role === "trigger" ? "user" : message.role };
50
57
  }
@@ -123,7 +130,11 @@ function createCortexApiClient(getTransport) {
123
130
  return send("/threads");
124
131
  },
125
132
  createThread() {
126
- return send("/threads", { method: "POST" });
133
+ const body = getTransport().threadBody;
134
+ return send("/threads", {
135
+ method: "POST",
136
+ ...body && { body: JSON.stringify(body) }
137
+ });
127
138
  },
128
139
  deleteThread(threadId) {
129
140
  return send(`/threads/${threadId}`, { method: "DELETE" });
@@ -131,8 +142,8 @@ function createCortexApiClient(getTransport) {
131
142
  listMessages(threadId) {
132
143
  return send(`/threads/${threadId}/messages`);
133
144
  },
134
- listLlmRequests(messageId) {
135
- return send(`/messages/${messageId}/llm-requests`);
145
+ listLlmRequests(threadId, messageId) {
146
+ return send(`/threads/${threadId}/messages/${messageId}/llm-requests`);
136
147
  },
137
148
  abortStream(threadId) {
138
149
  return send(`/chat/${threadId}/abort`, { method: "POST" });
@@ -182,8 +193,14 @@ var ar_default = {
182
193
  translate_history: "السجل",
183
194
  translate_back: "رجوع",
184
195
  translate_greeting: "بماذا يمكنني مساعدتك اليوم؟",
185
- translate_n_conversations: "{{count}} محادثات",
186
- translate_one_conversation: "محادثة واحدة",
196
+ translate_conversations: {
197
+ zero: "لا محادثات",
198
+ one: "محادثة واحدة",
199
+ two: "محادثتان",
200
+ few: "{{count}} محادثات",
201
+ many: "{{count}} محادثة",
202
+ other: "{{count}} محادثة"
203
+ },
187
204
  translate_no_threads_yet: "لا توجد محادثات بعد",
188
205
  translate_start_a_new_conversation: "ابدأ محادثة جديدة",
189
206
  translate_untitled: "بدون عنوان",
@@ -196,44 +213,41 @@ var ar_default = {
196
213
  translate_drop_files_here: "أفلت ملفاتك هنا...",
197
214
  translate_remove_attachment: "إزالة المرفق",
198
215
  translate_attachment_rejected: "لا يمكن إرفاق هذا الملف",
216
+ translate_attachment_rejected_type: "يمكن إرفاق ملفات {{types}} فقط",
217
+ translate_attachment_rejected_size: "الحد الأقصى لحجم الملف {{size}} ميغابايت",
218
+ translate_attachment_rejected_name: "اسم الملف طويل جدًا",
219
+ translate_attachment_rejected_count: {
220
+ zero: "لا يمكن إرفاق ملفات بالرسالة",
221
+ one: "يمكن إرفاق ملف واحد كحد أقصى لكل رسالة",
222
+ two: "يمكن إرفاق ملفين كحد أقصى لكل رسالة",
223
+ few: "يمكن إرفاق {{count}} ملفات كحد أقصى لكل رسالة",
224
+ many: "يمكن إرفاق {{count}} ملفًا كحد أقصى لكل رسالة",
225
+ other: "يمكن إرفاق {{count}} ملف كحد أقصى لكل رسالة"
226
+ },
199
227
  translate_attachment_caption: "من فضلك اطّلع على الملفات المرفقة.",
200
228
  translate_download: "تنزيل",
201
- translate_tool_status_0: "جارٍ جلب البيانات…",
202
- translate_tool_status_1: "جارٍ تحليل المعلومات…",
203
- translate_tool_status_2: "جارٍ معالجة الطلب…",
204
- translate_tool_status_3: "جارٍ تجميع النتائج…",
205
- translate_tool_status_4: "جارٍ تحضير الرد…",
206
- translate_tool_status_5: "جارٍ البحث…",
207
- translate_tool_status_6: "جارٍ فحص السجلات…",
208
- translate_tool_status_7: "جارٍ مراجعة التفاصيل…",
209
- translate_tool_status_8: "جارٍ إجراء الحسابات…",
210
- translate_tool_status_9: "جارٍ سحب المعلومات…",
211
- translate_tool_done_0: "تم جلب البيانات بنجاح",
212
- translate_tool_done_1: "تم التحليل بنجاح",
213
- translate_tool_done_2: "تمت معالجة الطلب بنجاح",
214
- translate_tool_done_3: "تم تجميع النتائج بنجاح",
215
- translate_tool_done_4: "تم تحضير الرد بنجاح",
216
- translate_tool_done_5: "تم البحث بنجاح",
217
- translate_tool_done_6: "تم فحص السجلات بنجاح",
218
- translate_tool_done_7: "تمت المراجعة بنجاح",
219
- translate_tool_done_8: "تمت الحسابات بنجاح",
220
- translate_tool_done_9: "تم استرجاع المعلومات بنجاح",
221
- translate_rows_read: "{{count}} صفوف",
222
- translate_one_more_step: "وخطوة أخرى",
223
- translate_n_more_steps: "و{{count}} خطوات أخرى",
229
+ translate_tool_status: "جارٍ تنفيذ خطوة…",
230
+ translate_tool_done: "اكتملت الخطوة",
231
+ translate_tool_cancelled: "أُلغيت الخطوة",
232
+ translate_rows: {
233
+ zero: "لا صفوف",
234
+ one: "صف واحد",
235
+ two: "صفان",
236
+ few: "{{count}} صفوف",
237
+ many: "{{count}} صفًا",
238
+ other: "{{count}} صف"
239
+ },
240
+ translate_more_steps: {
241
+ zero: "ولا خطوات أخرى",
242
+ one: "وخطوة أخرى",
243
+ two: "وخطوتان أخريان",
244
+ few: "و{{count}} خطوات أخرى",
245
+ many: "و{{count}} خطوة أخرى",
246
+ other: "و{{count}} خطوة أخرى"
247
+ },
224
248
  translate_tool_error: "حدث خطأ",
225
249
  translate_attachment_status: "جارٍ قراءة الملف المرفق…",
226
250
  translate_attachment_done: "تمت قراءة الملف المرفق",
227
- translate_graph_0: "جارٍ استكشاف الروابط...",
228
- translate_graph_1: "جارٍ رسم الخريطة...",
229
- translate_graph_2: "جارٍ اكتشاف العلاقات...",
230
- translate_graph_3: "جارٍ تتبع الروابط...",
231
- translate_graph_4: "جارٍ التنقل في المعرفة...",
232
- translate_graph_5: "جارٍ كشف الرؤى...",
233
- translate_graph_6: "جارٍ ربط النقاط...",
234
- translate_graph_7: "جارٍ تتبع المسار...",
235
- translate_graph_8: "جارٍ تجميع الأجزاء...",
236
- translate_graph_9: "جارٍ بناء الصورة...",
237
251
  translate_code_0: "جارٍ حساب الأرقام...",
238
252
  translate_code_1: "جارٍ معالجة البيانات...",
239
253
  translate_code_2: "جارٍ تنفيذ طلبك...",
@@ -267,6 +281,7 @@ var ar_default = {
267
281
  translate_approve: "موافقة",
268
282
  translate_deny: "رفض",
269
283
  translate_error: "خطأ",
284
+ translate_approval_pending: "وافق على الطلب أعلاه أو ارفضه أولًا.",
270
285
  translate_approval_requested: "طلب موافقة",
271
286
  translate_approval_response: "رد الموافقة",
272
287
  translate_waiting_for_approval: "في انتظار الموافقة لتنفيذ هذه الأداة.",
@@ -307,6 +322,9 @@ var ar_default = {
307
322
  translate_trigger_fired: "تم التشغيل بواسطة",
308
323
  translate_trigger_payload: "الحمولة",
309
324
  translate_messages_disabled: "يعمل هذا الوكيل من مشغّلاته فقط.",
325
+ translate_access_refused: "لم يقبل هذا الوكيل تسجيل دخولك.",
326
+ translate_agent_unreachable: "تعذّر الوصول إلى هذا الوكيل الآن. نعيد المحاولة...",
327
+ translate_agent_missing: "هذا الوكيل غير متاح.",
310
328
  translate_streaming: "جارٍ البث",
311
329
  translate_done: "تم",
312
330
  translate_no_reasoning: "لا يوجد تفكير مسجّل.",
@@ -329,6 +347,8 @@ var ar_default = {
329
347
  translate_image_unavailable_alt: "الصورة غير متاحة: {{alt}}",
330
348
  translate_image: "صورة",
331
349
  translate_send: "إرسال",
350
+ translate_stop: "إيقاف",
351
+ translate_delete_conversation: "حذف المحادثة",
332
352
  translate_table: "جدول",
333
353
  translate_expand: "توسيع {{name}}",
334
354
  translate_table_export: "تصدير إلى Excel",
@@ -343,8 +363,10 @@ var en_default = {
343
363
  translate_history: "History",
344
364
  translate_back: "Back",
345
365
  translate_greeting: "What can I help you with today?",
346
- translate_n_conversations: "{{count}} conversations",
347
- translate_one_conversation: "1 conversation",
366
+ translate_conversations: {
367
+ one: "1 conversation",
368
+ other: "{{count}} conversations"
369
+ },
348
370
  translate_no_threads_yet: "No threads yet",
349
371
  translate_start_a_new_conversation: "Start a new conversation",
350
372
  translate_untitled: "Untitled",
@@ -357,44 +379,29 @@ var en_default = {
357
379
  translate_drop_files_here: "Drop your files here...",
358
380
  translate_remove_attachment: "Remove attachment",
359
381
  translate_attachment_rejected: "This file cannot be attached",
382
+ translate_attachment_rejected_type: "Only {{types}} files can be attached",
383
+ translate_attachment_rejected_size: "Files can be up to {{size}} MB",
384
+ translate_attachment_rejected_name: "The file name is too long",
385
+ translate_attachment_rejected_count: {
386
+ one: "Up to 1 file per message",
387
+ other: "Up to {{count}} files per message"
388
+ },
360
389
  translate_attachment_caption: "Please take a look at the attached files.",
361
390
  translate_download: "Download",
362
- translate_tool_status_0: "Fetching data...",
363
- translate_tool_status_1: "Analyzing information...",
364
- translate_tool_status_2: "Processing request...",
365
- translate_tool_status_3: "Gathering results...",
366
- translate_tool_status_4: "Preparing response...",
367
- translate_tool_status_5: "Looking things up...",
368
- translate_tool_status_6: "Checking records...",
369
- translate_tool_status_7: "Reviewing details...",
370
- translate_tool_status_8: "Running calculations...",
371
- translate_tool_status_9: "Pulling information...",
372
- translate_tool_done_0: "Data fetched successfully",
373
- translate_tool_done_1: "Analysis completed successfully",
374
- translate_tool_done_2: "Request processed successfully",
375
- translate_tool_done_3: "Results gathered successfully",
376
- translate_tool_done_4: "Response prepared successfully",
377
- translate_tool_done_5: "Lookup completed successfully",
378
- translate_tool_done_6: "Records checked successfully",
379
- translate_tool_done_7: "Review completed successfully",
380
- translate_tool_done_8: "Calculations completed successfully",
381
- translate_tool_done_9: "Information retrieved successfully",
382
- translate_rows_read: "{{count}} rows",
383
- translate_one_more_step: "and 1 more step",
384
- translate_n_more_steps: "and {{count}} more steps",
391
+ translate_tool_status: "Running a step...",
392
+ translate_tool_done: "Step completed",
393
+ translate_tool_cancelled: "Step cancelled",
394
+ translate_rows: {
395
+ one: "1 row",
396
+ other: "{{count}} rows"
397
+ },
398
+ translate_more_steps: {
399
+ one: "and 1 more step",
400
+ other: "and {{count}} more steps"
401
+ },
385
402
  translate_tool_error: "Something went wrong",
386
403
  translate_attachment_status: "Reading the attached file...",
387
404
  translate_attachment_done: "Finished reading the file",
388
- translate_graph_0: "Exploring connections...",
389
- translate_graph_1: "Mapping out the links...",
390
- translate_graph_2: "Discovering relationships...",
391
- translate_graph_3: "Tracing the connections...",
392
- translate_graph_4: "Navigating the knowledge...",
393
- translate_graph_5: "Uncovering insights...",
394
- translate_graph_6: "Connecting the dots...",
395
- translate_graph_7: "Following the trail...",
396
- translate_graph_8: "Piecing things together...",
397
- translate_graph_9: "Building the picture...",
398
405
  translate_code_0: "Running the numbers...",
399
406
  translate_code_1: "Working through the data...",
400
407
  translate_code_2: "Processing your request...",
@@ -428,6 +435,7 @@ var en_default = {
428
435
  translate_approve: "Approve",
429
436
  translate_deny: "Deny",
430
437
  translate_error: "Error",
438
+ translate_approval_pending: "Approve or deny the request above first.",
431
439
  translate_approval_requested: "Approval requested",
432
440
  translate_approval_response: "Approval response",
433
441
  translate_waiting_for_approval: "Waiting for approval to execute this tool.",
@@ -468,6 +476,9 @@ var en_default = {
468
476
  translate_trigger_fired: "Triggered by",
469
477
  translate_trigger_payload: "Payload",
470
478
  translate_messages_disabled: "This agent only runs from its triggers.",
479
+ translate_access_refused: "This agent did not accept your sign-in.",
480
+ translate_agent_unreachable: "This agent cannot be reached right now. Trying again...",
481
+ translate_agent_missing: "This agent is not available.",
471
482
  translate_streaming: "Streaming",
472
483
  translate_done: "Done",
473
484
  translate_no_reasoning: "No reasoning provided.",
@@ -490,6 +501,8 @@ var en_default = {
490
501
  translate_image_unavailable_alt: "Image unavailable: {{alt}}",
491
502
  translate_image: "Image",
492
503
  translate_send: "Send",
504
+ translate_stop: "Stop",
505
+ translate_delete_conversation: "Delete conversation",
493
506
  translate_table: "Table",
494
507
  translate_expand: "Expand {{name}}",
495
508
  translate_table_export: "Export to Excel",
@@ -506,20 +519,18 @@ function resolveLocale(locale) {
506
519
  return locale && LOCALES.includes(locale) ? locale : LOCALES[0];
507
520
  }
508
521
  function translate(locale, key, params) {
509
- const value = translations[locale][key];
522
+ const entry = translations[locale][key];
523
+ const value = typeof entry === "string" ? entry : entry[new Intl.PluralRules(locale).select(Number(params?.["count"]))] ?? entry.other;
510
524
  if (!params)
511
525
  return value;
512
526
  return value.replace(/\{\{\s*(\w+)\s*\}\}/g, (match, name) => (name in params) ? String(params[name]) : match);
513
527
  }
514
- function pluralKey(count, one, other) {
515
- return count === 1 ? one : other;
516
- }
517
528
 
518
529
  // src/internal/client/src/slots.ts
519
530
  function landingFromHandshake(capabilities, locale, send) {
520
531
  const takesMessages = capabilities !== undefined && capabilities.messages !== false;
521
532
  return {
522
- greeting: localized(capabilities?.greeting, locale) || translate(locale, "translate_greeting"),
533
+ greeting: capabilities === undefined ? "" : localized(capabilities.greeting, locale) || translate(locale, "translate_greeting"),
523
534
  suggestions: takesMessages && localized(capabilities.suggestions, locale) || [],
524
535
  send: (prompt) => {
525
536
  if (takesMessages)
@@ -560,6 +571,17 @@ function unansweredToolCalls(messages) {
560
571
  const parts = newestAssistantMessage(messages)?.parts ?? [];
561
572
  return parts.filter((part) => part.type === "tool-call" && !isSettledToolState(part.state));
562
573
  }
574
+ function awaitsApproval(messages) {
575
+ for (let index = messages.length - 1;index >= 0; index -= 1) {
576
+ const message = messages[index];
577
+ const waiting = message?.parts.some((part) => part.type === "tool-call" && part.state === "approval-requested");
578
+ if (waiting)
579
+ return true;
580
+ if (message?.role === "user")
581
+ return false;
582
+ }
583
+ return false;
584
+ }
563
585
  function streamingMessage(messages) {
564
586
  const tail = messages.at(-1);
565
587
  if (tail?.role !== "assistant")
@@ -614,8 +636,7 @@ function toolCallOutputText(part) {
614
636
  return JSON.stringify(output, null, 2);
615
637
  }
616
638
  var CODE_FIELDS = {
617
- code: "javascript",
618
- query: "cypher"
639
+ code: "javascript"
619
640
  };
620
641
  function splitToolCallInput(input) {
621
642
  const record = input && typeof input === "object" ? input : null;
@@ -645,13 +666,6 @@ var ANIM_STATES = {
645
666
  complete: "complete",
646
667
  error: "error"
647
668
  };
648
- function stableIndex(id) {
649
- let hash = 0;
650
- for (let i = 0;i < id.length; i++) {
651
- hash = hash * 31 + id.charCodeAt(i) | 0;
652
- }
653
- return Math.abs(hash) % STATUS_COUNT;
654
- }
655
669
  function toolCallStatement(part) {
656
670
  if (!STATEMENT_TOOLS.some((name) => name === part.name))
657
671
  return;
@@ -661,53 +675,57 @@ function toolCallStatement(part) {
661
675
  const status = input.status;
662
676
  return typeof status === "string" && status.trim() ? status.trim() : undefined;
663
677
  }
664
- function outputReportsFailure(part) {
678
+ function reportedEnding(part) {
665
679
  let output = part.output;
666
680
  if (typeof output === "string") {
667
681
  try {
668
682
  output = JSON.parse(output);
669
683
  } catch {
670
- return false;
684
+ return;
671
685
  }
672
686
  }
673
- return !!output && typeof output === "object" && "error" in output && output.error === true;
687
+ if (!output || typeof output !== "object")
688
+ return;
689
+ if ("error" in output && output.error === true)
690
+ return "failed";
691
+ if (!toolCallMetadataOf(part)?.embed || !("status" in output))
692
+ return;
693
+ const status = output.status;
694
+ return status === "failed" || status === "cancelled" ? status : undefined;
674
695
  }
675
- function toolCallRowCount(part) {
696
+ function toolCallRows(part) {
676
697
  const output = part.output;
677
698
  if (!output || typeof output !== "object" || !("rowCount" in output))
678
699
  return;
679
- return typeof output.rowCount === "number" ? output.rowCount : undefined;
700
+ const count = output.rowCount;
701
+ return typeof count === "number" ? count : undefined;
680
702
  }
681
- function pooledTitleKey(part, state, declined) {
682
- if (declined)
703
+ function toolLineKey(part, state, ending) {
704
+ if (ending === "declined")
683
705
  return "translate_declined";
706
+ if (ending === "cancelled")
707
+ return "translate_tool_cancelled";
684
708
  if (state === "error")
685
709
  return "translate_tool_error";
686
710
  if (state === "approval")
687
711
  return "translate_needs_approval";
688
712
  const family = part.name === "readAttachment" ? "attachment" : "tool";
689
- const variant = family === "tool" ? `_${stableIndex(part.id)}` : "";
690
- return `translate_${family}_${state === "complete" ? "done" : "status"}${variant}`;
713
+ return `translate_${family}_${state === "complete" ? "done" : "status"}`;
691
714
  }
692
715
  function toolCallAnimation(part) {
693
- const declined = part.approval?.approved === false;
694
- const failed = declined || part.state === "complete" && outputReportsFailure(part);
695
- const state = failed ? "error" : ANIM_STATES[part.state] ?? "processing";
716
+ const ending = part.approval?.approved === false ? "declined" : part.state === "complete" ? reportedEnding(part) : undefined;
717
+ const state = ending ? "error" : ANIM_STATES[part.state] ?? "processing";
696
718
  return {
697
719
  state,
698
720
  active: state === "starting" || state === "processing",
699
721
  gated: part.approval !== undefined || part.state === "approval-requested",
700
- titleKey: pooledTitleKey(part, state, declined),
722
+ titleKey: toolLineKey(part, state, ending),
701
723
  statement: toolCallStatement(part),
702
- rowCount: state === "complete" ? toolCallRowCount(part) : undefined
724
+ rows: state === "complete" ? toolCallRows(part) : undefined
703
725
  };
704
726
  }
705
727
  function approvalPrompt(part, locale) {
706
- const metadata = part.metadata;
707
- if (!metadata || typeof metadata !== "object" || !("cortex" in metadata))
708
- return;
709
- const cortex = metadata.cortex;
710
- return cortex?.approval?.[locale] || undefined;
728
+ return toolCallMetadataOf(part)?.approval?.[locale] || undefined;
711
729
  }
712
730
  function approvalCard(part, locale) {
713
731
  const approved = part.approval?.approved;
@@ -745,13 +763,16 @@ function visibleMessageParts(parts, options) {
745
763
  return part.type !== "thinking" || options.isStreaming && isLast;
746
764
  });
747
765
  }
766
+ function drawsMessageBody(visibleParts, metadata) {
767
+ return visibleParts.length > 0 || Boolean(metadata?.attachments?.length || metadata?.isAborted);
768
+ }
748
769
  function messageCopyText(parts) {
749
770
  return parts.filter((part) => part.type === "text").map((part) => part.content).join(`
750
771
 
751
772
  `);
752
773
  }
753
- function drawsAsLine(part, hostTools) {
754
- if (hostTools && part.name in hostTools)
774
+ function drawsAsLine(part, consumerTools) {
775
+ if (consumerTools && part.name in consumerTools)
755
776
  return false;
756
777
  return part.name !== REQUEST_LOCATION_TOOL || !isSettledToolState(part.state);
757
778
  }
@@ -880,6 +901,15 @@ function clientToolAnswers(tail) {
880
901
  });
881
902
  return answers.length > 0 ? answers : null;
882
903
  }
904
+ async function refusalOf(response) {
905
+ if (response.status !== 409)
906
+ return;
907
+ const body = await response.clone().json().catch(() => {
908
+ return;
909
+ });
910
+ const dropped = body !== null && typeof body === "object" && "outcome" in body && body.outcome === "dropped" && "reason" in body && body.reason === "approval_pending";
911
+ return dropped ? "approval_pending" : undefined;
912
+ }
883
913
  async function* withCommittedTranscript(stream, options, lastSent) {
884
914
  for await (const chunk of stream) {
885
915
  if (chunk.type !== EventType.MESSAGES_SNAPSHOT) {
@@ -895,26 +925,45 @@ async function* withCommittedTranscript(stream, options, lastSent) {
895
925
  }
896
926
  function createCortexConnection(options) {
897
927
  const { api, thread } = options;
898
- const requestOptions = async () => ({ headers: await api.resolveHeaders() });
928
+ const fetchClient = Object.assign(async (input, init) => {
929
+ const response = await fetch(input, init);
930
+ const refusal = await refusalOf(response);
931
+ if (refusal)
932
+ options.onRefused?.(refusal);
933
+ return response;
934
+ }, fetch);
935
+ const requestOptions = async () => ({ headers: await api.resolveHeaders(), fetchClient });
936
+ let open = 0;
937
+ async function* counted(stream) {
938
+ open += 1;
939
+ options.onStreamStarted?.();
940
+ try {
941
+ yield* stream;
942
+ } finally {
943
+ open -= 1;
944
+ }
945
+ }
899
946
  const turn = fetchServerSentEvents(() => api.resolveUrl("/chat"), requestOptions);
900
947
  const connect = function(messages, data, abortSignal, runContext) {
901
948
  const tail = newestUnsent(messages);
902
949
  const answers = clientToolAnswers(tail);
903
950
  const stream = answers ? turn.connect([], { ...data, [CLIENT_TOOL_ANSWERS_KEY]: answers }, abortSignal, runContext) : turn.connect(tail, data, abortSignal, runContext);
904
- return withCommittedTranscript(stream, options, messages.at(-1)?.id);
951
+ return counted(withCommittedTranscript(stream, options, messages.at(-1)?.id));
905
952
  };
906
953
  const join = fetchServerSentEvents(() => api.resolveUrl(`/chat/${thread.id}/stream`), requestOptions);
907
954
  let replayBase = [];
955
+ async function* replay(runId, abortSignal) {
956
+ yield {
957
+ type: EventType.MESSAGES_SNAPSHOT,
958
+ timestamp: Date.now(),
959
+ messages: replayBase
960
+ };
961
+ yield* withCommittedTranscript(join.joinRun(runId, abortSignal), options, replayBase.at(-1)?.id);
962
+ }
908
963
  return {
909
964
  connect,
910
- async* joinRun(runId, abortSignal) {
911
- yield {
912
- type: EventType.MESSAGES_SNAPSHOT,
913
- timestamp: Date.now(),
914
- messages: replayBase
915
- };
916
- yield* withCommittedTranscript(join.joinRun(runId, abortSignal), options, replayBase.at(-1)?.id);
917
- },
965
+ joinRun: (runId, abortSignal) => counted(replay(runId, abortSignal)),
966
+ streaming: () => open > 0,
918
967
  hydrate: async () => {
919
968
  const hydration = await hydrateThread(options);
920
969
  replayBase = hydration.messages;
@@ -964,12 +1013,28 @@ function randomId() {
964
1013
  }
965
1014
 
966
1015
  // src/internal/client/src/chat/attachment-queue.ts
1016
+ var REFUSAL_KEYS = {
1017
+ type: "translate_attachment_rejected_type",
1018
+ size: "translate_attachment_rejected_size",
1019
+ name: "translate_attachment_rejected_name",
1020
+ count: "translate_attachment_rejected_count"
1021
+ };
1022
+ function attachmentErrorText(item, locale) {
1023
+ if (!item.refusal)
1024
+ return translate(locale, "translate_attachment_rejected");
1025
+ return translate(locale, REFUSAL_KEYS[item.refusal], {
1026
+ types: new Intl.ListFormat(locale).format(ATTACHMENT_MIME_TYPES.map((type) => type.slice(type.indexOf("/") + 1).toUpperCase())),
1027
+ size: ATTACHMENT_MAX_BYTES / 1024 / 1024,
1028
+ count: MAX_ATTACHMENTS_PER_MESSAGE
1029
+ });
1030
+ }
967
1031
  function createAttachmentQueue(options) {
968
1032
  const { api } = options;
969
1033
  const listeners = new Set;
970
1034
  const cancelled = new Set;
971
1035
  let items = [];
972
1036
  let consumed = [];
1037
+ let uploads = Promise.resolve();
973
1038
  function getState() {
974
1039
  return items;
975
1040
  }
@@ -992,16 +1057,38 @@ function createAttachmentQueue(options) {
992
1057
  return;
993
1058
  patch(localId, { status: "error" });
994
1059
  }
1060
+ async function upload(localId, threadId, file) {
1061
+ if (cancelled.delete(localId))
1062
+ return;
1063
+ let attachment;
1064
+ try {
1065
+ attachment = await api.uploadAttachment(threadId, file);
1066
+ } catch {
1067
+ fail(localId);
1068
+ return;
1069
+ }
1070
+ if (cancelled.delete(localId)) {
1071
+ api.deleteAttachment(attachment.id).catch(() => {});
1072
+ return;
1073
+ }
1074
+ patch(localId, {
1075
+ status: "ready",
1076
+ attachmentId: attachment.id,
1077
+ summary: attachment
1078
+ });
1079
+ }
995
1080
  function accept(files) {
996
1081
  const accepted = [];
997
1082
  for (const file of files) {
998
- const rejected = checkAttachmentPolicy(file.type, file.size) !== "ok" || items.filter((item) => item.status !== "error").length >= MAX_ATTACHMENTS_PER_MESSAGE;
1083
+ const policy = checkAttachmentPolicy(file);
1084
+ const full = items.filter((item) => item.status !== "error").length >= MAX_ATTACHMENTS_PER_MESSAGE;
1085
+ const refusal = policy !== "ok" ? policy : full ? "count" : undefined;
999
1086
  const localId = randomId();
1000
1087
  setItems([
1001
1088
  ...items,
1002
- { localId, filename: file.name, status: rejected ? "error" : "uploading" }
1089
+ refusal ? { localId, filename: file.name, status: "error", refusal } : { localId, filename: file.name, status: "uploading" }
1003
1090
  ]);
1004
- if (!rejected)
1091
+ if (!refusal)
1005
1092
  accepted.push({ localId, file });
1006
1093
  }
1007
1094
  if (!accepted.length)
@@ -1011,17 +1098,7 @@ function createAttachmentQueue(options) {
1011
1098
  if (cancelled.delete(localId))
1012
1099
  continue;
1013
1100
  patch(localId, { threadId });
1014
- api.uploadAttachment(threadId, file).then((attachment) => {
1015
- if (cancelled.delete(localId)) {
1016
- api.deleteAttachment(attachment.id).catch(() => {});
1017
- return;
1018
- }
1019
- patch(localId, {
1020
- status: "ready",
1021
- attachmentId: attachment.id,
1022
- summary: attachment
1023
- });
1024
- }, () => fail(localId));
1101
+ uploads = uploads.then(() => upload(localId, threadId, file)).catch(() => {});
1025
1102
  }
1026
1103
  }, () => {
1027
1104
  for (const { localId } of accepted) {
@@ -1154,10 +1231,6 @@ function createClientToolEmbed(options) {
1154
1231
  setState({ phase: "initiating" });
1155
1232
  try {
1156
1233
  const result = await options.initiate();
1157
- if (!result.embed) {
1158
- setState({ phase: "unavailable" });
1159
- return;
1160
- }
1161
1234
  if (!/^https?:$/.test(new URL(result.embedUrl).protocol)) {
1162
1235
  setState({ phase: "error" });
1163
1236
  return;
@@ -1432,8 +1505,9 @@ function locationPickerHint(state) {
1432
1505
  return { key: "translate_location_hint", failed: false };
1433
1506
  }
1434
1507
  // src/internal/client/src/chat/websocket.ts
1508
+ var BACKOFF_CEILING_MS = 30000;
1435
1509
  function wsBackoffDelay(attempt) {
1436
- return Math.min(1000 * 2 ** (attempt - 1), 30000);
1510
+ return Math.min(1000 * 2 ** (attempt - 1), BACKOFF_CEILING_MS);
1437
1511
  }
1438
1512
  var STABLE_CONNECTION_MS = 1e4;
1439
1513
  function createCortexSocket(options) {
@@ -1441,6 +1515,7 @@ function createCortexSocket(options) {
1441
1515
  let reconnectTimer;
1442
1516
  let attempt = 0;
1443
1517
  let closed = false;
1518
+ let open = false;
1444
1519
  function connect() {
1445
1520
  const { wsUrl: wsUrlOption, transport } = options.getConfig();
1446
1521
  if (wsUrlOption === false)
@@ -1451,6 +1526,7 @@ function createCortexSocket(options) {
1451
1526
  return;
1452
1527
  ws = new WebSocket(appendTokenToUrl(wsUrl, headers));
1453
1528
  ws.addEventListener("open", () => {
1529
+ open = true;
1454
1530
  const opened = ws;
1455
1531
  setTimeout(() => {
1456
1532
  if (ws === opened && !closed)
@@ -1470,7 +1546,10 @@ function createCortexSocket(options) {
1470
1546
  }
1471
1547
  options.onEvent(parsed);
1472
1548
  });
1473
- ws.addEventListener("close", scheduleReconnect);
1549
+ ws.addEventListener("close", () => {
1550
+ open = false;
1551
+ scheduleReconnect();
1552
+ });
1474
1553
  }).catch(scheduleReconnect);
1475
1554
  }
1476
1555
  function scheduleReconnect() {
@@ -1486,8 +1565,12 @@ function createCortexSocket(options) {
1486
1565
  return {
1487
1566
  close() {
1488
1567
  closed = true;
1568
+ open = false;
1489
1569
  clearTimeout(reconnectTimer);
1490
1570
  ws?.close();
1571
+ },
1572
+ isOpen() {
1573
+ return open;
1491
1574
  }
1492
1575
  };
1493
1576
  }
@@ -1510,23 +1593,40 @@ function appendTokenToUrl(wsUrl, headers) {
1510
1593
  parsed.searchParams.set("token", authHeader.slice(7));
1511
1594
  return parsed.toString();
1512
1595
  }
1513
- // src/internal/client/src/chat/capabilities.ts
1514
- function loadCapabilities(api, onLoaded, delay = wsBackoffDelay) {
1596
+ // src/internal/client/src/chat/ask-until-answered.ts
1597
+ var UNANSWERED_NOTICES = {
1598
+ unreachable: "translate_agent_unreachable",
1599
+ refused: "translate_access_refused",
1600
+ missing: "translate_agent_missing"
1601
+ };
1602
+ function unansweredBy(error) {
1603
+ const status = error instanceof Error ? /^HTTP (\d+)\b/.exec(error.message)?.[1] : undefined;
1604
+ if (status === "401")
1605
+ return "refused";
1606
+ if (status === "404")
1607
+ return "missing";
1608
+ return "unreachable";
1609
+ }
1610
+ function askUntilAnswered(ask, handlers, delay = wsBackoffDelay) {
1515
1611
  let stopped = false;
1516
1612
  let timer;
1517
1613
  let attempt = 0;
1518
- function ask() {
1519
- api.getCapabilities().then((capabilities) => {
1614
+ function next() {
1615
+ ask().then((answer) => {
1520
1616
  if (!stopped)
1521
- onLoaded(capabilities);
1522
- }, () => {
1617
+ handlers.onAnswered(answer);
1618
+ }, (error) => {
1523
1619
  if (stopped)
1524
1620
  return;
1621
+ const why = unansweredBy(error);
1622
+ handlers.onMissed?.(why);
1623
+ if (why === "missing")
1624
+ return;
1525
1625
  attempt += 1;
1526
- timer = setTimeout(ask, delay(attempt));
1626
+ timer = setTimeout(next, why === "refused" ? BACKOFF_CEILING_MS : delay(attempt));
1527
1627
  });
1528
1628
  }
1529
- ask();
1629
+ next();
1530
1630
  return function stop() {
1531
1631
  stopped = true;
1532
1632
  clearTimeout(timer);
@@ -1554,6 +1654,43 @@ function upsertThread(threads, thread) {
1554
1654
  function removeThread(threads, threadId) {
1555
1655
  return threads.filter((thread) => thread.id !== threadId);
1556
1656
  }
1657
+ function retitleThread(threads, threadId, title) {
1658
+ return threads.map((thread) => thread.id === threadId ? { ...thread, title } : thread);
1659
+ }
1660
+ var TITLE_READ_DELAYS = [0, 1000, 2000, 3000, 4000];
1661
+ function followThreadTitle(options) {
1662
+ const delays = options.delays ?? TITLE_READ_DELAYS;
1663
+ let stopped = false;
1664
+ let timer;
1665
+ function owed() {
1666
+ const shown = options.selected();
1667
+ return !stopped && !options.socketOpen() && shown?.id === options.threadId && !shown.title;
1668
+ }
1669
+ async function read(attempt) {
1670
+ if (!owed())
1671
+ return;
1672
+ const listed = await options.listThreads().catch(() => {
1673
+ return;
1674
+ });
1675
+ const title = listed?.find((thread) => thread.id === options.threadId)?.title;
1676
+ if (!owed())
1677
+ return;
1678
+ if (title)
1679
+ options.setTitle(title);
1680
+ else
1681
+ readAfter(attempt + 1);
1682
+ }
1683
+ function readAfter(attempt) {
1684
+ const wait = delays[attempt];
1685
+ if (wait !== undefined)
1686
+ timer = setTimeout(() => void read(attempt), wait);
1687
+ }
1688
+ readAfter(0);
1689
+ return function stop() {
1690
+ stopped = true;
1691
+ clearTimeout(timer);
1692
+ };
1693
+ }
1557
1694
  function applyWsEvent(threads, event) {
1558
1695
  switch (event.type) {
1559
1696
  case "thread:deleted":
@@ -1568,6 +1705,51 @@ function applyWsEvent(threads, event) {
1568
1705
  return threads;
1569
1706
  }
1570
1707
  }
1708
+ function createRunTracker() {
1709
+ const live = new Map;
1710
+ const changed = new Map;
1711
+ let clock = 0;
1712
+ function admitsRun(event) {
1713
+ if (event.type === "thread:run-started") {
1714
+ live.set(event.payload.thread.id, event.payload.runId);
1715
+ return true;
1716
+ }
1717
+ if (event.type !== "thread:run-finished")
1718
+ return true;
1719
+ const runId = live.get(event.payload.thread.id);
1720
+ return runId === undefined || runId === event.payload.runId;
1721
+ }
1722
+ return {
1723
+ admits(event) {
1724
+ const admitted = admitsRun(event);
1725
+ if (admitted && "thread" in event.payload)
1726
+ changed.set(event.payload.thread.id, ++clock);
1727
+ return admitted;
1728
+ },
1729
+ running(threadId, isRunning) {
1730
+ changed.set(threadId, ++clock);
1731
+ return (threads) => {
1732
+ const thread = threads?.find((candidate) => candidate.id === threadId);
1733
+ return threads && thread ? upsertThread(threads, { ...thread, isRunning }) : threads;
1734
+ };
1735
+ },
1736
+ async read(listThreads) {
1737
+ live.clear();
1738
+ const begun = ++clock;
1739
+ const listed = sortThreads(await listThreads());
1740
+ function show(shown) {
1741
+ return listed.map((thread) => {
1742
+ const since = changed.get(thread.id) ?? 0;
1743
+ const newer = since > begun ? shown?.find((row) => row.id === thread.id) : undefined;
1744
+ if (since < begun)
1745
+ changed.set(thread.id, begun);
1746
+ return newer ? { ...thread, isRunning: newer.isRunning } : thread;
1747
+ });
1748
+ }
1749
+ return { listed, show };
1750
+ }
1751
+ };
1752
+ }
1571
1753
  // src/internal/client/src/content/markdown.ts
1572
1754
  import { marked } from "marked";
1573
1755
  import DOMPurify from "dompurify";
@@ -1575,25 +1757,41 @@ function renderMarkdown(value, fading = []) {
1575
1757
  if (!value) {
1576
1758
  return "";
1577
1759
  }
1578
- let html = marked.parse(value, { async: false });
1579
- html = html.replace(/<table>/g, '<div style="overflow-x:auto"><table style="width:max-content">').replace(/<\/table>/g, "</table></div>").replace(/<(t[hd])([\s>])/g, '<$1 style="padding:0.5rem 1rem"$2');
1760
+ const template = document.createElement("template");
1761
+ template.innerHTML = marked.parse(value, { async: false }).replace(/<table>/g, '<div style="overflow-x:auto"><table style="width:max-content">').replace(/<\/table>/g, "</table></div>").replace(/<(t[hd])([\s>])/g, '<$1 style="padding:0.5rem 1rem"$2');
1762
+ orient(template.content);
1580
1763
  if (fading.length)
1581
- html = wrapFadingTail(html, fading);
1582
- return DOMPurify.sanitize(html, { FORBID_TAGS: ["img", "picture", "source"] });
1764
+ wrapFadingTail(template.content, fading);
1765
+ return DOMPurify.sanitize(template.innerHTML, { FORBID_TAGS: ["img", "picture", "source"] });
1766
+ }
1767
+ var RTL_LETTER = /[\p{Script=Arabic}\p{Script=Hebrew}]/u;
1768
+ function orient(root) {
1769
+ for (const block of Array.from(root.children)) {
1770
+ if (block.localName !== "div")
1771
+ block.setAttribute("dir", "auto");
1772
+ }
1773
+ root.querySelectorAll("table").forEach((table) => {
1774
+ const letter = /\p{L}/u.exec(table.textContent ?? "")?.[0];
1775
+ if (!letter)
1776
+ return;
1777
+ const dir = RTL_LETTER.test(letter) ? "rtl" : "ltr";
1778
+ table.setAttribute("dir", dir);
1779
+ if (table.parentElement?.childElementCount === 1)
1780
+ table.parentElement.setAttribute("dir", dir);
1781
+ });
1782
+ root.querySelectorAll("th, td").forEach((cell) => cell.setAttribute("dir", "auto"));
1783
+ root.querySelectorAll("pre").forEach((code) => code.setAttribute("dir", "ltr"));
1583
1784
  }
1584
- function wrapFadingTail(html, fading) {
1585
- const template = document.createElement("template");
1586
- template.innerHTML = html;
1785
+ function wrapFadingTail(root, fading) {
1587
1786
  const runs = [...fading].sort((a, b) => a.length - b.length);
1588
1787
  const furthest = runs[runs.length - 1]?.length ?? 0;
1589
1788
  let consumed = 0;
1590
- for (const node of textNodesFromEnd(template.content)) {
1789
+ for (const node of textNodesFromEnd(root)) {
1591
1790
  if (consumed >= furthest)
1592
1791
  break;
1593
1792
  node.replaceWith(...splitTail(node.data, consumed, runs));
1594
1793
  consumed += node.data.length;
1595
1794
  }
1596
- return template.innerHTML;
1597
1795
  }
1598
1796
  function textNodesFromEnd(root) {
1599
1797
  const walker = document.createTreeWalker(root, 4);
@@ -2581,7 +2779,6 @@ function watchColorScheme(theme, onChange) {
2581
2779
  import hljs from "highlight.js/lib/core";
2582
2780
  import javascript from "highlight.js/lib/languages/javascript";
2583
2781
  import json from "highlight.js/lib/languages/json";
2584
- import sql from "highlight.js/lib/languages/sql";
2585
2782
  var registered = false;
2586
2783
  function ensureLanguages() {
2587
2784
  if (registered)
@@ -2589,7 +2786,6 @@ function ensureLanguages() {
2589
2786
  registered = true;
2590
2787
  hljs.registerLanguage("javascript", javascript);
2591
2788
  hljs.registerLanguage("json", json);
2592
- hljs.registerLanguage("cypher", sql);
2593
2789
  }
2594
2790
  function highlightCode(code, lang) {
2595
2791
  if (!code)
@@ -2884,7 +3080,10 @@ function endScrollTop(list) {
2884
3080
  function createWorkingAvatar(avatar) {
2885
3081
  let shown = false;
2886
3082
  const content = avatar.parentElement;
2887
- const observer = typeof ResizeObserver === "undefined" ? undefined : new ResizeObserver(place);
3083
+ const observer = typeof ResizeObserver === "undefined" ? undefined : new ResizeObserver(() => {
3084
+ if (shown)
3085
+ place();
3086
+ });
2888
3087
  observer?.observe(content);
2889
3088
  function place() {
2890
3089
  const target = content.querySelector(FRONTIER);
@@ -2910,6 +3109,8 @@ function createWorkingAvatar(avatar) {
2910
3109
  return;
2911
3110
  }
2912
3111
  shown = false;
3112
+ const [, drawnY = "0px"] = getComputedStyle(avatar).translate.split(" ");
3113
+ avatar.style.setProperty("--cortex-avatar-y", drawnY);
2913
3114
  avatar.classList.add("cortex-working-avatar--leaving");
2914
3115
  settled(avatar, true).then(() => {
2915
3116
  if (shown)
@@ -2941,18 +3142,48 @@ function settled(element, subtree = false) {
2941
3142
  return Promise.allSettled(element.getAnimations({ subtree }).map((animation) => animation.finished));
2942
3143
  }
2943
3144
  // src/internal/client/src/chat/turn-lifecycle.ts
3145
+ import { EventType as EventType2 } from "@tanstack/ai";
3146
+ function failureLabel(failure) {
3147
+ const key = failure.refusal === "approval_pending" ? "translate_approval_pending" : "translate_error";
3148
+ return key;
3149
+ }
2944
3150
  var MAX_REDELIVERIES = 2;
2945
3151
  function createTurnLifecycle(options) {
2946
3152
  let ownsRun = false;
2947
- let serverAnswered = false;
3153
+ let cortexAnswered = false;
2948
3154
  let streamDropped = false;
3155
+ let runFailure;
3156
+ let refusal;
3157
+ let sentPrompt;
3158
+ let streamPrompt;
2949
3159
  let wasAborted = false;
2950
3160
  let wasWorking = false;
2951
- let carriedTranscript = false;
3161
+ let carriedAt;
2952
3162
  let owedSince;
2953
3163
  const dispatched = new Set;
2954
3164
  let adoptedInFlight = 0;
2955
3165
  let adoptedDelivered = false;
3166
+ const awaitingCortex = new Set;
3167
+ const lostDeliveries = new Set;
3168
+ let submission;
3169
+ const outstanding = new Map;
3170
+ let epoch = 0;
3171
+ let readBacks = 0;
3172
+ let appliedReadBack = 0;
3173
+ async function delivered(deliver) {
3174
+ const delivery = Symbol("delivery");
3175
+ awaitingCortex.add(delivery);
3176
+ try {
3177
+ await deliver();
3178
+ if (submission && await submission.over)
3179
+ lostDeliveries.add(delivery);
3180
+ if (lostDeliveries.has(delivery))
3181
+ throw new Error("The answer did not reach Cortex");
3182
+ } finally {
3183
+ awaitingCortex.delete(delivery);
3184
+ lostDeliveries.delete(delivery);
3185
+ }
3186
+ }
2956
3187
  function adopt() {
2957
3188
  if (ownsRun && adoptedInFlight === 0)
2958
3189
  return false;
@@ -2963,31 +3194,43 @@ function createTurnLifecycle(options) {
2963
3194
  }
2964
3195
  return true;
2965
3196
  }
2966
- function adoptionSettled(delivered) {
3197
+ function adoptionSettled(through) {
2967
3198
  adoptedInFlight -= 1;
2968
- if (delivered)
3199
+ if (through)
2969
3200
  adoptedDelivered = true;
2970
3201
  else if (adoptedInFlight === 0 && !adoptedDelivered) {
2971
3202
  ownsRun = false;
2972
3203
  options.setRunning(false);
2973
3204
  }
2974
3205
  }
2975
- async function redeliver(call, answer) {
2976
- for (let attempt = 0;attempt < MAX_REDELIVERIES; attempt += 1) {
2977
- const transcript = await options.refreshMessages().catch(() => {
2978
- return;
2979
- });
2980
- if (!options.isAlive())
2981
- return false;
2982
- if (!transcript)
2983
- continue;
2984
- if (!unansweredToolCalls(transcript).some((open) => open.id === call.id))
2985
- return true;
2986
- const resent = await options.deliver(answer).then(() => true, () => false);
2987
- if (resent)
2988
- return true;
3206
+ async function readBack() {
3207
+ const begun = epoch;
3208
+ const own = ++readBacks;
3209
+ const stale = () => epoch !== begun || appliedReadBack > own || !options.isAlive();
3210
+ const transcript = await options.refreshMessages(stale).catch(() => {
3211
+ return;
3212
+ });
3213
+ if (!transcript || stale())
3214
+ return false;
3215
+ appliedReadBack = own;
3216
+ const open = new Set(unansweredToolCalls(transcript).map((call) => call.id));
3217
+ for (const callId of outstanding.keys()) {
3218
+ if (!open.has(callId))
3219
+ outstanding.delete(callId);
2989
3220
  }
2990
- return false;
3221
+ if (ownsRun)
3222
+ dispatchToolCalls(transcript);
3223
+ const owed = [...outstanding.values()];
3224
+ if (owed.some((held) => held.failedResends >= MAX_REDELIVERIES))
3225
+ return false;
3226
+ for (const held of owed) {
3227
+ const through = await delivered(() => options.deliver(held.answer)).then(() => true, () => false);
3228
+ if (!through) {
3229
+ held.failedResends += 1;
3230
+ return readBack();
3231
+ }
3232
+ }
3233
+ return true;
2991
3234
  }
2992
3235
  async function resolve(call, onToolCall) {
2993
3236
  let output;
@@ -3006,11 +3249,10 @@ function createTurnLifecycle(options) {
3006
3249
  return;
3007
3250
  const adopted = adopt();
3008
3251
  const answer = { toolCallId: call.id, tool: call.name, output };
3009
- const delivered = await options.deliver(answer).then(() => true, () => redeliver(call, answer));
3252
+ outstanding.set(call.id, { answer, failedResends: 0 });
3253
+ const through = await delivered(() => options.deliver(answer)).then(() => true, readBack);
3010
3254
  if (adopted)
3011
- adoptionSettled(delivered);
3012
- if (!delivered)
3013
- dispatched.delete(call.id);
3255
+ adoptionSettled(through);
3014
3256
  }
3015
3257
  function dispatchToolCalls(messages) {
3016
3258
  const pending = unansweredToolCalls(messages);
@@ -3026,51 +3268,66 @@ function createTurnLifecycle(options) {
3026
3268
  return pending.length > 0;
3027
3269
  }
3028
3270
  async function settle(messages) {
3029
- const aborted = wasAborted;
3030
- wasAborted = false;
3031
- if (!aborted && ownsRun) {
3032
- if (dispatchToolCalls(messages()))
3033
- return;
3034
- if (streamDropped)
3035
- options.reloadThreads().catch(() => {});
3036
- else
3037
- options.setRunning(false);
3038
- }
3039
- if (owedSince === undefined && (carriedTranscript || aborted))
3271
+ if (streamDropped)
3272
+ options.reloadThreads().catch(() => {});
3273
+ else
3274
+ options.setRunning(false);
3275
+ if (ownsRun && !wasAborted && dispatchToolCalls(messages()))
3276
+ return;
3277
+ if (owedSince === undefined && carriedAt !== undefined)
3040
3278
  return;
3041
3279
  owedSince = undefined;
3042
- const transcript = await options.refreshMessages();
3043
- if (!aborted && ownsRun && transcript)
3044
- dispatchToolCalls(transcript);
3280
+ await readBack();
3045
3281
  }
3046
3282
  return {
3047
- chunkArrived() {
3048
- serverAnswered = true;
3283
+ chunkArrived(chunk) {
3284
+ cortexAnswered = true;
3285
+ awaitingCortex.clear();
3286
+ if (chunk.type === EventType2.RUN_ERROR && chunk.code !== "aborted") {
3287
+ runFailure = { reason: chunk.message || undefined };
3288
+ }
3049
3289
  },
3050
3290
  transcriptCarried(at) {
3051
- carriedTranscript = true;
3291
+ carriedAt = at;
3052
3292
  if (owedSince !== undefined && owedSince <= at)
3053
3293
  owedSince = undefined;
3054
3294
  },
3055
3295
  transcriptUpdated(updatedAt) {
3296
+ const changedAt = Date.parse(updatedAt);
3297
+ if (carriedAt !== undefined && changedAt <= carriedAt)
3298
+ return;
3056
3299
  if (!wasWorking) {
3057
- options.refreshMessages();
3300
+ readBack();
3058
3301
  return;
3059
3302
  }
3060
- owedSince = Math.max(owedSince ?? 0, Date.parse(updatedAt));
3303
+ owedSince = Math.max(owedSince ?? 0, changedAt);
3061
3304
  },
3062
3305
  streamFailed() {
3063
3306
  streamDropped = true;
3064
- if (serverAnswered)
3307
+ const delivering = awaitingCortex.size > 0;
3308
+ for (const delivery of awaitingCortex)
3309
+ lostDeliveries.add(delivery);
3310
+ awaitingCortex.clear();
3311
+ if (wasAborted)
3312
+ return;
3313
+ if (cortexAnswered)
3065
3314
  options.onTurnFinished();
3066
3315
  else
3067
3316
  options.onSendFailed();
3317
+ if (refusal) {
3318
+ options.setTurnFailed({ reason: undefined, refusal });
3319
+ if (streamPrompt !== undefined)
3320
+ options.returnDraft(streamPrompt);
3321
+ return;
3322
+ }
3323
+ const messageLost = ownsRun && !delivering && !cortexAnswered;
3324
+ const failure = runFailure ?? (messageLost ? { reason: undefined } : undefined);
3325
+ if (failure)
3326
+ options.setTurnFailed(failure);
3068
3327
  },
3069
3328
  loadingChanged(isLoading, messages) {
3070
3329
  if (isLoading) {
3071
3330
  wasWorking = true;
3072
- streamDropped = false;
3073
- carriedTranscript = false;
3074
3331
  return;
3075
3332
  }
3076
3333
  if (!wasWorking)
@@ -3087,14 +3344,61 @@ function createTurnLifecycle(options) {
3087
3344
  dispatchToolCalls(messages);
3088
3345
  }, 0);
3089
3346
  },
3090
- sendStarted() {
3091
- options.setRunning(true);
3347
+ deliverAnswer(deliver) {
3348
+ const adopted = adopt();
3349
+ const delivery = delivered(deliver).catch(async (error) => {
3350
+ await readBack();
3351
+ throw error;
3352
+ });
3353
+ delivery.then(() => {
3354
+ if (adopted)
3355
+ adoptionSettled(true);
3356
+ }, () => {
3357
+ if (adopted)
3358
+ adoptionSettled(false);
3359
+ });
3360
+ return delivery;
3361
+ },
3362
+ interruptStateChanged(state) {
3363
+ if (state.resuming) {
3364
+ if (submission)
3365
+ return;
3366
+ let end = () => {};
3367
+ const over = new Promise((resolve2) => {
3368
+ end = resolve2;
3369
+ });
3370
+ submission = { errorsAtStart: state.interruptErrors.length, over, end };
3371
+ return;
3372
+ }
3373
+ submission?.end(state.interruptErrors.length > submission.errorsAtStart);
3374
+ submission = undefined;
3375
+ },
3376
+ readBack,
3377
+ streamStarted() {
3378
+ if (ownsRun)
3379
+ options.setRunning(true);
3380
+ epoch += 1;
3381
+ streamDropped = false;
3382
+ runFailure = undefined;
3383
+ refusal = undefined;
3384
+ streamPrompt = sentPrompt;
3385
+ sentPrompt = undefined;
3386
+ carriedAt = undefined;
3387
+ wasAborted = false;
3388
+ options.setTurnFailed(undefined);
3389
+ },
3390
+ sendStarted(prompt) {
3391
+ epoch += 1;
3392
+ sentPrompt = prompt;
3393
+ options.returnDraft(undefined);
3092
3394
  ownsRun = true;
3093
- serverAnswered = false;
3395
+ cortexAnswered = false;
3396
+ },
3397
+ sendRefused(reason) {
3398
+ refusal = reason;
3094
3399
  },
3095
3400
  abortConfirmed() {
3096
3401
  wasAborted = true;
3097
- options.setRunning(false);
3098
3402
  }
3099
3403
  };
3100
3404
  }
@@ -3193,6 +3497,9 @@ var CortexWebSocketService = class CortexWebSocketService2 {
3193
3497
  get opened() {
3194
3498
  return this.openedSubject.asObservable();
3195
3499
  }
3500
+ isOpen() {
3501
+ return this.socket?.isOpen() ?? false;
3502
+ }
3196
3503
  ensureSocket() {
3197
3504
  if (this.socket)
3198
3505
  return;
@@ -3230,14 +3537,34 @@ var CortexThreadService = class CortexThreadService2 {
3230
3537
  api = inject(CORTEX_API);
3231
3538
  wsService = inject(CortexWebSocketService);
3232
3539
  destroyRef = inject(DestroyRef);
3540
+ runs = createRunTracker();
3541
+ stopTitleFollow = undefined;
3542
+ stopFirstRead = undefined;
3543
+ constructor() {
3544
+ this.destroyRef.onDestroy(() => {
3545
+ this.stopTitleFollow?.();
3546
+ this.stopFirstRead?.();
3547
+ });
3548
+ }
3233
3549
  start() {
3234
- this.reload().subscribe();
3550
+ this.stopFirstRead = askUntilAnswered(() => this.runs.read(() => this.api.listThreads()), {
3551
+ onAnswered: ({ show }) => this.threads.update(show),
3552
+ onMissed: (why) => {
3553
+ if (why !== "unreachable")
3554
+ this.threads.set(this.threads() ?? []);
3555
+ }
3556
+ });
3235
3557
  this.wsService.events.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
3236
3558
  this.onWsEvent(event);
3237
3559
  });
3238
3560
  }
3239
3561
  reload() {
3240
- return from(this.api.listThreads()).pipe(tap((threads) => this.threads.set(sortThreads(threads))));
3562
+ return from(this.runs.read(() => this.api.listThreads()).catch(() => {
3563
+ return;
3564
+ })).pipe(tap((read) => {
3565
+ if (read)
3566
+ this.threads.update(read.show);
3567
+ }), map((read) => read?.listed));
3241
3568
  }
3242
3569
  create() {
3243
3570
  return from(this.api.createThread()).pipe(tap((thread) => this.upsert(thread)));
@@ -3249,12 +3576,24 @@ var CortexThreadService = class CortexThreadService2 {
3249
3576
  this.threads.set(upsertThread(this.threads() ?? [], thread));
3250
3577
  }
3251
3578
  setRunning(threadId, isRunning) {
3252
- const thread = this.threads()?.find((currentThread) => currentThread.id === threadId);
3253
- if (thread)
3254
- this.upsert({
3255
- ...thread,
3256
- isRunning
3257
- });
3579
+ this.threads.update(this.runs.running(threadId, isRunning));
3580
+ }
3581
+ followTitle(selected) {
3582
+ this.stopTitleFollow?.();
3583
+ const threadId = selected()?.id;
3584
+ if (!threadId)
3585
+ return;
3586
+ this.stopTitleFollow = followThreadTitle({
3587
+ threadId,
3588
+ listThreads: () => this.api.listThreads(),
3589
+ selected,
3590
+ socketOpen: () => this.wsService.isOpen(),
3591
+ setTitle: (title) => {
3592
+ const current = this.threads();
3593
+ if (current)
3594
+ this.threads.set(retitleThread(current, threadId, title));
3595
+ }
3596
+ });
3258
3597
  }
3259
3598
  remove(threadId) {
3260
3599
  const current = this.threads();
@@ -3263,6 +3602,8 @@ var CortexThreadService = class CortexThreadService2 {
3263
3602
  this.threads.set(removeThread(current, threadId));
3264
3603
  }
3265
3604
  onWsEvent(event) {
3605
+ if (!this.runs.admits(event))
3606
+ return;
3266
3607
  const current = this.threads();
3267
3608
  const next = applyWsEvent(current ?? [], event);
3268
3609
  if (current || next.length)
@@ -3288,7 +3629,8 @@ i0.ɵɵngDeclareClassMetadata({
3288
3629
  version: "22.2.0",
3289
3630
  ngImport: i0,
3290
3631
  type: CortexThreadService,
3291
- decorators: [{ type: Injectable }]
3632
+ decorators: [{ type: Injectable }],
3633
+ ctorParameters: () => []
3292
3634
  });
3293
3635
  var CortexChatService = class CortexChatService2 {
3294
3636
  selectedThread = computed(() => {
@@ -3307,7 +3649,11 @@ var CortexChatService = class CortexChatService2 {
3307
3649
  return false;
3308
3650
  return unansweredToolCalls(chat.messages()).length > 0;
3309
3651
  }, ...ngDevMode ? [{ debugName: "hasPendingToolCalls" }] : []);
3652
+ awaitsApproval = computed(() => awaitsApproval(this.messages()), ...ngDevMode ? [{ debugName: "awaitsApproval" }] : []);
3653
+ turnFailure = signal(undefined, ...ngDevMode ? [{ debugName: "turnFailure" }] : []);
3654
+ returnedDraft = signal(undefined, ...ngDevMode ? [{ debugName: "returnedDraft" }] : []);
3310
3655
  capabilities = signal(undefined, ...ngDevMode ? [{ debugName: "capabilities" }] : []);
3656
+ unanswered = signal(undefined, ...ngDevMode ? [{ debugName: "unanswered" }] : []);
3311
3657
  events = new Subject;
3312
3658
  selectedThreadSnapshot = signal(undefined, ...ngDevMode ? [{ debugName: "selectedThreadSnapshot" }] : []);
3313
3659
  config = inject(CORTEX_CONFIG);
@@ -3336,7 +3682,14 @@ var CortexChatService = class CortexChatService2 {
3336
3682
  loadCapabilities() {
3337
3683
  this.stopCapabilities?.();
3338
3684
  this.capabilities.set(undefined);
3339
- this.stopCapabilities = loadCapabilities(this.api, (capabilities) => this.capabilities.set(capabilities));
3685
+ this.unanswered.set(undefined);
3686
+ this.stopCapabilities = askUntilAnswered(() => this.api.getCapabilities(), {
3687
+ onAnswered: (capabilities) => {
3688
+ this.capabilities.set(capabilities);
3689
+ this.unanswered.set(undefined);
3690
+ },
3691
+ onMissed: (why) => this.unanswered.set(why)
3692
+ });
3340
3693
  }
3341
3694
  get events$() {
3342
3695
  return this.events.asObservable();
@@ -3357,6 +3710,8 @@ var CortexChatService = class CortexChatService2 {
3357
3710
  this.chatInjector = undefined;
3358
3711
  this.lifecycle = undefined;
3359
3712
  this.isLoadingMessages.set(false);
3713
+ this.turnFailure.set(undefined);
3714
+ this.returnedDraft.set(undefined);
3360
3715
  const previousThread = this.selectedThread();
3361
3716
  if (!previousThread && !this.chat())
3362
3717
  return;
@@ -3380,11 +3735,11 @@ var CortexChatService = class CortexChatService2 {
3380
3735
  return this.pendingThreadCreation;
3381
3736
  }
3382
3737
  send(prompt, attachments = []) {
3383
- if (this.isAgentWorking() || this.hasPendingToolCalls())
3738
+ if (this.isAgentWorking() || this.awaitsApproval())
3384
3739
  return of();
3385
3740
  return this.ensureThread().pipe(tap(() => {
3386
3741
  this.events.next("onSend");
3387
- this.lifecycle?.sendStarted();
3742
+ this.lifecycle?.sendStarted(prompt);
3388
3743
  }), switchMap(() => {
3389
3744
  const message = {
3390
3745
  id: randomId(),
@@ -3403,27 +3758,24 @@ var CortexChatService = class CortexChatService2 {
3403
3758
  }
3404
3759
  addToolResult(toolCallId, toolName, output2) {
3405
3760
  const chat = this.chat();
3406
- if (!chat)
3761
+ const lifecycle = this.lifecycle;
3762
+ if (!chat || !lifecycle)
3407
3763
  return Promise.resolve();
3408
- return chat.addToolResult({
3764
+ return lifecycle.deliverAnswer(() => chat.addToolResult({
3409
3765
  toolCallId,
3410
3766
  tool: toolName,
3411
3767
  output: output2
3412
- }).catch((error) => {
3413
- const threadId = this.selectedThread()?.id;
3414
- if (threadId)
3415
- this.refreshMessages(threadId);
3416
- throw error;
3417
- });
3768
+ }));
3418
3769
  }
3419
3770
  respondToApproval(approvalId, approved) {
3420
3771
  const chat = this.chat();
3421
- if (!chat)
3772
+ const lifecycle = this.lifecycle;
3773
+ if (!chat || !lifecycle)
3422
3774
  return Promise.resolve();
3423
- return respondToApproval({
3775
+ return lifecycle.deliverAnswer(() => respondToApproval({
3424
3776
  interrupts: chat.interrupts(),
3425
3777
  addToolApprovalResponse: chat.addToolApprovalResponse
3426
- }, approvalId, approved);
3778
+ }, approvalId, approved));
3427
3779
  }
3428
3780
  async abort() {
3429
3781
  const chat = this.chat();
@@ -3434,8 +3786,10 @@ var CortexChatService = class CortexChatService2 {
3434
3786
  const { aborted } = await this.api.abortStream(threadId).catch(() => ({ aborted: false }));
3435
3787
  if (this.chat() !== chat)
3436
3788
  return;
3437
- if (aborted)
3789
+ if (aborted) {
3438
3790
  this.lifecycle?.abortConfirmed();
3791
+ return;
3792
+ }
3439
3793
  }
3440
3794
  chat.stop();
3441
3795
  }
@@ -3450,6 +3804,8 @@ var CortexChatService = class CortexChatService2 {
3450
3804
  const injector = createEnvironmentInjector([], this.environmentInjector, "cortex-chat");
3451
3805
  this.chatInjector = injector;
3452
3806
  this.selectedThreadSnapshot.set(thread);
3807
+ this.turnFailure.set(undefined);
3808
+ this.returnedDraft.set(undefined);
3453
3809
  const lifecycle = createTurnLifecycle({
3454
3810
  threadId: thread.id,
3455
3811
  isAlive: () => this.chatInjector === injector,
@@ -3462,9 +3818,20 @@ var CortexChatService = class CortexChatService2 {
3462
3818
  error: reject
3463
3819
  });
3464
3820
  }),
3465
- refreshMessages: () => this.refreshMessages(thread.id),
3466
- onTurnFinished: () => this.events.next("onFinish"),
3467
- onSendFailed: () => this.events.next("onError")
3821
+ refreshMessages: (stale) => this.refreshMessages(thread.id, stale),
3822
+ onTurnFinished: () => {
3823
+ this.events.next("onFinish");
3824
+ this.threadService.followTitle(() => this.selectedThread());
3825
+ },
3826
+ onSendFailed: () => this.events.next("onError"),
3827
+ setTurnFailed: (failure) => {
3828
+ if (this.chatInjector === injector)
3829
+ this.turnFailure.set(failure);
3830
+ },
3831
+ returnDraft: (prompt) => {
3832
+ if (this.chatInjector === injector)
3833
+ this.returnedDraft.set(prompt);
3834
+ }
3468
3835
  });
3469
3836
  this.lifecycle = lifecycle;
3470
3837
  this.chat.set(runInInjectionContext(injector, () => {
@@ -3473,8 +3840,9 @@ var CortexChatService = class CortexChatService2 {
3473
3840
  persistence: true,
3474
3841
  initialMessages,
3475
3842
  connection: this.createConnection(thread, mode, injector),
3476
- onChunk: () => lifecycle.chunkArrived(),
3477
- onError: () => lifecycle.streamFailed()
3843
+ onChunk: (chunk) => lifecycle.chunkArrived(chunk),
3844
+ onError: () => lifecycle.streamFailed(),
3845
+ onInterruptStateChange: (state) => lifecycle.interruptStateChanged(state)
3478
3846
  });
3479
3847
  effect(() => {
3480
3848
  const isLoading = chat.isLoading();
@@ -3490,7 +3858,7 @@ var CortexChatService = class CortexChatService2 {
3490
3858
  this.mountChat(thread, "reload");
3491
3859
  return;
3492
3860
  }
3493
- this.refreshMessages(thread.id);
3861
+ this.lifecycle?.readBack();
3494
3862
  }
3495
3863
  createConnection(thread, mode, injector) {
3496
3864
  return createCortexConnection({
@@ -3506,24 +3874,32 @@ var CortexChatService = class CortexChatService2 {
3506
3874
  if (this.chatInjector === injector)
3507
3875
  this.lifecycle?.transcriptCarried(at);
3508
3876
  },
3877
+ onStreamStarted: () => {
3878
+ if (this.chatInjector === injector)
3879
+ this.lifecycle?.streamStarted();
3880
+ },
3881
+ onRefused: (refusal) => {
3882
+ if (this.chatInjector === injector)
3883
+ this.lifecycle?.sendRefused(refusal);
3884
+ },
3509
3885
  setLoadingMessages: (loading) => {
3510
3886
  if (this.chatInjector === injector)
3511
3887
  this.isLoadingMessages.set(loading);
3512
3888
  }
3513
3889
  });
3514
3890
  }
3515
- refreshMessages(threadId) {
3516
- this.refreshing = this.refreshing.then(() => this.readBackMessages(threadId));
3891
+ refreshMessages(threadId, stale) {
3892
+ this.refreshing = this.refreshing.then(() => this.readBackMessages(threadId, stale));
3517
3893
  return this.refreshing;
3518
3894
  }
3519
- async readBackMessages(threadId) {
3895
+ async readBackMessages(threadId, stale) {
3520
3896
  const chat = this.chat();
3521
3897
  if (!chat || this.selectedThread()?.id !== threadId)
3522
3898
  return;
3523
3899
  return settleTurn({
3524
3900
  api: this.api,
3525
3901
  threadId,
3526
- isStale: () => this.chat() !== chat,
3902
+ isStale: () => this.chat() !== chat || stale(),
3527
3903
  isStreaming: () => this.isAgentWorking(),
3528
3904
  setMessages: (messages) => {
3529
3905
  chat.setMessages(messages);
@@ -3546,6 +3922,7 @@ var CortexChatService = class CortexChatService2 {
3546
3922
  this.reattach(event.payload.thread);
3547
3923
  break;
3548
3924
  case "thread:messages-updated":
3925
+ case "thread:run-finished":
3549
3926
  if (this.selectedThread()?.id === event.payload.thread.id)
3550
3927
  this.lifecycle?.transcriptUpdated(event.payload.thread.updatedAt);
3551
3928
  }
@@ -3553,7 +3930,10 @@ var CortexChatService = class CortexChatService2 {
3553
3930
  subscribeToWsConnections() {
3554
3931
  this.wsService.opened.pipe(skip(1), takeUntilDestroyed(this.destroyRef)).subscribe(() => {
3555
3932
  this.loadCapabilities();
3556
- this.threadService.reload().subscribe(() => this.reattach());
3933
+ this.threadService.reload().subscribe((listed) => {
3934
+ if (listed)
3935
+ this.reattach();
3936
+ });
3557
3937
  });
3558
3938
  }
3559
3939
  static ɵfac = i0.ɵɵngDeclareFactory({
@@ -3618,6 +3998,10 @@ i0.ɵɵngDeclareClassMetadata({
3618
3998
  });
3619
3999
  var AttachmentQueueComponent = class AttachmentQueueComponent2 {
3620
4000
  queue = inject(AttachmentQueueService);
4001
+ locale = inject(CORTEX_LOCALE);
4002
+ errorText(item) {
4003
+ return attachmentErrorText(item, this.locale());
4004
+ }
3621
4005
  static ɵfac = i0.ɵɵngDeclareFactory({
3622
4006
  minVersion: "12.0.0",
3623
4007
  version: "22.2.0",
@@ -3639,7 +4023,6 @@ var AttachmentQueueComponent = class AttachmentQueueComponent2 {
3639
4023
  <div
3640
4024
  class="cortex-attachment-chip"
3641
4025
  [class.cortex-attachment-chip--error]="item.status === 'error'"
3642
- [title]="item.status === 'error' ? ('translate_attachment_rejected' | translate) : ''"
3643
4026
  >
3644
4027
  @if (item.status === 'uploading' || item.status === 'deleting') {
3645
4028
  <svg class="cortex-attachment-chip__spinner" viewBox="0 0 16 16" fill="none">
@@ -3658,6 +4041,16 @@ var AttachmentQueueComponent = class AttachmentQueueComponent2 {
3658
4041
  stroke-linecap="round"
3659
4042
  />
3660
4043
  </svg>
4044
+ } @else if (item.status === 'error') {
4045
+ <svg viewBox="0 0 16 16" class="cortex-attachment-chip__icon" fill="none">
4046
+ <circle cx="8" cy="8" r="6" stroke="currentColor" stroke-width="1.25" />
4047
+ <path
4048
+ d="M8 4.75v4M8 10.75v.5"
4049
+ stroke="currentColor"
4050
+ stroke-width="1.4"
4051
+ stroke-linecap="round"
4052
+ />
4053
+ </svg>
3661
4054
  } @else {
3662
4055
  <svg viewBox="0 0 16 16" class="cortex-attachment-chip__icon" fill="none">
3663
4056
  <path
@@ -3674,7 +4067,16 @@ var AttachmentQueueComponent = class AttachmentQueueComponent2 {
3674
4067
  </svg>
3675
4068
  }
3676
4069
 
3677
- <span class="cortex-attachment-chip__name">{{ item.filename }}</span>
4070
+ <!-- A refused file says why on a second line, readable without hovering. -->
4071
+ <span class="cortex-attachment-chip__text">
4072
+ <!-- <bdi> orders a Latin name in Arabic without moving its line off the chip's edge. -->
4073
+ <span class="cortex-attachment-chip__name"
4074
+ ><bdi>{{ item.filename }}</bdi></span
4075
+ >
4076
+ @if (item.status === 'error') {
4077
+ <span class="cortex-attachment-chip__reason">{{ errorText(item) }}</span>
4078
+ }
4079
+ </span>
3678
4080
 
3679
4081
  <button
3680
4082
  type="button"
@@ -3724,7 +4126,6 @@ i0.ɵɵngDeclareClassMetadata({
3724
4126
  <div
3725
4127
  class="cortex-attachment-chip"
3726
4128
  [class.cortex-attachment-chip--error]="item.status === 'error'"
3727
- [title]="item.status === 'error' ? ('translate_attachment_rejected' | translate) : ''"
3728
4129
  >
3729
4130
  @if (item.status === 'uploading' || item.status === 'deleting') {
3730
4131
  <svg class="cortex-attachment-chip__spinner" viewBox="0 0 16 16" fill="none">
@@ -3743,6 +4144,16 @@ i0.ɵɵngDeclareClassMetadata({
3743
4144
  stroke-linecap="round"
3744
4145
  />
3745
4146
  </svg>
4147
+ } @else if (item.status === 'error') {
4148
+ <svg viewBox="0 0 16 16" class="cortex-attachment-chip__icon" fill="none">
4149
+ <circle cx="8" cy="8" r="6" stroke="currentColor" stroke-width="1.25" />
4150
+ <path
4151
+ d="M8 4.75v4M8 10.75v.5"
4152
+ stroke="currentColor"
4153
+ stroke-width="1.4"
4154
+ stroke-linecap="round"
4155
+ />
4156
+ </svg>
3746
4157
  } @else {
3747
4158
  <svg viewBox="0 0 16 16" class="cortex-attachment-chip__icon" fill="none">
3748
4159
  <path
@@ -3759,7 +4170,16 @@ i0.ɵɵngDeclareClassMetadata({
3759
4170
  </svg>
3760
4171
  }
3761
4172
 
3762
- <span class="cortex-attachment-chip__name">{{ item.filename }}</span>
4173
+ <!-- A refused file says why on a second line, readable without hovering. -->
4174
+ <span class="cortex-attachment-chip__text">
4175
+ <!-- <bdi> orders a Latin name in Arabic without moving its line off the chip's edge. -->
4176
+ <span class="cortex-attachment-chip__name"
4177
+ ><bdi>{{ item.filename }}</bdi></span
4178
+ >
4179
+ @if (item.status === 'error') {
4180
+ <span class="cortex-attachment-chip__reason">{{ errorText(item) }}</span>
4181
+ }
4182
+ </span>
3763
4183
 
3764
4184
  <button
3765
4185
  type="button"
@@ -3789,11 +4209,15 @@ var ChatComposerComponent = class ChatComposerComponent2 {
3789
4209
  chatService = inject(CortexChatService);
3790
4210
  queue = inject(AttachmentQueueService);
3791
4211
  locale = inject(CORTEX_LOCALE);
3792
- text = signal("", ...ngDevMode ? [{ debugName: "text" }] : []);
4212
+ text = linkedSignal({
4213
+ ...ngDevMode ? { debugName: "text" } : {},
4214
+ source: this.chatService.returnedDraft,
4215
+ computation: (draft, previous) => previous?.value || draft || ""
4216
+ });
3793
4217
  dragging = signal(false, ...ngDevMode ? [{ debugName: "dragging" }] : []);
3794
4218
  attachmentsEnabled = computed(() => this.chatService.capabilities()?.attachments ?? false, ...ngDevMode ? [{ debugName: "attachmentsEnabled" }] : []);
3795
4219
  acceptedTypes = ATTACHMENT_MIME_TYPES.join(",");
3796
- canSend = computed(() => !this.queue.busy() && (Boolean(this.text().trim()) || this.queue.hasReady()), ...ngDevMode ? [{ debugName: "canSend" }] : []);
4220
+ canSend = computed(() => !this.chatService.awaitsApproval() && !this.queue.busy() && (Boolean(this.text().trim()) || this.queue.hasReady()), ...ngDevMode ? [{ debugName: "canSend" }] : []);
3797
4221
  messageInput = viewChild("messageInput", ...ngDevMode ? [{ debugName: "messageInput" }] : []);
3798
4222
  focusInput() {
3799
4223
  this.messageInput()?.nativeElement.focus();
@@ -3897,7 +4321,12 @@ var ChatComposerComponent = class ChatComposerComponent2 {
3897
4321
  [class.cortex-widget__textarea--disabled]="chatService.isAgentWorking()"
3898
4322
  ></textarea>
3899
4323
  @if (chatService.isAgentWorking()) {
3900
- <button (click)="chatService.abort()" class="cortex-stop-btn">
4324
+ <button
4325
+ type="button"
4326
+ [attr.aria-label]="'translate_stop' | translate"
4327
+ (click)="chatService.abort()"
4328
+ class="cortex-stop-btn"
4329
+ >
3901
4330
  <span class="cortex-stop-btn__ring"></span>
3902
4331
  <svg width="12" height="12" viewBox="0 0 12 12" fill="none" class="cortex-stop-btn__icon">
3903
4332
  <rect x="1" y="1" width="10" height="10" rx="2.5" fill="currentColor" />
@@ -3933,6 +4362,8 @@ var ChatComposerComponent = class ChatComposerComponent2 {
3933
4362
  }
3934
4363
 
3935
4364
  <button
4365
+ type="button"
4366
+ [attr.aria-label]="'translate_send' | translate"
3936
4367
  (click)="send()"
3937
4368
  class="cortex-widget__send-btn"
3938
4369
  [disabled]="!canSend()"
@@ -4018,7 +4449,12 @@ i0.ɵɵngDeclareClassMetadata({
4018
4449
  [class.cortex-widget__textarea--disabled]="chatService.isAgentWorking()"
4019
4450
  ></textarea>
4020
4451
  @if (chatService.isAgentWorking()) {
4021
- <button (click)="chatService.abort()" class="cortex-stop-btn">
4452
+ <button
4453
+ type="button"
4454
+ [attr.aria-label]="'translate_stop' | translate"
4455
+ (click)="chatService.abort()"
4456
+ class="cortex-stop-btn"
4457
+ >
4022
4458
  <span class="cortex-stop-btn__ring"></span>
4023
4459
  <svg width="12" height="12" viewBox="0 0 12 12" fill="none" class="cortex-stop-btn__icon">
4024
4460
  <rect x="1" y="1" width="10" height="10" rx="2.5" fill="currentColor" />
@@ -4054,6 +4490,8 @@ i0.ɵɵngDeclareClassMetadata({
4054
4490
  }
4055
4491
 
4056
4492
  <button
4493
+ type="button"
4494
+ [attr.aria-label]="'translate_send' | translate"
4057
4495
  (click)="send()"
4058
4496
  class="cortex-widget__send-btn"
4059
4497
  [disabled]="!canSend()"
@@ -4090,9 +4528,6 @@ i0.ɵɵngDeclareClassMetadata({
4090
4528
  });
4091
4529
  var ChatHeaderComponent = class ChatHeaderComponent2 {
4092
4530
  context = input.required(...ngDevMode ? [{ debugName: "context" }] : []);
4093
- countKey(count2) {
4094
- return pluralKey(count2, "translate_one_conversation", "translate_n_conversations");
4095
- }
4096
4531
  static ɵfac = i0.ɵɵngDeclareFactory({
4097
4532
  minVersion: "12.0.0",
4098
4533
  version: "22.2.0",
@@ -4165,9 +4600,11 @@ var ChatHeaderComponent = class ChatHeaderComponent2 {
4165
4600
  <h2 class="cortex-widget__threads-title">
4166
4601
  {{ 'translate_history' | translate }}
4167
4602
  </h2>
4168
- <p class="cortex-widget__threads-count">
4169
- {{ countKey(header.threadCount) | translate: { count: header.threadCount } }}
4170
- </p>
4603
+ @if (header.threadCount !== undefined) {
4604
+ <p class="cortex-widget__threads-count">
4605
+ {{ 'translate_conversations' | translate: { count: header.threadCount } }}
4606
+ </p>
4607
+ }
4171
4608
  </div>
4172
4609
  <ng-container *ngTemplateOutlet="newChatButton" />
4173
4610
  } @else {
@@ -4302,9 +4739,11 @@ i0.ɵɵngDeclareClassMetadata({
4302
4739
  <h2 class="cortex-widget__threads-title">
4303
4740
  {{ 'translate_history' | translate }}
4304
4741
  </h2>
4305
- <p class="cortex-widget__threads-count">
4306
- {{ countKey(header.threadCount) | translate: { count: header.threadCount } }}
4307
- </p>
4742
+ @if (header.threadCount !== undefined) {
4743
+ <p class="cortex-widget__threads-count">
4744
+ {{ 'translate_conversations' | translate: { count: header.threadCount } }}
4745
+ </p>
4746
+ }
4308
4747
  </div>
4309
4748
  <ng-container *ngTemplateOutlet="newChatButton" />
4310
4749
  } @else {
@@ -4693,6 +5132,7 @@ i0.ɵɵngDeclareClassMetadata({
4693
5132
  }] }
4694
5133
  });
4695
5134
  var MessageAbortedFlagComponent = class MessageAbortedFlagComponent2 {
5135
+ label = input.required(...ngDevMode ? [{ debugName: "label" }] : []);
4696
5136
  static ɵfac = i0.ɵɵngDeclareFactory({
4697
5137
  minVersion: "12.0.0",
4698
5138
  version: "22.2.0",
@@ -4702,11 +5142,18 @@ var MessageAbortedFlagComponent = class MessageAbortedFlagComponent2 {
4702
5142
  target: i0.ɵɵFactoryTarget.Component
4703
5143
  });
4704
5144
  static ɵcmp = i0.ɵɵngDeclareComponent({
4705
- minVersion: "14.0.0",
5145
+ minVersion: "17.1.0",
4706
5146
  version: "22.2.0",
4707
5147
  type: MessageAbortedFlagComponent2,
4708
5148
  isStandalone: true,
4709
5149
  selector: "cortex-message-aborted-flag",
5150
+ inputs: { label: {
5151
+ classPropertyName: "label",
5152
+ publicName: "label",
5153
+ isSignal: true,
5154
+ isRequired: true,
5155
+ transformFunction: null
5156
+ } },
4710
5157
  host: { classAttribute: "cortex-aborted-flag" },
4711
5158
  ngImport: i0,
4712
5159
  template: `<span class="cortex-aborted-flag__line"></span>
@@ -4714,7 +5161,7 @@ var MessageAbortedFlagComponent = class MessageAbortedFlagComponent2 {
4714
5161
  <svg class="cortex-aborted-flag__icon" width="12" height="12" viewBox="0 0 12 12" fill="none">
4715
5162
  <path d="M6 1.5v5M6 8.75v.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
4716
5163
  </svg>
4717
- {{ 'translate_aborted' | translate }}
5164
+ {{ label() | translate }}
4718
5165
  </span>
4719
5166
  <span class="cortex-aborted-flag__line"></span>
4720
5167
  `,
@@ -4745,12 +5192,20 @@ i0.ɵɵngDeclareClassMetadata({
4745
5192
  <svg class="cortex-aborted-flag__icon" width="12" height="12" viewBox="0 0 12 12" fill="none">
4746
5193
  <path d="M6 1.5v5M6 8.75v.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
4747
5194
  </svg>
4748
- {{ 'translate_aborted' | translate }}
5195
+ {{ label() | translate }}
4749
5196
  </span>
4750
5197
  <span class="cortex-aborted-flag__line"></span>
4751
5198
  `
4752
5199
  }]
4753
- }]
5200
+ }],
5201
+ propDecorators: { label: [{
5202
+ type: i0.Input,
5203
+ args: [{
5204
+ isSignal: true,
5205
+ alias: "label",
5206
+ required: true
5207
+ }]
5208
+ }] }
4754
5209
  });
4755
5210
  var MessageAttachmentsComponent = class MessageAttachmentsComponent2 {
4756
5211
  attachments = input.required(...ngDevMode ? [{ debugName: "attachments" }] : []);
@@ -5355,11 +5810,13 @@ var MessageLlmInspectorComponent = class MessageLlmInspectorComponent2 {
5355
5810
  activeTab = signal({}, ...ngDevMode ? [{ debugName: "activeTab" }] : []);
5356
5811
  loaded = false;
5357
5812
  api = inject(CORTEX_API);
5813
+ chatService = inject(CortexChatService);
5358
5814
  async toggle() {
5359
- if (!this.loaded) {
5815
+ const threadId = this.chatService.selectedThread()?.id;
5816
+ if (!this.loaded && threadId) {
5360
5817
  this.loading.set(true);
5361
5818
  try {
5362
- this.requests.set(await this.api.listLlmRequests(this.messageId()));
5819
+ this.requests.set(await this.api.listLlmRequests(threadId, this.messageId()));
5363
5820
  } finally {
5364
5821
  this.loading.set(false);
5365
5822
  this.loaded = true;
@@ -6648,7 +7105,7 @@ var MediaBlockComponent = class MediaBlockComponent2 {
6648
7105
  />
6649
7106
  </ng-template>
6650
7107
  @if (debugMode() && (failure() || showSource())) {
6651
- <pre class="cortex-media-block__source">{{ source() }}</pre>
7108
+ <pre dir="ltr" class="cortex-media-block__source">{{ source() }}</pre>
6652
7109
  }
6653
7110
  `,
6654
7111
  dependencies: [
@@ -6779,7 +7236,7 @@ i0.ɵɵngDeclareClassMetadata({
6779
7236
  />
6780
7237
  </ng-template>
6781
7238
  @if (debugMode() && (failure() || showSource())) {
6782
- <pre class="cortex-media-block__source">{{ source() }}</pre>
7239
+ <pre dir="ltr" class="cortex-media-block__source">{{ source() }}</pre>
6783
7240
  }
6784
7241
  `
6785
7242
  }]
@@ -7386,7 +7843,7 @@ var MessageReasoningPartComponent = class MessageReasoningPartComponent2 {
7386
7843
 
7387
7844
  <div class="cortex-reasoning-details__body">
7388
7845
  <div class="cortex-reasoning-details__content">
7389
- <pre class="cortex-reasoning-details__pre">{{
7846
+ <pre dir="auto" class="cortex-reasoning-details__pre">{{
7390
7847
  p.content.trim() ? p.content : ('translate_no_reasoning' | translate)
7391
7848
  }}</pre>
7392
7849
  </div>
@@ -7468,7 +7925,7 @@ i0.ɵɵngDeclareClassMetadata({
7468
7925
 
7469
7926
  <div class="cortex-reasoning-details__body">
7470
7927
  <div class="cortex-reasoning-details__content">
7471
- <pre class="cortex-reasoning-details__pre">{{
7928
+ <pre dir="auto" class="cortex-reasoning-details__pre">{{
7472
7929
  p.content.trim() ? p.content : ('translate_no_reasoning' | translate)
7473
7930
  }}</pre>
7474
7931
  </div>
@@ -8200,7 +8657,7 @@ var ApprovalCardComponent = class ApprovalCardComponent2 {
8200
8657
  outcome = computed(() => toolCallAnimation(this.toolCallPart()), ...ngDevMode ? [{ debugName: "outcome" }] : []);
8201
8658
  sentenceId = computed(() => `cortex-approval-${this.toolCallPart().id}`, ...ngDevMode ? [{ debugName: "sentenceId" }] : []);
8202
8659
  respond(approved) {
8203
- this.chatService.respondToApproval(approvalIdOf(this.toolCallPart()), approved);
8660
+ this.chatService.respondToApproval(approvalIdOf(this.toolCallPart()), approved).catch(() => {});
8204
8661
  }
8205
8662
  static ɵfac = i0.ɵɵngDeclareFactory({
8206
8663
  minVersion: "12.0.0",
@@ -8447,10 +8904,10 @@ var ClientToolEmbedComponent = class ClientToolEmbedComponent2 {
8447
8904
  const state = this.state();
8448
8905
  return state.phase === "embedded" && state.surface === "modal";
8449
8906
  }, ...ngDevMode ? [{ debugName: "isModal" }] : []);
8450
- sandbox = computed(() => {
8907
+ keepsOwnOrigin = computed(() => {
8451
8908
  const state = this.state();
8452
- return state.phase === "embedded" ? embedSandbox(state.embedUrl, window.location.origin, this.trustSameOriginEmbeds) : "";
8453
- }, ...ngDevMode ? [{ debugName: "sandbox" }] : []);
8909
+ return state.phase === "embedded" && embedSandbox(state.embedUrl, window.location.origin, this.trustSameOriginEmbeds).includes("allow-same-origin");
8910
+ }, ...ngDevMode ? [{ debugName: "keepsOwnOrigin" }] : []);
8454
8911
  config = inject(CORTEX_CONFIG);
8455
8912
  trustSameOriginEmbeds;
8456
8913
  api = inject(CORTEX_API);
@@ -8581,15 +9038,28 @@ var ClientToolEmbedComponent = class ClientToolEmbedComponent2 {
8581
9038
  {{ 'translate_client_tool_cancel' | translate }}
8582
9039
  </button>
8583
9040
  </div>
9041
+ <!-- Angular takes an iframe's sandbox only as a static attribute, so each
9042
+ grant set embedSandbox yields is its own frame. -->
8584
9043
  @if (embedUrl(); as url) {
8585
- <iframe
8586
- #embedFrame
8587
- class="cortex-client-tool-embed__frame"
8588
- [src]="url"
8589
- [attr.sandbox]="sandbox()"
8590
- [title]="'translate_client_tool_title' | translate"
8591
- (load)="checkFrameOrigin($event)"
8592
- ></iframe>
9044
+ @if (keepsOwnOrigin()) {
9045
+ <iframe
9046
+ #embedFrame
9047
+ class="cortex-client-tool-embed__frame"
9048
+ [src]="url"
9049
+ sandbox="allow-scripts allow-forms allow-popups allow-same-origin"
9050
+ [title]="'translate_client_tool_title' | translate"
9051
+ (load)="checkFrameOrigin($event)"
9052
+ ></iframe>
9053
+ } @else {
9054
+ <iframe
9055
+ #embedFrame
9056
+ class="cortex-client-tool-embed__frame"
9057
+ [src]="url"
9058
+ sandbox="allow-scripts allow-forms allow-popups"
9059
+ [title]="'translate_client_tool_title' | translate"
9060
+ (load)="checkFrameOrigin($event)"
9061
+ ></iframe>
9062
+ }
8593
9063
  } @else if (s.phase === 'error') {
8594
9064
  <div class="cortex-client-tool-embed__status">
8595
9065
  <span>{{ 'translate_client_tool_failed' | translate }}</span>
@@ -8664,15 +9134,28 @@ i0.ɵɵngDeclareClassMetadata({
8664
9134
  {{ 'translate_client_tool_cancel' | translate }}
8665
9135
  </button>
8666
9136
  </div>
9137
+ <!-- Angular takes an iframe's sandbox only as a static attribute, so each
9138
+ grant set embedSandbox yields is its own frame. -->
8667
9139
  @if (embedUrl(); as url) {
8668
- <iframe
8669
- #embedFrame
8670
- class="cortex-client-tool-embed__frame"
8671
- [src]="url"
8672
- [attr.sandbox]="sandbox()"
8673
- [title]="'translate_client_tool_title' | translate"
8674
- (load)="checkFrameOrigin($event)"
8675
- ></iframe>
9140
+ @if (keepsOwnOrigin()) {
9141
+ <iframe
9142
+ #embedFrame
9143
+ class="cortex-client-tool-embed__frame"
9144
+ [src]="url"
9145
+ sandbox="allow-scripts allow-forms allow-popups allow-same-origin"
9146
+ [title]="'translate_client_tool_title' | translate"
9147
+ (load)="checkFrameOrigin($event)"
9148
+ ></iframe>
9149
+ } @else {
9150
+ <iframe
9151
+ #embedFrame
9152
+ class="cortex-client-tool-embed__frame"
9153
+ [src]="url"
9154
+ sandbox="allow-scripts allow-forms allow-popups"
9155
+ [title]="'translate_client_tool_title' | translate"
9156
+ (load)="checkFrameOrigin($event)"
9157
+ ></iframe>
9158
+ }
8676
9159
  } @else if (s.phase === 'error') {
8677
9160
  <div class="cortex-client-tool-embed__status">
8678
9161
  <span>{{ 'translate_client_tool_failed' | translate }}</span>
@@ -9207,7 +9690,7 @@ var MessageToolCallAnimatedComponent = class MessageToolCallAnimatedComponent2 {
9207
9690
  }, ...ngDevMode ? [{ debugName: "mountedComponent" }] : []);
9208
9691
  clientToolFallback = signal(false, ...ngDevMode ? [{ debugName: "clientToolFallback" }] : []);
9209
9692
  owed = computed(() => this.toolCallPart().state === "input-complete" && !this.chatService.isAgentWorking(), ...ngDevMode ? [{ debugName: "owed" }] : []);
9210
- showClientTool = computed(() => !this.clientToolFallback() && this.owed(), ...ngDevMode ? [{ debugName: "showClientTool" }] : []);
9693
+ showClientTool = computed(() => !this.clientToolFallback() && this.owed() && toolCallMetadataOf(this.toolCallPart())?.embed !== undefined, ...ngDevMode ? [{ debugName: "showClientTool" }] : []);
9211
9694
  approvalRequested = computed(() => this.toolCallPart().state === "approval-requested" && !this.chatService.isAgentWorking(), ...ngDevMode ? [{ debugName: "approvalRequested" }] : []);
9212
9695
  animation = computed(() => toolCallAnimation(this.toolCallPart()), ...ngDevMode ? [{ debugName: "animation" }] : []);
9213
9696
  animState = computed(() => this.animation().state, ...ngDevMode ? [{ debugName: "animState" }] : []);
@@ -9216,8 +9699,8 @@ var MessageToolCallAnimatedComponent = class MessageToolCallAnimatedComponent2 {
9216
9699
  displayTitleKey = computed(() => this.animation().titleKey, ...ngDevMode ? [{ debugName: "displayTitleKey" }] : []);
9217
9700
  statement = computed(() => this.animation().statement, ...ngDevMode ? [{ debugName: "statement" }] : []);
9218
9701
  rowsLabel = computed(() => {
9219
- const count2 = this.animation().rowCount;
9220
- return count2 === undefined ? undefined : translate(this.locale(), "translate_rows_read", { count: count2 });
9702
+ const rows = this.animation().rows;
9703
+ return rows === undefined ? undefined : translate(this.locale(), "translate_rows", { count: rows });
9221
9704
  }, ...ngDevMode ? [{ debugName: "rowsLabel" }] : []);
9222
9705
  static ɵfac = i0.ɵɵngDeclareFactory({
9223
9706
  minVersion: "12.0.0",
@@ -9502,9 +9985,6 @@ var ToolAnimationComponent = class ToolAnimationComponent2 {
9502
9985
  template: `@let toolPart = toolCallPart();
9503
9986
 
9504
9987
  @switch (settled() ? '' : toolPart.name) {
9505
- @case ('queryGraph') {
9506
- <cortex-subtle-activity activity="graph" />
9507
- }
9508
9988
  @case ('executeCode') {
9509
9989
  <cortex-subtle-activity activity="code" />
9510
9990
  }
@@ -9543,9 +10023,6 @@ i0.ɵɵngDeclareClassMetadata({
9543
10023
  template: `@let toolPart = toolCallPart();
9544
10024
 
9545
10025
  @switch (settled() ? '' : toolPart.name) {
9546
- @case ('queryGraph') {
9547
- <cortex-subtle-activity activity="graph" />
9548
- }
9549
10026
  @case ('executeCode') {
9550
10027
  <cortex-subtle-activity activity="code" />
9551
10028
  }
@@ -10242,11 +10719,9 @@ var MessageBodyComponent = class MessageBodyComponent2 {
10242
10719
  const mark = this.fold()?.get(part);
10243
10720
  if (mark?.kind !== "more")
10244
10721
  return;
10245
- const key = pluralKey(mark.count, "translate_one_more_step", "translate_n_more_steps");
10246
10722
  return {
10247
10723
  runId: mark.runId,
10248
- count: mark.count,
10249
- key
10724
+ count: mark.count
10250
10725
  };
10251
10726
  }
10252
10727
  tokenUsage = computed(() => this.metadata()?.tokenUsage, ...ngDevMode ? [{ debugName: "tokenUsage" }] : []);
@@ -10345,7 +10820,7 @@ var MessageBodyComponent = class MessageBodyComponent2 {
10345
10820
  [class.cortex-message-part--animated]="animate()"
10346
10821
  (click)="openRun.emit(folded.runId)"
10347
10822
  >
10348
- {{ folded.key | translate: { count: folded.count } }}
10823
+ {{ 'translate_more_steps' | translate: { count: folded.count } }}
10349
10824
  </button>
10350
10825
  }
10351
10826
  @if ($index === actionsAfterPart()) {
@@ -10358,7 +10833,7 @@ var MessageBodyComponent = class MessageBodyComponent2 {
10358
10833
  }
10359
10834
 
10360
10835
  @if (metadata()?.isAborted) {
10361
- <cortex-message-aborted-flag />
10836
+ <cortex-message-aborted-flag label="translate_aborted" />
10362
10837
  }
10363
10838
 
10364
10839
  @if (actionsAfterPart() === -1) {
@@ -10398,7 +10873,8 @@ var MessageBodyComponent = class MessageBodyComponent2 {
10398
10873
  {
10399
10874
  kind: "component",
10400
10875
  type: MessageAbortedFlagComponent,
10401
- selector: "cortex-message-aborted-flag"
10876
+ selector: "cortex-message-aborted-flag",
10877
+ inputs: ["label"]
10402
10878
  },
10403
10879
  {
10404
10880
  kind: "component",
@@ -10494,7 +10970,7 @@ i0.ɵɵngDeclareClassMetadata({
10494
10970
  [class.cortex-message-part--animated]="animate()"
10495
10971
  (click)="openRun.emit(folded.runId)"
10496
10972
  >
10497
- {{ folded.key | translate: { count: folded.count } }}
10973
+ {{ 'translate_more_steps' | translate: { count: folded.count } }}
10498
10974
  </button>
10499
10975
  }
10500
10976
  @if ($index === actionsAfterPart()) {
@@ -10507,7 +10983,7 @@ i0.ɵɵngDeclareClassMetadata({
10507
10983
  }
10508
10984
 
10509
10985
  @if (metadata()?.isAborted) {
10510
- <cortex-message-aborted-flag />
10986
+ <cortex-message-aborted-flag label="translate_aborted" />
10511
10987
  }
10512
10988
 
10513
10989
  @if (actionsAfterPart() === -1) {
@@ -10758,6 +11234,7 @@ var MessageComponent = class MessageComponent2 {
10758
11234
  debugMode: this.debugMode(),
10759
11235
  isStreaming: this.isStreaming()
10760
11236
  }), ...ngDevMode ? [{ debugName: "visibleParts" }] : []);
11237
+ drawsBody = computed(() => drawsMessageBody(this.visibleParts(), this.metadata()), ...ngDevMode ? [{ debugName: "drawsBody" }] : []);
10761
11238
  static ɵfac = i0.ɵɵngDeclareFactory({
10762
11239
  minVersion: "12.0.0",
10763
11240
  version: "22.2.0",
@@ -10825,7 +11302,7 @@ var MessageComponent = class MessageComponent2 {
10825
11302
  template: `<!-- A firing's message reaches the SDK as a user turn; the envelope says what it really was. -->
10826
11303
  @if (metadata()?.trigger; as firing) {
10827
11304
  <cortex-trigger-block [firing]="firing" [debugMode]="debugMode()" />
10828
- } @else if (visibleParts().length || metadata()?.attachments?.length) {
11305
+ } @else if (drawsBody()) {
10829
11306
  <cortex-message-body
10830
11307
  [message]="message()"
10831
11308
  [parts]="visibleParts()"
@@ -10883,7 +11360,7 @@ i0.ɵɵngDeclareClassMetadata({
10883
11360
  template: `<!-- A firing's message reaches the SDK as a user turn; the envelope says what it really was. -->
10884
11361
  @if (metadata()?.trigger; as firing) {
10885
11362
  <cortex-trigger-block [firing]="firing" [debugMode]="debugMode()" />
10886
- } @else if (visibleParts().length || metadata()?.attachments?.length) {
11363
+ } @else if (drawsBody()) {
10887
11364
  <cortex-message-body
10888
11365
  [message]="message()"
10889
11366
  [parts]="visibleParts()"
@@ -10969,6 +11446,7 @@ var MessageListComponent = class MessageListComponent2 {
10969
11446
  animateNewParts = signal(false, ...ngDevMode ? [{ debugName: "animateNewParts" }] : []);
10970
11447
  chatService = inject(CortexChatService);
10971
11448
  config = inject(CORTEX_CONFIG);
11449
+ failureLabel = failureLabel;
10972
11450
  openedRuns = signal(/* @__PURE__ */ new Set, ...ngDevMode ? [{ debugName: "openedRuns" }] : []);
10973
11451
  fold = toolCallFolder();
10974
11452
  foldable = computed(() => {
@@ -11139,6 +11617,14 @@ var MessageListComponent = class MessageListComponent2 {
11139
11617
  (openRun)="openRun($event)"
11140
11618
  />
11141
11619
  }
11620
+ @if (chatService.turnFailure(); as failure) {
11621
+ <cortex-message-aborted-flag [label]="failureLabel(failure)" />
11622
+ <!-- The reason may name the model provider's answer: shown only where
11623
+ the debug view is offered. -->
11624
+ @if (config().showDebugButton && failure.reason) {
11625
+ <p class="cortex-aborted-flag__reason">{{ failure.reason }}</p>
11626
+ }
11627
+ }
11142
11628
  @if (chatService.isAgentWorking() && !frontier()) {
11143
11629
  <div class="cortex-working-thinking" data-cortex-frontier>
11144
11630
  <cortex-subtle-activity activity="reasoning" />
@@ -11165,25 +11651,34 @@ var MessageListComponent = class MessageListComponent2 {
11165
11651
  </div>
11166
11652
  </div>
11167
11653
  `,
11168
- dependencies: [{
11169
- kind: "component",
11170
- type: MessageComponent,
11171
- selector: "cortex-message",
11172
- inputs: [
11173
- "message",
11174
- "debugMode",
11175
- "animate",
11176
- "fold",
11177
- "workingTurn",
11178
- "frontier"
11179
- ],
11180
- outputs: ["openRun"]
11181
- }, {
11182
- kind: "component",
11183
- type: SubtleActivityComponent,
11184
- selector: "cortex-subtle-activity",
11185
- inputs: ["activity"]
11186
- }],
11654
+ dependencies: [
11655
+ {
11656
+ kind: "component",
11657
+ type: MessageAbortedFlagComponent,
11658
+ selector: "cortex-message-aborted-flag",
11659
+ inputs: ["label"]
11660
+ },
11661
+ {
11662
+ kind: "component",
11663
+ type: MessageComponent,
11664
+ selector: "cortex-message",
11665
+ inputs: [
11666
+ "message",
11667
+ "debugMode",
11668
+ "animate",
11669
+ "fold",
11670
+ "workingTurn",
11671
+ "frontier"
11672
+ ],
11673
+ outputs: ["openRun"]
11674
+ },
11675
+ {
11676
+ kind: "component",
11677
+ type: SubtleActivityComponent,
11678
+ selector: "cortex-subtle-activity",
11679
+ inputs: ["activity"]
11680
+ }
11681
+ ],
11187
11682
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
11188
11683
  encapsulation: i0.ViewEncapsulation.None
11189
11684
  });
@@ -11199,7 +11694,11 @@ i0.ɵɵngDeclareClassMetadata({
11199
11694
  selector: "cortex-message-list",
11200
11695
  changeDetection: ChangeDetectionStrategy2.OnPush,
11201
11696
  encapsulation: ViewEncapsulation2.None,
11202
- imports: [MessageComponent, SubtleActivityComponent],
11697
+ imports: [
11698
+ MessageAbortedFlagComponent,
11699
+ MessageComponent,
11700
+ SubtleActivityComponent
11701
+ ],
11203
11702
  template: `<div class="cortex-message-list" #messagesContainer (scroll)="onScroll()">
11204
11703
  <!-- The observed element: its height is the content's, free of the scroller's padding. -->
11205
11704
  <div class="cortex-message-list__content" #messagesContent>
@@ -11214,6 +11713,14 @@ i0.ɵɵngDeclareClassMetadata({
11214
11713
  (openRun)="openRun($event)"
11215
11714
  />
11216
11715
  }
11716
+ @if (chatService.turnFailure(); as failure) {
11717
+ <cortex-message-aborted-flag [label]="failureLabel(failure)" />
11718
+ <!-- The reason may name the model provider's answer: shown only where
11719
+ the debug view is offered. -->
11720
+ @if (config().showDebugButton && failure.reason) {
11721
+ <p class="cortex-aborted-flag__reason">{{ failure.reason }}</p>
11722
+ }
11723
+ }
11217
11724
  @if (chatService.isAgentWorking() && !frontier()) {
11218
11725
  <div class="cortex-working-thinking" data-cortex-frontier>
11219
11726
  <cortex-subtle-activity activity="reasoning" />
@@ -11347,10 +11854,6 @@ i0.ɵɵngDeclareClassMetadata({
11347
11854
  var ThreadListComponent = class ThreadListComponent2 {
11348
11855
  context = input.required(...ngDevMode ? [{ debugName: "context" }] : []);
11349
11856
  locale = inject(CORTEX_LOCALE);
11350
- deleteThread(event, threadId) {
11351
- event.stopPropagation();
11352
- this.context().deleteThread(threadId);
11353
- }
11354
11857
  relativeTime(iso) {
11355
11858
  return timeLabel(iso, this.locale());
11356
11859
  }
@@ -11396,13 +11899,11 @@ var ThreadListComponent = class ThreadListComponent2 {
11396
11899
  }
11397
11900
  }
11398
11901
 
11902
+ <!-- Each row is a card holding two buttons side by side: opening the thread,
11903
+ stretched over the whole card, and deleting it. -->
11399
11904
  @for (thread of threads ?? []; track thread.id) {
11400
11905
  @let isActive = thread.id === list.selectedThreadId;
11401
- <button
11402
- (click)="list.openThread(thread)"
11403
- class="cortex-widget__thread-item"
11404
- [class.cortex-widget__thread-item--active]="isActive"
11405
- >
11906
+ <div class="cortex-widget__thread-item" [class.cortex-widget__thread-item--active]="isActive">
11406
11907
  <div class="cortex-widget__thread-icon" [class.cortex-widget__thread-icon--active]="isActive">
11407
11908
  <svg width="14" height="14" viewBox="0 0 16 16" fill="none">
11408
11909
  <!-- Rounded speech bubble with a tail, on the shared 16x16 icon grid. -->
@@ -11416,9 +11917,10 @@ var ThreadListComponent = class ThreadListComponent2 {
11416
11917
  </svg>
11417
11918
  </div>
11418
11919
 
11419
- <div class="cortex-widget__thread-info">
11920
+ <button type="button" (click)="list.openThread(thread)" class="cortex-widget__thread-info">
11420
11921
  <div class="cortex-widget__thread-title-row">
11421
11922
  <p
11923
+ dir="auto"
11422
11924
  class="cortex-widget__thread-title"
11423
11925
  [class.cortex-widget__thread-title--active]="isActive"
11424
11926
  >
@@ -11440,10 +11942,12 @@ var ThreadListComponent = class ThreadListComponent2 {
11440
11942
  @if (time) {
11441
11943
  <p class="cortex-widget__thread-time">{{ time }}</p>
11442
11944
  }
11443
- </div>
11945
+ </button>
11444
11946
 
11445
11947
  <button
11446
- (click)="deleteThread($event, thread.id)"
11948
+ type="button"
11949
+ [attr.aria-label]="'translate_delete_conversation' | translate"
11950
+ (click)="list.deleteThread(thread.id)"
11447
11951
  class="cortex-widget__thread-delete"
11448
11952
  [class.cortex-widget__thread-delete--active]="isActive"
11449
11953
  >
@@ -11473,7 +11977,7 @@ var ThreadListComponent = class ThreadListComponent2 {
11473
11977
  stroke-linejoin="round"
11474
11978
  />
11475
11979
  </svg>
11476
- </button>
11980
+ </div>
11477
11981
  }
11478
11982
 
11479
11983
  @if (threads?.length === 0) {
@@ -11551,13 +12055,11 @@ i0.ɵɵngDeclareClassMetadata({
11551
12055
  }
11552
12056
  }
11553
12057
 
12058
+ <!-- Each row is a card holding two buttons side by side: opening the thread,
12059
+ stretched over the whole card, and deleting it. -->
11554
12060
  @for (thread of threads ?? []; track thread.id) {
11555
12061
  @let isActive = thread.id === list.selectedThreadId;
11556
- <button
11557
- (click)="list.openThread(thread)"
11558
- class="cortex-widget__thread-item"
11559
- [class.cortex-widget__thread-item--active]="isActive"
11560
- >
12062
+ <div class="cortex-widget__thread-item" [class.cortex-widget__thread-item--active]="isActive">
11561
12063
  <div class="cortex-widget__thread-icon" [class.cortex-widget__thread-icon--active]="isActive">
11562
12064
  <svg width="14" height="14" viewBox="0 0 16 16" fill="none">
11563
12065
  <!-- Rounded speech bubble with a tail, on the shared 16x16 icon grid. -->
@@ -11571,9 +12073,10 @@ i0.ɵɵngDeclareClassMetadata({
11571
12073
  </svg>
11572
12074
  </div>
11573
12075
 
11574
- <div class="cortex-widget__thread-info">
12076
+ <button type="button" (click)="list.openThread(thread)" class="cortex-widget__thread-info">
11575
12077
  <div class="cortex-widget__thread-title-row">
11576
12078
  <p
12079
+ dir="auto"
11577
12080
  class="cortex-widget__thread-title"
11578
12081
  [class.cortex-widget__thread-title--active]="isActive"
11579
12082
  >
@@ -11595,10 +12098,12 @@ i0.ɵɵngDeclareClassMetadata({
11595
12098
  @if (time) {
11596
12099
  <p class="cortex-widget__thread-time">{{ time }}</p>
11597
12100
  }
11598
- </div>
12101
+ </button>
11599
12102
 
11600
12103
  <button
11601
- (click)="deleteThread($event, thread.id)"
12104
+ type="button"
12105
+ [attr.aria-label]="'translate_delete_conversation' | translate"
12106
+ (click)="list.deleteThread(thread.id)"
11602
12107
  class="cortex-widget__thread-delete"
11603
12108
  [class.cortex-widget__thread-delete--active]="isActive"
11604
12109
  >
@@ -11628,7 +12133,7 @@ i0.ɵɵngDeclareClassMetadata({
11628
12133
  stroke-linejoin="round"
11629
12134
  />
11630
12135
  </svg>
11631
- </button>
12136
+ </div>
11632
12137
  }
11633
12138
 
11634
12139
  @if (threads?.length === 0) {
@@ -11743,6 +12248,10 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
11743
12248
  descendants: true
11744
12249
  });
11745
12250
  slots = computed(() => new Map(this.slotDirectives().map((directive) => directive.entry())), ...ngDevMode ? [{ debugName: "slots" }] : []);
12251
+ unansweredNotice = computed(() => {
12252
+ const why = this.chatService.unanswered();
12253
+ return why && UNANSWERED_NOTICES[why];
12254
+ }, ...ngDevMode ? [{ debugName: "unansweredNotice" }] : []);
11746
12255
  chatHeader = computed(() => this.headerContext("chat"), ...ngDevMode ? [{ debugName: "chatHeader" }] : []);
11747
12256
  threadsHeader = computed(() => this.headerContext("threads"), ...ngDevMode ? [{ debugName: "threadsHeader" }] : []);
11748
12257
  landing = computed(() => ({
@@ -11796,7 +12305,7 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
11796
12305
  viewMode: this.viewMode(),
11797
12306
  title: this.chatService.selectedThread()?.title ?? null,
11798
12307
  agentName: localized(this.config().agentName, this.injector.get(CORTEX_LOCALE)()),
11799
- threadCount: this.threadService.threads()?.length ?? 0,
12308
+ threadCount: this.threadService.threads()?.length,
11800
12309
  isWorking: this.chatService.isAgentWorking(),
11801
12310
  debug: {
11802
12311
  shown: Boolean(this.config().showDebugButton),
@@ -11963,8 +12472,8 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
11963
12472
  <div class="cortex-widget__sidebar-backdrop" (click)="closeSidebar()"></div>
11964
12473
  </div>
11965
12474
 
11966
- <!-- The widget's own parts, each standing in for a slot the host left empty.
11967
- Marked like a host's slot so each default's context is typed the same way. -->
12475
+ <!-- The widget's own parts, each standing in for a slot the consumer left empty.
12476
+ Marked like a consumer's slot so each default's context is typed the same way. -->
11968
12477
  <ng-template cortexSlot="header" #defaultHeader let-header>
11969
12478
  <cortex-chat-header [context]="header" />
11970
12479
  </ng-template>
@@ -11983,10 +12492,15 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
11983
12492
  </ng-template>
11984
12493
 
11985
12494
  <!-- The composer, or the notice an agent that takes no messages shows instead.
11986
- Nothing until the handshake answers: a first send before it could open a
11987
- thread /chat refuses. -->
12495
+ No composer until the handshake answers: a first send before it could open
12496
+ a thread /chat refuses. Nothing while the first answer is out, then why
12497
+ Cortex has not answered. -->
11988
12498
  <ng-template #composer>
11989
- @if (chatService.capabilities()?.messages === false) {
12499
+ @if (unansweredNotice(); as notice) {
12500
+ <p class="cortex-widget__messages-disabled">
12501
+ {{ notice | translate }}
12502
+ </p>
12503
+ } @else if (chatService.capabilities()?.messages === false) {
11990
12504
  <p class="cortex-widget__messages-disabled">
11991
12505
  {{ 'translate_messages_disabled' | translate }}
11992
12506
  </p>
@@ -11995,7 +12509,7 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
11995
12509
  }
11996
12510
  </ng-template>
11997
12511
  `,
11998
- styles: ['@charset "UTF-8";:root{--cortex-color-surface: light-dark(#ffffff, #0a0a0a);--cortex-color-surface-subtle: light-dark(#f8fafc, #141414);--cortex-color-surface-muted: light-dark(#f1f5f9, #1f1f1f);--cortex-color-border: light-dark(#e2e8f0, #2e2e2e);--cortex-color-border-strong: light-dark(#cbd5e1, #444444);--cortex-color-text-heading: light-dark(#1e293b, #fafafa);--cortex-color-text-strong: light-dark(#334155, #e5e5e5);--cortex-color-text: light-dark(#475569, #d4d4d4);--cortex-color-text-secondary: light-dark(#64748b, #a3a3a3);--cortex-color-text-muted: light-dark(#94a3b8, #737373);--cortex-color-primary: light-dark(#1e293b, #fafafa);--cortex-color-primary-foreground: light-dark(#ffffff, #0a0a0a);--cortex-color-accent: light-dark(#4f46e5, #818cf8);--cortex-color-accent-surface: light-dark(#e0e7ff, #312e81);--cortex-color-link: light-dark(#2563eb, #60a5fa);--cortex-color-hover: light-dark(rgba(0, 0, 0, .05), rgba(255, 255, 255, .06));--cortex-color-user-surface: var(--cortex-color-surface-subtle);--cortex-color-user-border: var(--cortex-color-border);--cortex-color-code-text: light-dark(#334155, #e5e5e5);--cortex-color-success: light-dark(#059669, #34d399);--cortex-color-success-surface: light-dark(#ecfdf5, #064e3b);--cortex-color-success-border: light-dark(#d1fae5, #065f46);--cortex-color-danger: light-dark(#dc2626, #f87171);--cortex-color-danger-surface: light-dark(#fef2f2, #450a0a);--cortex-color-danger-border: light-dark(#fecaca, #7f1d1d);--cortex-radius: .5rem;--cortex-font-mono: var( --default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace );--cortex-font-size: .8125rem}.cortex-widget{color-scheme:light}.cortex-widget[data-cortex-theme=dark]{color-scheme:dark}.cortex-widget[data-cortex-theme=system]{color-scheme:light dark}@layer base.cortex{:where(.cortex-widget),:where(.cortex-widget) *,:where(.cortex-widget) :before,:where(.cortex-widget) :after{box-sizing:border-box;margin:0;padding:0;border:0 solid}:where(.cortex-widget){tab-size:4}:where(.cortex-widget) hr{height:0;color:inherit;border-top-width:1px}:where(.cortex-widget) :is(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}:where(.cortex-widget) a{color:inherit;text-decoration:inherit}:where(.cortex-widget) :is(b,strong){font-weight:bolder}:where(.cortex-widget) :is(code,kbd,samp,pre){font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}:where(.cortex-widget) small{font-size:80%}:where(.cortex-widget) :is(sub,sup){font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.cortex-widget) sub{bottom:-.25em}:where(.cortex-widget) sup{top:-.5em}:where(.cortex-widget) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.cortex-widget) :is(ol,ul,menu){list-style:none}:where(.cortex-widget) :is(img,svg,video,canvas,audio,iframe,embed,object){display:block;vertical-align:middle}:where(.cortex-widget) :is(img,video){max-width:100%;height:auto}:where(.cortex-widget) :is(button,input,select,optgroup,textarea){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(.cortex-widget) ::placeholder{opacity:1;color:color-mix(in oklab,currentcolor 50%,transparent)}:where(.cortex-widget) textarea{resize:vertical}}.cortex-widget .hljs{color:light-dark(#24292e,#c9d1d9);background:transparent}.cortex-widget .hljs-doctag,.cortex-widget .hljs-keyword,.cortex-widget .hljs-meta .hljs-keyword,.cortex-widget .hljs-template-tag,.cortex-widget .hljs-template-variable,.cortex-widget .hljs-type,.cortex-widget .hljs-variable.language_{color:light-dark(#d73a49,#ff7b72)}.cortex-widget .hljs-title,.cortex-widget .hljs-title.class_,.cortex-widget .hljs-title.class_.inherited__,.cortex-widget .hljs-title.function_{color:light-dark(#6f42c1,#d2a8ff)}.cortex-widget .hljs-attr,.cortex-widget .hljs-attribute,.cortex-widget .hljs-literal,.cortex-widget .hljs-meta,.cortex-widget .hljs-number,.cortex-widget .hljs-operator,.cortex-widget .hljs-selector-attr,.cortex-widget .hljs-selector-class,.cortex-widget .hljs-selector-id,.cortex-widget .hljs-variable{color:light-dark(#005cc5,#79c0ff)}.cortex-widget .hljs-meta .hljs-string,.cortex-widget .hljs-regexp,.cortex-widget .hljs-string{color:light-dark(#032f62,#a5d6ff)}.cortex-widget .hljs-built_in,.cortex-widget .hljs-symbol{color:light-dark(#e36209,#ffa657)}.cortex-widget .hljs-code,.cortex-widget .hljs-comment,.cortex-widget .hljs-formula{color:light-dark(#6a737d,#8b949e)}.cortex-widget .hljs-name,.cortex-widget .hljs-quote,.cortex-widget .hljs-selector-pseudo,.cortex-widget .hljs-selector-tag{color:light-dark(#22863a,#7ee787)}.cortex-widget .hljs-subst{color:light-dark(#24292e,#c9d1d9)}.cortex-widget .hljs-section{color:light-dark(#005cc5,#1f6feb);font-weight:700}.cortex-widget .hljs-bullet{color:light-dark(#735c0f,#f2cc60)}.cortex-widget .hljs-emphasis{font-style:italic}.cortex-widget .hljs-strong{font-weight:700}.cortex-widget .hljs-addition{color:light-dark(#22863a,#aff5b4);background-color:light-dark(#f0fff4,#033a16)}.cortex-widget .hljs-deletion{color:light-dark(#b31d28,#ffdcd7);background-color:light-dark(#ffeef0,#67060c)}.cortex-widget{display:block}.cortex-widget__container{width:100%;height:100%;position:relative;overflow:hidden}.cortex-widget__screen{position:absolute;inset:0;display:flex;flex-direction:column;transition:transform .3s ease-out}.cortex-widget__screen--active{transform:translate(0)}.cortex-widget__screen--left{transform:translate(-100%)}[dir=rtl] .cortex-widget__screen--left,.cortex-widget__screen--right{transform:translate(100%)}[dir=rtl] .cortex-widget__screen--right{transform:translate(-100%)}@keyframes cortex-skeleton-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.cortex-skeleton{background:linear-gradient(90deg,var(--cortex-color-border) 0%,var(--cortex-color-surface-muted) 40%,var(--cortex-color-border) 80%);background-size:200% 100%;animation:cortex-skeleton-shimmer 1.8s ease-in-out infinite;border-radius:6px}.cortex-widget__messages-skeleton{flex:1;overflow:hidden;padding:1rem;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel{width:100%;display:flex;flex-direction:column}.cortex-widget__msg-skel--user{align-items:flex-end}.cortex-widget__msg-skel--assistant{align-items:flex-start}.cortex-widget__msg-skel-bubble{max-width:80%;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel-bubble--user{padding:.75rem 1rem;border-radius:calc(var(--cortex-radius) * 2);border-end-end-radius:0;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-widget__msg-skel-line{height:.75rem;max-width:100%}.cortex-widget__messages{flex:1;overflow:hidden}.cortex-widget__container--full{display:flex;flex-direction:row}.cortex-widget__container--full>.cortex-widget__screen{position:relative;inset:auto;transition:none}.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--active,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--left,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--right{transform:none}.cortex-widget__container--full>.cortex-widget__screen:first-child{width:280px;min-width:280px;flex-shrink:0;border-right:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{border-right:0;border-left:1px solid var(--cortex-color-border)}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__back-btn,.cortex-widget__container--full .cortex-widget__history-btn{display:none}@media(min-width:769px){.cortex-widget__container--full>.cortex-widget__screen:nth-child(2) .cortex-widget__new-btn{display:none}}.cortex-widget__container--full .cortex-widget__chat-title{font-size:var(--cortex-font-size-header, .875rem)}.cortex-widget__container--full .cortex-widget__chat-header{background:var(--cortex-color-surface)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1.5rem max(2rem,(100% - 48rem) / 2)}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem max(2rem,(100% - 48rem) / 2) 1.25rem}@media(max-width:768px){.cortex-widget__container--full>.cortex-widget__screen:first-child{position:fixed;inset:0;width:280px;min-width:280px;z-index:110;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{transform:translate(100%);border-left:1px solid var(--cortex-color-border);border-right:0}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-secondary)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:hover{color:var(--cortex-color-text-strong);background:var(--cortex-color-surface-muted)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:active{background:var(--cortex-color-border)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem}}@media(max-width:768px){.cortex-widget__container--full.cortex-widget__container--sidebar-open>.cortex-widget__screen:first-child{transform:translate(0)}.cortex-widget__container--full.cortex-widget__container--sidebar-open .cortex-widget__sidebar-backdrop{display:block;position:fixed;inset:0;z-index:100;background:#0f172a59;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:cortex-sidebar-backdrop-in .2s ease-out both}}@keyframes cortex-sidebar-backdrop-in{0%{opacity:0}to{opacity:1}}.cortex-widget__chat-header{flex-shrink:0;height:3rem;padding:0 1rem;display:flex;align-items:center;gap:.75rem;border-bottom:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__header-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__header-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-surface-muted)}[dir=rtl] .cortex-widget__back-icon{transform:rotate(180deg)}.cortex-widget__chat-title-wrap{min-width:0;flex:1}.cortex-widget__chat-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, var(--cortex-font-size));font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__debug-btn{flex-shrink:0;font-size:.6875rem;font-weight:500;padding:.25rem .625rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__debug-btn--on{background:light-dark(#fef3c7,#78350f);color:light-dark(#d97706,#fbbf24)}.cortex-widget__debug-btn--on:hover{background:light-dark(#fde68a,#92400e)}.cortex-widget__debug-btn--off{background:var(--cortex-color-surface-muted);color:var(--cortex-color-text-muted)}.cortex-widget__debug-btn--off:hover{background:var(--cortex-color-border)}.cortex-widget__landing{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:1.25rem;text-align:center}.cortex-widget__landing .cortex-widget__landing-composer{max-width:26rem}.cortex-widget__landing-composer{width:100%}.cortex-widget__landing-composer .cortex-widget__input-area{padding:1rem 0 0;border-top:0;background:transparent}.cortex-widget__landing-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent);display:flex;align-items:center;justify-content:center;margin-bottom:.875rem}[dir=rtl] .cortex-widget__landing-icon{transform:scaleX(-1)}.cortex-widget__landing-greeting{font-family:var(--cortex-font-display, inherit);font-size:1.0625rem;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading);margin:0}.cortex-widget__landing-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;margin-top:.875rem}.cortex-widget__landing-chip{border:1px solid var(--cortex-color-border);border-radius:999px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);font-size:.75rem;font-weight:500;padding:.375rem .75rem;cursor:pointer;transition:border-color .15s,color .15s}.cortex-widget__landing-chip:hover{border-color:var(--cortex-color-accent);color:var(--cortex-color-accent)}.cortex-widget__landing-recent{width:100%;max-width:26rem;margin-top:1rem;display:flex;flex-direction:column}.cortex-widget__landing-recent-item{display:flex;align-items:center;gap:.75rem;padding:.4375rem .625rem;border:0;border-radius:calc(var(--cortex-radius) * .75);background:transparent;cursor:pointer;transition:background-color .15s}.cortex-widget__landing-recent-item:hover{background:var(--cortex-color-hover)}.cortex-widget__landing-recent-title{flex:1;min-width:0;text-align:start;font-size:var(--cortex-font-size);font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__landing-recent-time{flex-shrink:0;font-size:.6875rem;color:var(--cortex-color-text-muted);margin:0}cortex-chat-composer,cortex-message-tool-call-outcome,cortex-llm-usage-chips{display:contents}.cortex-widget__input-area{flex-shrink:0;padding:.75rem;background:var(--cortex-color-surface);border-top:1px solid var(--cortex-color-border)}.cortex-widget__input-box{display:flex;align-items:flex-end;gap:.5rem;border-radius:calc(var(--cortex-radius) * 1.5);border:1px solid var(--cortex-color-border);padding:.375rem;background:color-mix(in oklab,var(--cortex-color-surface-subtle) 45%,var(--cortex-color-surface));transition:border-color .15s,background-color .15s}.cortex-widget__input-box--enabled:focus-within{border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface)}.cortex-widget__input-box--dragging{border-color:var(--cortex-color-text-heading);border-style:dashed;background:var(--cortex-color-surface-muted)}.cortex-widget__textarea,.cortex-widget__textarea:focus,.cortex-widget__textarea:focus-visible,.cortex-widget__textarea:disabled{background:transparent;border:0;outline:none;box-shadow:none}.cortex-widget__textarea{flex:1;resize:none;font-size:var(--cortex-font-size-message, var(--cortex-font-size));padding:.375rem .5rem;min-height:28px;max-height:calc(5.5 * var(--cortex-font-size-message, var(--cortex-font-size)) + .75rem);overflow-y:auto;line-height:1.375;color:var(--cortex-color-text-strong)}.cortex-widget__textarea::placeholder{color:var(--cortex-color-text-muted)}.cortex-widget__textarea--disabled{color:var(--cortex-color-text-muted);cursor:not-allowed}.cortex-widget__textarea:disabled{cursor:not-allowed}.cortex-widget__input-actions{flex-shrink:0;display:flex;align-items:center;gap:.375rem}@keyframes cortex-stop-pulse-ring{0%{opacity:.45;transform:scale(1)}50%{opacity:.15;transform:scale(1.12)}to{opacity:.45;transform:scale(1)}}@keyframes cortex-stop-fade-in{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}.cortex-stop-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;background:var(--cortex-color-danger);color:#fff;border:0;animation:cortex-stop-fade-in .2s ease-out both;transition:background .15s ease}.cortex-stop-btn:hover{background:color-mix(in oklab,var(--cortex-color-danger) 85%,black)}.cortex-stop-btn:active{transform:scale(.92)}.cortex-stop-btn__ring{position:absolute;inset:0;border-radius:var(--cortex-radius);background:var(--cortex-color-danger);animation:cortex-stop-pulse-ring 2s ease-in-out infinite;pointer-events:none}.cortex-stop-btn__icon{position:relative;z-index:1}.cortex-widget__attach-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__attach-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-widget__file-input{display:none}.cortex-widget__send-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;border:0;transition:background-color .15s;cursor:default}.cortex-widget__send-btn--empty{background:var(--cortex-color-send-empty, transparent);color:var(--cortex-color-send-empty-text, var(--cortex-color-text-muted))}.cortex-widget__send-btn--ready{background:var(--cortex-color-primary);color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-widget__send-btn--ready:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}[dir=rtl] .cortex-widget__send-icon{transform:rotate(180deg)}.cortex-widget__threads-header{flex-shrink:0;padding:1.25rem 1.25rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-widget__threads-header .cortex-widget__new-btn{margin-inline-start:auto}.cortex-widget__threads-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, .9375rem);font-weight:600;color:var(--cortex-color-text-heading);letter-spacing:-.01em;margin:0}.cortex-widget__threads-count{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0}.cortex-widget__new-chat-btn{display:inline-flex;align-items:center;gap:.375rem;font-size:.75rem;font-weight:500;color:var(--cortex-color-primary-foreground);background:var(--cortex-color-primary);padding:.375rem .75rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__new-chat-btn:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}.cortex-widget__new-chat-btn:active{background:var(--cortex-color-primary)}.cortex-widget__new-chat-btn--empty-state{margin-top:.75rem}.cortex-widget__threads-list{flex:1;overflow-y:auto;padding:0 .75rem .75rem}.cortex-widget__thread-skeleton{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.375rem;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__thread-skeleton-icon{flex-shrink:0;width:2rem;height:2rem}.cortex-widget__thread-skeleton-lines{flex:1;display:flex;flex-direction:column;gap:.375rem}.cortex-widget__thread-skeleton-line{height:.875rem}.cortex-widget__thread-item{width:100%;text-align:start;padding:.75rem;border-radius:var(--cortex-radius);display:flex;align-items:center;gap:.75rem;transition:background-color .15s,border-color .15s;cursor:pointer;margin-bottom:.375rem;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface);color:var(--cortex-color-text)}.cortex-widget__thread-item:hover{background:var(--cortex-color-surface-muted);border-color:var(--cortex-color-border-strong)}.cortex-widget__thread-item:active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border))}.cortex-widget__thread-item--active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border));border-color:var(--cortex-color-border-strong);color:var(--cortex-color-text-heading)}.cortex-widget__thread-item--active:hover{background:var(--cortex-color-border)}.cortex-widget__thread-item--active:active{background:color-mix(in oklab,var(--cortex-color-border) 50%,var(--cortex-color-border-strong))}.cortex-widget__thread-icon{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;font-size:.6875rem;font-weight:600;background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}[dir=rtl] .cortex-widget__thread-icon{transform:scaleX(-1)}.cortex-widget__thread-icon--active{background:color-mix(in oklab,var(--cortex-color-accent-surface) 85%,var(--cortex-color-accent))}.cortex-widget__thread-info{min-width:0;flex:1}.cortex-widget__thread-title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-widget__thread-title{font-size:var(--cortex-font-size);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.25;margin:0;color:var(--cortex-color-text-strong)}.cortex-widget__thread-title--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-widget__thread-time{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-widget__thread-running{flex-shrink:0;display:inline-flex;align-items:center;gap:.3125rem;padding:.2rem .45rem;border-radius:999px;background:var(--cortex-color-success-surface);color:var(--cortex-color-success);font-size:.625rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.cortex-widget__thread-running-dot{width:.375rem;height:.375rem;border-radius:999px;background:currentColor;box-shadow:0 0 .45rem currentColor;animation:cortex-thread-running-pulse 1.4s ease-in-out infinite}@keyframes cortex-thread-running-pulse{0%,to{opacity:.45;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.cortex-widget__thread-delete{flex-shrink:0;opacity:0;width:1.75rem;height:1.75rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .15s;background:transparent;border:0;color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-delete{opacity:1}.cortex-widget__thread-delete:hover{background:var(--cortex-color-border)}.cortex-widget__thread-delete--active{color:var(--cortex-color-text-secondary)}.cortex-widget__thread-delete--active:hover{color:var(--cortex-color-text)}.cortex-widget__thread-arrow{flex-shrink:0;transition:color .15s;color:var(--cortex-color-border-strong)}[dir=rtl] .cortex-widget__thread-arrow{transform:rotate(180deg)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow{color:var(--cortex-color-text-muted)}.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-secondary)}.cortex-widget__threads-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 0;text-align:center}.cortex-widget__threads-empty-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);display:flex;align-items:center;justify-content:center;margin-bottom:.75rem}.cortex-widget__threads-empty-svg{color:var(--cortex-color-accent)}.cortex-widget__threads-empty-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size);color:var(--cortex-color-text-muted);font-weight:500;margin:0}.cortex-widget__threads-empty-subtitle{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.25rem;margin-bottom:0}.cortex-widget__sidebar-toggle-btn,.cortex-widget__sidebar-backdrop{display:none}.cortex-message-list{height:100%;overflow-y:auto;overflow-x:hidden;width:100%;padding:1rem}.cortex-message-list__content{position:relative;display:flex;flex-direction:column;gap:.5rem}.cortex-message-list__content--settling{animation:cortex-content-settle .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-content-settle{0%{translate:0 var(--cortex-slide)}}.cortex-widget__screen>.cortex-send-flight{position:absolute;z-index:2;margin:0;max-width:none;pointer-events:none;animation:cortex-send-fade 80ms linear both,cortex-send-fly .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-send-fade{0%{opacity:0}}@keyframes cortex-send-fly{0%{translate:var(--cortex-fly-x) var(--cortex-fly-y)}}.cortex-working-thinking{padding-inline-start:2rem;--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-working-thinking{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}.cortex-working-avatar{position:absolute;top:0;inset-inline-start:0;z-index:1;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:9999px;background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground);translate:0 var(--cortex-avatar-y, 0);visibility:hidden;pointer-events:none}.cortex-working-avatar svg{width:.875rem;height:.875rem}.cortex-working-avatar--shown{visibility:visible;transition:translate .42s cubic-bezier(.76,0,.24,1);animation:cortex-avatar-in .7s cubic-bezier(.16,1,.3,1) both}.cortex-working-avatar--leaving{animation:cortex-avatar-out .36s cubic-bezier(.5,0,.75,0) .12s both}.cortex-working-avatar__ring{position:absolute;inset:-.25rem;border-radius:9999px;border:1.5px solid color-mix(in oklab,var(--cortex-color-accent) 18%,transparent);border-top-color:var(--cortex-color-accent);border-right-color:color-mix(in oklab,var(--cortex-color-accent) 45%,transparent)}.cortex-working-avatar--shown .cortex-working-avatar__ring{animation:cortex-tool-spin 1s linear infinite}.cortex-working-avatar--leaving .cortex-working-avatar__ring{animation:cortex-avatar-ring-out .22s ease-out both}@keyframes cortex-avatar-in{0%{opacity:0;transform:translateY(2.5rem) scale(.7)}}@keyframes cortex-avatar-out{to{opacity:0;transform:scale(.4)}}@keyframes cortex-avatar-ring-out{to{opacity:0}}.cortex-message{min-width:0;transition:margin-block-start .42s cubic-bezier(.76,0,.24,1)}.cortex-message:empty{display:none}.cortex-message:has(.cortex-message-part--folded):not(:has(.cortex-message-part:not(.cortex-message-part--folded))){margin-block-start:-.5rem;transition-delay:.6s}.cortex-text-bubble--assistant,.cortex-subtle-activity,.cortex-tool-pill,.cortex-tool-pill .cortex-tool-pill__icon{transition:translate .42s cubic-bezier(.76,0,.24,1) .16s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity,.cortex-message--working-turn .cortex-tool-pill,.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{transition-delay:0s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity{translate:2rem}[dir=rtl] .cortex-message--working-turn .cortex-text-bubble--assistant,[dir=rtl] .cortex-message--working-turn .cortex-subtle-activity{translate:-2rem}.cortex-message--working-turn .cortex-tool-pill{translate:.875rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill{translate:-.875rem}.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:-.5rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:.5rem}.cortex-message-parts{width:100%;display:flex;flex-direction:column;gap:.5rem}.cortex-message-actions{display:flex;align-items:center;gap:.375rem;margin-top:-.25rem}.cortex-message-actions--user{justify-content:flex-end}.cortex-message-actions__time{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:0;transition:opacity .15s ease}.cortex-message-actions:not(:has(.cortex-copy-btn)) .cortex-message-actions__time{opacity:1}.cortex-message:hover .cortex-message-actions .cortex-copy-btn__button,.cortex-message:hover .cortex-message-actions .cortex-message-actions__time,.cortex-message-actions:focus-within .cortex-copy-btn__button,.cortex-message-actions:focus-within .cortex-message-actions__time{opacity:1}.cortex-message-debug-zone{display:flex;flex-direction:column;gap:.25rem;padding-top:.375rem;margin-top:.125rem;border-top:1px dashed var(--cortex-color-border)}.cortex-message-part{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;min-width:0;transition:grid-template-rows .42s cubic-bezier(.76,0,.24,1),margin-block-end .42s cubic-bezier(.76,0,.24,1),opacity .3s ease,visibility 0s,overflow 0s .42s allow-discrete}.cortex-message-part>*{min-height:0}.cortex-message-part:empty{display:none}.cortex-message-part--folded{grid-template-rows:0fr;margin-block-end:-.5rem;opacity:0;overflow:clip;visibility:hidden;transition-delay:.6s,.6s,.6s,1.02s,0s}[data-cortex-frontier] .cortex-tool-pill__spinner{visibility:hidden}[data-cortex-frontier] .cortex-subtle-activity__dots{display:none}.cortex-message-part--animated{--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-message-part--animated{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}@keyframes cortex-part-reveal{0%{opacity:0;transform:translate(var(--cortex-reveal-from));filter:blur(5px);-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-start) 0;mask-position:var(--cortex-reveal-start) 0}40%{opacity:1}to{transform:none;filter:none;-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-end) 0;mask-position:var(--cortex-reveal-end) 0}}.cortex-unhandled-type{text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-text-part{width:100%;display:flex;flex-direction:column}.cortex-text-part--user{align-items:flex-end}.cortex-text-bubble{min-width:0;overflow-wrap:anywhere;font-size:var(--cortex-font-size-message, var(--cortex-font-size));line-height:1.625;color:var(--cortex-color-text-strong)}.cortex-text-bubble--assistant{width:calc(100% - 2rem)}.cortex-text-bubble--user{max-width:80%;padding:.75rem 1rem;border-radius:calc(var(--cortex-radius) * 2);border-end-end-radius:0;border:1px solid var(--cortex-color-user-border);background:var(--cortex-color-user-surface)}.cortex-text-bubble h1,.cortex-text-bubble h2,.cortex-text-bubble h3,.cortex-text-bubble h4,.cortex-text-bubble h5,.cortex-text-bubble h6{margin-top:1.25em;margin-bottom:.5em;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading)}.cortex-text-bubble h1:first-child,.cortex-text-bubble h2:first-child,.cortex-text-bubble h3:first-child,.cortex-text-bubble h4:first-child,.cortex-text-bubble h5:first-child,.cortex-text-bubble h6:first-child{margin-top:0}.cortex-text-bubble h1{font-size:1.25em}.cortex-text-bubble h2{font-size:1.125em}.cortex-text-bubble h3{font-size:1em}.cortex-text-bubble p{margin-top:.75em;margin-bottom:.75em}.cortex-text-bubble p:first-child{margin-top:0}.cortex-text-bubble p:last-child{margin-bottom:0}.cortex-text-bubble ul,.cortex-text-bubble ol{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1.5em}.cortex-text-bubble ul{list-style-type:disc}.cortex-text-bubble ol{list-style-type:decimal}.cortex-text-bubble li{margin-top:.25em;margin-bottom:.25em}.cortex-text-bubble code{font-family:var(--cortex-font-mono);font-size:.875em;background:var(--cortex-color-border);padding:.125em .375em;border-radius:calc(var(--cortex-radius) * .5)}.cortex-text-bubble pre{margin-top:.75em;margin-bottom:.75em;padding:.75em 1em;background:var(--cortex-color-code-surface, color-mix(in oklab, var(--cortex-color-text-heading) 8%, transparent));border-radius:var(--cortex-radius);max-width:100%;overflow-x:auto;font-size:.8125em;line-height:1.6}.cortex-text-bubble pre code{background:transparent;padding:0;color:var(--cortex-color-code-text)}.cortex-text-bubble blockquote{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1em;border-inline-start:3px solid var(--cortex-color-border-strong);color:var(--cortex-color-text-secondary);font-style:italic}.cortex-text-bubble a{color:var(--cortex-color-link);text-decoration:underline}.cortex-text-bubble a:hover{color:color-mix(in oklab,var(--cortex-color-link) 80%,var(--cortex-color-text-heading))}.cortex-text-bubble table{width:100%;border-collapse:collapse;margin-top:.75em;margin-bottom:.75em;font-size:.875em}.cortex-text-bubble th,.cortex-text-bubble td{border:1px solid var(--cortex-color-border);padding:.375em .75em;text-align:start}.cortex-text-bubble th{background:var(--cortex-color-surface-subtle);font-weight:600}.cortex-text-bubble hr{margin-top:1.5em;margin-bottom:1.5em;border:none;border-top:1px solid var(--cortex-color-border)}.cortex-text-bubble img{max-width:100%;height:auto;border-radius:calc(var(--cortex-radius) * .75)}.cortex-stream-fade{animation:cortex-stream-fade .3s ease-out}@keyframes cortex-stream-fade{0%{opacity:0}}.cortex-expandable{display:block;position:relative}.cortex-expandable__content{isolation:isolate}.cortex-expandable__toolbar{position:absolute;top:.375rem;inset-inline-end:.375rem;z-index:1;display:flex;gap:.125rem;padding:.125rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);box-shadow:0 1px 3px #00000014;opacity:0;transition:opacity .15s}.cortex-expandable:hover>.cortex-expandable__toolbar,.cortex-expandable__toolbar:has(:focus-visible){opacity:1}@media(hover:none){.cortex-expandable__toolbar{position:static;width:fit-content;margin:0 0 .25rem;margin-inline-start:auto;opacity:1}}.cortex-expandable__action{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;width:1.75rem;height:1.75rem;color:var(--cortex-color-text-muted)}.cortex-expandable__action:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-expandable__dialog{width:fit-content;min-width:min(24rem,100vw - 2rem);max-width:calc(100vw - 2rem);max-height:calc(100dvh - 2rem);margin:auto;padding:0;overflow:hidden;border:1px solid var(--cortex-color-border);border-radius:calc(var(--cortex-radius) * 1.5);background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 24px 64px #0000003d}.cortex-expandable__dialog[open]{display:flex;flex-direction:column;animation:cortex-expandable-in .18s ease-out}.cortex-expandable__dialog::backdrop{background:#00000073;animation:cortex-expandable-backdrop-in .18s ease-out}.cortex-expandable__head{display:flex;align-items:center;gap:.125rem;padding-block:.375rem;padding-inline:1rem .375rem;border-bottom:1px solid var(--cortex-color-border)}.cortex-expandable__title{flex:1;min-width:0;margin-inline-end:.5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;font-weight:600;color:var(--cortex-color-text-heading)}.cortex-expandable__body{min-height:0;overflow:auto;overscroll-behavior:contain}@keyframes cortex-expandable-in{0%{opacity:0;transform:translateY(.5rem) scale(.98)}}@keyframes cortex-expandable-backdrop-in{0%{opacity:0}}.cortex-media-block{display:block;width:40rem;max-width:100%;margin:.75em 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-media-block__head{display:flex}.cortex-media-block__head[hidden]{display:none}.cortex-media-block__head{align-items:center;justify-content:space-between;gap:.5rem;padding:.25rem .5rem .25rem .75rem;background:var(--cortex-color-surface-subtle);border-bottom:1px solid var(--cortex-color-border);font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-media-block__lang{font-family:var(--cortex-font-mono)}.cortex-media-block__pending{display:inline-flex;align-items:center;gap:.375rem}.cortex-media-block__pending:before{content:"";width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-media-block__actions{display:inline-flex;align-items:center;gap:.125rem}.cortex-media-block__action{background:transparent;border:0;padding:.125rem .375rem;border-radius:calc(var(--cortex-radius) * .5);font:inherit;color:inherit;cursor:pointer}.cortex-media-block__action:hover,.cortex-media-block__action[aria-pressed=true]{background:var(--cortex-color-hover);color:var(--cortex-color-text-strong)}.cortex-media-block__body{display:block;padding:.75rem}.cortex-media-block__body[hidden]{display:none}.cortex-media-block__body{min-height:6rem;overflow-x:auto}.cortex-media-block__body svg{display:block;max-width:100%;height:auto;direction:ltr}.cortex-media-block__body svg text{unicode-bidi:plaintext}.cortex-media-block__body>div>svg{margin-inline:auto}.cortex-media-block__body--map{padding:0;height:18rem}.cortex-media-block__body--map>div{height:100%}.cortex-media-block__body--report{padding:1rem}.cortex-expandable__body .cortex-media-block__body{width:min(72rem,100vw - 2rem - 2px)}.cortex-expandable__body .cortex-media-block__body:not(.cortex-media-block__body--map,.cortex-media-block__body--report)>div{display:grid}.cortex-expandable__body .cortex-media-block__body:not(.cortex-media-block__body--map,.cortex-media-block__body--report) svg{width:100%;max-width:none!important;max-height:calc(100dvh - 6.5rem)}.cortex-expandable__body .cortex-media-block__body--map{height:min(48rem,100dvh - 5rem)}.cortex-expandable:has(>.cortex-expandable__content>.cortex-media-block__body--map)>.cortex-expandable__toolbar{right:.375rem;left:auto}.cortex-media-block__error{margin:0;font-size:.8125rem;color:var(--cortex-color-danger)}.cortex-media-block .cortex-media-block__source{margin:0;padding:.75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.5;white-space:pre;overflow-x:auto;color:var(--cortex-color-text)}.cortex-attachment-image{margin:.75em 0}.cortex-attachment-image .cortex-expandable{width:fit-content;max-width:100%}.cortex-attachment-image .cortex-expandable__content img{display:block;max-width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border)}.cortex-expandable__body .cortex-attachment-image__expanded{display:block;max-width:calc(100vw - 2rem - 2px);max-height:calc(100dvh - 5rem);margin:auto;border-radius:0}.cortex-attachment-image__caption{margin:.25rem 0 0;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-table-block{display:block;margin:.75em 0}.cortex-table-block th{white-space:nowrap}.cortex-table-block td{max-width:20rem}.cortex-table-block table{margin:0}.cortex-table-block .cortex-expandable{width:fit-content;max-width:100%}.cortex-table-block__expanded{padding:1rem}.cortex-table-block__expanded td{max-width:40rem}.cortex-reasoning-details{width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-reasoning-details__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.75rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-reasoning-details__summary::-webkit-details-marker{display:none}.cortex-reasoning-details__header{display:flex;align-items:center;gap:.5rem;min-width:0;flex:1}.cortex-reasoning-details__icon{display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}.cortex-reasoning-details__title-group{min-width:0}.cortex-reasoning-details__title-row{display:flex;align-items:center;gap:.5rem}.cortex-reasoning-details__title{font-weight:500;color:var(--cortex-color-text-strong);font-size:.875rem}.cortex-reasoning-details__badge{display:inline-flex;align-items:center;border-radius:calc(var(--cortex-radius) * .5);padding:.125rem .375rem;font-size:.6875rem;font-weight:500}.cortex-reasoning-details__badge--streaming{background:light-dark(#fef3c7,#78350f);color:light-dark(#b45309,#fcd34d)}.cortex-reasoning-details__badge--done{background:var(--cortex-color-success-border);color:var(--cortex-color-success)}.cortex-reasoning-details__chevron{margin-inline-start:auto;display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary>.cortex-reasoning-details__chevron{transform:rotate(180deg)}.cortex-reasoning-details__body{padding:0 1rem 1rem}.cortex-reasoning-details__content{margin-top:.25rem;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-surface);border:1px solid var(--cortex-color-border);padding:.75rem}.cortex-reasoning-details__pre{margin:0;white-space:pre-wrap;overflow-wrap:break-word;font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.625;color:var(--cortex-color-text-strong)}@keyframes cortex-aborted-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.cortex-aborted-flag{display:flex;align-items:center;gap:.625rem;padding:.25rem 0;animation:cortex-aborted-fade-in .3s ease-out both;-webkit-user-select:none;user-select:none}.cortex-aborted-flag__line{flex:1;height:1px;background:repeating-linear-gradient(90deg,#e2a36f 0px,#e2a36f 4px,transparent 4px,transparent 8px);opacity:.5}.cortex-aborted-flag__label{display:inline-flex;align-items:center;gap:.3125rem;font-family:var(--cortex-font-mono);font-size:.625rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:light-dark(#c2824a,#e2a36f)}.cortex-aborted-flag__icon{color:light-dark(#c2824a,#e2a36f);flex-shrink:0}.cortex-trigger-block{display:inline-flex;width:fit-content;padding:.375rem .75rem;border-radius:999px;background:var(--cortex-color-accent-surface);color:var(--cortex-color-text-strong);font-size:.75rem}.cortex-trigger-block__head{display:flex;align-items:center;gap:.5rem}.cortex-trigger-block__icon{flex-shrink:0;color:var(--cortex-color-accent)}.cortex-trigger-block__name{font-family:var(--cortex-font-mono);font-weight:600}.cortex-trigger-block__time{color:var(--cortex-color-text-secondary);font-size:.6875rem}.cortex-trigger-block--debug{display:flex;flex-direction:column;width:auto;gap:.375rem;padding:.5rem .75rem;border:1px dashed var(--cortex-color-border-strong);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.6875rem}.cortex-trigger-block--debug .cortex-trigger-block__head{font-family:var(--cortex-font-mono);letter-spacing:.04em;text-transform:uppercase;color:var(--cortex-color-text-secondary)}.cortex-trigger-block--debug .cortex-trigger-block__name{color:var(--cortex-color-text-strong)}.cortex-trigger-block--debug .cortex-trigger-block__time{margin-inline-start:auto;font-size:inherit;text-transform:none;letter-spacing:0}.cortex-trigger-block__payload{font-size:.75rem}.cortex-trigger-block__payload>summary{cursor:pointer;color:var(--cortex-color-text-secondary);-webkit-user-select:none;user-select:none}.cortex-trigger-block__payload[open]>summary{margin-bottom:.25rem}.cortex-widget__messages-disabled{padding:.75rem 1rem;text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-message-attachments{display:flex;flex-wrap:wrap;gap:.375rem}.cortex-message-attachments--user{justify-content:flex-end}.cortex-message-attachment{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:.25rem .5rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong);cursor:pointer;transition:background .15s}.cortex-message-attachment:hover{background:var(--cortex-color-surface-muted)}.cortex-message-attachment__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-message-attachment__icon,.cortex-message-attachment__dl-icon{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-debug-tool{--_accent: var(--cortex-color-border-strong);position:relative;width:100%;border-radius:10px;background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-debug-tool:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var(--_accent);z-index:1;transition:background .2s}.cortex-debug-tool[data-state=complete]{--_accent: var(--cortex-color-success)}.cortex-debug-tool[data-state=error]{--_accent: var(--cortex-color-danger)}.cortex-debug-tool[data-state=awaiting-input],.cortex-debug-tool[data-state=input-streaming],.cortex-debug-tool[data-state=input-complete]{--_accent: light-dark(#d97706, #fbbf24)}.cortex-debug-tool[data-state=approval-requested],.cortex-debug-tool[data-state=approval-responded]{--_accent: light-dark(#7c3aed, #a78bfa)}.cortex-debug-tool__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.625rem .875rem .625rem 1.125rem}.cortex-debug-tool__summary::-webkit-details-marker{display:none}.cortex-debug-tool__header{display:flex;align-items:flex-start;gap:.75rem}.cortex-debug-tool__meta{flex:1;min-width:0}.cortex-debug-tool__title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-debug-tool__name{font-weight:600;font-size:.8125rem;color:var(--cortex-color-text-heading);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.01em}.cortex-debug-tool__id-row{margin-top:2px;font-size:.625rem;color:var(--cortex-color-text-muted);font-family:ui-monospace,SF Mono,Cascadia Code,monospace;word-break:break-all}.cortex-debug-tool__actions{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.cortex-debug-tool__state{display:inline-flex;align-items:center;gap:5px;font-size:.6875rem;font-weight:500;padding:2px 8px;border-radius:4px;white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__state--success{color:var(--cortex-color-success);background:var(--cortex-color-success-surface)}.cortex-debug-tool__state--error{color:var(--cortex-color-danger);background:light-dark(#fef2f2,#450a0a)}.cortex-debug-tool__state--approval{color:light-dark(#7c3aed,#a78bfa);background:light-dark(#f5f3ff,#2e1065)}.cortex-debug-tool__state--pending{color:light-dark(#b45309,#fcd34d);background:light-dark(#fffbeb,#451a03)}.cortex-debug-tool__pulse{width:6px;height:6px;border-radius:50%;background:light-dark(#d97706,#fbbf24);animation:dbg-pulse 2s ease-in-out infinite}.cortex-debug-tool__pulse--violet{background:#8b5cf6}@keyframes dbg-pulse{0%,to{opacity:1}50%{opacity:.3}}.cortex-debug-tool__chevron{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:4px;color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary .cortex-debug-tool__chevron{transform:rotate(180deg)}.cortex-debug-tool__body{padding:0 .875rem .75rem 1.125rem}.cortex-debug-tool__section:not(:first-child){border-top:1px solid var(--cortex-color-border);padding-top:.625rem;margin-top:.625rem}.cortex-debug-tool__section-bar{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-debug-tool__section-label{font-size:.625rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-muted);font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__section-label--success{color:var(--cortex-color-success)}.cortex-debug-tool__section-label--error{color:var(--cortex-color-danger)}.cortex-debug-tool__section-label--approval{color:light-dark(#7c3aed,#a78bfa)}.cortex-debug-tool__section-lang{font-size:.5625rem;color:var(--cortex-color-border-strong);font-family:ui-monospace,SF Mono,monospace;text-transform:lowercase}.cortex-debug-tool__pre{margin:0;max-height:20rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre;overflow-wrap:break-word}.cortex-debug-tool__tree{max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__error-pre{margin:0;max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:light-dark(#fef2f2,#450a0a);color:light-dark(#991b1b,#fca5a5);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre-wrap;word-break:break-word}.cortex-debug-tool__message{padding:.5rem .75rem;font-size:.75rem;color:var(--cortex-color-text-secondary);border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__message--approval{color:light-dark(#5b21b6,#c4b5fd);background:light-dark(#faf5ff,#3b0764)}.cortex-debug-tool__section--success .cortex-debug-tool__tree{background:light-dark(#f0fdf4,#052e16)}.cortex-debug-tool__section--error .cortex-debug-tool__tree{background:light-dark(#fef2f2,#450a0a)}.cortex-tool-call-animated{display:block}.cortex-tool-pill{display:inline-flex;align-items:center;gap:.375rem;padding:.25rem 0;max-width:100%}.cortex-tool-pill__icon{position:relative;width:.75rem;height:.75rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--cortex-color-text-muted)}.cortex-tool-pill__spinner{position:absolute;width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;opacity:0;transition:opacity .2s}.cortex-tool-pill__spinner--visible{opacity:1;animation:cortex-tool-spin .8s linear infinite}@keyframes cortex-tool-spin{to{transform:rotate(360deg)}}.cortex-tool-pill__svg{position:absolute;width:.75rem;height:.75rem;opacity:0;transform:scale(.6);transition:opacity .2s,transform .2s}.cortex-tool-pill__svg--visible{opacity:1;transform:scale(1)}.cortex-tool-pill__svg--check{color:var(--cortex-color-success)}.cortex-tool-pill__svg--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title{font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .3s}.cortex-tool-pill__title--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title--pending{color:var(--cortex-color-text-muted);opacity:.6}.cortex-tool-pill__meta{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:.8;white-space:nowrap;font-variant-numeric:tabular-nums}.cortex-approval-card{display:block;max-width:min(100%,28rem);margin:.25rem 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-approval-card--asking{border-color:color-mix(in oklab,var(--cortex-color-accent) 45%,var(--cortex-color-border));box-shadow:0 0 0 3px color-mix(in oklab,var(--cortex-color-accent) 10%,transparent)}.cortex-approval-card__head{display:flex;align-items:center;gap:.5rem;padding:.625rem .75rem 0;font-size:.75rem;font-weight:600;color:var(--cortex-color-accent)}.cortex-approval-card__sentence{margin:0;padding:.375rem .75rem .5rem;font-weight:600;color:var(--cortex-color-text-heading)}.cortex-approval-card__foot{display:flex;gap:.5rem;padding:.625rem .75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-approval-card__button{border:1px solid var(--cortex-color-border-strong);border-radius:calc(var(--cortex-radius) * .75);background:var(--cortex-color-surface);padding:.375rem .875rem;font:inherit;font-size:.8125rem;font-weight:500;color:var(--cortex-color-text-strong);cursor:pointer}.cortex-approval-card__button--approve{border-color:var(--cortex-color-accent);background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground)}.cortex-approval-card__line{display:flex;align-items:baseline;gap:.5rem;padding:.5rem .75rem;font-size:.8125rem;color:var(--cortex-color-text-secondary)}.cortex-approval-card__line .cortex-tool-pill__icon{flex-shrink:0}.cortex-approval-card__decision{font-weight:600;color:var(--cortex-color-text-strong)}.cortex-approval-card__summary{min-width:0;flex:1}.cortex-tool-fold{display:block;align-self:flex-start;text-align:start;border:0;background:none;padding:0 0 .25rem;margin-block-start:-.625rem;margin-inline-start:1.125rem;font:inherit;font-size:.75rem;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-tool-fold:hover,.cortex-tool-fold:focus-visible{color:var(--cortex-color-text-secondary)}.cortex-client-tool-embed{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-client-tool-embed__bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border-block-end:1px solid var(--cortex-color-border-strong);font-size:12px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__cancel{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-client-tool-embed__cancel:hover{color:var(--cortex-color-danger)}.cortex-client-tool-embed__frame{display:block;inline-size:100%;block-size:420px;border:0;background:var(--cortex-color-surface)}.cortex-client-tool-embed__status{display:flex;align-items:center;gap:8px;padding:20px 16px;font-size:13px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__retry{border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:none;padding:4px 10px;font:inherit;font-size:12px;color:inherit;cursor:pointer}.cortex-client-tool-embed-dialog{border:0;padding:0;background:none;inline-size:min(560px,100vw - 48px);max-inline-size:none}.cortex-client-tool-embed-dialog::backdrop{background:#00000073}.cortex-client-tool-embed-dialog .cortex-client-tool-embed{inline-size:100%;max-inline-size:none;box-shadow:0 24px 64px #0000004d}.cortex-client-tool-embed-dialog .cortex-client-tool-embed__frame{block-size:min(70dvh,560px)}.cortex-location-input{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-location-input--settled{display:flex;gap:10px;border-color:var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-location-input__map{position:relative;block-size:11rem;background:var(--cortex-color-surface-muted)}.cortex-location-input__map--still{flex:none;inline-size:120px;block-size:84px}.cortex-location-input__canvas{block-size:100%}.cortex-location-input__still-failed{display:flex;align-items:center;justify-content:center;block-size:100%;padding:0 8px;font-size:11px;text-align:center;color:var(--cortex-color-text-muted)}.cortex-location-input__locate{position:absolute;inset-inline-end:10px;inset-block-start:10px;z-index:1001;display:inline-flex;align-items:center;justify-content:center;inline-size:30px;block-size:30px;border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 1px 3px #0003;cursor:pointer}.cortex-location-input__locate svg{inline-size:15px;block-size:15px}.cortex-location-input__locate:disabled{opacity:.45;cursor:default}.cortex-location-input__foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border-block-start:1px solid var(--cortex-color-border-strong);font-size:12px}.cortex-location-input__hint{display:inline-flex;align-items:center;gap:6px;min-inline-size:0;color:var(--cortex-color-text-muted)}.cortex-location-input__hint--failed{color:var(--cortex-color-danger)}.cortex-location-input__spinner{inline-size:.625rem;block-size:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-location-input__coords{font-family:var(--cortex-font-mono);font-size:.75rem;color:var(--cortex-color-text-secondary);direction:ltr;unicode-bidi:isolate}.cortex-location-input__actions{display:flex;align-items:center;gap:8px}.cortex-location-input__skip{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-location-input__skip:hover{color:var(--cortex-color-danger)}.cortex-location-input__skip:disabled{opacity:.45;cursor:default}.cortex-location-input__send{border:1px solid var(--cortex-color-primary);border-radius:8px;background:var(--cortex-color-primary);padding:4px 10px;font:inherit;font-size:12px;color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-location-input__send:disabled{opacity:.45;cursor:default}.cortex-location-input__body{display:flex;flex-direction:column;justify-content:center;gap:2px;min-inline-size:0;padding-block:8px;padding-inline-end:12px}.cortex-location-input__title{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--cortex-color-text-strong)}.cortex-location-input__title svg{inline-size:13px;block-size:13px;color:var(--cortex-color-success)}.cortex-reasoning-animated{display:block}.cortex-subtle-activity{display:flex;align-items:center;gap:.375rem;padding:.25rem 0;width:fit-content}.cortex-subtle-activity__dots{display:flex;align-items:center;gap:3px}.cortex-subtle-activity__dot{width:3px;height:3px;border-radius:9999px;background:var(--cortex-color-accent);animation:cortex-subtle-dot-pulse 1.4s ease-in-out infinite}.cortex-subtle-activity__dot--d1{animation-delay:.2s}.cortex-subtle-activity__dot--d2{animation-delay:.4s}@keyframes cortex-subtle-dot-pulse{0%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1.3)}}.cortex-subtle-activity__label-mask{overflow:hidden;position:relative;height:1.1em}.cortex-subtle-activity__label{display:block;font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;line-height:1.1em}.cortex-subtle-activity__label--idle,.cortex-subtle-activity__label--entering{opacity:1;transform:translateY(0);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--exiting{opacity:0;transform:translateY(-6px);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--enter-start{opacity:0;transform:translateY(6px);transition:none}.cortex-attachment-queue{display:flex;flex-wrap:wrap;gap:.375rem;margin-bottom:.5rem}.cortex-attachment-chip{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding-block:.25rem;padding-inline:.5rem .375rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong)}.cortex-attachment-chip--error{border-color:var(--cortex-color-danger-border);background:var(--cortex-color-danger-surface);color:var(--cortex-color-danger)}.cortex-attachment-chip__icon,.cortex-attachment-chip__spinner{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-attachment-chip__spinner{animation:cortex-attachment-spin .8s linear infinite}.cortex-attachment-chip__spinner-track{opacity:.25}@keyframes cortex-attachment-spin{to{transform:rotate(360deg)}}.cortex-attachment-chip__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-attachment-chip__remove{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:1rem;height:1rem;padding:0;border:0;border-radius:3px;background:transparent;color:currentColor;opacity:.6;cursor:pointer}.cortex-attachment-chip__remove:hover{opacity:1;background:var(--cortex-color-hover)}.cortex-attachment-chip__remove svg{width:.75rem;height:.75rem}.cortex-token-usage{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-token-usage__summary{align-self:end}html[dir=ltr] .cortex-token-usage__summary{align-self:start}.cortex-token-usage__summary{display:inline-flex;align-items:center;gap:.625rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-token-usage__summary:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-token-usage__summary{flex-wrap:wrap;max-width:100%;text-align:start}.cortex-token-usage__total-number{font-weight:600;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__total-label{margin-inline-start:3px;color:var(--cortex-color-text-muted);font-weight:400;letter-spacing:.03em}.cortex-token-usage__model{color:var(--cortex-color-border-strong);font-weight:400;font-size:.5625rem;letter-spacing:.02em;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-token-usage__pills{display:inline-flex;align-items:center;gap:.5rem}.cortex-token-usage__pill{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-muted)}.cortex-token-usage__dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.cortex-token-usage__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 2px #ea580c1a}.cortex-token-usage__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 2px #4f46e51a}.cortex-token-usage__cache-badge{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 6px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-token-usage--expanded .cortex-token-usage__chevron{transform:rotate(180deg)}.cortex-token-usage__details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-token-usage__details-inner{overflow:hidden}.cortex-token-usage--expanded .cortex-token-usage__details{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-token-usage__columns{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--cortex-color-border);border-radius:8px;overflow:hidden}.cortex-token-usage__col{background:var(--cortex-color-surface-subtle);padding:.5rem .625rem}.cortex-token-usage__col-header{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-token-usage__col-label{font-weight:600;font-size:.5625rem;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-secondary);font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__col-total{margin-inline-start:auto;font-weight:700;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__rows{display:flex;flex-direction:column;gap:1px}.cortex-token-usage__row{display:flex;align-items:baseline;justify-content:space-between;padding:2px 0;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__row-label{color:var(--cortex-color-text-muted);font-size:.625rem}.cortex-token-usage__row-value{font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary);font-weight:500}.cortex-token-usage__cache-bar-row{display:flex;align-items:center;gap:.5rem;margin-top:.5rem;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__cache-bar{flex:1;height:3px;border-radius:2px;background:var(--cortex-color-border);overflow:hidden}.cortex-token-usage__cache-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#10b981,var(--cortex-color-success));transition:width .4s cubic-bezier(.4,0,.2,1)}.cortex-token-usage__cache-label{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-llm-inspector__trigger{align-self:end}html[dir=ltr] .cortex-llm-inspector__trigger{align-self:start}.cortex-llm-inspector__trigger{display:inline-flex;align-items:center;gap:.5rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-llm-inspector__trigger:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-llm-inspector__icon{color:var(--cortex-color-text-muted);flex-shrink:0}.cortex-llm-inspector__loading{color:var(--cortex-color-border-strong);font-style:italic}.cortex-llm-inspector__badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;padding:0 .35rem;border-radius:9999px;background:var(--cortex-color-border);color:var(--cortex-color-text-secondary);font-size:.5625rem;font-weight:700}.cortex-llm-inspector__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-llm-inspector--open .cortex-llm-inspector__chevron{transform:rotate(180deg)}.cortex-llm-inspector__panel-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-llm-inspector__panel-inner{overflow:hidden}.cortex-llm-inspector--open .cortex-llm-inspector__panel-wrapper{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-llm-inspector__panel{display:flex;flex-direction:column;gap:.375rem}.cortex-llm-inspector__empty{padding:.625rem;color:var(--cortex-color-text-muted);font-style:italic}.cortex-llm-inspector__step{border-radius:8px;background:var(--cortex-color-surface-subtle);overflow:hidden;transition:box-shadow .2s ease}.cortex-llm-inspector__step--expanded{box-shadow:0 0 0 1px var(--cortex-color-border)}.cortex-llm-inspector__step-header{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .625rem;border:none;background:transparent;cursor:pointer;font:inherit;color:inherit;text-align:start;transition:background .15s ease}.cortex-llm-inspector__step-header:hover{background:#00000005}.cortex-llm-inspector__step-label{font-weight:600;color:var(--cortex-color-text-secondary);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-metrics{display:inline-flex;align-items:center;gap:.625rem;margin-inline-start:auto;font-variant-numeric:tabular-nums}.cortex-llm-inspector__metric{display:inline-flex;align-items:center;gap:3px}.cortex-llm-inspector__dot{width:5px;height:5px;border-radius:50%;flex-shrink:0}.cortex-llm-inspector__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 1.5px #ea580c1f}.cortex-llm-inspector__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 1.5px #4f46e51f}.cortex-llm-inspector__cache-pct{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 5px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-chevron{color:var(--cortex-color-border-strong);transition:transform .2s ease;flex-shrink:0}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-chevron{transform:rotate(180deg)}.cortex-llm-inspector__step-body-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease;opacity:0}.cortex-llm-inspector__step-body-inner{overflow:hidden}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-body-wrapper{grid-template-rows:1fr;opacity:1}.cortex-llm-inspector__step-body{padding:0 .625rem .625rem;display:flex;flex-direction:column;gap:.5rem}.cortex-llm-inspector__usage-rows{display:flex;flex-direction:column;border-radius:6px;overflow:hidden;background:var(--cortex-color-border);gap:1px}.cortex-llm-inspector__usage-row{display:flex;align-items:baseline;gap:.5rem;padding:.375rem .625rem;background:var(--cortex-color-surface);flex-wrap:wrap}.cortex-llm-inspector__usage-row--total{background:light-dark(#fafbfc,#141414)}.cortex-llm-inspector__usage-lbl{font-size:.5625rem;text-transform:uppercase;letter-spacing:.05em;color:var(--cortex-color-text-muted);font-weight:600;width:3.25rem;flex-shrink:0;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__usage-val{font-variant-numeric:tabular-nums;font-weight:600;color:var(--cortex-color-text-secondary);min-width:3rem}.cortex-llm-inspector__usage-row--total .cortex-llm-inspector__usage-val{font-weight:700;color:var(--cortex-color-text-heading)}.cortex-llm-inspector__usage-detail{color:var(--cortex-color-border-strong);font-size:.5625rem;margin-inline-start:auto}.cortex-llm-inspector__tabs{display:flex;gap:0;border-bottom:1px solid var(--cortex-color-border)}.cortex-llm-inspector__tab{padding:.375rem .75rem;border:none;background:transparent;cursor:pointer;font:inherit;color:var(--cortex-color-text-muted);font-weight:500;position:relative;transition:color .15s ease;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__tab:hover{color:var(--cortex-color-text-secondary)}.cortex-llm-inspector__tab--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-llm-inspector__tab--active:after{content:"";position:absolute;inset-inline:0;bottom:-1px;height:2px;background:var(--cortex-color-text-heading);border-radius:1px 1px 0 0}.cortex-llm-inspector__json-pane{position:relative;max-height:24rem;overflow:auto;padding:.625rem;background:var(--cortex-color-surface);border-radius:6px}.cortex-llm-inspector__json-copy{position:sticky;top:0;float:inline-end;z-index:1}.cortex-json-tree{display:block;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.75rem;line-height:1.25rem;-webkit-user-select:text;user-select:text;white-space:pre-wrap;word-break:break-word}.cortex-json-tree__indent{padding-inline-start:1.25em;border-inline-start:1px solid var(--cortex-color-border);margin-inline-start:.3em}.cortex-json-tree__line{position:relative}.cortex-json-tree__toggle{cursor:pointer;-webkit-user-select:none;user-select:none}.cortex-json-tree__toggle:hover .cortex-json-tree__arrow{color:var(--cortex-color-text)}.cortex-json-tree__arrow{display:inline-block;width:1em;text-align:center;color:var(--cortex-color-text-muted);font-size:.525rem;transition:transform .15s ease;vertical-align:middle}.cortex-json-tree__arrow--collapsed{transform:rotate(-90deg)}.cortex-json-tree__bracket{color:var(--cortex-color-text-secondary)}.cortex-json-tree__key{color:light-dark(#6366f1,#818cf8)}.cortex-json-tree__colon{color:var(--cortex-color-text-secondary)}.cortex-json-tree__comma{color:var(--cortex-color-text-muted)}.cortex-json-tree__string{color:var(--cortex-color-success)}.cortex-json-tree__number{color:light-dark(#2563eb,#60a5fa)}.cortex-json-tree__boolean{color:light-dark(#d97706,#fbbf24)}.cortex-json-tree__null{color:var(--cortex-color-text-muted);font-style:italic}.cortex-json-tree__collapsed-hint{display:inline-block;padding:0 .4em;margin:0 .15em;font-size:.625rem;line-height:1.5;color:var(--cortex-color-text-muted);background:var(--cortex-color-surface-subtle);border:1px solid var(--cortex-color-border);border-radius:3px;font-style:italic;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:middle}.cortex-json-tree__collapsed-hint:hover{color:var(--cortex-color-text-secondary);border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface-muted)}.cortex-copy-btn{display:inline-flex;align-items:center}.cortex-copy-btn__button{display:inline-flex;align-items:center;justify-content:center;width:1.375rem;height:1.375rem;padding:0;border:none;border-radius:3px;background:transparent;color:var(--cortex-color-text-muted);cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease,background .15s ease}:hover>cortex-copy-button .cortex-copy-btn__button,:hover>.cortex-copy-btn .cortex-copy-btn__button,.cortex-copy-btn__button:hover,.cortex-copy-btn__button:focus-visible{opacity:1}.cortex-copy-btn__button:hover{background:var(--cortex-color-hover);color:var(--cortex-color-text)}.cortex-copy-btn__button--copied{opacity:1;color:var(--cortex-color-success);pointer-events:none}.cortex-copy-btn__button--copied:hover{color:var(--cortex-color-success);background:transparent}.cortex-copy-btn__icon{flex-shrink:0}.cortex-copy-btn__icon--check{animation:cortex-copy-pop .25s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes cortex-copy-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.cortex-widget *,.cortex-widget *:before,.cortex-widget *:after,.cortex-widget *::backdrop{animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:.01ms!important;transition-delay:0s!important}}\n'],
12512
+ styles: ['@charset "UTF-8";:root{--cortex-color-surface: light-dark(#ffffff, #0a0a0a);--cortex-color-surface-subtle: light-dark(#f8fafc, #141414);--cortex-color-surface-muted: light-dark(#f1f5f9, #1f1f1f);--cortex-color-border: light-dark(#e2e8f0, #2e2e2e);--cortex-color-border-strong: light-dark(#cbd5e1, #444444);--cortex-color-text-heading: light-dark(#1e293b, #fafafa);--cortex-color-text-strong: light-dark(#334155, #e5e5e5);--cortex-color-text: light-dark(#475569, #d4d4d4);--cortex-color-text-secondary: light-dark(#64748b, #a3a3a3);--cortex-color-text-muted: light-dark(#94a3b8, #737373);--cortex-color-primary: light-dark(#1e293b, #fafafa);--cortex-color-primary-foreground: light-dark(#ffffff, #0a0a0a);--cortex-color-accent: light-dark(#4f46e5, #818cf8);--cortex-color-accent-surface: light-dark(#e0e7ff, #312e81);--cortex-color-link: light-dark(#2563eb, #60a5fa);--cortex-color-hover: light-dark(rgba(0, 0, 0, .05), rgba(255, 255, 255, .06));--cortex-color-user-surface: var(--cortex-color-surface-subtle);--cortex-color-user-border: var(--cortex-color-border);--cortex-color-code-text: light-dark(#334155, #e5e5e5);--cortex-color-success: light-dark(#059669, #34d399);--cortex-color-success-surface: light-dark(#ecfdf5, #064e3b);--cortex-color-success-border: light-dark(#d1fae5, #065f46);--cortex-color-danger: light-dark(#dc2626, #f87171);--cortex-color-danger-surface: light-dark(#fef2f2, #450a0a);--cortex-color-danger-border: light-dark(#fecaca, #7f1d1d);--cortex-radius: .5rem;--cortex-font-mono: var( --default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace );--cortex-font-size: .8125rem}.cortex-widget{color-scheme:light}.cortex-widget[data-cortex-theme=dark]{color-scheme:dark}.cortex-widget[data-cortex-theme=system]{color-scheme:light dark}@layer base.cortex{:where(.cortex-widget),:where(.cortex-widget) *,:where(.cortex-widget) :before,:where(.cortex-widget) :after{box-sizing:border-box;margin:0;padding:0;border:0 solid}:where(.cortex-widget){tab-size:4}:where(.cortex-widget) hr{height:0;color:inherit;border-top-width:1px}:where(.cortex-widget) :is(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}:where(.cortex-widget) a{color:inherit;text-decoration:inherit}:where(.cortex-widget) :is(b,strong){font-weight:bolder}:where(.cortex-widget) :is(code,kbd,samp,pre){font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}:where(.cortex-widget) small{font-size:80%}:where(.cortex-widget) :is(sub,sup){font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.cortex-widget) sub{bottom:-.25em}:where(.cortex-widget) sup{top:-.5em}:where(.cortex-widget) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.cortex-widget) :is(ol,ul,menu){list-style:none}:where(.cortex-widget) :is(img,svg,video,canvas,audio,iframe,embed,object){display:block;vertical-align:middle}:where(.cortex-widget) :is(img,video){max-width:100%;height:auto}:where(.cortex-widget) :is(button,input,select,optgroup,textarea){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(.cortex-widget) ::placeholder{opacity:1;color:color-mix(in oklab,currentcolor 50%,transparent)}:where(.cortex-widget) textarea{resize:vertical}}.cortex-widget .hljs{color:light-dark(#24292e,#c9d1d9);background:transparent}.cortex-widget .hljs-doctag,.cortex-widget .hljs-keyword,.cortex-widget .hljs-meta .hljs-keyword,.cortex-widget .hljs-template-tag,.cortex-widget .hljs-template-variable,.cortex-widget .hljs-type,.cortex-widget .hljs-variable.language_{color:light-dark(#d73a49,#ff7b72)}.cortex-widget .hljs-title,.cortex-widget .hljs-title.class_,.cortex-widget .hljs-title.class_.inherited__,.cortex-widget .hljs-title.function_{color:light-dark(#6f42c1,#d2a8ff)}.cortex-widget .hljs-attr,.cortex-widget .hljs-attribute,.cortex-widget .hljs-literal,.cortex-widget .hljs-meta,.cortex-widget .hljs-number,.cortex-widget .hljs-operator,.cortex-widget .hljs-selector-attr,.cortex-widget .hljs-selector-class,.cortex-widget .hljs-selector-id,.cortex-widget .hljs-variable{color:light-dark(#005cc5,#79c0ff)}.cortex-widget .hljs-meta .hljs-string,.cortex-widget .hljs-regexp,.cortex-widget .hljs-string{color:light-dark(#032f62,#a5d6ff)}.cortex-widget .hljs-built_in,.cortex-widget .hljs-symbol{color:light-dark(#e36209,#ffa657)}.cortex-widget .hljs-code,.cortex-widget .hljs-comment,.cortex-widget .hljs-formula{color:light-dark(#6a737d,#8b949e)}.cortex-widget .hljs-name,.cortex-widget .hljs-quote,.cortex-widget .hljs-selector-pseudo,.cortex-widget .hljs-selector-tag{color:light-dark(#22863a,#7ee787)}.cortex-widget .hljs-subst{color:light-dark(#24292e,#c9d1d9)}.cortex-widget .hljs-section{color:light-dark(#005cc5,#1f6feb);font-weight:700}.cortex-widget .hljs-bullet{color:light-dark(#735c0f,#f2cc60)}.cortex-widget .hljs-emphasis{font-style:italic}.cortex-widget .hljs-strong{font-weight:700}.cortex-widget .hljs-addition{color:light-dark(#22863a,#aff5b4);background-color:light-dark(#f0fff4,#033a16)}.cortex-widget .hljs-deletion{color:light-dark(#b31d28,#ffdcd7);background-color:light-dark(#ffeef0,#67060c)}.cortex-widget{display:block}.cortex-widget__container{width:100%;height:100%;position:relative;overflow:hidden}.cortex-widget__screen{position:absolute;inset:0;display:flex;flex-direction:column;transition:transform .3s ease-out}.cortex-widget__screen--active{transform:translate(0)}.cortex-widget__screen--left{transform:translate(-100%)}[dir=rtl] .cortex-widget__screen--left,.cortex-widget__screen--right{transform:translate(100%)}[dir=rtl] .cortex-widget__screen--right{transform:translate(-100%)}@keyframes cortex-skeleton-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.cortex-skeleton{background:linear-gradient(90deg,var(--cortex-color-border) 0%,var(--cortex-color-surface-muted) 40%,var(--cortex-color-border) 80%);background-size:200% 100%;animation:cortex-skeleton-shimmer 1.8s ease-in-out infinite;border-radius:6px}.cortex-widget__messages-skeleton{flex:1;overflow:hidden;padding:1rem;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel{width:100%;display:flex;flex-direction:column}.cortex-widget__msg-skel--user{align-items:flex-end}.cortex-widget__msg-skel--assistant{align-items:flex-start}.cortex-widget__msg-skel-bubble{max-width:80%;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel-bubble--user{padding:.75rem 1rem;border-radius:calc(var(--cortex-radius) * 2);border-end-end-radius:0;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-widget__msg-skel-line{height:.75rem;max-width:100%}.cortex-widget__messages{flex:1;overflow:hidden}.cortex-widget__container--full{display:flex;flex-direction:row}.cortex-widget__container--full>.cortex-widget__screen{position:relative;inset:auto;transition:none}.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--active,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--left,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--right{transform:none}.cortex-widget__container--full>.cortex-widget__screen:first-child{width:280px;min-width:280px;flex-shrink:0;border-right:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{border-right:0;border-left:1px solid var(--cortex-color-border)}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__back-btn,.cortex-widget__container--full .cortex-widget__history-btn{display:none}@media(min-width:769px){.cortex-widget__container--full>.cortex-widget__screen:nth-child(2) .cortex-widget__new-btn{display:none}}.cortex-widget__container--full .cortex-widget__chat-title{font-size:var(--cortex-font-size-header, .875rem)}.cortex-widget__container--full .cortex-widget__chat-header{background:var(--cortex-color-surface)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1.5rem max(2rem,(100% - 48rem) / 2)}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem max(2rem,(100% - 48rem) / 2) 1.25rem}@media(max-width:768px){.cortex-widget__container--full>.cortex-widget__screen:first-child{position:fixed;inset:0;width:280px;min-width:280px;z-index:110;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{transform:translate(100%);border-left:1px solid var(--cortex-color-border);border-right:0}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-secondary)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:hover{color:var(--cortex-color-text-strong);background:var(--cortex-color-surface-muted)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:active{background:var(--cortex-color-border)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem}}@media(max-width:768px){.cortex-widget__container--full.cortex-widget__container--sidebar-open>.cortex-widget__screen:first-child{transform:translate(0)}.cortex-widget__container--full.cortex-widget__container--sidebar-open .cortex-widget__sidebar-backdrop{display:block;position:fixed;inset:0;z-index:100;background:#0f172a59;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:cortex-sidebar-backdrop-in .2s ease-out both}}@keyframes cortex-sidebar-backdrop-in{0%{opacity:0}to{opacity:1}}.cortex-widget__chat-header{flex-shrink:0;height:3rem;padding:0 1rem;display:flex;align-items:center;gap:.75rem;border-bottom:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__header-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__header-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-surface-muted)}[dir=rtl] .cortex-widget__back-icon{transform:rotate(180deg)}.cortex-widget__chat-title-wrap{min-width:0;flex:1}.cortex-widget__chat-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, var(--cortex-font-size));font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__debug-btn{flex-shrink:0;font-size:.6875rem;font-weight:500;padding:.25rem .625rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__debug-btn--on{background:light-dark(#fef3c7,#78350f);color:light-dark(#d97706,#fbbf24)}.cortex-widget__debug-btn--on:hover{background:light-dark(#fde68a,#92400e)}.cortex-widget__debug-btn--off{background:var(--cortex-color-surface-muted);color:var(--cortex-color-text-muted)}.cortex-widget__debug-btn--off:hover{background:var(--cortex-color-border)}.cortex-widget__landing{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:1.25rem;text-align:center}.cortex-widget__landing .cortex-widget__landing-composer{max-width:26rem}.cortex-widget__landing-composer{width:100%}.cortex-widget__landing-composer .cortex-widget__input-area{padding:1rem 0 0;border-top:0;background:transparent}.cortex-widget__landing-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent);display:flex;align-items:center;justify-content:center;margin-bottom:.875rem}[dir=rtl] .cortex-widget__landing-icon{transform:scaleX(-1)}.cortex-widget__landing-greeting{font-family:var(--cortex-font-display, inherit);font-size:1.0625rem;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading);margin:0}.cortex-widget__landing-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;margin-top:.875rem}.cortex-widget__landing-chip{border:1px solid var(--cortex-color-border);border-radius:999px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);font-size:.75rem;font-weight:500;padding:.375rem .75rem;cursor:pointer;transition:border-color .15s,color .15s}.cortex-widget__landing-chip:hover{border-color:var(--cortex-color-accent);color:var(--cortex-color-accent)}.cortex-widget__landing-recent{width:100%;max-width:26rem;margin-top:1rem;display:flex;flex-direction:column}.cortex-widget__landing-recent-item{display:flex;align-items:center;gap:.75rem;padding:.4375rem .625rem;border:0;border-radius:calc(var(--cortex-radius) * .75);background:transparent;cursor:pointer;transition:background-color .15s}.cortex-widget__landing-recent-item:hover{background:var(--cortex-color-hover)}.cortex-widget__landing-recent-title{flex:1;min-width:0;text-align:start;font-size:var(--cortex-font-size);font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__landing-recent-time{flex-shrink:0;font-size:.6875rem;color:var(--cortex-color-text-muted);margin:0}cortex-chat-composer,cortex-message-tool-call-outcome,cortex-llm-usage-chips{display:contents}.cortex-widget__input-area{flex-shrink:0;padding:.75rem;background:var(--cortex-color-surface);border-top:1px solid var(--cortex-color-border)}.cortex-widget__input-box{display:flex;align-items:flex-end;gap:.5rem;border-radius:calc(var(--cortex-radius) * 1.5);border:1px solid var(--cortex-color-border);padding:.375rem;background:color-mix(in oklab,var(--cortex-color-surface-subtle) 45%,var(--cortex-color-surface));transition:border-color .15s,background-color .15s}.cortex-widget__input-box--enabled:focus-within{border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface)}.cortex-widget__input-box--dragging{border-color:var(--cortex-color-text-heading);border-style:dashed;background:var(--cortex-color-surface-muted)}.cortex-widget__textarea,.cortex-widget__textarea:focus,.cortex-widget__textarea:focus-visible,.cortex-widget__textarea:disabled{background:transparent;border:0;outline:none;box-shadow:none}.cortex-widget__textarea{flex:1;resize:none;font-size:var(--cortex-font-size-message, var(--cortex-font-size));padding:.375rem .5rem;min-height:28px;max-height:calc(5.5 * var(--cortex-font-size-message, var(--cortex-font-size)) + .75rem);overflow-y:auto;line-height:1.375;color:var(--cortex-color-text-strong)}.cortex-widget__textarea::placeholder{color:var(--cortex-color-text-muted)}.cortex-widget__textarea--disabled{color:var(--cortex-color-text-muted);cursor:not-allowed}.cortex-widget__textarea:disabled{cursor:not-allowed}.cortex-widget__input-actions{flex-shrink:0;display:flex;align-items:center;gap:.375rem}@keyframes cortex-stop-pulse-ring{0%{opacity:.45;transform:scale(1)}50%{opacity:.15;transform:scale(1.12)}to{opacity:.45;transform:scale(1)}}@keyframes cortex-stop-fade-in{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}.cortex-stop-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;background:var(--cortex-color-danger);color:#fff;border:0;animation:cortex-stop-fade-in .2s ease-out both;transition:background .15s ease}.cortex-stop-btn:hover{background:color-mix(in oklab,var(--cortex-color-danger) 85%,black)}.cortex-stop-btn:active{transform:scale(.92)}.cortex-stop-btn__ring{position:absolute;inset:0;border-radius:var(--cortex-radius);background:var(--cortex-color-danger);animation:cortex-stop-pulse-ring 2s ease-in-out infinite;pointer-events:none}.cortex-stop-btn__icon{position:relative;z-index:1}.cortex-widget__attach-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__attach-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-widget__file-input{display:none}.cortex-widget__send-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;border:0;transition:background-color .15s;cursor:default}.cortex-widget__send-btn--empty{background:var(--cortex-color-send-empty, transparent);color:var(--cortex-color-send-empty-text, var(--cortex-color-text-muted))}.cortex-widget__send-btn--ready{background:var(--cortex-color-primary);color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-widget__send-btn--ready:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}[dir=rtl] .cortex-widget__send-icon{transform:rotate(180deg)}.cortex-widget__threads-header{flex-shrink:0;padding:1.25rem 1.25rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-widget__threads-header .cortex-widget__new-btn{margin-inline-start:auto}.cortex-widget__threads-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, .9375rem);font-weight:600;color:var(--cortex-color-text-heading);letter-spacing:-.01em;margin:0}.cortex-widget__threads-count{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0}.cortex-widget__new-chat-btn{display:inline-flex;align-items:center;gap:.375rem;font-size:.75rem;font-weight:500;color:var(--cortex-color-primary-foreground);background:var(--cortex-color-primary);padding:.375rem .75rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__new-chat-btn:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}.cortex-widget__new-chat-btn:active{background:var(--cortex-color-primary)}.cortex-widget__new-chat-btn--empty-state{margin-top:.75rem}.cortex-widget__threads-list{flex:1;overflow-y:auto;padding:0 .75rem .75rem}.cortex-widget__thread-skeleton{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.375rem;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__thread-skeleton-icon{flex-shrink:0;width:2rem;height:2rem}.cortex-widget__thread-skeleton-lines{flex:1;display:flex;flex-direction:column;gap:.375rem}.cortex-widget__thread-skeleton-line{height:.875rem}.cortex-widget__thread-item{position:relative;width:100%;padding:.75rem;border-radius:var(--cortex-radius);display:flex;align-items:center;gap:.75rem;transition:background-color .15s,border-color .15s;cursor:pointer;margin-bottom:.375rem;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface);color:var(--cortex-color-text)}.cortex-widget__thread-item:hover{background:var(--cortex-color-surface-muted);border-color:var(--cortex-color-border-strong)}.cortex-widget__thread-item:active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border))}.cortex-widget__thread-item--active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border));border-color:var(--cortex-color-border-strong);color:var(--cortex-color-text-heading)}.cortex-widget__thread-item--active:hover{background:var(--cortex-color-border)}.cortex-widget__thread-item--active:active{background:color-mix(in oklab,var(--cortex-color-border) 50%,var(--cortex-color-border-strong))}.cortex-widget__thread-icon{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;font-size:.6875rem;font-weight:600;background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}[dir=rtl] .cortex-widget__thread-icon{transform:scaleX(-1)}.cortex-widget__thread-icon--active{background:color-mix(in oklab,var(--cortex-color-accent-surface) 85%,var(--cortex-color-accent))}.cortex-widget__thread-info{min-width:0;flex:1;text-align:start;cursor:pointer}.cortex-widget__thread-info:after{content:"";position:absolute;inset:0}.cortex-widget__thread-title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-widget__thread-title{font-size:var(--cortex-font-size);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.25;margin:0;color:var(--cortex-color-text-strong)}.cortex-widget__thread-title--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-widget__thread-time{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-widget__thread-running{flex-shrink:0;display:inline-flex;align-items:center;gap:.3125rem;padding:.2rem .45rem;border-radius:999px;background:var(--cortex-color-success-surface);color:var(--cortex-color-success);font-size:.625rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.cortex-widget__thread-running-dot{width:.375rem;height:.375rem;border-radius:999px;background:currentColor;box-shadow:0 0 .45rem currentColor;animation:cortex-thread-running-pulse 1.4s ease-in-out infinite}@keyframes cortex-thread-running-pulse{0%,to{opacity:.45;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.cortex-widget__thread-delete{position:relative;flex-shrink:0;opacity:0;width:1.75rem;height:1.75rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .15s;background:transparent;border:0;color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-delete,.cortex-widget__thread-delete:focus-visible{opacity:1}.cortex-widget__thread-delete:hover{background:var(--cortex-color-border)}.cortex-widget__thread-delete--active{color:var(--cortex-color-text-secondary)}.cortex-widget__thread-delete--active:hover{color:var(--cortex-color-text)}.cortex-widget__thread-arrow{flex-shrink:0;transition:color .15s;color:var(--cortex-color-border-strong);pointer-events:none}[dir=rtl] .cortex-widget__thread-arrow{transform:rotate(180deg)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow{color:var(--cortex-color-text-muted)}.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-secondary)}.cortex-widget__threads-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 0;text-align:center}.cortex-widget__threads-empty-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);display:flex;align-items:center;justify-content:center;margin-bottom:.75rem}.cortex-widget__threads-empty-svg{color:var(--cortex-color-accent)}.cortex-widget__threads-empty-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size);color:var(--cortex-color-text-muted);font-weight:500;margin:0}.cortex-widget__threads-empty-subtitle{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.25rem;margin-bottom:0}.cortex-widget__sidebar-toggle-btn,.cortex-widget__sidebar-backdrop{display:none}.cortex-message-list{height:100%;overflow-y:auto;overflow-x:hidden;width:100%;padding:1rem}.cortex-message-list__content{position:relative;display:flex;flex-direction:column;gap:.5rem}.cortex-message-list__content--settling{animation:cortex-content-settle .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-content-settle{0%{translate:0 var(--cortex-slide)}}.cortex-widget__screen>.cortex-send-flight{position:absolute;z-index:2;margin:0;max-width:none;pointer-events:none;animation:cortex-send-fade 80ms linear both,cortex-send-fly .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-send-fade{0%{opacity:0}}@keyframes cortex-send-fly{0%{translate:var(--cortex-fly-x) var(--cortex-fly-y)}}.cortex-working-thinking{padding-inline-start:2rem;--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-working-thinking{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}.cortex-working-avatar{position:absolute;top:0;inset-inline-start:0;z-index:1;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:9999px;background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground);translate:0 var(--cortex-avatar-y, 0);visibility:hidden;pointer-events:none}.cortex-working-avatar svg{width:.875rem;height:.875rem}.cortex-working-avatar--shown{visibility:visible;transition:translate .42s cubic-bezier(.76,0,.24,1);animation:cortex-avatar-in .7s cubic-bezier(.16,1,.3,1) both}.cortex-working-avatar--leaving{animation:cortex-avatar-out .36s cubic-bezier(.5,0,.75,0) .12s both}.cortex-working-avatar__ring{position:absolute;inset:-.25rem;border-radius:9999px;border:1.5px solid color-mix(in oklab,var(--cortex-color-accent) 18%,transparent);border-top-color:var(--cortex-color-accent);border-right-color:color-mix(in oklab,var(--cortex-color-accent) 45%,transparent)}.cortex-working-avatar--shown .cortex-working-avatar__ring{animation:cortex-tool-spin 1s linear infinite}.cortex-working-avatar--leaving .cortex-working-avatar__ring{animation:cortex-avatar-ring-out .22s ease-out both}@keyframes cortex-avatar-in{0%{opacity:0;transform:translateY(2.5rem) scale(.7)}}@keyframes cortex-avatar-out{to{opacity:0;transform:scale(.4)}}@keyframes cortex-avatar-ring-out{to{opacity:0}}.cortex-message{min-width:0;transition:margin-block-start .42s cubic-bezier(.76,0,.24,1)}.cortex-message:empty{display:none}.cortex-message:has(.cortex-message-part--folded):not(:has(.cortex-message-part:not(.cortex-message-part--folded))){margin-block-start:-.5rem;transition-delay:.6s}.cortex-text-bubble--assistant,.cortex-subtle-activity,.cortex-tool-pill,.cortex-tool-pill .cortex-tool-pill__icon{transition:translate .42s cubic-bezier(.76,0,.24,1) .16s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity,.cortex-message--working-turn .cortex-tool-pill,.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{transition-delay:0s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity{translate:2rem}[dir=rtl] .cortex-message--working-turn .cortex-text-bubble--assistant,[dir=rtl] .cortex-message--working-turn .cortex-subtle-activity{translate:-2rem}.cortex-message--working-turn .cortex-tool-pill{translate:.875rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill{translate:-.875rem}.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:-.5rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:.5rem}.cortex-message-parts{width:100%;display:flex;flex-direction:column;gap:.5rem}.cortex-message-actions{display:flex;align-items:center;gap:.375rem;margin-top:-.25rem}.cortex-message-actions--user{justify-content:flex-end}.cortex-message-actions__time{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:0;transition:opacity .15s ease}.cortex-message-actions:not(:has(.cortex-copy-btn)) .cortex-message-actions__time{opacity:1}.cortex-message:hover .cortex-message-actions .cortex-copy-btn__button,.cortex-message:hover .cortex-message-actions .cortex-message-actions__time,.cortex-message-actions:focus-within .cortex-copy-btn__button,.cortex-message-actions:focus-within .cortex-message-actions__time{opacity:1}.cortex-message-debug-zone{display:flex;flex-direction:column;gap:.25rem;padding-top:.375rem;margin-top:.125rem;border-top:1px dashed var(--cortex-color-border)}.cortex-message-part{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;min-width:0;transition:grid-template-rows .42s cubic-bezier(.76,0,.24,1),margin-block-end .42s cubic-bezier(.76,0,.24,1),opacity .3s ease,visibility 0s,overflow 0s .42s allow-discrete}.cortex-message-part>*{min-height:0}.cortex-message-part:empty{display:none}.cortex-message-part--folded{grid-template-rows:0fr;margin-block-end:-.5rem;opacity:0;overflow:clip;visibility:hidden;transition-delay:.6s,.6s,.6s,1.02s,0s}[data-cortex-frontier] .cortex-tool-pill__spinner{visibility:hidden}[data-cortex-frontier] .cortex-subtle-activity__dots{display:none}.cortex-message-part--animated{--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-message-part--animated{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}@keyframes cortex-part-reveal{0%{opacity:0;transform:translate(var(--cortex-reveal-from));filter:blur(5px);-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-start) 0;mask-position:var(--cortex-reveal-start) 0}40%{opacity:1}to{transform:none;filter:none;-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-end) 0;mask-position:var(--cortex-reveal-end) 0}}.cortex-unhandled-type{text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-text-part{width:100%;display:flex;flex-direction:column}.cortex-text-part--user{align-items:flex-end}.cortex-text-bubble{min-width:0;overflow-wrap:anywhere;font-size:var(--cortex-font-size-message, var(--cortex-font-size));line-height:1.625;color:var(--cortex-color-text-strong)}.cortex-text-bubble--assistant{width:calc(100% - 2rem)}.cortex-text-bubble--user{max-width:80%;padding:.75rem 1rem;border-radius:calc(var(--cortex-radius) * 2);border-end-end-radius:0;border:1px solid var(--cortex-color-user-border);background:var(--cortex-color-user-surface)}.cortex-text-bubble h1,.cortex-text-bubble h2,.cortex-text-bubble h3,.cortex-text-bubble h4,.cortex-text-bubble h5,.cortex-text-bubble h6{margin-top:1.25em;margin-bottom:.5em;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading)}.cortex-text-bubble h1:first-child,.cortex-text-bubble h2:first-child,.cortex-text-bubble h3:first-child,.cortex-text-bubble h4:first-child,.cortex-text-bubble h5:first-child,.cortex-text-bubble h6:first-child{margin-top:0}.cortex-text-bubble h1{font-size:1.25em}.cortex-text-bubble h2{font-size:1.125em}.cortex-text-bubble h3{font-size:1em}.cortex-text-bubble p{margin-top:.75em;margin-bottom:.75em}.cortex-text-bubble p:first-child{margin-top:0}.cortex-text-bubble p:last-child{margin-bottom:0}.cortex-text-bubble ul,.cortex-text-bubble ol{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1.5em}.cortex-text-bubble ul{list-style-type:disc}.cortex-text-bubble ol{list-style-type:decimal}.cortex-text-bubble li{margin-top:.25em;margin-bottom:.25em}.cortex-text-bubble code{font-family:var(--cortex-font-mono);font-size:.875em;background:var(--cortex-color-border);padding:.125em .375em;border-radius:calc(var(--cortex-radius) * .5)}.cortex-text-bubble pre{margin-top:.75em;margin-bottom:.75em;padding:.75em 1em;background:var(--cortex-color-code-surface, color-mix(in oklab, var(--cortex-color-text-heading) 8%, transparent));border-radius:var(--cortex-radius);max-width:100%;overflow-x:auto;font-size:.8125em;line-height:1.6}.cortex-text-bubble pre code{background:transparent;padding:0;color:var(--cortex-color-code-text)}.cortex-text-bubble blockquote{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1em;border-inline-start:3px solid var(--cortex-color-border-strong);color:var(--cortex-color-text-secondary);font-style:italic}.cortex-text-bubble a{color:var(--cortex-color-link);text-decoration:underline}.cortex-text-bubble a:hover{color:color-mix(in oklab,var(--cortex-color-link) 80%,var(--cortex-color-text-heading))}.cortex-text-bubble table{width:100%;border-collapse:collapse;margin-top:.75em;margin-bottom:.75em;font-size:.875em}.cortex-text-bubble th,.cortex-text-bubble td{border:1px solid var(--cortex-color-border);padding:.375em .75em;text-align:start}.cortex-text-bubble th{background:var(--cortex-color-surface-subtle);font-weight:600}.cortex-text-bubble hr{margin-top:1.5em;margin-bottom:1.5em;border:none;border-top:1px solid var(--cortex-color-border)}.cortex-text-bubble img{max-width:100%;height:auto;border-radius:calc(var(--cortex-radius) * .75)}.cortex-stream-fade{animation:cortex-stream-fade .3s ease-out}@keyframes cortex-stream-fade{0%{opacity:0}}.cortex-expandable{display:block;position:relative}.cortex-expandable__content{isolation:isolate}.cortex-expandable__toolbar{position:absolute;top:.375rem;inset-inline-end:.375rem;z-index:1;display:flex;gap:.125rem;padding:.125rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);box-shadow:0 1px 3px #00000014;opacity:0;transition:opacity .15s}.cortex-expandable:hover>.cortex-expandable__toolbar,.cortex-expandable__toolbar:has(:focus-visible){opacity:1}@media(hover:none){.cortex-expandable__toolbar{position:static;width:fit-content;margin:0 0 .25rem;margin-inline-start:auto;opacity:1}}.cortex-expandable__action{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;width:1.75rem;height:1.75rem;color:var(--cortex-color-text-muted)}.cortex-expandable__action:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-expandable__dialog{width:fit-content;min-width:min(24rem,100vw - 2rem);max-width:calc(100vw - 2rem);max-height:calc(100dvh - 2rem);margin:auto;padding:0;overflow:hidden;border:1px solid var(--cortex-color-border);border-radius:calc(var(--cortex-radius) * 1.5);background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 24px 64px #0000003d}.cortex-expandable__dialog[open]{display:flex;flex-direction:column;animation:cortex-expandable-in .18s ease-out}.cortex-expandable__dialog::backdrop{background:#00000073;animation:cortex-expandable-backdrop-in .18s ease-out}.cortex-expandable__head{display:flex;align-items:center;gap:.125rem;padding-block:.375rem;padding-inline:1rem .375rem;border-bottom:1px solid var(--cortex-color-border)}.cortex-expandable__title{flex:1;min-width:0;margin-inline-end:.5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;font-weight:600;color:var(--cortex-color-text-heading)}.cortex-expandable__body{min-height:0;overflow:auto;overscroll-behavior:contain}@keyframes cortex-expandable-in{0%{opacity:0;transform:translateY(.5rem) scale(.98)}}@keyframes cortex-expandable-backdrop-in{0%{opacity:0}}.cortex-media-block{display:block;width:40rem;max-width:100%;margin:.75em 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-media-block__head{display:flex}.cortex-media-block__head[hidden]{display:none}.cortex-media-block__head{align-items:center;justify-content:space-between;gap:.5rem;padding:.25rem .5rem .25rem .75rem;background:var(--cortex-color-surface-subtle);border-bottom:1px solid var(--cortex-color-border);font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-media-block__lang{font-family:var(--cortex-font-mono)}.cortex-media-block__pending{display:inline-flex;align-items:center;gap:.375rem}.cortex-media-block__pending:before{content:"";width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-media-block__actions{display:inline-flex;align-items:center;gap:.125rem}.cortex-media-block__action{background:transparent;border:0;padding:.125rem .375rem;border-radius:calc(var(--cortex-radius) * .5);font:inherit;color:inherit;cursor:pointer}.cortex-media-block__action:hover,.cortex-media-block__action[aria-pressed=true]{background:var(--cortex-color-hover);color:var(--cortex-color-text-strong)}.cortex-media-block__body{display:block;padding:.75rem}.cortex-media-block__body[hidden]{display:none}.cortex-media-block__body{min-height:6rem;overflow-x:auto}.cortex-media-block__body svg{display:block;max-width:100%;height:auto;direction:ltr}.cortex-media-block__body svg text{unicode-bidi:plaintext}.cortex-media-block__body>div>svg{margin-inline:auto}.cortex-media-block__body--map{padding:0;height:18rem}.cortex-media-block__body--map>div{height:100%}.cortex-media-block__body--report{padding:1rem}.cortex-expandable__body .cortex-media-block__body{width:min(72rem,100vw - 2rem - 2px)}.cortex-expandable__body .cortex-media-block__body:not(.cortex-media-block__body--map,.cortex-media-block__body--report)>div{display:grid}.cortex-expandable__body .cortex-media-block__body:not(.cortex-media-block__body--map,.cortex-media-block__body--report) svg{width:100%;max-width:none!important;max-height:calc(100dvh - 6.5rem)}.cortex-expandable__body .cortex-media-block__body--map{height:min(48rem,100dvh - 5rem)}.cortex-expandable:has(>.cortex-expandable__content>.cortex-media-block__body--map)>.cortex-expandable__toolbar{right:.375rem;left:auto}.cortex-media-block__error{margin:0;font-size:.8125rem;color:var(--cortex-color-danger)}.cortex-media-block .cortex-media-block__source{margin:0;padding:.75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.5;white-space:pre;overflow-x:auto;color:var(--cortex-color-text)}.cortex-attachment-image{margin:.75em 0}.cortex-attachment-image .cortex-expandable{width:fit-content;max-width:100%}.cortex-attachment-image .cortex-expandable__content img{display:block;max-width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border)}.cortex-expandable__body .cortex-attachment-image__expanded{display:block;max-width:calc(100vw - 2rem - 2px);max-height:calc(100dvh - 5rem);margin:auto;border-radius:0}.cortex-attachment-image__caption{margin:.25rem 0 0;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-table-block{display:block;margin:.75em 0}.cortex-table-block th{white-space:nowrap}.cortex-table-block td{max-width:20rem}.cortex-table-block table{margin:0}.cortex-table-block .cortex-expandable{width:fit-content;max-width:100%}.cortex-table-block:has(table[dir=ltr])>.cortex-expandable{margin-right:auto}.cortex-table-block:has(table[dir=rtl])>.cortex-expandable{margin-left:auto}.cortex-table-block__expanded{padding:1rem}.cortex-table-block__expanded td{max-width:40rem}.cortex-reasoning-details{width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-reasoning-details__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.75rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-reasoning-details__summary::-webkit-details-marker{display:none}.cortex-reasoning-details__header{display:flex;align-items:center;gap:.5rem;min-width:0;flex:1}.cortex-reasoning-details__icon{display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}.cortex-reasoning-details__title-group{min-width:0}.cortex-reasoning-details__title-row{display:flex;align-items:center;gap:.5rem}.cortex-reasoning-details__title{font-weight:500;color:var(--cortex-color-text-strong);font-size:.875rem}.cortex-reasoning-details__badge{display:inline-flex;align-items:center;border-radius:calc(var(--cortex-radius) * .5);padding:.125rem .375rem;font-size:.6875rem;font-weight:500}.cortex-reasoning-details__badge--streaming{background:light-dark(#fef3c7,#78350f);color:light-dark(#b45309,#fcd34d)}.cortex-reasoning-details__badge--done{background:var(--cortex-color-success-border);color:var(--cortex-color-success)}.cortex-reasoning-details__chevron{margin-inline-start:auto;display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary>.cortex-reasoning-details__chevron{transform:rotate(180deg)}.cortex-reasoning-details__body{padding:0 1rem 1rem}.cortex-reasoning-details__content{margin-top:.25rem;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-surface);border:1px solid var(--cortex-color-border);padding:.75rem}.cortex-reasoning-details__pre{margin:0;white-space:pre-wrap;overflow-wrap:break-word;font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.625;color:var(--cortex-color-text-strong)}@keyframes cortex-aborted-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.cortex-aborted-flag{display:flex;align-items:center;gap:.625rem;padding:.25rem 0;animation:cortex-aborted-fade-in .3s ease-out both;-webkit-user-select:none;user-select:none}.cortex-aborted-flag__line{flex:1;height:1px;background:repeating-linear-gradient(90deg,#e2a36f 0px,#e2a36f 4px,transparent 4px,transparent 8px);opacity:.5}.cortex-aborted-flag__label{display:inline-flex;align-items:center;gap:.3125rem;font-family:var(--cortex-font-mono);font-size:.625rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:light-dark(#c2824a,#e2a36f)}.cortex-aborted-flag__icon{color:light-dark(#c2824a,#e2a36f);flex-shrink:0}.cortex-aborted-flag__reason{margin:.125rem 0 0;font-size:.75rem;line-height:1.4;text-align:center;overflow-wrap:anywhere;color:light-dark(#c2824a,#e2a36f)}.cortex-trigger-block{display:inline-flex;width:fit-content;padding:.375rem .75rem;border-radius:999px;background:var(--cortex-color-accent-surface);color:var(--cortex-color-text-strong);font-size:.75rem}.cortex-trigger-block__head{display:flex;align-items:center;gap:.5rem}.cortex-trigger-block__icon{flex-shrink:0;color:var(--cortex-color-accent)}.cortex-trigger-block__name{font-family:var(--cortex-font-mono);font-weight:600}.cortex-trigger-block__time{color:var(--cortex-color-text-secondary);font-size:.6875rem}.cortex-trigger-block--debug{display:flex;flex-direction:column;width:auto;gap:.375rem;padding:.5rem .75rem;border:1px dashed var(--cortex-color-border-strong);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.6875rem}.cortex-trigger-block--debug .cortex-trigger-block__head{font-family:var(--cortex-font-mono);letter-spacing:.04em;text-transform:uppercase;color:var(--cortex-color-text-secondary)}.cortex-trigger-block--debug .cortex-trigger-block__name{color:var(--cortex-color-text-strong)}.cortex-trigger-block--debug .cortex-trigger-block__time{margin-inline-start:auto;font-size:inherit;text-transform:none;letter-spacing:0}.cortex-trigger-block__payload{font-size:.75rem}.cortex-trigger-block__payload>summary{cursor:pointer;color:var(--cortex-color-text-secondary);-webkit-user-select:none;user-select:none}.cortex-trigger-block__payload[open]>summary{margin-bottom:.25rem}.cortex-widget__messages-disabled{padding:.75rem 1rem;text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-message-attachments{display:flex;flex-wrap:wrap;gap:.375rem}.cortex-message-attachments--user{justify-content:flex-end}.cortex-message-attachment{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:.25rem .5rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong);cursor:pointer;transition:background .15s}.cortex-message-attachment:hover{background:var(--cortex-color-surface-muted)}.cortex-message-attachment__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-message-attachment__icon,.cortex-message-attachment__dl-icon{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-debug-tool{--_accent: var(--cortex-color-border-strong);position:relative;width:100%;border-radius:10px;background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-debug-tool:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var(--_accent);z-index:1;transition:background .2s}.cortex-debug-tool[data-state=complete]{--_accent: var(--cortex-color-success)}.cortex-debug-tool[data-state=error]{--_accent: var(--cortex-color-danger)}.cortex-debug-tool[data-state=awaiting-input],.cortex-debug-tool[data-state=input-streaming],.cortex-debug-tool[data-state=input-complete]{--_accent: light-dark(#d97706, #fbbf24)}.cortex-debug-tool[data-state=approval-requested],.cortex-debug-tool[data-state=approval-responded]{--_accent: light-dark(#7c3aed, #a78bfa)}.cortex-debug-tool__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.625rem .875rem .625rem 1.125rem}.cortex-debug-tool__summary::-webkit-details-marker{display:none}.cortex-debug-tool__header{display:flex;align-items:flex-start;gap:.75rem}.cortex-debug-tool__meta{flex:1;min-width:0}.cortex-debug-tool__title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-debug-tool__name{font-weight:600;font-size:.8125rem;color:var(--cortex-color-text-heading);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.01em}.cortex-debug-tool__id-row{margin-top:2px;font-size:.625rem;color:var(--cortex-color-text-muted);font-family:ui-monospace,SF Mono,Cascadia Code,monospace;word-break:break-all}.cortex-debug-tool__actions{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.cortex-debug-tool__state{display:inline-flex;align-items:center;gap:5px;font-size:.6875rem;font-weight:500;padding:2px 8px;border-radius:4px;white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__state--success{color:var(--cortex-color-success);background:var(--cortex-color-success-surface)}.cortex-debug-tool__state--error{color:var(--cortex-color-danger);background:light-dark(#fef2f2,#450a0a)}.cortex-debug-tool__state--approval{color:light-dark(#7c3aed,#a78bfa);background:light-dark(#f5f3ff,#2e1065)}.cortex-debug-tool__state--pending{color:light-dark(#b45309,#fcd34d);background:light-dark(#fffbeb,#451a03)}.cortex-debug-tool__pulse{width:6px;height:6px;border-radius:50%;background:light-dark(#d97706,#fbbf24);animation:dbg-pulse 2s ease-in-out infinite}.cortex-debug-tool__pulse--violet{background:#8b5cf6}@keyframes dbg-pulse{0%,to{opacity:1}50%{opacity:.3}}.cortex-debug-tool__chevron{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:4px;color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary .cortex-debug-tool__chevron{transform:rotate(180deg)}.cortex-debug-tool__body{padding:0 .875rem .75rem 1.125rem}.cortex-debug-tool__section:not(:first-child){border-top:1px solid var(--cortex-color-border);padding-top:.625rem;margin-top:.625rem}.cortex-debug-tool__section-bar{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-debug-tool__section-label{font-size:.625rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-muted);font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__section-label--success{color:var(--cortex-color-success)}.cortex-debug-tool__section-label--error{color:var(--cortex-color-danger)}.cortex-debug-tool__section-label--approval{color:light-dark(#7c3aed,#a78bfa)}.cortex-debug-tool__section-lang{font-size:.5625rem;color:var(--cortex-color-border-strong);font-family:ui-monospace,SF Mono,monospace;text-transform:lowercase}.cortex-debug-tool__pre{margin:0;max-height:20rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre;overflow-wrap:break-word}.cortex-debug-tool__tree{max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__error-pre{margin:0;max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:light-dark(#fef2f2,#450a0a);color:light-dark(#991b1b,#fca5a5);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre-wrap;word-break:break-word}.cortex-debug-tool__message{padding:.5rem .75rem;font-size:.75rem;color:var(--cortex-color-text-secondary);border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__message--approval{color:light-dark(#5b21b6,#c4b5fd);background:light-dark(#faf5ff,#3b0764)}.cortex-debug-tool__section--success .cortex-debug-tool__tree{background:light-dark(#f0fdf4,#052e16)}.cortex-debug-tool__section--error .cortex-debug-tool__tree{background:light-dark(#fef2f2,#450a0a)}.cortex-tool-call-animated{display:block}.cortex-tool-pill{display:inline-flex;align-items:center;gap:.375rem;padding:.25rem 0;max-width:100%}.cortex-tool-pill__icon{position:relative;width:.75rem;height:.75rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--cortex-color-text-muted)}.cortex-tool-pill__spinner{position:absolute;width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;opacity:0;transition:opacity .2s}.cortex-tool-pill__spinner--visible{opacity:1;animation:cortex-tool-spin .8s linear infinite}@keyframes cortex-tool-spin{to{transform:rotate(360deg)}}.cortex-tool-pill__svg{position:absolute;width:.75rem;height:.75rem;opacity:0;transform:scale(.6);transition:opacity .2s,transform .2s}.cortex-tool-pill__svg--visible{opacity:1;transform:scale(1)}.cortex-tool-pill__svg--check{color:var(--cortex-color-success)}.cortex-tool-pill__svg--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title{font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .3s}.cortex-tool-pill__title--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title--pending{color:var(--cortex-color-text-muted);opacity:.6}.cortex-tool-pill__meta{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:.8;white-space:nowrap;font-variant-numeric:tabular-nums}.cortex-approval-card{display:block;max-width:min(100%,28rem);margin:.25rem 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-approval-card--asking{border-color:color-mix(in oklab,var(--cortex-color-accent) 45%,var(--cortex-color-border));box-shadow:0 0 0 3px color-mix(in oklab,var(--cortex-color-accent) 10%,transparent)}.cortex-approval-card__head{display:flex;align-items:center;gap:.5rem;padding:.625rem .75rem 0;font-size:.75rem;font-weight:600;color:var(--cortex-color-accent)}.cortex-approval-card__sentence{margin:0;padding:.375rem .75rem .5rem;font-weight:600;color:var(--cortex-color-text-heading)}.cortex-approval-card__foot{display:flex;gap:.5rem;padding:.625rem .75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-approval-card__button{border:1px solid var(--cortex-color-border-strong);border-radius:calc(var(--cortex-radius) * .75);background:var(--cortex-color-surface);padding:.375rem .875rem;font:inherit;font-size:.8125rem;font-weight:500;color:var(--cortex-color-text-strong);cursor:pointer}.cortex-approval-card__button--approve{border-color:var(--cortex-color-accent);background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground)}.cortex-approval-card__line{display:flex;align-items:baseline;gap:.5rem;padding:.5rem .75rem;font-size:.8125rem;color:var(--cortex-color-text-secondary)}.cortex-approval-card__line .cortex-tool-pill__icon{flex-shrink:0}.cortex-approval-card__decision{font-weight:600;color:var(--cortex-color-text-strong)}.cortex-approval-card__summary{min-width:0;flex:1}.cortex-tool-fold{display:block;align-self:flex-start;text-align:start;border:0;background:none;padding:0 0 .25rem;margin-block-start:-.625rem;margin-inline-start:1.125rem;font:inherit;font-size:.75rem;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-tool-fold:hover,.cortex-tool-fold:focus-visible{color:var(--cortex-color-text-secondary)}.cortex-client-tool-embed{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-client-tool-embed__bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border-block-end:1px solid var(--cortex-color-border-strong);font-size:12px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__cancel{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-client-tool-embed__cancel:hover{color:var(--cortex-color-danger)}.cortex-client-tool-embed__frame{display:block;inline-size:100%;block-size:420px;border:0;background:var(--cortex-color-surface)}.cortex-client-tool-embed__status{display:flex;align-items:center;gap:8px;padding:20px 16px;font-size:13px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__retry{border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:none;padding:4px 10px;font:inherit;font-size:12px;color:inherit;cursor:pointer}.cortex-client-tool-embed-dialog{border:0;padding:0;background:none;inline-size:min(560px,100vw - 48px);max-inline-size:none}.cortex-client-tool-embed-dialog::backdrop{background:#00000073}.cortex-client-tool-embed-dialog .cortex-client-tool-embed{inline-size:100%;max-inline-size:none;box-shadow:0 24px 64px #0000004d}.cortex-client-tool-embed-dialog .cortex-client-tool-embed__frame{block-size:min(70dvh,560px)}.cortex-location-input{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-location-input--settled{display:flex;gap:10px;border-color:var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-location-input__map{position:relative;block-size:11rem;background:var(--cortex-color-surface-muted)}.cortex-location-input__map--still{flex:none;inline-size:120px;block-size:84px}.cortex-location-input__canvas{block-size:100%}.cortex-location-input__still-failed{display:flex;align-items:center;justify-content:center;block-size:100%;padding:0 8px;font-size:11px;text-align:center;color:var(--cortex-color-text-muted)}.cortex-location-input__locate{position:absolute;inset-inline-end:10px;inset-block-start:10px;z-index:1001;display:inline-flex;align-items:center;justify-content:center;inline-size:30px;block-size:30px;border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 1px 3px #0003;cursor:pointer}.cortex-location-input__locate svg{inline-size:15px;block-size:15px}.cortex-location-input__locate:disabled{opacity:.45;cursor:default}.cortex-location-input__foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border-block-start:1px solid var(--cortex-color-border-strong);font-size:12px}.cortex-location-input__hint{display:inline-flex;align-items:center;gap:6px;min-inline-size:0;color:var(--cortex-color-text-muted)}.cortex-location-input__hint--failed{color:var(--cortex-color-danger)}.cortex-location-input__spinner{inline-size:.625rem;block-size:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-location-input__coords{font-family:var(--cortex-font-mono);font-size:.75rem;color:var(--cortex-color-text-secondary);direction:ltr;unicode-bidi:isolate}.cortex-location-input__actions{display:flex;align-items:center;gap:8px}.cortex-location-input__skip{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-location-input__skip:hover{color:var(--cortex-color-danger)}.cortex-location-input__skip:disabled{opacity:.45;cursor:default}.cortex-location-input__send{border:1px solid var(--cortex-color-primary);border-radius:8px;background:var(--cortex-color-primary);padding:4px 10px;font:inherit;font-size:12px;color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-location-input__send:disabled{opacity:.45;cursor:default}.cortex-location-input__body{display:flex;flex-direction:column;justify-content:center;gap:2px;min-inline-size:0;padding-block:8px;padding-inline-end:12px}.cortex-location-input__title{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--cortex-color-text-strong)}.cortex-location-input__title svg{inline-size:13px;block-size:13px;color:var(--cortex-color-success)}.cortex-reasoning-animated{display:block}.cortex-subtle-activity{display:flex;align-items:center;gap:.375rem;padding:.25rem 0;width:fit-content}.cortex-subtle-activity__dots{display:flex;align-items:center;gap:3px}.cortex-subtle-activity__dot{width:3px;height:3px;border-radius:9999px;background:var(--cortex-color-accent);animation:cortex-subtle-dot-pulse 1.4s ease-in-out infinite}.cortex-subtle-activity__dot--d1{animation-delay:.2s}.cortex-subtle-activity__dot--d2{animation-delay:.4s}@keyframes cortex-subtle-dot-pulse{0%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1.3)}}.cortex-subtle-activity__label-mask{overflow:hidden;position:relative;height:1.1em}.cortex-subtle-activity__label{display:block;font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;line-height:1.1em}.cortex-subtle-activity__label--idle,.cortex-subtle-activity__label--entering{opacity:1;transform:translateY(0);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--exiting{opacity:0;transform:translateY(-6px);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--enter-start{opacity:0;transform:translateY(6px);transition:none}.cortex-attachment-queue{display:flex;flex-wrap:wrap;gap:.375rem;margin-bottom:.5rem}.cortex-attachment-chip{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding-block:.25rem;padding-inline:.5rem .375rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong)}.cortex-attachment-chip--error{align-items:flex-start;max-width:100%;border-color:var(--cortex-color-danger-border);background:var(--cortex-color-danger-surface);color:var(--cortex-color-danger)}.cortex-attachment-chip__icon,.cortex-attachment-chip__spinner{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-attachment-chip__spinner{animation:cortex-attachment-spin .8s linear infinite}.cortex-attachment-chip__spinner-track{opacity:.25}@keyframes cortex-attachment-spin{to{transform:rotate(360deg)}}.cortex-attachment-chip__text{display:grid;min-width:0;text-align:start}.cortex-attachment-chip__reason{font-size:.71875rem;opacity:.9}.cortex-attachment-chip--error .cortex-attachment-chip__icon{color:currentColor}.cortex-attachment-chip__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-attachment-chip__remove{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:1rem;height:1rem;padding:0;border:0;border-radius:3px;background:transparent;color:currentColor;opacity:.6;cursor:pointer}.cortex-attachment-chip__remove:hover{opacity:1;background:var(--cortex-color-hover)}.cortex-attachment-chip__remove svg{width:.75rem;height:.75rem}.cortex-token-usage{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-token-usage__summary{align-self:end}html[dir=ltr] .cortex-token-usage__summary{align-self:start}.cortex-token-usage__summary{display:inline-flex;align-items:center;gap:.625rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-token-usage__summary:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-token-usage__summary{flex-wrap:wrap;max-width:100%;text-align:start}.cortex-token-usage__total-number{font-weight:600;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__total-label{margin-inline-start:3px;color:var(--cortex-color-text-muted);font-weight:400;letter-spacing:.03em}.cortex-token-usage__model{color:var(--cortex-color-border-strong);font-weight:400;font-size:.5625rem;letter-spacing:.02em;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-token-usage__pills{display:inline-flex;align-items:center;gap:.5rem}.cortex-token-usage__pill{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-muted)}.cortex-token-usage__dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.cortex-token-usage__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 2px #ea580c1a}.cortex-token-usage__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 2px #4f46e51a}.cortex-token-usage__cache-badge{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 6px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-token-usage--expanded .cortex-token-usage__chevron{transform:rotate(180deg)}.cortex-token-usage__details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-token-usage__details-inner{overflow:hidden}.cortex-token-usage--expanded .cortex-token-usage__details{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-token-usage__columns{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--cortex-color-border);border-radius:8px;overflow:hidden}.cortex-token-usage__col{background:var(--cortex-color-surface-subtle);padding:.5rem .625rem}.cortex-token-usage__col-header{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-token-usage__col-label{font-weight:600;font-size:.5625rem;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-secondary);font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__col-total{margin-inline-start:auto;font-weight:700;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__rows{display:flex;flex-direction:column;gap:1px}.cortex-token-usage__row{display:flex;align-items:baseline;justify-content:space-between;padding:2px 0;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__row-label{color:var(--cortex-color-text-muted);font-size:.625rem}.cortex-token-usage__row-value{font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary);font-weight:500}.cortex-token-usage__cache-bar-row{display:flex;align-items:center;gap:.5rem;margin-top:.5rem;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__cache-bar{flex:1;height:3px;border-radius:2px;background:var(--cortex-color-border);overflow:hidden}.cortex-token-usage__cache-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#10b981,var(--cortex-color-success));transition:width .4s cubic-bezier(.4,0,.2,1)}.cortex-token-usage__cache-label{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-llm-inspector__trigger{align-self:end}html[dir=ltr] .cortex-llm-inspector__trigger{align-self:start}.cortex-llm-inspector__trigger{display:inline-flex;align-items:center;gap:.5rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-llm-inspector__trigger:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-llm-inspector__icon{color:var(--cortex-color-text-muted);flex-shrink:0}.cortex-llm-inspector__loading{color:var(--cortex-color-border-strong);font-style:italic}.cortex-llm-inspector__badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;padding:0 .35rem;border-radius:9999px;background:var(--cortex-color-border);color:var(--cortex-color-text-secondary);font-size:.5625rem;font-weight:700}.cortex-llm-inspector__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-llm-inspector--open .cortex-llm-inspector__chevron{transform:rotate(180deg)}.cortex-llm-inspector__panel-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-llm-inspector__panel-inner{overflow:hidden}.cortex-llm-inspector--open .cortex-llm-inspector__panel-wrapper{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-llm-inspector__panel{display:flex;flex-direction:column;gap:.375rem}.cortex-llm-inspector__empty{padding:.625rem;color:var(--cortex-color-text-muted);font-style:italic}.cortex-llm-inspector__step{border-radius:8px;background:var(--cortex-color-surface-subtle);overflow:hidden;transition:box-shadow .2s ease}.cortex-llm-inspector__step--expanded{box-shadow:0 0 0 1px var(--cortex-color-border)}.cortex-llm-inspector__step-header{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .625rem;border:none;background:transparent;cursor:pointer;font:inherit;color:inherit;text-align:start;transition:background .15s ease}.cortex-llm-inspector__step-header:hover{background:#00000005}.cortex-llm-inspector__step-label{font-weight:600;color:var(--cortex-color-text-secondary);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-metrics{display:inline-flex;align-items:center;gap:.625rem;margin-inline-start:auto;font-variant-numeric:tabular-nums}.cortex-llm-inspector__metric{display:inline-flex;align-items:center;gap:3px}.cortex-llm-inspector__dot{width:5px;height:5px;border-radius:50%;flex-shrink:0}.cortex-llm-inspector__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 1.5px #ea580c1f}.cortex-llm-inspector__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 1.5px #4f46e51f}.cortex-llm-inspector__cache-pct{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 5px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-chevron{color:var(--cortex-color-border-strong);transition:transform .2s ease;flex-shrink:0}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-chevron{transform:rotate(180deg)}.cortex-llm-inspector__step-body-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease;opacity:0}.cortex-llm-inspector__step-body-inner{overflow:hidden}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-body-wrapper{grid-template-rows:1fr;opacity:1}.cortex-llm-inspector__step-body{padding:0 .625rem .625rem;display:flex;flex-direction:column;gap:.5rem}.cortex-llm-inspector__usage-rows{display:flex;flex-direction:column;border-radius:6px;overflow:hidden;background:var(--cortex-color-border);gap:1px}.cortex-llm-inspector__usage-row{display:flex;align-items:baseline;gap:.5rem;padding:.375rem .625rem;background:var(--cortex-color-surface);flex-wrap:wrap}.cortex-llm-inspector__usage-row--total{background:light-dark(#fafbfc,#141414)}.cortex-llm-inspector__usage-lbl{font-size:.5625rem;text-transform:uppercase;letter-spacing:.05em;color:var(--cortex-color-text-muted);font-weight:600;width:3.25rem;flex-shrink:0;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__usage-val{font-variant-numeric:tabular-nums;font-weight:600;color:var(--cortex-color-text-secondary);min-width:3rem}.cortex-llm-inspector__usage-row--total .cortex-llm-inspector__usage-val{font-weight:700;color:var(--cortex-color-text-heading)}.cortex-llm-inspector__usage-detail{color:var(--cortex-color-border-strong);font-size:.5625rem;margin-inline-start:auto}.cortex-llm-inspector__tabs{display:flex;gap:0;border-bottom:1px solid var(--cortex-color-border)}.cortex-llm-inspector__tab{padding:.375rem .75rem;border:none;background:transparent;cursor:pointer;font:inherit;color:var(--cortex-color-text-muted);font-weight:500;position:relative;transition:color .15s ease;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__tab:hover{color:var(--cortex-color-text-secondary)}.cortex-llm-inspector__tab--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-llm-inspector__tab--active:after{content:"";position:absolute;inset-inline:0;bottom:-1px;height:2px;background:var(--cortex-color-text-heading);border-radius:1px 1px 0 0}.cortex-llm-inspector__json-pane{position:relative;max-height:24rem;overflow:auto;padding:.625rem;background:var(--cortex-color-surface);border-radius:6px}.cortex-llm-inspector__json-copy{position:sticky;top:0;float:inline-end;z-index:1}.cortex-json-tree{display:block;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.75rem;line-height:1.25rem;-webkit-user-select:text;user-select:text;white-space:pre-wrap;word-break:break-word}.cortex-json-tree__indent{padding-inline-start:1.25em;border-inline-start:1px solid var(--cortex-color-border);margin-inline-start:.3em}.cortex-json-tree__line{position:relative}.cortex-json-tree__toggle{cursor:pointer;-webkit-user-select:none;user-select:none}.cortex-json-tree__toggle:hover .cortex-json-tree__arrow{color:var(--cortex-color-text)}.cortex-json-tree__arrow{display:inline-block;width:1em;text-align:center;color:var(--cortex-color-text-muted);font-size:.525rem;transition:transform .15s ease;vertical-align:middle}.cortex-json-tree__arrow--collapsed{transform:rotate(-90deg)}.cortex-json-tree__bracket{color:var(--cortex-color-text-secondary)}.cortex-json-tree__key{color:light-dark(#6366f1,#818cf8)}.cortex-json-tree__colon{color:var(--cortex-color-text-secondary)}.cortex-json-tree__comma{color:var(--cortex-color-text-muted)}.cortex-json-tree__string{color:var(--cortex-color-success)}.cortex-json-tree__number{color:light-dark(#2563eb,#60a5fa)}.cortex-json-tree__boolean{color:light-dark(#d97706,#fbbf24)}.cortex-json-tree__null{color:var(--cortex-color-text-muted);font-style:italic}.cortex-json-tree__collapsed-hint{display:inline-block;padding:0 .4em;margin:0 .15em;font-size:.625rem;line-height:1.5;color:var(--cortex-color-text-muted);background:var(--cortex-color-surface-subtle);border:1px solid var(--cortex-color-border);border-radius:3px;font-style:italic;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:middle}.cortex-json-tree__collapsed-hint:hover{color:var(--cortex-color-text-secondary);border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface-muted)}.cortex-copy-btn{display:inline-flex;align-items:center}.cortex-copy-btn__button{display:inline-flex;align-items:center;justify-content:center;width:1.375rem;height:1.375rem;padding:0;border:none;border-radius:3px;background:transparent;color:var(--cortex-color-text-muted);cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease,background .15s ease}:hover>cortex-copy-button .cortex-copy-btn__button,:hover>.cortex-copy-btn .cortex-copy-btn__button,.cortex-copy-btn__button:hover,.cortex-copy-btn__button:focus-visible{opacity:1}.cortex-copy-btn__button:hover{background:var(--cortex-color-hover);color:var(--cortex-color-text)}.cortex-copy-btn__button--copied{opacity:1;color:var(--cortex-color-success);pointer-events:none}.cortex-copy-btn__button--copied:hover{color:var(--cortex-color-success);background:transparent}.cortex-copy-btn__icon{flex-shrink:0}.cortex-copy-btn__icon--check{animation:cortex-copy-pop .25s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes cortex-copy-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.cortex-widget *,.cortex-widget *:before,.cortex-widget *:after,.cortex-widget *::backdrop{animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:.01ms!important;transition-delay:0s!important}}\n'],
11999
12513
  dependencies: [
12000
12514
  {
12001
12515
  kind: "component",
@@ -12159,8 +12673,8 @@ i0.ɵɵngDeclareClassMetadata({
12159
12673
  <div class="cortex-widget__sidebar-backdrop" (click)="closeSidebar()"></div>
12160
12674
  </div>
12161
12675
 
12162
- <!-- The widget's own parts, each standing in for a slot the host left empty.
12163
- Marked like a host's slot so each default's context is typed the same way. -->
12676
+ <!-- The widget's own parts, each standing in for a slot the consumer left empty.
12677
+ Marked like a consumer's slot so each default's context is typed the same way. -->
12164
12678
  <ng-template cortexSlot="header" #defaultHeader let-header>
12165
12679
  <cortex-chat-header [context]="header" />
12166
12680
  </ng-template>
@@ -12179,10 +12693,15 @@ i0.ɵɵngDeclareClassMetadata({
12179
12693
  </ng-template>
12180
12694
 
12181
12695
  <!-- The composer, or the notice an agent that takes no messages shows instead.
12182
- Nothing until the handshake answers: a first send before it could open a
12183
- thread /chat refuses. -->
12696
+ No composer until the handshake answers: a first send before it could open
12697
+ a thread /chat refuses. Nothing while the first answer is out, then why
12698
+ Cortex has not answered. -->
12184
12699
  <ng-template #composer>
12185
- @if (chatService.capabilities()?.messages === false) {
12700
+ @if (unansweredNotice(); as notice) {
12701
+ <p class="cortex-widget__messages-disabled">
12702
+ {{ notice | translate }}
12703
+ </p>
12704
+ } @else if (chatService.capabilities()?.messages === false) {
12186
12705
  <p class="cortex-widget__messages-disabled">
12187
12706
  {{ 'translate_messages_disabled' | translate }}
12188
12707
  </p>
@@ -12191,7 +12710,7 @@ i0.ɵɵngDeclareClassMetadata({
12191
12710
  }
12192
12711
  </ng-template>
12193
12712
  `,
12194
- styles: ['@charset "UTF-8";:root{--cortex-color-surface: light-dark(#ffffff, #0a0a0a);--cortex-color-surface-subtle: light-dark(#f8fafc, #141414);--cortex-color-surface-muted: light-dark(#f1f5f9, #1f1f1f);--cortex-color-border: light-dark(#e2e8f0, #2e2e2e);--cortex-color-border-strong: light-dark(#cbd5e1, #444444);--cortex-color-text-heading: light-dark(#1e293b, #fafafa);--cortex-color-text-strong: light-dark(#334155, #e5e5e5);--cortex-color-text: light-dark(#475569, #d4d4d4);--cortex-color-text-secondary: light-dark(#64748b, #a3a3a3);--cortex-color-text-muted: light-dark(#94a3b8, #737373);--cortex-color-primary: light-dark(#1e293b, #fafafa);--cortex-color-primary-foreground: light-dark(#ffffff, #0a0a0a);--cortex-color-accent: light-dark(#4f46e5, #818cf8);--cortex-color-accent-surface: light-dark(#e0e7ff, #312e81);--cortex-color-link: light-dark(#2563eb, #60a5fa);--cortex-color-hover: light-dark(rgba(0, 0, 0, .05), rgba(255, 255, 255, .06));--cortex-color-user-surface: var(--cortex-color-surface-subtle);--cortex-color-user-border: var(--cortex-color-border);--cortex-color-code-text: light-dark(#334155, #e5e5e5);--cortex-color-success: light-dark(#059669, #34d399);--cortex-color-success-surface: light-dark(#ecfdf5, #064e3b);--cortex-color-success-border: light-dark(#d1fae5, #065f46);--cortex-color-danger: light-dark(#dc2626, #f87171);--cortex-color-danger-surface: light-dark(#fef2f2, #450a0a);--cortex-color-danger-border: light-dark(#fecaca, #7f1d1d);--cortex-radius: .5rem;--cortex-font-mono: var( --default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace );--cortex-font-size: .8125rem}.cortex-widget{color-scheme:light}.cortex-widget[data-cortex-theme=dark]{color-scheme:dark}.cortex-widget[data-cortex-theme=system]{color-scheme:light dark}@layer base.cortex{:where(.cortex-widget),:where(.cortex-widget) *,:where(.cortex-widget) :before,:where(.cortex-widget) :after{box-sizing:border-box;margin:0;padding:0;border:0 solid}:where(.cortex-widget){tab-size:4}:where(.cortex-widget) hr{height:0;color:inherit;border-top-width:1px}:where(.cortex-widget) :is(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}:where(.cortex-widget) a{color:inherit;text-decoration:inherit}:where(.cortex-widget) :is(b,strong){font-weight:bolder}:where(.cortex-widget) :is(code,kbd,samp,pre){font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}:where(.cortex-widget) small{font-size:80%}:where(.cortex-widget) :is(sub,sup){font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.cortex-widget) sub{bottom:-.25em}:where(.cortex-widget) sup{top:-.5em}:where(.cortex-widget) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.cortex-widget) :is(ol,ul,menu){list-style:none}:where(.cortex-widget) :is(img,svg,video,canvas,audio,iframe,embed,object){display:block;vertical-align:middle}:where(.cortex-widget) :is(img,video){max-width:100%;height:auto}:where(.cortex-widget) :is(button,input,select,optgroup,textarea){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(.cortex-widget) ::placeholder{opacity:1;color:color-mix(in oklab,currentcolor 50%,transparent)}:where(.cortex-widget) textarea{resize:vertical}}.cortex-widget .hljs{color:light-dark(#24292e,#c9d1d9);background:transparent}.cortex-widget .hljs-doctag,.cortex-widget .hljs-keyword,.cortex-widget .hljs-meta .hljs-keyword,.cortex-widget .hljs-template-tag,.cortex-widget .hljs-template-variable,.cortex-widget .hljs-type,.cortex-widget .hljs-variable.language_{color:light-dark(#d73a49,#ff7b72)}.cortex-widget .hljs-title,.cortex-widget .hljs-title.class_,.cortex-widget .hljs-title.class_.inherited__,.cortex-widget .hljs-title.function_{color:light-dark(#6f42c1,#d2a8ff)}.cortex-widget .hljs-attr,.cortex-widget .hljs-attribute,.cortex-widget .hljs-literal,.cortex-widget .hljs-meta,.cortex-widget .hljs-number,.cortex-widget .hljs-operator,.cortex-widget .hljs-selector-attr,.cortex-widget .hljs-selector-class,.cortex-widget .hljs-selector-id,.cortex-widget .hljs-variable{color:light-dark(#005cc5,#79c0ff)}.cortex-widget .hljs-meta .hljs-string,.cortex-widget .hljs-regexp,.cortex-widget .hljs-string{color:light-dark(#032f62,#a5d6ff)}.cortex-widget .hljs-built_in,.cortex-widget .hljs-symbol{color:light-dark(#e36209,#ffa657)}.cortex-widget .hljs-code,.cortex-widget .hljs-comment,.cortex-widget .hljs-formula{color:light-dark(#6a737d,#8b949e)}.cortex-widget .hljs-name,.cortex-widget .hljs-quote,.cortex-widget .hljs-selector-pseudo,.cortex-widget .hljs-selector-tag{color:light-dark(#22863a,#7ee787)}.cortex-widget .hljs-subst{color:light-dark(#24292e,#c9d1d9)}.cortex-widget .hljs-section{color:light-dark(#005cc5,#1f6feb);font-weight:700}.cortex-widget .hljs-bullet{color:light-dark(#735c0f,#f2cc60)}.cortex-widget .hljs-emphasis{font-style:italic}.cortex-widget .hljs-strong{font-weight:700}.cortex-widget .hljs-addition{color:light-dark(#22863a,#aff5b4);background-color:light-dark(#f0fff4,#033a16)}.cortex-widget .hljs-deletion{color:light-dark(#b31d28,#ffdcd7);background-color:light-dark(#ffeef0,#67060c)}.cortex-widget{display:block}.cortex-widget__container{width:100%;height:100%;position:relative;overflow:hidden}.cortex-widget__screen{position:absolute;inset:0;display:flex;flex-direction:column;transition:transform .3s ease-out}.cortex-widget__screen--active{transform:translate(0)}.cortex-widget__screen--left{transform:translate(-100%)}[dir=rtl] .cortex-widget__screen--left,.cortex-widget__screen--right{transform:translate(100%)}[dir=rtl] .cortex-widget__screen--right{transform:translate(-100%)}@keyframes cortex-skeleton-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.cortex-skeleton{background:linear-gradient(90deg,var(--cortex-color-border) 0%,var(--cortex-color-surface-muted) 40%,var(--cortex-color-border) 80%);background-size:200% 100%;animation:cortex-skeleton-shimmer 1.8s ease-in-out infinite;border-radius:6px}.cortex-widget__messages-skeleton{flex:1;overflow:hidden;padding:1rem;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel{width:100%;display:flex;flex-direction:column}.cortex-widget__msg-skel--user{align-items:flex-end}.cortex-widget__msg-skel--assistant{align-items:flex-start}.cortex-widget__msg-skel-bubble{max-width:80%;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel-bubble--user{padding:.75rem 1rem;border-radius:calc(var(--cortex-radius) * 2);border-end-end-radius:0;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-widget__msg-skel-line{height:.75rem;max-width:100%}.cortex-widget__messages{flex:1;overflow:hidden}.cortex-widget__container--full{display:flex;flex-direction:row}.cortex-widget__container--full>.cortex-widget__screen{position:relative;inset:auto;transition:none}.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--active,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--left,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--right{transform:none}.cortex-widget__container--full>.cortex-widget__screen:first-child{width:280px;min-width:280px;flex-shrink:0;border-right:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{border-right:0;border-left:1px solid var(--cortex-color-border)}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__back-btn,.cortex-widget__container--full .cortex-widget__history-btn{display:none}@media(min-width:769px){.cortex-widget__container--full>.cortex-widget__screen:nth-child(2) .cortex-widget__new-btn{display:none}}.cortex-widget__container--full .cortex-widget__chat-title{font-size:var(--cortex-font-size-header, .875rem)}.cortex-widget__container--full .cortex-widget__chat-header{background:var(--cortex-color-surface)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1.5rem max(2rem,(100% - 48rem) / 2)}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem max(2rem,(100% - 48rem) / 2) 1.25rem}@media(max-width:768px){.cortex-widget__container--full>.cortex-widget__screen:first-child{position:fixed;inset:0;width:280px;min-width:280px;z-index:110;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{transform:translate(100%);border-left:1px solid var(--cortex-color-border);border-right:0}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-secondary)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:hover{color:var(--cortex-color-text-strong);background:var(--cortex-color-surface-muted)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:active{background:var(--cortex-color-border)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem}}@media(max-width:768px){.cortex-widget__container--full.cortex-widget__container--sidebar-open>.cortex-widget__screen:first-child{transform:translate(0)}.cortex-widget__container--full.cortex-widget__container--sidebar-open .cortex-widget__sidebar-backdrop{display:block;position:fixed;inset:0;z-index:100;background:#0f172a59;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:cortex-sidebar-backdrop-in .2s ease-out both}}@keyframes cortex-sidebar-backdrop-in{0%{opacity:0}to{opacity:1}}.cortex-widget__chat-header{flex-shrink:0;height:3rem;padding:0 1rem;display:flex;align-items:center;gap:.75rem;border-bottom:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__header-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__header-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-surface-muted)}[dir=rtl] .cortex-widget__back-icon{transform:rotate(180deg)}.cortex-widget__chat-title-wrap{min-width:0;flex:1}.cortex-widget__chat-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, var(--cortex-font-size));font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__debug-btn{flex-shrink:0;font-size:.6875rem;font-weight:500;padding:.25rem .625rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__debug-btn--on{background:light-dark(#fef3c7,#78350f);color:light-dark(#d97706,#fbbf24)}.cortex-widget__debug-btn--on:hover{background:light-dark(#fde68a,#92400e)}.cortex-widget__debug-btn--off{background:var(--cortex-color-surface-muted);color:var(--cortex-color-text-muted)}.cortex-widget__debug-btn--off:hover{background:var(--cortex-color-border)}.cortex-widget__landing{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:1.25rem;text-align:center}.cortex-widget__landing .cortex-widget__landing-composer{max-width:26rem}.cortex-widget__landing-composer{width:100%}.cortex-widget__landing-composer .cortex-widget__input-area{padding:1rem 0 0;border-top:0;background:transparent}.cortex-widget__landing-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent);display:flex;align-items:center;justify-content:center;margin-bottom:.875rem}[dir=rtl] .cortex-widget__landing-icon{transform:scaleX(-1)}.cortex-widget__landing-greeting{font-family:var(--cortex-font-display, inherit);font-size:1.0625rem;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading);margin:0}.cortex-widget__landing-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;margin-top:.875rem}.cortex-widget__landing-chip{border:1px solid var(--cortex-color-border);border-radius:999px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);font-size:.75rem;font-weight:500;padding:.375rem .75rem;cursor:pointer;transition:border-color .15s,color .15s}.cortex-widget__landing-chip:hover{border-color:var(--cortex-color-accent);color:var(--cortex-color-accent)}.cortex-widget__landing-recent{width:100%;max-width:26rem;margin-top:1rem;display:flex;flex-direction:column}.cortex-widget__landing-recent-item{display:flex;align-items:center;gap:.75rem;padding:.4375rem .625rem;border:0;border-radius:calc(var(--cortex-radius) * .75);background:transparent;cursor:pointer;transition:background-color .15s}.cortex-widget__landing-recent-item:hover{background:var(--cortex-color-hover)}.cortex-widget__landing-recent-title{flex:1;min-width:0;text-align:start;font-size:var(--cortex-font-size);font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__landing-recent-time{flex-shrink:0;font-size:.6875rem;color:var(--cortex-color-text-muted);margin:0}cortex-chat-composer,cortex-message-tool-call-outcome,cortex-llm-usage-chips{display:contents}.cortex-widget__input-area{flex-shrink:0;padding:.75rem;background:var(--cortex-color-surface);border-top:1px solid var(--cortex-color-border)}.cortex-widget__input-box{display:flex;align-items:flex-end;gap:.5rem;border-radius:calc(var(--cortex-radius) * 1.5);border:1px solid var(--cortex-color-border);padding:.375rem;background:color-mix(in oklab,var(--cortex-color-surface-subtle) 45%,var(--cortex-color-surface));transition:border-color .15s,background-color .15s}.cortex-widget__input-box--enabled:focus-within{border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface)}.cortex-widget__input-box--dragging{border-color:var(--cortex-color-text-heading);border-style:dashed;background:var(--cortex-color-surface-muted)}.cortex-widget__textarea,.cortex-widget__textarea:focus,.cortex-widget__textarea:focus-visible,.cortex-widget__textarea:disabled{background:transparent;border:0;outline:none;box-shadow:none}.cortex-widget__textarea{flex:1;resize:none;font-size:var(--cortex-font-size-message, var(--cortex-font-size));padding:.375rem .5rem;min-height:28px;max-height:calc(5.5 * var(--cortex-font-size-message, var(--cortex-font-size)) + .75rem);overflow-y:auto;line-height:1.375;color:var(--cortex-color-text-strong)}.cortex-widget__textarea::placeholder{color:var(--cortex-color-text-muted)}.cortex-widget__textarea--disabled{color:var(--cortex-color-text-muted);cursor:not-allowed}.cortex-widget__textarea:disabled{cursor:not-allowed}.cortex-widget__input-actions{flex-shrink:0;display:flex;align-items:center;gap:.375rem}@keyframes cortex-stop-pulse-ring{0%{opacity:.45;transform:scale(1)}50%{opacity:.15;transform:scale(1.12)}to{opacity:.45;transform:scale(1)}}@keyframes cortex-stop-fade-in{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}.cortex-stop-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;background:var(--cortex-color-danger);color:#fff;border:0;animation:cortex-stop-fade-in .2s ease-out both;transition:background .15s ease}.cortex-stop-btn:hover{background:color-mix(in oklab,var(--cortex-color-danger) 85%,black)}.cortex-stop-btn:active{transform:scale(.92)}.cortex-stop-btn__ring{position:absolute;inset:0;border-radius:var(--cortex-radius);background:var(--cortex-color-danger);animation:cortex-stop-pulse-ring 2s ease-in-out infinite;pointer-events:none}.cortex-stop-btn__icon{position:relative;z-index:1}.cortex-widget__attach-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__attach-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-widget__file-input{display:none}.cortex-widget__send-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;border:0;transition:background-color .15s;cursor:default}.cortex-widget__send-btn--empty{background:var(--cortex-color-send-empty, transparent);color:var(--cortex-color-send-empty-text, var(--cortex-color-text-muted))}.cortex-widget__send-btn--ready{background:var(--cortex-color-primary);color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-widget__send-btn--ready:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}[dir=rtl] .cortex-widget__send-icon{transform:rotate(180deg)}.cortex-widget__threads-header{flex-shrink:0;padding:1.25rem 1.25rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-widget__threads-header .cortex-widget__new-btn{margin-inline-start:auto}.cortex-widget__threads-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, .9375rem);font-weight:600;color:var(--cortex-color-text-heading);letter-spacing:-.01em;margin:0}.cortex-widget__threads-count{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0}.cortex-widget__new-chat-btn{display:inline-flex;align-items:center;gap:.375rem;font-size:.75rem;font-weight:500;color:var(--cortex-color-primary-foreground);background:var(--cortex-color-primary);padding:.375rem .75rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__new-chat-btn:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}.cortex-widget__new-chat-btn:active{background:var(--cortex-color-primary)}.cortex-widget__new-chat-btn--empty-state{margin-top:.75rem}.cortex-widget__threads-list{flex:1;overflow-y:auto;padding:0 .75rem .75rem}.cortex-widget__thread-skeleton{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.375rem;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__thread-skeleton-icon{flex-shrink:0;width:2rem;height:2rem}.cortex-widget__thread-skeleton-lines{flex:1;display:flex;flex-direction:column;gap:.375rem}.cortex-widget__thread-skeleton-line{height:.875rem}.cortex-widget__thread-item{width:100%;text-align:start;padding:.75rem;border-radius:var(--cortex-radius);display:flex;align-items:center;gap:.75rem;transition:background-color .15s,border-color .15s;cursor:pointer;margin-bottom:.375rem;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface);color:var(--cortex-color-text)}.cortex-widget__thread-item:hover{background:var(--cortex-color-surface-muted);border-color:var(--cortex-color-border-strong)}.cortex-widget__thread-item:active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border))}.cortex-widget__thread-item--active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border));border-color:var(--cortex-color-border-strong);color:var(--cortex-color-text-heading)}.cortex-widget__thread-item--active:hover{background:var(--cortex-color-border)}.cortex-widget__thread-item--active:active{background:color-mix(in oklab,var(--cortex-color-border) 50%,var(--cortex-color-border-strong))}.cortex-widget__thread-icon{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;font-size:.6875rem;font-weight:600;background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}[dir=rtl] .cortex-widget__thread-icon{transform:scaleX(-1)}.cortex-widget__thread-icon--active{background:color-mix(in oklab,var(--cortex-color-accent-surface) 85%,var(--cortex-color-accent))}.cortex-widget__thread-info{min-width:0;flex:1}.cortex-widget__thread-title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-widget__thread-title{font-size:var(--cortex-font-size);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.25;margin:0;color:var(--cortex-color-text-strong)}.cortex-widget__thread-title--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-widget__thread-time{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-widget__thread-running{flex-shrink:0;display:inline-flex;align-items:center;gap:.3125rem;padding:.2rem .45rem;border-radius:999px;background:var(--cortex-color-success-surface);color:var(--cortex-color-success);font-size:.625rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.cortex-widget__thread-running-dot{width:.375rem;height:.375rem;border-radius:999px;background:currentColor;box-shadow:0 0 .45rem currentColor;animation:cortex-thread-running-pulse 1.4s ease-in-out infinite}@keyframes cortex-thread-running-pulse{0%,to{opacity:.45;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.cortex-widget__thread-delete{flex-shrink:0;opacity:0;width:1.75rem;height:1.75rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .15s;background:transparent;border:0;color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-delete{opacity:1}.cortex-widget__thread-delete:hover{background:var(--cortex-color-border)}.cortex-widget__thread-delete--active{color:var(--cortex-color-text-secondary)}.cortex-widget__thread-delete--active:hover{color:var(--cortex-color-text)}.cortex-widget__thread-arrow{flex-shrink:0;transition:color .15s;color:var(--cortex-color-border-strong)}[dir=rtl] .cortex-widget__thread-arrow{transform:rotate(180deg)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow{color:var(--cortex-color-text-muted)}.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-secondary)}.cortex-widget__threads-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 0;text-align:center}.cortex-widget__threads-empty-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);display:flex;align-items:center;justify-content:center;margin-bottom:.75rem}.cortex-widget__threads-empty-svg{color:var(--cortex-color-accent)}.cortex-widget__threads-empty-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size);color:var(--cortex-color-text-muted);font-weight:500;margin:0}.cortex-widget__threads-empty-subtitle{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.25rem;margin-bottom:0}.cortex-widget__sidebar-toggle-btn,.cortex-widget__sidebar-backdrop{display:none}.cortex-message-list{height:100%;overflow-y:auto;overflow-x:hidden;width:100%;padding:1rem}.cortex-message-list__content{position:relative;display:flex;flex-direction:column;gap:.5rem}.cortex-message-list__content--settling{animation:cortex-content-settle .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-content-settle{0%{translate:0 var(--cortex-slide)}}.cortex-widget__screen>.cortex-send-flight{position:absolute;z-index:2;margin:0;max-width:none;pointer-events:none;animation:cortex-send-fade 80ms linear both,cortex-send-fly .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-send-fade{0%{opacity:0}}@keyframes cortex-send-fly{0%{translate:var(--cortex-fly-x) var(--cortex-fly-y)}}.cortex-working-thinking{padding-inline-start:2rem;--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-working-thinking{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}.cortex-working-avatar{position:absolute;top:0;inset-inline-start:0;z-index:1;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:9999px;background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground);translate:0 var(--cortex-avatar-y, 0);visibility:hidden;pointer-events:none}.cortex-working-avatar svg{width:.875rem;height:.875rem}.cortex-working-avatar--shown{visibility:visible;transition:translate .42s cubic-bezier(.76,0,.24,1);animation:cortex-avatar-in .7s cubic-bezier(.16,1,.3,1) both}.cortex-working-avatar--leaving{animation:cortex-avatar-out .36s cubic-bezier(.5,0,.75,0) .12s both}.cortex-working-avatar__ring{position:absolute;inset:-.25rem;border-radius:9999px;border:1.5px solid color-mix(in oklab,var(--cortex-color-accent) 18%,transparent);border-top-color:var(--cortex-color-accent);border-right-color:color-mix(in oklab,var(--cortex-color-accent) 45%,transparent)}.cortex-working-avatar--shown .cortex-working-avatar__ring{animation:cortex-tool-spin 1s linear infinite}.cortex-working-avatar--leaving .cortex-working-avatar__ring{animation:cortex-avatar-ring-out .22s ease-out both}@keyframes cortex-avatar-in{0%{opacity:0;transform:translateY(2.5rem) scale(.7)}}@keyframes cortex-avatar-out{to{opacity:0;transform:scale(.4)}}@keyframes cortex-avatar-ring-out{to{opacity:0}}.cortex-message{min-width:0;transition:margin-block-start .42s cubic-bezier(.76,0,.24,1)}.cortex-message:empty{display:none}.cortex-message:has(.cortex-message-part--folded):not(:has(.cortex-message-part:not(.cortex-message-part--folded))){margin-block-start:-.5rem;transition-delay:.6s}.cortex-text-bubble--assistant,.cortex-subtle-activity,.cortex-tool-pill,.cortex-tool-pill .cortex-tool-pill__icon{transition:translate .42s cubic-bezier(.76,0,.24,1) .16s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity,.cortex-message--working-turn .cortex-tool-pill,.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{transition-delay:0s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity{translate:2rem}[dir=rtl] .cortex-message--working-turn .cortex-text-bubble--assistant,[dir=rtl] .cortex-message--working-turn .cortex-subtle-activity{translate:-2rem}.cortex-message--working-turn .cortex-tool-pill{translate:.875rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill{translate:-.875rem}.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:-.5rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:.5rem}.cortex-message-parts{width:100%;display:flex;flex-direction:column;gap:.5rem}.cortex-message-actions{display:flex;align-items:center;gap:.375rem;margin-top:-.25rem}.cortex-message-actions--user{justify-content:flex-end}.cortex-message-actions__time{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:0;transition:opacity .15s ease}.cortex-message-actions:not(:has(.cortex-copy-btn)) .cortex-message-actions__time{opacity:1}.cortex-message:hover .cortex-message-actions .cortex-copy-btn__button,.cortex-message:hover .cortex-message-actions .cortex-message-actions__time,.cortex-message-actions:focus-within .cortex-copy-btn__button,.cortex-message-actions:focus-within .cortex-message-actions__time{opacity:1}.cortex-message-debug-zone{display:flex;flex-direction:column;gap:.25rem;padding-top:.375rem;margin-top:.125rem;border-top:1px dashed var(--cortex-color-border)}.cortex-message-part{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;min-width:0;transition:grid-template-rows .42s cubic-bezier(.76,0,.24,1),margin-block-end .42s cubic-bezier(.76,0,.24,1),opacity .3s ease,visibility 0s,overflow 0s .42s allow-discrete}.cortex-message-part>*{min-height:0}.cortex-message-part:empty{display:none}.cortex-message-part--folded{grid-template-rows:0fr;margin-block-end:-.5rem;opacity:0;overflow:clip;visibility:hidden;transition-delay:.6s,.6s,.6s,1.02s,0s}[data-cortex-frontier] .cortex-tool-pill__spinner{visibility:hidden}[data-cortex-frontier] .cortex-subtle-activity__dots{display:none}.cortex-message-part--animated{--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-message-part--animated{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}@keyframes cortex-part-reveal{0%{opacity:0;transform:translate(var(--cortex-reveal-from));filter:blur(5px);-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-start) 0;mask-position:var(--cortex-reveal-start) 0}40%{opacity:1}to{transform:none;filter:none;-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-end) 0;mask-position:var(--cortex-reveal-end) 0}}.cortex-unhandled-type{text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-text-part{width:100%;display:flex;flex-direction:column}.cortex-text-part--user{align-items:flex-end}.cortex-text-bubble{min-width:0;overflow-wrap:anywhere;font-size:var(--cortex-font-size-message, var(--cortex-font-size));line-height:1.625;color:var(--cortex-color-text-strong)}.cortex-text-bubble--assistant{width:calc(100% - 2rem)}.cortex-text-bubble--user{max-width:80%;padding:.75rem 1rem;border-radius:calc(var(--cortex-radius) * 2);border-end-end-radius:0;border:1px solid var(--cortex-color-user-border);background:var(--cortex-color-user-surface)}.cortex-text-bubble h1,.cortex-text-bubble h2,.cortex-text-bubble h3,.cortex-text-bubble h4,.cortex-text-bubble h5,.cortex-text-bubble h6{margin-top:1.25em;margin-bottom:.5em;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading)}.cortex-text-bubble h1:first-child,.cortex-text-bubble h2:first-child,.cortex-text-bubble h3:first-child,.cortex-text-bubble h4:first-child,.cortex-text-bubble h5:first-child,.cortex-text-bubble h6:first-child{margin-top:0}.cortex-text-bubble h1{font-size:1.25em}.cortex-text-bubble h2{font-size:1.125em}.cortex-text-bubble h3{font-size:1em}.cortex-text-bubble p{margin-top:.75em;margin-bottom:.75em}.cortex-text-bubble p:first-child{margin-top:0}.cortex-text-bubble p:last-child{margin-bottom:0}.cortex-text-bubble ul,.cortex-text-bubble ol{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1.5em}.cortex-text-bubble ul{list-style-type:disc}.cortex-text-bubble ol{list-style-type:decimal}.cortex-text-bubble li{margin-top:.25em;margin-bottom:.25em}.cortex-text-bubble code{font-family:var(--cortex-font-mono);font-size:.875em;background:var(--cortex-color-border);padding:.125em .375em;border-radius:calc(var(--cortex-radius) * .5)}.cortex-text-bubble pre{margin-top:.75em;margin-bottom:.75em;padding:.75em 1em;background:var(--cortex-color-code-surface, color-mix(in oklab, var(--cortex-color-text-heading) 8%, transparent));border-radius:var(--cortex-radius);max-width:100%;overflow-x:auto;font-size:.8125em;line-height:1.6}.cortex-text-bubble pre code{background:transparent;padding:0;color:var(--cortex-color-code-text)}.cortex-text-bubble blockquote{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1em;border-inline-start:3px solid var(--cortex-color-border-strong);color:var(--cortex-color-text-secondary);font-style:italic}.cortex-text-bubble a{color:var(--cortex-color-link);text-decoration:underline}.cortex-text-bubble a:hover{color:color-mix(in oklab,var(--cortex-color-link) 80%,var(--cortex-color-text-heading))}.cortex-text-bubble table{width:100%;border-collapse:collapse;margin-top:.75em;margin-bottom:.75em;font-size:.875em}.cortex-text-bubble th,.cortex-text-bubble td{border:1px solid var(--cortex-color-border);padding:.375em .75em;text-align:start}.cortex-text-bubble th{background:var(--cortex-color-surface-subtle);font-weight:600}.cortex-text-bubble hr{margin-top:1.5em;margin-bottom:1.5em;border:none;border-top:1px solid var(--cortex-color-border)}.cortex-text-bubble img{max-width:100%;height:auto;border-radius:calc(var(--cortex-radius) * .75)}.cortex-stream-fade{animation:cortex-stream-fade .3s ease-out}@keyframes cortex-stream-fade{0%{opacity:0}}.cortex-expandable{display:block;position:relative}.cortex-expandable__content{isolation:isolate}.cortex-expandable__toolbar{position:absolute;top:.375rem;inset-inline-end:.375rem;z-index:1;display:flex;gap:.125rem;padding:.125rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);box-shadow:0 1px 3px #00000014;opacity:0;transition:opacity .15s}.cortex-expandable:hover>.cortex-expandable__toolbar,.cortex-expandable__toolbar:has(:focus-visible){opacity:1}@media(hover:none){.cortex-expandable__toolbar{position:static;width:fit-content;margin:0 0 .25rem;margin-inline-start:auto;opacity:1}}.cortex-expandable__action{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;width:1.75rem;height:1.75rem;color:var(--cortex-color-text-muted)}.cortex-expandable__action:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-expandable__dialog{width:fit-content;min-width:min(24rem,100vw - 2rem);max-width:calc(100vw - 2rem);max-height:calc(100dvh - 2rem);margin:auto;padding:0;overflow:hidden;border:1px solid var(--cortex-color-border);border-radius:calc(var(--cortex-radius) * 1.5);background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 24px 64px #0000003d}.cortex-expandable__dialog[open]{display:flex;flex-direction:column;animation:cortex-expandable-in .18s ease-out}.cortex-expandable__dialog::backdrop{background:#00000073;animation:cortex-expandable-backdrop-in .18s ease-out}.cortex-expandable__head{display:flex;align-items:center;gap:.125rem;padding-block:.375rem;padding-inline:1rem .375rem;border-bottom:1px solid var(--cortex-color-border)}.cortex-expandable__title{flex:1;min-width:0;margin-inline-end:.5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;font-weight:600;color:var(--cortex-color-text-heading)}.cortex-expandable__body{min-height:0;overflow:auto;overscroll-behavior:contain}@keyframes cortex-expandable-in{0%{opacity:0;transform:translateY(.5rem) scale(.98)}}@keyframes cortex-expandable-backdrop-in{0%{opacity:0}}.cortex-media-block{display:block;width:40rem;max-width:100%;margin:.75em 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-media-block__head{display:flex}.cortex-media-block__head[hidden]{display:none}.cortex-media-block__head{align-items:center;justify-content:space-between;gap:.5rem;padding:.25rem .5rem .25rem .75rem;background:var(--cortex-color-surface-subtle);border-bottom:1px solid var(--cortex-color-border);font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-media-block__lang{font-family:var(--cortex-font-mono)}.cortex-media-block__pending{display:inline-flex;align-items:center;gap:.375rem}.cortex-media-block__pending:before{content:"";width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-media-block__actions{display:inline-flex;align-items:center;gap:.125rem}.cortex-media-block__action{background:transparent;border:0;padding:.125rem .375rem;border-radius:calc(var(--cortex-radius) * .5);font:inherit;color:inherit;cursor:pointer}.cortex-media-block__action:hover,.cortex-media-block__action[aria-pressed=true]{background:var(--cortex-color-hover);color:var(--cortex-color-text-strong)}.cortex-media-block__body{display:block;padding:.75rem}.cortex-media-block__body[hidden]{display:none}.cortex-media-block__body{min-height:6rem;overflow-x:auto}.cortex-media-block__body svg{display:block;max-width:100%;height:auto;direction:ltr}.cortex-media-block__body svg text{unicode-bidi:plaintext}.cortex-media-block__body>div>svg{margin-inline:auto}.cortex-media-block__body--map{padding:0;height:18rem}.cortex-media-block__body--map>div{height:100%}.cortex-media-block__body--report{padding:1rem}.cortex-expandable__body .cortex-media-block__body{width:min(72rem,100vw - 2rem - 2px)}.cortex-expandable__body .cortex-media-block__body:not(.cortex-media-block__body--map,.cortex-media-block__body--report)>div{display:grid}.cortex-expandable__body .cortex-media-block__body:not(.cortex-media-block__body--map,.cortex-media-block__body--report) svg{width:100%;max-width:none!important;max-height:calc(100dvh - 6.5rem)}.cortex-expandable__body .cortex-media-block__body--map{height:min(48rem,100dvh - 5rem)}.cortex-expandable:has(>.cortex-expandable__content>.cortex-media-block__body--map)>.cortex-expandable__toolbar{right:.375rem;left:auto}.cortex-media-block__error{margin:0;font-size:.8125rem;color:var(--cortex-color-danger)}.cortex-media-block .cortex-media-block__source{margin:0;padding:.75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.5;white-space:pre;overflow-x:auto;color:var(--cortex-color-text)}.cortex-attachment-image{margin:.75em 0}.cortex-attachment-image .cortex-expandable{width:fit-content;max-width:100%}.cortex-attachment-image .cortex-expandable__content img{display:block;max-width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border)}.cortex-expandable__body .cortex-attachment-image__expanded{display:block;max-width:calc(100vw - 2rem - 2px);max-height:calc(100dvh - 5rem);margin:auto;border-radius:0}.cortex-attachment-image__caption{margin:.25rem 0 0;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-table-block{display:block;margin:.75em 0}.cortex-table-block th{white-space:nowrap}.cortex-table-block td{max-width:20rem}.cortex-table-block table{margin:0}.cortex-table-block .cortex-expandable{width:fit-content;max-width:100%}.cortex-table-block__expanded{padding:1rem}.cortex-table-block__expanded td{max-width:40rem}.cortex-reasoning-details{width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-reasoning-details__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.75rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-reasoning-details__summary::-webkit-details-marker{display:none}.cortex-reasoning-details__header{display:flex;align-items:center;gap:.5rem;min-width:0;flex:1}.cortex-reasoning-details__icon{display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}.cortex-reasoning-details__title-group{min-width:0}.cortex-reasoning-details__title-row{display:flex;align-items:center;gap:.5rem}.cortex-reasoning-details__title{font-weight:500;color:var(--cortex-color-text-strong);font-size:.875rem}.cortex-reasoning-details__badge{display:inline-flex;align-items:center;border-radius:calc(var(--cortex-radius) * .5);padding:.125rem .375rem;font-size:.6875rem;font-weight:500}.cortex-reasoning-details__badge--streaming{background:light-dark(#fef3c7,#78350f);color:light-dark(#b45309,#fcd34d)}.cortex-reasoning-details__badge--done{background:var(--cortex-color-success-border);color:var(--cortex-color-success)}.cortex-reasoning-details__chevron{margin-inline-start:auto;display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary>.cortex-reasoning-details__chevron{transform:rotate(180deg)}.cortex-reasoning-details__body{padding:0 1rem 1rem}.cortex-reasoning-details__content{margin-top:.25rem;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-surface);border:1px solid var(--cortex-color-border);padding:.75rem}.cortex-reasoning-details__pre{margin:0;white-space:pre-wrap;overflow-wrap:break-word;font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.625;color:var(--cortex-color-text-strong)}@keyframes cortex-aborted-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.cortex-aborted-flag{display:flex;align-items:center;gap:.625rem;padding:.25rem 0;animation:cortex-aborted-fade-in .3s ease-out both;-webkit-user-select:none;user-select:none}.cortex-aborted-flag__line{flex:1;height:1px;background:repeating-linear-gradient(90deg,#e2a36f 0px,#e2a36f 4px,transparent 4px,transparent 8px);opacity:.5}.cortex-aborted-flag__label{display:inline-flex;align-items:center;gap:.3125rem;font-family:var(--cortex-font-mono);font-size:.625rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:light-dark(#c2824a,#e2a36f)}.cortex-aborted-flag__icon{color:light-dark(#c2824a,#e2a36f);flex-shrink:0}.cortex-trigger-block{display:inline-flex;width:fit-content;padding:.375rem .75rem;border-radius:999px;background:var(--cortex-color-accent-surface);color:var(--cortex-color-text-strong);font-size:.75rem}.cortex-trigger-block__head{display:flex;align-items:center;gap:.5rem}.cortex-trigger-block__icon{flex-shrink:0;color:var(--cortex-color-accent)}.cortex-trigger-block__name{font-family:var(--cortex-font-mono);font-weight:600}.cortex-trigger-block__time{color:var(--cortex-color-text-secondary);font-size:.6875rem}.cortex-trigger-block--debug{display:flex;flex-direction:column;width:auto;gap:.375rem;padding:.5rem .75rem;border:1px dashed var(--cortex-color-border-strong);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.6875rem}.cortex-trigger-block--debug .cortex-trigger-block__head{font-family:var(--cortex-font-mono);letter-spacing:.04em;text-transform:uppercase;color:var(--cortex-color-text-secondary)}.cortex-trigger-block--debug .cortex-trigger-block__name{color:var(--cortex-color-text-strong)}.cortex-trigger-block--debug .cortex-trigger-block__time{margin-inline-start:auto;font-size:inherit;text-transform:none;letter-spacing:0}.cortex-trigger-block__payload{font-size:.75rem}.cortex-trigger-block__payload>summary{cursor:pointer;color:var(--cortex-color-text-secondary);-webkit-user-select:none;user-select:none}.cortex-trigger-block__payload[open]>summary{margin-bottom:.25rem}.cortex-widget__messages-disabled{padding:.75rem 1rem;text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-message-attachments{display:flex;flex-wrap:wrap;gap:.375rem}.cortex-message-attachments--user{justify-content:flex-end}.cortex-message-attachment{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:.25rem .5rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong);cursor:pointer;transition:background .15s}.cortex-message-attachment:hover{background:var(--cortex-color-surface-muted)}.cortex-message-attachment__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-message-attachment__icon,.cortex-message-attachment__dl-icon{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-debug-tool{--_accent: var(--cortex-color-border-strong);position:relative;width:100%;border-radius:10px;background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-debug-tool:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var(--_accent);z-index:1;transition:background .2s}.cortex-debug-tool[data-state=complete]{--_accent: var(--cortex-color-success)}.cortex-debug-tool[data-state=error]{--_accent: var(--cortex-color-danger)}.cortex-debug-tool[data-state=awaiting-input],.cortex-debug-tool[data-state=input-streaming],.cortex-debug-tool[data-state=input-complete]{--_accent: light-dark(#d97706, #fbbf24)}.cortex-debug-tool[data-state=approval-requested],.cortex-debug-tool[data-state=approval-responded]{--_accent: light-dark(#7c3aed, #a78bfa)}.cortex-debug-tool__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.625rem .875rem .625rem 1.125rem}.cortex-debug-tool__summary::-webkit-details-marker{display:none}.cortex-debug-tool__header{display:flex;align-items:flex-start;gap:.75rem}.cortex-debug-tool__meta{flex:1;min-width:0}.cortex-debug-tool__title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-debug-tool__name{font-weight:600;font-size:.8125rem;color:var(--cortex-color-text-heading);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.01em}.cortex-debug-tool__id-row{margin-top:2px;font-size:.625rem;color:var(--cortex-color-text-muted);font-family:ui-monospace,SF Mono,Cascadia Code,monospace;word-break:break-all}.cortex-debug-tool__actions{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.cortex-debug-tool__state{display:inline-flex;align-items:center;gap:5px;font-size:.6875rem;font-weight:500;padding:2px 8px;border-radius:4px;white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__state--success{color:var(--cortex-color-success);background:var(--cortex-color-success-surface)}.cortex-debug-tool__state--error{color:var(--cortex-color-danger);background:light-dark(#fef2f2,#450a0a)}.cortex-debug-tool__state--approval{color:light-dark(#7c3aed,#a78bfa);background:light-dark(#f5f3ff,#2e1065)}.cortex-debug-tool__state--pending{color:light-dark(#b45309,#fcd34d);background:light-dark(#fffbeb,#451a03)}.cortex-debug-tool__pulse{width:6px;height:6px;border-radius:50%;background:light-dark(#d97706,#fbbf24);animation:dbg-pulse 2s ease-in-out infinite}.cortex-debug-tool__pulse--violet{background:#8b5cf6}@keyframes dbg-pulse{0%,to{opacity:1}50%{opacity:.3}}.cortex-debug-tool__chevron{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:4px;color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary .cortex-debug-tool__chevron{transform:rotate(180deg)}.cortex-debug-tool__body{padding:0 .875rem .75rem 1.125rem}.cortex-debug-tool__section:not(:first-child){border-top:1px solid var(--cortex-color-border);padding-top:.625rem;margin-top:.625rem}.cortex-debug-tool__section-bar{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-debug-tool__section-label{font-size:.625rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-muted);font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__section-label--success{color:var(--cortex-color-success)}.cortex-debug-tool__section-label--error{color:var(--cortex-color-danger)}.cortex-debug-tool__section-label--approval{color:light-dark(#7c3aed,#a78bfa)}.cortex-debug-tool__section-lang{font-size:.5625rem;color:var(--cortex-color-border-strong);font-family:ui-monospace,SF Mono,monospace;text-transform:lowercase}.cortex-debug-tool__pre{margin:0;max-height:20rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre;overflow-wrap:break-word}.cortex-debug-tool__tree{max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__error-pre{margin:0;max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:light-dark(#fef2f2,#450a0a);color:light-dark(#991b1b,#fca5a5);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre-wrap;word-break:break-word}.cortex-debug-tool__message{padding:.5rem .75rem;font-size:.75rem;color:var(--cortex-color-text-secondary);border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__message--approval{color:light-dark(#5b21b6,#c4b5fd);background:light-dark(#faf5ff,#3b0764)}.cortex-debug-tool__section--success .cortex-debug-tool__tree{background:light-dark(#f0fdf4,#052e16)}.cortex-debug-tool__section--error .cortex-debug-tool__tree{background:light-dark(#fef2f2,#450a0a)}.cortex-tool-call-animated{display:block}.cortex-tool-pill{display:inline-flex;align-items:center;gap:.375rem;padding:.25rem 0;max-width:100%}.cortex-tool-pill__icon{position:relative;width:.75rem;height:.75rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--cortex-color-text-muted)}.cortex-tool-pill__spinner{position:absolute;width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;opacity:0;transition:opacity .2s}.cortex-tool-pill__spinner--visible{opacity:1;animation:cortex-tool-spin .8s linear infinite}@keyframes cortex-tool-spin{to{transform:rotate(360deg)}}.cortex-tool-pill__svg{position:absolute;width:.75rem;height:.75rem;opacity:0;transform:scale(.6);transition:opacity .2s,transform .2s}.cortex-tool-pill__svg--visible{opacity:1;transform:scale(1)}.cortex-tool-pill__svg--check{color:var(--cortex-color-success)}.cortex-tool-pill__svg--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title{font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .3s}.cortex-tool-pill__title--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title--pending{color:var(--cortex-color-text-muted);opacity:.6}.cortex-tool-pill__meta{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:.8;white-space:nowrap;font-variant-numeric:tabular-nums}.cortex-approval-card{display:block;max-width:min(100%,28rem);margin:.25rem 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-approval-card--asking{border-color:color-mix(in oklab,var(--cortex-color-accent) 45%,var(--cortex-color-border));box-shadow:0 0 0 3px color-mix(in oklab,var(--cortex-color-accent) 10%,transparent)}.cortex-approval-card__head{display:flex;align-items:center;gap:.5rem;padding:.625rem .75rem 0;font-size:.75rem;font-weight:600;color:var(--cortex-color-accent)}.cortex-approval-card__sentence{margin:0;padding:.375rem .75rem .5rem;font-weight:600;color:var(--cortex-color-text-heading)}.cortex-approval-card__foot{display:flex;gap:.5rem;padding:.625rem .75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-approval-card__button{border:1px solid var(--cortex-color-border-strong);border-radius:calc(var(--cortex-radius) * .75);background:var(--cortex-color-surface);padding:.375rem .875rem;font:inherit;font-size:.8125rem;font-weight:500;color:var(--cortex-color-text-strong);cursor:pointer}.cortex-approval-card__button--approve{border-color:var(--cortex-color-accent);background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground)}.cortex-approval-card__line{display:flex;align-items:baseline;gap:.5rem;padding:.5rem .75rem;font-size:.8125rem;color:var(--cortex-color-text-secondary)}.cortex-approval-card__line .cortex-tool-pill__icon{flex-shrink:0}.cortex-approval-card__decision{font-weight:600;color:var(--cortex-color-text-strong)}.cortex-approval-card__summary{min-width:0;flex:1}.cortex-tool-fold{display:block;align-self:flex-start;text-align:start;border:0;background:none;padding:0 0 .25rem;margin-block-start:-.625rem;margin-inline-start:1.125rem;font:inherit;font-size:.75rem;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-tool-fold:hover,.cortex-tool-fold:focus-visible{color:var(--cortex-color-text-secondary)}.cortex-client-tool-embed{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-client-tool-embed__bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border-block-end:1px solid var(--cortex-color-border-strong);font-size:12px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__cancel{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-client-tool-embed__cancel:hover{color:var(--cortex-color-danger)}.cortex-client-tool-embed__frame{display:block;inline-size:100%;block-size:420px;border:0;background:var(--cortex-color-surface)}.cortex-client-tool-embed__status{display:flex;align-items:center;gap:8px;padding:20px 16px;font-size:13px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__retry{border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:none;padding:4px 10px;font:inherit;font-size:12px;color:inherit;cursor:pointer}.cortex-client-tool-embed-dialog{border:0;padding:0;background:none;inline-size:min(560px,100vw - 48px);max-inline-size:none}.cortex-client-tool-embed-dialog::backdrop{background:#00000073}.cortex-client-tool-embed-dialog .cortex-client-tool-embed{inline-size:100%;max-inline-size:none;box-shadow:0 24px 64px #0000004d}.cortex-client-tool-embed-dialog .cortex-client-tool-embed__frame{block-size:min(70dvh,560px)}.cortex-location-input{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-location-input--settled{display:flex;gap:10px;border-color:var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-location-input__map{position:relative;block-size:11rem;background:var(--cortex-color-surface-muted)}.cortex-location-input__map--still{flex:none;inline-size:120px;block-size:84px}.cortex-location-input__canvas{block-size:100%}.cortex-location-input__still-failed{display:flex;align-items:center;justify-content:center;block-size:100%;padding:0 8px;font-size:11px;text-align:center;color:var(--cortex-color-text-muted)}.cortex-location-input__locate{position:absolute;inset-inline-end:10px;inset-block-start:10px;z-index:1001;display:inline-flex;align-items:center;justify-content:center;inline-size:30px;block-size:30px;border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 1px 3px #0003;cursor:pointer}.cortex-location-input__locate svg{inline-size:15px;block-size:15px}.cortex-location-input__locate:disabled{opacity:.45;cursor:default}.cortex-location-input__foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border-block-start:1px solid var(--cortex-color-border-strong);font-size:12px}.cortex-location-input__hint{display:inline-flex;align-items:center;gap:6px;min-inline-size:0;color:var(--cortex-color-text-muted)}.cortex-location-input__hint--failed{color:var(--cortex-color-danger)}.cortex-location-input__spinner{inline-size:.625rem;block-size:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-location-input__coords{font-family:var(--cortex-font-mono);font-size:.75rem;color:var(--cortex-color-text-secondary);direction:ltr;unicode-bidi:isolate}.cortex-location-input__actions{display:flex;align-items:center;gap:8px}.cortex-location-input__skip{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-location-input__skip:hover{color:var(--cortex-color-danger)}.cortex-location-input__skip:disabled{opacity:.45;cursor:default}.cortex-location-input__send{border:1px solid var(--cortex-color-primary);border-radius:8px;background:var(--cortex-color-primary);padding:4px 10px;font:inherit;font-size:12px;color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-location-input__send:disabled{opacity:.45;cursor:default}.cortex-location-input__body{display:flex;flex-direction:column;justify-content:center;gap:2px;min-inline-size:0;padding-block:8px;padding-inline-end:12px}.cortex-location-input__title{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--cortex-color-text-strong)}.cortex-location-input__title svg{inline-size:13px;block-size:13px;color:var(--cortex-color-success)}.cortex-reasoning-animated{display:block}.cortex-subtle-activity{display:flex;align-items:center;gap:.375rem;padding:.25rem 0;width:fit-content}.cortex-subtle-activity__dots{display:flex;align-items:center;gap:3px}.cortex-subtle-activity__dot{width:3px;height:3px;border-radius:9999px;background:var(--cortex-color-accent);animation:cortex-subtle-dot-pulse 1.4s ease-in-out infinite}.cortex-subtle-activity__dot--d1{animation-delay:.2s}.cortex-subtle-activity__dot--d2{animation-delay:.4s}@keyframes cortex-subtle-dot-pulse{0%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1.3)}}.cortex-subtle-activity__label-mask{overflow:hidden;position:relative;height:1.1em}.cortex-subtle-activity__label{display:block;font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;line-height:1.1em}.cortex-subtle-activity__label--idle,.cortex-subtle-activity__label--entering{opacity:1;transform:translateY(0);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--exiting{opacity:0;transform:translateY(-6px);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--enter-start{opacity:0;transform:translateY(6px);transition:none}.cortex-attachment-queue{display:flex;flex-wrap:wrap;gap:.375rem;margin-bottom:.5rem}.cortex-attachment-chip{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding-block:.25rem;padding-inline:.5rem .375rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong)}.cortex-attachment-chip--error{border-color:var(--cortex-color-danger-border);background:var(--cortex-color-danger-surface);color:var(--cortex-color-danger)}.cortex-attachment-chip__icon,.cortex-attachment-chip__spinner{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-attachment-chip__spinner{animation:cortex-attachment-spin .8s linear infinite}.cortex-attachment-chip__spinner-track{opacity:.25}@keyframes cortex-attachment-spin{to{transform:rotate(360deg)}}.cortex-attachment-chip__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-attachment-chip__remove{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:1rem;height:1rem;padding:0;border:0;border-radius:3px;background:transparent;color:currentColor;opacity:.6;cursor:pointer}.cortex-attachment-chip__remove:hover{opacity:1;background:var(--cortex-color-hover)}.cortex-attachment-chip__remove svg{width:.75rem;height:.75rem}.cortex-token-usage{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-token-usage__summary{align-self:end}html[dir=ltr] .cortex-token-usage__summary{align-self:start}.cortex-token-usage__summary{display:inline-flex;align-items:center;gap:.625rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-token-usage__summary:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-token-usage__summary{flex-wrap:wrap;max-width:100%;text-align:start}.cortex-token-usage__total-number{font-weight:600;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__total-label{margin-inline-start:3px;color:var(--cortex-color-text-muted);font-weight:400;letter-spacing:.03em}.cortex-token-usage__model{color:var(--cortex-color-border-strong);font-weight:400;font-size:.5625rem;letter-spacing:.02em;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-token-usage__pills{display:inline-flex;align-items:center;gap:.5rem}.cortex-token-usage__pill{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-muted)}.cortex-token-usage__dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.cortex-token-usage__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 2px #ea580c1a}.cortex-token-usage__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 2px #4f46e51a}.cortex-token-usage__cache-badge{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 6px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-token-usage--expanded .cortex-token-usage__chevron{transform:rotate(180deg)}.cortex-token-usage__details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-token-usage__details-inner{overflow:hidden}.cortex-token-usage--expanded .cortex-token-usage__details{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-token-usage__columns{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--cortex-color-border);border-radius:8px;overflow:hidden}.cortex-token-usage__col{background:var(--cortex-color-surface-subtle);padding:.5rem .625rem}.cortex-token-usage__col-header{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-token-usage__col-label{font-weight:600;font-size:.5625rem;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-secondary);font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__col-total{margin-inline-start:auto;font-weight:700;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__rows{display:flex;flex-direction:column;gap:1px}.cortex-token-usage__row{display:flex;align-items:baseline;justify-content:space-between;padding:2px 0;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__row-label{color:var(--cortex-color-text-muted);font-size:.625rem}.cortex-token-usage__row-value{font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary);font-weight:500}.cortex-token-usage__cache-bar-row{display:flex;align-items:center;gap:.5rem;margin-top:.5rem;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__cache-bar{flex:1;height:3px;border-radius:2px;background:var(--cortex-color-border);overflow:hidden}.cortex-token-usage__cache-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#10b981,var(--cortex-color-success));transition:width .4s cubic-bezier(.4,0,.2,1)}.cortex-token-usage__cache-label{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-llm-inspector__trigger{align-self:end}html[dir=ltr] .cortex-llm-inspector__trigger{align-self:start}.cortex-llm-inspector__trigger{display:inline-flex;align-items:center;gap:.5rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-llm-inspector__trigger:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-llm-inspector__icon{color:var(--cortex-color-text-muted);flex-shrink:0}.cortex-llm-inspector__loading{color:var(--cortex-color-border-strong);font-style:italic}.cortex-llm-inspector__badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;padding:0 .35rem;border-radius:9999px;background:var(--cortex-color-border);color:var(--cortex-color-text-secondary);font-size:.5625rem;font-weight:700}.cortex-llm-inspector__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-llm-inspector--open .cortex-llm-inspector__chevron{transform:rotate(180deg)}.cortex-llm-inspector__panel-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-llm-inspector__panel-inner{overflow:hidden}.cortex-llm-inspector--open .cortex-llm-inspector__panel-wrapper{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-llm-inspector__panel{display:flex;flex-direction:column;gap:.375rem}.cortex-llm-inspector__empty{padding:.625rem;color:var(--cortex-color-text-muted);font-style:italic}.cortex-llm-inspector__step{border-radius:8px;background:var(--cortex-color-surface-subtle);overflow:hidden;transition:box-shadow .2s ease}.cortex-llm-inspector__step--expanded{box-shadow:0 0 0 1px var(--cortex-color-border)}.cortex-llm-inspector__step-header{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .625rem;border:none;background:transparent;cursor:pointer;font:inherit;color:inherit;text-align:start;transition:background .15s ease}.cortex-llm-inspector__step-header:hover{background:#00000005}.cortex-llm-inspector__step-label{font-weight:600;color:var(--cortex-color-text-secondary);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-metrics{display:inline-flex;align-items:center;gap:.625rem;margin-inline-start:auto;font-variant-numeric:tabular-nums}.cortex-llm-inspector__metric{display:inline-flex;align-items:center;gap:3px}.cortex-llm-inspector__dot{width:5px;height:5px;border-radius:50%;flex-shrink:0}.cortex-llm-inspector__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 1.5px #ea580c1f}.cortex-llm-inspector__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 1.5px #4f46e51f}.cortex-llm-inspector__cache-pct{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 5px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-chevron{color:var(--cortex-color-border-strong);transition:transform .2s ease;flex-shrink:0}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-chevron{transform:rotate(180deg)}.cortex-llm-inspector__step-body-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease;opacity:0}.cortex-llm-inspector__step-body-inner{overflow:hidden}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-body-wrapper{grid-template-rows:1fr;opacity:1}.cortex-llm-inspector__step-body{padding:0 .625rem .625rem;display:flex;flex-direction:column;gap:.5rem}.cortex-llm-inspector__usage-rows{display:flex;flex-direction:column;border-radius:6px;overflow:hidden;background:var(--cortex-color-border);gap:1px}.cortex-llm-inspector__usage-row{display:flex;align-items:baseline;gap:.5rem;padding:.375rem .625rem;background:var(--cortex-color-surface);flex-wrap:wrap}.cortex-llm-inspector__usage-row--total{background:light-dark(#fafbfc,#141414)}.cortex-llm-inspector__usage-lbl{font-size:.5625rem;text-transform:uppercase;letter-spacing:.05em;color:var(--cortex-color-text-muted);font-weight:600;width:3.25rem;flex-shrink:0;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__usage-val{font-variant-numeric:tabular-nums;font-weight:600;color:var(--cortex-color-text-secondary);min-width:3rem}.cortex-llm-inspector__usage-row--total .cortex-llm-inspector__usage-val{font-weight:700;color:var(--cortex-color-text-heading)}.cortex-llm-inspector__usage-detail{color:var(--cortex-color-border-strong);font-size:.5625rem;margin-inline-start:auto}.cortex-llm-inspector__tabs{display:flex;gap:0;border-bottom:1px solid var(--cortex-color-border)}.cortex-llm-inspector__tab{padding:.375rem .75rem;border:none;background:transparent;cursor:pointer;font:inherit;color:var(--cortex-color-text-muted);font-weight:500;position:relative;transition:color .15s ease;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__tab:hover{color:var(--cortex-color-text-secondary)}.cortex-llm-inspector__tab--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-llm-inspector__tab--active:after{content:"";position:absolute;inset-inline:0;bottom:-1px;height:2px;background:var(--cortex-color-text-heading);border-radius:1px 1px 0 0}.cortex-llm-inspector__json-pane{position:relative;max-height:24rem;overflow:auto;padding:.625rem;background:var(--cortex-color-surface);border-radius:6px}.cortex-llm-inspector__json-copy{position:sticky;top:0;float:inline-end;z-index:1}.cortex-json-tree{display:block;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.75rem;line-height:1.25rem;-webkit-user-select:text;user-select:text;white-space:pre-wrap;word-break:break-word}.cortex-json-tree__indent{padding-inline-start:1.25em;border-inline-start:1px solid var(--cortex-color-border);margin-inline-start:.3em}.cortex-json-tree__line{position:relative}.cortex-json-tree__toggle{cursor:pointer;-webkit-user-select:none;user-select:none}.cortex-json-tree__toggle:hover .cortex-json-tree__arrow{color:var(--cortex-color-text)}.cortex-json-tree__arrow{display:inline-block;width:1em;text-align:center;color:var(--cortex-color-text-muted);font-size:.525rem;transition:transform .15s ease;vertical-align:middle}.cortex-json-tree__arrow--collapsed{transform:rotate(-90deg)}.cortex-json-tree__bracket{color:var(--cortex-color-text-secondary)}.cortex-json-tree__key{color:light-dark(#6366f1,#818cf8)}.cortex-json-tree__colon{color:var(--cortex-color-text-secondary)}.cortex-json-tree__comma{color:var(--cortex-color-text-muted)}.cortex-json-tree__string{color:var(--cortex-color-success)}.cortex-json-tree__number{color:light-dark(#2563eb,#60a5fa)}.cortex-json-tree__boolean{color:light-dark(#d97706,#fbbf24)}.cortex-json-tree__null{color:var(--cortex-color-text-muted);font-style:italic}.cortex-json-tree__collapsed-hint{display:inline-block;padding:0 .4em;margin:0 .15em;font-size:.625rem;line-height:1.5;color:var(--cortex-color-text-muted);background:var(--cortex-color-surface-subtle);border:1px solid var(--cortex-color-border);border-radius:3px;font-style:italic;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:middle}.cortex-json-tree__collapsed-hint:hover{color:var(--cortex-color-text-secondary);border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface-muted)}.cortex-copy-btn{display:inline-flex;align-items:center}.cortex-copy-btn__button{display:inline-flex;align-items:center;justify-content:center;width:1.375rem;height:1.375rem;padding:0;border:none;border-radius:3px;background:transparent;color:var(--cortex-color-text-muted);cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease,background .15s ease}:hover>cortex-copy-button .cortex-copy-btn__button,:hover>.cortex-copy-btn .cortex-copy-btn__button,.cortex-copy-btn__button:hover,.cortex-copy-btn__button:focus-visible{opacity:1}.cortex-copy-btn__button:hover{background:var(--cortex-color-hover);color:var(--cortex-color-text)}.cortex-copy-btn__button--copied{opacity:1;color:var(--cortex-color-success);pointer-events:none}.cortex-copy-btn__button--copied:hover{color:var(--cortex-color-success);background:transparent}.cortex-copy-btn__icon{flex-shrink:0}.cortex-copy-btn__icon--check{animation:cortex-copy-pop .25s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes cortex-copy-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.cortex-widget *,.cortex-widget *:before,.cortex-widget *:after,.cortex-widget *::backdrop{animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:.01ms!important;transition-delay:0s!important}}\n']
12713
+ styles: ['@charset "UTF-8";:root{--cortex-color-surface: light-dark(#ffffff, #0a0a0a);--cortex-color-surface-subtle: light-dark(#f8fafc, #141414);--cortex-color-surface-muted: light-dark(#f1f5f9, #1f1f1f);--cortex-color-border: light-dark(#e2e8f0, #2e2e2e);--cortex-color-border-strong: light-dark(#cbd5e1, #444444);--cortex-color-text-heading: light-dark(#1e293b, #fafafa);--cortex-color-text-strong: light-dark(#334155, #e5e5e5);--cortex-color-text: light-dark(#475569, #d4d4d4);--cortex-color-text-secondary: light-dark(#64748b, #a3a3a3);--cortex-color-text-muted: light-dark(#94a3b8, #737373);--cortex-color-primary: light-dark(#1e293b, #fafafa);--cortex-color-primary-foreground: light-dark(#ffffff, #0a0a0a);--cortex-color-accent: light-dark(#4f46e5, #818cf8);--cortex-color-accent-surface: light-dark(#e0e7ff, #312e81);--cortex-color-link: light-dark(#2563eb, #60a5fa);--cortex-color-hover: light-dark(rgba(0, 0, 0, .05), rgba(255, 255, 255, .06));--cortex-color-user-surface: var(--cortex-color-surface-subtle);--cortex-color-user-border: var(--cortex-color-border);--cortex-color-code-text: light-dark(#334155, #e5e5e5);--cortex-color-success: light-dark(#059669, #34d399);--cortex-color-success-surface: light-dark(#ecfdf5, #064e3b);--cortex-color-success-border: light-dark(#d1fae5, #065f46);--cortex-color-danger: light-dark(#dc2626, #f87171);--cortex-color-danger-surface: light-dark(#fef2f2, #450a0a);--cortex-color-danger-border: light-dark(#fecaca, #7f1d1d);--cortex-radius: .5rem;--cortex-font-mono: var( --default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace );--cortex-font-size: .8125rem}.cortex-widget{color-scheme:light}.cortex-widget[data-cortex-theme=dark]{color-scheme:dark}.cortex-widget[data-cortex-theme=system]{color-scheme:light dark}@layer base.cortex{:where(.cortex-widget),:where(.cortex-widget) *,:where(.cortex-widget) :before,:where(.cortex-widget) :after{box-sizing:border-box;margin:0;padding:0;border:0 solid}:where(.cortex-widget){tab-size:4}:where(.cortex-widget) hr{height:0;color:inherit;border-top-width:1px}:where(.cortex-widget) :is(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}:where(.cortex-widget) a{color:inherit;text-decoration:inherit}:where(.cortex-widget) :is(b,strong){font-weight:bolder}:where(.cortex-widget) :is(code,kbd,samp,pre){font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}:where(.cortex-widget) small{font-size:80%}:where(.cortex-widget) :is(sub,sup){font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.cortex-widget) sub{bottom:-.25em}:where(.cortex-widget) sup{top:-.5em}:where(.cortex-widget) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.cortex-widget) :is(ol,ul,menu){list-style:none}:where(.cortex-widget) :is(img,svg,video,canvas,audio,iframe,embed,object){display:block;vertical-align:middle}:where(.cortex-widget) :is(img,video){max-width:100%;height:auto}:where(.cortex-widget) :is(button,input,select,optgroup,textarea){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(.cortex-widget) ::placeholder{opacity:1;color:color-mix(in oklab,currentcolor 50%,transparent)}:where(.cortex-widget) textarea{resize:vertical}}.cortex-widget .hljs{color:light-dark(#24292e,#c9d1d9);background:transparent}.cortex-widget .hljs-doctag,.cortex-widget .hljs-keyword,.cortex-widget .hljs-meta .hljs-keyword,.cortex-widget .hljs-template-tag,.cortex-widget .hljs-template-variable,.cortex-widget .hljs-type,.cortex-widget .hljs-variable.language_{color:light-dark(#d73a49,#ff7b72)}.cortex-widget .hljs-title,.cortex-widget .hljs-title.class_,.cortex-widget .hljs-title.class_.inherited__,.cortex-widget .hljs-title.function_{color:light-dark(#6f42c1,#d2a8ff)}.cortex-widget .hljs-attr,.cortex-widget .hljs-attribute,.cortex-widget .hljs-literal,.cortex-widget .hljs-meta,.cortex-widget .hljs-number,.cortex-widget .hljs-operator,.cortex-widget .hljs-selector-attr,.cortex-widget .hljs-selector-class,.cortex-widget .hljs-selector-id,.cortex-widget .hljs-variable{color:light-dark(#005cc5,#79c0ff)}.cortex-widget .hljs-meta .hljs-string,.cortex-widget .hljs-regexp,.cortex-widget .hljs-string{color:light-dark(#032f62,#a5d6ff)}.cortex-widget .hljs-built_in,.cortex-widget .hljs-symbol{color:light-dark(#e36209,#ffa657)}.cortex-widget .hljs-code,.cortex-widget .hljs-comment,.cortex-widget .hljs-formula{color:light-dark(#6a737d,#8b949e)}.cortex-widget .hljs-name,.cortex-widget .hljs-quote,.cortex-widget .hljs-selector-pseudo,.cortex-widget .hljs-selector-tag{color:light-dark(#22863a,#7ee787)}.cortex-widget .hljs-subst{color:light-dark(#24292e,#c9d1d9)}.cortex-widget .hljs-section{color:light-dark(#005cc5,#1f6feb);font-weight:700}.cortex-widget .hljs-bullet{color:light-dark(#735c0f,#f2cc60)}.cortex-widget .hljs-emphasis{font-style:italic}.cortex-widget .hljs-strong{font-weight:700}.cortex-widget .hljs-addition{color:light-dark(#22863a,#aff5b4);background-color:light-dark(#f0fff4,#033a16)}.cortex-widget .hljs-deletion{color:light-dark(#b31d28,#ffdcd7);background-color:light-dark(#ffeef0,#67060c)}.cortex-widget{display:block}.cortex-widget__container{width:100%;height:100%;position:relative;overflow:hidden}.cortex-widget__screen{position:absolute;inset:0;display:flex;flex-direction:column;transition:transform .3s ease-out}.cortex-widget__screen--active{transform:translate(0)}.cortex-widget__screen--left{transform:translate(-100%)}[dir=rtl] .cortex-widget__screen--left,.cortex-widget__screen--right{transform:translate(100%)}[dir=rtl] .cortex-widget__screen--right{transform:translate(-100%)}@keyframes cortex-skeleton-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.cortex-skeleton{background:linear-gradient(90deg,var(--cortex-color-border) 0%,var(--cortex-color-surface-muted) 40%,var(--cortex-color-border) 80%);background-size:200% 100%;animation:cortex-skeleton-shimmer 1.8s ease-in-out infinite;border-radius:6px}.cortex-widget__messages-skeleton{flex:1;overflow:hidden;padding:1rem;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel{width:100%;display:flex;flex-direction:column}.cortex-widget__msg-skel--user{align-items:flex-end}.cortex-widget__msg-skel--assistant{align-items:flex-start}.cortex-widget__msg-skel-bubble{max-width:80%;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel-bubble--user{padding:.75rem 1rem;border-radius:calc(var(--cortex-radius) * 2);border-end-end-radius:0;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-widget__msg-skel-line{height:.75rem;max-width:100%}.cortex-widget__messages{flex:1;overflow:hidden}.cortex-widget__container--full{display:flex;flex-direction:row}.cortex-widget__container--full>.cortex-widget__screen{position:relative;inset:auto;transition:none}.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--active,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--left,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--right{transform:none}.cortex-widget__container--full>.cortex-widget__screen:first-child{width:280px;min-width:280px;flex-shrink:0;border-right:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{border-right:0;border-left:1px solid var(--cortex-color-border)}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__back-btn,.cortex-widget__container--full .cortex-widget__history-btn{display:none}@media(min-width:769px){.cortex-widget__container--full>.cortex-widget__screen:nth-child(2) .cortex-widget__new-btn{display:none}}.cortex-widget__container--full .cortex-widget__chat-title{font-size:var(--cortex-font-size-header, .875rem)}.cortex-widget__container--full .cortex-widget__chat-header{background:var(--cortex-color-surface)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1.5rem max(2rem,(100% - 48rem) / 2)}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem max(2rem,(100% - 48rem) / 2) 1.25rem}@media(max-width:768px){.cortex-widget__container--full>.cortex-widget__screen:first-child{position:fixed;inset:0;width:280px;min-width:280px;z-index:110;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{transform:translate(100%);border-left:1px solid var(--cortex-color-border);border-right:0}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-secondary)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:hover{color:var(--cortex-color-text-strong);background:var(--cortex-color-surface-muted)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:active{background:var(--cortex-color-border)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem}}@media(max-width:768px){.cortex-widget__container--full.cortex-widget__container--sidebar-open>.cortex-widget__screen:first-child{transform:translate(0)}.cortex-widget__container--full.cortex-widget__container--sidebar-open .cortex-widget__sidebar-backdrop{display:block;position:fixed;inset:0;z-index:100;background:#0f172a59;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:cortex-sidebar-backdrop-in .2s ease-out both}}@keyframes cortex-sidebar-backdrop-in{0%{opacity:0}to{opacity:1}}.cortex-widget__chat-header{flex-shrink:0;height:3rem;padding:0 1rem;display:flex;align-items:center;gap:.75rem;border-bottom:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__header-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__header-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-surface-muted)}[dir=rtl] .cortex-widget__back-icon{transform:rotate(180deg)}.cortex-widget__chat-title-wrap{min-width:0;flex:1}.cortex-widget__chat-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, var(--cortex-font-size));font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__debug-btn{flex-shrink:0;font-size:.6875rem;font-weight:500;padding:.25rem .625rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__debug-btn--on{background:light-dark(#fef3c7,#78350f);color:light-dark(#d97706,#fbbf24)}.cortex-widget__debug-btn--on:hover{background:light-dark(#fde68a,#92400e)}.cortex-widget__debug-btn--off{background:var(--cortex-color-surface-muted);color:var(--cortex-color-text-muted)}.cortex-widget__debug-btn--off:hover{background:var(--cortex-color-border)}.cortex-widget__landing{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:1.25rem;text-align:center}.cortex-widget__landing .cortex-widget__landing-composer{max-width:26rem}.cortex-widget__landing-composer{width:100%}.cortex-widget__landing-composer .cortex-widget__input-area{padding:1rem 0 0;border-top:0;background:transparent}.cortex-widget__landing-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent);display:flex;align-items:center;justify-content:center;margin-bottom:.875rem}[dir=rtl] .cortex-widget__landing-icon{transform:scaleX(-1)}.cortex-widget__landing-greeting{font-family:var(--cortex-font-display, inherit);font-size:1.0625rem;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading);margin:0}.cortex-widget__landing-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;margin-top:.875rem}.cortex-widget__landing-chip{border:1px solid var(--cortex-color-border);border-radius:999px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);font-size:.75rem;font-weight:500;padding:.375rem .75rem;cursor:pointer;transition:border-color .15s,color .15s}.cortex-widget__landing-chip:hover{border-color:var(--cortex-color-accent);color:var(--cortex-color-accent)}.cortex-widget__landing-recent{width:100%;max-width:26rem;margin-top:1rem;display:flex;flex-direction:column}.cortex-widget__landing-recent-item{display:flex;align-items:center;gap:.75rem;padding:.4375rem .625rem;border:0;border-radius:calc(var(--cortex-radius) * .75);background:transparent;cursor:pointer;transition:background-color .15s}.cortex-widget__landing-recent-item:hover{background:var(--cortex-color-hover)}.cortex-widget__landing-recent-title{flex:1;min-width:0;text-align:start;font-size:var(--cortex-font-size);font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__landing-recent-time{flex-shrink:0;font-size:.6875rem;color:var(--cortex-color-text-muted);margin:0}cortex-chat-composer,cortex-message-tool-call-outcome,cortex-llm-usage-chips{display:contents}.cortex-widget__input-area{flex-shrink:0;padding:.75rem;background:var(--cortex-color-surface);border-top:1px solid var(--cortex-color-border)}.cortex-widget__input-box{display:flex;align-items:flex-end;gap:.5rem;border-radius:calc(var(--cortex-radius) * 1.5);border:1px solid var(--cortex-color-border);padding:.375rem;background:color-mix(in oklab,var(--cortex-color-surface-subtle) 45%,var(--cortex-color-surface));transition:border-color .15s,background-color .15s}.cortex-widget__input-box--enabled:focus-within{border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface)}.cortex-widget__input-box--dragging{border-color:var(--cortex-color-text-heading);border-style:dashed;background:var(--cortex-color-surface-muted)}.cortex-widget__textarea,.cortex-widget__textarea:focus,.cortex-widget__textarea:focus-visible,.cortex-widget__textarea:disabled{background:transparent;border:0;outline:none;box-shadow:none}.cortex-widget__textarea{flex:1;resize:none;font-size:var(--cortex-font-size-message, var(--cortex-font-size));padding:.375rem .5rem;min-height:28px;max-height:calc(5.5 * var(--cortex-font-size-message, var(--cortex-font-size)) + .75rem);overflow-y:auto;line-height:1.375;color:var(--cortex-color-text-strong)}.cortex-widget__textarea::placeholder{color:var(--cortex-color-text-muted)}.cortex-widget__textarea--disabled{color:var(--cortex-color-text-muted);cursor:not-allowed}.cortex-widget__textarea:disabled{cursor:not-allowed}.cortex-widget__input-actions{flex-shrink:0;display:flex;align-items:center;gap:.375rem}@keyframes cortex-stop-pulse-ring{0%{opacity:.45;transform:scale(1)}50%{opacity:.15;transform:scale(1.12)}to{opacity:.45;transform:scale(1)}}@keyframes cortex-stop-fade-in{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}.cortex-stop-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;background:var(--cortex-color-danger);color:#fff;border:0;animation:cortex-stop-fade-in .2s ease-out both;transition:background .15s ease}.cortex-stop-btn:hover{background:color-mix(in oklab,var(--cortex-color-danger) 85%,black)}.cortex-stop-btn:active{transform:scale(.92)}.cortex-stop-btn__ring{position:absolute;inset:0;border-radius:var(--cortex-radius);background:var(--cortex-color-danger);animation:cortex-stop-pulse-ring 2s ease-in-out infinite;pointer-events:none}.cortex-stop-btn__icon{position:relative;z-index:1}.cortex-widget__attach-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__attach-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-widget__file-input{display:none}.cortex-widget__send-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;border:0;transition:background-color .15s;cursor:default}.cortex-widget__send-btn--empty{background:var(--cortex-color-send-empty, transparent);color:var(--cortex-color-send-empty-text, var(--cortex-color-text-muted))}.cortex-widget__send-btn--ready{background:var(--cortex-color-primary);color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-widget__send-btn--ready:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}[dir=rtl] .cortex-widget__send-icon{transform:rotate(180deg)}.cortex-widget__threads-header{flex-shrink:0;padding:1.25rem 1.25rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-widget__threads-header .cortex-widget__new-btn{margin-inline-start:auto}.cortex-widget__threads-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, .9375rem);font-weight:600;color:var(--cortex-color-text-heading);letter-spacing:-.01em;margin:0}.cortex-widget__threads-count{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0}.cortex-widget__new-chat-btn{display:inline-flex;align-items:center;gap:.375rem;font-size:.75rem;font-weight:500;color:var(--cortex-color-primary-foreground);background:var(--cortex-color-primary);padding:.375rem .75rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__new-chat-btn:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}.cortex-widget__new-chat-btn:active{background:var(--cortex-color-primary)}.cortex-widget__new-chat-btn--empty-state{margin-top:.75rem}.cortex-widget__threads-list{flex:1;overflow-y:auto;padding:0 .75rem .75rem}.cortex-widget__thread-skeleton{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.375rem;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__thread-skeleton-icon{flex-shrink:0;width:2rem;height:2rem}.cortex-widget__thread-skeleton-lines{flex:1;display:flex;flex-direction:column;gap:.375rem}.cortex-widget__thread-skeleton-line{height:.875rem}.cortex-widget__thread-item{position:relative;width:100%;padding:.75rem;border-radius:var(--cortex-radius);display:flex;align-items:center;gap:.75rem;transition:background-color .15s,border-color .15s;cursor:pointer;margin-bottom:.375rem;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface);color:var(--cortex-color-text)}.cortex-widget__thread-item:hover{background:var(--cortex-color-surface-muted);border-color:var(--cortex-color-border-strong)}.cortex-widget__thread-item:active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border))}.cortex-widget__thread-item--active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border));border-color:var(--cortex-color-border-strong);color:var(--cortex-color-text-heading)}.cortex-widget__thread-item--active:hover{background:var(--cortex-color-border)}.cortex-widget__thread-item--active:active{background:color-mix(in oklab,var(--cortex-color-border) 50%,var(--cortex-color-border-strong))}.cortex-widget__thread-icon{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;font-size:.6875rem;font-weight:600;background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}[dir=rtl] .cortex-widget__thread-icon{transform:scaleX(-1)}.cortex-widget__thread-icon--active{background:color-mix(in oklab,var(--cortex-color-accent-surface) 85%,var(--cortex-color-accent))}.cortex-widget__thread-info{min-width:0;flex:1;text-align:start;cursor:pointer}.cortex-widget__thread-info:after{content:"";position:absolute;inset:0}.cortex-widget__thread-title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-widget__thread-title{font-size:var(--cortex-font-size);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.25;margin:0;color:var(--cortex-color-text-strong)}.cortex-widget__thread-title--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-widget__thread-time{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-widget__thread-running{flex-shrink:0;display:inline-flex;align-items:center;gap:.3125rem;padding:.2rem .45rem;border-radius:999px;background:var(--cortex-color-success-surface);color:var(--cortex-color-success);font-size:.625rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.cortex-widget__thread-running-dot{width:.375rem;height:.375rem;border-radius:999px;background:currentColor;box-shadow:0 0 .45rem currentColor;animation:cortex-thread-running-pulse 1.4s ease-in-out infinite}@keyframes cortex-thread-running-pulse{0%,to{opacity:.45;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.cortex-widget__thread-delete{position:relative;flex-shrink:0;opacity:0;width:1.75rem;height:1.75rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .15s;background:transparent;border:0;color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-delete,.cortex-widget__thread-delete:focus-visible{opacity:1}.cortex-widget__thread-delete:hover{background:var(--cortex-color-border)}.cortex-widget__thread-delete--active{color:var(--cortex-color-text-secondary)}.cortex-widget__thread-delete--active:hover{color:var(--cortex-color-text)}.cortex-widget__thread-arrow{flex-shrink:0;transition:color .15s;color:var(--cortex-color-border-strong);pointer-events:none}[dir=rtl] .cortex-widget__thread-arrow{transform:rotate(180deg)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow{color:var(--cortex-color-text-muted)}.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-secondary)}.cortex-widget__threads-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 0;text-align:center}.cortex-widget__threads-empty-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);display:flex;align-items:center;justify-content:center;margin-bottom:.75rem}.cortex-widget__threads-empty-svg{color:var(--cortex-color-accent)}.cortex-widget__threads-empty-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size);color:var(--cortex-color-text-muted);font-weight:500;margin:0}.cortex-widget__threads-empty-subtitle{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.25rem;margin-bottom:0}.cortex-widget__sidebar-toggle-btn,.cortex-widget__sidebar-backdrop{display:none}.cortex-message-list{height:100%;overflow-y:auto;overflow-x:hidden;width:100%;padding:1rem}.cortex-message-list__content{position:relative;display:flex;flex-direction:column;gap:.5rem}.cortex-message-list__content--settling{animation:cortex-content-settle .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-content-settle{0%{translate:0 var(--cortex-slide)}}.cortex-widget__screen>.cortex-send-flight{position:absolute;z-index:2;margin:0;max-width:none;pointer-events:none;animation:cortex-send-fade 80ms linear both,cortex-send-fly .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-send-fade{0%{opacity:0}}@keyframes cortex-send-fly{0%{translate:var(--cortex-fly-x) var(--cortex-fly-y)}}.cortex-working-thinking{padding-inline-start:2rem;--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-working-thinking{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}.cortex-working-avatar{position:absolute;top:0;inset-inline-start:0;z-index:1;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:9999px;background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground);translate:0 var(--cortex-avatar-y, 0);visibility:hidden;pointer-events:none}.cortex-working-avatar svg{width:.875rem;height:.875rem}.cortex-working-avatar--shown{visibility:visible;transition:translate .42s cubic-bezier(.76,0,.24,1);animation:cortex-avatar-in .7s cubic-bezier(.16,1,.3,1) both}.cortex-working-avatar--leaving{animation:cortex-avatar-out .36s cubic-bezier(.5,0,.75,0) .12s both}.cortex-working-avatar__ring{position:absolute;inset:-.25rem;border-radius:9999px;border:1.5px solid color-mix(in oklab,var(--cortex-color-accent) 18%,transparent);border-top-color:var(--cortex-color-accent);border-right-color:color-mix(in oklab,var(--cortex-color-accent) 45%,transparent)}.cortex-working-avatar--shown .cortex-working-avatar__ring{animation:cortex-tool-spin 1s linear infinite}.cortex-working-avatar--leaving .cortex-working-avatar__ring{animation:cortex-avatar-ring-out .22s ease-out both}@keyframes cortex-avatar-in{0%{opacity:0;transform:translateY(2.5rem) scale(.7)}}@keyframes cortex-avatar-out{to{opacity:0;transform:scale(.4)}}@keyframes cortex-avatar-ring-out{to{opacity:0}}.cortex-message{min-width:0;transition:margin-block-start .42s cubic-bezier(.76,0,.24,1)}.cortex-message:empty{display:none}.cortex-message:has(.cortex-message-part--folded):not(:has(.cortex-message-part:not(.cortex-message-part--folded))){margin-block-start:-.5rem;transition-delay:.6s}.cortex-text-bubble--assistant,.cortex-subtle-activity,.cortex-tool-pill,.cortex-tool-pill .cortex-tool-pill__icon{transition:translate .42s cubic-bezier(.76,0,.24,1) .16s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity,.cortex-message--working-turn .cortex-tool-pill,.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{transition-delay:0s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity{translate:2rem}[dir=rtl] .cortex-message--working-turn .cortex-text-bubble--assistant,[dir=rtl] .cortex-message--working-turn .cortex-subtle-activity{translate:-2rem}.cortex-message--working-turn .cortex-tool-pill{translate:.875rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill{translate:-.875rem}.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:-.5rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:.5rem}.cortex-message-parts{width:100%;display:flex;flex-direction:column;gap:.5rem}.cortex-message-actions{display:flex;align-items:center;gap:.375rem;margin-top:-.25rem}.cortex-message-actions--user{justify-content:flex-end}.cortex-message-actions__time{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:0;transition:opacity .15s ease}.cortex-message-actions:not(:has(.cortex-copy-btn)) .cortex-message-actions__time{opacity:1}.cortex-message:hover .cortex-message-actions .cortex-copy-btn__button,.cortex-message:hover .cortex-message-actions .cortex-message-actions__time,.cortex-message-actions:focus-within .cortex-copy-btn__button,.cortex-message-actions:focus-within .cortex-message-actions__time{opacity:1}.cortex-message-debug-zone{display:flex;flex-direction:column;gap:.25rem;padding-top:.375rem;margin-top:.125rem;border-top:1px dashed var(--cortex-color-border)}.cortex-message-part{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;min-width:0;transition:grid-template-rows .42s cubic-bezier(.76,0,.24,1),margin-block-end .42s cubic-bezier(.76,0,.24,1),opacity .3s ease,visibility 0s,overflow 0s .42s allow-discrete}.cortex-message-part>*{min-height:0}.cortex-message-part:empty{display:none}.cortex-message-part--folded{grid-template-rows:0fr;margin-block-end:-.5rem;opacity:0;overflow:clip;visibility:hidden;transition-delay:.6s,.6s,.6s,1.02s,0s}[data-cortex-frontier] .cortex-tool-pill__spinner{visibility:hidden}[data-cortex-frontier] .cortex-subtle-activity__dots{display:none}.cortex-message-part--animated{--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-message-part--animated{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}@keyframes cortex-part-reveal{0%{opacity:0;transform:translate(var(--cortex-reveal-from));filter:blur(5px);-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-start) 0;mask-position:var(--cortex-reveal-start) 0}40%{opacity:1}to{transform:none;filter:none;-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-end) 0;mask-position:var(--cortex-reveal-end) 0}}.cortex-unhandled-type{text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-text-part{width:100%;display:flex;flex-direction:column}.cortex-text-part--user{align-items:flex-end}.cortex-text-bubble{min-width:0;overflow-wrap:anywhere;font-size:var(--cortex-font-size-message, var(--cortex-font-size));line-height:1.625;color:var(--cortex-color-text-strong)}.cortex-text-bubble--assistant{width:calc(100% - 2rem)}.cortex-text-bubble--user{max-width:80%;padding:.75rem 1rem;border-radius:calc(var(--cortex-radius) * 2);border-end-end-radius:0;border:1px solid var(--cortex-color-user-border);background:var(--cortex-color-user-surface)}.cortex-text-bubble h1,.cortex-text-bubble h2,.cortex-text-bubble h3,.cortex-text-bubble h4,.cortex-text-bubble h5,.cortex-text-bubble h6{margin-top:1.25em;margin-bottom:.5em;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading)}.cortex-text-bubble h1:first-child,.cortex-text-bubble h2:first-child,.cortex-text-bubble h3:first-child,.cortex-text-bubble h4:first-child,.cortex-text-bubble h5:first-child,.cortex-text-bubble h6:first-child{margin-top:0}.cortex-text-bubble h1{font-size:1.25em}.cortex-text-bubble h2{font-size:1.125em}.cortex-text-bubble h3{font-size:1em}.cortex-text-bubble p{margin-top:.75em;margin-bottom:.75em}.cortex-text-bubble p:first-child{margin-top:0}.cortex-text-bubble p:last-child{margin-bottom:0}.cortex-text-bubble ul,.cortex-text-bubble ol{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1.5em}.cortex-text-bubble ul{list-style-type:disc}.cortex-text-bubble ol{list-style-type:decimal}.cortex-text-bubble li{margin-top:.25em;margin-bottom:.25em}.cortex-text-bubble code{font-family:var(--cortex-font-mono);font-size:.875em;background:var(--cortex-color-border);padding:.125em .375em;border-radius:calc(var(--cortex-radius) * .5)}.cortex-text-bubble pre{margin-top:.75em;margin-bottom:.75em;padding:.75em 1em;background:var(--cortex-color-code-surface, color-mix(in oklab, var(--cortex-color-text-heading) 8%, transparent));border-radius:var(--cortex-radius);max-width:100%;overflow-x:auto;font-size:.8125em;line-height:1.6}.cortex-text-bubble pre code{background:transparent;padding:0;color:var(--cortex-color-code-text)}.cortex-text-bubble blockquote{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1em;border-inline-start:3px solid var(--cortex-color-border-strong);color:var(--cortex-color-text-secondary);font-style:italic}.cortex-text-bubble a{color:var(--cortex-color-link);text-decoration:underline}.cortex-text-bubble a:hover{color:color-mix(in oklab,var(--cortex-color-link) 80%,var(--cortex-color-text-heading))}.cortex-text-bubble table{width:100%;border-collapse:collapse;margin-top:.75em;margin-bottom:.75em;font-size:.875em}.cortex-text-bubble th,.cortex-text-bubble td{border:1px solid var(--cortex-color-border);padding:.375em .75em;text-align:start}.cortex-text-bubble th{background:var(--cortex-color-surface-subtle);font-weight:600}.cortex-text-bubble hr{margin-top:1.5em;margin-bottom:1.5em;border:none;border-top:1px solid var(--cortex-color-border)}.cortex-text-bubble img{max-width:100%;height:auto;border-radius:calc(var(--cortex-radius) * .75)}.cortex-stream-fade{animation:cortex-stream-fade .3s ease-out}@keyframes cortex-stream-fade{0%{opacity:0}}.cortex-expandable{display:block;position:relative}.cortex-expandable__content{isolation:isolate}.cortex-expandable__toolbar{position:absolute;top:.375rem;inset-inline-end:.375rem;z-index:1;display:flex;gap:.125rem;padding:.125rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);box-shadow:0 1px 3px #00000014;opacity:0;transition:opacity .15s}.cortex-expandable:hover>.cortex-expandable__toolbar,.cortex-expandable__toolbar:has(:focus-visible){opacity:1}@media(hover:none){.cortex-expandable__toolbar{position:static;width:fit-content;margin:0 0 .25rem;margin-inline-start:auto;opacity:1}}.cortex-expandable__action{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;width:1.75rem;height:1.75rem;color:var(--cortex-color-text-muted)}.cortex-expandable__action:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-expandable__dialog{width:fit-content;min-width:min(24rem,100vw - 2rem);max-width:calc(100vw - 2rem);max-height:calc(100dvh - 2rem);margin:auto;padding:0;overflow:hidden;border:1px solid var(--cortex-color-border);border-radius:calc(var(--cortex-radius) * 1.5);background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 24px 64px #0000003d}.cortex-expandable__dialog[open]{display:flex;flex-direction:column;animation:cortex-expandable-in .18s ease-out}.cortex-expandable__dialog::backdrop{background:#00000073;animation:cortex-expandable-backdrop-in .18s ease-out}.cortex-expandable__head{display:flex;align-items:center;gap:.125rem;padding-block:.375rem;padding-inline:1rem .375rem;border-bottom:1px solid var(--cortex-color-border)}.cortex-expandable__title{flex:1;min-width:0;margin-inline-end:.5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;font-weight:600;color:var(--cortex-color-text-heading)}.cortex-expandable__body{min-height:0;overflow:auto;overscroll-behavior:contain}@keyframes cortex-expandable-in{0%{opacity:0;transform:translateY(.5rem) scale(.98)}}@keyframes cortex-expandable-backdrop-in{0%{opacity:0}}.cortex-media-block{display:block;width:40rem;max-width:100%;margin:.75em 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-media-block__head{display:flex}.cortex-media-block__head[hidden]{display:none}.cortex-media-block__head{align-items:center;justify-content:space-between;gap:.5rem;padding:.25rem .5rem .25rem .75rem;background:var(--cortex-color-surface-subtle);border-bottom:1px solid var(--cortex-color-border);font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-media-block__lang{font-family:var(--cortex-font-mono)}.cortex-media-block__pending{display:inline-flex;align-items:center;gap:.375rem}.cortex-media-block__pending:before{content:"";width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-media-block__actions{display:inline-flex;align-items:center;gap:.125rem}.cortex-media-block__action{background:transparent;border:0;padding:.125rem .375rem;border-radius:calc(var(--cortex-radius) * .5);font:inherit;color:inherit;cursor:pointer}.cortex-media-block__action:hover,.cortex-media-block__action[aria-pressed=true]{background:var(--cortex-color-hover);color:var(--cortex-color-text-strong)}.cortex-media-block__body{display:block;padding:.75rem}.cortex-media-block__body[hidden]{display:none}.cortex-media-block__body{min-height:6rem;overflow-x:auto}.cortex-media-block__body svg{display:block;max-width:100%;height:auto;direction:ltr}.cortex-media-block__body svg text{unicode-bidi:plaintext}.cortex-media-block__body>div>svg{margin-inline:auto}.cortex-media-block__body--map{padding:0;height:18rem}.cortex-media-block__body--map>div{height:100%}.cortex-media-block__body--report{padding:1rem}.cortex-expandable__body .cortex-media-block__body{width:min(72rem,100vw - 2rem - 2px)}.cortex-expandable__body .cortex-media-block__body:not(.cortex-media-block__body--map,.cortex-media-block__body--report)>div{display:grid}.cortex-expandable__body .cortex-media-block__body:not(.cortex-media-block__body--map,.cortex-media-block__body--report) svg{width:100%;max-width:none!important;max-height:calc(100dvh - 6.5rem)}.cortex-expandable__body .cortex-media-block__body--map{height:min(48rem,100dvh - 5rem)}.cortex-expandable:has(>.cortex-expandable__content>.cortex-media-block__body--map)>.cortex-expandable__toolbar{right:.375rem;left:auto}.cortex-media-block__error{margin:0;font-size:.8125rem;color:var(--cortex-color-danger)}.cortex-media-block .cortex-media-block__source{margin:0;padding:.75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.5;white-space:pre;overflow-x:auto;color:var(--cortex-color-text)}.cortex-attachment-image{margin:.75em 0}.cortex-attachment-image .cortex-expandable{width:fit-content;max-width:100%}.cortex-attachment-image .cortex-expandable__content img{display:block;max-width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border)}.cortex-expandable__body .cortex-attachment-image__expanded{display:block;max-width:calc(100vw - 2rem - 2px);max-height:calc(100dvh - 5rem);margin:auto;border-radius:0}.cortex-attachment-image__caption{margin:.25rem 0 0;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-table-block{display:block;margin:.75em 0}.cortex-table-block th{white-space:nowrap}.cortex-table-block td{max-width:20rem}.cortex-table-block table{margin:0}.cortex-table-block .cortex-expandable{width:fit-content;max-width:100%}.cortex-table-block:has(table[dir=ltr])>.cortex-expandable{margin-right:auto}.cortex-table-block:has(table[dir=rtl])>.cortex-expandable{margin-left:auto}.cortex-table-block__expanded{padding:1rem}.cortex-table-block__expanded td{max-width:40rem}.cortex-reasoning-details{width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-reasoning-details__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.75rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-reasoning-details__summary::-webkit-details-marker{display:none}.cortex-reasoning-details__header{display:flex;align-items:center;gap:.5rem;min-width:0;flex:1}.cortex-reasoning-details__icon{display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}.cortex-reasoning-details__title-group{min-width:0}.cortex-reasoning-details__title-row{display:flex;align-items:center;gap:.5rem}.cortex-reasoning-details__title{font-weight:500;color:var(--cortex-color-text-strong);font-size:.875rem}.cortex-reasoning-details__badge{display:inline-flex;align-items:center;border-radius:calc(var(--cortex-radius) * .5);padding:.125rem .375rem;font-size:.6875rem;font-weight:500}.cortex-reasoning-details__badge--streaming{background:light-dark(#fef3c7,#78350f);color:light-dark(#b45309,#fcd34d)}.cortex-reasoning-details__badge--done{background:var(--cortex-color-success-border);color:var(--cortex-color-success)}.cortex-reasoning-details__chevron{margin-inline-start:auto;display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary>.cortex-reasoning-details__chevron{transform:rotate(180deg)}.cortex-reasoning-details__body{padding:0 1rem 1rem}.cortex-reasoning-details__content{margin-top:.25rem;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-surface);border:1px solid var(--cortex-color-border);padding:.75rem}.cortex-reasoning-details__pre{margin:0;white-space:pre-wrap;overflow-wrap:break-word;font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.625;color:var(--cortex-color-text-strong)}@keyframes cortex-aborted-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.cortex-aborted-flag{display:flex;align-items:center;gap:.625rem;padding:.25rem 0;animation:cortex-aborted-fade-in .3s ease-out both;-webkit-user-select:none;user-select:none}.cortex-aborted-flag__line{flex:1;height:1px;background:repeating-linear-gradient(90deg,#e2a36f 0px,#e2a36f 4px,transparent 4px,transparent 8px);opacity:.5}.cortex-aborted-flag__label{display:inline-flex;align-items:center;gap:.3125rem;font-family:var(--cortex-font-mono);font-size:.625rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:light-dark(#c2824a,#e2a36f)}.cortex-aborted-flag__icon{color:light-dark(#c2824a,#e2a36f);flex-shrink:0}.cortex-aborted-flag__reason{margin:.125rem 0 0;font-size:.75rem;line-height:1.4;text-align:center;overflow-wrap:anywhere;color:light-dark(#c2824a,#e2a36f)}.cortex-trigger-block{display:inline-flex;width:fit-content;padding:.375rem .75rem;border-radius:999px;background:var(--cortex-color-accent-surface);color:var(--cortex-color-text-strong);font-size:.75rem}.cortex-trigger-block__head{display:flex;align-items:center;gap:.5rem}.cortex-trigger-block__icon{flex-shrink:0;color:var(--cortex-color-accent)}.cortex-trigger-block__name{font-family:var(--cortex-font-mono);font-weight:600}.cortex-trigger-block__time{color:var(--cortex-color-text-secondary);font-size:.6875rem}.cortex-trigger-block--debug{display:flex;flex-direction:column;width:auto;gap:.375rem;padding:.5rem .75rem;border:1px dashed var(--cortex-color-border-strong);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.6875rem}.cortex-trigger-block--debug .cortex-trigger-block__head{font-family:var(--cortex-font-mono);letter-spacing:.04em;text-transform:uppercase;color:var(--cortex-color-text-secondary)}.cortex-trigger-block--debug .cortex-trigger-block__name{color:var(--cortex-color-text-strong)}.cortex-trigger-block--debug .cortex-trigger-block__time{margin-inline-start:auto;font-size:inherit;text-transform:none;letter-spacing:0}.cortex-trigger-block__payload{font-size:.75rem}.cortex-trigger-block__payload>summary{cursor:pointer;color:var(--cortex-color-text-secondary);-webkit-user-select:none;user-select:none}.cortex-trigger-block__payload[open]>summary{margin-bottom:.25rem}.cortex-widget__messages-disabled{padding:.75rem 1rem;text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-message-attachments{display:flex;flex-wrap:wrap;gap:.375rem}.cortex-message-attachments--user{justify-content:flex-end}.cortex-message-attachment{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:.25rem .5rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong);cursor:pointer;transition:background .15s}.cortex-message-attachment:hover{background:var(--cortex-color-surface-muted)}.cortex-message-attachment__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-message-attachment__icon,.cortex-message-attachment__dl-icon{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-debug-tool{--_accent: var(--cortex-color-border-strong);position:relative;width:100%;border-radius:10px;background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-debug-tool:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var(--_accent);z-index:1;transition:background .2s}.cortex-debug-tool[data-state=complete]{--_accent: var(--cortex-color-success)}.cortex-debug-tool[data-state=error]{--_accent: var(--cortex-color-danger)}.cortex-debug-tool[data-state=awaiting-input],.cortex-debug-tool[data-state=input-streaming],.cortex-debug-tool[data-state=input-complete]{--_accent: light-dark(#d97706, #fbbf24)}.cortex-debug-tool[data-state=approval-requested],.cortex-debug-tool[data-state=approval-responded]{--_accent: light-dark(#7c3aed, #a78bfa)}.cortex-debug-tool__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.625rem .875rem .625rem 1.125rem}.cortex-debug-tool__summary::-webkit-details-marker{display:none}.cortex-debug-tool__header{display:flex;align-items:flex-start;gap:.75rem}.cortex-debug-tool__meta{flex:1;min-width:0}.cortex-debug-tool__title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-debug-tool__name{font-weight:600;font-size:.8125rem;color:var(--cortex-color-text-heading);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.01em}.cortex-debug-tool__id-row{margin-top:2px;font-size:.625rem;color:var(--cortex-color-text-muted);font-family:ui-monospace,SF Mono,Cascadia Code,monospace;word-break:break-all}.cortex-debug-tool__actions{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.cortex-debug-tool__state{display:inline-flex;align-items:center;gap:5px;font-size:.6875rem;font-weight:500;padding:2px 8px;border-radius:4px;white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__state--success{color:var(--cortex-color-success);background:var(--cortex-color-success-surface)}.cortex-debug-tool__state--error{color:var(--cortex-color-danger);background:light-dark(#fef2f2,#450a0a)}.cortex-debug-tool__state--approval{color:light-dark(#7c3aed,#a78bfa);background:light-dark(#f5f3ff,#2e1065)}.cortex-debug-tool__state--pending{color:light-dark(#b45309,#fcd34d);background:light-dark(#fffbeb,#451a03)}.cortex-debug-tool__pulse{width:6px;height:6px;border-radius:50%;background:light-dark(#d97706,#fbbf24);animation:dbg-pulse 2s ease-in-out infinite}.cortex-debug-tool__pulse--violet{background:#8b5cf6}@keyframes dbg-pulse{0%,to{opacity:1}50%{opacity:.3}}.cortex-debug-tool__chevron{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:4px;color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary .cortex-debug-tool__chevron{transform:rotate(180deg)}.cortex-debug-tool__body{padding:0 .875rem .75rem 1.125rem}.cortex-debug-tool__section:not(:first-child){border-top:1px solid var(--cortex-color-border);padding-top:.625rem;margin-top:.625rem}.cortex-debug-tool__section-bar{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-debug-tool__section-label{font-size:.625rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-muted);font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__section-label--success{color:var(--cortex-color-success)}.cortex-debug-tool__section-label--error{color:var(--cortex-color-danger)}.cortex-debug-tool__section-label--approval{color:light-dark(#7c3aed,#a78bfa)}.cortex-debug-tool__section-lang{font-size:.5625rem;color:var(--cortex-color-border-strong);font-family:ui-monospace,SF Mono,monospace;text-transform:lowercase}.cortex-debug-tool__pre{margin:0;max-height:20rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre;overflow-wrap:break-word}.cortex-debug-tool__tree{max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__error-pre{margin:0;max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:light-dark(#fef2f2,#450a0a);color:light-dark(#991b1b,#fca5a5);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre-wrap;word-break:break-word}.cortex-debug-tool__message{padding:.5rem .75rem;font-size:.75rem;color:var(--cortex-color-text-secondary);border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__message--approval{color:light-dark(#5b21b6,#c4b5fd);background:light-dark(#faf5ff,#3b0764)}.cortex-debug-tool__section--success .cortex-debug-tool__tree{background:light-dark(#f0fdf4,#052e16)}.cortex-debug-tool__section--error .cortex-debug-tool__tree{background:light-dark(#fef2f2,#450a0a)}.cortex-tool-call-animated{display:block}.cortex-tool-pill{display:inline-flex;align-items:center;gap:.375rem;padding:.25rem 0;max-width:100%}.cortex-tool-pill__icon{position:relative;width:.75rem;height:.75rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--cortex-color-text-muted)}.cortex-tool-pill__spinner{position:absolute;width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;opacity:0;transition:opacity .2s}.cortex-tool-pill__spinner--visible{opacity:1;animation:cortex-tool-spin .8s linear infinite}@keyframes cortex-tool-spin{to{transform:rotate(360deg)}}.cortex-tool-pill__svg{position:absolute;width:.75rem;height:.75rem;opacity:0;transform:scale(.6);transition:opacity .2s,transform .2s}.cortex-tool-pill__svg--visible{opacity:1;transform:scale(1)}.cortex-tool-pill__svg--check{color:var(--cortex-color-success)}.cortex-tool-pill__svg--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title{font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .3s}.cortex-tool-pill__title--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title--pending{color:var(--cortex-color-text-muted);opacity:.6}.cortex-tool-pill__meta{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:.8;white-space:nowrap;font-variant-numeric:tabular-nums}.cortex-approval-card{display:block;max-width:min(100%,28rem);margin:.25rem 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-approval-card--asking{border-color:color-mix(in oklab,var(--cortex-color-accent) 45%,var(--cortex-color-border));box-shadow:0 0 0 3px color-mix(in oklab,var(--cortex-color-accent) 10%,transparent)}.cortex-approval-card__head{display:flex;align-items:center;gap:.5rem;padding:.625rem .75rem 0;font-size:.75rem;font-weight:600;color:var(--cortex-color-accent)}.cortex-approval-card__sentence{margin:0;padding:.375rem .75rem .5rem;font-weight:600;color:var(--cortex-color-text-heading)}.cortex-approval-card__foot{display:flex;gap:.5rem;padding:.625rem .75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-approval-card__button{border:1px solid var(--cortex-color-border-strong);border-radius:calc(var(--cortex-radius) * .75);background:var(--cortex-color-surface);padding:.375rem .875rem;font:inherit;font-size:.8125rem;font-weight:500;color:var(--cortex-color-text-strong);cursor:pointer}.cortex-approval-card__button--approve{border-color:var(--cortex-color-accent);background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground)}.cortex-approval-card__line{display:flex;align-items:baseline;gap:.5rem;padding:.5rem .75rem;font-size:.8125rem;color:var(--cortex-color-text-secondary)}.cortex-approval-card__line .cortex-tool-pill__icon{flex-shrink:0}.cortex-approval-card__decision{font-weight:600;color:var(--cortex-color-text-strong)}.cortex-approval-card__summary{min-width:0;flex:1}.cortex-tool-fold{display:block;align-self:flex-start;text-align:start;border:0;background:none;padding:0 0 .25rem;margin-block-start:-.625rem;margin-inline-start:1.125rem;font:inherit;font-size:.75rem;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-tool-fold:hover,.cortex-tool-fold:focus-visible{color:var(--cortex-color-text-secondary)}.cortex-client-tool-embed{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-client-tool-embed__bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border-block-end:1px solid var(--cortex-color-border-strong);font-size:12px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__cancel{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-client-tool-embed__cancel:hover{color:var(--cortex-color-danger)}.cortex-client-tool-embed__frame{display:block;inline-size:100%;block-size:420px;border:0;background:var(--cortex-color-surface)}.cortex-client-tool-embed__status{display:flex;align-items:center;gap:8px;padding:20px 16px;font-size:13px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__retry{border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:none;padding:4px 10px;font:inherit;font-size:12px;color:inherit;cursor:pointer}.cortex-client-tool-embed-dialog{border:0;padding:0;background:none;inline-size:min(560px,100vw - 48px);max-inline-size:none}.cortex-client-tool-embed-dialog::backdrop{background:#00000073}.cortex-client-tool-embed-dialog .cortex-client-tool-embed{inline-size:100%;max-inline-size:none;box-shadow:0 24px 64px #0000004d}.cortex-client-tool-embed-dialog .cortex-client-tool-embed__frame{block-size:min(70dvh,560px)}.cortex-location-input{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-location-input--settled{display:flex;gap:10px;border-color:var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-location-input__map{position:relative;block-size:11rem;background:var(--cortex-color-surface-muted)}.cortex-location-input__map--still{flex:none;inline-size:120px;block-size:84px}.cortex-location-input__canvas{block-size:100%}.cortex-location-input__still-failed{display:flex;align-items:center;justify-content:center;block-size:100%;padding:0 8px;font-size:11px;text-align:center;color:var(--cortex-color-text-muted)}.cortex-location-input__locate{position:absolute;inset-inline-end:10px;inset-block-start:10px;z-index:1001;display:inline-flex;align-items:center;justify-content:center;inline-size:30px;block-size:30px;border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 1px 3px #0003;cursor:pointer}.cortex-location-input__locate svg{inline-size:15px;block-size:15px}.cortex-location-input__locate:disabled{opacity:.45;cursor:default}.cortex-location-input__foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border-block-start:1px solid var(--cortex-color-border-strong);font-size:12px}.cortex-location-input__hint{display:inline-flex;align-items:center;gap:6px;min-inline-size:0;color:var(--cortex-color-text-muted)}.cortex-location-input__hint--failed{color:var(--cortex-color-danger)}.cortex-location-input__spinner{inline-size:.625rem;block-size:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-location-input__coords{font-family:var(--cortex-font-mono);font-size:.75rem;color:var(--cortex-color-text-secondary);direction:ltr;unicode-bidi:isolate}.cortex-location-input__actions{display:flex;align-items:center;gap:8px}.cortex-location-input__skip{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-location-input__skip:hover{color:var(--cortex-color-danger)}.cortex-location-input__skip:disabled{opacity:.45;cursor:default}.cortex-location-input__send{border:1px solid var(--cortex-color-primary);border-radius:8px;background:var(--cortex-color-primary);padding:4px 10px;font:inherit;font-size:12px;color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-location-input__send:disabled{opacity:.45;cursor:default}.cortex-location-input__body{display:flex;flex-direction:column;justify-content:center;gap:2px;min-inline-size:0;padding-block:8px;padding-inline-end:12px}.cortex-location-input__title{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--cortex-color-text-strong)}.cortex-location-input__title svg{inline-size:13px;block-size:13px;color:var(--cortex-color-success)}.cortex-reasoning-animated{display:block}.cortex-subtle-activity{display:flex;align-items:center;gap:.375rem;padding:.25rem 0;width:fit-content}.cortex-subtle-activity__dots{display:flex;align-items:center;gap:3px}.cortex-subtle-activity__dot{width:3px;height:3px;border-radius:9999px;background:var(--cortex-color-accent);animation:cortex-subtle-dot-pulse 1.4s ease-in-out infinite}.cortex-subtle-activity__dot--d1{animation-delay:.2s}.cortex-subtle-activity__dot--d2{animation-delay:.4s}@keyframes cortex-subtle-dot-pulse{0%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1.3)}}.cortex-subtle-activity__label-mask{overflow:hidden;position:relative;height:1.1em}.cortex-subtle-activity__label{display:block;font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;line-height:1.1em}.cortex-subtle-activity__label--idle,.cortex-subtle-activity__label--entering{opacity:1;transform:translateY(0);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--exiting{opacity:0;transform:translateY(-6px);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--enter-start{opacity:0;transform:translateY(6px);transition:none}.cortex-attachment-queue{display:flex;flex-wrap:wrap;gap:.375rem;margin-bottom:.5rem}.cortex-attachment-chip{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding-block:.25rem;padding-inline:.5rem .375rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong)}.cortex-attachment-chip--error{align-items:flex-start;max-width:100%;border-color:var(--cortex-color-danger-border);background:var(--cortex-color-danger-surface);color:var(--cortex-color-danger)}.cortex-attachment-chip__icon,.cortex-attachment-chip__spinner{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-attachment-chip__spinner{animation:cortex-attachment-spin .8s linear infinite}.cortex-attachment-chip__spinner-track{opacity:.25}@keyframes cortex-attachment-spin{to{transform:rotate(360deg)}}.cortex-attachment-chip__text{display:grid;min-width:0;text-align:start}.cortex-attachment-chip__reason{font-size:.71875rem;opacity:.9}.cortex-attachment-chip--error .cortex-attachment-chip__icon{color:currentColor}.cortex-attachment-chip__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-attachment-chip__remove{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:1rem;height:1rem;padding:0;border:0;border-radius:3px;background:transparent;color:currentColor;opacity:.6;cursor:pointer}.cortex-attachment-chip__remove:hover{opacity:1;background:var(--cortex-color-hover)}.cortex-attachment-chip__remove svg{width:.75rem;height:.75rem}.cortex-token-usage{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-token-usage__summary{align-self:end}html[dir=ltr] .cortex-token-usage__summary{align-self:start}.cortex-token-usage__summary{display:inline-flex;align-items:center;gap:.625rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-token-usage__summary:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-token-usage__summary{flex-wrap:wrap;max-width:100%;text-align:start}.cortex-token-usage__total-number{font-weight:600;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__total-label{margin-inline-start:3px;color:var(--cortex-color-text-muted);font-weight:400;letter-spacing:.03em}.cortex-token-usage__model{color:var(--cortex-color-border-strong);font-weight:400;font-size:.5625rem;letter-spacing:.02em;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-token-usage__pills{display:inline-flex;align-items:center;gap:.5rem}.cortex-token-usage__pill{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-muted)}.cortex-token-usage__dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.cortex-token-usage__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 2px #ea580c1a}.cortex-token-usage__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 2px #4f46e51a}.cortex-token-usage__cache-badge{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 6px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-token-usage--expanded .cortex-token-usage__chevron{transform:rotate(180deg)}.cortex-token-usage__details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-token-usage__details-inner{overflow:hidden}.cortex-token-usage--expanded .cortex-token-usage__details{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-token-usage__columns{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--cortex-color-border);border-radius:8px;overflow:hidden}.cortex-token-usage__col{background:var(--cortex-color-surface-subtle);padding:.5rem .625rem}.cortex-token-usage__col-header{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-token-usage__col-label{font-weight:600;font-size:.5625rem;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-secondary);font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__col-total{margin-inline-start:auto;font-weight:700;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__rows{display:flex;flex-direction:column;gap:1px}.cortex-token-usage__row{display:flex;align-items:baseline;justify-content:space-between;padding:2px 0;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__row-label{color:var(--cortex-color-text-muted);font-size:.625rem}.cortex-token-usage__row-value{font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary);font-weight:500}.cortex-token-usage__cache-bar-row{display:flex;align-items:center;gap:.5rem;margin-top:.5rem;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__cache-bar{flex:1;height:3px;border-radius:2px;background:var(--cortex-color-border);overflow:hidden}.cortex-token-usage__cache-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#10b981,var(--cortex-color-success));transition:width .4s cubic-bezier(.4,0,.2,1)}.cortex-token-usage__cache-label{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-llm-inspector__trigger{align-self:end}html[dir=ltr] .cortex-llm-inspector__trigger{align-self:start}.cortex-llm-inspector__trigger{display:inline-flex;align-items:center;gap:.5rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-llm-inspector__trigger:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-llm-inspector__icon{color:var(--cortex-color-text-muted);flex-shrink:0}.cortex-llm-inspector__loading{color:var(--cortex-color-border-strong);font-style:italic}.cortex-llm-inspector__badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;padding:0 .35rem;border-radius:9999px;background:var(--cortex-color-border);color:var(--cortex-color-text-secondary);font-size:.5625rem;font-weight:700}.cortex-llm-inspector__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-llm-inspector--open .cortex-llm-inspector__chevron{transform:rotate(180deg)}.cortex-llm-inspector__panel-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-llm-inspector__panel-inner{overflow:hidden}.cortex-llm-inspector--open .cortex-llm-inspector__panel-wrapper{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-llm-inspector__panel{display:flex;flex-direction:column;gap:.375rem}.cortex-llm-inspector__empty{padding:.625rem;color:var(--cortex-color-text-muted);font-style:italic}.cortex-llm-inspector__step{border-radius:8px;background:var(--cortex-color-surface-subtle);overflow:hidden;transition:box-shadow .2s ease}.cortex-llm-inspector__step--expanded{box-shadow:0 0 0 1px var(--cortex-color-border)}.cortex-llm-inspector__step-header{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .625rem;border:none;background:transparent;cursor:pointer;font:inherit;color:inherit;text-align:start;transition:background .15s ease}.cortex-llm-inspector__step-header:hover{background:#00000005}.cortex-llm-inspector__step-label{font-weight:600;color:var(--cortex-color-text-secondary);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-metrics{display:inline-flex;align-items:center;gap:.625rem;margin-inline-start:auto;font-variant-numeric:tabular-nums}.cortex-llm-inspector__metric{display:inline-flex;align-items:center;gap:3px}.cortex-llm-inspector__dot{width:5px;height:5px;border-radius:50%;flex-shrink:0}.cortex-llm-inspector__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 1.5px #ea580c1f}.cortex-llm-inspector__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 1.5px #4f46e51f}.cortex-llm-inspector__cache-pct{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 5px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-chevron{color:var(--cortex-color-border-strong);transition:transform .2s ease;flex-shrink:0}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-chevron{transform:rotate(180deg)}.cortex-llm-inspector__step-body-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease;opacity:0}.cortex-llm-inspector__step-body-inner{overflow:hidden}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-body-wrapper{grid-template-rows:1fr;opacity:1}.cortex-llm-inspector__step-body{padding:0 .625rem .625rem;display:flex;flex-direction:column;gap:.5rem}.cortex-llm-inspector__usage-rows{display:flex;flex-direction:column;border-radius:6px;overflow:hidden;background:var(--cortex-color-border);gap:1px}.cortex-llm-inspector__usage-row{display:flex;align-items:baseline;gap:.5rem;padding:.375rem .625rem;background:var(--cortex-color-surface);flex-wrap:wrap}.cortex-llm-inspector__usage-row--total{background:light-dark(#fafbfc,#141414)}.cortex-llm-inspector__usage-lbl{font-size:.5625rem;text-transform:uppercase;letter-spacing:.05em;color:var(--cortex-color-text-muted);font-weight:600;width:3.25rem;flex-shrink:0;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__usage-val{font-variant-numeric:tabular-nums;font-weight:600;color:var(--cortex-color-text-secondary);min-width:3rem}.cortex-llm-inspector__usage-row--total .cortex-llm-inspector__usage-val{font-weight:700;color:var(--cortex-color-text-heading)}.cortex-llm-inspector__usage-detail{color:var(--cortex-color-border-strong);font-size:.5625rem;margin-inline-start:auto}.cortex-llm-inspector__tabs{display:flex;gap:0;border-bottom:1px solid var(--cortex-color-border)}.cortex-llm-inspector__tab{padding:.375rem .75rem;border:none;background:transparent;cursor:pointer;font:inherit;color:var(--cortex-color-text-muted);font-weight:500;position:relative;transition:color .15s ease;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__tab:hover{color:var(--cortex-color-text-secondary)}.cortex-llm-inspector__tab--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-llm-inspector__tab--active:after{content:"";position:absolute;inset-inline:0;bottom:-1px;height:2px;background:var(--cortex-color-text-heading);border-radius:1px 1px 0 0}.cortex-llm-inspector__json-pane{position:relative;max-height:24rem;overflow:auto;padding:.625rem;background:var(--cortex-color-surface);border-radius:6px}.cortex-llm-inspector__json-copy{position:sticky;top:0;float:inline-end;z-index:1}.cortex-json-tree{display:block;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.75rem;line-height:1.25rem;-webkit-user-select:text;user-select:text;white-space:pre-wrap;word-break:break-word}.cortex-json-tree__indent{padding-inline-start:1.25em;border-inline-start:1px solid var(--cortex-color-border);margin-inline-start:.3em}.cortex-json-tree__line{position:relative}.cortex-json-tree__toggle{cursor:pointer;-webkit-user-select:none;user-select:none}.cortex-json-tree__toggle:hover .cortex-json-tree__arrow{color:var(--cortex-color-text)}.cortex-json-tree__arrow{display:inline-block;width:1em;text-align:center;color:var(--cortex-color-text-muted);font-size:.525rem;transition:transform .15s ease;vertical-align:middle}.cortex-json-tree__arrow--collapsed{transform:rotate(-90deg)}.cortex-json-tree__bracket{color:var(--cortex-color-text-secondary)}.cortex-json-tree__key{color:light-dark(#6366f1,#818cf8)}.cortex-json-tree__colon{color:var(--cortex-color-text-secondary)}.cortex-json-tree__comma{color:var(--cortex-color-text-muted)}.cortex-json-tree__string{color:var(--cortex-color-success)}.cortex-json-tree__number{color:light-dark(#2563eb,#60a5fa)}.cortex-json-tree__boolean{color:light-dark(#d97706,#fbbf24)}.cortex-json-tree__null{color:var(--cortex-color-text-muted);font-style:italic}.cortex-json-tree__collapsed-hint{display:inline-block;padding:0 .4em;margin:0 .15em;font-size:.625rem;line-height:1.5;color:var(--cortex-color-text-muted);background:var(--cortex-color-surface-subtle);border:1px solid var(--cortex-color-border);border-radius:3px;font-style:italic;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:middle}.cortex-json-tree__collapsed-hint:hover{color:var(--cortex-color-text-secondary);border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface-muted)}.cortex-copy-btn{display:inline-flex;align-items:center}.cortex-copy-btn__button{display:inline-flex;align-items:center;justify-content:center;width:1.375rem;height:1.375rem;padding:0;border:none;border-radius:3px;background:transparent;color:var(--cortex-color-text-muted);cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease,background .15s ease}:hover>cortex-copy-button .cortex-copy-btn__button,:hover>.cortex-copy-btn .cortex-copy-btn__button,.cortex-copy-btn__button:hover,.cortex-copy-btn__button:focus-visible{opacity:1}.cortex-copy-btn__button:hover{background:var(--cortex-color-hover);color:var(--cortex-color-text)}.cortex-copy-btn__button--copied{opacity:1;color:var(--cortex-color-success);pointer-events:none}.cortex-copy-btn__button--copied:hover{color:var(--cortex-color-success);background:transparent}.cortex-copy-btn__icon{flex-shrink:0}.cortex-copy-btn__icon--check{animation:cortex-copy-pop .25s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes cortex-copy-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.cortex-widget *,.cortex-widget *:before,.cortex-widget *:after,.cortex-widget *::backdrop{animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:.01ms!important;transition-delay:0s!important}}\n']
12195
12714
  }]
12196
12715
  }],
12197
12716
  propDecorators: {