.gobaobot {
  position: fixed;
  right: 16px;
  bottom: 16px;
  /* Above the theme's mobile action bar (.gb-mobilebar z-index:9990). */
  z-index: 10000;
  max-width: calc(100vw - 32px);
  font: 16px/1.4 system-ui, -apple-system, sans-serif;
}
/* On mobile the theme shows a fixed bottom action bar (~60px tall, z-index
   9990) that used to sit ON TOP of the launcher and swallow taps (tap -> /our-bao/).
   Lift the widget above it so the chat button stays tappable. */
@media (max-width: 767px) {
  .gobaobot {
    bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 12px);
  }
}

.gobaobot__launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #3b1d6e;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  cursor: pointer;
  font: inherit;
}
.gobaobot__launch:hover {
  background: #4b2a86;
}
.gobaobot__launch:focus-visible,
.gobaobot__close:focus-visible,
.gobaobot__form button:focus-visible,
.gobaobot__form input:focus-visible {
  outline: 2px solid #b287f0;
  outline-offset: 2px;
}

/* Mascot: fixed box so layout never jumps */
.gobaobot__mascot {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 50%;
}
.gobaobot__mascot--head {
  width: 40px;
  height: 40px;
}

.gobaobot__panel {
  width: min(360px, calc(100vw - 32px));
  margin-top: 8px;
  background: #fff;
  color: #1b1028;
  border: 1px solid #d9d2e6;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.gobaobot__panel[hidden] {
  display: none;
}

.gobaobot__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.gobaobot__head-title {
  flex: 1;
  font-weight: 600;
  color: #3b1d6e;
}
.gobaobot__close {
  border: 0;
  background: transparent;
  color: #6b6478;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.gobaobot__close:hover {
  background: #f2eef8;
  color: #1b1028;
}

.gobaobot__note {
  margin: 0 0 8px;
  font-size: 12px;
  color: #6b6478;
}
.gobaobot__log {
  max-height: 240px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gobaobot__msg {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.gobaobot__msg--user {
  align-self: flex-end;
  background: #3b1d6e;
  color: #fff;
  padding: 6px 10px;
  border-radius: 12px 12px 2px 12px;
}
.gobaobot__msg--bot {
  align-self: flex-start;
  background: #f2eef8;
  padding: 6px 10px;
  border-radius: 12px 12px 12px 2px;
}
/* Very light "thinking" pulse — hidden entirely when reduced-motion is set */
.gobaobot__msg--bot[data-waiting] {
  animation: gobaobot-pulse 1s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .gobaobot__msg--bot[data-waiting] {
    animation: none;
  }
  .gobaobot {
    transition: none;
  }
}
@keyframes gobaobot-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

.gobaobot__form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.gobaobot__form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 8px;
  border: 1px solid #d9d2e6;
  border-radius: 8px;
}
.gobaobot__form button {
  background: #3b1d6e;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
