
/* Red Velvet Society LIVE AI Chat Support - cross-device safe v1.6.2 */
.rvs-ai-chat,
.rvs-ai-chat *,
.rvs-ai-chat *::before,
.rvs-ai-chat *::after{
  box-sizing:border-box;
}
.rvs-ai-chat{
  position:fixed !important;
  right:max(18px,env(safe-area-inset-right)) !important;
  bottom:max(18px,env(safe-area-inset-bottom)) !important;
  z-index:9999 !important;
  width:auto !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  text-align:left;
}
.rvs-ai-chat-toggle{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-width:58px;
  min-height:58px;
  max-width:calc(100vw - 24px);
  padding:0 18px 0 12px;
  border:1px solid rgba(242,207,135,.36);
  border-radius:999px;
  background:
    radial-gradient(circle at 20% 0%,rgba(242,207,135,.24),transparent 38%),
    linear-gradient(135deg,#120508,#6f0d22 58%,#150608);
  color:#fff4dd;
  cursor:pointer;
  box-shadow:0 18px 54px rgba(0,0,0,.38),0 0 48px rgba(158,23,50,.22);
  transition:transform .24s ease,box-shadow .24s ease,border-color .24s ease;
  -webkit-tap-highlight-color:transparent;
}
.rvs-ai-chat-toggle:hover,
.rvs-ai-chat.is-open .rvs-ai-chat-toggle{
  transform:translateY(-2px);
  border-color:rgba(242,207,135,.58);
  box-shadow:0 24px 70px rgba(0,0,0,.44),0 0 58px rgba(216,173,95,.18);
}
.rvs-ai-chat-toggle-icon{
  flex:0 0 auto;
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:linear-gradient(135deg,#f2cf87,#d8ad5f);
  color:#150608;
  font-weight:900;
}
.rvs-ai-chat-toggle-text{
  min-width:0;
  max-width:170px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11px;
  font-weight:900;
  letter-spacing:.13em;
  text-transform:uppercase;
}

/* Important: this must be a DIV in footer.php. Do not use SECTION because the theme has global full-bleed section rules. */
.rvs-ai-chat-panel{
  position:fixed !important;
  right:max(18px,env(safe-area-inset-right)) !important;
  bottom:calc(max(18px,env(safe-area-inset-bottom)) + 72px) !important;
  left:auto !important;
  width:min(390px,calc(100vw - 36px)) !important;
  max-width:calc(100vw - 36px) !important;
  height:auto !important;
  max-height:min(650px,calc(100dvh - 112px)) !important;
  min-height:0 !important;
  display:grid !important;
  grid-template-rows:auto minmax(120px,1fr) auto auto auto !important;
  overflow:hidden !important;
  border:1px solid rgba(242,207,135,.28);
  border-radius:26px;
  background:
    radial-gradient(circle at 10% 0%,rgba(242,207,135,.16),transparent 32%),
    linear-gradient(145deg,rgba(7,3,4,.98),rgba(22,5,9,.98));
  color:#fff8ec;
  box-shadow:0 34px 120px rgba(0,0,0,.52);
  opacity:0;
  visibility:hidden;
  transform:translateY(14px) scale(.98);
  transition:opacity .22s ease,visibility .22s ease,transform .22s ease;
  z-index:10000 !important;
}
.rvs-ai-chat.is-open .rvs-ai-chat-panel{
  opacity:1;
  visibility:visible;
  transform:translateY(0) scale(1);
}
.rvs-ai-chat-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  min-width:0;
  padding:18px 18px 14px;
  border-bottom:1px solid rgba(255,248,236,.11);
  background:linear-gradient(135deg,rgba(158,23,50,.28),rgba(255,255,255,.03));
}
.rvs-ai-chat-header > div{
  min-width:0;
}
.rvs-ai-chat-kicker{
  display:block;
  margin-bottom:5px;
  color:#f2cf87;
  font-size:9px;
  font-weight:900;
  letter-spacing:.24em;
  text-transform:uppercase;
  white-space:normal;
}
.rvs-ai-chat-header strong{
  display:block;
  max-width:100%;
  overflow-wrap:anywhere;
  font-family:Georgia,"Times New Roman",serif;
  font-size:24px;
  line-height:1;
  font-weight:400;
  letter-spacing:-.04em;
}
.rvs-ai-chat-close{
  flex:0 0 auto;
  width:34px;
  height:34px;
  border:1px solid rgba(255,248,236,.14);
  border-radius:999px;
  background:rgba(255,255,255,.04);
  color:#fff8ec;
  cursor:pointer;
  font-size:22px;
  line-height:1;
}
.rvs-ai-chat-messages{
  display:grid;
  align-content:start;
  gap:12px;
  min-height:0;
  padding:16px;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.rvs-ai-message{
  max-width:88%;
  min-width:0;
  padding:12px 13px;
  border-radius:18px;
  font-size:14px;
  line-height:1.55;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.rvs-ai-message span{
  display:block;
  margin-bottom:5px;
  font-size:9px;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.rvs-ai-message p{
  margin:0;
  white-space:normal;
}
.rvs-ai-message-bot{
  justify-self:start;
  border:1px solid rgba(242,207,135,.18);
  background:rgba(255,255,255,.055);
  color:rgba(255,248,236,.86);
}
.rvs-ai-message-bot span{color:#f2cf87}
.rvs-ai-message-user{
  justify-self:end;
  background:linear-gradient(135deg,#f2cf87,#d8ad5f);
  color:#150608;
}
.rvs-ai-message-user span{color:rgba(21,6,8,.68)}
.rvs-ai-chat-quick{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-width:0;
  padding:0 16px 14px;
  max-height:118px;
  overflow:auto;
}
.rvs-ai-chat-quick button{
  flex:0 1 auto;
  max-width:100%;
  min-height:34px;
  padding:0 12px;
  border:1px solid rgba(242,207,135,.22);
  border-radius:999px;
  background:rgba(255,255,255,.045);
  color:#f2cf87;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
  white-space:normal;
  line-height:1.2;
}
.rvs-ai-chat-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  min-width:0;
  padding:14px 16px 12px;
  border-top:1px solid rgba(255,248,236,.10);
}
.rvs-ai-chat-form input{
  min-width:0;
  width:100%;
  min-height:44px;
  border:1px solid rgba(242,207,135,.18);
  border-radius:999px;
  background:rgba(255,255,255,.08);
  color:#fff8ec;
  padding:0 14px;
  outline:none;
  font-size:16px;
}
.rvs-ai-chat-form input::placeholder{color:rgba(255,248,236,.46)}
.rvs-ai-chat-form button{
  min-height:44px;
  border:0;
  border-radius:999px;
  background:linear-gradient(135deg,#f2cf87,#d8ad5f);
  color:#150608;
  padding:0 16px;
  font-size:11px;
  font-weight:900;
  letter-spacing:.1em;
  text-transform:uppercase;
  cursor:pointer;
}
.rvs-ai-chat-note{
  margin:0;
  padding:0 16px 14px;
  color:rgba(255,248,236,.48);
  font-size:11px;
  line-height:1.45;
}

/* Tablet / iPad */
@media(max-width:1024px){
  .rvs-ai-chat-panel{
    width:min(380px,calc(100vw - 32px)) !important;
    max-width:calc(100vw - 32px) !important;
    right:16px !important;
    bottom:86px !important;
  }
}

/* Phones */
@media(max-width:620px){
  .rvs-ai-chat{
    right:max(12px,env(safe-area-inset-right)) !important;
    bottom:max(12px,env(safe-area-inset-bottom)) !important;
  }
  .rvs-ai-chat-toggle{
    width:56px;
    min-width:56px;
    height:56px;
    min-height:56px;
    padding:0;
  }
  .rvs-ai-chat-toggle-text{
    display:none;
  }
  .rvs-ai-chat-panel{
    left:12px !important;
    right:12px !important;
    bottom:76px !important;
    width:auto !important;
    max-width:none !important;
    max-height:calc(100dvh - 96px) !important;
    border-radius:22px;
  }
  .rvs-ai-chat-header{
    padding:15px 15px 12px;
  }
  .rvs-ai-chat-header strong{
    font-size:22px;
  }
  .rvs-ai-chat-messages{
    padding:14px;
  }
  .rvs-ai-message{
    max-width:94%;
    font-size:13px;
  }
  .rvs-ai-chat-quick{
    padding:0 14px 12px;
    max-height:112px;
  }
  .rvs-ai-chat-quick button{
    min-height:32px;
    font-size:9px;
    letter-spacing:.06em;
  }
  .rvs-ai-chat-form{
    grid-template-columns:1fr;
    padding:12px 14px 10px;
  }
  .rvs-ai-chat-form button{
    width:100%;
  }
  .rvs-ai-chat-note{
    padding:0 14px 12px;
  }
}

/* Very short screens */
@media(max-height:560px){
  .rvs-ai-chat-panel{
    max-height:calc(100dvh - 86px) !important;
  }
  .rvs-ai-chat-quick{
    max-height:84px;
  }
}

/* Browser compatibility fallback */
@supports not (height:100dvh){
  .rvs-ai-chat-panel{
    max-height:calc(100vh - 112px) !important;
  }
  @media(max-width:620px){
    .rvs-ai-chat-panel{
      max-height:calc(100vh - 96px) !important;
    }
  }
}

@media(prefers-reduced-motion:reduce){
  .rvs-ai-chat-toggle,
  .rvs-ai-chat-panel,
  .rvs-ai-chat-quick button{
    transition:none !important;
  }
}
