.site-chat {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 70;
  font-family: var(--font-body, system-ui, sans-serif);
}

.site-chat__launch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.theme-american .site-chat__launch {
  border-radius: 4px;
}

.site-chat__launch:hover {
  background: var(--brand-strong);
  transform: translateY(-2px);
}

.site-chat__launch svg {
  display: block;
}

.site-chat__launch.is-bouncing {
  animation: siteChatBounce 900ms ease;
}

.site-chat__launch-ping {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #22c55e;
}

.site-chat__teaser {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.8rem);
  width: min(270px, calc(100vw - 1.5rem));
  padding: 0.95rem 1rem 1rem;
  border: 1px solid var(--brand-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.theme-american .site-chat__teaser {
  border-radius: 4px;
}

.site-chat__teaser strong {
  display: block;
  padding-right: 1.2rem;
  color: var(--brand-ink);
  font-size: 0.95rem;
  line-height: 1.3;
}

.site-chat__teaser span {
  display: block;
  margin-top: 0.35rem;
  color: #5b6775;
  font-size: 0.8rem;
  line-height: 1.45;
}

.site-chat__teaser-close {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.site-chat__teaser-cta {
  margin-top: 0.7rem;
  padding: 0.5rem 0.8rem;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.theme-american .site-chat__teaser-cta {
  border-radius: 3px;
}

.site-chat__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 1.5rem));
  max-height: min(650px, calc(100dvh - 7rem));
  overflow: hidden;
  border: 1px solid var(--brand-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.26);
}

.theme-american .site-chat__panel {
  border-radius: 4px;
}

.site-chat__panel[hidden],
.site-chat__teaser[hidden] {
  display: none !important;
}

.site-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-top: 4px solid var(--brand);
  background: #0b1f2a;
  color: #fff;
}

.theme-american .site-chat__head {
  background: #002868;
  border-top-color: #c8102e;
}

.site-chat__head strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.2;
}

.site-chat__head span {
  display: block;
  margin-top: 0.12rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.7rem;
}

.site-chat__close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.site-chat__messages {
  flex: 1 1 auto;
  min-height: 140px;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
  overscroll-behavior: contain;
}

.site-chat__msg {
  display: flex;
  margin-bottom: 0.65rem;
}

.site-chat__msg--bot {
  justify-content: flex-start;
}

.site-chat__msg--user {
  justify-content: flex-end;
}

.site-chat__bubble {
  max-width: 84%;
  padding: 0.65rem 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #263244;
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.site-chat__msg--user .site-chat__bubble {
  border-color: var(--brand);
  border-bottom-right-radius: 4px;
  background: var(--brand);
  color: #fff;
}

.site-chat__msg--bot .site-chat__bubble {
  border-bottom-left-radius: 4px;
}

.theme-american .site-chat__bubble {
  border-radius: 3px;
}

.site-chat__typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 1.1rem;
}

.site-chat__typing i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #94a3b8;
  animation: siteChatTyping 900ms infinite ease-in-out;
}

.site-chat__typing i:nth-child(2) { animation-delay: 120ms; }
.site-chat__typing i:nth-child(3) { animation-delay: 240ms; }

.site-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.9rem 0.65rem;
  background: #f8fafc;
}

.site-chat__chip {
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-ink);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.site-chat__chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.theme-american .site-chat__chip {
  border-radius: 3px;
}

.site-chat__form {
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.site-chat__form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 2.6rem;
  padding: 0 0.7rem;
  border: 1px solid #dbe3ec;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font-size: 0.84rem;
}

.site-chat__form input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

.site-chat__form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

.theme-american .site-chat__form input,
.theme-american .site-chat__form button {
  border-radius: 3px;
}

.site-chat__foot {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.site-chat__book,
.site-chat__wa {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0 0.6rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.site-chat__book {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff !important;
}

.site-chat__wa {
  border-color: var(--brand-line);
  color: var(--brand-ink) !important;
}

.theme-american .site-chat__book,
.theme-american .site-chat__wa {
  border-radius: 3px;
}

.site-chat__booking {
  margin-top: 0.5rem;
  padding: 0.8rem;
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #fff;
}

.theme-american .site-chat__booking {
  border-radius: 3px;
}

.site-chat__booking-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.site-chat__booking label {
  display: block;
  margin-bottom: 0.22rem;
  color: #526071;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-chat__booking input,
.site-chat__booking select {
  width: 100%;
  height: 2.35rem;
  padding: 0 0.45rem;
  border: 1px solid #dbe3ec;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 0.8rem;
}

.site-chat__booking .site-chat__booking-submit {
  width: 100%;
  min-height: 2.5rem;
  margin-top: 0.65rem;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.site-chat__quote {
  margin-top: 0.6rem;
  padding: 0.8rem;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: #f0fdf4;
  color: #14532d;
  font-size: 0.82rem;
  line-height: 1.5;
}

.site-chat__quote strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.site-chat__quote a {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.55rem;
  padding: 0 0.75rem;
  border-radius: 7px;
  background: #15803d;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.site-chat__quote.is-empty {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.site-chat__quote.is-empty a {
  background: #b91c1c;
}

.site-chat__panel.is-open {
  display: flex;
}

.site-chat.is-open .site-chat__launch,
.site-chat.is-open .site-chat__teaser {
  display: none;
}

body.chat-open .site-chat__panel {
  max-height: min(680px, calc(100dvh - 2rem));
}

body.chat-open .app-bottom-nav {
  display: none !important;
}

body.app-more-open .site-chat {
  display: none !important;
}

@media (max-width: 1023px) {
  .site-chat {
    right: 0.85rem;
    bottom: calc(4.8rem + env(safe-area-inset-bottom, 0px));
  }

  .site-chat__panel {
    width: calc(100vw - 1.5rem);
    max-height: calc(100dvh - 10.5rem);
  }

  body.chat-open .site-chat {
    bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
  }

  body.chat-open .site-chat__panel {
    max-height: calc(100dvh - 1.6rem);
  }
}

@media (max-width: 420px) {
  .site-chat__booking-row {
    grid-template-columns: 1fr;
  }
}

@keyframes siteChatBounce {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-7px); }
  60% { transform: translateY(2px); }
  80% { transform: translateY(-2px); }
}

@keyframes siteChatTyping {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .site-chat__launch,
  .site-chat__launch.is-bouncing,
  .site-chat__typing i {
    animation: none !important;
    transition: none !important;
  }
}
