:root {
  --cb-size: 56px;
  --cb-gap: 16px;
  --cb-radius: 18px;
  --cb-shadow: 0 10px 30px rgba(0,0,0,.18);
  --cb-accent: #8B1C3F; /* burgundy launcher color */
  --cb-bg: #0b1020;
  --cb-panel: #ffffff;
  }

  .cb-launcher {
  position: fixed;
  right: var(--cb-gap);
  bottom: var(--cb-gap);
  width: var(--cb-size);
  height: var(--cb-size);
  border-radius: 999px;
  display: flex;               /* flexbox for centering */
  align-items: center;
  justify-content: center;
  background: var(--cb-accent);
  color: #fff;
  box-shadow: var(--cb-shadow);
  cursor: pointer;
  border: 2px solid var(--cb-accent);
  z-index: 2147483647;
  transition: opacity 0.2s ease;  /* animate opacity */
}

.cb-launcher svg {
  width: 70%;   /* was 60% */
  height: 70%;
  display: block;
}

.cb-launcher:hover {
opacity: 0.7;   /* dims everything on hover */
  }

/*
  .cb-launcher:active{ transform: scale(.96); }
  .cb-launcher:focus-visible{ outline: 3px solid #93c5fd; outline-offset: 2px; } */

/* Panel wrapper */
.cb-panel {
  position: fixed;
  right: var(--cb-gap);
  bottom: calc(var(--cb-gap) + var(--cb-size) + 8px);
  width: min(360px, 92vw);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--cb-panel);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  overflow: hidden;
  z-index: 2147483647;
  transform: translateY(12px) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
  display: flex;
  flex-direction: column;
}

.cb-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Panel sections */
.cb-header {
  position: relative; /* Add this for dropdown positioning */
  background: var(--cb-accent);
  color: #fff;
  padding: 5px 14px;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 500;
}


.cb-dropdown {
  position: absolute;
  top: 100%;
  left: 10px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.cb-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cb-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  border-radius: 0;
  transition: background-color 0.2s ease;
}

.cb-dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.cb-dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.cb-dropdown-item:hover {
  background-color: #f3f4f6;
}

.cb-dropdown-item:focus {
  background-color: #f3f4f6;
}

.cb-dropdown-item:focus-visible {
  outline: 2px solid var(--cb-accent);
  outline-offset: -2px;
}

.cb-title { font: 600 16px/1.3 system-ui, -apple-system, Segoe UI, Roboto; }

.cb-spacer { flex: 1; }

.cb-iconbtn {
  background: transparent;
  color: #fff;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.cb-iconbtn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cb-iconbtn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.cb-close {
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 18px;
  width: 28px; height: 28px;
  border-radius: 8px;
  cursor: pointer;
}

.cb-close:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

.cb-messages {
  flex: 1;
  padding: 12px;
  overflow: auto;
  background: #f8fafc;
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto;
}

/* Message row layout */
.cb-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  align-items: flex-start;
}

/* Bot rows without avatar */
.cb-row:has(.cb-bubble.bot) {
  justify-content: flex-start;
}

.cb-row:has(.cb-bubble.bot) > div {
  margin-left: 0;
}

/* Avatar styling */
.cb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  background: var(--cb-accent);
  color: white;
  flex-shrink: 0;
}

.cb-avatar svg {
  width: 16px;
  height: 16px;
  color: white;
}

.cb-avatar.user {
  background: #6b7280;
  order: 2;
}

/* Bubble styling */
.cb-bubble {
  max-width: 280px;
  padding: 12px 16px;
  border-radius: 16px;
  margin-bottom: 4px;
  line-height: 1.4;
}

.cb-bubble.bot {
  background: #e5e7eb;
  color: #374151;
  border-bottom-left-radius: 4px;
}

.cb-bubble.user {
  background: var(--cb-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

/* User messages - right align */
.cb-row:has(.cb-bubble.user) {
  flex-direction: row-reverse;
}

.cb-row:has(.cb-bubble.user) > div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Meta information */
.cb-meta {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
  margin-left: 4px;
}

.cb-row:has(.cb-bubble.user) .cb-meta {
  margin-left: 0;
  margin-right: 4px;
}

/* Day separator */
.cb-daysep {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  margin: 20px 0 16px;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

.cb-inputbar {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 10px; background: #fff; border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.cb-text {
  resize: none; min-height: 42px; max-height: 120px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid #d1d5db;
  font: 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto;
}

.cb-send {
  padding: 0 14px; border-radius: 10px; border: 0; background: var(--cb-accent); color: #fff; font-weight: 600; cursor: pointer;
}

/* Footer with disclaimer and survey link */
.cb-footer {
  padding: 12px 10px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: 12px;
}

.cb-disclaimer {
  margin: 0 0 6px 0;
  color: #6b7280;
  font-size: 11px;
}

.cb-survey-link {
  display: inline-block;
  color: var(--cb-accent);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.cb-survey-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  .cb-panel { transition: none; }
  .cb-launcher { transition: none; }
}

/* Mobile tweak: keep panel taller */
@media (max-width: 480px) {
  .cb-panel { width: 92vw; height: 70vh; }
}

/* ===== FEEDBACK SYSTEM ===== */

.cb-feedback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin: 16px 0;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-align: center;
}

.cb-feedback-text {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.cb-feedback-buttons {
  display: flex;
  gap: 12px;
}

.cb-feedback-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid #e5e7eb;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cb-feedback-btn:hover {
  transform: scale(1.05);
}

.cb-feedback-positive {
  color: #10b981;
  border-color: #d1fae5;
}

.cb-feedback-positive:hover {
  background: #d1fae5;
  border-color: #10b981;
}

.cb-feedback-negative {
  color: #ef4444;
  border-color: #fecaca;
}

.cb-feedback-negative:hover {
  background: #fecaca;
  border-color: #ef4444;
}

.cb-feedback-thanks {
  text-align: center;
  padding: 12px;
  color: #10b981;
  font-weight: 500;
  font-size: 14px;
}