/**
 * Chatbot rich text sandbox
 * Normalizes server-rendered Markdown so host-site typography rules cannot
 * leak into chatbot answers.
 */

.mr-chatbot-container .mr-chatbot-rich-text,
.mr-chat-area-container .mr-chatbot-rich-text {
  color: var(--mr-chatbot-color-dark-gray, var(--chat-area-color-dark, #280103)) !important;
  font-family: 'Lexend', sans-serif !important;
  font-size: var(--mr-chatbot-font-content, var(--chat-area-font-size, 14px)) !important;
  font-style: normal !important;
  font-weight: var(--mr-chatbot-weight-light, 300) !important;
  line-height: var(--mr-chatbot-line-height, var(--chat-area-line-height, 1.6)) !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  text-transform: none !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.mr-chatbot-container .mr-chatbot-rich-text.is-streaming,
.mr-chat-area-container .mr-chatbot-rich-text.is-streaming {
  white-space: pre-wrap !important;
}

.mr-chatbot-container .mr-chatbot-rich-text *,
.mr-chatbot-container .mr-chatbot-rich-text *::before,
.mr-chatbot-container .mr-chatbot-rich-text *::after,
.mr-chat-area-container .mr-chatbot-rich-text *,
.mr-chat-area-container .mr-chatbot-rich-text *::before,
.mr-chat-area-container .mr-chatbot-rich-text *::after {
  box-sizing: border-box !important;
  font-family: inherit !important;
  font-style: inherit !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(p, ul, ol, blockquote, pre, table, h1, h2, h3, h4, h5, h6),
.mr-chat-area-container .mr-chatbot-rich-text :where(p, ul, ol, blockquote, pre, table, h1, h2, h3, h4, h5, h6) {
  margin-top: 0 !important;
  margin-bottom: 0.72em !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(p, ul, ol, li, blockquote, td, th, a, span, strong, b, em, i),
.mr-chat-area-container .mr-chatbot-rich-text :where(p, ul, ol, li, blockquote, td, th, a, span, strong, b, em, i) {
  color: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(p):empty,
.mr-chat-area-container .mr-chatbot-rich-text :where(p):empty {
  display: none !important;
}

.mr-chatbot-container .mr-chatbot-rich-text > :last-child,
.mr-chatbot-container .mr-chatbot-rich-text :where(li) > :last-child,
.mr-chat-area-container .mr-chatbot-rich-text > :last-child,
.mr-chat-area-container .mr-chatbot-rich-text :where(li) > :last-child {
  margin-bottom: 0 !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(h1, h2, h3, h4, h5, h6),
.mr-chat-area-container .mr-chatbot-rich-text :where(h1, h2, h3, h4, h5, h6) {
  margin: 0.85em 0 0.35em !important;
  color: inherit !important;
  font-family: inherit !important;
  font-size: 1em !important;
  font-weight: var(--mr-chatbot-weight-semibold, 600) !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(strong, b),
.mr-chat-area-container .mr-chatbot-rich-text :where(strong, b) {
  color: inherit !important;
  font-weight: var(--mr-chatbot-weight-semibold, 600) !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(em, i),
.mr-chat-area-container .mr-chatbot-rich-text :where(em, i) {
  font-style: italic !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(a),
.mr-chat-area-container .mr-chatbot-rich-text :where(a) {
  color: var(--mr-chatbot-color-primary, var(--chat-area-color-primary, #e30613)) !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  text-decoration: none !important;
  overflow-wrap: anywhere;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(a:hover, a:focus),
.mr-chat-area-container .mr-chatbot-rich-text :where(a:hover, a:focus) {
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(ul, ol),
.mr-chat-area-container .mr-chatbot-rich-text :where(ul, ol) {
  display: block !important;
  color: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  padding-left: 1.25em !important;
  list-style-position: outside !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(ul),
.mr-chat-area-container .mr-chatbot-rich-text :where(ul) {
  list-style-type: disc !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(ol),
.mr-chat-area-container .mr-chatbot-rich-text :where(ol) {
  list-style-type: decimal !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(li),
.mr-chat-area-container .mr-chatbot-rich-text :where(li) {
  display: list-item !important;
  margin: 0.25em 0 !important;
  padding-left: 0.05em !important;
  text-align: left !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(li)::marker,
.mr-chat-area-container .mr-chatbot-rich-text :where(li)::marker {
  color: var(--mr-chatbot-color-primary, var(--chat-area-color-primary, #e30613));
  font-weight: var(--mr-chatbot-weight-semibold, 600);
}

.mr-chatbot-container .mr-chatbot-rich-text :where(blockquote),
.mr-chat-area-container .mr-chatbot-rich-text :where(blockquote) {
  padding-left: 0.9em !important;
  border-left: 3px solid var(--mr-chatbot-color-blush, var(--chat-area-color-blush, #f4e3e3));
}

.mr-chatbot-container .mr-chatbot-rich-text :where(code),
.mr-chat-area-container .mr-chatbot-rich-text :where(code) {
  padding: 0.08em 0.28em;
  border-radius: 4px;
  background: rgba(40, 1, 3, 0.07);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 0.92em !important;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(pre),
.mr-chat-area-container .mr-chatbot-rich-text :where(pre) {
  max-width: 100%;
  padding: 0.75em;
  overflow-x: auto;
  white-space: pre-wrap !important;
  border-radius: 8px;
  background: rgba(40, 1, 3, 0.07);
}

.mr-chatbot-container .mr-chatbot-rich-text :where(pre code),
.mr-chat-area-container .mr-chatbot-rich-text :where(pre code) {
  padding: 0;
  background: transparent;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(table),
.mr-chat-area-container .mr-chatbot-rich-text :where(table) {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.mr-chatbot-container .mr-chatbot-rich-text :where(th, td),
.mr-chat-area-container .mr-chatbot-rich-text :where(th, td) {
  padding: 0.35em 0.5em;
  border: 1px solid var(--mr-chatbot-color-blush, var(--chat-area-color-blush, #f4e3e3));
  text-align: left;
  vertical-align: top;
}

.mr-chatbot-container .mr-chatbot-rich-text .mr-chatbot-citation-link,
.mr-chat-area-container .mr-chatbot-rich-text .mr-chatbot-citation-link {
  font-size: 0.72em !important;
  font-weight: var(--mr-chatbot-weight-semibold, 600) !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.mr-chatbot-container .mr-chatbot-sources,
.mr-chat-area-container .mr-chatbot-sources {
  color: var(--mr-chatbot-color-dark-gray, var(--chat-area-color-dark, #280103)) !important;
  font-family: 'Lexend', sans-serif !important;
  font-size: 12px !important;
  font-style: normal !important;
  font-weight: var(--mr-chatbot-weight-light, 300) !important;
  line-height: 16px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.mr-chatbot-container .mr-chatbot-sources *,
.mr-chat-area-container .mr-chatbot-sources * {
  box-sizing: border-box !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.mr-chatbot-container .mr-chatbot-sources :where(ol, ul),
.mr-chat-area-container .mr-chatbot-sources :where(ol, ul) {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.mr-chatbot-container .mr-chatbot-sources :where(li),
.mr-chat-area-container .mr-chatbot-sources :where(li) {
  margin: 0 !important;
  padding: 0 !important;
}
