.ai-response-markdown {
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: normal;
}

.ai-message div.ai-response-markdown,
.message-content > div.ai-response-markdown {
  min-width: 0;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.ai-response-markdown > :first-child { margin-top: 0; }
.ai-response-markdown > :last-child { margin-bottom: 0; }

.ai-response-markdown p {
  margin: 0 0 0.72em;
  color: inherit;
  font: inherit;
  line-height: inherit;
  white-space: normal;
}

.ai-response-markdown h3,
.ai-response-markdown h4,
.ai-response-markdown h5,
.ai-response-markdown h6 {
  margin: 1em 0 0.5em;
  color: #001850;
  font-size: 1em;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.45;
}

.ai-response-markdown ul,
.ai-response-markdown ol {
  margin: 0.15em 0 0.8em;
  padding-inline-start: 1.45em;
}

.ai-response-markdown li {
  margin: 0.3em 0;
  padding-inline-start: 0.12em;
}

.ai-response-markdown li::marker {
  color: #0068f8;
  font-weight: 800;
}

.ai-response-markdown strong {
  display: inline;
  margin: 0;
  color: #071b45;
  font: inherit;
  font-weight: 800;
  line-height: inherit;
}

.ai-response-markdown em { color: #4b5e83; }
.ai-response-markdown del { color: #4b5e83; }

.ai-response-markdown a {
  color: #003090;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: #0068f8;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.ai-response-markdown a:focus-visible {
  border-radius: 3px;
  outline: 2px solid #0068f8;
  outline-offset: 2px;
}

.ai-response-markdown code {
  padding: 0.1em 0.35em;
  border: 1px solid #d8e4f5;
  border-radius: 4px;
  background: #f7faff;
  color: #001850;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.ai-markdown-code-block {
  position: relative;
  margin: 0.25em 0 0.8em;
}

.ai-markdown-code-language {
  display: block;
  padding: 0.4em 0.75em;
  border: 1px solid #d8e4f5;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #eef5ff;
  color: #4b5e83;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8em;
  font-weight: 700;
}

.ai-response-markdown pre {
  max-width: 100%;
  margin: 0;
  padding: 0.75em;
  overflow-x: auto;
  border: 1px solid #d8e4f5;
  border-radius: 8px;
  background: #f7faff;
  white-space: pre;
}

.ai-markdown-code-language + pre { border-radius: 0 0 8px 8px; }

.ai-response-markdown pre code {
  padding: 0;
  border: 0;
  background: transparent;
  white-space: pre;
}

.ai-response-markdown blockquote {
  margin: 0.25em 0 0.8em;
  padding: 0.15em 0 0.15em 0.75em;
  border-left: 3px solid #0068f8;
  color: #4b5e83;
}

.ai-response-markdown blockquote > :last-child { margin-bottom: 0; }

.ai-response-markdown hr {
  height: 1px;
  margin: 0.9em 0;
  border: 0;
  background: #d8e4f5;
}

.ai-markdown-table-scroll {
  max-width: 100%;
  margin: 0.3em 0 0.85em;
  overflow-x: auto;
  border: 1px solid #d8e4f5;
  border-radius: 8px;
  background: #fff;
}

.ai-markdown-table-scroll:focus-visible {
  outline: 2px solid #0068f8;
  outline-offset: 2px;
}

.ai-response-markdown table {
  width: 100%;
  min-width: 360px;
  border-collapse: collapse;
  color: #071b45;
  font-size: 0.92em;
}

.ai-response-markdown th,
.ai-response-markdown td {
  padding: 0.6em 0.7em;
  border-bottom: 1px solid #d8e4f5;
  text-align: left;
  vertical-align: top;
}

.ai-response-markdown th {
  background: #f7faff;
  color: #001850;
  font-weight: 800;
}

.ai-response-markdown tr:last-child td { border-bottom: 0; }
.ai-response-markdown .align-center { text-align: center; }
.ai-response-markdown .align-right { text-align: right; }

.ai-response-markdown .ai-markdown-task {
  position: relative;
  list-style: none;
}

.ai-markdown-task-marker {
  display: inline-grid;
  width: 1.05em;
  height: 1.05em;
  margin: 0 0.42em 0 -1.42em;
  place-items: center;
  border: 1px solid #9eb5d7;
  border-radius: 3px;
  color: #fff;
  background: #fff;
  font-size: 0.82em;
  line-height: 1;
}

.ai-markdown-task.is-checked .ai-markdown-task-marker {
  border-color: #0068f8;
  background: #0068f8;
}

@media (max-width: 520px) {
  .ai-response-markdown ul,
  .ai-response-markdown ol {
    padding-inline-start: 1.25em;
  }

  .ai-response-markdown th,
  .ai-response-markdown td {
    padding: 0.52em 0.58em;
  }
}
