/* Customer-site after-hours chat embed — homeowner language, not product pitch */
.cs-chat-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9000;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.cs-chat-fab {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: var(--cs-brand, #0284c7);
  color: var(--cs-brand-ink, #fff);
  box-shadow: 0 8px 28px rgba(2, 132, 199, 0.4);
}
.cs-chat-fab:hover {
  filter: brightness(1.05);
}
.cs-chat-fab:focus-visible {
  outline: 2px solid #0c4a6e;
  outline-offset: 3px;
}
.cs-chat-panel {
  display: none;
  width: min(360px, calc(100vw - 32px));
  height: min(480px, calc(100vh - 100px));
  margin-bottom: 12px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  flex-direction: column;
  overflow: hidden;
  color: #0f172a; /* panel is always light — do not inherit dark-theme ink */
}
.cs-chat-root.is-open .cs-chat-panel {
  display: flex;
}
.cs-chat-head {
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--cs-brand-dark, #0c4a6e), var(--cs-brand, #0284c7));
  color: var(--cs-brand-ink, #fff);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.cs-chat-head strong {
  display: block;
  font-size: 14px;
}
.cs-chat-head small {
  opacity: 0.85;
  font-size: 11px;
}
.cs-chat-close {
  border: 0;
  background: color-mix(in srgb, currentColor 14%, transparent);
  color: var(--cs-brand-ink, #fff);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.cs-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cs-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.cs-bubble--bot {
  align-self: flex-start;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.cs-bubble--user {
  align-self: flex-end;
  background: var(--cs-brand, #0284c7);
  color: var(--cs-brand-ink, #fff);
  border-bottom-right-radius: 4px;
}
.cs-bubble--sys {
  align-self: center;
  font-size: 12px;
  color: #047857;
  background: #d1fae5;
  border-radius: 999px;
  padding: 6px 12px;
}
.cs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px;
  background: #f8fafc;
}
.cs-chip {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: #0f172a;
}
.cs-chip:hover {
  border-color: var(--cs-brand, #0284c7);
  color: var(--cs-brand-dark, #0c4a6e);
}
.cs-chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.cs-chat-input input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
}
.cs-chat-input input:focus {
  outline: none;
  border-color: var(--cs-brand, #0284c7);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}
.cs-chat-input button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  background: var(--cs-brand, #0284c7);
  color: var(--cs-brand-ink, #fff);
  cursor: pointer;
}
.cs-chat-foot {
  font-size: 10px;
  color: #64748b;
  text-align: center;
  padding: 4px 8px 8px;
  background: #fff;
}

/* Keep the chat bubble clear of the sticky Call / Request bar on phones */
@media (max-width: 899px) {
  .cs-chat-root {
    bottom: 78px;
  }
}
