#tlai-sales-chat {
  --tlai-wine: #7a1738;
  --tlai-wine-dark: #5e102a;
  --tlai-ink: #20252b;
  --tlai-muted: #667085;
  --tlai-line: #e4e7ec;
  --tlai-soft: #f6f7f8;
  --tlai-white: #fff;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147482000;
  color: var(--tlai-ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.42;
}

#tlai-sales-chat *,
#tlai-sales-chat *::before,
#tlai-sales-chat *::after { box-sizing: border-box; }

#tlai-sales-chat button,
#tlai-sales-chat textarea { font: inherit; }

#tlai-sales-chat button { -webkit-tap-highlight-color: transparent; }

#tlai-sales-chat .tlai-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 7px 15px 7px 7px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--tlai-wine), var(--tlai-wine-dark));
  color: var(--tlai-white);
  box-shadow: 0 12px 34px rgba(47, 13, 25, .28);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

#tlai-sales-chat .tlai-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(47, 13, 25, .34); }
#tlai-sales-chat .tlai-launcher:focus-visible,
#tlai-sales-chat button:focus-visible,
#tlai-sales-chat textarea:focus-visible { outline: 3px solid rgba(122, 23, 56, .24); outline-offset: 2px; }

#tlai-sales-chat .tlai-launcher-avatar,
#tlai-sales-chat .tlai-header-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f4dce4;
  color: var(--tlai-wine);
}

#tlai-sales-chat .tlai-launcher-avatar { width: 44px; height: 44px; border: 2px solid rgba(255,255,255,.8); }
#tlai-sales-chat .tlai-header-avatar { width: 42px; height: 42px; border: 2px solid rgba(255,255,255,.72); }
#tlai-sales-chat .tlai-launcher-avatar img,
#tlai-sales-chat .tlai-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
#tlai-sales-chat .tlai-launcher-avatar svg,
#tlai-sales-chat .tlai-header-avatar svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.15; stroke-linecap: round; stroke-linejoin: round; }
#tlai-sales-chat .tlai-launcher-label { font-weight: 750; white-space: nowrap; }
#tlai-sales-chat .tlai-online-dot { width: 9px; height: 9px; margin-left: -3px; border: 2px solid #fff; border-radius: 50%; background: #38b26b; }

#tlai-sales-chat .tlai-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 42px));
  overflow: hidden;
  border: 1px solid rgba(30, 34, 40, .12);
  border-radius: 20px;
  background: var(--tlai-white);
  box-shadow: 0 24px 70px rgba(17, 24, 39, .27);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.98);
  transform-origin: right bottom;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

#tlai-sales-chat.tlai-open .tlai-panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
#tlai-sales-chat.tlai-open .tlai-launcher { opacity: 0; visibility: hidden; pointer-events: none; }

#tlai-sales-chat .tlai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 11px 12px;
  background: linear-gradient(135deg, var(--tlai-wine), var(--tlai-wine-dark));
  color: var(--tlai-white);
}

#tlai-sales-chat .tlai-heading { display: flex; flex: 1 1 auto; min-width: 0; flex-direction: column; }
#tlai-sales-chat .tlai-heading strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
#tlai-sales-chat .tlai-heading span { color: rgba(255,255,255,.78); font-size: 12px; }
#tlai-sales-chat .tlai-clear,
#tlai-sales-chat .tlai-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
#tlai-sales-chat .tlai-clear:hover,
#tlai-sales-chat .tlai-close:hover { background: rgba(255,255,255,.12); }
#tlai-sales-chat .tlai-clear svg,
#tlai-sales-chat .tlai-close svg,
#tlai-sales-chat .tlai-send svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

#tlai-sales-chat .tlai-messages {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 14px 10px;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

#tlai-sales-chat .tlai-message { display: flex; margin: 0 0 12px; }
#tlai-sales-chat .tlai-message.tlai-user { justify-content: flex-end; }
#tlai-sales-chat .tlai-content { max-width: 94%; }
#tlai-sales-chat .tlai-user .tlai-content { max-width: 88%; }
#tlai-sales-chat .tlai-bubble { max-width: 100%; padding: 10px 12px; border-radius: 15px 15px 15px 4px; background: #f0f1f3; color: var(--tlai-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
#tlai-sales-chat .tlai-user .tlai-bubble { border-radius: 15px 15px 4px 15px; background: var(--tlai-wine); color: #fff; }
#tlai-sales-chat .tlai-error .tlai-bubble { border: 1px solid #f1c7c7; background: #fff1f1; color: #8a1f1f; }

#tlai-sales-chat .tlai-typing .tlai-bubble { display: flex; align-items: center; gap: 4px; min-height: 38px; }
#tlai-sales-chat .tlai-typing i { width: 6px; height: 6px; border-radius: 50%; background: #98a2b3; animation: tlai-pulse 1.1s infinite ease-in-out; }
#tlai-sales-chat .tlai-typing i:nth-child(2) { animation-delay: .15s; }
#tlai-sales-chat .tlai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tlai-pulse { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

#tlai-sales-chat .tlai-products { display: grid; width: 100%; gap: 7px; margin-top: 8px; }
#tlai-sales-chat .tlai-product {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--tlai-line);
  border-radius: 12px;
  background: #fff;
  color: var(--tlai-ink);
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(16, 24, 40, .05);
}
#tlai-sales-chat .tlai-product:hover { border-color: rgba(122, 23, 56, .48); color: var(--tlai-wine-dark); text-decoration: none; }
#tlai-sales-chat .tlai-product-name { font-weight: 750; line-height: 1.3; }
#tlai-sales-chat .tlai-product-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--tlai-muted); font-size: 12px; }
#tlai-sales-chat .tlai-product-price { color: var(--tlai-wine); font-weight: 800; white-space: nowrap; }
#tlai-sales-chat .tlai-product-reason { color: var(--tlai-muted); font-size: 12px; line-height: 1.3; }

#tlai-sales-chat .tlai-starters { border-top: 1px solid #f0f1f3; background: #fff; }
#tlai-sales-chat .tlai-starters[hidden] { display: none; }

/* Produzione senza voce - azioni rapide iniziali */
#tlai-sales-chat .tlai-quick-actions {
  display: grid;
  gap: 7px;
  padding: 9px 11px 8px;
}
#tlai-sales-chat .tlai-quick-actions-title {
  padding: 0 2px 1px;
  color: var(--tlai-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
#tlai-sales-chat .tlai-quick-action {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 57px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid #e0e4e8;
  border-radius: 13px;
  background: #fff;
  color: var(--tlai-ink);
  text-align: left;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .045);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
#tlai-sales-chat .tlai-quick-action:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 23, 56, .32);
  background: #fffafb;
  color: var(--tlai-ink);
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(16, 24, 40, .08);
}
#tlai-sales-chat .tlai-quick-action:focus-visible { outline: 3px solid rgba(122, 23, 56, .22); outline-offset: 2px; }
#tlai-sales-chat .tlai-quick-action-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f7eef1;
  color: var(--tlai-wine);
}
#tlai-sales-chat .tlai-quick-action-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#tlai-sales-chat .tlai-quick-action-copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
#tlai-sales-chat .tlai-quick-action-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
}
#tlai-sales-chat .tlai-quick-action-copy small {
  overflow: hidden;
  color: var(--tlai-muted);
  font-size: 10.8px;
  line-height: 1.25;
  text-overflow: ellipsis;
}
#tlai-sales-chat .tlai-quick-action-arrow {
  justify-self: end;
  color: #98a2b3;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}
#tlai-sales-chat .tlai-quick-action-whatsapp { border-color: #cfe9d8; background: #fbfffc; }
#tlai-sales-chat .tlai-quick-action-whatsapp:hover { border-color: #25d366; background: #f4fff8; }
#tlai-sales-chat .tlai-quick-action-whatsapp .tlai-quick-action-icon { background: #eafaf0; color: #168c46; }
#tlai-sales-chat .tlai-quick-action-project .tlai-quick-action-icon { background: #fff2d9; color: #a96300; }
#tlai-sales-chat .tlai-quick-action-order .tlai-quick-action-icon { background: #eef3ff; color: #315ca8; }

#tlai-sales-chat .tlai-form { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--tlai-line); background: #fff; }
#tlai-sales-chat .tlai-form textarea { flex: 1 1 auto; max-height: 110px; min-height: 42px; padding: 10px 11px; resize: none; border: 1px solid #d0d5dd; border-radius: 12px; background: #fff; color: var(--tlai-ink); line-height: 1.35; }
#tlai-sales-chat .tlai-form textarea::placeholder { color: #98a2b3; }
#tlai-sales-chat .tlai-send { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px; background: var(--tlai-wine); color: #fff; cursor: pointer; }
#tlai-sales-chat .tlai-send:hover { background: var(--tlai-wine-dark); }
#tlai-sales-chat .tlai-send:disabled { opacity: .55; cursor: wait; }
#tlai-sales-chat .tlai-privacy { padding: 0 10px 9px; background: #fff; color: var(--tlai-muted); font-size: 10.5px; text-align: center; }
#tlai-sales-chat .tlai-sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }

@media (max-width: 560px) {
  #tlai-sales-chat { right: 12px; bottom: 12px; }
  #tlai-sales-chat .tlai-panel { position: fixed; right: 8px; bottom: 8px; width: calc(100vw - 16px); height: min(720px, calc(100dvh - 16px)); border-radius: 18px; }
  #tlai-sales-chat .tlai-launcher-label { display: none; }
  #tlai-sales-chat .tlai-launcher { width: 58px; padding: 7px; }
  #tlai-sales-chat .tlai-online-dot { position: absolute; right: 4px; bottom: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  #tlai-sales-chat *, #tlai-sales-chat *::before, #tlai-sales-chat *::after { scroll-behavior: auto!important; transition-duration: .01ms!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; }
}
