/* WhoHelpsHere: the only stylesheet. System fonts, no images, no CDNs.
 * Light/dark via prefers-color-scheme, RTL via logical properties. Budget: 24 KB. */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --accent: #15803d;
  --accent-strong: #166534;
  --accent-soft: #dcfce7;
  --accent-ink: #ffffff;
  --link: #1d4ed8;
  --focus: #2563eb;
  --warn-bg: #fffbeb;
  --warn-ink: #854d0e;
  --warn-line: #fcd34d;
  --alert: #b91c1c;
  --head-bg: #14532d;
  --head-ink: #ffffff;
  --head-ink-2: #cde9d6;
  --brand-2: #86efac;
  --head-line: rgba(255, 255, 255, .22);
  --thead-bg: #f1f5f9;
  --grp-bg: #e9eef5;
  --row-hover: #f1f5f9;
  --edge: rgba(15, 23, 42, .16);
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-2: 0 6px 16px rgba(15, 23, 42, .10);
  --r: 12px;
  --r-sm: 8px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --maxw: 75rem;
  --gutter: var(--s5);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1a;
    --surface: #151d2b;
    --surface-2: #1b2433;
    --surface-3: #202b3c;
    --ink: #e8eef8;
    --ink-2: #a9b6c9;
    --ink-3: #93a2b8;
    --line: #2a3648;
    --line-2: #3a4759;
    --accent: #4ade80;
    --accent-strong: #86efac;
    --accent-soft: #14301f;
    --accent-ink: #052e16;
    --link: #93c5fd;
    --focus: #7dd3fc;
    --warn-bg: #2c2410;
    --warn-ink: #fcd77a;
    --warn-line: #6b5518;
    --alert: #fca5a5;
    --head-bg: #10192a;
    --head-ink: #e8eef8;
    --head-ink-2: #a9b6c9;
    --brand-2: var(--accent);
    --head-line: rgba(255, 255, 255, .14);
    --thead-bg: #1b2433;
    --grp-bg: #202b3c;
    --row-hover: #1b2433;
    --edge: rgba(0, 0, 0, .55);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .40);
    --shadow-2: 0 6px 16px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

/* -------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-block-start: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus {
  position: static; display: inline-block; margin: var(--s2);
  padding: var(--s2) var(--s3); background: var(--accent); color: var(--accent-ink);
  border-radius: var(--r-sm); font-weight: 600;
}
h1, h2, h3, h4 { line-height: 1.22; text-wrap: balance; }
h1 { font-size: 2.25rem; font-weight: 750; letter-spacing: -.02em; }
h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.0625rem; font-weight: 700; }
p { max-width: 68ch; }
/* vertical rhythm: elements carry no margin, containers space their children */
h1, h2, h3, h4, p, ul, ol, figure, form, table, dl { margin: 0; }
.card__body > * + *, .card--pad > * + *, .finding__in > * + *, .callout > * + *,
.flow > * + * { margin-block-start: var(--s3); }
.section > * + *, .stack > * + * { margin-block-start: var(--s4); }
.lede { font-size: 1.0625rem; color: var(--ink-2); }
p.hint, .hint { font-size: .875rem; color: var(--ink-2); }
.nodata { color: var(--ink-3); font-style: italic; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: .1em .35em; }

/* ------------------------------------------------------------- app header */
.topbar { background: var(--head-bg); color: var(--head-ink); border-bottom: 1px solid var(--head-line); }
.topbar__in {
  max-width: var(--maxw); margin: 0 auto; padding: var(--s3) var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5);
}
.brand {
  margin-inline-end: auto; font-size: 1.125rem; font-weight: 750; letter-spacing: -.01em;
  color: var(--head-ink); text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--brand-2); }
.brand:hover { text-decoration: underline; }
.nav { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); font-size: .9375rem; }
.nav a {
  color: var(--head-ink-2); text-decoration: none; padding: var(--s1) var(--s3);
  border-radius: 999px; white-space: nowrap;
}
.nav a:hover { color: var(--head-ink); background: var(--head-line); }
.nav a[aria-current="page"] { color: var(--head-ink); background: var(--head-line); font-weight: 600; }
.langs {
  display: flex; border: 1px solid var(--head-line); border-radius: 999px;
  overflow: hidden; font-size: .8125rem; background: rgba(255, 255, 255, .06);
}
.langs > * {
  padding: var(--s1) var(--s3); text-decoration: none; color: var(--head-ink-2);
  border-inline-start: 1px solid var(--head-line); white-space: nowrap; font-weight: 500;
}
.langs > :first-child { border-inline-start: 0; }
.langs a:hover { background: var(--head-line); color: var(--head-ink); }
.langs strong { background: var(--head-ink); color: var(--head-bg); font-weight: 700; }

/* -------------------------------------------------------- page scaffolding */
.page { max-width: var(--maxw); margin: 0 auto; padding: var(--s5) var(--gutter) var(--s7); }
.page > * + * { margin-block-start: var(--s4); }
.page > * + .section, .page > * + .tabs, .page > * + .finding { margin-block-start: var(--s6); }
.page > * + .section--first { margin-block-start: var(--s5); }
.crumb { font-size: .8125rem; color: var(--ink-3); margin: 0; max-width: none; }
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb .sep { padding: 0 var(--s1); opacity: .6; }
.pagehead__meta { margin: var(--s2) 0 0; color: var(--ink-2); font-size: .9375rem; }
.pagehead .lede { margin-block-start: var(--s3); }
.dot { padding: 0 var(--s1); opacity: .5; }
.section { margin-block-start: var(--s6); }
.section--first { margin-block-start: 0; }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s3); }
.section__head h2 { flex: 0 1 auto; }
.section > p { color: var(--ink-2); font-size: .9375rem; }

/* sticky in-page tab bar */
.tabs {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: var(--s2); align-items: center; overflow-x: auto;
  margin-inline: calc(var(--gutter) * -1); padding: var(--s2) var(--gutter);
  background: var(--bg); border-block-end: 1px solid var(--line);
  scrollbar-width: thin;
}
.tabs .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.tabs a {
  padding: var(--s1) var(--s3); border-radius: 999px; font-size: .875rem; font-weight: 500;
  text-decoration: none; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
  white-space: nowrap;
}
.tabs a:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface-2); }
@media (max-width: 47.99rem) { .tabs { position: static; } .tabs .k { display: none; } }

/* ------------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1);
}
.card__head { padding: var(--s4) var(--s4) 0; }
.card--pad { padding: var(--s4); }
.card__title { font-size: 1rem; font-weight: 700; margin: 0; }
.card__sub { margin: var(--s1) 0 0; font-size: .8125rem; color: var(--ink-2); }
.card__body { padding: var(--s4); overflow-x: auto; }
.card__foot {
  padding: var(--s3) var(--s4); border-block-start: 1px solid var(--line);
  background: var(--surface-2); border-end-start-radius: var(--r); border-end-end-radius: var(--r);
}
p.src, .src { font-size: .78125rem; line-height: 1.5; color: var(--ink-3); margin: 0; max-width: 90ch; }
.src a { color: var(--ink-2); }
.card--pad > .src:last-child, .card__body > .src:last-child {
  margin-top: var(--s3); padding-top: var(--s3); border-block-start: 1px dashed var(--line);
}
.grid-2 { display: grid; gap: var(--s4); align-items: start; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
@media (max-width: 47.99rem) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------------------- KPI cards */
.kpis {
  display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none; padding: 0; margin: 0;
}
@media (min-width: 40rem) {
  .kpis { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
  .kpis--tight { grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
}
.kpi {
  display: flex; flex-direction: column; gap: var(--s1);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1); padding: var(--s3) var(--s4) var(--s4);
}
.kpi__label {
  font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); line-height: 1.35;
}
.kpi__value {
  font-size: 1.5rem; font-weight: 750; line-height: 1.1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; margin-top: auto; padding-top: var(--s1);
}
.kpi__value.is-nodata { font-size: 1.0625rem; font-weight: 600; color: var(--ink-3); font-style: italic; }

/* -------------------------------------------------- finding, callouts, badges */
.finding {
  background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent);
  border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden;
}
.finding__in { padding: var(--s4) var(--s5); }
.finding h2 {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); margin-bottom: var(--s2);
}
.finding .big { font-size: 1.25rem; line-height: 1.4; font-weight: 600; max-width: 60ch; letter-spacing: -.01em; }
.finding__links { font-size: .9375rem; margin-top: var(--s3); }
.finding .caveat { font-size: .84375rem; color: var(--ink-2); max-width: 78ch; margin-top: var(--s3); }
.callout {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-sm);
  padding: var(--s3) var(--s4); font-size: .9375rem;
}
.callout p { max-width: 80ch; }
.callout--warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.callout--warn a { color: inherit; }
.badge {
  display: inline-block; font-size: .6875rem; font-weight: 600; line-height: 1.6;
  padding: 0 var(--s2); border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; vertical-align: 1px;
}
.badge.local { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.badge.stale, .badge.unverified { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.chip {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: 0 var(--s2);
  border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: var(--s2) var(--s4); font: inherit; font-size: .9375rem; font-weight: 600;
  cursor: pointer; border-radius: var(--r-sm); border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
}
.btn:hover { background: var(--accent-strong); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--surface-2); }

/* ------------------------------------------------------------------ charts */
.chart { display: block; width: 100%; max-width: 100%; height: auto; }
.card__body > .chart:not(.hchart) { max-width: 34rem; }
.chart .bar { fill: var(--accent); }
.chart .axis { stroke: var(--line-2); }
.chart text { fill: var(--ink-3); font-size: 9px; font-family: inherit; }
.hchart .track { fill: var(--surface-3); }
.hchart text.l { fill: var(--ink); font-size: 13.5px; font-weight: 650; }
.hchart text.d { fill: var(--ink-3); font-size: 11.5px; }
.chartnote { font-size: .8125rem; color: var(--ink-3); margin: var(--s3) 0 0; max-width: 78ch; }

/* ------------------------------------------------------------- data tables */
.tablecard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1); overflow: hidden;
}
.tablecard__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3);
  padding: var(--s3) var(--s4); border-block-end: 1px solid var(--line);
}
.tablecard__head h3 { font-size: .9375rem; }
.tablecard__count { font-size: .8125rem; color: var(--ink-3); margin-inline-start: auto; }
.tools {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: flex-end;
  padding: var(--s3) var(--s4); background: var(--surface-2); border-block-end: 1px solid var(--line);
}
.tools .field { display: flex; flex-direction: column; gap: var(--s1); flex: 1 1 18rem; max-width: 26rem; min-width: 0; }
.tools label { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.tools input[type=search] {
  width: 100%; padding: var(--s2) var(--s3); font: inherit; font-size: .9375rem;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
.tools .status { margin: 0; align-self: center; font-size: .8125rem; font-weight: 600; color: var(--ink-2); margin-inline-start: auto; }
.tools .hint { flex: 1 0 100%; margin: 0; font-size: .8125rem; color: var(--ink-3); max-width: 90ch; }
.tablescroll { overflow: auto; max-width: 100%; overscroll-behavior-x: contain; }
.tablescroll--tall { max-height: min(70vh, 34rem); }

table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .875rem; }
table.data th, table.data td {
  text-align: start; padding: var(--s3); border-block-end: 1px solid var(--line); vertical-align: middle;
}
table.data tbody tr:last-child > * { border-block-end: 0; }
table.data thead th {
  position: sticky; top: 0; z-index: 3; background: var(--thead-bg); color: var(--ink-2);
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  line-height: 1.35; padding-block: var(--s2); border-block-end: 1px solid var(--line-2);
  box-shadow: 0 1px 0 var(--line-2), 0 2px 6px -4px var(--edge);
}
table.data th[scope="row"] { font-weight: 600; }
table.data tr.sev > * { color: var(--alert); }
table.data td.num, table.data th.num { text-align: end; font-variant-numeric: tabular-nums; }
/* every column after the first is numeric (keeps the markup small) */
table.data.num-rest > * > tr > :not(:first-child) { text-align: end; font-variant-numeric: tabular-nums; }
table.data.num-rest tbody tr.grp th { text-align: start; }
table.data tbody tr:not(.grp):hover > * { background: var(--row-hover); }
table.data tbody tr:not(.grp):focus-within > * { background: var(--row-hover); }
table.data a { color: var(--link); text-decoration: none; font-weight: 500; }
table.data a:hover { text-decoration: underline; }

/* group heading rows: the label stays put while the table scrolls sideways */
table.data tbody tr.grp th {
  background: var(--grp-bg); color: var(--ink-2); font-size: .6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; padding-block: var(--s2);
  border-block-end: 1px solid var(--line-2); position: relative; z-index: 1;
}
table.data tbody tr.grp th > span { position: sticky; inset-inline-start: var(--s3); display: inline-block; }

/* sticky first column, so district names survive a sideways scroll */
.data--sticky > * > tr > :first-child {
  position: sticky; inset-inline-start: 0; z-index: 2;
  background: var(--surface); border-inline-end: 1px solid var(--line);
}
.data--sticky thead th:first-child { z-index: 4; background: var(--thead-bg); }
.data--sticky tbody tr.grp th:first-child { z-index: 1; background: var(--grp-bg); border-inline-end: 0; }
.tablescroll.is-scrolled .data--sticky > * > tr > :first-child { box-shadow: var(--edge-shadow); }
.tablescroll { --edge-shadow: 4px 0 6px -4px var(--edge); }
[dir="rtl"] .tablescroll { --edge-shadow: -4px 0 6px -4px var(--edge); }

/* a fixed layout means sorting cannot move the columns */
.data--fixed { table-layout: fixed; min-width: 50rem; }
.data--fixed .cw-name { width: 30%; }

/* sort control: label + reserved-width icon, aligned at the inline end */
.sortbtn {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center;
  gap: var(--s2); width: 100%; font: inherit; color: inherit;
  text-transform: inherit; letter-spacing: inherit; text-align: inherit;
}
.sortbtn .lbl { flex: 1 1 auto; min-width: 0; text-wrap: balance; }
table.data th:first-child .sortbtn .lbl { flex: 0 1 auto; }
.sortbtn .ico { flex: 0 0 .875rem; width: .875rem; text-align: center; font-size: .8125rem; line-height: 1; opacity: .45; }
.sortbtn:hover { color: var(--ink); }
.sortbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
th[aria-sort="none"] .ico::after { content: "\2195"; }
th[aria-sort="ascending"] .ico::after { content: "\2191"; }
th[aria-sort="descending"] .ico::after { content: "\2193"; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--ink); }
th[aria-sort="ascending"] .ico, th[aria-sort="descending"] .ico { opacity: 1; color: var(--accent); }

/* ------------------------------------------------------------------- forms */
.form h3 { margin-bottom: var(--s1); }
.field-row { margin-top: var(--s4); }
.form label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: var(--s1); }
.form label.inline { display: flex; gap: var(--s2); align-items: center; font-weight: 400; margin-top: var(--s2); }
input[type=text], input[type=url], select, textarea {
  width: 100%; padding: var(--s2) var(--s3); font: inherit; font-size: .9375rem;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
textarea { min-height: 6rem; resize: vertical; }
.form .btn { margin-top: var(--s4); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.privacy { font-size: .8125rem; color: var(--ink-3); margin-top: var(--s3); }

/* -------------------------------------------------------- lists, accordions */
details.sector {
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  margin-top: var(--s2); overflow: hidden;
}
details.sector + details.sector { margin-top: var(--s2); }
details.sector > summary {
  cursor: pointer; font-weight: 600; font-size: .9375rem; padding: var(--s3) var(--s4);
  display: flex; align-items: center; gap: var(--s2); list-style-position: inside;
}
details.sector > summary::marker { color: var(--ink-3); }
details.sector > summary:hover { background: var(--surface-2); }
details.sector[open] > summary { border-block-end: 1px solid var(--line); background: var(--surface-2); }
details.sector .scount { margin-inline-start: auto; }
ul.orgs { list-style: none; padding: 0; margin: 0; }
ul.orgs > li {
  padding: var(--s2) var(--s4); border-block-start: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: baseline; font-size: .9375rem;
}
ul.orgs > li:first-child { border-block-start: 0; }
ul.orgs .oname { font-weight: 600; }
ul.orgs .osec { font-size: .8125rem; color: var(--ink-3); }
ul.orgs .badge { margin-inline-start: auto; }
.trend {
  background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent);
  border-radius: var(--r-sm); padding: var(--s3) var(--s4); max-width: 78ch; box-shadow: var(--shadow-1);
}
.trend strong { color: var(--accent-strong); }
.actions, .prose ul, .prose ol { padding-inline-start: 1.25rem; font-size: .9375rem; color: var(--ink-2); }
.actions li + li, .prose li + li { margin-top: var(--s2); }

/* ---------------------------------------------------------- home specifics */
.hero h1 { max-width: 28ch; }
.hero .lede { margin-top: var(--s4); max-width: 72ch; }
.countries { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); list-style: none; padding: 0; margin: 0; }
.ccard {
  display: flex; flex-direction: column; gap: var(--s2); height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1); padding: var(--s4); text-decoration: none; color: var(--ink);
}
.ccard:hover { border-color: var(--accent); box-shadow: var(--shadow-2); }
.ccard__name { font-weight: 700; font-size: 1.0625rem; }
.ccard__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2) var(--s3); font-size: .6875rem; line-height: 1.35; color: var(--ink-3); }
.ccard__stats b { display: block; font-size: 1.0625rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.meter { margin-top: auto; padding-top: var(--s2); }
.meter__svg { display: block; width: 100%; height: 6px; }
.meter__svg .track { fill: var(--surface-3); }
.meter__svg .fill { fill: var(--accent); }
.meter__label { display: block; font-size: .75rem; color: var(--ink-3); margin-top: var(--s1); }

/* ----------------------------------------------------- district two-column */
.cols { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 64rem) { .cols { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; } }
.side { display: grid; gap: var(--s4); }

/* ------------------------------------------------------------------ footer */
.footer {
  border-block-start: 1px solid var(--line); background: var(--surface);
  color: var(--ink-3); font-size: .8125rem; margin-top: var(--s7);
}
.footer__in { max-width: var(--maxw); margin: 0 auto; padding: var(--s5) var(--gutter); }
.footer p { max-width: 80ch; }
.footer a { color: var(--ink-2); }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s3); }

/* --------------------------------------------------------------------- RTL */
[dir="rtl"] .chart { direction: ltr; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 47.99rem) {
  :root { --gutter: var(--s4); }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.1875rem; }
  .finding__in { padding: var(--s4); }
  .finding .big { font-size: 1.0625rem; }
  table.data th, table.data td { padding: var(--s2) var(--s3); }
  .tablescroll--tall { max-height: min(70vh, 26rem); }
  .data--fixed { min-width: 44.5rem; }
  .data--fixed .cw-name { width: 9.5rem; }
  /* a bar chart scaled to a phone would set its labels in 8px type; give it a
     floor and let the card scroll instead of shrinking the text out of reach */
  .hchart { min-width: 27rem; }
  .hchart text.l { font-size: 16px; }
  .hchart text.d { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --shadow-1: none; --shadow-2: none; }
  .topbar, .footer, .tabs, .tools, .form, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page { max-width: none; padding: 0; }
  .card, .kpi, .tablecard, .finding, .trend { box-shadow: none; break-inside: avoid; }
  .tablescroll, .tablescroll--tall { overflow: visible; max-height: none; }
  table.data thead th { position: static; }
  .data--sticky > * > tr > :first-child { position: static; }
  a { color: #000; }
}
