.rsa {
  --rsa-ink: #111827;
  --rsa-muted: #5b6472;
  --rsa-border: #dfe3e8;
  --rsa-surface: #ffffff;
  --rsa-soft: #f5f7f8;
  --rsa-accent: #c9470b;
  --rsa-green: #0f6b5d;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1100;
  font-family: inherit;
  letter-spacing: 0;
}

.rsa *,
.rsa *::before,
.rsa *::after {
  box-sizing: border-box;
}

.rsa__launcher {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 10px 16px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: var(--rsa-ink);
  color: #fff;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.22);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0;
  cursor: pointer;
}

.rsa__launcher:hover,
.rsa__launcher:focus-visible {
  background: #202735;
  color: #fff;
  transform: translateY(-1px);
}

.rsa__launcher:focus-visible,
.rsa__close:focus-visible,
.rsa__quick button:focus-visible,
.rsa__form input:focus-visible,
.rsa__form button:focus-visible,
.rsa__actions a:focus-visible,
.rsa__product a:focus-visible {
  outline: 3px solid rgba(15, 107, 93, 0.32);
  outline-offset: 2px;
}

.rsa__launcher-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--rsa-accent);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.rsa__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  width: min(390px, calc(100vw - 32px));
  height: min(610px, calc(100dvh - 40px));
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid var(--rsa-border);
  border-radius: 8px;
  background: var(--rsa-surface);
  box-shadow: 0 22px 60px rgba(17, 24, 39, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.985);
  transform-origin: bottom right;
  transition: opacity 160ms ease, transform 160ms ease;
}

.rsa__panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.rsa.is-open .rsa__launcher {
  visibility: hidden;
  pointer-events: none;
}

.rsa__header {
  display: flex;
  min-height: 92px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px 16px;
  background: var(--rsa-ink);
  color: #fff;
}

.rsa__header h2,
.rsa__header p {
  margin: 0;
  color: inherit;
  letter-spacing: 0;
}

.rsa__header h2 {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.2;
}

.rsa__eyebrow {
  font-size: 10px;
  font-weight: 750;
  opacity: 0.72;
}

.rsa__status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px !important;
  font-size: 12px;
  opacity: 0.82;
}

.rsa__status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
}

.rsa__close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.rsa__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.rsa__messages {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  overscroll-behavior: contain;
  background: var(--rsa-soft);
}

.rsa__message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--rsa-border);
  border-radius: 6px;
  background: var(--rsa-surface);
  color: var(--rsa-ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.rsa__message p {
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

.rsa__message--customer {
  margin-left: auto;
  border-color: var(--rsa-green);
  background: var(--rsa-green);
  color: #fff;
}

.rsa__typing {
  display: flex;
  gap: 4px;
  align-items: center;
  min-height: 39px;
}

.rsa__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7b8491;
  animation: rsa-typing 1s infinite ease-in-out;
}

.rsa__typing span:nth-child(2) {
  animation-delay: 120ms;
}

.rsa__typing span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes rsa-typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

.rsa__products {
  display: grid;
  gap: 8px;
  margin: 4px 0 12px;
}

.rsa__product {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--rsa-border);
  border-radius: 6px;
  background: #fff;
  color: var(--rsa-ink);
}

.rsa__product img {
  width: 76px;
  height: 76px;
  margin: 0;
  border: 1px solid #edf0f2;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
}

.rsa__product span {
  display: block;
  margin-bottom: 2px;
  color: var(--rsa-green);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.rsa__product h3 {
  margin: 0;
  color: var(--rsa-ink);
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0;
}

.rsa__product p {
  display: -webkit-box;
  margin: 4px 0 7px;
  overflow: hidden;
  color: var(--rsa-muted);
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.rsa__product div > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rsa__product strong {
  color: var(--rsa-green);
  font-size: 13px;
}

.rsa__product a {
  color: var(--rsa-accent);
  font-size: 11px;
  font-weight: 750;
  text-decoration: underline;
}

.rsa__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
}

.rsa__actions a {
  padding: 8px 10px;
  border: 1px solid var(--rsa-ink);
  border-radius: 4px;
  background: #fff;
  color: var(--rsa-ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

.rsa__actions a:hover,
.rsa__actions a.is-primary {
  border-color: var(--rsa-green);
  background: var(--rsa-green);
  color: #fff;
}

.rsa__quick {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--rsa-border);
  background: #fff;
  scrollbar-width: thin;
}

.rsa__quick[hidden] {
  display: none;
}

.rsa__quick button {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--rsa-border);
  border-radius: 4px;
  background: #fff;
  color: var(--rsa-ink);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}

.rsa__quick button:hover {
  border-color: var(--rsa-green);
  color: var(--rsa-green);
}

.rsa__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--rsa-border);
  background: #fff;
}

.rsa__form input {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin: 0;
  padding: 0 11px;
  border: 1px solid #cbd1d8;
  border-radius: 4px;
  background: #fff;
  color: var(--rsa-ink);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
}

.rsa__form button {
  min-width: 70px;
  height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 4px;
  background: var(--rsa-accent);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  cursor: pointer;
}

.rsa__form button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.rsa__honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.rsa__privacy {
  margin: 0;
  padding: 0 12px 10px;
  background: #fff;
  color: var(--rsa-muted);
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
}

@media (max-width: 600px) {
  .rsa {
    right: 12px;
    bottom: 12px;
  }

  .rsa__launcher {
    min-height: 46px;
  }

  .rsa__panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(82dvh, 680px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
    transform: translateY(22px);
    transform-origin: bottom center;
  }

  .rsa__panel.is-open {
    transform: translateY(0);
  }

  body.rsa-is-open {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rsa__panel,
  .rsa__launcher,
  .rsa__typing span {
    transition: none;
    animation: none;
  }
}

@media print {
  .rsa {
    display: none !important;
  }
}
