/* Styles for assets/viz.js, the chart and dashboard library. viz.js loads this file itself, so a page that
   imports viz.js needs nothing more; a page can also link it in its own HTML to have it before the script runs.
   Colours come only from the --calc-* variables, so the charts follow whatever light or dark theme the page has.
   This file is the source: edit it directly. Charts and controls are .viz-*; anything clickable has .viz-pick.
   .viz-svg on an element gives the SVG inside it the shared axis, grid and line styles (used by story.js). */

/* Theme colours. A host page sets these on :root (and again for its dark theme); these are fallbacks only, at
   zero specificity, so the page's own values always win. */
:where(:root) { --calc-bg: #fff; --calc-ink: #1b2219; --calc-text: #2e2f2c; --calc-muted: #6d6f69; --calc-rule: #e4e4e0;
  --calc-accent: #224668; --calc-context: #c4c6c0; --calc-surface: #f5f5f1; }

.viz-pick {
  cursor: pointer;
}

:is(.viz-treemap, .viz-bars, .viz-cols, .viz-range, .viz-chips, .viz-dots, .viz-bubbles, .viz-crumbs, .viz-drawer, .viz-table) button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: inherit;
  border-radius: 0;
}

:is(.viz-treemap, .viz-bars, .viz-cols, .viz-range, .viz-chips, .viz-dots, .viz-bubbles, .viz-crumbs, .viz-table) :is(button, tr):focus-visible {
  outline: 2px solid var(--calc-accent);
  outline-offset: 2px;
}

.viz-dim {
  opacity: 0.32;
}

/* spotlight(root): everything drawn with a key dims, except the key being pointed at */
:where(.viz-spot) [data-key] {
  transition: opacity 0.18s;
}
.viz-spot-on [data-key]:not(.viz-lit),
.viz-spot-on .viz-bar-row[data-key]:not(.viz-lit) > * {
  opacity: 0.22;
}
.viz-spot .viz-legend span[data-key] {
  cursor: default;
}
.viz-spot .viz-legend span[data-key]:focus-visible {
  outline: 2px solid var(--calc-accent);
  outline-offset: 2px;
}

/* the first time a chart scrolls into view: bars grow, columns rise, lines draw on */
@keyframes viz-grow-x { from { transform: scaleX(0); } }
@keyframes viz-grow-y { from { transform: scaleY(0); } }
@keyframes viz-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes viz-fade { from { opacity: 0; } }
.viz-entering .viz-bar-track:not(.viz-signed) .viz-bar {
  transform-origin: left;
  animation: viz-grow-x 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.viz-entering .viz-col-stack {
  transform-origin: bottom;
  animation: viz-grow-y 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.viz-entering.viz-stackbars svg path.viz-stack-bar {
  transform-box: view-box;
  animation: viz-grow-y 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.viz-entering svg .viz-line[pathLength] {
  stroke-dasharray: 1;
  animation: viz-draw 1.2s cubic-bezier(0.3, 0.6, 0.3, 1) backwards;
}
.viz-entering svg :is(.viz-area, circle) {
  animation: viz-fade 0.6s 0.7s backwards;
}
@media (prefers-reduced-motion: reduce) {
  .viz-entering * { animation: none !important; }
}

.viz-tip {
  position: fixed;
  z-index: 1200;
  display: none;
  pointer-events: none;
  max-width: min(320px, 100vw - 16px);
  background: color-mix(in srgb, var(--calc-surface) 95%, var(--calc-bg));
  color: var(--calc-ink);
  border: 1px solid color-mix(in srgb, var(--calc-ink) 18%, var(--calc-rule));
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 0.78rem;
  line-height: 1.4;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
}
.viz-tip b {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--calc-ink);
}
.viz-tip b:not(:last-child) {
  padding-bottom: 4px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--calc-rule);
}
.viz-tip span {
  display: block;
  color: var(--calc-text);
}
.viz-tip .viz-tip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}
.viz-tip .viz-tip-k {
  display: inline-flex;
  align-items: center;
  color: var(--calc-text);
}
.viz-tip .viz-tip-v {
  font-weight: 600;
  color: var(--calc-ink);
  white-space: nowrap;
}
.viz-tip i {
  display: block;
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--calc-accent);
  opacity: 0.92;
  border-top: 1px solid var(--calc-rule);
  padding-top: 5px;
  margin-top: 6px;
}

.viz-kicker {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--calc-muted);
  margin: 0 0 6px;
}

.viz-filters {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin: 20px 0 26px;
  padding: 10px 0;
  background: var(--calc-bg);
  border-top: 1px solid var(--calc-rule);
  border-bottom: 1px solid var(--calc-rule);
  font-size: 0.8rem;
}
@media (max-width: 700px) {
  .viz-filters {
    position: static;
  }
}
.viz-filters label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--calc-ink);
  margin: 0;
  cursor: pointer;
}
.viz-filters select {
  font: inherit;
  color: var(--calc-ink);
  background: var(--calc-bg);
  border: 1px solid var(--calc-rule);
  border-radius: 0;
  padding: 3px 6px;
  max-width: 100%;
}
.viz-filters input[type=checkbox] {
  accent-color: var(--calc-accent);
  width: 15px;
  height: 15px;
}
.viz-filters .viz-filters-reset {
  margin-left: auto;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--calc-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}


.viz-tip span .viz-sw {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 0;
}


/* read by a screen reader, not shown (the table's "Sorted by ..." status) */
.viz-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}


.viz-tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0 8px;
  border: 1px solid var(--calc-rule);
  border-radius: 999px;
  color: var(--calc-muted);
  margin: 0 4px 4px 0;
  white-space: nowrap;
}
.viz-tag i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}

.viz-muted {
  color: var(--calc-muted);
}

.viz-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 28px 44px;
  align-items: start;
}

.viz-note {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--calc-muted);
  margin: 12px 0 0;
  max-width: 760px;
}

.viz-title {
  font-size: 1rem;
  line-height: 1.3;
  color: var(--calc-ink);
  margin: 0 0 10px;
}
