/* RBS product advisor chat widget.
   The panel is a flex column so the log takes all the leftover height:
   fixing the log's height instead leaves the panel short on tall screens. */

.rbs-adv-btn {
  position: fixed; bottom: 64px; right: 18px; z-index: 998;
  background: #aa1122; color: #fff; border: 0; border-radius: 50px;
  padding: 12px 18px; font-weight: 700; font-size: .95rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.rbs-adv-btn[hidden] { display: none; }

.rbs-adv-panel {
  position: fixed; bottom: 64px; right: 18px; z-index: 999;
  display: flex; flex-direction: column;
  width: min(400px, 92vw);
  height: min(80vh, 780px);
  background: #fff; border: 1px solid #ddd; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25); overflow: hidden;
}
.rbs-adv-panel[hidden] { display: none; }

.rbs-adv-head {
  flex: 0 0 auto; background: #1d1f21; color: #fff; padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.rbs-adv-close {
  background: none; border: 0; color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.rbs-adv-log {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 12px; font-size: .92rem; background: #fafafa;
  overscroll-behavior: contain;
}
.rbs-adv-bubble {
  border-radius: 8px; padding: 8px 10px; margin-bottom: 8px;
  white-space: pre-wrap; background: #eee; margin-right: 1rem;
}
.rbs-adv-bubble.me { background: #aa1122; color: #fff; margin-left: 2rem; margin-right: 0; }
.rbs-adv-links { margin: -4px 0 8px; font-size: .88rem; }
.rbs-adv-links a {
  display: block; color: #aa1122; font-weight: 600;
  text-decoration: none; margin-bottom: 3px;
}
.rbs-adv-links a:hover, .rbs-adv-links a:focus { text-decoration: underline; }
.rbs-adv-form { flex: 0 0 auto; display: flex; border-top: 1px solid #eee; }
.rbs-adv-form input {
  flex: 1; border: 0; padding: 12px; font-size: .95rem; outline: none;
  min-width: 0; border-radius: 0;
}
.rbs-adv-form button {
  border: 0; background: #aa1122; color: #fff; padding: 0 18px;
  font-weight: 700; cursor: pointer;
}
.rbs-adv-form button[disabled] { opacity: .6; cursor: default; }

/* Clear the sticky mobile call/quote bar, and use the room a phone has. */
@media (max-width: 767px) {
  .rbs-adv-panel { bottom: 72px; height: min(80vh, 640px); width: min(400px, 94vw); right: 3vw; }
  .rbs-adv-btn { bottom: 72px; }
}

/* The input drops its own outline (it sits flush in the form), so show focus on the form. */
.rbs-adv-form:focus-within { box-shadow: inset 0 0 0 2px #aa1122; }
.rbs-adv-btn:focus-visible, .rbs-adv-close:focus-visible, #rbs-adv-send:focus-visible { outline: 2px solid #1d1f21; outline-offset: 2px; }
