:root {
  color-scheme: light;
  --ink: #1e2e3d;
  --ink-strong: #132331;
  --muted: #657583;
  --muted-strong: #455867;
  --line: #d7e0e7;
  --line-strong: #b8c9d5;
  --page: #f3f6f8;
  --panel: #ffffff;
  --deep: #1c354a;
  --deep-2: #2b5e7d;
  --blue: #3979a0;
  --blue-soft: #dceaf2;
  --green: #2d7b68;
  --green-soft: #ddeee9;
  --teal: #2f7786;
  --teal-soft: #ddecef;
  --amber: #ad6d0a;
  --amber-soft: #fff0d1;
  --red: #bd4b43;
  --red-soft: #f9e1df;
  --gray-soft: #edf1f4;
  --shadow: 0 14px 34px rgba(27, 55, 76, 0.07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

button, input, select { font: inherit; }

button, select, input[type="range"] { cursor: pointer; }

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(47, 119, 134, 0.32);
  outline-offset: 2px;
}

.rbf-app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.rbf-app-shell.rbf-embedded { display: block; min-height: 0; }
.rbf-app-shell.rbf-embedded .rbf-sidebar { display: none; }
.rbf-app-shell.rbf-embedded .rbf-main { padding: 28px clamp(0px, 1vw, 14px) 42px; }

.rbf-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  color: #f5fffb;
  background: var(--deep);
}

.rbf-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; }
.rbf-brand-mark { display: grid; width: 46px; height: 46px; place-items: center; color: var(--deep); background: #b9d3e1; border-radius: 10px; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.06em; }
.rbf-brand strong, .rbf-brand span { display: block; }
.rbf-brand strong { font-size: 1.04rem; }
.rbf-brand span { color: rgba(245,255,251,.68); font-size: .8rem; }

.rbf-nav { display: grid; gap: 5px; }
.rbf-nav a { padding: 10px 11px; color: rgba(245,255,251,.72); border-radius: 8px; text-decoration: none; }
.rbf-nav a:hover, .rbf-nav a.active { color: #fff; background: rgba(255,255,255,.1); }

.rbf-sidebar-note { margin-top: 34px; padding: 14px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; background: rgba(255,255,255,.08); }
.rbf-sidebar-note span { display: block; color: #b9d3e1; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rbf-sidebar-note strong { display: block; margin-top: 8px; font-size: .95rem; }
.rbf-sidebar-note p { margin: 8px 0 0; color: rgba(245,255,251,.68); font-size: .82rem; line-height: 1.5; }

.rbf-main { min-width: 0; padding: 28px clamp(18px, 3vw, 44px) 56px; }
.rbf-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.rbf-eyebrow, .rbf-kicker { margin: 0 0 5px; color: var(--teal); font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; color: var(--ink-strong); font-size: clamp(1.7rem, 3vw, 2.45rem); line-height: 1.1; letter-spacing: -.035em; }
h2 { margin-bottom: 5px; color: var(--ink-strong); font-size: 1.12rem; line-height: 1.2; }
.rbf-lede { max-width: 760px; margin-bottom: 0; color: var(--muted); line-height: 1.5; }
.rbf-button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink); font-weight: 800; }
.rbf-button:hover { border-color: var(--deep-2); background: #f8fbfd; }


.rbf-controls, .rbf-panel { border: 1px solid var(--line); border-radius: 11px; background: var(--panel); box-shadow: var(--shadow); }
.rbf-controls { margin-bottom: 14px; overflow: hidden; }
.rbf-control-row { display: flex; align-items: flex-end; gap: 20px; padding: 16px 17px; }
.rbf-control-row--top { border-bottom: 1px solid var(--line); }
.rbf-field { display: grid; gap: 6px; min-width: 150px; }
.rbf-field span, .rbf-mode-control > span, .rbf-period-readout > span, .rbf-date-heading span { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.rbf-field select, .rbf-field input[type="date"], .rbf-adjustable-input { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fbfcfd; color: var(--ink); }
.rbf-field--facility { flex: 0 1 260px; }
.rbf-mode-control { display: grid; gap: 6px; }
.rbf-segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: #f3f7fa; }
.rbf-segmented button { min-height: 31px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-strong); font-size: .88rem; font-weight: 800; }
.rbf-segmented button.active { color: #fff; background: var(--deep-2); }
.rbf-period-readout { margin-left: auto; text-align: right; }
.rbf-period-readout strong, .rbf-period-readout small { display: block; }
.rbf-period-readout strong { margin-top: 3px; font-size: 1rem; }
.rbf-period-readout small { color: var(--muted); font-size: .78rem; }

.rbf-date-controls { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.4fr); grid-template-areas: "heading inputs" "heading range"; align-items: start; gap: 13px 22px; padding: 15px 17px 17px; }
.rbf-date-heading { grid-area: heading; }
.rbf-date-heading strong, .rbf-date-heading small { display: block; }
.rbf-date-heading strong { margin-top: 2px; font-size: .93rem; }
.rbf-date-heading small { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.rbf-date-inputs { display: grid; grid-area: inputs; grid-template-columns: repeat(2, minmax(125px, 1fr)); gap: 9px; }
.rbf-range-wrap { grid-area: range; min-width: 0; }
.rbf-range-labels { display: flex; justify-content: space-between; margin-bottom: 4px; color: var(--muted-strong); font-size: .8rem; font-weight: 800; }
.rbf-dual-range { position: relative; height: 28px; }
.rbf-dual-range::before, .rbf-range-fill { position: absolute; top: 11px; left: 0; right: 0; height: 6px; border-radius: 999px; content: ""; }
.rbf-dual-range::before { background: #e3ebe6; }
.rbf-range-fill { right: auto; background: var(--blue); }
.rbf-dual-range input { position: absolute; inset: 0; width: 100%; height: 28px; margin: 0; appearance: none; pointer-events: none; background: transparent; }
.rbf-dual-range input::-webkit-slider-thumb { width: 18px; height: 18px; appearance: none; pointer-events: auto; border: 3px solid #fff; border-radius: 50%; background: var(--deep-2); box-shadow: 0 0 0 1px var(--deep-2), 0 2px 6px rgba(27,55,76,.24); }
.rbf-dual-range input::-moz-range-thumb { width: 13px; height: 13px; pointer-events: auto; border: 3px solid #fff; border-radius: 50%; background: var(--deep-2); box-shadow: 0 0 0 1px var(--deep-2), 0 2px 6px rgba(27,55,76,.24); }
.rbf-range-hint { color: var(--muted); font-size: .76rem; }


.rbf-panel { margin-bottom: 14px; padding: 18px; }
.rbf-section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 15px; }
.rbf-section-heading > div:first-child > span { display: block; max-width: 780px; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.rbf-legend { display: flex; flex: 0 0 auto; gap: 10px; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.rbf-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rbf-legend-swatch { width: 12px; height: 12px; border-radius: 3px; }
.rbf-legend-swatch--low { background: rgba(57,121,160,.08); border: 1px solid #cbdde8; }
.rbf-legend-swatch--high { background: rgba(57,121,160,.42); border: 1px solid #73a7c5; }
.rbf-legend-swatch--missing { background: var(--gray-soft); border: 1px solid #d8e0e6; }

.rbf-grid-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.rbf-metric-table { width: 100%; min-width: 850px; border-collapse: separate; border-spacing: 0; }
.rbf-metric-table th, .rbf-metric-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rbf-metric-table tr:last-child td { border-bottom: 0; }
.rbf-metric-table th:last-child, .rbf-metric-table td:last-child { border-right: 0; }
.rbf-metric-table thead th { padding: 10px 12px; color: var(--muted-strong); font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; }
.rbf-metric-table thead tr:first-child th { border-bottom: 0; padding-bottom: 4px; color: var(--deep-2); background: #f6faf7; }
.rbf-metric-table thead tr:nth-child(2) th { padding-top: 4px; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: 0; text-transform: none; }
.rbf-metric-table .facility-head, .rbf-metric-table .facility-cell { position: sticky; left: 0; z-index: 2; text-align: left; }
.rbf-metric-table .facility-head { z-index: 3; min-width: 168px; background: #f6faf7; }
.rbf-metric-table .facility-cell { min-width: 168px; padding: 12px; background: #fff; }
.rbf-facility-name { display: block; color: var(--ink-strong); font-weight: 850; }
.rbf-facility-code { display: block; margin-top: 2px; color: var(--muted); font-size: .75rem; }
.rbf-facility-commitment { display: block; margin-top: 8px; color: var(--ink-strong); font-size: .76rem; font-weight: 850; line-height: 1.35; }
.rbf-metric-cell { position: relative; min-width: 154px; padding: 9px 10px; vertical-align: top; background: var(--gray-soft); transition: transform .14s ease, box-shadow .14s ease; }
.rbf-metric-cell.is-data { background: rgba(57, 121, 160, calc(.06 + (var(--heat, .2) * .34))); }
.rbf-metric-cell:hover, .rbf-metric-cell:focus-within { z-index: 4; transform: translateY(-1px); box-shadow: inset 0 0 0 2px var(--deep-2), 0 5px 14px rgba(27,55,76,.13); }
.rbf-cell-value { display: block; color: var(--ink-strong); font-size: 1rem; font-weight: 900; }
.rbf-cell-meta { display: block; margin-top: 3px; color: var(--muted-strong); font-size: .72rem; }
.rbf-cell-status { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; color: var(--muted); font-size: .7rem; font-weight: 800; }
.rbf-cell-status::before { width: 6px; height: 6px; border-radius: 50%; background: #9ca9a4; content: ""; }
.rbf-metric-cell.status-qualifies .rbf-cell-status { color: var(--green); }
.rbf-metric-cell.status-qualifies .rbf-cell-status::before { background: var(--green); }
.rbf-metric-cell.status-fails .rbf-cell-status { color: var(--red); }
.rbf-metric-cell.status-fails .rbf-cell-status::before { background: var(--red); }
.rbf-cell-tooltip { position: absolute; z-index: 10; bottom: calc(100% + 8px); left: 8px; display: none; width: 245px; padding: 10px; border: 1px solid #3c657d; border-radius: 8px; color: #f4f9fc; background: #1c354a; box-shadow: 0 8px 20px rgba(19,35,49,.25); font-size: .75rem; line-height: 1.45; }
.rbf-cell-tooltip strong { display: block; margin-bottom: 3px; color: #c8dfed; }
.rbf-metric-cell:hover .rbf-cell-tooltip, .rbf-metric-cell:focus-within .rbf-cell-tooltip { display: block; }
.rbf-grid-footnote { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: .78rem; }
.rbf-status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.rbf-status-dot--green { background: var(--green); }

.rbf-workbench-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "rules grid" "controls waterfall"; gap: 14px; align-items: stretch; }
.rbf-workbench-grid > #rules { grid-area: rules; }
.rbf-workbench-grid > #grid { grid-area: grid; }
.rbf-workbench-grid > #controls { grid-area: controls; }
.rbf-workbench-grid > #waterfall { grid-area: waterfall; }
.rbf-workbench-grid > .rbf-panel, .rbf-workbench-grid > .rbf-controls { height: 100%; margin-bottom: 0; }
.rbf-rule-list { display: grid; border-top: 1px solid var(--line); }
.rbf-rule-row { display: grid; grid-template-columns: minmax(145px, 1.35fr) minmax(94px, .8fr) minmax(94px, .8fr) minmax(142px, 1fr) minmax(92px, .78fr); align-items: center; gap: 8px; min-height: 72px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rbf-rule-label strong, .rbf-rule-label small { display: block; }
.rbf-rule-label strong { color: var(--ink-strong); font-size: .88rem; }
.rbf-rule-label small { margin-top: 2px; color: var(--muted); font-size: .74rem; }
.rbf-rule-formula { display: block; margin-top: 7px; padding: 5px 7px; border-left: 3px solid var(--blue); color: var(--ink-strong); background: #f4f8fa; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .7rem; line-height: 1.35; }
.rbf-rule-summary { margin: 6px 0 0; color: var(--muted-strong); font-size: .74rem; line-height: 1.42; }
.rbf-rule-input { display: grid; gap: 4px; }
.rbf-rule-input > span { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.rbf-rule-input--static strong { display: block; min-height: 38px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--deep-2); background: #f4f8fa; font-size: .78rem; line-height: 1.25; }
.rbf-input-with-unit { display: flex; align-items: center; }
.rbf-input-with-unit input { min-width: 0; border-radius: 7px 0 0 7px; }
.rbf-input-with-unit em { min-height: 38px; padding: 8px 7px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 7px 7px 0; color: var(--muted-strong); background: #f1f5f8; font-size: .76rem; font-style: normal; white-space: nowrap; }
.rbf-adjustable-input[disabled] { cursor: not-allowed; color: #91a09a; background: #f1f4f2; }
.rbf-rule-input--spacer { min-height: 38px; }
.rbf-multiple-control { display: grid; gap: 5px; }
.rbf-multiple-slider { width: 100%; height: 18px; accent-color: var(--deep-2); }
.rbf-multiple-control output { display: block; min-height: 28px; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--deep-2); background: #f4f8fa; font-size: .75rem; font-weight: 850; line-height: 1.2; text-align: center; }
.rbf-rule-result { text-align: right; }
.rbf-rule-result strong, .rbf-rule-result small { display: block; }
.rbf-rule-result strong { font-size: .86rem; }
.rbf-rule-result small { margin-top: 2px; color: var(--muted); font-size: .7rem; }
.rbf-rule-result--pass strong { color: var(--green); }
.rbf-rule-result--fail strong { color: var(--red); }
.rbf-rule-result--missing strong { color: var(--muted); }
.rbf-rule-result--blocked strong { color: var(--amber); }
.rbf-valuation-scope { margin: 13px 0 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.rbf-valuation-scope .rbf-field { max-width: 280px; }

.rbf-waterfall-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.rbf-waterfall-total { padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7fafc; }
.rbf-waterfall-total--highlight { border-color: #b4cfde; background: #eaf3f7; }
.rbf-waterfall-total span, .rbf-waterfall-total small { display: block; color: var(--muted); font-size: .72rem; font-weight: 800; }
.rbf-waterfall-total strong { display: block; margin: 4px 0 1px; color: var(--ink-strong); font-size: 1.35rem; }
.rbf-waterfall-total small { font-weight: 500; }
.rbf-waterfall-chart { display: grid; grid-template-columns: 49px minmax(0, 1fr); gap: 7px; min-height: 285px; margin-top: 3px; }
.rbf-waterfall-axis { position: relative; height: 222px; color: var(--muted); font-size: .66rem; font-weight: 700; }
.rbf-waterfall-axis span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.rbf-waterfall-axis span:nth-child(1) { top: 0; transform: none; }
.rbf-waterfall-axis span:nth-child(2) { top: 50%; }
.rbf-waterfall-axis span:nth-child(3) { top: 100%; transform: translateY(-100%); }
.rbf-waterfall-plot { position: relative; height: 222px; border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.rbf-waterfall-gridline { position: absolute; right: 0; left: 0; border-top: 1px dashed #dbe4ea; }
.rbf-waterfall-gridline--top { top: 0; }
.rbf-waterfall-gridline--mid { top: 50%; }
.rbf-waterfall-gridline--base { bottom: 0; border-top-style: solid; border-color: var(--line-strong); }
.rbf-waterfall-columns { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; padding: 0 5px; }
.rbf-waterfall-column { position: relative; display: grid; grid-template-rows: 222px auto auto; min-width: 0; text-align: center; }
.rbf-waterfall-column:not(:last-child)::after { position: absolute; right: -7px; bottom: var(--bar-end); width: 7px; border-top: 1px solid #98adbb; content: ""; }
.rbf-waterfall-bar-area { position: relative; min-width: 0; }
.rbf-waterfall-bar { position: absolute; right: 13%; left: 13%; min-height: 3px; border: 1px solid rgba(22, 53, 74, .24); border-radius: 2px 2px 0 0; background: var(--blue); box-shadow: 0 2px 4px rgba(24, 51, 69, .08); }
.rbf-waterfall-column--paid .rbf-waterfall-bar { border-color: #8297a7; background: #a9bbc8; }
.rbf-waterfall-column--paid::after { display: none; }
.rbf-waterfall-column--payment .rbf-waterfall-bar { background: #3979a0; }
.rbf-waterfall-column--uptime .rbf-waterfall-bar { background: #547f9d; }
.rbf-waterfall-column--energy .rbf-waterfall-bar { background: #3d8993; }
.rbf-waterfall-column--admissions .rbf-waterfall-bar { background: #6b7b8a; }
.rbf-waterfall-column--total .rbf-waterfall-bar { border-color: #172a39; background: #1e2e3d; }
.rbf-waterfall-value { position: absolute; right: 0; left: 0; bottom: calc(var(--bar-height, 0%) + var(--bar-bottom, 0%)); transform: translateY(-100%); color: var(--ink-strong); font-size: .68rem; font-weight: 900; white-space: nowrap; }
.rbf-waterfall-column strong { overflow: hidden; margin-top: 8px; color: var(--ink-strong); font-size: .68rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.rbf-waterfall-column small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: .61rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }

.rbf-projection-panel { margin-top: 0; }
.rbf-projection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.rbf-projection-column { min-width: 0; }
.rbf-projection-column--future { padding-left: 20px; border-left: 1px solid var(--line); }
.rbf-projection-heading h3 { margin: 0 0 4px; color: var(--ink-strong); font-size: 1rem; }
.rbf-projection-heading p:last-child { margin: 0 0 12px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.rbf-waterfall-summary--compact { margin-bottom: 8px; }
.rbf-waterfall-summary--compact .rbf-waterfall-total strong { font-size: 1.05rem; }
.rbf-projection-horizon { display: grid; gap: 5px; margin: 4px 0 13px; }
.rbf-projection-horizon > span { color: var(--muted); font-size: .72rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.rbf-projection-horizon-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.rbf-projection-horizon-control input { width: 100%; accent-color: var(--deep-2); }
.rbf-projection-horizon-control output { min-width: 72px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--deep-2); background: #f4f8fa; font-size: .78rem; font-weight: 850; text-align: center; }
.rbf-projection-horizon-labels { display: flex; justify-content: space-between; padding: 0 4px; color: var(--muted); font-size: .68rem; }
.rbf-projection-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 13px; }
.rbf-projection-summary article { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #f7fafc; }
.rbf-projection-summary article span, .rbf-projection-summary article small { display: block; color: var(--muted); font-size: .67rem; font-weight: 750; }
.rbf-projection-summary article strong { display: block; margin: 3px 0 1px; color: var(--ink-strong); font-size: .98rem; }
.rbf-projection-summary article small { font-weight: 500; }
.rbf-projection-summary--highlight { border-color: #b4cfde !important; background: #eaf3f7 !important; }
.rbf-cashflow-table-wrap { max-height: 330px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.rbf-cashflow-table { width: 100%; border-collapse: collapse; font-size: .73rem; }
.rbf-cashflow-table caption { padding: 8px 10px; color: var(--muted-strong); font-size: .72rem; font-weight: 850; text-align: left; }
.rbf-cashflow-table th, .rbf-cashflow-table td { padding: 7px 8px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.rbf-cashflow-table th:first-child, .rbf-cashflow-table td:first-child { text-align: left; }
.rbf-cashflow-table thead th { color: var(--muted); background: #f7fafc; font-size: .66rem; letter-spacing: .03em; text-transform: uppercase; }
.rbf-cashflow-table tbody th { color: var(--ink-strong); font-weight: 750; }
.rbf-cashflow-table tbody td { color: var(--muted-strong); }
.rbf-cashflow-table tbody td strong { color: var(--ink-strong); }
.rbf-projection-note { margin: 9px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.4; }

.rbf-audit-panel { margin-top: 0; }
.rbf-audit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.rbf-audit-grid article { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfc; }
.rbf-audit-icon { display: grid; flex: 0 0 auto; width: 24px; height: 24px; place-items: center; border-radius: 50%; font-weight: 900; }
.rbf-audit-icon--pass { color: var(--green); background: var(--green-soft); }
.rbf-audit-icon--fail { color: var(--red); background: var(--red-soft); }
.rbf-audit-icon--missing { color: var(--muted-strong); background: var(--gray-soft); }
.rbf-audit-icon--blocked { color: var(--amber); background: var(--amber-soft); }
.rbf-audit-grid strong { display: block; font-size: .86rem; }
.rbf-audit-grid p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.rbf-source-line { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.rbf-loading { padding: 28px 15px; color: var(--muted); text-align: center; }
.rbf-empty { color: var(--muted); font-size: .85rem; }

@media (min-width: 1081px) {
  .rbf-workbench-grid #grid .rbf-metric-table { min-width: 0; table-layout: fixed; }
  .rbf-workbench-grid #grid .rbf-metric-table .facility-head,
  .rbf-workbench-grid #grid .rbf-metric-table .facility-cell { width: 18%; min-width: 0; }
  .rbf-workbench-grid #grid .rbf-metric-cell { min-width: 0; }
}

@media (max-width: 1080px) {
  .rbf-app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .rbf-date-controls { grid-template-columns: 1fr; grid-template-areas: "heading" "inputs" "range"; }
  .rbf-workbench-grid { grid-template-columns: 1fr; grid-template-areas: "rules" "grid" "controls" "waterfall"; }
}

@media (max-width: 760px) {
  .rbf-app-shell { display: block; }
  .rbf-sidebar { position: static; height: auto; padding: 14px 16px; }
  .rbf-brand { margin-bottom: 13px; }
  .rbf-nav { display: flex; gap: 5px; overflow-x: auto; }
  .rbf-nav a { flex: 0 0 auto; font-size: .84rem; }
  .rbf-sidebar-note { display: none; }
  .rbf-main { padding: 20px 12px 42px; }
  .rbf-topbar { display: block; }
  .rbf-button { margin-top: 14px; }
  .rbf-control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .rbf-field--facility, .rbf-period-readout { grid-column: 1 / -1; }
  .rbf-period-readout { margin-left: 0; text-align: left; }
  .rbf-date-controls { gap: 13px; }
  .rbf-date-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .rbf-section-heading { display: block; }
  .rbf-legend { margin-top: 10px; }
  .rbf-rule-row { grid-template-columns: minmax(135px, 1fr) minmax(98px, .9fr); gap: 9px; }
  .rbf-rule-label, .rbf-rule-result { grid-column: 1 / -1; }
  .rbf-rule-result { text-align: left; }
  .rbf-rule-input--spacer { display: none; }
  .rbf-rule-input--coverage { grid-column: 2; }
  .rbf-projection-grid { grid-template-columns: 1fr; }
  .rbf-projection-column--future { padding-top: 18px; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .rbf-audit-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
 .rbf-control-row { grid-template-columns: 1fr; }
  .rbf-field--facility, .rbf-period-readout { grid-column: auto; }
  .rbf-segmented { width: 100%; }
  .rbf-segmented button { flex: 1; }
  .rbf-date-inputs { grid-template-columns: 1fr; }
  .rbf-waterfall-summary { grid-template-columns: 1fr; }
  .rbf-projection-summary { grid-template-columns: 1fr; }
  .rbf-rule-row { grid-template-columns: 1fr; }
  .rbf-rule-input--coverage { grid-column: auto; }
}
