.mmba-float-button {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 3000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  border: 1px solid #2563eb;
  border-radius: 20px;
  background: #2563eb;
  color: #fff;
  padding: 0 14px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
  font-size: 13px;
  cursor: pointer;
}

.mmba-float-button:hover {
  background: #1d4ed8;
}

.mmba-clue-notice {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 3201;
  display: none;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid #c9dbff;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(22, 35, 58, 0.16);
  color: #172033;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  cursor: pointer;
  overflow: hidden;
}

.mmba-clue-notice.open {
  display: block;
}

.mmba-clue-notice-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
}

.mmba-clue-notice-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 36px;
  height: 22px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
}

.mmba-clue-notice-text {
  display: grid;
  min-width: 0;
  gap: 2px;
  flex: 1 1 auto;
}

.mmba-clue-notice-text strong {
  color: #172033;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.mmba-clue-notice-text span {
  color: #5b6b84;
  font-size: 12px;
  line-height: 1.35;
}

.mmba-clue-notice-close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  line-height: 24px;
  cursor: pointer;
}

.mmba-clue-notice-close:hover {
  background: #eff4ff;
  color: #2563eb;
}

.mmba-clue-notice[data-type="subordinate"] .mmba-clue-notice-badge {
  background: #0f766e;
}

.mmba-side-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin: 1px 8px;
  border-radius: 6px;
  color: #d5dae5;
  padding: 0 18px 0 48px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 40px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.mmba-side-entry:hover {
  background: rgba(37, 99, 235, 0.16);
  color: #ffffff;
}

.mmba-side-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}

.mmba-side-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mmba-operation-cell {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mmba-phone-cell {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  white-space: nowrap;
}

.mmba-phone-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #2563eb;
  padding: 0 2px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13px;
  line-height: 24px;
  cursor: pointer;
  white-space: nowrap;
}

.mmba-inline-phone-link,
.mmba-detail-phone-link {
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
}

.mmba-phone-link::after {
  content: "▾";
  margin-left: 4px;
  font-size: 10px;
  transform: translateY(-1px);
}

.mmba-phone-link:hover,
.mmba-phone-link:focus {
  color: #1d4ed8;
  text-decoration: underline;
}

.mmba-contact-actions {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  max-width: 100%;
  min-width: 96px;
  white-space: nowrap;
  vertical-align: middle;
}

.mmba-row-contact-actions {
  width: 100%;
  min-width: 96px;
  justify-content: center;
}

.mmba-inline-contact-actions,
.mmba-detail-contact-actions {
  min-width: 96px;
  justify-content: flex-start;
}

.mmba-contact-icon-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  padding: 0;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.mmba-contact-icon-button svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mmba-contact-dial {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.mmba-contact-sms {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #ea580c;
}

.mmba-contact-wechat {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #16a34a;
}

.mmba-contact-icon-button:hover,
.mmba-contact-icon-button:focus {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.mmba-contact-icon-button.is-disabled {
  border-color: #e5e7eb;
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.mmba-contact-icon-button.is-sending,
.mmba-contact-icon-button.is-cooling {
  opacity: .62;
  cursor: not-allowed;
  box-shadow: none;
}

.mmba-contact-icon-button.is-sending {
  position: relative;
}

.mmba-contact-icon-button.is-sending::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 3px;
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: mmba-spin .7s linear infinite;
}

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

.mmba-customer-batch-toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-left: 8px;
  vertical-align: middle;
  color: #172033;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.mmba-customer-batch-toolbar-info {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: 30px;
  font-size: 12px;
}

.mmba-customer-batch-toolbar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 24px;
  border-radius: 999px;
  background: #f5f7fb;
  color: #64748b;
  padding: 0 8px;
  line-height: 24px;
}

.mmba-customer-batch-toolbar-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.mmba-customer-batch-toolbar button,
.mmba-customer-batch-foot button {
  height: 30px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  color: #606266;
  padding: 0 12px;
  font-size: 13px;
  line-height: 28px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.mmba-customer-batch-toolbar button:hover,
.mmba-customer-batch-foot button:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.mmba-customer-batch-toolbar button.primary,
.mmba-customer-batch-foot button.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.mmba-customer-batch-toolbar button.primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.mmba-customer-batch-toolbar button:disabled,
.mmba-customer-batch-foot button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.mmba-batch-select-cell {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mmba-customer-batch-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-right: 2px;
  cursor: pointer;
}

.mmba-customer-batch-select input {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #2563eb;
}

.mmba-customer-batch-row-selected > td {
  background: #f4f8ff !important;
}

.mmba-customer-batch-mask {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  background: rgba(15, 23, 42, 0.24);
}

.mmba-customer-batch-mask.open {
  display: block;
}

.mmba-customer-batch-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9999;
  display: none;
  width: min(620px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  color: #172033;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  overflow: hidden;
}

.mmba-customer-batch-dialog.open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.mmba-customer-batch-head,
.mmba-customer-batch-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5ebf3;
  padding: 14px 16px;
}

.mmba-customer-batch-head strong {
  display: block;
  color: #172033;
  font-size: 16px;
  line-height: 1.4;
}

.mmba-customer-batch-subtitle {
  display: block;
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
}

.mmba-customer-batch-close {
  width: 30px;
  height: 30px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  font-size: 18px;
  line-height: 28px;
  cursor: pointer;
}

.mmba-customer-batch-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 14px 16px 16px;
}

.mmba-customer-batch-summary,
.mmba-customer-batch-status {
  border: 1px solid #edf2f7;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 20px;
}

.mmba-customer-batch-search {
  display: grid;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
}

.mmba-customer-batch-search input {
  height: 32px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 0 9px;
  outline: none;
  font-family: inherit;
}

.mmba-customer-batch-search input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.mmba-customer-batch-owner-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.mmba-customer-batch-owner-item {
  display: grid;
  gap: 2px;
  min-height: 46px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.mmba-customer-batch-owner-item strong {
  color: #172033;
  font-size: 13px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mmba-customer-batch-owner-item span {
  color: #64748b;
  font-size: 12px;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mmba-customer-batch-owner-item:hover {
  border-color: #93c5fd;
}

.mmba-customer-batch-owner-item.selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.mmba-customer-batch-empty {
  grid-column: 1 / -1;
  border: 1px dashed #d9e1ec;
  border-radius: 6px;
  color: #94a3b8;
  padding: 14px;
  text-align: center;
  font-size: 13px;
}

.mmba-customer-batch-section {
  display: grid;
  gap: 8px;
}

.mmba-customer-batch-section-title {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.mmba-customer-batch-owner-modes,
.mmba-customer-batch-biz-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mmba-customer-batch-owner-modes label,
.mmba-customer-batch-biz-types label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  color: #24324a;
  padding: 0 9px;
  cursor: pointer;
  font-size: 13px;
}

.mmba-customer-batch-owner-modes input,
.mmba-customer-batch-biz-types input {
  margin: 0;
  accent-color: #2563eb;
}

.mmba-customer-batch-foot {
  justify-content: flex-end;
  border-top: 1px solid #e5ebf3;
  border-bottom: 0;
}

.mmba-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.mmba-row-menu {
  position: fixed;
  z-index: 3200;
  display: none;
  min-width: 96px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 35, 58, 0.14);
  padding: 4px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.mmba-row-menu.open {
  display: grid;
}

.mmba-row-menu button {
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: #24324a;
  padding: 0 10px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.mmba-row-menu button:hover {
  background: #eff5ff;
  color: #2563eb;
}

.mmba-float-button .mmba-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #57d799;
}

.mmba-drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 3001;
  display: none;
  background: rgba(15, 23, 42, 0.22);
}

.mmba-drawer-mask.open {
  display: block;
}

.mmba-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 3002;
  width: min(440px, calc(100vw - 28px));
  transform: translateX(105%);
  transition: transform 0.2s ease;
  border-left: 1px solid #d9e1ec;
  background: #fff;
  box-shadow: -16px 0 36px rgba(22, 35, 58, 0.18);
  color: #172033;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.mmba-drawer.open {
  transform: translateX(0);
}

.mmba-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #e5ebf3;
  padding: 16px;
}

.mmba-drawer-title {
  font-size: 16px;
  font-weight: 700;
}

.mmba-drawer-subtitle {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.mmba-close {
  width: 30px;
  height: 30px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.mmba-drawer-body {
  height: calc(100vh - 68px);
  overflow: auto;
  padding: 14px 16px 18px;
}

.mmba-context {
  display: grid;
  gap: 8px;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #f8fafd;
  padding: 12px;
  margin-bottom: 12px;
}

.mmba-context-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #4b5a72;
  font-size: 13px;
}

.mmba-context-row strong {
  color: #172033;
  text-align: right;
  overflow-wrap: anywhere;
}

.mmba-context-row strong.mmba-lock-closed {
  color: #c2413a;
}

.mmba-context-row strong.mmba-lock-open {
  color: #16805c;
}

.mmba-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.mmba-form-grid label,
.mmba-field label {
  display: grid;
  gap: 5px;
  color: #667085;
  font-size: 12px;
}

.mmba-form-grid input,
.mmba-field input,
.mmba-field textarea {
  width: 100%;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  outline: none;
  font-family: inherit;
}

.mmba-form-grid input,
.mmba-field input {
  height: 32px;
  padding: 0 9px;
}

.mmba-field textarea {
  min-height: 76px;
  padding: 8px 9px;
  resize: vertical;
}

.mmba-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.mmba-quick-actions button,
.mmba-link-actions a,
.mmba-link-actions button {
  height: 32px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  color: #24324a;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.mmba-quick-actions button:hover,
.mmba-link-actions a:hover,
.mmba-link-actions button:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.mmba-quick-actions button.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.mmba-quick-actions button.danger {
  border-color: #f1b6b2;
  background: #fff7f6;
  color: #c2413a;
}

.mmba-link-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mmba-link-actions a,
.mmba-link-actions button {
  line-height: 30px;
}

.mmba-result {
  min-height: 38px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #0f172a;
  color: #dce7ff;
  padding: 9px;
  white-space: pre-wrap;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.mmba-inline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
  margin: 12px 0;
  color: #24324a;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.mmba-inline-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mmba-inline-kicker {
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
}

.mmba-inline-bar strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mmba-inline-bar span {
  color: #667085;
  font-size: 12px;
}

.mmba-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.mmba-inline-actions button,
.mmba-inline-actions a {
  height: 30px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  color: #24324a;
  padding: 0 10px;
  line-height: 28px;
  text-decoration: none;
  cursor: pointer;
}

.mmba-inline-actions .primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.mmba-lead-tag-panel {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  margin: 12px 0;
  color: #24324a;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.mmba-lead-tag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mmba-lead-tag-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mmba-lead-tag-kicker {
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
}

.mmba-lead-tag-head strong {
  color: #172033;
  font-size: 14px;
  line-height: 1.35;
}

.mmba-lead-tag-edit,
.mmba-lead-tag-save,
.mmba-lead-tag-cancel,
.mmba-lead-tag-close {
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
  color: #24324a;
  cursor: pointer;
  font-family: inherit;
}

.mmba-lead-tag-edit {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
  cursor: pointer;
  pointer-events: auto;
}

.mmba-lead-tag-edit:hover,
.mmba-lead-tag-cancel:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.mmba-lead-tag-line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 28px;
  padding: 4px 0;
  font-size: 13px;
  line-height: 24px;
}

.mmba-lead-tag-label {
  color: #667085;
  white-space: nowrap;
}

.mmba-lead-tag-values,
.mmba-lead-tag-selected,
.mmba-lead-tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.mmba-lead-tag-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  border: 1px solid #c7dcff;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0 7px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.mmba-lead-tag-chip.more {
  border-color: #d9e1ec;
  background: #f8fafc;
  color: #64748b;
}

.mmba-lead-tag-empty,
.mmba-lead-tag-record,
.mmba-lead-tag-record-editor,
.mmba-lead-tag-selected > span {
  color: #94a3b8;
  font-size: 13px;
}

.mmba-phone-cell {
  gap: 3px;
  flex-direction: column;
  align-items: flex-start;
}

.mmba-phone-tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  max-width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.mmba-phone-tags-label {
  color: #64748b;
  font-size: 12px;
  line-height: 20px;
}

.mmba-phone-tags .mmba-lead-tag-chip {
  min-height: 20px;
  padding: 0 5px;
  font-size: 12px;
  line-height: 18px;
}

.mmba-phone-tags:hover .mmba-lead-tag-chip {
  border-color: #93c5fd;
}

.mmba-lead-tag-list-host {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
  white-space: normal;
}

.mmba-row-tag-summary {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  max-width: 100%;
  min-height: 22px;
  border: 0;
  background: transparent;
  padding: 0;
  margin-top: 2px;
  text-align: left;
  cursor: pointer;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 20px;
}

.mmba-row-tags-label {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  line-height: 20px;
}

.mmba-row-tag-summary .mmba-lead-tag-chip {
  min-height: 20px;
  border-color: #bfdbfe;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.mmba-row-tag-summary .mmba-lead-tag-chip.more {
  border-color: #d9e1ec;
  background: #f8fafc;
  color: #64748b;
}

.mmba-row-tag-summary:hover .mmba-lead-tag-chip {
  border-color: #93c5fd;
}

.mmba-lead-tag-column-header .cell {
  color: #334155;
  font-weight: 600;
}

.mmba-lead-tag-column-cell .cell,
.mmba-lead-tag-column-cell .mmba-lead-tag-list-host {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 32px;
  min-width: 0;
  white-space: normal;
}

.mmba-lead-tag-column-cell .mmba-row-tag-summary {
  flex-wrap: wrap;
  margin-top: 0;
}

.mmba-lead-tag-column-cell .mmba-row-tags-label {
  display: none;
}

.mmba-row-tag-tooltip {
  position: fixed;
  z-index: 10000;
  display: none;
  max-width: min(360px, calc(100vw - 24px));
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #172033;
  color: #ffffff;
  padding: 8px 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 12px;
  line-height: 20px;
  pointer-events: none;
  white-space: normal;
  word-break: break-word;
}

.mmba-row-tag-tooltip.open {
  display: block;
}

.mmba-lead-tag-mask {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  background: rgba(15, 23, 42, 0.24);
}

.mmba-lead-tag-mask.open {
  display: block;
}

.mmba-lead-tag-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9999;
  display: none;
  width: min(860px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  color: #172033;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  overflow: hidden;
}

.mmba-lead-tag-dialog.open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.mmba-lead-tag-dialog-head,
.mmba-lead-tag-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5ebf3;
  padding: 14px 16px;
}

.mmba-lead-tag-dialog-head strong {
  display: block;
  color: #172033;
  font-size: 16px;
  line-height: 1.4;
}

.mmba-lead-tag-dialog-subtitle {
  display: block;
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
}

.mmba-lead-tag-close {
  width: 30px;
  height: 30px;
  color: #64748b;
  font-size: 18px;
  line-height: 28px;
}

.mmba-lead-tag-dialog-body {
  overflow: auto;
  padding: 14px 16px 16px;
}

.mmba-lead-tag-tabs {
  display: inline-flex;
  gap: 0;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.mmba-lead-tag-tabs button {
  height: 30px;
  border: 0;
  border-right: 1px solid #d9e1ec;
  background: #fff;
  color: #475569;
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
}

.mmba-lead-tag-tabs button:last-child {
  border-right: 0;
}

.mmba-lead-tag-tabs button.active {
  background: #2563eb;
  color: #fff;
}

.mmba-lead-tag-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.mmba-lead-tag-toolbar strong {
  color: #172033;
  font-size: 13px;
}

.mmba-lead-tag-toolbar button {
  height: 28px;
  border: 0;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font-size: 13px;
}

.mmba-lead-tag-selected {
  min-height: 32px;
  border: 1px solid #edf2f7;
  border-radius: 6px;
  background: #f8fafc;
  padding: 7px;
  margin-bottom: 12px;
}

.mmba-lead-tag-selected button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border: 1px solid #c7dcff;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0 7px;
  cursor: pointer;
  font-size: 12px;
}

.mmba-lead-tag-selected button span {
  color: #64748b;
}

.mmba-lead-tag-groups {
  display: grid;
  gap: 12px;
}

.mmba-lead-tag-group {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.mmba-lead-tag-group-title {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  line-height: 28px;
  white-space: nowrap;
}

.mmba-lead-tag-options button {
  min-height: 28px;
  border: 1px solid #d9e1ec;
  border-radius: 5px;
  background: #fff;
  color: #24324a;
  padding: 0 10px;
  cursor: pointer;
  font-size: 13px;
  line-height: 26px;
}

.mmba-lead-tag-options button:hover {
  border-color: #93c5fd;
  color: #2563eb;
}

.mmba-lead-tag-options button.selected {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.mmba-lead-tag-record-editor {
  min-height: 120px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  padding: 12px;
}

.mmba-lead-tag-dialog-foot {
  justify-content: flex-end;
  border-top: 1px solid #e5ebf3;
  border-bottom: 0;
}

.mmba-lead-tag-cancel,
.mmba-lead-tag-save {
  height: 32px;
  min-width: 78px;
  padding: 0 14px;
  font-size: 13px;
}

.mmba-lead-tag-save {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.mmba-lead-tag-save:disabled {
  opacity: 0.62;
  cursor: wait;
}

/* Polished lead tag panel and editor. */
.mmba-lead-tag-panel {
  width: min(620px, 100%);
  box-sizing: border-box;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
  padding: 0;
  margin: 12px 0 16px;
  box-shadow: 0 8px 22px rgba(20, 33, 61, 0.06);
  overflow: hidden;
}

.mmba-lead-tag-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: #2563eb;
}

.mmba-lead-tag-head {
  margin-bottom: 0;
  border-bottom: 1px solid #edf2f7;
  padding: 13px 14px 11px;
}

.mmba-lead-tag-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mmba-lead-tag-kicker {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.mmba-lead-tag-head strong {
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.mmba-lead-tag-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 30px;
  border-color: #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #2563eb;
  padding: 0 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font-size: 13px;
  font-weight: 500;
  line-height: 28px;
}

.mmba-lead-tag-edit:hover {
  border-color: #2563eb;
  background: #f8fbff;
  color: #1d4ed8;
}

.mmba-lead-tag-line {
  grid-template-columns: 74px minmax(0, 1fr);
  min-height: 36px;
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 24px;
}

.mmba-lead-tag-line:last-child {
  border-bottom: 0;
}

.mmba-lead-tag-label {
  color: #64748b;
}

.mmba-lead-tag-values {
  align-items: center;
}

.mmba-lead-tag-chip {
  min-height: 24px;
  border-color: #bfdbfe;
  border-radius: 5px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 22px;
}

.mmba-lead-tag-chip.more {
  border-color: #d9e1ec;
  background: #f8fafc;
  color: #64748b;
}

.mmba-lead-tag-empty,
.mmba-lead-tag-record,
.mmba-lead-tag-record-editor,
.mmba-lead-tag-selected > span {
  color: #94a3b8;
}

.mmba-lead-tag-dialog {
  width: min(920px, calc(100vw - 36px));
  max-height: min(780px, calc(100vh - 36px));
  border-color: #dfe7f1;
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.24);
}

.mmba-lead-tag-dialog-head {
  border-bottom-color: #e6edf5;
  background: #f8fafc;
  padding: 16px 18px;
}

.mmba-lead-tag-dialog-head strong {
  color: #111827;
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
}

.mmba-lead-tag-dialog-subtitle {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 18px;
}

.mmba-lead-tag-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 20px;
  line-height: 30px;
}

.mmba-lead-tag-close:hover {
  background: #eef2f7;
  color: #334155;
}

.mmba-lead-tag-dialog-body {
  background: #ffffff;
  padding: 16px 18px 18px;
}

.mmba-lead-tag-tabs {
  display: inline-flex;
  border: 0;
  border-radius: 6px;
  background: #eef2f7;
  padding: 3px;
  margin-bottom: 14px;
}

.mmba-lead-tag-tabs button {
  min-width: 86px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  padding: 0 14px;
  font-weight: 500;
}

.mmba-lead-tag-tabs button.active {
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.mmba-lead-tag-toolbar {
  margin-bottom: 9px;
}

.mmba-lead-tag-toolbar strong {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.mmba-lead-tag-toolbar button {
  border-radius: 5px;
  color: #2563eb;
  padding: 0 8px;
  font-weight: 500;
}

.mmba-lead-tag-toolbar button:hover {
  background: #eff6ff;
}

.mmba-lead-tag-selected {
  min-height: 40px;
  border-color: #dfe7f1;
  border-radius: 8px;
  background: #fbfdff;
  padding: 8px;
  margin-bottom: 14px;
}

.mmba-lead-tag-selected button {
  min-height: 26px;
  border-color: #bfdbfe;
  border-radius: 5px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0 8px;
  font-weight: 500;
}

.mmba-lead-tag-selected button:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.mmba-lead-tag-groups {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mmba-lead-tag-group {
  display: block;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #ffffff;
  padding: 11px 12px 12px;
}

.mmba-lead-tag-group-title {
  margin-bottom: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
}

.mmba-lead-tag-options {
  gap: 7px;
}

.mmba-lead-tag-options button {
  min-height: 28px;
  border-color: #d9e1ec;
  border-radius: 5px;
  background: #ffffff;
  color: #334155;
  padding: 0 10px;
  font-size: 13px;
  line-height: 26px;
}

.mmba-lead-tag-options button:hover {
  border-color: #93c5fd;
  background: #f8fbff;
  color: #1d4ed8;
}

.mmba-lead-tag-options button.selected {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.mmba-lead-tag-record-editor {
  min-height: 130px;
  border-color: #dfe7f1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.mmba-lead-tag-dialog-foot {
  border-top-color: #e6edf5;
  background: #f8fafc;
  padding: 13px 18px;
}

.mmba-lead-tag-cancel,
.mmba-lead-tag-save {
  height: 34px;
  min-width: 82px;
  border-radius: 6px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
}

.mmba-lead-tag-cancel {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #334155;
}

.mmba-lead-tag-save {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.mmba-lead-tag-save:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

@media (max-width: 760px) {
  .mmba-inline-bar {
    display: block;
  }

  .mmba-inline-actions {
    justify-content: flex-start;
    margin-top: 8px;
  }

  .mmba-form-grid,
  .mmba-quick-actions,
  .mmba-link-actions {
    grid-template-columns: 1fr;
  }

  .mmba-lead-tag-line,
  .mmba-lead-tag-group {
    grid-template-columns: 1fr;
  }

  .mmba-lead-tag-groups {
    grid-template-columns: 1fr;
  }

  .mmba-lead-tag-dialog-head,
  .mmba-lead-tag-dialog-foot,
  .mmba-lead-tag-head {
    align-items: flex-start;
  }

  .mmba-lead-tag-dialog-foot,
  .mmba-lead-tag-head {
    flex-direction: column;
  }

  .mmba-lead-tag-edit,
  .mmba-lead-tag-cancel,
  .mmba-lead-tag-save {
    width: 100%;
  }
}
