:root{
  --mmc-font-family: inherit;
  --mmc-font-size: 14px;
  --mmc-text: inherit;
  --mmc-bg: #ffffff;
  --mmc-header-bg: #111827;
  --mmc-header-text: #ffffff;
  --mmc-btn-bg: #111827;
  --mmc-btn-text: #ffffff;
  --mmc-user-bg: #e5efff;
  --mmc-user-text: #111827;
  --mmc-bot-bg: #f3f4f6;
  --mmc-bot-text: #111827;
  --mmc-radius: 12px;
  --mmc-float-bg: #111827;
  --mmc-float-text: #ffffff;
  --mmc-float-weight: 600;
  --mmc-float-border-w: 0px;
  --mmc-float-border-c: transparent;
  --mmc-float-radius: 999px;
  --mmc-float-pad-y: 12px;
  --mmc-float-pad-x: 16px;
  --mmc-float-mar-b: 20px;
  --mmc-float-mar-r: 20px;
}
.mmc-chatbot{
  max-width: 420px;
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  font-family: system-ui, Arial, sans-serif;
  background: #fff;
  position: relative;
}
.mmc-chatbot__header{
  padding: 12px 14px;
  font-weight: 700;
  border-bottom: 1px solid #eee;
}
.mmc-chatbot__messages{
  height: 320px;
  overflow: auto;
  padding: 12px;
  background: #fafafa;
}
.mmc-chatbot__msg{
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 85%;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.mmc-chatbot__msg--user{
  margin-left: auto;
  background: #e8f0fe;
}
.mmc-chatbot__msg--bot{
  margin-right: auto;
  background: #fff;
  border: 1px solid #eee;
}
.mmc-chatbot__form{
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eee;
}
.mmc-chatbot__input{
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
}
.mmc-chatbot__send{
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.mmc-chatbot__status{
  padding: 0 12px 12px;
  color: #666;
  font-size: 12px;
}

/* Lead gate overlay */
.mmc-chatbot--gated .mmc-chatbot__form,
.mmc-chatbot--gated .mmc-chatbot__messages {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.mmc-leadgate{
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.96);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  gap: 10px;
}
.mmc-leadgate__title{
  font-weight: 800;
  font-size: 16px;
}
.mmc-leadgate__desc{
  font-size: 13px;
  color: #444;
}
.mmc-leadgate__form{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mmc-leadgate__input{
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
}
.mmc-leadgate__btn{
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.mmc-leadgate__err{
  color: #b00020;
  font-size: 12px;
}

/* Bubble UI */
#mmc-bubble-mount{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
}
.mmc-bubble{
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.mmc-bubblepanel{
  position: absolute;
  right: 0;
  bottom: 54px;
  width: 380px;
  max-width: calc(100vw - 36px);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 14px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.18);
  display: none;
  overflow: hidden;
}
.mmc-bubblepanel.is-open{ display: block; }
.mmc-bubblepanel__inner{ display: flex; flex-direction: column; }
.mmc-bubblepanel__top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
}
.mmc-bubblepanel__title{ font-weight: 800; }
.mmc-bubblepanel__close{
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* Bubble chat sizing */
.mmc-chatbot--bubble{
  border: 0;
  border-radius: 0;
}
.mmc-chatbot--bubble .mmc-chatbot__messages{
  height: 280px;
}


/* Theme-safe styling via CSS variables */
.mmc-chatbot{
  font-size: var(--mmc-font-size, 14px);
  color: var(--mmc-text, inherit);
}
.mmc-chatbot, .mmc-chatbot *{
  font-family: var(--mmc-font-family, inherit);
}
.mmc-chatbot__panel{
  background: var(--mmc-bg, #fff);
  border-radius: var(--mmc-radius, 12px);
}
.mmc-chatbot__header{
  background: var(--mmc-header-bg, #111827);
  color: var(--mmc-header-text, #fff);
  border-top-left-radius: var(--mmc-radius, 12px);
  border-top-right-radius: var(--mmc-radius, 12px);
}
.mmc-chatbot__send{
  background: var(--mmc-btn-bg, #111827);
  color: var(--mmc-btn-text, #fff);
  border-radius: calc(var(--mmc-radius, 12px) * 0.75);
}
.mmc-chatbot__bubble--user{
  background: var(--mmc-user-bg, #e5efff);
  color: var(--mmc-user-text, #111827);
}
.mmc-chatbot__bubble--bot{
  background: var(--mmc-bot-bg, #f3f4f6);
  color: var(--mmc-bot-text, #111827);
}


/* Styling overrides via CSS variables (applied per-chatbot via inline vars) */
.mmc-chatbot{
  background: var(--mmc-bg, transparent);
  color: var(--mmc-text, inherit);
  font-size: var(--mmc-font-size, 14px);
  border-radius: var(--mmc-radius, 12px);
  overflow: hidden;
}
.mmc-chatbot, .mmc-chatbot *{
  font-family: var(--mmc-font-family, inherit);
}
.mmc-chatbot__header{
  background: var(--mmc-header-bg, #111827);
  color: var(--mmc-header-text, #fff);
}
.mmc-chatbot__send{
  background: var(--mmc-btn-bg, #111827);
  color: var(--mmc-btn-text, #fff);
  border-radius: calc(var(--mmc-radius, 12px) * 0.75);
}
.mmc-chatbot__msg{
  border-radius: calc(var(--mmc-radius, 12px) * 0.75);
}
.mmc-chatbot__msg--user{
  background: var(--mmc-user-bg, #e8f0fe);
  color: var(--mmc-user-text, #111827);
}
.mmc-chatbot__msg--bot{
  background: var(--mmc-bot-bg, #ffffff);
  color: var(--mmc-bot-text, #111827);
  border-color: rgba(0,0,0,0.08);
}


/* Floating bubble button variables */
.mmc-bubble{
  background: var(--mmc-float-bg, #111827);
  color: var(--mmc-float-text, #fff);
  font-weight: var(--mmc-float-weight, 600);
  border-style: solid;
  border-width: var(--mmc-float-border-w, 0px);
  border-color: var(--mmc-float-border-c, transparent);
  border-radius: var(--mmc-float-radius, 999px);
  padding: var(--mmc-float-pad-y, 12px) var(--mmc-float-pad-x, 16px);
  margin-bottom: var(--mmc-float-mar-b, 20px);
  margin-right: var(--mmc-float-mar-r, 20px);
}


/* Lead gate custom fields */
.mmc-leadgate__field{ margin-top:10px; }
.mmc-leadgate__label{ display:block; font-weight:600; margin-bottom:6px; }
.mmc-leadgate__input, .mmc-leadgate textarea{
  width:100%;
  box-sizing:border-box;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,0.15);
  border-radius: 10px;
}


/* v1.0.17.7: New UI bubble styles */

.mmc-root{ font-family: var(--mmc-font-family); font-size: var(--mmc-font-size); color: var(--mmc-text); }
.mmc-panel{ width: 360px; max-width: calc(100vw - 40px); height: 460px; display:flex; flex-direction:column; background: var(--mmc-bg); border-radius: var(--mmc-radius); overflow:hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.18); }
.mmc-header{ background: var(--mmc-header-bg); color: var(--mmc-header-text); padding: 12px 14px; font-weight: 700; }
.mmc-body{ flex:1; display:flex; flex-direction:column; overflow:hidden; }
.mmc-messages{ flex:1; overflow:auto; padding: 12px; background: #f8fafc; }
.mmc-msg{ display:flex; margin: 8px 0; }
.mmc-msg-user{ justify-content:flex-end; }
.mmc-msg-bot{ justify-content:flex-start; }
.mmc-bubble{ max-width: 85%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.35; }
.mmc-msg-user .mmc-bubble{ background: var(--mmc-user-bg); color: var(--mmc-user-text); border-top-right-radius: 6px; }
.mmc-msg-bot .mmc-bubble{ background: var(--mmc-bot-bg); color: var(--mmc-bot-text); border-top-left-radius: 6px; }
.mmc-composer{ display:flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(0,0,0,0.08); background: #fff; }
.mmc-input{ flex:1; padding: 10px 12px; border: 1px solid rgba(0,0,0,0.18); border-radius: 12px; outline: none; }
.mmc-input:focus{ border-color: rgba(34,121,154,0.7); }
.mmc-btn{ cursor:pointer; border:0; border-radius: 12px; padding: 10px 14px; font-weight:600; }
.mmc-btn-send{ background: linear-gradient(90deg,#22799a,#22336e); color: var(--mmc-user-text, #fff); }
.mmc-bubble-btn{ position: fixed; right: var(--mmc-float-mar-r); bottom: var(--mmc-float-mar-b); background: linear-gradient(90deg,#22799a,#22336e); color: var(--mmc-user-text, #fff); border: none; border-radius: var(--mmc-float-radius); padding: var(--mmc-float-pad-y) var(--mmc-float-pad-x); font-weight: var(--mmc-float-weight); box-shadow: 0 10px 25px rgba(0,0,0,0.25); z-index: 99999; }
.mmc-bubble-wrap{ position: fixed; right: var(--mmc-float-mar-r); bottom: calc(var(--mmc-float-mar-b) + 60px); z-index: 99999; }
.mmc-bubble-wrap.mmc-closed{ display:none; }
.mmc-typing .mmc-bubble{ display:flex; align-items:center; gap: 6px; }
.mmc-dots i{ display:inline-block; width:6px; height:6px; border-radius:999px; background: rgba(0,0,0,0.35); animation: mmcDot 1.2s infinite; }
.mmc-dots i:nth-child(2){ animation-delay: .15s; }
.mmc-dots i:nth-child(3){ animation-delay: .3s; }
@keyframes mmcDot{ 0%,80%,100%{ transform: translateY(0); opacity:.5; } 40%{ transform: translateY(-4px); opacity:1; } }

.mmc-lead-wrap{ padding: 12px; border-bottom: 1px solid rgba(0,0,0,0.08); background:#fff; }
.mmc-lead-form{ display:flex; flex-direction:column; gap: 10px; }
.mmc-field label{ display:block; font-size: 12px; opacity:.8; margin-bottom: 4px; }
.mmc-field input, .mmc-field textarea{ width:100%; padding: 10px 12px; border: 1px solid rgba(0,0,0,0.18); border-radius: 12px; }
.mmc-btn-primary{ background: linear-gradient(90deg,#22799a,#22336e); color: var(--mmc-user-text, #fff); }



/* ===== New Messenger-style UI (mmc-root / mmc-msg / mmc-bubble) ===== */
.mmc-root{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: var(--mmc-font-size);
  color: var(--mmc-text);
}
.mmc-panel{
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--mmc-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.mmc-header{
  background: var(--mmc-header-bg);
  color: var(--mmc-header-text);
  padding: 12px 14px;
  font-weight: 700;
}
.mmc-body{
  background: #f7f7f8;
}
.mmc-messages{
  height: 360px;
  overflow: auto;
  padding: 14px;
}
.mmc-msg{
  display: flex;
  margin: 8px 0;
}
.mmc-msg-user{
  justify-content: flex-end;
}
.mmc-msg-bot{
  justify-content: flex-start;
}
.mmc-bubble{
  position: relative;
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 18px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}
.mmc-msg-user .mmc-bubble{
  background: var(--mmc-user-bg, #0084ff);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.mmc-msg-bot .mmc-bubble{
  background: var(--mmc-bot-bg, #e5e7eb);
  color: #111827;
  border-bottom-left-radius: 6px;
}

/* bubble tails */
.mmc-msg-user .mmc-bubble::after{
  content:"";
  position:absolute;
  right:-8px;
  bottom:6px;
  width:14px;
  height:14px;
  background: var(--mmc-user-bg, #0084ff);
  border-bottom-left-radius: 14px;
  transform: rotate(45deg);
}
.mmc-msg-bot .mmc-bubble::after{
  content:"";
  position:absolute;
  left:-8px;
  bottom:6px;
  width:14px;
  height:14px;
  background: var(--mmc-bot-bg, #e5e7eb);
  border-bottom-right-radius: 14px;
  transform: rotate(45deg);
}

/* typing dots */
.mmc-dots{
  display:inline-flex;
  gap:4px;
  align-items:center;
  height: 12px;
}
.mmc-dots i{
  display:inline-block;
  width:6px;
  height:6px;
  border-radius:999px;
  background: currentColor;
  opacity: .6;
  animation: mmcDot 1.2s infinite ease-in-out;
}
.mmc-dots i:nth-child(2){ animation-delay: .15s; }
.mmc-dots i:nth-child(3){ animation-delay: .3s; }
@keyframes mmcDot{
  0%, 80%, 100% { transform: translateY(0); opacity:.4; }
  40% { transform: translateY(-3px); opacity: .85; }
}

.mmc-composer{
  display:flex;
  gap:8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
.mmc-input{
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  outline: none;
}
.mmc-input:focus{
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.mmc-btn{
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}
.mmc-btn-send{
  background: linear-gradient(135deg,#22799a,#22336e);
  color: #fff;
}
.mmc-btn-primary{
  background: linear-gradient(135deg,#22799a,#22336e);
  color: #fff;
}

/* Bubble launcher */
.mmc-bubble-btn{
  position: fixed;
  right: var(--mmc-float-mar-r);
  bottom: var(--mmc-float-mar-b);
  background: linear-gradient(135deg,#22799a,#22336e);
  color: #fff;
  border: 0;
  border-radius: var(--mmc-float-radius);
  padding: var(--mmc-float-pad-y) var(--mmc-float-pad-x);
  font-weight: var(--mmc-float-weight);
  z-index: 99999;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}
.mmc-bubble-wrap{
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 99999;
}
.mmc-bubble-wrap.mmc-closed .mmc-panel{
  display:none;
}

/* Lead form */
.mmc-lead-wrap{
  padding: 12px 14px 0;
}
.mmc-lead-form{
  background:#fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
.mmc-lead-form .mmc-field{
  display:flex;
  flex-direction: column;
  gap:6px;
  margin-bottom: 10px;
}
.mmc-lead-form label{
  font-weight: 600;
  font-size: 12px;
  color:#374151;
}
.mmc-lead-form input,
.mmc-lead-form textarea{
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline:none;
}
.mmc-lead-form input:focus,
.mmc-lead-form textarea:focus{
  border-color:#93c5fd;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}



/* ===== Alias styles for current JS classnames (mmc-msg--user/mmc-msg__bubble) ===== */
.mmc-msg{ display:flex; margin:8px 0; }
.mmc-msg--user{ justify-content:flex-end; }
.mmc-msg--bot{ justify-content:flex-start; }
.mmc-msg__bubble{
  position: relative;
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 18px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}
.mmc-msg--user .mmc-msg__bubble{
  background: var(--mmc-user-bg, #0084ff);
  color: var(--mmc-user-text, #fff);
  border-bottom-right-radius: 6px;
}
.mmc-msg--bot .mmc-msg__bubble{
  background: var(--mmc-bot-bg, #e5e7eb);
  color: var(--mmc-bot-text, #111827);
  border-bottom-left-radius: 6px;
}
.mmc-msg--user .mmc-msg__bubble::after{
  content:"";
  position:absolute;
  right:-8px;
  bottom:6px;
  width:14px;
  height:14px;
  background: var(--mmc-user-bg, #0084ff);
  border-bottom-left-radius: 14px;
  transform: rotate(45deg);
}
.mmc-msg--bot .mmc-msg__bubble::after{
  content:"";
  position:absolute;
  left:-8px;
  bottom:6px;
  width:14px;
  height:14px;
  background: var(--mmc-bot-bg, #e5e7eb);
  border-bottom-right-radius: 14px;
  transform: rotate(45deg);
}





.mmc-embedded{
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Inner column layout */
.mmc-embedded .mmc-chatbot__inner{
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Messages area grows */
.mmc-embedded .mmc-chatbot__messages{
  height: auto;          /* override default 320px */
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 220px;     /* gives a usable height if parent doesn't set one */
}

/* Status + input row stay at bottom */
.mmc-embedded .mmc-chatbot__status{ flex: 0 0 auto; }
.mmc-embedded .mmc-chatbot__form{ flex: 0 0 auto; }




.mmc-embedded {
  display: block !important;
  height: 100% !important;
  max-height: none !important;
  position: relative !important;
  min-height: 520px; /* fallback if parent has no height */
  box-sizing: border-box;
}

.mmc-embedded .mmc-chatbot__window {
  height: 100% !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box;
}

.mmc-embedded .mmc-chatbot__messages {
  flex: 1 1 auto !important;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto !important;
}

.mmc-embedded .mmc-chatbot__input {
  flex: 0 0 auto !important;
}



/* Embedded / Shortcode mode — fill parent container (Elementor, columns, flex) */
.mmc-embedded {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  display: block !important;
  position: relative !important;
  box-sizing: border-box;
  min-height: 520px; /* fallback if parent has no height */
}

/* The main chatbot wrapper we build in JS */
.mmc-embedded .mmc-chatbot__inner {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box;
}

/* Messages area should expand */
.mmc-embedded .mmc-chatbot__messages {
  flex: 1 1 auto !important;
  height: auto !important;          /* overrides fixed 320px */
  max-height: none !important;
  overflow-y: auto !important;
}

/* Keep input row at bottom */
.mmc-embedded .mmc-chatbot__form {
  flex: 0 0 auto !important;
}


/* Embedded / Shortcode mode — form layout (keep Send button visible) */
.mmc-embedded .mmc-chatbot__form {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
.mmc-embedded .mmc-chatbot__form input,
.mmc-embedded .mmc-chatbot__form textarea {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
.mmc-embedded .mmc-chatbot__send,
.mmc-embedded button.mmc-chatbot__send {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 84px;
}
