@layer base {
/*Defaults*/
	div.tool.wide {
		width: 72px;
		padding: 1px 0;
	}
	.hidden, .tooltip_shift, .custom_select ul, .mobile_only, .m_disp {
		display: none;
	}
	div.selection_only {
		visibility: hidden;
	}
	a.open-in-browser {
		cursor: pointer;
	}
	.f_left {
		float: left;
	}
	.f_right {
		float: right !important;
	}
	.i_b {
		display: inline-block;
	}
	label.inline_label {
		padding-left: 8px;
		padding-right: 8px;
		padding-top: 2px;
	}
	.progress_bar {
		background-color: var(--color-back);
		height: 18px;
		margin-top: 12px;
		border-radius: 10px;
	}
	.progress_bar_inner {
		background-color: var(--color-accent);
		height: 100%;
		width: calc(100% * var(--progress));
		border-radius: inherit;
	}
	.accent_color {
		color: var(--color-accent);
		font-weight: normal; 
	}
	.slash {
		color: var(--color-light);
		padding-left: 3px;
		padding-right: 3px;
		font-weight: normal; 
		display: inline-block;
	}
	code, .code {
		font-family: var(--font-code);
	}
	.code {
		font-size: 16px;
		tab-size: 4;
	}
	textarea.code {
		padding: 5px;
	}
	.small_text {
		font-size: 0.94em;
	}
	.subtle {
		color: var(--color-subtle_text);
	}
	.color_x {
		color: var(--color-axis-x);
	}
	.color_y {
		color: var(--color-axis-y);
	}
	.color_z {
		color: var(--color-axis-z);
	}
	.color_u {
		color: var(--color-axis-u);
	}
	.color_v {
		color: var(--color-axis-v);
	}
	.color_w {
		color: var(--color-axis-w);
	}
	.button {
		display: inline-block;
		width: 30px;
		text-align: center;
		cursor: default;
	}
	.dark_bordered {
		height: 30px;
		padding-left: 4px;
		padding-top: 1px;
		background-color: var(--color-back);
		border: 1px solid var(--color-border);
		border-radius: 5px;
	}
	.input_wide {
		width: 100%;
		padding: 8px;
		height: 40px;
		padding-bottom: 5px;
	}
	input.medium_width {
		width: 64px;
	}
	.prism-editor-wrapper {
		padding-left: 4px;
		padding-top: 1px;
		background-color: var(--color-back);
		border: 1px solid var(--color-border);
		border-radius: 5px;
	}
	.prism-editor__autocomplete {
		background-color: var(--color-back);
		border: 1px solid var(--color-accent);
		z-index: 30;
	}
	.prism-editor__autocomplete li:hover {
		color: var(--color-light);
	}
	.prism-editor__autocomplete li.selected {
		background-color: var(--color-accent);
		color: var(--color-accent_text);
	}
	.checkerboard, .checkerboard_trigger .checkerboard_target {
		--color-checker_offset: rgba(0, 0, 0, 0.16);
		background-color: var(--color-checkerboard) !important;
		background-image: linear-gradient(45deg, var(--color-checkerboard) 25%, transparent 25%),
						  linear-gradient(-45deg, var(--color-checkerboard) 25%, transparent 25%),
						  linear-gradient(45deg, transparent 75%, var(--color-checkerboard) 75%),
						  linear-gradient(-45deg, var(--color-checker_offset) 75%, var(--color-checkerboard) 75%);
		background-size: 30px 30px;
		background-position: 0 0, 0 15px, 15px -15px, -15px 0px;
	}
	body[mode=start] div#center.checkerboard {
		background-image: none;
		background-color: var(--color-dark) !important;
	}

/*UI Elements*/
	div.preview {
		height: 100%;
		width: 100%;
		position: relative;
		cursor: inherit;
	}
	.preview > canvas {
		background-repeat: no-repeat;
	}
	div.preview.fixed_ratio {
		display: flex;
	}
	.preview.fixed_ratio > canvas {
		margin: auto;
		border-radius: 7px;
		border: 2px solid var(--color-grid);
	}
	.preview > .preview_perspective_label {
		position: absolute;
		width: fit-content;
		margin: auto;
		bottom: 4px;
		right: 0;
		left: 0;
		pointer-events: none;
		opacity: 0.5;
		text-transform: uppercase;
	}
	.preview .preview_menu {
		position: absolute;
		right: 3px;
		top: 2px;
		border-radius: 5px;
		background-color: var(--color-dark);
		display: flex;
	}
	.checkerboard .preview_menu {
		background-color: var(--color-checkerboard);
	}
	.preview .preview_menu .tool {
		width: 32px;
	}
	.preview .preview_menu .preview_main_menu > i {
		width: 20px;
	}
	.preview .preview_background_menu {
		background-size: cover;
		width: 30px;
	}
	.preview > canvas.selectable_cursor {
		cursor: copy;
	}
	#weight_brush_outline {
		--radius: 50;
		position: absolute;
		width: calc(var(--radius) * 2px);
		height: calc(var(--radius) * 2px);
		margin: calc(var(--radius) * -1px);
		border-radius: 50%;
		border: 1px dashed var(--color-light);
		pointer-events: none;
		z-index: 12;
	}
	.text_padding {
		margin-left: 5px;
		margin-right: 5px;
	}
	.toolbar_label {
		padding: 2px;
		margin-left: 4px;
	}
	.bar {
		height: 30px;
	}
	.bar > * {
		float: left;
	}
	.bar.flex {
		display: flex;
	}
	.bar.flex > * {
		float: none;
	}
	.bar.flex > label {
		flex-grow: 0;
	}
	.scroll_horizontal {
		overflow-x: scroll;
		overflow-y: hidden;
		height: 100%;
		scrollbar-width: none;
	}
	.scroll_horizontal ::-webkit-scrollbar {
		height: 0px;
	}
	.list {
		background-color: var(--color-back);
		overflow-y: scroll;
		flex-grow: 1;
		clear: both;
	}
	.list::-webkit-scrollbar-track {
		background: var(--color-back);
	}
	ul.list_style li {
		list-style: initial;
		margin-left: 20px;
	}
	#quick_message_box {
		position: absolute;
		margin-left: auto;
		margin-right: auto;
		left: 0;
		right: 0;
		top: 420px;
		z-index: 100;
		min-width: 150px;
		max-width: 250px;
		width: fit-content;
		padding: 0 12px;
		background-color: var(--color-bright_ui);
		color: var(--color-bright_ui_text);
		box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);;
		text-align: center;
		overflow-wrap: break-word;
		cursor: default;
		pointer-events: none;
	}
	@media (max-device-width: 640px) {
		#quick_message_box {
			bottom: 26px;
			top: unset;
			padding: 6px;
		}
	}
	#cursor_tooltip {
		position: absolute;
		z-index: 101;
		max-width: 250px;
		width: fit-content;
		line-height: 18px;
		padding: 2px 8px;
		margin-top: 10px;
		margin-left: 9px;
		background-color: var(--color-bright_ui);
		color: var(--color-bright_ui_text);
		box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);;
		overflow-wrap: break-word;
		white-space: pre-line;
		cursor: default;
		pointer-events: none;
	}
	.uv_message_box {
		position: absolute;
		margin-left: auto;
		margin-right: auto;
		z-index: 101;
		min-width: 100px;
		max-width: 200px;
		background-color: var(--color-bright_ui);
		color: var(--color-bright_ui_text);
		box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);;
		text-align: center;
		cursor: default;
		top: 40px;
		right: 0px;
		left: 0px;
		pointer-events: none;
	}
	.selection_rectangle {
		position: absolute;
		display: block;
		border: 1px solid var(--color-accent);
		background-color: rgba(40,50,60,0.5);
		pointer-events: none;
	}

	.annotation {
		min-width: 40px;
		max-width: 100%;
		width: max-content;
		position: absolute;
		text-align: center;
		background-color: var(--color-bright_ui);
		color: var(--color-bright_ui_text);
		padding: 3px 8px;
		pointer-events: none;
	}
	.annotation.transparent {
		background: transparent;
		font-weight: normal;
		font-size: 1.2em;
		padding: 0;
		margin: -4px;
		min-width: 15px;
		color: var(--color-light);
		text-shadow: 0 0 5px black;
	}
	.light_on_hover:hover {
		color: var(--color-light);
	}

	.elevated {
		background-color: var(--color-elevated);
		box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
		border-radius: 5px;
	}

	.spinning {
		-webkit-animation: spin 2s linear infinite;
		-moz-animation: spin 2s linear infinite;
		animation: spin 2s linear infinite;
	}
	@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
	@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
	@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }
/*Markdown*/
	.markdown h1 {
		margin: 8px 0 8px 0;
	}
	.markdown h2 {
		margin: 14px 0 8px 0;
	}
	.markdown p {
		margin: 12px 0;
	}
	.markdown li {
		list-style: initial;
		cursor: inherit;
		margin: 8px 0;
	}
	.markdown li > p,
	.markdown h2 > p,
	.markdown h3 > p {
		margin: 0;
	}
	.markdown ul {
		padding-left: 24px;
	}
	.markdown ol {
		padding-left: 24px;
	}
	.markdown ol li {
		list-style: auto;
	}
	.markdown a {
		cursor: pointer;
	}
	.markdown pre {
		border: 1px solid var(--color-border);
		background: var(--color-back);
		font-family: var(--font-code);
		padding: 6px 10px;
		clear: both;
		cursor: text;
		user-select: text;
		-webkit-user-select: text;
		overflow: auto;
	}
	.markdown pre code {
		user-select: text;
		-webkit-user-select: text;
	}
	blockquote {
		border-left: 4px solid var(--color-accent);
		padding: 4px;
		padding-left: 16px;
		background: var(--color-back);
	}
	.markdown table {
		border: 1px solid var(--color-border);
		background: var(--color-back);
	}
	.markdown th {
		padding: 4px;
	}
	.markdown td {
		padding: 3px 4px;
		border-top: 1px solid var(--color-border);
	}
	.markdown img {
		image-rendering: auto;
		max-width: 100%;
	}

/*Actions*/
	.toolbar {
		width: 100%;
		overflow: hidden;
		flex-shrink: 0;
	}
	.toolbar > .content {
		display: flex;
		flex-wrap: wrap;
	}
	div.toolbar_wrapper {
		float: none;
	}
	.toolbar_wrapper.narrow > .toolbar {
		width: fit-content;
		display: flex;
		flex-direction: row-reverse;
		justify-content: space-between;
		height: 100%;
	}
	body.is_mobile .toolbar_wrapper.narrow > .toolbar:not(.vertical) {
		width: 100%;
	}
	.toolbar_wrapper > .toolbar.no_wrap {
		width: fit-content;
		display: flex;
		flex-flow: row-reverse;
		flex-wrap: nowrap;
		height: 100%;
	}
	.toolbar_wrapper > .toolbar.no_wrap > .content {
		height: 100%;
		overflow: hidden;
		flex-grow: 1;
	}
	.toolbar_wrapper > .toolbar.vertical {
		width: 40px;
		flex-direction: column-reverse;
	}
	.toolbar_wrapper > .toolbar.vertical .tool {
		height: 36px;
		width: 40px;
		padding: 2px;
	}
	.toolbar > .tool.toolbar_menu {
		float: right;
		width: 12px;
		color: var(--color-subtle_text);
	}
	.toolbar.vertical .toolbar_menu {
		height: 24px;
		padding: 0;
	}
	.toolbar > .tool.toolbar_menu > i {
		width: 16px;
		margin-left: -5px;
		font-size: 20px;
		margin-top: 5px;
	}
	.toolbar.vertical > .tool.toolbar_menu > i {
		width: auto;
		margin-right: auto;
		margin-left: auto;
	}
	.toolbar_overflow_popup {
		background-color: var(--color-ui);
		position: absolute;
		display: flex;
		flex-wrap: wrap;
		max-width: 180px;
		z-index: 20;
		box-shadow: 0 0px 8px rgba(0, 0, 0, 0.64);
	}
	.toolbar_overflow_dummy {
		height: 30px;
		width: 38px;
	}
	.tool {
		height: 30px;
		width: 36px;
		margin-left: 1px;
		margin-right: 1px;
		background: transparent;
		display: inline-block;
		text-align: center;
		vertical-align: middle;
		cursor: default;
		float: left;
		color: var(--color-text);
		flex-shrink: 0;
		cursor: pointer;
	}
	.tool i {
		display: block;
		margin: 4px auto;
	}
	.tool:active > .icon {
		padding-top: 1px;
	}
	.tool:active > .icon.fa_big {
		padding-top: 2px;
	}
	img.icon {
		height: 26px;
		image-rendering: pixelated;
	}

	.tool.widget {
		width: auto;
		padding: 0;
	}
	.tool.widget.bar_text {
		padding: 2px;
	}
	.tool.has_label {
		width: auto;
	}

	.tool:hover {
		color: var(--color-light);
	}
	.tool.right_tool {
		position: relative;
	}
	.tool.enabled {
		background: var(--color-accent);
		border-radius: 4px;
		color: var(--color-accent_text);
	}

	.placeholder {
		width: 20px;
		height: 10px;
		float: left;
	}
	.toolbar .toolbar_separator.border {
		width: 2px;
		height: 24px;
		float: left;
		background-color: var(--color-border);
		margin: 4px;
		margin-bottom: 0;
	}
	.toolbar .toolbar_separator.spacer {
		background: transparent;
		flex-grow: 1;
	}
	.toolbar .toolbar_separator.linebreak {
		display: block;
		float: left;
		width: 100%;
		height: 0;
		margin: 0;
	}
	.text_button:hover {
		color: var(--color-light);
	}
	.bar_select_wrapper {
		position: relative;
	}
	.bar_select:hover {
		color: var(--color-light);
	}
	.bar_select select {
		padding-right: 24px;
		width: 100%;
	}
	.bar_select .bar_select_wrapper::before {
		content: "\f0d7";
		font-family: 'Font Awesome 6 Free';
		font-weight: 900;
		display: block;
		position: absolute;
		height: 12px;
		width: 16px;
	    pointer-events: none;
	    right: 6px;
	    top: 3px;
	}
	.half {
		display: inline-block;
		width: calc(50% - 4px);
	}
	.tooltip {
		position: absolute;
		height: 28px;
		width: fit-content;
		padding-left: 6px;
		padding-right: 6px;
		padding-top: 1px;
		background: var(--color-bright_ui);
		color: var(--color-bright_ui_text);
		margin-top: 30px;
		white-space: nowrap;
		z-index: 20;
		box-shadow: 0 0.4px 3.5px rgba(0, 0, 0, 0.6);
		border-radius: 4px;
		pointer-events: none;
		visibility: hidden;
	}
	.tool:hover > .tooltip {
		visibility: visible;
	}
	.tooltip_shift {
		display: none;
	}
	.tooltip_description {
		position: absolute;
		background-color: var(--color-ui);
		color: var(--color-text);
		border: 1px solid var(--color-bright_ui);
		padding: 2px 6px;
		margin-top: 1px;
		font-size: 0.84em;
		margin-left: -5px;
		opacity: 0;
	}
	.tool:hover > .tooltip .tooltip_description {
		transition-property: opacity;
		transition-duration: 200ms;
		transition-delay: 600ms;
		opacity: 1;
	}
	.tool.bar_select.icon_mode {
		padding: 0 4px;
		background-color: var(--color-button);
		border-radius: 5px;
	}
	.tool.bar_select .select_option {
		float: left;
		width: 28px;
		height: 100%;
		border-radius: 4px;
		color: var(--color-text);
	}
	.tool.bar_select .select_option:hover {
		color: var(--color-light);
	}
	.tool.bar_select .select_option.selected {
		background: var(--color-accent);
		color: var(--color-accent_text);
	}
	.tool.bar_select .select_option:active {
		padding-top: 1px;
	}
	.tool.bar_select .select_option .icon {
		transform: scale(0.86);
	}
	.tool.bar_select .select_option[key=vertex] .icon {
		transform: scale(0.6);
	}

	.tool.side_menu_tool {
		width: 48px;
	}
	.tool.side_menu_tool i.icon {
		display: block;
		margin-left: 6px;
		float: left;
	}
	.tool.side_menu_tool i.icon.action_more_options {
		display: inline-block;
		width: 20px;
		height: 100%;
		margin-top: 0;
		padding-top: 4px;
		color: var(--color-text);
		margin-left: 0;
	}
	.tool.side_menu_tool i.icon.action_more_options:hover {
		color: inherit;
	}
	.toolbar.vertical .tool.side_menu_tool {
		height: 54px;
	}
	.toolbar.vertical .tool.side_menu_tool > .action_more_options {
		max-width: 48px;
		text-align: center;
		width: 100%;
		margin-top: 0px;
		padding-top: 0px;
	}

/*(Context-)Menu*/
	.contextMenu {
		position: absolute;
		display: block;
		height: auto;
		width: fit-content;
		min-width: 145px;
		background-color: var(--color-bright_ui);
		color: var(--color-bright_ui_text);
		z-index: 30;
		box-shadow: 0.4px 0.4px 4px rgba(0, 0, 0, 0.7);
		border-radius: 6px;
		cursor: default;
		white-space: nowrap;
	}
	.contextMenu.sub {
		display: none;
		margin-top: -4px;
	}
	.contextMenu.scrollable {
		max-height: min(800px, 100vh);
		overflow: auto;
	}
	.contextMenu li {
		display: flex;
		height: 30px;
		padding: 4px;
		padding-left: 34px;
		padding-right: 8px;
	}
	.contextMenu li:first-of-type {
		border-top-left-radius: inherit;
		border-top-right-radius: inherit;
	}
	.contextMenu li:last-of-type {
		border-bottom-left-radius: inherit;
		border-bottom-right-radius: inherit;
	}
	.contextMenu li.parent {
		padding-right: 20px;
	}
	.contextMenu li.parent::after {
		content: "\f105";
		display: block;
		font-family: 'Font Awesome 6 Free';
		font-weight: 900;
		font-size: inherit;
		text-rendering: auto;
		-webkit-font-smoothing: antialiased;
		margin-right: -12px;
		margin-left: 6px;
		margin-top: -1px;
		pointer-events: none;
	}
	.contextMenu li.enabled {
		padding-left: 29px;
		border-left: 5px solid var(--color-accent);
	}
	.contextMenu li.focused,
	.contextMenu li.parent.opened {
		background-color: var(--color-accent);
		color: var(--color-accent_text);
	}
	.contextMenu li.hybrid_parent.opened {
		background-color: transparent;
	}
	.contextMenu li > i {
		margin-top: 1px; 
		margin-right: 4px;
		margin-left: -28px;
		pointer-events: none;
	}
	.contextMenu li > img {
		cursor: default;
		height: 20px;
		width: 20px;
		color: var(--color-text);
		white-space: nowrap;
		margin-bottom: -3px;
		margin-left: -27px;
		margin-right: 5px;
		margin-top: 1px;
	}
	.contextMenu li > span {
		pointer-events: none;
		flex: 1 0 auto;
	}
	.contextMenu li.marked > span {
		text-decoration: underline;
	}
	.contextMenu li.parent.focused > .contextMenu.sub {
		display: block;
	}
	.contextMenu li.hybrid_parent.opened > .contextMenu.sub {
		display: block;
	}
	.contextMenu li.opened > .contextMenu.sub {
		display: block;
	}
	.contextMenu .menu_more_button {
		width: 28px;
		margin: -4px -8px -4px 2px;
		padding: 4px 0;
		text-align: center;
		border-radius: 5px;
	}
	.contextMenu .menu_more_button:hover,
	.hybrid_parent.opened .menu_more_button {
		background-color: var(--color-accent);
		color: var(--color-accent_text);
	}
	.contextMenu .menu_more_button > * {
		pointer-events: none;
	}
	li.menu_separator {
		height: 2px;
		width: 100%;
		padding: 0;
		background-color: var(--color-menu_separator);
	}
	li.menu_separator.has_label {
		margin-top: 12px;
		margin-bottom: 6px;
	}
	li.menu_separator.has_label > label {
		background-color: var(--color-bright_ui);
		color: color-mix(in srgb, var(--color-bright_ui_text) 70%, transparent);
		margin-top: -12px;
		margin-left: 12px;
		padding: 0 5px;
		height: 20px;
	}
	.contextMenu li.highlighted {
		animation: menu_item_highlight 1s infinite ease-in-out;
	}
	@keyframes menu_item_highlight {
		0% {
			background-color: transparent;
		}
		50% {
			background-color: var(--color-accent);
		}
		100% {
			background-color: transparent;
		}
	}
	.contextMenu .menu_search_bar {
		padding: 0;
		display: flex;
		position: sticky;
		top: 0;
		background-color: inherit;
		border-bottom: 2px solid var(--color-menu_separator);
	}
	.menu_search_bar > input {
		color: inherit;
		padding: 6px;
		flex-grow: 1;
		height: auto;
	}
	.menu_search_bar > div {
		width: 30px;
		text-align: center;
		padding-top: 2px;
	}
	.menu_search_bar > div > * {
		pointer-events: none;
		vertical-align: middle;
	}

	.keybinding_label {
		pointer-events: none;
		font-size: 0.84em;
		padding: 2px 0 2px 8px;
		opacity: 0.6;
		flex-grow: 0;
		flex-shrink: 0;
	}

/* Theme Borders */
	body.theme_borders .contextMenu,
	body.theme_borders dialog,
	body.theme_borders #start_screen > content,
	body.theme_borders #quick_message_box,
	body.theme_borders action_selector > #action_selector_list,
	body.theme_borders .plugins_suggested_row > ul > li
	{
		border: 1px solid var(--color-border);
	}
	body.theme_borders #start_screen section {
		border-bottom: 1px solid var(--color-border);
	}
	body.theme_borders .panel {
		margin-top: -1px;
		border-top: 01px solid var(--color-border);
	}
	body.theme_borders #right_bar {
		border-left: 1px solid var(--color-border);
	}
	body.theme_borders #left_bar {
		border-right: 1px solid var(--color-border);
	}
	body.theme_borders .preview .preview_menu {
		right: 0;
	}
	body.theme_borders .dialog_sidebar {
		border-right: 1px solid var(--color-border);
	}
	body.theme_borders .dialog_handle {
		border-bottom: 1px solid var(--color-border);
	}
	body.theme_borders .dialog_close_button {
		right: -1px;
		top: -1px;
		height: 34px;
	}
	body.theme_borders li.animation_file {
		border-top: 1px solid var(--color-border);
	}
	body.theme_borders #main_toolbar, body.theme_borders #tab_bar {
		border-bottom: 1px solid var(--color-border);
	}
	body.theme_borders #status_bar {
		border-top: 1px solid var(--color-border);
	}
	body.theme_borders .contextMenu li.menu_separator {
		background-color: var(--color-border);
		height: 1px;
		padding: 0;
		opacity: 1;
	}
	body.theme_borders #animation_controllers_wrapper .controller_state {
		border-color: var(--color-border);
	}
}