/* V145: identidad, globos de mensaje y adjuntos. La foto utiliza el icono TreeKnow ya presente. */
.tkai .tkai-header{gap:12px}
.tkai .tkai-identity{display:flex;align-items:center;gap:10px;min-width:0}
.tkai .tkai-identity>span{display:flex;flex-direction:column;min-width:0}
.tkai .tkai-identity-logo,.tkai .tkai-nudge-head img{object-fit:cover;border-radius:11px;flex-shrink:0}
.tkai .tkai-header strong{font-size:15px;line-height:1.25}
.tkai .tkai-header small{font-size:11px;line-height:1.4;margin-top:2px}
.tkai .tkai-nudge{min-width:0;width:min(308px,calc(100vw - 24px));max-width:min(308px,calc(100vw - 24px));padding:0;border:1px solid #e0e3e9;background:#fff;box-shadow:0 14px 38px #0003;border-radius:17px;overflow:visible;text-align:left}
.tkai .tkai-nudge-open{width:100%;border:0;background:none;color:#191a20;border-radius:17px;padding:13px 16px;text-align:left;cursor:pointer}
.tkai .tkai-nudge-head{display:flex;align-items:center;gap:9px;font-size:13px;line-height:1.2}
.tkai .tkai-nudge-head strong{font-size:13px;font-weight:750}
.tkai .tkai-nudge-message{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;margin:7px 0 8px;font-size:14px;line-height:1.42;font-weight:500;overflow-wrap:anywhere;white-space:normal}
.tkai .tkai-nudge-reply{display:block;border:1px solid #e2e5eb;border-radius:10px;color:#8a96a9;font-size:12px;font-weight:500;padding:9px 11px;background:#f9fafc}
.tkai .tkai-nudge-dismiss{position:absolute;right:-10px;top:-11px;display:grid;place-items:center;width:27px;height:27px;border:1px solid #e1e5ee;border-radius:50%;background:#fff;color:#56627a;font-size:21px;line-height:1;cursor:pointer}
.tkai .tkai-form .tkai-attach{position:relative;display:grid;place-items:center;border:1px solid #ddd;border-radius:10px;width:37px;flex-shrink:0;cursor:pointer;color:#323948;background:#fff}
.tkai .tkai-image-input{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.tkai .tkai-image-pending{display:flex;align-items:center;gap:8px;padding:7px 13px;background:#f9fafb;border-top:1px solid #e5e7eb;font-size:11px;color:#566275}
.tkai .tkai-image-pending[hidden]{display:none}
.tkai .tkai-pending-thumb{object-fit:cover;width:37px;height:37px;border-radius:6px}
.tkai .tkai-file-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tkai .tkai-clear-image{border:0;background:#eaedf1;border-radius:50%;font-size:18px;width:26px;height:26px;cursor:pointer}
.tkai .tkai-image-bubble{padding:6px;background:#f1f2f4;max-width:80%}
.tkai .tkai-image-bubble img{max-width:100%;width:auto;max-height:225px;border-radius:9px;display:block}
.tkai .tkai-draft-consent{display:block;margin:0 12px 7px;font-size:10px;line-height:1.35;color:#555d6e;cursor:pointer}
.tkai .tkai-draft-consent[hidden],.tkai .tkai-feedback[hidden]{display:none!important}
.tkai .tkai-draft-consent input{vertical-align:middle;accent-color:#5425f6;margin-right:5px}
.tkai .tkai-draft-consent span{color:#7a8291}
.tkai .tkai-feedback{display:block;padding:3px 13px 8px;font-size:11px;line-height:1.3;color:#456080}
@media(max-width:767px){.tkai .tkai-nudge{width:min(292px,calc(100vw - 30px));max-width:min(292px,calc(100vw - 30px))}.tkai .tkai-panel{max-height:calc(100dvh - 120px)}}
/* V145.1: la descripción opcional acompaña a la fotografía en el mismo mensaje. */
.tkai .tkai-image-bubble .tkai-message-caption{display:block;margin:6px 4px 3px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.4}

/* V145.2: el único campo obligatorio es el texto cuando NO se adjunta foto. */
.tkai .tkai-form .tkai-image-input:invalid{box-shadow:none}

/* V146.1: aviso visible al comprador mientras un humano puede ver el borrador del chat. */
.tkai-live-note{display:block;margin:5px 12px 2px;padding:7px 9px;background:#f3f0ff;color:#4d2996;border-radius:9px;border:1px solid #e2d8ff;font:600 11px/1.45 Inter,system-ui,sans-serif}
.tkai-live-note[hidden]{display:none!important}

/* V146.2 — chat del comprador: menos texto repetido y más espacio para conversar.
   El aviso de lectura previa de un borrador permanece visible cuando hay
   atención humana; no se desactiva ninguna protección ni evento de V146.1. */
.tkai .tkai-info { display: none !important; }
.tkai .tkai-push-hint { display: none !important; }
.tkai .tkai-live-note {
  flex: 0 0 auto;
  margin: 3px 10px 5px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #f4f5f7;
  border-color: #e3e7ed;
  color: #475365;
  font-size: 10px;
  font-weight: 550;
  line-height: 1.3;
}

/* V146.5: transparencia en una frase breve, sin tarjeta grande ni texto repetido. */
.tkai .tkai-live-note:not([hidden]){display:block;align-self:stretch;margin:2px 12px 6px;padding:3px 0;border:0;border-radius:0;background:transparent;color:#697587;font-size:10px;line-height:1.25;font-weight:500}

/* TreeKnow AI V2 — corazoncito persistente, sin alterar el diseño del chat. */
.tkai-bubble .tkai-heart{position:relative;display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:4px 3px 0;margin:2px 0 0;color:#9ba4b2;cursor:pointer;font-size:17px;line-height:1}
.tkai-bubble .tkai-heart small{font-size:10px;font-weight:700}
.tkai-bubble .tkai-heart.is-hearted{color:#e34e74}
.tkai-bubble .tkai-heart.heart-burst{animation:tkai-heart-pop .35s ease-out}
.tkai-bubble .tkai-heart.heart-burst::after{content:"✦ · ✦";position:absolute;left:4px;bottom:4px;color:#f281ab;pointer-events:none;animation:tkai-heart-spark .45s ease-out forwards}
@keyframes tkai-heart-spark{0%{transform:scale(.4);opacity:1}100%{transform:translateY(-19px) scale(1.35);opacity:0}}
@keyframes tkai-heart-pop{0%{transform:scale(.7)}45%{transform:scale(1.4)}100%{transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.tkai-bubble .tkai-heart.heart-burst,.tkai-bubble .tkai-heart.heart-burst::after{animation:none}}

/* TreeKnow AI V3: corazones entrantes y visor móvil de imágenes/QR. */
.tkai .tkai-heart-received{color:#e34e74;cursor:default}
.tkai .tkai-heart-received[hidden],.tkai .tkai-image-lightbox[hidden]{display:none!important}
.tkai .tkai-image-bubble a{cursor:zoom-in;display:block}
.tkai .tkai-image-lightbox{position:fixed;inset:0;z-index:2147483647;display:flex;align-items:center;justify-content:center;padding:14px;background:rgba(0,0,0,.88);box-sizing:border-box;isolation:isolate}
.tkai .tkai-image-lightbox-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:12px;width:min(100%,520px);max-height:calc(100dvh - 28px);padding:48px 12px 15px;background:#16181d;color:#fff;border:1px solid #444;border-radius:16px;box-sizing:border-box}
.tkai .tkai-image-close{position:absolute;top:8px;right:10px;display:grid;place-items:center;min-width:36px;min-height:36px;padding:0;border:0;border-radius:50%;background:#373a43;color:#fff;font-size:28px;cursor:pointer}
.tkai .tkai-image-large{display:block;width:auto;height:auto;max-width:100%;max-height:min(62dvh,620px);object-fit:contain;background:#fff;border-radius:8px}
.tkai .tkai-image-actions{width:100%;display:flex;flex-direction:column;align-items:center;gap:9px;text-align:center}
.tkai .tkai-image-download{display:inline-flex;justify-content:center;align-items:center;min-height:42px;padding:0 20px;border-radius:11px;background:#fff;color:#191a20;font-weight:750;text-decoration:none;cursor:pointer}
.tkai .tkai-image-actions small{font-size:11px;line-height:1.4;color:#d4d8e0}
@media(max-width:767px){.tkai .tkai-image-lightbox{padding:9px}.tkai .tkai-image-lightbox-card{max-height:calc(100dvh - 18px);padding:48px 10px 12px}.tkai .tkai-image-large{max-height:58dvh}}
