/* =========================================================
   RAINBOW COLORS AI — PREVIEW-ONLY CHAT ASSISTANT
   Scoped styles. Every selector is namespaced with .rc-ai-.
========================================================= */

.rc-ai-root {
  --rcai-red: #dc2626;
  --rcai-red-dark: #991b1b;
  --rcai-red-deep: #7f1d1d;
  --rcai-red-soft: #fef2f2;
  --rcai-red-border: #fecaca;
  --rcai-ink: #1f2937;
  --rcai-muted: #6b7280;
  --rcai-soft-muted: #9ca3af;
  --rcai-line: #e5e7eb;
  --rcai-surface: #ffffff;
  --rcai-canvas: #f8fafc;
  --rcai-bottom: 100px;
  --rcai-ease: cubic-bezier(.2, .8, .2, 1);
  color: var(--rcai-ink);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.rc-ai-root,
.rc-ai-root *,
.rc-ai-root *::before,
.rc-ai-root *::after {
  box-sizing: border-box;
}

.rc-ai-root button,
.rc-ai-root textarea,
.rc-ai-root a {
  font: inherit;
}

.rc-ai-root button {
  -webkit-tap-highlight-color: transparent;
}

.rc-ai-root svg {
  display: block;
  flex: 0 0 auto;
}

/* ---------- Launcher ---------- */
.rc-ai-launcher {
  position: fixed;
  right: 24px;
  bottom: calc(var(--rcai-bottom) + env(safe-area-inset-bottom, 0px));
  z-index: 1450;
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: calc(100vw - 32px);
  padding: 8px 16px 8px 8px;
  border: 1px solid rgba(220, 38, 38, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .98);
  color: var(--rcai-ink);
  box-shadow:
    0 16px 46px rgba(15, 23, 42, .18),
    0 2px 8px rgba(15, 23, 42, .07);
  cursor: pointer;
  text-align: left;
  transition:
    transform .25s var(--rcai-ease),
    box-shadow .25s var(--rcai-ease),
    opacity .2s ease,
    visibility .2s ease;
}

.rc-ai-launcher:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 54px rgba(15, 23, 42, .22),
    0 3px 10px rgba(15, 23, 42, .08);
}

.rc-ai-launcher:focus-visible {
  outline: 3px solid rgba(220, 38, 38, .38);
  outline-offset: 4px;
}

.rc-ai-launcher__icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ef4444 0%, var(--rcai-red) 52%, var(--rcai-red-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(220, 38, 38, .3);
}

.rc-ai-launcher__icon::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 50%;
  pointer-events: none;
}

.rc-ai-launcher__icon svg {
  width: 23px;
  height: 23px;
}

.rc-ai-launcher__copy {
  display: block;
  min-width: 0;
}

.rc-ai-launcher__name {
  display: block;
  overflow: hidden;
  color: var(--rcai-red-dark);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-ai-launcher__hint {
  display: block;
  color: var(--rcai-muted);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}

.rc-ai-root.is-open .rc-ai-launcher {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(.96);
}

/* ---------- Panel ---------- */
.rc-ai-panel {
  position: fixed;
  right: 24px;
  bottom: calc(var(--rcai-bottom) + env(safe-area-inset-bottom, 0px));
  z-index: 1460;
  display: flex;
  flex-direction: column;
  width: min(410px, calc(100vw - 32px));
  height: 620px;
  height: min(620px, calc(100dvh - 200px - env(safe-area-inset-bottom, 0px)));
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 24px;
  background: var(--rcai-surface);
  box-shadow:
    0 32px 90px rgba(15, 23, 42, .28),
    0 4px 18px rgba(15, 23, 42, .12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(.975);
  transform-origin: bottom right;
  transition:
    opacity .22s ease,
    visibility .22s ease,
    transform .3s var(--rcai-ease),
    height .25s var(--rcai-ease);
}

.rc-ai-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.rc-ai-panel.is-minimized {
  width: min(370px, calc(100vw - 28px));
  height: auto;
}

.rc-ai-panel.is-minimized .rc-ai-demo-note,
.rc-ai-panel.is-minimized .rc-ai-messages,
.rc-ai-panel.is-minimized .rc-ai-composer-wrap {
  display: none;
}

.rc-ai-panel:focus {
  outline: none;
}

/* ---------- Header ---------- */
.rc-ai-header {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 14px 14px 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 8%, rgba(255, 255, 255, .22) 0, rgba(255, 255, 255, 0) 32%),
    linear-gradient(135deg, var(--rcai-red-deep) 0%, #b91c1c 48%, var(--rcai-red) 100%);
  color: #fff;
}

.rc-ai-panel.is-minimized .rc-ai-header {
  border-radius: 23px;
}

.rc-ai-header::after {
  content: '';
  position: absolute;
  right: -34px;
  bottom: -56px;
  width: 138px;
  height: 138px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  pointer-events: none;
}

.rc-ai-identity {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.rc-ai-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .05);
  backdrop-filter: blur(8px);
}

.rc-ai-avatar svg {
  width: 22px;
  height: 22px;
}

.rc-ai-title-wrap {
  min-width: 0;
}

.rc-ai-title {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-ai-subtitle {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, .8);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
}

.rc-ai-header-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.rc-ai-demo-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .92);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rc-ai-icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.rc-ai-icon-button:hover {
  background: rgba(255, 255, 255, .22);
  transform: translateY(-1px);
}

.rc-ai-icon-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.rc-ai-icon-button svg {
  width: 15px;
  height: 15px;
}

.rc-ai-minimize svg {
  transition: transform .25s var(--rcai-ease);
}

.rc-ai-panel.is-minimized .rc-ai-minimize svg {
  transform: rotate(180deg);
}

/* ---------- Demo strip ---------- */
.rc-ai-demo-note {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-bottom: 1px solid #fee2e2;
  background: var(--rcai-red-soft);
  color: #9f1239;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
}

.rc-ai-demo-note svg {
  width: 12px;
  height: 12px;
}

/* ---------- Messages ---------- */
.rc-ai-messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 14px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 8% 0%, rgba(220, 38, 38, .04) 0, rgba(220, 38, 38, 0) 34%),
    var(--rcai-canvas);
  overscroll-behavior: contain;
  scrollbar-color: #d1d5db transparent;
  scrollbar-width: thin;
}

.rc-ai-messages::-webkit-scrollbar {
  width: 6px;
}

.rc-ai-messages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d1d5db;
}

.rc-ai-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 12px;
}

.rc-ai-message--bot {
  align-items: flex-start;
}

.rc-ai-message--user {
  align-items: flex-end;
  justify-content: flex-end;
}

.rc-ai-message__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  margin-top: 2px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ef4444, var(--rcai-red-dark));
  color: #fff;
  box-shadow: 0 4px 10px rgba(220, 38, 38, .2);
}

.rc-ai-message__avatar svg {
  width: 13px;
  height: 13px;
}

.rc-ai-message__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  max-width: calc(100% - 33px);
  min-width: 0;
}

.rc-ai-message--user .rc-ai-message__content {
  align-items: flex-end;
  max-width: 84%;
}

.rc-ai-bubble {
  max-width: 100%;
  padding: 10px 13px;
  border: 1px solid #e8ebef;
  border-radius: 15px 15px 15px 4px;
  background: #fff;
  color: var(--rcai-ink);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .04);
  font-size: 12.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.rc-ai-bubble p {
  margin: 0;
  unicode-bidi: plaintext;
}

.rc-ai-bubble p + p {
  margin-top: 7px;
}

.rc-ai-message--user .rc-ai-bubble {
  border-color: var(--rcai-red);
  border-radius: 15px 15px 4px 15px;
  background: linear-gradient(145deg, #ef4444, var(--rcai-red));
  color: #fff;
  box-shadow: 0 5px 14px rgba(220, 38, 38, .2);
}

.rc-ai-bubble strong {
  font-weight: 800;
}

.rc-ai-bubble .rc-ai-muted-line {
  margin-top: 7px;
  color: var(--rcai-muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.rc-ai-welcome .rc-ai-bubble {
  padding: 12px 14px;
}

.rc-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
  max-width: 100%;
  padding: 1px 0 2px;
}

.rc-ai-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--rcai-red-border);
  border-radius: 999px;
  background: #fff;
  color: var(--rcai-red-dark);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.rc-ai-chip:hover {
  border-color: #fca5a5;
  background: #fff5f5;
  transform: translateY(-1px);
}

.rc-ai-chip:focus-visible {
  outline: 2px solid rgba(220, 38, 38, .42);
  outline-offset: 2px;
}

.rc-ai-chip--soft {
  border-color: #e5e7eb;
  color: #4b5563;
}

.rc-ai-chip--soft:hover {
  border-color: #fca5a5;
  color: var(--rcai-red-dark);
}

/* ---------- Product cards ---------- */
.rc-ai-products {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.rc-ai-product {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .035);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.rc-ai-product:hover {
  border-color: #fca5a5;
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(15, 23, 42, .08);
}

.rc-ai-product:focus-visible {
  outline: 2px solid rgba(220, 38, 38, .42);
  outline-offset: 2px;
}

.rc-ai-product__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 66px;
  overflow: hidden;
  border-radius: 10px;
  background: #f3f4f6;
}

.rc-ai-product__media img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
}

.rc-ai-product__media.is-missing::after {
  content: 'RC';
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}

.rc-ai-product__media.is-missing img {
  display: none;
}

.rc-ai-product__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rc-ai-product__category {
  overflow: hidden;
  color: var(--rcai-red-dark);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .07em;
  line-height: 1.3;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.rc-ai-product__name {
  display: -webkit-box;
  overflow: hidden;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.rc-ai-product__desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--rcai-muted);
  font-size: 10px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.rc-ai-product__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--rcai-red-dark);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.rc-ai-product__link svg {
  width: 10px;
  height: 10px;
}

.rc-ai-catalogue-note {
  margin: 1px 0 0;
  color: var(--rcai-soft-muted);
  font-size: 9.5px;
  line-height: 1.4;
}

/* ---------- Typing ---------- */
.rc-ai-typing-message {
  display: none;
}

.rc-ai-typing-message.is-visible {
  display: flex;
}

.rc-ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  padding: 1px 2px;
}

.rc-ai-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b91c1c;
  opacity: .35;
  animation: rcAiTyping 1.1s ease-in-out infinite;
}

.rc-ai-typing span:nth-child(2) { animation-delay: .14s; }
.rc-ai-typing span:nth-child(3) { animation-delay: .28s; }

@keyframes rcAiTyping {
  0%, 70%, 100% { opacity: .3; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- Composer ---------- */
.rc-ai-composer-wrap {
  flex: 0 0 auto;
  padding: 10px 12px 8px;
  border-top: 1px solid #eef0f3;
  background: #fff;
}

.rc-ai-composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 5px 5px 5px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .025);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.rc-ai-composer:focus-within {
  border-color: #fca5a5;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .08);
}

.rc-ai-input {
  flex: 1 1 auto;
  width: 100%;
  min-height: 34px;
  max-height: 88px;
  padding: 7px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--rcai-ink);
  font-size: 12.5px;
  line-height: 1.4;
  resize: none;
  scrollbar-width: thin;
}

.rc-ai-input::placeholder {
  color: #9ca3af;
}

.rc-ai-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #ef4444, var(--rcai-red-dark));
  color: #fff;
  box-shadow: 0 5px 12px rgba(220, 38, 38, .22);
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.rc-ai-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(220, 38, 38, .28);
}

.rc-ai-send:disabled {
  cursor: default;
  opacity: .5;
  transform: none;
  box-shadow: none;
}

.rc-ai-send:focus-visible {
  outline: 2px solid rgba(220, 38, 38, .42);
  outline-offset: 2px;
}

.rc-ai-send svg {
  width: 16px;
  height: 16px;
}

.rc-ai-privacy {
  margin: 6px 0 0;
  color: #a1a7b3;
  font-size: 9px;
  line-height: 1.35;
  text-align: center;
}

.rc-ai-privacy svg {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 2px;
  vertical-align: -1px;
}

/* ---------- Structured answer blocks ---------- */
.rc-ai-bubble .rc-ai-answer__title {
  margin: 10px 0 4px;
  color: var(--rcai-red-dark) !important;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.35;
}

.rc-ai-bubble .rc-ai-answer__title:first-child {
  margin-top: 0;
}

.rc-ai-bubble .rc-ai-answer__list {
  margin: 4px 0 8px !important;
  padding-inline-start: 18px !important;
  list-style: disc !important;
}

.rc-ai-bubble .rc-ai-answer__list--ordered {
  list-style: decimal !important;
}

.rc-ai-bubble .rc-ai-answer__list li {
  margin: 0 0 3px;
  color: var(--rcai-ink) !important;
  font-size: 12.5px;
  line-height: 1.5;
  unicode-bidi: plaintext;
}

.rc-ai-bubble .rc-ai-answer__list li:last-child {
  margin-bottom: 0;
}

.rc-ai-bubble .rc-ai-answer__note {
  margin: 8px 0 0;
  padding: 6px 8px;
  border-inline-start: 3px solid var(--rcai-red-border);
  border-radius: 8px;
  background: #fff7f7;
  color: #9f1239 !important;
  font-size: 10.5px;
  line-height: 1.4;
}

.rc-ai-bubble .rc-ai-answer__note + .rc-ai-answer__title {
  margin-top: 10px;
}


/* ---------- Preview-only floating Rainbow Colors logo ---------- */
.rc-preview-logo-button {
  position: fixed;
  left: 18px;
  bottom: 84px;
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(201, 164, 76, .72);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .18), 0 0 0 1px rgba(201, 164, 76, .12);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.rc-preview-logo-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .22), 0 0 0 1px rgba(201, 164, 76, .18);
}

.rc-preview-logo-button:focus-visible {
  outline: 2px solid rgba(220, 38, 38, .42);
  outline-offset: 3px;
}

.rc-preview-logo-button__logo {
  width: auto;
  height: 24px;
  max-width: 42px;
  object-fit: contain;
  object-position: center;
  background: transparent;
  border: 0;
  padding: 0;
}

@media (max-width: 640px) {
  .rc-preview-logo-button {
    left: 14px;
    bottom: 76px;
    width: 52px;
    height: 52px;
  }

  .rc-preview-logo-button__logo {
    height: 20px;
    max-width: 36px;
  }
}

/* ---------- Legacy storefront theme guard ----------
   style.css still contains broad `button`, `input`, `textarea`, `h2`
   and `p` rules with !important. They are intended for the storefront,
   not the assistant. These scoped declarations keep the assistant's
   own red/white palette without changing any storefront element.
--------------------------------------------------------- */
.rc-ai-root button.rc-ai-launcher {
  border: 1px solid rgba(220, 38, 38, .18) !important;
  background: rgba(255, 255, 255, .98) !important;
  color: var(--rcai-ink) !important;
  box-shadow:
    0 16px 46px rgba(15, 23, 42, .18),
    0 2px 8px rgba(15, 23, 42, .07) !important;
}

.rc-ai-root button.rc-ai-launcher:hover {
  border-color: rgba(220, 38, 38, .28) !important;
  background: #fff !important;
  color: var(--rcai-ink) !important;
  box-shadow:
    0 20px 54px rgba(15, 23, 42, .22),
    0 3px 10px rgba(15, 23, 42, .08) !important;
}

.rc-ai-root button.rc-ai-icon-button {
  border: 1px solid rgba(255, 255, 255, .18) !important;
  background: rgba(255, 255, 255, .1) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.rc-ai-root button.rc-ai-icon-button:hover {
  border-color: rgba(255, 255, 255, .3) !important;
  background: rgba(255, 255, 255, .22) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.rc-ai-root button.rc-ai-chip {
  border: 1px solid var(--rcai-red-border) !important;
  background: #fff !important;
  color: var(--rcai-red-dark) !important;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .035) !important;
}

.rc-ai-root button.rc-ai-chip:hover {
  border-color: #fca5a5 !important;
  background: #fff5f5 !important;
  color: var(--rcai-red-dark) !important;
  box-shadow: 0 3px 8px rgba(220, 38, 38, .08) !important;
}

.rc-ai-root button.rc-ai-chip.rc-ai-chip--soft {
  border-color: #e5e7eb !important;
  color: #4b5563 !important;
}

.rc-ai-root button.rc-ai-chip.rc-ai-chip--soft:hover {
  border-color: #fca5a5 !important;
  color: var(--rcai-red-dark) !important;
}

.rc-ai-root button.rc-ai-send {
  border: 1px solid transparent !important;
  background: linear-gradient(145deg, #ef4444, var(--rcai-red-dark)) !important;
  color: #fff !important;
  box-shadow: 0 5px 12px rgba(220, 38, 38, .22) !important;
}

.rc-ai-root button.rc-ai-send:hover {
  border-color: transparent !important;
  background: linear-gradient(145deg, #dc2626, #7f1d1d) !important;
  color: #fff !important;
  box-shadow: 0 7px 16px rgba(220, 38, 38, .28) !important;
}

.rc-ai-root button.rc-ai-send:disabled {
  background: linear-gradient(145deg, #ef4444, var(--rcai-red-dark)) !important;
  color: #fff !important;
  box-shadow: none !important;
  opacity: .5;
}

.rc-ai-root textarea.rc-ai-input {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--rcai-ink) !important;
  box-shadow: none !important;
}

.rc-ai-root textarea.rc-ai-input:focus,
.rc-ai-root textarea.rc-ai-input:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--rcai-ink) !important;
  box-shadow: none !important;
}

.rc-ai-root textarea.rc-ai-input::placeholder {
  color: #9ca3af !important;
}

.rc-ai-root .rc-ai-header .rc-ai-title {
  color: #fff !important;
}

.rc-ai-root .rc-ai-header .rc-ai-subtitle {
  color: rgba(255, 255, 255, .82) !important;
}

.rc-ai-root .rc-ai-bubble {
  background: #fff !important;
  color: var(--rcai-ink) !important;
}

.rc-ai-root .rc-ai-message--user .rc-ai-bubble {
  background: linear-gradient(145deg, #ef4444, var(--rcai-red)) !important;
  color: #fff !important;
}

.rc-ai-root .rc-ai-bubble p {
  color: inherit !important;
}

.rc-ai-root .rc-ai-bubble .rc-ai-answer__title {
  color: var(--rcai-red-dark) !important;
}

.rc-ai-root .rc-ai-bubble .rc-ai-answer__list {
  list-style: disc !important;
  padding-inline-start: 18px !important;
}

.rc-ai-root .rc-ai-bubble .rc-ai-answer__list--ordered {
  list-style: decimal !important;
}

.rc-ai-root .rc-ai-bubble .rc-ai-answer__list li {
  color: var(--rcai-ink) !important;
}

.rc-ai-root .rc-ai-bubble .rc-ai-answer__note {
  color: #9f1239 !important;
}

.rc-ai-root .rc-ai-bubble .rc-ai-muted-line {
  color: var(--rcai-muted) !important;
}

.rc-ai-root .rc-ai-catalogue-note {
  color: var(--rcai-soft-muted) !important;
}

.rc-ai-root .rc-ai-privacy {
  color: #a1a7b3 !important;
}

.rc-ai-root .rc-ai-product {
  background: #fff !important;
  color: var(--rcai-ink) !important;
}

.rc-ai-root .rc-ai-product:hover {
  background: #fff !important;
  color: var(--rcai-ink) !important;
}

/* ---------- Accessibility helper ---------- */
.rc-ai-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .rc-ai-root {
    --rcai-bottom: 94px;
  }

  .rc-ai-launcher {
    right: 14px;
  }

  .rc-ai-panel {
    right: 12px;
    left: 12px;
    width: auto;
    height: 620px;
    height: min(620px, calc(100dvh - 190px - env(safe-area-inset-bottom, 0px)));
    border-radius: 22px;
  }

  .rc-ai-panel.is-minimized {
    right: 14px;
    left: auto;
    width: min(360px, calc(100vw - 28px));
  }

  .rc-ai-header {
    padding: 14px 12px 13px 14px;
  }

  .rc-ai-messages {
    padding: 14px 12px 10px;
  }

  .rc-ai-composer-wrap {
    padding: 9px 10px 8px;
  }
}

@media (max-width: 480px) {
  .rc-ai-root {
    --rcai-bottom: 92px;
  }

  .rc-ai-launcher {
    right: 14px;
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .rc-ai-launcher__icon {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    background: transparent;
    box-shadow: none;
  }

  .rc-ai-launcher__icon::after {
    inset: 7px;
  }

  .rc-ai-launcher__copy {
    display: none;
  }

  /* On phones the launcher becomes a red circular button. */
  .rc-ai-root button.rc-ai-launcher {
    border-color: rgba(255, 255, 255, .3) !important;
    background: linear-gradient(145deg, #ef4444, var(--rcai-red-dark)) !important;
    color: #fff !important;
    box-shadow:
      0 12px 28px rgba(220, 38, 38, .3),
      0 3px 8px rgba(15, 23, 42, .12) !important;
  }

  .rc-ai-root button.rc-ai-launcher:hover {
    border-color: rgba(255, 255, 255, .3) !important;
    background: linear-gradient(145deg, #ef4444, var(--rcai-red-dark)) !important;
    color: #fff !important;
    box-shadow:
      0 14px 32px rgba(220, 38, 38, .34),
      0 4px 10px rgba(15, 23, 42, .14) !important;
  }

  .rc-ai-panel {
    right: 8px;
    left: 8px;
    height: min(640px, calc(100dvh - 200px - env(safe-area-inset-bottom, 0px)));
    border-radius: 20px;
  }

  .rc-ai-panel.is-minimized {
    right: 10px;
    left: auto;
    width: min(340px, calc(100vw - 20px));
  }

  .rc-ai-header {
    gap: 8px;
    padding: 13px 11px 12px 13px;
  }

  .rc-ai-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .rc-ai-title {
    font-size: 14px;
  }

  .rc-ai-subtitle {
    font-size: 9.8px;
  }

  .rc-ai-demo-pill {
    display: none;
  }

  .rc-ai-icon-button {
    width: 30px;
    height: 30px;
  }

  .rc-ai-demo-note {
    padding: 6px 13px;
    font-size: 9.5px;
  }

  .rc-ai-messages {
    padding: 13px 10px 9px;
  }

  .rc-ai-message__content {
    max-width: calc(100% - 31px);
  }

  .rc-ai-message--user .rc-ai-message__content {
    max-width: 88%;
  }

  .rc-ai-bubble {
    padding: 9px 11px;
    font-size: 12px;
  }

  .rc-ai-product {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .rc-ai-product__media {
    width: 52px;
    height: 62px;
  }

  .rc-ai-composer-wrap {
    padding: 8px 8px 7px;
  }

  .rc-ai-privacy {
    font-size: 8.5px;
  }
}

/* Keep the page usable while the mobile navigation drawer is open. */
body.mobile-menu-open .rc-ai-root {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Reduced motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  .rc-ai-launcher,
  .rc-ai-panel,
  .rc-ai-icon-button,
  .rc-ai-minimize svg,
  .rc-ai-chip,
  .rc-ai-product,
  .rc-ai-send,
  .rc-ai-typing span {
    animation: none !important;
    transition: none !important;
  }

  .rc-ai-panel {
    transform: none !important;
  }
}

@media print {
  .rc-ai-root {
    display: none !important;
  }
}
