.btr-sourceviewer-modal {
	position: fixed;
	display: flex;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;

	justify-content: center;
	align-items: center;

	background-color: rgba(0, 0, 0, 0.7);
	z-index: 100000;
}

.btr-sourceviewer-container {
	position: relative;

	display: grid;
	background: #fff;
	width: calc(100% - 128px);
	height: calc(100% - 128px);

	padding: 1.5px;
	padding-bottom: 0;

	border: 1px solid #b8b8b8;

	border-radius: 2px;
	overflow: hidden;

	grid-template-rows: 25px minmax(0, auto);
	grid-template-columns: auto 560px;

	grid-template-areas:
		"header explorer"
		"content explorer";
}

.btr-sourceviewer-header {
	position: relative;
	padding-right: 25px;
	
	color: #000;
	font-size: 12px;
	
	grid-area: header;
	background: #F2F2F2;
	border: 1px solid #B6B6B6;

	margin-right: 1.5px;
}

.btr-sourceviewer-header .btr-sourceviewer-tab {
	display: inline-flex;
	height: 100%;

	background: #F2F2F2;
	border-right: 1px solid #B6B6B6;

	justify-content: center;
	align-items: center;

	color: #000;

	font-size: 12px;
	padding: 0 10px;
	padding-top: 4px;

	cursor: default;

	user-select: none;
	-moz-user-select: none;
}

.btr-sourceviewer-header .btr-sourceviewer-tab:hover {
	background: #E4EEFE;
}

.btr-sourceviewer-header .btr-sourceviewer-tab.active {
	background: linear-gradient(to top, #FFF 0px, #FFF 20px, #B6B6B6 20px, #B6B6B6 21px, transparent 21px);
}

.btr-sourceviewer-header .btr-sourceviewer-tab-close {
	display: flex;
	justify-content: center;
	align-items: center;

	width: 15px;
	height: 15px;

	margin-left: 2px;
	
	font-size: 16px;
	font-weight: 500;

	color: #7F7F7F;
}

.btr-sourceviewer-header .btr-sourceviewer-tab-close:hover {
	background: #E4EEFE;
	color: #C7C7C7;
}

/* */

.btr-sourceviewer-header .btr-sourceviewer-settings-button {
	position: absolute;
	right: 0;
	top: 0;
	width: 25px;
	height: 100%;
	border-left: 1px solid #B6B6B6;
	
	user-select: none;
	cursor: pointer;
}

.btr-sourceviewer-header .btr-sourceviewer-settings-button:hover {
	background: #E4EEFE;
}

.btr-sourceviewer-header .btr-sourceviewer-settings-button.active {
	background: white;
}

.btr-sourceviewer-header .btr-sourceviewer-settings-button::before {
	display: block;
	content: "\2699";
	width: 100%;
	height: 100%;
	position: absolute;
	text-align: center;
	font-size: 18px;
	left: 0;
	top: 2px;
	
	user-select: none;
	pointer-events: none;
}

.btr-sourceviewer-settings {
	position: absolute;
	top: 100%;
	right: -1px;
	
	width: 240px;
	z-index: 2;
	
	
	background: white;
	border: 1px solid #B6B6B6;
	
	display: none;
	grid: auto-flow / max-content auto;
	
	cursor: default;
	user-select: none;
}

.btr-sourceviewer-settings, .btr-sourceviewer-settings * {
	font-size: 12px !important;
	color: black !important;
	font-weight: 300 !important;
	font-family: "Source Sans Pro",Arial,Helvetica,sans-serif !important;
}

.btr-sourceviewer-header .btr-sourceviewer-settings-button.active + .btr-sourceviewer-settings {
	display: grid;
}

.btr-sourceviewer-setting-label {
	border-right: 1px solid #B6B6B6;
	padding: 4px 8px;
}

.btr-sourceviewer-setting-value {
	padding: 0;
}

.btr-sourceviewer-setting-label:not(:nth-child(-n + 2)),
.btr-sourceviewer-setting-value:not(:nth-child(-n + 2)) {
	border-top: 1px solid #B6B6B6;
}

.btr-sourceviewer-setting-value input[type="number"] {
	display: block;
	width: 100%;
	height: 100%;
	border: none;
	padding-left: 8px;
	background: none;
	color: black;
}

.btr-sourceviewer-setting-value input[type="checkbox"] {
	display: block;
	margin: 0;
	padding: 0;
	margin-left: 5px;
	height: 100%;
	
}

/* */

.btr-sourceviewer-content {
	grid-area: content;
	background: #fff;
	border: 1px solid #B6B6B6;
	border-top: none;

	margin-right: 1.5px;
	margin-bottom: 1.5px;

	overflow: auto;
}

.btr-sourceviewer-explorer {
	grid-area: explorer;
	background: #fff;
}

/* */

.btr-sourceviewer-container .btr-explorer-parent {
	display: flex;
	width: 100%;
	height: 100%;
}

.btr-sourceviewer-container .btr-explorer-parent .btr-explorer,
.btr-sourceviewer-container .btr-explorer-parent .btr-properties {
	width: 50%;
	position: relative;
	top: auto;
	bottom: auto;
	right: auto;
	left: auto;
	z-index: initial;
	box-shadow: none;
}

/* */

.btr-sourceviewer-source-container, .btr-sourceviewer-source-container * {
	font-family: "Fira Mono", monospace !important;
	font-size: 14px !important;
	font-weight: 300;
	line-height: 18px;

	color: #000;
}

.btr-sourceviewer-source-container {
	white-space: var(--sv-wrapping, break-spaces);
	word-break: break-word;

	position: relative;
	min-height: 100%;

	tab-size: var(--sv-tabwidth, 4);
	-moz-tab-size: var(--sv-tabwidth, 4);
	
	display: flex;
	flex-direction: row;
	user-select: none;
}

.btr-sourceviewer-source-container > * {
	padding-top: 4px;
	padding-bottom: 12px;
}

.btr-sourceviewer-source-container > .btr-sourceviewer-linenumbers {
	background: #DDDDDD;
	padding-left: 12px;
	padding-right: 4px;
	
	text-align: right;
	white-space: nowrap;

	user-select: none;
	pointer-events: none;
}

.btr-sourceviewer-source-container > .btr-sourceviewer-scopes {
	flex: 0 0 auto;
	
	background: #FAFAFA;
	width: 14px;

	user-select: none;
	pointer-events: none;
}

.btr-sourceviewer-source-container > .btr-sourceviewer-lines {
	position: relative;
	flex: 1 1 auto;

	padding-left: 6px;
	padding-right: 6px;

	cursor: text;
	user-select: text;
	
	outline: none !important; /* Weird chrome outline */
}

.btr-sourceviewer-source-container .btr-linenumber {
	text-align: right;
	white-space: nowrap;

	user-select: none;
	pointer-events: none;
}

.btr-sourceviewer-source-container .btr-linenumber::selection {
	display: none;
}

.btr-sourceviewer-source-container .btr-line-container {
	display: block;
	position: relative;
}

.btr-sourceviewer-source-container .btr-line-container.btr-collapsed {
	display: block;
	max-height: 0px;
	max-width: 0;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

.btr-sourceviewer-source-container .btr-line-container .btr-linenumber {
	position: absolute;
	top: 1px;
	left: -75px;
	width: 50px;
}

.btr-sourceviewer-source-container .btr-line-container .btr-scope {
	position: absolute;
	top: 0px;
	left: -20px;
	width: 14px;
	height: 18px;

	cursor: default;
	user-select: none;
}

.btr-sourceviewer-source-container .btr-line-container.open .btr-scope::before,
.btr-sourceviewer-source-container .btr-line-container.closed .btr-scope::before {
	content: "";
	position: absolute;

	width: 6px;
	height: 6px;

	border: 0 solid #7F7F7F;
	border-width: 0 1px 1px 0;

	transform: rotate(45deg);
	transform-origin: center;

	left: 4px;
	top: 5px;

	user-select: none;
}

.btr-sourceviewer-source-container .btr-line-container.closed .btr-scope::before {
	transform: rotate(-45deg);
	margin-top: 1px;
	margin-left: -1px;
}

.btr-sourceviewer-source-container .btr-linetext {
	display: inline-block;
	width: 100%;
}

.btr-sourceviewer-source-container .btr-sourceviewer-tab,
.btr-sourceviewer-source-container .btr-sourceviewer-space {
	position: relative;
}

.btr-sourceviewer-source-container .btr-sourceviewer-tab::before {
	position: absolute;
	display: var(--sv-whitespace, "inline");
	width: 100%;
	
	text-align: center;
	content: "\2192";
	opacity: 0.25;
	
	user-select: none;
	pointer-events: none;
}

.btr-sourceviewer-source-container .btr-sourceviewer-space::before {
	position: absolute;
	display: var(--sv-whitespace, "inline");
	width: 100%;
	
	text-align: center;
	content: "\B7";
	opacity: 0.3;
	
	user-select: none;
	pointer-events: none;
}

.btr-sourceviewer-source-container .btr-sourceviewer-string { color: rgb(127, 0, 127); }
.btr-sourceviewer-source-container .btr-sourceviewer-comment { color: rgb(0, 127, 9); }
.btr-sourceviewer-source-container .btr-sourceviewer-keyword { color: rgb(0, 0, 127); font-weight: bold; }
.btr-sourceviewer-source-container .btr-sourceviewer-global { color: rgb(0, 0, 127); text-shadow: 0px 0px 0.1px rgba(0, 0, 127, 0.5); }
.btr-sourceviewer-source-container .btr-sourceviewer-property { color: rgb(72, 92, 142); }
.btr-sourceviewer-source-container .btr-sourceviewer-method { color: rgb(0, 116, 189); }
.btr-sourceviewer-source-container .btr-sourceviewer-number { color: rgb(0, 127, 127); }
.btr-sourceviewer-source-container .btr-sourceviewer-operator { color: rgb(127, 127, 0); }
.btr-sourceviewer-source-container .btr-sourceviewer-nilbool { color: rgb(0, 127, 127); font-weight: bold; }
.btr-sourceviewer-source-container .btr-sourceviewer-attribute { color: rgb(0, 0, 127); font-weight: bold; }
