/* Shared desktop help widget. The script adds .ecx-desktop-help-mounted. */
.ecx-desktop-help {
  --dh-bg: var(--bg2, var(--card, #131a2c));
  --dh-bg-soft: var(--bg1, var(--card2, #0f1422));
  --dh-bg-hover: var(--bg3, var(--surface-2, #1a2340));
  --dh-border: var(--brd, var(--line, #25324b));
  --dh-text: var(--t1, var(--text, #e8ecf1));
  --dh-muted: var(--t2, var(--muted, #a6b0c1));
  --dh-dim: var(--t3, var(--muted2, #7f8ca2));
  --dh-blue: var(--bl, #3772ff);
  position: fixed;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  left: auto;
  /* Above page content and ordinary dropdowns, below transaction modals. */
  z-index: 1800;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--dh-text);
}

.ecx-desktop-help *,
.ecx-desktop-help *::before,
.ecx-desktop-help *::after {
  box-sizing: border-box;
}

.ecx-dh-trigger {
  min-width: 132px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px 0 12px;
  border: 1px solid rgba(119, 158, 255, .42);
  border-radius: 24px;
  background: linear-gradient(135deg, #2768e8 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 12px 30px rgba(27, 83, 188, .3);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.ecx-dh-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(27, 83, 188, .38);
  filter: brightness(1.04);
}

.ecx-dh-trigger:active { transform: translateY(0); }

.ecx-dh-trigger-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
}

.ecx-dh-icon,
.ecx-dh-trigger-icon svg,
.ecx-dh-close svg,
.ecx-dh-service-icon svg,
.ecx-dh-link-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ecx-dh-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  left: auto;
  width: min(386px, calc(100vw - 48px));
  max-height: min(690px, calc(100vh - 164px));
  max-height: min(690px, calc(100dvh - 164px));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--dh-border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--dh-bg) 94%, transparent);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34), 0 4px 16px rgba(0, 0, 0, .16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.985);
  transform-origin: right bottom;
  pointer-events: none;
  transition: opacity .17s ease, transform .17s ease, visibility .17s ease;
}

@supports (backdrop-filter: blur(18px)) {
  .ecx-dh-panel { backdrop-filter: blur(18px) saturate(1.08); }
}

.ecx-desktop-help.is-open .ecx-dh-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ecx-dh-panel[hidden] { display: none !important; }

.ecx-dh-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--dh-border);
}

.ecx-dh-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--dh-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.ecx-dh-title {
  margin: 0;
  color: var(--dh-text);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}

.ecx-dh-subtitle {
  margin: 4px 0 0;
  color: var(--dh-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ecx-dh-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: -3px -3px 0 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--dh-muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.ecx-dh-close:hover {
  background: var(--dh-bg-hover);
  color: var(--dh-text);
}

.ecx-dh-body { padding: 14px; }

.ecx-dh-service {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--dh-blue) 32%, var(--dh-border));
  border-radius: 15px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--dh-blue) 15%, var(--dh-bg)) 0%, var(--dh-bg-soft) 100%);
}

.ecx-dh-service-icon {
  width: 42px;
  height: 42px;
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--dh-blue) 17%, transparent);
  color: var(--dh-blue);
}

.ecx-dh-service-copy { min-width: 0; }
.ecx-dh-service-copy strong {
  display: block;
  color: var(--dh-text);
  font-size: 14px;
  font-weight: 760;
}
.ecx-dh-service-copy span {
  display: block;
  margin-top: 2px;
  color: var(--dh-muted);
  font-size: 11px;
}

.ecx-dh-service-button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 40px;
  margin-top: 2px;
  padding: 9px 14px;
  border: 0;
  border-radius: 11px;
  background: var(--dh-blue);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}

.ecx-dh-service-button:hover { filter: brightness(1.08); }
.ecx-dh-service-button:active { transform: scale(.99); }
.ecx-dh-service-button:disabled { cursor: wait; opacity: .68; }

.ecx-dh-service-status {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  color: #f59e0b;
  font-size: 11px;
  line-height: 1.45;
}
.ecx-dh-service-status:empty { display: none; }

.ecx-dh-section-label {
  display: block;
  margin: 15px 2px 8px;
  color: var(--dh-dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ecx-dh-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ecx-dh-link {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--dh-border);
  border-radius: 12px;
  background: var(--dh-bg-soft);
  color: var(--dh-text);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.ecx-dh-link:hover {
  border-color: color-mix(in srgb, var(--dh-blue) 52%, var(--dh-border));
  background: var(--dh-bg-hover);
  transform: translateY(-1px);
}

.ecx-dh-link.is-primary { grid-column: 1 / -1; }

.ecx-dh-link-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--dh-blue) 13%, transparent);
  color: var(--dh-blue);
}

.ecx-dh-link-copy { min-width: 0; }
.ecx-dh-link-copy strong,
.ecx-dh-link-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ecx-dh-link-copy strong {
  color: var(--dh-text);
  font-size: 12px;
  font-weight: 730;
}
.ecx-dh-link-copy span {
  margin-top: 2px;
  color: var(--dh-dim);
  font-size: 10px;
}

.ecx-dh-trigger:focus-visible,
.ecx-dh-close:focus-visible,
.ecx-dh-service-button:focus-visible,
.ecx-dh-link:focus-visible,
.ecx-dh-panel:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--dh-blue) 36%, transparent);
  outline-offset: 2px;
}

html.light-mode .ecx-desktop-help {
  --dh-bg: #ffffff;
  --dh-bg-soft: #f7f9fc;
  --dh-bg-hover: #eef3fa;
  --dh-border: #d8e0ea;
  --dh-text: #172033;
  --dh-muted: #46546a;
  --dh-dim: #69778b;
}

html.light-mode .ecx-dh-panel {
  box-shadow: 0 24px 60px rgba(27, 43, 70, .18), 0 4px 14px rgba(27, 43, 70, .08);
}

/* Hide the old one-click customer-service pills only after this replacement
   has mounted, and only on desktop. */
@media (min-width: 1025px) {
  html.ecx-desktop-help-mounted .cs-float-btn { display: none !important; }
}

@media (min-width: 1025px) and (max-width: 1680px) {
  /* Keep the fixed launcher clear of the footer's legal copy. */
  html.ecx-desktop-help-mounted .ecx-shared-footer .footer-bottom {
    padding-right: 172px !important;
  }
}

@media (min-width: 1025px) and (max-width: 1180px) {
  .ecx-desktop-help {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }

  .ecx-dh-panel {
    width: min(370px, calc(100vw - 32px));
    max-height: min(640px, calc(100vh - 154px));
    max-height: min(640px, calc(100dvh - 154px));
  }

  html.ecx-desktop-help-mounted .ecx-shared-footer .footer-bottom {
    padding-right: 164px !important;
  }
}

@media (max-width: 1024px) {
  .ecx-desktop-help { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ecx-dh-trigger,
  .ecx-dh-panel,
  .ecx-dh-link,
  .ecx-dh-service-button { transition: none !important; }
}
