#ny-chatbot-container .ny-live-session {
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  margin: 8px 12px;
  padding: 10px 12px;
  flex: 0 0 auto;
  z-index: 3;
  border: 1px solid color-mix(in srgb, var(--ny-accent-color, #145dee) 18%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ny-accent-color, #145dee) 7%, var(--ny-container-bg, #fff));
  color: var(--ny-bot-msg-text, #111827);
  box-shadow: 0 4px 16px rgb(15 23 42 / 0.06);
  animation: ny-live-inline-in 0.2s ease-out;
}

@keyframes ny-live-inline-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  #ny-chatbot-container .ny-live-session { animation: none; }
}

#ny-chatbot-container .ny-live-session-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: var(--ny-accent-color, #145dee);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ny-accent-color, #145dee) 12%, transparent);
}

#ny-chatbot-container .ny-live-session-icon svg {
  width: 19px;
  height: 19px;
}

#ny-chatbot-container .ny-live-session-copy {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

#ny-chatbot-container .ny-live-session-title {
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ny-chatbot-container .ny-live-session-status {
  overflow: hidden;
  color: color-mix(in srgb, var(--ny-bot-msg-text, #111827) 62%, transparent);
  font-size: 0.68rem;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ny-chatbot-container .ny-live-session.is-waiting .ny-live-session-icon {
  animation: ny-live-pulse 1.5s ease-in-out infinite;
}

#ny-chatbot-container .ny-live-session.is-active .ny-live-session-icon {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgb(22 163 74 / 0.12);
}

#ny-chatbot-container .ny-live-session.is-error .ny-live-session-icon {
  background: #d97706;
  box-shadow: 0 0 0 4px rgb(217 119 6 / 0.12);
}

#ny-chatbot-container .ny-live-session.is-ended {
  opacity: 0.82;
}

@keyframes ny-live-pulse {
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ny-accent-color, #145dee) 6%, transparent); }
}

#ny-chatbot-container button.ny-live-end {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 30px;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid rgb(220 38 38 / 0.22);
  border-radius: 9px;
  color: #b91c1c;
  background: rgb(254 242 242 / 0.9);
  font: inherit;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#ny-chatbot-container button.ny-live-end:hover,
#ny-chatbot-container button.ny-live-end:focus,
#ny-chatbot-container button.ny-live-end:active {
  border: 1px solid rgb(220 38 38 / 0.4);
  background: #fee2e2;
}

#ny-chatbot-container button.ny-live-end:disabled {
  opacity: 0.55;
  cursor: wait;
}

#ny-chatbot-container .ny-live-msg.ny-live-archived {
  opacity: 0.88;
}

#ny-chatbot-container .ny-live-system {
  align-self: center;
  max-width: 90%;
  margin: 5px auto;
  padding: 5px 11px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--ny-bot-msg-text, #111827) 65%, transparent);
  background: color-mix(in srgb, var(--ny-bot-msg-text, #111827) 6%, transparent);
  font-size: 0.68rem;
  line-height: 1.7;
  text-align: center;
  white-space: pre-wrap;
}

/* Boundary between a finished conversation and the one started after it.
   A rule rather than another pill: the pills are events inside a conversation,
   this separates two of them, so it has to read as a different kind of thing. */
#ny-chatbot-container .ny-live-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 14px 0 10px;
  padding: 0;
  border-radius: 0;
  background: none;
  letter-spacing: 0.02em;
}

#ny-chatbot-container .ny-live-divider::before,
#ny-chatbot-container .ny-live-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--ny-bot-msg-text, #111827) 14%, transparent);
}

#ny-chatbot-container .ny-live-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  margin: 3px 0;
}

#ny-chatbot-container .ny-live-msg-me {
  align-self: flex-start;
  align-items: flex-start;
  margin-inline-end: auto;
}

#ny-chatbot-container .ny-live-msg-them {
  align-self: flex-end;
  align-items: flex-end;
  margin-inline-start: auto;
}

#ny-chatbot-container .ny-live-author {
  margin: 0 7px 3px;
  color: color-mix(in srgb, var(--ny-bot-msg-text, #111827) 58%, transparent);
  font-size: 0.66rem;
  font-weight: 600;
}

#ny-chatbot-container .ny-live-bubble {
  padding: 0.68em 1em;
  border-radius: 1.15em;
  font-size: var(--ny-user-msg-fs-desktop, 0.8rem);
  line-height: 1.85;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

#ny-chatbot-container .ny-live-msg-me .ny-live-bubble {
  border-bottom-right-radius: 0.35em;
  color: var(--ny-user-msg-text, #fff);
  background: var(--ny-user-msg-bg, var(--ny-primary-color, #145dee));
  box-shadow: 0 3px 10px color-mix(in srgb, var(--ny-user-msg-bg, #145dee) 18%, transparent);
}

#ny-chatbot-container .ny-live-msg-them .ny-live-bubble {
  border: 1px solid color-mix(in srgb, var(--ny-bot-msg-text, #111827) 7%, transparent);
  border-bottom-left-radius: 0.35em;
  color: var(--ny-bot-msg-text, #111827);
  background: var(--ny-bot-msg-bg, #f4f5f7);
}

#ny-chatbot-container .ny-live-msg-me .ny-live-bubble-products,
#ny-chatbot-container .ny-live-msg-them .ny-live-bubble-products {
  border: 0;
  background: none;
  box-shadow: none;
}

/* The clock under a live bubble. Same class the bot messages use, so it
   inherits their size and opacity; only the alignment is per-side, since a
   live row is a flex column rather than a bubble with meta inside it. */
#ny-chatbot-container .ny-live-msg .ny-message-time {
  margin: 3px 7px 0;
  color: color-mix(in srgb, var(--ny-bot-msg-text, #111827) 55%, transparent);
  direction: ltr;
  unicode-bidi: isolate;
}

#ny-chatbot-container .ny-live-msg-me .ny-message-time {
  text-align: start;
}

#ny-chatbot-container .ny-live-msg-them .ny-message-time {
  text-align: end;
}

#ny-chatbot-container .ny-live-delivery {
  margin: 3px 7px 0;
  color: color-mix(in srgb, var(--ny-bot-msg-text, #111827) 50%, transparent);
  font-size: 0.61rem;
}

#ny-chatbot-container .ny-live-pending .ny-live-bubble {
  opacity: 0.62;
}

#ny-chatbot-container .ny-live-failed {
  cursor: pointer;
}

#ny-chatbot-container .ny-live-failed .ny-live-bubble {
  color: #991b1b;
  background: #fee2e2;
  box-shadow: none;
}

#ny-chatbot-container .ny-live-failed .ny-live-delivery {
  color: #b91c1c;
}

#ny-chatbot-container.ny-live-mode #ny-file-btn,
#ny-chatbot-container.ny-live-mode #ny-voice-btn,
#ny-chatbot-container.ny-live-mode #ny-stop-btn,
#ny-chatbot-container.ny-live-mode #ny-file-info,
#ny-chatbot-container.ny-live-mode #ny-quick-replies,
#ny-chatbot-container.ny-live-mode .ny-bot-actions,
#ny-chatbot-container.ny-live-mode .ny-similar-questions {
  display: none !important;
}

#ny-chatbot-container.ny-live-mode #ny-chat-form {
  border-top-color: color-mix(in srgb, var(--ny-accent-color, #145dee) 18%, transparent);
  background: color-mix(in srgb, var(--ny-accent-color, #145dee) 3%, var(--ny-container-bg, #fff));
}

#ny-chatbot-container.ny-live-mode #ny-send-btn {
  display: inline-flex !important;
}

#ny-chatbot-container.ny-live-connecting #ny-chat-input,
#ny-chatbot-container.ny-live-connecting #ny-send-btn {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 600px) {
  #ny-chatbot-container .ny-live-session {
    margin-top: 4px;
    padding: 9px 10px;
  }

  #ny-chatbot-container .ny-live-session-title { font-size: 0.74rem; }
  #ny-chatbot-container .ny-live-bubble { font-size: var(--ny-user-msg-fs-mobile, 0.78rem); }
  #ny-chatbot-container button.ny-live-end { padding-inline: 7px; }
}

#ny-chatbot-container .ny-live-bubble.ny-live-markdown {
  white-space: normal;
}

#ny-chatbot-container .ny-live-markdown .ny-md-heading {
  margin: 0.35em 0 0.25em;
  font-size: 1.03em;
  font-weight: 700;
  line-height: 1.6;
}

#ny-chatbot-container .ny-live-markdown strong { font-weight: 700; }
#ny-chatbot-container .ny-live-markdown em { font-style: italic; }

#ny-chatbot-container .ny-live-markdown .ny-md-list {
  margin: 0.3em 0;
  padding-inline-start: 1.25em;
  list-style: disc;
}

#ny-chatbot-container .ny-live-markdown .ny-md-list li {
  margin: 0.15em 0;
  list-style: inherit;
}

#ny-chatbot-container .ny-live-markdown .ny-md-link {
  overflow-wrap: anywhere;
  max-width: 100%;
}

#ny-chatbot-container .ny-live-bubble-products {
  padding: 0;
  white-space: normal;
}

#ny-chatbot-container .ny-live-product-note {
  margin-bottom: 6px;
  padding: 0.68em 1em;
  border: 1px solid color-mix(in srgb, var(--ny-bot-msg-text, #111827) 7%, transparent);
  border-radius: 1.15em;
  border-bottom-left-radius: 0.35em;
  color: var(--ny-bot-msg-text, #111827);
  background: var(--ny-bot-msg-bg, #f4f5f7);
  font-size: var(--ny-user-msg-fs-desktop, 0.8rem);
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#ny-chatbot-container .ny-live-products .ny-products-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#ny-chatbot-container .ny-live-products .product-card {
  display: block;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid var(--ny-card-border, rgb(0 0 0 / 0.1));
  border-radius: 10px;
  background: var(--ny-card-bg, #fff);
  transition: all 0.2s ease;
}

#ny-chatbot-container .ny-live-products .product-card:hover {
  background: var(--ny-card-hover-bg, #fafafa);
  border-color: var(--ny-card-border, rgb(0 0 0 / 0.1));
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
}

#ny-chatbot-container .ny-live-products .product-content-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px;
  color: inherit;
  text-decoration: none;
}

#ny-chatbot-container .ny-live-products .product-image {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
}

#ny-chatbot-container .ny-live-products .product-image img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

#ny-chatbot-container .ny-live-products .left-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#ny-chatbot-container .ny-live-products .product-title {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--ny-card-title, inherit);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#ny-chatbot-container .ny-live-products .price-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#ny-chatbot-container .ny-live-products .price {
  color: var(--ny-primary-color, #145dee);
  font-size: 0.82rem;
  font-weight: 700;
}

#ny-chatbot-container .ny-live-products .price.out-of-stock {
  color: #991b1b;
  font-weight: 600;
}

#ny-chatbot-container .ny-live-products .old-price,
#ny-chatbot-container .ny-live-products .price del {
  color: color-mix(in srgb, var(--ny-bot-msg-text, #111827) 45%, transparent);
  font-size: 0.72rem;
  font-weight: 400;
  text-decoration: line-through;
}

@media (max-width: 600px) {
  #ny-chatbot-container .ny-live-products .product-image {
    width: 56px;
    height: 56px;
  }

  #ny-chatbot-container .ny-live-products .product-title { font-size: 0.78rem; }
  #ny-chatbot-container .ny-live-products .price { font-size: 0.76rem; }
  #ny-chatbot-container .ny-live-product-note { font-size: var(--ny-user-msg-fs-mobile, 0.78rem); }
}
