/* Site chat widget — landing */
.site-chat-root {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1200;
  font-family: inherit;
}

.site-chat-fab {
  width: 3.5rem;
  height: 3.5rem;
  border: 0;
  border-radius: 999px;
  background: #173c78;
  color: #fff;
  box-shadow: 0 10px 28px rgba(23, 60, 120, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.site-chat-fab:hover,
.site-chat-fab.is-open {
  background: #3d7ea6;
  transform: translateY(-1px);
}

.site-chat-fab-icon {
  font-family: "Material Symbols Outlined", sans-serif;
  font-size: 1.6rem;
  line-height: 1;
  font-variation-settings: "FILL" 1;
}

.site-chat-teaser {
  position: absolute;
  right: 4.25rem;
  bottom: 0.45rem;
  /* max-content: avoid shrink-to-fit against narrow .site-chat-root (FAB width) */
  width: max-content;
  max-width: min(740px, calc(100vw - 7rem));
  padding: 0.85rem 1.1rem;
  border-radius: 0.85rem;
  background: #fff;
  color: #1f2937;
  font-size: 0.88rem;
  line-height: 1.4;
  white-space: normal;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(23, 60, 120, 0.12);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.site-chat-teaser.is-hidden {
  display: none;
}

.site-chat-teaser.is-fading {
  opacity: 0;
}

.site-chat-panel {
  position: absolute;
  right: 0;
  bottom: 4.35rem;
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 7rem));
  display: none;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(23, 60, 120, 0.12);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.site-chat-panel.is-open {
  display: flex;
}

.site-chat-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, #173c78, #3d7ea6);
  color: #fff;
}

.site-chat-panel-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.site-chat-panel-sub {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 0.15rem;
}

.site-chat-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.site-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 0.9rem;
  background: #f5f7fa;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.site-chat-msg {
  max-width: 88%;
  padding: 0.65rem 0.8rem;
  border-radius: 0.85rem;
  font-size: 0.86rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.site-chat-msg--user {
  align-self: flex-end;
  background: #173c78;
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.site-chat-msg--assistant {
  align-self: flex-start;
  background: #fff;
  color: #1f2937;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom-left-radius: 0.25rem;
}

.site-chat-typing {
  align-self: flex-start;
  font-size: 0.78rem;
  color: #64748b;
  padding: 0.2rem 0.35rem;
}

.site-chat-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.7rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.site-chat-form input {
  flex: 1;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 0.65rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.86rem;
}

.site-chat-form.is-closed {
  opacity: 0.65;
}

.site-chat-form input:disabled,
.site-chat-send:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.site-chat-form input:focus {
  outline: 2px solid rgba(61, 126, 166, 0.35);
  border-color: #3d7ea6;
}

.site-chat-send {
  border: 0;
  border-radius: 0.65rem;
  background: #3d7ea6;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}

.site-chat-send:hover {
  background: #173c78;
}

@media (max-width: 480px) {
  .site-chat-root {
    right: 0.75rem;
    bottom: 0.75rem;
  }
  .site-chat-teaser {
    right: 0;
    bottom: 4.2rem;
    width: max-content;
    max-width: calc(100vw - 1.5rem);
  }
}
