/* The chart hover box (tracker M145, live 2026-11-22). Shared by every chart that opts in through
   public/forge/tools/chart-tip.js, and linked by each page that opts in. One look for every chart (A, the ink
   chip): the chart's dark green ink turned over, lime light names, white figures in JetBrains Mono 600 with
   tabular numbers. No chart styles its own box. Nothing here prints. */

.ctip { --ctip-ink: var(--dark-green-1); position: absolute; z-index: 5; pointer-events: none; }
.ctip-hits { position: absolute; inset: 0; }
.ctip-hit { position: absolute; top: 0; bottom: 0; margin: 0; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
/* keyboard focus on a light ground: the near-black ring (style guide, keyboard focus) */
.ctip-hit:focus { outline: none; }
.ctip-hit:focus-visible { outline: 2px solid var(--black); outline-offset: -2px; }

/* the marks on the chart: a guide down a line chart, a soft band behind a column, a ring on each line's point */
.ctip-mark { position: absolute; inset: 0; opacity: 0; transition: opacity 0.15s; }
.ctip.is-open .ctip-mark { opacity: 1; }
.ctip-guide { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--ctip-ink); margin-left: -1px; opacity: 0.7; }
.ctip[data-mode='column'] .ctip-guide { display: none; }
.ctip-band { position: absolute; top: 0; bottom: 0; border-radius: 8px; background: color-mix(in srgb, var(--ctip-ink) 8%, transparent); }
.ctip[data-mode='line'] .ctip-band { display: none; }
.ctip-ring { position: absolute; width: 10px; height: 10px; margin: -7px 0 0 -7px; border: 2px solid var(--ctip-ink); border-radius: 50%; background: var(--accent-light); }

/* the box, the ink chip */
.ctip-box { position: absolute; left: 0; top: 0; box-sizing: border-box; width: max-content; max-width: min(280px, calc(100vw - 16px)); padding: 10px 12px 11px; border-radius: 10px; background: var(--dark-green-1); color: var(--accent-light); box-shadow: 0 6px 18px color-mix(in srgb, var(--black) 28%, transparent); opacity: 0; visibility: hidden; transition: opacity 0.15s; font: 400 13px/1.35 'JetBrains Mono', monospace; text-align: left; }
.ctip.is-open .ctip-box { opacity: 1; visibility: visible; }
.ctip-title { display: block; margin-bottom: 7px; color: var(--accent); font: 600 11px/1.3 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 0.06em; }
.ctip-rows { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; }
.ctip-row { display: contents; }
.ctip-name { min-width: 0; }
.ctip-val { color: var(--white); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* the swatches, drawn as the charts' keys draw them, in the box's own ink */
.ctip-sw { display: inline-block; width: 14px; height: 10px; box-sizing: border-box; }
.ctip-sw.is-line { height: 0; border-top: 3px solid currentColor; }
.ctip-sw.is-dash { height: 0; border-top: 2px dashed currentColor; }
.ctip-sw.is-dot { height: 0; border-top: 2px dotted currentColor; }
.ctip-sw.is-col { border-top: 3px solid currentColor; background: color-mix(in srgb, currentColor 35%, transparent); }
.ctip-sw.is-range { width: 8px; height: 12px; margin: 0 3px; border: 2px solid currentColor; border-left: 0; border-right: 0; background: linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat; }
.ctip-sw.is-hatch, .ctip-sw.is-over { background: repeating-linear-gradient(135deg, currentColor 0 2px, transparent 2px 5px); }
.ctip-sw.is-none { visibility: hidden; }

@media screen and (max-width: 479px) {
  .ctip-box { padding: 8px 10px 9px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ctip-mark, .ctip-box { transition: none; }
}
/* the box, its guides and its buttons never print */
@media print {
  .ctip { display: none !important; }
}
