/* Evidence blocks share the site's type and colors without changing the chat shell. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) {
  --ai-data-line: color-mix(in srgb, var(--color-on-surface) 13%, var(--color-surface));
  --ai-data-soft: color-mix(in srgb, var(--color-primary) 4%, var(--color-surface));
  --ai-data-muted: color-mix(in srgb, var(--color-on-surface) 72%, var(--color-surface));
}
.fxm-ai-ui .fxm-ai-data-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ai-data-line);
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-on-surface);
  font-family: var(--font-body);
  box-shadow: 0 2px 6px rgb(39 46 66 / 3%);
}
.fxm-ai-ui .fxm-ai-data-head { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 15px 18px; border-bottom: 1px solid var(--ai-data-line); }
.fxm-ai-ui .fxm-ai-data-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: var(--ai-data-soft); color: var(--color-primary); }
.fxm-ai-ui .fxm-ai-data-title { flex: 1; min-width: 0; margin: 0; color: var(--color-on-surface); font-family: var(--font-headline); font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-data-meta { flex-shrink: 0; padding: 3px 8px; border-radius: 6px; background: var(--ai-data-soft); color: var(--ai-data-muted); font-size: 11px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.fxm-ai-ui .fxm-ai-data-notes { padding: 12px 18px; border-top: 1px solid var(--ai-data-line); background: color-mix(in srgb, var(--color-primary) 2%, var(--color-surface)); }
.fxm-ai-ui .fxm-ai-data-notes p { margin: 0; color: var(--ai-data-muted); font: 12px/1.65 var(--font-body); overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-data-notes p + p { margin-top: 5px; }

/* Sources are supporting material: one quiet fold line (icon, label, count),
 * closed by default; opened, a light compact list. Only safe URLs look clickable. */
.fxm-ai-ui .fxm-ai-sources { margin: 0; font-family: var(--font-body); }
.fxm-ai-ui .fxm-ai-sources-fold > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--color-on-surface) 52%, var(--color-surface));
  font: 12px/1 var(--font-body);
  cursor: pointer;
  list-style: none;
  transition: background-color .15s ease, color .15s ease;
}
.fxm-ai-ui .fxm-ai-sources-fold > summary::-webkit-details-marker { display: none; }
.fxm-ai-ui .fxm-ai-sources-fold > summary::marker { content: ''; }
.fxm-ai-ui .fxm-ai-sources-fold > summary:hover,
.fxm-ai-ui .fxm-ai-sources-fold[open] > summary { background: var(--ai-data-soft); color: var(--color-on-surface); }
.fxm-ai-ui .fxm-ai-sources-icon, .fxm-ai-ui .fxm-ai-sources-chevron { display: inline-flex; flex: none; }
.fxm-ai-ui .fxm-ai-sources-icon svg { width: 13px; height: 13px; }
.fxm-ai-ui .fxm-ai-sources-count { min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: color-mix(in srgb, var(--color-on-surface) 6%, var(--color-surface)); font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.fxm-ai-ui .fxm-ai-sources-chevron svg { width: 12px; height: 12px; transform: rotate(90deg); transition: transform .15s ease; }
.fxm-ai-ui .fxm-ai-sources-fold[open] .fxm-ai-sources-chevron svg { transform: rotate(-90deg); }
.fxm-ai-ui .fxm-ai-source-list { list-style: none; margin: 6px 0 0; padding: 2px 12px; border-radius: 12px; background: color-mix(in srgb, var(--color-on-surface) 2.5%, var(--color-surface)); }
.fxm-ai-ui .fxm-ai-source-row { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 7px 0; }
.fxm-ai-ui .fxm-ai-source-row + .fxm-ai-source-row { border-top: 1px solid color-mix(in srgb, var(--color-on-surface) 6%, var(--color-surface)); }
.fxm-ai-ui .fxm-ai-source-number { flex: 0 0 auto; min-width: 22px; color: color-mix(in srgb, var(--color-primary) 72%, var(--color-surface)); font: 600 10px/1.6 var(--font-body); font-variant-numeric: tabular-nums; }
.fxm-ai-ui .fxm-ai-source-content { display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; gap: 0 10px; min-width: 0; }
.fxm-ai-ui .fxm-ai-source-title { display: block; min-width: 0; color: color-mix(in srgb, var(--color-on-surface) 82%, var(--color-surface)); font: 500 12px/1.6 var(--font-body); text-decoration: none; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-source-title svg { display: inline-block; margin-left: 4px; vertical-align: -1px; color: var(--color-primary); }
.fxm-ai-ui a.fxm-ai-source-title { cursor: pointer; transition: color .15s ease; }
.fxm-ai-ui a.fxm-ai-source-title:hover { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.fxm-ai-ui .fxm-ai-source-meta { display: inline-flex; flex-wrap: wrap; gap: 0 8px; color: color-mix(in srgb, var(--color-on-surface) 45%, var(--color-surface)); font: 11px/1.6 var(--font-body); overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-source-excerpt { display: -webkit-box; flex-basis: 100%; margin: 2px 0 0; overflow: hidden; color: color-mix(in srgb, var(--color-on-surface) 50%, var(--color-surface)); font: 11px/1.6 var(--font-body); overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.fxm-ai-ui .fxm-ai-source-row--unavailable :is(.fxm-ai-source-title, .fxm-ai-source-number) { color: var(--ai-data-muted); }

/* Tables keep natural reading width. The local scroll region owns overflow. */
.fxm-ai-ui .fxm-ai-table-scroll { max-width: 100%; max-height: 440px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-surface)) transparent; }
.fxm-ai-ui .fxm-ai-data-table { width: 100%; min-width: max(100%, calc(var(--ai-table-columns, 3) * 8.5rem)); border-collapse: separate; border-spacing: 0; color: var(--color-on-surface); font: 13px/1.6 var(--font-body); }
.fxm-ai-ui .fxm-ai-data-table :is(th, td) { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--ai-data-line); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-data-table th { position: sticky; top: 0; z-index: 2; background: var(--ai-data-soft); color: var(--ai-data-muted); font-weight: 600; white-space: nowrap; }
.fxm-ai-ui .fxm-ai-data-table th[data-fxm-ai-sort] { padding: 0; }
.fxm-ai-ui .fxm-ai-data-table td { background: var(--color-surface); }
.fxm-ai-ui .fxm-ai-data-table :is(th, td):first-child { position: sticky; left: 0; min-width: 8.5rem; max-width: 15rem; box-shadow: 1px 0 var(--ai-data-line); }
.fxm-ai-ui .fxm-ai-data-table th:first-child { z-index: 3; }
.fxm-ai-ui .fxm-ai-data-table td:first-child { z-index: 1; font-weight: 500; }
.fxm-ai-ui .fxm-ai-data-table tr:nth-child(even) td { background: color-mix(in srgb, var(--color-primary) 1.5%, var(--color-surface)); }
.fxm-ai-ui .fxm-ai-data-table tr:hover td { background: var(--ai-data-soft); }
.fxm-ai-ui .fxm-ai-data-table tbody tr:last-child td { border-bottom: 0; }
.fxm-ai-ui .fxm-ai-data-table .fxm-ai-cell-number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fxm-ai-ui .fxm-ai-data-table .fxm-ai-cell-missing { color: var(--ai-data-muted); }
.fxm-ai-ui .fxm-ai-table-sort { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 12px 16px; border: 0; background: transparent; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
.fxm-ai-ui .fxm-ai-cell-number .fxm-ai-table-sort { justify-content: flex-end; }
.fxm-ai-ui .fxm-ai-table-sort [data-sort-ind] { color: var(--ai-data-muted); font-size: 12px; }
.fxm-ai-ui .fxm-ai-data-table th:is([aria-sort="ascending"], [aria-sort="descending"]) .fxm-ai-table-sort,
.fxm-ai-ui .fxm-ai-table-sort:hover { background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)); color: var(--color-primary); }
.fxm-ai-ui .fxm-ai-table-sort:focus-visible { outline-offset: -3px; }
.fxm-ai-ui .fxm-ai-table-help { padding: 8px 16px; border-top: 1px solid var(--ai-data-line); color: var(--ai-data-muted); font: 11px/1.6 var(--font-body); }
.fxm-ai-ui .fxm-ai-table-empty { margin: 0; padding: 24px 18px; color: var(--ai-data-muted); font: 13px/1.6 var(--font-body); }
.fxm-ai-ui .fxm-ai-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Markdown tables retain their semantics and receive the same contrast and density. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown-table-wrap { margin-block: 12px; border: 1px solid var(--ai-data-line); border-radius: 12px; background: var(--color-surface); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown table { font: 13px/1.6 var(--font-body); color: var(--color-on-surface); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown :is(th, td) { padding: 11px 14px; border-color: var(--ai-data-line); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown th { background: var(--ai-data-soft); color: var(--color-on-surface); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown tbody tr:nth-child(even) { background: color-mix(in srgb, var(--color-primary) 1.5%, var(--color-surface)); }

/* The server's collapsed tier stays collapsed; its contents are now discoverable. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-evidence-details { margin: 0; border: 1px solid var(--ai-data-line); border-radius: 14px; background: var(--color-surface); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-evidence-details > summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: var(--color-on-surface); cursor: pointer; list-style: none; }
.fxm-ai-ui .fxm-ai-evidence-details > summary::-webkit-details-marker { display: none; }
.fxm-ai-ui .fxm-ai-evidence-details > summary::marker { content: ''; }
.fxm-ai-ui .fxm-ai-evidence-details > summary::before { display: none; }
.fxm-ai-ui .fxm-ai-details-label { flex: 1; min-width: 0; font: 600 13px/1.6 var(--font-body); }
.fxm-ai-ui .fxm-ai-details-preview { display: block; margin-top: 3px; color: var(--ai-data-muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-details-chevron { flex: 0 0 16px; color: var(--color-primary); }
.fxm-ai-ui .fxm-ai-evidence-details[open] > summary { border-bottom: 1px solid var(--ai-data-line); }
.fxm-ai-ui .fxm-ai-evidence-details[open] > summary .fxm-ai-details-chevron { transform: rotate(90deg); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-evidence-details > .fxm-ai-details-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; }
.fxm-ai-ui .fxm-ai-evidence-details > .fxm-ai-details-body > * { min-width: 0; }
.fxm-ai-ui :is(.fxm-ai-evidence-details > summary, .fxm-ai-table-scroll):focus-visible { outline: 2px solid var(--color-primary); outline-offset: -3px; border-radius: 6px; }
.fxm-ai-ui .fxm-ai-sources-fold > summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

@media (max-width: 639px) {
  .fxm-ai-ui .fxm-ai-data-head { gap: 8px; padding: 12px; }
  .fxm-ai-ui .fxm-ai-data-title { font-size: 13px; }
  .fxm-ai-ui .fxm-ai-data-meta { padding-inline: 6px; font-size: 10px; }
  .fxm-ai-ui .fxm-ai-source-list { padding-inline: 10px; }
  .fxm-ai-ui .fxm-ai-data-notes { padding: 10px 12px; }
  .fxm-ai-ui .fxm-ai-data-table { font-size: 12px; }
  .fxm-ai-ui .fxm-ai-data-table :is(th, td), .fxm-ai-ui .fxm-ai-table-sort { padding: 11px 12px; }
  .fxm-ai-ui .fxm-ai-data-table th[data-fxm-ai-sort] { padding: 0; }
  .fxm-ai-ui .fxm-ai-table-help { padding-inline: 12px; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-evidence-details > summary { padding: 12px; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-evidence-details > .fxm-ai-details-body { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .fxm-ai-ui a.fxm-ai-source-title, .fxm-ai-ui .fxm-ai-sources-fold > summary, .fxm-ai-ui .fxm-ai-sources-chevron svg { transition: none; }
}

/* ---- v10 answer layout: skeletons, INSIGHTS, KPI context / WARNING tone ---- */
.fxm-ai-ui .fxm-ai-skeleton-compact { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px dashed var(--ai-data-line); border-radius: 12px; background: var(--ai-data-soft); color: var(--ai-data-muted); font: 12px/1.6 var(--font-body); }
.fxm-ai-ui .fxm-ai-skeleton-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.fxm-ai-ui .fxm-ai-skeleton-bars > span { width: 4px; border-radius: 2px; background: color-mix(in srgb, var(--color-primary) 45%, transparent); animation: fxm-ai-skeleton-bar 1.1s ease-in-out infinite; }
.fxm-ai-ui .fxm-ai-skeleton-bars > span:nth-child(1) { height: 6px; }
.fxm-ai-ui .fxm-ai-skeleton-bars > span:nth-child(2) { height: 12px; animation-delay: .15s; }
.fxm-ai-ui .fxm-ai-skeleton-bars > span:nth-child(3) { height: 9px; animation-delay: .3s; }
@keyframes fxm-ai-skeleton-bar { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.fxm-ai-ui .fxm-ai-skeleton-summary { display: flex; flex-direction: column; gap: 10px; }
.fxm-ai-ui .fxm-ai-skeleton-block { height: 64px; border-radius: 12px; background: linear-gradient(90deg, var(--ai-data-soft) 25%, color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)) 50%, var(--ai-data-soft) 75%); background-size: 200% 100%; animation: fxm-ai-skeleton-shimmer 1.4s linear infinite; }
.fxm-ai-ui .fxm-ai-skeleton-block--header { height: 72px; }
.fxm-ai-ui .fxm-ai-skeleton-block--kpi { height: 96px; }
.fxm-ai-ui .fxm-ai-skeleton-block--insights { height: 112px; }
@keyframes fxm-ai-skeleton-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.fxm-ai-ui .fxm-ai-tone-text--positive { color: #166534; }
.fxm-ai-ui .fxm-ai-tone-text--negative { color: #9f1239; }
.fxm-ai-ui .fxm-ai-tone-text--warning { color: #b45309; }
.fxm-ai-ui .fxm-ai-tone-text--neutral { color: var(--ai-data-muted); }
.fxm-ai-ui .fxm-ai-tone-text--unknown { color: color-mix(in srgb, var(--color-on-surface) 50%, var(--color-surface)); }
.fxm-ai-ui .fxm-ai-kpi-card--warning { border-color: rgb(245 158 11 / 30%); background: rgb(255 251 235 / 60%); }
.fxm-ai-ui .fxm-ai-kpi-context { margin: 2px 0 0; font-size: 11px; font-weight: 600; line-height: 1.5; }

.fxm-ai-ui .fxm-ai-insights { padding: 14px 16px; border: 1px solid var(--ai-data-line); border-radius: 12px; background: var(--color-surface); font-family: var(--font-body); }
.fxm-ai-ui .fxm-ai-insights-title { margin: 0 0 10px; color: var(--color-on-surface); font-size: 13px; font-weight: 600; line-height: 1.5; }
.fxm-ai-ui .fxm-ai-insights--checklist > summary { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; list-style: none; }
.fxm-ai-ui .fxm-ai-insights--checklist > summary > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-insights--checklist > summary::-webkit-details-marker { display: none; }
.fxm-ai-ui .fxm-ai-insights--checklist > summary::marker { content: ''; }
.fxm-ai-ui .fxm-ai-insights--checklist > summary::before { display: none; }
.fxm-ai-ui .fxm-ai-insights--checklist[open] > summary { margin-bottom: 10px; }
.fxm-ai-ui .fxm-ai-insights--checklist > summary .fxm-ai-details-chevron { transition: transform .15s ease; }
.fxm-ai-ui .fxm-ai-insights--checklist[open] > summary .fxm-ai-details-chevron { transform: rotate(90deg); }
.fxm-ai-ui .fxm-ai-insights--checklist > summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  .fxm-ai-ui .fxm-ai-insights--checklist > summary .fxm-ai-details-chevron { transition: none; }
}
.fxm-ai-ui .fxm-ai-check-list { list-style: none; margin: 0; padding: 0; }
.fxm-ai-ui .fxm-ai-check + .fxm-ai-check { border-top: 1px solid var(--ai-data-line); }
.fxm-ai-ui .fxm-ai-check > details > summary, .fxm-ai-ui .fxm-ai-check-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; font-size: 13px; line-height: 1.5; list-style: none; }
.fxm-ai-ui .fxm-ai-check > details > summary { cursor: pointer; }
.fxm-ai-ui .fxm-ai-check > details > summary::-webkit-details-marker { display: none; }
.fxm-ai-ui .fxm-ai-check-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1; }
.fxm-ai-ui .fxm-ai-check-label { flex: 1; min-width: 0; color: var(--color-on-surface); overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-check-value { flex-shrink: 0; max-width: 45%; color: var(--ai-data-muted); font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-check-text { margin: 0 0 10px 29px; color: var(--ai-data-muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-check--pass .fxm-ai-check-icon { background: #ecfdf5; color: #059669; }
.fxm-ai-ui .fxm-ai-check--attention .fxm-ai-check-icon { background: #fffbeb; color: #d97706; }
.fxm-ai-ui .fxm-ai-check--alert .fxm-ai-check-icon { background: #fff1f2; color: #e11d48; }
.fxm-ai-ui .fxm-ai-check--unknown .fxm-ai-check-icon { border: 1px dashed #9aa1b5; color: #7b8194; }
.fxm-ai-ui .fxm-ai-check--unchecked { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 9px 0; color: color-mix(in srgb, var(--color-on-surface) 50%, var(--color-surface)); font-size: 12px; line-height: 1.5; }

.fxm-ai-ui .fxm-ai-finding-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.fxm-ai-ui .fxm-ai-finding { min-width: 0; padding: 12px 14px; border: 1px solid var(--ai-data-line); border-left-width: 3px; border-radius: 10px; background: var(--color-surface); }
.fxm-ai-ui .fxm-ai-finding--positive { border-left-color: #10b981; }
.fxm-ai-ui .fxm-ai-finding--warning { border-left-color: #f59e0b; }
.fxm-ai-ui .fxm-ai-finding--negative { border-left-color: #f43f5e; }
.fxm-ai-ui .fxm-ai-finding--neutral { border-left-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-surface)); }
.fxm-ai-ui .fxm-ai-finding--unknown { border-style: dashed; border-left-color: #9aa1b5; }
.fxm-ai-ui .fxm-ai-finding p { margin: 0; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-finding-label { color: var(--ai-data-muted); font-size: 11px; line-height: 1.5; }
.fxm-ai-ui .fxm-ai-finding-value { margin-top: 2px !important; color: var(--color-on-surface); font-size: 15px; font-weight: 700; line-height: 1.4; }
.fxm-ai-ui .fxm-ai-finding-text { margin-top: 6px !important; color: var(--color-on-surface); font-size: 12px; line-height: 1.65; }
.fxm-ai-ui .fxm-ai-finding-implication { margin-top: 4px !important; color: var(--ai-data-muted); font-size: 12px; line-height: 1.6; }
.fxm-ai-ui .fxm-ai-finding-action { margin-top: 6px !important; color: var(--color-on-surface); font-size: 12px; line-height: 1.6; }
.fxm-ai-ui .fxm-ai-finding-action > span { margin-right: 6px; padding: 1px 6px; border-radius: 4px; background: var(--ai-data-soft); color: var(--color-primary); font-size: 11px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .fxm-ai-ui .fxm-ai-skeleton-bars > span, .fxm-ai-ui .fxm-ai-skeleton-block { animation: none; }
}

/* ---- Answer summary in the broker-detail look: hero, KPI cards, checks ----
 * Same surfaces as the broker detail hero: soft gradient panels with a
 * purple-tinted lift, white tiles floating on them, no hard rules. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) {
  --ai-ink: #2f2658;
  --ai-card-line: rgb(47 38 88 / 7%);
  --ai-card-shadow: 0 10px 28px -16px rgb(79 52 217 / 20%), 0 3px 10px -8px rgb(47 38 88 / 10%);
  --ai-tile-line: rgb(79 52 217 / 9%);
  --ai-tile-shadow: 0 8px 20px -16px rgb(47 38 88 / 45%);
}
.fxm-ai-ui .fxm-ai-hero {
  position: relative;
  isolation: isolate;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--ai-card-line);
  border-radius: 20px;
  background: linear-gradient(120deg, #fff 0%, #fbfbfd 45%, #f4f5fa 100%);
  box-shadow: var(--ai-card-shadow);
}
/* The detail page's dotted world map fades in from the right behind the
 * title row; a short accent tab replaces the old full-width bar. */
.fxm-ai-ui .fxm-ai-hero::before {
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  width: min(640px, 80%);
  height: 170px;
  content: "";
  pointer-events: none;
  background: var(--fxm-img-world-map-dots-v2, url("../images/world-map-dots.svg?v=2")) no-repeat right -24px top -40px / 560px auto;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgb(0 0 0 / 18%) 30%, #000 78%), linear-gradient(180deg, #000 40%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, rgb(0 0 0 / 18%) 30%, #000 78%), linear-gradient(180deg, #000 40%, transparent 100%);
  mask-composite: intersect;
}
.fxm-ai-ui .fxm-ai-hero::after { position: absolute; top: 0; left: 24px; width: 72px; height: 3px; border-radius: 0 0 999px 999px; background: linear-gradient(90deg, #4f34d9, #6b55f8 55%, #89dfd7); content: ""; }
.fxm-ai-ui .fxm-ai-hero-logo {
  position: relative;
  display: inline-flex;
  flex: 0 0 104px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 104px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--ai-tile-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--ai-tile-shadow);
}
.fxm-ai-ui .fxm-ai-hero-logo > img { position: absolute; inset: 0; display: block; box-sizing: border-box; width: 100%; height: 100%; padding: 8px 10px; object-fit: contain; background: #fff; }
.fxm-ai-ui .fxm-ai-hero-logo > img[hidden] { display: none; }
.fxm-ai-ui .fxm-ai-hero-logo:not(.fxm-ai-hero-logo--image) { flex-basis: 60px; width: 60px; height: 60px; border: 0; background: linear-gradient(135deg, #6c50f2, #4f34d9 60%, #3c23ba); box-shadow: 0 10px 22px -12px rgb(79 52 217 / 70%); }
.fxm-ai-ui .fxm-ai-hero-initial { color: #4f34d9; font: 700 24px/1 var(--font-headline); }
.fxm-ai-ui .fxm-ai-hero-logo:not(.fxm-ai-hero-logo--image) .fxm-ai-hero-initial { color: #fff; }
.fxm-ai-ui .fxm-ai-hero-text { flex: 1; }
.fxm-ai-ui .fxm-ai-hero-kind { display: block; color: #8a8f9c; font-size: 12px; line-height: 1.5; }
.fxm-ai-ui .fxm-ai-hero .fxm-ai-hero-name { margin: 2px 0 0; color: var(--ai-ink, #2f2658); font: 700 22px/1.3 var(--font-headline); letter-spacing: -.01em; }
/* Long regulator names wrap to a second line instead of losing their acronym. */
.fxm-ai-ui .fxm-ai-hero .fxm-ai-hero-name.truncate { display: -webkit-box; overflow: hidden; white-space: normal; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.fxm-ai-ui .fxm-ai-hero .fxm-ai-hero-subtitle { margin-top: 4px; color: #6b6f7d; font-size: 13px; line-height: 1.6; }
.fxm-ai-ui .fxm-ai-hero .fxm-ai-hero-badge { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 5px 12px; font-size: 12px; line-height: 1.5; }
.fxm-ai-ui .fxm-ai-hero-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* Status pill taken from the entity's first badge (no HEADER). */
.fxm-ai-ui .fxm-ai-hero-badge--tone-positive { border-color: rgb(16 185 129 / 25%); background: #f0fdf4; color: #166534; }
.fxm-ai-ui .fxm-ai-hero-badge--tone-caution { border-color: rgb(245 158 11 / 25%); background: #fffbeb; color: #92400e; }
.fxm-ai-ui .fxm-ai-hero-badge--tone-neutral { border-color: rgb(79 52 217 / 16%); background: #f5f3ff; color: #4f34d9; }
/* Subject card (design spec §5.4): HEADER title row, first KPI group, then the
 * subject entity's facts and links, one card. The title row is the detail link. */
.fxm-ai-ui .fxm-ai-subject-card { display: block; container-type: inline-size; }
.fxm-ai-ui .fxm-ai-hero-head { display: flex; align-items: center; gap: 16px; min-width: 0; border-radius: 12px; color: inherit; text-decoration: none; }
.fxm-ai-ui a.fxm-ai-hero-head:hover { color: inherit; text-decoration: none; }
.fxm-ai-ui a.fxm-ai-hero-head:hover .fxm-ai-hero-name { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.fxm-ai-ui a.fxm-ai-hero-head:hover .fxm-ai-entity-arrow { background: var(--color-primary); color: var(--color-on-primary, #fff); }
.fxm-ai-ui a.fxm-ai-hero-head:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.fxm-ai-ui .fxm-ai-hero-kind .fxm-ai-ad-badge { margin-left: 6px; vertical-align: 1px; }
.fxm-ai-ui .fxm-ai-subject-row { margin-top: 12px; }
.fxm-ai-ui .fxm-ai-hero-head + .fxm-ai-subject-row { margin-top: 18px; }
.fxm-ai-ui .fxm-ai-subject-kpi .fxm-ai-kpi { padding: 0; border: 0; border-radius: 0; background: transparent; }
.fxm-ai-ui .fxm-ai-subject-kpi .fxm-ai-kpi-title { display: none; }
/* Entity-introduced card only: its summary, its score (when no KPI group
 * carries one) and any badge after the status pill. */
.fxm-ai-ui .fxm-ai-subject-summary .fxm-ai-entity-summary { color: #6b6f7d; font-size: 13px; line-height: 1.7; }
.fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-metric { gap: 14px; padding: 12px 16px; border: 1px solid var(--ai-tile-line); border-radius: 14px; background: #fff; box-shadow: var(--ai-tile-shadow); }
.fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-metric-label { color: #8a8f9c; }
.fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-metric-value { font: 700 22px/1.2 var(--font-headline); }
.fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-meter { max-width: 320px; height: 6px; }
.fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-meter > span { background: linear-gradient(90deg, #4f34d9, #6b55f8 60%, #89dfd7); }
/* Key data: one white strip split by hairlines, quieter than the KPI tiles;
 * one column per fact so one or two facts still fill the row. */
.fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-facts { grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 0; padding: 4px 0; border: 1px solid var(--ai-tile-line); border-radius: 14px; background: rgb(255 255 255 / 88%); box-shadow: var(--ai-tile-shadow); }
.fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-fact { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; padding: 8px 16px; border-radius: 0; background: transparent; }
.fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-fact + .fxm-ai-entity-fact { border-left: 1px solid var(--ai-tile-line); }
.fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-fact dt { color: #8a8f9c; }
.fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-fact dd { color: var(--ai-ink); font: 600 14px/1.5 var(--font-body); text-align: left; }
@container (max-width: 519px) {
  .fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-facts { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; padding: 0 14px; }
  .fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-fact { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; }
  .fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-fact + .fxm-ai-entity-fact { border-top: 1px solid var(--ai-tile-line); border-left: 0; }
  .fxm-ai-ui .fxm-ai-subject-card .fxm-ai-entity-fact dd { font-size: 13px; text-align: right; }
}
@container (max-width: 560px) {
  .fxm-ai-ui .fxm-ai-hero-head { flex-wrap: wrap; gap: 12px; }
  .fxm-ai-ui .fxm-ai-hero-head .fxm-ai-hero-logo { flex-basis: 80px; width: 80px; height: 50px; border-radius: 12px; }
  .fxm-ai-ui .fxm-ai-hero-head .fxm-ai-hero-logo:not(.fxm-ai-hero-logo--image) { flex-basis: 50px; width: 50px; height: 50px; }
  .fxm-ai-ui .fxm-ai-hero-head .fxm-ai-hero-text { flex: 1 1 calc(100% - 148px); }
  .fxm-ai-ui .fxm-ai-hero-head .fxm-ai-hero-name { font-size: 19px; }
  .fxm-ai-ui .fxm-ai-hero-head .fxm-ai-entity-arrow { order: 2; }
  .fxm-ai-ui .fxm-ai-hero-head .fxm-ai-hero-badge { order: 3; margin-left: 0; }
}

.fxm-ai-ui .fxm-ai-assistant-body .fxm-ai-kpi { padding: 0; border: 0; background: transparent; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-title { margin-bottom: 10px; color: var(--ai-ink, #2f2658); font-size: 14px; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: 10px; }
/* Every KPI is the same white tile; tone lives in the value and context
 * colours only, so one green tile no longer looks like a different widget. */
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-card {
  position: relative;
  min-width: 0;
  min-height: 88px;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid var(--ai-tile-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--ai-tile-shadow);
}
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-card--ring { gap: 14px; }
.fxm-ai-ui .fxm-ai-kpi :is(.fxm-ai-kpi-tone--positive, .fxm-ai-kpi-tone--warning, .fxm-ai-kpi-tone--negative, .fxm-ai-kpi-tone--neutral) { border-color: var(--ai-tile-line); background: #fff; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-tone--unknown { border-style: dashed; border-color: #cfd3de; background: rgb(255 255 255 / 70%); box-shadow: none; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-label { margin-bottom: 4px; color: #8a8f9c; font-size: 12px; line-height: 1.5; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-value { color: var(--ai-ink, #2f2658); font: 700 22px/1.25 var(--font-headline); letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-tone--positive .fxm-ai-kpi-value { color: #0f7a5a; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-tone--warning .fxm-ai-kpi-value { color: #b45309; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-tone--negative .fxm-ai-kpi-value { color: #be123c; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-tone--unknown .fxm-ai-kpi-value { color: #7b8194; font-size: 15px; font-weight: 600; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-value .fxm-ai-kpi-unit { margin-left: 2px; color: #8a8f9c; font: 400 12px/1 var(--font-body); letter-spacing: 0; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-card--ring > div > .fxm-ai-kpi-unit { color: #8a8f9c; font-size: 12px; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-ring { width: 58px; height: 58px; flex-basis: 58px; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-ring::after { inset: 5px; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-ring-label { font-size: 14px; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-context { margin-top: 6px; font-size: 12px; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-hint { margin-top: 4px; color: #8a8f9c; font-size: 11px; line-height: 1.5; }
.fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-notes p { color: #8a8f9c; font-size: 12px; }

.fxm-ai-ui .fxm-ai-insights { padding: 16px 18px; border-color: var(--ai-card-line); border-radius: 18px; background: #fff; box-shadow: var(--ai-card-shadow); }
.fxm-ai-ui .fxm-ai-insights-title { color: var(--ai-ink, #2f2658); font-size: 14px; }
.fxm-ai-ui .fxm-ai-check > details > summary, .fxm-ai-ui .fxm-ai-check-row { gap: 10px; padding: 11px 0; font-size: 14px; }
.fxm-ai-ui .fxm-ai-check-icon { flex-basis: 22px; width: 22px; height: 22px; font-size: 12px; }
.fxm-ai-ui .fxm-ai-check-value { font-size: 13px; }
.fxm-ai-ui .fxm-ai-check-text { margin-left: 32px; font-size: 13px; }
.fxm-ai-ui .fxm-ai-data-card { border-color: var(--ai-card-line); border-radius: 18px; box-shadow: var(--ai-card-shadow); }
.fxm-ai-ui .fxm-ai-data-head { background: linear-gradient(120deg, #fff 0%, #fbfbfd 55%, #f6f6fa 100%); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-evidence-details { border-color: var(--ai-card-line); border-radius: 18px; box-shadow: var(--ai-card-shadow); }

.fxm-ai-ui .fxm-ai-assistant-message .fxm-ai-followups { gap: 8px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-assistant-message .fxm-ai-followups [data-fxm-ai-followup] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-color: color-mix(in srgb, var(--color-primary) 18%, transparent);
  background: linear-gradient(180deg, #fff, #faf9ff);
  font-size: 13px;
  box-shadow: 0 1px 2px rgb(24 20 51 / 3%);
}
.fxm-ai-ui .fxm-ai-followups [data-fxm-ai-followup]::before { content: "↗"; color: color-mix(in srgb, var(--color-primary) 60%, #fff); font-size: 12px; }
.fxm-ai-ui [data-fxm-ai-disclaimer] { padding-top: 12px; border-top: 1px dashed #ebe8f3; font-size: 12px; }

@media (max-width: 639px) {
  .fxm-ai-ui .fxm-ai-hero { padding: 16px 14px 14px; border-radius: 18px; }
  .fxm-ai-ui .fxm-ai-hero::before { width: 100%; height: 140px; background-size: 460px auto; }
  .fxm-ai-ui .fxm-ai-hero::after { left: 18px; }
  .fxm-ai-ui .fxm-ai-hero-head + .fxm-ai-subject-row { margin-top: 14px; }
  .fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-card { min-height: 80px; padding: 12px; }
  .fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-card--ring { grid-column: 1 / -1; }
  .fxm-ai-ui .fxm-ai-kpi .fxm-ai-kpi-value { font-size: 19px; }
  .fxm-ai-ui .fxm-ai-insights { padding: 14px; }
  .fxm-ai-ui .fxm-ai-check > details > summary, .fxm-ai-ui .fxm-ai-check-row { font-size: 13px; }
}
