.support-section {
  margin-top: 96px; /* below top-nav */
  padding: 32px 32px 48px;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.support-card {
  background: #020617;
  border-radius: 16px;
  border: 1px solid rgba(30, 64, 175, 0.7);
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
}

.support-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 22px;
}

.support-icon-livechat {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

.support-icon-email {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.support-title {
  font-size: 20px;
  margin: 0 0 4px;
}

.support-subtitle {
  margin: 0 0 20px;
  color: #9ca3af;
  font-size: 14px;
}

.support-primary-button {
  margin-top: auto;
  width: 100%;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #f9fafb;
}

.support-livechat-button {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
}

.support-livechat-guest {
  display: none;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.support-livechat-guest-text {
  margin: 0;
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.45;
}

.support-email-button {
  background: #2563eb;
}

.support-primary-button:hover {
  filter: brightness(1.08);
}

.support-inapp-wrap {
  max-width: 560px;
  margin: 32px auto 0;
  padding: 24px 28px 28px;
  background: #020617;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.support-card-livechat--active-chat .support-livechat-card-top {
  display: none;
}

.support-card-livechat--active-chat.support-card-livechat {
  padding-top: 20px;
}

.support-card-livechat .support-inapp-wrap--embedded {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* —— Live Chat (reference UI: light panel, bubbles, read receipts) —— */
.live-chat-shell {
  --lc-composer-bg: #0a0e14;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  padding: 20px 18px 0;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  min-height: 0;
}

.live-chat-shell-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.live-chat-shell-header .live-chat-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.live-chat-card-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #374151;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.live-chat-card-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.live-chat-card-close:active {
  transform: scale(0.96);
}

.live-chat-title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}

.live-chat-lead {
  margin: 0 0 8px;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.45;
}

.live-chat-status-line {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.live-chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  flex-shrink: 0;
}

.live-chat-status-pill {
  font-weight: 600;
  color: #15803d;
}

.live-chat-thread {
  flex: 1;
  min-height: 0;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 12px;
  max-height: min(52vh, 360px);
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.live-chat-thread-empty {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  color: #9ca3af;
  padding: 20px 8px;
}

.live-chat-thread-empty--err {
  color: #b45309;
}

.live-chat-msg {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.live-chat-msg:last-child {
  margin-bottom: 0;
}

.live-chat-msg--user {
  align-items: flex-end;
}

.live-chat-msg--support {
  align-items: flex-start;
}

.live-chat-msg-bubble {
  position: relative;
  max-width: 88%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.live-chat-msg--user .live-chat-msg-bubble {
  background: #2563eb;
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  padding-right: 40px;
  padding-bottom: 14px;
  min-width: 3rem;
}

.live-chat-msg--support .live-chat-msg-bubble {
  background: #e5e7eb;
  color: #111827;
  border-radius: 16px 16px 16px 4px;
}

/* Outgoing delivery ticks — bottom-right inside bubble (WhatsApp-style) */
.live-chat-msg-ticks {
  position: absolute;
  right: 8px;
  bottom: 5px;
  display: inline-flex;
  align-items: flex-end;
  flex-direction: row;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.live-chat-msg-tick {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.live-chat-msg-tick + .live-chat-msg-tick {
  margin-left: -0.42em;
}

.live-chat-msg-ticks--undelivered .live-chat-msg-tick {
  color: #cbd5e1;
}

.live-chat-msg-ticks--delivered .live-chat-msg-tick {
  color: #cbd5e1;
}

.live-chat-msg-ticks--read .live-chat-msg-tick {
  color: #7dd3fc;
}

.live-chat-msg-meta {
  margin-top: 4px;
  font-size: 0.6875rem;
  color: #9ca3af;
  max-width: 88%;
}

.live-chat-msg--user .live-chat-msg-meta {
  text-align: right;
}

.live-chat-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.live-chat-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.live-chat-image-preview {
  display: none;
  align-items: flex-start;
  margin: 0 -18px 0;
  padding: 8px 14px 10px;
  background: var(--lc-composer-bg, #0a0e14);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  margin-bottom: 0;
}

.live-chat-image-preview-inner {
  position: relative;
  display: inline-block;
  max-width: min(280px, 100%);
}

.live-chat-image-preview-inner img {
  display: block;
  max-width: 100%;
  max-height: 140px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  object-fit: contain;
  background: #0f172a;
}

.live-chat-image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Dark bottom bar (reference: pill input, gallery + gradient send) */
.live-chat-composer {
  --lc-composer-edge: #06080d;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -18px 0;
  padding: 12px 14px 12px;
  background: var(--lc-composer-bg, #0a0e14);
  border-radius: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* One separator: preview row already has a top border when an image is attached */
.live-chat-shell:has(#supportChatImagePreview[style*='flex']) .live-chat-composer {
  border-top: none;
  box-shadow: none;
}

.live-chat-composer-attach,
.live-chat-composer-send {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
}

.live-chat-composer-attach {
  border: 1px solid rgba(100, 116, 139, 0.35);
  color: #94a3b8;
  background: #121826;
  box-shadow: none;
}

.live-chat-composer-attach:hover {
  color: #cbd5e1;
  background: #161f30;
  border-color: rgba(148, 163, 184, 0.45);
}

.live-chat-composer-attach:active,
.live-chat-composer-send:active {
  transform: scale(0.97);
}

.live-chat-composer-icon {
  width: 22px;
  height: 22px;
}

.live-chat-composer-send {
  border: none;
  background: linear-gradient(105deg, #22d3ee 0%, #0ea5e9 35%, #2563eb 72%, #1d4ed8 100%);
  color: #f8fafc;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.live-chat-composer-send:hover {
  color: #ffffff;
  filter: brightness(1.06);
}

.live-chat-composer-send-icon {
  width: 20px;
  height: 20px;
  margin-left: 1px;
  margin-top: -1px;
}

.live-chat-composer-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.live-chat-composer-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  max-height: 120px;
  resize: none;
  overflow-y: auto;
  border-radius: 999px;
  border: 1px solid rgba(30, 41, 59, 0.85);
  background: var(--lc-composer-edge);
  color: #f1f5f9;
  padding: 11px 18px;
  font-size: 0.9375rem;
  line-height: 1.35;
  font-family: inherit;
  field-sizing: content;
}

@supports not (field-sizing: content) {
  .live-chat-composer-input {
    min-height: 46px;
  }
}

.live-chat-composer-input::placeholder {
  color: #94a3b8;
}

.live-chat-composer-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.2);
}

.live-chat-msg-image {
  display: block;
  max-width: min(260px, 85vw);
  height: auto;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
}

.live-chat-msg--user .live-chat-msg-image {
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.live-chat-msg-text {
  display: block;
}

.live-chat-send-status {
  margin: 0 -18px 0;
  padding: 4px 14px max(12px, env(safe-area-inset-bottom, 0px));
  font-size: 0.75rem;
  color: #64748b;
  min-height: 1.2em;
  background: var(--lc-composer-bg, #0a0e14);
  border-radius: 0 0 13px 13px;
}

body.support-open .live-chat-send-status {
  color: #94a3b8;
}

/* Phone: bounded flex height so the message list scrolls (Support tab, not only fullscreen) */
@media (max-width: 768px) {
  #supportLiveChatCard.support-card.support-card-livechat--active-chat {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    max-height: calc(100dvh - 200px);
  }

  #supportLiveChatCard.support-card-livechat--active-chat #supportInAppChatWrap.support-inapp-wrap--embedded {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #supportLiveChatCard.support-card-livechat--active-chat .live-chat-shell {
    flex: 1 1 0%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  #supportLiveChatCard.support-card-livechat--active-chat .live-chat-thread {
    flex: 1 1 0%;
    min-height: 120px;
    max-height: none !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
}

/* Desktop: tall scrollable thread + composer (attach, type, send) in one column */
@media (min-width: 769px) {
  #supportLiveChatCard.support-card.support-card-livechat--active-chat {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: min(72vh, 820px);
    max-height: calc(100vh - 140px);
  }

  #supportLiveChatCard.support-card-livechat--active-chat #supportInAppChatWrap.support-inapp-wrap--embedded {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #supportLiveChatCard.support-card-livechat--active-chat .live-chat-shell {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  #supportLiveChatCard.support-card-livechat--active-chat .live-chat-thread {
    flex: 1 1 auto;
    min-height: 220px;
    max-height: none;
  }

  .live-chat-composer-input {
    max-height: 200px;
  }
}

