/* SerpDomains live chat — marketplace dark / glass theme */
#sd-live-chat-root {
  --sd-lc-deep: #060d1f;
  --sd-lc-mid: #1a3f9e;
  --sd-lc-brand: #2d5ae3;
  --sd-lc-cyan: #5aceff;
  --sd-lc-glass: rgba(8, 18, 42, 0.82);
  --sd-lc-border: rgba(255, 255, 255, 0.14);
  --sd-lc-text: #f8fafc;
  --sd-lc-muted: rgba(226, 232, 240, 0.72);
  --sd-lc-tab-w: 52px;
  --sd-lc-peek: 14px;
  /* Above Zendesk launcher (marketplace sets ~999997) */
  --sd-lc-z: 10000000;
  position: relative;
  z-index: var(--sd-lc-z);
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#sd-live-chat-root *,
#sd-live-chat-root *::before,
#sd-live-chat-root *::after {
  box-sizing: border-box;
}

#sd-live-chat-tab {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: calc(var(--sd-lc-z) + 2);
  transform: translateY(-50%);
  width: var(--sd-lc-tab-w);
  min-height: 112px;
  border: 1px solid var(--sd-lc-border);
  border-left: none;
  border-radius: 0 14px 14px 0;
  background: linear-gradient(
    165deg,
    rgba(45, 90, 227, 0.95) 0%,
    rgba(10, 24, 58, 0.96) 55%,
    rgba(6, 13, 31, 0.98) 100%
  );
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--sd-lc-text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 0.35rem;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

#sd-live-chat-root[data-state='peek'] #sd-live-chat-tab {
  transform: translateY(-50%) translateX(calc(-1 * (var(--sd-lc-tab-w) - var(--sd-lc-peek))));
}

#sd-live-chat-root[data-state='expanded'] #sd-live-chat-tab {
  transform: translateY(-50%) translateX(0);
}

#sd-live-chat-root[data-state='open'] #sd-live-chat-tab {
  display: none;
}

#sd-live-chat-tab:hover {
  box-shadow:
    0 16px 48px rgba(45, 90, 227, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

#sd-live-chat-tab:focus-visible {
  outline: 2px solid var(--sd-lc-cyan);
  outline-offset: 2px;
}

.sd-lc-tab-icon {
  width: 22px;
  height: 22px;
  color: var(--sd-lc-cyan);
  flex-shrink: 0;
}

.sd-lc-tab-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.25s ease, max-height 0.3s ease;
}

#sd-live-chat-root[data-state='expanded'] .sd-lc-tab-label,
#sd-live-chat-root[data-state='open'] .sd-lc-tab-label {
  opacity: 1;
  max-height: 80px;
}

.sd-lc-tab-badge {
  position: absolute;
  top: 8px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.sd-lc-tab-badge.visible {
  display: inline-flex;
}

#sd-live-chat-panel {
  position: fixed;
  left: 0;
  bottom: 0;
  top: 0;
  z-index: calc(var(--sd-lc-z) + 1);
  width: min(100vw, 380px);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    165deg,
    rgba(12, 28, 68, 0.97) 0%,
    rgba(6, 13, 31, 0.98) 48%,
    rgba(4, 10, 24, 0.99) 100%
  );
  border-right: 1px solid var(--sd-lc-border);
  box-shadow: 16px 0 48px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--sd-lc-text);
  transform: translateX(-105%);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

#sd-live-chat-root[data-state='open'] #sd-live-chat-panel {
  transform: translateX(0);
  pointer-events: auto;
}

.sd-lc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid var(--sd-lc-border);
  background: linear-gradient(180deg, rgba(45, 90, 227, 0.18), transparent);
}

.sd-lc-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sd-lc-header p {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--sd-lc-muted);
  line-height: 1.4;
}

.sd-lc-close {
  border: 1px solid var(--sd-lc-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--sd-lc-text);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.sd-lc-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(90, 206, 255, 0.45);
}

.sd-lc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}

.sd-lc-msg {
  max-width: 92%;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--sd-lc-border);
}

.sd-lc-msg-you {
  align-self: flex-end;
  background: rgba(45, 90, 227, 0.28);
  border-color: rgba(90, 206, 255, 0.25);
}

.sd-lc-msg-support {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
}

.sd-lc-msg-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--sd-lc-cyan);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sd-lc-msg-body {
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.sd-lc-msg-time {
  margin-top: 0.3rem;
  font-size: 0.65rem;
  color: var(--sd-lc-muted);
}

.sd-lc-empty {
  text-align: center;
  color: var(--sd-lc-muted);
  font-size: 0.85rem;
  padding: 2rem 1rem;
  line-height: 1.5;
}

.sd-lc-compose {
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--sd-lc-border);
  background: rgba(0, 0, 0, 0.2);
}

.sd-lc-compose-error {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: #f87171;
  line-height: 1.35;
  display: none;
}

.sd-lc-compose textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid var(--sd-lc-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--sd-lc-text);
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sd-lc-compose textarea::placeholder {
  color: rgba(226, 232, 240, 0.45);
}

.sd-lc-compose textarea:focus {
  border-color: rgba(90, 206, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(45, 90, 227, 0.25);
}

.sd-lc-send-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.sd-lc-hint {
  font-size: 0.68rem;
  color: var(--sd-lc-muted);
  line-height: 1.35;
  flex: 1;
}

.sd-lc-send {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(45, 90, 227, 0.9), rgba(26, 63, 158, 0.95));
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.2s;
}

.sd-lc-send:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(45, 90, 227, 0.45);
}

.sd-lc-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sd-lc-login {
  padding: 1.5rem 1.25rem;
  text-align: center;
}

.sd-lc-login p {
  color: var(--sd-lc-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.sd-lc-login a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}

.sd-lc-login a:hover {
  background: rgba(90, 206, 255, 0.14);
  border-color: rgba(90, 206, 255, 0.45);
}

.sd-lc-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--sd-lc-z);
  background: rgba(2, 6, 18, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

#sd-live-chat-root[data-state='open'] .sd-lc-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile: hide Zendesk bubble — our left tab is the support entry */
@media (max-width: 768px) {
  body:has(#sd-live-chat-root) iframe#launcher,
  body:has(#sd-live-chat-root) iframe[title*='Messaging'],
  body:has(#sd-live-chat-root) iframe[aria-label*='Zendesk'],
  body:has(#sd-live-chat-root) iframe[id*='launcher'],
  body:has(#sd-live-chat-root) #webWidget,
  body:has(#sd-live-chat-root) [class*='zEWidget-launcher'],
  body:has(#sd-live-chat-root) [class*='StyledLauncher'] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
}

@media (max-width: 480px) {
  #sd-live-chat-panel {
    width: 100vw;
  }

  #sd-live-chat-tab {
    min-height: 96px;
    top: auto;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: none;
  }

  #sd-live-chat-root[data-state='peek'] #sd-live-chat-tab {
    transform: translateX(calc(-1 * (var(--sd-lc-tab-w) - var(--sd-lc-peek))));
  }

  #sd-live-chat-root[data-state='expanded'] #sd-live-chat-tab {
    transform: translateX(0);
  }
}
