/* Charts: histogram, heatmap, stacked bars, horizontal bars, gauge, timeline. */

/* histogram */
.hist { margin: 18px 0 4px; }
.hist-plot {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 150px;
  padding-top: 18px;
  border-bottom: 1px solid var(--line);
}
.hist-bin { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; }
.hist-bar { position: relative; display: block; width: 100%; background: var(--navy-soft); border-radius: 3px 3px 0 0; }
.hist-bin.is-above .hist-bar { background: var(--navy); }
.hist-n {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 2px;
  font-size: 9.5px;
  color: var(--note);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hist-cut { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed var(--ink); }
.hist-cut-label {
  position: absolute;
  top: -2px;
  left: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255, 255, 255, .9);
  padding: 0 3px;
}
.hist-axis { position: relative; height: 20px; font-size: 10.5px; color: var(--label); }
.hist-tick { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }

/* heatmap (table) */
.hm { border-collapse: separate; border-spacing: 2px; width: 100%; min-width: 820px; table-layout: fixed; font-size: 11px; }
.hm th { font-weight: 500; }
.hm-corner { width: 170px; }
.hm-col { color: var(--label); font-size: 10px; text-align: left; white-space: nowrap; overflow: visible; height: 18px; }
.hm-row { text-align: left; white-space: nowrap; font-size: 12px; color: var(--ink); padding-right: 8px; overflow: hidden; text-overflow: ellipsis; }
.hm-code { color: var(--label); font-size: 11px; font-variant-numeric: tabular-nums; }
.hm-cell { height: 24px; border-radius: 3px; }
.hm-total { width: 58px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-size: 11.5px; }
th.hm-total { color: var(--label); font-size: 10px; }
.l0 { background: var(--hm0); }
.l1 { background: var(--hm1); }
.l2 { background: var(--hm2); }
.l3 { background: var(--hm3); }
.l4 { background: var(--hm4); }
.l5 { background: var(--hm5); }
.hm-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--note); }
.hm-swatch { width: 12px; height: 12px; border-radius: 2px; }
.hm-legend span:first-child { margin-right: 4px; }
.hm-legend span:last-child { margin-left: 4px; }

/* stacked bars */
.sb { margin: 14px 0 12px; display: grid; gap: 14px; }
.sb-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 12.5px; }
.sb-name { font-weight: 600; }
.sb-meta { color: var(--note); font-size: var(--fs-note); text-align: right; }
.sb-bar { display: flex; height: 26px; border-radius: 0 4px 4px 0; overflow: hidden; background: var(--line-soft); }
.sb-seg {
  display: grid;
  place-items: center;
  background: var(--c);
  color: var(--fg);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
}

/* horizontal bars */
.hb { display: grid; gap: 8px; margin: 14px 0 12px; }
.hb-row { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr) 64px; gap: 10px; align-items: center; }
.hb-label { font-size: 12.5px; color: var(--text); line-height: 1.35; }
.hb-sub { display: block; color: var(--label); font-size: 11px; font-variant-numeric: tabular-nums; }
.hb-track { position: relative; height: 16px; }
.hb-bar { display: block; height: 100%; background: var(--navy-soft); border-radius: 0 4px 4px 0; }
.hb-row.is-hl .hb-bar { background: var(--navy); }
.hb-row.is-hl .hb-label { color: var(--ink); font-weight: 600; }
.hb-ref { position: absolute; top: -3px; bottom: -3px; border-left: 1.5px dashed var(--ink); }
.hb-value { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* gauge */
.gauge { margin: 4px 0 10px; }
.gauge-head { display: flex; justify-content: space-between; align-items: baseline; }
.gauge-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gauge-track { position: relative; height: 10px; margin-top: 6px; background: var(--line-soft); border-radius: 0 5px 5px 0; }
.gauge-zone { position: absolute; left: 90%; right: 0; top: 0; bottom: 0; background: var(--hot-bg); border-radius: 0 5px 5px 0; }
.gauge-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--navy); border-radius: 0 5px 5px 0; opacity: .85; }
.gauge-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); }
.gauge-axis { position: relative; height: 16px; font-size: 10px; color: var(--label); }
.gauge-axis span { position: absolute; top: 2px; transform: translateX(-50%); }
.gauge-axis span:first-child { transform: none; }
.gauge-axis span:last-child { transform: translateX(-100%); }

/* timeline */
.tl { display: grid; gap: 2px; }
.tl-lane, .tl-axis { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 6px; }
.tl-label { font-size: 10.5px; color: var(--label); font-variant-numeric: tabular-nums; }
.tl-track { position: relative; height: 14px; background: var(--line-soft); border-radius: 3px; }
.tl-axis .tl-track { background: none; height: 16px; }
.tl-dot { position: absolute; top: 3px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px #fff; }
.tl-year { position: absolute; top: 0; font-size: 10px; color: var(--label); border-left: 1px solid var(--line); padding-left: 3px; height: 14px; line-height: 14px; }
