.vulp-chat {
  --chat-bg: #11131d;
  --chat-surface: #191c29;
  --chat-border: rgba(235, 236, 244, 0.11);
  --chat-text: #f2f2f6;
  --chat-muted: #9da0b4;
  --chat-orange: #ff7927;
  --chat-orange-2: #f25b16;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  color: var(--chat-text);
  font-family: var(--font-body, "Avenir Next", "Segoe UI", sans-serif);
}

.vulp-chat,
.vulp-chat * {
  box-sizing: border-box;
}

.vulp-chat__launcher {
  min-height: 54px;
  padding: 7px 14px 7px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 155, 87, 0.35);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(34, 30, 35, 0.98), rgba(24, 25, 38, 0.98));
  color: var(--chat-text);
  box-shadow: 0 18px 45px rgba(3, 4, 12, 0.45), inset 0 1px rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font: inherit;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.vulp-chat__launcher:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 155, 87, 0.58);
  box-shadow: 0 22px 55px rgba(3, 4, 12, 0.52), 0 0 28px rgba(242, 91, 22, 0.11);
}

.vulp-chat__launcher-logo {
  width: 39px;
  height: 39px;
  padding: 3px;
  border: 1px solid rgba(255, 155, 87, 0.38);
  border-radius: 12px;
  background: transparent;
  object-fit: contain;
}

.vulp-chat__launcher-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.vulp-chat__launcher-copy strong {
  font-size: 13px;
  line-height: 1.2;
}

.vulp-chat__launcher-copy span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--chat-muted);
  font-size: 10.5px;
}

.vulp-chat__pulse {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #5fe1a2;
  box-shadow: 0 0 0 4px rgba(95, 225, 162, 0.11);
}

.vulp-chat__panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  width: min(390px, calc(100vw - 28px));
  height: min(640px, calc(100dvh - 110px));
  min-height: 480px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--chat-border);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 121, 39, 0.13), transparent 34%),
    var(--chat-bg);
  box-shadow: 0 28px 90px rgba(2, 3, 10, 0.64), inset 0 1px rgba(255, 255, 255, 0.05);
  transform-origin: bottom right;
  animation: vulp-chat-in 180ms ease-out;
}

.vulp-chat__panel[hidden] {
  display: none;
}

@keyframes vulp-chat-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.vulp-chat__header {
  min-height: 74px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--chat-border);
  background: rgba(19, 21, 32, 0.78);
  backdrop-filter: blur(14px);
}

.vulp-chat__identity {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.vulp-chat__avatar {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 3px;
  border: 1px solid rgba(255, 155, 87, 0.42);
  border-radius: 14px;
  background: transparent;
}

.vulp-chat__avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vulp-chat__avatar::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: #5fe1a2;
  box-shadow: 0 0 0 2px var(--chat-bg);
}

.vulp-chat__identity strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.vulp-chat__identity span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--chat-muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vulp-chat__close {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--chat-muted);
  cursor: pointer;
  font-size: 18px;
}

.vulp-chat__close:hover {
  border-color: var(--chat-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--chat-text);
}

.vulp-chat__messages {
  overflow-y: auto;
  padding: 18px 15px 16px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.vulp-chat__message {
  margin-bottom: 13px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.vulp-chat__message--user {
  justify-content: flex-end;
}

.vulp-chat__mini-avatar {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 121, 39, 0.1);
  object-fit: contain;
}

.vulp-chat__bubble {
  max-width: 84%;
  padding: 11px 13px;
  border: 1px solid var(--chat-border);
  border-radius: 15px 15px 15px 5px;
  background: var(--chat-surface);
  color: #dedfe8;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.vulp-chat__message--user .vulp-chat__bubble {
  border-color: rgba(255, 142, 74, 0.28);
  border-radius: 15px 15px 5px 15px;
  background: linear-gradient(135deg, #d94e13, #f26c20);
  color: #fff7f1;
}

.vulp-chat__suggestions {
  margin: 4px 0 16px 33px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.vulp-chat__suggestion,
.vulp-chat__action {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 144, 76, 0.24);
  border-radius: 10px;
  background: rgba(255, 121, 39, 0.07);
  color: #f4b086;
  cursor: pointer;
  font: 600 11.5px/1.2 inherit;
  transition: background 130ms ease, border-color 130ms ease;
}

.vulp-chat__suggestion:hover,
.vulp-chat__action:hover {
  border-color: rgba(255, 144, 76, 0.45);
  background: rgba(255, 121, 39, 0.13);
}

.vulp-chat__action {
  margin-top: 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vulp-chat__typing {
  min-width: 54px;
  display: flex;
  gap: 4px;
}

.vulp-chat__typing i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--chat-muted);
  animation: vulp-chat-dot 900ms infinite ease-in-out;
}

.vulp-chat__typing i:nth-child(2) {
  animation-delay: 130ms;
}

.vulp-chat__typing i:nth-child(3) {
  animation-delay: 260ms;
}

@keyframes vulp-chat-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.vulp-chat__composer {
  padding: 11px 12px 10px;
  border-top: 1px solid var(--chat-border);
  background: rgba(15, 17, 26, 0.96);
}

.vulp-chat__form {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
}

.vulp-chat__input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  outline: none;
  background: rgba(5, 6, 11, 0.6);
  color: var(--chat-text);
  font: 13px inherit;
}

.vulp-chat__input::placeholder {
  color: #74788e;
}

.vulp-chat__input:focus {
  border-color: rgba(255, 126, 49, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 121, 39, 0.09);
}

.vulp-chat__send {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 157, 92, 0.32);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--chat-orange-2), var(--chat-orange));
  color: #1c0b04;
  cursor: pointer;
  font-size: 17px;
}

.vulp-chat__send:disabled,
.vulp-chat__input:disabled {
  cursor: wait;
  opacity: 0.58;
}

.vulp-chat__fine-print {
  margin: 7px 2px 0;
  color: #6f7386;
  font-size: 9.5px;
  line-height: 1.4;
  text-align: center;
}

.vulp-chat__fine-print a {
  color: #8f93a7;
}

@media (max-width: 560px) {
  .vulp-chat {
    right: 10px;
    bottom: 10px;
  }

  .vulp-chat__launcher {
    min-height: 50px;
    border-radius: 15px;
  }

  .vulp-chat__launcher-logo {
    width: 35px;
    height: 35px;
  }

  .vulp-chat__panel {
    position: fixed;
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    height: min(720px, calc(100dvh - 16px));
    max-height: none;
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vulp-chat__panel,
  .vulp-chat__launcher,
  .vulp-chat__typing i {
    animation: none;
    transition: none;
  }
}
