/* Shared LLM-generated HTML: AI Chat assistant bubbles, AI Report preview/PDF, AI Analyzer output */

.ai-output table {
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
  margin: 12px 0;
  font-size: 0.9rem;
}

.ai-output th,
.ai-output td {
  border: 1px solid #dee2e6;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.ai-output th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
}

/* Report document title (AI Report phase-2 HTML) */
.ai-output h1 {
  margin: 0 0 0.75rem 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #212529;
  line-height: 1.25;
}

.ai-output h2 {
  margin: 1.25rem 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
}

.ai-output h2:first-child {
  margin-top: 0;
}

.ai-output h3 {
  margin: 16px 0 6px 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #333;
  text-align: left;
}

/* Chart title directly above an inlined chart image: centered, lighter than section h2 */
.ai-output h3:has(+ img) {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
}

/* Chart title (<h3>) sits above the inlined chart image; tighten gap vs default img margins */
.ai-output h3 + img {
  margin-top: 0.35rem !important;
}

.ai-output h3:first-child {
  margin-top: 0;
}

.ai-output p {
  margin: 0 0 10px 0;
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.5;
}

.ai-output ul {
  margin: 8px 0 0 0;
  padding-left: 1.25rem;
  color: #333;
}

.ai-output li {
  margin-bottom: 6px;
  line-height: 1.5;
}
