.rdk-site-chat {
  --rdk-chat-accent: #3f4bff;
  --rdk-chat-accent-hover: #315dff;
  --rdk-chat-panel: #081322;
  --rdk-chat-panel-strong: #0d1a2c;
  --rdk-chat-line: #293c5c;
  --rdk-chat-text: #f7f9fd;
  --rdk-chat-muted: #9eacc0;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  color: var(--rdk-chat-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.rdk-site-chat *,
.rdk-site-chat *::before,
.rdk-site-chat *::after {
  box-sizing: border-box;
}

.rdk-site-chat button,
.rdk-site-chat input,
.rdk-site-chat textarea {
  font: inherit;
}

.rdk-site-chat button {
  cursor: pointer;
}

.rdk-site-chat button:focus-visible,
.rdk-site-chat input:focus-visible,
.rdk-site-chat textarea:focus-visible {
  outline: 3px solid rgba(80, 91, 255, 0.28);
  outline-offset: 2px;
}

.rdk-site-chat [hidden] {
  display: none !important;
}

.rdk-site-chat-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rdk-site-chat-launcher {
  position: relative;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid #7182ff;
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: var(--rdk-chat-accent);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42);
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.rdk-site-chat-launcher:hover {
  transform: translateY(-2px);
  background: var(--rdk-chat-accent-hover);
  box-shadow: 0 19px 42px rgba(0, 0, 0, 0.5);
}

.rdk-site-chat-launcher svg {
  width: 22px;
  height: 22px;
}

.rdk-site-chat-launcher.has-unread {
  animation: rdk-chat-pulse 1.8s ease-in-out infinite;
}

.rdk-site-chat-unread {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 2px solid #030713;
  border-radius: 999px;
  padding: 0 5px;
  color: #fff;
  background: #ef3f65;
  font-size: 10px;
  font-weight: 900;
}

.rdk-site-chat-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: min(382px, calc(100vw - 28px));
  height: min(570px, calc(100dvh - 112px));
  min-height: 430px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--rdk-chat-line);
  border-radius: 12px;
  color: var(--rdk-chat-text);
  background: var(--rdk-chat-panel);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform-origin: bottom right;
  animation: rdk-chat-enter 170ms ease-out;
}

.rdk-site-chat-header {
  min-height: 74px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--rdk-chat-line);
  background: #0d1b2e;
}

.rdk-site-chat-agent {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #7782ff;
  border-radius: 50%;
  color: #fff;
  background: var(--rdk-chat-accent);
}

.rdk-site-chat-agent svg {
  width: 21px;
  height: 21px;
}

.rdk-site-chat-heading {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.rdk-site-chat-heading strong {
  font-size: 14px;
  letter-spacing: 0;
}

.rdk-site-chat-heading span {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--rdk-chat-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rdk-site-chat-heading i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2fd48c;
}

.rdk-site-chat-header-actions {
  display: flex;
  gap: 2px;
}

.rdk-site-chat-icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  padding: 0;
  color: #b7c3d3;
  background: transparent;
}

.rdk-site-chat-icon-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.rdk-site-chat-icon-button svg {
  width: 18px;
  height: 18px;
}

.rdk-site-chat-profile {
  min-height: 0;
  overflow-y: auto;
  padding: 22px 20px 20px;
}

.rdk-site-chat-profile-intro {
  margin-bottom: 20px;
}

.rdk-site-chat-profile-intro strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-size: 18px;
}

.rdk-site-chat-profile-intro p {
  margin: 0;
  color: var(--rdk-chat-muted);
  font-size: 12px;
  line-height: 1.55;
}

.rdk-site-chat-profile-form {
  display: grid;
  gap: 14px;
}

.rdk-site-chat-profile-form label {
  display: grid;
  gap: 7px;
  color: #cad3df;
  font-size: 11px;
  font-weight: 750;
}

.rdk-site-chat-profile-form input {
  width: 100%;
  height: 44px;
  border: 1px solid #304360;
  border-radius: 8px;
  padding: 0 12px;
  color: #f8fafc;
  background: #07111f;
}

.rdk-site-chat-profile-form input::placeholder,
.rdk-site-chat-composer textarea::placeholder {
  color: #6f7e93;
}

.rdk-site-chat-profile-form input:focus,
.rdk-site-chat-composer textarea:focus {
  border-color: #5a69ff;
}

.rdk-site-chat-privacy {
  margin: 2px 0 0;
  color: #718096;
  font-size: 9px;
  line-height: 1.5;
}

.rdk-site-chat-profile-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  margin-top: 2px;
}

.rdk-site-chat-profile-actions button {
  height: 42px;
  border-radius: 8px;
  padding: 0 15px;
  font-size: 11px;
  font-weight: 800;
}

.rdk-site-chat-profile-cancel {
  border: 1px solid #30415b;
  color: #c1cad8;
  background: #0a1525;
}

.rdk-site-chat-profile-submit {
  border: 1px solid #6675ff;
  color: #fff;
  background: var(--rdk-chat-accent);
}

.rdk-site-chat-conversation {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto auto;
}

.rdk-site-chat-messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px;
  scrollbar-width: thin;
  scrollbar-color: #354762 transparent;
}

.rdk-site-chat-welcome {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin-bottom: 3px;
}

.rdk-site-chat-welcome .rdk-site-chat-agent {
  width: 34px;
  height: 34px;
}

.rdk-site-chat-welcome .rdk-site-chat-agent svg {
  width: 18px;
  height: 18px;
}

.rdk-site-chat-welcome-copy {
  border: 1px solid #2b3d59;
  border-radius: 8px;
  padding: 10px 11px;
  background: #101e31;
}

.rdk-site-chat-welcome-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.rdk-site-chat-welcome-copy p,
.rdk-site-chat-message p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.rdk-site-chat-welcome-copy p {
  color: #b3becc;
  font-size: 11px;
  line-height: 1.48;
}

.rdk-site-chat-message {
  width: fit-content;
  max-width: 84%;
  display: grid;
  gap: 5px;
  border: 1px solid #2b3d59;
  border-radius: 8px;
  padding: 9px 11px 7px;
  background: #101e31;
}

.rdk-site-chat-message.is-user {
  align-self: flex-end;
  border-color: #6974ff;
  color: #fff;
  background: var(--rdk-chat-accent);
}

.rdk-site-chat-message p {
  font-size: 12px;
  line-height: 1.45;
}

.rdk-site-chat-message time {
  justify-self: end;
  color: #8190a6;
  font-size: 8px;
}

.rdk-site-chat-message.is-user time {
  color: rgba(255, 255, 255, 0.72);
}

.rdk-site-chat-state,
.rdk-site-chat-closed {
  margin: 5px auto;
  color: #8290a5;
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.rdk-site-chat-closed {
  max-width: 280px;
  border: 1px solid #293a54;
  border-radius: 7px;
  padding: 7px 9px;
  background: #0c1929;
}

.rdk-site-chat-error {
  margin: 0;
  border-top: 1px solid rgba(248, 113, 113, 0.25);
  padding: 8px 13px;
  color: #fda4af;
  background: rgba(127, 29, 29, 0.15);
  font-size: 10px;
  line-height: 1.4;
}

.rdk-site-chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: end;
  gap: 8px;
  border-top: 1px solid var(--rdk-chat-line);
  padding: 10px 11px;
  background: #0c1929;
}

.rdk-site-chat-composer textarea {
  width: 100%;
  min-height: 43px;
  max-height: 105px;
  resize: vertical;
  border: 1px solid #31445f;
  border-radius: 7px;
  padding: 10px 11px;
  color: #f8fafc;
  background: #07111f;
  font-size: 11px;
  line-height: 1.4;
}

.rdk-site-chat-composer button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #6675ff;
  border-radius: 7px;
  padding: 0;
  color: #fff;
  background: var(--rdk-chat-accent);
}

.rdk-site-chat-composer button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.rdk-site-chat-composer button svg {
  width: 18px;
  height: 18px;
}

.rdk-site-chat-footer {
  padding: 7px 10px 8px;
  color: #68768a;
  background: #0c1929;
  font-size: 8px;
  text-align: center;
}

.rdk-site-chat-new-message {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 280px;
  min-height: 64px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid #4f5fbd;
  border-radius: 10px;
  padding: 10px 12px;
  color: #f8fafc;
  text-align: left;
  background: #091526;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.52);
  animation: rdk-chat-notice-enter 180ms ease-out;
}

.rdk-site-chat-new-message:hover {
  border-color: #7582ff;
  background: #0d1b2e;
}

.rdk-site-chat-new-message-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--rdk-chat-accent);
}

.rdk-site-chat-new-message-icon svg {
  width: 19px;
  height: 19px;
}

.rdk-site-chat-new-message-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rdk-site-chat-new-message-copy strong {
  font-size: 13px;
}

.rdk-site-chat-new-message-copy small {
  overflow: hidden;
  color: #aab8ca;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes rdk-chat-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rdk-chat-notice-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rdk-chat-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@media (max-width: 600px) {
  .rdk-site-chat {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .rdk-site-chat-panel {
    position: fixed;
    right: 10px;
    bottom: 82px;
    width: calc(100vw - 20px);
    height: min(610px, calc(100dvh - 100px));
    min-height: 0;
    border-radius: 12px;
  }

  .rdk-site-chat-launcher {
    width: 50px;
    height: 50px;
  }

  .rdk-site-chat-launcher svg {
    width: 21px;
    height: 21px;
  }

  .rdk-site-chat-new-message {
    width: min(280px, calc(100vw - 28px));
  }
}

@media (max-height: 560px) and (min-width: 601px) {
  .rdk-site-chat-panel {
    height: calc(100dvh - 96px);
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rdk-site-chat-launcher,
  .rdk-site-chat-launcher.has-unread,
  .rdk-site-chat-panel,
  .rdk-site-chat-new-message {
    animation: none;
    transition: none;
  }
}
