/* ════════════════════════════════════════════════════════════════════════════
   Onflow · o PALCO (<z-palco>, partials/zheus.js.php): o mapa vivo de uma ferramenta.
   Um núcleo de partículas no centro, as áreas da ferramenta em volta ligadas por fios que correm,
   e a barra de comando embaixo. Usado na entrada do ADSpy (órbita) e do AdsFlow (trilha do criativo).
   Coordenadas dos nós e dos fios num quadro 1000 × 560: a cena inteira escala junto.
   ════════════════════════════════════════════════════════════════════════════ */
.zp { --zp-tinta: 255,255,255; --zp-placa: 11,12,14; --zp-gelo: #c0d3de; position: relative; padding: 4px 0 26px; }
html[data-theme="light"] .zp { --zp-tinta: 11,12,14; --zp-placa: 255,255,255; --zp-gelo: #4d6f93; }

/* a cena cabe na tela sem rolar: a largura também é limitada pela altura que sobra */
.zp-cena { position: relative; width: min(100%, 1060px, calc((100vh - 318px) * 1.7857)); min-width: min(100%, 700px); aspect-ratio: 1000 / 560; margin: 0 auto;
  transform: perspective(1400px) rotateY(calc(var(--px, 0) * 2.4deg)) rotateX(calc(var(--py, 0) * -1.8deg)); transition: opacity .34s var(--ease-ui), filter .34s var(--ease-ui), scale .34s var(--ease-ui); }
/* saída: ao escolher um nó a cena avança e some antes de a tela trocar */
.zp--saindo .zp-cena { opacity: 0; filter: blur(12px); scale: 1.09; }
.zp--saindo .zp-barra { opacity: 0; translate: 0 10px; }

/* ── fios ── */
.zp-fios { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.zp-fio { fill: none; stroke: rgba(var(--zp-tinta), .11); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: zp-traco 1s var(--ease-expo) forwards; animation-delay: calc(var(--i, 0) * 70ms + 380ms); }
.zp-fluxo { fill: none; stroke: rgba(var(--zp-tinta), .62); stroke-width: 1.7; stroke-linecap: round; stroke-dasharray: .1 9; opacity: 0; animation: zp-corre 1.5s linear infinite, zp-acende .9s var(--ease-ui) forwards; animation-delay: 0s, calc(var(--i, 0) * 70ms + 1000ms); transition: stroke .3s var(--ease-ui), stroke-width .3s var(--ease-ui); }
.zp-grao { fill: rgb(var(--zp-tinta)); opacity: 0; offset-rotate: 0deg; filter: drop-shadow(0 0 4px rgba(170, 210, 255, .9)); animation: zh-travel 3.6s linear infinite; animation-delay: calc(var(--i, 0) * .6s + 1.4s); }
.zp-fios g.quente .zp-fio { stroke: rgba(var(--zp-tinta), .3); }
.zp-fios g.quente .zp-fluxo { stroke: rgb(var(--zp-tinta)); stroke-width: 2.4; }
@keyframes zp-traco { to { stroke-dashoffset: 0; } }
@keyframes zp-corre { to { stroke-dashoffset: -9.1; } }
@keyframes zp-acende { to { opacity: 1; } }

/* ── núcleo ── */
.zp-nucleo { position: absolute; width: 36%; aspect-ratio: 1; translate: -50% -50%; display: grid; place-items: center; pointer-events: none; animation: zp-nasce 1.4s var(--ease-expo) both; }
.zp--trilha .zp-nucleo { width: 29.8%; }
.zp-nucleo::before { content: ''; position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle, rgba(150, 195, 255, .3), rgba(150, 195, 255, .08) 46%, transparent 68%); animation: zp-respira 5.5s ease-in-out infinite; }
html[data-theme="light"] .zp-nucleo::before { background: radial-gradient(circle, rgba(77, 111, 147, .16), transparent 66%); }
.zp-nucleo canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.zp-nucleo-txt { position: absolute; top: 81%; left: 50%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; white-space: nowrap; animation: zh-rise 1.1s var(--ease-expo) both; animation-delay: .5s; }
.zp-nucleo-txt b { font-size: 15px; font-weight: 500; letter-spacing: -.01em; color: rgb(var(--zp-tinta)); max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.zp-nucleo-txt small { font-family: var(--x8-label-font); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--zp-gelo); }
.zp-nucleo-txt span { font-size: 11.5px; color: rgba(var(--zp-tinta), .5); }
@keyframes zp-nasce { from { opacity: 0; scale: .55; filter: blur(18px); } }
@keyframes zp-respira { 50% { scale: 1.12; opacity: .7; } }

/* ── nós ── */
.zp-no { position: absolute; translate: -50% -50%; padding: 0; border: 0; background: none; cursor: pointer; color: rgb(var(--zp-tinta)); font: inherit; -webkit-tap-highlight-color: transparent; animation: zp-brota .95s var(--ease-expo) both; animation-delay: calc(var(--i, 0) * 70ms + 560ms); }
.zp-no:focus-visible { outline: 0; }
.zp-hex { position: relative; display: grid; place-items: center; width: 64px; height: 64px; transition: scale .4s var(--ease-expo), filter .4s var(--ease-ui); }
.zp-hex svg:not(.z-ico) { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.zp-hex .z-ico, .zp-hex em { position: relative; z-index: 1; transition: color .3s var(--ease-ui); }
.zp-hex-b { fill: rgba(var(--zp-placa), .78); stroke: rgba(var(--zp-tinta), .3); stroke-width: 1.2; stroke-linejoin: round; transition: fill .3s var(--ease-ui), stroke .3s var(--ease-ui); }
.zp-no.quente .zp-hex, .zp-no:focus-visible .zp-hex { scale: 1.12; filter: drop-shadow(0 0 18px rgba(170, 210, 255, .45)); }
.zp-no.quente .zp-hex-b, .zp-no:focus-visible .zp-hex-b { fill: rgb(var(--zp-tinta)); stroke: rgb(var(--zp-tinta)); }
.zp-no.quente .zp-hex .z-ico, .zp-no:focus-visible .zp-hex .z-ico { color: rgb(var(--zp-placa)); }
.zp-no.indo .zp-hex { scale: 1.5; filter: drop-shadow(0 0 30px rgba(190, 220, 255, .8)); }
/* nó em anel (etapa com contagem): o arco é a fatia daquela etapa no total */
.zp-anel-t { fill: rgba(var(--zp-placa), .78); stroke: rgba(var(--zp-tinta), .14); stroke-width: 1.4; }
.zp-anel-v { fill: none; stroke: var(--tom, rgb(var(--zp-tinta))); stroke-width: 2.6; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 32px 32px; animation: zp-anel 1.4s var(--ease-expo) both; animation-delay: calc(var(--i, 0) * 70ms + 900ms); }
.zp-hex em { font-style: normal; font-size: 19px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.zp-no.anel.quente .zp-anel-t { fill: rgba(var(--zp-tinta), .1); stroke: rgba(var(--zp-tinta), .45); }
@keyframes zp-anel { from { stroke-dasharray: 0 100; } }
@keyframes zp-brota { from { opacity: 0; scale: .5; filter: blur(10px); } }

.zp-rot { position: absolute; display: flex; flex-direction: column; gap: 2px; white-space: nowrap; text-align: left; transition: opacity .3s var(--ease-ui); }
.zp-rot b { font-size: 14px; font-weight: 500; letter-spacing: -.01em; color: rgba(var(--zp-tinta), .92); }
.zp-rot small { font-family: var(--x8-label-font); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--zp-gelo); }
.zp-rot span { font-size: 11.5px; color: rgba(var(--zp-tinta), .48); }
.zp-no.quente .zp-rot b { color: rgb(var(--zp-tinta)); }
.zp-no.quente .zp-rot span { color: rgba(var(--zp-tinta), .75); }
.zp-no--d .zp-rot { left: calc(100% + 12px); top: 50%; translate: 0 -50%; }
.zp-no--e .zp-rot { right: calc(100% + 12px); top: 50%; translate: 0 -50%; text-align: right; align-items: flex-end; }
.zp-no--c .zp-rot { bottom: calc(100% + 8px); left: 50%; translate: -50% 0; text-align: center; align-items: center; }
.zp-no--b .zp-rot { top: calc(100% + 8px); left: 50%; translate: -50% 0; text-align: center; align-items: center; }

/* ── barra de comando: vidro com o brilho correndo na base ── */
.zp-barra-wrap { position: relative; z-index: 2; margin-top: -6px; }
.zp-barra { position: relative; display: flex; align-items: center; gap: 10px; width: min(100%, 640px); margin: 0 auto; padding: 8px 8px 8px 18px; border-radius: 18px; border: 1px solid rgba(var(--zp-tinta), .16); background: rgba(var(--zp-placa), .62); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); box-shadow: 0 24px 60px -30px #000; color: rgba(var(--zp-tinta), .55); animation: zh-rise 1.1s var(--ease-expo) both; animation-delay: .95s; transition: border-color .3s var(--ease-ui), opacity .3s var(--ease-ui), translate .3s var(--ease-ui); }
.zp-barra:focus-within { border-color: rgba(var(--zp-tinta), .38); }
.zp-barra::before, .zp-barra::after { content: ''; position: absolute; left: 7%; right: 7%; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #7fb4ff 22%, #ffffff 50%, #ffd7a3 78%, transparent); background-size: 200% 100%; animation: zp-brilho 7s linear infinite; pointer-events: none; }
.zp-barra::before { height: 16px; bottom: -9px; filter: blur(13px); opacity: .5; }
.zp-barra input { flex: 1 1 auto; min-width: 0; height: 36px; border: 0; outline: 0; background: none; color: rgb(var(--zp-tinta)); font: inherit; font-size: 14px; }
.zp-barra input::placeholder { color: rgba(var(--zp-tinta), .4); }
.zp-barra .cs-btn { flex: none; margin: 0; }
html[data-theme="light"] .zp-barra { box-shadow: 0 18px 44px -26px rgba(11, 12, 14, .35); }
@keyframes zp-brilho { to { background-position: -200% 0; } }

/* botão que volta ao mapa, na fileira de abas da ferramenta */
.zp-volta .z-ico { flex: none; }

/* ── a tela que abre depois do mapa entra no mesmo ritmo ── */
.as > .as-corpo, .cr .cc-quadro, .cr .cc-ret, .cr .cc-importar, .cr .cc-barra { animation: zp-entra .6s var(--ease-expo) both; }
.cr .cc-quadro { animation-delay: .08s; }
@keyframes zp-entra { from { opacity: 0; translate: 0 14px; filter: blur(8px); } }
/* a coluna (ou a faixa) para onde o nó do mapa levou pisca uma vez */
.zp-alvo { animation: zp-alvo 1.7s var(--ease-ui) 1 !important; }
@keyframes zp-alvo { 0%, 100% { box-shadow: 0 0 0 0 rgba(170, 210, 255, 0); } 25% { box-shadow: 0 0 0 2px rgba(170, 210, 255, .75), 0 0 42px rgba(150, 195, 255, .35); } }

/* ── celular: sem órbita; núcleo em cima e os nós em lista de dois em dois ── */
@media (max-width: 760px) {
  .zp-cena { width: 100%; min-width: 0; aspect-ratio: auto; transform: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .zp-fios { display: none; }
  .zp-nucleo, .zp--trilha .zp-nucleo { position: relative; left: auto !important; top: auto !important; translate: none; grid-column: 1 / -1; width: min(64%, 240px); margin: 0 auto 54px; }
  .zp-no { position: relative; left: auto !important; top: auto !important; translate: none; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid rgba(var(--zp-tinta), .1); border-radius: 16px; background: rgba(var(--zp-placa), .5); text-align: left; min-width: 0; }
  .zp-hex { width: 46px; height: 46px; flex: none; }
  .zp-hex em { font-size: 15px; }
  .zp-rot { position: static !important; translate: none !important; align-items: flex-start !important; text-align: left !important; white-space: normal; min-width: 0; }
  .zp-rot span { display: none; }
  .zp-barra-wrap { margin-top: 16px; }
  .zp-barra { padding-left: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .zp *, .zp-barra, .zp-barra::before, .zp-barra::after, .as > .as-corpo, .cr .cc-quadro, .cr .cc-ret, .cr .cc-importar, .cr .cc-barra { animation: none !important; }
  .zp-fio { stroke-dashoffset: 0; } .zp-fluxo { opacity: 1; } .zp-grao { display: none; }
}

/* seletor de projeto do AdsFlow no tema claro: o botão nasce com texto cinza-claro (pensado pro fundo escuro) */
html[data-theme="light"] .cr .cc-vistas > .q-btn { color: #0b0c0e !important; }
