/* PediloFlow · asistente «¿Te ayudo?» (assets/js/chat-ayuda.js). Lo usan la web principal y el panel: no depende de app.css. */
.pfc-lanzador, .pfc-ventana { --pfc-verde: #09865c; --pfc-verde-osc: #066a49; --pfc-suave: #e8f6ef; --pfc-tinta: #10231d; --pfc-texto: #3d4e48; --pfc-linea: #dfe7e3; --pfc-wsp: #1a9e4b; font-family: inherit; }

.pfc-lanzador { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 1990; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: var(--pfc-verde); color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 10px 28px -8px rgba(13, 33, 25, .5); transition: transform .15s ease, background .15s ease; }
.pfc-lanzador:hover { background: var(--pfc-verde-osc); transform: translateY(-1px); }
.pfc-lanzador:focus-visible { outline: 3px solid var(--pfc-tinta); outline-offset: 3px; }
.pfc-lanzador svg { width: 24px; height: 24px; flex: none; }
.pfc-lanzador[aria-expanded="true"] { background: var(--pfc-verde-osc); }

.pfc-ventana { position: fixed; right: 18px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); z-index: 2000; display: flex; flex-direction: column; width: 370px; height: min(560px, calc(100vh - 110px)); background: #fff; color: var(--pfc-texto); border: 1px solid var(--pfc-linea); border-radius: 18px; box-shadow: 0 24px 60px -12px rgba(16, 35, 29, .35); overflow: hidden; font-size: 15px; line-height: 1.45; animation: pfc-entra .18s ease-out; }
.pfc-ventana[hidden] { display: none; }
@keyframes pfc-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pfc-ventana { animation: none; } .pfc-lanzador { transition: none; } }

.pfc-cab { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; background: var(--pfc-verde); color: #fff; }
.pfc-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: #fff; color: var(--pfc-verde); font-weight: 800; }
.pfc-cab-texto { display: grid; min-width: 0; flex: 1; }
.pfc-cab-texto strong { font-size: 15px; }
.pfc-cab-texto small { font-size: 12.5px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfc-cerrar { width: 40px; height: 40px; flex: none; border: 0; border-radius: 10px; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.pfc-cerrar:hover { background: rgba(255, 255, 255, .15); }
.pfc-cerrar:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

.pfc-mensajes { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; background: #f6f9f7; }
.pfc-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; overflow-wrap: anywhere; }
.pfc-msg p { margin: 0; }
.pfc-msg p + p, .pfc-msg ol, .pfc-msg .pfc-candado { margin-top: 6px; }
.pfc-msg ol { margin-bottom: 0; padding-left: 20px; }
.pfc-bot { align-self: flex-start; background: #fff; border: 1px solid var(--pfc-linea); border-bottom-left-radius: 4px; color: var(--pfc-texto); }
.pfc-yo { align-self: flex-end; background: var(--pfc-verde); color: #fff; border-bottom-right-radius: 4px; }
.pfc-msg { animation: pfc-msg .2s ease-out; }
@keyframes pfc-msg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* «escribiendo…»: tres puntitos */
.pfc-escribiendo { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.pfc-escribiendo span { width: 7px; height: 7px; border-radius: 50%; background: #9fb3ab; animation: pfc-punto 1.1s infinite ease-in-out; }
.pfc-escribiendo span:nth-child(2) { animation-delay: .15s; }
.pfc-escribiendo span:nth-child(3) { animation-delay: .3s; }
@keyframes pfc-punto { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pfc-msg, .pfc-escribiendo span { animation: none; } }
.pfc-enviar:disabled { opacity: .6; cursor: default; }
/* puntito verde de «En línea» */
.pfc-cab-texto small::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #7ee2b3; vertical-align: 1px; }
.pfc-titulo { display: block; margin-bottom: 4px; color: var(--pfc-tinta); }
.pfc-candado { color: #8a5a00; font-weight: 600; }
.pfc-acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pfc-accion { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--pfc-linea); background: #fff; color: var(--pfc-verde-osc); font-weight: 600; font-size: 14px; text-decoration: none; }
.pfc-accion:hover { border-color: var(--pfc-verde); }
.pfc-accion.pfc-principal { background: var(--pfc-verde); border-color: var(--pfc-verde); color: #fff; }
.pfc-accion.pfc-wsp { background: var(--pfc-wsp); border-color: var(--pfc-wsp); color: #fff; }
.pfc-accion svg, .pfc-pie-wsp svg { width: 18px; height: 18px; flex: none; }
.pfc-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pfc-chip { min-height: 36px; padding: 6px 12px; border: 1px solid var(--pfc-verde); border-radius: 999px; background: #fff; color: var(--pfc-verde-osc); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.pfc-chip:hover { background: var(--pfc-suave); }
.pfc-chip-otra { border-style: dashed; font-weight: 500; }
.pfc-chip:focus-visible, .pfc-accion:focus-visible, .pfc-pie a:focus-visible, .pfc-enviar:focus-visible { outline: 3px solid var(--pfc-tinta); outline-offset: 2px; }

.pfc-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--pfc-linea); background: #fff; }
.pfc-form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--pfc-linea); border-radius: 999px; background: #fff; color: var(--pfc-tinta); font: inherit; font-size: 16px; }
.pfc-form input:focus { outline: none; border-color: var(--pfc-verde); box-shadow: 0 0 0 3px rgba(9, 134, 92, .18); }
.pfc-enviar { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--pfc-verde); color: #fff; cursor: pointer; }
.pfc-enviar svg { width: 20px; height: 20px; }
.pfc-pie { display: flex; gap: 8px; padding: 0 12px 12px; background: #fff; }
.pfc-pie a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--pfc-linea); color: var(--pfc-tinta); font-weight: 600; font-size: 14px; text-decoration: none; }
.pfc-pie a:hover { border-color: var(--pfc-verde); }
.pfc-pie a[hidden] { display: none; }
.pfc-pie .pfc-pie-wsp { background: var(--pfc-wsp); border-color: var(--pfc-wsp); color: #fff; }

/* Panel: deja lugar abajo para el botón y sube los carteles */
body.panel.con-pfc .contenido { padding-bottom: 96px; }
body.panel.con-pfc .toasts { bottom: 84px; }

body.pfc-compacto .pfc-lanzador { width: 52px; padding: 0; justify-content: center; }
body.pfc-compacto .pfc-lanzador-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Celular: la ventana ocupa casi toda la pantalla y el botón queda redondo, solo con el ícono */
@media (max-width: 640px) {
  .pfc-lanzador { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: 54px; height: 54px; padding: 0; justify-content: center; }
  .pfc-lanzador-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pfc-ventana { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); top: calc(8px + env(safe-area-inset-top, 0px)); width: auto; height: auto; max-height: none; border-radius: 16px; }
  body.pfc-abierto .pfc-lanzador { display: none; }
  body.panel.con-pfc .toasts { bottom: auto; }
}
@media print { .pfc-lanzador, .pfc-ventana { display: none !important; } }
