/* ThinkAI Kids customer service widget — floating chat. */
.cs-widget-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD740, #FF9F1C);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 159, 28, 0.4);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
  font-size: 24px;
}
.cs-widget-toggle:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(255, 159, 28, 0.5); }
.cs-widget-toggle:focus { outline: 3px solid #FFFFFF80; outline-offset: 2px; }
.cs-widget-toggle.open { transform: rotate(45deg); }
.cs-widget-badge {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #FF4D6A; color: #FFF; font-size: 11px;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid #FFF;
}
.cs-widget-panel {
  position: fixed;
  right: 24px;
  bottom: 100px;
  width: 360px;
  max-height: 540px;
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(43, 35, 66, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans', sans-serif;
}
.cs-widget-panel.open { display: flex; animation: cs-pop .2s ease; }
@keyframes cs-pop { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cs-widget-head {
  background: linear-gradient(135deg, #2B2342, #4D4A8C);
  color: #FFF;
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
}
.cs-widget-head-avatar { width: 36px; height: 36px; border-radius: 50%; background: #FFD740; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.cs-widget-head-text { flex: 1; }
.cs-widget-head-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.cs-widget-head-sub { font-size: 12px; opacity: 0.75; margin-top: 2px; }
.cs-widget-close { background: transparent; border: none; color: #FFF; font-size: 22px; cursor: pointer; padding: 0; line-height: 1; opacity: 0.7; }
.cs-widget-close:hover { opacity: 1; }
.cs-widget-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #F7F4ED;
  min-height: 240px;
  max-height: 360px;
}
.cs-msg { display: flex; margin-bottom: 12px; }
.cs-msg-text {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  max-width: 80%;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.cs-msg.user { justify-content: flex-end; }
.cs-msg.user .cs-msg-text { background: #FFD740; color: #2B2342; border-bottom-right-radius: 4px; }
.cs-msg.bot { justify-content: flex-start; }
.cs-msg.bot .cs-msg-text { background: #FFFFFF; color: #2B2342; border: 1px solid #E5DAC4; border-bottom-left-radius: 4px; }
.cs-msg-ts { font-size: 10px; opacity: 0.5; margin-top: 2px; }
.cs-widget-suggested {
  padding: 0 16px 12px;
  background: #F7F4ED;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.cs-chip {
  padding: 6px 10px;
  background: #FFFFFF;
  border: 1px solid #E5DAC4;
  border-radius: 16px;
  font-size: 12px;
  color: #2B2342;
  cursor: pointer;
  white-space: nowrap;
}
.cs-chip:hover { background: #FFF7DA; border-color: #FFD740; }
.cs-widget-foot {
  border-top: 1px solid #E5DAC4;
  padding: 12px;
  display: flex;
  gap: 8px;
  background: #FFFFFF;
}
.cs-widget-input {
  flex: 1;
  border: 1px solid #E5DAC4;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: #F7F4ED;
  outline: none;
  font-family: inherit;
}
.cs-widget-input:focus { border-color: #FFD740; background: #FFF; }
.cs-widget-send {
  background: linear-gradient(135deg, #FFD740, #FF9F1C);
  border: none;
  color: #2B2342;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}
.cs-widget-send:disabled { opacity: 0.5; cursor: not-allowed; }
.cs-widget-foot-note {
  padding: 0 14px 8px;
  font-size: 10px;
  color: #888;
  background: #FFF;
  text-align: center;
}

@media (max-width: 480px) {
  .cs-widget-toggle { right: 16px; bottom: 16px; width: 52px; height: 52px; font-size: 24px; }
  .cs-widget-panel { left: 12px; right: 12px; bottom: 80px; width: auto; max-height: 70vh; }
}
