/* App-wide tweaks on top of Bootstrap 5.3. Keep this small. */
:focus-visible { outline: 3px solid rgba(13, 110, 253, .5); outline-offset: 2px; }

/* Tab rows scroll sideways on small screens instead of widening the page. */
.tabs-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.tabs-scroll .nav { min-width: max-content; }

/* Long emails/names never force horizontal scrolling. */
.text-break-all { word-break: break-all; }

.min-w-0 { min-width: 0; }
.preview-text { max-height: 24rem; overflow-y: auto; overflow-wrap: anywhere; }

/* Chat */
.chat-log { height: min(60vh, 34rem); overflow-y: auto; background: var(--bs-tertiary-bg); }
.chat-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: .75rem; }
.chat-row-user { align-items: flex-end; }
.chat-bubble { max-width: min(85%, 40rem); padding: .6rem .85rem; border-radius: 1rem; overflow-wrap: anywhere; }
.chat-bubble p:last-child, .chat-bubble ul:last-child, .chat-bubble ol:last-child { margin-bottom: 0; }
.chat-bubble ul, .chat-bubble ol { padding-left: 1.2rem; }
.chat-bubble-user { background: var(--bs-primary); color: #fff; border-bottom-right-radius: .25rem; white-space: pre-wrap; }
.chat-bubble-bot { background: #fff; border: 1px solid var(--bs-border-color); border-bottom-left-radius: .25rem; }
.chat-bubble-error { border-color: var(--bs-danger-border-subtle); background: var(--bs-danger-bg-subtle); }
.chat-meta { max-width: min(85%, 40rem); margin-top: .25rem; padding-left: .25rem; }
.chat-meta summary { display: inline; cursor: pointer; text-decoration: underline; }
.citation { text-decoration: none; font-weight: 600; }
#chat-input { resize: none; max-height: 10rem; }
