/* In-app human support thread. Kept isolated so it cannot restyle the landing site. */
.support-launch-button {
  position: relative;
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  flex: 0 0 38px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #17181c;
  color: #f7f7f8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.support-launch-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-launch-button:focus-visible {
  outline: 2px solid rgba(239, 49, 36, 0.9);
  outline-offset: 2px;
}

.support-unread-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid #16171a;
  border-radius: 50%;
  background: #ef3124;
  box-sizing: content-box;
}

.support-dialog.modal {
  z-index: 40;
  align-items: stretch;
  padding: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.support-dialog-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.support-dialog .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.support-dialog-sheet.modal-sheet {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f7f7f8;
  background: #0b0c0f !important;
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.52) !important;
}

.support-dialog-head {
  flex: 0 0 auto;
  min-height: calc(66px + env(safe-area-inset-top, 0px));
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  padding: env(safe-area-inset-top, 0px) 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #0b0c0f;
}

.support-dialog-close {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #f7f7f8;
}

.support-dialog-close svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-dialog-title-wrap {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.support-dialog-title-wrap h3 {
  margin: 0;
  color: #ffffff;
  font-size: 17px;
  font-weight: 740;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.support-dialog-title-wrap span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.support-dialog-title-wrap i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #52b866;
  box-shadow: none;
}

.support-dialog-messages {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 14px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.support-dialog-empty {
  width: min(360px, 100%);
  margin: clamp(68px, 13vh, 118px) auto auto;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 4px 24px;
  text-align: center;
}

.support-dialog-empty-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(239, 49, 36, 0.45);
  border-radius: 12px;
  color: #ffffff;
  background: #15161a;
}

.support-dialog-empty-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-dialog-empty-kicker {
  margin-top: 3px;
  color: #ef4b43;
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.support-dialog-empty h4 {
  margin: 0;
  color: #ffffff;
  font-size: 23px;
  font-weight: 720;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.support-dialog-empty p {
  max-width: 32ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 14px;
  line-height: 1.45;
}

.support-dialog-suggestions {
  width: min(340px, 100%);
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.support-dialog-suggestion {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: #15161a;
  color: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 12px;
  font-weight: 660;
  text-align: left;
}

.support-dialog-suggestion svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-message {
  display: grid;
  color: #f7f7f8;
}

.support-message.is-support {
  width: 100%;
  max-width: 420px;
  align-self: flex-start;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 7px 4px 13px 0;
}

.support-message.is-visitor {
  width: fit-content;
  max-width: min(82%, 380px);
  align-self: flex-end;
  padding: 10px 12px 8px;
  border: 1px solid rgba(239, 75, 67, 0.18);
  border-radius: 14px;
  background: #1c1718;
  color: #ffffff;
}

.support-message-avatar {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: #050607;
}

.support-message-avatar img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.support-message-content {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.support-message p {
  margin: 0;
  color: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.support-message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

.support-message-meta span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 680;
}

.support-message-meta time {
  font-variant-numeric: tabular-nums;
}

.support-message.is-visitor .support-message-meta {
  justify-content: flex-end;
  margin-top: -1px;
  color: rgba(255, 255, 255, 0.36);
}

.support-dialog-loading {
  margin: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 13px;
  font-weight: 650;
}

.support-dialog-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ef3124;
  border-radius: 50%;
  animation: support-dialog-spin 0.75s linear infinite;
}

@keyframes support-dialog-spin {
  to { transform: rotate(360deg); }
}

.support-dialog-state {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0 18px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 11px;
  font-weight: 620;
  line-height: 1.35;
  text-align: center;
}

.support-dialog-state:not(:empty) {
  padding-top: 8px;
}

.support-dialog-composer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: end;
  gap: 8px;
  padding: 12px 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b0c0f;
}

.support-dialog-composer textarea {
  width: 100%;
  min-height: 46px;
  max-height: 116px;
  resize: none;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 11px;
  outline: none;
  background: #141519 !important;
  color: #ffffff !important;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  box-sizing: border-box;
}

.support-dialog-composer textarea::placeholder {
  color: rgba(255, 255, 255, 0.36);
}

.support-dialog-composer textarea:focus {
  border-color: rgba(239, 75, 67, 0.82) !important;
  box-shadow: 0 0 0 2px rgba(239, 75, 67, 0.12) !important;
}

.support-dialog-send {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #f05a52;
  border-radius: 11px;
  background: #ef4b43;
  color: #ffffff;
  box-shadow: none;
}

.support-dialog-send svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-dialog-send:disabled,
.support-dialog-composer textarea:disabled {
  opacity: 0.5;
}

.support-dialog-privacy {
  flex: 0 0 auto;
  margin: 0;
  padding: 7px 16px max(10px, env(safe-area-inset-bottom, 0px));
  background: #0b0c0f;
  color: rgba(255, 255, 255, 0.46);
  font-size: 11px;
  font-weight: 580;
  line-height: 1.3;
  text-align: center;
}

@media (max-width: 380px) {
  .topbar .topbar-tools {
    gap: 6px !important;
  }

  .support-launch-button {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    flex-basis: 38px;
  }

  .support-dialog-messages {
    padding-inline: 12px;
  }
}

@media (max-width: 340px) {
  .topbar .brand-logo,
  html[lang="en"] .topbar .brand-logo {
    width: 74px !important;
  }

  .topbar .topbar-tools {
    gap: 4px !important;
  }

  .topbar .language-switch {
    gap: 2px !important;
    padding: 2px !important;
  }

  .topbar .language-switch-button {
    min-width: 27px !important;
    padding-inline: 4px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-dialog-messages {
    scroll-behavior: auto;
  }

  .support-dialog-loading::before {
    animation-duration: 1.6s;
  }
}
