:root {
  --rpc-chat-primary: #4b0808;
  --rpc-chat-primary-dark: #310404;
  --rpc-chat-accent: #d5a84f;
  --rpc-chat-text: #252525;
  --rpc-chat-muted: #706767;
  --rpc-chat-surface: #ffffff;
  --rpc-chat-soft: #f7f3f1;
  --rpc-chat-border: rgba(75, 8, 8, 0.14);
  --rpc-chat-shadow: 0 18px 55px rgba(23, 10, 10, 0.24);
}

.rpc-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9998;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--rpc-chat-primary);
  color: #fff;
  box-shadow: var(--rpc-chat-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, background .2s ease;
}

.rpc-chat-launcher:hover,
.rpc-chat-launcher:focus-visible {
  transform: translateY(-3px);
  background: var(--rpc-chat-primary-dark);
}

.rpc-chat-launcher svg { width: 28px; height: 28px; }
.rpc-chat-launcher .rpc-chat-close-icon { display: none; }
.rpc-chat-launcher[aria-expanded="true"] .rpc-chat-open-icon { display: none; }
.rpc-chat-launcher[aria-expanded="true"] .rpc-chat-close-icon { display: block; }

.rpc-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 9999;
  width: min(390px, calc(100vw - 32px));
  height: min(650px, calc(100vh - 130px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rpc-chat-border);
  border-radius: 22px;
  background: var(--rpc-chat-surface);
  box-shadow: var(--rpc-chat-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.rpc-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.rpc-chat-header {
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--rpc-chat-primary), var(--rpc-chat-primary-dark));
}

.rpc-chat-brand { display: flex; align-items: center; gap: 12px; }
.rpc-chat-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--rpc-chat-primary);
  font-size: 22px;
  font-weight: 700;
}
.rpc-chat-title { margin: 0; color: #fff; font-size: 17px; font-weight: 700; }
.rpc-chat-status { margin: 2px 0 0; color: rgba(255,255,255,.82); font-size: 12px; }

.rpc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: linear-gradient(180deg, #fff, var(--rpc-chat-soft));
  scroll-behavior: smooth;
}

.rpc-chat-message { display: flex; margin-bottom: 14px; }
.rpc-chat-message.is-user { justify-content: flex-end; }
.rpc-chat-bubble {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  color: var(--rpc-chat-text);
  border: 1px solid var(--rpc-chat-border);
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-wrap;
}
.rpc-chat-message.is-user .rpc-chat-bubble {
  color: #fff;
  background: var(--rpc-chat-primary);
  border-color: var(--rpc-chat-primary);
  border-radius: 16px 16px 4px 16px;
}

.rpc-chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
}
.rpc-chat-chip {
  border: 1px solid rgba(75, 8, 8, .25);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--rpc-chat-primary);
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.rpc-chat-chip:hover { background: #f7eeee; }

.rpc-chat-typing {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 0 18px 10px;
  background: var(--rpc-chat-soft);
  color: var(--rpc-chat-muted);
  font-size: 12px;
}
.rpc-chat-typing.is-visible { display: flex; }
.rpc-chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: rpcChatPulse 1.1s infinite ease-in-out;
}
.rpc-chat-dot:nth-child(2) { animation-delay: .15s; }
.rpc-chat-dot:nth-child(3) { animation-delay: .3s; }
@keyframes rpcChatPulse { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.rpc-chat-form {
  display: flex;
  gap: 9px;
  padding: 14px;
  border-top: 1px solid var(--rpc-chat-border);
  background: #fff;
}
.rpc-chat-input {
  min-width: 0;
  flex: 1;
  border: 1px solid rgba(75,8,8,.2);
  border-radius: 999px;
  padding: 11px 14px;
  color: var(--rpc-chat-text);
  background: #fff;
  outline: none;
}
.rpc-chat-input:focus { border-color: var(--rpc-chat-primary); box-shadow: 0 0 0 3px rgba(75,8,8,.08); }
.rpc-chat-send {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--rpc-chat-primary);
  cursor: pointer;
}
.rpc-chat-send:disabled { opacity: .55; cursor: not-allowed; }
.rpc-chat-send svg { width: 20px; height: 20px; }
.rpc-chat-disclaimer {
  margin: 0;
  padding: 0 16px 12px;
  color: var(--rpc-chat-muted);
  background: #fff;
  text-align: center;
  font-size: 10px;
  line-height: 1.4;
}
.rpc-chat-disclaimer a { color: var(--rpc-chat-primary); font-weight: 700; }

@media (max-width: 575px) {
  .rpc-chat-launcher { right: 16px; bottom: 16px; }
  .rpc-chat-panel {
    right: 8px;
    bottom: 88px;
    width: calc(100vw - 16px);
    height: calc(100vh - 104px);
    border-radius: 18px;
  }
}

/* =========================================================
   RECREATE Ai Core — Reliant Production Interface
   ========================================================= */

/* Prevent the Reliant website theme from styling this section */
section#rpcChatPanel.rpc-chat-panel {
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Reliant branded header */
.rpc-chat-header {
  background: linear-gradient(135deg, #ed0000 0%, #820000 100%);
}

.rpc-chat-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rpc-chat-avatar {
  display: block;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  padding: 0;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #ffffff;
}

.rpc-chat-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
}

/* Production launcher */
#rpcChatLauncher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10001;

  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;

  width: 238px;
  height: 64px;
  padding: 7px 15px 7px 7px;

  box-sizing: border-box;
  overflow: hidden;
  border: 0;
  border-radius: 999px;

  background: linear-gradient(135deg, #ed0000 0%, #820000 100%);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(90, 0, 0, 0.30);

  cursor: pointer;
}

#rpcChatLauncher .rpc-chat-launcher-logo {
  display: block;
  width: 50px;
  height: 50px;
  min-width: 50px;
  flex: 0 0 50px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #ffffff;
}

#rpcChatLauncher .rpc-chat-launcher-text {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

#rpcChatLauncher .rpc-chat-open-icon {
  display: block;
  width: 23px;
  height: 23px;
  min-width: 23px;
  flex: 0 0 23px;
}

#rpcChatLauncher .rpc-chat-close-icon {
  display: none;
}

#rpcChatLauncher[aria-expanded="true"] {
  width: 64px;
  padding: 0;
  justify-content: center;
}

#rpcChatLauncher[aria-expanded="true"] .rpc-chat-launcher-logo,
#rpcChatLauncher[aria-expanded="true"] .rpc-chat-launcher-text,
#rpcChatLauncher[aria-expanded="true"] .rpc-chat-open-icon {
  display: none;
}

#rpcChatLauncher[aria-expanded="true"] .rpc-chat-close-icon {
  display: block;
  width: 26px;
  height: 26px;
}

/* RECREATE Ai Core footer */
.rpc-chat-powered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 0;
  padding: 6px 14px 9px;
  background: #ffffff;
  text-align: center;
}

.rpc-chat-powered-icon {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.rpc-chat-powered-label {
  color: #686868;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rpc-chat-powered-name {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
}

.rpc-chat-powered-name strong {
  color: #181818;
}

.rpc-chat-powered-name b {
  color: #4b9638;
}

@media (max-width: 575px) {
  #rpcChatLauncher {
    right: 12px;
    bottom: 12px;
    width: 214px;
    height: 58px;
    gap: 8px;
    padding: 6px 13px 6px 6px;
  }

  #rpcChatLauncher .rpc-chat-launcher-logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex-basis: 44px;
  }

  #rpcChatLauncher .rpc-chat-launcher-text {
    font-size: 14px;
  }

  #rpcChatLauncher[aria-expanded="true"] {
    width: 58px;
  }
}
