/**
 * Musaned Custom Chat System — Musaned Website Brand System
 * Direction: Accessible, compact support experience
 * Color System: Site Charcoal (#0C1012), Secondary Slate (#334155),
 *               Brand Cyan (#2990B1), Background (#F5F8FA), Soft Border (#DCE3E4)
 * Supports: Arabic (RTL) / English (LTR), Dark Mode, Mobile Safe-Areas, Reduced Motion
 *
 * @package MusanedCustomChat
 */

:root {
  /* Musaned Site Color Tokens */
  --mcc-primary-dark: #0C1012;
  --mcc-secondary-slate: #334155;
  --mcc-brand-cyan-dark: #1B6C86;
  --mcc-brand-cyan: #2990B1;
  --mcc-brand-cyan-light: #EAF5F8;
  --mcc-brand-cyan-glow: rgba(41, 144, 177, 0.22);
  --mcc-bg-body: #F5F8FA;
  --mcc-bg-window: #FFFFFF;
  --mcc-bg-header: #0C1012;
  --mcc-surface: #FFFFFF;
  --mcc-surface-hover: #F5F8FA;
  --mcc-border: #DCE3E4;
  --mcc-border-subtle: #E8ECEE;
  --mcc-text-primary: #0F172A;
  --mcc-text-secondary: #475569;
  --mcc-text-muted: #64748B;
  --mcc-text-on-dark: #FFFFFF;
  --mcc-action-secondary-text: #1B6C86;
  --mcc-action-secondary-hover-bg: #EAF5F8;

  /* Bubbles */
  --mcc-bubble-bot-bg: #FFFFFF;
  --mcc-bubble-bot-border: #DCE3E4;
  --mcc-bubble-bot-text: #17262D;
  --mcc-bubble-user-bg: #1B6C86;
  --mcc-bubble-user-text: #FFFFFF;

  /* WhatsApp Official */
  --mcc-whatsapp: #25D366;
  --mcc-whatsapp-dark: #1EBE5D;
  --mcc-whatsapp-glow: rgba(37, 211, 102, 0.3);

  /* Elevation & Geometry */
  --mcc-shadow-window: 0 18px 48px -14px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.06);
  --mcc-shadow-card: 0 2px 8px rgba(15, 23, 42, 0.06);
  --mcc-shadow-card-hover: 0 5px 14px rgba(15, 23, 42, 0.1);
  --mcc-radius-window: 20px;
  --mcc-radius-card: 14px;
  --mcc-radius-bubble: 16px;
  --mcc-font: "Cairo", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

/* Dark Mode Integration */
.dark, [data-theme="dark"] {
  --mcc-bg-window: #0C1012;
  --mcc-bg-header: #0C1012;
  --mcc-bg-body: #0C1012;
  --mcc-surface: #12181B;
  --mcc-surface-hover: #182126;
  --mcc-border: #263F4E;
  --mcc-border-subtle: #1E3340;
  --mcc-text-primary: #F5F8FA;
  --mcc-text-secondary: #B9CDD6;
  --mcc-text-muted: #91AAB5;
  --mcc-action-secondary-text: #82D7EC;
  --mcc-action-secondary-hover-bg: #173340;
  /* Contextual/selected service surfaces must stay dark in dark mode. */
  --mcc-brand-cyan-light: #173340;
  --mcc-bubble-bot-bg: #182C38;
  --mcc-bubble-bot-border: #263F4E;
  --mcc-bubble-bot-text: #F5F8FA;
  --mcc-bubble-user-bg: #1B6C86;
  --mcc-bubble-user-text: #FFFFFF;
  --mcc-shadow-window: 0 28px 70px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(41, 144, 177, 0.15);
}

/* --------------------------------------------------------------------------
   Root Container
   -------------------------------------------------------------------------- */
.mcc-root {
  position: fixed;
  bottom: max(1.5rem, env(safe-area-inset-bottom, 1.5rem));
  z-index: 99999;
  font-family: var(--mcc-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--mcc-text-primary);
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.mcc-root *, .mcc-root *::before, .mcc-root *::after {
  box-sizing: inherit;
}

.mcc-root [hidden] {
  display: none !important;
}

.mcc-pos-right {
  right: max(1.5rem, env(safe-area-inset-right, 1.5rem));
  left: auto;
}

.mcc-pos-left {
  left: max(1.5rem, env(safe-area-inset-left, 1.5rem));
  right: auto;
}

/* --------------------------------------------------------------------------
   Floating Launcher Button (Musaned Cyan)
   -------------------------------------------------------------------------- */
.mcc-launcher {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  background: var(--mcc-brand-cyan-dark);
  color: #FFFFFF;
  border: 1.5px solid var(--mcc-brand-cyan-dark);
  box-shadow: 0 12px 28px -6px rgba(19, 35, 45, 0.4), 0 0 0 1px rgba(41, 144, 177, 0.3);
  cursor: pointer;
  padding: 0;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
  user-select: none;
  outline: none;
}

.mcc-launcher:hover {
  transform: translateY(-3px) scale(1.04);
  border-color: var(--mcc-brand-cyan);
  box-shadow: 0 16px 36px -6px rgba(19, 35, 45, 0.5), 0 0 0 3px var(--mcc-brand-cyan-glow);
}

.mcc-launcher:active {
  transform: translateY(0) scale(0.96);
}

.mcc-launcher:focus-visible {
  outline: 2px solid var(--mcc-brand-cyan-dark);
  outline-offset: 3px;
}

.mcc-launcher-icon-wrap {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  position: relative;
}

.mcc-launcher-icon {
  position: absolute;
  width: 26px;
  height: 26px;
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.mcc-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}

.mcc-launcher[aria-expanded="true"] .mcc-icon-open {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

.mcc-launcher[aria-expanded="true"] .mcc-icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.mcc-unread-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--mcc-brand-cyan-dark);
  color: #0C1012;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* --------------------------------------------------------------------------
   Chat Window (Corporate Luxury Dimension & Styling)
   -------------------------------------------------------------------------- */
.mcc-window {
  position: absolute;
  bottom: calc(60px + 14px);
  width: 396px;
  max-width: calc(100vw - 28px);
  height: min(650px, calc(100dvh - 110px), calc(100vh - 110px));
  max-height: calc(100dvh - 90px);
  min-height: 400px;
  background: var(--mcc-bg-window);
  border: 1px solid var(--mcc-border);
  border-radius: var(--mcc-radius-window);
  box-shadow: var(--mcc-shadow-window);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s;
  z-index: 99999;
}

.mcc-pos-right .mcc-window {
  right: 0;
  left: auto;
  transform-origin: bottom right;
}

.mcc-pos-left .mcc-window {
  left: 0;
  right: auto;
  transform-origin: bottom left;
}

.mcc-window.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* --------------------------------------------------------------------------
   Window Header (Deep Luxury Dark with Gold Accent)
   -------------------------------------------------------------------------- */
.mcc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--mcc-primary-dark);
  color: var(--mcc-text-on-dark);
  border-bottom: 1px solid rgba(41, 144, 177, 0.2);
  flex-shrink: 0;
  z-index: 5;
  gap: 6px;
}

.mcc-header-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.mcc-btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.18s ease, transform 0.18s ease;
}

.mcc-btn-back:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.06);
}

.mcc-btn-back svg {
  width: 15px;
  height: 15px;
}

.mcc-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.mcc-avatar-circle {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 1.5px solid var(--mcc-brand-cyan-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  padding: 2px;
}

.mcc-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mcc-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: var(--mcc-brand-cyan-dark);
  border: 2px solid var(--mcc-primary-dark);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.mcc-status-dot.is-live {
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
}

.mcc-status-dot.is-queued {
  background: #F59E0B;
}

.mcc-status-dot.is-offline {
  background: #8E9BA1;
}

.mcc-title-meta {
  min-width: 0;
  flex: 1;
}

.mcc-brand-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.mcc-subtitle {
  margin: 1px 0 0 0;
  font-size: 11px;
  color: #DCE3E4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mcc-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mcc-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.mcc-header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.mcc-header-btn:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--mcc-brand-cyan-glow);
}

.mcc-conversations-view {
  padding: 18px;
  min-height: 100%;
  background: var(--mcc-surface-light, #fff);
}
.dark .mcc-conversations-view,
[data-theme="dark"] .mcc-conversations-view { background: var(--mcc-primary-dark, #0c1012); }
.mcc-conversations-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.mcc-conversations-heading h3 { margin:0; font-size:16px; color:var(--mcc-text, #14232b); }
.dark .mcc-conversations-heading h3,
[data-theme="dark"] .mcc-conversations-heading h3 { color:#f5f8fa; }
.mcc-conversations-heading .mcc-btn-primary { min-height:38px; padding:8px 12px; font-size:12px; }
.mcc-conversation-list { display:grid; gap:10px; min-width:0; }
.mcc-conversation-item { box-sizing:border-box; display:block; width:100%; min-width:0; overflow:hidden; text-align:start; border:1px solid var(--mcc-border, #d8e1e5); border-radius:14px; padding:13px; background:rgba(255,255,255,.72); color:inherit; cursor:pointer; box-shadow:0 4px 12px rgba(20,35,43,.05); transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.mcc-conversation-item:hover, .mcc-conversation-item:focus-visible { border-color:var(--mcc-brand-cyan-dark); outline:2px solid color-mix(in srgb, var(--mcc-brand-cyan-dark) 30%, transparent); }
.mcc-conversation-item:hover { transform:translateY(-1px); box-shadow:0 7px 18px rgba(20,35,43,.09); }
.mcc-conversation-item.is-current { border-color:var(--mcc-brand-cyan-dark); background:rgba(0,196,212,.09); box-shadow:0 0 0 1px rgba(0,196,212,.12), 0 7px 18px rgba(20,35,43,.08); }
.mcc-conversation-item-head { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; width:100%; }
.mcc-conversation-title { min-width:0; overflow:hidden; font-weight:800; text-overflow:ellipsis; white-space:nowrap; overflow-wrap:anywhere; unicode-bidi:plaintext; }
.mcc-conversation-status { flex:0 0 auto; max-width:45%; overflow:hidden; border-radius:999px; padding:3px 7px; font-size:10px; font-weight:700; background:rgba(20,35,43,.08); color:var(--mcc-text, #14232b); text-overflow:ellipsis; white-space:nowrap; overflow-wrap:anywhere; }
.mcc-status-active, .mcc-status-live { background:rgba(0,196,212,.15); color:#006f7b; }
.mcc-status-queued { background:rgba(236,180,67,.18); color:#8a5a00; }
.mcc-status-expired, .mcc-status-closed { background:rgba(120,133,141,.16); color:#68747a; }
.mcc-conversation-preview { display:-webkit-box; min-width:0; max-width:100%; margin-top:8px; overflow:hidden; color:var(--mcc-text-muted, #5b6b73); font-size:12px; line-height:1.45; overflow-wrap:anywhere; word-break:break-word; -webkit-box-orient:vertical; -webkit-line-clamp:2; unicode-bidi:plaintext; }
.mcc-conversation-meta { display:flex; min-width:0; gap:8px; flex-wrap:wrap; margin-top:7px; font-size:11px; opacity:.72; overflow-wrap:anywhere; unicode-bidi:plaintext; }
.mcc-conversation-unread { display:inline-flex; width:8px; height:8px; border-radius:50%; background:var(--mcc-brand-cyan-dark); }
.mcc-conversation-empty { text-align:center; padding:30px 12px; opacity:.78; }
.mcc-history-retry { margin-top:8px; min-height:34px; padding:7px 12px; }
.dark .mcc-conversation-item, [data-theme="dark"] .mcc-conversation-item { background:rgba(20,31,36,.86); box-shadow:0 4px 14px rgba(0,0,0,.2); }
.dark .mcc-conversation-preview, [data-theme="dark"] .mcc-conversation-preview { color:#b6c6cc; }
.dark .mcc-conversation-status, [data-theme="dark"] .mcc-conversation-status { color:#eaf4f7; background:rgba(255,255,255,.1); }
.dark .mcc-status-active, [data-theme="dark"] .mcc-status-active, .dark .mcc-status-live, [data-theme="dark"] .mcc-status-live { color:#79e8ef; background:rgba(0,196,212,.18); }
@media (prefers-reduced-motion: reduce) {
  .mcc-conversation-item { transition:none; }
  .mcc-conversation-item:hover { transform:none; }
}

/* --------------------------------------------------------------------------
   Wave 6 Premium Design Layer
   A small, shared token layer keeps the existing architecture intact while
   giving every chat surface the same rhythm, depth and focus treatment.
   -------------------------------------------------------------------------- */
:root {
  --mcc-space-1: 4px;
  --mcc-space-2: 8px;
  --mcc-space-3: 12px;
  --mcc-space-4: 16px;
  --mcc-space-5: 20px;
  --mcc-space-6: 24px;
  --mcc-radius-control: 12px;
  --mcc-radius-panel: 22px;
  --mcc-shadow-soft: 0 8px 24px rgba(15, 23, 42, .08);
  --mcc-focus-ring: 0 0 0 3px var(--mcc-brand-cyan-glow);
}

.mcc-window {
  border-radius: var(--mcc-radius-panel);
  box-shadow: 0 24px 64px -22px rgba(15, 23, 42, .30), 0 0 0 1px rgba(41, 144, 177, .12);
}

.mcc-header {
  min-height: 68px;
  padding: 12px 14px;
  background: linear-gradient(145deg, #0C1012 0%, #142329 100%);
  border-bottom-color: rgba(130, 215, 236, .22);
}

.mcc-avatar-wrap { width: 40px; height: 40px; }
.mcc-brand-title { font-size: 14px; letter-spacing: -.25px; }
.mcc-subtitle { font-size: 10.5px; color: #B9CDD6; }
.mcc-header-actions { gap: 5px; }
.mcc-header-btn, .mcc-btn-back { border-radius: var(--mcc-radius-control); }
.mcc-header-btn:hover, .mcc-btn-back:hover { background: rgba(130, 215, 236, .18); }
.mcc-header-btn:focus-visible, .mcc-btn-back:focus-visible { box-shadow: var(--mcc-focus-ring); }

.mcc-body {
  padding: var(--mcc-space-5) var(--mcc-space-4) var(--mcc-space-4);
  gap: var(--mcc-space-4);
}

.mcc-messages { gap: 12px; }
.mcc-msg { max-width: min(88%, 350px); }
.mcc-msg-meta { margin-bottom: 4px; padding-inline: 6px; font-size: 10.5px; }
.mcc-bubble { padding: 12px 15px; border-radius: 17px; line-height: 1.62; }
.mcc-msg-bot .mcc-bubble { box-shadow: 0 3px 12px rgba(15, 23, 42, .06); }
.mcc-msg-user .mcc-bubble { box-shadow: 0 4px 12px rgba(27, 108, 134, .20); }
.mcc-msg-time { opacity: .82; font-size: 9.5px; }

.mcc-primary-cta,
.mcc-service-card.mcc-primary-cta {
  border-radius: 16px !important;
  box-shadow: 0 8px 22px rgba(27, 108, 134, .20) !important;
}

.mcc-primary-cta-content { gap: 12px !important; }
.mcc-primary-cta-icon-wrap { width: 42px !important; height: 42px !important; }
.mcc-primary-cta-title { font-size: 14.5px !important; }
.mcc-primary-cta-sub { font-size: 11.5px !important; }

.mcc-services-grid { gap: 10px; }
.mcc-service-card {
  min-height: 82px;
  padding: 12px 13px;
  border-radius: var(--mcc-radius-card);
  box-shadow: var(--mcc-shadow-card);
}
.mcc-service-card:hover { transform: translateY(-1px); box-shadow: var(--mcc-shadow-card-hover); }
.mcc-service-card:focus-visible { outline: 3px solid var(--mcc-brand-cyan-glow); outline-offset: 2px; }
.mcc-service-icon { width: 30px; height: 30px; border-radius: 9px; }
.mcc-service-label { font-size: 12.5px; }
.mcc-service-desc { font-size: 10.5px; line-height: 1.35; }

.mcc-input, .mcc-country-btn, .mcc-send-btn, .mcc-skip-name {
  border-radius: var(--mcc-radius-control);
}
.mcc-input { height: 46px; padding-inline: 15px; font-size: 13.5px; }
.mcc-input:focus, .mcc-country-btn:focus-visible, .mcc-send-btn:focus-visible { box-shadow: var(--mcc-focus-ring); }
.mcc-send-btn { width: 46px; height: 46px; }
.mcc-footer { padding: 13px 16px max(13px, env(safe-area-inset-bottom, 13px)); gap: 9px; }

.mcc-conversations-view { padding: var(--mcc-space-5); }
.mcc-conversation-item { border-radius: 16px; padding: 15px; box-shadow: var(--mcc-shadow-soft); }
.mcc-conversation-item:focus-visible { outline: 3px solid var(--mcc-brand-cyan-glow); outline-offset: 2px; }
.mcc-conversation-preview { line-height: 1.55; }

.mcc-typing { border-radius: 14px; box-shadow: var(--mcc-shadow-soft); }
.mcc-form-error { border-radius: 10px; background: color-mix(in srgb, #A33030 8%, transparent); padding: 7px 9px; }

@media (max-width: 480px) {
  .mcc-window { border-radius: 20px; }
  .mcc-header { min-height: 64px; padding: 10px 12px; }
  .mcc-avatar-wrap { width: 36px; height: 36px; }
  .mcc-brand-title { font-size: 13px; }
  .mcc-body { padding: 16px 13px 14px; gap: 13px; }
  .mcc-service-card { min-height: 72px; padding: 11px 12px; }
  .mcc-service-icon { width: 28px; height: 28px; }
  .mcc-footer { padding-inline: 12px; }
}

@media (max-width: 360px) {
  .mcc-header { min-height: 60px; }
  .mcc-header-actions { gap: 3px; }
  .mcc-header-btn { width: 30px; height: 30px; }
  .mcc-bubble { padding: 11px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .mcc-window, .mcc-msg, .mcc-service-card, .mcc-primary-cta { transition: none !important; animation: none !important; }
}

/* Short landscape viewports are wider than 480px, so they do not enter the
   portrait mobile rule above. Keep the panel inside the usable visual
   viewport instead of allowing the desktop min-height to push its header off
   screen. */
@media (orientation: landscape) and (max-height: 520px) {
  .mcc-window {
    position: fixed;
    top: max(8px, env(safe-area-inset-top, 8px));
    bottom: max(8px, env(safe-area-inset-bottom, 8px));
    right: max(12px, env(safe-area-inset-right, 12px));
    left: auto;
    width: min(460px, calc(100vw - 24px));
    height: auto;
    max-height: calc(100dvh - env(safe-area-inset-top, 8px) - env(safe-area-inset-bottom, 8px) - 16px);
    min-height: 0;
    border-radius: 18px;
  }

  .mcc-body { min-height: 0; padding-block: 12px; }
  .mcc-footer { padding-block: 10px max(10px, env(safe-area-inset-bottom, 10px)); }
}

/* The chat's own launcher is replaced by the in-panel close control while
   open. Site-level WhatsApp/phone controls remain untouched. */
.mcc-root:has(.mcc-window.is-open) > .mcc-launcher {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mcc-header-btn svg {
  width: 15px;
  height: 15px;
}

/* The explicit close action is intentionally more prominent than minimize
   and restart, while retaining the existing cyan/slate visual language. */
.mcc-btn-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: var(--mcc-brand-cyan-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.mcc-btn-close:hover {
  background: var(--mcc-brand-cyan);
  border-color: #FFFFFF;
}

.mcc-btn-close svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Body Area & Messages Region
   -------------------------------------------------------------------------- */
.mcc-body {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px 22px 16px;
  background: var(--mcc-bg-body);
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Explicit smooth scrolling is requested by chat.js when appropriate.
     Automatic actionable-card reveals must land immediately on small viewports. */
  scroll-behavior: auto;
}

.mcc-body::-webkit-scrollbar {
  width: 5px;
}

.mcc-body::-webkit-scrollbar-track {
  background: transparent;
}

.mcc-body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--mcc-text-muted) 34%, transparent);
  border-radius: 999px;
}

.mcc-body {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--mcc-text-muted) 34%, transparent) transparent;
  overscroll-behavior: contain;
}

.mcc-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  min-height: min-content;
}

.mcc-init-state {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 86%;
  padding: 12px 14px;
  color: var(--mcc-text-secondary);
  background: var(--mcc-bubble-bot-bg);
  border: 1px solid var(--mcc-bubble-bot-border);
  border-radius: 14px 14px 14px 4px;
  box-shadow: var(--mcc-shadow-card);
}

.mcc-init-state.is-error {
  flex-wrap: wrap;
  color: var(--mcc-text-primary);
  border-inline-start: 3px solid var(--mcc-brand-cyan);
}

.mcc-init-message {
  min-width: 0;
}

.mcc-init-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid var(--mcc-border);
  border-top-color: var(--mcc-brand-cyan);
  border-radius: 50%;
  animation: mcc-init-spin 0.8s linear infinite;
}

.mcc-init-retry {
  min-height: 34px;
  padding: 6px 13px;
  color: #fff;
  background: var(--mcc-brand-cyan-dark);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mcc-init-retry:hover,
.mcc-init-retry:focus-visible {
  background: var(--mcc-secondary-slate);
}

.mcc-input:disabled,
.mcc-send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@keyframes mcc-init-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .mcc-init-spinner { animation-duration: 2s; }
}

/* --------------------------------------------------------------------------
   Message Bubbles (Corporate Contrast & Operator Support)
   -------------------------------------------------------------------------- */
.mcc-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: mccFadeSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mcc-session-notice {
  align-self: center;
  max-width: 92%;
  margin: 8px auto;
  padding: 8px 12px;
  border: 1px solid var(--mcc-border);
  border-radius: 12px;
  background: var(--mcc-surface-hover);
  color: var(--mcc-text-secondary);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.mcc-unsent-draft {
  align-self: center;
  max-width: 92%;
  margin: 4px auto 10px;
  padding: 10px 12px;
  border: 1px solid var(--mcc-border);
  border-radius: 12px;
  background: var(--mcc-surface);
  color: var(--mcc-text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.mcc-unsent-draft-text {
  margin-top: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--mcc-bg-body);
  color: var(--mcc-text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

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

.mcc-msg-bot,
.mcc-msg-operator {
  align-self: flex-start;
}

.mcc-msg-user {
  align-self: flex-end;
}

.mcc-msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--mcc-text-secondary);
  margin-bottom: 3px;
  padding: 0 4px;
}

.mcc-msg-meta.is-operator .mcc-sender-name {
  color: var(--mcc-primary-dark);
  font-weight: 800;
}

.mcc-operator-chip {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(41, 144, 177, 0.18);
  color: #1B6C86;
  border: 1px solid rgba(41, 144, 177, 0.4);
}

.mcc-bubble {
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  border-radius: var(--mcc-radius-bubble);
  word-wrap: break-word;
  white-space: pre-line;
}

.mcc-msg-bot .mcc-bubble {
  background: var(--mcc-bubble-bot-bg);
  color: var(--mcc-bubble-bot-text);
  border: 1px solid var(--mcc-bubble-bot-border);
  box-shadow: 0 1px 3px rgba(19, 35, 45, 0.04);
  border-top-left-radius: 4px;
}

[dir="rtl"] .mcc-msg-bot .mcc-bubble {
  border-top-left-radius: var(--mcc-radius-bubble);
  border-top-right-radius: 4px;
}

/* Real Human Operator Bubble (Distinguished Gold Rim) */
.mcc-msg-operator .mcc-bubble {
  background: var(--mcc-surface);
  color: var(--mcc-text-primary);
  border: 1.5px solid var(--mcc-brand-cyan-dark);
  box-shadow: 0 3px 12px -2px rgba(41, 144, 177, 0.28);
  border-top-left-radius: 4px;
}

[dir="rtl"] .mcc-msg-operator .mcc-bubble {
  border-top-left-radius: var(--mcc-radius-bubble);
  border-top-right-radius: 4px;
}

.mcc-msg-user .mcc-bubble {
  background: var(--mcc-bubble-user-bg);
  color: var(--mcc-bubble-user-text);
  box-shadow: 0 2px 6px rgba(19, 35, 45, 0.15);
  border-top-right-radius: 4px;
}

[dir="rtl"] .mcc-msg-user .mcc-bubble {
  border-top-right-radius: var(--mcc-radius-bubble);
  border-top-left-radius: 4px;
}

.mcc-msg-time {
  font-size: 10px;
  color: var(--mcc-text-muted);
  margin-top: 2px;
  padding: 0 4px;
  min-height: 12px;
}

.mcc-msg-bot .mcc-msg-time,
.mcc-msg-operator .mcc-msg-time {
  align-self: flex-start;
}

.mcc-msg-user .mcc-msg-time {
  align-self: flex-end;
}

/* --------------------------------------------------------------------------
   Interactive Tracks: PRIMARY CTA + SECONDARY SERVICES
   -------------------------------------------------------------------------- */
.mcc-interactive {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 10px;
  margin-top: 2px;
  padding-bottom: 6px;
}

.mcc-welcome-tracks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* Track 1: Primary Action — Live Customer Support (High Priority Corporate Luxury Card) */
.mcc-primary-cta,
.mcc-service-card.mcc-primary-cta {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 13px 15px !important;
  background: #0C1012 !important;
  color: #FFFFFF !important;
  border: 1.5px solid var(--mcc-brand-cyan-dark) !important;
  border-radius: var(--mcc-radius-card) !important;
  box-shadow: 0 6px 18px -3px rgba(19, 35, 45, 0.28), 0 0 0 1px rgba(41, 144, 177, 0.2) !important;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease,
              background 0.2s ease;
  user-select: none;
  text-align: start !important;
  margin: 2px 0 6px 0 !important;
  min-height: auto !important;
  box-sizing: border-box !important;
}

.mcc-primary-cta:hover,
.mcc-service-card.mcc-primary-cta:hover {
  transform: translateY(-2px);
  background: #12181B !important;
  border-color: var(--mcc-brand-cyan) !important;
  box-shadow: 0 10px 24px -4px rgba(19, 35, 45, 0.38), 0 0 0 2px var(--mcc-brand-cyan-glow) !important;
}

.mcc-primary-cta:active,
.mcc-service-card.mcc-primary-cta:active {
  transform: translateY(0);
}

.mcc-primary-cta-content {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.mcc-primary-cta-icon-wrap {
  display: grid !important;
  place-items: center !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 9999px !important;
  background: rgba(41, 144, 177, 0.2) !important;
  border: 1.5px solid var(--mcc-brand-cyan-dark) !important;
  color: #EAF5F8 !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s ease, background 0.2s ease;
}

.mcc-primary-cta:hover .mcc-primary-cta-icon-wrap,
.mcc-service-card.mcc-primary-cta:hover .mcc-primary-cta-icon-wrap {
  transform: scale(1.06);
  background: var(--mcc-brand-cyan-dark) !important;
  color: var(--mcc-primary-dark) !important;
}

.mcc-primary-cta-icon-wrap svg {
  width: 20px !important;
  height: 20px !important;
}

.mcc-primary-cta-texts {
  min-width: 0 !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.mcc-primary-cta-header-row {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-bottom: 1px !important;
  flex-wrap: wrap !important;
}

.mcc-primary-cta-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #FFFFFF !important;
  letter-spacing: -0.1px;
  line-height: 1.3 !important;
}

.mcc-primary-cta-badge {
  font-size: 9.5px !important;
  font-weight: 700 !important;
  padding: 1px 7px !important;
  border-radius: 999px !important;
  background: rgba(41, 144, 177, 0.25) !important;
  color: #EAF5F8 !important;
  border: 1px solid var(--mcc-brand-cyan-dark) !important;
  letter-spacing: 0.2px;
  white-space: nowrap !important;
}

.mcc-primary-cta-sub {
  margin: 0 !important;
  font-size: 11.5px !important;
  color: #DCE3E4 !important;
  line-height: 1.35 !important;
}

.mcc-primary-cta-arrow {
  display: grid !important;
  place-items: center !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--mcc-brand-cyan-dark) !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.mcc-primary-cta:hover .mcc-primary-cta-arrow,
.mcc-service-card.mcc-primary-cta:hover .mcc-primary-cta-arrow {
  background: var(--mcc-brand-cyan-dark) !important;
  color: var(--mcc-primary-dark) !important;
}

[dir="rtl"] .mcc-primary-cta:hover .mcc-primary-cta-arrow,
[dir="rtl"] .mcc-service-card.mcc-primary-cta:hover .mcc-primary-cta-arrow {
  transform: translateX(-3px);
}
[dir="ltr"] .mcc-primary-cta:hover .mcc-primary-cta-arrow,
[dir="ltr"] .mcc-service-card.mcc-primary-cta:hover .mcc-primary-cta-arrow {
  transform: translateX(3px);
}

.mcc-primary-cta-arrow svg {
  width: 14px !important;
  height: 14px !important;
}

/* Track 2: Secondary Action Header */
.mcc-secondary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px 0;
}

.mcc-secondary-header::before,
.mcc-secondary-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--mcc-border);
}

.mcc-secondary-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--mcc-text-secondary);
  letter-spacing: 0.2px;
}

/* Secondary Services Grid (Minimal SaaS Compact Grid) */
.mcc-services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  width: 100%;
}

.mcc-service-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 9px 11px;
  background: var(--mcc-surface);
  border: 1px solid var(--mcc-border);
  border-radius: 11px;
  cursor: pointer;
  text-align: start;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--mcc-shadow-card);
  position: relative;
  outline: none;
  min-height: 68px;
}

.mcc-service-card:hover {
  background: var(--mcc-surface-hover);
  border-color: var(--mcc-brand-cyan-dark);
  transform: translateY(-2px);
  box-shadow: var(--mcc-shadow-card-hover);
}

.mcc-service-card:focus-visible {
  outline: 2px solid var(--mcc-brand-cyan-dark);
  outline-offset: 2px;
}

.mcc-service-card.is-contextual {
  border-color: var(--mcc-brand-cyan-dark);
  background: var(--mcc-brand-cyan-light);
  box-shadow: 0 4px 12px -2px var(--mcc-brand-cyan-glow);
}

.mcc-service-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--mcc-bg-body);
  border: 1px solid var(--mcc-border);
  color: var(--mcc-primary-dark);
  margin-bottom: 5px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.mcc-service-card:hover .mcc-service-icon {
  transform: scale(1.08);
  background: var(--mcc-brand-cyan-dark);
  color: #0C1012;
  border-color: var(--mcc-brand-cyan-dark);
}

.mcc-service-icon svg {
  width: 14px;
  height: 14px;
}

.mcc-service-info {
  min-width: 0;
  width: 100%;
}

.mcc-service-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.mcc-service-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--mcc-text-primary);
  line-height: 1.25;
}

.mcc-contextual-badge {
  font-size: 9px;
  font-weight: 700;
  color: #1B6C86;
  background: rgba(41, 144, 177, 0.2);
  padding: 1px 5px;
  border-radius: 999px;
  white-space: nowrap;
}

.mcc-service-desc {
  display: block;
  font-size: 10px;
  color: var(--mcc-text-secondary);
  line-height: 1.25;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mcc-service-card.is-contextual {
  border-color: var(--mcc-brand-cyan-dark);
  background: var(--mcc-brand-cyan-light);
  box-shadow: 0 4px 14px -2px var(--mcc-brand-cyan-glow);
}

/* Keep selected/contextual cards readable when the site theme is dark. */
.dark .mcc-root .mcc-service-card.is-contextual,
[data-theme="dark"] .mcc-root .mcc-service-card.is-contextual {
  background: #173340;
  border-color: #82D7EC;
  color: var(--mcc-text-primary);
}

.dark .mcc-root .mcc-service-card.is-contextual .mcc-service-label,
[data-theme="dark"] .mcc-root .mcc-service-card.is-contextual .mcc-service-label {
  color: #F5F8FA;
}

.dark .mcc-root .mcc-service-card.is-contextual .mcc-service-desc,
[data-theme="dark"] .mcc-root .mcc-service-card.is-contextual .mcc-service-desc {
  color: #B9CDD6;
}

.mcc-service-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--mcc-bg-body);
  border: 1px solid var(--mcc-border);
  color: var(--mcc-primary-dark);
  margin-bottom: 8px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.mcc-service-card:hover .mcc-service-icon {
  transform: scale(1.08);
  background: var(--mcc-brand-cyan-dark);
  color: #0C1012;
  border-color: var(--mcc-brand-cyan-dark);
}

.dark .mcc-root .mcc-service-icon,
[data-theme="dark"] .mcc-root .mcc-service-icon {
  background: #182C38;
  border-color: #3C6677;
  color: #F5F8FA;
}

.dark .mcc-root .mcc-service-card:hover .mcc-service-icon,
[data-theme="dark"] .mcc-root .mcc-service-card:hover .mcc-service-icon {
  background: #1B6C86;
  border-color: #82D7EC;
  color: #FFFFFF;
}

.mcc-service-icon svg {
  width: 17px;
  height: 17px;
}

.mcc-service-info {
  min-width: 0;
  width: 100%;
}

.mcc-service-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.mcc-service-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--mcc-text-primary);
  line-height: 1.3;
}

.mcc-contextual-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: #1B6C86;
  background: rgba(41, 144, 177, 0.2);
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.mcc-service-desc {
  display: block;
  font-size: 11px;
  color: var(--mcc-text-secondary);
  line-height: 1.35;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Confirmation Card (Corporate Summary)
   -------------------------------------------------------------------------- */
.mcc-confirm-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--mcc-surface);
  border: 1px solid var(--mcc-border);
  border-radius: var(--mcc-radius-card);
  box-shadow: var(--mcc-shadow-card);
  animation: mccFadeSlide 0.2s ease;
}

.mcc-confirm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--mcc-border-subtle);
  font-size: 13px;
}

.mcc-confirm-item:last-of-type {
  border-bottom: none;
}

.mcc-confirm-key {
  color: var(--mcc-text-secondary);
}

.mcc-confirm-val-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mcc-confirm-val {
  color: var(--mcc-text-primary);
  font-weight: 600;
}

.mcc-btn-edit {
  background: transparent;
  border: none;
  color: var(--mcc-action-secondary-text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.mcc-btn-edit:hover {
  background: var(--mcc-action-secondary-hover-bg);
  color: var(--mcc-action-secondary-text);
}

.mcc-confirm-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mcc-btn-edit-details {
  min-height: 42px;
  border: 1px solid var(--mcc-border);
  border-radius: 10px;
  background: transparent;
  color: var(--mcc-action-secondary-text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.mcc-btn-edit-details:hover,
.mcc-btn-edit-details:focus-visible {
  border-color: var(--mcc-brand-cyan-dark);
  outline: 2px solid var(--mcc-brand-cyan-glow);
  outline-offset: 2px;
}

/* Persistent, low-friction path to human support while details are collected. */
.mcc-human-support-action {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--mcc-brand-cyan-dark);
  border-radius: 10px;
  background: transparent;
  color: var(--mcc-action-secondary-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mcc-human-support-action svg {
  width: 18px;
  height: 18px;
}

.mcc-human-support-action:hover,
.mcc-human-support-action:focus-visible {
  background: var(--mcc-action-secondary-hover-bg);
  outline: 2px solid var(--mcc-brand-cyan-glow);
  outline-offset: 2px;
}

.mcc-human-support-action:disabled {
  cursor: wait;
  opacity: .65;
}

.mcc-root .mcc-btn-edit-details.mcc-retry-handoff {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  color: #FFFFFF;
  background: var(--mcc-brand-cyan-dark);
  border: 1px solid var(--mcc-brand-cyan-dark);
  border-radius: 10px;
  font-weight: 700;
}

.mcc-root .mcc-btn-edit-details.mcc-retry-handoff:hover,
.mcc-root .mcc-btn-edit-details.mcc-retry-handoff:focus-visible {
  color: #FFFFFF;
  background: #15576C;
  border-color: #15576C;
}

.mcc-btn-primary {
  width: 100%;
  padding: 12px 18px;
  background: var(--mcc-brand-cyan-dark);
  color: #FFFFFF;
  border: 1.5px solid var(--mcc-brand-cyan-dark);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(19, 35, 45, 0.15);
}

.mcc-btn-primary:hover {
  background: var(--mcc-brand-cyan-dark);
  border-color: var(--mcc-brand-cyan);
  box-shadow: 0 6px 18px rgba(19, 35, 45, 0.25);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   WhatsApp Fallback Card (Verified Channel)
   -------------------------------------------------------------------------- */
.mcc-whatsapp-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--mcc-surface);
  border: 1px solid var(--mcc-border);
  border-radius: var(--mcc-radius-card);
  box-shadow: var(--mcc-shadow-card);
  animation: mccFadeSlide 0.2s ease;
}

.mcc-whatsapp-card-header {
  display: flex;
  gap: 12px;
}

.mcc-whatsapp-card-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.12);
  color: var(--mcc-whatsapp);
  flex-shrink: 0;
}

.mcc-whatsapp-card-icon svg {
  width: 22px;
  height: 22px;
}

.mcc-whatsapp-card-meta {
  min-width: 0;
  flex: 1;
}

.mcc-whatsapp-card-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--mcc-text-primary);
}

.mcc-whatsapp-card-text {
  margin: 3px 0 0 0;
  font-size: 12px;
  color: var(--mcc-text-secondary);
  line-height: 1.4;
}

.mcc-whatsapp-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: var(--mcc-whatsapp);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px -3px var(--mcc-whatsapp-glow);
}

.mcc-whatsapp-cta-btn:hover {
  background: var(--mcc-whatsapp-dark);
  transform: translateY(-1px);
  color: #FFFFFF;
}

.mcc-whatsapp-cta-icon svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Typing Indicator
   -------------------------------------------------------------------------- */
.mcc-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--mcc-surface);
  border: 1px solid var(--mcc-border);
  border-radius: 12px;
  align-self: flex-start;
  width: fit-content;
}

.mcc-typing-dots {
  display: flex;
  gap: 4px;
}

.mcc-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--mcc-brand-cyan-dark);
  animation: mccBounce 1.4s infinite ease-in-out both;
}

.mcc-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.mcc-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

.mcc-typing-label {
  color: var(--mcc-text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.mcc-root button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none !important;
  box-shadow: none !important;
}

@keyframes mccBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   Footer & Input Form
   -------------------------------------------------------------------------- */
.mcc-footer {
  padding: 12px 16px;
  background: var(--mcc-bg-window);
  border-top: 1px solid var(--mcc-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mcc-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.mcc-form-error {
  color: #A33030;
  font-size: 12px;
  line-height: 1.4;
  padding: 2px 4px;
}

.mcc-form-error[hidden] {
  display: none;
}

.mcc-country-select-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.mcc-country-source {
  padding-inline-start: 5px;
  color: var(--mcc-text-muted);
  font-size: 9px;
  line-height: 1.1;
}

.mcc-country-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 10px;
  background: var(--mcc-bg-body);
  border: 1px solid var(--mcc-border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mcc-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mcc-country-name-display {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcc-name-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
  padding: 4px 0 4px 4px;
  padding-inline-start: 4px;
}

.mcc-skip-name {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--mcc-border);
  border-radius: 10px;
  background: var(--mcc-surface);
  color: var(--mcc-action-secondary-text);
  font: inherit;
  cursor: pointer;
}

.mcc-skip-name:hover,
.mcc-skip-name:focus-visible {
  border-color: var(--mcc-brand-cyan-dark);
  outline: 2px solid var(--mcc-brand-cyan-glow);
  outline-offset: 2px;
}

.mcc-country-btn:hover {
  border-color: var(--mcc-brand-cyan-dark);
  background: var(--mcc-surface);
}

.mcc-chevron-down {
  width: 14px;
  height: 14px;
  color: var(--mcc-text-muted);
}

.mcc-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.mcc-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: var(--mcc-bg-body);
  border: 1px solid var(--mcc-border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--mcc-text-primary);
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.mcc-input:focus {
  background: var(--mcc-surface);
  border-color: var(--mcc-brand-cyan);
  box-shadow: 0 0 0 3px var(--mcc-brand-cyan-glow);
}

.mcc-input::placeholder,
.mcc-country-search::placeholder {
  color: var(--mcc-text-muted);
  opacity: 1;
}

/* Dark-mode controls need their own visible secondary-action treatment. */
.dark .mcc-root .mcc-btn-edit-details,
[data-theme="dark"] .mcc-root .mcc-btn-edit-details,
.dark .mcc-root .mcc-skip-name,
[data-theme="dark"] .mcc-root .mcc-skip-name,
.dark .mcc-root .mcc-human-support-action,
[data-theme="dark"] .mcc-root .mcc-human-support-action {
  border-color: #3C6677;
  background: #121F25;
}

.dark .mcc-root .mcc-btn-edit-details:hover,
.dark .mcc-root .mcc-btn-edit-details:focus-visible,
[data-theme="dark"] .mcc-root .mcc-btn-edit-details:hover,
[data-theme="dark"] .mcc-root .mcc-btn-edit-details:focus-visible,
.dark .mcc-root .mcc-skip-name:hover,
.dark .mcc-root .mcc-skip-name:focus-visible,
[data-theme="dark"] .mcc-root .mcc-skip-name:hover,
[data-theme="dark"] .mcc-root .mcc-skip-name:focus-visible,
.dark .mcc-root .mcc-human-support-action:hover,
.dark .mcc-root .mcc-human-support-action:focus-visible,
[data-theme="dark"] .mcc-root .mcc-human-support-action:hover,
[data-theme="dark"] .mcc-root .mcc-human-support-action:focus-visible {
  border-color: #82D7EC;
  background: #173340;
}

.dark .mcc-root .mcc-input,
[data-theme="dark"] .mcc-root .mcc-input,
.dark .mcc-root .mcc-country-btn,
[data-theme="dark"] .mcc-root .mcc-country-btn,
.dark .mcc-root .mcc-country-search,
[data-theme="dark"] .mcc-root .mcc-country-search {
  border-color: #3C6677;
}

.dark .mcc-root .mcc-form-error,
[data-theme="dark"] .mcc-root .mcc-form-error {
  color: #FFB4B4;
}

.mcc-send-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--mcc-brand-cyan-dark);
  color: #FFFFFF;
  border: 1px solid var(--mcc-brand-cyan-dark);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mcc-send-btn:hover {
  background: var(--mcc-brand-cyan-dark);
  border-color: var(--mcc-brand-cyan);
  transform: scale(1.04);
}

.mcc-send-btn:active {
  transform: scale(0.96);
}

.mcc-send-icon {
  width: 18px;
  height: 18px;
}

[dir="rtl"] .mcc-send-icon {
  transform: rotate(180deg);
}

/* Final dark-mode contrast guard (after the card's base/hover declarations). */
.dark .mcc-root .mcc-service-card.is-contextual,
[data-theme="dark"] .mcc-root .mcc-service-card.is-contextual {
  background: #173340;
  border-color: #82D7EC;
  color: #F5F8FA;
}
.dark .mcc-root .mcc-service-card.is-contextual .mcc-service-label,
[data-theme="dark"] .mcc-root .mcc-service-card.is-contextual .mcc-service-label { color: #F5F8FA; }
.dark .mcc-root .mcc-service-card.is-contextual .mcc-service-desc,
[data-theme="dark"] .mcc-root .mcc-service-card.is-contextual .mcc-service-desc { color: #B9CDD6; }
.dark .mcc-root .mcc-service-icon,
[data-theme="dark"] .mcc-root .mcc-service-icon { background: #182C38; border-color: #3C6677; color: #F5F8FA; }
.dark .mcc-root .mcc-service-card:hover .mcc-service-icon,
[data-theme="dark"] .mcc-root .mcc-service-card:hover .mcc-service-icon { background: #1B6C86; border-color: #82D7EC; color: #FFFFFF; }

.mcc-footer-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--mcc-text-muted);
}

.mcc-footer-privacy a {
  color: var(--mcc-text-secondary);
  text-decoration: none;
}

.mcc-footer-privacy a:hover {
  color: var(--mcc-brand-cyan-dark);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Country Dropdown Popover
   -------------------------------------------------------------------------- */
.mcc-country-dropdown {
  position: absolute;
  bottom: 64px;
  left: 16px;
  right: 16px;
  max-height: 280px;
  background: var(--mcc-surface);
  border: 1px solid var(--mcc-border);
  border-radius: 14px;
  box-shadow: 0 16px 36px -6px rgba(19, 35, 45, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  animation: mccFadeSlide 0.18s ease;
}

.mcc-country-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--mcc-border);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--mcc-text-primary);
}

.mcc-country-dropdown-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--mcc-text-muted);
}

.mcc-country-dropdown-close svg {
  width: 16px;
  height: 16px;
}

.mcc-country-search-wrap {
  position: relative;
  padding: 8px 12px;
  border-bottom: 1px solid var(--mcc-border-subtle);
}

.mcc-country-search-icon {
  position: absolute;
  top: 16px;
  left: 20px;
  width: 14px;
  height: 14px;
  color: var(--mcc-text-muted);
}

[dir="rtl"] .mcc-country-search-icon {
  left: auto;
  right: 20px;
}

.mcc-country-search {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 28px;
  background: var(--mcc-bg-body);
  border: 1px solid var(--mcc-border);
  border-radius: 6px;
  font-size: 12px;
  outline: none;
  color: var(--mcc-text-primary);
}

[dir="rtl"] .mcc-country-search {
  padding: 0 28px 0 10px;
}

.mcc-country-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  flex: 1;
}

.mcc-country-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--mcc-text-primary);
}

.mcc-country-option:hover,
.mcc-country-option.is-highlighted {
  background: var(--mcc-surface-hover);
  color: var(--mcc-brand-cyan);
}

.mcc-country-option.is-selected {
  background: var(--mcc-brand-cyan-light);
  color: var(--mcc-brand-cyan-dark);
}

.mcc-country-option-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mcc-country-option-dial {
  font-size: 11.5px;
  color: var(--mcc-text-muted);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Mobile Floating Peek Bubble
   -------------------------------------------------------------------------- */
.mcc-mobile-peek {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: 290px;
  padding: 12px 14px;
  background: var(--mcc-surface);
  border: 1px solid var(--mcc-border);
  border-radius: 14px;
  box-shadow: 0 12px 28px -6px rgba(19, 35, 45, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  animation: mccFadeSlide 0.25s ease;
}

.mcc-peek-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--mcc-brand-cyan-dark);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mcc-peek-avatar svg {
  width: 16px;
  height: 16px;
}

.mcc-peek-content {
  min-width: 0;
  flex: 1;
}

.mcc-peek-title {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mcc-text-primary);
}

.mcc-peek-text {
  margin: 1px 0 0 0;
  font-size: 11px;
  color: var(--mcc-text-secondary);
}

.mcc-peek-close {
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--mcc-text-muted);
  cursor: pointer;
  padding: 0 4px;
}

/* --------------------------------------------------------------------------
   Scroll Pill Indicator & History Loader
   -------------------------------------------------------------------------- */
.mcc-history-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 0 6px;
  width: 100%;
  color: var(--mcc-text-muted);
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
}

.mcc-history-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--mcc-border, rgba(0, 0, 0, 0.1));
  border-top-color: var(--mcc-brand-cyan-dark);
  border-radius: 50%;
  animation: mccSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes mccSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .mcc-history-spinner {
    animation: none;
    opacity: 0.6;
  }
}

.mcc-new-messages-indicator {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--mcc-brand-cyan-dark);
  color: #FFFFFF;
  border: 1px solid var(--mcc-brand-cyan-dark);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(19, 35, 45, 0.25);
  opacity: 1;
  z-index: 25;
}

.mcc-new-messages-indicator[hidden] {
  display: none !important;
}

.mcc-new-messages-indicator svg {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   Mobile Responsiveness (Below 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .mcc-root {
    bottom: 16px;
  }

  .mcc-pos-right {
    right: 16px;
  }

  .mcc-pos-left {
    left: 16px;
  }

  .mcc-window {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    width: 100%;
    max-width: calc(100vw - 16px);
    height: min(720px, calc(100dvh - 28px));
    max-height: calc(100dvh - 28px);
    min-height: 0;
    border-radius: 18px;
    border: 1px solid var(--mcc-border);
    z-index: 100000;
  }

  .mcc-header {
    padding-top: max(12px, env(safe-area-inset-top, 12px));
    padding-bottom: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .mcc-header-actions {
    gap: 3px;
  }

  .mcc-header-btn {
    width: 28px;
    height: 28px;
  }

  /* 44 px is the mobile touch target for the deliberate close action. */
  .mcc-header-btn.mcc-btn-close {
    width: 44px;
    height: 44px;
    border-radius: 9px;
  }

  .mcc-btn-close svg {
    width: 20px;
    height: 20px;
  }

  .mcc-brand-title {
    font-size: 13px;
  }

  .mcc-body {
    padding: 14px 14px 18px 14px;
    gap: 10px;
    min-height: 0;
  }

  .mcc-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  }

  /* Compact 2-column luxury grid on mobile */
  .mcc-services-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .mcc-service-card {
    padding: 8px 10px !important;
    min-height: 60px !important;
    border-radius: 9px !important;
  }

  .mcc-service-icon {
    width: 22px !important;
    height: 22px !important;
    margin-bottom: 3px !important;
  }

  .mcc-service-icon svg {
    width: 12px !important;
    height: 12px !important;
  }

  .mcc-service-label {
    font-size: 11px !important;
  }

  .mcc-service-desc {
    font-size: 9.5px !important;
    line-height: 1.2 !important;
  }

  .mcc-primary-cta,
  .mcc-service-card.mcc-primary-cta {
    padding: 11px 13px !important;
  }

  .mcc-primary-cta-icon-wrap {
    width: 36px !important;
    height: 36px !important;
  }

  .mcc-primary-cta-icon-wrap svg {
    width: 18px !important;
    height: 18px !important;
  }

  .mcc-primary-cta-title {
    font-size: 13px !important;
  }

  .mcc-primary-cta-sub {
    font-size: 10.5px !important;
  }

  .mcc-country-name-display {
    display: inline;
    max-width: 58px;
    font-size: 10.5px;
  }
}

@media (max-width: 360px) {
  .mcc-header {
    gap: 4px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .mcc-header-info {
    gap: 7px;
    min-width: 0;
  }

  .mcc-title-meta {
    min-width: 0;
  }

  .mcc-header-info {
    flex-basis: 0;
  }

  .mcc-header-actions {
    flex-basis: auto;
    max-width: 44%;
  }

  .mcc-header-actions .mcc-header-btn {
    flex-shrink: 0;
  }

  .mcc-header-info {
    gap: 6px;
  }

  .mcc-avatar-wrap {
    width: 32px;
    height: 32px;
  }

  .mcc-header-actions {
    gap: 2px;
  }

  .mcc-window {
    max-width: calc(100vw - 10px);
    bottom: max(8px, env(safe-area-inset-bottom, 8px));
    height: min(720px, calc(100dvh - 18px));
    max-height: calc(100dvh - 18px);
  }

  .mcc-services-grid {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }

  .mcc-service-card {
    min-height: 58px !important;
    padding: 9px 11px !important;
  }

  .mcc-service-label {
    font-size: 12.5px !important;
  }

  .mcc-service-desc {
    font-size: 10.5px !important;
  }
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .mcc-launcher,
  .mcc-window,
  .mcc-msg,
  .mcc-primary-cta,
  .mcc-service-card,
  .mcc-typing-dots span {
    animation: none !important;
    transition: none !important;
  }
}
