/* Enterprise diagram styling for Mermaid output. Node/edge colors are set
   per-diagram via the %%{init: {"theme":"base","themeVariables":{...}}}%%
   directive; this file only handles geometry, weight, and depth. */

.mermaid {
  margin: 28px 0;
  text-align: center;
}

.mermaid svg {
  max-width: 100%;
  filter: drop-shadow(0 1px 3px rgba(11, 11, 11, 0.08));
}

/* Rounded, crisp node shapes */
.mermaid .node rect,
.mermaid .node polygon,
.mermaid .node circle,
.mermaid .node ellipse {
  rx: 6px;
  ry: 6px;
  stroke-width: 1.25px !important;
}

/* Cylinders (databases) keep their native shape, just tighten the stroke */
.mermaid .node path {
  stroke-width: 1.25px !important;
}

/* Subgraph / cluster boxes: sharper corners than nodes, hairline border,
   read as a container rather than another node. Mermaid's inline `style
   <subgraphId> fill:...` does not reliably override cluster fill in the
   bundled engine version, so cluster color is fixed here in CSS instead —
   one neutral container tone across every diagram, with color reserved
   for the accent/status nodes inside. */
.mermaid .cluster rect {
  rx: 4px;
  ry: 4px;
  fill: #f9f9f7 !important;
  stroke: #c9c8c0 !important;
  stroke-width: 1px !important;
}

.mermaid .cluster .cluster-label text,
.mermaid .cluster-label span {
  font-weight: 600;
  letter-spacing: 0.01em;
  fill: #52514e;
}

/* Edges: thin, muted, consistent weight regardless of diagram type */
.mermaid .edgePath .path,
.mermaid .flowchart-link,
.mermaid .messageLine0,
.mermaid .messageLine1 {
  stroke-width: 1.4px !important;
}

.mermaid .arrowheadPath {
  stroke-width: 0.5px;
}

/* Edge / message labels: legible chip over the line, no visual noise */
.mermaid .edgeLabel,
.mermaid .labelBkg {
  border-radius: 3px;
}

/* Sequence-diagram actors match the same rounded-node language */
.mermaid .actor {
  rx: 6px;
  ry: 6px;
  stroke-width: 1.25px !important;
}

.mermaid .actor-line {
  stroke-width: 1px !important;
}

/* Mermaid's default theme sets a text-colored stroke on several text
   classes (fill and stroke the same color) — on top of an already-bold
   default weight this reads as heavy, double-printed type. Both are
   fixed here: no stroke on any glyph, normal weight throughout, with a
   single semibold weight reserved for labels that are meant to stand
   out (loop/alt frame captions, cluster titles). */
.mermaid .messageText,
.mermaid .error-text,
.mermaid .noteText,
.mermaid .actor tspan {
  stroke: none !important;
  font-weight: 400 !important;
}

.mermaid .loopText,
.mermaid .loopText tspan,
.mermaid .labelText,
.mermaid .labelText tspan {
  stroke: none !important;
  font-weight: 600;
}

/* Typography: one sans stack everywhere, no Mermaid default serif fallback */
.mermaid text,
.mermaid .nodeLabel,
.mermaid .edgeLabel,
.mermaid .label,
.mermaid tspan {
  font-family:
    -apple-system,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif !important;
}

