.sca-widget {
  --sca-emerald: #11634c;
  --sca-emerald-dark: #0a4938;
  --sca-violet: #6753a5;
  --sca-ink: #172d29;
  --sca-muted: #566960;
  --sca-line: #dde9e3;
  --sca-bottom-offset: 24px;
  --sca-right-offset: 24px;
  position: fixed;
  right: max(var(--sca-right-offset), env(safe-area-inset-right, 0px));
  bottom: calc(var(--sca-bottom-offset) + env(safe-area-inset-bottom, 0px));
  z-index: 999990;
  isolation: isolate;
  color: var(--sca-ink);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
}
.sca-widget *, .sca-widget *::before, .sca-widget *::after { box-sizing: border-box; }
.sca-widget [hidden] { display: none !important; }
.sca-widget button, .sca-widget input, .sca-widget a { font: inherit; }
.sca-widget button, .sca-widget a { -webkit-tap-highlight-color: transparent; }
.sca-widget button { cursor: pointer; margin: 0; text-transform: none; letter-spacing: normal; }
.sca-widget button:focus-visible, .sca-widget a:focus-visible, .sca-widget input:focus-visible, .sca-conversation:focus-visible {
  outline: 3px solid var(--sca-violet);
  outline-offset: 3px;
}
.sca-widget button:disabled { cursor: wait; opacity: .6; }
.sca-widget svg { display: block; width: 24px; height: 24px; flex: none; }
.sca-backdrop { position: fixed; inset: 0; z-index: -1; background: rgba(18, 38, 31, .24); backdrop-filter: blur(2px); }
.sca-launcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 56px;
  height: 56px;
  padding: 0 19px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  color: #fff;
  background: var(--sca-emerald);
  box-shadow: 0 7px 24px rgba(8, 62, 46, .23), 0 1px 3px rgba(8, 62, 46, .15);
  font-weight: 650 !important;
  transition: background .16s ease, transform .16s ease;
}
.sca-launcher:hover { background: var(--sca-emerald-dark); transform: translateY(-2px); }
.sca-launcher[aria-expanded="true"] { background: var(--sca-emerald-dark); }
.sca-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  display: flex;
  flex-direction: column;
  width: min(410px, calc(100vw - 32px));
  height: min(625px, calc(100vh - var(--sca-bottom-offset) - 96px));
  height: min(625px, calc(100dvh - var(--sca-bottom-offset) - env(safe-area-inset-bottom, 0px) - 96px));
  min-height: 0;
  overflow: hidden;
  border: 1px solid #d7e4dc;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(17, 47, 36, .2), 0 2px 8px rgba(17, 47, 36, .08);
  animation: sca-enter .18s ease-out;
}
.sca-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 20px 16px 17px;
  background: linear-gradient(115deg, #f0faf4, #f6f3fe);
  border-bottom: 1px solid var(--sca-line);
}
.sca-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 13px; color: var(--sca-emerald); background: #fff; box-shadow: 0 1px 4px rgba(22, 69, 48, .07); }
.sca-heading { flex: 1; min-width: 0; }
.sca-eyebrow { margin: 0 0 4px; color: var(--sca-emerald); font-size: 9px; font-weight: 750; letter-spacing: .11em; line-height: 1.2; }
.sca-heading h2 { margin: 0; color: var(--sca-ink); font: 700 15px/1.3 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.sca-heading #sca-description { margin: 4px 0 0; color: var(--sca-muted); font-size: 11px; line-height: 1.3; }
.sca-close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; color: var(--sca-muted); background: transparent; }
.sca-close:hover { color: var(--sca-ink); background: rgba(103, 83, 165, .08); }
.sca-close svg { width: 21px; height: 21px; }
.sca-conversation { flex: 1; min-height: 70px; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px; background: #fcfdfc; scrollbar-color: #bfd1c6 transparent; scrollbar-width: thin; }
.sca-message { max-width: 100%; margin: 0 0 15px; overflow-wrap: anywhere; }
.sca-message:last-child { margin-bottom: 0; }
.sca-speaker { display: block; margin: 0 3px 5px; color: var(--sca-muted); font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.sca-bubble { width: fit-content; max-width: 100%; padding: 11px 13px; border: 1px solid var(--sca-line); border-radius: 4px 15px 15px; background: #fff; color: var(--sca-ink); font-size: 13px; line-height: 1.6; }
.sca-bubble p { margin: 0; }
.sca-message-user { margin-left: 26px; }
.sca-message-user .sca-speaker { text-align: right; }
.sca-message-user .sca-bubble { margin-left: auto; border-color: #e5dff2; border-radius: 15px 4px 15px 15px; color: #49387d; background: #f3effb; }
.sca-result-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 7px; }
.sca-result-list li { margin: 0; padding: 0; }
.sca-result-link { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 9px 11px; border: 1px solid #d4e6dc; border-radius: 10px; color: var(--sca-emerald-dark); background: #f6fcf8; text-decoration: none; }
.sca-result-link:hover { color: var(--sca-emerald-dark); border-color: #95bba7; background: #edf8f1; text-decoration: none; }
.sca-result-copy { flex: 1; min-width: 0; }
.sca-result-title { display: block; font-size: 12px; font-weight: 650; line-height: 1.45; }
.sca-result-type { display: block; margin-top: 3px; color: var(--sca-muted); font-size: 10px; font-weight: 500; }
.sca-result-arrow { font-size: 17px; }
.sca-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; flex: none; padding: 12px 16px; border-top: 1px solid var(--sca-line); background: #fff; }
.sca-actions button, .sca-actions a { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 7px 8px; border: 1px solid #d9e6de; border-radius: 9px; color: #355749; background: #fff; font-size: 11px; font-weight: 650; line-height: 1.25; text-align: center; text-decoration: none; }
.sca-actions button:hover, .sca-actions a:hover { border-color: #bdcde1; color: #49387d; background: #f7f5fc; text-decoration: none; }
.sca-actions span { color: var(--sca-violet); font-size: 16px; line-height: 1; font-weight: 650; }
.sca-form { flex: none; padding: 4px 16px 13px; background: #fff; }
.sca-input-label { display: block; margin: 0 0 6px; color: var(--sca-muted); font-size: 11px; font-weight: 550; }
.sca-input-row { display: flex; gap: 8px; align-items: center; }
.sca-widget .sca-input-row input { width: 100%; min-width: 0; height: 44px; padding: 10px 12px; border: 1px solid #c8d9cf; border-radius: 10px; color: var(--sca-ink); background: #fcfdfc; font-size: 13px; box-shadow: none; line-height: 1.4; }
.sca-input-row input::placeholder { color: #64786d; opacity: 1; }
.sca-widget .sca-send { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; color: #fff; background: var(--sca-emerald); }
.sca-widget .sca-send:hover { background: var(--sca-emerald-dark); }
.sca-send svg { width: 22px; height: 22px; }
.sca-privacy { margin: 8px 0 0; color: var(--sca-muted); font-size: 9px; line-height: 1.5; }
.sca-loading .sca-bubble { color: var(--sca-muted); }
@keyframes sca-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .sca-widget { --sca-bottom-offset: 88px; --sca-right-offset: 16px; }
  .sca-launcher { width: 56px; padding: 0; }
  .sca-launcher-text { display: none; }
  .sca-panel { width: min(410px, calc(100vw - 32px)); border-radius: 18px; }
  .sca-header { padding: 14px 12px; gap: 8px; }
  .sca-mark { width: 34px; height: 34px; border-radius: 10px; }
  .sca-heading h2 { font-size: 13px; }
  .sca-eyebrow { font-size: 8px; }
  .sca-conversation { padding: 14px 12px; }
  .sca-actions { padding: 10px 12px; gap: 6px; }
  .sca-form { padding: 3px 12px 11px; }
  .sca-widget .sca-input-row input { font-size: 16px; }
}
@media (max-height: 620px) {
  .sca-panel { position: fixed; top: max(12px, env(safe-area-inset-top, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); height: auto; width: min(480px, calc(100vw - 24px)); }
  .sca-header { padding-top: 10px; padding-bottom: 10px; }
  .sca-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 7px; padding-bottom: 7px; gap: 5px; }
  .sca-actions button, .sca-actions a { min-height: 36px; padding: 5px 4px; font-size: 10px; gap: 4px; }
  .sca-actions span { font-size: 13px; }
  .sca-open .sca-launcher { visibility: hidden; }
}
@media (max-height: 420px) {
  .sca-conversation { min-height: 24px; padding-top: 8px; padding-bottom: 8px; }
  .sca-header { padding-top: 7px; padding-bottom: 7px; }
  .sca-input-label { margin-bottom: 4px; }
  .sca-privacy { margin-top: 5px; font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .sca-panel { animation: none; }
  .sca-launcher { transition: none; }
  .sca-launcher:hover { transform: none; }
}
@media (forced-colors: active) {
  .sca-panel, .sca-launcher, .sca-bubble, .sca-actions button, .sca-actions a, .sca-result-link, .sca-send { border: 1px solid ButtonText; }
  .sca-backdrop { background: transparent; backdrop-filter: none; }
}
