/* SI RSIC — readable "prose" styling for rendered analysis Markdown (marked + mermaid output).
   Scoped under .rsic-prose so it never leaks into the app chrome. Uses the design tokens (CSS vars) the
   BlazorCN/MUD theme already defines, so it follows light/dark + the accent automatically. */
.rsic-prose {
  font-size: 0.95rem;
  line-height: 1.7;
  color: hsl(var(--foreground));
  overflow-wrap: anywhere;
}
.rsic-prose > :first-child { margin-top: 0; }
.rsic-prose h1,
.rsic-prose h2,
.rsic-prose h3,
.rsic-prose h4 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1.6em 0 0.6em;
}
.rsic-prose h1 { font-size: 1.6rem; }
.rsic-prose h2 {
  font-size: 1.3rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid hsl(var(--border));
}
.rsic-prose h3 { font-size: 1.1rem; }
.rsic-prose h4 { font-size: 1rem; }
.rsic-prose p { margin: 0.8em 0; }
.rsic-prose ul,
.rsic-prose ol { margin: 0.8em 0; padding-left: 1.5em; }
.rsic-prose li { margin: 0.3em 0; }
.rsic-prose ul { list-style: disc; }
.rsic-prose ol { list-style: decimal; }
.rsic-prose a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rsic-prose strong { font-weight: 600; }
.rsic-prose blockquote {
  margin: 1em 0;
  padding: 0.2em 1em;
  border-left: 3px solid hsl(var(--primary));
  background: hsl(var(--muted) / 0.4);
  color: hsl(var(--muted-foreground));
  border-radius: 0 0.375rem 0.375rem 0;
}
.rsic-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: hsl(var(--muted) / 0.7);
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
}
.rsic-prose pre {
  margin: 1em 0;
  padding: 0.9em 1em;
  background: hsl(var(--muted) / 0.6);
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  overflow-x: auto;
}
.rsic-prose pre code { background: none; padding: 0; font-size: 0.82em; }
.rsic-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.88em;
  display: block;
  overflow-x: auto;
}
.rsic-prose th,
.rsic-prose td {
  border: 1px solid hsl(var(--border));
  padding: 0.5em 0.7em;
  text-align: left;
  vertical-align: top;
}
.rsic-prose th { background: hsl(var(--muted) / 0.6); font-weight: 600; }
.rsic-prose tr:nth-child(even) td { background: hsl(var(--muted) / 0.25); }
.rsic-prose hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: 1.6em 0; }
.rsic-prose img { max-width: 100%; height: auto; border-radius: 0.375rem; }

/* Rendered mermaid diagrams — centred on a soft card so they read as figures. */
.rsic-prose .rsic-diagram {
  margin: 1.2em 0;
  padding: 1em;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  overflow-x: auto;
  text-align: center;
}
.rsic-prose .rsic-diagram svg { max-width: 100%; height: auto; }
.rsic-prose .rsic-diagram-error {
  margin: 1.2em 0;
  padding: 0.75em 1em;
  font-size: 0.85em;
  color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.08);
  border: 1px solid hsl(var(--destructive) / 0.3);
  border-radius: 0.5rem;
}
