.markdown {
  overflow-wrap: break-word;
}

.markdown p:last-child {
  margin-bottom: 0;
}

.preWrapper {
  margin: 0.5em 0;
}

.codeBlock {
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 100%;
  overflow-x: auto;
}

.fadeIn {
  animation: text-fade-in 0.3s ease-out forwards;
}

@keyframes text-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Task lists (GFM) */
.taskList {
  list-style: none;
  padding-left: 0;
  margin: 0.5em 0;
}

.taskListItem {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  margin-bottom: 0.25em;
}

/* Images */
.imageWrapper {
  display: block;
  margin: 0.5em 0;
}

/* KaTeX overrides for better integration */
.markdown :global(.katex) {
  font-size: 1em;
}

.markdown :global(.katex-display) {
  margin: 0.5em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Tables with rounded corners */
.table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--mantine-radius-md);
  overflow: hidden;
}
