/* ============================================================
   Minoo Brow Bar — Chat widget styles (public site)
   ============================================================ */
#mbb-chat {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  font-family: 'Montserrat', system-ui, sans-serif;
  color: #3a2e2a;
}

/* ---------- Floating button ---------- */
.mbb-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(135deg, #b76e79, #a85966);
  color: #fff;
  border: 0;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 14px 36px rgba(58, 46, 42, 0.22);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.mbb-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(58, 46, 42, 0.28); }
.mbb-fab.open { background: #3a2e2a; }
.mbb-fab-ico { font-size: 1.15rem; line-height: 1; }

@media (max-width: 520px) {
  .mbb-fab-label { display: none; }
  .mbb-fab { padding: 0.85rem 1rem; }
}

/* ---------- Panel ---------- */
.mbb-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #faf3ee;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(58, 46, 42, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(183, 110, 121, 0.20);
  animation: mbbPop 0.18s ease;
}
@keyframes mbbPop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
/* CSS display:flex on .mbb-panel above overrides the HTML `hidden` attribute,
   which is why the X button used to do nothing. Force `hidden` to win. */
.mbb-panel[hidden] { display: none !important; }
.mbb-compose[hidden] { display: none !important; }
.mbb-warn[hidden] { display: none !important; }

.mbb-head {
  background: linear-gradient(135deg, #b76e79, #a85966);
  color: #fff;
  padding: 0.95rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.mbb-head-title { flex: 1; min-width: 0; }
.mbb-head-title strong { display: block; font-size: 1rem; font-weight: 600; }
.mbb-head-title .mbb-head-sub { font-size: 0.74rem; opacity: 0.85; margin-top: 0.15rem; }

.mbb-close {
  background: rgba(255,255,255,0.15);
  border: 0;
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.mbb-close:hover { background: rgba(255,255,255,0.30); }

/* ---------- Body ---------- */
.mbb-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Start screen */
.mbb-start { display: flex; flex-direction: column; gap: 0.6rem; }
.mbb-q {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: #b76e79;
  font-size: 1.1rem;
  margin: 0.4rem 0 0.6rem;
}
.mbb-staff-picks { display: flex; flex-direction: column; gap: 0.5rem; }
.mbb-pick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid rgba(183, 110, 121, 0.20);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  width: 100%;
  font-family: inherit;
  color: #3a2e2a;
}
.mbb-pick:hover { border-color: #b76e79; transform: translateX(2px); }
.mbb-pick > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.mbb-pick strong { font-size: 0.95rem; }
.mbb-pick span span { font-size: 0.76rem; color: #8a6f63; }
.mbb-pick-av {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  flex-shrink: 0;
}

#mbb-name {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(183, 110, 121, 0.30);
  border-radius: 6px;
  background: #fff;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}
#mbb-name:focus { border-color: #b76e79; }
.mbb-go {
  background: linear-gradient(135deg, #b76e79, #a85966);
  color: #fff;
  border: 0;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  align-self: flex-end;
}

/* Messages */
.mbb-msgs { display: flex; flex-direction: column; gap: 0.55rem; }
.mbb-sys {
  text-align: center;
  font-size: 0.74rem;
  color: #8a6f63;
  margin: 0.4rem 0;
  font-style: italic;
}
.mbb-sys.mbb-await { margin-top: 0.7rem; }

.mbb-msg { display: flex; flex-direction: column; max-width: 80%; }
.mbb-msg.me   { align-self: flex-end;   align-items: flex-end; }
.mbb-msg.them { align-self: flex-start; align-items: flex-start; }
.mbb-bubble {
  background: #fff;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
  border: 1px solid rgba(183, 110, 121, 0.15);
}
.mbb-msg.me .mbb-bubble {
  background: linear-gradient(135deg, #f5d0c5, #ecaaa0);
  color: #3a2e2a;
  border-color: transparent;
  border-bottom-right-radius: 4px;
}
.mbb-msg.them .mbb-bubble { border-bottom-left-radius: 4px; }
.mbb-time {
  font-size: 0.66rem;
  color: #8a6f63;
  margin-top: 0.18rem;
  padding: 0 0.3rem;
}
.mbb-scrub {
  font-size: 0.7rem;
  color: #b76e79;
  background: rgba(183, 110, 121, 0.08);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  margin-top: 0.18rem;
  display: inline-block;
}
.mbb-ai-badge {
  font-size: 0.7rem;
  color: #8a6f63;
  background: rgba(201, 181, 138, 0.18);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  margin-top: 0.18rem;
  display: inline-block;
  letter-spacing: 0.02em;
}

/* Typing-dots animation */
.mbb-dots {
  display: inline-flex;
  gap: 4px;
  padding: 0.15rem 0.2rem;
  align-items: center;
}
.mbb-dots span {
  width: 6px; height: 6px;
  background: #b76e79;
  border-radius: 50%;
  display: inline-block;
  animation: mbbBlink 1.2s infinite both;
}
.mbb-dots span:nth-child(2) { animation-delay: 0.15s; }
.mbb-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes mbbBlink {
  0%, 60%, 100% { transform: scale(0.7); opacity: 0.4; }
  30% { transform: scale(1); opacity: 1; }
}

/* Status dot in header */
.mbb-head-sub {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mbb-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #6fcf97;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(111,207,151,0.7);
  animation: mbbPulse 2s infinite;
}
@keyframes mbbPulse {
  0% { box-shadow: 0 0 0 0 rgba(111,207,151,0.7); }
  70% { box-shadow: 0 0 0 6px rgba(111,207,151,0); }
  100% { box-shadow: 0 0 0 0 rgba(111,207,151,0); }
}

/* ---------- Footer (compose + warn + privacy notice) ---------- */
.mbb-foot {
  border-top: 1px solid rgba(183, 110, 121, 0.18);
  background: #fff;
  padding: 0.6rem 0.75rem 0.7rem;
}
.mbb-warn {
  background: rgba(246, 192, 74, 0.14);
  border: 1px solid rgba(246, 192, 74, 0.40);
  color: #6b4f1c;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.mbb-compose { display: flex; gap: 0.45rem; align-items: flex-end; }
#mbb-input {
  flex: 1;
  background: #faf3ee;
  border: 1px solid rgba(183, 110, 121, 0.25);
  border-radius: 16px;
  padding: 0.55rem 0.85rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: #3a2e2a;
  outline: none;
  resize: none;
  min-height: 40px;
  max-height: 100px;
}
#mbb-input:focus { border-color: #b76e79; }
.mbb-send {
  background: linear-gradient(135deg, #b76e79, #a85966);
  color: #fff;
  border: 0;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  height: 40px;
}
.mbb-priv {
  margin-top: 0.55rem;
  font-size: 0.7rem;
  color: #8a6f63;
  line-height: 1.45;
  padding: 0 0.1rem;
}

@media (max-width: 520px) {
  .mbb-panel {
    bottom: 78px;
    right: 12px; left: 12px;
    width: auto;
    height: 70vh;
  }
}
