/* SiteChat widget. Theme by setting CSS variables on :root or .sc-root. */
.sc-root {
  --sc-accent: #111111;
  --sc-accent-text: #ffffff;
  --sc-background: #ffffff;
  --sc-text: #161616;
  --sc-muted: #667085;
  --sc-line: #e7e5e4;
  --sc-bubble-user: #111111;
  --sc-bubble-user-text: #ffffff;
  --sc-bubble-bot: #f4f2ef;
  --sc-radius: 18px;
  --sc-font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sc-shadow: 0 18px 50px rgba(16, 16, 16, 0.18);
  --sc-offset: max(16px, env(safe-area-inset-right, 0px));
  --sc-offset-left: max(16px, env(safe-area-inset-left, 0px));
  --sc-offset-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  --sc-launcher-size: 56px;
  --sc-z: 2147483000;
  position: static;
  font-family: var(--sc-font-family);
  color: var(--sc-text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.sc-root *,
.sc-root *::before,
.sc-root *::after {
  box-sizing: border-box;
}

.sc-launcher {
  position: fixed;
  z-index: var(--sc-z);
  width: var(--sc-launcher-size);
  height: var(--sc-launcher-size);
  border: 0;
  border-radius: 50%;
  background: var(--sc-accent);
  color: var(--sc-accent-text);
  box-shadow: var(--sc-shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 180ms ease, box-shadow 180ms ease;
  bottom: var(--sc-offset-bottom);
  right: var(--sc-offset);
}

.sc-root[data-position="bottom-left"] .sc-launcher {
  right: auto;
  left: var(--sc-offset-left);
}

.sc-launcher:hover {
  transform: translateY(-1px) scale(1.03);
}

.sc-launcher:focus-visible {
  outline: 3px solid var(--sc-accent);
  outline-offset: 3px;
}

.sc-launcher svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sc-launcher[aria-expanded="true"] .sc-icon-open,
.sc-launcher[aria-expanded="false"] .sc-icon-close {
  display: none;
}

.sc-panel {
  position: fixed;
  z-index: calc(var(--sc-z) + 1);
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 24px));
  height: min(640px, calc(100dvh - 24px - var(--sc-offset-bottom)));
  max-height: min(640px, calc(100svh - 24px - var(--sc-offset-bottom)));
  background: var(--sc-background);
  color: var(--sc-text);
  border-radius: var(--sc-radius);
  box-shadow: var(--sc-shadow);
  overflow: hidden;
  bottom: calc(var(--sc-offset-bottom) + var(--sc-launcher-size) + 12px);
  right: var(--sc-offset);
  transform-origin: 100% 100%;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
}

.sc-root[data-position="bottom-left"] .sc-panel {
  right: auto;
  left: var(--sc-offset-left);
  transform-origin: 0 100%;
}

.sc-root.is-open .sc-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px 16px;
  background: var(--sc-accent);
  color: var(--sc-accent-text);
}

.sc-header h2, .sc-header .sc-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sc-header p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.82;
  font-weight: 500;
}

.sc-close {
  border: 0;
  background: transparent;
  color: inherit;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sc-close:hover,
.sc-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.sc-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.sc-msg {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 14.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sc-msg.is-bot {
  align-self: flex-start;
  background: var(--sc-bubble-bot);
  color: var(--sc-text);
  border-bottom-left-radius: 6px;
}

.sc-msg.is-user {
  align-self: flex-end;
  background: var(--sc-bubble-user);
  color: var(--sc-bubble-user-text);
  border-bottom-right-radius: 6px;
}

.sc-msg.is-system {
  align-self: stretch;
  max-width: 100%;
  background: transparent;
  color: var(--sc-muted);
  font-size: 12.5px;
  padding: 2px 4px;
  text-align: center;
}

.sc-handoff {
  display: block;
  width: calc(100% - 8px);
  margin: 2px 4px 6px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--sc-accent);
  color: var(--sc-accent-text);
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.sc-handoff:hover,
.sc-handoff:focus-visible {
  filter: brightness(1.05);
  outline: 3px solid var(--sc-accent);
  outline-offset: 2px;
}

.sc-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 12px 14px;
  background: var(--sc-bubble-bot);
  border-radius: 16px 16px 16px 6px;
}

.sc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sc-muted);
  animation: sc-bounce 1s infinite ease-in-out;
}

.sc-typing span:nth-child(2) { animation-delay: 0.12s; }
.sc-typing span:nth-child(3) { animation-delay: 0.24s; }

@keyframes sc-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-3px); opacity: 1; }
}

.sc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 10px;
}

.sc-chip {
  border: 1px solid var(--sc-line);
  background: var(--sc-background);
  color: var(--sc-text);
  border-radius: 999px;
  padding: 7px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sc-chip:hover,
.sc-chip:focus-visible {
  border-color: var(--sc-accent);
  outline: none;
}

.sc-note {
  margin: 0;
  padding: 0 16px 8px;
  font-size: 11.5px;
  color: var(--sc-muted);
}

.sc-composer {
  display: flex;
  gap: 8px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--sc-line);
  background: var(--sc-background);
}

.sc-composer label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.sc-composer input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--sc-line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--sc-text);
  background: var(--sc-background);
}

.sc-composer input:focus-visible {
  outline: 2px solid var(--sc-accent);
  border-color: var(--sc-accent);
}

.sc-send {
  border: 0;
  border-radius: 12px;
  background: var(--sc-accent);
  color: var(--sc-accent-text);
  width: 44px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sc-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sc-send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 420px) {
  .sc-panel {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px - var(--sc-offset-bottom) - var(--sc-launcher-size) - 8px);
    max-height: calc(100svh - 16px - var(--sc-offset-bottom) - var(--sc-launcher-size) - 8px);
    right: 8px;
    left: 8px;
    width: auto;
  }
  .sc-root[data-position="bottom-left"] .sc-panel {
    left: 8px;
    right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-panel,
  .sc-launcher,
  .sc-typing span {
    transition: none !important;
    animation: none !important;
  }
}

.sc-root[hidden] {
  display: none !important;
}

.sc-header .sc-title{margin:0;font-weight:700;font-size:1rem;line-height:1.2}

/* r6: tappable help lines on crisis replies */
.sc-num{color:inherit;font-weight:700;text-decoration:underline;text-underline-offset:2px;padding:6px 0}
.sc-footer{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:2px 0 10px;padding:10px;border:1px solid rgba(180,35,24,.45);border-radius:12px;background:rgba(180,35,24,.07)}
.sc-footer-h{grid-column:1/-1;margin:0 0 2px;font-size:.8rem;font-weight:700;color:#1c1917}
.sc-line{display:flex;flex-direction:column;justify-content:center;min-height:48px;padding:6px 10px;border-radius:10px;background:#B42318;color:#fff;text-decoration:none;line-height:1.15}
.sc-line b{font-size:.86rem;white-space:nowrap}.sc-line small{font-size:.7rem;opacity:.92}
.sc-line:focus-visible{outline:3px solid #1c1917;outline-offset:2px}

/* r7: numbers never break across lines */
.sc-num,a[href^="tel:"]:not(.sc-line),a[href^="sms:"]:not(.sc-line){white-space:nowrap}
