/* =========================================================================
   Solar4Good — King Kong design system, applied to a sales dashboard.

   Ink ground for the header band, cream for reading, paper for cards.
   Acid-neon does exactly one job: it marks the single number that matters
   and the primary action. It is never used to colour data, because a chart
   needs several colours and neon would stop meaning anything.

   Chart colours are a separate, quieter set, each checked for colour-blind
   separation and contrast against the cream surface they sit on.
   ========================================================================= */

:root {
  /* brand tokens */
  --ink: #0a0d08;
  --ink2: #141a11;
  --neon: #c3f53c;
  --neon-d: #7fae00;
  --cream: #f5f7f0;
  --sage: #eef7e0;
  --paper: #ffffff;
  --read: #22271e;
  --muted: #5a625c;
  --line: #e4e8e0;

  --disp: 'Bebas Neue', Oswald, 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --wrap: 1160px;

  /* radius, per the system: pills 30, cards 18–20, small 10–16 */
  --r-pill: 30px;
  --r-card: 18px;
  --r-sm: 12px;
  --r-xs: 8px;

  --shadow-card: 0 16px 36px -26px rgba(20, 26, 17, 0.35);
  --glow: 0 0 32px rgba(195, 245, 60, 0.35);

  /* data colours — not brand accents */
  --d1: #2a78d6;
  --d-rest: #9c9a94;
  --good: #0ca30c;
  --warn: #fab219;
  --bad: #d03b3b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--read);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
p,
dl,
dd,
dt {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--neon-d);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--neon);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-family: var(--disp);
  letter-spacing: 0.06em;
  z-index: 60;
}
.skip:focus {
  left: 8px;
  top: 8px;
}

/* --------------------------------------------------------- display type */

.eyebrow {
  display: block;
  font-family: var(--disp);
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
  margin-bottom: 6px;
}

.cell-title {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

/* --------------------------------------------------------------- topbar */

.topbar {
  background: var(--ink);
  color: #fff;
  position: relative;
}

.topbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-top: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 20px;
  height: 20px;
  flex: none;
  background:
    linear-gradient(var(--neon), var(--neon)) 0 100% / 4px 45% no-repeat,
    linear-gradient(var(--neon), var(--neon)) 8px 100% / 4px 75% no-repeat,
    linear-gradient(var(--neon), var(--neon)) 16px 100% / 4px 100% no-repeat;
}

.brand-name {
  font-family: var(--disp);
  font-size: 25px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.source-note {
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: baseline;
}

.dot-sep {
  color: rgba(255, 255, 255, 0.3);
}

.source-file {
  color: rgba(255, 255, 255, 0.66);
}

a.source-file {
  color: var(--neon);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a.source-file:hover {
  border-bottom-color: currentColor;
}

.source-age {
  color: rgba(255, 255, 255, 0.45);
}

/* ------------------------------------------------------------------ hero */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 48px;
  padding-top: 38px;
  padding-bottom: 36px;
}

.hero-figure {
  min-width: 0;
}

/* The glow on the number reaches 32px, so the label is kept clear of it. */
.hero .eyebrow {
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 22px;
}

/* The one thing neon marks in this view. */
.hero-number {
  display: block;
  font-family: var(--disp);
  font-size: clamp(64px, 11vw, 128px);
  line-height: 0.74;
  color: var(--neon);
  text-shadow: var(--glow);
  letter-spacing: 0.01em;
}

.hero-meta {
  display: block;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
}

.statrail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 34px;
  padding: 0;
}

.statrail div {
  min-width: 0;
}

.statrail dt {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.statrail dd {
  font-family: var(--disp);
  font-size: 34px;
  line-height: 1;
  color: #fff;
  margin-top: 4px;
}

/* --------------------------------------------------------------- nav tabs */

.sectionnav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0;
}

.sectionnav::-webkit-scrollbar {
  display: none;
}

.navlink {
  flex: none;
  padding: 10px 15px 11px;
  font-family: var(--disp);
  font-size: 17px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  white-space: nowrap;
  line-height: 1.2;
  border-bottom: 3px solid transparent;
}

.navlink:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.navlink.is-on {
  color: var(--ink);
  background: var(--neon);
  border-bottom-color: var(--neon);
}

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

.state-msg {
  max-width: var(--wrap);
  margin: 48px auto;
  padding: 0 24px;
  color: var(--muted);
}

.state-error {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--read);
  border-left: 3px solid var(--bad);
  padding-left: 14px;
  margin-left: 24px;
  margin-right: 24px;
}

.state-hint {
  color: var(--muted);
}

/* ---------------------------------------------------------------- buttons */

.btn {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 9px 18px;
  font-family: var(--disp);
  font-size: 16px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.2;
  cursor: pointer;
  color: var(--read);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  border-color: var(--muted);
}

.btn:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.55;
}

.btn-quiet {
  background: transparent;
  color: var(--muted);
}

.btn-quiet:hover:not(:disabled) {
  color: var(--read);
  background: var(--cream);
}

/* Primary = neon fill, ink text. One per view. */
.btn-primary {
  background: var(--neon);
  border-color: var(--neon);
  color: var(--ink);
}

.btn-primary:hover:not(:disabled) {
  background: #b3e82c;
  border-color: #b3e82c;
}

/* Ghost on ink */
.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-filter.has-filters {
  border-color: var(--neon-d);
  color: var(--ink);
  background: var(--sage);
}

.filter-icon {
  width: 13px;
  height: 10px;
  flex: none;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 13px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 2px 4px / 9px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 4.5px 8px / 4px 2px no-repeat;
}

.filter-count {
  background: var(--neon-d);
  color: #fff;
  border-radius: var(--r-pill);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.iconbtn {
  appearance: none;
  background: none;
  border: 0;
  font-size: 24px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--muted);
  border-radius: var(--r-xs);
}

.iconbtn:hover {
  background: var(--cream);
  color: var(--read);
}

/* ---------------------------------------------------------------- toolbar */

.toolbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 25;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.tool {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tool-custom {
  gap: 6px;
}

.tool-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.control {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  font-size: 14px;
  color: var(--read);
  max-width: 210px;
  min-width: 0;
}

select.control {
  cursor: pointer;
}

.control:hover {
  border-color: var(--muted);
}

.toolbar-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.toolbar-count strong {
  color: var(--read);
  font-variant-numeric: tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-bottom: 12px;
}

.chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--sage);
  border: 1px solid #d6e8bb;
  color: #3f4a2c;
  border-radius: var(--r-pill);
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  max-width: 320px;
}

.chip:hover {
  border-color: var(--neon-d);
}

.chip-label {
  color: #6a7757;
}

.chip-value {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-x {
  font-size: 16px;
  line-height: 1;
  color: #6a7757;
}

.chip-clear {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

/* ----------------------------------------------------------------- drawer */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 8, 0.44);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: var(--paper);
  z-index: 45;
  display: flex;
  flex-direction: column;
  transform: translateX(101%);
  transition: transform 0.18s ease;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.drawer-head h2 {
  font-family: var(--disp);
  font-size: 26px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.drawer-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex: none;
}

.drawer-foot-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.field .control {
  max-width: none;
  width: 100%;
}

.filter-summary {
  font-size: 13px;
  color: var(--muted);
}

.filter-summary strong {
  color: var(--read);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- page */

.page {
  padding-top: 22px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ------------------------------------------------------------------- KPIs */

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 15px 16px 16px;
  min-width: 0;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  font-family: var(--disp);
  font-size: 40px;
  line-height: 0.95;
  margin-top: 9px;
  color: var(--read);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-spark {
  margin-top: 9px;
  height: 26px;
}

.spark {
  display: block;
  overflow: visible;
}

.spark-line {
  fill: none;
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.spark-area {
  opacity: 0.12;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

.status-good {
  background: var(--good);
}
.status-warn {
  background: var(--warn);
}
.status-bad {
  background: var(--bad);
}

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-width: 0;
  scroll-margin-top: 86px;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px 20px 15px;
  border-bottom: 1px solid var(--line);
}

.card-head h2 {
  font-family: var(--body);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--read);
}

.card-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 5px;
  max-width: 64ch;
}

.head-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.card-body {
  padding: 18px 20px;
  min-width: 0;
}

.card-body-flush {
  padding: 0;
  overflow-x: auto;
}

.scroll-x {
  overflow-x: auto;
}

.card-foot {
  padding: 12px 20px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.note {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 94ch;
}

.empty {
  color: var(--muted);
  padding: 30px 0;
  text-align: center;
}

.subhead {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.overview-cell {
  min-width: 0;
}

/* ----------------------------------------------------------------- legend */

.legend {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
}

.legend-stack {
  flex-direction: column;
  gap: 8px;
  margin: 0;
  flex: 1 1 160px;
  min-width: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-width: 0;
}

.legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex: none;
}

.legend-label {
  color: var(--read);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  padding-left: 10px;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ donut */

.donut-box {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.donut-wrap {
  position: relative;
  flex: none;
  width: 168px;
  height: 168px;
}

.donut {
  display: block;
}

.donut-centre {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-total {
  font-family: var(--disp);
  font-size: 34px;
  line-height: 1;
  color: var(--read);
}

.donut-caption {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 3px;
}

/* ------------------------------------------------------------- leaderboard */

.ltable,
.dtable,
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.ltable th,
.dtable th {
  text-align: left;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: bottom;
}

.ltable td {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ltable tbody tr:last-child td {
  border-bottom: 0;
}

.ltable tbody tr:hover td {
  background: var(--cream);
}

.sortbtn {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 8px 4px 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sortbtn:hover {
  color: var(--read);
}

.caret {
  color: var(--neon-d);
  font-size: 10px;
  line-height: 1;
}

th.is-sorted .sortbtn {
  color: var(--read);
}

.l-rank {
  width: 36px;
  padding-right: 8px !important;
}

.rankpill,
.rankplain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rankpill {
  border-radius: var(--r-pill);
  color: #fff;
  padding: 0 7px;
}

.rank-1 {
  background: #2a78d6;
}
.rank-2 {
  background: #eb6834;
}
.rank-3 {
  background: #1baf7a;
}

.rankplain {
  color: var(--muted);
}

.l-name {
  min-width: 120px;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px !important;
  font-weight: 600;
}

.l-bar {
  width: 20%;
  min-width: 78px;
  padding-right: 16px !important;
}

.l-num,
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-left: 14px !important;
  white-space: nowrap;
}

.l-good {
  color: #0a7d0a;
}
.l-warn {
  color: #8a6008;
}
.l-bad {
  color: #a92f2f;
}

.bar-track {
  height: 10px;
  background: var(--cream);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--d1);
  border-radius: var(--r-pill);
  min-width: 3px;
}

/* -------------------------------------------------------------------- bars */

.bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 280px) minmax(60px, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-radius: var(--r-xs);
}

.bar-row:hover {
  background: var(--cream);
}

.bar-name {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.bar-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
  margin-top: 6px;
}

.bar-name-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bar-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-note {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bar-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 48px;
  font-weight: 700;
}

/* ------------------------------------------------------------------- plots */

.trend {
  position: relative;
  width: 100%;
}

.plot-svg {
  display: block;
  width: 100%;
}

.plot-svg .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.plot-svg .baseline {
  stroke: #cdd3c8;
  stroke-width: 1;
}

.plot-svg .trend-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.plot-svg .trend-area {
  opacity: 0.1;
}

.plot-svg .plot-dot {
  stroke: var(--paper);
  stroke-width: 2;
}

.plot-svg .crosshair {
  stroke: #cdd3c8;
  stroke-width: 1;
}

.plot-svg .axis-y,
.plot-svg .axis-x {
  fill: var(--muted);
  font-size: 11.5px;
  font-family: var(--body);
  font-variant-numeric: tabular-nums;
}

.plot-svg .axis-y {
  text-anchor: end;
}

.tip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13px;
  white-space: nowrap;
  z-index: 5;
  min-width: 130px;
}

.tip-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11.5px;
  margin-bottom: 5px;
}

.tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-row + .tip-row {
  margin-top: 3px;
}

.tip-key {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  flex: none;
}

.tip-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tip-name {
  color: rgba(255, 255, 255, 0.68);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.tip-total {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin-top: 6px;
  padding-top: 6px;
}

.single-point {
  padding: 26px 0;
  text-align: center;
  color: var(--muted);
}

/* ------------------------------------------------------------------ matrix */

.matrix-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.matrix {
  border-collapse: separate;
  border-spacing: 2px;
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}

.matrix th {
  font-weight: 700;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  padding: 7px 8px;
  text-align: center;
}

.matrix-corner,
.matrix-rowhead {
  position: sticky;
  left: 0;
  background: var(--paper);
  text-align: left !important;
  z-index: 1;
  min-width: 132px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--line);
}

.matrix-rowhead {
  font-size: 13px;
  font-weight: 600;
  color: var(--read);
}

.matrix-cell {
  text-align: center;
  padding: 7px 8px;
  min-width: 42px;
  font-size: 12.5px;
  border-radius: var(--r-xs);
}

.matrix-zero {
  background: var(--cream);
}

.matrix-total {
  text-align: right !important;
  font-weight: 700;
  padding: 7px 10px;
  white-space: nowrap;
  border-left: 1px solid var(--line);
}

.matrix-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.matrix-swatch {
  width: 22px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.matrix-legend-label {
  margin: 0 5px;
}

/* ------------------------------------------------------------------- table */

.dtable {
  font-size: 13px;
}

.dtable th {
  padding: 12px 12px 10px;
  background: var(--paper);
  border-bottom: 1px solid #cdd3c8;
}

.dtable td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dtable tbody tr:hover td {
  background: var(--cream);
}

.dtable td.num {
  font-variant-numeric: tabular-nums;
}

.muted-col {
  color: var(--muted);
}

.as-typed {
  color: var(--muted);
  font-style: italic;
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  background: var(--cream);
  color: var(--muted);
  border: 1px solid var(--line);
}

.pill-good {
  background: #e8f6e8;
  color: #0a6b0a;
  border-color: #bfe4bf;
}

.pill-warn {
  background: #fdf3dd;
  color: #7d5606;
  border-color: #f0dcae;
}

.pill-bad {
  background: #fbeaea;
  color: #9c2b2b;
  border-color: #eec4c4;
}

.pager {
  justify-content: space-between;
}

.pager-info,
.pager-page {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pager-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* ------------------------------------------------------------------ footer */

.pagefoot {
  color: var(--muted);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  max-width: 90ch;
}

.is-refreshing {
  opacity: 0.55;
  transition: opacity 0.12s linear;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1240px) {
  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .overview-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }
}

@media (max-width: 860px) {
  .statrail {
    gap: 10px 24px;
  }
  .statrail dd {
    font-size: 27px;
  }
}

@media (max-width: 720px) {
  .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-value {
    font-size: 33px;
  }
  .hero {
    padding-top: 28px;
    padding-bottom: 26px;
    gap: 22px 28px;
  }
  .hero .eyebrow {
    margin-bottom: 16px;
  }
  .hero-meta {
    margin-top: 18px;
  }
  .card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .card-head h2 {
    font-size: 21px;
  }
  .head-tools .control,
  .head-tools .segmented {
    width: 100%;
  }
  .head-tools .seg {
    flex: 1 1 auto;
    text-align: center;
  }
  .toolbar {
    position: static;
  }
  .tool {
    flex: 1 1 100%;
  }
  .tool .control {
    flex: 1 1 auto;
    max-width: none;
  }
  .toolbar-count {
    margin-left: 0;
  }
  .bar-row {
    grid-template-columns: minmax(110px, 46%) minmax(40px, 1fr) auto;
    gap: 10px;
  }
  .l-bar {
    display: none;
  }
  .donut-box {
    justify-content: center;
  }
  .topbar-right {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }
  .source-note {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* segmented control (chart view switches) */
.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--paper);
}

.seg {
  appearance: none;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 7px 14px;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
}

.segmented .seg:last-child {
  border-right: 0;
}

.seg:hover {
  background: var(--cream);
  color: var(--read);
}

.seg.is-on {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}
