/* Floating support launcher + live chat panel */
.vt-support-root {
  --vt-s-panel: #ffffff;
  --vt-s-soft: #f8fafc;
  --vt-s-line: #e8edf3;
  --vt-s-text: #0f172a;
  --vt-s-muted: #64748b;
  --vt-s-accent: #0ea5e9;
  --vt-s-tg: #2AABEE;
  --vt-s-chat: #16a34a;
  position: fixed;
  z-index: 99980;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  font-family: Sora, system-ui, -apple-system, sans-serif;
  touch-action: none;
}

.vt-support-fab {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.vt-support-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.vt-support-root.is-open .vt-support-actions {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.vt-support-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  border-radius: 999px;
  padding: 11px 14px 11px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform .15s ease, filter .15s ease;
}

.vt-support-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.vt-support-btn svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.vt-support-btn-tg { background: linear-gradient(135deg, #2AABEE, #229ED9); }
.vt-support-btn-chat { background: linear-gradient(135deg, #34d399, #16a34a); }

.vt-support-main {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  cursor: grab;
  color: #04101f;
  background: radial-gradient(circle at 30% 25%, #7dd3fc, #38bdf8 45%, #0284c7);
  box-shadow:
    0 0 0 0 rgba(56, 189, 248, .55),
    0 14px 34px rgba(2, 132, 199, .45);
  display: grid;
  place-items: center;
  animation: vt-support-pulse 2.4s ease-in-out infinite;
  position: relative;
}

.vt-support-main:active { cursor: grabbing; }
.vt-support-main svg { width: 26px; height: 26px; }

.vt-support-root.is-dragging .vt-support-main {
  animation: none;
  cursor: grabbing;
}

@keyframes vt-support-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56,189,248,.5), 0 14px 34px rgba(2,132,199,.45); }
  50% { box-shadow: 0 0 0 12px rgba(56,189,248,0), 0 14px 34px rgba(2,132,199,.45); }
}

@media (prefers-reduced-motion: reduce) {
  .vt-support-main { animation: none; }
}

.vt-support-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(360px, calc(100vw - 28px));
  height: min(520px, calc(100dvh - 110px));
  background: var(--vt-s-panel);
  color: var(--vt-s-text);
  border: 1px solid var(--vt-s-line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .16);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.vt-support-root.is-chat .vt-support-panel { display: flex; }
.vt-support-root.is-chat .vt-support-actions { display: none; }

.vt-support-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--vt-s-line);
  background: linear-gradient(180deg, #f0f9ff, #fff);
}

.vt-support-panel-head strong { font-size: 14px; }
.vt-support-panel-head span { display: block; color: var(--vt-s-muted); font-size: 12px; margin-top: 2px; }

.vt-support-icon-btn {
  border: 0;
  background: transparent;
  color: var(--vt-s-muted);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.vt-support-icon-btn:hover { background: var(--vt-s-soft); color: var(--vt-s-text); }

.vt-support-panel-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f4f6f9;
}

.vt-support-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vt-support-form label {
  font-size: 12px;
  color: var(--vt-s-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vt-support-form input {
  border: 1px solid var(--vt-s-line);
  background: #fff;
  color: var(--vt-s-text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}

.vt-support-form button {
  border: 0;
  border-radius: 999px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: var(--vt-s-accent);
  color: #fff;
}

.vt-support-error {
  color: #e11d48;
  font-size: 12px;
  min-height: 1.2em;
}

.vt-support-bubble {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

.vt-support-bubble.guest {
  align-self: flex-end;
  background: var(--vt-s-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.vt-support-bubble.admin,
.vt-support-bubble.system {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--vt-s-line);
  border-bottom-left-radius: 4px;
}

.vt-support-bubble.system {
  opacity: .9;
  font-size: 12.5px;
  color: var(--vt-s-muted);
}

.vt-support-meta {
  font-size: 10px;
  color: inherit;
  opacity: .7;
  margin-top: 4px;
}

.vt-support-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--vt-s-line);
  background: #fff;
}

.vt-support-tools {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  background: var(--vt-s-soft);
  border: 1px solid var(--vt-s-line);
  border-radius: 16px;
  padding: 4px 6px 4px 4px;
}

.vt-support-tools textarea {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 110px;
  border: 0;
  background: transparent;
  color: var(--vt-s-text);
  border-radius: 12px;
  padding: 10px 8px;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.vt-support-attach {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
  color: var(--vt-s-muted);
}
.vt-support-tools input[type=file] { display: none; }

.vt-support-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--vt-s-muted);
  padding: 6px 8px;
  border: 1px dashed var(--vt-s-line);
  border-radius: 8px;
  background: var(--vt-s-soft);
}
.vt-support-preview button {
  border: 0;
  background: transparent;
  color: var(--vt-s-muted);
  cursor: pointer;
}

.vt-support-img {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin-top: 8px;
}
.vt-support-audio {
  display: block;
  width: 100%;
  margin-top: 8px;
}
.vt-support-file {
  display: inline-block;
  margin-top: 8px;
  color: #0284c7;
  font-weight: 600;
  text-decoration: none;
}

.vt-support-hint {
  color: var(--vt-s-muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .vt-support-root.is-chat {
    inset: 0 !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-width: none;
    touch-action: auto;
    z-index: 99990;
  }
  .vt-support-root.is-chat .vt-support-fab {
    display: none;
  }
  .vt-support-root.is-chat .vt-support-panel {
    position: fixed;
    inset: 0;
    right: 0 !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .vt-support-panel-head {
    padding: 12px 14px calc(12px + 0px);
  }
  .vt-support-compose {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .vt-support-tools textarea {
    font-size: 16px; /* prevent iOS zoom */
  }
  .vt-support-btn {
    padding: 12px 16px 12px 14px;
    font-size: 14px;
  }
  .vt-support-main {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 480px) {
  .vt-support-root:not(.is-chat) {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}
