/* Chat OLTREVASCA: accesso fisso e invito discreto, con spazio per l’area sicura del dispositivo. */
.chat-launcher,.chat-invite,.chat-dialog {
  --chat-right: max(16px, env(safe-area-inset-right));
  --chat-bottom: calc(16px + env(safe-area-inset-bottom));
  position: fixed;
  right: var(--chat-right);
  z-index: 40;
  box-sizing: border-box;
  font-family: inherit;
}
.chat-launcher {
  bottom: var(--chat-bottom);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 4px 18px 4px 4px;
  border: 2px solid #fff;
  border-radius: 38px;
  background: #073b59;
  color: #fff;
  box-shadow: 0 6px 24px #073b5933;
  text-align: left;
  cursor: pointer;
  transition: gap 180ms ease, padding 180ms ease, background 180ms ease;
}
.chat-launcher-avatar,.chat-invite-avatar {
  display: block;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}
.chat-launcher-label { display: grid; gap: 3px; max-width: 170px; overflow: hidden; opacity: 1; white-space: nowrap; transition: max-width 180ms ease, opacity 140ms ease, transform 180ms ease; }
.chat-launcher-label strong { font-size: 16px; line-height: 1.2; font-weight: 750; }
.chat-launcher.is-open { gap: 0; padding: 4px; }
.chat-launcher.is-open .chat-launcher-label { max-width: 0; opacity: 0; transform: translateX(-8px); }
.chat-launcher:hover { background: #0b4b6b; }
.chat-launcher:disabled { cursor: default; }
.chat-launcher:focus-visible,.chat-invite button:focus-visible { outline: 3px solid #48bbed; outline-offset: 3px; }
.chat-invite {
  bottom: calc(var(--chat-bottom) + 80px);
  width: min(320px, calc(100% - 32px));
  max-height: calc(100dvh - var(--chat-bottom) - 104px);
  overflow: auto;
  padding: 16px;
  border: 1px solid #d2e1e5;
  border-radius: 18px;
  background: #fff;
  color: #193e4c;
  box-shadow: 0 8px 32px #073b5930;
}
.chat-invite[hidden] { display: none !important; }
.chat-invite-heading { display: flex; align-items: center; gap: 10px; }
.chat-invite-heading>div { flex: 1; }
.chat-invite-heading strong { display: block; font-size: 13px; line-height: 1.4; letter-spacing: .03em; }
.chat-invite-heading span { display: block; margin-top: 2px; font-size: 11px; line-height: 1.4; color: #536c76; }
.chat-invite-close {
  align-self: flex-start;
  flex: none;
  width: 40px;
  height: 40px;
  margin: -8px -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #355d6c;
  font-family: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.chat-invite-message { margin: 14px 0; font-size: 16px; line-height: 1.5; }
.chat-invite-open {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 11px;
  background: #073b59;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.chat-invite-open:hover { background: #0b4b6b; }
@media (min-width: 960px) {
  .chat-launcher,.chat-invite,.chat-dialog {
    --chat-right: max(24px, env(safe-area-inset-right));
    --chat-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-launcher,.chat-launcher-label { transition: none; }
}
@media print {
  .chat-launcher,.chat-invite { display: none !important; }
}
