/* Shared analysis canvas. Content and source values are identical in chat/report. */
.ai-report { container-type:inline-size; }
.ai-report .report-heading { padding:28px 28px 20px; border-bottom:0; }
.ai-report .report-status { margin:0; }
.ai-report .report-layout { display:grid; grid-template-columns:minmax(0,1fr); }
.ai-report .report-block { padding:24px 28px; border:0; min-width:0; }
.ai-report .report-block-heading { display:flex; align-items:flex-start; gap:12px; margin-bottom:18px; }
.ai-report .report-block-heading h2 { flex:1; margin:0; text-wrap:balance; }
.ai-report .report-group { border-top:1px solid var(--line); margin:12px 0; column-gap:8px; }
.ai-report .report-group:first-child { border-top:0; margin-top:0; }
.ai-report .report-metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:12px; }
.ai-report .report-metric { container-type:inline-size; background:var(--warm); border:1px solid var(--line); padding:18px; border-radius:var(--radius-card); }
.ai-report .report-metric strong { font-size:var(--font-size-metric-responsive); letter-spacing:-.025em; line-height:var(--line-heading); white-space:nowrap; overflow-wrap:normal; overflow-x:auto; }
.ai-report .report-metric strong .report-value-select { text-align:left; padding:0; white-space:nowrap; }
.ai-report .report-metric .report-metric-unit { margin-left:4px; color:var(--muted); font-size:var(--font-size-table); letter-spacing:0; font-weight:var(--font-weight-regular); }
.ai-report .report-metric p { margin:0 0 10px; }
.ai-report .report-metric-emphasis { background:var(--accent-soft); border-color:var(--line-selected); }
.ai-report .report-metric-emphasis strong { color:var(--accent-ink); }
.ai-report .report-metric .report-comparison { margin-top:14px; gap:6px; flex-direction:column; align-items:flex-start; }
.ai-report .report-metric .report-comparison-change { background:transparent; padding:0; font-size:var(--font-size-table); font-weight:var(--font-weight-medium); white-space:normal; }
.ai-report .report-headline { padding-bottom:12px; }
.ai-report .report-headline .report-prose { font-size:var(--font-size-heading); }
.ai-report .report-headline-tools { display:flex; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.ai-report .report-chart-unit { margin:0 0 12px; }
.ai-report .report-chart-host { min-width:0; width:100%; height:320px; }
.ai-report .report-chart-data { margin:12px 0 0; font-size:var(--font-size-note); color:var(--muted); }
.ai-report .report-chart-data[open] { color:var(--ink); }
.ai-report .report-chart-data summary { width:fit-content; cursor:pointer; padding:4px 0; }
.ai-report .report-chart-data summary:hover { color:var(--ink); }
.ai-report .report-chart-data .report-table-scroll { margin-top:12px; }
.ai-report .report-axis-note { margin:8px 0; color:var(--muted); font-size:var(--font-size-table); line-height:var(--line-ui); }
.ai-report .report-chart-composition { container-type:inline-size; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); gap:12px 24px; align-items:center; }
.ai-report .report-composition-key { list-style:none; padding:0; margin:0; min-width:0; }
.ai-report .report-composition-key li { display:flex; align-items:baseline; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); line-height:var(--line-ui); }
.ai-report .report-composition-key li:last-child { border:0; }
.ai-report .report-composition-key li>div { flex:1; min-width:0; }
.ai-report .report-composition-key .report-value-select { text-align:left; font-size:var(--font-size-table); line-height:var(--line-ui); }
.ai-report .report-composition-key span { display:block; margin-top:2px; color:var(--muted); font-size:var(--font-size-table); font-variant-numeric:tabular-nums; }
.ai-report .report-composition-key strong { font-size:var(--font-size-body); font-weight:var(--font-weight-medium); font-variant-numeric:tabular-nums; white-space:nowrap; }
.ai-report .report-series-swatch { width:8px; height:8px; border-radius:50%; flex:none; background:var(--chart-1); }
.ai-report .report-series-1 { background:var(--report-teal); }
.ai-report .report-series-2 { background:var(--report-ochre); }
.ai-report .report-series-3 { background:var(--report-purple); }
.ai-report .report-series-4 { background:var(--report-rose); }
.ai-report .report-series-5 { background:var(--report-slate); }
.ai-report .report-table-scroll th { background:var(--warm); border-bottom:1px solid var(--line-strong); }
.ai-report .report-table-scroll td { border-bottom:1px solid var(--line); padding-top:13px; padding-bottom:13px; }
.ai-report .report-table-scroll tr:last-child td { border-bottom:0; }
.ai-report .report-note { border-left:2px solid var(--line-strong); padding-left:12px; font-size:var(--font-size-table); }
.ai-report .report-inline-notices { grid-column:1/-1; }
.ai-report .report-limit { font-size:var(--font-size-table); }
.chat-message:has(.inline-report-mount) { max-width:var(--visual-reading-width); }
.result-entry-named { border-top:0; padding-top:0; min-width:0; }
.result-entry-card { display:flex; align-items:center; gap:20px; width:100%; min-width:0; padding:16px 20px; border:1.25px solid var(--accent); border-radius:var(--radius-card); background:var(--surface); color:var(--ink); text-align:left; white-space:normal; }
.result-entry-card:hover,.result-entry-card[aria-expanded="true"] { background:var(--accent-soft); }
.result-entry-card:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.result-entry-copy { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.result-entry-title { font-size:var(--font-size-body); font-weight:var(--font-weight-semibold); line-height:var(--line-body); overflow-wrap:anywhere; }
.result-entry-label { color:var(--accent-ink); font-size:var(--font-size-ui); line-height:var(--line-ui); }
.result-entry-arrow { flex:none; width:24px; height:24px; color:var(--accent); transform:rotate(-45deg); }
.result-entry-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:12px; margin-top:4px; }
.result-entry .result-entry-description { margin-top:8px; }
.inline-report-mount { min-width:0; width:100%; margin-top:16px; }
.inline-report { border:0; border-radius:0; background:transparent; overflow:visible; }
.inline-report .report-block { padding:20px 0; }
.inline-report .report-group { column-gap:32px; }
.inline-report>.report-layout>.report-block:first-child { padding-top:8px; }
.inline-report .report-block-text .report-block-heading { margin-bottom:8px; }
.inline-report-loading { color:var(--muted); font-size:var(--font-size-table); padding:18px 0; max-width:var(--reading-width); margin-inline:auto; }
.inline-report-error { padding:16px 0; max-width:var(--reading-width); margin-inline:auto; }
.inline-report .report-prose { margin:0; }
/* Visuals use the wider canvas; prose, headings and actions keep the same
   centered reading column as ordinary replies and the composer. */
.inline-report .report-block > :not(.report-metrics,.report-table-scroll,.report-chart-scroll,.report-chart-host,.report-chart-composition) { width:min(100%,var(--reading-width)); margin-inline:auto; }
@container (min-width:680px) {
  .ai-report .report-layout,.ai-report .report-group { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .ai-report .report-layout>.report-block,.ai-report .report-group>.report-block { grid-column:1/-1; }
  .ai-report .report-layout>.report-half,.ai-report .report-group>.report-half { grid-column:span 3; }
  .ai-report .report-layout>.report-third,.ai-report .report-group>.report-third { grid-column:span 2; }
  .ai-report .report-layout>.report-two-thirds,.ai-report .report-group>.report-two-thirds { grid-column:span 4; }
}
@container (max-width:450px) {
  .ai-report .report-block { padding:20px 16px; }
  .inline-report .report-block { padding:18px 0; }
  .ai-report .report-heading { padding:24px 16px 12px; }
  .ai-report .report-metrics { gap:8px; }
  .ai-report .report-metric { padding:12px; }
  .ai-report .report-chart-composition { gap:0; }
}
@container (max-width:300px) {
  .ai-report .report-metrics { grid-template-columns:minmax(0,1fr); }
}
@media print {
  .ai-report .report-chart-data { color:var(--ink); }
}

/* One shared condition area, separate from chapter bodies. */
.ai-report .report-common-conditions{margin:12px 28px;padding:12px 16px}
.ai-report .report-common-conditions .report-block{margin:0;padding:0;border:0;background:transparent;box-shadow:none}
.ai-report .report-common-conditions .report-block-heading{margin-bottom:6px}
.ai-report .report-common-conditions .report-prose p{margin:6px 0}
@media(max-width:600px){.ai-report .report-common-conditions{margin:12px 18px}}
