/* RVL Chat Widget — on-brand with roguevalleyleads.com
   Navy #0C3054 / #08243F, blue #3C84C0, amber #FFA200 accent, ink #16202B.
   All classes are prefixed .rvl-chat- to avoid collisions with site CSS. */

.rvl-chat-root {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #16202b;
  z-index: 9999;
}
.rvl-chat-hidden { display: none !important; }

/* Floating launcher button */
.rvl-chat-button {
  position: fixed;
  left: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: #0c3054;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(8, 36, 63, 0.35);
}
.rvl-chat-button:hover { background: #12456f; }
.rvl-chat-button-icon { font-size: 18px; }

/* Panel */
.rvl-chat-panel {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8ee;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(8, 36, 63, 0.3);
  overflow: hidden;
}
.rvl-chat-header {
  position: relative;
  padding: 14px 44px 12px 16px;
  background: #0c3054;
  color: #fff;
}
.rvl-chat-title { font-size: 16px; font-weight: 700; }
.rvl-chat-disclosure {
  margin-top: 2px;
  font-size: 11.5px;
  color: #bcd3e6;
}
.rvl-chat-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.rvl-chat-close:hover { background: rgba(255, 255, 255, 0.15); }

.rvl-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f6f9fb;
}
.rvl-chat-msg { display: flex; margin-bottom: 10px; }
.rvl-chat-msg-user { justify-content: flex-end; }
.rvl-chat-bubble {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8ee;
  word-wrap: break-word;
}
.rvl-chat-msg-user .rvl-chat-bubble {
  background: #0c3054;
  color: #fff;
  border-color: #0c3054;
}
.rvl-chat-msg-user .rvl-chat-bubble a { color: #ffd98a; }
.rvl-chat-typing { color: #64707c; font-style: italic; }
.rvl-chat-cite { color: #3c84c0; font-weight: 600; }
.rvl-chat-msg-sources .rvl-chat-bubble { background: #eef4f9; border-color: #d6e4f0; }
.rvl-chat-sources-label { font-size: 12px; font-weight: 700; color: #46525f; margin-bottom: 4px; }
.rvl-chat-source {
  display: block;
  font-size: 12.5px;
  color: #3c84c0;
  margin: 2px 0;
}

.rvl-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e2e8ee;
  background: #fff;
}
.rvl-chat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e2e8ee;
  border-radius: 999px;
  font-size: 14px;
  outline: none;
}
.rvl-chat-input:focus { border-color: #3c84c0; }
.rvl-chat-send {
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: #ffa200;
  color: #1a1408;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.rvl-chat-send:hover { background: #ffb52e; }

/* Mobile: panel becomes a bottom sheet */
@media (max-width: 480px) {
  .rvl-chat-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: min(72dvh, 560px);
    max-height: none;
    border-radius: 16px 16px 0 0;
  }
  .rvl-chat-button-label { display: none; }
  .rvl-chat-button { padding: 14px 16px; }
}
