/* the charts (the same as in INTECHI FINANCE) */
/* One file for one part of the application: a change of that part touches only this file. */

/* ---- charts (the same as in INTECHI FINANCE) ---- */
:root {
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --mark-other: #a9b0aa;
}
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 16px;
}
.chart {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.chart h3 {
  margin: 0;
  font-size: 16px;
}
.chart .svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.chart .donut {
  width: 190px;
  height: 190px;
  flex: none;
}
.donut-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink);
}
.legend li {
  display: flex;
  align-items: center;
  gap: 7px;
}
.legend .key {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: none;
}
.legend-col {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  flex: 1;
  min-width: 160px;
}
.legend-col li {
  justify-content: flex-start;
}
.legend-col li b {
  margin-left: auto;
  font-weight: 600;
}
.svg .grid {
  stroke: var(--grid);
  stroke-width: 1;
}
.svg .base {
  stroke: var(--grid);
  stroke-width: 1;
}
.svg .link {
  stroke: var(--grid);
  stroke-width: 1;
}
.svg .ax {
  fill: var(--muted);
  font-size: 11px;
  font-family: Manrope, system-ui, sans-serif;
}
.svg .lab {
  fill: var(--ink);
  font-size: 12.5px;
  font-family: Manrope, system-ui, sans-serif;
}
.svg .val {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}
.svg .center-v {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}
.svg .hit {
  fill: transparent;
}
.svg .cat:hover .hit,
.svg .cat:focus .hit {
  fill: rgba(21, 32, 27, 0.05);
}
.svg .cat {
  outline: none;
}
.svg .cat:focus-visible .hit {
  stroke: #f59331;
  stroke-width: 2;
}
.svg .xhair {
  stroke: #8a948d;
  stroke-width: 1;
  opacity: 0;
}
.svg .cat:hover .xhair,
.svg .cat:focus .xhair {
  opacity: 1;
}
.svg .arc {
  transition: opacity 0.15s;
  outline: none;
}
.svg .arc:hover,
.svg .arc:focus {
  opacity: 0.8;
}
.chart-table summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  min-height: 32px;
  display: flex;
  align-items: center;
}
.chart-table table {
  font-size: 13px;
}
.chart-table th[scope],
.chart-table tbody th {
  font-weight: 600;
}
.tt {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: #15201b;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: 280px;
}
.tt[hidden] {
  display: none;
}
.tt-title {
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.85;
}
.tt-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tt-row b {
  font-weight: 700;
  color: #fff;
}
.tt-row span:last-child {
  opacity: 0.8;
}
.tt-key {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  flex: none;
}
.svg .center-v {
  font-size: 12px;
}
/* the chart is as wide as its card (it scales); only on a phone it keeps a readable size and scrolls inside the card, never over the edge of it */
@media (max-width: 640px) {
  .svg-wrap {
    overflow-x: auto;
  }
  .svg-wrap .svg {
    min-width: 520px;
  }
}
.svg .lab.strong {
  font-weight: 700;
}
.svg-wrap {
  overflow: visible;
}
@media (max-width: 640px) {
  .svg-wrap {
    overflow-x: auto;
    overflow-y: hidden;
  }
}
.tt {
  max-width: none;
  width: max-content;
}
.tt-row,
.tt-row b,
.tt-row span {
  white-space: nowrap;
}
.tt-row {
  gap: 10px;
}
.legend-col li b,
.scn-value,
.donut-row .mono {
  white-space: nowrap;
}
.tt-row.tt-sum {
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
html[data-theme='dark'] .chart .svg .xhair {
  stroke: #6c7a73;
}
html[data-theme='dark'] .svg .cat:hover .hit,
html[data-theme='dark'] .svg .cat:focus .hit {
  fill: rgba(255, 255, 255, 0.07);
}
html[data-theme='dark'] .svg .link {
  stroke: var(--grid);
}
.svg .lab.sm {
  font-size: 11.5px;
}
.svg .cat .hit {
  rx: 8;
  ry: 8;
}
a.chart-link {
  cursor: pointer;
}
a.chart-link:hover .arc,
a.chart-link:hover path {
  opacity: 0.85;
}

.home-charts {
  margin-top: 14px;
}
.home-charts + .co-tiles,
.co-tiles {
  margin-top: 14px;
}
