/* ===========================================================================
   RBF Works — Key Insights visuals (KIV). Pair with ki-849h7wv9d3-visuals.js.
   Everything is namespaced .kiv-. Colours are CSS variables: .kiv (paper) and
   .kiv--dark (navy). Override --kiv-bg if the visual sits on another surface.
   =========================================================================== */

.kiv {
  --kiv-ink: #141f3c;
  --kiv-muted: #5e6885;
  --kiv-line: rgba(20, 32, 63, .15);
  --kiv-line-2: rgba(20, 32, 63, .07);
  --kiv-bg: #faf7f1;
  --kiv-surface: #ffffff;
  --kiv-surface-2: #f2ecdf;
  --kiv-data: #2b3f8c;
  --kiv-data-2: #3a5bc7;
  --kiv-data-soft: #c3cdec;
  --kiv-data-faint: #e7ebf7;
  --kiv-accent: #f7941e;
  --kiv-accent-2: #fdb913;
  --kiv-accent-ink: #9a5200;
  --kiv-accent-soft: rgba(247, 148, 30, .14);
  --kiv-on-accent: #241300;
  --kiv-good: #1c7c39;
  --kiv-good-soft: rgba(28, 124, 57, .10);
  --kiv-bad: #c9573a;
  --kiv-bad-ink: #a8452b;
  --kiv-bad-soft: rgba(201, 87, 58, .10);
  --kiv-grad: linear-gradient(118deg, #f7941e 0%, #fdb913 100%);
  --kiv-ease: cubic-bezier(.2, .7, .2, 1);
  --kiv-fs: 12.5px;
  --kiv-fs-s: 11.5px;

  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  container-name: kiv;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--kiv-fs);
  line-height: 1.4;
  color: var(--kiv-ink);
  -webkit-font-smoothing: antialiased;
  text-align: left;
}
.kiv--dark {
  --kiv-ink: #f4f1ea;
  --kiv-muted: #aab4d4;
  --kiv-line: rgba(255, 255, 255, .2);
  --kiv-line-2: rgba(255, 255, 255, .08);
  --kiv-bg: #131f4d;
  --kiv-surface: rgba(255, 255, 255, .06);
  --kiv-surface-2: rgba(255, 255, 255, .11);
  --kiv-data: #a3b6f3;
  --kiv-data-2: #7f99ee;
  --kiv-data-soft: rgba(163, 182, 243, .42);
  --kiv-data-faint: rgba(163, 182, 243, .13);
  --kiv-accent: #f9a23a;
  --kiv-accent-ink: #fdb913;
  --kiv-accent-soft: rgba(253, 185, 19, .15);
  --kiv-good: #62c784;
  --kiv-good-soft: rgba(98, 199, 132, .15);
  --kiv-bad: #ef8a6d;
  --kiv-bad-ink: #f5a58d;
  --kiv-bad-soft: rgba(239, 138, 109, .15);
}
.kiv *, .kiv *::before, .kiv *::after { box-sizing: border-box; }
.kiv p { margin: 0; }
.kiv b { font-weight: 700; }

/* ---------- frame ---------- */
.kiv-fig {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.kiv-notes, .kiv-cap { width: 100%; max-width: 880px; margin-left: auto; margin-right: auto; }
.kiv-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--kiv-muted);
  line-height: 1.3;
}
.kiv-note {
  font-size: var(--kiv-fs);
  line-height: 1.45;
  color: var(--kiv-ink);
  padding-left: 12px;
  border-left: 2px solid var(--kiv-accent);
}
.kiv-notes { margin-top: 14px; }
.kiv-note--inline { align-self: center; }
.kiv-cap {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--kiv-line-2);
  font-size: 11px;
  line-height: 1.4;
  color: var(--kiv-muted);
}
.kiv-big {
  font-size: clamp(22px, 7.4cqw, 34px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--kiv-data);
  white-space: nowrap;
}
.kiv-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--kiv-line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: var(--kiv-fs-s);
  font-weight: 600;
  line-height: 1.3;
  background: var(--kiv-surface);
  transition: border-color .4s, background-color .4s;
}
.kiv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--kiv-muted);
}
.kiv-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.kiv-lg-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.kiv-lg-dot--hollow { border: 1.5px solid var(--kiv-data-soft); background: var(--kiv-bg); }
.kiv-lg-dot--served { background: var(--kiv-data); }
.kiv-lg-sq { width: 11px; height: 11px; border-radius: 2px; flex: none; }
.kiv-lg-sq--out { background: var(--kiv-accent); }
.kiv-lg-sq--pay { background: var(--kiv-data); }
.kiv-lg-sq--adv { background: var(--kiv-data-2); }

.kiv-over { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 0; }
.kiv-arr-line { fill: none; stroke: var(--kiv-muted); stroke-width: 1.5; stroke-linecap: round; }
.kiv-arr-head { fill: var(--kiv-muted); }
.kiv-arr--out .kiv-arr-line { stroke: var(--kiv-data-2); }
.kiv-arr--out .kiv-arr-head { fill: var(--kiv-data-2); }

.kiv-coin {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--kiv-grad);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5), 0 1px 3px rgba(19, 31, 77, .28);
  transform: translate(-50%, -50%);
  z-index: 2;
}
.kiv-coin--lg { width: 22px; height: 22px; top: 0; left: 0; }
.kiv-coin--part { width: 10px; height: 10px; }

/* ---------- state engine ---------- */
.kiv-stack { display: grid; }
.kiv-stack > .kiv-stack-i { grid-area: 1 / 1; min-width: 0; }
.kiv [data-on], .kiv [data-from] { transition: opacity .5s var(--kiv-ease); }
.kiv [data-on]:not(.is-on), .kiv [data-from]:not(.is-on) { opacity: 0; pointer-events: none; }
.kiv .kiv-ghost[data-on]:not(.is-on), .kiv .kiv-ghost[data-from]:not(.is-on) { opacity: .3; }

.kiv--compact { --kiv-fs: 11.5px; --kiv-fs-s: 11px; }
.kiv--compact .kiv-fig { gap: 8px; }
.kiv--compact .kiv-notes, .kiv--nonotes .kiv-notes, .kiv--compact .kiv-more { display: none; }
.kiv--compact .kiv-cap { margin-top: 8px; }

/* ===========================================================================
   1 · sequence
   =========================================================================== */
.kiv-seq-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 8px;
}
@container kiv (min-width: 520px) { .kiv-seq-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kiv-seq-chip {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px 8px;
  border: 1px solid var(--kiv-line);
  border-radius: 10px;
  background: var(--kiv-surface);
  font-size: var(--kiv-fs-s);
  font-weight: 600;
  line-height: 1.3;
  transition: opacity .5s var(--kiv-ease), border-color .4s, background-color .4s, box-shadow .4s;
}
.kiv-seq-badge {
  position: absolute;
  top: -8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  transition: opacity .5s var(--kiv-ease), background-color .4s, color .4s;
}
.kiv-seq-badge--c { background: var(--kiv-accent); color: var(--kiv-on-accent); }
.kiv-seq-badge--m { background: var(--kiv-bg); color: var(--kiv-bad-ink); border: 1px solid var(--kiv-bad); }
.kiv-sequence[data-step="0"] .kiv-seq-chip.is-c,
.kiv-sequence[data-step="3"] .kiv-seq-chip.is-c { border-color: var(--kiv-accent); background: var(--kiv-accent-soft); box-shadow: 0 0 0 3px var(--kiv-accent-soft); }
.kiv-sequence[data-step="1"] .kiv-seq-chip.is-c { border-color: var(--kiv-good); background: var(--kiv-good-soft); }
.kiv-sequence[data-step="1"] .kiv-seq-chip.is-c .kiv-seq-badge--c { background: var(--kiv-good); color: var(--kiv-bg); }
.kiv-sequence[data-step="1"] .kiv-seq-chip.is-m { border-color: var(--kiv-bad); border-style: dashed; background: var(--kiv-bad-soft); }
.kiv-sequence[data-step="1"] .kiv-seq-chip:not(.is-c):not(.is-m),
.kiv-sequence[data-step="2"] .kiv-seq-chip { opacity: .42; }
.kiv-sequence[data-step="3"] .kiv-seq-chip:not(.is-c) { opacity: .6; }

.kiv-seq-band { min-height: 96px; }
.kiv-seq-band > .kiv-stack-i { align-self: center; }
.kiv-seq-q {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0 6px 14px;
  border-left: 3px solid var(--kiv-accent);
}
.kiv-seq-q-big { font-size: clamp(16px, 4.6cqw, 22px); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.kiv-seq-q-sub { font-size: var(--kiv-fs); color: var(--kiv-muted); max-width: 48ch; }

.kiv-seq-mm { display: flex; flex-direction: column; gap: 8px; }
.kiv-seq-mm-row {
  display: grid;
  grid-template-columns: minmax(78px, max-content) minmax(26px, 1fr) minmax(0, 1.9fr);
  align-items: center;
  gap: 8px;
}
.kiv-seq-tool {
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--kiv-data);
  color: var(--kiv-bg);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.kiv-seq-mm-arrow { position: relative; height: 20px; }
.kiv-seq-mm-arrow i { position: absolute; left: 0; right: 2px; top: 50%; border-top: 2px solid currentColor; }
.kiv-seq-mm-arrow i::after {
  content: ""; position: absolute; right: -2px; top: -6px;
  border: 5px solid transparent; border-left: 7px solid currentColor; border-right: 0;
}
.kiv-seq-mm-arrow b {
  position: absolute; left: 50%; top: 50%;
  width: 20px; height: 20px; margin: -10px 0 0 -10px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: var(--kiv-bg);
  font-size: 11px;
}
.kiv-seq-mm-row--bad .kiv-seq-mm-arrow { color: var(--kiv-bad); }
.kiv-seq-mm-row--good .kiv-seq-mm-arrow { color: var(--kiv-good); }
.kiv-seq-mm-row--bad .kiv-seq-tool { background: var(--kiv-surface-2); color: var(--kiv-ink); }
.kiv-seq-mm-target { display: flex; flex-direction: column; font-size: var(--kiv-fs-s); line-height: 1.3; min-width: 0; }
.kiv-seq-mm-target b { font-weight: 600; }
.kiv-seq-mm-target small { font-size: 11px; font-weight: 600; }
.kiv-seq-mm-row--bad small { color: var(--kiv-bad-ink); }
.kiv-seq-mm-row--good small { color: var(--kiv-good); }

.kiv-seq-div {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(22px, 8cqw, 64px) auto clamp(22px, 8cqw, 64px) minmax(0, 1fr);
  grid-template-rows: auto auto;
  row-gap: 26px;
  align-items: center;
}
.kiv-seq-obj { position: relative; z-index: 1; font-size: var(--kiv-fs-s); font-weight: 600; line-height: 1.25; }
.kiv-seq-obj--tl { grid-row: 1; grid-column: 1; justify-self: end; text-align: right; }
.kiv-seq-obj--bl { grid-row: 2; grid-column: 1; justify-self: end; text-align: right; }
.kiv-seq-obj--tr { grid-row: 1; grid-column: 5; justify-self: start; }
.kiv-seq-obj--br { grid-row: 2; grid-column: 5; justify-self: start; }
.kiv-seq-hub {
  position: relative; z-index: 1;
  grid-row: 1 / 3; grid-column: 3;
  width: 70px; height: 70px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--kiv-grad);
  color: var(--kiv-on-accent);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}

.kiv-seq-path {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 6px;
}
.kiv-seq-track {
  position: absolute;
  top: 13px;
  left: calc(50% / var(--n));
  right: calc(50% / var(--n));
  height: 2px;
  background: var(--kiv-line);
}
.kiv-seq-track-fill {
  position: absolute; inset: 0;
  background: var(--kiv-grad);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .6s var(--kiv-ease);
}
.kiv-sequence[data-step="3"] .kiv-seq-track-fill { transform: scaleX(1); }
.kiv-seq-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.kiv-seq-num {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--kiv-line);
  background: var(--kiv-bg);
  color: var(--kiv-muted);
  font-size: 12px;
  font-weight: 700;
  transition: background-color .4s, border-color .4s, color .4s;
}
.kiv-seq-lbl { font-size: 11px; line-height: 1.3; font-weight: 500; color: var(--kiv-muted); transition: color .4s; overflow-wrap: anywhere; }
@container kiv (min-width: 480px) { .kiv-seq-lbl { font-size: var(--kiv-fs-s); } }
.kiv-sequence[data-step="3"] .kiv-seq-num {
  background: var(--kiv-data); border-color: var(--kiv-data); color: var(--kiv-bg);
  transition-delay: calc(var(--i) * 140ms);
}
.kiv-sequence[data-step="3"] .kiv-seq-lbl { color: var(--kiv-ink); font-weight: 600; transition-delay: calc(var(--i) * 140ms); }

/* ===========================================================================
   2 · reach
   =========================================================================== */
.kiv-reach-field {
  position: relative;
  aspect-ratio: 2.3 / 1;
  min-height: 150px;
  max-height: 250px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--kiv-data-faint), transparent 80%);
}
.kiv-reach-dots { position: absolute; inset: 28px 10px 8px 10px; }
.kiv-dot {
  position: absolute;
  width: clamp(8px, 2.3cqw, 12px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid var(--kiv-data-soft);
  background: var(--kiv-bg);
  transform: translate(-50%, -50%);
  transition: background-color .45s var(--kiv-ease), border-color .45s var(--kiv-ease), opacity .4s;
  transition-delay: calc(var(--d) * 420ms);
}
.kiv--dark .kiv-dot { border-color: rgba(163, 182, 243, .55); }
.kiv-reach.kiv-at-1 .kiv-dot[data-g="-1"] { background: var(--kiv-data); border-color: var(--kiv-data); }
.kiv-reach[data-step="3"] .kiv-dot[data-g="-1"] { opacity: .5; }
.kiv-reach[data-step="3"] .kiv-dot[data-g="0"] { background: var(--kiv-data-2); border-color: var(--kiv-data-2); }
.kiv-reach[data-step="3"] .kiv-dot[data-g="1"] { background: var(--kiv-accent); border-color: var(--kiv-accent); }
.kiv-reach[data-step="3"] .kiv-dot[data-g="2"] { background: var(--kiv-bg); border: 3px solid var(--kiv-accent-2); }
.kiv-reach[data-step="3"] .kiv-dot[data-g="3"] { background: var(--kiv-good); border-color: var(--kiv-good); }
.kiv-reach[data-step="3"][data-hl] .kiv-dot { opacity: .18; transition-delay: 0s; }
.kiv-reach[data-step="3"][data-hl="0"] .kiv-dot[data-g="0"],
.kiv-reach[data-step="3"][data-hl="1"] .kiv-dot[data-g="1"],
.kiv-reach[data-step="3"][data-hl="2"] .kiv-dot[data-g="2"],
.kiv-reach[data-step="3"][data-hl="3"] .kiv-dot[data-g="3"] { opacity: 1; }

.kiv-reach-zone { position: absolute; top: 0; bottom: 0; border-radius: 12px; }
.kiv-reach-zone--in { left: 0; background: var(--kiv-data-faint); border: 1px solid var(--kiv-data-soft); }
.kiv-reach-zone--out { right: 0; border: 1.5px dashed var(--kiv-line); }
.kiv-reach-zl {
  position: absolute; top: 7px; left: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: var(--kiv-data); white-space: nowrap;
}
.kiv-reach-zone--out .kiv-reach-zl { left: auto; right: 10px; color: var(--kiv-muted); }
.kiv-reach-axis { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; color: var(--kiv-muted); letter-spacing: .02em; }
.kiv-reach-axis i { position: relative; flex: 1; height: 1.5px; background: linear-gradient(90deg, var(--kiv-data), var(--kiv-muted)); }
.kiv-reach-axis i::after {
  content: ""; position: absolute; right: -1px; top: -4px;
  border: 4.5px solid transparent; border-left: 7px solid var(--kiv-muted); border-right: 0;
}
.kiv-reach .kiv-legend-served { transition: opacity .4s; }
.kiv-reach[data-step="0"] .kiv-legend-served { opacity: .35; }
.kiv-reach-panel { min-height: 0; }
.kiv-reach-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@container kiv (min-width: 600px) { .kiv-reach-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kiv-reach-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--kiv-line);
  border-radius: 10px;
  background: var(--kiv-surface);
  font-size: 11px;
  line-height: 1.35;
  color: var(--kiv-muted);
  transition: border-color .3s, opacity .3s;
}
.kiv-reach-card > b { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--kiv-ink); line-height: 1.25; }
.kiv-sw { width: 11px; height: 11px; border-radius: 50%; flex: none; }
@container kiv (max-width: 479px) { .kiv-reach-card .kiv-more { display: none; } .kiv-reach-card { justify-content: center; min-height: 36px; } }
.kiv-reach-card[data-g="0"] .kiv-sw { background: var(--kiv-data-2); }
.kiv-reach-card[data-g="1"] .kiv-sw { background: var(--kiv-accent); }
.kiv-reach-card[data-g="2"] .kiv-sw { border: 3px solid var(--kiv-accent-2); }
.kiv-reach-card[data-g="3"] .kiv-sw { background: var(--kiv-good); }
.kiv-reach[data-hl="0"] .kiv-reach-card[data-g="0"],
.kiv-reach[data-hl="1"] .kiv-reach-card[data-g="1"],
.kiv-reach[data-hl="2"] .kiv-reach-card[data-g="2"],
.kiv-reach[data-hl="3"] .kiv-reach-card[data-g="3"] { border-color: var(--kiv-ink); }

/* ===========================================================================
   3 · cashgap
   =========================================================================== */
.kiv-cg-plot {
  --up: 40%;
  --dn: 60%;
  --bw: min(38px, calc(100% / var(--n) * .42));
  position: relative;
  height: clamp(200px, 48cqw, 260px);
}
.kiv-cg-axis { position: absolute; left: 0; right: 0; top: var(--up); height: 1.5px; background: var(--kiv-ink); opacity: .6; }
.kiv-cg-gap {
  position: absolute; left: 0; top: var(--up);
  height: calc(var(--dn) * .88 * .94 + 6px);
  background: var(--kiv-bad-soft);
  border: 1.5px dashed var(--kiv-bad);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  transform-origin: bottom;
  transition: transform .6s var(--kiv-ease);
}
.kiv-cashgap[data-step="2"] .kiv-cg-gap { transform: scaleY(var(--gs)); }
.kiv-cg-cover {
  position: absolute; left: 0; top: var(--up);
  height: calc(var(--up) * .86 * var(--adv));
  background: var(--kiv-data-faint);
  border-bottom: 1.5px dashed var(--kiv-data-2);
}
.kiv-cg-bar { position: absolute; width: var(--bw); transform: translateX(-50%); }
.kiv-cg-bar--dn {
  top: var(--up);
  height: calc(var(--dn) * var(--f) * .94);
  background: var(--kiv-accent);
  border-radius: 0 0 4px 4px;
  transition: opacity .5s var(--kiv-ease), background-color .4s, border-color .4s;
}
.kiv-cg-bar--dn.is-wait {
  background: repeating-linear-gradient(135deg, var(--kiv-accent) 0 3px, transparent 3px 7px);
  border: 1.5px solid var(--kiv-accent);
  border-top: 0;
}
.kiv-cashgap[data-step="1"] .kiv-cg-bar--dn.is-late { opacity: .22; }
.kiv-cg-bar--up { bottom: calc(100% - var(--up)); border-radius: 4px 4px 0 0; transform-origin: bottom; }
.kiv-cg-pay { height: calc(var(--up) * .86); background: var(--kiv-data); transition: transform .6s var(--kiv-ease); }
.kiv-cashgap[data-step="2"] .kiv-cg-pay { transform: translateX(-50%) scaleY(calc(1 - var(--adv))); }
.kiv-cg-adv { height: calc(var(--up) * .86 * var(--adv)); background: var(--kiv-data-2); }
.kiv-cg-stop {
  position: absolute;
  top: calc(var(--up) + var(--dn) * var(--f) * .94);
  width: 22px; height: 22px;
  margin: -26px 0 0 -11px;
  box-shadow: 0 0 0 2px var(--kiv-bg);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--kiv-bad);
  color: var(--kiv-bg);
  font-size: 11px;
  font-weight: 700;
}
.kiv-cg-lbl { position: absolute; left: 0; top: 0; }
.kiv-cg-lbl .kiv-stack-i { display: flex; flex-direction: column; gap: 2px; font-size: 11px; line-height: 1.3; color: var(--kiv-muted); }
.kiv-cg-lbl b { font-size: var(--kiv-fs); color: var(--kiv-ink); line-height: 1.25; }
.kiv-cg-lbl .is-bad b { color: var(--kiv-bad-ink); }
.kiv-cg-lbl .is-adv b { color: var(--kiv-data-2); }
.kiv--dark .kiv-cg-lbl .is-adv b { color: var(--kiv-data); }
.kiv-cg-gaptag {
  position: absolute; left: 8px; top: calc(var(--up) + var(--dn) * .88 * .94 - 16px);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--kiv-bad-ink);
  white-space: nowrap;
}
.kiv-cg-stages {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 4px;
  margin-top: -4px;
}
.kiv-cg-stages span { font-size: 11px; font-weight: 600; line-height: 1.25; text-align: center; color: var(--kiv-muted); overflow-wrap: anywhere; }
.kiv-cg-stages span.is-pay { color: var(--kiv-data); }

/* ===========================================================================
   4 · amplifier
   =========================================================================== */
.kiv-amp-meter { display: flex; flex-direction: column; gap: 7px; }
.kiv-amp-mhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.kiv-amp-mword { font-size: var(--kiv-fs); font-weight: 700; text-align: right; justify-items: end; }
.kiv-amplifier[data-step="1"] .kiv-amp-mword { color: var(--kiv-bad-ink); }
.kiv-amp-track { height: 14px; border-radius: 999px; background: var(--kiv-surface-2); overflow: hidden; }
.kiv-amp-fill { height: 100%; width: 90%; border-radius: inherit; background: var(--kiv-grad); transition: width .7s var(--kiv-ease); }
.kiv-amplifier[data-step="1"] .kiv-amp-fill { width: 20%; }
.kiv-amplifier[data-step="2"] .kiv-amp-fill { width: 34%; }
.kiv-amp-link { position: relative; width: 2px; height: 16px; margin: -4px auto; background: var(--kiv-line); }
.kiv-amp-link::after {
  content: ""; position: absolute; left: 50%; top: -3px; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom: 6px solid var(--kiv-muted); border-top: 0;
}
.kiv-amp-rbf {
  align-self: center;
  width: min(100%, 380px);
  display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap;
  gap: 2px 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--kiv-data);
  color: var(--kiv-bg);
  text-align: center;
}
.kiv-amp-rbf b { font-size: 18px; letter-spacing: .02em; }
.kiv-amp-rbf span { font-size: 11px; font-weight: 600; }
.kiv-amp-found { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@container kiv (min-width: 500px) { .kiv-amp-found { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); } }
.kiv-amp-block {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 6px;
  min-height: 62px;
  padding: 9px 10px;
  border: 1.5px solid var(--kiv-data);
  border-radius: 8px;
  background: var(--kiv-data-faint);
  font-size: var(--kiv-fs-s);
  font-weight: 700;
  line-height: 1.3;
  transition: border-color .4s, background-color .4s;
}
.kiv-amp-block.is-crack { padding-right: 34px; }
.kiv-amp-crack {
  position: absolute; right: 6px; top: 7px;
  width: 26px; height: 16px;
  fill: none; stroke: var(--kiv-bad); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transition: opacity .4s;
}
.kiv-amplifier.kiv-at-1 .kiv-amp-block.is-crack { border-style: dashed; border-color: var(--kiv-bad); background: var(--kiv-bad-soft); }
.kiv-amplifier.kiv-at-1 .kiv-amp-block.is-crack .kiv-amp-crack { opacity: 1; }
.kiv-amplifier[data-step="2"] .kiv-amp-block.is-help { border-style: solid; border-color: var(--kiv-good); background: var(--kiv-good-soft); }
.kiv-amplifier[data-step="2"] .kiv-amp-block.is-help .kiv-amp-crack { opacity: .3; }
.kiv-amp-tag { font-size: 11px; font-weight: 600; line-height: 1.3; }
.kiv-amp-tag--bad { color: var(--kiv-bad-ink); }
.kiv-amp-tag--good { color: var(--kiv-good); }
.kiv-amp-flabel { text-align: center; margin-top: -4px; }

/* ===========================================================================
   5 · triggers
   =========================================================================== */
.kiv-tr-chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kiv-tr-link {
  position: relative;
  display: flex; align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--kiv-line);
  border-radius: 8px;
  background: var(--kiv-surface);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--kiv-muted);
  transition: border-color .4s, background-color .4s, color .4s;
}
.kiv-tr-link:not(:last-child)::after {
  content: ""; position: absolute; right: -12px; top: 50%;
  width: 7px; height: 7px;
  border-top: 1.5px solid var(--kiv-muted); border-right: 1.5px solid var(--kiv-muted);
  transform: translateY(-50%) rotate(45deg);
}
.kiv-triggers[data-step="0"] .kiv-tr-link[data-i="0"] { border-color: var(--kiv-accent); background: var(--kiv-accent-soft); color: var(--kiv-ink); }
.kiv-triggers.kiv-at-1 .kiv-tr-link:not([data-i="0"]) { border-color: var(--kiv-data); background: var(--kiv-data-faint); color: var(--kiv-ink); }
.kiv-triggers[data-step="2"] .kiv-tr-link:not([data-i="0"]) { border-color: var(--kiv-bad); background: var(--kiv-bad-soft); }

.kiv-tr-grid { --tr-cols: minmax(76px, 26%) minmax(0, 1fr); display: grid; }
.kiv-tr-row, .kiv-tr-lane { display: grid; grid-template-columns: var(--tr-cols); column-gap: 14px; align-items: center; }
.kiv-tr-lane { padding: 7px 0; border-top: 1px solid var(--kiv-line-2); transition: opacity .5s var(--kiv-ease); }
.kiv-tr-headrow { padding-bottom: 4px; }
.kiv-tr-axtitle { font-size: 11px; font-weight: 600; color: var(--kiv-muted); }
.kiv-tr-pressure { color: var(--kiv-bad-ink); font-weight: 700; }
.kiv-tr-lab { font-size: 11px; font-weight: 700; line-height: 1.25; }
.kiv-tr-track { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kiv-tr-track::before {
  content: ""; position: absolute; inset: -7px 0 -7px -8px; border-radius: 6px;
  background: linear-gradient(90deg, transparent 0%, var(--kiv-bad-soft) 45%, rgba(201, 87, 58, .26) 100%);
  opacity: 0; transition: opacity .6s var(--kiv-ease);
}
.kiv-triggers[data-step="2"] .kiv-tr-lane--p .kiv-tr-track::before { opacity: 1; }
.kiv-tr-marks { position: relative; height: 18px; }
.kiv-tr-rule { position: relative; font-size: 11px; line-height: 1.3; color: var(--kiv-muted); }
.kiv-tr-bar { position: absolute; top: 5px; height: 8px; display: flex; gap: 2px; }
.kiv-tr-bar b { flex: 1; border-radius: 2px; background: var(--kiv-data-soft); }
.kiv-tr-dash { position: absolute; top: 8px; height: 0; border-top: 1.5px dashed var(--kiv-muted); opacity: .7; }
.kiv-triggers[data-step="0"] .kiv-tr-lane--p { opacity: .4; }
.kiv-triggers.kiv-at-1 .kiv-tr-lane--sale { opacity: .45; }
.kiv-tr-ticks { position: relative; height: 22px; border-top: 1px solid var(--kiv-line); }
.kiv-tr-ticks span { position: absolute; top: 5px; transform: translateX(-50%); font-size: 11px; color: var(--kiv-muted); }
.kiv-tr-ticks .kiv-tr-more { font-weight: 700; }

/* ===========================================================================
   6 · goldilocks
   =========================================================================== */
.kiv-gl-top { min-height: 52px; }
.kiv-gl-top > .kiv-stack-i { align-self: end; }
.kiv-gl-q { position: relative; height: 52px; }
.kiv-gl-q-t {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.kiv-gl-q-br {
  position: absolute; left: 30%; width: 40%; bottom: 3px; height: 9px;
  border: 1.5px solid var(--kiv-muted); border-bottom: 0; border-radius: 5px 5px 0 0;
}
.kiv-gl-drift { display: flex; flex-direction: column; gap: 6px; padding-bottom: 2px; }
.kiv-gl-drift-l { font-size: 11px; font-weight: 600; line-height: 1.3; color: var(--kiv-bad-ink); text-align: center; padding: 0 3%; }
.kiv-gl-drift-a { position: relative; height: 12px; }
.kiv-gl-drift-fill {
  position: absolute; left: 6px; right: 0; top: 50%;
  border-top: 2px dashed var(--kiv-bad);
  transform-origin: right; transform: scaleX(0);
  transition: transform .8s var(--kiv-ease) .1s;
}
.kiv-goldilocks[data-step="2"] .kiv-gl-drift-fill { transform: scaleX(1); }
.kiv-gl-drift-head { position: absolute; left: -2px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-right: 9px solid var(--kiv-bad); border-left: 0; }
.kiv-gl-drift-dot { position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--kiv-bad); }

.kiv-gl-scale { position: relative; display: grid; grid-template-columns: 30fr 40fr 30fr; height: 40px; }
.kiv-gl-z {
  display: flex; align-items: center;
  padding: 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap;
  transition: background-color .45s, color .45s, box-shadow .45s;
}
.kiv-gl-z--low { background: var(--kiv-data-faint); color: var(--kiv-data); border-radius: 10px 0 0 10px; }
.kiv-gl-z--mid {
  justify-content: center;
  color: var(--kiv-muted);
  background: repeating-linear-gradient(135deg, var(--kiv-surface-2) 0 6px, transparent 6px 12px);
  box-shadow: inset 0 0 0 1px var(--kiv-line);
}
.kiv-gl-z--high { justify-content: flex-end; background: var(--kiv-accent-soft); color: var(--kiv-accent-ink); border-radius: 0 10px 10px 0; }
.kiv-goldilocks[data-step="0"] .kiv-gl-z--mid { color: var(--kiv-ink); box-shadow: inset 0 0 0 1.5px var(--kiv-muted); }
/* verbatim: the middle label is a longer doc quote, so it may wrap */
.kiv--verbatim .kiv-gl-scale { grid-template-columns: minmax(0, 30fr) minmax(0, 40fr) minmax(0, 30fr); }
.kiv--verbatim .kiv-gl-z--mid { white-space: normal; text-align: center; line-height: 1.2; letter-spacing: .06em; padding: 0 6px; }
.kiv-goldilocks[data-step="1"] .kiv-gl-z--low { background: var(--kiv-data-soft); }
.kiv-goldilocks[data-step="2"] .kiv-gl-z--high { background: rgba(247, 148, 30, .32); }
.kiv-gl-dot {
  position: absolute; top: 100%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--kiv-bad);
  border: 2.5px solid var(--kiv-bg);
  box-shadow: 0 0 0 1px var(--kiv-bad);
}
.kiv-gl-marks { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 58px; }
.kiv-gl-pin { position: absolute; top: -12px; height: 26px; width: 0; border-left: 1.5px solid var(--kiv-bad); }
.kiv-gl-m { padding-top: 18px; font-size: 11px; line-height: 1.35; }
.kiv-gl-m--low { grid-column: 1; }
.kiv-gl-m--high { grid-column: 2; text-align: right; }
.kiv-gl-fig { display: block; font-size: 16px; font-weight: 700; color: var(--kiv-bad-ink); line-height: 1.1; margin-bottom: 2px; }
.kiv-gl-mt { font-weight: 600; }
.kiv-gl-fp { margin-left: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--kiv-muted); }
.kiv-gl-mn { display: block; color: var(--kiv-muted); }
.kiv-gl-risks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kiv-gl-col { padding-top: 8px; border-top: 2px solid var(--kiv-line); transition: opacity .5s var(--kiv-ease), border-color .4s; }
.kiv-gl-col > b { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--kiv-muted); transition: color .4s; }
.kiv-gl-col ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: var(--kiv-fs-s); line-height: 1.3; }
.kiv-gl-col li { position: relative; padding-left: 12px; }
.kiv-gl-col li::before { content: ""; position: absolute; left: 0; top: .5em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .55; }
.kiv-gl-col.is-future { opacity: .55; }
.kiv-gl-col.is-now { border-color: var(--kiv-bad); }
.kiv-gl-col.is-now > b { color: var(--kiv-bad-ink); }
.kiv-gl-col.is-past { opacity: .7; }

/* ===========================================================================
   7 · pyramid
   =========================================================================== */
.kiv-py-grid { display: grid; gap: 7px; transition: opacity .5s var(--kiv-ease); }
.kiv-py-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: center; transition: opacity .5s var(--kiv-ease); }
.kiv-py-barcell { position: relative; height: 34px; display: flex; justify-content: center; align-items: center; }
.kiv-py-bar { height: 100%; border-radius: 6px; background: var(--kiv-data); }
.kiv-py-row[data-k="0"] .kiv-py-bar { background: var(--kiv-accent); }
.kiv-py-row[data-k="1"] .kiv-py-bar { background: var(--kiv-data-2); }
.kiv-py-ghost { position: absolute; inset: 0; border: 1.5px dashed var(--kiv-muted); border-radius: 6px; }
.kiv-py-ghost::before, .kiv-py-ghost::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  border-top: 1.5px solid var(--kiv-muted); border-right: 1.5px solid var(--kiv-muted);
}
.kiv-py-ghost::before { left: 8px; transform: rotate(45deg); }
.kiv-py-ghost::after { right: 8px; transform: rotate(-135deg); }
.kiv-pyramid[data-step="1"] .kiv-py-bar--top { animation: kiv-shrink .8s var(--kiv-ease) both; transform-origin: center; }
@keyframes kiv-shrink { from { transform: scaleX(calc(100 / var(--w))); } to { transform: scaleX(1); } }
.kiv-pyramid[data-step="1"] .kiv-py-row:not([data-k="0"]) { opacity: .4; }
.kiv-pyramid[data-step="2"] .kiv-py-grid { opacity: .4; }
.kiv-py-lab { display: flex; flex-direction: column; gap: 1px; font-size: 11px; line-height: 1.3; color: var(--kiv-muted); min-width: 0; }
.kiv-py-lab > b { font-size: var(--kiv-fs); color: var(--kiv-ink); }
.kiv-py-idcol { color: var(--kiv-accent-ink); font-weight: 600; }
.kiv-py-fe { margin-top: 4px; }
.kiv-py-flow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.kiv-py-fl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--kiv-muted); padding-top: 12px; }
.kiv-py-pipe { position: relative; height: 80px; }
.kiv-py-line { position: absolute; left: 0; right: 0; top: 46px; height: 12px; margin-top: -6px; border-radius: 999px; background: var(--kiv-surface-2); }
/* zero-width wrappers positioned with left: (a full-width box moved with translateX overflowed the page) */
.kiv-py-dw {
  position: absolute; left: var(--x0); top: 46px; width: 0; height: 0;
  transition: left .8s var(--kiv-ease);
  transition-delay: calc(var(--k) * 35ms);
}
.kiv-py-dw i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--kiv-data); transition: background-color .4s; }
.kiv-pyramid[data-step="2"] .kiv-py-dw { left: var(--x1); }
.kiv-pyramid[data-step="2"] .kiv-py-dw i { background: var(--kiv-accent); }
.kiv-py-gate { position: absolute; top: 32px; width: 4px; height: 28px; margin-left: -2px; border-radius: 2px; background: var(--kiv-good); transition: background-color .4s, transform .4s; }
.kiv-pyramid[data-step="2"] .kiv-py-gate { background: var(--kiv-bad); transform: scaleY(1.25); }
.kiv-py-gatel { position: absolute; top: 64px; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--kiv-muted); white-space: nowrap; }
.kiv-py-wait {
  position: absolute; top: 0; max-width: 60%;
  display: flex; flex-direction: column; align-items: flex-end;
  padding-right: 8px;
  font-size: 11px; line-height: 1.2; color: var(--kiv-bad-ink); text-align: right;
}
.kiv-py-wait b { font-size: 14px; white-space: nowrap; }

/* ===========================================================================
   8 · datauses
   =========================================================================== */
.kiv-du-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(84px, 21cqw, 116px) minmax(0, 1fr);
  column-gap: clamp(18px, 6cqw, 46px);
  row-gap: 10px;
  align-items: center;
}
.kiv-du-hub {
  position: relative; z-index: 1;
  width: 100%; aspect-ratio: 1;
  display: grid; place-items: center;
  padding: 4px;
  border-radius: 50%;
  background: var(--kiv-data);
  color: var(--kiv-bg);
  box-shadow: 0 0 0 6px var(--kiv-data-faint);
  font-size: 11px; font-weight: 700; line-height: 1.2; text-align: center;
}
.kiv-du-node {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 3px;
  padding: 6px 9px;
  border: 1px solid var(--kiv-line);
  border-radius: 8px;
  background: var(--kiv-surface);
  font-size: 11px; font-weight: 600; line-height: 1.3;
  transition: opacity .45s var(--kiv-ease), border-color .4s, background-color .4s;
}
@container kiv (min-width: 480px) { .kiv-du-node { font-size: var(--kiv-fs-s); } }
.kiv--light .kiv-du-node, .kiv:not(.kiv--dark) .kiv-du-node { background: #fff; }
.kiv-du-node--pay { justify-self: center; text-align: center; }
.kiv-du-node--pay { border-color: var(--kiv-accent); background: var(--kiv-accent-soft); margin-bottom: 4px; }
.kiv:not(.kiv--dark) .kiv-du-node--pay { background: #fff4e6; }
.kiv-du-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; align-items: start; position: relative; z-index: 1; }
.kiv-du-call { display: flex; flex-direction: column; gap: 2px; padding: 5px 8px; border-left: 2px solid var(--kiv-good); font-size: 11px; line-height: 1.3; min-width: 0; }
.kiv-du-call b { color: var(--kiv-good); font-weight: 700; }
.kiv-du-call--ed { align-items: center; text-align: center; border: 1.5px dashed var(--kiv-bad); border-radius: 8px; background: var(--kiv-bg); }
.kiv-du-call--ed b { color: var(--kiv-bad-ink); }
.kiv-du-call--ed span { color: var(--kiv-muted); }
.kiv-datauses[data-step="2"] .kiv-du-node.is-ex::after {
  content: "\2713"; position: absolute; top: -8px; right: -6px;
  width: 18px; height: 18px; display: grid; place-items: center;
  border-radius: 50%; background: var(--kiv-good); color: var(--kiv-bg); font-size: 11px; font-weight: 700;
}
.kiv-datauses[data-step="0"] .kiv-du-node--l, .kiv-datauses[data-step="0"] .kiv-du-node--r { opacity: .5; }
.kiv-datauses.kiv-at-1 .kiv-du-node--l, .kiv-datauses.kiv-at-1 .kiv-du-node--r { border-color: var(--kiv-data-2); }
.kiv-datauses[data-step="2"] .kiv-du-node--l:not(.is-ex), .kiv-datauses[data-step="2"] .kiv-du-node--r:not(.is-ex) { opacity: .5; border-color: var(--kiv-line); }
.kiv-datauses[data-step="2"] .kiv-du-node.is-ex { border-color: var(--kiv-good); border-width: 1.5px; }
.kiv:not(.kiv--dark).kiv-datauses[data-step="2"] .kiv-du-node.is-ex { background: #eef6f0; }
.kiv--dark.kiv-datauses[data-step="2"] .kiv-du-node.is-ex { background: var(--kiv-good-soft); }
.kiv-du-l { fill: none; stroke: var(--kiv-line); stroke-width: 1.5; stroke-dasharray: 3 4; transition: stroke .4s, opacity .4s; }
.kiv-du-end { fill: var(--kiv-muted); opacity: .5; transition: fill .4s, opacity .4s; }
.kiv-du-l.kiv-du-l--pay { stroke: var(--kiv-accent); stroke-width: 2.2; stroke-dasharray: none; }
.kiv-du-end.kiv-du-l--pay { fill: var(--kiv-accent); opacity: 1; }
.kiv-datauses.kiv-at-1 .kiv-du-l.kiv-du-l--use { stroke: var(--kiv-data-2); stroke-dasharray: none; }
.kiv-datauses.kiv-at-1 .kiv-du-end.kiv-du-l--use { fill: var(--kiv-data-2); opacity: 1; }
.kiv-datauses[data-step="2"] .kiv-du-l--use:not(.is-ex) { opacity: .3; }
.kiv-datauses[data-step="2"] .kiv-du-l.kiv-du-l--use.is-ex { stroke: var(--kiv-good); stroke-width: 2.2; }
.kiv-datauses[data-step="2"] .kiv-du-end.kiv-du-l--use.is-ex { fill: var(--kiv-good); }
.kiv-du-l--ed, .kiv-du-end.kiv-du-l--ed { opacity: 0; }
.kiv-datauses[data-step="2"] .kiv-du-l.kiv-du-l--ed { opacity: 1; stroke: var(--kiv-bad); }
.kiv-datauses[data-step="2"] .kiv-du-end.kiv-du-l--ed { opacity: 1; fill: var(--kiv-bad); }

/* ===========================================================================
   9 · claimcash
   =========================================================================== */
.kiv-cc-pipe { position: relative; height: 70px; }
.kiv-cc-line, .kiv-cc-jam { position: absolute; top: 16px; height: 8px; margin-top: -4px; border-radius: 999px; }
.kiv-cc-line { background: var(--kiv-surface-2); box-shadow: inset 0 0 0 1px var(--kiv-line-2); }
.kiv-cc-jam { background: repeating-linear-gradient(135deg, var(--kiv-bad) 0 4px, transparent 4px 8px); }
.kiv-cc-stage {
  position: absolute; top: 0;
  width: calc(100% / var(--n));
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transform: translateX(-50%);
}
.kiv-cc-node {
  position: relative; z-index: 1;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid var(--kiv-data);
  background: var(--kiv-bg);
  color: var(--kiv-data);
  font-size: 12px; font-weight: 700;
  transition: border-color .4s, box-shadow .4s, color .4s;
}
.kiv-cc-sl { font-size: 11px; font-weight: 700; line-height: 1.2; text-align: center; }
.kiv-claimcash[data-step="0"] .is-proc .kiv-cc-node,
.kiv-claimcash[data-step="0"] .is-budget .kiv-cc-node { border-color: var(--kiv-accent); box-shadow: 0 0 0 5px var(--kiv-accent-soft); }
.kiv-claimcash[data-step="1"] .is-proc .kiv-cc-node,
.kiv-claimcash[data-step="1"] .is-budget .kiv-cc-node { border-color: var(--kiv-bad); color: var(--kiv-bad-ink); box-shadow: 0 0 0 5px var(--kiv-bad-soft); }
.kiv-claimcash[data-step="1"] .is-budget .kiv-cc-node { border-style: dashed; }
.kiv-claimcash[data-step="2"] .is-pay .kiv-cc-node { border-color: var(--kiv-good); box-shadow: 0 0 0 5px var(--kiv-good-soft); }
.kiv-cc-coinw {
  position: absolute; left: var(--c0); top: 16px; width: 0; height: 0; z-index: 2;
  transition: left .9s var(--kiv-ease);
}
.kiv-claimcash[data-step="1"] .kiv-cc-coinw { left: var(--c1); }
.kiv-claimcash[data-step="2"] .kiv-cc-coinw { left: var(--c2); }
.kiv-cc-panel > .kiv-stack-i { align-self: start; }
.kiv-cc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kiv-cc-card { padding: 9px 11px; border: 1px solid var(--kiv-line); border-radius: 10px; background: var(--kiv-surface); }
.kiv-cc-card > b { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--kiv-accent-ink); }
.kiv-cc-card ul { margin: 5px 0 0; padding-left: 15px; font-size: var(--kiv-fs-s); line-height: 1.35; }
.kiv-cc-nep p { margin: 4px 0 8px; font-size: var(--kiv-fs); line-height: 1.45; }
.kiv-cc-cons { display: flex; flex-wrap: wrap; gap: 6px; }
.kiv-cc-cons span {
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--kiv-bad); background: var(--kiv-bad-soft);
  font-size: 11px; font-weight: 700; color: var(--kiv-bad-ink);
}
.kiv-cc-brow { display: grid; grid-template-columns: minmax(86px, max-content) minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 7px; }
.kiv-cc-bl { font-size: 11px; font-weight: 700; color: var(--kiv-muted); }
.kiv-cc-bt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kiv-cc-b { display: block; height: 12px; border-radius: 3px; flex: 0 1 auto; }
.kiv-cc-b--before { width: 100%; background: var(--kiv-muted); opacity: .45; }
.kiv-cc-b--after { width: 100%; background: var(--kiv-data); transition: width .8s var(--kiv-ease) .2s; }
.kiv-claimcash[data-step="2"] .kiv-cc-b--after { width: 52%; }
.kiv-cc-bt em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--kiv-data); white-space: nowrap; flex: none; }
.kiv-cc-good > p { margin-top: 8px; font-size: 11px; line-height: 1.4; color: var(--kiv-muted); }

/* ===========================================================================
   10 · spectrum
   =========================================================================== */
.kiv-sp-goods { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kiv-sp-good { display: flex; align-items: center; gap: 8px; font-size: var(--kiv-fs-s); font-weight: 700; line-height: 1.3; }
.kiv-sp-good--l { color: var(--kiv-data); }
.kiv-sp-good--r { justify-content: flex-end; text-align: right; color: var(--kiv-accent-ink); }
.kiv-sp-good i { position: relative; flex: 0 0 22px; height: 2px; background: currentColor; }
.kiv-sp-good--l i::before, .kiv-sp-good--r i::after {
  content: ""; position: absolute; top: -4px; border: 5px solid transparent;
}
.kiv-sp-good--l i::before { left: -3px; border-right: 7px solid currentColor; border-left: 0; }
.kiv-sp-good--r i::after { right: -3px; border-left: 7px solid currentColor; border-right: 0; }
.kiv-sp-ends { display: flex; justify-content: space-between; gap: 12px; font-size: var(--kiv-fs); margin-bottom: -4px; }
.kiv-sp-ends b { max-width: 48%; }
.kiv-sp-ends b + b { text-align: right; }
.kiv-sp-axis { position: relative; height: 30px; margin: 0 8px; }
.kiv-sp-bar { position: absolute; left: -8px; right: -8px; top: 50%; height: 8px; margin-top: -4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--kiv-data), var(--kiv-data-soft) 50%, var(--kiv-accent)); }
.kiv-sp-hyb { position: absolute; top: 0; bottom: 0; border-radius: 10px; background: var(--kiv-surface-2); box-shadow: inset 0 0 0 1px var(--kiv-line); }
.kiv-sp-dot {
  position: absolute; top: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 3px solid var(--kiv-ink);
  background: var(--kiv-bg);
  transition: opacity .45s var(--kiv-ease), transform .45s var(--kiv-ease);
}
.kiv-sp-dot:not(.is-on) { transform: scale(.7); }
.kiv-sp-dot.is-end.is-on { border-color: var(--kiv-ink); background: var(--kiv-accent); }
.kiv-sp-lanes { position: relative; margin: 0 8px; }
.kiv-sp-lead { position: absolute; top: -6px; width: 0; border-left: 1.5px solid var(--kiv-muted); }
.kiv-sp-lab { position: absolute; font-size: 12px; font-weight: 700; line-height: 18px; white-space: nowrap; }
.kiv-sp-lab.is-end { color: var(--kiv-ink); }
.kiv-sp-lab:not(.is-end) { color: var(--kiv-muted); }
.kiv-spectrum[data-step="2"] .kiv-sp-lab:not(.is-end) { color: var(--kiv-ink); }
.kiv-sp-hint { position: absolute; left: 0; right: 0; top: 20px; text-align: center; font-size: var(--kiv-fs); font-style: italic; color: var(--kiv-muted); }

/* ===========================================================================
   11 · structure & 12 · gender (small multiples)
   =========================================================================== */
.kiv-sms { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
@container kiv (min-width: 480px) { .kiv-sms { gap: 12px; } }
.kiv-sm {
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
  padding: 10px 9px 12px;
  border: 1px solid var(--kiv-line);
  border-radius: 12px;
  background: var(--kiv-surface);
  transition: opacity .5s var(--kiv-ease), border-color .4s, box-shadow .4s;
}
@container kiv (min-width: 480px) { .kiv-sm { padding: 12px 12px 14px; } }
.kiv-sm.is-now, .kiv-gd-pilot.is-now { border-color: var(--kiv-accent); box-shadow: 0 0 0 3px var(--kiv-accent-soft); }
.kiv-sm.is-past { opacity: .78; }
.kiv-sm.is-future { opacity: .32; }
.kiv-sm-h { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--kiv-muted); line-height: 1.3; min-height: 2.6em; overflow-wrap: anywhere; }
.kiv-sm-g { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.kiv-sm-t { font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
@container kiv (min-width: 480px) { .kiv-sm-t { font-size: var(--kiv-fs-s); } }
.kiv-sms .kiv-big { font-size: clamp(22px, 5.2cqw, 30px); }
.kiv-sm--zero .kiv-big { color: var(--kiv-bad-ink); }
.kiv-sm--share .kiv-big { color: var(--kiv-accent-ink); }
.kiv-st-seats i { display: block; width: 36px; height: 30px; border: 2px dashed var(--kiv-bad); border-radius: 10px 10px 4px 4px; position: relative; }
.kiv-st-seats i::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -8px; height: 6px; border: 2px dashed var(--kiv-bad); border-top: 0; border-radius: 0 0 3px 3px; }
.kiv-waffle { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 1.5px; width: 100%; max-width: 120px; }
.kiv-waffle i { aspect-ratio: 1; border-radius: 1.5px; background: var(--kiv-line); }
.kiv-waffle i.is-on { background: var(--kiv-accent); }
.kiv-st-grow { display: flex; align-items: center; gap: 8px; }
.kiv-st-grow > b { color: var(--kiv-muted); font-size: 14px; }
.kiv-st-one i { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--kiv-accent); }
.kiv-st-many { display: grid; grid-template-columns: repeat(3, 9px); gap: 3px; }
.kiv-st-many i { width: 9px; height: 9px; border-radius: 50%; background: var(--kiv-data); transition: transform .45s var(--kiv-ease); transition-delay: calc(var(--k) * 50ms); }
.kiv-sm.is-future .kiv-st-many i { transform: scale(.5); }
.kiv-st-levers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; transition: opacity .5s var(--kiv-ease); }
.kiv-st-levers.is-future { opacity: .45; }
.kiv-st-levers.is-now .kiv-chip { border-color: var(--kiv-accent); background: var(--kiv-accent-soft); }

.kiv-gd-mult { display: flex; align-items: flex-end; gap: 12px; }
.kiv-gd-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kiv-gd-col small { font-size: 11px; color: var(--kiv-muted); white-space: nowrap; }
.kiv-gd-stack { display: flex; flex-direction: column-reverse; gap: 2px; }
.kiv-gd-stack i { display: block; width: 22px; height: 11px; border-radius: 2px; background: var(--kiv-data-soft); }
.kiv-gd-col.is-after i { background: var(--kiv-data); transform-origin: bottom; transition: transform .45s var(--kiv-ease), opacity .45s; transition-delay: calc(var(--k) * 90ms); }
.kiv-sm.is-future .kiv-gd-col.is-after i:not(:first-child) { transform: scaleY(.1); opacity: 0; }
.kiv-gd-slope { position: relative; width: 100%; height: 70px; margin-bottom: 16px; }
.kiv-gd-slope svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kiv-gd-grid { stroke: var(--kiv-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.kiv-gd-sl { stroke: var(--kiv-data); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.kiv-gd-pt { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--kiv-data-soft); border: 2px solid var(--kiv-data); }
.kiv-gd-pt.is-to { background: var(--kiv-data); }
.kiv-gd-v { position: absolute; transform: translate(-50%, 7px); font-size: 11px; font-weight: 700; white-space: nowrap; }
.kiv-gd-ax { position: absolute; bottom: -17px; transform: translateX(-50%); font-size: 11px; color: var(--kiv-muted); white-space: nowrap; }
.kiv-gd-ax--l { left: 18%; }
.kiv-gd-ax--r { left: 82%; }
.kiv-gd-gap { display: grid; gap: 3px; width: 100%; }
.kiv-gd-gap small { font-size: 11px; color: var(--kiv-muted); }
.kiv-gd-hb { position: relative; height: 12px; }
.kiv-gd-hb i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 2px; background: var(--kiv-data-soft); }
.kiv-gd-hb.is-w i { width: calc(100% - var(--gap)); background: var(--kiv-data); transition: width .7s var(--kiv-ease); }
.kiv-sm.is-future .kiv-gd-hb.is-w i { width: 100%; }
.kiv-gd-gapmark { position: absolute; right: 0; top: -2px; bottom: -2px; width: var(--gap); border: 1.5px dashed var(--kiv-bad); border-radius: 2px; background: var(--kiv-bad-soft); }
/* gender at narrow widths: one row per case, graphic on the right */
@container kiv (max-width: 479px) {
  .kiv-gender .kiv-sms { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .kiv-gender .kiv-sm {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(96px, 42%);
    grid-template-areas: "h g" "b g" "t g";
    column-gap: 12px; row-gap: 4px;
    align-items: start;
  }
  .kiv-gender .kiv-sm > .kiv-sm-h { grid-area: h; min-height: 0; }
  .kiv-gender .kiv-sm-g { display: contents; }
  .kiv-gender .kiv-sm-g > .kiv-big { grid-area: b; }
  .kiv-gender .kiv-sm-g > :not(.kiv-big) { grid-area: g; align-self: center; justify-self: stretch; }
  .kiv-gender .kiv-sm-t { grid-area: t; }
  .kiv-gender .kiv-gd-mult { justify-content: center; }
}
.kiv-gd-pilot {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--kiv-line); border-radius: 12px; background: var(--kiv-surface);
  transition: opacity .5s var(--kiv-ease), border-color .4s, box-shadow .4s;
}
.kiv-gd-pilot .kiv-sm-h { min-height: 0; }
.kiv-gd-pilot.is-future { opacity: .32; }
.kiv-gd-pilot.is-past { opacity: .78; }
@container kiv (max-width: 479px) {
  .kiv-gd-pilot { grid-template-columns: 1fr 1fr; }
  .kiv-gd-pilot .kiv-sm-h { grid-column: 1 / -1; }
}
.kiv-gd-ind { display: flex; align-items: center; gap: 8px; font-size: 11px; line-height: 1.3; min-width: 0; }
.kiv-gd-ind i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 14px; font-weight: 700; }
.kiv-gd-ind.is-up i { background: var(--kiv-good-soft); color: var(--kiv-good); }
.kiv-gd-ind.is-up i::before { content: "\2197"; }
.kiv-gd-ind.is-flat i { background: var(--kiv-surface-2); color: var(--kiv-muted); }
.kiv-gd-ind.is-flat i::before { content: "\2192"; }

/* ===========================================================================
   13 · adapt
   =========================================================================== */
.kiv-ad-lanes { display: grid; gap: 12px; }
.kiv-ad-lane { display: grid; gap: 4px; transition: opacity .5s var(--kiv-ease); }
.kiv-ad-lane.is-future { opacity: .35; }
.kiv-ad-lane.is-past { opacity: .5; }
.kiv-ad-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.kiv-ad-head > b { font-size: var(--kiv-fs); }
.kiv-ad-kind { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--kiv-muted); transition: color .4s; }
.kiv-adapt.kiv-at-1 .kiv-ad-lane--planned .kiv-ad-kind { color: var(--kiv-good); }
.kiv-adapt.kiv-at-1 .kiv-ad-lane--abrupt .kiv-ad-kind { color: var(--kiv-bad-ink); }
.kiv-adapt[data-step="2"] .kiv-ad-lane--rhythm .kiv-ad-kind { color: var(--kiv-data); }
.kiv-ad-chart { position: relative; height: clamp(62px, 15cqw, 84px); }
.kiv-ad-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kiv-ad-base { stroke: var(--kiv-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.kiv-ad-pre, .kiv-ad-q, .kiv-ad-up, .kiv-ad-down { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.kiv-ad-pre { stroke: var(--kiv-data); stroke-width: 2.5; }
.kiv-ad-q { stroke: var(--kiv-muted); stroke-width: 2; stroke-dasharray: 2 5; }
.kiv-ad-up { stroke: var(--kiv-good); stroke-width: 3; }
.kiv-ad-down { stroke: var(--kiv-bad); stroke-width: 3; }
.kiv .kiv-ad-reveal { transition: clip-path .9s var(--kiv-ease), opacity .25s; }
.kiv .kiv-ad-reveal:not(.is-on) { clip-path: inset(0 100% 0 0); }
.kiv .kiv-ad-reveal.is-on { clip-path: inset(-10% -2% -10% 0); }
.kiv-ad-vline { position: absolute; top: 0; bottom: 5%; border-left: 1.5px dashed var(--kiv-muted); }
.kiv-ad-lbl { position: absolute; font-size: 11px; font-weight: 600; line-height: 1.25; }
.kiv-ad-lbl--rev { top: 0; transform: translateX(-100%); padding-right: 7px; color: var(--kiv-muted); white-space: nowrap; }
.kiv-ad-lbl--pct { transform: translateY(-135%); color: var(--kiv-good); font-weight: 700; white-space: nowrap; }
.kiv-ad-lbl--cliff { top: 0; right: 0; display: flex; flex-direction: column; color: var(--kiv-bad-ink); }
.kiv-ad-lbl--cliff b { font-size: var(--kiv-fs-s); }
.kiv-ad-chart--rhythm { height: 46px; }
.kiv-ad-rline { position: absolute; left: 0; right: 0; top: 70%; height: 2px; margin-top: -1px; background: var(--kiv-line); }
.kiv-ad-tick {
  position: absolute; top: 70%;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--kiv-data-soft);
  transform: scale(.6);
  transition: transform .45s var(--kiv-ease), background-color .4s;
  transition-delay: calc(var(--k) * 120ms);
}
.kiv-adapt[data-step="2"] .kiv-ad-tick { transform: scale(1); background: var(--kiv-accent); }
.kiv-ad-lbl--rh { left: 0; top: 0; color: var(--kiv-muted); }
.kiv-ad-time { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--kiv-muted); }
.kiv-ad-time i { position: relative; flex: 1; height: 1px; background: var(--kiv-line); }
.kiv-ad-time i::after { content: ""; position: absolute; right: -1px; top: -4px; border: 4.5px solid transparent; border-left: 7px solid var(--kiv-muted); border-right: 0; }

/* ===========================================================================
   14 · clocks
   =========================================================================== */
.kiv-ck-body { position: relative; display: grid; gap: 14px; padding: 0 10px; }
.kiv-ck-lane { display: grid; gap: 6px; transition: opacity .5s var(--kiv-ease); }
.kiv-ck-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: var(--kiv-fs); }
.kiv-ck-val { font-size: 15px; font-weight: 700; color: var(--kiv-data); }
.kiv-ck-lane--mk .kiv-ck-val { color: var(--kiv-accent-ink); }
.kiv-ck-sub { flex-basis: 100%; font-size: 11px; line-height: 1.3; color: var(--kiv-muted); }
.kiv-ck-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--kiv-muted); margin-top: -2px; }
.kiv-ck-leg i { width: 18px; height: 10px; border-radius: 3px; background: repeating-linear-gradient(135deg, var(--kiv-data) 0 2px, var(--kiv-data-soft) 2px 5px); }
.kiv-ck-track { position: relative; height: 16px; border-radius: 999px; background: var(--kiv-line-2); }
.kiv-ck-lane--tr .kiv-ck-track { background: none; }
.kiv-ck-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px 0 0 999px; overflow: hidden; }
.kiv-ck-bar--pg { background: var(--kiv-data); }
.kiv-ck-bar--mk { background: var(--kiv-accent); }
.kiv-ck-range { position: absolute; top: 0; bottom: 0; border-radius: 0 999px 999px 0; }
.kiv-ck-range--pg { background: linear-gradient(90deg, var(--kiv-data), var(--kiv-data-faint)); }
.kiv-ck-range--mk { background: linear-gradient(90deg, var(--kiv-accent), var(--kiv-accent-soft)); }
.kiv-ck-setup {
  position: absolute; left: 0; top: 0; bottom: 0; width: 38%;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .6) 0 2px, transparent 2px 5px);
  -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent);
  mask-image: linear-gradient(90deg, #000 55%, transparent);
  transition: opacity .5s;
}
.kiv--dark .kiv-ck-setup { background: repeating-linear-gradient(135deg, rgba(19, 31, 77, .55) 0 2px, transparent 2px 5px); }
.kiv-clocks.kiv-at-1 .kiv-ck-setup { opacity: .5; }
.kiv .kiv-grow { transform-origin: left; transition: transform .7s var(--kiv-ease), opacity .3s; }
.kiv .kiv-grow:not(.is-on) { transform: scaleX(0); }
.kiv-ck-range--mk.kiv-grow { transition-delay: .3s; }
.kiv-ck-ew { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed var(--kiv-bad); z-index: 1; }
.kiv-ck-start { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--kiv-good); z-index: 1; }
.kiv-ck-arrow { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; background: var(--kiv-good); border-radius: 2px; }
.kiv-ck-arrow::after { content: ""; position: absolute; right: -2px; top: -5px; border: 6.5px solid transparent; border-left: 10px solid var(--kiv-good); border-right: 0; }
.kiv-ck-lane--tr .kiv-ck-head b { color: var(--kiv-good); }
.kiv-ck-endev { position: relative; height: 16px; margin-top: -6px; }
.kiv-ck-endev span { position: absolute; left: var(--x); padding-left: 7px; font-size: 11px; font-weight: 700; color: var(--kiv-bad-ink); white-space: nowrap; }
.kiv-ck-endev::before { content: ""; position: absolute; left: var(--x); top: 0; height: 12px; border-left: 2px dashed var(--kiv-bad); }
.kiv-ck-ruler { position: relative; height: 22px; border-top: 1px solid var(--kiv-muted); margin-top: -4px; }
.kiv-ck-tick { position: absolute; top: 0; height: 5px; border-left: 1px solid var(--kiv-muted); }
.kiv-ck-tick b { position: absolute; top: 6px; left: 0; transform: translateX(-50%); font-size: 11px; font-weight: 500; color: var(--kiv-muted); }
@container kiv (max-width: 420px) { .kiv-ck-tick.is-odd b { display: none; } }
.kiv-ck-unit { margin-top: -10px; text-align: right; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--kiv-muted); }

/* ===========================================================================
   fallback
   =========================================================================== */
.kiv-fb { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kiv-fb-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--kiv-line); border-radius: 12px; font-size: var(--kiv-fs-s); transition: opacity .5s, border-color .4s; }
.kiv-fb-tile.is-now { border-color: var(--kiv-accent); }
.kiv-fb-tile.is-future { opacity: .45; }
.kiv-fb-take { font-size: 16px; font-weight: 600; line-height: 1.35; }

/* ===========================================================================
   Evidence map
   =========================================================================== */
.kiv-emap-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@container kiv (min-width: 680px) { .kiv-emap-body { grid-template-columns: minmax(0, 1fr) minmax(190px, 28%); align-items: start; } }
.kiv-emap-main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.kiv-emap-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 11px; color: var(--kiv-muted); }
.kiv-emap-lt { font-weight: 600; }
.kiv-emap-lg { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.kiv-emap-lg i { width: calc(var(--r) * 2); height: calc(var(--r) * 2); border-radius: 50%; background: var(--kiv-data); opacity: .85; }
.kiv-emap-map { position: relative; min-height: 120px; }
.kiv-emap-loading, .kiv-emap-fallback {
  display: grid; place-items: center;
  aspect-ratio: 2.6 / 1;
  border-radius: 12px;
  background: var(--kiv-surface-2);
  font-size: var(--kiv-fs-s);
  color: var(--kiv-muted);
}
.kiv-emap-fallback { aspect-ratio: auto; padding: 14px; place-items: start; }
.kiv-emap-fallback ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.kiv-emap-fallback button { font: inherit; font-size: 11px; font-weight: 600; color: var(--kiv-ink); background: var(--kiv-surface); border: 1px solid var(--kiv-line); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.kiv-emap-svg { display: block; width: 100%; height: auto; overflow: hidden; border-radius: 12px; }
.kiv-emap-c { fill: var(--kiv-surface-2); stroke: var(--kiv-bg); stroke-width: .6; transition: fill .3s; }
.kiv--dark .kiv-emap-c { fill: rgba(255, 255, 255, .07); }
.kiv-emap-c.is-data { fill: var(--kiv-data-faint); }
.kiv:not(.kiv--dark) .kiv-emap-c.is-data { fill: #dfe4f3; }
.kiv-emap-c.is-hl { fill: var(--kiv-accent-soft); stroke: var(--kiv-accent); stroke-width: 1; }
.kiv:not(.kiv--dark) .kiv-emap-c.is-hl { fill: #fde3c2; }
.kiv--dark .kiv-emap-c.is-hl { fill: rgba(249, 162, 58, .32); }
.kiv-emap-lead { stroke: var(--kiv-muted); stroke-width: 1; opacity: .7; }
.kiv-emap-anchor { fill: var(--kiv-muted); }
.kiv-emap-dot {
  fill: var(--kiv-data); fill-opacity: .9;
  stroke: var(--kiv-bg); stroke-width: 1.5;
  cursor: pointer;
  transition: opacity .3s, fill .3s;
}
.kiv-emap-dot:focus { outline: none; }
.kiv-emap-dot:hover, .kiv-emap-dot:focus-visible { fill: var(--kiv-accent); stroke: var(--kiv-ink); }
.kiv-emap.has-hl .kiv-emap-dot.is-off { opacity: .22; }
.kiv-emap-dot.is-on { fill: var(--kiv-accent); fill-opacity: 1; }
.kiv-emap-labels text { fill: var(--kiv-ink); font-family: inherit; font-weight: 600; paint-order: stroke; stroke: var(--kiv-bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.kiv-emap-tip {
  position: absolute; z-index: 5; left: 0; top: 0;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--kiv-ink);
  color: var(--kiv-bg);
  font-size: 12px; line-height: 1.35;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .5);
  pointer-events: none;
  opacity: 0; transform: translateY(4px);
  transition: opacity .15s, transform .15s;
}
.kiv-emap-tip.is-open { opacity: 1; transform: none; }
.kiv-emap-tip div { font-size: 11px; opacity: .85; margin-top: 2px; }
.kiv-emap-side { min-width: 0; }
.kiv-emap-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
@container kiv (min-width: 460px) and (max-width: 679px) { .kiv-emap-list { grid-template-columns: 1fr 1fr; } }
.kiv-emap-list li { transition: opacity .3s; }
.kiv-emap-list li.is-off { opacity: .4; }
.kiv-emap-item {
  appearance: none; -webkit-appearance: none;
  width: 100%; display: grid; gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--kiv-line); border-radius: 10px;
  background: var(--kiv-surface);
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
  transition: border-color .25s;
}
.kiv-emap-item:hover, .kiv-emap-item:focus-visible, .kiv-emap-list li.is-on .kiv-emap-item { border-color: var(--kiv-accent); outline: none; }
.kiv-emap-item b { font-size: var(--kiv-fs); }
.kiv-emap-sc { font-size: 11px; color: var(--kiv-muted); }
.kiv-emap-ins { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.kiv-emap-ins i, .kiv-mx-chips i {
  min-width: 22px; height: 22px; padding: 0 5px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--kiv-data-faint);
  color: var(--kiv-data);
  font-size: 11px; font-weight: 700; font-style: normal;
  transition: background-color .25s, color .25s;
}
.kiv-emap-ins i.is-on, .kiv-mx-chips i.is-hc { background: var(--kiv-accent); color: var(--kiv-on-accent); }

/* ===========================================================================
   Matrix
   =========================================================================== */
.kiv-mx-wrap { width: 100%; overflow-x: auto; }
.kiv-mx-grid {
  display: grid;
  grid-template-columns: minmax(128px, 1.9fr) repeat(var(--c), minmax(20px, 1fr)) 46px;
  min-width: 440px;
  font-size: var(--kiv-fs-s);
}
.kiv-mx-corner { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 0 8px 6px 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--kiv-muted); border-bottom: 1px solid var(--kiv-line); }
.kiv-mx-block { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px 4px; border-top: 3px solid var(--kiv-data); font-size: 11px; color: var(--kiv-muted); text-align: center; }
.kiv-mx-block.is-alt { border-top-color: var(--kiv-accent); }
.kiv-mx-block > b { font-size: 12px; color: var(--kiv-ink); }
.kiv-mx-bname { display: none; line-height: 1.2; font-weight: 600; overflow-wrap: anywhere; }
@container kiv (min-width: 900px) { .kiv-mx-bname { display: block; } }
.kiv-mx-col, .kiv-mx-row {
  appearance: none; -webkit-appearance: none;
  border: 0; background: none;
  font: inherit; color: inherit;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.kiv-mx-col { padding: 5px 0; border-bottom: 1px solid var(--kiv-line); font-size: 12px; font-weight: 700; }
.kiv-mx-col:focus-visible, .kiv-mx-row:focus-visible { outline: 2px solid var(--kiv-accent); outline-offset: -2px; }
.kiv-mx-cnt-h { align-self: end; padding: 0 0 6px; border-bottom: 1px solid var(--kiv-line); font-size: 11px; font-weight: 700; color: var(--kiv-muted); text-align: center; line-height: 1.2; }
.kiv-mx-row { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 5px 8px 5px 0; border-bottom: 1px solid var(--kiv-line-2); text-align: left; line-height: 1.25; }
.kiv-mx-row b { font-size: var(--kiv-fs-s); font-weight: 700; }
.kiv-mx-row span { font-size: 11px; color: var(--kiv-muted); }
.kiv-mx-cell { display: grid; place-items: center; min-height: 32px; border-bottom: 1px solid var(--kiv-line-2); transition: background-color .2s; }
.kiv-mx-cell.is-alt { background: rgba(20, 32, 63, .035); }
.kiv--dark .kiv-mx-cell.is-alt { background: rgba(255, 255, 255, .04); }
.kiv-mx-cell i { width: 5px; height: 5px; border-radius: 50%; background: var(--kiv-line); transition: transform .2s, background-color .2s; }
.kiv-mx-cell.is-cite i { width: 12px; height: 12px; background: var(--kiv-data); }
.kiv-mx-cnt { display: grid; place-items: center; border-bottom: 1px solid var(--kiv-line-2); font-weight: 700; color: var(--kiv-data); }
.kiv-mx .is-hr, .kiv-mx .is-hc { background: var(--kiv-accent-soft); }
.kiv-mx .kiv-mx-cell.is-hr.is-hc { background: rgba(247, 148, 30, .3); }
.kiv-mx .kiv-mx-cell.is-cite.is-hr i, .kiv-mx .kiv-mx-cell.is-cite.is-hc i { background: var(--kiv-accent); transform: scale(1.15); }
.kiv-mx .kiv-mx-row.is-hr b, .kiv-mx .kiv-mx-col.is-hc { color: var(--kiv-accent-ink); }
.kiv-mx-list { display: none; list-style: none; margin: 0; padding: 0; }
.kiv-mx-li {
  appearance: none; -webkit-appearance: none;
  width: 100%;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--kiv-line); border-radius: 10px;
  background: var(--kiv-surface);
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
}
.kiv-mx-lname { display: grid; gap: 1px; min-width: 0; }
.kiv-mx-lname b { font-size: var(--kiv-fs); }
.kiv-mx-lname span { font-size: 11px; color: var(--kiv-muted); }
.kiv-mx-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 55%; }
.kiv-mx-list li.is-hr .kiv-mx-li { border-color: var(--kiv-accent); }
.kiv-mx-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px !important; font-size: 11px; color: var(--kiv-muted); }
.kiv-mx-key b { color: var(--kiv-ink); margin-right: 2px; }
@container kiv (max-width: 519px) {
  .kiv-mx-wrap { display: none; }
  .kiv-mx-list { display: grid; gap: 6px; }
}

/* ===========================================================================
   Reduced motion: final states, no movement.
   =========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .kiv *, .kiv *::before, .kiv *::after {
    transition: none !important;
    animation: none !important;
  }
}
