/* STATS-BUILD-1: the Stats page.
 *
 * Phone first. One column at 390 px with no sideways scroll; on a wide screen the tree
 * sits beside the page. The charts are drawn from the partition's own numbers and every
 * one of them can be read as a table.
 *
 * Colour is never the only cue: the numbers are written out in the table, the news bars
 * are striped, and the chamber averages are striped grey.
 */

.stats-page {
  --stats-ink: var(--ink);
  --stats-ink-2: var(--ink-2);
  --stats-ink-3: var(--ink-3);
  --stats-line: var(--line-2);
  --stats-panel: var(--card);
  display: grid;
  gap: var(--s5);
  padding-block: var(--s5) var(--s8);
}

.stats-hero__lead {
  max-width: var(--measure);
  color: var(--stats-ink-2);
  font-size: var(--fs-md);
}

.stats-hero--detail .eyebrow {
  margin-bottom: var(--s1);
}

/* ---------- filters ---------- */

/* STATS-FOLD-1: one summary line ("All of Canada · 30 days · Everything") and a "Change" text link
   that opens the same three controls in place.  The box with the controls is closed until then. */
.stats-filterbar {
  display: grid;
  gap: var(--s2);
}

.stats-filters__summary {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--stats-ink-2);
}

.stats-filters__change {
  display: inline-block;
  margin-inline-start: var(--s2);
  padding-block: var(--s2);
  color: var(--accent);
  text-decoration: underline;
}

.stats-filters__all {
  margin: 0;
  font-size: var(--fs-sm);
}

.stats-filters__all a {
  display: inline-block;
  padding-block: var(--s2);
  color: var(--accent);
  text-decoration: underline;
}

/* STATS-ALL-ISSUES-1: the "All issues" view (web/js/issues/directory.js). Its issue tiles use the one white
   (--tile-white), not the cream --card. The explanation block (intro, "matched automatically" note, help link)
   sits below the list (rule 48). */
.stats-all .ig-card { background: var(--tile-white, #fff); }

.stats-all .idir-about {
  display: grid;
  gap: var(--s3);
  justify-items: start;
  max-width: 62ch;
  margin-top: var(--s7);
}

.stats-all .idir-about p { margin: 0; }
.stats-all .eyebrow a { color: var(--accent); }

.stats-filters[hidden] { display: none; }

.stats-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s5);
  align-items: end;
  padding: var(--s3) var(--s4);
  background: var(--paper-2);
  border: 1px solid var(--stats-line);
  border-radius: var(--radius-sm);
}

.stats-filter {
  display: grid;
  gap: var(--s1);
  min-width: 8rem;
}

.stats-filter label {
  font-size: var(--fs-xs);
  color: var(--stats-ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.stats-filter select {
  min-height: 44px;
  padding: var(--s1) var(--s2);
  font: inherit;
  background: var(--card);
  color: var(--stats-ink);
  border: 1px solid var(--stats-line);
  border-radius: var(--radius-sm);
}

.stats-filters__asof {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--stats-ink-3);
}

/* ---------- the count strip ---------- */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-strip__cell {
  display: grid;
  gap: 2px;
  padding: var(--s2) var(--s3);
  background: var(--card);
  border: 1px solid var(--stats-line);
  border-radius: var(--radius-sm);
}

.stats-strip__count {
  font: 700 var(--fs-lg)/1.1 var(--font-body);
  color: var(--stats-ink);
}

.stats-strip__label {
  font-size: var(--fs-xs);
  color: var(--stats-ink-3);
}

/* ---------- panels ---------- */

.stats-panel {
  display: grid;
  /* The rows keep their own height.  A grid's `align-content` defaults to `stretch`,
     so a panel that is taller than its content (the left-hand card is stretched to the
     height of the right-hand one beside it) spread the leftover space over its rows:
     a one-line heading became 125 px tall and left a large empty band under it. */
  align-content: start;
  gap: var(--s3);
  padding: var(--s4);
  background: var(--stats-panel);
  border: 1px solid var(--stats-line);
  border-radius: var(--radius-sm);
}

.stats-panel h2 {
  margin: 0;
  font-size: var(--fs-lg);
}

.stats-panel__note {
  margin: 0;
  max-width: var(--measure);
  color: var(--stats-ink-2);
  font-size: var(--fs-sm);
}

/* The overlap note carries no extra styling: the "--overlap" modifier is a hook
   the screens gate uses to read the note that explains the overlapping counts,
   apart from the note that introduces the section. */

.stats-columns {
  display: grid;
  gap: var(--s4);
}

@media (min-width: 900px) {
  .stats-columns { grid-template-columns: 1fr 1fr; }
}

/* ---------- your representatives (reps.js) ---------- */

.stats-reps__form {
  display: grid;
  gap: var(--s1);
  max-width: 34rem;
}

.stats-reps__form label {
  font-size: var(--fs-xs);
  color: var(--stats-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.stats-reps__formrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.stats-reps__formrow input {
  flex: 1 1 14rem;
  min-width: 0;
  min-height: 44px;
  padding: 0 var(--s3);
  font: inherit;
  border: 1px solid var(--stats-line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.stats-reps__formrow .btn { min-height: 44px; }

.stats-reps__out { display: grid; gap: var(--s3); }

.stats-reps__place { margin: 0; font-weight: 700; }

.stats-reps__msg { margin: 0; color: var(--stats-ink-2); }

.stats-reps__choices { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }

.stats-reps__grid {
  display: grid;
  gap: var(--s4);
  align-items: start;
}

.stats-reps__grid > * { min-width: 0; }

@media (min-width: 900px) {
  .stats-reps__grid { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
}

.stats-reps__card {
  display: grid;
  align-content: start;
  gap: var(--s2);
  padding: var(--s4);
  background: #fff;
  border: 1px solid var(--stats-line);
  border-radius: var(--radius-sm);
}

.stats-reps__card--state { border-style: dashed; background: var(--paper-2); }

.stats-reps__eyebrow {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.stats-reps__name { margin: 0; font-size: var(--fs-lg); }

.stats-reps__note,
.stats-reps__based,
.stats-reps__office,
.stats-reps__state { margin: 0; font-size: var(--fs-sm); color: var(--stats-ink-2); }

.stats-reps__small {
  margin: 0;
  padding: var(--s2) var(--s3);
  font-size: var(--fs-sm);
  background: #fff;
  border: 1px solid var(--stats-line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
}

.stats-reps__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s4);
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--stats-ink-2);
}

.stats-reps__swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}

.stats-reps__rows { display: grid; }

.stats-reps__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: var(--s2) 0;
  border-bottom: 1px dotted var(--stats-line);
}

.stats-reps__area { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.stats-reps__row--other .stats-reps__area { color: var(--stats-ink-3); }

.stats-reps__bars { display: grid; gap: 3px; }

.stats-reps__bar {
  display: block;
  height: 9px;
  border-radius: 4px;
}

.stats-reps__bar--chamber {
  background-image: repeating-linear-gradient(45deg, transparent 0 3px, rgba(255, 255, 255, 0.5) 3px 5px);
}

.stats-reps__value {
  font-size: var(--fs-xs);
  color: var(--stats-ink-3);
  font-variant-numeric: tabular-nums;
}

.stats-reps__links { margin: var(--s2) 0 0; }

.stats-reps .stats-table { font-size: var(--fs-xs); }

/* The table beside the chart: short headings, and no letter-spacing, so a four-column table
   fits a 340 px card without a clipped heading. */
.stats-reps .stats-table th,
.stats-reps .stats-table td { padding: var(--s1) 4px; }

.stats-reps .stats-table thead th {
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
  overflow-wrap: normal;
}

.stats-reps .stats-table tbody th { font-weight: 600; }

/* ---------- charts ---------- */

.stats-chart {
  margin: 0;
  display: grid;
  /* The rows keep their own height, for the same reason as the panels. */
  align-content: start;
  gap: var(--s2);
}

.stats-chart__title {
  font-weight: 700;
  color: var(--stats-ink);
}

.stats-chart__sub {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--stats-ink-3);
}

/* The "Show as a table" control.
 *
 * It is a text link, the way the design shows it ("▶ Show as a table"), not a pill
 * button.  A pill with a 999px radius on a stretched box is an oval, and a 44px-tall
 * oval that says "Show as a table" reads as a button the reader is meant to press
 * rather than as the disclosure it is.
 */
.stats-chart__toggle {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: 44px;
  padding: 0;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stats-chart__toggle::before {
  content: "▶";
  font-size: 0.7em;
  text-decoration: none;
}

.stats-chart__toggle:hover { color: var(--ink); }

.stats-chart__table { overflow-x: auto; }

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.stats-table caption {
  text-align: left;
  padding-bottom: var(--s2);
  color: var(--stats-ink-3);
  font-size: var(--fs-xs);
}

.stats-table th,
.stats-table td {
  text-align: left;
  padding: var(--s1) var(--s2);
  border-bottom: 1px solid var(--stats-line);
  vertical-align: top;
}

.stats-table thead th {
  color: var(--stats-ink-3);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ---------- the pie ---------- */

.stats-pie {
  display: grid;
  gap: var(--s3);
}

@media (min-width: 560px) {
  .stats-pie { grid-template-columns: 180px 1fr; align-items: center; }
}

.stats-pie__svg { width: 100%; max-width: 180px; height: auto; }

/* Square ends on the slices.  trace.css gives every unsized <svg> `stroke-linecap: round`
 * (it is meant for icons), the circles inherit it, and a rounded cap on a 34px stroke
 * overlaps the next arc: the ring looked scalloped, with a blob at each boundary. */
.stats-pie__slice { stroke-linecap: butt; }

.stats-pie__total {
  font: 700 22px var(--font-body);
  fill: var(--ink);
}

.stats-pie__unit {
  font: 12px var(--font-body);
  fill: var(--ink-3);
}

.stats-pie__legend-list {
  display: grid;
  gap: var(--s1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-pie__legend {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: var(--s2);
  align-items: baseline;
  font-size: var(--fs-sm);
}

/* The tail row: "The other 17 areas".
 *
 * It has a swatch and a share like every other row, so it is laid out the same way and
 * reads on one line.  It used to have neither, so it fell into the 12px column of the
 * grid and wrapped one word per line.
 */
.stats-pie__legend--rest {
  color: var(--stats-ink-3);
}

.stats-pie__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.stats-pie__share { color: var(--stats-ink-3); }

/* ---------- the source chips ---------- */

.stats-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A chip is a small pill: the swatch, the name and the count on one line.
 *
 * The chip is a flex item of a flex row, so it takes its own height (the line box of
 * its text).  It is not a grid row, and it does not stretch.
 */
.stats-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 2px var(--s2);
  font-size: var(--fs-sm);
  line-height: 1.6;
  white-space: nowrap;
  background: var(--paper-2);
  border: 1px solid var(--stats-line);
  border-radius: var(--radius-pill);
}

.stats-chip__swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.stats-chip__count { font-weight: 700; }

/* ---------- the said-vs-covered bars ---------- */

.stats-bars {
  display: grid;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-bars__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--stats-line);
}

/* One row: the name and its tag on the left, the two bars on the right, and the numbers
 * under the bars (the design's layout).  The numbers used to be a third column, and their
 * long text squeezed the bars to about 55 px; now the bars have the whole right-hand
 * column and a bar's width is its share of that column.
 *
 * On a phone the row is one column in reading order: name, tag, bars, numbers. */
.stats-bars__name { order: 1; font-size: var(--fs-sm); font-weight: 600; }
.stats-bars__tag { order: 2; justify-self: start; }
.stats-bars__pair { order: 3; }
.stats-bars__values { order: 4; }

@media (min-width: 700px) {
  .stats-bars__row {
    grid-template-columns: minmax(10rem, 13rem) 1fr;
    align-items: start;
    gap: var(--s1) var(--s3);
  }
  .stats-bars__name { grid-column: 1; grid-row: 1; }
  .stats-bars__tag { grid-column: 1; grid-row: 2; justify-self: start; }
  .stats-bars__pair { grid-column: 2; grid-row: 1; padding-top: 4px; }
  .stats-bars__values { grid-column: 2; grid-row: 2; }
}

.stats-bars__pair {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.stats-bars__bar {
  height: 9px;
  border-radius: 2px;
  display: block;
}

.stats-bars__bar--said { background: #2f5a8b; }

/* The news bar is striped: the two bars are told apart without relying on colour. */
.stats-bars__bar--covered {
  background: repeating-linear-gradient(135deg, #2A818C 0 4px, #e7f2f4 4px 8px);
  border: 1px solid #2A818C;
}

.stats-bars__values { font-size: var(--fs-xs); color: var(--stats-ink-3); }

.stats-bars__tag {
  font-size: var(--fs-xs);
  color: var(--stats-ink-2);
  background: var(--paper-2);
  border-radius: var(--radius-tag);
  padding: 1px var(--s2);
}

/* ---------- the weekly line ---------- */

.stats-weekly__svg {
  width: 100%;
  height: 120px;
  overflow: visible;
}

.stats-weekly__line {
  fill: none;
  stroke: #2f5a8b;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.stats-weekly__point { fill: #2f5a8b; }

/* ---------- the responsibility list ---------- */

.stats-duty,
.stats-areas,
.stats-themes,
.stats-issues,
.stats-feeds {
  display: grid;
  gap: var(--s1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-duty__row,
.stats-themes__row,
.stats-issues__row,
.stats-feeds__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s1) var(--s3);
  align-items: baseline;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--stats-line);
}

.stats-duty__lever,
.stats-duty__flag,
.stats-issues__more,
.stats-feeds__status,
.stats-feeds__date {
  font-size: var(--fs-xs);
  color: var(--stats-ink-3);
  grid-column: 1 / -1;
}

.stats-duty__share,
.stats-themes__count,
.stats-issues__count { font-weight: 700; }

.stats-themes__flag,
.stats-duty__flag {
  color: var(--stats-ink-3);
}

.stats-areas {
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: var(--s2);
}

.stats-areas__cell {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s2);
  border: 1px solid var(--stats-line);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

.stats-areas__count { color: var(--stats-ink-3); }

/* ---------- the tree beside the page ---------- */

.stats-detail { display: grid; gap: var(--s4); }

/* On a phone the tree is not shown: one level per screen, with a back link. */
.stats-tree { display: none; }

@media (min-width: 1000px) {
  .stats-page:has(.stats-detail) {
    grid-template-columns: 18rem 1fr;
    align-items: start;
  }
  .stats-tree {
    display: block;
    position: sticky;
    top: calc(var(--site-header-h, 64px) + var(--s3));
    max-height: calc(100vh - var(--site-header-h, 64px) - var(--s6));
    overflow-y: auto;
    padding: var(--s3);
    background: var(--card);
    border: 1px solid var(--stats-line);
    border-radius: var(--radius-sm);
  }
}

.stats-tree__label {
  margin: 0 0 var(--s2);
  font: 700 var(--fs-xs)/1.3 var(--font-body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.stats-tree__list,
.stats-tree__themes {
  display: grid;
  gap: var(--s1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-tree__themes { margin-top: var(--s1); padding-left: var(--s3); }

.stats-tree__area,
.stats-tree__theme {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s2);
  align-items: baseline;
  font-size: var(--fs-sm);
}

.stats-tree__count { color: var(--stats-ink-3); font-size: var(--fs-xs); }

/* ---------- the breadcrumb ---------- */

.stats-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  align-items: baseline;
  font-size: var(--fs-sm);
  color: var(--stats-ink-3);
}

.stats-breadcrumb__sep { color: var(--stats-ink-3); }

/* ---------- the definition card ---------- */

.stats-definition {
  display: grid;
  gap: var(--s2);
  padding: var(--s3);
  background: var(--paper-2);
  border: 1px solid var(--stats-line);
  border-radius: var(--radius-sm);
}

.stats-definition h2,
.stats-definition h3 { margin: 0; font-size: var(--fs-md); }

.stats-definition__parts {
  display: grid;
  gap: var(--s3);
  margin: 0;
  padding-left: 1.2rem;
}

.stats-definition__parts h4 {
  margin: 0 0 2px;
  font-size: var(--fs-sm);
  color: var(--accent);
}

.stats-definition__parts p { margin: 0; font-size: var(--fs-sm); color: var(--stats-ink-2); }

.stats-definition__source { margin: 0; font-size: var(--fs-xs); color: var(--stats-ink-3); }

/* ---------- how we count (STATS-FOLD-1): the one method section, last on every page ---------- */

.stats-method h3 {
  margin: 0;
  font-size: var(--fs-md);
}

.stats-method__rules {
  display: grid;
  gap: var(--s2);
  margin: 0;
  padding-left: 1.1rem;
  max-width: var(--measure);
  color: var(--stats-ink-2);
  font-size: var(--fs-sm);
}

.stats-method__sources,
.stats-method__fresh {
  display: grid;
  gap: var(--s2);
}

/* ---------- the levers ---------- */

.stats-levers {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-levers__item {
  display: inline-flex;
  gap: var(--s1);
  align-items: baseline;
  padding: var(--s1) var(--s2);
  font-size: var(--fs-sm);
  background: var(--paper-2);
  border: 1px solid var(--stats-line);
  border-radius: var(--radius-tag);
}

.stats-levers__label { font-weight: 700; }

.stats-levers__levels { color: var(--stats-ink-2); }

/* ---------- the item lists ---------- */

.stats-items__group { display: grid; gap: var(--s1); }

.stats-items__title {
  margin: var(--s2) 0 0;
  font-size: var(--fs-md);
  display: flex;
  gap: var(--s2);
  align-items: baseline;
}

.stats-items__count { color: var(--stats-ink-3); font-size: var(--fs-sm); font-weight: 400; }

.stats-items {
  display: grid;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-item {
  display: grid;
  gap: 2px;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--stats-line);
}

.stats-item__kind {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--stats-ink-3);
}

.stats-item__title { font-weight: 600; }

.stats-item__meta { font-size: var(--fs-xs); color: var(--stats-ink-3); }

.stats-more { margin: 0; font-size: var(--fs-sm); color: var(--stats-ink-3); }

/* ---------- the states ---------- */

.stats-state {
  margin: 0;
  padding: var(--s2) var(--s3);
  font-size: var(--fs-sm);
  border-left: 3px solid var(--stats-line);
  background: var(--paper-2);
}

.stats-state--untracked { border-left-color: #8a867a; }

.stats-empty {
  margin: 0;
  padding: var(--s3);
  font-size: var(--fs-sm);
  color: var(--stats-ink-2);
  background: var(--tile-bg);
  border-radius: var(--radius-sm);
}

/* ---------- the match note ---------- */

.stats-match-note {
  display: grid;
  gap: var(--s2);
  padding: var(--s3);
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

.stats-match-note p { margin: 0; font-size: var(--fs-sm); }

/* ---------- the action row ---------- */

.stats-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0;
}

.stats-actions .btn { min-height: 44px; }

/* ---------- the kinds row ---------- */

.stats-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
}

/* ---------- the lobbying section ---------- */

.stats-lobbying {
  display: grid;
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-lobbying__area {
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--stats-line);
}

.stats-lobbying__name {
  margin: 0;
  font-size: var(--fs-md);
}

.stats-lobbying__total {
  margin: var(--s1) 0 0;
  font-weight: 700;
}

.stats-lobbying__classes,
.stats-lobbying__institution-list {
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
}

.stats-lobbying__class,
.stats-lobbying__institution {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s1) 0;
  font-size: var(--fs-sm);
}

.stats-lobbying__class-count,
.stats-lobbying__institution-count {
  font-weight: 700;
  white-space: nowrap;
}

.stats-lobbying__institutions {
  margin-top: var(--s2);
  font-size: var(--fs-sm);
}

.stats-lobbying__institutions summary {
  cursor: pointer;
  color: var(--stats-ink-3);
}

/* ---------- the mandate-letters section ---------- */

.stats-mandate {
  display: grid;
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-mandate__item {
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--stats-line);
}

.stats-mandate__government {
  margin: 0;
  font-weight: 700;
}

.stats-mandate__office {
  margin: var(--s1) 0 0;
  font-size: var(--fs-sm);
  color: var(--stats-ink-3);
}

/* The excerpt is the letter's own words.  The letters are published as bulleted
   lists, so a sentence runs on past a list marker; the build turns that marker
   into a line break, and `pre-line` keeps the break visible.  The reader sees the
   list the letter actually is. */
.stats-mandate__excerpt {
  margin: var(--s2) 0 0;
  padding: 0 0 0 var(--s2);
  border-left: 3px solid var(--stats-line);
  font-size: var(--fs-sm);
  white-space: pre-line;
}

.stats-mandate__link {
  display: inline-block;
  margin-top: var(--s2);
  font-size: var(--fs-sm);
}

/* The credit: **one line per source**.  The two places publish under two
   licences, so each keeps its own line and the reader can tell which is which. */
.stats-lobbying__credit {
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-xs);
  color: var(--stats-ink-3);
}

.stats-lobbying__credit-line {
  margin: 0 0 var(--s1);
}

.stats-lobbying__credit-text {
  display: block;
}

.stats-lobbying__credit-licence {
  display: block;
  color: var(--stats-ink-3);
}

/* ---------- federal spending (STATS-MONEY-1) ---------- */

.stats-money__view {
  display: grid;
  gap: var(--s2);
  align-content: start;
  padding-top: var(--s3);
  border-top: 1px solid var(--stats-line);
}

.stats-money h3 { margin: 0; font-size: var(--fs-md, 1.05rem); }

.stats-money h4 { margin: 0; font-size: var(--fs-sm); }

/* What was spent is a solid bar; the plan is a striped one, so the two views are told apart
   without relying on colour and are never read as one series. */
.stats-money__bar { background: #3a6b57; }

.stats-money__bar--plan {
  background: repeating-linear-gradient(135deg, #6b5a8e 0 4px, #efeaf6 4px 8px);
  border: 1px solid #6b5a8e;
}

.stats-money__figure { margin: 0; font-weight: 600; }

.stats-money__cut { margin: var(--s2) 0 0; font-size: var(--fs-xs); color: var(--stats-ink-3); }

.stats-money__outside,
.stats-money__notes { display: grid; gap: var(--s2); padding-top: var(--s2); }

.stats-money__lines {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s1);
  font-size: var(--fs-sm);
}

.stats-money__lines li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
}

.stats-money__lines--notes li { display: block; }

.stats-money__line-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }

.stats-money__source { margin: 0; }

.stats-columns--money { align-items: start; }
