/* The dashboards' charts and layout (public/app/viz.js), for the business dashboard and the admin
   portal. Dark only, like everything else. Colours are checked for colour-blind readers against the
   card (#161413); see docs/DASHBOARDS.md. */

:root {
  /* One series: the accent. The period before, and "other": grey. */
  --viz-accent: #3ecfa6;
  --viz-prev: #78716c;
  /* Several series, always in this order. */
  --viz-1: #199e70;
  --viz-2: #d95926;
  --viz-3: #3987e5;
  --viz-4: #c98500;
  --viz-5: #d55181;
  --viz-6: #008300;
  --viz-7: #9085e9;
  --viz-8: #e66767;
  /* How much: darker is fewer, brighter is more. Empty cells stay close to the card. */
  --viz-zero: #1f1c1a;
  --viz-seq-1: #163f34;
  --viz-seq-2: #165a48;
  --viz-seq-3: #18765e;
  --viz-seq-4: #1f9376;
  --viz-seq-5: #2db08e;
  --viz-seq-6: #3ecfa6;
  --viz-seq-7: #8ae6cb;
  /* Funnel stages: one hue, darker as it narrows; every step clears 2:1 on the card. */
  --viz-ord-1: #3ecfa6;
  --viz-ord-2: #31b892;
  --viz-ord-3: #26a07e;
  --viz-ord-4: #1e886a;
  --viz-ord-5: #187257;
  --viz-ord-6: #145e48;
  /* Good and bad, only where the data means good or bad (always with words or an icon too). */
  --viz-good: #47cd89;
  --viz-warn: #fdb022;
  --viz-bad: #f97066;
  /* Chart furniture: recessive hairlines. */
  --viz-grid: #292524;
  --viz-axis: #44403c;
  --viz-label: #78716c;
}

/* ---------- Page layout ---------- */
.view.wide {
  width: min(1480px, 100%);
}
.dash {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.dash > * {
  grid-column: span 12;
  min-width: 0;
}
.dash > .span-3 {
  grid-column: span 3;
}
.dash > .span-4 {
  grid-column: span 4;
}
.dash > .span-5 {
  grid-column: span 5;
}
.dash > .span-6 {
  grid-column: span 6;
}
.dash > .span-7 {
  grid-column: span 7;
}
.dash > .span-8 {
  grid-column: span 8;
}
@media (max-width: 1199px) {
  .dash > .span-3 {
    grid-column: span 6;
  }
  .dash > .span-4,
  .dash > .span-5,
  .dash > .span-7,
  .dash > .span-8 {
    grid-column: span 12;
  }
}
@media (max-width: 860px) {
  .dash > .span-3,
  .dash > .span-6 {
    grid-column: span 12;
  }
}
.dash + .dash,
.viz-tiles + .dash,
.dash + .viz-tiles {
  margin-top: 16px;
}
.view.is-loading .dash,
.view.is-loading .viz-tiles {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* Report pages, like tabs at the top of a report. */
.viz-tabs {
  display: flex;
  gap: 2px;
  margin: -8px 0 14px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.viz-tabs a {
  padding: 9px 12px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 540;
  text-decoration: none;
  white-space: nowrap;
}
.viz-tabs a:hover {
  color: var(--text);
}
.viz-tabs a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--brand);
}

/* ---------- The filter row ---------- */
.viz-filters {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: -6px 0 16px;
  padding: 10px 0;
  background: color-mix(in srgb, var(--bg-subtle) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@media (max-width: 900px) {
  .viz-filters {
    top: 56px;
  }
}
.viz-filters-main,
.viz-filters-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.viz-filters .select {
  width: auto;
  max-width: 220px;
  min-height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 13.5px;
}
.viz-chip {
  gap: 6px;
}
.viz-chip button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: -4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.viz-chip button:hover {
  background: var(--bg-muted);
}
.viz-updated {
  font-size: 12.5px;
  color: var(--text-3);
}
@media (max-width: 560px) {
  .viz-filters .segmented button {
    padding: 5px 9px;
  }
}

/* ---------- Stat tiles ---------- */
.viz-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.viz-tiles.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.viz-tiles.cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1280px) {
  .viz-tiles.cols-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1080px) {
  .viz-tiles,
  .viz-tiles.cols-3,
  .viz-tiles.cols-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 380px) {
  .viz-tiles,
  .viz-tiles.cols-3,
  .viz-tiles.cols-6 {
    grid-template-columns: 1fr;
  }
}
.viz-tile {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px 14px;
  color: inherit;
  text-decoration: none;
}
.viz-tile.is-link:hover {
  border-color: var(--border-strong);
}
.viz-tile-link {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}
.viz-tile-link:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.viz-tile .viz-info-btn {
  position: relative;
  z-index: 1;
}
.viz-tile-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.viz-tile-label {
  font-size: 13px;
  font-weight: 540;
  color: var(--text-2);
}
/* Proportional figures on big numbers (tabular only in columns). */
.viz-tile-value {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.viz-tile-unit {
  margin-left: 4px;
  font-size: 18px;
  color: var(--text-2);
}
.viz-tile-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 12.5px;
  color: var(--text-3);
}
.viz-tile-note {
  font-size: 12px;
  color: var(--text-3);
}
@media (max-width: 560px) {
  .viz-tile {
    padding: 14px 14px 12px;
  }
  .viz-tile-value {
    font-size: 25px;
  }
}
.viz-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.viz-delta.good {
  color: var(--good);
}
.viz-delta.bad {
  color: var(--bad);
}
.viz-delta.flat {
  font-weight: 520;
  color: var(--text-3);
}
.viz-spark {
  position: relative;
  height: 32px;
  margin-top: 4px;
}
.viz-spark svg {
  display: block;
  width: 100%;
  height: 32px;
  overflow: visible;
}
.viz-spark-line {
  fill: none;
  stroke: var(--viz-accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.viz-spark-prev {
  fill: none;
  stroke: var(--viz-prev);
  stroke-width: 1.5;
  stroke-linejoin: round;
  opacity: 0.8;
}
.viz-spark-area {
  fill: var(--viz-accent);
  opacity: 0.1;
}
.viz-spark-line.partial {
  stroke-dasharray: 3 3;
  opacity: 0.6;
}
.viz-spark-dot.partial {
  opacity: 0.6;
}
.viz-spark-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--viz-accent);
  box-shadow: 0 0 0 2px var(--surface);
  transform: translate(-50%, -50%);
}

/* Meters side by side (the catalogue): four a row, or two in a half-width card. */
.viz-meter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 28px;
}
.viz-meter-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1000px) {
  .viz-meter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .viz-meter-grid {
    grid-template-columns: 1fr;
  }
}

/* An explanation behind an (i): shown across the card it belongs to. */
.viz-info {
  display: inline-flex;
}
.viz-info-btn {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  font: 650 10px/1 var(--font);
  cursor: help;
}
.viz-info-btn:hover,
.viz-info-btn:focus-visible {
  color: var(--text);
  border-color: var(--text-3);
}
.viz-info-pop {
  position: absolute;
  z-index: 30;
  top: 44px;
  left: 12px;
  right: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--inverse);
  color: var(--on-inverse);
  font-size: 12.5px;
  font-weight: 450;
  letter-spacing: 0;
  line-height: 1.45;
  text-align: left;
  box-shadow: var(--shadow);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.viz-info:hover .viz-info-pop,
.viz-info-btn:focus + .viz-info-pop {
  visibility: visible;
  opacity: 1;
}

/* ---------- Chart cards ---------- */
.viz-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 20px 20px;
}
.viz-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 12px;
  margin-bottom: 14px;
}
.viz-card-head h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.viz-card-head p {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-2);
}
.viz-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.viz-mode button {
  padding: 3px 10px;
  font-size: 12.5px;
}
/* A measure switch in a card's head keeps each choice on one line, and wraps as a whole on phones. */
.viz-actions .segmented {
  flex-wrap: wrap;
  border-radius: 18px;
}
.viz-actions .segmented button {
  white-space: nowrap;
}
.viz-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
/* A chart that fills its card's height (the map beside a taller list). */
.viz-fill-plot {
  flex: 1 1 auto;
  min-height: 320px;
}
.viz-fill-plot > .viz-svg {
  position: absolute;
  inset: 0;
}
.viz-card-foot {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-3);
}
.viz-empty {
  display: grid;
  place-content: center;
  gap: 4px;
  min-height: 170px;
  padding: 12px;
  color: var(--text-3);
  font-size: 13.5px;
  text-align: center;
}
.viz-empty strong {
  font-size: 14px;
  color: var(--text-2);
}
@media (max-width: 560px) {
  .viz-card {
    padding: 16px 14px 16px;
  }
}

/* ---------- Inside the charts ---------- */
.viz {
  position: relative;
}
.viz-plot {
  position: relative;
}
.viz-svg {
  display: block;
  max-width: 100%;
  height: auto;
  overflow: visible;
}
.viz-svg:focus-visible {
  outline: none;
  border-radius: 8px;
  box-shadow: var(--focus);
}
.viz-grid {
  stroke: var(--viz-grid);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.viz-base {
  stroke: var(--viz-axis);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.viz-tick {
  fill: var(--viz-label);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.viz-tick.pick {
  cursor: pointer;
}
.viz-tick.pick:hover {
  fill: var(--text);
}
.viz-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.viz-area {
  opacity: 0.1;
}
/* The bucket still in progress (today, this week). */
.viz-line.partial {
  stroke-dasharray: 4 4;
  opacity: 0.6;
}
.viz-dot.partial {
  opacity: 0.6;
}
.viz-col.partial {
  opacity: 0.5;
}
.viz-dot {
  stroke: var(--surface);
  stroke-width: 2;
}
.viz-hair {
  stroke: var(--text-3);
  stroke-width: 1;
}
.viz-col {
  transition: opacity 0.12s;
}
.viz-hit.pick {
  cursor: pointer;
}
.viz-cell.on {
  stroke: var(--text);
  stroke-width: 1.5;
}
.viz-cell-label {
  fill: var(--text);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.viz-cell-label.on-bright {
  fill: var(--on-brand);
}
.viz-ring {
  fill: none;
  stroke: var(--viz-grid);
  stroke-width: 1;
}
.viz-centre {
  fill: var(--text-3);
}
.viz-bubble-dot {
  fill: var(--viz-accent);
  fill-opacity: 0.55;
  stroke: var(--surface);
  stroke-width: 2;
  transition: fill-opacity 0.12s;
}
.viz-bubble:hover .viz-bubble-dot {
  fill-opacity: 0.85;
}
.viz-bubble.picked .viz-bubble-dot {
  fill-opacity: 0.95;
  stroke: var(--text);
}
.viz-bubble.dim .viz-bubble-dot {
  fill-opacity: 0.22;
}
.viz-map .pick {
  cursor: pointer;
}
.viz-map .pick:focus-visible {
  outline: none;
  stroke: var(--text);
  stroke-width: 2;
}
.viz-map-label {
  fill: var(--text-2);
  font-size: 11.5px;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* The tooltip: values lead, names follow. */
.viz-tip {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--inverse);
  color: var(--on-inverse);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: var(--shadow);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
}
.viz-tip-title {
  font-size: 11.5px;
  color: color-mix(in srgb, var(--on-inverse) 62%, transparent);
}
.viz-tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.viz-tip-row strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.viz-tip-row strong + span {
  color: color-mix(in srgb, var(--on-inverse) 72%, transparent);
}

/* Legends and keys: a short line for lines, a block for bars and areas. */
.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.viz-key {
  display: inline-block;
  flex: none;
  background: var(--key);
}
.viz-key.line {
  width: 14px;
  height: 2.5px;
  border-radius: 2px;
}
.viz-key.box {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Ranked bars */
.viz-ranked {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.viz-ranked li {
  transition: opacity 0.12s;
}
.viz-rank-row {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.viz-rank-row {
  cursor: pointer;
}
button.viz-rank-row:hover {
  background: var(--bg-muted);
}
.viz-rank-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}
.viz-rank-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.viz-rank-label > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viz-rank-label small,
.viz-rank-value small {
  font-size: 12px;
  font-weight: 450;
  color: var(--text-3);
}
.viz-rank-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.viz-rank-track {
  display: block;
  height: 8px;
}
.viz-rank-fill {
  display: flex;
  gap: 2px;
  height: 100%;
}
.viz-rank-part {
  display: block;
  min-width: 2px;
  height: 100%;
}
.viz-rank-part:last-child {
  border-radius: 0 4px 4px 0;
}
.viz-ranked.has-pick li:not(.picked) {
  opacity: 0.45;
}
.viz-ranked li.picked .viz-rank-row {
  background: var(--bg-muted);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* Part to whole */
.viz-share-bar {
  display: flex;
  gap: 2px;
  height: 12px;
}
.viz-share-bar > span {
  min-width: 3px;
}
.viz-share-bar > span:first-child {
  border-radius: 4px 0 0 4px;
}
.viz-share-bar > span:last-child {
  border-radius: 0 4px 4px 0;
}
.viz-share-bar > span:only-child {
  border-radius: 4px;
}
.viz-share-bar > .empty {
  flex: 1;
  background: var(--viz-zero);
}
.viz-share-list {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.viz-share-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 3.2em;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}
.viz-share-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.viz-share-name small {
  font-size: 12px;
  color: var(--text-3);
}
.viz-share-list strong {
  font-variant-numeric: tabular-nums;
}
.viz-share-pct {
  color: var(--text-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Funnel */
.viz-funnel {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.viz-funnel li {
  display: grid;
  gap: 5px;
}
.viz-funnel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
}
.viz-funnel-head strong {
  font-variant-numeric: tabular-nums;
}
.viz-funnel-track {
  display: block;
  height: 10px;
  border-radius: 4px;
  background: var(--viz-zero);
}
.viz-funnel-fill {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
}
.viz-funnel-note {
  font-size: 12px;
  color: var(--text-3);
}

/* Heatmap scale */
.viz-scale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
}
.viz-scale-steps {
  display: inline-flex;
  gap: 2px;
}
.viz-scale-steps span {
  width: 16px;
  height: 10px;
  border-radius: 2px;
}

/* Meters */
.viz-meters {
  display: grid;
  gap: 18px;
}
.viz-meter {
  display: grid;
  gap: 7px;
}
.viz-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}
.viz-meter-head strong {
  font-variant-numeric: tabular-nums;
}
.viz-meter-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--viz-accent) 16%, var(--surface));
}
.viz-meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 4px;
  background: var(--viz-accent);
}
.viz-meter.warn .viz-meter-track {
  background: color-mix(in srgb, var(--viz-warn) 14%, var(--surface));
}
.viz-meter.warn .viz-meter-fill {
  background: var(--viz-warn);
}
.viz-meter-target {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--text);
}
.viz-meter-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

/* Tables: the charts' accessible twins, and the leaderboards. */
.viz-table-wrap {
  max-height: 440px;
  overflow: auto;
}
.viz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.viz-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.viz-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.viz-table th.sortable:hover {
  color: var(--text);
}
.viz-table th[aria-sort="descending"]::after {
  content: " ↓";
}
.viz-table th[aria-sort="ascending"]::after {
  content: " ↑";
}
.viz-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.viz-table tr:last-child td {
  border-bottom: 0;
}
.viz-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.viz-table tbody tr.pick {
  cursor: pointer;
}
.viz-table tbody tr.pick:hover td {
  background: var(--bg-muted);
}
.viz-table tbody tr.picked td {
  background: var(--bg-muted);
}
/* A number with a bar behind it (conditional formatting in a table). */
.viz-cellbar {
  position: relative;
  display: block;
  min-width: 96px;
  padding: 1px 0;
  text-align: right;
}
.viz-cellbar::before {
  content: "";
  position: absolute;
  inset: 2px auto 2px 0;
  width: var(--w);
  border-radius: 3px;
  background: color-mix(in srgb, var(--viz-accent) 22%, transparent);
}
.viz-cellbar.warn::before {
  background: color-mix(in srgb, var(--viz-warn) 24%, transparent);
}
.viz-cellbar > span {
  position: relative;
  padding: 0 6px;
}
.viz-name-cell {
  display: grid;
  min-width: 140px;
}
.viz-name-cell small {
  font-size: 12px;
  color: var(--text-3);
}

/* Things the team should act on, at the top of the overview. */
.viz-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.viz-alerts a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border));
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}
.viz-alerts a strong {
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}
.viz-alerts a:hover {
  border-color: var(--warn);
}

/* A plain list of figures inside a card. */
.viz-facts {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.viz-facts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}
.viz-facts li:first-child {
  border-top: 0;
}
.viz-facts strong {
  font-variant-numeric: tabular-nums;
}
.viz-facts small {
  display: block;
  color: var(--text-3);
  font-size: 12px;
}

/* ---------- Saving as PDF ---------- */
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  html,
  body {
    background: var(--bg) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .sidebar,
  .topbar,
  .tabbar,
  .nav-scrim,
  .toasts,
  .viz-actions,
  .viz-filters-side,
  .viz-filters .segmented button[aria-pressed="false"],
  .viz-chip button,
  .viz-info,
  .no-print {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .view,
  .view.wide {
    width: 100%;
    padding: 0;
  }
  .viz-filters {
    position: static;
    backdrop-filter: none;
    background: none;
  }
  .viz-card,
  .viz-tile,
  .callout {
    break-inside: avoid;
  }
  /* Paper is about 1,050px wide: keep the desktop layout rather than the tablet one. */
  .viz-alerts {
    display: none;
  }
  .viz-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .viz-tiles.cols-3,
  .viz-tiles.cols-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dash > .span-3 {
    grid-column: span 3;
  }
  .dash > .span-4 {
    grid-column: span 4;
  }
  .dash > .span-5 {
    grid-column: span 5;
  }
  .dash > .span-6 {
    grid-column: span 6;
  }
  .dash > .span-7 {
    grid-column: span 7;
  }
  .dash > .span-8 {
    grid-column: span 8;
  }
  .viz-meter-grid:not(.two) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
