#buddy-widget-root {
  --buddy-primary: #0D9BD8;
  --buddy-bg: #f2f6fa;
  --buddy-text: #162635;
  --buddy-muted: #51657a;
  --buddy-border: #dbe2ea;
  --buddy-shadow: 0 16px 34px rgba(6, 24, 44, 0.2);
  --buddy-radius: 16px;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  font-family: "Montserrat", "Segoe UI", Tahoma, sans-serif;
}

#buddy-widget-root * {
  box-sizing: border-box;
  font-family: inherit;
}

#buddy-widget-root .buddy-anchor {
  position: absolute;
  bottom: 24px;
  right: 24px;
  pointer-events: none;
}

#buddy-widget-root .buddy-anchor.buddy-left {
  right: auto;
  left: 24px;
}

#buddy-widget-root .buddy-launcher-wrap {
  position: absolute;
  bottom: 0;
  right: 0;
  pointer-events: auto;
}

#buddy-widget-root .buddy-anchor.buddy-left .buddy-launcher-wrap {
  right: auto;
  left: 0;
}

#buddy-widget-root .buddy-label {
  display: none;
}

#buddy-widget-root .buddy-anchor.buddy-left .buddy-label {
  right: auto;
  left: 72px;
}


#buddy-widget-root .buddy-launcher {
  width: 150px;
  height: 150px;
  border: 0;
  cursor: pointer;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  padding: 0;
}

#buddy-widget-root .buddy-launcher:hover {
  transform: translateY(-2px);
}

#buddy-widget-root .buddy-launcher-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22));
}

#buddy-widget-root .buddy-launcher.buddy-pulse .buddy-launcher-logo {
  animation: buddyPulse 0.9s ease-out 3;
}

#buddy-widget-root .buddy-panel {
  position: absolute;
  /* Gap above the launcher â€” shrinks on short screens */
  bottom: min(160px, calc(100vh - 480px));
  right: 0;
  /* Never wider than viewport; never taller than available space */
  width: min(420px, calc(100vw - 32px));
  height: min(640px, calc(100vh - min(160px, calc(100vh - 480px)) - 28px));
  border-radius: var(--buddy-radius);
  background: #fff;
  box-shadow: var(--buddy-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  transform: translateY(18px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out, visibility 0.2s ease-out;
}

#buddy-widget-root .buddy-panel.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

#buddy-widget-root .buddy-anchor.buddy-left .buddy-panel {
  right: auto;
  left: 0;
}

#buddy-widget-root .buddy-header {
  height: 96px;
  background: var(--buddy-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

#buddy-widget-root .buddy-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#buddy-widget-root .buddy-header-avatar {
  width: 80px;
  height: 80px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

#buddy-widget-root .buddy-header-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#buddy-widget-root .buddy-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

#buddy-widget-root .buddy-status {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.95;
}

#buddy-widget-root .buddy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2dd36f;
}

#buddy-widget-root .buddy-header-actions {
  display: flex;
  gap: 6px;
}

#buddy-widget-root .buddy-icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: transparent;
  color: #fff;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#buddy-widget-root .buddy-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#buddy-widget-root .buddy-icon-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

#buddy-widget-root .buddy-messages {
  flex: 1;
  overflow-y: auto;
  background: var(--buddy-bg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#buddy-widget-root .buddy-message {
  display: flex;
  align-items: center;
  gap: 8px;
}

#buddy-widget-root .buddy-message.user {
  justify-content: flex-end;
}

#buddy-widget-root .buddy-message.bot {
  justify-content: flex-start;
}

#buddy-widget-root .buddy-avatar {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex: 0 0 60px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.14));
}

#buddy-widget-root .buddy-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

#buddy-widget-root .buddy-bubble {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  word-break: break-word;
  white-space: pre-wrap;
}

#buddy-widget-root .buddy-message.bot .buddy-bubble {
  background: #fff;
  color: var(--buddy-text);
  border-bottom-left-radius: 4px;
  white-space: pre-line;
}

#buddy-widget-root .buddy-message.user .buddy-bubble {
  background: var(--buddy-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

#buddy-widget-root .buddy-message.bot .buddy-bubble a {
  color: var(--buddy-primary);
  text-decoration: underline;
  word-break: break-word;
}

#buddy-widget-root .buddy-pdf-link {
  display: inline-block;
  margin-top: 6px;
  font-weight: 500;
}

#buddy-widget-root .buddy-time {
  margin-top: 4px;
  font-size: 11px;
  color: var(--buddy-muted);
  opacity: 0;
  transition: opacity 0.18s ease;
}

#buddy-widget-root .buddy-message.user .buddy-time {
  text-align: right;
}

#buddy-widget-root .buddy-message:hover .buddy-time {
  opacity: 1;
}

#buddy-widget-root .buddy-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

#buddy-widget-root .buddy-chip {
  border: 1px solid var(--buddy-primary);
  background: transparent;
  color: var(--buddy-primary);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#buddy-widget-root .buddy-chip:hover {
  background: rgba(13, 155, 216, 0.08);
}

#buddy-widget-root .buddy-input {
  min-height: 80px;
  border-top: 1px solid var(--buddy-border);
  background: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

#buddy-widget-root .buddy-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--buddy-border);
  border-radius: 12px;
  outline: none;
  min-height: 44px;
  max-height: 110px;
  padding: 11px 12px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--buddy-text);
}

#buddy-widget-root .buddy-input textarea:focus {
  border-color: var(--buddy-primary);
  box-shadow: 0 0 0 3px rgba(13, 155, 216, 0.15);
}

#buddy-widget-root .buddy-send {
  border: 0;
  border-radius: 12px;
  height: 44px;
  min-width: 56px;
  padding: 0 14px;
  cursor: pointer;
  background: var(--buddy-primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

#buddy-widget-root .buddy-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#buddy-widget-root .buddy-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#buddy-widget-root .buddy-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: buddyDots 1s infinite ease-in-out;
}

#buddy-widget-root .buddy-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

#buddy-widget-root .buddy-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

#buddy-widget-root .buddy-retry {
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#buddy-widget-root .buddy-hidden {
  display: none !important;
}

/* â”€â”€ RESPONSIVE BREAKPOINTS (floating panel on all sizes) â”€â”€â”€ */
/* â”€â”€ â‰¤ 767px  MOBILE: floating panel, never full-screen â”€â”€â”€â”€â”€ */
@media (max-width: 767px) {

  #buddy-widget-root .buddy-anchor,
  #buddy-widget-root .buddy-anchor.buddy-left {
    right: 0;
    left: 0;
    bottom: 0;
  }

  #buddy-widget-root .buddy-label {
    display: none;
  }

  #buddy-widget-root .buddy-launcher-wrap {
    position: absolute;
    right: 16px;
    bottom: 16px;
  }

  #buddy-widget-root .buddy-anchor.buddy-left .buddy-launcher-wrap {
    right: auto;
    left: 16px;
  }

  #buddy-widget-root .buddy-launcher,
  #buddy-widget-root .buddy-launcher-logo {
    width: 72px;
    height: 72px;
  }

  /* Floating panel: fits within the viewport, never overflows */
  #buddy-widget-root .buddy-panel {
    position: absolute;
    right: 0;
    bottom: 88px;
    left: 0;
    width: calc(100vw - 16px);
    max-width: 420px;
    height: min(600px, calc(100vh - 110px));
    margin: 0 auto 0 auto;
    border-radius: 14px;
  }

  #buddy-widget-root .buddy-anchor.buddy-left .buddy-panel {
    right: 0;
    left: 0;
  }

  #buddy-widget-root .buddy-header {
    height: 64px;
    padding: 0 10px;
  }

  #buddy-widget-root .buddy-header-avatar {
    width: 44px;
    height: 44px;
  }

  #buddy-widget-root .buddy-icon-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    font-size: 17px;
  }

  #buddy-widget-root .buddy-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  #buddy-widget-root .buddy-bubble-wrap {
    max-width: 82%;
  }

  #buddy-widget-root .buddy-messages {
    padding: 14px 12px;
  }

  #buddy-widget-root .buddy-input {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

/* â”€â”€ â‰¤ 480px  SMALL PHONE â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 480px) {
  #buddy-widget-root .buddy-launcher-wrap {
    right: 12px;
    bottom: 12px;
  }

  #buddy-widget-root .buddy-launcher,
  #buddy-widget-root .buddy-launcher-logo {
    width: 60px;
    height: 60px;
  }

  #buddy-widget-root .buddy-panel {
    bottom: 80px;
    width: calc(100vw - 12px);
    height: min(560px, calc(100vh - 100px));
  }

  #buddy-widget-root .buddy-header {
    height: 58px;
    padding: 0 10px;
  }

  #buddy-widget-root .buddy-header-avatar {
    width: 38px;
    height: 38px;
  }

  #buddy-widget-root .buddy-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }

  #buddy-widget-root .buddy-bubble-wrap {
    max-width: 86%;
  }

  #buddy-widget-root .buddy-bubble {
    font-size: 14px;
    padding: 10px 12px;
  }

  #buddy-widget-root .buddy-chip {
    font-size: 12px;
    padding: 6px 11px;
  }

  #buddy-widget-root .buddy-messages {
    padding: 12px 10px;
  }

  #buddy-widget-root .buddy-input {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  #buddy-widget-root .buddy-input textarea {
    font-size: 14px;
    min-height: 40px;
  }

  #buddy-widget-root .buddy-send {
    height: 40px;
    min-width: 48px;
    font-size: 13px;
  }
}

/* â”€â”€ â‰¤ 320px  ULTRA-NARROW â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 320px) {

  #buddy-widget-root .buddy-launcher,
  #buddy-widget-root .buddy-launcher-logo {
    width: 52px;
    height: 52px;
  }

  #buddy-widget-root .buddy-launcher-wrap {
    right: 8px;
    bottom: 8px;
  }

  #buddy-widget-root .buddy-panel {
    bottom: 68px;
  }

  #buddy-widget-root .buddy-header {
    height: 52px;
  }

  #buddy-widget-root .buddy-header-avatar {
    width: 32px;
    height: 32px;
  }

  #buddy-widget-root .buddy-name {
    font-size: 13px;
  }

  #buddy-widget-root .buddy-status {
    font-size: 11px;
  }

  #buddy-widget-root .buddy-icon-btn {
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
  }

  #buddy-widget-root .buddy-avatar {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
  }

  #buddy-widget-root .buddy-bubble {
    font-size: 13px;
    padding: 8px 10px;
  }

  #buddy-widget-root .buddy-send {
    height: 36px;
    min-width: 44px;
    font-size: 12px;
    padding: 0 10px;
  }
}

/* â”€â”€ TOUCH: remove sticky hover states â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (hover: none) {
  #buddy-widget-root .buddy-launcher:hover {
    transform: none;
  }

  #buddy-widget-root .buddy-icon-btn:hover {
    background: transparent;
  }

  #buddy-widget-root .buddy-chip:hover {
    background: transparent;
  }

  #buddy-widget-root .buddy-message:hover .buddy-time {
    opacity: 0;
  }

  #buddy-widget-root .buddy-message:active .buddy-time {
    opacity: 1;
  }
}

/* â”€â”€ REDUCED MOTION â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (prefers-reduced-motion: reduce) {
  #buddy-widget-root .buddy-launcher {
    transition: none;
  }

  #buddy-widget-root .buddy-panel {
    transition: opacity 0.1s ease, visibility 0.1s ease;
    transform: none !important;
  }

  #buddy-widget-root .buddy-launcher.buddy-pulse .buddy-launcher-logo {
    animation: none;
  }

  #buddy-widget-root .buddy-typing span {
    animation: none;
    opacity: 0.7;
  }

  #buddy-widget-root .buddy-time {
    transition: none;
  }
}

/* â”€â”€ PRINT â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media print {
  #buddy-widget-root {
    display: none !important;
  }
}

@keyframes buddyPulse {
  0% {
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22)) drop-shadow(0 0 0 rgba(13, 155, 216, 0.6));
  }

  70% {
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22)) drop-shadow(0 0 18px rgba(13, 155, 216, 0));
  }

  100% {
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22)) drop-shadow(0 0 0 rgba(13, 155, 216, 0));
  }
}

@keyframes buddyDots {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

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

/* Meherban Shah */
#buddy-widget-root .buddy-privacy-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 10px 16px;
    padding: 12px;
    background: #F8FCFF;
    border: 1px solid #D9ECF7;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #51657A;
}

#buddy-widget-root .buddy-privacy-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: rgba(13,155,216,.1);
    color: #0D9BD8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

#buddy-widget-root .buddy-privacy-content {
    flex: 1;
}

#buddy-widget-root .buddy-privacy-content strong {
    color: #0D9BD8;
    font-weight: 700;
}

@media (max-width: 480px) {
    #buddy-widget-root .buddy-privacy-notice {
        margin: 8px 12px;
        padding: 10px;
        font-size: 11px;
    }

    #buddy-widget-root .buddy-privacy-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 16px;
    }
}
