/* Reports + customer health (owned by the reports agent; docs/REPORTS.md).
   Chart marks use the --series tokens only (blue = first series, orange = second; validated for colour-blindness
   in light and dark). Text on charts uses the text tokens, never the series colour. */

.rp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rp-filters { gap: 8px; }
.rp-filters .seg .btn { text-decoration: none; }
.rp-table tfoot td { font-weight: 650; border-top: 1px solid var(--border-strong); }
.rp-row-actions { gap: 4px; flex-wrap: nowrap; justify-content: flex-end; }
.rp-help { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.rp-import-errors { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; max-height: 260px; overflow-y: auto; }
.rp-how { padding: 12px 16px; }
.rp-how summary { font-weight: 600; }
.rp-how > .stack { margin-top: 10px; }
.rp-seg { flex-wrap: wrap; }
.rp-refetch { opacity: 0.55; transition: opacity 0.15s var(--ease); }
.notice .icon { width: 15px; height: 15px; vertical-align: -3px; }

/* ---------- Charts ---------- */

.rp-chart { position: relative; width: 100%; min-width: 0; }
.rp-svg { display: block; width: 100%; overflow: visible; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 6px; font-size: 12.5px; color: var(--text-2); }
.rp-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.rp-sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rp-sw.rp-s1 { background: var(--series); }
.rp-sw.rp-s2 { background: var(--s-tx); }

.rp-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.rp-axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.rp-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.rp-tick-year { fill: var(--muted); font-size: 10px; }
.rp-direct { fill: var(--text-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.rp-bar.rp-s1 { fill: var(--series); }
.rp-bar.rp-s2 { fill: var(--s-tx); }
.rp-col { transition: opacity 0.12s var(--ease); }
.has-hot .rp-col:not(.is-hot) { opacity: 0.4; }

.rp-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rp-line.rp-s1 { stroke: var(--series); }
.rp-area.rp-s1 { fill: var(--series); fill-opacity: 0.1; stroke: none; }
.rp-dot.rp-s1 { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.rp-cross { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }

.rp-hit { fill: transparent; cursor: default; outline: none; }
.rp-hit:focus-visible { stroke: var(--focus); stroke-width: 2; }

.rp-tip { pointer-events: none; }
.rp-tip-bg { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; filter: drop-shadow(0 4px 10px rgba(16, 24, 40, 0.14)); }
.rp-tip-text { font-size: 12px; }
.rp-tip-title { fill: var(--muted); font-weight: 600; }
.rp-tip-value { fill: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-tip-label { fill: var(--text-2); }
.rp-tip-key { stroke-width: 2; stroke-linecap: round; }
.rp-tip-key.rp-s1 { stroke: var(--series); }
.rp-tip-key.rp-s2 { stroke: var(--s-tx); }

@media (forced-colors: active) {
  .rp-bar.rp-s1, .rp-sw.rp-s1 { fill: CanvasText; background: CanvasText; }
  .rp-bar.rp-s2, .rp-sw.rp-s2 { fill: GrayText; background: GrayText; }
  .rp-line.rp-s1 { stroke: CanvasText; }
}

/* ---------- Health: level pills, score, reasons ---------- */

.pill.hl-good { background: var(--good-tint); color: var(--good-ink); }
.pill.hl-watch { background: var(--warning-tint); color: var(--warning-ink); }
.pill.hl-risk { background: var(--critical-tint); color: var(--critical-ink); }
.pill.hl-unknown { background: var(--muted-tint); color: var(--text-2); }
.pill.hl-good, .pill.hl-watch, .pill.hl-risk, .pill.hl-unknown { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pill.hl-good .icon, .pill.hl-watch .icon, .pill.hl-risk .icon, .pill.hl-unknown .icon { width: 12px; height: 12px; }

.hl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hl-score { display: flex; align-items: baseline; }
.hl-score-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.hl-meter { display: block; width: 100%; height: 8px; border-radius: 999px; overflow: hidden; }
.hl-meter-good .hl-meter-track { fill: color-mix(in srgb, var(--good) 18%, var(--surface)); }
.hl-meter-good .hl-meter-fill { fill: var(--good); }
.hl-meter-watch .hl-meter-track { fill: var(--track-warning); }
.hl-meter-watch .hl-meter-fill { fill: var(--warning); }
.hl-meter-risk .hl-meter-track { fill: var(--track-critical); }
.hl-meter-risk .hl-meter-fill { fill: var(--critical); }

.hl-reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.hl-reasons li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hl-reasons li + li { border-top: 1px solid var(--grid); padding-top: 8px; }
.hl-reasons.compact { gap: 3px; font-size: 13px; }
.hl-reasons.compact li + li { border-top: 0; padding-top: 0; }
.hl-points { flex: none; font-size: 12px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.hl-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.hl-cell b { min-width: 22px; text-align: right; }

@media (max-width: 720px) {
  .rp-filters { flex-wrap: wrap; }
  .hl-reasons li { flex-direction: column; gap: 2px; }
}
