/* Markdown Rendering Styles */
.prompt-markdown {
  margin-bottom: 1rem;
}

/* Markdown Static Sections (H1) */
.markdown-section-static {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.375rem;
  background-color: #fff;
}

.markdown-section-static h1 {
  font-size: 1.125rem;
  color: #212529;
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 0.5rem;
  margin-bottom: 0.0rem;
  font-weight: 600;
}

/* Markdown Foldable Sections (H2+) */
.markdown-section {
  margin-bottom: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.375rem;
  background-color: #fff;
}

/* Nested H3 sections - visually indented */
.markdown-section .markdown-level-3 {
  margin-left: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid #dee2e6;
  border-top: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
  background-color: rgba(0, 0, 0, 0.02);
}

.markdown-section summary {
  cursor: pointer;
  user-select: none;
  padding: 0.75rem 1rem;
  font-weight: 600;
  transition: background-color 0.2s ease;
  list-style: none;
}

.markdown-section summary::-webkit-details-marker {
  display: none;
}

.markdown-section summary::before {
  content: '▼';
  display: inline-block;
  margin-right: 0.75rem;
  font-size: 0.875rem;
  transition: transform 0.2s ease;
  color: #6c757d;
}

.markdown-section:not([open]) summary::before {
  transform: rotate(-90deg);
}

.markdown-section summary:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

/* Markdown Header Levels */
.markdown-header.markdown-h1 {
  font-size: 1.125rem;
  color: #212529;
  border-bottom: 2px solid #dee2e6;
}

.markdown-header.markdown-h2 {
  font-size: 1rem;
  color: #495057;
}

.markdown-header.markdown-h3 {
  font-size: 0.9375rem;
  color: #6c757d;
}

/* Markdown Content */
.markdown-content {
  padding: 1rem;
  font-size: 0.875rem;
}

.markdown-content p {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

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

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.markdown-content h1 { font-size: 1rem; }
.markdown-content h2 { font-size: 0.9375rem; }
.markdown-content h3 { font-size: 0.875rem; }
.markdown-content h4 { font-size: 0.875rem; }
.markdown-content h5 { font-size: 0.8125rem; }
.markdown-content h6 { font-size: 0.8125rem; }

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child,
.markdown-content h4:first-child,
.markdown-content h5:first-child,
.markdown-content h6:first-child {
  margin-top: 0;
}

.markdown-content ul,
.markdown-content ol {
  margin-bottom: 0.75rem;
  padding-left: 2rem;
}

.markdown-content li {
  margin-bottom: 0.25rem;
}

.markdown-content code {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.markdown-content pre {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 0.375rem;
  overflow-x: auto;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.markdown-content pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 0.8125rem;
}

.markdown-content blockquote {
  border-left: 4px solid #dee2e6;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #6c757d;
  font-style: italic;
}

.markdown-content table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.markdown-content table th,
.markdown-content table td {
  padding: 0.5rem;
  border: 1px solid #dee2e6;
}

.markdown-content table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.markdown-content a {
  color: #0d6efd;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

.markdown-content hr {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid #dee2e6;
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
  margin: 1rem 0;
}