#wcw *, #wcw *::before, #wcw *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
#wcw-btn {
  position: fixed; bottom: 28px; right: 28px; z-index: 2147483645;
  width: 58px; height: 58px; border-radius: 16px; border: none; cursor: pointer;
  background: var(--wc-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.18s;
}
#wcw-btn:hover { transform: scale(1.1) rotate(-4deg); box-shadow: 0 8px 32px rgba(0,0,0,0.22); }
#wcw-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
#wcw-btn .wc-io { display: flex; }
#wcw-btn .wc-ic { display: none; }
#wcw-btn.open .wc-io { display: none; }
#wcw-btn.open .wc-ic { display: flex; }
#wcw-btn svg { width: 24px; height: 24px; }
#wcw-panel {
  position: fixed; bottom: 100px; right: 28px; z-index: 2147483646;
  width: 370px; max-width: calc(100vw - 40px);
  height: 560px; max-height: calc(100svh - 120px);
  border-radius: 24px; overflow: hidden;
  display: flex; flex-direction: column;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.06);
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease;
}
#wcw-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }
#wcw-header {
  padding: 18px 20px 16px; flex-shrink: 0;
  background: #fff; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
}
#wcw-header-left { display: flex; align-items: center; gap: 12px; }
#wcw-hav {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--wc-accent); display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff; overflow: hidden;
}
#wcw-hav img { width: 100%; height: 100%; object-fit: cover; }
#wcw-hav-logo { max-width: 70px; max-height: 32px; object-fit: contain; }
#wcw-htitle { font-size: 15px; font-weight: 600; color: #0f172a; line-height: 1.2; }
#wcw-hstatus { font-size: 12px; color: #64748b; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
#wcw-hstatus::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
#wcw-hright { display: flex; align-items: center; gap: 4px; }
.wcw-ibtn {
  width: 34px; height: 34px; border-radius: 10px; border: none; cursor: pointer;
  background: #f8fafc; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.wcw-ibtn:hover { background: #f1f5f9; color: #0f172a; }
.wcw-ibtn svg { width: 16px; height: 16px; }
#wcw-dd {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 220px; border-radius: 14px;
  background: #fff; border: 1px solid #e8ecf0;
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
  opacity: 0; transform: translateY(-8px) scale(0.95);
  transform-origin: top right; pointer-events: none;
  transition: opacity 0.18s, transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 10; overflow: hidden;
}
#wcw-dd.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.wcw-ddi {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px !important; cursor: pointer; color: #334155;
  font-size: 14px; font-weight: 500; border: none; background: none; width: 100%; text-align: left;
  transition: background 0.12s;
}
.wcw-ddi:hover { background: #f8fafc; }
.wcw-ddi svg { width: 16px; height: 16px; color: #94a3b8; flex-shrink: 0; }
.wcw-ddiv { height: 1px; background: #f1f5f9; margin: 2px 0; }
#wcw-msgs {
  flex: 1; overflow-y: auto; padding: 20px 16px;
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth; background: #fafbfc;
}
#wcw-msgs::-webkit-scrollbar { width: 4px; }
#wcw-msgs::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }
.wcw-row { display: flex; align-items: flex-end; gap: 8px; }
.wcw-row.user { flex-direction: row-reverse; }
.wcw-av {
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0;
  background: var(--wc-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; overflow: hidden;
  align-self: flex-start; margin-top: 20px;
}
.wcw-av img { width: 100%; height: 100%; object-fit: cover; }
.wcw-row.user .wcw-av { display: none; }
.wcw-col { display: flex; flex-direction: column; gap: 4px; max-width: 78%; }
.wcw-row.user .wcw-col { align-items: flex-end; }
.wcw-sender { font-size: 11px; font-weight: 600; color: #94a3b8; padding: 0 4px; }
.wcw-bub {
  padding: 8px 12px !important; border-radius: 10px;
  font-size: 14px; font-weight: 400; line-height: 1.65; color: #1e293b;
  background: #f3f4f5; border: none;
  animation: wcwIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.wcw-row.user .wcw-bub {
  padding: 12px 16px !important; border-radius: 18px 18px 4px 18px;
  background: var(--wc-accent); color: #fff; border: none;
}
@keyframes wcwIn { from { opacity: 0; transform: scale(0.94) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.wcw-dots { display: flex; align-items: center; gap: 4px; padding: 4px 0; }
.wcw-dots span { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.wcw-dots span:nth-child(1) { animation: wcwDot 1.3s infinite 0s; }
.wcw-dots span:nth-child(2) { animation: wcwDot 1.3s infinite 0.18s; }
.wcw-dots span:nth-child(3) { animation: wcwDot 1.3s infinite 0.36s; }
@keyframes wcwDot {
  0%,60%,100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.wcw-hcard {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left;
  background: #fff; border: 1.5px solid #e8ecf0; border-radius: 14px;
  padding: 14px 16px !important; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit;
}
.wcw-hcard div:last-child { color: #475569; }
#wcw.dark .wcw-hcard div:last-child { color: #f1f5f9; }
#wcw.dark .wcw-hcard { background: #1e293b; border: 0px solid transparent; }
#wcw.dark .wcw-hcard:hover { border-color: var(--wc-accent); box-shadow: 0 4px 12px rgba(0,0,0,0.4); border: 1px solid #e8ecf0; }
#wcw-help {
  position: fixed; bottom: 100px; right: 28px;
  background: #0f172a; color: #fff; padding: 10px 14px; border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex; align-items: center; gap: 10px; z-index: 2147483644;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: all 0.25s ease;
}
#wcw-help.show { opacity: 1; transform: translateY(0); pointer-events: all; }
#wcw-help button { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 14px; }
#wcw-footer {
  padding: 14px 16px 18px; flex-shrink: 0;
  background: #fff; border-top: 1px solid #f0f0f0;
}
#wcw-irow { display: flex; gap: 10px; align-items: flex-end; }
#wcw-input {
  flex: 1; padding: 11px 16px; border-radius: 14px;
  background: #f8fafc; color: #0f172a; font-size: 14px; font-weight: 400;
  border: 1.5px solid #e8ecf0; outline: none; resize: none;
  min-height: 44px; max-height: 110px; line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
}
#wcw-input::placeholder { color: #94a3b8; }
#wcw-input:focus { border-color: var(--wc-accent); background: #fff; }
#wcw-send {
  width: 44px; height: 44px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--wc-accent); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s, transform 0.12s;
}
#wcw-send:hover { opacity: 0.88; }
#wcw-send:active { transform: scale(0.92); }
#wcw-send:disabled { opacity: 0.35; cursor: not-allowed; }
#wcw-send svg { width: 18px; height: 18px; }
#wcw-hint { text-align: center; margin-top: 10px; font-size: 11px; color: #c8d0dc; }
#wcw.dark #wcw-panel { background: #0f172a; box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06); }
#wcw.dark #wcw-header { background: #0f172a; border-bottom-color: #1e293b; }
#wcw.dark #wcw-htitle { color: #f1f5f9; }
#wcw.dark #wcw-hstatus { color: #64748b; }
#wcw.dark .wcw-ibtn { background: #1e293b; color: #94a3b8; }
#wcw.dark .wcw-ibtn:hover { background: #334155; color: #f1f5f9; }
#wcw.dark #wcw-msgs { background: #0f172a; }
#wcw.dark .wcw-bub { color: #cbd5e1; background: #1e293b; }
#wcw.dark .wcw-sender { color: #475569; }
#wcw.dark .wcw-row.user .wcw-bub { color: #fff; }
#wcw.dark #wcw-footer { background: #0f172a; border-top-color: #1e293b; }
#wcw.dark #wcw-input { background: #1e293b; border-color: #334155; color: #f1f5f9; }
#wcw.dark #wcw-input:focus { background: #1e293b; }
#wcw.dark #wcw-input::placeholder { color: #475569; }
#wcw.dark #wcw-dd { background: #1e293b; border-color: #334155; }
#wcw.dark .wcw-ddi { color: #cbd5e1; }
#wcw.dark .wcw-ddi:hover { background: #334155; }
#wcw.dark .wcw-ddiv { background: #334155; }
#wcw.dark #wcw-hint { color: #334155; }
@media (max-width: 480px) {
  #wcw-panel { width: 100vw; max-width: 100vw; right: 0; bottom: 0; border-radius: 24px 24px 0 0; height: 88svh; max-height: 88svh; }
  #wcw-btn { bottom: 20px; right: 20px; }
}
