/* Back2Basics chatbot — current homepage markup */

#b2b-design-demo {
  --chat-blue: #00afe5;
  --chat-orange: #fc5927;
  --chat-heading: #193e51;
  --chat-text: #254b5d;
  --chat-muted: #8298a4;
  --chat-border: #dce9f0;
  --chat-close-size: 40px;

  position: relative;
  z-index: 2147483000;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--chat-heading);
}

#b2b-design-demo *,
#b2b-design-demo *::before,
#b2b-design-demo *::after {
  box-sizing: border-box;
}

#b2b-design-demo .stage {
  max-width: none;
  margin: 0;
}

#b2b-design-demo button {
  appearance: none;
  font: inherit;
  cursor: pointer;
}

#b2b-design-demo button:focus-visible {
  outline: 3px solid #f9845c;
  outline-offset: 3px;
}

#b2b-design-demo svg {
  width: 24px;
  height: 24px;
}

/* Panel */

#b2b-design-demo #b2b-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 380px;
  max-width: calc(100vw - 28px);
  height: 600px;
  max-height: calc(100vh - 108px);
  max-height: calc(100dvh - 108px);
  min-height: 0;
  margin: 0;
  padding: 0;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--chat-border);
  border-radius: 24px;
  box-shadow: 0 14px 45px #104e631c;
  container: b2b-chat / size;
}

#b2b-design-demo #b2b-chat-panel:not([hidden]) {
  display: flex;
}

#b2b-design-demo #b2b-chat-panel::before,
#b2b-design-demo #b2b-chat-panel::after {
  content: none;
}

/* Header */

#b2b-design-demo #b2b-chat-panel>.top {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 76px;
  width: 100%;
  height: 76px;
  margin: 0;
  padding: 16px 18px;
  overflow: visible;
  border: 0;
  background: var(--chat-blue);
  color: #fff;
}

#b2b-design-demo .avatar {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 7px #0082a515;
}

#b2b-design-demo .avatar .robot-image {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

#b2b-design-demo .title {
  flex: 1;
  min-width: 0;
}

#b2b-design-demo .title h2 {
  margin: 0 0 5px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.6px;
}

#b2b-design-demo .subtitle {
  margin: 0;
  color: #fff;
  font-size: 13px;
}

#b2b-design-demo .status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

#b2b-design-demo .status-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #77f0a2;
  animation: b2b-status-pulse 2s ease-out infinite;
}

#b2b-design-demo .status-line[data-state="busy"] .status-dot {
  display: none;
}

#b2b-design-demo .status-line:is([data-state="offline"],
  [data-state="error"]) .status-dot {
  background: #ffd3c5;
  box-shadow: none;
  animation: none;
}

#b2b-design-demo .top .close {
  position: relative;
  inset: auto;
  float: none;
  display: grid;
  place-items: center;
  flex: 0 0 var(--chat-close-size);
  width: var(--chat-close-size);
  height: var(--chat-close-size);
  min-width: var(--chat-close-size);
  min-height: var(--chat-close-size);
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 14%);
  color: #fff;
  opacity: 1;
  line-height: 1;
  box-shadow: none;
  text-shadow: none;
  transition: background 160ms ease, transform 160ms ease;
}

#b2b-design-demo .top .close:hover {
  background: rgb(255 255 255 / 24%);
}

#b2b-design-demo .top .close:active {
  transform: scale(0.94);
}

#b2b-design-demo .top .close svg {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  pointer-events: none;
}

/* Scrollable content */

#b2b-design-demo #b2b-chat-panel>.content {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 17px 19px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background: linear-gradient(#f1faff, #fff 65%);
}

#b2b-design-demo .content::-webkit-scrollbar {
  display: none;
}

#b2b-design-demo .eyebrow {
  margin: 0 0 9px;
  color: #e95322;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-align: center;
}

#b2b-design-demo .welcome h3 {
  margin: 0 0 8px;
  color: var(--chat-heading);
  justify-content: center;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.8px;
}

#b2b-design-demo .intro {
  margin: 0 0 16px;
  color: #657e8b;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

#b2b-design-demo .choices {
  display: grid;
  gap: 8px;
}

#b2b-design-demo .choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 53px;
  padding: 9px 11px;
  border: 1px solid #e0eaf0;
  border-radius: 13px;
  background: #fff;
  color: #23485b;
  font-size: 15px;
  text-align: left;
  box-shadow: 0 3px 9px #1a546604;
}

#b2b-design-demo .choice:hover:not(:disabled) {
  background: #fff6f0;
  border-color: #ffc7b3;
}

#b2b-design-demo .choice .symbol {
  display: grid;
  place-items: center;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: #fff0e9;
  color: #f35b2b;
}

#b2b-design-demo .choice .symbol svg {
  width: 20px;
  height: 20px;
}

#b2b-design-demo .choice .arrow {
  flex-shrink: 0;
  width: 17px;
  margin-left: auto;
  color: #92adba;
}

/* Message bubbles */

#b2b-design-demo .bubble {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0 0 15px;
  padding: 12px 14px;
  border-radius: 16px 16px 16px 4px;
  background: #edf7fc;
  color: var(--chat-text);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#b2b-design-demo .bubble.user {
  margin-left: 32px;
  border-radius: 16px 16px 4px 16px;
  background: var(--chat-orange);
  color: #fff;
}

#b2b-design-demo .bubble.error {
  background: #fff1ea;
  color: #904728;
  border: 1px solid #f5d5c6;
}

#b2b-design-demo .bubble.pending {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 70px;
  padding: 17px 18px;
  border: 1px solid #dceef6;
  border-radius: 17px 17px 17px 4px;
  color: #607f8e;
}

/* Typing indicator */

#b2b-design-demo .typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 18px;
}

#b2b-design-demo .typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chat-blue);
  animation: b2b-dot-bounce 1.2s ease-in-out infinite;
}

#b2b-design-demo .typing-dots span:nth-child(2) {
  animation-delay: 150ms;
}

#b2b-design-demo .typing-dots span:nth-child(3) {
  animation-delay: 300ms;
}

/* Reply text and timestamps */

#b2b-design-demo .message-body {
  width: 100%;
  min-width: 0;
  text-align: left;
  white-space: normal;
  line-height: 1.62;
  overflow-wrap: anywhere;
  word-break: normal;
}

#b2b-design-demo .message-body p {
  margin: 0 0 10px;
}

#b2b-design-demo .message-body p:last-child {
  margin-bottom: 0;
}

#b2b-design-demo .message-body :is(ul, ol) {
  margin: 7px 0 10px;
  padding-left: 21px;
}

#b2b-design-demo .message-body li {
  margin: 4px 0;
  padding-left: 2px;
}

#b2b-design-demo .reply-heading {
  display: block;
  margin: 2px 0 8px;
  color: var(--chat-heading);
  font-weight: 700;
  line-height: 1.4;
}

#b2b-design-demo .chat-link {
  color: #008fbd;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

#b2b-design-demo .chat-link:hover {
  color: #f15a29;
}

#b2b-design-demo .bubble.user .chat-link {
  color: #fff;
}

#b2b-design-demo .message-time {
  display: block;
  align-self: flex-end;
  width: auto;
  max-width: 100%;
  margin: 5px 0 0;
  padding: 0;
  color: #708895;
  font-size: 11px;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

#b2b-design-demo .bubble.user .message-time {
  color: rgb(255 255 255 / 88%);
}

#b2b-design-demo .bubble.error .message-time {
  color: #956452;
}

/* Suggested follow-up questions */

#b2b-design-demo .suggestions {
  display: grid;
  gap: 8px;
  margin: 8px 0 18px;
}

#b2b-design-demo .suggestions button {
  padding: 10px 12px;
  border: 1px solid #cde6ef;
  border-radius: 12px;
  background: #f5fbfe;
  color: #24657c;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

#b2b-design-demo :is(.choice, .suggestions button):disabled {
  opacity: 0.5;
  cursor: default;
}

/* Composer */

#b2b-design-demo #b2b-chat-panel>.footer {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 12px 14px 10px;
  border-top: 1px solid #ebf1f5;
  background: #fff;
}

#b2b-design-demo .footer form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#b2b-design-demo .message-input {
  flex: 1;
  width: 0;
  min-width: 0;
  height: 48px;
  padding: 12px 14px;
  border: 1px solid #dce7ed;
  border-radius: 20px;
  background: #fafcfd;
  color: #23485b;
  font: inherit;
  font-size: 15px;
  line-height: 22px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

#b2b-design-demo .message-input::placeholder {
  color: #7f95a1;
}

#b2b-design-demo .message-input:focus {
  outline: none;
  border-color: #29c7fa;
  box-shadow: 0 0 0 3px #00afe51a;
}

#b2b-design-demo .send {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--chat-blue);
  color: #fff;
}

#b2b-design-demo .send:hover:not(:disabled) {
  background: #009fce;
}

#b2b-design-demo .send:disabled {
  background: #8bdcf5;
  cursor: default;
}

#b2b-design-demo .footnote {
  margin: 8px 0 0;
  color: var(--chat-muted);
  font-size: 11px;
  text-align: center;
}

/* Image attachments */

#b2b-design-demo .attach {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #dce7ed;
  border-radius: 50%;
  background: #fff;
  color: var(--chat-blue);
}

#b2b-design-demo .attach:hover:not(:disabled) {
  background: #f1faff;
  border-color: #9edff1;
}

#b2b-design-demo .attach:disabled {
  opacity: 0.45;
  cursor: default;
}

#b2b-design-demo .attach svg {
  width: 20px;
  height: 20px;
}

#b2b-design-demo .attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 9px;
  padding: 8px 10px;
  border: 1px solid #dceaf0;
  border-radius: 14px;
  background: #f7fbfd;
}

#b2b-design-demo .attachment-image {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  object-fit: cover;
  border: 1px solid #dceaf0;
  border-radius: 10px;
  background: #fff;
}

#b2b-design-demo .attachment-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

#b2b-design-demo .attachment-name {
  overflow: hidden;
  color: #23485b;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#b2b-design-demo .attachment-size {
  color: var(--chat-muted);
  font-size: 11px;
}

#b2b-design-demo .attachment-remove {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #78909c;
}

#b2b-design-demo .attachment-remove:hover {
  background: #eaf5fa;
  color: #f15a29;
}

#b2b-design-demo .attachment-remove svg {
  width: 16px;
  height: 16px;
}

#b2b-design-demo .message-image {
  display: block;
  width: min(220px, 100%);
  max-height: 210px;
  margin: 0 0 9px;
  object-fit: cover;
  border: 1px solid #dceaf0;
  border-radius: 12px;
  background: #fff;
}

#b2b-design-demo .bubble.user .message-image {
  border-color: #ffffff55;
}

/* Launcher */

#b2b-design-demo .launcher-row {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

#b2b-design-demo .launcher {
  position: fixed;
  right: 24px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--chat-blue);
  color: #fff;
  box-shadow: 0 7px 20px #00afe52b;
}

#b2b-design-demo .launcher svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: none;
}

/* Hidden states controlled by the existing JavaScript */

#b2b-design-demo [hidden] {
  display: none;
}

/* Mobile */

@media (max-width: 480px) {
  #b2b-design-demo {
    --chat-close-size: 38px;
  }

  #b2b-design-demo #b2b-chat-panel {
    right: 12px;
    bottom: 94px;
    width: calc(100vw - 24px);
    max-width: none;
    height: min(700px, calc(100vh - 110px));
    height: min(700px, calc(100dvh - 110px));
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
  }

  #b2b-design-demo #b2b-chat-panel>.top {
    flex-basis: 72px;
    height: 72px;
    padding: 14px 16px;
  }

  #b2b-design-demo .message-input {
    font-size: 16px;
  }

  #b2b-design-demo .launcher {
    right: 16px;
    bottom: 16px;
    width: 66px;
    height: 66px;
  }
}

/* Compact welcome content when the panel is short */

@container b2b-chat (max-height: 560px) {

  #b2b-design-demo .welcome h3 br,
  #b2b-design-demo .intro br,
  #b2b-design-demo .footnote {
    display: none;
  }

  #b2b-design-demo .intro {
    margin-bottom: 12px;
  }

  #b2b-design-demo .choice {
    min-height: 46px;
  }
}

@container b2b-chat (max-height: 450px) {

  #b2b-design-demo .intro,
  #b2b-design-demo .eyebrow {
    display: none;
  }

  #b2b-design-demo .welcome h3 {
    margin-bottom: 12px;
    font-size: 22px;
  }

  #b2b-design-demo .choices {
    gap: 6px;
  }

  #b2b-design-demo .choice {
    min-height: 44px;
  }
}

/* Animation */

@keyframes b2b-status-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 2px #77f0a230;
  }

  60% {
    box-shadow: 0 0 0 6px #77f0a200;
  }
}

@keyframes b2b-dot-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {

  #b2b-design-demo .status-dot,
  #b2b-design-demo .typing-dots span {
    animation: none;
  }

  #b2b-design-demo .message-input,
  #b2b-design-demo .top .close {
    transition: none;
  }
}

/* Launcher icon follows the existing expanded state. */
#b2b-design-demo .launcher svg {
  grid-area: 1 / 1;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

#b2b-design-demo .launcher .launcher-close-icon {
  width: 28px;
  height: 28px;
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}

#b2b-design-demo .launcher[aria-expanded="true"] .launcher-chat-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

#b2b-design-demo .launcher[aria-expanded="true"] .launcher-close-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  #b2b-design-demo .launcher svg {
    transition: none;
  }
}