/* Scrivici — chat Sofia sul sito */
.spp-webchat {
  font-family: inherit;
  color: var(--ink, #2E150F);
}
.spp-webchat[hidden] { display: none !important; }

.spp-webchat-launch {
  display: none !important;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(24px + 56px + env(safe-area-inset-bottom, 0px));
  z-index: 99992;
  align-items: center;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  min-height: 48px;
  font-size: 17px;
  border: 2.5px solid var(--ink, #2E150F);
  border-radius: 999px;
  background: var(--spp-grad-hot, linear-gradient(135deg, #FF4D7E 0%, #E8356D 52%, #C41D54 100%));
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 4px 4px 0 var(--ink, #2E150F), 0 10px 24px rgba(232, 53, 109, 0.28);
  cursor: pointer;
  line-height: 1;
}
.spp-webchat-launch:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink, #2E150F);
}
.spp-webchat-launch-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b8f2c8;
  box-shadow: 0 0 0 3px rgba(184, 242, 200, 0.35);
}

.spp-webchat-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 99981;
  width: min(400px, calc(100vw - 24px));
  height: min(640px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  background: var(--cream, #FEF8E7);
  border: 2.5px solid var(--ink, #2E150F);
  border-radius: 28px;
  box-shadow: 8px 8px 0 var(--ink, #2E150F);
  overflow: hidden;
}
.spp-webchat-panel[hidden] { display: none !important; }

.spp-webchat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  background: #fff;
  border-bottom: 2px solid var(--ink, #2E150F);
}
.spp-webchat-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.spp-webchat-who strong {
  font-size: 20px;
  font-weight: 800;
}
.spp-webchat-who span {
  font-size: 15px;
  color: var(--ink-soft, #5B3327);
}
.spp-webchat-close {
  min-width: 48px;
  min-height: 44px;
  padding: 8px 14px;
  border: 2px solid var(--ink, #2E150F);
  border-radius: 999px;
  background: var(--pink-soft, #FDE0E4);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  color: inherit;
}

.spp-webchat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--cream, #FEF8E7);
}
.spp-webchat-bubble {
  max-width: 92%;
  padding: 12px 16px;
  border: 2px solid var(--ink, #2E150F);
  border-radius: 18px;
  font-size: 18px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spp-webchat-bubble--img {
  padding: 10px 10px 12px;
}
.spp-webchat-under {
  display: block;
  padding: 2px 4px 0;
}
.spp-webchat-bubble a { color: var(--hot, #E8356D); font-weight: 700; }
.spp-webchat-sofia {
  align-self: flex-start;
  background: #fff;
  border-bottom-left-radius: 6px;
}
.spp-webchat-me {
  align-self: flex-end;
  background: var(--pink-soft, #FDE0E4);
  border-bottom-right-radius: 6px;
}
.spp-webchat-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 100%;
  align-self: stretch;
}
.spp-webchat-photos figure,
.spp-webchat-pick {
  margin: 0;
  padding: 0;
  background: #fff;
  border: 2.5px solid var(--ink, #2E150F);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  text-align: inherit;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-shadow: 3px 3px 0 var(--ink, #2E150F);
}
.spp-webchat-pick:focus-visible,
.spp-webchat-pick:hover {
  outline: 3px solid var(--hot, #E8356D);
  outline-offset: 2px;
}
.spp-webchat-photos img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  pointer-events: none;
  flex: 0 0 auto;
}
.spp-webchat-photos figcaption {
  display: block !important;
  flex: 0 0 auto;
  padding: 10px 8px 12px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
  white-space: normal;
  word-wrap: break-word;
  background: #fff;
}
.spp-webchat-tap-hint {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-soft, #5B3327);
  align-self: flex-start;
}
.spp-webchat-pays {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
}
.spp-webchat-pays a {
  display: inline-flex;
  justify-content: center;
  min-height: 48px;
  align-items: center;
  padding: 12px 18px;
  border: 2.5px solid var(--ink, #2E150F);
  border-radius: 999px;
  background: var(--spp-grad-hot, #E8356D);
  color: #fff !important;
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink, #2E150F);
}
.spp-webchat-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid var(--ink, #2E150F);
  border-radius: 18px;
}
.spp-webchat-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-mute, #6B5048);
  animation: spp-webchat-dot 1.1s infinite ease-in-out;
}
.spp-webchat-typing i:nth-child(2) { animation-delay: .15s; }
.spp-webchat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes spp-webchat-dot {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.spp-webchat-dock {
  background: #fff;
  border-top: 2px solid var(--ink, #2E150F);
  padding: 10px 12px 12px;
}
.spp-webchat-hint {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft, #5B3327);
  text-align: center;
}
.spp-webchat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.spp-webchat-form textarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 140px;
  padding: 12px 14px;
  border: 2.5px solid var(--ink, #2E150F);
  border-radius: 14px;
  background: var(--cream, #FEF8E7);
  font: inherit;
  font-size: 18px;
  line-height: 1.3;
}
.spp-webchat-send {
  flex: 0 0 auto;
  min-height: 48px;
  min-width: 88px;
  padding: 0 18px;
  border: 2.5px solid var(--ink, #2E150F);
  border-radius: 999px;
  background: var(--spp-grad-hot, #E8356D);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
}
.spp-webchat-send:disabled,
.spp-webchat-attach:disabled,
.spp-webchat-pick:disabled {
  opacity: .55;
  cursor: wait;
}
.spp-webchat-attach {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border: 2.5px solid var(--ink, #2E150F);
  border-radius: 16px;
  background: var(--butter, #FCF3CF);
  cursor: pointer;
  color: inherit;
  font-weight: 800;
  font-size: 18px;
}
.spp-webchat-alt {
  margin: 8px 0 0;
  padding: 0;
  font-size: 16px;
  text-align: center;
  color: var(--ink-soft, #5B3327);
}
.spp-webchat-alt a {
  color: var(--hot, #E8356D);
  font-weight: 800;
  display: inline-block;
  padding: 6px 4px;
}
.spp-webchat-thumb {
  max-width: 100%;
  width: 100%;
  border-radius: 12px;
  border: 2px solid var(--ink, #2E150F);
  display: block;
  order: -1;
}

.spp-webchat-landing {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px 40px;
}
.spp-webchat-seo {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.spp-webchat-lead {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 750;
  text-align: center;
  color: var(--ink, #2E150F);
}
.spp-webchat-buggy {
  margin: 0 auto 16px;
  max-width: 28em;
  padding: 10px 14px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 700;
  text-align: center;
  color: var(--ink, #2E150F);
  background: var(--butter, #FCF3CF);
  border: 2px solid var(--ink, #2E150F);
  border-radius: 14px;
}
.spp-webchat-doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 20px;
}
.spp-webchat-door {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 64px;
  padding: 16px 18px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none !important;
  border: 2.5px solid var(--ink, #2E150F);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink, #2E150F);
}
.spp-webchat-door-site {
  background: var(--spp-grad-hot, linear-gradient(135deg, #FF4D7E 0%, #E8356D 52%, #C41D54 100%));
  color: #fff !important;
}
.spp-webchat-door-tg {
  background: var(--butter, #FCF3CF);
  color: var(--ink, #2E150F) !important;
}
.spp-webchat-door:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink, #2E150F);
}

body.spp-scrivici-page .entry-content > .wp-block-post-title,
body.spp-scrivici-page .entry-content > h1:first-child {
  display: none !important;
}
body.spp-scrivici-page .spp-webchat-launch,
body.spp-scrivici-page .spp-webchat-lead,
body.spp-scrivici-page .spp-webchat-buggy,
body.spp-scrivici-page .spp-webchat-doors {
  display: none !important;
}
body.spp-scrivici-page .spp-header-widget,
body.spp-scrivici-page .spp-footer,
body.spp-scrivici-page .spp-footer-widget,
body.spp-scrivici-page .cky-consent-container {
  display: none !important;
}
body.spp-scrivici-page {
  padding: 0 !important;
}
body.spp-scrivici-page .spp-webchat-landing {
  max-width: none;
  margin: 0;
  padding: 0;
}
body.spp-scrivici-page .spp-webchat {
  display: block;
  position: relative;
  z-index: 1;
}
body.spp-scrivici-page .spp-webchat-panel {
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-width: none !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: 200000 !important;
  animation: spp-webchat-hover-in 0.4s ease;
}
@keyframes spp-webchat-hover-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
body.spp-scrivici-page .spp-webchat-head {
  padding: 18px 20px 16px;
}
body.spp-scrivici-page .spp-webchat-who strong {
  font-size: 28px;
}
body.spp-scrivici-page .spp-webchat-who span {
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;
}
body.spp-scrivici-page .spp-webchat-who span::after {
  content: "Scrivi qui. Ti aiuto io.";
  display: block;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink-soft, #5B3327);
  font-weight: 700;
}
body.spp-scrivici-page .spp-webchat-log {
  padding: 18px 16px 14px;
  gap: 14px;
}
body.spp-scrivici-page .spp-webchat-bubble {
  max-width: 94%;
  padding: 14px 18px;
  font-size: 22px;
  line-height: 1.45;
}
body.spp-scrivici-page .spp-webchat-hint {
  font-size: 0 !important;
  line-height: 0;
}
body.spp-scrivici-page .spp-webchat-hint::before {
  content: "Puoi scrivere o mandare una foto.";
  display: block;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink-soft, #5B3327);
  text-align: center;
}
body.spp-scrivici-page .spp-webchat-form textarea {
  min-height: 56px;
  font-size: 22px;
}
body.spp-scrivici-page .spp-webchat-send,
body.spp-scrivici-page .spp-webchat-attach {
  min-height: 56px;
  font-size: 22px;
}
body.spp-scrivici-page .spp-webchat-alt {
  font-size: 18px;
}
body.spp-scrivici-page .spp-webchat-alt a {
  padding: 10px 8px;
  font-size: 20px;
}
body.spp-scrivici-page .spp-webchat-photos figcaption,
body.spp-scrivici-page .spp-webchat-tap-hint,
body.spp-scrivici-page .spp-webchat-under {
  font-size: 18px;
}
body.spp-scrivici-page .spp-webchat-photos figcaption {
  font-size: 20px;
  padding: 12px 10px 14px;
}
body.spp-scrivici-page .spp-webchat-pays a {
  min-height: 56px;
  font-size: 20px;
}

@media (max-width: 640px) {
  .spp-webchat-launch {
    bottom: calc(16px + 56px + env(safe-area-inset-bottom, 0px));
  }
  .spp-webchat-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 8px;
    height: min(680px, calc(100dvh - 16px));
    border-radius: 22px;
  }
  body.spp-scrivici-page .spp-webchat-panel {
    inset: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    border-radius: 0 !important;
  }
  body.spp-scrivici-page .spp-webchat-who strong {
    font-size: 26px;
  }
  body.spp-scrivici-page .spp-webchat-bubble {
    font-size: 20px;
  }
  .spp-webchat-doors {
    grid-template-columns: 1fr;
  }
  .spp-webchat-lead {
    font-size: 20px;
  }
  .spp-webchat-buggy {
    font-size: 15px;
  }
  .spp-webchat-door {
    min-height: 72px;
    font-size: 22px;
  }
}
