/* PLAN-22 front customer chat — Appearance tokens */
.iph-front-chat-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1040;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--site-primary, #0d6efd);
  color: var(--site-on-primary, #fff);
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.iph-front-chat-fab:hover,
.iph-front-chat-fab:focus-visible {
  filter: brightness(1.05);
  outline: none;
}

.iph-front-chat-offcanvas {
  width: min(100vw, 26rem);
  background: var(--site-surface, #fff);
  color: var(--site-text, #212529);
}

.iph-front-chat-messages {
  overflow-y: auto;
  padding: 0.75rem 1rem;
  max-height: calc(100vh - 10rem);
}

.iph-front-chat-bubble {
  max-width: 92%;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.925rem;
  line-height: 1.45;
}

.iph-front-chat-bubble--user {
  margin-left: auto;
  background: var(--site-primary-soft, rgba(13, 110, 253, 0.12));
  color: var(--site-text, #212529);
}

.iph-front-chat-bubble--assistant {
  margin-right: auto;
  background: var(--site-muted-surface, rgba(0, 0, 0, 0.06));
  color: var(--site-text, #212529);
}

.iph-front-chat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--site-muted, #6c757d);
}

.iph-front-chat-stars button {
  border: none;
  background: transparent;
  padding: 0;
  line-height: 1;
  color: var(--site-muted, #6c757d);
  cursor: pointer;
}

.iph-front-chat-stars button.is-on {
  color: #e6a800;
}

.iph-front-chat-best.is-on {
  font-weight: 600;
  color: var(--site-primary, #0d6efd);
}

.iph-front-chat-status {
  margin-top: 0.15rem;
}

.iph-front-chat-bubble--system {
  margin-left: auto;
  margin-right: auto;
  max-width: 88%;
  background: transparent;
  border: 1px dashed var(--site-muted, #adb5bd);
  color: var(--site-muted, #6c757d);
  font-size: 0.8rem;
  text-align: center;
}

.iph-front-chat-load-older {
  text-align: center;
  font-size: 0.75rem;
  color: var(--site-muted, #6c757d);
  padding: 0.35rem 0.5rem;
}

.iph-front-chat-composer textarea {
  resize: none;
}

.iph-front-chat-composer .btn.is-loading {
  opacity: 0.85;
  pointer-events: none;
}

.iph-front-chat-pending {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--site-muted, #6c757d);
}

.iph-front-chat-pending-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.iph-front-chat-pending-dots span {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: iph-front-chat-dot 1.2s infinite ease-in-out;
}

.iph-front-chat-pending-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.iph-front-chat-pending-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes iph-front-chat-dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-0.15rem); }
}

html[data-appearance="dark"] .iph-front-chat-bubble--user {
  background: rgba(255, 255, 255, 0.08);
}

html[data-appearance="dark"] .iph-front-chat-bubble--assistant {
  background: rgba(255, 255, 255, 0.06);
}
