/* Wave N Lane B charts (docs/design/wave-n-visual-data/design-spec.md §2 Lane B; fragments: templates/lens/viz.html).
   Tokens only, so light and data-theme="black" need no branch. Square ends everywhere (no capsule). Colour = primary
   family + accent + secondary hatch; direction is carried by position and sign text, never by a tone. Motion: one draw
   with --motion-dur-draw (0ms under prefers-reduced-motion via farfold.css), no loops. */

/* ---- shared fills (k1..k5 = order of the legend, not meaning) ---- */
.vzb-part[data-vzb="k1"], .vzb-key[data-vzb="k1"] { background: var(--color-primary); }
.vzb-part[data-vzb="k2"], .vzb-key[data-vzb="k2"] { background: var(--color-accent); }
.vzb-part[data-vzb="k3"], .vzb-key[data-vzb="k3"] {
  background: repeating-linear-gradient(45deg, var(--color-text-secondary) 0 2px, transparent 2px 5px);
  box-shadow: inset 0 0 0 1px var(--color-text-secondary);
}
.vzb-part[data-vzb="k4"], .vzb-key[data-vzb="k4"] { background: color-mix(in srgb, var(--color-text-secondary) 55%, transparent); }
.vzb-part[data-vzb="k5"], .vzb-key[data-vzb="k5"] { background: transparent; box-shadow: inset 0 0 0 1px var(--color-text-secondary); }

@keyframes vzb-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes vzb-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- stacked ratio bar ---- */
.vzb-ratio-wrap { display: grid; gap: 4px; margin-top: 6px; min-width: 0; }
.vzb-ratio { display: flex; gap: 1px; height: 8px; width: 100%; border-radius: 0; overflow: hidden;
  animation: vzb-wipe var(--motion-dur-draw) var(--motion-ease-enter) both; }
.vzb-part { flex-basis: 0; min-width: 2px; }
.vzb-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--color-text-secondary); }
.vzb-legend > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.vzb-legend b { font-family: var(--font-num); font-weight: 600; color: var(--color-text-primary); }
.vzb-key { display: inline-block; width: 8px; height: 8px; }

/* ---- segment meter (N square cells) ---- */
.vzb-seg { display: inline-flex; gap: 2px; vertical-align: middle; }
.vzb-cell { width: 10px; height: 10px; box-shadow: inset 0 0 0 1px var(--color-border-strong); }
.vzb-cell.is-on { background: var(--color-primary); box-shadow: none; animation: vzb-fade var(--motion-dur-draw) var(--motion-ease-enter) both; }
.vzb-seg--inv .vzb-cell.is-on { background: repeating-linear-gradient(45deg, var(--color-text-secondary) 0 2px, transparent 2px 4px);
  box-shadow: inset 0 0 0 1px var(--color-text-secondary); }
.vzb-seg--sm .vzb-cell { width: 6px; height: 10px; }
.vzb-meters { display: flex; flex-wrap: wrap; gap: 0 var(--space-4, 16px); }
.vzb-meter-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 6px 0 0; }

/* ---- position gauges (z −3…+3, percentile 0…100) ---- */
.vzb-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3, 12px) var(--space-4, 16px); margin: var(--space-3, 12px) 0; }
.vzb-gauge { display: grid; gap: 4px; min-width: 0; }
.vzb-gauge-k { color: var(--color-text-secondary); font-weight: 600; }
.vzb-gauge-track { position: relative; height: 10px; border-radius: 0; background:
  linear-gradient(var(--color-border-strong), var(--color-border-strong)) 50% 0 / 1px 100% no-repeat, var(--color-surface-elevated);
  box-shadow: inset 0 0 0 1px var(--color-border); }
.vzb-pct { background:
  linear-gradient(var(--color-border-strong), var(--color-border-strong)) 20% 0 / 1px 100% no-repeat,
  linear-gradient(var(--color-border-strong), var(--color-border-strong)) 50% 0 / 1px 100% no-repeat,
  linear-gradient(var(--color-border-strong), var(--color-border-strong)) 80% 0 / 1px 100% no-repeat, var(--color-surface-elevated); }
.vzb-gauge-fill { position: absolute; top: 2px; bottom: 2px; left: var(--a); width: calc(var(--b) - var(--a));
  background: color-mix(in srgb, var(--color-primary) 35%, transparent); animation: vzb-fade var(--motion-dur-draw) var(--motion-ease-enter) both; }
.vzb-gauge-mark { position: absolute; top: -3px; bottom: -3px; left: var(--p); width: 2px; margin-left: -1px; background: var(--color-primary); }
.vzb-gauge-scale { display: flex; justify-content: space-between; font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---- calibration band strip (node detail, CALIBRATED only; viz-b.js places lines) ---- */
.vzb-band { margin: var(--space-3, 12px) 0; }
.vzb-band-track { position: relative; height: 18px; background: var(--color-surface-elevated); box-shadow: inset 0 0 0 1px var(--color-border); }
.vzb-band-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--color-text-secondary); }
.vzb-band-line.is-confirm { border-left: 2px solid var(--color-accent); }
.vzb-band-now { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--color-primary); }
.vzb-band-key { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--color-text-secondary); }
.vzb-band-key i { display: inline-block; width: 10px; height: 0; vertical-align: middle; margin-right: 4px; }
.vzb-band-key .k-confirm { border-top: 2px solid var(--color-accent); }
.vzb-band-key .k-inv { border-top: 1px dashed var(--color-text-secondary); }
.vzb-band-key .k-now { width: 2px; height: 10px; background: var(--color-primary); }

/* ---- diverging rows (macro 1-month change, market 1D/5D) — 0 at centre, same colour both sides ---- */
.vzb-div { display: grid; gap: 4px; margin-top: var(--space-2, 8px); min-height: 24px; }
.vzb-div-row { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) 4.6em; align-items: center; gap: 8px; font-size: 12px; }
.vzb-div-row > .lbl { font-family: var(--font-mono); color: var(--color-text-secondary); }
.vzb-div-row > .val { font-family: var(--font-num); font-variant-numeric: tabular-nums; text-align: right; color: var(--color-text-primary); }
.vzb-div-track { position: relative; height: 8px; background:
  linear-gradient(var(--color-border-strong), var(--color-border-strong)) 50% 0 / 1px 100% no-repeat; }
.vzb-bar { position: absolute; top: 0; bottom: 0; width: var(--w, 0%); background: var(--color-primary);
  animation: vzb-fade var(--motion-dur-draw) var(--motion-ease-enter) both; }
.vzb-bar.is-pos { left: 50%; }
.vzb-bar.is-neg { right: 50%; }
.vzb-bar.is-alt { background: color-mix(in srgb, var(--color-primary) 45%, transparent); }
.vzb-div-key { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--color-text-secondary); }
.vzb-div-key i { display: inline-block; width: 10px; height: 8px; margin-right: 4px; vertical-align: middle; background: var(--color-primary); }
.vzb-div-key i.is-alt { background: color-mix(in srgb, var(--color-primary) 45%, transparent); }
.vzb-pair { display: grid; gap: 2px; }
.vzb-pair .vzb-div-track { height: 6px; }

/* ---- lens map: lane disclosure share + |z| heat tiles ---- */
.vzb-lanebar { display: flex; gap: 1px; width: 100%; max-width: 160px; height: 4px; margin-top: 4px; }
.vzb-lanebar > .on { background: var(--color-primary); }
.vzb-lanebar > .off { box-shadow: inset 0 0 0 1px var(--color-border-strong); }
.lens-node.vzb-z1 { background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface-elevated)); }
.lens-node.vzb-z2 { background: color-mix(in srgb, var(--color-primary) 13%, var(--color-surface-elevated)); }
.lens-node.vzb-z3 { background: color-mix(in srgb, var(--color-primary) 22%, var(--color-surface-elevated)); }
.vzb-ztag { font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--color-text-secondary); }
.vzb-heat-key { display: inline-flex; gap: 1px; vertical-align: middle; margin-right: 4px; }
.vzb-heat-key > i { width: 14px; height: 10px; box-shadow: inset 0 0 0 1px var(--color-border); }
.vzb-heat-key > i:nth-child(1) { background: var(--color-surface-elevated); }
.vzb-heat-key > i:nth-child(2) { background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface-elevated)); }
.vzb-heat-key > i:nth-child(3) { background: color-mix(in srgb, var(--color-primary) 13%, var(--color-surface-elevated)); }
.vzb-heat-key > i:nth-child(4) { background: color-mix(in srgb, var(--color-primary) 22%, var(--color-surface-elevated)); }

/* ---- education: tier ratio in the hero ---- */
.edu-hero-ratio { max-width: 420px; }
.badge .vzb-seg { margin-right: 4px; }

@media (max-width: 480px) {
  .vzb-div-row { grid-template-columns: 2.8em minmax(0, 1fr) 4.2em; gap: 6px; }
  .vzb-gauges { grid-template-columns: 1fr; }
}
.vzb-div--pairs .vzb-div-row { grid-template-columns: 3.2em minmax(0, 1fr); }
.vzb-head { margin-top: var(--space-3); }
