/* Artra support chat widget (static/js/support_widget.js). Neutral ink, no
   gradients; sits bottom-right above page content. */
#artraSupport {
  --asw-ink: #111827;
  --asw-bg: #ffffff;
  --asw-muted: #6b7280;
  --asw-line: #e5e7eb;
  --asw-user: #111827;
  --asw-user-text: #ffffff;
  --asw-bot: #f3f4f6;
  --asw-staff: #ecfdf5;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1080;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #artraSupport {
    --asw-ink: #f9fafb;
    --asw-bg: #111827;
    --asw-muted: #9ca3af;
    --asw-line: #374151;
    --asw-user: #f9fafb;
    --asw-user-text: #111827;
    --asw-bot: #1f2937;
    --asw-staff: #064e3b;
  }
}
:root[data-theme="dark"] #artraSupport {
  --asw-ink: #f9fafb;
  --asw-bg: #111827;
  --asw-muted: #9ca3af;
  --asw-line: #374151;
  --asw-user: #f9fafb;
  --asw-user-text: #111827;
  --asw-bot: #1f2937;
  --asw-staff: #064e3b;
}
#artraSupport .asw-hidden { display: none !important; }
#artraSupport button, #artraSupport input, #artraSupport textarea { font: inherit; letter-spacing: normal; text-transform: none; }

#artraSupport .asw-launcher {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--asw-ink);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
#artraSupport .asw-launcher:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
/* Speech-bubble icon, drawn in CSS (no icon font dependency). */
#artraSupport .asw-launcher-icon {
  width: 24px;
  height: 20px;
  border-radius: 6px;
  background: var(--asw-bg);
  position: relative;
}
#artraSupport .asw-launcher-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  bottom: -6px;
  border-width: 6px 6px 0 0;
  border-style: solid;
  border-color: var(--asw-bg) transparent transparent transparent;
}
#artraSupport .asw-launcher-open .asw-launcher-icon { width: 18px; height: 3px; border-radius: 2px; }
#artraSupport .asw-launcher-open .asw-launcher-icon::after { display: none; }
#artraSupport .asw-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--asw-ink);
}

#artraSupport .asw-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  background: var(--asw-bg);
  color: var(--asw-ink);
  border: 1px solid var(--asw-line);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
#artraSupport .asw-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--asw-line);
}
#artraSupport .asw-sub { color: var(--asw-muted); font-size: 12px; }
#artraSupport .asw-close {
  border: 0;
  background: transparent;
  color: var(--asw-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
#artraSupport .asw-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#artraSupport .asw-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  word-break: break-word;
}
#artraSupport .asw-msg a { color: inherit; text-decoration: underline; }
#artraSupport .asw-user { align-self: flex-end; background: var(--asw-user); color: var(--asw-user-text); }
#artraSupport .asw-bot { align-self: flex-start; background: var(--asw-bot); }
#artraSupport .asw-staff { align-self: flex-start; background: var(--asw-staff); }
#artraSupport .asw-system {
  align-self: center;
  max-width: 95%;
  background: transparent;
  color: var(--asw-muted);
  font-size: 12px;
  text-align: center;
}
#artraSupport .asw-typing { color: var(--asw-muted); }
#artraSupport .asw-who { font-size: 11px; color: var(--asw-muted); margin-bottom: 2px; }
#artraSupport .asw-fb { margin-top: 6px; font-size: 12px; color: var(--asw-muted); display: flex; gap: 6px; align-items: center; }
#artraSupport .asw-fb-btn { border: 0; background: transparent; cursor: pointer; padding: 0 2px; font-size: 14px; }

#artraSupport .asw-email { padding: 10px 16px; border-top: 1px solid var(--asw-line); }
#artraSupport .asw-email-label { font-size: 12px; color: var(--asw-muted); margin-bottom: 6px; }
#artraSupport .asw-row { display: flex; gap: 6px; }
#artraSupport .asw-form {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--asw-line);
  align-items: flex-end;
}
#artraSupport .asw-input {
  flex: 1;
  border: 1px solid var(--asw-line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--asw-bg);
  color: var(--asw-ink);
  font: inherit;
  min-width: 0;
}
#artraSupport .asw-text { resize: none; max-height: 120px; }
#artraSupport .asw-btn {
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  background: var(--asw-ink);
  color: var(--asw-bg);
  font-weight: 600;
  cursor: pointer;
}
#artraSupport .asw-btn:disabled { opacity: 0.5; cursor: default; }
#artraSupport .asw-foot { padding: 0 16px 10px; text-align: center; }
#artraSupport .asw-link {
  border: 0;
  background: transparent;
  color: var(--asw-muted);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 480px) {
  #artraSupport { right: 12px; bottom: 12px; }
  #artraSupport .asw-panel { width: calc(100vw - 24px); height: calc(100vh - 96px); }
}

/* Dark host page (marketing site): a light bubble so it stands out. */
#artraSupport.asw-on-dark .asw-launcher { background: #ffffff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
#artraSupport.asw-on-dark .asw-launcher-icon { background: #111827; }
#artraSupport.asw-on-dark .asw-launcher-icon::after { border-color: #111827 transparent transparent transparent; }
#artraSupport.asw-on-dark .asw-dot { border-color: #ffffff; }
#artraSupport.asw-probe, #artraSupport.asw-probe * { pointer-events: none !important; }

/* Out of the way while the dialer (or any modal) is open — the bubble sat on
   top of the dialer's Save button. */
body.modal-open #artraSupport,
body:has(#modal-dial:not([hidden])) #artraSupport { display: none !important; }
