/* MB ChatDesk v0.3.2 – Front widget CSS */
.mbchatapp-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mbchatapp-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.mbchatapp-button:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
}

.mbchatapp-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: #dc3545;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.mbchatapp-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: 370px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  display: none;
  flex-direction: column;
}
.mbchatapp-panel.is-open { display: flex; }

.mbchatapp-header {
  color: #fff;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mbchatapp-header-title { flex: 1; }
.mbchatapp-close {
  background: none;
  border: 0;
  color: rgba(255,255,255,.8);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.mbchatapp-close:hover { color: #fff; }

.mbchatapp-messages {
  height: 340px;
  overflow-y: auto;
  padding: 14px;
  background: #f5f7fa;
}

.mbchatapp-row {
  margin-bottom: 10px;
  display: flex;
}
.mbchatapp-row.is-visitor { justify-content: flex-end; }
.mbchatapp-row.is-agent { justify-content: flex-start; }

.mbchatapp-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  word-break: break-word;
  font-size: 13px;
  line-height: 1.45;
}
.mbchatapp-row.is-visitor .mbchatapp-bubble {
  background: #e7f1ff;
}

.mbchatapp-name {
  font-size: 11px;
  font-weight: 600;
  opacity: .55;
  margin-bottom: 3px;
}

.mbchatapp-time {
  font-size: 10px;
  opacity: .4;
  margin-top: 4px;
  text-align: right;
}

.mbchatapp-consent {
  display: block;
  font-size: 12px;
  padding: 10px 14px 0;
  color: #555;
  border-top: 1px solid transparent;
  transition: border-color .2s;
}
.mbchatapp-consent label {
  cursor: pointer;
}

.mbchatapp-compose {
  padding: 12px 14px;
  border-top: 1px solid #eef2f5;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.mbchatapp-input {
  flex: 1;
  box-sizing: border-box;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  border: 1px solid #d7dce1;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
  transition: border-color .2s;
}
.mbchatapp-input:focus {
  border-color: #0d6efd;
}

.mbchatapp-send {
  border: 0;
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity .2s;
}
.mbchatapp-send:hover { opacity: .9; }

.mbchatapp-footer {
  padding: 6px 14px 10px;
  text-align: center;
}
.mbchatapp-gdpr-link {
  background: none;
  border: 0;
  color: #999;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
}
.mbchatapp-gdpr-link:hover { color: #555; }

/* Pre-chat form (bod 19) */
.mbchatapp-prechat {
  padding: 20px 16px;
  background: #fff;
}
.mbchatapp-prechat-intro {
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
}
.mbchatapp-prechat input {
  width: 100%;
  padding: 10px;
  border: 1px solid #d7dce1;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.mbchatapp-pc-submit {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
.mbchatapp-pc-consent {
  display: block;
  font-size: 11px;
  color: #666;
  padding: 4px 0 8px;
  cursor: pointer;
  line-height: 1.4;
}
.mbchatapp-pc-consent input {
  width: auto;
  margin-right: 6px;
  vertical-align: middle;
}
/* Upload */
.mbchatapp-attach {
  cursor: pointer;
  font-size: 18px;
  padding: 6px;
  opacity: .6;
  transition: opacity .2s;
}
.mbchatapp-attach:hover { opacity: 1; }
/* Load more (bod 20) */
.mbchatapp-load-more {
  display: block;
  margin: 0 auto 10px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  color: #666;
}
/* Footer */
.mbchatapp-new-conv {
  background: none;
  border: 0;
  color: #999;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 12px;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .mbchatapp-panel {
    width: calc(100vw - 16px);
    right: -10px;
    bottom: 64px;
    border-radius: 14px;
  }
  .mbchatapp-messages {
    height: 50vh;
  }
}


/* Attachments */
.mbchatapp-attachment { margin-top: 6px; }
.mbchatapp-attachment a { color: inherit; text-decoration: underline; font-size: 12px; }
.mbchatapp-attachment-preview { margin-top: 6px; }
.mbchatapp-attachment-preview img { max-width: 180px; max-height: 140px; display: block; border-radius: 8px; }
