.noilezer-chat-container { /* copied and namespaced from SF-chatbot-2 */
  --noilezer-shadow: 114, 89, 53; /* rgb for #725935 */
  font-family: Open Sans,Arial,sans-serif;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 100%;
  height: 80%;
  max-width: 420px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(var(--noilezer-shadow), 0.15);
}
.noilezer-chat-header {
  background: linear-gradient(0deg, #725935 0%, #C39C67 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
  /* header should not grow/shrink; fixed size region */
  flex: 0 0 auto;
}
.noilezer-chat-header::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(0deg, #725935 0%, #C39C67 100%);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.noilezer-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}
.noilezer-ai-title {
  display: flex;
  align-items: center;
  color: white;
  font-size: 18px;
  font-weight: 600;
}
.noilezer-sparkle-icon {
  width: 32px;
  height: 32px;
  background: #f8fafc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-size: 20px;
}

.noilezer-chat-box {
  /* chat box is the only flexible area vertically */
  flex: 1 1 auto;
  min-height: 0; /* allow proper flexbox shrinking */
  padding: 20px;
  overflow-y: auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

.noilezer-welcome-section {
  text-align: center;
  margin-bottom: 24px;
}

/* Entrance animation for the welcome block */
.noilezer-welcome-section {
  animation: welcomeIn 320ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes welcomeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Staggered fade/slide for quick-question buttons */
.noilezer-quick-question-button.q-animate { animation: qFadeIn 360ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes qFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.noilezer-welcome-message {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 20px;
}

.noilezer-quick-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.noilezer-quick-question-button {
  padding: 14px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  background-color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 2px 8px rgba(var(--noilezer-shadow), 0.04);
}

.noilezer-quick-question-button:hover {
  background-color: #f8fafc;
  border-color: #C39C67;
  color: #725935;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--noilezer-shadow), 0.15);
}

.noilezer-chat-message {
  display: flex;
  margin-bottom: 16px;
  align-items: flex-end;
  animation: fadeInUp 0.3s ease;
}

.noilezer-chat-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 75%;
  font-weight: 400;
  line-height: 1.6;
  font-size: 14px;
  position: relative;
  /* prefer not to break words mid-word; allow wrapping at word boundaries */
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
  text-align: left;
  transition: min-height 0.1s, height 0.1s, padding 0.1s;
}

/* Markdown heading styles inside chat bubbles */
.noilezer-chat-bubble h1,
.noilezer-chat-bubble h2,
.noilezer-chat-bubble h3,
.noilezer-chat-bubble h4,
.noilezer-chat-bubble h5,
.noilezer-chat-bubble h6 {
  margin: 6px 0 8px 0;
  font-weight: 700;
  color: #0f172a;
}

.noilezer-chat-bubble h3 { font-size: 15px; }
.noilezer-chat-bubble h2 { font-size: 16px; }
.noilezer-chat-bubble h1 { font-size: 18px; }

/* Allow links and animated letters inside bubbles to wrap and respect container width.
   This overrides the per-word no-wrap used for the typewriter effect only for anchors
   so long link labels don't overflow the chat bubble. */
.noilezer-chat-bubble a {
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  display: inline;
  color: inherit;
  text-decoration: underline;
}

.noilezer-chat-bubble a .noilezer-word {
  /* allow words inside links to break/wrap normally */
  white-space: normal;
  display: inline;
}

.noilezer-chat-bubble a .ripple-letter {
  /* allow each animated letter to participate in wrapping */
  display: inline;
}

.noilezer-chat-message.noilezer-user {
  justify-content: flex-end;
  font-weight: 600;
}

.noilezer-chat-message.noilezer-user .noilezer-chat-bubble {
  background: linear-gradient(135deg, #C39C67 0%, #725935 100%);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(var(--noilezer-shadow), 0.3);
}

.noilezer-chat-message.noilezer-system {
  justify-content: flex-start;
}

.noilezer-chat-message.noilezer-system .noilezer-chat-bubble {
  background: #f1f5f9;
  color: #1F2937;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(var(--noilezer-shadow), 0.08);
  border: 1px solid #e2e8f0;
}

.noilezer-ai-avatar {
  width: 24px;
  height: 24px;
  background: #C39C67;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
  font-size: 10px;
  color: white;
}

.noilezer-input-container {
  display: flex;
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e5e7eb;
  align-items: center;
  gap: 12px;
  /* input area should not grow */
  flex: 0 0 auto;
}

.noilezer-input-container input {
  flex: 1;
  padding: 14px 20px;
  font-size: 14px;
  border: 2px solid #e5e7eb;
  border-radius: 20px;
  outline: none;
  background: #f8fafc;
  transition: all 0.3s ease;
}

.noilezer-input-container input:focus {
  border-color: #C39C67;
  background: white;
  box-shadow: 0 0 0 3px rgba(var(--noilezer-shadow), 0.1);
}

.noilezer-input-container input::placeholder {
  color: #9ca3af;
}

.noilezer-send-button {
  background: linear-gradient(135deg, #C39C67 0%, #725935 100%);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(var(--noilezer-shadow), 0.3);
}

.noilezer-send-button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(var(--noilezer-shadow), 0.4); }

#noilezer-reset-chatbot { min-width: 32px; min-height: 32px; border: 0px; border-radius: 100%; }

.noilezer-powered-by {
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: #6B7280;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  box-sizing: border-box;
  height: 40px; /* fixed height to avoid stretching beyond normal padding */
  display: flex;
  align-items: center;
  justify-content: center;
  /* do not grow or shrink vertically */
  flex: 0 0 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.noilezer-powered-by a { color: #C39C67; text-decoration: none; font-weight: 500; margin-left: 6px; }
.noilezer-powered-by a:hover { text-decoration: underline; }

.noilezer-toast {
  position: fixed;
  bottom: 200px;
  right: 24px;
  background: #C39C67;
  color: white;
  padding: 12px 20px;
  border-radius: 16px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(var(--noilezer-shadow), 0.15);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
  z-index: 10000;
}
.noilezer-toast.show { opacity: 1; transform: translateY(0); }

/* Scrollbar */
.noilezer-chat-box::-webkit-scrollbar { width: 4px; }
.noilezer-chat-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: translateY(0);} }

.ripple-letter { display: inline-block; opacity: 0; animation: swirlIn 0.05s forwards; white-space: pre; }
@keyframes swirlIn { 0% { opacity: 0; transform: rotateX(90deg) translateY(2px);} 60% { opacity: 0.8; transform: rotateX(-20deg) translateY(0);} 100% { opacity: 1; transform: rotateX(0deg) translateY(0);} }

/* Keep individual words together so we don't break mid-word */
.noilezer-word { display: inline-block; white-space: nowrap; }

.typing-dots { display: flex; align-items: center; gap: 4px; }
.typing-dots span { width: 6px; height: 6px; background: #6B7280; border-radius: 50%; animation: typing 1.0s infinite ease-in-out; }
@keyframes typing { 0%,60%,100%{ transform: translateY(0); opacity:0.4; } 30%{ transform: translateY(-8px); opacity:1; } }

.noilezer-chatbot-toggle-btn { position: fixed; bottom: 8px; right: 24px; z-index: 9998; background: linear-gradient(135deg, #C39C67 0%, #725935 100%); color: #fff; border: none; border-radius: 50%; width: 52px; height: 52px; font-size: 24px; cursor: pointer; box-shadow: 0 4px 16px rgba(var(--noilezer-shadow), 0.3); }

/* removed show-more styles per user request */

/* Responsive */
@media (max-width: 768px) {
  /* On small screens the chat should take the full viewport and respect safe-area insets */
  .noilezer-chat-container {
    position: fixed;
  /* pin the container inside the viewport while honoring safe-area insets (reduced to half) */
  top: calc(env(safe-area-inset-top) / 2);
    right: 0;
  bottom: calc(env(safe-area-inset-bottom) / 2);
    left: 0;
    width: 100%;
    max-width: none;
  /* keep rounded corners on mobile but smaller than desktop */
  border-radius: 8px;
  /* ensure the container never exceeds the viewport (account for reduced safe-area) */
  max-height: calc(100vh - (env(safe-area-inset-top) / 2) - (env(safe-area-inset-bottom) / 2));
    box-sizing: border-box;
    padding: 0;
    display: flex;
    flex-direction: column;
  }
  /* add extra header padding so the title isn't clipped by the status bar */
  /* only increase the top padding for the status bar area so total height stays predictable (use half inset) */
  .noilezer-chat-header { padding: 16px; padding-top: calc(16px + (env(safe-area-inset-top) / 2)); box-sizing: border-box; }
  /* chat box should flex to fill available space; avoid hard calc heights */
  .noilezer-chat-box { padding: 16px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .noilezer-quick-questions { gap: 8px; }
  .noilezer-quick-question-button { padding: 12px 14px; font-size: 13px; }
  /* ensure the input area doesn't overlap the home indicator */
  .noilezer-input-container { padding: 12px 16px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  /* push the safe-area inset down to the powered-by footer so there isn't an empty gap */
  .noilezer-powered-by { padding-bottom: env(safe-area-inset-bottom); }
}

@media (max-width: 400px) {
  /* Allow the chat box to fill the available flex space on very small screens too */
  .noilezer-chat-box { max-height: none; }
  .noilezer-welcome-message { font-size: 18px; }
  .noilezer-chat-bubble { font-size: 14px; line-height: 1.5; }
  .noilezer-quick-question-button { font-size: 12px; }
}
