/* 4029 Rainier FAQ chat assistant widget. Uses the site theme variables. */
.r4chat-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 9998;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--green, #2f5d3a); color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background .15s ease;
}
.r4chat-launch:hover { background: var(--green-dark, #1f3f27); transform: translateY(-2px); }
.r4chat-launch.r4chat-hidden { display: none; }

.r4chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 9999;
  width: 370px; max-width: calc(100vw - 32px);
  height: 540px; max-height: calc(100vh - 100px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
  font-family: inherit;
}
/* The display:flex above otherwise overrides the [hidden] attribute, so close/Esc wouldn't hide it. */
.r4chat-panel[hidden] { display: none; }

.r4chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; background: var(--green, #2f5d3a); color: #fff;
}
.r4chat-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.r4chat-sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.r4chat-close {
  background: transparent; border: 0; color: #fff; font-size: 26px; line-height: 1;
  cursor: pointer; padding: 0 4px; opacity: .9;
}
.r4chat-close:hover { opacity: 1; }

.r4chat-log {
  flex: 1; overflow-y: auto; padding: 14px;
  background: var(--cream, #f7f5ef);
  display: flex; flex-direction: column; gap: 10px;
}

.r4chat-msg {
  max-width: 85%; padding: 9px 12px; border-radius: 14px;
  font-size: 14px; line-height: 1.45; word-wrap: break-word;
}
.r4chat-msg p { margin: 0 0 6px; } .r4chat-msg p:last-child { margin-bottom: 0; }
.r4chat-msg ul { margin: 4px 0 0; padding-left: 18px; } .r4chat-msg li { margin: 2px 0; }
.r4chat-bot {
  align-self: flex-start; background: #fff; color: var(--text, #2b2b28);
  border: 1px solid #e7e3d8; border-bottom-left-radius: 4px;
}
.r4chat-bot a { color: var(--green, #2f5d3a); font-weight: 600; }
.r4chat-user {
  align-self: flex-end; background: var(--green, #2f5d3a); color: #fff;
  border-bottom-right-radius: 4px; white-space: pre-wrap;
}

.r4chat-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.r4chat-chip {
  background: #fff; color: var(--green, #2f5d3a); cursor: pointer;
  border: 1px solid var(--green, #2f5d3a); border-radius: 999px;
  padding: 7px 12px; font-size: 12.5px; line-height: 1.2; text-align: left;
}
.r4chat-chip:hover { background: var(--green, #2f5d3a); color: #fff; }

.r4chat-typing { display: inline-flex; gap: 4px; align-items: center; }
.r4chat-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: #aaa; display: inline-block;
  animation: r4chatblink 1.2s infinite both;
}
.r4chat-typing i:nth-child(2) { animation-delay: .2s; }
.r4chat-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes r4chatblink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.r4chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #ececec; background: #fff; }
.r4chat-input {
  flex: 1; border: 1px solid #ccc; border-radius: 22px; padding: 10px 14px;
  font-size: 14px; font-family: inherit; outline: none;
}
.r4chat-input:focus { border-color: var(--green, #2f5d3a); }
.r4chat-send {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--green, #2f5d3a); color: #fff; display: flex; align-items: center; justify-content: center;
}
.r4chat-send:hover { background: var(--green-dark, #1f3f27); }

@media (max-width: 480px) {
  .r4chat-panel {
    right: 0; bottom: 0; width: 100vw; max-width: 100vw;
    height: 100dvh; max-height: 100dvh; border-radius: 0;
  }
  .r4chat-launch { right: 16px; bottom: 16px; }
}
