.sb-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  font-family: "DM Sans", "Plus Jakarta Sans", system-ui, sans-serif;
  color: #2c2c34;
}
html.m-tab .sb-chat { bottom: 5.25rem; }
.sb-chat-launch {
  display: inline-flex;
  width: 64px;
  height: 64px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #f25ca8 0%, #e21886 55%, #c41068 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(196, 16, 104, 0.38);
  cursor: pointer;
}
.sb-chat-launch svg { width: 30px; height: 30px; }
.sb-chat-launch.is-hidden { display: none; }
.sb-chat-launch.is-attention { animation: sb-chat-pop 0.6s ease; }
@keyframes sb-chat-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.sb-chat-teaser {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(340px, calc(100vw - 36px));
  margin: 0;
  padding: 14px 14px 14px 12px;
  border: 1px solid #f3d0e4;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(190, 40, 110, 0.16);
}
.sb-chat-teaser[hidden] { display: none !important; }
.sb-chat-teaser::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-right: 1px solid #f3d0e4;
  border-bottom: 1px solid #f3d0e4;
  transform: rotate(45deg);
}
.sb-chat-teaser-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid #f0c6dc;
  border-radius: 999px;
  background: #fff;
  color: #c73d86;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.sb-chat-teaser-open {
  display: flex;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 4px 28px 2px 2px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.sb-chat-agent {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 16px;
  object-fit: cover;
  background: #f3ece4;
}
.sb-chat-agent-fallback {
  display: inline-flex;
  width: 72px;
  height: 72px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #f8d5e8;
  color: #a31466;
  font-size: 22px;
  font-weight: 700;
}
.sb-chat-teaser-copy { min-width: 0; padding-top: 2px; }
.sb-chat-teaser-name {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #2a2a33;
}
.sb-chat-teaser-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: #4b4b57;
}
.sb-chat-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(372px, calc(100vw - 24px));
  height: min(640px, calc(100vh - 36px));
  flex-direction: column;
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(180deg, #fff 0%, #fff7fb 100%);
  box-shadow: 0 24px 60px rgba(80, 10, 40, 0.28);
}
html.m-tab .sb-chat-panel { height: min(640px, calc(100vh - 7.5rem)); }
.sb-chat-panel[hidden] { display: none !important; }
.sb-chat-panel.is-wide { width: min(460px, calc(100vw - 24px)); }
.sb-chat-head {
  flex: none;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, #ef3b98 0%, #e21886 70%, #d4147c 100%);
  color: #fff;
}
.sb-chat-head-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sb-chat-icon-btn {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.sb-chat-icon-btn:hover { background: rgba(255, 255, 255, 0.14); }
.sb-chat-title {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sb-chat-audio {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #ffe8f4 100%);
  color: #3a3a44;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.sb-chat-audio-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  color: #e21886;
}
.sb-chat-who {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 14px 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}
.sb-chat-who img, .sb-chat-who-fallback {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
}
.sb-chat-who-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8d5e8;
  color: #a31466;
  font-size: 14px;
  font-weight: 700;
}
.sb-chat-who strong { display: block; font-size: 14px; }
.sb-chat-who span { display: block; font-size: 12px; color: #7a7a86; }
.sb-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}
.sb-chat-card {
  position: relative;
  margin: 0 0 12px;
  padding: 18px 16px 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(80, 20, 50, 0.06);
}
.sb-chat-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 10px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, #fff0f7, rgba(255, 240, 247, 0));
}
.sb-chat-time {
  display: block;
  margin-bottom: 8px;
  text-align: right;
  font-size: 12px;
  color: #9a9aa6;
}
.sb-chat-card p { margin: 0 0 8px; font-size: 15px; line-height: 1.45; color: #2e2e38; }
.sb-chat-card p:last-child { margin-bottom: 0; }
.sb-chat-card p.is-strong { font-weight: 700; }
.sb-chat-mine {
  margin: 0 0 12px auto;
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 16px 16px 4px 16px;
  background: #e21886;
  color: #fff;
}
.sb-chat-mine p { margin: 0; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.sb-chat-mine time { display: block; margin-top: 4px; text-align: right; font-size: 11px; color: rgba(255,255,255,0.8); }
.sb-chat-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 12px 12px;
  padding: 6px 8px 6px 16px;
  border: 1px solid #eee;
  border-radius: 999px;
  background: #fff;
}
.sb-chat-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  outline: none;
  color: #2c2c34;
}
.sb-chat-form input::placeholder { color: #b0b0b8; }
.sb-chat-send {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #b0b0b8;
  cursor: pointer;
}
.sb-chat-send.is-ready { color: #e21886; }
.sb-chat-note {
  margin: 0 16px 8px;
  font-size: 12px;
  color: #9a6078;
}
