/* Site chat widget — brand-led, motion-forward */
.mc-chat {
  --mc-chat-ink: #1a1714;
  --mc-chat-paper: #f7f4ef;
  --mc-chat-panel: #14110f;
  --mc-chat-accent: #dc2a1b;
  --mc-chat-steel: #6d8a9a;
  --mc-chat-line: rgba(255, 255, 255, 0.1);
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  /* Sit above call + WhatsApp float stack */
  bottom: calc(7.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  font-family: "Figtree", "Segoe UI", system-ui, sans-serif;
  pointer-events: none;
}
.mc-chat > * {
  pointer-events: auto;
}
.mc-chat-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem 0.55rem 0.65rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, #1c1917 0%, #2a2420 55%, #3a201c 100%);
  color: #fff;
  box-shadow:
    0 12px 28px rgba(20, 12, 8, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.mc-chat-fab:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 36px rgba(20, 12, 8, 0.4);
}
.mc-chat-fab-pulse {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 1px solid rgba(220, 42, 27, 0.45);
  animation: mcChatPulse 2.4s ease-out infinite;
  pointer-events: none;
}
.mc-chat.is-open .mc-chat-fab-pulse {
  display: none;
}
@keyframes mcChatPulse {
  0% { transform: scale(1); opacity: 0.7; }
  70% { transform: scale(1.12); opacity: 0; }
  100% { opacity: 0; }
}
.mc-chat-fab-icon {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--mc-chat-accent);
  color: #fff;
}
.mc-chat-fab-icon svg {
  width: 18px;
  height: 18px;
}
.mc-chat-fab-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.mc-chat.is-open .mc-chat-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

.mc-chat-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(392px, calc(100vw - 1.5rem));
  height: min(640px, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(900px 280px at 10% -10%, rgba(220, 42, 27, 0.28), transparent 55%),
    radial-gradient(700px 240px at 100% 0%, rgba(109, 138, 154, 0.22), transparent 50%),
    linear-gradient(165deg, #1a1613 0%, #12100e 55%, #0e0c0b 100%);
  color: #f5f2ec;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--mc-chat-line);
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.mc-chat.is-open .mc-chat-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.mc-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--mc-chat-line);
}
.mc-chat-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 242, 236, 0.55);
  font-weight: 650;
}
.mc-chat-title {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.mc-chat-sub {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: rgba(245, 242, 236, 0.65);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mc-chat-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #3dba74;
  box-shadow: 0 0 0 4px rgba(61, 186, 116, 0.18);
}
.mc-chat-head-acts {
  display: flex;
  gap: 0.35rem;
}
.mc-chat-wa,
.mc-chat-x {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.mc-chat-wa:hover,
.mc-chat-x:hover {
  background: rgba(255, 255, 255, 0.16);
}

.mc-chat-stream {
  flex: 1;
  overflow: auto;
  padding: 1rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  scroll-behavior: smooth;
}
.mc-chat-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.mc-chat-body[hidden],
.mc-chat-identity[hidden],
.mc-chat-quick[hidden] {
  display: none !important;
}
.mc-chat.is-identifying .mc-chat-quick {
  display: none !important;
}
.mc-chat-identity {
  padding: 0.7rem 0.9rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  overflow: auto;
}
.mc-chat-identity-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.mc-chat-identity-lead {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(245, 242, 236, 0.62);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mc-chat-identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.4rem;
}
.mc-chat-identity-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(245, 242, 236, 0.5);
}
.mc-chat-identity-grid label.is-full {
  grid-column: 1 / -1;
}
.mc-chat-identity-grid input {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0.42rem 0.55rem;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}
.mc-chat-identity-grid input:focus {
  outline: none;
  border-color: rgba(220, 42, 27, 0.55);
  box-shadow: 0 0 0 2px rgba(220, 42, 27, 0.16);
}
.mc-chat-identity-err {
  margin: 0;
  font-size: 0.72rem;
  color: #f5b5ae;
}
.mc-chat-identity-go {
  margin-top: 0.1rem;
  border: 0;
  border-radius: 10px;
  padding: 0.58rem 0.85rem;
  background: var(--mc-chat-accent);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 750;
  cursor: pointer;
}
.mc-chat-identity-go:disabled {
  opacity: 0.6;
  cursor: wait;
}
.mc-chat-bubble {
  max-width: 88%;
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.mc-chat-bubble.is-me {
  align-self: flex-end;
  background: linear-gradient(145deg, #dc2a1b, #b51f13);
  border-color: transparent;
}
.mc-chat-bubble.is-system {
  align-self: center;
  max-width: 94%;
  background: rgba(109, 138, 154, 0.18);
  text-align: center;
}
.mc-chat-bubble.is-in {
  animation: mcChatIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes mcChatIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.mc-chat-who {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.25rem;
}
.mc-chat-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.mc-chat-typing {
  display: inline-flex;
  gap: 0.28rem;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  width: fit-content;
}
.mc-chat-typing span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  animation: mcChatDot 1.1s infinite ease-in-out;
}
.mc-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.mc-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mcChatDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.mc-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.45rem 1rem 0.65rem;
}
.mc-chat-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #f5f2ec;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.mc-chat-chip:hover {
  background: rgba(220, 42, 27, 0.2);
  border-color: rgba(220, 42, 27, 0.45);
}

.mc-chat-compose {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.75rem 0.85rem 0.95rem;
  border-top: 1px solid var(--mc-chat-line);
  background: rgba(0, 0, 0, 0.25);
}
.mc-chat-input {
  flex: 1;
  resize: none;
  min-height: 2.5rem;
  max-height: 7.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.35;
}
.mc-chat-input:focus {
  outline: none;
  border-color: rgba(220, 42, 27, 0.55);
  box-shadow: 0 0 0 3px rgba(220, 42, 27, 0.18);
}
.mc-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.mc-chat-send {
  width: 2.65rem;
  height: 2.65rem;
  border: 0;
  border-radius: 14px;
  background: var(--mc-chat-accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}
.mc-chat-send:hover {
  transform: translateY(-1px);
  background: #c42316;
}
.mc-chat-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 480px) {
  .mc-chat {
    right: 0.65rem;
    bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px));
  }
  .mc-chat-panel {
    width: calc(100vw - 1.3rem);
    height: min(78vh, 620px);
    border-radius: 18px;
  }
  .mc-chat-fab-label {
    display: none;
  }
  .mc-chat-fab {
    padding: 0.55rem;
  }
}
