:root {
	color-scheme: dark;
	font-family: "Segoe UI", sans-serif;
	background: #12151b;
	color: #e8e4d9;
}

html, body {
	margin: 0;
	min-height: 100%;
}

body > header {
	padding: 0.6rem 1rem;
	border-bottom: 1px solid #2c3340;
}

body > aside {
	position: absolute;
	left: 0;
	top: 56px;
	width: 250px;
	bottom: 0;
	overflow: auto;
	padding: 0.75rem;
	box-sizing: border-box;
	background: #1a1e26;
	border-right: 1px solid #2c3340;
}

#changelog-wrap {
	position: absolute;
	right: 0;
	top: 56px;
	width: 280px;
	bottom: 0;
	overflow: auto;
	padding: 0.75rem;
	box-sizing: border-box;
	background: #1a1e26;
	border-left: 1px solid #2c3340;
}

.nav, .palette {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin: 0.75rem 0;
}

button, input {
	font: inherit;
	background: #101216;
	color: inherit;
	border: 1px solid #3a4250;
	padding: 0.3rem 0.5rem;
}

button { cursor: pointer; }
button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}
#apply-status.ok { color: #b8d4a0; }
.error { color: #f0a0a0; }
.hint { color: #9aa3b2; font-size: 0.85rem; }
.open-toggle { display: flex; gap: 0.4rem; align-items: center; }
article { margin-bottom: 0.75rem; }
fieldset { border-color: #3a4250; margin-top: 1rem; }
#selection-border {
	position: fixed;
	pointer-events: none;
	box-sizing: border-box;
	border: 2px solid #e23d3d;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
	z-index: 4;
}

label { display: block; margin: 0.4rem 0; }

#settings-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	z-index: 19;
}

#settings-modal {
	position: fixed;
	inset: 4vh 4vw;
	z-index: 20;
	display: flex;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#settings-modal[hidden],
#settings-backdrop[hidden] {
	display: none !important;
}

#settings-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

#settings-main header,
#settings-main footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
}

#settings-main footer {
	border-bottom: 0;
	border-top: 1px solid #2c3340;
}

#settings-form {
	flex: 1;
	overflow: auto;
	padding: 0;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.settings-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	padding: 0.65rem 1rem 0.5rem;
	border-bottom: 1px solid #2c3340;
	background: #12151c;
}

.settings-tab {
	appearance: none;
	border: 1px solid transparent;
	background: transparent;
	color: #a8a295;
	padding: 0.35rem 0.7rem;
	border-radius: 4px;
	cursor: pointer;
	font: inherit;
}

.settings-tab:hover {
	color: #e8e2d4;
	background: #1c222c;
}

.settings-tab.active {
	color: #1a1510;
	background: #d4c48a;
	border-color: #d4c48a;
}

.settings-panels {
	flex: 1;
	overflow: auto;
	padding: 0.75rem 1rem 1.25rem;
}

.settings-category {
	margin-bottom: 0;
}

.settings-category h3 {
	margin: 0 0 0.5rem;
	font-size: 0.95rem;
	color: #d4c48a;
	border-bottom: 1px solid #2c3340;
	padding-bottom: 0.25rem;
}

.setting-row {
	display: grid;
	grid-template-columns: minmax(12rem, 1fr) minmax(8rem, 14rem) 4rem;
	gap: 0.4rem 0.75rem;
	align-items: center;
	padding: 0.45rem 0.5rem;
	margin: 0.2rem 0;
	border-radius: 4px;
}

.setting-row .hint {
	grid-column: 1 / -1;
	margin: 0;
}

.setting-row.dirty {
	background: #4a3d18;
	box-shadow: inset 0 0 0 1px #c4a35a;
}

.setting-value {
	font-variant-numeric: tabular-nums;
	color: #c5c0b4;
}

#settings-log-wrap {
	width: min(340px, 32vw);
	flex-shrink: 0;
	border-left: 1px solid #2c3340;
	display: flex;
	flex-direction: column;
	background: #1a1e26;
}

#settings-log-wrap h2 {
	margin: 0;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
	font-size: 1rem;
}

#settings-log {
	flex: 1;
	overflow: auto;
	padding: 0.75rem 1rem;
}
