/* AI chat: keep every message, tool call and tool output inside the chat column.
   The message bubble is a grid with overflow-hidden — grid children won't shrink below their content by
   default, so a long tool row widened the grid and the bubble clipped it. Force the column to the bubble's
   width; long text wraps; tables/media stay within the column; markdown code scrolls inside its own box. */
.chat-fit { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.chat-fit.grid { grid-template-columns: minmax(0, 1fr); }
.chat-fit > * { min-width: 0; max-width: 100%; }
.chat-fit pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.chat-fit table { display: block; max-width: 100%; overflow-x: auto; }
.chat-fit img, .chat-fit video, .chat-fit iframe, .chat-fit canvas { max-width: 100%; height: auto; }
.chat-fit .truncate { min-width: 0; }

/* Compact tool cards (Search, Read, Bash…): ~70% less height. Output boxes scroll inside. */
.chat-fit.tool-card { padding-top: 4px; padding-bottom: 4px; }
.chat-fit.tool-card > span.absolute { top: 10px; }
.tool-card .max-h-64 { max-height: 5rem; }
.tool-card .max-h-48 { max-height: 3.75rem; }
.tool-card .max-h-40 { max-height: 3.25rem; }
.tool-card .max-h-32 { max-height: 2.75rem; }
.tool-card .max-h-28 { max-height: 2.5rem; }
.tool-card .max-h-20 { max-height: 3.5rem; }
.tool-card pre, .tool-card .leading-relaxed { line-height: 1.4; }
.tool-card .mt-1\.5 { margin-top: 3px; }
.tool-card .py-2 { padding-top: 4px; padding-bottom: 4px; }
.tool-card .py-1\.5 { padding-top: 3px; padding-bottom: 3px; }

/* List markers: the app's CSS reset (Tailwind preflight) sets list-style:none on every ul/ol, and GitHub's stylesheet expects
   the browser default, so bullets and numbers vanished in the chat. Put the markers back, GitHub style. */
.markdown-body ul { list-style-type: disc; }
.markdown-body ol { list-style-type: decimal; }
.markdown-body ul ul { list-style-type: circle; }
.markdown-body ul ul ul, .markdown-body ol ul ul { list-style-type: square; }
.markdown-body li { display: list-item; }
.markdown-body ul.contains-task-list, .markdown-body .contains-task-list, .markdown-body .task-list-item,
.markdown-body ul.no-list, .markdown-body ol.no-list { list-style-type: none; }
