.markdown-modal {
  font-size: 14px;
  line-height: 1.6;

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-top: 1.25em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.25;
  }

  h1 {
    font-size: 2em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--bs-border-color);
  }

  h2 {
    font-size: 1.5em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--bs-border-color);
  }

  h3 {
    font-size: 1.25em;
  }

  h4 {
    font-size: 1em;
  }

  h5 {
    font-size: 0.875em;
  }

  h6 {
    font-size: 0.85em;
    color: var(--bs-secondary-color);
  }

  p {
    margin-top: 0;
    margin-bottom: 1em;
  }

  a {
    color: var(--bs-link-color);
    text-decoration: none;
  }

  a:hover {
    text-decoration: underline;
  }

  ul,
  ol {
    margin-top: 0;
    margin-bottom: 1em;
    padding-left: 2em;
  }

  ul ul,
  ul ol,
  ol ul,
  ol ol {
    margin-bottom: 0;
  }

  /* Task list checkboxes */
  li input[type='checkbox'] {
    margin-right: 0.4em;
    pointer-events: none;
  }

  li.task-list-item {
    list-style: none;
    margin-left: -1.5em;
  }

  blockquote {
    margin: 0 0 1em;
    padding: 0 1em;
    color: var(--bs-secondary-color);
    border-left: 4px solid var(--bs-border-color);
  }

  blockquote > :last-child {
    margin-bottom: 0;
  }

  code {
    padding: 0.2em 0.4em;
    font-size: 85%;
    background-color: var(--bs-tertiary-bg);
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  }

  pre {
    margin-top: 0;
    margin-bottom: 1em;
    padding: 1em;
    overflow: auto;
    background-color: var(--bs-tertiary-bg);
    border-radius: 6px;
  }

  pre code {
    padding: 0;
    background-color: transparent;
    font-size: 100%;
  }

  table {
    width: 100%;
    margin-bottom: 1em;
    border-collapse: collapse;
    border-spacing: 0;
    overflow: auto;
  }

  table th,
  table td {
    padding: 6px 13px;
    border: 1px solid var(--bs-border-color);
  }

  table th {
    font-weight: 600;
    background-color: var(--bs-tertiary-bg);
  }

  table tr:nth-child(even) {
    background-color: var(--bs-tertiary-bg);
  }

  hr {
    height: 1px;
    margin: 1.5em 0;
    border: none;
    background-color: var(--bs-border-color);
  }

  img {
    max-width: 100%;
  }

  del {
    text-decoration: line-through;
  }
}

.markdown-source {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 1em;
  background-color: var(--bs-tertiary-bg);
  border-radius: 6px;
  overflow: auto;
  max-height: 60vh;
}

@media (max-width: 576px) {
  .markdown-source {
    font-size: 12px;
    padding: 0.75em;
    max-height: 50vh;
  }
}
