/* Taniman insights. Restrained warm neutrals, one green accent. Series colors validated with the dataviz checker (light and dark). */
:root {
  color-scheme: light;
  --bg: #f8f9f5;
  --bg-2: #eef1ea;
  --hover: #e6eae1;
  --ink: #1d2620;
  --ink-2: #59635b;
  --grid: #e1e5dc;
  --base: #b5bcb1;
  --accent: #2c4a36;
  --on-fill: #fbfcf8;
  --err: #a3322a;
  --c1: #2f7a4b;
  --c2: #3f78c0;
  --c3: #d0702f;
  --c4: #9a5aa8;
  --shadow: 0 2px 10px rgb(29 38 32 / 0.14);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #151916;
    --bg-2: #1d231f;
    --hover: #252c27;
    --ink: #e8ece5;
    --ink-2: #a2aca3;
    --grid: #29302b;
    --base: #4a534c;
    --accent: #8fcf9f;
    --on-fill: #101410;
    --err: #f0897d;
    --c1: #4fae73;
    --c2: #6a9ee0;
    --c3: #e0803f;
    --c4: #b77fc4;
    --shadow: 0 2px 12px rgb(0 0 0 / 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto;
  max-width: 76rem;
  padding: 1.25rem 1rem 4rem;
  background: var(--bg);
  color: var(--ink);
  font: 0.9375rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (min-width: 700px) { body { padding: 1.75rem 1.5rem 5rem; } }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
button {
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--bg-2);
  border: 0;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
}
button:hover { background: var(--hover); }
button:disabled { color: var(--ink-2); cursor: progress; }

/* header */
.bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; }
.bar.sub { margin-top: 0.75rem; align-items: center; }
h1 { margin: 0; font-size: 1.125rem; font-weight: 650; color: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
nav a { color: var(--ink-2); text-decoration: none; padding: 0.25rem 0; }
nav a:hover { color: var(--ink); }
nav a[aria-current] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline 2px var(--accent);
  text-underline-offset: 0.45em;
}
.views { font-size: 1rem; }
.ranges { font-size: 0.875rem; gap: 0.25rem 1rem; }
.meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; font-size: 0.8125rem; color: var(--ink-2); }

/* content */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem 3rem;
  margin-top: 1.5rem;
  transition: opacity 150ms ease-out;
}
main.busy { opacity: 0.55; }
@media (min-width: 1000px) {
  main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  main > .figs, main > .note, main > .error, main > .wide { grid-column: 1 / -1; }
}
.block { min-width: 0; }
h2 { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 600; }
.note { margin: 0; color: var(--ink-2); }
.error h2 { color: var(--err); margin-bottom: 0.25rem; }
.error p { margin: 0 0 0.75rem; color: var(--ink-2); }

/* key figures */
.figs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 1.25rem 1rem;
  margin: 0;
  padding: 1rem;
  background: var(--bg-2);
  border-radius: 8px;
}
@media (min-width: 700px) { .figs { gap: 1.25rem 1.5rem; padding: 1.125rem 1.25rem; } }
.fig { min-width: 0; }
.fig dt { font-size: 0.8125rem; color: var(--ink-2); }
.fig dd { margin: 0.125rem 0 0; font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.fig dd span { display: block; margin-top: 0.125rem; font-size: 0.8125rem; font-weight: 400; color: var(--ink-2); }

/* legend + series colors */
.c1 { --c: var(--c1); }
.c2 { --c: var(--c2); }
.c3 { --c: var(--c3); }
.c4 { --c: var(--c4); }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0 0 0.625rem; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 0.375rem; }
.key { display: inline-block; flex: none; background: var(--c); }
.key.box { width: 10px; height: 10px; border-radius: 2px; }
.key.line { width: 14px; height: 2px; border-radius: 1px; }

/* charts */
.figure { margin: 0; }
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart text { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--base); stroke-width: 1; }
.chart path.line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart path.fill { fill: var(--c); }
.chart .dot { fill: var(--c); stroke: var(--bg); stroke-width: 2; }
.chart .hover { visibility: hidden; }
.chart .hover.on { visibility: visible; }
.chart rect.hover { fill: var(--hover); }
.chart line.hover { stroke: var(--base); stroke-width: 1; }
.tip {
  position: absolute;
  z-index: 1;
  visibility: hidden;
  pointer-events: none;
  padding: 0.5rem 0.625rem;
  background: var(--bg);
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.tip.on { visibility: visible; }
.tip p { margin: 0; display: flex; align-items: center; gap: 0.375rem; color: var(--ink-2); }
.tip p:first-child { margin-bottom: 0.25rem; }
.tip strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
details { margin-top: 0.5rem; }
summary { cursor: pointer; width: max-content; font-size: 0.8125rem; color: var(--ink-2); }
summary:hover { color: var(--ink); }
details[open] summary { margin-bottom: 0.5rem; }

/* part-to-whole bar */
.segrow { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); align-items: center; gap: 0.75rem; margin-bottom: 0.625rem; }
.seg-name, .seg-none { font-size: 0.8125rem; color: var(--ink-2); }
.seg { display: flex; gap: 2px; height: 28px; }
.seg > div {
  flex: 1 1 0;
  min-width: 2px;
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
  border-radius: 4px;
  background: var(--c);
  color: var(--on-fill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.seg > div.tight span { visibility: hidden; }
.segrow + .scroll { margin-top: 1rem; }

/* tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 0.4375rem 0.75rem; text-align: left; white-space: nowrap; }
thead th { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); background: var(--bg-2); }
thead th:first-child { border-radius: 6px 0 0 6px; }
thead th:last-child { border-radius: 0 6px 6px 0; }
tbody th { font-weight: 500; position: sticky; left: 0; background: var(--bg); }
thead th:first-child { position: sticky; left: 0; }
tbody tr:hover th { background: var(--bg-2); }
tbody tr:hover { background: var(--bg-2); }
.n { text-align: right; font-variant-numeric: tabular-nums; }
td.empty { color: var(--ink-2); white-space: normal; }
.meter { display: block; min-width: 4rem; height: 6px; border-radius: 3px; background: var(--grid); }
.meter span { display: block; height: 100%; border-radius: 3px; background: var(--c1); }
