/* Stesso sfondo della schermata precedente, con messaggi e stato vettoriali. */
.handover-chat__stage { gap: 8px; --handover-cycle: 16s; }
.handover-chat__widget.sentiment-flow__chat { width: 326px; max-width: 100%; aspect-ratio: 340 / 490; margin: 0; flex-shrink: 0; border: 6px solid #000; border-radius: 16px; background: #fff; box-shadow: 0 18px 40px rgb(0 0 0 / 15%); container-type: inline-size; }
.handover-chat__interface { display: flex; flex-direction: column; height: 100%; color: #111; }
.handover-chat__interface > .sentiment-flow__crop { flex-shrink: 0; }
.handover-chat__header { aspect-ratio: 416 / 57; }
.handover-chat__header img, .handover-chat__footer img { width: 103.8462%; max-width: none; margin-left: -1.9231%; }
.handover-chat__header img { transform: translateY(-1.2903%); }
.handover-chat__footer { aspect-ratio: 416 / 124; border-top: 0; }
.handover-chat__footer img { bottom: -2.4038cqi; }
.handover-chat__messages { flex: 1; min-height: 0; overflow: hidden; padding: 3.8cqi; background: #fff; font: 400 4cqi/1.45 'Montserrat', sans-serif; }
.handover-chat__bubble { width: fit-content; max-width: 95%; margin: 0; padding: 2.8cqi 3cqi; }
.handover-chat__bubble--assistant { border-radius: 3.5cqi 3.5cqi 3.5cqi .5cqi; background: #f0f0f0; }
.handover-chat__bubble--visitor { max-width: 91%; margin-left: auto; border-radius: 3.5cqi 3.5cqi .5cqi 3.5cqi; color: #fff; background: #111; }
.handover-chat__question, .handover-chat__result { margin-top: 4cqi; }
.handover-chat__result { position: relative; }
.handover-chat__request { padding: 3.5cqi; border-radius: 4cqi 4cqi 4cqi .5cqi; background: #f4f4f4; }
.handover-chat__request-title { display: flex; align-items: center; gap: 2.4cqi; font-size: 4.15cqi; font-weight: 700; line-height: 1.35; }
.handover-chat__request-title svg { width: 5cqi; height: 5cqi; flex-shrink: 0; }
.handover-chat__waiting { margin: 2.8cqi 0 0; }
.handover-chat__waiting-dots, .handover-chat__processing { display: flex; gap: 1cqi; }
.handover-chat__waiting-dots { margin-top: 2.4cqi; }
.handover-chat__waiting-dots span, .handover-chat__processing span { width: 1.5cqi; height: 1.5cqi; border-radius: 50%; background: #888; }
.handover-chat__paused { margin: 2.4cqi 0 0; color: #777; font-size: 3.4cqi; }
.handover-chat__choices { display: flex; flex-direction: column; align-items: flex-start; gap: 2cqi; margin-top: 3cqi; font-size: 3.4cqi; line-height: 1.3; }
.handover-chat__choices span { display: block; padding: 1.8cqi 3cqi; border-radius: 20cqi; color: #fff; background: #000; }
.handover-chat__processing { position: absolute; top: 0; left: 0; display: none; padding: 3cqi 4cqi; border-radius: 3.5cqi 3.5cqi 3.5cqi .5cqi; background: #f0f0f0; }
.handover-chat__footer .sentiment-flow__chat-placeholder { left: 5.5%; right: 24%; top: 16.5%; height: 24%; padding-left: .75%; font-size: 3.37cqi; }
.handover-chat__draft { visibility: hidden; overflow: hidden; white-space: nowrap; }
.handover-chat__draft span { display: block; width: 100%; }
.handover-chat__disclaimer { position: absolute; left: 4%; right: 4%; top: 72%; height: 25%; display: flex; align-items: center; justify-content: center; background: #fff; color: #999; text-align: center; font: 400 2.4cqi/1.3 Arial, sans-serif; }
.handover-chat__toggle { align-self: flex-end; padding: 0; border: 0; background: transparent; color: #555; cursor: pointer; font: 400 11px/1.4 'JetBrains Mono', monospace; }
.handover-chat__toggle[hidden] { display: none; }
.handover-chat__toggle:hover { color: #111; }
.handover-chat__toggle:focus-visible { outline: 2px solid #111; outline-offset: 4px; }

[data-handover-animated] :is(.handover-chat__greeting, .handover-chat__question, .handover-chat__processing, .handover-chat__request, .handover-chat__paused, .handover-chat__choices, .handover-chat__placeholder, .handover-chat__draft, .handover-chat__draft span) { animation-duration: var(--handover-cycle); animation-timing-function: linear; animation-iteration-count: infinite; }
[data-handover-animated] .handover-chat__greeting { animation-name: handover-greeting; }
[data-handover-animated] .handover-chat__question { animation-name: handover-question; }
[data-handover-animated] .handover-chat__processing { display: flex; animation-name: handover-processing; }
[data-handover-animated] .handover-chat__request { animation-name: handover-request; }
[data-handover-animated] .handover-chat__paused { animation-name: handover-paused; }
[data-handover-animated] .handover-chat__choices { animation-name: handover-choices; }
[data-handover-animated] .handover-chat__placeholder { animation-name: handover-placeholder; }
[data-handover-animated] .handover-chat__draft { visibility: visible; animation-name: handover-draft; }
[data-handover-animated] .handover-chat__draft span { animation-name: handover-type; animation-timing-function: steps(30, end); }
[data-handover-animated] .handover-chat__waiting-dots span, [data-handover-animated] .handover-chat__processing span { animation: handover-dot 1s ease-in-out infinite; }
[data-handover-animated] :is(.handover-chat__waiting-dots, .handover-chat__processing) span:nth-child(2) { animation-delay: .16s; }
[data-handover-animated] :is(.handover-chat__waiting-dots, .handover-chat__processing) span:nth-child(3) { animation-delay: .32s; }
[data-handover-paused="true"] * { animation-play-state: paused !important; }
@keyframes handover-greeting { 0% { opacity: 0; transform: translateY(5px); } 5%,96% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }
@keyframes handover-placeholder { 0%,3%,18%,100% { opacity: 1; } 4%,17% { opacity: 0; } }
@keyframes handover-draft { 0%,3%,18%,100% { opacity: 0; } 4%,17% { opacity: 1; } }
@keyframes handover-type { 0%,4% { clip-path: inset(0 100% 0 0); } 16%,100% { clip-path: inset(0); } }
@keyframes handover-question { 0%,19% { opacity: 0; transform: translateY(5px); } 23%,96% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }
@keyframes handover-processing { 0%,24%,34%,100% { opacity: 0; } 26%,31% { opacity: 1; } }
@keyframes handover-request { 0%,34% { opacity: 0; transform: translateY(6px); } 39%,96% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }
@keyframes handover-paused { 0%,41% { opacity: 0; } 45%,100% { opacity: 1; } }
@keyframes handover-choices { 0%,46% { opacity: 0; } 51%,100% { opacity: 1; } }
@keyframes handover-dot { 50% { opacity: .35; transform: translateY(-2px); } }
@media (max-width: 1023px) { .handover-chat__widget.sentiment-flow__chat { width: 260px; } }
@media (prefers-reduced-motion: reduce) {
  [data-handover-chat] * { animation: none !important; }
  [data-handover-chat] .handover-chat__processing, [data-handover-chat] .handover-chat__draft, [data-handover-chat] [data-handover-toggle] { display: none; }
}
