.vp {
  --ink: #17211b; --muted: #64706a; --line: #d7dfd8; --teal: #275f55; --good: #2e6f40; --bg: #f8faf8;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.vp *, .vp *::before, .vp *::after { box-sizing: border-box; }

.vp-bar { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.vp-title { font-size: 15px; font-weight: 800; margin-right: auto; }
.vp-btn {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  cursor: pointer; font-size: 12px; font-weight: 800; padding: 7px 11px;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}
.vp-btn:active { transform: scale(0.97); }
@media (hover: hover) { .vp-btn:hover { background: #f6fbf8; border-color: #b8c7bc; } }
.vp-hint { color: var(--muted); font-size: 11px; width: 100%; }

.vp-stage { align-items: stretch; display: grid; gap: 16px; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .72fr); }

.vp-scene {
  background:
    radial-gradient(120% 90% at 50% 18%, #ffffff 0%, var(--bg) 60%, #eef3ef 100%);
  border: 1px solid var(--line); border-radius: 12px;
  min-height: 540px; min-width: 0; overflow: hidden; position: relative; touch-action: none;
}
.vp-canvas { display: block; inset: 0; position: absolute; width: 100%; height: 100%; }

/* click-through container stacked above the canvas; opacity driven in JS (camera fly).
   pointer-events:none lets empty-area drags reach the canvas (drag-to-orbit);
   only the chips opt back in, and only while face-on (.vp-int). */
.vp-overlay { inset: 0; position: absolute; pointer-events: none; z-index: 2; }
.vp-axis {
  background: rgba(255, 255, 255, .94); border: 1px solid var(--line); cursor: default;
  border-radius: 9px; box-shadow: 0 10px 26px -22px rgba(23, 33, 27, .6);
  display: grid; gap: 5px; left: 0; min-width: 116px; padding: 6px 8px 7px; pointer-events: none;
  position: absolute; top: 0; white-space: nowrap; backdrop-filter: blur(2px);
}
.vp-overlay.vp-int .vp-axis { pointer-events: auto; }   /* chips interactive only while face-on */
.vp-axhead { align-items: center; display: flex; gap: 7px; }
.vp-axcl { border-radius: 2px; flex: none; height: 11px; width: 4px; }
.vp-axis strong { font-size: 12px; font-weight: 700; margin-right: auto; }
.vp-score { border-radius: 999px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 900; padding: 2px 7px; }
.vp-eye {
  align-items: center; background: transparent; border: 0; border-radius: 6px; color: var(--muted);
  cursor: pointer; display: flex; justify-content: center; padding: 2px; min-height: 24px; min-width: 24px;
  transition: color 140ms ease, background-color 140ms ease;
}
.vp-eye:hover, .vp-eye:focus-visible { background: #eef3ef; color: var(--teal); outline: none; }
.vp-axisbar { background: #e6ede8; border-radius: 999px; height: 6px; overflow: hidden; }
.vp-axisbar span { display: block; height: 100%; border-radius: 999px; transition: width 220ms var(--ease-out); }

/* eye-tooltip: per-axis brief / submetric panel + gaps-proof line (CFP scorecard parity) */
.vp-tip {
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 24px 50px -24px rgba(23, 33, 27, .55); left: 0; padding: 12px; pointer-events: none;
  position: absolute; top: 0; white-space: normal; width: 232px; z-index: 6;
}
.vp-tip[hidden] { display: none; }
.vp-tip-head { align-items: center; display: flex; gap: 7px; }
.vp-tip-head strong { font-size: 13px; font-weight: 800; margin-right: auto; }
.vp-tip-score { font-family: ui-monospace, Menlo, monospace; font-size: 17px; font-weight: 900; }
.vp-pill { border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: .03em; padding: 2px 7px; text-transform: uppercase; }
.vp-pill.good { background: #e5f3e9; color: var(--good); }
.vp-pill.watch { background: #fff0d6; color: #8a4b00; }
.vp-pill.risk { background: #fae8e8; color: #9b2424; }
.vp-tip-sub { color: var(--muted); font-size: 12px; margin-top: 5px; }
.vp-tip-sub b { font-family: ui-monospace, Menlo, monospace; font-weight: 800; }
.vp-tip-sub b.up { color: var(--good); } .vp-tip-sub b.down { color: #9b2424; }
.vp-tip-spark { align-items: center; color: var(--muted); display: flex; font-size: 10px; gap: 8px; margin-top: 8px; }
.vp-spark { flex: none; }
.vp-tip-sec { border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .04em; margin-top: 9px; padding-top: 8px; text-transform: uppercase; }
.vp-tip-proof { display: grid; gap: 7px; list-style: none; margin: 7px 0 0; padding: 0; }
.vp-tip-proof li { border-left: 3px solid var(--line); display: grid; gap: 2px; padding: 1px 0 1px 9px; }
.vp-tip-proof li.ok { border-left-color: var(--good); } .vp-tip-proof li.sug { border-left-color: #d8a657; }
.vp-tip-proof li > div { font-size: 12px; font-weight: 600; }
.vp-tip-proof .vp-src { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 10px; font-weight: 400; }
.vp-tip-gap { color: var(--muted); font-size: 12px; margin-top: 7px; }

.vp-side {
  align-content: start; background: #fbfcfb; border: 1px solid var(--line); border-radius: 12px;
  display: grid; gap: 8px; max-height: 600px; min-width: 0; overflow: auto; padding: 14px;
}
.vp-when { font-size: 13px; } .vp-when b { font-size: 15px; }
.vp-avg { color: var(--muted); font-size: 13px; }
.vp-avg strong { color: var(--ink); font-family: ui-monospace, Menlo, monospace; font-size: 18px; }
.vp-d, .vp-deltas b { border-radius: 999px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 800; padding: 1px 7px; }
.vp-d.up, .vp-deltas b.up { background: #e5f3e9; color: var(--good); }
.vp-d.down, .vp-deltas b.down { background: #fae8e8; color: #9b2424; }
.vp-sec { border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .04em; margin-top: 6px; padding-top: 10px; text-transform: uppercase; }
.vp-deltas { display: grid; gap: 5px; list-style: none; margin: 0; padding: 0; }
.vp-deltas li { align-items: center; display: flex; font-size: 13px; gap: 8px; justify-content: space-between; }
.vp-deltas span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-changes { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.vp-changes li { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; display: grid; gap: 3px; padding: 9px 10px; }
.vp-changes li:has(.vp-st.ok) { border-left-color: var(--good); }
.vp-changes li:has(.vp-st.sug) { border-left-color: #d8a657; }
.vp-st { border-radius: 999px; font-size: 10px; font-weight: 900; justify-self: start; padding: 2px 7px; text-transform: uppercase; }
.vp-st.ok { background: #e5f3e9; color: var(--good); } .vp-st.sug { background: #fff0d6; color: #8a4b00; }
.vp-what { font-size: 13px; font-weight: 600; } .vp-tg { color: var(--teal); font-size: 12px; font-weight: 700; } .vp-src { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.vp-empty { color: var(--muted); font-size: 13px; }

.vp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.vp-chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700; padding: 5px 11px; transition: transform 140ms var(--ease-out); }
.vp-chip:active { transform: scale(0.97); }
.vp-chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }

@media (max-width: 860px) { .vp-stage { grid-template-columns: 1fr; } .vp-scene { min-height: 420px; } .vp-side { max-height: none; } }

/* ---- drill-down: per-axis sub-spider (detail-on-demand) ---- */
.vp-drill { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(23, 33, 27, .42); backdrop-filter: blur(3px); animation: vp-fade 160ms ease; }
.vp-drill[hidden] { display: none; }
@keyframes vp-fade { from { opacity: 0; } to { opacity: 1; } }
.vp-drill-card { background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 40px 90px -40px rgba(23, 33, 27, .7); max-width: 760px; width: 100%;
  max-height: 88vh; overflow: auto; padding: 20px 22px 22px; position: relative;
  animation: vp-pop 200ms var(--ease-out); }
@keyframes vp-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.vp-drill-x { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); cursor: pointer; display: grid; font-size: 18px; height: 30px; line-height: 1;
  place-items: center; position: absolute; right: 12px; top: 12px; width: 30px;
  transition: background-color 140ms ease, color 140ms ease; }
.vp-drill-x:hover { background: #f6fbf8; color: var(--ink); }
.vp-drill-head { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; padding-right: 36px; }
.vp-drill-id { margin-right: auto; }
.vp-drill-ax { font-size: 19px; font-weight: 800; }
.vp-drill-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.vp-drill-score { font-family: ui-monospace, Menlo, monospace; font-size: 30px; font-weight: 900; line-height: 1; }
.vp-drill-score span { color: var(--muted); font-size: 13px; font-weight: 700; }
.vp-conf { background: #eef3ef; border-radius: 999px; color: #3a4f5c; font-size: 10px; font-weight: 800;
  letter-spacing: .02em; padding: 3px 9px; text-transform: capitalize; }
.vp-drill-body { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); margin-top: 16px; }
.vp-subradar { display: block; height: auto; width: 100%; }
.vp-sub-node { cursor: pointer; transition: fill .12s ease; }
@media (hover: hover) and (pointer: fine) { .vp-sub-node:hover { fill: rgba(39, 95, 85, .12); } }
.vp-drill-right { align-content: start; display: grid; gap: 14px; }
.vp-drill-lbl { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .05em; margin-bottom: 5px; text-transform: uppercase; }
.vp-drill-hl { align-items: baseline; display: flex; flex-wrap: wrap; gap: 8px; }
.vp-hl-tag { background: #fff0d6; border-radius: 999px; color: #8a4b00; font-size: 10px; font-weight: 900; letter-spacing: .03em; padding: 3px 9px; text-transform: uppercase; }
.vp-drill-hl b { font-size: 14px; font-weight: 800; }
.vp-drill-act p { font-size: 13px; line-height: 1.5; margin: 0; }
.vp-prov-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vp-prov-chips span { background: #f1f5f1; border: 1px solid #e2e8e2; border-radius: 7px; color: #3c4a43;
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; padding: 3px 8px; }
.vp-drill-info { border-top: 1px solid var(--line); display: grid; gap: 12px; margin-top: 16px; padding-top: 14px; }
.vp-mtn { display: block; height: auto; width: 100%; }
.vp-time-exp { color: var(--muted); font-size: 12px; margin-top: 6px; }
.vp-time-exp b { font-family: ui-monospace, Menlo, monospace; font-weight: 800; }
.vp-time-exp b.up { color: var(--good); } .vp-time-exp b.down { color: #9b2424; }
.vp-time-back { background: #f1f5f1; border: 1px solid var(--line); border-radius: 7px; color: var(--teal); cursor: pointer; font-size: 10px; font-weight: 800; margin-left: 6px; padding: 1px 7px; }
.vp-list-lbl { margin: 18px 0 8px; }
.vp-drill-list { display: grid; gap: 7px; }
.vp-li { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; display: grid; gap: 11px; grid-template-columns: 24px minmax(0, 1fr) auto; padding: 7px 9px; text-align: left; width: 100%;
  transition: background-color 130ms ease, border-color 130ms ease, transform 110ms var(--ease-out); }
.vp-li:active { transform: scale(0.995); }
@media (hover: hover) { .vp-li:hover { background: #f6fbf8; border-color: #b8c7bc; } }
.vp-li.active { background: #f1f7f3; border-color: var(--teal); box-shadow: inset 2px 0 0 var(--teal); }
.vp-li-n { align-items: center; border-radius: 7px; color: #fff; display: flex; font-size: 11px; font-weight: 900; height: 24px; justify-content: center; width: 24px; }
.vp-li-main { min-width: 0; }
.vp-li-top { align-items: baseline; display: flex; gap: 8px; justify-content: space-between; }
.vp-li-top b { font-size: 13px; font-weight: 700; }
.vp-li-score { font-family: ui-monospace, Menlo, monospace; font-size: 13px; font-weight: 900; }
.vp-li-bar { background: #e6ede8; border-radius: 999px; height: 5px; margin: 4px 0 3px; overflow: hidden; }
.vp-li-bar span { border-radius: 999px; display: block; height: 100%; }
.vp-li-src { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-li-w { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 800; }
.vp-drill-caveat { background: #fbfaf6; border: 1px solid #ece4d2; border-radius: 9px; color: #6a5b3a; font-size: 12px; line-height: 1.5; margin-top: 14px; padding: 10px 12px; }
.vp-drill-caveat b { color: #8a4b00; }

/* ---- issue layer: the agent-ready work bound to each metric ---- */
.vp-drill-issues { margin-top: 16px; }
.vp-issues-lbl { align-items: center; display: flex; gap: 8px; }
.vp-issues-n { background: #275f55; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 800; min-width: 18px; padding: 1px 7px; text-align: center; }
.vp-issues-empty { background: #f6f9f6; border: 1px dashed #d7dfd8; border-radius: 9px; color: #64706a; font-size: 12.5px; padding: 12px 14px; }
.vp-issues-list { display: grid; gap: 9px; }
.vp-issue { background: #fff; border: 1px solid #d7dfd8; border-left: 4px solid #c7d2cb; border-radius: 10px; padding: 11px 13px; }
.vp-issue.p0 { border-left-color: #9b2424; } .vp-issue.p1 { border-left-color: #c0701c; } .vp-issue.p2 { border-left-color: #2f7d86; } .vp-issue.p3 { border-left-color: #9aa6a0; }
.vp-issue-top { align-items: baseline; display: flex; flex-wrap: wrap; gap: 8px; }
.vp-sev { border-radius: 6px; color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .03em; padding: 2px 7px; }
.vp-sev.p0 { background: #9b2424; } .vp-sev.p1 { background: #c0701c; } .vp-sev.p2 { background: #2f7d86; } .vp-sev.p3 { background: #768079; }
.vp-issue-title { color: #17211b; font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.vp-issue-type { background: #eef3ef; border-radius: 6px; color: #3a4f5c; font-family: ui-monospace, Menlo, monospace; font-size: 10px; margin-left: auto; padding: 2px 7px; }
.vp-issue-sm { color: #64706a; font-size: 11px; font-weight: 700; letter-spacing: .03em; margin-top: 3px; text-transform: uppercase; }
.vp-issue-line { color: #3c4a43; font-size: 12.5px; line-height: 1.5; margin-top: 6px; }
.vp-issue-line span { color: #64706a; font-size: 10px; font-weight: 900; letter-spacing: .05em; margin-right: 6px; text-transform: uppercase; }
.vp-issue-urls { display: grid; gap: 4px; margin-top: 8px; }
.vp-issue-url { align-items: baseline; display: flex; flex-wrap: wrap; gap: 8px; }
.vp-issue-url a { color: #275f55; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; font-weight: 600; text-decoration: none; }
.vp-issue-url a:hover { text-decoration: underline; }
.vp-issue-prob { color: #64706a; font-size: 11px; }
.vp-issue-foot { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 9px; }
.vp-issue-gh { background: #1f2328; border-radius: 7px; color: #fff; font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700; padding: 3px 9px; text-decoration: none; }
.vp-issue-gh.none { background: #f1f3f1; color: #8a948d; font-weight: 600; }
.vp-issue-impact { font-size: 12px; font-weight: 800; }
.vp-issue-impact.up { color: #2e6f40; } .vp-issue-impact.down { color: #9b2424; }
.vp-issue-status { background: #eef3ef; border-radius: 999px; color: #3a4f5c; font-size: 10px; font-weight: 800; margin-left: auto; padding: 2px 9px; text-transform: capitalize; }
.vp-issues-more { color: #64706a; font-size: 12px; padding: 4px 2px; }

@media (max-width: 620px) { .vp-drill-body { grid-template-columns: 1fr; } .vp-subradar { margin: 0 auto; max-width: 320px; } }
@media (prefers-reduced-motion: reduce) {
  .vp-drill, .vp-drill-card { animation: none; }
  .vp-axisbar span, .vp-rank-bar span, .vp-cluster-bar span, .vp-li-bar span, .vp-mtn { transition: none; }
  .vp-btn, .vp-chip, .vp-rank-row, .vp-li { transition: none; }
  .vp-btn:active, .vp-chip:active, .vp-rank-row:active, .vp-li:active { transform: none; }
}

/* ---- run badge (live vs demo) ---- */
.vp-runbadge { border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: .03em; padding: 3px 9px; text-transform: uppercase; }
.vp-runbadge[hidden] { display: none; }
.vp-runbadge.live { background: #e5f3e9; color: var(--good); text-transform: none; letter-spacing: 0; }
.vp-runbadge.demo { background: #eef1ee; color: #586058; }

/* ---- weak-axis pop on the face-on chips (Von Restorff) ---- */
.vp-axis.weak { border-color: #e6c3c3; box-shadow: 0 0 0 1px #f0d2d2, 0 10px 26px -22px rgba(155, 36, 36, .55); }

/* ---- cluster summary strip: the chunked, group-level read ---- */
.vp-cluster-strip { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.vp-cluster-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--cl); border-radius: 10px; padding: 9px 12px; }
.vp-cluster-top { align-items: baseline; display: flex; gap: 8px; justify-content: space-between; }
.vp-cluster-name { color: var(--cl); font-size: 12px; font-weight: 800; letter-spacing: .01em; }
.vp-cluster-avg { font-family: ui-monospace, Menlo, monospace; font-size: 17px; font-weight: 900; }
.vp-cluster-bar { background: #e6ede8; border-radius: 999px; height: 5px; margin: 6px 0 5px; overflow: hidden; }
.vp-cluster-bar span { background: var(--cl); border-radius: 999px; display: block; height: 100%; transition: width 240ms var(--ease-out); }
.vp-cluster-axes { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 680px) { .vp-cluster-strip { grid-template-columns: 1fr; } }

/* ---- drill header cluster tag ---- */
.vp-drill-cl { background: color-mix(in srgb, var(--cl) 14%, #fff); border-radius: 999px; color: var(--cl); font-size: 10px; font-weight: 800; padding: 2px 7px; }

/* ---- ranked bar-rail: radar = gestalt, bars = precise ranking ---- */
.vp-rank { margin-top: 16px; }
.vp-rank-h { align-items: baseline; display: flex; gap: 10px; margin-bottom: 9px; }
.vp-rank-h > span:first-child { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.vp-rank-sub { color: var(--muted); font-size: 11px; }
.vp-rank-grid { display: grid; gap: 6px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vp-rank-row { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
  display: grid; gap: 9px; grid-template-columns: 16px 8px minmax(64px, 0.9fr) minmax(0, 1.3fr) auto 10px; padding: 6px 10px; text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease, transform 120ms var(--ease-out); width: 100%; }
.vp-rank-cl { border-radius: 3px; height: 14px; width: 8px; }
.vp-rank-row:active { transform: scale(0.99); }
@media (hover: hover) { .vp-rank-row:hover { background: #f6fbf8; border-color: #b8c7bc; } }
.vp-rank-row.weak { border-left: 4px solid #d8a657; }
.vp-rank-n { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 800; text-align: center; }
.vp-rank-lab { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-rank-bar { background: #e6ede8; border-radius: 999px; height: 6px; overflow: hidden; }
.vp-rank-bar span { border-radius: 999px; display: block; height: 100%; transition: width 220ms var(--ease-out); }
.vp-rank-sc { font-family: ui-monospace, Menlo, monospace; font-size: 13px; font-weight: 900; text-align: right; }
.vp-rank-dot { border-radius: 50%; height: 9px; width: 9px; }
.vp-rank-dot.ok { background: #2e6f40; } .vp-rank-dot.mid { background: #d8a657; } .vp-rank-dot.low { background: #9b2424; }
.vp-rank-dot.none { background: transparent; box-shadow: inset 0 0 0 1.5px #d2dad3; }
@media (max-width: 860px) { .vp-rank-grid { grid-template-columns: 1fr; } }
