:root {
  --ra-primary: #9e6eff;
  --ra-primary-strong: #7d4fe0;
  --ra-primary-soft: #efe7ff;
  --ra-bg: #ffffff;
  --ra-surface: #f3f6f9;
  --ra-surface-strong: #eaf0f5;
  --ra-text: #0f172a;
  --ra-muted: #5b6476;
  --ra-border: rgba(15, 23, 42, 0.12);
  --ra-border-strong: rgba(15, 23, 42, 0.2);
  --ra-shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.2);
  --ra-shadow-md: 0 14px 28px rgba(15, 23, 42, 0.16);
  --ra-radius: 18px;
  --ra-font:
    "Manrope", "Avenir Next", "Segoe UI", "Noto Sans", sans-serif;
}

.reno-assistant {
  font-family: inherit;
  color: var(--ra-text);
}

.reno-assistant button,
.reno-assistant input {
  font-family: inherit;
}

.reno-assistant::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2147482999;
  opacity: 0;
  transition: opacity 240ms ease;
  background: radial-gradient(
      520px 320px at calc(100% - 48px) calc(100% - 120px),
      rgba(158, 110, 255, 0.18),
      transparent 70%
    ),
    radial-gradient(
      420px 280px at calc(100% - 40px) calc(100% - 140px),
      rgba(15, 23, 42, 0.1),
      transparent 70%
    );
}

.reno-assistant.is-open::before {
  opacity: 1;
}

.reno-assistant__fab {
  position: fixed;
  z-index: 2147483000;
  right: 20px;
  bottom: 20px;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.22), transparent 42%),
    linear-gradient(135deg, var(--ra-primary), var(--ra-primary-strong));
  color: #fff;
  cursor: pointer;
  box-shadow: var(--ra-shadow-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 220ms ease;
}

[dir="rtl"] .reno-assistant__fab {
  right: auto;
  left: 20px;
}

.reno-assistant__fab::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 1px solid rgba(158, 110, 255, 0.45);
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 220ms ease, transform 220ms ease;
}

.reno-assistant__fab:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(158, 110, 255, 0.2),
    var(--ra-shadow-md);
}

.reno-assistant__fab:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--ra-shadow-lg);
  filter: saturate(1.06);
}

.reno-assistant__fab:hover::after {
  opacity: 1;
  transform: scale(1);
}

.reno-assistant__panel {
  position: fixed;
  z-index: 2147483000;
  right: 20px;
  bottom: 90px;
  width: min(400px, calc(100vw - 40px));
  height: min(620px, calc(100vh - 130px));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 1));
  border: 1px solid var(--ra-border);
  border-radius: var(--ra-radius);
  box-shadow: var(--ra-shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  visibility: hidden;
  pointer-events: none;
  transform-origin: bottom right;
  transition:
    opacity 240ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0ms linear 240ms;
}

[dir="rtl"] .reno-assistant__panel {
  right: auto;
  left: 20px;
  transform-origin: bottom left;
}

.reno-assistant__panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 280ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0ms linear 0ms;
}

.reno-assistant__header {
  position: relative;
  padding: 13px 14px;
  border-bottom: 1px solid var(--ra-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--ra-bg);
}

.reno-assistant__header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    rgba(158, 110, 255, 0.08),
    rgba(15, 23, 42, 0.04)
  );
}

.reno-assistant__title {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.reno-assistant__title strong {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reno-assistant__title span {
  font-size: 12px;
  line-height: 1.2;
  color: var(--ra-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reno-assistant__close {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ra-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.reno-assistant__close:hover {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.1);
  color: var(--ra-text);
}

.reno-assistant__close:focus-visible {
  outline: none;
  border-color: rgba(158, 110, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(158, 110, 255, 0.15);
}

.reno-assistant__header-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reno-assistant__tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--ra-border);
  background: var(--ra-bg);
}

.reno-assistant__tabs .reno-assistant__close {
  width: auto;
  height: 30px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
}

.reno-assistant__tabs .reno-assistant__close:hover {
  border-color: var(--ra-border);
}

.reno-assistant__tabs .reno-assistant__close.is-active {
  color: var(--ra-primary-strong);
  border-color: rgba(158, 110, 255, 0.35);
  background: var(--ra-primary-soft);
}

.reno-assistant__body {
  flex: 1;
  overflow: auto;
  padding: 13px 13px 11px;
  background:
    radial-gradient(
      220px 140px at 100% 0%,
      rgba(158, 110, 255, 0.1),
      transparent 70%
    ),
    var(--ra-surface);
}

.reno-assistant__empty {
  margin: 10px 6px;
  padding: 13px 14px;
  border: 1px dashed rgba(15, 23, 42, 0.2);
  border-radius: 13px;
  color: var(--ra-muted);
  font-size: 13px;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.9);
}

.reno-assistant__msg {
  display: flex;
  margin: 10px 0;
  animation: ra-msg-in 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reno-assistant__msg--user {
  justify-content: flex-end;
}

.reno-assistant__bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--ra-border);
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  white-space: pre-wrap;
  word-break: break-word;
}

.reno-assistant__bubble a {
  color: #1d4ed8;
  text-decoration: underline;
}

.reno-assistant__msg--assistant .reno-assistant__bubble {
  border-top-left-radius: 8px;
}

.reno-assistant__msg--user .reno-assistant__bubble {
  border-top-right-radius: 8px;
  background: linear-gradient(135deg, #efe4ff, #faf7ff);
  border-color: rgba(158, 110, 255, 0.34);
}

.reno-assistant__history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reno-assistant__history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--ra-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.reno-assistant__history-item:hover {
  border-color: var(--ra-border-strong);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.reno-assistant__history-open {
  flex: 1;
  width: 100%;
  height: auto;
  display: block;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
}

.reno-assistant__history-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ra-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reno-assistant__history-date {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ra-muted);
}

.reno-assistant__footer {
  border-top: 1px solid var(--ra-border);
  padding: 10px;
  background: var(--ra-bg);
}

.reno-assistant__form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.reno-assistant__input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--ra-border);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 13px;
  color: var(--ra-text);
  outline: none;
  background: #fff;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.reno-assistant__input::placeholder {
  color: #8b93a4;
}

.reno-assistant__input:focus {
  border-color: rgba(158, 110, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(158, 110, 255, 0.18);
}

.reno-assistant__send {
  border: 0;
  border-radius: 12px;
  padding: 11px 13px;
  background: linear-gradient(135deg, var(--ra-primary), var(--ra-primary-strong));
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    opacity 180ms ease;
}

.reno-assistant__send:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.reno-assistant__send:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.reno-assistant__disclaimer {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #667085;
  white-space: pre-wrap;
}

.reno-assistant__typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--ra-border);
  background: #fff;
}

.reno-assistant__dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.reno-assistant__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  animation: ra-bounce 1.1s infinite ease-in-out;
}

.reno-assistant__dot:nth-child(2) {
  animation-delay: 0.12s;
}

.reno-assistant__dot:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes ra-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-4px);
    opacity: 0.9;
  }
}

@keyframes ra-msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reno-assistant::before,
  .reno-assistant__fab,
  .reno-assistant__panel,
  .reno-assistant__msg,
  .reno-assistant__dot,
  .reno-assistant__history-item,
  .reno-assistant__send {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 560px) {
  .reno-assistant__panel {
    width: calc(100vw - 18px);
    right: 9px;
    bottom: 75px;
    height: min(640px, calc(100vh - 86px));
    border-radius: 16px;
  }

  [dir="rtl"] .reno-assistant__panel {
    right: auto;
    left: 9px;
  }

  .reno-assistant__fab {
    right: 10px;
    bottom: 10px;
  }

  [dir="rtl"] .reno-assistant__fab {
    right: auto;
    left: 10px;
  }
}
