.n-select-tree {
	position: relative;
	outline: none;
	.form-control {
		cursor: pointer;
		padding: 5px 2px 2px 0;
		border: 0;
		box-shadow: none;
		-webkit-box-shadow: none;
		-o-box-shadow: none;
		.text {
			order: 1;
			flex-grow: 1;
			cursor: pointer;
			white-space: nowrap;
			text-overflow: ellipsis;
			padding-right: 3px;
			width: 0;	// must set an exactly width, it works, no matter what it is.
			overflow: hidden;
		}
		.selection {
			box-sizing: border-box;
			list-style: none;
			margin: 0;
			margin-top: -3px;
			padding: 0;
			width: ~'-webkit-calc(100% - 13px)';
			width: ~'-moz-calc(100% - 13px)';
			width: ~'calc(100% - 13px)';
			> li {
				border: 1px solid @border-color;
				border-radius: 4px;
				padding: 1px 3px;
				margin: 1px 6px 1px 0;
				float: left;
				line-height: 1.5;
				word-break: break-word;
			}
			> li:last-child {
				margin-right: 0;
			}
		}
		> .fa {
			// padding-top: 5px;
			position: absolute;
			right: 0;
			bottom: 10px;
		}
	}
	&:focus hr.focus-line {
		transform: scaleX(1);
		-o-transform: scaleX(1);
		-webkit-transform: scaleX(1);
	}

	&.n-disabled {
		.form-control {
			cursor: not-allowed;
			// pointer-events: none;
			color: @disabled-color;
		}
		&:focus hr.focus-line {
			transform: scaleX(0);
			-o-transform: scaleX(0);
			-webkit-transform: scaleX(0);
		}
	}
	&.n-view-mode {
		.form-control {
			cursor: default;
			.selection > li > span:first-child {
				display: none;
			}
			> .fa {
				display: none;
			}
		}
		hr.focus-line,
		hr.normal-line {
			display: none;
		}
	}
}

.n-select-tree-popover {
	&.popover.top,
	&.popover.bottom {
		margin-top: 2px;
		max-width: 9999px;
		min-width: 300px;
		z-index: 10000;
		position: absolute;
		.arrow {
			margin-left: -8px;
			border-width: 8px;
			left: 20px;
		}
	}
	&.popover.top {
		.arrow {
			bottom: -8px;
			border-bottom-width: 0;
		}
	}
	&.popover.bottom {
		.arrow {
			top: -8px;
			border-top-width: 0;
		}
	}
	&.popover.top.right-to-left,
	&.popover.bottom.right-to-left {
		.arrow {
			left: auto;
			right: 20px;
			margin-right: -8px;
		}
	}
	.popover-content {
		padding: 5px 5px 0;
		overflow: auto;
		max-height: 300px;
	}
	&.mobile-phone {
		width: 100%;
		top: 0;
		left: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0.541176);
		margin-top: 0;
		padding: 15px;
		> div.arrow {
			display: none;
		}
		> div.popover-content {
			background-color: @container-background-color;
			box-shadow: rgba(0, 0, 0, 0.247059) 0px 14px 45px, rgba(0, 0, 0, 0.219608) 0px 10px 18px;
			padding: 10px 5px 0;
			position: fixed;
			width: ~'-webkit-calc(100% - 30px)';
			width: ~'-moz-calc(100% - 30px)';
			width: ~'calc(100% - 30px)';
			/* 126 = 30 margin + 33 operations + 63 browser footer */
			min-height: ~'-webkit-calc(100vh - 126px)';
			min-height: ~'-moz-calc(100vh - 126px)';
			min-height: ~'calc(100vh - 126px)';
			.n-tree {
				max-height: ~'-webkit-calc(100vh - 45px - 126px)';
				max-height: ~'-moz-calc(100vh - 45px - 126px)';
				max-height: ~'calc(100vh - 45px - 126px)';
				overflow-y: hidden;
				overflow-x: hidden;
				ul.nav > li {
					white-space: normal;
					word-break: break-word;
					> div.node-content {
						display: table;
						> a:first-child {
							display: table-cell;
							width: 25px;
	    					min-width: 25px;
							vertical-align: middle;
							text-align: center;
							padding-bottom: 5px;
						}
						> div.n-checkbox {
							display: table-cell;
							width: 30px;
							min-width: 30px;
							vertical-align: middle;
							text-align: center;
						}
						> a:last-child {
							display: table-cell;
							width: 100%;
							padding-left: 5px;
							padding-right: 5px;
							vertical-align: middle;
							> span {
								padding-left: 0;
								padding-right: 0;
							}
						}
					}
				}
				span.buttons {
					display: block;
					top: 25px;
    				right: 20px;
    				position: fixed;
				}
			}
			> .operations {
				height: 33px;
				line-height: 33px;
				position: absolute;
				right: 0;
				left: 0;
				bottom: 2px;
				> div {
					border-top: 1px solid @select-option-chosen-color;
					// margin-left: 15px;
					// margin-right: 15px;
					> a {
						float: right;
						color: @color-primary;
						font-size: 1.3em;
						padding-left: 16px;
						padding-right: 16px;
					}
				}
			}
		}
		&.fix-bottom {
			background-color: transparent;
			padding: 0;
			> div.popover-content {
				width: 100%;
				bottom: 0;
				box-shadow: none;
				padding: 40px 0 0;
			    height: 210px;
			    min-height: inherit;
			    background-color: #d9d9d9;
			    overflow: hidden;
				> .n-tree {
					position: relative;
					max-height: inherit;
					height: 170px;
					padding-top: 10px;
					> span.buttons {
						top: auto;
						bottom: 138px;
    					right: 10px;
					}
				}
				> .operations {
					position: absolute;
					height: 40px;
					line-height: 40px;
					top: 0;
					left: 0;
					right: 0;
					border-top: 1px solid #c8c9cc;
					border-bottom: 1px solid #d9d9d9;
					background-color: #f0f1f2;
					> div {
						border-top: 0;
					}
				}
			}
		}
	}
}
