:root {
	--border-highest: #878787;
	--border-high: #646464;
	
    --bg-highest: #6d6d6d;
    --bg-high: #525252;
    --bg-shine: #6e6e6e;
    --bg-mid: #363636;
    --bg-low: #282828;
    --bg-lowest: #161616;

    --fg-highest: white;
    --fg-high: white;
    --fg-mid: #d6d6d6;
    --fg-low: #b2b2b2;

	--primary: aqua;
	--on-primary: black;

	/* transparent grid */
	--tg-white: #fff;
	--tg-gray: #e0e0e0;
	--tg-cs: 8px;
	--tg-checker: conic-gradient(var(--tg-gray) 0 25%, var(--tg-white) 0 50%,
						var(--tg-gray) 0 75%, var(--tg-white) 0)
		0 0 / calc(var(--tg-cs) * 2) calc(var(--tg-cs) * 2);

	/* transparent grid dark */
	--tgd-white: #5b5b5b;
	--tgd-gray: #414141;
	--tgd-checker: conic-gradient(var(--tgd-gray) 0 25%, var(--tgd-white) 0 50%,
						var(--tgd-gray) 0 75%, var(--tgd-white) 0)
		0 0 / calc(var(--tg-cs) * 2) calc(var(--tg-cs) * 2);
}

html, body, #__core { height: 100%; overflow-y: clip; overflow-x: clip; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-lowest);
    font-family: sans-serif;
}

body {
	scrollbar-color: var(--bg-highest) var(--bg-lowest);
}

.menu-bar {
    background: var(--bg-high);
    user-select: none;
}

.menu-bar span {
    color: var(--fg-high);
}

.menu-bar u {
    text-decoration: none;
}

.underline-accelerators u {
    text-decoration: underline;
}

.menu-strip {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-level {
    position: relative;
}

.top-level:hover {
    background-color: var(--bg-highest);
}

.strip-label {
    border: none;
    background: transparent;
    padding: 6px 10px;
    cursor: pointer;
}

.popup {
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--bg-high);
    border: 0.1rem solid var(--bg-low);
    z-index: 100;
    padding: 0;
	width: 220px;
}

.popup li {
    list-style: none;
}

.item button {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 4px 20px 4px 32px;
    display: flex;
    justify-content: space-between;
}

.item button:hover {
    background-color: var(--bg-highest);
}

.item button:disabled {
    opacity: .4;
}

.shortcut {
    margin-left: 2em;
    opacity: .6;
}

.win {
    position: absolute;
    background-color: var(--bg-highest);
    border: 0.1rem outset var(--border-highest);
    color: var(--fg-highest);
    min-width: 200px;
	border-radius: 8px 8px 0px 0px;
	box-shadow: rgb(0, 0, 0) 0px 20px 30px -10px;
}

.win .bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    cursor: move;
	font-weight: 600;
	font-size: 0.9em;
}

.win .bar button {
    border: none;
    background: transparent;
    color: var(--fg-highest);
    font-size: 16px;
    cursor: pointer;
}

.win .body {
	background-color: var(--bg-high);
	margin: 2px;
	border: 0.1rem inset var(--border-high);
}

.workspace {
	width: 100%;
	height: 100%;
	display: flex;
	flex: 1;
	margin-top: 0.2rem;
	margin-bottom: 1rem;
}

.workspace .left-panel {
	width: 48px;
	margin-right: 0.2rem;
}

.workspace .mid-area {
	flex: 1;
	height: 100%;
}

.workspace .right-panel {
	width: 300px;
	display: flex;
	flex-direction: column;
	margin-right: 0.2rem;
}

#__core {
	display: flex;
	flex-direction: column;
}

.tool-panel button {
	width: 100%;
	height: 48px;
	background-color: transparent;
	border: 0;
	color: var(--fg-high);
}

.tool-panel button.active {
	background-color: var(--bg-mid);
}

.tool-panel button:hover {
	background-color: var(--bg-shine);
}

.assets-panel, .config-panel, .tool-panel {
	width: 100%;
	background-color: var(--bg-high);
	color: var(--fg-high);
	outline: 0.1rem outset var(--border-high);
}

.config-panel, .assets-panel {
	flex: 1;
}

.tool-panel {
	height: 100%;
}

.tab-switcher {
	height: 24px;
	display: flex;
	background-color: var(--bg-mid);
	border: 0.1rem inset var(--bg-mid);
	gap: 4px;
	
	width: 0;
	min-width: 100%;
	overflow-x: auto;
	overflow-y: clip;
	scrollbar-width: thin;
	
	user-select: none;
}

.tab-switcher button, .tab-switcher .tabbutton {
	background-color: transparent;
	border: 0;
	color: var(--fg-low);
	padding: 0px 8px 0px 8px;
	font-size: 13px;
    display: flex;
    align-items: center;
    text-wrap-mode: nowrap;
}

.tab-switcher button:hover, .tab-switcher .tabbutton:hover {
	color: var(--fg-high);
}

.tab-switcher button.active, .tab-switcher .tabbutton.active {
	background-color: var(--bg-high);
	color: var(--fg-high);
	outline: 0.1rem solid var(--bg-high);
}

.tabbed-panel {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.tabbed-panel .content {
	flex: 1;
}

.tabbed-panel .content .tab {
	height: 0;
	min-height: 100%;
	overflow-y: auto;
	overflow-x: clip;
}

.workcanvas {
	background-color: var(--bg-low);
	display: flex;
	flex-direction: column;
	height: 100%;
	user-select: none;
}

.workcanvas .tab-switcher {
	border: 0;
	background-color: var(--bg-lowest);
}

.workcanvas .tab-switcher button.active {
	outline: 0;
	background-color: var(--bg-mid);
}

.workcanvas .content {
	flex: 1;
}

.workcanvas .content .controls {
	position: absolute;
	top: 0px;
	right: 0px;
	color: var(--fg-high);
	padding: 8px;
	background-color: rgb(16, 16, 16, 0.67);
}

.controls button {
	background-color: transparent;/* var(--bg-mid); */
	color: var(--fg-mid);
	outline: 0;
	border: 0;
	padding: 4px;
	font-family: monospace;
	border-radius: 50%;
}

.controls button.active {
	background-color: var(--bg-highest);
	color: var(--fg-highest);
	border-radius: 25%;
}

.controls button.inactive {
	background-color: var(--bg-lowest);
	color: var(--fg-low);
	border-radius: 25%;
}


.historyItems {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.historyItems button {
	background-color: var(--bg-mid);
	color: var(--fg-high);
	border: 0;
	width: 100%;
	min-height: 32px;
}

.historyItems button.redoable {
	background-color: var(--bg-lowest);
}
.historyItems button.top {
	background-color: var(--bg-highest);
}

.file {
	background-color: var(--bg-low);
	display: flex;
	flex-direction: row;
	align-items: center;
	padding: 8px;
	padding-left: 28px;
	gap: 8px;
	position: relative;
}

.file:nth-child(even) {
	background-color: color-mix(in srgb, var(--bg-low), var(--bg-high) 20%);
}

.file-name {
	overflow: hidden;
	text-overflow: ellipsis;
  	font-size: 13px;
}

.dragging-kind-background .highlight-on-drag-kind-background,
.dragging-kind-icon .highlight-on-drag-kind-icon,
.dragging-kind-other .highlight-on-drag-kind-other {
	outline: 2px dashed var(--fg-mid);
}

.file[draggable="true"]:hover, .file.selectable:hover, .file.dragover {
	background-color: color-mix(in srgb, var(--bg-low), var(--bg-lowest) 60%);
	border: 1px solid var(--primary);
	margin: -1px;
	z-index: 1;
	outline: none;
}

.file.dragover {
	border-style: dashed;
	border-width: 2px;
	margin: -2px;
}

.file.dragover img {
	outline: 1px solid var(--primary);
}

.file .file-grip {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 24px;
	background-color: rgba(0, 0, 0, 25%);
	color: var(--fg-low);
  	display: flex;
  	align-items: center;
	justify-content: center;
}

.file.highlight-dragging .file-grip {
	background-color: var(--primary);
	color: var(--on-primary);
}

:not(.dragging-file) :not(.dragover) > .file .file-grip:hover {
	background-color: var(--bg-lowest);
	color: var(--fg-highest);
}

.file.highlight-above {
	border: 0 solid var(--primary);
  	border-top-width: 2px;
}
.file.highlight-below {
	border: 0 solid var(--primary);
  	border-bottom-width: 2px;
}


.file img, .file .img-container {
	height: 48px;
	width: 48px;
	user-select: none;
	position: relative;
}

.file.compact img {
	width: 32px;
	height: 32px;
}

.file.compact p {
	margin: 0;
	font-size: 13px;
	color: var(--fg-high);
	font-family: monospace;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}


.file .img-container img, .file .img-container .change-button {
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	padding: 0;
	border: 0;
	outline: 0;
	margin: 0;
}

.file .img-container .change-button {
	background-color: rgba(255, 255, 255, 0.4);
	border: 1px solid var(--fg-highest);
	color: var(--fg-highest);
	display: none;
}

.file .img-container:hover .change-button {
	display: unset;
}

.file input {
	width: 100%;
}

.file .labeled-input {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	margin-right: 16px;
}

.labeled-input label {
	font-size: 10px;
	color: var(--fg-low);
	user-select: none;
	text-transform: uppercase;
	font-weight: 600;
}

.file input:focus {
	background-color: var(--bg-lowest);
	color: var(--fg-highest);
	outline: 0.1rem solid var(--bg-high);
}

.file button {
	background: transparent;
	border: 0;
	color: var(--fg-low);
}

.file button:hover {
	color: var(--fg-highest);
}

.file .add-onhover-area {
	position: absolute;
	top: 75%;
	bottom: 0;
	left: 0;
	right: 0;
}

.file .add-onhover-area.above {
	top: 0;
	bottom: 75%;
}

.file .add-onhover-area .add-onhover {
	display: none;
	position: absolute;
	left: calc(50% - 12px);
	top: calc(100% - 12px);
	height: 24px;
	width: 24px;
	background-color: transparent;
	z-index: 1;
	opacity: 0.5;
}

.file .add-onhover-area.above .add-onhover {
	top: -12px;
}

:not(.dragging-file) > .file .add-onhover-area:hover .add-onhover {
	display: unset;
}

.file .add-onhover-area:hover .add-onhover:hover {
	background-color:  var(--bg-shine);
	opacity: 1;
}

.asset-category-header {
	display: flex;
	justify-content: space-between;
	height: 16px;
	align-items: center;
	padding: 4px;
	background-color: var(--bg-lowest);
}

.asset-category-header button, .tool-button {
	height: 32px;
	width: 32px;
	background-color: transparent;
	border: 0;
	color: var(--fg-high);
}

.asset-category-header button:hover, .tool-button:hover {
	background-color: var(--bg-shine);
}

.asset-category-header h4 {
	padding: 0;
	margin: 0;
}


.color-fields {
	display: grid;
	grid-template-columns: auto auto auto auto;
}

.color-field {
	display: flex;
	flex-direction: column;
	width: auto;
	position: relative;
	padding-bottom: 16px;
	flex: 1;
}

.color-field input {
	width: auto;
	height: 48px;
	border: none;
	outline: none;
	margin: none;
	background-color: transparent;
}

.color-field label {
	position: absolute;
	padding: 1px 4px 1px 4px;
	left: 0;
	right: 0;
	bottom: 2px;
	font-size: 11px;
	text-align: center;
	text-overflow: ellipsis;
	overflow: hidden;

	color: var(--fg-high);
}

.color-field:hover {
	background-color: var(--bg-mid);
}

.color-field:hover label {
	text-overflow: unset;
	overflow: unset;
	background-color: var(--bg-mid);
	color: var(--fg-high);
	z-index: 2;

	left: 50%;
	right: unset;
	transform: translateX(-50%);
}


.color-fields > .color-field:nth-child(4n+1):hover label {
	left: 0;
	right: unset;
	transform: unset;
}

.color-fields > .color-field:nth-child(4n):hover label {
	left: unset;
	right: 0;
	transform: unset;
}


#colorWindow {
	display: flex;
	flex-direction: column;
}

.hsv-main {
	display: flex;
	gap: 8px;
}

.hsv-sv-box {
	width: 300px;
	height: 300px;
	background-color: red;
	position: relative;
}

.hsv-hue {
	width: 32px;
	background-color: green;
	position: relative;
}

.col-dot {
	position: absolute;
	width: 10px;
	height: 10px;
	outline: 0.1rem solid white;
	border-radius: 100%;
	transform: translateX(-50%) translateY(-50%);
	background-color: red;
}

.col-line {
	position: absolute;
	left: 0;
	right: 0;
	height: 0.1rem;
	transform: translateY(-50%);;
	outline: 1px solid white;
	background-color: black;
}

.col-line-hor {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 0.1rem;
	transform: translateX(-50%);
	outline: 1px solid white;
	background-color: black;
}


.component {
	display: flex;
	flex-direction: row;
	margin-top: 4px;
	gap: 4px;
}

.component-label {
	width: 32px;
}

.component-slider {
	flex: 1;
	background-color: red;
	position: relative;
}

.component input {
	width: 64px;
}

.color-input {
	height: 48px;
	width: 48px;
	align-self: center;
	margin-top: 4px;
	margin-bottom: 4px;
	outline: 1px inset white;
	border-radius: 2px;
}

.color-input.inherited {
	position: relative;
}
.color-input.inherited::after {
    content: "auto";
    font-size: 12px;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: var(--color);
    filter: invert(1) contrast(100) saturate(0);
}

.color-box, .color-input, .recent-color {
  	background: linear-gradient(var(--color, transparent), var(--color, transparent)), var(--tg-checker);
}

.recent-color {
	width: 35px;
	height: 24px;
	border: 1px inset var(--border-highest);
}

.recent-colors {
	display: flex;
	flex-wrap: wrap;
	box-sizing: border-box;
	gap: 6px;
	width: 340px;
	margin-top: 8px
}

#colorWindow h1 {
	margin: 0 0 4px 0;
	text-align: center;
}

.color-box {
	width: 100%;
	height: 48px;
	margin: 4px 0 4px 0;
}

.action-buttons {
	display: flex;
	flex-direction: row;
	gap: 4px;
	justify-content: end;
	margin-top: 8px;
}

.action-buttons button {
	background-color: var(--bg-mid);
	color: var(--fg-high);
	outline: unset;
	border: unset;
	font-size: 14px;
	padding: 4px 8px 4px 8px;

	outline: 1px outset var(--bg-mid);
}

/* primary */
.action-buttons button:last-child {
	background-color: var(--fg-high);
	outline: 1px outset var(--fg-high);
	color: var(--bg-mid);
	padding: 4px 16px 4px 16px;
}

.action-buttons button:hover {
	background-color: var(--bg-shine);
	outline: 1px outset var(--bg-shine);
	color: var(--fg-high);
}

.action-buttons button:active {
	background-color: var(--bg-lowest);
	outline: 1px inset var(--bg-lowest);
	color: var(--fg-high);
}

.color-section-header {
	margin: 4px;
	padding: 0; 
}

.question-hint {
	color: var(--fg-mid);
}



.asset-categories {
	display: flex;
	flex-direction: column;
	gap: 1px;
	background: var(--bg-lowest);
	height: 100%;
}

.asset-configurable, .asset-category {
	background: var(--bg-high);
	position: relative;
}

.asset-configurable, .asset-category-header {
	padding: 12px 16px;
}

.asset-configurable .tool-button {
	position: absolute;
	top: 4px;
	right: 8px;
}

h1, h2, h3, h4 {
	margin: 0 0 12px 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--fg-mid);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	user-select: none;
}

.asset-configurable > div {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	min-height: 28px;
}

.asset-configurable > div:last-child {
	margin-bottom: 0;
}

input[type="radio"] {
	margin: 0;
	accent-color: var(--primary);
}

input[type="text"],
textarea,
select {
	background: var(--bg-low);
	color: var(--fg-high);
	border: 1px solid var(--border-high);
	padding: 4px 8px;
	font-size: 13px;
	flex: 1;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
	outline: 1px solid var(--primary);
	border-color: var(--primary);
}

.asset-configurable label:not(.color-field label) {
	color: var(--fg-high);
	width: 80px;
	font-size: 13px;
}

.asset-configurable > .check-radio label {
	width: 100%;
}


.inline-rect > div {
	display: flex;
	align-items: center;
	margin-bottom: 8px;
	min-height: 28px;
	flex: 1;
}

.asset-configurable .inline-rect div label {
	width: 12px;
}

.inline-rect div input[type="text"] {
	width: 100%;
	margin-left: 4px;
}

.inline-rect div input[type="text"]::after {
	content: "%";
	color: var(--fg-high);
	font-size: 13px;
}


.asset-configurable:has(input[value="constant"]:checked) .theme-token-picker,
.asset-configurable:has(input[value="themed"]:checked) .color-fields2 {
	display: none;
}

.rectanglegen-opts div {
	display: flex;
	align-items: center;
	margin: 8px;
}
.label-left {
	width: 160px;
	display: inline-block;
}

.rectanglegen-preview {
	width: min-content;
	position: relative;
}

.rectanglegen-preview .fg-text {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	font-size: 64px;
	text-align: center;
}

.rectanglegen-preview canvas {
	background: var(--tgd-checker);
}


div.replace-file-container {
	background-color: var(--bg-lowest);
	border: 2px dashed var(--border-high);
	padding: 8px;
}

div.replace-file-container:hover {
	border-color: var(--border-highest);
}

div.replace-file-container.active {
	border-color: var(--primary);
}

.replace-file-text {
	font-size: 12px;
	color: var(--fg-low);
	text-align: center;
	width: 100%;
	user-select: none;
}



.qualifier-editor {
	font-family: monospace;
	white-space: pre-wrap;
	word-break: break-all;
	background: var(--bg-low);
	border: 1px solid var(--border-high);
	padding: 4px 6px;
	min-height: 1.5em;
	line-height: 1.5;
}

.token-valid { color: #22863a; }
.token-invalid {
	color: #d1242f;
	text-decoration: underline wavy #d1242f;
	cursor: help;
}
.token-arg { color: #0969da; }
.token-string { color: #6f42c1; }


.autocomplete-list {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
	background: var(--bg-mid);
	border: 1px solid var(--border-high);
	max-height: 200px;
	overflow-y: auto;
	z-index: 100;
	display: none;
}

.autocomplete-list.visible {
	display: block;
}

.autocomplete-list li {
	padding: 6px 10px;
	cursor: pointer;
	font-family: monospace;
	font-size: 13px;
}

.autocomplete-list li:hover,
.autocomplete-list li[aria-selected="true"] {
	background: var(--bg-highest);
	color: var(--fg-highest);
}

.autocomplete-list li .desc {
	color: var(--fg-low);
	font-size: 11px;
	margin-left: 8px;
}

.autocomplete-list li:hover .desc,
.autocomplete-list li[aria-selected="true"] .desc {
	color: var(--fg-highest);
}


.font-picker-window {
	max-height: 800px;
	width: 480px;
	display: flex;
	flex-direction: column;
}

.font-picker-header {
	padding: 12px;
	border-bottom: 1px solid var(--border-high);
	flex-shrink: 0;
}

.font-picker-header input {
	width: 100%;
	margin-bottom: 8px;
	box-sizing: border-box;
}

.font-picker-contents {
	overflow-y: auto;
	flex: 1;
	padding: 12px;
}

.font-picker-footer {
	padding: 12px;
	border-top: 1px solid var(--border-high);
	flex-shrink: 0;
	font-size: 12px;
	color: var(--fg-low);
}

.font-card {
	padding: 12px;
	margin-bottom: 8px;
	border: 1px solid var(--border-high);
	background-color: var(--bg-mid);
	border-radius: 4px;
	cursor: pointer;
}

.font-preview {
	font-size: 24px;
	line-height: 1.4;
	color: var(--fg-mid);
	min-height: 32px;
	visibility: hidden;
}

.font-card-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 4px;
}

.font-card-header .name {
	font-weight: 600;
}

.font-card-header .category {
	font-size: 11px;
	color: var(--fg-low);
	text-transform: lowercase;
}

.font-card-footer {
	font-size: 11px;
	color: var(--fg-low);
	margin-top: 4px;
}




.key-info-section {
	margin-bottom: 20px;
}

.key-info-section:last-child {
	margin-bottom: 0;
}

.key-info-hint {
	margin: -8px 0 10px 0;
	font-size: 12px;
	color: var(--fg-mid);
	opacity: 0.7;
	user-select: none;
}

.file-list .file:first-child {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
}
.file-list .file:last-child {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
}

.key-info-detail-item {
	background-color: var(--bg-low);
	padding: 12px 16px;
	border-radius: 4px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 4px;
}

.key-info-detail-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--fg-mid);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	user-select: none;
}

.key-info-detail-value {
	font-size: 13px;
	color: var(--fg-high);
}
