/* La fotografia resta intatta. Solo il display contiene la chat vettoriale. */
.repetitive-detail__phone { display: flex; flex-direction: column; justify-content: center; background: #f4f4f3; --phone-cycle: 16s; }
.repetitive-phone { position: relative; width: 100%; aspect-ratio: 1374 / 1145; overflow: hidden; margin-block: auto; }
.repetitive-phone__canvas { position: relative; width: 100%; aspect-ratio: 1374 / 1145; }
.repetitive-phone__photo { display: block; width: 100%; height: auto; filter: grayscale(1); }
.repetitive-phone__screen.sentiment-flow__chat { position: absolute; left: 35%; top: 9.7%; width: 37%; height: 84.75%; max-width: none; margin: 0; display: flex; flex-direction: column; border: 0; border-radius: 0; background: #fff; transform: matrix(1, -.008, .0114, 1, 0, 0); transform-origin: top left; container-type: inline-size;
  /* Sagoma misurata sulla foto originale: bordi inclinati e curva inferiore asimmetrica. */
  clip-path: polygon(0% 0%, 98.647% 0%, 98.364% 9.371%, 98.456% 32.249%, 98.750% 54.921%, 99.066% 76.564%, 99.319% 92.022%, 99.078% 94.082%, 98.246% 96.140%, 97.240% 97.166%, 95.645% 98.190%, 94.060% 98.699%, 92.869% 99.209%, 88.334% 99.705%, 83.215% 99.890%, 75.542% 99.961%, 64.526% 100%, 43.085% 100%, 19.480% 100%, 14.170% 100%, 11.615% 99.899%, 9.069% 99.373%, 6.720% 98.848%, 5.355% 98.327%, 3.793% 97.805%, 2.241% 96.768%, 1.280% 95.734%, .342% 93.669%, 0% 91.606%, 0% 76.148%, 0% 54.507%, 0% 31.836%, .021% 8.959%);
}
.repetitive-phone__screen > .sentiment-flow__crop { flex: 0 0 auto; }
/* Usa solo l'interfaccia dello screenshot, senza il bordo della finestra del widget. */
.repetitive-phone__screen .sentiment-flow__crop--header img { clip-path: inset(4% 2% 0 2%); }
.repetitive-phone__screen .sentiment-flow__crop--footer img { clip-path: inset(0 2% 1% 2%); }
.repetitive-phone__messages { flex: 1; min-height: 0; overflow: hidden; padding: 3.8cqi; background: #fff; font: 400 5.2cqi/1.4 'Montserrat', sans-serif; }
.repetitive-phone__time { margin-bottom: 3.6cqi; text-align: center; color: #888; font-size: 3.3cqi; }
.repetitive-phone__bubble { width: fit-content; max-width: 92%; margin: 0; padding: 2.8cqi 3.2cqi; }
.repetitive-phone__bubble--assistant { border-radius: 3.5cqi 3.5cqi 3.5cqi .5cqi; background: #eee; color: #111; }
.repetitive-phone__bubble--visitor { margin-left: auto; border-radius: 3.5cqi 3.5cqi .5cqi 3.5cqi; background: #111; color: #fff; }
.repetitive-phone__question, .repetitive-phone__reply-area, .repetitive-phone__thanks { margin-top: 4cqi; }
.repetitive-phone__question { max-width: 83%; }
.repetitive-phone__reply-area { position: relative; }
.repetitive-phone__answer { margin: 0; }
.repetitive-phone__citation-number { display: inline-flex; align-items: center; justify-content: center; width: 4.4cqi; height: 4.4cqi; border-radius: 50%; background: #000; color: #fff; font: 500 3.1cqi/1 Arial, sans-serif; vertical-align: .1em; }
.repetitive-phone__source { width: fit-content; margin-top: 2.6cqi; font-size: 4cqi; text-decoration: underline; text-underline-offset: .2em; }
.repetitive-phone__feedback { display: flex; align-items: center; gap: 3.8cqi; margin-top: 2cqi; color: #777; }
.repetitive-phone__feedback svg { display: block; width: 4.4cqi; height: 4.4cqi; }
.repetitive-phone__typing { position: absolute; top: 0; left: 0; display: none; gap: 1cqi; padding: 3.5cqi 4cqi; border-radius: 3cqi 3cqi 3cqi .5cqi; background: #eee; }
.repetitive-phone__typing span { width: 1.3cqi; height: 1.3cqi; border-radius: 50%; background: #777; }
.repetitive-phone__draft { visibility: hidden; white-space: nowrap; overflow: hidden; }
.repetitive-phone__draft span { display: block; width: 100%; }
.repetitive-detail__phone > .repetitive-detail__toggle { align-self: flex-end; margin-top: 8px; }

[data-phone-animated] :is(.repetitive-phone__greeting, .repetitive-phone__question, .repetitive-phone__typing, .repetitive-phone__reply, .repetitive-phone__answer, .repetitive-phone__source, .repetitive-phone__feedback, .repetitive-phone__thanks, .repetitive-phone__placeholder, .repetitive-phone__draft, .repetitive-phone__draft span) { animation-duration: var(--phone-cycle); animation-timing-function: linear; animation-iteration-count: infinite; }
[data-phone-animated] .repetitive-phone__greeting { animation-name: phone-greeting; }
[data-phone-animated] .repetitive-phone__question { animation-name: phone-question; }
[data-phone-animated] .repetitive-phone__typing { display: flex; animation-name: phone-typing; }
[data-phone-animated] .repetitive-phone__typing span { animation: phone-dot 1s ease-in-out infinite; }
[data-phone-animated] .repetitive-phone__typing span:nth-child(2) { animation-delay: .16s; }
[data-phone-animated] .repetitive-phone__typing span:nth-child(3) { animation-delay: .32s; }
[data-phone-animated] .repetitive-phone__reply { animation-name: phone-reply; }
[data-phone-animated] .repetitive-phone__answer { animation-name: phone-answer; }
[data-phone-animated] .repetitive-phone__source { animation-name: phone-source; }
[data-phone-animated] .repetitive-phone__feedback { animation-name: phone-feedback; }
[data-phone-animated] .repetitive-phone__thanks { animation-name: phone-thanks; }
[data-phone-animated] .repetitive-phone__placeholder { animation-name: phone-placeholder; }
[data-phone-animated] .repetitive-phone__draft { visibility: visible; animation-name: phone-draft; }
[data-phone-animated] .repetitive-phone__draft span { animation-name: phone-draft-text; animation-timing-function: steps(37, end); }
[data-phone-paused="true"] * { animation-play-state: paused !important; }

@keyframes phone-greeting { 0% { opacity: 0; transform: translateY(5px); } 5%,96% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }
@keyframes phone-placeholder { 0%,3%,18%,100% { opacity: 1; } 4%,17% { opacity: 0; } }
@keyframes phone-draft { 0%,3%,18%,100% { opacity: 0; } 4%,17% { opacity: 1; } }
@keyframes phone-draft-text { 0%,4% { clip-path: inset(0 100% 0 0); } 15%,100% { clip-path: inset(0); } }
@keyframes phone-question { 0%,18% { opacity: 0; transform: translateY(6px); } 22%,96% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }
@keyframes phone-typing { 0%,24%,44%,100% { opacity: 0; } 27%,41% { opacity: 1; } }
@keyframes phone-dot { 50% { opacity: .35; transform: translateY(-2px); } }
@keyframes phone-reply { 0%,44% { opacity: 0; transform: translateY(6px); } 48%,96% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }
@keyframes phone-answer { 0%,48% { clip-path: inset(0 0 100% 0); } 61%,100% { clip-path: inset(0); } }
@keyframes phone-source { 0%,62% { opacity: 0; } 66%,100% { opacity: 1; } }
@keyframes phone-feedback { 0%,67% { opacity: 0; } 71%,96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes phone-thanks { 0%,78% { opacity: 0; transform: translateY(5px); } 82%,96% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }

/* Sullo smartphone si avvicina l'inquadratura, conservando foto e proporzioni. */
@media (max-width: 767px) {
  .repetitive-phone { aspect-ratio: 4 / 5; }
  .repetitive-phone__canvas { position: absolute; width: 150%; left: -30.4%; top: 50%; transform: translateY(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  [data-repetitive-phone] * { animation: none !important; }
  [data-repetitive-phone] .repetitive-phone__typing, [data-repetitive-phone] .repetitive-phone__draft, [data-repetitive-phone] [data-phone-toggle] { display: none; }
}
