/* charts.css - vilbert.net v2 charts, design A "Terminal". Pairs with charts.js.
 * Every look is a class here; charts.js only sets SVG geometry attributes (CSP style-src 'self', no inline style).
 * Mark colours are validated with the dataviz validator on the dark panel #0a1117 (see NOTES.md):
 *   --vc-line #c08933 (balance line, sparkline), --vc-up #19a9b0, --vc-down #ad524d (week bars, drawdown, CI state).
 * Text never wears a mark colour: values and labels use the ink tokens of A (--ink, --ink-2, --ink-3).
 */
.vc {
  --vc-surface: var(--panel-solid, #0a1117);
  --vc-ink: var(--ink, #edf2f6);
  --vc-ink-2: var(--ink-2, #b9c5cf);
  --vc-ink-3: var(--ink-3, #93a3b1);
  --vc-grid: var(--line, #1b2833);
  --vc-axis: var(--line-2, #2a3c4c);
  --vc-line: #c08933;
  --vc-up: #19a9b0;
  --vc-down: #ad524d;
  --vc-focus: var(--focus, #8ec1ff);
  --vc-mono: var(--mono, 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace);
  --vc-h: 300px;   /* plot height; the per-kind defaults below use :where() so any page class overrides them */
  --vc-t: 0px;     /* tools row height (the "Vis tabel" button); 0 for spark and ci */
  position: relative; margin: 0; min-width: 0;
}
.vc:where([data-chart="balance"]) { --vc-h: 400px; --vc-t: 40px; }
.vc:where([data-chart="weeks"]) { --vc-h: 260px; --vc-t: 40px; }
.vc:where([data-chart="drawdown"]) { --vc-h: 200px; --vc-t: 40px; }
.vc:where([data-chart="ci"]) { --vc-h: 46px; }
.vc:where([data-chart="spark"]) { --vc-h: 74px; }
@media (max-width: 760px) {
  .vc:where([data-chart="balance"]) { --vc-h: 300px; }
  .vc:where([data-chart="weeks"]) { --vc-h: 220px; }
  .vc:where([data-chart="drawdown"]) { --vc-h: 170px; }
  .vc:where([data-chart="spark"]) { --vc-h: 54px; }
}

/* before the chart has drawn: the fallback holds exactly the space the chart will take (no layout shift) */
.vc:not(.vc-on) > .vc-fallback { box-sizing: border-box; height: calc(var(--vc-h) + var(--vc-t)); overflow: auto; }
.vc.vc-on > .vc-fallback { height: auto; overflow: visible; }
.vc > .vc-fallback[hidden] { display: none; }

.vc-plot { position: relative; height: var(--vc-h); outline: none; touch-action: pan-y; }
.vc-plot.vc-measure { position: absolute; left: 0; right: 0; top: 0; visibility: hidden; pointer-events: none; }
.vc-plot.vc-active { z-index: 5; }
.vc-plot:focus-visible { outline: 2px solid var(--vc-focus); outline-offset: 2px; border-radius: 4px; }
.vc-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.vc-tools { box-sizing: border-box; height: var(--vc-t); display: flex; align-items: center; justify-content: flex-end; }
.vc-toggle {
  font: 500 11.5px/1 var(--vc-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--vc-ink-2);
  background: transparent; border: 1px solid var(--vc-axis); border-radius: 6px; padding: 7px 10px; cursor: pointer;
}
.vc-toggle:hover { color: var(--vc-ink); border-color: var(--vc-ink-3); }
.vc-toggle:focus-visible { outline: 2px solid var(--vc-focus); outline-offset: 2px; }
.vc-sr { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

/* ---------------------------------------------------------------- chrome */
.vc text { font-family: var(--vc-mono); font-size: 11.5px; fill: var(--vc-ink-3); }
.vc-small text { font-size: 10.5px; }
.vc-grid line { stroke: var(--vc-grid); stroke-width: 1; shape-rendering: crispEdges; }
.vc-axis-line { stroke: var(--vc-axis); stroke-width: 1; shape-rendering: crispEdges; }
.vc-unit { fill: var(--vc-ink-3); }
.vc-zero { stroke: var(--vc-ink-3); stroke-width: 1; shape-rendering: crispEdges; }
.vc-base { stroke: var(--vc-ink-3); stroke-width: 1; stroke-opacity: .75; shape-rendering: crispEdges; }
text.vc-base-l { fill: var(--vc-ink-2); paint-order: stroke; stroke: var(--vc-surface); stroke-width: 4px; stroke-linejoin: round; }
.vc-ver { stroke: var(--vc-ink-2); stroke-width: 1; stroke-opacity: .5; shape-rendering: crispEdges; }
.vc-flag rect { fill: #182532; stroke: var(--vc-axis); stroke-width: 1; }
text.vc-flag-t { fill: var(--vc-ink); font-weight: 500; }
.vc-last rect { fill: var(--vc-surface); stroke: var(--vc-line); stroke-width: 1; }
text.vc-last-t { fill: var(--vc-ink); font-weight: 500; }
text.vc-lab { fill: var(--vc-ink-2); }
text.vc-lab-strong { fill: var(--vc-ink); font-weight: 500; }
text.vc-halo { paint-order: stroke; stroke: var(--vc-surface); stroke-width: 4px; stroke-linejoin: round; }

/* ---------------------------------------------------------------- marks */
.vc-line { fill: none; stroke: var(--vc-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vc-area { fill: var(--vc-line); fill-opacity: .1; stroke: none; }
.vc-dot { fill: var(--vc-line); stroke: var(--vc-surface); stroke-width: 2; }
.vc-dd-line { fill: none; stroke: var(--vc-down); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vc-dd-area { fill: var(--vc-down); fill-opacity: .14; stroke: none; }
.vc-dd-dot { fill: var(--vc-down); stroke: var(--vc-surface); stroke-width: 2; }
.vc-bar { stroke: none; fill-opacity: .9; }
.vc-bar.vc-pos { fill: var(--vc-up); }
.vc-bar.vc-neg { fill: var(--vc-down); }
.vc-bar.vc-wip { fill-opacity: .42; }
.vc-bar.vc-hot { fill-opacity: 1; }
.vc-bar.vc-wip.vc-hot { fill-opacity: .62; }
.vc-ci-track { stroke: var(--vc-axis); stroke-width: 2; stroke-linecap: round; }
.vc-ci-tick { stroke: var(--vc-axis); stroke-width: 1; }
.vc-ci-zero { stroke: var(--vc-ink-2); stroke-width: 2; }
.vc-ci-bar { fill: var(--vc-ink-3); fill-opacity: .55; }
.vc-ci-bar.vc-pos { fill: var(--vc-up); fill-opacity: .85; }
.vc-ci-bar.vc-neg { fill: var(--vc-down); fill-opacity: .85; }
.vc-ci-dot { fill: var(--vc-ink); stroke: var(--vc-surface); stroke-width: 2; }
text.vc-ci-word { fill: var(--vc-ink); font-weight: 500; letter-spacing: .04em; }
.vc-spark-base { stroke: var(--vc-ink-3); stroke-width: 1; stroke-opacity: .5; shape-rendering: crispEdges; }

/* ---------------------------------------------------------------- hover layer */
.vc-hit { fill: transparent; }
.vc-plot[data-interactive] { cursor: crosshair; }
.vc[data-chart="weeks"] .vc-plot[data-interactive] { cursor: pointer; }
.vc-cross line { stroke: var(--vc-ink); stroke-opacity: .45; stroke-width: 1; shape-rendering: crispEdges; }
.vc-tip rect.vc-tip-bg { fill: #0d151c; fill-opacity: 1; stroke: var(--vc-axis); stroke-width: 1; }
.vc-tip text { fill: var(--vc-ink-2); font-size: 12px; }
.vc-small .vc-tip text { font-size: 11px; }
.vc-tip text.vc-tip-h { fill: var(--vc-ink); font-weight: 500; }
.vc-tip text.vc-tip-v { fill: var(--vc-ink); font-weight: 500; }
.vc-tip .vc-key { stroke-width: 2; stroke-linecap: round; }
.vc-key-line { stroke: var(--vc-line); }
.vc-key-up { stroke: var(--vc-up); }
.vc-key-down { stroke: var(--vc-down); }
.vc-key-ink { stroke: var(--vc-ink-2); }

/* ---------------------------------------------------------------- the one draw-in (first draw only, never on resize) */
.vc-intro .vc-line, .vc-intro .vc-dd-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: vc-draw 1.3s cubic-bezier(.45, .05, .2, 1) forwards; }
.vc-intro .vc-area, .vc-intro .vc-dd-area, .vc-intro .vc-dot, .vc-intro .vc-dd-dot, .vc-intro .vc-last { animation: vc-fade .6s ease-out .8s both; }
.vc-intro .vc-bar { transform-box: fill-box; animation: vc-grow .6s cubic-bezier(.2, .8, .2, 1) both; }
.vc-intro .vc-bar.vc-pos { transform-origin: 50% 100%; }
.vc-intro .vc-bar.vc-neg { transform-origin: 50% 0%; }
.vc-intro .vc-d1 { animation-delay: .05s; } .vc-intro .vc-d2 { animation-delay: .1s; } .vc-intro .vc-d3 { animation-delay: .15s; }
.vc-intro .vc-d4 { animation-delay: .2s; } .vc-intro .vc-d5 { animation-delay: .25s; } .vc-intro .vc-d6 { animation-delay: .3s; }
.vc-intro .vc-d7 { animation-delay: .35s; } .vc-intro .vc-d8 { animation-delay: .4s; } .vc-intro .vc-d9 { animation-delay: .45s; }
.vc-intro .vc-ci-bar { transform-box: fill-box; transform-origin: 50% 50%; animation: vc-growx .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vc-draw { to { stroke-dashoffset: 0; } }
@keyframes vc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vc-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes vc-growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .vc-intro * { animation: none !important; } }
.rm .vc-intro * { animation: none !important; }
@media print { .vc-intro * { animation: none !important; } .vc-tools { display: none; } }

/* forced colours: marks keep their shape, text keeps system colours */
@media (forced-colors: active) {
  .vc-line, .vc-dd-line { stroke: CanvasText; }
  .vc-bar, .vc-ci-bar { fill: CanvasText; }
  .vc text { fill: CanvasText; }
}
