/* ==========================================================================
   ZidTech charts: tokens + marks for assets/js/charts.js
   Palette validated with the dataviz validator (all-pairs, 3 slots):
     dark  (surface #0c1120): #1f8ff0 #e2652c #18a874
     light (surface #ffffff): #0a72d6 #e2652c #16a06f
   ========================================================================== */
.zc, .zc-tip, .zc-legend, .zc-swatch {
  --zc-1: #1f8ff0;
  --zc-2: #e2652c;
  --zc-3: #18a874;
  --zc-mute: rgba(var(--ink), .17);
  --zc-track: rgba(var(--ink), .05);
  --zc-grid: rgba(var(--ink), .07);
  --zc-axis: rgba(var(--ink), .2);
  --zc-surface: var(--panel);
}
[data-theme="light"] .zc, [data-theme="light"] .zc-tip, [data-theme="light"] .zc-legend, [data-theme="light"] .zc-swatch {
  --zc-1: #0a72d6;
  --zc-2: #e2652c;
  --zc-3: #16a06f;
  --zc-mute: rgba(var(--ink), .16);
  --zc-track: rgba(var(--ink), .045);
  --zc-grid: rgba(var(--ink), .08);
  --zc-axis: rgba(var(--ink), .22);
}

.zc { margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.zc-head { display: flex; flex-direction: column; gap: 4px; }
.zc-title { font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; color: var(--text); margin: 0; }
.zc-sub { font-size: .88rem; color: var(--text-2); margin: 0; line-height: 1.5; }
.zc-plot { position: relative; width: 100%; min-height: var(--zc-h, 120px); }
.zc-svg { display: block; overflow: visible; font-family: inherit; }
.zc-note { font-size: .78rem; color: var(--text-3); margin: 0; line-height: 1.5; }

/* text: always text tokens, never the series colour */
.zc-cat { fill: var(--text-2); font-size: 13px; }
.zc-val { fill: var(--text); font-size: 13px; font-weight: 600; }
.zc-tick { fill: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* chrome: solid hairlines, recessive */
.zc-grid { stroke: var(--zc-grid); stroke-width: 1; shape-rendering: crispEdges; }
.zc-base { stroke: var(--zc-axis); stroke-width: 1; shape-rendering: crispEdges; }
.zc-track { fill: var(--zc-track); }
.zc-cross { stroke: var(--zc-axis); stroke-width: 1; opacity: 0; pointer-events: none; }
.is-hover .zc-cross { opacity: 1; }

/* marks */
.zc-fill.s1, .zc-dot.s1 { fill: var(--zc-1); }
.zc-fill.s2, .zc-dot.s2 { fill: var(--zc-2); }
.zc-fill.s3, .zc-dot.s3 { fill: var(--zc-3); }
.zc-fill.zc-mute { fill: var(--zc-mute); }
.zc-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.zc-line.s1 { stroke: var(--zc-1); }
.zc-line.s2 { stroke: var(--zc-2); }
.zc-line.s3 { stroke: var(--zc-3); }
.zc-line.zc-spark { stroke: var(--zc-mute); stroke-width: 1.6; }
.zc-area.s1 { fill: var(--zc-1); opacity: .1; }
.zc-area.s2 { fill: var(--zc-2); opacity: .1; }
.zc-area.s3 { fill: var(--zc-3); opacity: .1; }
.zc-dot { stroke: var(--zc-surface); stroke-width: 2; }
.zc-dot.zc-hover { opacity: 0; pointer-events: none; }
.is-hover .zc-dot.zc-hover { opacity: 1; }
.zc-meter-track { fill: rgba(31, 143, 240, .16); }
.zc-meter-fill { fill: var(--zc-1); }
[data-theme="light"] .zc-meter-track { fill: rgba(10, 114, 214, .14); }

/* hit targets: bigger than the mark, the mark lifts on hover/focus */
.zc-hit { fill: transparent; cursor: default; outline: none; }
.zc-mark:hover .zc-fill, .zc-mark:focus-within .zc-fill { filter: brightness(1.18); }
[data-theme="light"] .zc-mark:hover .zc-fill, [data-theme="light"] .zc-mark:focus-within .zc-fill { filter: brightness(.9); }
.zc-hit:focus-visible { stroke: var(--accent); stroke-width: 1.5; }
.zc-mark:hover .zc-cat, .zc-mark:focus-within .zc-cat { fill: var(--text); }

/* entrance: grow from the baseline, draw lines, pop dots */
.zc-grow-x, .zc-grow-y, .zc-pop { transform-box: fill-box; }
.zc-grow-x { transform-origin: left center; }
.zc-grow-y { transform-origin: center bottom; }
.zc-pop { transform-origin: center; }
html:not(.no-anim) .zc:not(.is-in) .zc-grow-x { transform: scaleX(0); }
html:not(.no-anim) .zc:not(.is-in) .zc-grow-y { transform: scaleY(0); }
html:not(.no-anim) .zc:not(.is-in) .zc-pop { transform: scale(0); }
html:not(.no-anim) .zc:not(.is-in) .zc-fade { opacity: 0; }
html:not(.no-anim) .zc:not(.is-in) .zc-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
html:not(.no-anim) .zc:not(.is-in) .zc-area,
html:not(.no-anim) .zc:not(.is-in) .zc-val { opacity: 0; }
.zc .zc-grow-x, .zc .zc-grow-y, .zc .zc-pop { transition: transform 1.1s cubic-bezier(.16, 1, .3, 1) var(--d, 0ms); }
.zc .zc-fade { transition: opacity .9s ease var(--d, 0ms); }
.zc .zc-draw { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s cubic-bezier(.65, 0, .35, 1); }
.zc .zc-area { transition: opacity 1s ease .6s; }
.zc .zc-val { transition: opacity .6s ease .7s; }
.zc-area.s1, .zc-area.s2, .zc-area.s3 { --o: .1; }

/* legend + keys (mirror the mark: rect for bars, line for lines) */
.zc-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: var(--text-2); }
.zc-legend li { display: inline-flex; align-items: center; gap: 8px; }
.zc-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--zc-1); flex: none; }
.zc-key.s2 { background: var(--zc-2); }
.zc-key.s3 { background: var(--zc-3); }
.zc-key.mute { background: var(--zc-mute); }
.zc-key--line { height: 2px; width: 14px; border-radius: 2px; }

/* tooltip: value leads, label follows; line keys */
.zc-tip {
  position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none; opacity: 0;
  min-width: 120px; max-width: 260px; padding: 10px 12px; border-radius: 12px;
  background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow-m);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: .82rem; color: var(--text-2); transition: opacity .15s ease;
}
.zc-tip.is-on { opacity: 1; }
.zc-tip-h { font-size: .74rem; color: var(--text-3); margin-bottom: 6px; letter-spacing: .02em; }
.zc-tip-r { display: flex; align-items: center; gap: 8px; line-height: 1.5; }
.zc-tip-r .zc-key { width: 12px; height: 2px; border-radius: 2px; }
.zc-tip-r b { color: var(--text); font-weight: 600; }

/* table view: every value reachable without hovering */
.zc-table { font-size: .82rem; color: var(--text-3); }
.zc-table summary { cursor: pointer; width: max-content; padding: 2px 0; color: var(--text-3); list-style: none; }
.zc-table summary::-webkit-details-marker { display: none; }
.zc-table summary::before { content: '+ '; }
.zc-table[open] summary::before { content: '– '; }
.zc-table summary:hover { color: var(--text-2); }
.zc-table table { width: 100%; border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
.zc-table th, .zc-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--text-2); font-weight: 400; }
.zc-table thead th { color: var(--text-3); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.zc-table tbody th { color: var(--text); }

/* a chart sitting in a card */
.zc-card { padding: clamp(18px, 2.4vw, 28px); border-radius: var(--r-l, 24px); border: 1px solid var(--line); background: linear-gradient(180deg, var(--card-a), var(--card-b)); }

@media (forced-colors: active) {
  .zc-fill, .zc-dot { fill: CanvasText; }
  .zc-line { stroke: CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  .zc * { transition: none !important; }
}
