/* Reports shell (GRW-20). Light only. Brand values come from /css/rds-tokens.css;
   the --rp-* roles below are chart and text roles measured for contrast in the rendered page.
   Each report is one fixed 1600 by 900 page (.canvas) that app.js scales to fit as one piece.
   Only a phone (under 600px wide, never inside a frame) gets the stacked column (html.is-stacked).
   A click on a mark filters every other visual; the clicked visual dims its other marks. */

:root {
  color-scheme: light;
  --rp-top-h: 52px;
  --rp-side-w: 200px;

  /* text roles: the token muted grey measures under 4.5:1 on white, so small text uses this step */
  --rp-ink-3: #5f6e6c;

  /* chart roles */
  --rp-current: var(--rds-teal);  /* the year being read */
  --rp-prior: #7f8c8a;            /* the comparison year, 3.5:1 on white */
  --rp-other: #8a9694;
  --rp-grid: #e6ebea;
  --rp-base: #c3ccca;
  /* Categorical order: the brand green, gold and blue, then a tint or shade of the same three hues.
     Run through the dataviz validator on white (scripts/validate_palette.js, light mode): lightness band pass,
     color-blind separation pass (worst neighbours 15.3), normal-vision floor pass (worst neighbours 21.8).
     Two notes from the same run: the brand green sits under the chroma floor (0.079 against 0.10), which is
     the brand value and stays; gold and the two light tints are under 3:1 on white, so every chart has a legend
     or direct labels and a table view. Neighbours never share a hue. */
  --rp-s1: #2c5e3b;
  --rp-s2: #c59b27;
  --rp-s3: #25548f;
  --rp-s4: #6fbf86;
  --rp-s5: #8a6a12;
  --rp-s6: #5b9aed;
  --rp-s7: #3f8f5c;
  --rp-s8: #d9ae3c;

  /* a gain and a loss as fills: validated as a pair (color-blind separation 11.4), and always shown with a sign */
  --rp-up: #3f8f5c;
  --rp-down: #9a2650;

  /* the one thing on the page that must pop: the selected mark and the filter it sets */
  --rp-pop: var(--rds-pop);
  --rp-pop-bg: #e6edf6;

  --rp-edge: #9cc4a6;             /* a pressed or open metric card */
  --rp-pos-bg: #e4f4ef;
  --rp-neg-bg: #f9e8ee;
  --rp-active: #e9f0eb;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
html.is-locked { overflow: hidden; }
/* the fixed page fits the window, so the window itself never scrolls */
html.is-canvas { overflow: hidden; scrollbar-gutter: auto; }
.is-canvas .layout { min-height: 0; }
body {
  margin: 0;
  background: var(--rds-bg);
  color: var(--rds-text);
  font-family: var(--rds-font);
  font-size: 15px;
  line-height: 1.5;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, p { margin: 0; }
button, select { font: inherit; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--rds-teal); outline-offset: 2px; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--rds-surface); color: var(--rds-ink);
  padding: 0 14px; line-height: 44px; border-radius: 8px; box-shadow: var(--rds-sh-2); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 8px; }
.noscript { padding: 24px; max-width: 60ch; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--rp-top-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--rds-ink);
}
.topbar-in {
  height: var(--rp-top-h); display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
}
.wordmark {
  color: #fff; font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  display: inline-block; line-height: 44px;
}
.wordmark span { color: var(--rds-gold); }
.book {
  position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 8px;
  background: var(--rds-gold); color: var(--rds-ink); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap;
  transition: background-color .15s;
}
.book::before { content: ''; position: absolute; inset: -4px -2px; } /* 44px hit area around a 36px pill */
.book:hover { background: #d9ae3c; }
.topbar :focus-visible { outline-color: var(--rds-gold); outline-offset: 3px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: var(--rp-side-w) minmax(0, 1fr); min-height: calc(100vh - var(--rp-top-h)); }
.side { background: var(--rds-surface); border-right: 1px solid var(--rds-line); padding: 0 12px; }
.side-nav { position: sticky; top: var(--rp-top-h); max-height: calc(100vh - var(--rp-top-h)); overflow-y: auto; padding: 22px 0; }
.org { font-weight: 700; color: var(--rds-ink); font-size: 1rem; padding: 0 12px 16px; margin-bottom: 14px; border-bottom: 1px solid var(--rds-line); }
.grp { font-size: .8rem; font-weight: 600; color: var(--rp-ink-3); padding: 0 12px; margin-bottom: 6px; }
.side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px;
  color: var(--rds-text-2); text-decoration: none; font-weight: 500; font-size: .94rem; transition: background-color .15s, color .15s;
}
.nav-link:hover { background: var(--rds-surface-2); color: var(--rds-ink); }
.nav-link[aria-current="page"] { background: var(--rp-active); color: var(--rds-ink); font-weight: 600; }
.mnav { display: none; }

.main { min-width: 0; }
.main:focus { outline: none; }

/* ---------- the fixed page ---------- */
.stage { display: grid; place-items: start center; padding: 16px; overflow: hidden; }
.is-embed .stage { place-items: center; padding: 0; }
.fit { position: relative; overflow: hidden; }
.canvas {
  width: 1600px; height: 900px; transform-origin: 0 0;
  display: flex; flex-direction: column; gap: 14px; padding: 20px 24px 24px;
  background: var(--rds-bg);
}

/* ---------- title row ---------- */
.c-head { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 32px; }
.c-titles { min-width: 0; }
.title-row { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; }
.title { font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.02em; color: var(--rds-ink); font-weight: 700; text-wrap: balance; }
.updated { color: var(--rp-ink-3); font-size: .875rem; white-space: nowrap; }
.question { margin-top: 5px; color: var(--rds-text-2); font-size: 1rem; text-wrap: pretty; }
.hint { color: var(--rp-ink-3); font-size: .9rem; margin-left: 6px; }
.c-tools { flex: none; display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; justify-content: flex-end; }
.period {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--rds-surface); border: 1px solid var(--rds-line-strong); border-radius: 10px;
}
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--rds-ink); cursor: pointer;
  transition: background-color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--rds-surface-2); }
.icon-btn:disabled { color: #b4bebc; cursor: not-allowed; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.select-wrap { position: relative; display: inline-flex; }
.select {
  appearance: none; -webkit-appearance: none; height: 36px; padding: 0 30px 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--rds-ink); font-weight: 600; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23172C2D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select:hover { background-color: var(--rds-surface-2); }
.year-select { font-variant-numeric: tabular-nums; }
.compare-note { color: var(--rds-text-2); font-size: .92rem; }
.compare-note strong { color: var(--rds-ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--rds-surface-2); border-radius: 9px; flex: none; }
.seg[hidden] { display: none; }
.seg button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent;
  color: var(--rds-text-2); font-size: .84rem; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s;
}
.seg button:hover { color: var(--rds-ink); }
.seg button[aria-pressed="true"] { background: var(--rds-surface); color: var(--rds-ink); box-shadow: var(--rds-sh-1); }
.seg-sm button { height: 26px; padding: 0 10px; font-size: .8rem; }

/* ---------- main metrics ---------- */
.dash { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.dash[hidden] { display: none; }
.metrics { flex: none; }
.kpis { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 14px; }
.kpi-cell { min-width: 0; display: flex; }
/* KPI cards carry the only resting shadow on the page: they are the buttons that open the drawer */
.kpi {
  width: 100%; text-align: left; display: flex; flex-direction: column; gap: 5px;
  padding: 13px 16px 12px; border: 1px solid var(--rds-line); border-radius: 14px;
  background: var(--rds-surface); color: inherit; cursor: pointer; box-shadow: var(--rds-sh-1);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.kpi:hover { border-color: var(--rds-line-strong); box-shadow: var(--rds-sh-2); }
.kpi:active, .kpi[aria-expanded="true"] { background: var(--rds-surface-2); border-color: var(--rp-edge); }
.kpi.is-big .kpi-value { font-size: 2.7rem; }
/* a metric card taller than its text (a rail down the side of the page) keeps label, value and change together */
.page-grid .kpi { justify-content: center; }
.page-grid .kpi-value { margin-top: 0; }
.kpi:focus-visible { outline-offset: 3px; }
.kpi-label { font-size: .88rem; font-weight: 500; color: var(--rds-text-2); line-height: 1.3; }
.kpi-value {
  font-size: 1.95rem; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em;
  color: var(--rds-ink); font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: auto;
}
.kpi-change { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .86rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-change .vs { font-weight: 400; color: var(--rp-ink-3); }
.is-good { color: var(--rds-pos-ink); }
.is-bad { color: var(--rds-neg-ink); }
.is-flat { color: var(--rds-text-2); }
.arr { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* KPI tooltip: explains the number; dark like the reference, with the prior-year figure the card leaves out */
.kpi-tip {
  position: absolute; z-index: 60; max-width: 280px; padding: 12px 14px; border-radius: 10px;
  background: var(--rds-ink); color: #fff; font-size: .86rem; line-height: 1.45; box-shadow: var(--rds-sh-2);
  transform-origin: var(--arrow-x, 50%) 100%;
}
.kpi-tip.is-below { transform-origin: var(--arrow-x, 50%) 0; }
.kpi-tip::after {
  content: ''; position: absolute; top: 100%; left: var(--arrow-x, 50%); transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--rds-ink);
}
.kpi-tip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--rds-ink); }
.kt-title { font-weight: 650; margin-bottom: 3px; }
.kt-text { color: #dbe3e1; }
.kt-prior { margin-top: 8px; color: #dbe3e1; font-variant-numeric: tabular-nums; }
.kt-prior strong { color: #fff; font-weight: 650; }

/* ---------- the page grid of a core report: five equal columns, one gap, cards and metric cards placed by line ---------- */
.dash.page-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.page-grid > .kpi-cell, .page-grid > .card { min-height: 0; }

/* ---------- visuals: groups of cards that share the rest of the page ---------- */
.sections { flex: 1; min-height: 0; display: flex; gap: 14px; }
.sections.dir-rows { flex-direction: column; }
.vgrp { flex: var(--g, 1) 1 0; min-width: 0; min-height: 0; display: flex; gap: 14px; }
.dir-cols > .vgrp { flex-direction: column; }
/* On the metric cards' columns: a block that spans g of the n columns is g columns wide plus the gaps between
   them, so its edges land exactly on the edges of the cards above. */
.sections.on-grid.dir-cols > .vgrp,
.dir-rows > .vgrp.on-grid > .card { flex: 0 0 calc((100% - (var(--n) - 1) * 14px) / var(--n) * var(--g) + (var(--g) - 1) * 14px); }
.card {
  flex: var(--g, 1) 1 0; min-width: 0; min-height: 0; overflow: hidden; padding: 14px 18px 14px;
  background: var(--rds-surface); border: 1px solid var(--rds-line); border-radius: 14px; display: flex; flex-direction: column;
}
.card > .card-body { flex: 1 1 0; min-height: 0; }
/* a donut beside a taller card sits in the middle of its space instead of leaving a gap below */
.card.type-donut > .card-body { display: flex; flex-direction: column; justify-content: center; }
.card-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-titles { min-width: 0; }
.card-title { font-size: 1rem; font-weight: 650; color: var(--rds-ink); line-height: 1.3; text-wrap: balance; }
.card-sub { margin-top: 2px; color: var(--rp-ink-3); font-size: .85rem; line-height: 1.35; text-wrap: pretty; }
.card-tools { flex: none; display: flex; align-items: center; gap: 8px; }
/* three or more tabs take their own line under the title, so the question never wraps into a narrow column */
.card.has-tabs .card-head { flex-direction: column; gap: 8px; }
.card.has-tabs .card-tools { align-self: stretch; justify-content: space-between; }
.chart { position: relative; min-width: 0; }

/* ---------- cross-filter ---------- */
.is-pick { cursor: pointer; }
.fchip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 420px; padding: 3px 4px 3px 12px; border-radius: 999px;
  background: var(--rp-pop-bg); border: 1px solid var(--rp-pop); color: var(--rds-text-2); font-size: .88rem; white-space: nowrap;
}
.fchip[hidden] { display: none; }
.fchip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--rds-ink); font-weight: 650; }
.fchip-clear {
  flex: none; height: 28px; margin-left: 6px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--rds-surface);
  color: var(--rp-pop); font-size: .84rem; font-weight: 600; cursor: pointer; box-shadow: var(--rds-sh-1);
}
.fchip-clear:hover { color: var(--rds-ink); }
.marker, .cell { transition: opacity .15s; }
.marker.is-dim { opacity: .28; }
/* the selected mark is the one place the pop blue appears; a mark made of several series colors keeps
   them and gets a blue guide or ring instead */
.marker.is-sel { stroke: var(--rp-pop) !important; stroke-width: 2.5; }
.cell.is-dim { opacity: .3; }
.sel-line { stroke: var(--rp-pop); stroke-width: 2; stroke-dasharray: 3 3; }
.bar-row.is-sel .bar, .hbar.is-sel, .vcol.is-sel .bar, .dbar.is-sel .bar, .sc-pt.is-sel .bubble,
.tm-tile.is-sel .tm-rect, .bar-row.is-sel .db-dot, tr.is-sel .ib-fill { fill: var(--rp-pop) !important; }
tr.is-sel .ib-fill { background: var(--rp-pop); }
.bar-row.is-sel .bar-name { color: var(--rds-ink); font-weight: 650; }
.dbar.is-sel .row-name, .sc-pt.is-sel .pt-label { font-weight: 650; fill: var(--rds-ink); }
.tbl tbody tr.can-pick { cursor: pointer; transition: opacity .15s; }
.tbl tbody tr.is-dim { opacity: .42; }
.tbl tbody tr.is-sel > *, .tbl-wrap .tbl tbody tr.is-sel > th { background: var(--rp-pop-bg); }
.tbl tbody tr.is-sel > th { font-weight: 650; box-shadow: inset 3px 0 0 var(--rp-pop); }
.tbl tbody tr:focus-visible { outline-offset: -2px; }

/* chart marks */
.chart-svg { display: block; overflow: visible; }
.plot { position: relative; border-radius: 6px; }
.plot:focus-visible, .bars:focus-visible, .donut-fig:focus-visible { outline-offset: 4px; }
.axis .grid { stroke: var(--rp-grid); stroke-width: 1; shape-rendering: crispEdges; }
.axis .base { stroke: var(--rp-base); stroke-width: 1; shape-rendering: crispEdges; }
.tick { fill: var(--rp-ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.tick.strong { fill: var(--rds-text-2); }
/* lines are dashed, so the caps stay square and the dashes read crisp */
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: butt; }
.marker { stroke: var(--rds-surface); stroke-width: 1.5; }
.marker.is-hollow { fill: var(--rds-surface); stroke-width: 2; }
.dot { stroke: var(--rds-surface); stroke-width: 2; }
.endlabel { fill: var(--rds-ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.probe-line { stroke: var(--rds-ink); stroke-opacity: .35; stroke-width: 1; shape-rendering: crispEdges; }
.col, .bar, .dseg, .vcol, .dbar, .sc-pt, .tm-tile { transition: opacity .15s; }
.col.is-dim, .bar.is-dim, .dseg.is-dim, .vcol.is-dim, .dbar.is-dim, .sc-pt.is-dim { opacity: .4; }
.tm-tile.is-dim { opacity: .5; }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; padding: 0; font-size: .84rem; color: var(--rds-text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.lg-key.line { width: 16px; height: 3px; border-radius: 2px; }
.lg-line { display: block; flex: none; overflow: visible; }
.lg-key.tick { width: 3px; height: 14px; border-radius: 1px; }
.lg-key.dash { width: 14px; height: 3px; border-radius: 1px; }
.lg-key.dot { width: 11px; height: 11px; border-radius: 50%; }
.lg-key.ring { width: 11px; height: 11px; border-radius: 50%; background: var(--rds-surface) !important; border: 2px solid var(--rp-prior); }

/* ranked bars */
.bars { position: relative; display: grid; gap: 2px; border-radius: 6px; }
.bars.is-wide.has-prior .bar-row { grid-template-columns: var(--label-w) minmax(0, 1fr) var(--col-w) var(--col-w) var(--chip-w); }
.bars.is-wide.no-prior .bar-row { grid-template-columns: var(--label-w) minmax(0, 1fr) var(--col-w); }
.bars .bar-head { min-height: 28px; margin-bottom: 4px; font-size: .78rem; font-weight: 600; color: var(--rp-ink-3); align-items: end; }
.bar-head > span { text-align: right; }
.bh-key { grid-column: 1 / 3; }
.bh-key .legend { margin: 0; font-weight: 400; }
.bar-num { text-align: right; font-size: .88rem; font-weight: 600; color: var(--rds-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-num.is-prior { font-weight: 400; color: var(--rds-text-2); }
.bar-row {
  display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr) var(--chip-w); align-items: center; column-gap: 12px;
  min-height: var(--row-h, 34px); transition: opacity .15s;
}
.bar-row.is-dim { opacity: .45; }
.bars.is-narrow .bar-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name chip" "bar bar"; row-gap: 2px; padding: 5px 0; }
.bars.is-narrow .bar-name { grid-area: name; }
.bars.is-narrow .bar-track { grid-area: bar; }
.bars.is-narrow .chip { grid-area: chip; }
.bar-name { font-size: .88rem; color: var(--rds-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-svg { display: block; overflow: visible; }
.bar-value { fill: var(--rds-ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prior-ring { fill: var(--rds-surface); }
.prior-mark { fill: var(--rds-ink); }
.bar-more { margin-top: 8px; font-size: .84rem; color: var(--rp-ink-3); }

.chip {
  display: inline-flex; align-items: center; gap: 3px; justify-self: end; padding: 2px 7px; border-radius: 6px;
  font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip.is-good { background: var(--rp-pos-bg); }
.chip.is-bad { background: var(--rp-neg-bg); }
.chip.is-flat { background: var(--rds-surface-2); }
.chip.is-plain { background: transparent; padding: 0; }

/* visuals that belong to one kind of page (visuals.js) */
.vnote { margin: 0 0 10px; font-size: .88rem; color: var(--rds-text-2); font-variant-numeric: tabular-nums; }
.vnote strong { color: var(--rds-ink); font-weight: 650; }
.vkey { display: inline-block; width: 10px; height: 10px; margin: 0 5px 0 3px; border-radius: 2px; }
.row-name { fill: var(--rds-text); font-size: 13.5px; }
.zero-line { stroke: var(--rds-ink); stroke-opacity: .65; stroke-width: 1; shape-rendering: crispEdges; }
.ref-line { stroke: var(--rds-ink); stroke-opacity: .6; stroke-width: 1.25; stroke-dasharray: 5 4; }
.ref-label { fill: var(--rds-text-2); font-size: 12.5px; font-weight: 600; }
.axis-title { fill: var(--rp-ink-3); font-size: 12px; font-weight: 600; }
.bubble { stroke: var(--rds-surface); stroke-width: 2; fill-opacity: .9; }
.pt-label { fill: var(--rds-text); font-size: 13px; font-weight: 500; }
.tm-rect { fill: var(--rp-current); }
.tm-tile.is-accent .tm-rect { fill: var(--rp-s2); }
/* labels inside a tile take the ink that holds 4.5:1 on its fill: white on green and on blue, ink on gold */
.tm-name { fill: #fff; font-size: 13.5px; font-weight: 600; }
.tm-name.is-sm { font-size: 12px; }
.tm-value { fill: #fff; font-size: 21px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tm-meta { fill: #fff; fill-opacity: .92; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tm-tile.is-accent:not(.is-sel) text { fill: var(--rds-ink); }
.bars.dumb { gap: 0; }
.bars.dumb .bar-name { line-height: 1.25; }
.bars.dumb .bar-row { grid-template-columns: var(--label-w) minmax(0, 1fr) var(--col-w) var(--chip-w); }
.bars.dumb .bar-head { margin-bottom: 0; min-height: 30px; }
.bars.dumb .db-axis { min-height: 22px; }
.vgrid { stroke: var(--rp-grid); stroke-width: 1; shape-rendering: crispEdges; }
.db-link { stroke: var(--rp-prior); stroke-width: 2; }
.db-prior { fill: var(--rds-surface); stroke: var(--rp-prior); stroke-width: 2; }
.db-dot { stroke: var(--rds-surface); stroke-width: 1.5; }

/* heatmap */
.cell-empty { fill: var(--rds-surface-2); }
.cell-ring { fill: none; stroke: var(--rp-pop); stroke-width: 2.5; pointer-events: none; }
.scale { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .8rem; color: var(--rp-ink-3); font-variant-numeric: tabular-nums; }
.scale-bar { flex: 0 1 220px; height: 8px; border-radius: 4px; }

/* donut */
.donut { display: flex; align-items: center; justify-content: center; gap: 20px 28px; flex-wrap: wrap; }
.donut-fig { flex: none; border-radius: 50%; position: relative; }
.dseg { fill: none; }
.donut-total { fill: var(--rds-ink); font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.donut-cap { fill: var(--rp-ink-3); font-size: 12px; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 240px; min-width: 0; display: grid; gap: 2px; }
.donut-legend li {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 6px; font-size: .88rem; transition: background-color .15s;
}
.donut-legend li.is-on { background: var(--rp-pop-bg); }
.dl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-val { color: var(--rds-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.dl-share { min-width: 3.6em; text-align: right; color: var(--rp-ink-3); font-variant-numeric: tabular-nums; }

/* tables */
/* a table wider than its card scrolls inside the card; the shadow at the edge says more columns sit there */
.tbl-wrap {
  overflow-x: auto; border-radius: 8px;
  background:
    linear-gradient(to left, var(--rds-surface) 30%, rgba(255, 255, 255, 0)) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 100% 50%, rgba(23, 44, 45, .14), rgba(23, 44, 45, 0)) right / 12px 100% no-repeat scroll;
}
.tbl-wrap .tbl tbody th, .tbl-wrap .tbl thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--rds-surface); }
.tbl tbody tr:hover > th { background: #f6f9f8; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--rds-line); }
.tbl thead th { padding: 0; font-size: .8rem; font-weight: 600; color: var(--rds-text-2); border-bottom-color: var(--rds-line-strong); }
.th-btn {
  display: flex; align-items: center; gap: 4px; width: 100%; min-height: 36px; padding: 6px 10px;
  border: 0; background: none; color: inherit; font-weight: 600; text-align: inherit; cursor: pointer; border-radius: 6px;
}
.th-btn:hover { color: var(--rds-ink); }
.tbl th.num .th-btn { justify-content: flex-end; }
.tbl th[aria-sort="ascending"] .th-btn::after { content: ''; border: 4px solid transparent; border-bottom: 5px solid currentColor; margin-top: -5px; }
.tbl th[aria-sort="descending"] .th-btn::after { content: ''; border: 4px solid transparent; border-top: 5px solid currentColor; margin-top: 5px; }
.tbl .num { text-align: right; }
.tbl tbody th { font-weight: 500; color: var(--rds-ink); }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl tbody tr:hover { background: #f6f9f8; }
.ib { display: inline-block; width: 72px; height: 6px; margin-right: 10px; vertical-align: middle; overflow: hidden; border-radius: 3px; background: var(--rds-surface-2); }
.ib-fill { display: block; height: 100%; border-radius: 0 3px 3px 0; background: var(--rp-current); }
.link-btn {
  min-height: 44px; padding: 0; border: 0; background: none; color: var(--rds-teal); font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.tbl-more { margin-top: 4px; }
/* on the fixed page a table shows every row: rows share the card's height, and a table longer than
   its card scrolls inside it under a header that stays in view */
.tbl-wrap.is-fit { overflow-y: auto; }
.is-fit .tbl { font-size: .84rem; line-height: 1.15; }
.is-fit .chip { padding: 0 6px; line-height: 1.2; }
.is-fit .tbl th, .is-fit .tbl td { padding: 0 10px; height: var(--row-h, 30px); }
/* long column names wrap onto a second line before the table grows wider than its card */
.is-fit .tbl thead th { position: sticky; top: 0; z-index: 2; height: auto; padding: 0; white-space: normal; background: var(--rds-surface); box-shadow: 0 1px 0 var(--rds-line-strong); }
.is-fit .tbl thead th:first-child { z-index: 3; }
.is-fit .th-btn { min-height: 30px; padding: 0 10px; line-height: 1.2; }
.is-fit .tbl th.num .th-btn { text-align: right; }
.is-canvas .chip { line-height: 1.25; padding: 1px 7px; }

/* chart tooltip: reads values, so it sits on the surface with the value first */
.ctip {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; min-width: 150px; max-width: 280px;
  padding: 9px 11px; border: 1px solid var(--rds-line); border-radius: 10px; background: var(--rds-surface);
  box-shadow: var(--rds-sh-2); font-size: .84rem; color: var(--rds-text);
}
.ctip-title { margin-bottom: 4px; font-size: .78rem; font-weight: 600; color: var(--rp-ink-3); }
.ctip-row { display: flex; align-items: center; gap: 8px; line-height: 1.65; }
.ctip-row strong { color: var(--rds-ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.ctip-row span:last-child { color: var(--rds-text-2); }
.ctip-key { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.ctip-key.is-line { width: 12px; height: 3px; }
.ctip-foot { display: flex; align-items: center; gap: 4px; margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--rds-line); color: var(--rds-text-2); }

/* ---------- drawer (Ripplix 2753 slide-over) ---------- */
.drawer-root { position: fixed; inset: 0; z-index: 70; }
.drawer-root[hidden] { display: none; }
.backdrop { position: absolute; inset: 0; background: rgba(23, 44, 45, .1); backdrop-filter: blur(1px); -webkit-backdrop-filter: blur(1px); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); display: flex; flex-direction: column;
  background: var(--rds-surface); box-shadow: var(--rds-sh-3); transform: translateX(100%);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.dr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--rds-line); }
.dr-title { padding-top: 6px; font-size: 1.15rem; font-weight: 700; color: var(--rds-ink); line-height: 1.3; }
.dr-sub { margin-top: 2px; font-size: .87rem; color: var(--rp-ink-3); }
.dr-close { width: 44px; height: 44px; }
.dr-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px 22px 32px; }
.dr-value { font-size: 2.1rem; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; color: var(--rds-ink); font-variant-numeric: tabular-nums; }
.dr-summary .kpi-change { margin-top: 6px; font-size: .9rem; }
.dr-prior { margin-top: 6px; font-size: .9rem; color: var(--rds-text-2); font-variant-numeric: tabular-nums; }
.dr-prior strong { color: var(--rds-ink); font-weight: 600; }
.dr-help { margin-top: 12px; max-width: 60ch; font-size: .9rem; color: var(--rds-text-2); text-wrap: pretty; }
.dr-sec { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--rds-line); }
.dr-sec h3 { font-size: .98rem; font-weight: 650; color: var(--rds-ink); }
.dr-sec .sub { margin: 2px 0 12px; font-size: .85rem; color: var(--rp-ink-3); }
.dr-sk { display: grid; gap: 12px; }

/* ---------- loading, empty and error ---------- */
.sk {
  display: block; border-radius: 6px; background: linear-gradient(90deg, #ecf0ef 0%, #f6f8f7 45%, #ecf0ef 90%);
  background-size: 220% 100%; animation: sk 1.3s ease-in-out infinite;
}
@keyframes sk { from { background-position: 100% 0; } to { background-position: -120% 0; } }
.sk-h1 { width: 280px; max-width: 70%; height: 32px; }
.sk-meta { width: 130px; height: 14px; }
.sk-q { width: 520px; max-width: 90%; height: 16px; margin-top: 12px; }
.sk-period { width: 300px; max-width: 100%; height: 44px; border-radius: 10px; flex: none; }
.sk-h2 { width: 140px; height: 18px; }
.sk-line { width: 420px; max-width: 80%; height: 14px; margin: 8px 0 14px; }
.sk-label { width: 62%; height: 12px; }
.sk-value { width: 74%; height: 30px; margin-top: 6px; }
.sk-change { width: 52%; height: 12px; margin-top: 4px; }
.sk-h3 { width: 220px; max-width: 70%; height: 16px; }
.sk-chart { height: 220px; margin-top: 12px; border-radius: 10px; }
.card.is-sk .sk-chart { flex: 1; height: auto; min-height: 120px; }
.sk-row { height: 28px; }
.kpi.is-sk { cursor: default; min-height: 104px; box-shadow: none; }
.dr-sk .sk-value { width: 170px; height: 38px; }
.dr-sk .sk-line { width: 60%; margin: 0; }
.dr-sk .sk-chart { height: 200px; margin: 8px 0 4px; }

.state { max-width: 560px; margin-top: 20px; padding: 26px 28px; background: var(--rds-surface); border: 1px solid var(--rds-line); border-radius: 14px; }
.state-title { margin-bottom: 6px; font-size: 1.05rem; font-weight: 650; color: var(--rds-ink); }
.state-text { margin-bottom: 18px; color: var(--rds-text-2); text-wrap: pretty; }
.btn {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 9px; background: var(--rds-teal); color: #fff;
  font-weight: 600; cursor: pointer; transition: background-color .15s;
}
.btn:hover { background: var(--rds-forest); }
.empty { padding: 32px 16px; border-radius: 10px; background: var(--rds-surface-2); color: var(--rds-text-2); font-size: .92rem; text-align: center; text-wrap: balance; }

.pbi { flex: 1; min-height: 0; width: 100%; overflow: hidden; border: 1px solid var(--rds-line); border-radius: 14px; background: var(--rds-surface); }
.pbi[hidden] { display: none; }
.pbi iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- responsive ---------- */
/* between the phone layout and a full desktop the report list moves into a select, so the page keeps the width */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mnav {
    display: flex; align-items: center; gap: 10px; position: sticky; top: var(--rp-top-h); z-index: 30;
    padding: 8px 16px; background: var(--rds-surface); border-bottom: 1px solid var(--rds-line);
  }
  .mnav-label { font-size: .85rem; font-weight: 600; color: var(--rds-text-2); }
  .mnav .select-wrap { flex: 1; }
  .mnav .select { width: 100%; height: 44px; border: 1px solid var(--rds-line-strong); background-color: var(--rds-surface); }
  .topbar-in { padding: 0 16px; }
}

/* ---------- stacked (phones under 600px wide): the same page as one scrolling column ---------- */
.is-stacked .stage { display: block; padding: 0; overflow: visible; }
.is-stacked .fit { overflow: visible; }
.is-stacked .canvas { width: auto; height: auto; padding: 20px 16px 64px; gap: 18px; }
.is-stacked .c-head { flex-direction: column; align-items: stretch; }
.is-stacked .c-tools { justify-content: flex-start; }
.is-stacked .title { font-size: 1.45rem; }
.is-stacked .question { font-size: .97rem; }
.is-stacked .hint { display: block; margin: 4px 0 0; }
.is-stacked .dash { gap: 18px; }
.is-stacked .dash.page-grid { display: flex; flex-direction: column; }
.is-stacked .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.is-stacked .kpi-cell:last-child:nth-child(odd) { grid-column: 1 / -1; }
.is-stacked .kpi-value { font-size: 1.5rem; }
.is-stacked .sections, .is-stacked .vgrp { flex-direction: column; flex: none; }
.is-stacked .sections.on-grid > .vgrp, .is-stacked .vgrp.on-grid > .card { flex: none; }
.is-stacked .card { flex: none; overflow: visible; padding: 16px 14px 18px; }
.is-stacked .card > .card-body { flex: none; }
.is-stacked .card-head { flex-wrap: wrap; }
.is-stacked .card.has-tabs .card-tools { flex-wrap: wrap; }
.is-stacked .card.is-sk { min-height: 300px; }
.is-stacked .pbi { aspect-ratio: 16 / 10; }
@media (max-width: 760px) {
  .dr-head { padding-left: 18px; }
  .dr-body { padding: 18px 18px 28px; }
}
@media (max-width: 380px) {
  .wordmark { font-size: .95rem; }
  .book { padding: 0 12px; }
}
/* touch: every target reaches 44px, either in size or through a padded hit area */
@media (pointer: coarse), (max-width: 760px) {
  .icon-btn, .select { height: 44px; }
  .icon-btn { width: 44px; }
  .nav-link { min-height: 44px; }
  .is-stacked .th-btn { min-height: 44px; }
  .seg button { position: relative; }
  .seg button::after { content: ''; position: absolute; inset: -8px 0; }
}
.card { container-type: inline-size; }
@container (max-width: 480px) {
  .ib { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* ---------- embed (?embed=1): the host page supplies the bar and the report tabs ---------- */
html.is-embed { --rp-top-h: 0px; }
.is-embed .topbar, .is-embed .side, .is-embed .mnav { display: none; }
.is-embed .layout { grid-template-columns: minmax(0, 1fr); }
