.analyst-viz-host {
  position: relative;
  min-height: 240px;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: var(--viz-background, #fff);
}

.analyst-viz-message {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 20px;
  color: var(--muted, #667085);
  font-size: 11px;
  text-align: center;
}

.analyst-viz-message.error { color: #a13f4d; }
.analyst-viz-title { padding: 11px 13px 0; color: var(--viz-foreground, #1b2434); font-size: 11px; font-weight: 760; }
.analyst-viz-billboard-host .bb { width: 100%; }
.analyst-viz-billboard-host .bb-axis text,
.analyst-viz-billboard-host .bb-legend-item text { fill: var(--viz-foreground, #4b5563); font-size: 10px; }
.analyst-viz-billboard-host .bb-axis path,
.analyst-viz-billboard-host .bb-axis line { stroke: var(--viz-grid, #e5e8ef); }
.analyst-viz-billboard-host .bb-grid line { stroke: var(--viz-grid, #e5e8ef); }
.analyst-viz-billboard-host .bb-tooltip { border: 1px solid #d8deea; box-shadow: 0 8px 22px rgba(33, 48, 82, .14); font-size: 10px; }
.analyst-viz-billboard-host .bb-tooltip th { position: static; background: #f7f8fb; }

.analyst-viz-d3-frame { position: relative; width: 100%; min-height: 240px; background: var(--viz-background, #fff); }
.analyst-viz-d3-frame svg { display: block; width: 100%; height: auto; min-height: 240px; overflow: visible; }
.analyst-viz-d3-frame .analyst-viz-axis text,
.analyst-viz-d3-frame .analyst-viz-legend text,
.analyst-viz-d3-frame .analyst-viz-axis-title { fill: var(--viz-muted, #667085); font-size: 10px; }
.analyst-viz-d3-frame .analyst-viz-axis path,
.analyst-viz-d3-frame .analyst-viz-axis line { stroke: var(--viz-grid, #e5e8ef); }
.analyst-viz-d3-frame .analyst-viz-legend text { font-size: 9px; }
.analyst-viz-d3-frame .analyst-viz-line,
.analyst-viz-d3-frame .analyst-viz-point,
.analyst-viz-d3-frame .analyst-viz-dot,
.analyst-viz-d3-frame .analyst-viz-bin,
.analyst-viz-d3-frame .analyst-viz-heat-cell,
.analyst-viz-d3-frame .analyst-viz-waterfall-bar { cursor: crosshair; }
.analyst-viz-d3-frame .analyst-viz-doughnut-slice { cursor: crosshair; stroke: var(--analyst-viz-background, #fff); stroke-width: 1px; }
.analyst-viz-d3-frame .analyst-viz-doughnut-legend { font-size: 10px; }
.analyst-viz-d3-frame .analyst-viz-doughnut-empty { font-size: 11px; }
.analyst-viz-d3-frame .analyst-viz-box-whisker { cursor: crosshair; }
.analyst-viz-d3-frame .analyst-viz-box-whisker-box {
  stroke: var(--viz-background, #fff);
  stroke-width: 1.5;
  fill-opacity: .78;
}
.analyst-viz-d3-frame .analyst-viz-box-whisker-median,
.analyst-viz-d3-frame .analyst-viz-box-whisker-whisker,
.analyst-viz-d3-frame .analyst-viz-box-whisker-cap,
.analyst-viz-d3-frame .analyst-viz-box-whisker-mean-line {
  stroke: var(--viz-foreground, #222);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.analyst-viz-d3-frame .analyst-viz-box-whisker-outlier,
.analyst-viz-d3-frame .analyst-viz-box-whisker-inner-point {
  stroke: var(--viz-background, #fff);
  stroke-width: 1;
}
.analyst-viz-d3-frame .analyst-viz-box-whisker-mean-marker {
  stroke: var(--viz-background, #fff);
  stroke-width: 1.5;
}
.analyst-viz-tooltip { position: absolute; z-index: 4; max-width: 220px; padding: 8px 10px; border-radius: 6px; background: var(--viz-tooltip-bg, #1b2434); color: var(--viz-tooltip-fg, #fff); pointer-events: none; box-shadow: 0 7px 18px rgba(22, 30, 49, .22); font-size: 10px; }
.analyst-viz-tooltip strong, .analyst-viz-tooltip span { display: block; }
.analyst-viz-tooltip strong { margin-top: 3px; color: rgba(255,255,255,.66); font-size: 9px; font-weight: 650; }
.analyst-viz-tooltip strong:first-child { margin-top: 0; }
.analyst-viz-tooltip span { margin-top: 1px; }

.analyst-viz-table-wrap { overflow: auto; max-height: 360px; padding: 0 12px 12px; }
.analyst-viz-table-wrap .analyst-viz-title { padding-left: 0; padding-bottom: 8px; }
.analyst-viz-table-wrap table { min-width: 100%; }
.analyst-viz-table-wrap th { position: sticky; top: 0; }
.analyst-viz-result-section { overflow: visible; }
.analyst-viz-result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.analyst-viz-result-heading h2 { margin-bottom: 3px; }
.analyst-viz-result-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.analyst-viz-result { min-height: 260px; }

.analyst-viz-accessibility-trigger {
  position: absolute;
  z-index: 5;
  top: 8px;
  right: 8px;
  padding: 5px 9px;
  border: 1px solid var(--viz-grid, #cbd5e1);
  border-radius: 5px;
  background: var(--viz-background, #fff);
  color: var(--viz-foreground, #1b2434);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  pointer-events: auto;
}
.analyst-viz-accessibility-trigger:focus-visible,
.analyst-viz-accessibility-dialog button:focus-visible {
  outline: 3px solid #3758d5;
  outline-offset: 2px;
}
.analyst-viz-accessibility-dialog {
  width: min(94vw, 900px);
  max-width: 900px;
  max-height: 88vh;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #1b2434;
  background: #fff;
  box-shadow: 0 16px 48px rgba(15, 23, 42, .28);
  pointer-events: auto;
}
.analyst-viz-accessibility-dialog::backdrop { background: rgba(15, 23, 42, .48); }
.analyst-viz-accessibility-dialog-header,
.analyst-viz-accessibility-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.analyst-viz-accessibility-dialog h2 { margin: 0; font-size: 18px; }
.analyst-viz-accessibility-dialog p { margin: 9px 0; line-height: 1.45; }
.analyst-viz-accessibility-summary { font-weight: 650; }
.analyst-viz-accessibility-source-note,
.analyst-viz-accessibility-bounds-note,
.analyst-viz-accessibility-page-status { color: #596579; font-size: 13px; }
.analyst-viz-accessibility-statistics { margin: 10px 0; padding: 10px; border: 1px solid #d6dce7; border-radius: 6px; }
.analyst-viz-accessibility-statistics h3 { margin: 0 0 5px; font-size: 14px; }
.analyst-viz-accessibility-statistics p { color: #596579; font-size: 12px; }
.analyst-viz-accessibility-statistics ul { margin: 0; padding-left: 20px; }
.analyst-viz-accessibility-statistics li { margin: 3px 0; }
.analyst-viz-accessibility-table-slot { overflow: auto; max-height: 52vh; border: 1px solid #d8deea; }
.analyst-viz-accessibility-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.analyst-viz-accessibility-table caption { padding: 8px; text-align: left; font-weight: 700; }
.analyst-viz-accessibility-table th,
.analyst-viz-accessibility-table td { padding: 6px 8px; border-top: 1px solid #e3e7ef; text-align: left; vertical-align: top; }
.analyst-viz-accessibility-table thead th { position: sticky; top: 0; z-index: 1; background: #f4f6fa; }
.analyst-viz-accessibility-table tbody th { font-weight: 650; }
.analyst-viz-accessibility-dialog button { padding: 6px 10px; border: 1px solid #bdc7d7; border-radius: 5px; background: #f8fafc; color: #1b2434; cursor: pointer; }
.analyst-viz-accessibility-dialog button:disabled { cursor: default; opacity: .55; }
.analyst-viz-accessibility-pagination { justify-content: flex-end; margin-top: 10px; }
.analyst-viz-accessibility-pagination button:first-child { margin-right: auto; }

@media (max-width: 760px) {
  .analyst-viz-d3-frame svg { min-width: 600px; }
  .analyst-viz-d3-frame { overflow-x: auto; }
  .analyst-viz-accessibility-dialog { width: 96vw; padding: 12px; }
  .analyst-viz-accessibility-dialog-header { align-items: flex-start; }
}

/* Readable compact chart density ----------------------------------------- */
.analyst-viz-host { min-height: 220px; }
.analyst-viz-message { min-height: 180px; padding: 12px; font-size: 13px; }
.analyst-viz-title { padding: 7px 10px 0; font-size: 13px; }
.analyst-viz-billboard-host .bb-axis text,
.analyst-viz-billboard-host .bb-legend-item text { font-size: 12px; }
.analyst-viz-billboard-host .bb-tooltip { font-size: 12px; }
.analyst-viz-d3-frame { min-height: 220px; }
.analyst-viz-d3-frame svg { min-height: 220px; }
.analyst-viz-d3-frame .analyst-viz-axis text,
.analyst-viz-d3-frame .analyst-viz-legend text,
.analyst-viz-d3-frame .analyst-viz-axis-title { font-size: 12px; }
.analyst-viz-d3-frame .analyst-viz-legend text { font-size: 11px; }
.analyst-viz-tooltip { padding: 6px 8px; font-size: 12px; }
.analyst-viz-tooltip strong { font-size: 10px; }
.analyst-viz-result-heading { gap: 8px; margin-bottom: 5px; }
.analyst-viz-result-heading p { font-size: 12px; }
.analyst-viz-result { min-height: 220px; }
.analyst-viz-table-wrap { max-height: 330px; padding: 0 8px 8px; }

@media (max-width: 760px) {
  .analyst-viz-message { min-height: 160px; }
  .analyst-viz-result { min-height: 190px; }
}
