@import "../fonts/css/onest-variable.css";

:root {
	--d2h-bg-color: var(--background-step-1);
	--d2h-border-color: var(--border);
	--d2h-dim-color: var(--text-muted);
	--d2h-line-border-color: var(--border);
	--d2h-file-header-bg-color: var(--background-step-2);
	--d2h-file-header-border-color: var(--border);
	--d2h-empty-placeholder-bg-color: var(--background-step-1);
	--d2h-empty-placeholder-border-color: var(--border);
	--d2h-selected-color: var(--info-flat);
	--d2h-ins-bg-color: hsl(from var(--success-base) h s calc(l / 5));
	--d2h-ins-border-color: hsl(from var(--success-base) h s calc(l / 2));
	--d2h-ins-highlight-bg-color: hsl(from var(--success-base) h s calc(l / 3));
	--d2h-ins-label-color: var(--success-base);
	--d2h-del-bg-color: hsl(from var(--danger-base) h s calc(l / 3));
	--d2h-del-border-color: hsl(from var(--danger-base) h s calc(l / 2));
	--d2h-del-highlight-bg-color: hsl(from var(--danger-base) h s calc(l / 1.5));
	--d2h-del-label-color: var(--danger-base);
	--d2h-change-del-color: hsl(from var(--warning-base) h s calc(l * 1.2));
	--d2h-change-ins-color: hsl(from var(--success-base) h s calc(l * 1.25));
	--d2h-info-bg-color: hsl(from var(--info-base) h s calc(l / 5));
	--d2h-info-border-color: hsl(from var(--info-base) h s calc(l / 2));
	--d2h-change-label-color: var(--warning-base);
	--d2h-moved-label-color: var(--info-base);
}

[data-theme="light"] {
	--d2h-ins-bg-color: var(--success-base);
	--d2h-ins-highlight-bg-color: hsl(from var(--success-base) h s calc(l / 0.7));
	--d2h-del-bg-color: hsl(from var(--danger-base) h s calc(l * 2));
	--d2h-del-highlight-bg-color: hsl(from var(--danger-base) h s calc(l * 1.5));
	--d2h-info-bg-color: hsl(from var(--info-base) h s calc(l * 1.5));
}

.d2h-wrapper {
	text-align: left;
}

.d2h-file-header {
	background-color: var(--d2h-file-header-bg-color);
	border-bottom: 1px solid var(--d2h-file-header-border-color);
	display: flex;
	font-family: var(--scms-font-onest);
	height: 35px;
	padding: 5px 10px;
}
.d2h-file-header.d2h-sticky-header {
	position: sticky;
	top: 0;
	z-index: 1;
}
.d2h-file-stats {
	display: flex;
	font-size: 14px;
	margin-left: auto;
}
.d2h-lines-added {
	border: 1px solid var(--d2h-ins-border-color);
	border-radius: 5px 0 0 5px;
	color: var(--d2h-ins-label-color);
	padding: 2px;
	text-align: right;
	vertical-align: middle;
}
.d2h-lines-deleted {
	border: 1px solid var(--d2h-del-border-color);
	border-radius: 0 5px 5px 0;
	color: var(--d2h-del-label-color);
	margin-left: 1px;
	padding: 2px;
	text-align: left;
	vertical-align: middle;
}
.d2h-file-name-wrapper {
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	font-size: 15px;
	width: 100%;
}
.d2h-file-name {
	overflow-x: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 500;
}
.d2h-file-wrapper {
	border: 1px solid var(--d2h-border-color);
	border-radius: 3px;
	margin-bottom: 1em;
}
.d2h-file-collapse {
	-webkit-box-pack: end;
	-ms-flex-pack: end;
	cursor: pointer;
	display: none;
	font-size: 12px;
	justify-content: flex-end;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	border: 1px solid var(--d2h-border-color);
	border-radius: 3px;
	padding: 4px 8px;
}
.d2h-file-collapse.d2h-selected {
	background-color: var(--d2h-selected-color);
}
.d2h-file-collapse-input {
	margin: 0 4px 0 0;
}
.d2h-diff-table {
	border-collapse: collapse;
	font-family:
		ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
		monospace;
	font-size: 13px;
	width: 100%;
}
.d2h-files-diff {
	display: flex;
	width: 100%;
}
.d2h-file-diff {
	overflow-y: hidden;
}
.d2h-file-diff.d2h-d-none,
.d2h-files-diff.d2h-d-none {
	display: none;
}
.d2h-file-side-diff {
	display: inline-block;
	overflow-x: scroll;
	overflow-y: hidden;
	width: 50%;
	&::-webkit-scrollbar,
	&::-webkit-scrollbar-track {
		background-color: inherit;
		border-top-left-radius: 0;
		border-top-right-radius: 0;
		-webkit-box-shadow: inset 0 0 2px var(--border);
	}
	&::-webkit-scrollbar-thumb {
		background-color: var(--mono-flat-hover);
		border: 4px solid transparent;
		background-clip: content-box;
		border-radius: var(--radius-full);
	}
	&::-webkit-scrollbar-thumb:hover {
		background-color: var(--mono-flat-active);
		cursor: default;
	}
}
.d2h-code-line {
	padding: 0 8em;
	width: calc(100% - 16em);
}
.d2h-code-line,
.d2h-code-side-line {
	display: inline-block;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	white-space: nowrap;
}
.d2h-code-side-line {
	padding: 0 4.5em;
}
.d2h-code-line-ctn {
	background: none;
	display: inline-block;
	padding: 0;
	word-wrap: normal;
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
	vertical-align: top;
	white-space: break-spaces;
	width: 100%;
}
.d2h-code-line del,
.d2h-code-side-line del {
	background-color: var(--d2h-del-highlight-bg-color);
}
.d2h-code-line del,
.d2h-code-line ins,
.d2h-code-side-line del,
.d2h-code-side-line ins {
	border-radius: 0.2em;
	display: inline-block;
	margin-top: -1px;
	-webkit-text-decoration: none;
	text-decoration: none;
	padding-inline: 2px;
}
.d2h-code-line ins,
.d2h-code-side-line ins {
	background-color: var(--d2h-ins-highlight-bg-color);
	text-align: left;
}
.d2h-code-line-prefix {
	background: none;
	display: inline;
	padding: 0;
	word-wrap: normal;
	white-space: pre;
}
.line-num1 {
	float: left;
}
.line-num1,
.line-num2 {
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
	overflow: hidden;
	padding: 0 0.5em;
	text-overflow: ellipsis;
	width: 3.5em;
}
.line-num2 {
	float: right;
}
.d2h-code-linenumber {
	background-color: var(--d2h-bg-color);
	border: solid var(--d2h-line-border-color);
	border-width: 0 1px;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
	color: var(--d2h-dim-color);
	cursor: pointer;
	display: inline-block;
	position: absolute;
	text-align: right;
	width: 7.5em;
}
.d2h-code-linenumber:after {
	content: "\200b";
}
.d2h-code-side-linenumber {
	background-color: var(--d2h-bg-color);
	border: solid var(--d2h-line-border-color);
	border-width: 0 1px;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
	color: var(--d2h-dim-color);
	cursor: pointer;
	display: inline-block;
	overflow: hidden;
	padding: 0 0.5em;
	position: absolute;
	text-align: right;
	text-overflow: ellipsis;
	width: 4em;
}
.d2h-code-side-linenumber:after {
	content: "\200b";
}
.d2h-code-side-emptyplaceholder,
.d2h-emptyplaceholder {
	background-color: var(--d2h-empty-placeholder-bg-color);
	border-color: var(--d2h-empty-placeholder-border-color);
}
.d2h-code-line-prefix,
.d2h-code-linenumber,
.d2h-code-side-linenumber,
.d2h-emptyplaceholder {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}
.d2h-code-linenumber,
.d2h-code-side-linenumber {
	direction: rtl;
}
.d2h-del {
	background-color: var(--d2h-del-bg-color);
	border-color: var(--d2h-del-border-color);
}
.d2h-ins {
	background-color: var(--d2h-ins-bg-color);
	border-color: var(--d2h-ins-border-color);
}
.d2h-info {
	background-color: var(--d2h-info-bg-color);
	border-color: var(--d2h-info-border-color);
	color: var(--d2h-dim-color);
}
.d2h-file-diff .d2h-del.d2h-change {
	background-color: var(--d2h-change-del-color);
}
.d2h-file-diff .d2h-ins.d2h-change {
	background-color: var(--d2h-change-ins-color);
}
.d2h-file-list-wrapper {
	margin-bottom: 10px;
}
.d2h-file-list-wrapper a {
	-webkit-text-decoration: none;
	text-decoration: none;
}
.d2h-file-list-wrapper a,
.d2h-file-list-wrapper a:visited {
	color: var(--d2h-moved-label-color);
}
.d2h-file-list-header {
	text-align: left;
}
.d2h-file-list-title {
	font-weight: 700;
}
.d2h-file-list-line {
	display: flex;
	text-align: left;
}
.d2h-file-list {
	display: block;
	list-style: none;
	margin: 0;
	padding: 0;
}
.d2h-file-list > li {
	border-bottom: 1px solid var(--d2h-border-color);
	margin: 0;
	padding: 5px 10px;
}
.d2h-file-list > li:last-child {
	border-bottom: none;
}
.d2h-file-switch {
	cursor: pointer;
	display: none;
	font-size: 10px;
}
.d2h-icon {
	margin-right: 10px;
	vertical-align: middle;
	fill: currentColor;
}
.d2h-deleted {
	color: var(--d2h-del-label-color);
}
.d2h-added {
	color: var(--d2h-ins-label-color);
}
.d2h-changed {
	color: var(--d2h-change-label-color);
}
.d2h-moved {
	color: var(--d2h-moved-label-color);
}
.d2h-tag {
	background-color: var(--d2h-bg-color);
	display: flex;
	font-size: 10px;
	margin-left: 5px;
	padding: 0 2px;
}
.d2h-deleted-tag {
	border: 1px solid var(--d2h-del-label-color);
}
.d2h-added-tag {
	border: 1px solid var(--d2h-ins-label-color);
}
.d2h-changed-tag {
	border: 1px solid var(--d2h-change-label-color);
}
.d2h-moved-tag {
	border: 1px solid var(--d2h-moved-label-color);
}
