:root {
  --rf-forest: #0c1710;
  --rf-forest-soft: #142219;
  --rf-gold: #c9a764;
  --rf-gold-pale: #ead9ae;
  --rf-paper: #f5f1e8;
  --rf-ink: #22271f;
  --rf-muted: #686c64;
  --rf-line: rgba(26, 34, 26, .14);
}

.rf-launcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1045;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  padding: .42rem .92rem .42rem .42rem;
  border: 1px solid rgba(234, 217, 174, .58);
  border-radius: 999px;
  background: var(--rf-forest);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  text-align: left;
  transition: border-color .2s ease, background-color .2s ease;
}

.rf-launcher:hover,
.rf-launcher:focus-visible {
  border-color: var(--rf-gold-pale);
  background: #16231a;
  color: #fff;
}

.rf-launcher:focus-visible {
  outline: 2px solid var(--rf-gold-pale);
  outline-offset: 3px;
}

.rf-launcher__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--rf-gold);
  color: #111810;
  font-size: 1.1rem;
}

.rf-launcher__label {
  display: grid;
  line-height: 1.08;
}

.rf-launcher__label small {
  color: rgba(255, 255, 255, .58);
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.rf-launcher__label strong {
  margin-top: .16rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: .94rem;
}

.rf-dialog {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(440px, calc(100vw - 2rem));
  max-width: none;
  margin: 0;
}

.modal.fade .rf-dialog {
  transform: translateY(18px);
}

.modal.show .rf-dialog {
  transform: none;
}

.rf-content {
  max-height: min(760px, calc(100dvh - 2rem));
  overflow: hidden;
  border: 1px solid rgba(234, 217, 174, .28);
  border-radius: 1.8rem .35rem 1.8rem .35rem;
  background: var(--rf-paper);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

.rf-header {
  min-height: 92px;
  padding: 1rem 1.1rem;
  border: 0;
  border-bottom: 1px solid rgba(234, 217, 174, .2);
  background:
    radial-gradient(circle at 0 0, rgba(201, 167, 100, .18), transparent 15rem),
    var(--rf-forest);
  color: #fff;
}

.rf-identity {
  display: flex;
  align-items: center;
  gap: .78rem;
}

.rf-avatar,
.rf-message__avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(234, 217, 174, .42);
  border-radius: 50%;
  background: rgba(255, 255, 255, .045);
  color: var(--rf-gold-pale);
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
}

.rf-avatar {
  width: 52px;
  height: 52px;
  font-size: 1.35rem;
}

.rf-identity > span:last-child {
  display: grid;
}

.rf-status {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: .12rem;
  color: rgba(255, 255, 255, .58);
  font-size: .54rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.rf-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #72ba76;
}

.rf-identity strong {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.28rem;
  line-height: 1.05;
}

.rf-identity small {
  margin-top: .2rem;
  color: rgba(255, 255, 255, .66);
  font-size: .67rem;
}

.rf-header .btn-close {
  box-shadow: none;
  opacity: .72;
}

.rf-messages {
  min-height: 330px;
  height: min(430px, 50dvh);
  display: flex;
  flex-direction: column;
  gap: .9rem;
  overflow-y: auto;
  padding: 1.1rem;
  background:
    linear-gradient(rgba(245, 241, 232, .96), rgba(245, 241, 232, .96)),
    radial-gradient(circle at 20% 0, rgba(201, 167, 100, .18), transparent 15rem);
  scrollbar-width: thin;
  scrollbar-color: rgba(117, 99, 64, .42) transparent;
}

.rf-message {
  max-width: 89%;
  display: flex;
  align-items: flex-end;
  gap: .55rem;
}

.rf-message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.rf-message__avatar {
  width: 28px;
  height: 28px;
  border-color: rgba(106, 88, 53, .25);
  background: #ece5d7;
  color: #745f38;
  font-size: .72rem;
}

.rf-message--user .rf-message__avatar {
  border-color: var(--rf-forest);
  background: var(--rf-forest);
  color: var(--rf-gold-pale);
  font-family: inherit;
  font-style: normal;
  font-size: .48rem;
  font-weight: 850;
}

.rf-message__body {
  min-width: 0;
  padding: .82rem .92rem;
  border: 1px solid var(--rf-line);
  border-radius: .25rem 1.15rem 1.15rem 1.15rem;
  background: #fffdf8;
  color: var(--rf-ink);
}

.rf-message--user .rf-message__body {
  border-color: var(--rf-forest);
  border-radius: 1.15rem .25rem 1.15rem 1.15rem;
  background: var(--rf-forest);
  color: #fff;
}

.rf-message__body p {
  margin: 0;
  color: inherit;
  font-size: .84rem;
  line-height: 1.58;
  white-space: pre-line;
}

.rf-suggestions {
  display: grid;
  gap: .42rem;
  margin-top: .78rem;
  padding-top: .68rem;
  border-top: 1px solid var(--rf-line);
}

.rf-suggestions a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .48rem 0;
  color: #6e5934;
  font-size: .72rem;
  font-weight: 800;
  text-decoration: none;
}

.rf-suggestions a span {
  display: grid;
  gap: .08rem;
}

.rf-suggestions a small {
  color: var(--rf-muted);
  font-size: .52rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.rf-suggestions a:hover,
.rf-suggestions a:focus-visible {
  color: var(--rf-ink);
}

.rf-suggestions a:focus-visible,
.rf-quick button:focus-visible,
.rf-footer input:focus-visible,
.rf-footer button:focus-visible {
  outline: 2px solid var(--rf-gold);
  outline-offset: 2px;
}

.rf-quick {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  padding-left: 2.05rem;
}

.rf-quick button {
  padding: .48rem .68rem;
  border: 1px solid rgba(111, 91, 53, .25);
  border-radius: 999px;
  background: transparent;
  color: #66532f;
  font-size: .65rem;
  font-weight: 800;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.rf-quick button:hover {
  border-color: #826a3d;
  background: rgba(201, 167, 100, .09);
  color: var(--rf-ink);
}

.rf-message--typing .rf-message__body {
  display: flex;
  gap: .24rem;
  padding-block: 1rem;
}

.rf-message--typing .rf-message__body i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #907748;
  animation: rf-typing 1s infinite ease-in-out;
}

.rf-message--typing .rf-message__body i:nth-child(2) { animation-delay: .14s; }
.rf-message--typing .rf-message__body i:nth-child(3) { animation-delay: .28s; }

@keyframes rf-typing {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.rf-footer {
  display: block;
  padding: .8rem 1rem 1rem;
  border: 0;
  border-top: 1px solid var(--rf-line);
  background: #faf7f0;
}

.rf-footer > p {
  display: flex;
  align-items: flex-start;
  gap: .38rem;
  margin: 0 0 .65rem;
  color: #74766f;
  font-size: .61rem;
  line-height: 1.4;
}

.rf-footer > p i {
  color: #806a3e;
}

.rf-footer form {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: .55rem;
  padding: .28rem .3rem .28rem .82rem;
  border: 1px solid rgba(41, 47, 40, .18);
  border-radius: .35rem 1.3rem 1.3rem 1.3rem;
  background: #fff;
}

.rf-footer input {
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--rf-ink);
  font-size: .78rem;
}

.rf-footer input::placeholder {
  color: #8b8d86;
}

.rf-footer button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--rf-gold);
  color: #111810;
}

.rf-footer button:disabled,
.rf-footer input:disabled {
  cursor: wait;
  opacity: .58;
}

.rf-footer > small {
  display: block;
  margin-top: .55rem;
  color: #888a84;
  font-size: .55rem;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 575.98px) {
  .rf-launcher {
    min-width: 52px;
    min-height: 52px;
    padding: .3rem;
    border-radius: 50%;
  }

  .rf-launcher__icon {
    width: 44px;
    height: 44px;
  }

  .rf-launcher__label {
    display: none;
  }

  .rf-dialog {
    right: 0;
    bottom: 0;
    width: 100%;
  }

  .rf-content {
    max-height: calc(100dvh - .5rem);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 1.45rem 0 0 0;
  }

  .rf-messages {
    min-height: 300px;
    height: calc(100dvh - 270px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rf-launcher,
  .rf-dialog,
  .rf-quick button {
    transition: none;
  }

  .rf-message--typing .rf-message__body i {
    animation: none;
  }
}
