.rsc-root {
  --rsc-accent: #8a6a4f;
  --rsc-bg: #fbf7f1;
  --rsc-ink: #2b241e;
  --rsc-soft: #ffffff;
  --rsc-muted: #8b8076;
  position: fixed; right: 20px; bottom: 20px; z-index: 99999;
  font-family: inherit; color: var(--rsc-ink);
}
.rsc-root *, .rsc-root *::before, .rsc-root *::after { box-sizing: border-box; }
.rsc-root button { font: inherit; cursor: pointer; text-transform: none; letter-spacing: normal; line-height: 1.3; min-height: 0; }
.rsc-root .rsc-launcher, .rsc-root .rsc-icon { padding: 0 !important; border: 0 !important; }
.rsc-root .rsc-icon svg, .rsc-root .rsc-card svg { display: block; flex: none; }

/* Launcher bubble */
.rsc-launcher {
  position: relative; width: 72px; height: 72px; padding: 0; border: 0; border-radius: 50%;
  background: var(--rsc-accent); box-shadow: 0 8px 24px rgba(0,0,0,.18);
  display: grid; place-items: center; transition: transform .2s;
}
.rsc-launcher:hover { transform: scale(1.06); }
.rsc-launcher img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background: #fff; }
.rsc-launcher > .rsc-dots {
  position: absolute; top: 2px; left: -34px; background: #fff; padding: 6px 9px; border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.rsc-root.is-open .rsc-launcher > .rsc-dots { display: none; }

.rsc-dots { display: inline-flex; gap: 4px; }
.rsc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--rsc-muted); animation: rsc-b 1.2s infinite ease-in-out; }
.rsc-dots i:nth-child(2) { animation-delay: .15s; }
.rsc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes rsc-b { 0%, 80%, 100% { transform: translateY(0); opacity: .5 } 40% { transform: translateY(-4px); opacity: 1 } }

/* Panel */
.rsc-panel {
  position: absolute; right: 0; bottom: 88px; width: 380px; height: min(640px, calc(100vh - 120px));
  background: var(--rsc-bg); border-radius: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.22);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none; transition: opacity .2s, transform .2s;
}
.rsc-root.is-open .rsc-panel { opacity: 1; transform: none; pointer-events: auto; }

.rsc-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); z-index: 1;
}
.rsc-head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.rsc-head strong { flex: 1; font-size: 17px; letter-spacing: .3px; }
/* Close button — reset theme button styles so it stays a clean circle */
.rsc-root .rsc-close {
  all: unset;
  box-sizing: border-box;
  flex: 0 0 36px;
  width: 36px !important; height: 36px !important;
  min-width: 0 !important; min-height: 0 !important;
  padding: 0 !important; margin: 0 !important;
  border-radius: 50% !important;
  background: #efe9e1 !important;
  color: var(--rsc-ink) !important;
  display: flex !important; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.rsc-root .rsc-close:hover { background: #e4dbd0 !important; transform: rotate(90deg); }
.rsc-root .rsc-close:focus-visible { outline: 2px solid var(--rsc-accent); outline-offset: 2px; }
.rsc-root .rsc-close svg {
  display: block; width: 16px !important; height: 16px !important; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round;
}

.rsc-body { flex: 1; overflow-y: auto; padding: 18px 16px; background: linear-gradient(180deg, #fff 0%, var(--rsc-bg) 100%); }

/* Welcome */
.rsc-welcome { text-align: center; }
.rsc-hero { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; margin: 6px auto 14px; display: block; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.rsc-greet { color: var(--rsc-accent); font-size: 16px; line-height: 1.45; margin: 0 6px 18px; }
.rsc-chip {
  display: block; width: 100%; text-align: left; padding: 14px 18px; margin: 0 0 10px; border: 0;
  border-radius: 14px; background: var(--rsc-soft); color: var(--rsc-ink); font-size: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: background .15s;
}
.rsc-chip:hover { background: #f3ede6; }
.rsc-photo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.rsc-card {
  border: 0; border-radius: 16px; background: var(--rsc-soft); padding: 18px 10px 14px; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--rsc-ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.rsc-card span { width: 36px; height: 36px; border-radius: 50%; background: var(--rsc-accent); color: #fff; display: grid; place-items: center; }

/* Messages */
.rsc-msgs { display: flex; flex-direction: column; gap: 10px; }
.rsc-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.rsc-user { align-self: flex-end; background: var(--rsc-accent); color: #fff; border-bottom-right-radius: 4px; }
.rsc-assistant { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.rsc-thumb { display: block; max-width: 160px; border-radius: 10px; margin-bottom: 6px; }

.rsc-product {
  align-self: flex-start; display: flex; gap: 12px; background: #fff; padding: 10px; border-radius: 14px;
  max-width: 90%; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.rsc-product img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.rsc-pname { display: block; font-weight: 600; font-size: 13px; color: var(--rsc-ink); text-decoration: none; line-height: 1.3; }
.rsc-price { font-size: 13px; margin: 4px 0 8px; }
.rsc-price s { color: var(--rsc-muted); }
.rsc-buy { display: inline-block; background: var(--rsc-accent); color: #fff !important; padding: 6px 14px; border-radius: 20px; font-size: 13px; text-decoration: none; }

/* Input */
.rsc-input { display: flex; align-items: center; gap: 8px; padding: 12px; background: var(--rsc-bg); border-top: 1px solid #eee5da; margin: 0; }
.rsc-input input {
  flex: 1; min-width: 0; height: 44px; border: 1px solid #e3d9cd; border-radius: 22px; padding: 0 16px;
  background: #fff; font-size: 14px; color: var(--rsc-ink); outline: none;
}
.rsc-input input:focus { border-color: var(--rsc-accent); }
.rsc-icon { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--rsc-accent); color: #fff; display: grid; place-items: center; padding: 0; flex-shrink: 0; }
.rsc-send { opacity: .9; }

/* Consent */
.rsc-consent { position: absolute; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; padding: 20px; z-index: 2; }
.rsc-consent[hidden] { display: none; }
.rsc-consent-box { background: #fff; border-radius: 16px; padding: 18px; font-size: 13px; line-height: 1.5; }
.rsc-consent-box p { margin: 8px 0 14px; color: #5a5048; }
.rsc-consent-box a { color: var(--rsc-accent); }
.rsc-consent-box div { display: flex; justify-content: flex-end; gap: 8px; }
.rsc-no, .rsc-yes { border: 0; border-radius: 20px; padding: 8px 16px; }
.rsc-no { background: #efe9e1; color: var(--rsc-ink); }
.rsc-yes { background: var(--rsc-accent); color: #fff; }

/* Mobile: full-screen sheet */
@media (max-width: 480px) {
  .rsc-root { right: 14px; bottom: 14px; }
  .rsc-launcher { width: 62px; height: 62px; }
  .rsc-launcher img { width: 52px; height: 52px; }
  .rsc-panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; bottom: 0; }
  .rsc-root.is-open .rsc-launcher { display: none; }
}

/* Quick-reply buttons (quiz answers, FAQ topics) */
.rsc-quick { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; max-width: 95%; }
.rsc-root .rsc-quick button {
  padding: 8px 14px !important; margin: 0 !important; min-height: 0 !important;
  border: 1px solid var(--rsc-accent) !important; border-radius: 18px !important;
  background: #fff !important; color: var(--rsc-accent) !important;
  font-size: 13px !important; line-height: 1.3 !important; text-align: left;
  transition: background .15s, color .15s;
}
.rsc-root .rsc-quick button:hover { background: var(--rsc-accent) !important; color: #fff !important; }
.rsc-msg a { color: inherit; text-decoration: underline; }
.rsc-assistant a { color: var(--rsc-accent); font-weight: 600; }
.rsc-note { align-self: center; font-size: 11px; color: #b4552d; background: #fff3ec; padding: 6px 10px; border-radius: 8px; max-width: 95%; }
.rsc-root .rsc-chip, .rsc-root .rsc-card, .rsc-root .rsc-no, .rsc-root .rsc-yes { min-height: 0; text-transform: none; letter-spacing: normal; }
