diff --git a/app/globals.css b/app/globals.css index 019a3473..80a44ada 100644 --- a/app/globals.css +++ b/app/globals.css @@ -175,11 +175,13 @@ .mobile-chat-messages-area { flex: 1; /* Changed from height: 40vh to take available space */ overflow-y: auto; + overflow-x: hidden; padding: 12px; background-color: hsl(var(--card)); color: hsl(var(--card-foreground)); box-sizing: border-box; min-height: 0; + min-width: 0; border-radius: 16px; border: 1px solid hsl(var(--border)); margin: 4px 8px 8px 8px; @@ -272,3 +274,18 @@ .mapboxgl-compact { display: none !important; } + +/* KaTeX display math overflow containment */ +.prose .katex-display, +.prose-sm .katex-display, +.katex-display { + max-width: 100%; + overflow-x: auto; + overflow-y: hidden; +} + +.prose .katex-display > .katex, +.prose-sm .katex-display > .katex, +.katex-display > .katex { + max-width: 100%; +} diff --git a/components/chat.tsx b/components/chat.tsx index b18a8f17..389764ac 100644 --- a/components/chat.tsx +++ b/components/chat.tsx @@ -201,7 +201,7 @@ export function Chat({ id }: ChatProps) { onSuggestionsChange={setSuggestions} /> -