/* kpi */

/* Two-option view switch above the KPI section - toggles between
   #kpi-2021-2025 (existing content, default/active) and
   #transform-2030-kpi (new, currently-empty placeholder section). Same
   slider/knob toggle pattern already built for
   monitoring-results-impact's own Performance/Partnerships switch
   (.monitoring-impact-view-toggle__group/.view-toggle__btn/.selected) -
   track + sliding pill knob, uppercase, radius-22, 30px tall, min-width
   120px segments - re-scoped under kpi-prefixed classes (not the bare
   .view-toggle__btn/.selected names, which aren't scoped to their own
   component and would collide if both components ever share a page) and
   with the color scheme inverted: that component's track sits on a dark
   hero (transparent track, white knob), this one sits on a plain white
   page background (teal-bordered track, solid teal knob instead). */
.kpi-view-switch-wrap {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-bottom: var(--sp7);
  max-width: 1360px;
  margin-left: auto;
  margin-right: auto;
  justify-content: flex-end;
}

.kpi-view-switch {
  display: inline-flex;
  padding: var(--sp1);
  border-radius: var(--radius-22);
  background: var(--clr-white);
}

.kpi-view-switch__btn {
  all: unset;
  box-sizing: border-box;
  padding: 0 var(--sp6);
  background: transparent;
  border-radius: var(--radius-22);
  color: var(--clr-gray-dark);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  text-align: center;
  /* No text-transform - the case comes from the literal text in
     kpi.html.twig/kpi.stories.html itself ("2021 - 2025 KPIs"/"Transform
     2030 KPIs", already the intended case), not forced here. */
  white-space: nowrap;
  cursor: pointer;
  height: 30px;
  line-height: normal;
  min-width: 120px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* The "knob" - floats as a solid teal pill over the track on whichever
   side is active, same convention as monitoring-results-impact's own
   white knob. */
.kpi-view-switch__btn.is-active {
  background: var(--clr-primary);
  color: var(--clr-white);
}

.kpi-view-switch__btn:not(.is-active):hover {
  color: var(--clr-primary);
  background: transparent;
}

.kpi-view-switch__btn:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

/* Non-active view hidden entirely (not display via JS inline styles, so
   print/no-JS still falls back to showing both rather than hiding content
   with no way to reveal it). JS toggles this class on #kpi-2021-2025 /
   #transform-2030-kpi to match whichever .kpi-view-switch__btn is active. */
.kpi-view-section--hidden {
  display: none;
}

/* Real KPI indicator detail view - matches GFF_KPI_closeout_preview.html's
   own .kpi-head/.grid2/.fcv styling (that file is the authoritative
   source; GFF_KPI_section.html was a lossier earlier adaptation of it).
   See kpi.js renderKpiDetailResult()/renderKpiDetailHeader()/
   renderCriteriaBars()/renderKpiFcvMini(). */
.kpi-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp2) var(--sp3);
  margin-bottom: var(--sp7);
}

.kpi-detail-head:has(+ .kpi-detail-head__subtitle) {
  margin-top: 0;
  margin-bottom: var(--sp1);
}

/* .kpi-detail-head__title carries no typography of its own on purpose -
   the title also carries logical-model-results-title/titlr--sub2 (the
   SAME existing global classes the original, pre-redesign results title
   used), so its blue/bold styling matches the rest of the site exactly
   rather than a locally-guessed color/weight that could drift from it.
   flex:1 1 auto IS set here though - logical-model-results-title's own
   border-bottom (logic-model-responses.css) needs the full flex-item
   width to read as one continuous rule under the whole head row, not
   just stop under the title's own shrunk content width. */
.kpi-detail-head__title {
  flex: 1 1 auto;
  min-width: 0;
}

/* Now a sibling of .kpi-detail-head, not nested inside it - the head row
   is just "title ... hero value" (space-between); the subtitle reads as
   its own line underneath. Space before .kpi-detail-grid comes from the
   grid's own margin-top (below), not from here, so the gap stays correct
   whether or not a given KPI even has a description/subtitle. */
.kpi-detail-head__subtitle {
  margin-top: 0;
  font-size: var(--fs-14);
  color: var(--clr-gray-dark);
}

.kpi-detail-head__hero {
  text-align: right;
}

.kpi-detail-head__hero-num {
  font-size: var(--fs-50, 50px);
  font-weight: var(--fw-semibold);
  color: var(--clr-accent-teal);
  line-height: 1;
}

.kpi-detail-head__hero-cap {
  font-size: var(--fs-13);
  color: var(--clr-gray-medium);
}

@media (max-width: 767px) {
  .kpi-detail-head {
    align-items: flex-start;
  }

  .kpi-detail-head__hero {
    text-align: left;
  }
}

.kpi-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp6);
  align-items: start;
  margin-top: var(--sp6);
}

.kpi-detail-grid__col {
  width: 100%;
  overflow: hidden;
}

/* Criteria panel (left column) - a bordered card, a single value-colored
   bar per criterion (teal >=80%, amber otherwise - matches
   GFF_KPI_closeout_preview.html's hbars() color logic exactly). */
.kpi-criteria-panel {
  padding: var(--sp6);
  padding-top: var(--sp3);
  border: 1px solid var(--clr-gray-300);
  border-radius: var(--radius-8, 8px);
}

.kpi-criteria-panel__title,
.kpi-trend-chart__caption-title {
  font-size: var(--fs-15, 15px);
  font-weight: var(--fw-semibold);
  color: var(--clr-gray-dark);
}

.kpi-criteria-panel__subtitle {
  margin-bottom: var(--sp5);
  font-size: var(--fs-13);
  color: var(--clr-gray-medium);
}

/* Per-KPI FCV mini comparison (right column, below the trend chart) -
   matches GFF_KPI_closeout_preview.html's own fcvBlock(). */
.kpi-fcv-mini {
  margin-top: var(--sp5);
  padding-top: var(--sp5);
  border-top: 1px dashed var(--clr-gray-300);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp4);
}

.kpi-fcv-mini__rows {
  flex: 1 1 260px;
}

.kpi-fcv-mini__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp3);
  margin: var(--sp2) 0;
  font-size: var(--fs-13);
}

.kpi-fcv-mini__label {
  flex: 0 0 110px;
  font-weight: var(--fw-semibold);
  color: var(--clr-gray-dark);
}

.kpi-fcv-mini__track {
  /* min-width + flex-wrap on the row above: once there isn't room for
     the track alongside the 110px label, it wraps to its own line
     instead of being squeezed down to a sliver a few px wide. */
  flex: 1 1 120px;
  min-width: 120px;
  height: 10px;
  background: var(--clr-neutral-200, #e1e5ea);
  border-radius: 4px;
  overflow: hidden;
}

@media (max-width: 767px) {

  /* Label always on its own line here, track+value together on the next
     - forced outright rather than left to the organic flex-wrap trigger
     above (which only kicks in once the container gets very narrow), so
     the track reads as a comfortably wide bar throughout mobile, not
     just at the narrowest phone widths. */
  .kpi-fcv-mini__label {
    flex: 1 1 100%;
  }

  .kpi-fcv-mini__track {
    flex: 1 1 auto;
  }

  .kpi-fcv-mini__row {
    gap: 4px;
  }

  .kpi-fcv-mini__gap {
    display: none;
  }
}

.kpi-fcv-mini__fill {
  height: 100%;
  border-radius: 4px;
}

.kpi-fcv-mini__value {
  flex: 0 0 36px;
  text-align: right;
  font-weight: var(--fw-semibold);
  color: var(--clr-gray-dark);
}

.kpi-fcv-mini__gap {
  flex: 0 0 auto;
  text-align: center;
  min-width: 90px;
  padding: var(--sp2) var(--sp3);
  border-radius: var(--radius-8, 8px);
  background: #f8ecdb;
}

.kpi-fcv-mini__gap b {
  display: block;
  font-size: var(--fs-14);
  color: var(--clr-gray-dark);
}

.kpi-fcv-mini__gap small {
  font-size: var(--fs-12);
  color: var(--clr-gray-medium);
}

.kpi-fcv-mini__gap--ahead {
  background: #e2f0e0;
}

.kpi-fcv-mini__gap--par {
  background: var(--clr-neutral-200, #e1e5ea);
}

/* KPI Overview's own sub-items (data[0].tabs: overview/fy/fcv - see
   kpi.js) - each is its own independent sidebar selection nested under
   "KPI Overview" (matching how SD groups nest their own KPI indicators),
   not a tab-switcher and not stacked content in one panel. Every sub-item
   gets this same header block (title/description/key-message) above its
   own content - the existing chart (Overview), a new table (FY24-FY26), or
   a new chart (FCV). */
.kpi-subsection__title {
  margin: 0 0 var(--sp2);
  font-size: var(--fs-20);
  font-weight: var(--fw-bold);
  color: var(--clr-gray-dark);
}

.kpi-subsection__description {
  margin: 0 0 var(--sp5);
  font-size: var(--fs-14);
  line-height: 1.6;
  color: var(--clr-gray-dark);
}

/* When truncated, a .kpi-readmore-link gets inserted right after this -
   its own margin-top already provides the gap above "More"/"Less", same
   as .kpi-subsection__key-message-body (which has no margin-bottom of its
   own). Without this, the two margins stacked (15px + 8px) instead of
   collapsing, since .kpi-readmore-link is inline-block - gap read
   noticeably bigger here than after the key-message body. Only zeroed
   when the link is actually present, so the untruncated case's own
   bottom spacing (before whatever follows) is unaffected. */
.kpi-subsection__description:has(+ .kpi-readmore-link) {
  margin-bottom: 0;
}

/* Restores the trailing space description's own margin-bottom used to give
   (zeroed above) - scoped to this pair only, since .kpi-subsection__key-message
   already gets its trailing space from its own wrapper margin-bottom and
   doesn't need the link to carry it. */
.kpi-subsection__description+.kpi-readmore-link {
  margin-bottom: var(--sp5);
}

.kpi-subsection__key-message {
  margin: 0 0 var(--sp6);
  display: none;
}

.kpi-subsection__key-message-title {
  margin-bottom: var(--sp2);
  font-size: var(--fs-15);
  font-weight: var(--fw-bold);
  color: var(--clr-primary);
  text-transform: uppercase;
}

.kpi-subsection__key-message-body {
  font-size: var(--fs-14);
  line-height: 1.33;
  color: var(--clr-gray-dark);
}

.kpi-subsection__key-message-body p {
  margin: 0 0 var(--sp2);
  font-size: 14px;
}

.kpi-subsection__key-message-body p:last-child {
  margin-bottom: 0;
}

/* Shared by .kpi-subsection__key-message-body and .kpi-subsection__description
   - generic marker class, not tied to one element. */
.kpi-readmore-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kpi-readmore-link {
  display: inline-block;
  margin-top: var(--sp2);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--clr-primary);
  text-decoration: underline;
  cursor: pointer;
}

.kpi-readmore-link:hover {
  color: var(--section-clr3, var(--clr-blue));
  text-decoration: underline;
}

.kpi-subsection__footnote {
  margin-top: 0;
}

/* "Next FY (FY24-FY26)" comparison table */
.kpi-fy-table-wrap {
  overflow-x: auto;
}

@media (max-width: 991px) {
  .kpi-fy-table-wrap {
    max-height: 500px;
    overflow-y: auto;
  }
}

@media (max-width: 767px) {
  .kpi-fy-table-wrap {
    max-height: 400px;
    overflow-y: auto;
  }
}

.kpi-fy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-14);
}

/* Colors below match GFF_Compare_Indicators_KPI's own .fyt table
   (:root --brand/--brand2/--ink/--s2 literals there) - reusing this
   component's own existing navy/ink tokens (--clr-blue, explorer.css's
   --cxe-ink-strong) rather than copying that file's slightly different
   literal hex, so the table stays consistent with the rest of this
   component's own palette (e.g. .filter-aside's own --clr-blue bg). */
.kpi-fy-table thead th {
  background: var(--clr-blue, #21568C);
  color: var(--clr-white, #fff);
}

.kpi-fy-table thead th:not(:first-child, :nth-child(2)) {
  text-align: right;
}

/* .kpi-fy-table-wrap also carries .tbl-theme-default (sub-modules/tables/
   table.css, shared) - its own ".tbl-theme-default td{color:var(--td-clr);
   font-weight:var(--td-fw)}" is (class+tag) specificity, same or higher
   than a bare single .kpi-fy-table__* class selector, and loads before
   this file - every color/weight below is re-scoped under .kpi-fy-table
   (two classes) so it actually wins instead of silently losing to that
   shared default. */
.kpi-fy-table .kpi-fy-table__sd {
  color: var(--clr-blue, #21568C);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

.kpi-fy-table .kpi-fy-table__name-prefix {
  color: var(--cxe-ink-strong, #14243A);
  font-weight: var(--fw-semibold);
}

.kpi-fy-table__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.kpi-fy-table .kpi-fy-table__value--now {
  font-weight: var(--fw-bold, 700);
  color: var(--clr-blue, #21568C);
}

.kpi-fy-table .kpi-fy-table__change {
  font-weight: var(--fw-bold, 700);
  white-space: nowrap;
}

.kpi-fy-table .kpi-fy-table__change--up {
  color: #1fa29c;
}

.kpi-fy-table .kpi-fy-table__change--down {
  color: #e8606a;
}

.kpi-fy-table tbody tr:hover td {
  background: var(--clr-neutral-200, #F2F5F9);
}

/* A real KPI indicator's own FY trend (second chart below its existing bar
   chart) now lives in its own file, css/kpi-trend-chart.css. */

/* KPI Overview chart - value-band legend (matches GFF_KPI_section.html's
   own STATUS_BANDS/.ov-legend) - the bars themselves are colored by the
   same bands in kpi.js's bandColor(). */
.kpi-overview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp5);
  padding-bottom: var(--sp4);
  font-size: var(--fs-12);
  color: var(--clr-gray-medium);
}

.kpi-overview-legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp2);
  color: var(--clr-gray-dark);
}

.kpi-overview-legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* The "FCV" chart's own legend/row/bar styling moved to its own file,
   css/kpi-compare-chart.css, under generic `kpi-compare-*` class names
   (not tied to "fcv" - the chart itself is a generic two-series
   comparison layout, see that file's own header comment). */

/* .progress-bar-component / .progress-bar__type-1 are shared global
   classes (components/logic-model-responses/css/logic-model-responses.css)
   - overrides scoped under .kpi-component so they only apply inside this
   widget, not the other components reusing those same classes. */
.kpi-component .progress-bar-component {
  --label-width: 350px;
}

@media (max-width: 767px) {
  .kpi-component .progress-bar-component {
    /* 350px overflows a narrow column entirely - the grid's 1fr bar
       track gets squeezed to nothing and most of the criteria rows end
       up clipped out of view. */
    --label-width: 140px;
  }
}

.kpi-component .progress-bar-component .item-unit,
.kpi-component .progress-bar-component .item-label {
  font-size: var(--fs-13);
}

.kpi-component .progress-bar-component .item-unit {
  line-height: 13px;
}

.kpi-component .progress-bar__type-1 {
  grid-gap: var(--sp5);
}

.kpi-component .logical-model-results-title {
  margin-bottom: var(--sp7);
  padding-bottom: 5px;
  /* matches .cx-panel-title-row h3 (explorer.css) - same --cxe-* fallback
     reasoning as .logical-response-box above, this title isn't always
     rendered inside .cx-explorer. */
  font-size: var(--cxe-fs-title, var(--fs-20, 20px));
  line-height: 1.35;
  font-weight: 700;
  color: var(--cxe-ink, var(--clr-gray-dark, #4D4D4D));
}

.kpi-component .kpi-detail-head .logical-model-results-title {
  margin-bottom: 0;
}

.kpi-component .legend-section+.logical-response-content-wrap {
  margin-top: 0;
}

.kpi-component.no-legends .logical-response-content-wrap {
  margin-top: 0;
}

.kpi-component .kpi-criteria-panel .legend-section {
  display: none;
}

/* logic-model-responses.css's own .logical-response-content-wrap caps the
   Overview chart (and every other result panel here) at max-height:450px
   with its own internal overflow:auto scrollbar - scoped override, not a
   change to that shared file (its other consumer still gets the capped/
   scrollable behavior unchanged). The chart renders at its own full
   height instead, no inner scroll.
   Both axes, not just overflow-y: per the CSS overflow spec, if one axis
   is 'visible' and the other isn't, the UA computes the 'visible' one as
   'auto' instead (confirmed live - overflow-y kept resolving to auto even
   with !important, as long as overflow-x stayed auto from the shared base
   rule). kpi.js's own checkOverflow() horizontal check (scrollWidth >
   clientWidth) still runs against this element regardless - toggles
   is-scrollable-x/no-scroll-x classes, but neither one actually sets its
   own overflow-x anywhere in this codebase (grep confirmed - it was only
   ever riding on the shared shorthand this rule now opts out of), so
   nothing is actually lost here: the Overview chart was never a
   realistic horizontal-overflow case to begin with.
   !important: this element also carries .site-scrollbar (base.css,
   overflow:auto) and, once kpi.js's checkOverflow() sees max-height:none,
   adds .no-scroll-y (logic-model-responses.css, overflow-y:hidden) - both
   tie this rule's specificity exactly; !important removes the ambiguity
   outright rather than relying on source-order luck. */
.kpi-component .logical-response-content-wrap {
  max-height: none;
  overflow: visible !important;
}

.kpi-component .logical-response-content-wrap.is-scrollable {
  width: 100%;
}

.kpi-component .kpi-fy-table th,
.kpi-component .kpi-fy-table td {
  padding-top: var(--sp5);
  padding-bottom: var(--sp5);
}

.kpi-component .logical-response-box {
  /* --cxe-* are .cx-explorer's own custom properties (explorer.css) -
     inherited fine when this renders inside cross-country-analytics'
     embedded instance (.cross-country-kpi is a .cx-explorer descendant),
     but this component also runs standalone (kpi.stories.html, home
     page) with no such ancestor - fallbacks mirror --cxe-panel-pad/-line/
     -radius-panel's own literal values so these still show up there. */
  padding: var(--cxe-panel-pad, 24px);
  border: 1px solid var(--cxe-line, var(--clr-gray-light, #DBDBDB));
  border-radius: var(--cxe-radius-panel, 0 24px 0 24px);
}

/* No longer the scroll container or sticky element (see .filter-aside
   below, which is now both, matching cx-rail's own single-element
   .cx-rail exactly) - just a plain passthrough wrapper. */
.kpi-component .aside-category-inner {
  position: static;
  max-height: none;
  overflow: visible;
}

/* ============================================================
   Left filter: cx-acc/cx-acc-h (label span + .ic toggle span)/cx-acc-b/
   cx-radio, same classes and structure as cross-country-analytics' own
   .cx-rail accordion (components/cross-country-analytics/explorer/js/
   explorer.js's renderRail()) - js/kpi.js's generated markup uses these
   directly now (no elements/accordion/accordion.css classes anywhere;
   window.accordionUI replaced by this component's own
   initFilterAccordionToggle(), see kpi.js). Rules below copied property-
   for-property from explorer.css's own .cx-rail/.cx-acc/.cx-acc-h/
   .cx-acc-b/.cx-radio/.ic, scoped under .kpi-component so none of this
   reaches elements/accordion's other consumer (logic-model-responses) or
   explorer.css's own .cx-explorer instance. Covers both the 2021-2025
   view's own .filter-aside and the Transform 2030 view's JS-rendered one
   (same cx-* classes either way). */
.kpi-component .filter-aside {
  background: var(--clr-blue, #21568C);
  color: var(--clr-white);
  border-color: transparent;
  border-radius: 20px 0 20px 0;
  /* Top/bottom only - cx-rail-scroll (below) keeps its own left/right
     inset, but not top/bottom anymore, so the scrollbar's own scrollHeight
     reflects real content only, not padding it had to scroll past on
     either end. This outer, non-scrolling box provides that same visual
     inset instead - a single child (cx-rail-scroll) filling its content
     box, so padding here reads identically either way. */
  padding-top: 22px;
  padding-bottom: 22px;
}

/* cx-rail-scroll: the actual overflow:auto/scrollbar element for the
   2021-2025 rail (kpi.html.twig/kpi.stories.html) - split out from
   .filter-aside above on purpose. A native scrollbar painted on the SAME
   element as a border-radius corner doesn't clip cleanly in Chromium (the
   scrollbar sits flush against the border edge, same place the radius
   tries to round away) - reported bug: a page-background notch showing
   through the rounded top-right corner, right where the scrollbar's top
   end met the curve. Moving the actual scrolling one level in and having
   .filter-aside clip it via overflow:hidden (see #kpi-2021-2025 .filter-
   aside below) fixes this structurally rather than papering over it.
   Left/right padding only - top/bottom moved to .filter-aside above (see
   its own comment). */
.kpi-component .filter-aside .cx-rail-scroll {
  padding: 0 22px;
}

/* Rail header (.cx-rh/.cx-rh-top/.cx-count/.cx-rsub/.cx-sbox/.cx-search) -
   title + dynamic count/subtitle + search box, copied property-for-
   property from explorer.css's own versions. Count/subtitle text and the
   search filter's own behavior are js/kpi.js's job (see
   initFilterSearch()), not CSS. */
.kpi-component .filter-aside .cx-rh {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.26);
}

.kpi-component .filter-aside .cx-rh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi-component .filter-aside .cx-rh-top h2 {
  margin: 0;
  font-size: var(--fs-18, 18px);
  line-height: 1.35;
  font-weight: 700;
  color: var(--clr-white);
}

.kpi-component .filter-aside .cx-rsub {
  margin: 0;
  font-size: var(--fs-13, 13px);
  color: rgba(255, 255, 255, 0.92);
}

.kpi-component .filter-aside .cx-count {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-blue, #21568C);
  color: var(--clr-white);
  box-shadow: 0 6px 14px rgba(13, 30, 55, 0.14), inset 0 0 0 999px rgba(6, 26, 56, 0.42);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  line-height: 2;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
}

.kpi-component .filter-aside .cx-sbox {
  position: relative;
  margin-top: 6px;
}

.kpi-component .filter-aside .cx-sbox::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -8px;
  border: 2px solid var(--clr-gray-dark, #4D4D4D);
  border-radius: 50%;
  box-sizing: content-box;
}

.kpi-component .filter-aside .cx-sbox::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 50%;
  width: 6px;
  height: 2px;
  margin-top: 4px;
  background: var(--clr-gray-dark, #4D4D4D);
  transform: rotate(45deg);
  box-sizing: content-box;
}

.kpi-component .filter-aside .cx-search {
  width: 100%;
  min-height: 38px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--clr-gray-light, #DBDBDB);
  border-radius: 20px;
  font: inherit;
  font-size: var(--fs-14, 14px);
  color: var(--clr-gray-dark, #4D4D4D);
  background: var(--clr-white);
  box-sizing: border-box;
}

.kpi-component .filter-aside .cx-search::placeholder {
  color: var(--clr-gray-600, #767676);
}

.kpi-component .filter-aside .cx-none {
  font-size: var(--fs-13, 13px);
  padding: 10px 4px;
  color: var(--clr-white);
}

/* Search-hidden items/groups (see initFilterSearch() in kpi.js) */
.kpi-component .filter-aside [data-search-hidden="true"] {
  display: none !important;
}

/* Sticky + the actual scrolling - cx-rail's own .cx-rail is one element
   doing position:sticky/overflow/max-height/padding all at once;
   previously split here across this element (padding only) and
   .aside-category-inner (sticky/overflow/max-height, from elements/
   accordion/accordion.css), which put the scrollbar INSIDE this
   element's own padding instead of flush at its outer edge like cx-
   rail's own scrollbar.
   min-width:992px guard, same reasoning as the grid-template-columns
   override above: below 991px .aside-category-section (a second class
   on this same element) switches to position:absolute for the off-canvas
   Filter drawer (logic-model-responses-max-991.css) - sticky/a height
   cap here would fight that positioning instead of stacking with it. */
@media (min-width: 1025px) {
  .kpi-component .filter-aside {
    /* Grid parent (.aside-content-layout, layouts/col-layout/col-layout.css)
       defaults to align-items:stretch - without this, .filter-aside
       stretches to the FULL grid row height (matching the tall results
       panel), and that stretched+sticky+overflow:auto combo renders a
       stray duplicate scrollbar (arrows included) at the item's un-stuck
       native top, above the visible rail - reported bug, screenshot showed
       it floating in the gutter above the blue box. .t2030-kpi__nav
       (kpi-transform-2030.css) already carries this same fix with the
       identical reasoning; this rail just hadn't been given it yet. */
    align-self: start;
    position: sticky;
    top: calc(var(--header-height, 70px) + 20px);
    max-height: calc(100vh - var(--header-height, 70px) - 20px - 20px);
    /* elements/accordion/accordion.css's own .aside-category-section
       (shared with logic-model-responses) sets overflow:unset !important,
       unscoped - this wrapper also carries that class (see kpi.html.twig/
       kpi.stories.html, reused on purpose for the shared off-canvas Filter
       drawer CSS in logic-model-responses-max-991/767.css). !important
       required to beat it; .kpi-component .filter-aside still outranks
       accordion.css's single-class selector once both are !important. */
    overflow: auto !important;
  }

  /* 2021-2025 rail only (#kpi-2021-2025 - NOT the shared .kpi-component
     .filter-aside rule above, which Transform 2030's own nav
     (.t2030-kpi__nav) also matches): overflow:hidden here, so the actual
     scrolling - and the native-scrollbar/border-radius clipping conflict
     that comes with it (see .cx-rail-scroll above) - moves to the inner
     .cx-rail-scroll div instead. Scoped by ID rather than widened to every
     .filter-aside on purpose - Transform 2030's own nav already has a
     SEPARATE inner scroll div (.t2030-kpi__nav-inner, kpi-transform-
     2030.css) sized off a DIFFERENT max-height budget than this one;
     forcing its outer to overflow:hidden too, unverified, risks silently
     clipping part of that nav before its own scrollbar could ever reach
     it. Left untouched - not the component reported broken. */
  #kpi-2021-2025 .filter-aside {
    /* display:flex + the child's flex:1 1 auto/min-height:0 below, NOT
       height:100% on the child - .filter-aside only ever declares
       max-height (never a plain height), and CSS percentage-height
       resolution requires the CONTAINING BLOCK to have an explicit height,
       not just max-height (spec: an unspecified/content-based height
       resolves child height:100% to auto, even once max-height visually
       clamps the box). height:100% on .cx-rail-scroll silently did
       nothing - it just grew to fit all content, outer's overflow:hidden
       then clipped the excess with NO scrollbar to reach it (reported:
       scrollbar gone entirely). Flexbox's own sizing algorithm doesn't
       have that restriction - a flex item with min-height:0 correctly
       fills whatever space the (still max-height-capped) flex container
       actually has. */
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
  }

  #kpi-2021-2025 .filter-aside .cx-rail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    box-sizing: border-box;
  }
}

/* Sidebar/content grid - exact copy of cx-rail's own .cx-main
   (calc((100% - 72px) / 4) minmax(0, 1fr), gap 24px), replacing
   .aside-content-layout's own minmax(var(--aside-min-width), 1fr) 3fr
   (layouts/col-layout/col-layout.css, shared with logic-model-responses -
   scoped to .kpi-component so that file and its other consumer are
   untouched). Only the GRID TRACK WIDTHS change here - the results panel
   on the right (.layout-content/.logical-response-box and everything
   inside it: stats, charts, tables) is untouched, it just now renders
   into a differently-sized box, same as it already resizes for any
   viewport width.
   min-width:1025px guard: .logical-response-grid's own mobile override
   (logic-model-responses-max-991.css, grid-template-columns:1fr) drives
   the off-canvas Filter-drawer stacking below 992px natively, and the
   block right after this one extends that same drawer through 1024px
   for kpi specifically - a plain unscoped rule here would have higher
   specificity than either of those and silently win over them, breaking
   the drawer at both tiers. */
@media (min-width: 1025px) {
  .kpi-component .layout-wrapper {
    --gap: 24px;
  }

  .kpi-component .aside-content-layout {
    grid-template-columns: calc((100% - 72px) / 4) minmax(0, 1fr);
  }
}

/* Extends the off-canvas Filter drawer (natively <=991px only, logic-
   model-responses-max-991.css, gated by that file's own <link
   media="(max-width: 991px)">) through 1024px for kpi specifically -
   explicit request, not a sitewide change (that file has other
   consumers; a band scoped to .kpi-component here instead of editing it
   directly). Re-declares that file's own filter-btn/off-canvas rules
   property-for-property, .kpi-component-scoped, for exactly the 992-
   1024px gap its own query doesn't reach. Image paths are relative to
   THIS file's own location (components/kpi/css/), not that one's -
   components/logic-model-responses/img/ is two levels up from here. */
@media (min-width: 992px) and (max-width: 1024px) {
  .kpi-component .logical-model-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: url("/themes/custom/gff/templates/components/kpi/css/../../logic-model-responses/img/filter_icon_hover.svg") no-repeat center center;
    background-size: contain;
    font-size: 0;
    border: none;
  }

  .kpi-component.filter-show .logical-model-filter-btn {
    background: url("/themes/custom/gff/templates/components/kpi/css/../../logic-model-responses/img/filter_icon_with_close_hover.svg") no-repeat center center;
    background-size: contain;
  }

  .kpi-component .logical-response-grid {
    grid-template-columns: 1fr;
    position: relative;
  }

  .kpi-component .logical-response-grid .aside-category-section {
    position: absolute;
    left: -120%;
    top: 0;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0 6px 0px rgba(0, 0, 0, 0.2);
    min-height: 100%;
    transition: left 0.3s linear 0s;
    z-index: 1;
  }

  .kpi-component.filter-show .logical-response-grid .aside-category-section {
    left: 0;
  }
}

/* .cx-acc - divider between items. No top border on the first one (cx-
   rail has none either - just this bottom border, repeated); accordion.css
   would otherwise add one via its shared .accordion--item:first-child
   rule (kept for logic-model-responses, its other consumer). */
.kpi-component .filter-aside .cx-acc {
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.kpi-component .filter-aside .cx-acc:first-child {
  border-top: none;
}

.kpi-component .filter-aside .cx-acc-h {
  /* Real Drupal site has a sitewide `body button { height: 34px }`
     (components/common/css/button.css, same rule cross-country-
     analytics' own gff/cx_common already works around for its identical
     .cx-acc-h/.cx-radio) - without this, every header here gets squashed
     to 34px regardless of its own padding/line-wrapped label, same bug,
     different component. */
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-14);
  font-weight: 600;
  line-height: 1.4;
  color: var(--clr-white);
  padding: 12px 4px 12px 0;
  cursor: pointer;
  text-decoration: none;
}

.kpi-component .filter-aside .cx-acc-h > span:first-child {
  border-bottom: 2pt solid transparent;
  padding-bottom: 2px;
}

.kpi-component .filter-aside .cx-acc-h:hover > span:first-child {
  color: var(--clr-yellow-orange, #F8B323);
}

.kpi-component .filter-aside .cx-acc.active .cx-acc-h > span:first-child {
  color: var(--clr-yellow-orange, #F8B323);
}

/* .ic - the +/- toggle, drawn from 2 plain bars (currentColor, no image
   asset) same as cx-rail's own. */
.kpi-component .filter-aside .cx-acc-h .ic {
  flex: none;
  position: relative;
  width: 14px;
  height: 14px;
}

.kpi-component .filter-aside .cx-acc-h .ic::before,
.kpi-component .filter-aside .cx-acc-h .ic::after {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 2px;
  background: currentColor;
}

.kpi-component .filter-aside .cx-acc-h .ic::after {
  transform: rotate(90deg);
}

.kpi-component .filter-aside .cx-acc.active .cx-acc-h .ic {
  color: var(--clr-yellow-orange, #F8B323);
}

.kpi-component .filter-aside .cx-acc.active .cx-acc-h .ic::after {
  display: none;
}

/* .cx-acc-b - the open panel body. Only pads top/bottom; each .cx-radio
   row below carries its own left/right padding instead, so a hovered/
   selected row's highlight spans the full card width edge-to-edge rather
   than stopping at the body's own inset. */
.kpi-component .filter-aside .cx-acc-b {
  /* explorer.css's own .cx-acc-b (cross-country-analytics' rail, see
     components/cross-country-analytics/explorer/css/explorer.css) is
     unscoped and defaults to display:none, only reversed by its own
     .cx-acc.is-open - a state this component never sets (uses .active
     instead, open/closed here already fully controlled by the inline
     style on the parent .cx-acc-collapse, see kpi.js's setOpen()).
     Harmless on pages without explorer.css; required on pages (e.g.
     cross-country-analytics) that embed both components. */
  display: block;
  background: var(--clr-white);
  padding: 8px 0;
  margin: 0 0 14px;
  max-height: 260px;
  overflow: auto;
  border-top-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.kpi-component .filter-aside .cx-radio {
  /* Same sitewide `body button { height: 34px }` fix as .cx-acc-h above -
     a real <button> too, same component library, same bug otherwise. */
  height: auto;
  display: block;
  box-sizing: border-box;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 500;
  line-height: 1.45;
  color: var(--clr-gray-dark, #4D4D4D);
  padding: 8px 15px;
  min-height: 32px;
  cursor: pointer;
  text-decoration: none;
}

.kpi-component .filter-aside .cx-radio:hover,
.kpi-component .filter-aside .cx-radio.selected-option {
  background: #F2F2F2;
  color: #00413C;
}

.kpi-component .filter-aside .cx-radio.selected-option {
  font-weight: 700;
}

.kpi-component .filter-aside .cx-radio:focus-visible {
  outline: 3px solid var(--clr-blue, #21568C);
  outline-offset: -3px;
}

/* Info icon (js/kpi.js's .data-info-icon.info-icon2, kept in place per
   explicit request - not removed, just made visible) - its source SVGs
   (elements/icons/img/info-icons/info_icon2*.svg) are solid #4d4d4d,
   same invisible-on-navy problem the old accordion icon had, same fix.
   Reverted on :hover specifically because this element's OWN :after is
   the popover bubble (.data-info-icon:after, a separate always-white/
   dark-text box per elements/icons/icons.css) - filter applies to an
   element's pseudo-elements too, so without this the popover would get
   inverted right as it opens. The glyph itself briefly reverting to grey
   under the cursor for that same moment is harmless - it's covered by
   the pointer anyway. */
.kpi-component .filter-aside .data-info-icon {
  filter: brightness(0) invert(1);
}

.kpi-component .filter-aside .data-info-icon:hover {
  filter: none;
}

@media (max-width: 991px) {
  .kpi-component .logical-response-grid .aside-category-section {
    min-height: auto;
    top: 0 !important;
  }
}

/* ============================================================
   TEMPORARY - hidden for now, kept as its own block (not deleted/merged
   into the rules above) so it's easy to find and re-enable later. Nothing
   else here depends on these 3 classes being hidden.
   ============================================================ */
.kpi-subsection__title,
.kpi-subsection__description,
.kpi-detail-head__subtitle {
  display: none;
}

/* Page title/sub-title layout (normal-content-module.css) defaults to a
   constrained width tuned for prose pages - this component's own header
   needs the full available width instead. */
.kpi-component .page-title-wrapper .page-sub-title {
  max-width: none;
}

.kpi-component .vr-center-align {
  --content-mw: 1000px;
  --title-mw: none;
}

/* pointer-events:none on .progress-chart .tooltip-block was reverted -
   it made the tooltip's own hover/JS state flaky (sometimes not showing,
   sometimes closing while the pointer was still over it), since the
   element couldn't receive the mouseenter/mouseleave events that drive
   .open/.is-visible. Fixed the actual symptom (hovering the bar showing
   the wrong cursor) differently instead: plain cursor: default on the
   bar itself, not an events bypass on the tooltip. */
.progress-field .progress-bar__outer {
  cursor: default;
}

.progress-chart .tooltip-block {
  cursor: default;
}

/* Same reasoning as .progress-chart .tooltip-block above - the label sits
   on top of the bar it's reporting on, and without this it was eating
   the hover meant for that bar instead of passing it through. */
.progress-field .progress-data-label {
  pointer-events: none;
}
