/* ===== Viz: insight-card visualizations. Theme via --ink, --glow, --c1, --c2 on a parent. ===== */
.viz {
  color: var(--ink, currentColor);
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.viz *, .viz *::before, .viz *::after { box-sizing: border-box; }
.viz > svg, .viz-svg {
  display: block;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}
.viz text { fill: currentColor; font-family: inherit; font-variant-numeric: tabular-nums; }

.viz-fn, .viz-qlist, .viz-vs, .viz-stepswrap { flex: 1 1 auto; min-height: 0; }

/* ---------- shared svg pieces ---------- */
.viz-grid { stroke: currentColor; stroke-opacity: .13; stroke-width: 1; stroke-dasharray: 1.5 4; fill: none; }
.viz-base { stroke: currentColor; stroke-opacity: .2; stroke-width: 1; fill: none; }
.viz-xl, .viz-yl { font-size: 10.5px; fill-opacity: .5; letter-spacing: .02em; }
.viz-big .viz-xl, .viz-big .viz-yl { font-size: 11px; }
.viz-stroke { fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.viz-big .viz-stroke { stroke-width: 2.5; }
.viz-soft { fill: none; stroke: currentColor; stroke-opacity: .5; stroke-width: 1.75; stroke-dasharray: 4 5; stroke-linecap: round; }
.viz-mark { stroke: currentColor; stroke-opacity: .45; stroke-width: 1; stroke-dasharray: 3 4; }
.viz-pill { fill: currentColor; }
.viz-pill-t { font-size: 10.5px; font-weight: 500; letter-spacing: .01em; }
.viz-leg { font-size: 10.5px; fill-opacity: .7; letter-spacing: .02em; }
.viz-tip-t { font-size: 12px; font-weight: 600; }

/* ---------- scrubbing ---------- */
.viz-scrubbable { touch-action: pan-y; cursor: crosshair; }
.viz-scrub { opacity: 0; transition: opacity .15s ease; pointer-events: none; }
.viz-scrub.on { opacity: 1; }
.viz-scrub-line { stroke: currentColor; stroke-opacity: .35; stroke-width: 1; }

/* ---------- gauge ---------- */
.viz-g-track { fill: none; stroke: currentColor; stroke-opacity: .14; stroke-width: 2; stroke-linecap: round; }
.viz-g-arc { fill: none; stroke-width: 9; stroke-linecap: round; }
.viz-g-glow { fill: none; stroke-width: 10; stroke-linecap: round; opacity: .55; }
.viz-g-tick { fill: currentColor; fill-opacity: .35; }
.viz-g-end { font-size: 10px; fill-opacity: .45; }
.viz-g-num { font-size: 58px; font-weight: 300; letter-spacing: -.03em; }
.viz-g-lab { font-size: 9.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; fill-opacity: .6; }

/* ---------- health ---------- */
.viz-health > svg { flex: 1 1 auto; }
.viz-hstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding-top: 6px; flex: none; }
.viz-hs { display: flex; align-items: center; gap: 8px; justify-content: center; min-width: 0; }
.viz-hs svg { width: 26px; height: 26px; flex: none; overflow: visible; }
.viz-hs-ring-t { fill: none; stroke: currentColor; stroke-opacity: .15; stroke-width: 2.5; }
.viz-hs-ring { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.viz-hs-n { font-size: 15px; font-weight: 500; line-height: 1.05; display: block; }
.viz-hs-l { font-size: 10px; opacity: .55; letter-spacing: .06em; text-transform: uppercase; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viz-big .viz-hs svg { width: 32px; height: 32px; }
.viz-big .viz-hs-n { font-size: 17px; }

/* ---------- bars ---------- */
.viz-bar { fill: currentColor; fill-opacity: .24; transform-box: fill-box; transform-origin: 50% 100%; }
.viz-bar.hi { fill-opacity: 1; }
.viz-bar-v { font-size: 13px; font-weight: 600; }
.viz-bar-v.lo { font-size: 10.5px; font-weight: 500; fill-opacity: .55; }

/* ---------- funnel ---------- */
.viz-fn {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(60px, 1fr) auto;
  column-gap: 12px;
  row-gap: 11px;
  align-content: center;
  align-items: center;
  font-size: 13px;
}
.viz-frow { display: contents; }
.viz-fl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .82; max-width: 9.5em; }
.viz-frow.hot .viz-fl { opacity: 1; font-weight: 500; }
.viz-ftrack { position: relative; height: 10px; border-radius: 99px; background: color-mix(in srgb, currentColor 11%, transparent); overflow: hidden; }
.viz-fbar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: currentColor; opacity: .55; transform-origin: 0 50%; }
.viz-frow.hot .viz-fbar { background: var(--glow); opacity: 1; box-shadow: 0 0 14px color-mix(in srgb, var(--glow) 60%, transparent); }
.viz-fv { text-align: right; font-weight: 500; min-width: 2.6em; }
.viz-frow.hot .viz-fv { font-weight: 600; }
.viz-fdrop { grid-column: 2 / 4; display: flex; align-items: center; gap: 6px; margin: -5px 0 -5px; }
.viz-ftag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 8px 4px 6px; border-radius: 99px;
  background: color-mix(in srgb, var(--glow) 24%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--glow) 45%, transparent);
}
.viz-ftag svg { width: 10px; height: 10px; }
.viz-fdrop-t { font-size: 10.5px; opacity: .55; }
.viz-big .viz-fn { font-size: 14px; row-gap: 14px; }
.viz-big .viz-ftrack { height: 12px; }

/* ---------- quotes ---------- */
.viz-qlist { display: flex; flex-direction: column; gap: 10px; justify-content: center; padding: 2px 4px; }
.viz-q { margin: 0; max-width: 84%; display: flex; flex-direction: column; rotate: var(--r, 0deg); }
.viz-q.l { align-self: flex-start; align-items: flex-start; }
.viz-q.r { align-self: flex-end; align-items: flex-end; }
.viz-q blockquote {
  margin: 0; padding: 9px 13px 10px;
  font-family: "Newsreader", Georgia, serif; font-size: 15px; line-height: 1.3; letter-spacing: -.005em;
  background: color-mix(in srgb, currentColor 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 9%, transparent);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.viz-q.l blockquote { border-bottom-left-radius: 6px; }
.viz-q.r blockquote { border-bottom-right-radius: 6px; }
.viz-q figcaption { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .5; margin-top: 5px; padding: 0 6px; }
.viz-big .viz-qlist { gap: 14px; }
.viz-big .viz-q blockquote { font-size: 17px; padding: 11px 16px 12px; }

/* ---------- versus ---------- */
.viz-vs { display: flex; flex-direction: column; justify-content: center; font-size: 13px; }
.viz-vrow { display: grid; grid-template-columns: var(--cols); align-items: stretch; border-radius: 12px; }
.viz-vrow > span { display: flex; align-items: center; justify-content: center; padding: 9px 6px; min-width: 0; text-align: center; }
.viz-vrow > .viz-vl { justify-content: flex-start; text-align: left; padding-left: 10px; opacity: .85; }
.viz-vrow + .viz-vrow > span { border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent); }
.viz-vhead > span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .6; padding-top: 6px; padding-bottom: 8px; }
.viz-vhead > span.us { opacity: 1; font-weight: 600; }
.viz-vrow > span.us { background: color-mix(in srgb, currentColor 7%, transparent); font-weight: 600; }
.viz-vhead > span.us { border-radius: 12px 12px 0 0; }
.viz-vrow:last-child > span.us { border-radius: 0 0 12px 12px; }
.viz-vrow.lose { background: color-mix(in srgb, var(--glow) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--glow) 40%, transparent); }
.viz-vrow.lose > span, .viz-vrow.lose + .viz-vrow > span { border-top-color: transparent; }
.viz-vrow.lose > span.us { background: transparent; }
.viz-vrow.lose + .viz-vrow.lose { margin-top: 4px; }
.viz-vrow.lose > .viz-vl { opacity: 1; font-weight: 500; }
.viz-vs svg { width: 18px; height: 18px; display: block; overflow: visible; }
.viz-ic-yes circle { fill: currentColor; fill-opacity: .14; }
.viz-ic-yes path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.viz-ic-no path { fill: none; stroke: currentColor; stroke-opacity: .4; stroke-width: 1.6; stroke-linecap: round; }
.viz-big .viz-vs { font-size: 14.5px; }
.viz-big .viz-vrow > span { padding: 12px 8px; }

/* ---------- steps ---------- */
.viz-slist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.viz-stepswrap { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.viz-step { position: relative; display: flex; align-items: center; gap: 12px; font-size: 14px; line-height: 1.3; }
.viz-step:not(:last-child)::after {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: -12px; width: 1px;
  background: currentColor; opacity: .22;
}
.viz-sn {
  flex: none; width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent);
}
.viz-step:first-child .viz-sn { background: var(--glow); color: var(--c1, #111); box-shadow: 0 0 14px color-mix(in srgb, var(--glow) 55%, transparent); }
.viz-meta {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; padding: 5px 11px 5px 9px; border-radius: 99px;
  background: color-mix(in srgb, currentColor 9%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 12%, transparent);
}
.viz-meta svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; opacity: .75; }
.viz-big .viz-step { font-size: 15.5px; }
.viz-big .viz-slist { gap: 18px; }
.viz-big .viz-step:not(:last-child)::after { bottom: -18px; }

/* ---------- animations (only when .viz-play is added by Viz.mount) ---------- */
@keyframes viz-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes viz-fade { from { opacity: 0; } }
@keyframes viz-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes viz-grow-y { from { transform: scaleY(0); } }
@keyframes viz-grow-x { from { transform: scaleX(0); } }
@keyframes viz-pop { from { opacity: 0; transform: scale(.2); } }
@keyframes viz-pulse { 0% { transform: scale(.7); opacity: .6; } 80%, 100% { transform: scale(2.6); opacity: 0; } }

.viz-end, .viz-halo { transform-box: fill-box; transform-origin: center; }
.viz-halo { fill-opacity: .45; animation: viz-pulse 2.4s cubic-bezier(.2,.6,.3,1) infinite; animation-delay: var(--d, 0s); }

.viz-play .viz-draw { stroke-dasharray: 1 1; animation: viz-draw 1.3s cubic-bezier(.65,0,.35,1) both; animation-delay: var(--d, 0s); }
.viz-play .viz-fade { animation: viz-fade .9s ease both; animation-delay: var(--d, .4s); }
.viz-play .viz-rise { animation: viz-rise .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0s); }
.viz-play .viz-bar { animation: viz-grow-y .9s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0s); }
.viz-play .viz-fbar { animation: viz-grow-x 1.1s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0s); }
.viz-play .viz-end { animation: viz-pop .45s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--d, 1.1s); }
.viz-wait, .viz-wait * { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .viz, .viz * { animation: none !important; transition: none !important; }
}
