/* ============================================================
   VAPM™ LIVE ANALYSIS SIMULATION
   Homepage "The Deliverable" — replaces the static report mock.
   Self-contained: only depends on the global design tokens.
   ============================================================ */

.vapm-live {
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  background: #0a0a0b;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  font-family: var(--font-body);
  color: #f5f5f5;
  --vl-green: #34d399;
  --vl-amber: #f2b544;
  --vl-red: #e02424;
  --vl-dim: rgba(255, 255, 255, 0.34);
  --vl-dimmer: rgba(255, 255, 255, 0.18);
}

[data-theme='light'] .vapm-live {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  border-color: rgba(0, 0, 0, 0.14);
}

/* ---------- Brand bar ---------- */
.vapm-live__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 13px 18px;
  background: #121214;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.vapm-live__brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.vapm-live__brand svg { width: 20px; height: 14px; flex-shrink: 0; }
.vapm-live__wordmark {
  font-family: var(--font-display);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; color: #fff; line-height: 1.2;
}
.vapm-live__tagline {
  font-size: 8.5px; letter-spacing: 0.05em; color: var(--vl-dim); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vapm-live__conf {
  font-family: var(--font-display);
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--vl-red); border: 1px solid rgba(224, 36, 36, 0.55);
  border-radius: var(--radius-sm); padding: 3px 7px; flex-shrink: 0;
}

/* ---------- Property header ---------- */
.vapm-live__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-3); padding: 14px 18px 10px;
}
.vapm-live__addr { font-size: 12.5px; font-weight: 700; color: #fff; line-height: 1.3; }
.vapm-live__meta { font-size: 10px; color: var(--vl-dim); margin-top: 2px; line-height: 1.35; }
.vapm-live__phase {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0; padding-top: 2px;
  font-family: var(--font-display);
  font-size: 8.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--vl-dim); text-align: right;
}
.vapm-live__dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--vl-green); flex-shrink: 0;
  animation: vlPulse 2s ease-in-out infinite;
}
@keyframes vlPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- Clock row ---------- */
.vapm-live__clock {
  display: flex; align-items: center; gap: 10px; padding: 4px 18px 12px;
}
.vapm-live__time {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700; color: #fff; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 62px;
}
.vapm-live__bar-track {
  flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.09); overflow: hidden;
}
.vapm-live__bar-fill {
  height: 100%; width: 0%; border-radius: 2px; background: #fff;
  transition: width 0.5s linear;
}
.vapm-live__eta { font-size: 9.5px; color: var(--vl-dim); white-space: nowrap; flex-shrink: 0; }
.vapm-live__now {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: 9.5px; color: var(--vl-green);
}

/* ---------- Fan-out graph ---------- */
.vapm-live__graph { position: relative; height: 118px; margin: 0 12px 6px; }
.vapm-live__graph svg { width: 100%; height: 100%; display: block; overflow: visible; }
.vl-edge {
  fill: none; stroke: rgba(52, 211, 153, 0.30); stroke-width: 0.7;
  stroke-dasharray: 3 3; opacity: 0;
  animation: vlEdgeIn 0.6s ease forwards, vlDash 3s linear infinite;
}
@keyframes vlEdgeIn { to { opacity: 1; } }
@keyframes vlDash { to { stroke-dashoffset: -24; } }
.vl-node { fill: var(--vl-green); opacity: 0; animation: vlNodeIn 0.5s ease forwards; }
@keyframes vlNodeIn { from { opacity: 0; } to { opacity: 0.85; } }
.vl-node--hot { fill: var(--vl-amber); }
.vl-spark { fill: #eafff6; }

.vapm-live__seed,
.vapm-live__out {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.vapm-live__seed { left: 4px; }
.vapm-live__out { right: 4px; }
.vapm-live__seed span,
.vapm-live__out span {
  font-family: var(--font-display);
  font-size: 7px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--vl-dimmer);
}
.vapm-live__chip {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.20); background: #141416;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 700; color: #fff;
}
.vapm-live__doc {
  width: 34px; height: 44px; border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18); background: #141416;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.vapm-live__doc svg { width: 16px; height: 16px; color: var(--vl-dimmer); transition: color 0.4s ease; }
.vapm-live.is-done .vapm-live__doc {
  border-color: rgba(52, 211, 153, 0.75);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.30);
}
.vapm-live.is-done .vapm-live__doc svg { color: var(--vl-green); }

/* floating status pills over the graph */
.vapm-live__pill {
  position: absolute; padding: 2px 7px; border-radius: 4px;
  background: rgba(242, 181, 68, 0.13); border: 1px solid rgba(242, 181, 68, 0.38);
  color: var(--vl-amber); font-size: 8.5px; letter-spacing: 0.02em; white-space: nowrap;
  opacity: 0; transition: opacity 0.45s ease; pointer-events: none;
}
.vapm-live__pill.is-on { opacity: 1; }
.vapm-live__pill--ok {
  background: rgba(52, 211, 153, 0.13); border-color: rgba(52, 211, 153, 0.38); color: var(--vl-green);
}

/* ---------- Domain tracks ---------- */
.vapm-live__tracks { padding: 4px 18px 10px; }
.vapm-live__track { padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.vapm-live__track:last-child { border-bottom: 0; }
.vapm-live__track-top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
}
.vapm-live__track-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--vl-dimmer); flex-shrink: 0;
  transition: background 0.4s ease;
}
.vapm-live__track.is-live .vapm-live__track-dot { background: var(--vl-green); }
.vapm-live__track-name {
  flex: 1; font-size: 11px; color: rgba(255, 255, 255, 0.78); line-height: 1.25; min-width: 0;
}
.vapm-live__track-count {
  font-size: 9.5px; color: var(--vl-dim); font-variant-numeric: tabular-nums;
  flex-shrink: 0; letter-spacing: 0.02em;
}
.vapm-live__track-track { height: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.07); }
.vapm-live__track-fill {
  height: 100%; width: 0%; border-radius: 1px; background: var(--vl-green);
  transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- VAPM analysis badge grid ---------- */
.vapm-live__badges {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 2px 18px 12px;
}
.vapm-live__badge {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  padding: 3px 0; border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.015);
  font-family: var(--font-display);
  font-size: 7.5px; font-weight: 600; letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.16);
  transition: color 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
.vapm-live__badge::before {
  content: ''; width: 3px; height: 3px; border-radius: 50%;
  background: currentColor; opacity: 0; transition: opacity 0.35s ease;
}
.vapm-live__badge.is-run {
  color: var(--vl-amber); border-color: rgba(242, 181, 68, 0.35); background: rgba(242, 181, 68, 0.07);
}
.vapm-live__badge.is-done {
  color: var(--vl-green); border-color: rgba(52, 211, 153, 0.32); background: rgba(52, 211, 153, 0.06);
}
.vapm-live__badge.is-run::before,
.vapm-live__badge.is-done::before { opacity: 1; }

/* ---------- Counters ---------- */
.vapm-live__counts {
  display: grid; grid-template-columns: 1.15fr 1fr 0.95fr; gap: 1px;
  margin: 0 18px 12px; background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.07); border-radius: var(--radius-md); overflow: hidden;
}
.vapm-live__count { background: #0d0d0f; padding: 9px 10px; min-width: 0; }
.vapm-live__count-k {
  font-family: var(--font-display);
  font-size: 7.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--vl-dim); line-height: 1.3; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vapm-live__count-v {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--font-display); font-size: 17px; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.vapm-live__count-v em { font-style: normal; color: var(--vl-amber); }
.vapm-live__count-v small { font-size: 11px; font-weight: 600; color: var(--vl-dim); }

/* ---------- Live task feed ---------- */
.vapm-live__feed {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px;
  padding: 0 18px 12px; min-height: 118px; align-content: start;
}
.vapm-live__task {
  display: flex; align-items: center; gap: 6px; padding: 3px 0; min-width: 0;
  opacity: 0; transform: translateY(3px);
  animation: vlTaskIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes vlTaskIn { to { opacity: 1; transform: translateY(0); } }
.vapm-live__task-dot {
  width: 4px; height: 4px; border-radius: 50%; background: var(--vl-amber); flex-shrink: 0;
}
.vapm-live__task.is-done .vapm-live__task-dot { background: var(--vl-green); }
.vapm-live__task-label {
  flex: 1; font-size: 9.5px; color: rgba(255, 255, 255, 0.62); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vapm-live__task-tag {
  font-family: var(--font-display);
  font-size: 7px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.17); flex-shrink: 0;
}

/* ---------- Status line ---------- */
.vapm-live__status {
  padding: 10px 18px 12px; border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px; line-height: 1.5; color: rgba(255, 255, 255, 0.55);
}
.vapm-live__status strong { color: #fff; font-weight: 600; }

/* ---------- Report-ready reveal ---------- */
.vapm-live__ready {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center;
  margin: 0 18px 14px; padding: 12px 14px;
  border: 1px solid rgba(52, 211, 153, 0.28); border-radius: var(--radius-md);
  background: rgba(52, 211, 153, 0.05);
  max-height: 0; opacity: 0; overflow: hidden; padding-block: 0; margin-bottom: 0;
  border-width: 0; transition: none;
}
.vapm-live.is-done .vapm-live__ready {
  max-height: 200px; opacity: 1; padding-block: 12px; margin-bottom: 14px; border-width: 1px;
  transition: opacity 0.5s ease 0.1s, max-height 0.5s ease, padding 0.5s ease, margin 0.5s ease;
}
.vapm-live__gauge { position: relative; width: 62px; height: 62px; flex-shrink: 0; }
.vapm-live__gauge svg { width: 62px; height: 62px; transform: rotate(-90deg); }
.vapm-live__gauge-arc {
  stroke: var(--vl-red); stroke-width: 6; fill: none; stroke-linecap: round;
  stroke-dasharray: 176; stroke-dashoffset: 176;
}
.vapm-live.is-done .vapm-live__gauge-arc {
  transition: stroke-dashoffset 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
  stroke-dashoffset: 46;
}
.vapm-live__gauge-num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--vl-red); line-height: 1;
}
.vapm-live__gauge-num small { font-size: 8px; font-weight: 600; color: var(--vl-dim); margin-top: 1px; }
.vapm-live__ready-k {
  font-family: var(--font-display);
  font-size: 8px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--vl-green); margin-bottom: 3px;
}
.vapm-live__ready h4 { font-size: 12.5px; font-weight: 700; color: #fff; margin: 0 0 5px; line-height: 1.3; }
.vapm-live__ready p { font-size: 9.5px; color: rgba(255, 255, 255, 0.52); margin: 0; line-height: 1.45; }
.vapm-live__band {
  display: inline-block; margin-top: 6px; padding: 2px 7px; border-radius: 4px;
  font-family: var(--font-display);
  font-size: 8px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  background: rgba(224, 36, 36, 0.15); color: #ff6b6b;
}

/* ---------- Footer strip ---------- */
.vapm-live__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 10px 18px; background: rgba(224, 36, 36, 0.07);
  border-top: 1px solid rgba(224, 36, 36, 0.20);
}
.vapm-live__foot span {
  font-family: var(--font-display);
  font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--vl-dim);
}
.vapm-live__foot i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--vl-red);
  animation: vlPulse 2s ease-in-out infinite; flex-shrink: 0;
}

/* ---------- Simulation disclaimer ---------- */
.vapm-live-note {
  max-width: 440px; margin: var(--space-3) auto 0;
  font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-faint); text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 420px) {
  .vapm-live__badges { grid-template-columns: repeat(6, 1fr); }
  .vapm-live__feed { grid-template-columns: 1fr; min-height: 108px; }
  .vapm-live__counts { grid-template-columns: 1fr 1fr; }
  .vapm-live__counts > .vapm-live__count:last-child { grid-column: 1 / -1; }
  .vapm-live__eta { display: none; }
  .vapm-live__graph { height: 96px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .vapm-live *,
  .vapm-live *::before,
  .vapm-live *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Neutralize the legacy .report-doc frame — the panel brings its own chrome.
   Extra specificity: components.css loads after this file. */
.report-doc.report-doc--live {
  border: 0; box-shadow: none; background: none; border-radius: 0; overflow: visible;
  display: block;
}

/* ============================================================
   VAPM™ SOURCE VERIFICATION LEDGER
   Companion panel beneath the live analysis simulation.
   ============================================================ */
.vapm-verify {
  width: 100%; max-width: 440px; margin: var(--space-5) auto 0;
  background: #0a0a0b;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  font-family: var(--font-body);
  --vv-green: #34d399;
  --vv-dim: rgba(255, 255, 255, 0.34);
}
[data-theme='light'] .vapm-verify { box-shadow: 0 18px 44px rgba(0,0,0,0.18); border-color: rgba(0,0,0,0.14); }

.vapm-verify__head { padding: 14px 18px 10px; }
.vapm-verify__crumb {
  display: flex; align-items: center; gap: 7px; margin-bottom: 9px;
  font-family: var(--font-display); font-size: 10.5px; letter-spacing: 0.02em;
}
.vapm-verify__crumb i { width: 7px; height: 7px; border-radius: 50%; background: #fff; flex-shrink: 0; }
.vapm-verify__crumb b { color: #fff; font-weight: 700; }
.vapm-verify__crumb span { color: var(--vv-dim); }
.vapm-verify__crumb em { font-style: normal; color: var(--vv-dim); }
.vapm-verify__addr { font-size: 12.5px; font-weight: 600; color: #fff; line-height: 1.35; }
.vapm-verify__stat {
  margin-top: 5px; text-align: right; font-size: 10px; color: var(--vv-dim);
  font-variant-numeric: tabular-nums;
}

/* scrolling ledger */
.vapm-verify__win {
  position: relative; height: 292px; overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 46px, #000 calc(100% - 34px), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 46px, #000 calc(100% - 34px), transparent 100%);
}
.vapm-verify__track { will-change: transform; animation: vvScroll 46s linear infinite; }
@keyframes vvScroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.vapm-verify:hover .vapm-verify__track { animation-play-state: paused; }

.vapm-verify__row {
  display: flex; align-items: center; gap: 9px; padding: 6px 18px; min-width: 0;
}
.vapm-verify__tick {
  width: 12px; height: 12px; flex-shrink: 0; color: var(--vv-green);
}
.vapm-verify__tick svg { width: 12px; height: 12px; display: block; }
.vapm-verify__label {
  flex: 1; font-size: 11.5px; color: rgba(255, 255, 255, 0.80); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vapm-verify__ok {
  font-size: 9.5px; color: rgba(255, 255, 255, 0.26); flex-shrink: 0; letter-spacing: 0.02em;
}

/* inline "report ready" marker inside the ledger */
.vapm-verify__mark {
  margin: 10px 18px; padding: 9px 12px;
  border: 1px solid rgba(52, 211, 153, 0.26); border-radius: var(--radius-md);
  background: rgba(52, 211, 153, 0.05);
}
.vapm-verify__mark b { display: block; font-size: 11.5px; color: #fff; font-weight: 700; margin-bottom: 3px; }
.vapm-verify__mark span { font-size: 10px; color: rgba(255, 255, 255, 0.52); line-height: 1.45; }

.vapm-verify__foot {
  padding: 10px 18px 12px; border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.vapm-verify__foot p { font-size: 10px; color: rgba(255, 255, 255, 0.45); margin: 0 0 5px; }
.vapm-verify__foot div {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 10px; color: var(--vv-dim);
}
.vapm-verify__foot strong { color: #fff; font-weight: 700; }
.vapm-verify__foot i { width: 3px; height: 3px; border-radius: 50%; background: var(--vv-dim); }

@media (max-width: 420px) {
  .vapm-verify__win { height: 250px; }
}
@media (prefers-reduced-motion: reduce) {
  .vapm-verify__track { animation: none !important; }
}
