/* riverhealth.css — system LAYOUT classes (desktop-instrument chrome + fill).
 * Mirrors the EthiKit pattern; candidate for promotion into class.ui.css. */
body[data-system="riverhealth"] .riv-metricbar {
    padding: 6px 12px; border-bottom: 1px solid var(--ui-gray-200, #e5e7eb); min-height: 34px;
}
body[data-system="riverhealth"] .riv-statusbar {
    height: 24px; padding: 0 12px; border-top: 1px solid var(--ui-gray-200, #e5e7eb);
    font-size: 11px; color: var(--ui-text-muted, #6b7280); background: var(--ui-gray-50, #f9fafb); flex: 0 0 auto;
}
body[data-system="riverhealth"] .riv-statusbar .ui-text-sm { font-size: 11px; }
/* Analysis: per-parameter trend chart host (time-series + OLS regression). */
body[data-system="riverhealth"] .riv-trendchart { height: 300px; min-height: 300px; width: 100%; }
/* Analysis workbench: section nav, explanation box, trend verdict badge, status chart. */
body[data-system="riverhealth"] .riv-an-navbtn { width: 100%; justify-content: flex-start; text-align: left; }
body[data-system="riverhealth"] .riv-an-explain { border-left: 3px solid var(--ui-primary-300, #93c5fd);
    padding: 7px 10px; background: var(--ui-bg-sunken, #f9fafb); border-radius: var(--ui-radius-sm); color: var(--ui-fg-muted, #6b7280); }
body[data-system="riverhealth"] .riv-verdict-badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-weight: 700; font-size: 13px; }
body[data-system="riverhealth"] .riv-verdict-bad { background: #fee2e2; color: #b91c1c; }
body[data-system="riverhealth"] .riv-verdict-good { background: #dcfce7; color: #15803d; }
body[data-system="riverhealth"] .riv-verdict-stable { background: var(--ui-gray-100, #f3f4f6); color: #4b5563; }
body[data-system="riverhealth"] .riv-an-statuschart { height: 150px; width: 100%; }
/* Rivers: connectivity editor rows + validation note. */
body[data-system="riverhealth"] .riv-conn-row { padding: 2px 0; }
body[data-system="riverhealth"] .riv-conn-elev { min-width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; }
body[data-system="riverhealth"] .riv-conn-flow { min-width: 4.6rem; text-align: right; font-variant-numeric: tabular-nums; }
body[data-system="riverhealth"] .riv-rivers-detail { border-top: 1px solid var(--ui-border); border-bottom: 1px solid var(--ui-border); }
body[data-system="riverhealth"] .riv-conn-ok { color: #15803d; }
body[data-system="riverhealth"] .riv-conn-bad { color: #b91c1c; font-weight: 600; }
body[data-system="riverhealth"] .riv-conn-sel { background: #fff7ed; border-radius: var(--ui-radius-sm); }
body[data-system="riverhealth"] .riv-conn-reset { width: 100%; justify-content: center; }
/* Rivers: pin the control-stage to the viewport so the (tall) editor list scrolls
   internally instead of inflating the whole stage and pushing the graph far below. */
body[data-system="riverhealth"] .riv-rivers-cs { height: calc(100dvh - 170px); min-height: 420px; }
/* Rivers: split stage — map above, connectivity graph below. */
body[data-system="riverhealth"] .riv-rivers-map { flex: 1.6 1 0; min-height: 200px; }
body[data-system="riverhealth"] .riv-rivers-graph { flex: 1 1 0; min-height: 170px; border-top: 1px solid var(--ui-gray-200, #e5e7eb); }
/* Alerts: triage action bar above the alert detail. */
body[data-system="riverhealth"] .riv-alertbar { padding: 8px 0; border-top: 1px solid var(--ui-gray-200, #e5e7eb); }
/* Alerts: severity-group filter bar. */
body[data-system="riverhealth"] .riv-sevfilter { padding: 6px 12px; border-bottom: 1px solid var(--ui-gray-200, #e5e7eb); }
/* Alerts: scan/records view toggle. */
body[data-system="riverhealth"] .riv-subnav { border-bottom: 1px solid var(--ui-gray-200, #e5e7eb); }
/* Dashboard: marker-colour legend (right of the status line). */
body[data-system="riverhealth"] .riv-legend { white-space: nowrap; }
/* Dashboard: explorer time-series chart (point + measurement → value over time). */
body[data-system="riverhealth"] .riv-explorer-chart { min-height: 280px; width: 100%; }
/* Dashboard panels — static titled work cards (no hover lift; icon beside title). */
body[data-system="riverhealth"] .riv-panel:hover { transform: none; box-shadow: var(--ui-shadow-md); }
body[data-system="riverhealth"] .riv-panel .ui-card-header { flex-direction: row; align-items: center; gap: 6px; margin-bottom: var(--ui-space-2); }
/* Dashboard: selected-point context strip (tinted info card above the chart). */
body[data-system="riverhealth"] .riv-context { display: flex; flex-direction: column; gap: 1px; padding: 7px 11px;
    border-radius: var(--ui-radius-md); background: var(--ui-primary-50, #eff6ff); border: 1px solid var(--ui-primary-100, #dbeafe); }
body[data-system="riverhealth"] .riv-context-code { font-weight: 700; font-size: 13px; color: var(--ui-primary-700, #1d4ed8); }
body[data-system="riverhealth"] .riv-context-name { font-size: 12px; color: var(--ui-fg, #111827); }
body[data-system="riverhealth"] .riv-context-meta { font-size: 11px; color: var(--ui-fg-muted, #6b7280); }
/* Work-surface fill (design §4) — scoped to this system only. */
body[data-system="riverhealth"] .ui-pageframe-body  { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
body[data-system="riverhealth"] .ui-pageframe-stage { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
body[data-system="riverhealth"] .ui-pageframe-stage > * { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

/* P2 — a weak-fit verdict mutes: honest chips don't shout over R²≈0 */
.riv-verdict-weak { opacity: 0.55; filter: saturate(0.5); }

/* P6 — print the report region only (🖨 clones .riv-report into the overlay) */
.riv-print-overlay { display: none; }
@media print {
    body.riv-printing > *:not(.riv-print-overlay) { display: none !important; }
    body.riv-printing .riv-print-overlay { display: block; }
    .riv-print-overlay .ui-table th, .riv-print-overlay .ui-table td { border: 1px solid var(--ui-gray-300); padding: 2px 6px; }
}
