/* "Ask anything" marketing chat widget.
   Reuses the landing page's design tokens (--accent, --bg, --text, …) defined
   on :root in index.html, so it stays on-brand without redefining colours. */

.rmv-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(60, 40, 20, 0.18);
  transition: background 0.15s ease, transform 0.15s ease;
}

.rmv-chat-launcher:hover { background: var(--accent-dark); }
.rmv-chat-launcher:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }
.rmv-chat-launcher[hidden] { display: none; }
.rmv-chat-launcher .rmv-chat-launcher-icon { font-size: 1.1rem; line-height: 1; }

/* Inline opener used near the hero CTA — a quiet, link-like prompt. */
.rmv-chat-inline {
  display: inline-block;
  margin-top: 14px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-dark);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.rmv-chat-inline:hover { color: var(--accent); }
.rmv-chat-inline:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }

.rmv-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 32px);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(60, 40, 20, 0.22);
  overflow: hidden;
}
.rmv-chat-panel[hidden] { display: none; }

.rmv-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.rmv-chat-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.rmv-chat-subtitle { font-size: 0.8rem; color: var(--text-muted); }

.rmv-chat-close {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.rmv-chat-close:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }
.rmv-chat-close:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }

.rmv-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

.rmv-chat-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.rmv-chat-msg-assistant {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.rmv-chat-msg-assistant a {
  color: var(--accent-dark);
  text-decoration: underline;
}
.rmv-chat-msg-assistant a:hover { color: var(--accent); }
.rmv-chat-msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.rmv-chat-msg-error {
  align-self: center;
  background: #fbeaea;
  border: 1px solid #f0c9c9;
  color: #8a2a2a;
  font-size: 0.85rem;
  max-width: 100%;
}

/* Suggested starter questions. */
.rmv-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rmv-chat-chip {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}
.rmv-chat-chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.rmv-chat-chip:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }

/* Typing indicator. */
.rmv-chat-typing { display: inline-flex; gap: 4px; align-items: center; }
.rmv-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: rmv-chat-bounce 1.2s infinite ease-in-out;
}
.rmv-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.rmv-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes rmv-chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .rmv-chat-typing span { animation: none; }
}

.rmv-chat-footer { border-top: 1px solid var(--border); background: var(--white); }

.rmv-chat-form { display: flex; gap: 8px; padding: 10px 12px; align-items: flex-end; }
.rmv-chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--text);
  max-height: 120px;
}
.rmv-chat-input:focus-visible { outline: none; border-color: var(--accent); }

.rmv-chat-send {
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: var(--white);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
}
.rmv-chat-send:hover:not(:disabled) { background: var(--accent-dark); }
.rmv-chat-send:disabled { opacity: 0.5; cursor: default; }
.rmv-chat-send:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }

.rmv-chat-notice {
  padding: 0 14px 12px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
}
.rmv-chat-notice a { color: var(--text-muted); text-decoration: underline; }

@media (max-width: 480px) {
  .rmv-chat-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 16px); }
}
