/* Evidence charts only. Conversation typography and shell remain inherited.
 * Card look: hairline border, soft elevation, no header divider so the
 * plot reads as part of the card; pill type badge and chevron disclosure. */
.fxm-ai-ui .fxm-ai-chart-card {
  --ai-chart-line: color-mix(in srgb, var(--color-on-surface) 8%, var(--color-surface));
  --ai-chart-accent: var(--color-primary, #4f34d9);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--ai-card-line, var(--ai-chart-line));
  border-radius: 18px;
  background: var(--color-surface);
  color: inherit;
  font-family: var(--font-body);
  box-shadow: var(--ai-card-shadow, 0 1px 2px rgb(24 20 51 / 4%), 0 14px 32px -22px rgb(24 20 51 / 22%));
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.fxm-ai-ui .fxm-ai-chart-card:hover {
  border-color: color-mix(in srgb, var(--ai-chart-accent) 16%, var(--color-surface));
  box-shadow: 0 1px 2px rgb(24 20 51 / 4%), 0 18px 36px -22px rgb(79 52 217 / 28%);
}
.fxm-ai-ui .fxm-ai-chart-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 2px;
  background: transparent;
}
.fxm-ai-ui .fxm-ai-chart-heading h4 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: 600 14px/1.45 var(--font-headline);
  letter-spacing: -0.005em;
  color: var(--color-on-surface);
  overflow-wrap: anywhere;
}
.fxm-ai-ui .fxm-ai-chart-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--ai-chart-accent);
  border-radius: 9px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ai-chart-accent) 14%, var(--color-surface)), color-mix(in srgb, #14b8a6 12%, var(--color-surface)));
}
.fxm-ai-ui .fxm-ai-chart-icon svg { width: 15px; height: 15px; }
.fxm-ai-ui .fxm-ai-chart-kind {
  flex: 0 0 auto;
  max-width: 35%;
  padding: 2px 9px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--ai-chart-accent) 88%, var(--color-on-surface));
  background: color-mix(in srgb, var(--ai-chart-accent) 7%, var(--color-surface));
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.fxm-ai-ui .fxm-ai-chart-canvas {
  min-width: 0;
  width: calc(100% - 20px);
  margin: 6px 10px 10px;
  font-family: var(--font-body);
}
.fxm-ai-ui .fxm-ai-chart-notes {
  padding: 0 18px 14px;
  color: var(--ai-data-muted);
  font-size: 12px;
  line-height: 1.6;
}
.fxm-ai-ui .fxm-ai-chart-notes p { margin: 0; font-size: inherit; line-height: inherit; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-chart-notes p + p { margin-top: 4px; }
.fxm-ai-ui .fxm-ai-chart-data {
  margin: 0;
  border-top: 1px solid var(--ai-chart-line);
}
.fxm-ai-ui .fxm-ai-chart-data summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  color: var(--ai-chart-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.fxm-ai-ui .fxm-ai-chart-data summary::-webkit-details-marker { display: none; }
.fxm-ai-ui .fxm-ai-chart-data summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 150ms ease, margin 150ms ease;
}
.fxm-ai-ui .fxm-ai-chart-data[open] summary::after { margin-top: 3px; transform: rotate(225deg); }
.fxm-ai-ui .fxm-ai-chart-data summary:hover { background: var(--ai-data-soft); }
.fxm-ai-ui .fxm-ai-chart-data summary:focus-visible,
.fxm-ai-ui .fxm-ai-chart-data-scroll:focus-visible,
.fxm-ai-ui .fxm-ai-chart-diagram:focus-visible {
  outline: 2px solid var(--ai-chart-accent);
  outline-offset: -2px;
}
.fxm-ai-ui .fxm-ai-chart-data-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.fxm-ai-ui .fxm-ai-chart-node-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  margin: 0;
  padding: 8px 14px 12px 28px;
  color: var(--ai-data-muted);
  font-size: 12px;
  line-height: 1.6;
}
.fxm-ai-ui .fxm-ai-chart-node-list li { max-width: 100%; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-chart-fallback { padding: 12px 14px; min-width: 0; }
.fxm-ai-ui .fxm-ai-chart-diagram {
  max-width: 100%;
  margin: 0;
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
}
.fxm-ai-ui .fxm-ai-chart-diagram svg {
  display: block;
  max-width: none;
  min-width: 560px;
  height: auto;
  margin: 0 auto;
  font-family: var(--font-body);
}
@media (max-width: 639px) {
  .fxm-ai-ui .fxm-ai-chart-card { border-radius: 14px; }
  .fxm-ai-ui .fxm-ai-chart-heading { gap: 8px; padding: 12px 12px 0; }
  .fxm-ai-ui .fxm-ai-chart-heading h4 { font-size: 13px; }
  .fxm-ai-ui .fxm-ai-chart-canvas { width: calc(100% - 12px); margin: 4px 6px 8px; }
  .fxm-ai-ui .fxm-ai-chart-kind { max-width: 32%; padding-inline: 7px; }
  .fxm-ai-ui .fxm-ai-chart-notes { padding: 0 12px 10px; }
  .fxm-ai-ui .fxm-ai-chart-data summary { padding-inline: 12px; }
  .fxm-ai-ui .fxm-ai-chart-fallback { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .fxm-ai-ui .fxm-ai-chart-card,
  .fxm-ai-ui .fxm-ai-chart-data summary,
  .fxm-ai-ui .fxm-ai-chart-data summary::after { transition: none; }
}

/* ---- Relationship mind map (CHART RELATIONSHIP / DIAGRAM RELATIONSHIP) ----
 * Positions come from the renderer. The drawing shows only when the card is
 * at least as wide as it (width buckets below); otherwise the same tree reads
 * as an outline. Restrained on purpose: white cards, neutral hairlines and
 * links; the record type shows only as a small colored dot. */
.fxm-ai-ui .fxm-ai-mm-tone--subject { --mm-c: #4f34d9; }
.fxm-ai-ui .fxm-ai-mm-tone--broker { --mm-c: #8b72e8; }
.fxm-ai-ui .fxm-ai-mm-tone--license { --mm-c: #12a37a; }
.fxm-ai-ui .fxm-ai-mm-tone--regulator { --mm-c: #3b82f6; }
.fxm-ai-ui .fxm-ai-mm-tone--key { --mm-c: #d99100; }
.fxm-ai-ui .fxm-ai-mm-tone--declared { --mm-c: #94a3b8; }
.fxm-ai-ui .fxm-ai-mm-tone--lowScore { --mm-c: #e11d48; }
.fxm-ai-ui .fxm-ai-mm-tone--other { --mm-c: #a39bc4; }

.fxm-ai-ui .fxm-ai-mindmap {
  --mm-line: #e6e3ee;
  --mm-link: #cdc8db;
  --mm-ink: #2b2f3e;
  container: fxm-mindmap / inline-size;
  position: relative;
  min-width: 0;
  padding: 6px 18px 16px;
}
.fxm-ai-ui .fxm-ai-mm-scroll { display: var(--mm-on, none); max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.fxm-ai-ui .fxm-ai-mm-canvas { position: relative; margin: 0 auto; }
.fxm-ai-ui .fxm-ai-mm-links { position: absolute; inset: 0; z-index: 1; overflow: visible; pointer-events: none; }
.fxm-ai-ui .fxm-ai-mm-link { fill: none; stroke: var(--mm-link); stroke-width: 1.4; stroke-linecap: round; }
.fxm-ai-ui .fxm-ai-mm-link--dashed { stroke-dasharray: 5 4; }
.fxm-ai-ui .fxm-ai-mm-link--dotted { stroke-dasharray: .1 4.5; stroke-width: 2; }
.fxm-ai-ui .fxm-ai-mm-dot { fill: var(--mm-link); stroke: none; }
.fxm-ai-ui .fxm-ai-mm-knob { fill: #fff; stroke: var(--mm-link); stroke-width: 1.4; }
.fxm-ai-ui :is(.fxm-ai-mm-link, .fxm-ai-mm-dot, .fxm-ai-mm-knob) { animation: fxm-mm-fade .4s ease both; animation-delay: calc(var(--mm-d, 0) * 70ms); }
.fxm-ai-ui .fxm-ai-mm-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--mm-line);
  border-radius: 10px;
  background: #fff;
  color: var(--mm-ink);
  font-family: var(--font-body);
  box-shadow: 0 1px 2px rgb(24 20 51 / 4%);
  animation: fxm-mm-fade .4s ease both;
  animation-delay: calc(var(--mm-d, 0) * 70ms);
  transition: border-color .15s ease;
}
.fxm-ai-ui .fxm-ai-mm-node:hover { border-color: #cfcadd; }
.fxm-ai-ui .fxm-ai-mm-node--dashed { border-style: dashed; border-color: #d3cfdd; }
.fxm-ai-ui .fxm-ai-mm-node--ref { box-shadow: none; }
.fxm-ai-ui .fxm-ai-mm-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.fxm-ai-ui .fxm-ai-mm-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 16px;
  overflow: hidden;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}
.fxm-ai-ui .fxm-ai-mm-kind {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: #6b6f7d;
  font-weight: 500;
}
.fxm-ai-ui .fxm-ai-mm-kind::before { content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--mm-c); }
.fxm-ai-ui .fxm-ai-mm-node--dashed .fxm-ai-mm-kind::before { border-radius: 1.5px; transform: rotate(45deg); }
.fxm-ai-ui .fxm-ai-mm-rel { min-width: 0; overflow: hidden; color: #9a9eab; text-overflow: ellipsis; }
.fxm-ai-ui .fxm-ai-mm-rel::before { content: "·"; margin-right: 6px; }
.fxm-ai-ui .fxm-ai-mm-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--mm-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fxm-ai-ui .fxm-ai-mm-label--wrap {
  display: -webkit-box;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.fxm-ai-ui .fxm-ai-mm-tile {
  position: relative;
  display: inline-flex;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid var(--mm-line);
  border-radius: 8px;
  background: #fff;
  color: #8a8f9c;
}
.fxm-ai-ui .fxm-ai-mm-tile > img {
  position: absolute;
  inset: 0;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 3px;
  background: #fff;
  object-fit: contain;
}
.fxm-ai-ui .fxm-ai-mm-tile > img[hidden] { display: none; }
.fxm-ai-ui .fxm-ai-mm-tile-icon { display: inline-flex; }
/* The subject stands out by weight and a brand-colored outline, not by fill. */
.fxm-ai-ui .fxm-ai-mm-node--root {
  gap: 12px;
  padding: 14px;
  border: 1px solid rgb(79 52 217 / 35%);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(24 20 51 / 4%), 0 0 0 3px rgb(79 52 217 / 5%);
}
.fxm-ai-ui .fxm-ai-mm-node--root:hover { border-color: rgb(79 52 217 / 50%); }
.fxm-ai-ui .fxm-ai-mm-node--root .fxm-ai-mm-label { color: #2f2658; font-size: 16px; font-weight: 700; line-height: 22px; letter-spacing: -.005em; }
.fxm-ai-ui .fxm-ai-mm-node--root .fxm-ai-mm-tile { flex-basis: 48px; width: 48px; height: 48px; border-radius: 10px; color: #4f34d9; }
.fxm-ai-ui .fxm-ai-mm-node--root .fxm-ai-mm-tile > img { padding: 5px; }
.fxm-ai-ui .fxm-ai-mm-more { margin: 10px 0 0; color: var(--ai-data-muted); font-size: 12px; line-height: 1.6; }

/* Outline: the accessible reading of the tree, and the visible one on narrow cards. */
.fxm-ai-ui .fxm-ai-mm-outline {
  position: var(--mm-pos, static);
  top: 0;
  left: 0;
  display: grid;
  gap: 16px;
  min-width: 0;
  font-family: var(--font-body);
  clip-path: var(--mm-clip, none);
}
.fxm-ai-ui :is(.fxm-ai-mm-o-root, .fxm-ai-mm-o-node) {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  min-width: 0;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--mm-line);
  border-radius: 10px;
  background: #fff;
  color: var(--mm-ink);
}
.fxm-ai-ui .fxm-ai-mm-o-root--main {
  width: fit-content;
  max-width: 100%;
  padding: 10px 16px 10px 10px;
  border-color: rgb(79 52 217 / 35%);
  box-shadow: 0 0 0 3px rgb(79 52 217 / 5%);
}
.fxm-ai-ui .fxm-ai-mm-o-root--main .fxm-ai-mm-label { color: #2f2658; font-size: 15px; font-weight: 700; }
.fxm-ai-ui :is(.fxm-ai-mm-o-root, .fxm-ai-mm-o-node) .fxm-ai-mm-label { white-space: normal; overflow-wrap: anywhere; }
.fxm-ai-ui :is(.fxm-ai-mm-o-root, .fxm-ai-mm-o-node) .fxm-ai-mm-tile { flex-basis: 32px; width: 32px; height: 32px; border-radius: 8px; }
.fxm-ai-ui .fxm-ai-mm-o-root--main .fxm-ai-mm-tile { flex-basis: 40px; width: 40px; height: 40px; color: #4f34d9; }
.fxm-ai-ui .fxm-ai-mm-o-node { width: fit-content; min-width: min(100%, 260px); max-width: 100%; }
.fxm-ai-ui .fxm-ai-mm-o-node.fxm-ai-mm-node--dashed { border-style: dashed; border-color: #d3cfdd; }
.fxm-ai-ui .fxm-ai-mm-o-list { margin: 0; padding: 0 0 0 20px; list-style: none; }
.fxm-ai-ui .fxm-ai-mm-o-item { --mm-mid: 34px; position: relative; margin: 0; padding: 8px 0 0 18px; list-style: none; }
.fxm-ai-ui .fxm-ai-mm-o-item::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; border-left: 1.4px solid var(--mm-line); }
.fxm-ai-ui .fxm-ai-mm-o-item:last-child::before { bottom: auto; height: var(--mm-mid); }
.fxm-ai-ui .fxm-ai-mm-o-item::after { content: ""; position: absolute; top: var(--mm-mid); left: 0; width: 16px; border-top: 1.4px solid var(--mm-link); }
.fxm-ai-ui .fxm-ai-mm-o--dashed::after { border-top-style: dashed; }
.fxm-ai-ui .fxm-ai-mm-o--dotted::after { border-top-style: dotted; border-top-width: 2px; }

/* The drawing replaces the outline once the card fits it (one bucket per
 * 40px); the outline then stays available to assistive technology only. */
@container fxm-mindmap (min-width: 320px) { .fxm-ai-ui .fxm-ai-mindmap--w320 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 360px) { .fxm-ai-ui .fxm-ai-mindmap--w360 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 400px) { .fxm-ai-ui .fxm-ai-mindmap--w400 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 440px) { .fxm-ai-ui .fxm-ai-mindmap--w440 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 480px) { .fxm-ai-ui .fxm-ai-mindmap--w480 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 520px) { .fxm-ai-ui .fxm-ai-mindmap--w520 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 560px) { .fxm-ai-ui .fxm-ai-mindmap--w560 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 600px) { .fxm-ai-ui .fxm-ai-mindmap--w600 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 640px) { .fxm-ai-ui .fxm-ai-mindmap--w640 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 680px) { .fxm-ai-ui .fxm-ai-mindmap--w680 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 720px) { .fxm-ai-ui .fxm-ai-mindmap--w720 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 760px) { .fxm-ai-ui .fxm-ai-mindmap--w760 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 800px) { .fxm-ai-ui .fxm-ai-mindmap--w800 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 840px) { .fxm-ai-ui .fxm-ai-mindmap--w840 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }
@container fxm-mindmap (min-width: 880px) { .fxm-ai-ui .fxm-ai-mindmap--w880 > * { --mm-on: block; --mm-pos: absolute; --mm-clip: inset(50%); } }

/* ---- DIAGRAM TIMELINE: a native vertical timeline ---- */
.fxm-ai-ui .fxm-ai-tl { padding: 8px 18px 16px; font-family: var(--font-body); }
.fxm-ai-ui .fxm-ai-tl-title { margin: 0 0 12px; color: var(--ai-data-muted); font-size: 12px; line-height: 1.6; }
/* One continuous rail: section pills sit on it, each period is a dot with
 * its events in one light card. */
.fxm-ai-ui .fxm-ai-tl-section { position: relative; padding-bottom: 4px; }
.fxm-ai-ui .fxm-ai-tl-section::before { content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 2px; background: #e9e4f8; }
.fxm-ai-ui .fxm-ai-tl-section:first-of-type::before { top: 12px; }
.fxm-ai-ui .fxm-ai-tl-section:last-child { padding-bottom: 0; }
.fxm-ai-ui .fxm-ai-tl-section-name {
  position: relative;
  display: inline-flex;
  margin: 0 0 10px -4px;
  padding: 1px 10px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #f1edff;
  color: #4f34d9;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.fxm-ai-ui .fxm-ai-tl-list { margin: 0; padding: 0; list-style: none; }
.fxm-ai-ui .fxm-ai-tl-item { position: relative; margin: 0; padding: 0 0 14px 26px; list-style: none; }
.fxm-ai-ui .fxm-ai-tl-section:last-child .fxm-ai-tl-item:last-child { padding-bottom: 0; }
/* The rail ends at the last period's dot. */
.fxm-ai-ui .fxm-ai-tl-section:last-child .fxm-ai-tl-item:last-child::after { content: ""; position: absolute; top: 16px; bottom: 0; left: 4px; width: 4px; background: var(--color-surface, #fff); }
.fxm-ai-ui .fxm-ai-tl-dot {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 0;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border: 2.5px solid #4f34d9;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgb(79 52 217 / 10%);
}
.fxm-ai-ui .fxm-ai-tl-period { margin: 0; color: #2f2658; font-size: 13px; font-weight: 700; line-height: 1.55; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-tl-events {
  display: grid;
  gap: 2px;
  margin: 6px 0 0;
  padding: 8px 12px;
  border: 1px solid #efecf7;
  border-radius: 10px;
  background: #fff;
  list-style: none;
}
.fxm-ai-ui .fxm-ai-tl-events li { position: relative; margin: 0; padding-left: 14px; color: #4b4f5c; font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-tl-events li::before { content: ""; position: absolute; top: calc(.875em - 2px); left: 2px; width: 4px; height: 4px; border-radius: 50%; background: #b9addf; }

@keyframes fxm-mm-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 639px) {
  .fxm-ai-ui .fxm-ai-mindmap { padding: 10px 12px 12px; }
  .fxm-ai-ui .fxm-ai-tl { padding: 6px 12px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .fxm-ai-ui :is(.fxm-ai-mm-node, .fxm-ai-mm-link, .fxm-ai-mm-dot, .fxm-ai-mm-knob) { animation: none; transition: none; }
}
