.support-chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 50%;
  background: #4285f4;
  color: #fff;
  box-shadow: 0 8px 24px rgba(66, 133, 244, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.support-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(66, 133, 244, 0.45);
}

.support-chat-launcher[aria-expanded="true"] {
  background: #3367d6;
}

.support-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  z-index: 1080;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 7rem));
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.support-chat-panel[hidden] {
  display: none !important;
}

.support-chat-header {
  background: #4285f4;
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.support-chat-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.support-chat-header p {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  opacity: 0.9;
}

.support-chat-close {
  background: transparent;
  border: none;
  color: #fff;
  opacity: 0.85;
  cursor: pointer;
  padding: 0.15rem;
  font-size: 1.1rem;
  line-height: 1;
}

.support-chat-close:hover {
  opacity: 1;
}

.support-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #f8f9fa;
}

.support-chat-bubble {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.85rem;
  font-size: 0.84rem;
  line-height: 1.45;
  word-break: break-word;
}

.support-chat-bubble p {
  margin: 0 0 0.4rem;
}

.support-chat-bubble p:last-child {
  margin-bottom: 0;
}

.support-chat-bubble ul {
  margin: 0.25rem 0 0.4rem;
  padding-left: 1.1rem;
}

.support-chat-bubble-user {
  align-self: flex-end;
  background: #4285f4;
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}

.support-chat-bubble-assistant {
  align-self: flex-start;
  background: #fff;
  color: #212529;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom-left-radius: 0.2rem;
}

.support-chat-bubble-assistant a {
  color: #1a73e8;
}

.support-chat-bubble-escalated {
  border-color: #f4b400;
  background: #fffdf5;
}

.support-chat-typing {
  align-self: flex-start;
  font-size: 0.78rem;
  color: #6c757d;
  padding: 0 0.25rem;
}

.support-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.85rem 0.5rem;
  background: #f8f9fa;
}

.support-chat-quick button {
  border: 1px solid rgba(66, 133, 244, 0.35);
  background: #fff;
  color: #1a73e8;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}

.support-chat-quick button:hover {
  background: #e8f0fe;
}

.support-chat-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.65rem 0.85rem 0.75rem;
  background: #fff;
}

.support-chat-form {
  display: flex;
  gap: 0.45rem;
}

.support-chat-form input {
  flex: 1;
  border: 1px solid #ced4da;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
}

.support-chat-form input:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.support-chat-form button {
  border: none;
  border-radius: 999px;
  background: #4285f4;
  color: #fff;
  width: 2.35rem;
  height: 2.35rem;
  cursor: pointer;
  flex-shrink: 0;
}

.support-chat-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.support-chat-support-link {
  display: block;
  text-align: center;
  margin-top: 0.45rem;
  font-size: 0.72rem;
}

.support-chat-support-link a {
  color: #6c757d;
  text-decoration: none;
}

.support-chat-support-link a:hover {
  color: #1a73e8;
  text-decoration: underline;
}

/* Keep scroll-to-top above the chat launcher, hide when chat is open */
body:has(.support-chat-launcher) .scroll-to-top {
  bottom: 5.5rem;
  right: 1.25rem;
  z-index: 1070;
}

body:has(.support-chat-launcher[aria-expanded="true"]) .scroll-to-top {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 480px) {
  .support-chat-panel {
    right: 0.75rem;
    bottom: 5rem;
    width: calc(100vw - 1.5rem);
  }

  .support-chat-launcher {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}
