:root {
  --btr-chat-bg: #070610;
  --btr-chat-panel: #12101d;
  --btr-chat-soft: #191527;
  --btr-chat-border: rgba(172, 132, 255, .27);
  --btr-chat-text: #f7f4ff;
  --btr-chat-muted: #aaa3b8;
  --btr-chat-violet: #9d6cff;
  --btr-chat-violet-light: #c5a8ff;
  --btr-chat-cyan: #67e6df;
  --btr-chat-green: #64e79b;
}

#btr-chat-root, #btr-chat-root * { box-sizing: border-box; }

.btr-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99990;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(197, 168, 255, .48);
  border-radius: 999px;
  color: #090711;
  background: linear-gradient(135deg, #c6a7ff, #8b5cf6);
  box-shadow: 0 16px 45px rgba(117, 70, 220, .35);
  font: 800 14px/1 Inter, Arial, sans-serif;
  cursor: pointer;
}

.btr-chat-launcher-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--btr-chat-green);
  box-shadow: 0 0 14px rgba(100, 231, 155, .9);
}

.btr-chat-window {
  position: fixed;
  right: 22px;
  bottom: 90px;
  z-index: 99991;
  display: none;
  flex-direction: column;
  width: min(360px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 120px));
  padding: 0;
  border-top: none;
  overflow: hidden;
  border: 1px solid var(--btr-chat-border);
  border-radius: 22px;
  color: var(--btr-chat-text);
  background: radial-gradient(circle at top right, rgba(139,92,246,.19), transparent 36%), var(--btr-chat-bg);
  box-shadow: 0 24px 80px rgba(0,0,0,.58);
  font-family: Inter, Arial, sans-serif;
}

.btr-chat-window.is-open { display: flex; }

.btr-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--btr-chat-border);
  background: rgba(255,255,255,.015);
}

.btr-chat-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #0a0712;
  background: linear-gradient(135deg, #c3a5ff, #8555ed);
  font-size: 19px;
  font-weight: 950;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 0 20px rgba(157,108,255,.55);
}

.btr-eq-icon { overflow: visible; }
.eq-bar {
  transform-box: fill-box;
  transform-origin: center;
  animation: btrEqPulse 1.1s ease-in-out infinite;
}
.eq-bar-1 { animation-delay: 0s; }
.eq-bar-2 { animation-delay: .16s; }
.eq-bar-3 { animation-delay: .32s; }
.eq-bar-4 { animation-delay: .48s; }

@keyframes btrEqPulse {
  0%, 100% { transform: scaleY(.55); }
  50% { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .eq-bar { animation: none; transform: scaleY(.8); }
}

.btr-chat-heading { min-width: 0; flex: 1; }
.btr-chat-heading strong { display: block; font-size: 14px; letter-spacing: .02em; }
.btr-chat-heading span { display: block; margin-top: 4px; color: var(--btr-chat-muted); font-size: 11px; }

.btr-chat-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  color: var(--btr-chat-muted);
  background: rgba(255,255,255,.045);
  font-size: 20px;
  cursor: pointer;
}

.btr-chat-messages { flex: 1; overflow-y: auto; padding: 18px 14px; scroll-behavior: smooth; }

.btr-message {
  max-width: 87%;
  margin-bottom: 11px;
  padding: 11px 13px;
  border-radius: 15px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}

.btr-message.assistant {
  margin-right: auto;
  border: 1px solid rgba(197,168,255,.16);
  border-bottom-left-radius: 5px;
  background: var(--btr-chat-soft);
}

.btr-message.user {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  color: #0b0712;
  background: linear-gradient(135deg, #c3a5ff, #8d60f5);
  font-weight: 650;
}

.btr-message.error {
  border: 1px solid rgba(255,100,120,.24);
  color: #ffc5cd;
  background: rgba(255,76,100,.08);
}

.btr-chat-quick-actions { display: flex; gap: 7px; overflow-x: auto; padding: 0 14px 12px; }
.btr-chat-quick-actions button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid rgba(197,168,255,.26);
  border-radius: 999px;
  color: var(--btr-chat-violet-light);
  background: rgba(157,108,255,.07);
  font: 700 11px/1 Inter, Arial, sans-serif;
  cursor: pointer;
}

.btr-chat-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 14px 12px; }
.btr-chat-plan {
  display: block;
  padding: 11px;
  border: 1px solid rgba(103,230,223,.19);
  border-radius: 13px;
  color: var(--btr-chat-text);
  background: rgba(103,230,223,.045);
  text-align: center;
  text-decoration: none;
}
.btr-chat-plan strong { display: block; color: var(--btr-chat-cyan); font-size: 13px; }
.btr-chat-plan span { display: block; margin-top: 4px; color: var(--btr-chat-muted); font-size: 10px; }

.btr-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--btr-chat-border);
  background: rgba(5,4,10,.82);
}

.btr-chat-input {
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(197,168,255,.18);
  border-radius: 13px;
  outline: none;
  color: var(--btr-chat-text);
  background: var(--btr-chat-panel);
  font: 500 13px Inter, Arial, sans-serif;
}

.btr-chat-input:focus { border-color: rgba(197,168,255,.7); }
.btr-chat-send {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 13px;
  color: #0a0712;
  background: linear-gradient(135deg, #c3a5ff, #8555ed);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.btr-chat-send:disabled, .btr-chat-input:disabled { cursor: wait; opacity: .55; }
.btr-chat-honeypot { position: absolute !important; left: -99999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

@media (max-width: 600px) {
  .btr-chat-launcher { right: 12px; bottom: 82px; min-height: 48px; padding: 0 14px; }
  .btr-chat-window { right: 6px; top: 8px; bottom: 8px; width: calc(100vw - 12px); height: auto; border-radius: 20px; }
}
