.crm-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-tag {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--tag-color, #0f766e) 34%, #fff);
  border-radius: 999px;
  padding: 4px 9px;
  background: color-mix(in srgb, var(--tag-color, #0f766e) 11%, #fff);
  color: color-mix(in srgb, var(--tag-color, #0f766e) 78%, #111827);
  font-size: 0.76rem;
  font-weight: 900;
}

.crm-tag-filter {
  display: grid;
  gap: 6px;
}

.crm-tag-filter-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-height: 18px;
}

.crm-tag-filter-heading span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-tag-filter-heading button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 900;
}

.crm-tag-filter-select {
  width: 100%;
}

.crm-tag-filter-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
}

.crm-tag-filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--tag-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-color) 14%, transparent);
}

.crm-tag-filter-empty {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.crm-tag-picker {
  position: relative;
  min-width: 0;
}

.crm-tag-picker-shell {
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
}

.crm-tag-picker.is-open .crm-tag-picker-shell {
  border-color: rgba(15, 118, 110, 0.62);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.crm-tag-picker-shell input {
  width: 120px;
  min-width: 96px;
  flex: 1 1 120px;
  min-height: 28px;
  border: 0;
  border-radius: 0;
  padding: 2px;
  box-shadow: none;
}

.crm-tag-picker-shell input:focus {
  border-color: transparent;
  outline: 0;
  box-shadow: none;
}

.crm-tag-token {
  min-height: 28px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--tag-color, #0f766e) 72%, #fff);
  border-radius: 999px;
  padding: 3px 5px 3px 9px;
  background: color-mix(in srgb, var(--tag-color, #0f766e) 11%, #fff);
  color: color-mix(in srgb, var(--tag-color, #0f766e) 82%, #111827);
  font-size: 0.78rem;
  font-weight: 900;
}

.crm-tag-token button {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: color-mix(in srgb, var(--tag-color, #0f766e) 16%, #fff);
  color: inherit;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
}

.crm-tag-options {
  position: fixed;
  z-index: 120;
  top: var(--tag-popup-top);
  left: var(--tag-popup-left);
  width: var(--tag-popup-width);
  max-height: var(--tag-popup-max-height, 260px);
  display: grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px;
  overflow: auto;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.crm-tag-options.is-above {
  transform: translateY(calc(-100% - 6px));
}

.crm-tag-option,
.crm-tag-empty-option {
  min-height: 34px;
  display: flex;
  gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 7px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.crm-tag-option:hover {
  background: var(--panel-soft);
}

.crm-tag-option-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: var(--tag-color);
}

.crm-tag-empty-option {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}
