.support-widget [hidden] { display: none !important; }
.support-widget button { border: 0; padding: 0; background: transparent; font: inherit; color: inherit; line-height: 1.4; }
.support-widget p { color: inherit; }
.support-widget .support-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.support-widget {
  --support-text: #283343;
  --support-muted: #7c889c;
  --support-surface: #fff;
  --support-border: #e9edf5;
  --support-primary: #4264ee;
  --support-hover: #eef2ff;
  --support-scrollbar-thumb: #c4cddd;
  --support-scrollbar-thumb-hover: #9ba9c0;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  color: var(--support-text);
  font-size: 14px;
  line-height: 1.5;
}

.dark .support-widget {
  --support-text: #e4eaf5;
  --support-muted: #99a8c0;
  --support-surface: #172338;
  --support-border: #2a3852;
  --support-primary: #5a7bff;
  --support-hover: #243453;
  --support-scrollbar-thumb: #465673;
  --support-scrollbar-thumb-hover: #65799a;
}

.support-widget :is(.support-messages, .support-history, textarea)::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.support-widget :is(.support-messages, .support-history, textarea)::-webkit-scrollbar-track,
.support-widget :is(.support-messages, .support-history, textarea)::-webkit-scrollbar-corner {
  background: transparent;
}
.support-widget :is(.support-messages, .support-history, textarea)::-webkit-scrollbar-thumb {
  min-height: 36px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--support-scrollbar-thumb);
  background-clip: padding-box;
}
.support-widget :is(.support-messages, .support-history, textarea)::-webkit-scrollbar-thumb:hover {
  background-color: var(--support-scrollbar-thumb-hover);
}
.support-widget :is(.support-messages, .support-history, textarea)::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
@supports not selector(::-webkit-scrollbar) {
  .support-widget :is(.support-messages, .support-history, textarea) {
    scrollbar-width: thin;
    scrollbar-color: var(--support-scrollbar-thumb) transparent;
  }
  .support-widget :is(.support-messages, .support-history, textarea):hover {
    scrollbar-color: var(--support-scrollbar-thumb-hover) transparent;
  }
}

.support-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 24px));
  height: min(700px, calc(100vh - 130px));
  height: min(700px, calc(100dvh - 130px));
  overflow: hidden;
  border: 2px solid var(--support-surface);
  border-radius: 16px;
  background: linear-gradient(155deg, #dce2fb 0, #f5f7ff 165px, #fbfcff 300px);
  box-shadow:
    0 16px 60px #182c551f,
    0 3px 12px #182c5508;
  animation: support-panel-enter 180ms ease-out;
}

.dark .support-panel {
  background: linear-gradient(155deg, #253762 0, #142137 180px, #111d30 300px);
  box-shadow: 0 16px 60px #0006;
}

.support-header {
  cursor: grab;
  touch-action: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 10px 16px;
  flex-shrink: 0;
}
.support-brand-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  padding: 8px 12px 8px 9px;
  border-radius: 40px;
  background: #ffffff80;
  box-shadow: 0 3px 12px #30438310;
}
.dark .support-brand-pill {
  background: #172338b3;
}
.support-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  object-fit: contain;
  padding: 4px;
  border-radius: 50%;
  background: #fff;
}
.support-brand-pill .support-avatar {
  width: 38px;
  height: 38px;
}
.support-brand-copy {
  min-width: 0;
  flex: 1;
}
.support-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.support-demo-badge {
  border-radius: 4px;
  padding: 1px 5px;
  color: #4264dd;
  background: #e7edff;
  font-size: 10px;
}
.dark .support-demo-badge {
  color: #b0c5ff;
  background: #2b3e68;
}
.support-hours {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: #56657a;
  font-size: 11px;
  white-space: nowrap;
}
.dark .support-hours {
  color: #a9b8d0;
}
.support-hours > span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
}
.support-online-dot {
  width: 6px;
  height: 6px;
  margin-left: 3px;
  flex-shrink: 0;
  background: #23b780;
  border-radius: 50%;
}
.support-online-dot[data-online='false'] {
  background: var(--support-muted);
}
.support-connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  color: var(--support-muted);
  font-size: 11px;
}
.support-connection-status span {
  flex: 1;
}
.support-send-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--support-muted);
  font-size: 11px;
}
.support-load-earlier {
  display: block;
  margin: 6px auto 12px;
  color: var(--support-primary);
  font-size: 12px;
}
.support-retry-message {
  display: block;
  margin: 5px 0 0 auto;
  color: var(--support-primary);
  font-size: 11px;
}
.support-history-empty {
  margin-bottom: 15px;
  color: var(--support-muted);
  font-size: 12px;
}
.support-widget button:disabled {
  cursor: not-allowed;
}
.support-demo-notice {
  margin: 0 20px 2px;
  color: var(--support-muted);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}
.support-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  color: #596a82;
  transition: background 150ms;
}
.dark .support-icon-button {
  color: #a9b8d0;
}
.support-icon-button:hover {
  background: var(--support-hover);
}
.support-widget button:focus-visible,
.support-widget a:focus-visible {
  outline: 2px solid var(--support-primary);
  outline-offset: 3px;
}
.support-messages {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 18px 12px;
}
.support-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0 25px;
  color: var(--support-muted);
  font-size: 11px;
}
.support-date-divider::before,
.support-date-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--support-border);
}
.support-message-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 15px;
}
.support-message-content {
  min-width: 0;
  max-width: calc(100% - 45px);
}
.support-message-bubble {
  padding: 11px 13px;
  border: 1px solid var(--support-border);
  border-radius: 9px;
  border-top-left-radius: 4px;
  background: var(--support-surface);
  box-shadow: 0 1px 3px #1f293705;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.support-message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  color: inherit;
}
.support-message-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--support-muted);
  font-size: 10px;
}
.support-message-user {
  justify-content: flex-end;
}
.support-message-user .support-message-bubble {
  border: 0;
  border-radius: 9px 4px 9px 9px;
  background: var(--support-primary);
  color: #fff;
}
.support-message-user .support-message-meta {
  justify-content: flex-end;
}
.support-message-user .support-message-meta svg {
  color: var(--support-primary);
}
.support-quick-help {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  margin: 20px 0 12px 45px;
}
.support-quick-help > p {
  margin-bottom: 2px;
  color: var(--support-muted);
  font-size: 11px;
}
.support-quick-help > button {
  max-width: 100%;
  padding: 7px 11px;
  border: 1px solid #dce4ff;
  border-radius: 16px;
  background: #ffffffb3;
  color: #4264dd;
  font-size: 12px;
  text-align: left;
  transition: background 150ms;
}
.support-quick-help > button:hover {
  background: var(--support-hover);
}
.dark .support-quick-help > button {
  border-color: #304667;
  background: #172338;
  color: #abc2ff;
}
.support-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--support-border);
  border-radius: 9px;
  background: var(--support-surface);
}
.support-typing > span:not(.sr-only) {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--support-muted);
  animation: support-typing 1s ease-in-out infinite;
}
.support-typing > span:nth-child(2) {
  animation-delay: 150ms;
}
.support-typing > span:nth-child(3) {
  animation-delay: 300ms;
}
.support-composer {
  flex-shrink: 0;
  padding: 10px 16px 10px;
}
.support-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 9px;
  border: 1px solid var(--support-border);
  border-radius: 26px;
  background: var(--support-surface);
  box-shadow: 0 4px 20px #1f386a08;
}
.support-input-bar:focus-within {
  border-color: #aabaff;
}
.support-input-bar textarea {
  min-width: 0;
  width: 100%;
  max-height: 96px;
  min-height: 30px;
  padding: 5px 3px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--support-text);
  font-size: 13px;
  line-height: 20px;
}
.support-input-bar textarea::placeholder {
  color: #9ba8bf;
}
.support-send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--support-primary);
  color: white;
  transition: background 150ms;
}
.support-send-button:hover:not(:disabled) {
  background: #3152d5;
}
.support-send-button:disabled {
  cursor: default;
  background: #e4e7ed;
}
.dark .support-send-button:disabled {
  background: #34445f;
  color: #8091ae;
}
.support-input-hint {
  margin: 7px 0 0;
  color: var(--support-muted);
  text-align: center;
  font-size: 10px;
}
.support-emoji-control {
  position: relative;
}
.support-emoji-picker {
  position: absolute;
  bottom: 43px;
  left: -32px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 176px;
  padding: 10px;
  border: 1px solid var(--support-border);
  border-radius: 12px;
  background: var(--support-surface);
  box-shadow: 0 8px 28px #0002;
}
.support-emoji-picker button {
  height: 33px;
  border-radius: 6px;
  font-size: 22px;
}
.support-emoji-picker button:hover {
  background: var(--support-hover);
}
.support-pending-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.support-pending-file {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--support-border);
  border-radius: 9px;
  background: var(--support-surface);
  color: var(--support-muted);
}
.support-pending-thumbnail {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
}
.support-file-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 2px;
}
.support-file-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.support-file-copy > small {
  font-size: 10px;
  opacity: 0.75;
}
.support-file-attachment {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
  min-width: 160px;
}
.support-image-attachment {
  display: block;
  margin-top: 5px;
  max-width: 100%;
  text-align: left;
}
.support-image-attachment img {
  max-height: 180px;
  max-width: 100%;
  border-radius: 5px;
  object-fit: contain;
}
.support-image-attachment span {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  word-break: break-all;
}
.support-error {
  margin: 0 18px;
  color: #c43d3d;
  font-size: 12px;
}
.dark .support-error {
  color: #ff9c9c;
}
.support-history {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}
.support-history-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}
.support-history-heading h2 {
  font-weight: 600;
  font-size: 15px;
}
.support-new-conversation {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--support-surface);
  color: var(--support-primary);
  font-size: 11px;
}
.support-new-conversation:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.support-history-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-bottom: 10px;
  padding: 13px 11px;
  border: 1px solid var(--support-border);
  border-radius: 12px;
  background: var(--support-surface);
  text-align: left;
}
.support-history-card:hover {
  border-color: #aabaff;
}
.support-history-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: var(--support-hover);
  color: var(--support-primary);
}
.support-history-copy {
  min-width: 0;
  flex: 1;
}
.support-history-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--support-muted);
  font-size: 10px;
}
.support-history-card-heading time {
  flex-shrink: 0;
}
.support-history-copy strong,
.support-history-copy p,
.support-history-preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.support-history-copy strong {
  font-weight: 500;
}
.support-history-copy p {
  margin-top: 4px;
  color: var(--support-muted);
  font-size: 11px;
}
.support-history-preview { margin-top: 4px; color: var(--support-muted); font-size: 11px; }
.support-read-only {
  padding: 12px 16px 18px;
  text-align: center;
  font-size: 12px;
}
.support-read-only p {
  margin-bottom: 8px;
  color: var(--support-muted);
}
.support-read-only button {
  color: var(--support-primary);
}
.support-image-preview {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 55px 15px 20px;
  background: #0b1327f2;
  color: white;
}
.support-image-preview img {
  width: auto;
  height: auto;
  min-height: 0;
  max-height: calc(100% - 50px);
  max-width: 100%;
  object-fit: contain;
}
.support-image-preview p {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.support-preview-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff20;
}
.support-launcher {
  cursor: grab;
  touch-action: none;
  user-select: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--support-primary);
  color: white;
  box-shadow: 0 6px 22px #4264ee40;
  transition:
    transform 150ms,
    background 150ms;
}
.support-widget .support-launcher { background: var(--support-primary); color: white; }
.support-widget .support-send-button { background: var(--support-primary); color: white; }
.support-widget .support-send-button:disabled { background: #e4e7ed; color: #7c889c; }
.support-widget .support-quick-help > button { padding: 7px 11px; border: 1px solid #dce4ff; background: #ffffffb3; color: #4264dd; font-size: 12px; }
.support-widget .support-load-earlier,.support-widget .support-retry-message,.support-widget .support-read-only button { color: var(--support-primary); font-size: 12px; }
.support-widget .support-history-card { padding: 13px 11px; border: 1px solid var(--support-border); background: var(--support-surface); }
.support-widget .support-new-conversation { padding: 6px 8px; background: var(--support-surface); color: var(--support-primary); font-size: 11px; }
.support-widget .support-preview-close { background: #ffffff20; color: white; }
.support-widget .support-demo-notice,.support-widget .support-input-hint,.support-widget .support-history-empty,.support-widget .support-read-only p { color: var(--support-muted); }
.support-widget .support-error { color: #c43d3d; }
.support-footer-link { display: block; margin-top: 12px; padding: 0; border: 0; background: none; color: var(--blue); font-size: 14px; text-align: left; }
@media (prefers-color-scheme: dark) {
  .support-widget { --support-text: #e4eaf5; --support-muted: #a9b8d0; --support-surface: #172338; --support-border: #2a3852; --support-primary: #5a7bff; --support-hover: #243453; --support-scrollbar-thumb: #465673; --support-scrollbar-thumb-hover: #65799a; color-scheme: dark; }
  .support-panel { background: linear-gradient(155deg, #253762 0, #142137 180px, #111d30 300px); box-shadow: 0 16px 60px #0006; }
  .support-brand-pill { background: #172338b3; }
  .support-hours,.support-icon-button { color: #a9b8d0; }
  .support-widget .support-quick-help > button { border-color: #304667; background: #172338; color: #abc2ff; }
  .support-widget .support-send-button:disabled { background: #34445f; color: #a9b8d0; }
  .support-widget .support-error { color: #ff9c9c; }
}
.support-launcher:hover {
  background: #3152d5;
}
.support-widget[data-dragging='true'] .support-launcher,
.support-widget[data-dragging='true'] .support-header {
  cursor: grabbing;
}
.support-unread {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border: 2px solid var(--support-surface);
  border-radius: 10px;
  background: #ef5353;
  color: #fff;
  font-size: 10px;
  line-height: 15px;
}

@keyframes support-panel-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes support-typing {
  0%,
  80%,
  100% {
    opacity: 0.45;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (max-width: 480px) {
  .support-widget {
    right: 12px;
    bottom: 12px;
  }
  .support-panel {
    bottom: 62px;
    height: min(700px, calc(100dvh - 116px));
  }
  .support-header {
    padding-left: 20px;
    gap: 10px;
  }
}
@media (max-height: 540px) {
  .support-header {
    padding-top: 6px;
    padding-bottom: 5px;
  }
  .support-date-divider {
    margin: 6px 0 12px;
  }
  .support-input-hint {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .support-panel,
  .support-typing > span:not(.sr-only) {
    animation: none;
  }
  .support-widget button {
    transition: none;
  }
}
