/* Cena: clínica de estética (fluxo n8n + chatbot de agendamento + agenda do profissional). */
.cl-flow { background: linear-gradient(180deg, rgba(10, 24, 46, .95), rgba(6, 16, 32, .98)); border: 1px solid rgba(60, 208, 210, .2); border-radius: 13px; overflow: hidden; flex: none;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .05); }
.cl-flow svg { display: block; width: 100%; height: auto; }
.cl-no { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.88); transition: opacity .5s, transform .5s; }
.cl-no.show { opacity: 1; transform: none; }
.cl-no .caixa { fill: #0d2342; stroke: rgba(60, 208, 210, .35); stroke-width: 1.2; transition: .3s; }
.cl-no text { fill: #e6f1f5; font: 600 9px Inter, sans-serif; }
.cl-no text.pequeno { fill: #9FB3C8; font-weight: 400; font-size: 8px; }
.cl-no.ativo .caixa { stroke: #3CD0D2; stroke-width: 2.2; filter: drop-shadow(0 0 5px rgba(60, 208, 210, .9)); }
.cl-fio { fill: none; stroke: #3CD0D2; stroke-opacity: .65; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: var(--l); stroke-dashoffset: var(--l); transition: stroke-dashoffset .6s; }
.cl-fio.show { stroke-dashoffset: 0; }

.cl-baixo { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 12px; align-items: stretch; }

/* celular do chatbot: paciente à esquerda, assistente da clínica à direita */
.cl-celular { position: relative; display: flex; flex-direction: column; min-height: 0; border: 4px solid #1e293b; border-radius: 26px; background: #0b141a; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, .32), 0 16px 36px rgba(0, 0, 0, .55); }
.cl-celular::before { content: ""; position: absolute; top: 5px; left: 50%; width: 40px; height: 7px; margin-left: -20px; border-radius: 999px; background: #020617; z-index: 2; }
.cl-topo { display: flex; align-items: center; gap: 8px; padding: 15px 10px 6px; background: var(--wa-cab); border-bottom: 1px solid rgba(255, 255, 255, .05); }
.cl-avatar { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #04121f; font: 800 9.5px Inter, sans-serif; }
.cl-topo div { line-height: 1.1; }
.cl-topo b { display: block; font-size: 11px; line-height: 1.15; color: var(--wa-txt); }
.cl-topo small { display: flex; align-items: center; gap: 4px; font-size: 8px; line-height: 1.1; color: #5ff09a; margin-top: 1px; }
.cl-topo small i { width: 5px; height: 5px; border-radius: 50%; background: #25D366; box-shadow: 0 0 6px #25D366; }
.cl-conversa { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; padding: 8px;
  background: var(--wa-fundo); }
.cl-bolha { max-width: 90%; padding: 6px 9px 4px; border-radius: 9px; font-size: 11px; line-height: 1.35; color: var(--wa-txt); box-shadow: 0 1px 1px rgba(0, 0, 0, .28); animation: cl-sobe .35s; }
.cl-bolha small { display: block; margin-top: 2px; text-align: right; font-size: 7.5px; color: var(--wa-hora); }
.cl-bolha.paciente { align-self: flex-start; background: var(--wa-entra); border-top-left-radius: 2px; }
.cl-bolha.bot { align-self: flex-end; background: var(--wa-sai); border-top-right-radius: 2px; }
.cl-bolha.bot small { color: rgba(233, 237, 239, .65); }
@keyframes cl-sobe { from { opacity: 0; transform: translateY(6px); } }
.cl-voz { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.cl-voz em { flex: none; width: 18px; height: 18px; border-radius: 50%; background: #25D366; color: #04210f; font-style: normal; font-size: 7px; display: grid; place-items: center; }
.cl-ondas { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.cl-ondas i { width: 2px; border-radius: 2px; background: #94a3b8; }
.cl-voz b { font-size: 8.5px; font-weight: 600; color: #cbd5e1; margin-left: 2px; }
.cl-transc { display: block; margin-top: 3px; padding-top: 3px; border-top: 1px dashed rgba(255, 255, 255, .12); font-size: 8.5px; color: #7dd3fc; line-height: 1.25; }
.cl-opcoes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cl-opcao { padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .45); font-size: 10px; transition: .25s; }
.cl-opcao.marcada { background: #e9edef; color: #00372d; font-weight: 700; }
.cl-dia { align-self: center; font-size: 8.5px; color: var(--wa-hora); background: #182229; padding: 2px 9px; border-radius: 7px; }
.cl-entrada { margin: 0; padding: 7px 14px 9px; background: #0b141a; font-size: 9.5px; color: var(--wa-hora); border-top: 1px solid rgba(255, 255, 255, .04); }

/* agenda do profissional, que se atualiza junto com a conversa */
.cl-agenda { display: flex; flex-direction: column; min-height: 0; background: linear-gradient(180deg, rgba(10, 24, 46, .95), rgba(6, 16, 32, .98)); border: 1px solid rgba(60, 208, 210, .2); border-radius: 13px; overflow: hidden;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .05); }
.cl-agenda header { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.cl-agenda header b { font-weight: 600; }
.cl-agenda header span { color: var(--muted); font-size: 11px; }
.cl-grade { flex: 1; display: grid; grid-template-columns: 40px repeat(5, 1fr); grid-auto-rows: 1fr; gap: 4px; padding: 10px; font-size: 10px; }
.cl-grade .cab { color: var(--muted); text-align: center; align-self: center; font-weight: 600; }
.cl-grade .hora { color: var(--muted); align-self: center; font-size: 9.5px; }
.cl-slot { border-radius: 6px; background: rgba(255, 255, 255, .05); display: grid; place-items: center; font-size: 8.5px; color: transparent; transition: background .4s, box-shadow .4s, color .4s; }
.cl-slot.ocupado { background: rgba(159, 179, 200, .16); }
.cl-slot.oferta { background: rgba(60, 208, 210, .12); box-shadow: inset 0 0 0 1px rgba(60, 208, 210, .7); animation: cl-pulso 1.2s infinite; }
.cl-slot.meu { background: linear-gradient(135deg, #1C8499, #3CD0D2); color: #04121f; font-weight: 700; box-shadow: none; animation: none; }
@keyframes cl-pulso { 50% { background: rgba(60, 208, 210, .28); } }
.cl-legenda { display: flex; gap: 14px; padding: 0 12px 10px; font-size: 10px; color: var(--muted); }
.cl-legenda i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* layout coreografado da página de serviço: fluxo no centro -> celular no centro -> agenda no centro -> tela completa */
.cl-palco { position: relative; flex: 1; min-height: 0; width: 100%; }
.cl-palco .cl-celular-full,
.cl-palco .cl-flow-compact,
.cl-palco .cl-agenda {
  position: absolute;
  transition: left .75s cubic-bezier(.22, 1, .36, 1), top .75s cubic-bezier(.22, 1, .36, 1), width .75s cubic-bezier(.22, 1, .36, 1), height .75s cubic-bezier(.22, 1, .36, 1), opacity .5s ease, transform .65s cubic-bezier(.22, 1, .36, 1), box-shadow .5s ease;
}

.cl-celular-full .cl-bolha { font-size: 11px; line-height: 1.35; padding: 6px 9px 5px; }
.cl-flow-compact { display: flex; flex-direction: column; }
.cl-flow-compact .ebar { padding: 6px 10px; font-size: 10.5px; }
.cl-flow-compact .ebar .no-ar { position: static; margin-left: auto; padding: 1px 8px; font-size: 10px; }
.cl-svg-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px 8px; }
.cl-svg-srv { width: 100%; height: 100%; display: block; }
.cl-svg-srv .cl-fio { opacity: 0; transition: stroke-dashoffset .55s ease-out, opacity .15s ease-out; }
.cl-svg-srv .cl-fio.show { opacity: 1; }

.cl-palco .cl-agenda header { padding: 7px 10px; font-size: 11px; }
.cl-palco .cl-agenda header span { font-size: 10px; }
.cl-palco .cl-grade { padding: 6px 8px; gap: 3px; grid-template-columns: 34px repeat(5, 1fr); font-size: 9px; min-height: 0; }
.cl-palco .cl-grade .hora { font-size: 8.5px; }
.cl-palco .cl-slot { border-radius: 5px; font-size: 8px; }
.cl-palco .cl-legenda { padding: 0 10px 7px; font-size: 9px; gap: 10px; }

/* Fase 1: só fluxo grande no centro */
.cl-palco[data-fase="fluxo"] .cl-flow-compact { left: 2%; top: 10%; width: 96%; height: 80%; z-index: 4; }
.cl-palco[data-fase="fluxo"] .cl-svg-wrap { padding: 10px 14px; }
.cl-palco[data-fase="fluxo"] .cl-celular-full { left: calc(50% - 112px); top: 0; width: 224px; height: 100%; opacity: 0; transform: scale(.94); pointer-events: none; z-index: 8; }
.cl-palco[data-fase="fluxo"] .cl-agenda { left: 244px; top: 136px; width: calc(100% - 244px); height: calc(100% - 136px); opacity: 0; transform: scale(.96); pointer-events: none; z-index: 2; }

/* Fase 2: fluxo vai para o topo direito e celular aparece em altura cheia no centro, por cima do card */
.cl-palco[data-fase="celular"] .cl-flow-compact { left: 244px; top: 0; width: calc(100% - 244px); height: 126px; z-index: 2; }
.cl-palco[data-fase="celular"] .cl-celular-full { left: calc(50% - 112px); top: 0; width: 224px; height: 100%; opacity: 1; transform: none; z-index: 8;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .82), 0 0 0 1px rgba(60, 208, 210, .38); }
.cl-palco[data-fase="celular"] .cl-agenda { left: 244px; top: 136px; width: calc(100% - 244px); height: calc(100% - 136px); opacity: 0; transform: scale(.96); pointer-events: none; z-index: 2; }

/* Fase 3: celular vai para a esquerda e agenda já aparece no canto inferior direito */
.cl-palco[data-fase="agenda"] .cl-flow-compact { left: 244px; top: 0; width: calc(100% - 244px); height: 126px; z-index: 2; }
.cl-palco[data-fase="agenda"] .cl-celular-full { left: 0; top: 0; width: 232px; height: 100%; opacity: 1; transform: none; z-index: 3; }
.cl-palco[data-fase="agenda"] .cl-agenda { left: 244px; top: 136px; width: calc(100% - 244px); height: calc(100% - 136px); opacity: 1; transform: none; z-index: 2; }

/* Fase 4: agenda vai para o canto inferior direito e os 3 painéis ficam visíveis juntos */
.cl-palco[data-fase="completo"] .cl-flow-compact { left: 244px; top: 0; width: calc(100% - 244px); height: 126px; z-index: 2; }
.cl-palco[data-fase="completo"] .cl-celular-full { left: 0; top: 0; width: 232px; height: 100%; opacity: 1; transform: none; z-index: 3; }
.cl-palco[data-fase="completo"] .cl-agenda { left: 244px; top: 136px; width: calc(100% - 244px); height: calc(100% - 136px); opacity: 1; transform: none; z-index: 2; }

@media (max-width: 560px) {
  .cl-baixo { grid-template-columns: 1fr; }
  .cl-palco .cl-celular-full { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; opacity: 1 !important; }
  .cl-palco .cl-flow-compact, .cl-palco .cl-agenda, .cl-agenda { display: none; }
}
