:root {
  --support-blue: #2563eb;
  --support-blue-dark: #1d4ed8;
  --support-ink: #172033;
  --support-muted: #6b7280;
  --support-line: rgba(148, 163, 184, .34);
}
.support-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 24px;
  background: radial-gradient(circle at 28% 22%, #7dd3fc 0, #3b82f6 38%, #1d4ed8 100%);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(37, 99, 235, .38), 0 5px 14px rgba(15, 23, 42, .18);
  z-index: 9999;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.support-launcher::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(37, 99, 235, .25);
  border-radius: 28px;
  animation: support-pulse 2.4s ease-out infinite;
}
.support-launcher:hover { transform: translateY(-2px) scale(1.03); filter: saturate(1.1); }
.support-widget {
  position: fixed;
  right: 22px;
  bottom: 100px;
  width: 390px;
  max-width: calc(100vw - 24px);
  height: 620px;
  max-height: calc(100vh - 124px);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,250,252,.97));
  box-shadow: 0 28px 80px rgba(15, 23, 42, .22), 0 8px 22px rgba(15, 23, 42, .10);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  font-family: Inter, Arial, sans-serif;
}
.support-hidden { display: none !important; }
.support-header {
  position: relative;
  padding: 20px 20px 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 54%, #38bdf8 120%);
  color: #fff;
}
.support-header::before {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -72px;
  top: -112px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
}
.support-header-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.support-header-title { margin: 0; font-size: 18px; font-weight: 850; letter-spacing: -.02em; }
.support-header-subtitle { margin: 6px 0 0; max-width: 260px; font-size: 13px; line-height: 1.35; color: rgba(255,255,255,.82); }
.support-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.support-status-row { position: relative; display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; color: rgba(255,255,255,.9); }
.support-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 5px rgba(34,197,94,.18); }
.support-body { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #f5f7fb; }
.support-form { display: flex; flex-direction: column; gap: 11px; padding: 18px; }
.support-form input, .support-form textarea, .support-message-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--support-line);
  border-radius: 16px;
  padding: 13px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: rgba(255,255,255,.92);
  color: var(--support-ink);
  box-shadow: 0 1px 0 rgba(15,23,42,.02);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.support-form input:focus, .support-form textarea:focus, .support-message-input:focus {
  border-color: rgba(37,99,235,.72);
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
  background: #fff;
}
.support-form textarea { min-height: 108px; resize: vertical; }
.support-primary-btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 850;
  color: #fff;
  background: linear-gradient(135deg, var(--support-blue), #0ea5e9);
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(37,99,235,.24);
  transition: transform .16s ease, box-shadow .16s ease;
}
.support-primary-btn:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(37,99,235,.28); }
.support-note { margin: 2px 2px 0; font-size: 12px; line-height: 1.35; color: var(--support-muted); }
.support-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at 10% 0%, rgba(59,130,246,.08), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(14,165,233,.10), transparent 24%),
    #f5f7fb;
  scroll-behavior: smooth;
}
.support-message-row { max-width: 88%; display: grid; gap: 6px; animation: support-message-in .18s ease both; }
.support-message-user { align-self: flex-end; justify-items: end; }
.support-message-operator { align-self: flex-start; justify-items: start; }
.support-message-meta { display: flex; align-items: center; gap: 7px; color: #7b879a; font: 12px Inter, Arial, sans-serif; }
.support-message-user .support-message-meta { padding-right: 5px; }
.support-message-operator .support-message-meta { padding-left: 5px; }
.support-operator-avatar { width: 25px; height: 25px; border-radius: 999px; object-fit: cover; background: #dbeafe; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 4px 12px rgba(15,23,42,.10); }
.support-bubble {
  max-width: 100%;
  border-radius: 18px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.42;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}
.support-bubble-user { background: linear-gradient(135deg, #2563eb, #0ea5e9); color: #fff; border-bottom-right-radius: 7px; box-shadow: 0 10px 24px rgba(37,99,235,.22); }
.support-bubble-operator { background: rgba(255,255,255,.96); border: 1px solid rgba(203,213,225,.82); color: var(--support-ink); border-bottom-left-radius: 7px; box-shadow: 0 8px 20px rgba(15,23,42,.06); }
.support-chat-send {
  border-top: 1px solid rgba(203,213,225,.72);
  padding: 12px;
  display: flex;
  gap: 9px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
}
.support-chat-send button {
  min-width: 50px;
  border: 0;
  border-radius: 16px;
  padding: 0 16px;
  font-weight: 850;
  color: #fff;
  background: linear-gradient(135deg, var(--support-blue), #0ea5e9);
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(37,99,235,.22);
}
@keyframes support-pulse { 0% { opacity: .8; transform: scale(.92); } 80%, 100% { opacity: 0; transform: scale(1.18); } }
@keyframes support-message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 520px) {
  .support-launcher { right: 16px; bottom: 16px; width: 60px; height: 60px; border-radius: 22px; }
  .support-widget { inset: auto 10px 86px 10px; width: auto; height: min(620px, calc(100vh - 104px)); border-radius: 24px; }
  .support-header { padding: 18px 18px 16px; }
}
