/* /rbs directory. Built on site-theme.css tokens; the few local tokens below
 * encode the control hierarchy from the RBS mockup:
 *   filled accent   = the one active choice (selected filter, current page)
 *   outlined accent = an action (Download)
 *   outlined neutral = available choices (other filters, pager, inputs)
 *   tinted accent   = status chip (High Performing)
 * with neutral (not warm) hairlines and one control height. */

.rbs-page {
  --rbs-control-h: 40px;
  --rbs-radius: 8px;
  --pbj-control-border: #d6d6dc;
  --rbs-hairline: #e6e6ea;
  --rbs-card-border: #dedee3;
  --pbj-accent-solid: #623d8f;
  --pbj-on-accent: #ffffff;
  --rbs-chip-bg: #efe7f6;
  --rbs-chip-text: #4c2967;
  --rbs-th: #623d8f;
  --rbs-row-hover: #f7f6fa;
  font-family: "DM Sans PBJ", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--pbj-text);
  font-size: 15px;
}
:root[data-theme="dark"] .rbs-page {
  --pbj-control-border: #334155;
  --rbs-hairline: #222c3d;
  --rbs-card-border: #2a3448;
  --pbj-accent-solid: #7c3aed;
  --pbj-on-accent: #ffffff;
  --rbs-chip-bg: rgba(124, 58, 237, 0.2);
  --rbs-chip-text: #d8ccfd;
  --rbs-th: #b9a5fb;
  --rbs-row-hover: #151e30;
}
/* Wider canvas than prose pages: six dense columns need it. */
.pbj-content-box:has(> .rbs-page) { padding-left: clamp(16px, 2.5vw, 32px); padding-right: clamp(16px, 2.5vw, 32px); }
.pbj-content:has(> .rbs-page), .pbj-content:has(.rbs-page) { max-width: 1240px; }

.rbs-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rbs-muted { color: var(--pbj-text-subtle); }
.rbs-tnum { font-variant-numeric: tabular-nums; }
.rbs-dot { margin: 0 0.45em; color: var(--pbj-text-subtle); }
.rbs-page a { color: var(--pbj-accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.rbs-page a:hover { color: var(--pbj-accent-hover); }
.rbs-page a:focus-visible, .rbs-page button:focus-visible, .rbs-page select:focus-visible, .rbs-page input:focus-visible, .rbs-page summary:focus-visible {
  outline: 2px solid var(--pbj-accent); outline-offset: 2px;
}

/* Header */
.rbs-head { margin: 0.5rem 0 1.25rem; }
.rbs-breadcrumb { font-size: 0.875rem; color: var(--pbj-text-subtle); margin-bottom: 0.5rem; display: flex; gap: 0.45rem; align-items: center; }
.rbs-head__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; }
.rbs-title {
  font-family: "Vollkorn PBJ", "Vollkorn", Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(2rem, 4.2vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
  color: var(--pbj-text);
}
.rbs-lede { font-size: 1.12rem; line-height: 1.5; margin: 0 0 0.6rem; max-width: 46rem; color: var(--pbj-text); }
.rbs-source { font-size: 0.92rem; color: var(--pbj-text-subtle); margin: 0; }

/* Buttons */
.rbs-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  height: var(--rbs-control-h); padding: 0 1rem;
  border-radius: 6px; font: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background var(--pbj-transition-fast, 150ms ease), border-color var(--pbj-transition-fast, 150ms ease), color var(--pbj-transition-fast, 150ms ease);
}
.rbs-btn--outline { background: var(--pbj-surface); color: var(--pbj-accent); border: 1px solid var(--pbj-accent); }
.rbs-btn--outline:hover { background: var(--pbj-accent-soft); }

.rbs-download { position: relative; flex: 0 0 auto; margin-top: 0.4rem; }
.rbs-download > summary { list-style: none; }
.rbs-download > summary::-webkit-details-marker { display: none; }
.rbs-download[open] > summary svg { transform: rotate(180deg); }
.rbs-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  min-width: 290px; margin: 0; padding: 6px; list-style: none;
  background: var(--pbj-surface); border: 1px solid var(--rbs-card-border); border-radius: var(--rbs-radius);
  box-shadow: var(--pbj-shadow);
}
.rbs-menu a, .rbs-menu button {
  display: block; width: 100%; text-align: left; padding: 0.55rem 0.75rem; border-radius: 6px;
  color: var(--pbj-text) !important; text-decoration: none !important; font: inherit; font-size: 0.92rem;
  background: none; border: 0; cursor: pointer;
}
.rbs-menu a:hover, .rbs-menu button:hover { background: var(--pbj-accent-soft); }
.rbs-menu li + li:last-child { border-top: 1px solid var(--rbs-hairline); margin-top: 4px; padding-top: 4px; }

/* Controls */
.rbs-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.rbs-input {
  height: var(--rbs-control-h); border: 1px solid var(--pbj-control-border); border-radius: 6px;
  background: var(--pbj-surface); color: var(--pbj-text); font: inherit; font-size: 0.95rem; padding: 0 0.85rem;
}
.rbs-input::placeholder { color: var(--pbj-text-subtle); opacity: 0.85; }
.rbs-input:hover { border-color: var(--pbj-border-strong); }
.rbs-select { min-width: 180px; padding-right: 2rem; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.rbs-search { position: relative; flex: 1 1 260px; max-width: 340px; }
.rbs-search svg { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--pbj-text-subtle); pointer-events: none; }
.rbs-search .rbs-input { width: 100%; padding-left: 2.3rem; }
.rbs-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.rbs-pill {
  height: var(--rbs-control-h); padding: 0 1.1rem; border-radius: 999px;
  border: 1px solid var(--pbj-control-border); background: var(--pbj-surface); color: var(--pbj-text);
  font: inherit; font-size: 0.95rem; cursor: pointer; white-space: nowrap;
  transition: background var(--pbj-transition-fast, 150ms ease), border-color var(--pbj-transition-fast, 150ms ease), color var(--pbj-transition-fast, 150ms ease);
}
.rbs-pill:hover:not(.is-active) { border-color: var(--pbj-accent); color: var(--pbj-accent); }
.rbs-pill.is-active { background: var(--pbj-accent-solid); border-color: var(--pbj-accent-solid); color: var(--pbj-on-accent); font-weight: 600; }
.rbs-pill__n { font-variant-numeric: tabular-nums; }

.rbs-summary { margin: 0 0 0.75rem; font-size: 0.98rem; color: var(--pbj-text-subtle); }
.rbs-summary strong { color: var(--pbj-text); font-weight: 700; }

/* Cards + tables (reset the generic .pbj-content-box th/h2 rules) */
.rbs-page th { text-transform: none !important; letter-spacing: 0 !important; background: transparent !important; }
.rbs-page .rbs-h2, .rbs-page .rbs-h3 { text-transform: none; border: 0; padding: 0; }
.rbs-card { background: var(--pbj-surface); border: 1px solid var(--rbs-card-border); border-radius: var(--rbs-radius); }
/* position: relative keeps absolutely positioned .rbs-sr text in cells inside the scroller (else it widens the page on mobile). */
.rbs-table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rbs-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.rbs-table th, .rbs-table td { padding: 0.6rem 0.75rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--rbs-hairline); }
.rbs-table tbody tr:last-child td { border-bottom: 0; }
.rbs-table thead th { font-size: 0.86rem; font-weight: 600; color: var(--rbs-th); line-height: 1.25; letter-spacing: 0; text-transform: none; background: transparent; }
.rbs-table thead th button {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; color: inherit; font: inherit;
}
.rbs-table thead th button::after {
  content: ""; width: 7px; height: 11px; opacity: 0.55;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 0 7 4H0zM3.5 11 0 7h7z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 0 7 4H0zM3.5 11 0 7h7z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.rbs-table thead th[aria-sort="ascending"] button::after {
  opacity: 1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 2 7 6H0z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 2 7 6H0z'/%3E%3C/svg%3E");
}
.rbs-table thead th[aria-sort="descending"] button::after {
  opacity: 1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 9 0 5h7z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 9 0 5h7z'/%3E%3C/svg%3E");
}
.rbs-table tbody tr:hover td { background: var(--rbs-row-hover); }
.rbs-table .rbs-col-num { text-align: center; }
.rbs-table thead .rbs-col-num button { justify-content: center; }
.rbs-table .rbs-col-date { white-space: nowrap; }
.rbs-col-name { min-width: 14rem; }
#rbs-table thead th.rbs-col-date { min-width: 7.5rem; }
.rbs-col-loc { white-space: nowrap; }
.rbs-col-name a { font-weight: 500; }
.rbs-ccn { display: block; font-size: 0.78rem; color: var(--pbj-text-subtle); font-variant-numeric: tabular-nums; margin-top: 1px; }
.rbs-chip {
  display: inline-block; padding: 0.18rem 0.65rem; border-radius: 4px; font-size: 0.82rem; font-weight: 500;
  background: var(--rbs-chip-bg); color: var(--rbs-chip-text); white-space: nowrap;
}
.rbs-ccn .rbs-chip { margin-left: 0.5rem; padding: 0.05rem 0.45rem; font-size: 0.74rem; vertical-align: 1px; }

/* CMS star ratings: one cell, OVR / STF / INS stacked (owner-profile treatment; star colors from pbj-site-layout.css). */
.rbs-rts { display: flex; flex-direction: column; gap: 0.1rem; line-height: 1.15; }
.rbs-rt { white-space: nowrap; display: flex; align-items: center; gap: 0.35rem; }
.rbs-rt__l { flex: 0 0 1.75rem; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; color: var(--pbj-text-subtle); }
.rbs-stars { font-size: 0.86rem; letter-spacing: 0.02em; line-height: 1; }
.rbs-stars .pbj-rating-stars { letter-spacing: inherit; }
.rbs-stars__off { color: var(--pbj-text-subtle); opacity: 0.7; }
.rbs-stars--none { font-size: 0.74rem; font-style: italic; letter-spacing: 0; color: var(--pbj-text-subtle); }
.rbs-rts > .rbs-muted { white-space: normal; }
.rbs-fn { font-size: 0.72rem; color: var(--pbj-text-subtle); border: 1px solid var(--rbs-hairline); border-radius: 3px; padding: 0 0.25rem; line-height: 1.35; cursor: help; }
#rbs-table td.rbs-col-ratings { min-width: 8.5rem; }
.rbs-col-ratings .rbs-th-l { display: block; margin-bottom: 0.15rem; }
.rbs-th-sorts { display: flex; gap: 0.75rem; font-weight: 500; font-size: 0.8rem; }
/* Rating sort buttons: arrows follow the active button, not the whole header. */
.rbs-table thead th.rbs-col-ratings[aria-sort] button::after {
  opacity: 0.55;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 0 7 4H0zM3.5 11 0 7h7z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 0 7 4H0zM3.5 11 0 7h7z'/%3E%3C/svg%3E");
}
.rbs-table thead th.rbs-col-ratings button[data-dir="asc"]::after {
  opacity: 1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 2 7 6H0z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 2 7 6H0z'/%3E%3C/svg%3E");
}
.rbs-table thead th.rbs-col-ratings button[data-dir="desc"]::after {
  opacity: 1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 9 0 5h7z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 11'%3E%3Cpath d='M3.5 9 0 5h7z'/%3E%3C/svg%3E");
}
.rbs-th-sorts button[data-dir] { color: var(--pbj-text); font-weight: 600; }
.rbs-legend { margin: 0; padding: 0.6rem 1rem 0; font-size: 0.82rem; color: var(--pbj-text-subtle); border-top: 1px solid var(--rbs-hairline); }
.rbs-empty { text-align: center !important; padding: 2rem !important; color: var(--pbj-text-subtle); }

.rbs-table-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem 1rem; flex-wrap: wrap; }
.rbs-range { margin: 0; font-size: 0.86rem; color: var(--pbj-text-subtle); font-variant-numeric: tabular-nums; }
.rbs-noscript { padding: 0.75rem 1rem; margin: 0; }

/* Sections */
.rbs-section { margin-top: 2.25rem; }
.rbs-h2 {
  font-family: "Vollkorn PBJ", "Vollkorn", Georgia, serif; font-weight: 700; font-size: 1.6rem; line-height: 1.2;
  margin: 0 0 0.35rem; color: var(--pbj-text); letter-spacing: -0.01em;
}
.rbs-h3 { font-size: 1rem; font-weight: 700; margin: 1.35rem 0 0.4rem; color: var(--pbj-text); }
.rbs-sub { margin: 0 0 0.85rem; color: var(--pbj-text-subtle); font-size: 0.95rem; }
.rbs-table--states td:first-child a { font-weight: 500; }
.rbs-stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.rbs-stats > div { padding: 1rem 1.1rem; border-right: 1px solid var(--rbs-hairline); }
.rbs-stats > div:last-child { border-right: 0; }
.rbs-stat { display: block; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pbj-text); }
.rbs-stat-l { display: block; font-size: 0.85rem; color: var(--pbj-text-subtle); }
.rbs-related { margin: 0.85rem 0 0; font-size: 0.92rem; color: var(--pbj-text-subtle); }

/* Methodology */
.rbs-method { margin-top: 2rem; }
.rbs-method > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.15rem; cursor: pointer; }
.rbs-method > summary::-webkit-details-marker { display: none; }
.rbs-method > summary .rbs-h2 { font-family: inherit; font-size: 1.1rem; margin: 0; }
.rbs-plus { position: relative; width: 14px; height: 14px; flex: 0 0 auto; }
.rbs-plus::before, .rbs-plus::after { content: ""; position: absolute; background: var(--pbj-text); border-radius: 1px; }
.rbs-plus::before { left: 0; right: 0; top: 6px; height: 2px; }
.rbs-plus::after { top: 0; bottom: 0; left: 6px; width: 2px; transition: transform var(--pbj-transition-fast, 150ms ease); }
.rbs-method[open] .rbs-plus::after { transform: scaleY(0); }
.rbs-method__body { padding: 0.25rem 1.15rem 1.25rem; border-top: 1px solid var(--rbs-hairline); line-height: 1.6; }
.rbs-method__body > * { max-width: 52rem; }
.rbs-method__body p, .rbs-method__body ul { margin: 0 0 0.75rem; }
.rbs-method__body ul { padding-left: 1.2rem; }
.rbs-method__body li { margin-bottom: 0.3rem; }
.rbs-table--dates th { font-weight: 600; white-space: nowrap; color: var(--pbj-text); font-size: 0.92rem; }
.rbs-table--dates td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rbs-table--dates td:last-child { color: var(--pbj-text-subtle); }
.rbs-sources code { font-family: "DM Mono PBJ", ui-monospace, monospace; font-size: 0.85em; }

/* Narrow screens */
@media (max-width: 760px) {
  .rbs-head__row { flex-direction: column; gap: 0.75rem; }
  .rbs-download { margin-top: 0; }
  .rbs-menu { left: 0; right: auto; min-width: min(290px, calc(100vw - 32px)); }
  .rbs-controls { gap: 0.6rem; }
  .rbs-select, .rbs-search { flex: 1 1 100%; max-width: none; }
  .rbs-pills { width: 100%; }
  .rbs-pill { padding: 0 0.9rem; font-size: 0.9rem; height: 36px; }
  .rbs-lede { font-size: 1.02rem; }
  .rbs-table th, .rbs-table td { padding: 0.55rem 0.7rem; }
  /* Keep the facility name visible while the row scrolls sideways. */
  #rbs-table th:first-child, #rbs-table td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--pbj-surface); min-width: 170px; max-width: 200px;
    box-shadow: 1px 0 0 var(--rbs-hairline);
  }
  .rbs-table-foot { justify-content: center; }
  .rbs-range { width: 100%; text-align: center; }
  .rbs-table--dates, .rbs-table--dates tbody { display: block; }
  .rbs-table--dates tr { display: grid; grid-template-columns: auto 1fr; column-gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rbs-hairline); }
  .rbs-table--dates tr:last-child { border-bottom: 0; }
  .rbs-table--dates th, .rbs-table--dates td { border: 0; padding: 0; }
  .rbs-table--dates td:last-child { grid-column: 1 / -1; margin-top: 0.2rem; font-size: 0.9rem; white-space: normal; }
  .rbs-stats { grid-template-columns: 1fr 1fr; }
  .rbs-stats > div:nth-child(2) { border-right: 0; }
  .rbs-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--rbs-hairline); }
}

/* Compact provenance and native disclosure controls; retain theme sizing. */
.rbs-source { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .85rem; }
.rbs-source a { white-space: nowrap; }
.rbs-head__row > div { min-width: 0; }
.rbs-disclosure-note { font-size: .875rem; font-weight: 400; color: var(--pbj-text-subtle); }
.rbs-method > summary { gap: 1rem; }
.rbs-plus { flex-shrink: 0; }
.rbs-method { scroll-margin-top: 1rem; }
