:root {
  --cs-chat-height: 100vh;
  --cs-chat-blue: #143d7b;
  --cs-chat-blue-dark: #112746;
  --cs-chat-orange: #f57b20;
  --cs-chat-bg: #f6f8fc;
  --cs-chat-text: #112746;
  --cs-chat-muted: #62708a;
  --cs-chat-line: rgba(20, 61, 123, .12);
  --cs-chat-shadow: 0 24px 70px rgba(17, 39, 70, .22);
}

html.cs-chat-html-lock,
body.cs-chat-lock {
  overflow: hidden !important;
}

body.cs-chat-lock .cs-chat-launcher {
  display: none !important;
}

/* =========================================================
   Final mobile edge chat launcher
   Transparent vertical side tab with arrow only
   ========================================================= */

.cs-chat-launcher.cs-chat-launcher--edge {
  position: fixed !important;
  right: -14px !important;
  top: 58% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;

  z-index: 2147482500 !important;

  width: 46px !important;
  height: 96px !important;
  min-width: 46px !important;
  min-height: 96px !important;

  padding: 0 !important;
  margin: 0 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;

  border: 1px solid rgba(20, 61, 123, .18) !important;
  border-right: 0 !important;
  border-radius: 22px 0 0 22px !important;

  background: rgba(255, 255, 255, .46) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;

  box-shadow: 0 12px 30px rgba(17, 39, 70, .12) !important;

  color: #143d7b !important;
  cursor: pointer !important;
  overflow: hidden !important;

  animation: csChatEdgeNudge 2s ease-in-out infinite !important;
}

.cs-chat-launcher.cs-chat-launcher--edge::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: inherit !important;
  background: linear-gradient(
    180deg,
    rgba(245, 123, 32, .18),
    rgba(20, 61, 123, .08)
  ) !important;
  pointer-events: none !important;
}

.cs-chat-launcher__edge-arrow {
  position: relative !important;
  z-index: 1 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 30px !important;
  height: 96px !important;

  color: rgba(20, 61, 123, .72) !important;
  font-size: 38px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 8px rgba(255, 255, 255, .8) !important;
}

.cs-chat-launcher.cs-chat-launcher--edge:hover,
.cs-chat-launcher.cs-chat-launcher--edge:active {
  right: -6px !important;
  background: rgba(255, 255, 255, .68) !important;
  animation: none !important;
}

@keyframes csChatEdgeNudge {
  0%, 76%, 100% {
    transform: translateY(-50%) translateX(0);
  }

  82% {
    transform: translateY(-50%) translateX(-7px);
  }

  88% {
    transform: translateY(-50%) translateX(-2px);
  }

  94% {
    transform: translateY(-50%) translateX(-7px);
  }
}

/* Hide launcher when chat is open */
body.cs-chat-lock .cs-chat-launcher.cs-chat-launcher--edge,
body.cs-chat-open .cs-chat-launcher.cs-chat-launcher--edge,
html.cs-chat-lock .cs-chat-launcher.cs-chat-launcher--edge {
  display: none !important;
}

/* Desktop: larger, more visible chat CTA. Mobile edge-tab stays unchanged. */
@media (min-width: 981px) {
  .cs-chat-launcher.cs-chat-launcher--edge {
    right: 24px !important;
    top: auto !important;
    bottom: 26px !important;
    transform: none !important;

    width: 188px !important;
    height: 64px !important;
    min-width: 188px !important;
    min-height: 64px !important;

    padding: 0 22px 0 16px !important;
    gap: 11px !important;
    justify-content: center !important;

    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, .62) !important;

    background:
      linear-gradient(135deg, #f57b20 0%, #ef6f15 44%, #143d7b 100%) !important;
    box-shadow:
      0 20px 48px rgba(17, 39, 70, .24),
      0 10px 24px rgba(245, 123, 32, .28) !important;

    color: #fff !important;
    animation: csChatDesktopPulse 2.8s ease-in-out infinite !important;
  }

  .cs-chat-launcher.cs-chat-launcher--edge::before {
    inset: 2px !important;
    border-radius: 999px !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0)) !important;
    opacity: 1 !important;
  }

  .cs-chat-launcher.cs-chat-launcher--edge::after {
    content: "Ask a Question" !important;
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    color: #fff !important;
    font-size: 15px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    letter-spacing: -.01em !important;
    white-space: nowrap !important;
    text-shadow: 0 1px 10px rgba(17, 39, 70, .24) !important;
  }

  .cs-chat-launcher__edge-arrow {
    width: 34px !important;
    height: 34px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .95) !important;
    color: #143d7b !important;
    font-size: 30px !important;
    line-height: 30px !important;
    box-shadow: 0 8px 18px rgba(17, 39, 70, .18) !important;
    text-shadow: none !important;
  }

  .cs-chat-launcher.cs-chat-launcher--edge:hover,
  .cs-chat-launcher.cs-chat-launcher--edge:focus-visible {
    right: 24px !important;
    transform: translateY(-3px) !important;
    background:
      linear-gradient(135deg, #ff8628 0%, #f57b20 42%, #143d7b 100%) !important;
    box-shadow:
      0 24px 58px rgba(17, 39, 70, .28),
      0 12px 30px rgba(245, 123, 32, .34) !important;
    animation: none !important;
  }

  .cs-chat-launcher.cs-chat-launcher--edge:active {
    right: 24px !important;
    transform: translateY(-1px) !important;
  }
}

@keyframes csChatDesktopPulse {
  0%, 100% {
    box-shadow:
      0 20px 48px rgba(17, 39, 70, .24),
      0 10px 24px rgba(245, 123, 32, .28);
  }

  50% {
    box-shadow:
      0 24px 58px rgba(17, 39, 70, .28),
      0 12px 34px rgba(245, 123, 32, .42);
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cs-chat-launcher.cs-chat-launcher--edge {
    animation: none !important;
  }
}
.cs-chat {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  width: 100%;
  height: var(--cs-chat-height);
}

.cs-chat.is-open {
  display: block;
}

.cs-chat__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 12%, rgba(245, 123, 32, .18), transparent 34%),
    radial-gradient(circle at 86% 20%, rgba(20, 61, 123, .18), transparent 40%),
    rgba(8, 20, 38, .34);
  backdrop-filter: blur(10px);
}

.cs-chat__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 1120px);
  height: var(--cs-chat-height);
  max-height: var(--cs-chat-height);
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 8%, rgba(245, 123, 32, .12), transparent 32%),
    radial-gradient(circle at 90% 16%, rgba(20, 61, 123, .12), transparent 36%),
    linear-gradient(180deg, #f6f8fc 0%, #ffffff 100%);
  box-shadow: var(--cs-chat-shadow);
}

.cs-chat__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  border-bottom: 1px solid var(--cs-chat-line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

.cs-chat__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cs-chat__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--cs-chat-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(17, 39, 70, .18);
}

.cs-chat__brand strong {
  display: block;
  color: var(--cs-chat-blue-dark);
  font-size: 17px;
  line-height: 1.15;
  font-weight: 950;
  letter-spacing: -.025em;
}

.cs-chat__brand span {
  display: block;
  margin-top: 3px;
  color: var(--cs-chat-muted);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
}

.cs-chat__close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--cs-chat-line);
  border-radius: 999px;
  background: #fff;
  color: var(--cs-chat-blue-dark);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(17, 39, 70, .08);
}

.cs-chat__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.cs-chat__messages {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 18px 18px;
  scroll-behavior: smooth;
}

.cs-chat__message {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
}

.cs-chat__message.is-user {
  justify-content: flex-end;
}

.cs-chat__bubble {
  max-width: 760px;
  padding: 15px 16px;
  border-radius: 22px;
  font-size: 15px;
  line-height: 1.58;
  box-shadow: 0 12px 28px rgba(17, 39, 70, .07);
}

.cs-chat__message.is-bot .cs-chat__bubble {
  border: 1px solid var(--cs-chat-line);
  background: rgba(255, 255, 255, .94);
  color: var(--cs-chat-text);
}

.cs-chat__message.is-user .cs-chat__bubble {
  background: var(--cs-chat-blue);
  color: #fff;
  border-bottom-right-radius: 8px;
}

.cs-chat__bubble p {
  margin: 0 0 10px;
}

.cs-chat__bubble p:last-child {
  margin-bottom: 0;
}

.cs-chat__bubble a {
  color: var(--cs-chat-blue);
  font-weight: 900;
}


.cs-chat__bubble ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 61, 123, .1);
  border-radius: 16px;
  background: rgba(246, 248, 252, .86);
  list-style: none;
}

.cs-chat__bubble li {
  margin: 0;
}

.cs-chat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}

.cs-chat__action,
.cs-chat__quick,
.cs-chat__choice {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 38px;
  aspect-ratio: auto !important;
  padding: 9px 13px;
  border: 1px solid rgba(20, 61, 123, .14);
  border-radius: 999px;
  background: #fff;
  color: var(--cs-chat-blue-dark);
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(17, 39, 70, .06);
}

.cs-chat__action.is-primary,
.cs-chat__choice.is-primary {
  border-color: var(--cs-chat-orange);
  background: var(--cs-chat-orange);
  color: #fff;
}

.cs-chat__quickbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 14px;
  border-top: 1px solid var(--cs-chat-line);
  background: rgba(255, 255, 255, .9);
}

.cs-chat__quickbar::-webkit-scrollbar {
  display: none;
}

.cs-chat__composer {
  box-sizing: border-box;
  flex: 0 0 auto;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 52px !important;
  align-items: end;
  gap: 10px;
  width: 100%;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--cs-chat-line);
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(12px);
}

.cs-chat__input {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 52px;
  max-height: 112px;
  margin: 0 !important;
  padding: 14px 15px !important;
  border: 1px solid rgba(20, 61, 123, .18) !important;
  border-radius: 18px !important;
  background: #fff !important;
  color: var(--cs-chat-text) !important;
  font: inherit !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
  resize: none !important;
  outline: none !important;
  box-shadow: 0 8px 20px rgba(17, 39, 70, .06) !important;
}

.cs-chat__input::placeholder {
  color: rgba(17, 39, 70, .56);
}

.cs-chat__input:focus {
  border-color: rgba(245, 123, 32, .62) !important;
}

.cs-chat__send {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  box-sizing: border-box;
  display: grid !important;
  place-items: center;
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 18px !important;
  background: var(--cs-chat-orange) !important;
  color: #fff !important;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(245, 123, 32, .26);
}

.cs-chat__send svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.cs-chat__typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.cs-chat__typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(20, 61, 123, .38);
  animation: csTyping 1s infinite ease-in-out;
}

.cs-chat__typing span:nth-child(2) {
  animation-delay: .12s;
}

.cs-chat__typing span:nth-child(3) {
  animation-delay: .24s;
}

@keyframes csTyping {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: .45;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 720px) {
  .cs-chat-launcher {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 62px;
    height: 62px;
    min-height: 62px;
    padding: 9px;
    justify-content: center;
    border-radius: 999px;
  }

  .cs-chat-launcher__text {
    display: none;
  }

  .cs-chat-launcher__icon {
    width: 44px;
    height: 44px;
  }

  .cs-chat {
    width: 100%;
    height: var(--cs-chat-height);
  }

  .cs-chat__backdrop {
    display: none;
  }

  .cs-chat__panel {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: var(--cs-chat-height);
    max-height: var(--cs-chat-height);
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .cs-chat__header {
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  }

  .cs-chat__avatar {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    font-size: 12px;
  }

  .cs-chat__brand strong {
    font-size: 15px;
  }

  .cs-chat__brand span {
    max-width: 245px;
    font-size: 12px;
    line-height: 1.25;
  }

  .cs-chat__close {
    width: 42px;
    height: 42px;
    font-size: 30px;
  }

  .cs-chat__messages {
    padding: 18px 12px 12px;
  }

  .cs-chat__bubble {
    max-width: 92%;
    padding: 14px 15px;
    border-radius: 21px;
    font-size: 14px;
    line-height: 1.55;
  }

  .cs-chat__quickbar {
    min-height: 58px;
    padding: 8px 10px;
    gap: 8px;
  }

  .cs-chat__quick {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 9px 13px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .cs-chat__composer {
    grid-template-columns: minmax(0, 1fr) 52px !important;
    gap: 9px;
    padding: 10px 12px calc(92px + env(safe-area-inset-bottom));
  }

  .cs-chat.is-input-active .cs-chat__quickbar {
    display: none;
  }

  .cs-chat.is-input-active .cs-chat__composer {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .cs-chat__input {
    min-height: 52px !important;
    height: 52px;
    padding: 14px 14px !important;
    border-radius: 17px !important;
    font-size: 16px !important;
  }

  .cs-chat__send {
    width: 52px !important;
    min-width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    border-radius: 17px !important;
  }
}

@media (max-width: 390px) {
  .cs-chat__brand span {
    max-width: 205px;
  }

  .cs-chat__bubble {
    max-width: 94%;
  }
}

/* === iPhone Safari / Chrome fixed overlay patch === */
:root {
  --cs-chat-vh: 100vh;
  --cs-chat-top: 0px;
}

html.cs-chat-html-lock,
body.cs-chat-lock {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.cs-chat-lock {
  position: fixed !important;
  width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  touch-action: none !important;
}

body.cs-chat-lock .mobile-bottom-cta,
body.cs-chat-lock .mobile-sticky-cta,
body.cs-chat-lock .sticky-bottom-cta,
body.cs-chat-lock .bottom-cta,
body.cs-chat-lock .floating-cta,
body.cs-chat-lock [data-mobile-cta],
body.cs-chat-lock [data-sticky-cta] {
  display: none !important;
}

.cs-chat {
  position: fixed !important;
  left: 0 !important;
  top: var(--cs-chat-top) !important;
  right: 0 !important;
  bottom: auto !important;
  z-index: 2147483000 !important;
  width: 100vw !important;
  height: var(--cs-chat-vh) !important;
  max-height: var(--cs-chat-vh) !important;
  overflow: hidden !important;
  transform: translateZ(0);
  isolation: isolate;
}

.cs-chat.is-open {
  display: block !important;
}

.cs-chat__panel {
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  height: var(--cs-chat-vh) !important;
  max-height: var(--cs-chat-vh) !important;
  overflow: hidden !important;
}

.cs-chat__messages {
  overscroll-behavior: contain !important;
}

.cs-chat__quickbar {
  overscroll-behavior: contain !important;
}

@media (max-width: 720px) {
  .cs-chat {
    top: var(--cs-chat-top) !important;
    height: var(--cs-chat-vh) !important;
    max-height: var(--cs-chat-vh) !important;
  }

  .cs-chat__panel {
    position: relative !important;
    width: 100vw !important;
    max-width: none !important;
    height: var(--cs-chat-vh) !important;
    max-height: var(--cs-chat-vh) !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .cs-chat__composer {
    padding: 10px 12px calc(18px + env(safe-area-inset-bottom)) !important;
  }

  .cs-chat.is-input-active .cs-chat__quickbar {
    display: none !important;
  }

  .cs-chat.is-input-active .cs-chat__composer {
    padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  }
}


/* PERF GUARD: desktop launcher styles must not leak into mobile/tablet. */
@media (prefers-reduced-motion: reduce){
  .cs-chat-launcher,
  .cs-chat-launcher::before,
  .cs-chat-launcher::after{
    animation:none !important;
    transition:none !important;
  }
}

