@keyframes qb-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes qb-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes qb-blink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}
@keyframes qb-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.qb-pop { animation: qb-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }
.qb-msg { animation: qb-fade-in 0.22s ease both; }
.qb-dot { animation: qb-blink 1s infinite; }

@media (prefers-reduced-motion: reduce) {
  .qb-pop, .qb-msg, .qb-dot, #quote-bot-backdrop { animation: none; }
}

body.qb-no-scroll { overflow: hidden; }

.qb-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#quote-bot-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(8, 28, 24, 0.45);
  backdrop-filter: blur(2px);
  animation: qb-backdrop-in 0.2s ease both;
}
#quote-bot-backdrop.qb-open { display: block; }

#quote-bot-panel {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  position: fixed;
  z-index: 80;
  right: 1rem;
  bottom: 1rem;
  display: none;
  flex-direction: column;
  width: 384px;
  max-width: calc(100vw - 2rem);
  height: 564px;
  max-height: calc(100dvh - 6rem);
  border-radius: 1.5rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(13, 79, 71, 0.08);
  box-shadow: 0 30px 70px rgba(8, 40, 36, 0.34);
}

#quote-bot-panel.qb-open { display: flex; }

@media (min-width: 640px) {
  #quote-bot-panel { right: 1.5rem; bottom: 1.5rem; }
}

@media (max-width: 639px) {
  #quote-bot-panel.qb-open {
    inset: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
}

.qb-header {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 15px;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(125deg, #0a1418 0%, #0d2832 62%, #091a20 100%);
}

.qb-header-glow {
  pointer-events: none;
  position: absolute;
  top: -2.5rem;
  right: -2rem;
  width: 180px;
  height: 120px;
  background: radial-gradient(ellipse at center, rgba(34, 211, 238, 0.28), transparent 65%);
}

.qb-avatar {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.4);
}

.qb-avatar-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #22d3ee;
  border: 2px solid #0a1418;
  box-shadow: 0 0 8px #22d3ee;
}

.qb-title { font-weight: 800; font-size: 15.5px; line-height: 1.25; }
.qb-subtitle {
  font-size: 11.5px;
  color: #9fdfe9;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
}
.qb-subtitle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 7px #22d3ee;
}

.qb-close {
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.15s;
}
.qb-close:hover { background: rgba(255, 255, 255, 0.2); }

.qb-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: linear-gradient(180deg, #f5faf8 0%, #eef6f3 100%);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.qb-messages::-webkit-scrollbar { width: 5px; }
.qb-messages::-webkit-scrollbar-thumb {
  background: rgba(13, 79, 71, 0.2);
  border-radius: 99px;
}

.qb-msg { max-width: 88%; }
.qb-msg-bot { align-self: flex-start; }
.qb-msg-user { align-self: flex-end; }

.qb-bubble {
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-line;
  padding: 10px 14px;
  word-break: break-word;
}
.qb-bubble-bot {
  background: #fff;
  border: 1px solid #e8efed;
  color: #22302d;
  border-radius: 14px;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(8, 40, 36, 0.04);
}
.qb-bubble-user {
  background: linear-gradient(120deg, #0891b2, #06b6d4);
  color: #fff;
  border-radius: 14px;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.25);
}

.qb-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  background: #fff;
  border: 1px solid #e8efed;
  border-radius: 14px;
  padding: 12px 14px;
}
.qb-typing .qb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9fb8b2;
}
.qb-typing .qb-dot:nth-child(2) { animation-delay: 0.2s; }
.qb-typing .qb-dot:nth-child(3) { animation-delay: 0.4s; }

.qb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
}
.qb-chip {
  font-size: 12.5px;
  font-weight: 600;
  color: #0c4a52;
  background: #fff;
  border: 1px solid #9fdfe9;
  border-radius: 9999px;
  padding: 7px 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  max-width: 100%;
  text-align: left;
  line-height: 1.35;
}
.qb-chip:hover:not(:disabled) {
  background: #e0f7fb;
  border-color: #22d3ee;
  transform: translateY(-1px);
}
.qb-chip:active:not(:disabled) { transform: translateY(0); }
.qb-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.qb-composer {
  flex-shrink: 0;
  padding: 11px 13px;
  padding-bottom: max(11px, env(safe-area-inset-bottom));
  border-top: 1px solid #eef3f1;
  background: #fff;
}
.qb-form { display: flex; gap: 8px; align-items: center; }
.qb-form.qb-busy { opacity: 0.65; pointer-events: none; }

.qb-input {
  flex: 1;
  min-width: 0;
  border-radius: 9999px;
  padding: 11px 16px;
  font-size: 16px;
  outline: none;
  color: #16302b;
  border: 1.5px solid #e1ebe8;
  background: #f7fbfa;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.qb-input:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.qb-input--alt { border-color: #cfe0db; background: #fff; }

.qb-send {
  border: none;
  border-radius: 9999px;
  padding: 11px 18px;
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  background: linear-gradient(120deg, #0891b2, #06b6d4);
  transition: opacity 0.15s, transform 0.12s;
}
.qb-send:hover:not(:disabled) { transform: scale(1.03); }
.qb-send:disabled { opacity: 0.5; cursor: not-allowed; }

.qb-send-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.qb-footer-note {
  text-align: center;
  font-size: 10px;
  color: #9aa8a4;
  margin-top: 8px;
  line-height: 1.4;
}

.qb-footer-note a {
  color: #0e7490;
  text-decoration: none;
}
.qb-footer-note a:hover { text-decoration: underline; }
