#wiweb-ai-chatbot-root {
  --wiweb-chat-primary: #0b1730;
  --wiweb-chat-secondary: #53d8f1;
  --wiweb-chat-gradient: linear-gradient(135deg, var(--wiweb-chat-primary) 0%, color-mix(in srgb, var(--wiweb-chat-primary) 72%, #53d8f1 28%) 100%);
  --wiweb-chat-primary-soft: color-mix(in srgb, var(--wiweb-chat-primary) 82%, #ffffff 18%);
  --wiweb-chat-text: #17221b;
  --wiweb-chat-muted: #6b766f;
  --wiweb-chat-surface: #ffffff;
  --wiweb-chat-bg: #f5f8f6;
  --wiweb-chat-border: #e5ebe7;
  font-family: inherit;
  color: var(--wiweb-chat-text);
}

/* Launcher - compact support style */
.wiweb-chat-launcher {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 99999;
  height: 66px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-align: left;
  overflow: visible;
  transition: transform .22s ease, opacity .18s ease;
  -webkit-tap-highlight-color: transparent;
  margin: 0 !important;
  min-height: 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  line-height: 1 !important;
  box-sizing: border-box;
}
.wiweb-chat-launcher:hover { transform: translateY(-2px); }
.wiweb-chat-launcher:active { transform: translateY(0) scale(.985); }
.wiweb-chat-launcher.is-hidden { opacity: 0; pointer-events: none; transform: translateY(8px) scale(.96); }

.wiweb-chat-launcher-avatar-wrap {
  position: relative;
  z-index: 2;
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: inline-flex;
}
.wiweb-chat-launcher-avatar,
.wiweb-chat-header-avatar,
.wiweb-chat-message-avatar {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
  color: var(--wiweb-chat-primary);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65), 0 6px 14px rgba(0,0,0,.10);
}
.wiweb-chat-launcher-avatar {
  width: 62px;
  height: 62px;
  border: 3px solid #fff;
  box-shadow:
    0 0 0 2px rgba(95, 219, 255, .58),
    0 0 18px rgba(236, 148, 207, .34),
    0 8px 20px rgba(15, 23, 42, .20);
}
.wiweb-chat-header-avatar { width: 48px; height: 48px; }
.wiweb-chat-message-avatar { width: 30px; height: 30px; margin-top: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.wiweb-chat-launcher-avatar svg { width: 30px; height: 30px; }
.wiweb-chat-header-avatar svg { width: 28px; height: 28px; }
.wiweb-chat-message-avatar svg { width: 18px; height: 18px; }
.wiweb-chat-launcher-avatar.has-image,
.wiweb-chat-header-avatar.has-image,
.wiweb-chat-message-avatar.has-image { background: #fff; }
.wiweb-chat-launcher-avatar.has-image img,
.wiweb-chat-header-avatar.has-image img,
.wiweb-chat-message-avatar.has-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  padding: 0;
  object-position: center center;
  transform: none;
}

.wiweb-chat-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  z-index: 4;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #f23854;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 2px 7px rgba(242, 56, 84, .35);
  transition: opacity .18s ease, transform .18s ease;
}
.wiweb-chat-badge.is-seen { opacity: 0; transform: scale(.7); pointer-events: none; }

.wiweb-chat-launcher-copy {
  min-width: 0;
  height: 32px;
  margin-left: 8px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  background: #0b1730;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(11, 23, 48, .22);
  white-space: nowrap;
}
.wiweb-chat-launcher-copy strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #fff;
  white-space: nowrap;
}
.wiweb-chat-launcher-copy small {
  margin: 0;
  display: inline;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  color: #53d8f1;
}
.wiweb-chat-divider {
  color: rgba(255,255,255,.72);
  font-size: 10px;
  line-height: 1;
}
.wiweb-chat-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 12px;
  color: rgba(255,255,255,.95);
}
.wiweb-chat-status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #44d7a8;
  box-shadow: 0 0 0 3px rgba(68,215,168,.12);
  animation: wiweb-chat-pulse 1.9s ease-in-out infinite;
}
.wiweb-chat-header-status .wiweb-chat-status-dot {
  width: 8px;
  height: 8px;
  flex-basis: 8px;
  background: #45e57a;
  box-shadow: 0 0 0 4px rgba(69,229,122,.16);
}
@keyframes wiweb-chat-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(68,215,168,.14); }
  50% { box-shadow: 0 0 0 6px rgba(68,215,168,.035); }
}

/* Panel */
.wiweb-chat-panel {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 100000;
  width: min(410px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 44px));
  background: var(--wiweb-chat-surface);
  border: 1px solid rgba(20, 70, 42, .08);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(22, 46, 32, .24), 0 7px 24px rgba(0, 0, 0, .08);
  overflow: hidden;
  display: none;
  flex-direction: column;
  transform-origin: left bottom;
}
.wiweb-chat-panel.is-open { display: flex; animation: wiweb-chat-open .22s ease-out both; }
@keyframes wiweb-chat-open {
  from { opacity: 0; transform: translateY(12px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wiweb-chat-header {
  min-height: 88px;
  padding: 16px 18px;
  background: var(--wiweb-chat-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.wiweb-chat-header::after {
  content: '';
  position: absolute;
  right: -34px;
  top: -52px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.wiweb-chat-header::before {
  content: '';
  position: absolute;
  right: 18px;
  top: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}
.wiweb-chat-header-copy { min-width: 0; flex: 1; position: relative; z-index: 1; }
.wiweb-chat-title { font-weight: 780; font-size: 18px; line-height: 1.25; letter-spacing: -.01em; }
.wiweb-chat-header-status { margin-top: 5px; font-weight: 600; }
.wiweb-chat-close {
  position: relative;
  z-index: 2;
  margin-left: auto;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}
.wiweb-chat-close:hover { background: rgba(255,255,255,.22); transform: rotate(5deg); }
.wiweb-chat-close,
.wiweb-chat-send {
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  line-height: 0 !important;
  font-size: 0 !important;
}
.wiweb-chat-close:focus-visible,
.wiweb-chat-send:focus-visible,
.wiweb-chat-launcher:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.30), 0 0 0 5px rgba(83,216,241,.24);
}
.wiweb-chat-close svg { width: 18px !important; height: 18px !important; min-width: 18px !important; min-height: 18px !important; display: block !important; flex: 0 0 18px !important; overflow: visible !important; }
.wiweb-chat-send svg { width: 20px !important; height: 20px !important; min-width: 20px !important; min-height: 20px !important; display: block !important; flex: 0 0 20px !important; overflow: visible !important; }

/* Messages */
.wiweb-chat-messages {
  margin-bottom: 0;
  flex: 1;
  overflow-y: auto;
  padding: 18px 15px 14px;
  background: radial-gradient(circle at 0 0, rgba(0,104,56,.035), transparent 180px), var(--wiweb-chat-bg);
  scroll-behavior: smooth;
}
.wiweb-chat-messages::-webkit-scrollbar { width: 7px; }
.wiweb-chat-messages::-webkit-scrollbar-thumb { background: #d6dfd9; border-radius: 99px; }
.wiweb-chat-msg { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 13px; }
.wiweb-chat-msg.user { justify-content: flex-end; }
.wiweb-chat-msg.assistant { justify-content: flex-start; }
.wiweb-chat-bubble {
  max-width: 84%;
  padding: 11px 13px;
  border-radius: 16px;
  background: #fff;
  color: #243129;
  border: 1px solid #e8eeea;
  box-shadow: 0 3px 12px rgba(20,50,31,.055);
  line-height: 1.55;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.wiweb-chat-bubble.is-plain { white-space: pre-wrap; }
.wiweb-chat-msg.user .wiweb-chat-bubble {
  background: var(--wiweb-chat-gradient);
  color: #fff;
  border-color: transparent;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 14px rgba(0,104,56,.14);
}
.wiweb-chat-msg.assistant .wiweb-chat-bubble { border-bottom-left-radius: 5px; }
.wiweb-chat-msg.assistant .wiweb-chat-bubble p { margin: 0 0 8px; }
.wiweb-chat-msg.assistant .wiweb-chat-bubble p:last-child { margin-bottom: 0; }
.wiweb-chat-msg.assistant .wiweb-chat-bubble ul,
.wiweb-chat-msg.assistant .wiweb-chat-bubble ol { margin: 7px 0 9px 18px; padding: 0; }
.wiweb-chat-msg.assistant .wiweb-chat-bubble li { margin: 4px 0; }
.wiweb-chat-msg.assistant .wiweb-chat-bubble a { color: var(--wiweb-chat-primary); text-decoration: underline; text-underline-offset: 2px; font-weight: 650; }
.wiweb-chat-msg.assistant .wiweb-chat-bubble h3,
.wiweb-chat-msg.assistant .wiweb-chat-bubble h4,
.wiweb-chat-msg.assistant .wiweb-chat-bubble h5 { margin: 9px 0 6px; line-height: 1.3; color: #17221b; }
.wiweb-chat-msg.assistant .wiweb-chat-bubble blockquote { margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--wiweb-chat-primary); background: #f7faf8; border-radius: 0 8px 8px 0; }

/* Tables */
.wiweb-chat-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 10px 0 4px;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--wiweb-chat-border);
  border-radius: 12px;
  background: #fff;
}
.wiweb-chat-table-wrap table { width: 100%; min-width: 340px; border-collapse: collapse; margin: 0; font-size: 12.5px; }
.wiweb-chat-table-wrap th,
.wiweb-chat-table-wrap td { padding: 9px 10px; border-right: 1px solid var(--wiweb-chat-border); border-bottom: 1px solid var(--wiweb-chat-border); text-align: left; vertical-align: top; white-space: normal; }
.wiweb-chat-table-wrap th { background: color-mix(in srgb, var(--wiweb-chat-primary) 7%, #ffffff 93%); font-weight: 750; color: #17221b; }
.wiweb-chat-table-wrap tr:nth-child(even) td { background: #fbfcfb; }
.wiweb-chat-table-wrap tr:last-child td { border-bottom: 0; }
.wiweb-chat-table-wrap th:last-child,
.wiweb-chat-table-wrap td:last-child { border-right: 0; }

/* Composer */
.wiweb-chat-form {
  display: flex;
  gap: 10px;
  padding: 13px 14px 14px;
  border-top: 1px solid #eef2ef;
  background: #fff;
}
.wiweb-chat-input {
  flex: 1;
  height: 50px;
  border: 1px solid #dce4df;
  border-radius: 999px;
  padding: 0 17px;
  outline: none;
  font: inherit;
  font-size: 14px;
  color: var(--wiweb-chat-text);
  background: #fbfcfb;
  min-width: 0;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.wiweb-chat-input::placeholder { color: #909a94; }
.wiweb-chat-input:focus {
  border-color: var(--wiweb-chat-primary);
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wiweb-chat-primary) 12%, transparent 88%);
}
.wiweb-chat-send {
  padding: 0 !important;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: var(--wiweb-chat-gradient);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0,104,56,.22);
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.wiweb-chat-send:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,104,56,.28); }
.wiweb-chat-send:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }

/* Typing animation */
.wiweb-chat-typing { display: inline-flex; align-items: center; gap: 4px; min-width: 54px; min-height: 20px; }
.wiweb-chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9aa79f; animation: wiweb-chat-typing 1.1s infinite ease-in-out; }
.wiweb-chat-typing span:nth-child(2) { animation-delay: .13s; }
.wiweb-chat-typing span:nth-child(3) { animation-delay: .26s; }
@keyframes wiweb-chat-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .48; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 480px) {
  .wiweb-chat-launcher {
    left: 14px;
    bottom: 45px;
    width: 62px;
    min-width: 62px;
    height: 62px;
  }
  .wiweb-chat-launcher-copy { display: none; }
  .wiweb-chat-launcher-avatar-wrap { width: 58px; height: 58px; flex-basis: 58px; }
  .wiweb-chat-launcher-avatar { width: 58px; height: 58px; margin: 0; }
  .wiweb-chat-panel { left: 10px; bottom: 10px; width: calc(100vw - 20px); height: min(650px, calc(100vh - 20px)); border-radius: 20px; }
  .wiweb-chat-header { min-height: 80px; padding: 14px; }
  .wiweb-chat-messages { margin-bottom: 0; padding: 15px 11px 12px; }
  .wiweb-chat-bubble { max-width: 86%; font-size: 13.5px; }
  .wiweb-chat-message-avatar { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .wiweb-chat-launcher,
  .wiweb-chat-panel.is-open,
  .wiweb-chat-status-dot,
  .wiweb-chat-typing span { animation: none !important; transition: none !important; }
}
