/* Widget */
.cbv2-launcher{position:fixed;z-index:99999;bottom:20px;right:20px;width:64px;height:64px;border-radius:50%;border:3px solid var(--cbv2-accent,#ba697f);display:flex;align-items:center;justify-content:center;background:#fff;box-shadow:0 4px 16px rgba(0,0,0,.15);cursor:pointer;overflow:hidden}
.cbv2-launcher.left{left:20px;right:auto}
.cbv2-launcher.center-bottom{left:50%;transform:translateX(-50%)}
.cbv2-launcher.center{left:50%;bottom:50%;transform:translate(-50%,50%)}
.cbv2-launcher img{width:100%;height:100%;object-fit:cover}
.cbv2-dot{width:12px;height:12px;border-radius:50%;background:var(--cbv2-accent,#ba697f)}

.cbv2-window{position:fixed;z-index:999999;border-radius:16px;box-shadow:0 12px 40px rgba(0,0,0,.2);overflow:hidden;display:none;background:var(--cbv2-bg,#fff)}
.cbv2-window.visible{display:flex;flex-direction:column}
.cbv2-header{padding:10px 12px;background: var(--cbv2-header-bg, #ffffff);border-bottom:1px solid #eee;display:flex;align-items:center;justify-content:space-between}
.cbv2-title{
	font-weight:600;
    color: var(--cbv2-title-color, #000000);
}
.cbv2-close{cursor:pointer;font-size:18px;line-height:1}
/* Mensagens em coluna (uma por linha) */
.cbv2-messages{
  padding:10px;
  height:100%;
  overflow:auto;
  background: linear-gradient(
    180deg,
    var(--cbv2-chat-bg-1, #0a111f) 0%,
    var(--cbv2-chat-bg-2, #020617) 100%
  ) !important;
  display:flex;                /* NOVO */
  flex-direction:column;       /* NOVO */
  gap:8px;                     /* espaço entre mensagens */
}


.cbv2-bubble{
  background:var(--cbv2-bubble,#f5f5f5);
  color:var(--cbv2-text-bot,#000) !important; /* 👈 ISTO */
  padding:8px 12px;
  border-radius:12px;
  display:block;
  align-self:flex-start;
  max-width:85%;
  word-break:break-word;
}


/* Bolha do utilizador: vai para a direita */
.cbv2-bubble.user{
  background:var(--cbv2-bubble-user,#e6f2ff);
  color:var(--cbv2-text-user,#000) !important; /* 👈 ISTO */
  align-self:flex-end;
  margin-left:0;
}


.cbv2-footer{
	padding:8px;
	border-top:1px solid #eee;
	display:flex;gap:6px
}


.cbv2-footer input[type="text"],
.cbv2-footer input[type="email"],
.cbv2-footer input[type="tel"],
.cbv2-footer input[type="date"]{
  flex:1;
  padding:8px 10px;
  border:1px solid #ddd;
  border-radius:10px;
  color:var(--cbv2-text-input,#000) !important; /* 👈 ISTO */
}
.cbv2-footer button{padding:8px 12px;border:none;border-radius:10px;background:var(--cbv2-accent,#ba697f);color:#fff;cursor:pointer}
@media (max-width:768px){ .cbv2-launcher{width:56px;height:56px;bottom:12px;right:12px} }


/* Indicador de escrita (...) */
.cbv2-typing {
    background: #e5e7eb;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    display: inline-flex;
    gap: 4px;
    width: fit-content;
    margin-bottom: 8px;
    align-self: flex-start;
}

.cbv2-dot {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    animation: cbv2-bounce 1.4s infinite ease-in-out both;
}

.cbv2-dot:nth-child(1) { animation-delay: -0.32s; }
.cbv2-dot:nth-child(2) { animation-delay: -0.16s; }
.cbv2-dot:nth-child(3) { animation-delay: 0s; }

@keyframes cbv2-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Image nodes only — do not affect launcher/avatar or other messages. */
.cbv2-messages > .cbv2-image-sized{box-sizing:border-box;display:block;flex:0 0 auto;width:var(--cbv2-image-w,100%) !important;max-width:100% !important;height:auto !important;margin:6px 0;border-radius:var(--cbv2-image-radius,8px);min-width:0}
.cbv2-messages > img.cbv2-image-sized,.cbv2-messages > .cbv2-image-action > img{max-height:var(--cbv2-image-h,none) !important;object-fit:contain;display:block}
.cbv2-messages > .cbv2-image-action{padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;cursor:pointer}
.cbv2-messages > .cbv2-image-action > img{width:100% !important;max-width:100% !important;height:auto !important;border-radius:inherit;margin:0 auto}
.cbv2-messages > .cbv2-image-action:focus-visible{outline:2px solid var(--cbv2-accent,#ba697f);outline-offset:3px}
@media(max-width:768px){.cbv2-messages > .cbv2-image-sized{width:var(--cbv2-image-mw,100%) !important}.cbv2-messages > img.cbv2-image-sized,.cbv2-messages > .cbv2-image-action > img{max-height:var(--cbv2-image-mh,none) !important}}
.cbv2-image-lightbox{padding:12px;border:0;border-radius:12px;background:#fff;max-width:94vw;max-height:92vh;overflow:auto;box-sizing:border-box}
.cbv2-image-lightbox::backdrop{background:rgba(0,0,0,.78)}
.cbv2-image-lightbox img{display:block;width:auto;height:auto;max-width:85vw;max-height:78vh;object-fit:contain}
.cbv2-image-lightbox-close{display:block;margin:0 0 8px auto;border:0;border-radius:6px;background:#333;color:#fff;padding:6px 14px;font-size:22px;cursor:pointer}

/* Premium nodes */
.cbv2-product-cards{display:grid;gap:8px;align-self:stretch;min-width:0}
.cbv2-product-card{display:grid;grid-template-columns:80px minmax(0,1fr);align-items:center;gap:5px 10px;padding:10px;background:var(--cbv2-bubble,#fff);color:var(--cbv2-text-bot,#111);border-radius:12px;overflow-wrap:anywhere}
.cbv2-product-card img{grid-row:1/4;object-fit:contain;max-width:80px;max-height:100px;border-radius:7px}
.cbv2-product-card button{grid-column:2;background:var(--cbv2-accent,#ba697f);color:#fff;border:0;border-radius:7px;padding:8px;cursor:pointer}
.cbv2-design-result{width:auto;max-width:min(210px,100%);max-height:280px;height:auto;object-fit:contain;align-self:center;border-radius:9px;flex-shrink:0}
.cbv2-footer:has(textarea),.cbv2-footer:has(.cbv2-download-design){flex-wrap:wrap}
.cbv2-footer textarea{width:100%;resize:vertical;min-height:65px;box-sizing:border-box;padding:8px;border:1px solid #ddd;border-radius:8px;color:var(--cbv2-text-input,#111)}
.cbv2-download-design{display:flex;align-items:center;padding:8px;text-decoration:underline;color:var(--cbv2-text-input,#111)}
.cbv2-footer button:disabled{opacity:.55;cursor:wait}

/* Invello inspiration: compact, responsive picker and thumbnail. */
.cbv2-inspiration-controls{display:flex;flex-wrap:wrap;gap:8px;width:100%;min-width:0}
.cbv2-inspiration-file{width:100%;min-width:0;max-width:100%;font-size:12px;box-sizing:border-box;color:var(--cbv2-text-input,#111)}
.cbv2-inspiration-consent{display:flex;align-items:flex-start;gap:6px;width:100%;font-size:11px;line-height:1.4;overflow-wrap:anywhere}
.cbv2-inspiration-consent input{flex-shrink:0;margin-top:2px}
.cbv2-inspiration-result{align-self:flex-end;max-width:min(150px,100%);max-height:200px}
@media(max-width:768px){.cbv2-inspiration-result{max-width:min(120px,100%);max-height:170px}}

/* 1.2.4 — keep message formatting visible even with theme typography resets */
.cbv2-window .cbv2-bubble:not(.user) u{text-decoration:underline}
.cbv2-window .cbv2-bubble:not(.user) em{font-style:italic}
.cbv2-window .cbv2-bubble:not(.user) strong{font-weight:700}


.cbv2-ai-controls{display:flex;flex-direction:column;gap:6px;width:100%;min-width:0}.cbv2-ai-composer{display:flex;align-items:stretch;gap:6px;min-width:0}.cbv2-ai-composer textarea{flex:1;min-width:0;max-width:100%;box-sizing:border-box;resize:vertical;min-height:44px;max-height:120px;padding:8px;border:1px solid #ddd;border-radius:10px;color:var(--cbv2-text-input,#111)!important;background:#fff;font:inherit}.cbv2-ai-controls .cbv2-ai-continue{background:transparent;color:var(--cbv2-accent,#ba697f);border:1px solid var(--cbv2-accent,#ba697f)}.cbv2-ai-controls button:disabled{opacity:.55;cursor:not-allowed}
