/* ============================================================================
   buildvisuals.css — §02 animated mini-visuals
   ============================================================================ */
.bv {
  width: 100%; max-width: 520px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.7), 0 0 60px -34px var(--accent-glow);
}
.bv-count { display: inline-block; font-variant-numeric: tabular-nums; text-align: right; }
.bv-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bv-cap { font-size: 10px; letter-spacing: 0.14em; color: var(--text-4); }

/* 1 · graph */
.bv-graph .bv-kpi { display: inline-flex; align-items: baseline; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 24px; color: var(--accent); font-variant-numeric: tabular-nums; }
.bv-up { font-family: var(--font-mono); font-size: 11px; color: var(--ok); }
.bv-svg { width: 100%; height: 150px; display: block; }
.bv-area { opacity: 0; transition: opacity .8s var(--ease-out) .3s; }
.bv-area.in { opacity: 1; }
.bv-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.bv-line.in { animation: draw 1.5s var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.bv-dot { filter: drop-shadow(0 0 6px var(--accent-glow)); animation: dotIn .4s var(--ease-out) 1.3s backwards; }
@keyframes dotIn { from { opacity: 0; transform: scale(0); } }
.bv-bars { display: flex; align-items: flex-end; gap: 8px; height: 40px; margin-top: 14px; }
.bv-bar { flex: 1; height: var(--h, 0%); background: linear-gradient(180deg, var(--accent), color-mix(in oklch, var(--accent) 30%, transparent)); border-radius: 3px 3px 0 0; transition: height .7s var(--ease-out); align-self: flex-end; }

/* 2 · dashboard */
.bv-dashrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bv-tile { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: var(--surface); }
.bv-tile-k { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-4); }
.bv-tile-v { display: block; font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.05; margin-top: 5px; letter-spacing: -0.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.bv-sparkwrap { margin-top: 14px; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: var(--surface); }
.bv-spark { width: 100%; height: 56px; display: block; margin-top: 8px; }
.bv-perm { display: flex; gap: 8px; margin-top: 14px; }
.bv-chip { font-family: var(--font-mono); font-size: 11px; padding: 5px 12px; border-radius: 7px; border: 1px solid var(--line-2); color: var(--text-3); background: var(--surface); opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.bv-chip.in { opacity: 1; transform: none; }
.bv-chip:first-child.in { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

/* 3 · portal */
.bv-pthead { display: flex; align-items: center; gap: 11px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.bv-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.bv-ptmeta { display: flex; flex-direction: column; flex: 1; }
.bv-ptname { font-weight: 600; font-size: 14px; color: var(--text); }
.bv-ptbadge { font-size: 10px; }
.bv-ptprog { margin-top: 16px; }
.bv-ptprog-top { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.1em; color: var(--text-4); margin-bottom: 8px; }
.bv-prog { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bv-prog i { display: block; height: 100%; background: var(--accent); border-radius: 999px; box-shadow: 0 0 12px var(--accent-glow); transition: width 1.1s var(--ease-out) .2s; }
.bv-ptdocs { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.bv-ptdoc { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); opacity: 0; transform: translateX(-12px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.bv-ptdoc.in { opacity: 1; transform: none; }
.bv-ptdoc-ico { width: 22px; height: 26px; border-radius: 4px; border: 1px solid var(--line-3); background: var(--surface-3); position: relative; flex: 0 0 auto; }
.bv-ptdoc-ico::after { content: ""; position: absolute; left: 4px; right: 4px; top: 9px; height: 1px; background: var(--text-4); box-shadow: 0 4px 0 var(--text-4), 0 8px 0 var(--text-4); }
.bv-ptdoc-name { flex: 1; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-ptdoc-dl { color: var(--accent); font-size: 14px; }

/* 4 · calls */
.bv-callsrc { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-2); white-space: nowrap; transition: opacity .26s var(--ease); }
.bv-srcdot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); flex: 0 0 auto; }
/* opacity-only swap (the old translateX slide read as a jitter every cycle) */
@keyframes srcSwap { from { opacity: 0; } }
.bv-callnum { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 3.2vw, 28px); line-height: 1.1; letter-spacing: 0.01em; color: var(--text); margin-top: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; transition: opacity .26s var(--ease); }
.bv-calltag { display: flex; align-items: center; gap: 9px; min-height: 1.4em; font-size: 11px; color: var(--accent); margin-top: 6px; letter-spacing: 0.02em; white-space: nowrap; transition: opacity .26s var(--ease); }
.bv-calltag-sep { color: var(--text-4); }
.bv-wave { display: flex; align-items: center; gap: 4px; height: 64px; margin: 18px 0; }
.bv-wavebar { flex: 1; height: var(--h, 8%); min-height: 4px; background: var(--accent); border-radius: 2px; opacity: 0.8; animation: wave 1.3s var(--ease) infinite alternate; transform-origin: center; }
@keyframes wave { from { transform: scaleY(0.4); opacity: 0.4; } to { transform: scaleY(1); opacity: 0.9; } }
.bv-callfeed { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
/* fixed badge column (was `auto` → BOOKED vs VOICEMAIL had different widths,
   which shifted the source column to a different x on each row). 108px fits
   the widest badge so the number + source columns line up across all rows. */
.bv-callfeedrow { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) 108px; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.bv-callfeedrow:last-child { border-bottom: 0; }
.bv-cfn { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bv-cfs { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-callfeedrow .badge { white-space: nowrap; width: 100%; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .bv-line { stroke-dashoffset: 0 !important; animation: none !important; }
  .bv-area { opacity: 1 !important; }
  .bv-bar, .bv-chip, .bv-ptdoc, .bv-prog i { transition: none !important; }
  .bv-wavebar { animation: none !important; }
}
