.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(216, 180, 254, 0.18);
  color: #d8b4fe;
}

.support-icon-email {
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
}

.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, #c084fc 0%, #a78bfa 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: #a78bfa;
}

.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(216, 180, 254, 0.35);
}

.support-card-livechat--active-chat .support-livechat-card-top {
  display: none;
}

.support-card-livechat--active-chat.support-card-livechat {
  padding: 0;
  background: #121820;
  border-color: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.support-card-livechat .support-inapp-wrap--embedded {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* —— Live Support (dark panel, teal→blue header) —— */
.live-chat-shell {
  --lc-bg: #121820;
  --lc-thread: #151c27;
  --lc-composer: #0e141c;
  --lc-border: rgba(148, 163, 184, 0.14);
  --lc-accent: #3b82f6;
  --lc-teal: #2dd4bf;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--lc-bg);
  border-radius: 16px;
  padding: 0;
  border: 1px solid var(--lc-border);
  box-shadow: none;
  min-height: 0;
  overflow: hidden;
}

.live-chat-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(90deg, #2dd4bf 0%, #38bdf8 42%, #2563eb 100%);
  border-bottom: none;
}

.live-chat-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.live-chat-header-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.live-chat-header-icon svg {
  display: block;
}

.live-chat-header-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.live-chat-shell-header .live-chat-title {
  margin: 0;
  flex: none;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.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: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.live-chat-card-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.live-chat-card-close:active {
  transform: scale(0.96);
}

.live-chat-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.live-chat-lead {
  display: none;
}

.live-chat-status-line {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.3;
}

.live-chat-status-copy {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
}

.live-chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.live-chat-status-dot--online {
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.28);
}

.live-chat-status-dot--offline {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: none;
}

.live-chat-status-pill {
  display: inline;
  font-weight: 600;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  line-height: inherit;
  border: none;
  background: transparent;
  color: inherit;
}

.live-chat-status-pill--online,
.live-chat-status-pill--offline {
  color: rgba(255, 255, 255, 0.92);
  background: transparent;
  border: none;
}

.live-chat-status-hint {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}

.live-chat-last-seen {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}

.live-chat-thread {
  flex: 1;
  min-height: 0;
  background: var(--lc-thread);
  border: none;
  border-radius: 0;
  padding: 18px 14px;
  max-height: min(52vh, 360px);
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.live-chat-thread-empty {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  color: #94a3b8;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
}

.live-chat-thread-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 212, 191, 0.1);
  color: #2dd4bf;
  margin-bottom: 4px;
}

.live-chat-thread-empty-icon svg {
  display: block;
  width: 34px;
  height: 34px;
}

.live-chat-thread-empty-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.live-chat-thread-empty-text {
  margin: 0;
  max-width: 260px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #94a3b8;
}

.live-chat-thread-empty--err {
  color: #fbbf24;
}

.live-chat-thread-empty--err .live-chat-thread-empty-title {
  color: #fbbf24;
}

.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: #243044;
  color: #e2e8f0;
  border-radius: 16px 16px 16px 4px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.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.5em;
}

.live-chat-msg-ticks--undelivered .live-chat-msg-tick {
  color: #64748b;
}

.live-chat-msg-ticks--delivered .live-chat-msg-tick {
  color: #94a3b8;
}

.live-chat-msg-ticks--read .live-chat-msg-tick {
  color: #60a5fa;
}

.live-chat-msg--user .live-chat-msg-ticks--undelivered .live-chat-msg-tick {
  color: rgba(255, 255, 255, 0.5);
}

.live-chat-msg--user .live-chat-msg-ticks--delivered .live-chat-msg-tick {
  color: rgba(255, 255, 255, 0.88);
}

.live-chat-msg--user .live-chat-msg-ticks--read .live-chat-msg-tick {
  color: #93c5fd;
  text-shadow: none;
}

.live-chat-msg-meta {
  margin-top: 4px;
  font-size: 0.6875rem;
  color: #64748b;
  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;
  padding: 8px 14px 10px;
  background: var(--lc-composer);
  border-top: 1px solid var(--lc-border);
  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 var(--lc-border);
  object-fit: contain;
  background: #1e293b;
}

.live-chat-image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--lc-border);
  background: #1e293b;
  color: #e2e8f0;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
}

.live-chat-image-preview-remove:hover {
  background: #334155;
  color: #ffffff;
}

.live-chat-composer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px 12px;
  background: var(--lc-composer);
  border-radius: 0;
  border-top: 1px solid var(--lc-border);
  flex-shrink: 0;
  box-shadow: none;
}

.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: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
}

.live-chat-composer-attach {
  border: none;
  color: #94a3b8;
  background: transparent;
  box-shadow: none;
}

.live-chat-composer-attach:hover {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.1);
  border-color: transparent;
}

.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: #2563eb;
  color: #ffffff;
  box-shadow: none;
}

.live-chat-composer-send:hover {
  color: #ffffff;
  background: #1d4ed8;
  border-color: transparent;
}

.live-chat-composer-send-icon {
  width: 18px;
  height: 18px;
  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: 44px;
  max-height: 120px;
  resize: none;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #1a2330;
  color: #f1f5f9;
  padding: 11px 14px;
  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: 44px;
  }
}

.live-chat-composer-input::placeholder {
  color: #64748b;
}

.live-chat-composer-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  background: #1e293b;
}

.live-chat-msg-image,
.dmax-chat-viewable-image {
  display: block;
  max-width: min(260px, 85vw);
  height: auto;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #0f172a;
  cursor: pointer;
  transition: none;
}

.live-chat-msg-image:hover,
.dmax-chat-viewable-image:hover {
  opacity: 0.92;
}

.live-chat-msg-image:focus-visible,
.dmax-chat-viewable-image:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.live-chat-msg--user .live-chat-msg-image {
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.live-chat-msg-text {
  display: block;
}

.live-chat-send-status {
  margin: 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);
  border-radius: 0 0 15px 15px;
}

body.support-open .live-chat-send-status {
  color: #64748b;
}

/* 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;
  }
}

/* Full-size image viewer (live chat + admin panel) */
.dmax-chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.dmax-chat-lightbox[hidden] {
  display: none !important;
}

.dmax-chat-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.dmax-chat-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.dmax-chat-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1200px);
  max-height: min(88vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.dmax-chat-lightbox-open-tab {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.875rem;
  text-decoration: none;
}

.dmax-chat-lightbox-open-tab:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.dmax-chat-image-fallback {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: #d8b4fe;
  text-decoration: underline;
}

body.dmax-chat-lightbox-open {
  overflow: hidden;
}
