body {
	margin: 0;
	background-color: #0d1b3e;
	background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
	background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
	background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
	font-family: 'Trebuchet MS', Verdana, Arial;
	font-weight: normal;
	font-size: 20px;
	overflow: hidden;
}
canvas{
	position:absolute;
	top:0; left:0;
}

#canvasses {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
#canvasses[fullscreen=yes] {
	width: 100%;
	height: 100%;
}
#canvasses[cursor=ink]{
	cursor: url('cursors/ink.png') 0 30, auto;
}
#canvasses[cursor=drag]{
	cursor: url('cursors/drag.png') 15 15, auto;
}
#canvasses[cursor=erase]{
	cursor: url('cursors/erase.png') 5 25, auto;
}
#canvasses[cursor=label]{
	cursor: url('cursors/label.png') 15 15, auto;
}



/**********
 TOP BAR
**********/

#topbar {
	position: absolute;
	top: 15px;
	left: 50%;
	transform: translateX(-50%);
	height: 50px;
	background-color: #0d1b3e;
	border: 1px solid rgba(245, 230, 200, 0.5);
	border-radius: 0px;
	display: inline-flex;
	align-items: center;
	padding: 0 10px;
	box-sizing: border-box;
	gap: 12px;
	z-index: 20;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

#causal_studio_logo_link {
	position: absolute;
	top: 15px;
	left: 25px;
	z-index: 20;
	cursor: pointer;
}

#causal_studio_logo {
	height: 50px;
	width: auto;
	display: block;
}

#rmit_logo_topright {
	position: absolute;
	top: 15px;
	right: 30px;
	height: 70px;
	width: auto;
	z-index: 20;
	pointer-events: none;
}

#topbar_appname {
	color: rgba(245, 230, 200, 0.6);
	font-size: 13px;
	font-weight: 100;
	white-space: nowrap;
	flex-shrink: 0;
}

#topbar_project_box {
	display: flex;
	align-items: center;
	gap: 6px;
	border: 1px solid rgba(245, 230, 200, 0.5);
	border-radius: 0px;
	padding: 0 8px;
	height: 36px;
	flex-shrink: 0;
}

#topbar_project_box > div {
	display: flex;
	align-items: center;
}

#topbar_title {
	background: transparent;
	border: none;
	outline: none;
	color: #f5e6c8;
	font-size: 14px;
	font-weight: bold;
	font-family: 'Trebuchet MS', Verdana, Arial;
	width: 140px;
	-webkit-user-select: text;
	-moz-user-select: text;
	user-select: text;
	pointer-events: all;
}

	#topbar_title::placeholder {
		color: rgba(245, 230, 200, 0.4);
	}

#topbar_unit {
	background: transparent;
	border: none;
	outline: none;
	color: rgba(245, 230, 200, 0.8);
	font-size: 12px;
	font-weight: 100;
	font-family: 'Trebuchet MS', Verdana, Arial;
	width: 50px;
	-webkit-user-select: text;
	-moz-user-select: text;
	user-select: text;
	pointer-events: all;
}

	#topbar_unit::placeholder {
		color: rgba(245, 230, 200, 0.4);
	}

#topbar_actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

.top_button {
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0px;
	cursor: pointer;
	color: rgba(245, 230, 200, 0.75);
	font-size: 20px;
	transition: background 0.15s;
	flex-shrink: 0;
}

	.top_button:hover {
		background: rgba(245, 230, 200, 0.1);
		color: #f5e6c8;
	}



/**********
 BOTTOM BAR
**********/

#bottombar {
	position: absolute;
	bottom: 55px;
	left: 50%;
	transform: translateX(-50%);
	height: 56px;
	padding: 0 10px;
	background-color: #0d1b3e;
	border: 1px solid rgba(245, 230, 200, 0.5);
	border-radius: 0px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	z-index: 10;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

#tool_buttons {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-right: 0px;
}

#play_buttons {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bottom_button {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0;
	cursor: pointer;
	color: rgba(245, 230, 200, 0.85);
	font-size: 24px;
	border: none;
	transition: background 0.15s;
}

	.bottom_button:hover {
		background: rgba(245, 230, 200, 0.1);
		border-color: rgba(245, 230, 200, 0.5);
	}

	.bottom_button[selected=yes] {
		background: rgba(245, 230, 200, 0.15);
		border-color: rgba(245, 230, 200, 0.7);
		color: #f5e6c8;
	}

	.bottom_button.faded {
		opacity: 0.3;
		pointer-events: none;
	}


#speedbar {
	position: absolute;
	bottom: 38px;
	left: 50%;
	transform: translateX(-50%);
	height: 16px;
	min-width: max-content;
	width: auto;
	padding: 0 16px;
	background-color: #0d1b3e;
	border: 1px solid rgba(245, 230, 200, 0.5);
	border-radius: 0px;
	display: none; /* hidden in edit mode */
	align-items: center;
	gap: 8px;
	z-index: 10;
	box-sizing: border-box;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

	#speedbar.visible {
		display: inline-flex;
	}

#speedbar_label_slow {
	color:rgba(45, 191, 255, 0.8);
	font-size: 20px;
	cursor: default;
}

#speedbar_label_fast {
	color: rgba(45, 191, 255, 0.8);
	font-size: 20px;
	cursor: default;
}

#speed_slider {
	-webkit-appearance: none;
	appearance: none;
	flex: 1;
	height: 2px;
	border-radius: 0px;
	background: transparent;
	outline: none;
	cursor: pointer;
}

	#speed_slider::-webkit-slider-thumb {
		-webkit-appearance: none;
		appearance: none;
		width: 56px;
		height: 10px;
		background: rgba(245, 230, 200, 0.85);
		cursor: pointer;
		clip-path: polygon(10% 0%, 90% 0%, 100% 50%, 90% 100%, 10% 100%, 0% 50%);
	}

	#speed_slider::-moz-range-thumb {
		width: 30px;
		height: 8px;
		border-radius: 0px;
		background: rgba(245, 230, 200, 0.85);
		cursor: pointer;
		border: none;
	}



#year_counter {
	position: absolute;
	top: 28px;
	right: 200px;
	color: rgba(245, 230, 200, 0.85);
	font-size: 24px;
	font-weight: 100;
	pointer-events: none;
	white-space: nowrap;
	display: none;
}

/**********
 PROPERTIES PANEL
**********/

#propspanel {
	position: absolute;
	bottom: 125px;
	left: 50%;
	transform: translateX(-50%) translateY(0);
	height: 50px;
	padding: 0 10px;
	background-color: #0d1b3e;
	border: 1px solid rgba(245, 230, 200, 0.5);
	border-radius: 0px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	z-index: 10;
	transition: transform 0.2s ease, opacity 0.2s ease;
	opacity: 1;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

#propspanel.panel_hidden {
	transform: translateX(-50%) translateY(20px);
	opacity: 0;
	pointer-events: none;
}

#propspanel > .props_section > div[data-tooltip] {
	display: flex;
	align-items: center;
}

.props_section {
	display: flex;
	align-items: center;
	gap: 10px;
}

#propspanel input[type="text"],
#propspanel input[type="number"] {
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(245,230,200,0.5);
	border-radius: 0px;
	color: #f5e6c8;
	font-size: 13px;
	padding: 4px 8px;
	outline: none;
	height: 35px;
	box-sizing: border-box;
	-webkit-user-select: text;
	-moz-user-select: text;
	user-select: text;
	pointer-events: all;
}

#propspanel textarea {
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(245,230,200,0.5);
	border-radius: 0px;
	color: #f5e6c8;
	font-size: 13px;
	font-family: 'Trebuchet MS', Verdana, Arial;
	padding: 4px 8px;
	outline: none;
	box-sizing: border-box;
	-webkit-user-select: text;
	-moz-user-select: text;
	user-select: text;
	pointer-events: all;
	line-height: 1.4;
}

	#propspanel input[type="text"]::placeholder,
	#propspanel input[type="number"]::placeholder {
		color: rgba(245,230,200,0.4);
	}

#prop_colors {
	display: flex;
	gap: 5px;
	align-items: center;
}

.color_dot {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	cursor: pointer;
	border: 2px solid transparent;
	transition: border-color 0.1s;
}

	.color_dot[selected=yes] {
		border-color: #f5e6c8;
	}

#prop_nodetype,
#prop_strength {
	display: flex;
	gap: 4px;
}

.props_toggle {
	padding: 4px 8px;
	border-radius: 0px;
	font-size: 12px;
	cursor: pointer;
	color: rgba(245,230,200,0.6);
	border: 1px solid rgba(245,230,200,0.2);
	transition: background 0.1s;
}

	.props_toggle[selected=yes] {
		background: rgba(245,230,200,0.9);
		color: #0d1b3e;
		border-color: rgba(245,230,200,1);
		font-weight: bold;
	}

	.props_toggle:hover {
		background: rgba(245,230,200,0.08);
	}

	.props_toggle[selected=yes]:hover {
		background: rgba(245,230,200,0.9);
		color: #0d1b3e;
	}

.props_check {
	display: flex;
	align-items: center;
	gap: 4px;
	color: rgba(245,230,200,0.7);
	font-size: 12px;
	cursor: pointer;
	pointer-events: all;
}

	.props_check input[type="checkbox"] {
		pointer-events: all;
		cursor: pointer;
	}

.props_btn_delete {
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0px;
	cursor: pointer;
	color: rgba(255,100,100,0.7);
	font-size: 18px;
	border: 1px solid rgba(255,100,100,0.3);
	transition: background 0.1s;
}

	.props_btn_delete:hover {
		background: rgba(255,100,100,0.15);
		color: #ff6464;
	}



/**********
 MODAL
**********/

#modal_container {
	display: none;
	position: absolute;
	width: 100%;
	height: 100%;
	z-index: 50;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

	#modal_container[show=yes] {
		display: block;
	}

#modal_bg {
	position: absolute;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
}

#modal {
	position: absolute;
	top: 80px;
	right: 20px;
	bottom: 140px;
	width: 340px;
	background: #0d1b3e;
	border: 1px solid rgba(245, 230, 200, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
#modal[wide=yes] {
	right: auto;
	left: 50%;
	transform: translateX(-50%);
	width: 80%;
	max-width: 900px;
}

#modal_header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	height: 50px;
	border-bottom: 1px solid rgba(245, 230, 200, 0.2);
	flex-shrink: 0;
}

#modal_title {
	color: #f5e6c8;
	font-size: 16px;
	font-weight: bold;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

#modal_close {
	color: rgba(245, 230, 200, 0.6);
	font-size: 18px;
	cursor: pointer;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.1s, background 0.1s;
}

	#modal_close:hover {
		color: #f5e6c8;
		background: rgba(245, 230, 200, 0.1);
	}

#modal_page {
	flex: 1;
	overflow-y: auto;
	padding: 10px 20px 20px 20px;
	color: #f5e6c8;
	font-size: 15px;
	font-weight: 100;
	background: #0d1b3e;
}

	#modal_page::-webkit-scrollbar {
		width: 6px;
	}

	#modal_page::-webkit-scrollbar-track {
		background: rgba(245, 230, 200, 0.05);
	}

	#modal_page::-webkit-scrollbar-thumb {
		background: rgba(245, 230, 200, 0.2);
	}

#modal iframe {
	border: none;
}

/* Modal content styles */
.modal_section_header {
	color: rgba(245, 230, 200, 0.5);
	font-size: 11px;
	font-weight: bold;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 15px 0 8px 0;
	border-bottom: 1px solid rgba(245, 230, 200, 0.1);
	margin-bottom: 2px;
	text-align: center;
}

.modal_link {
	display: block;
	padding: 0 0 10px 0;
	color: #f5e6c8;
	text-decoration: none;
	border-bottom: 1px solid rgba(245, 230, 200, 0.08);
	font-size: 14px;
	text-align: center;
	transition: background 0.1s, padding-left 0.1s;
	cursor: pointer;
}

	.modal_link:hover {
		background: rgba(245, 230, 200, 0.06);
		padding-left: 8px;
		color: #fff;
	}

.modal_input {
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(245,230,200,0.3);
	color: #f5e6c8;
	font-size: 14px;
	padding: 8px 12px;
	width: 100%;
	box-sizing: border-box;
	outline: none;
	margin-bottom: 12px;
	font-family: 'Trebuchet MS', Verdana, Arial;
}

	.modal_input::placeholder {
		color: rgba(245,230,200,0.3);
	}

.modal_label {
	color: rgba(245,230,200,0.7);
	font-size: 13px;
	margin-bottom: 6px;
	display: block;
}

.modal_button {
	background: rgba(245,230,200,0.1);
	border: 1px solid rgba(245,230,200,0.3);
	color: #f5e6c8;
	font-size: 14px;
	padding: 8px 20px;
	cursor: pointer;
	font-family: 'Trebuchet MS', Verdana, Arial;
	transition: background 0.1s;
	text-decoration: none;
	display: inline-block;
}

	.modal_button:hover {
		background: rgba(245,230,200,0.2);
	}

.modal_output {
	background: rgba(0,0,0,0.3);
	border: 1px solid rgba(245,230,200,0.2);
	color: rgba(245,230,200,0.8);
	font-size: 12px;
	padding: 8px 12px;
	width: 100%;
	box-sizing: border-box;
	outline: none;
	font-family: monospace;
	cursor: text;
}

.modal_note {
	color: rgba(245,230,200,0.4);
	font-size: 12px;
	margin-top: 6px;
}

.modal_checkbox_label {
	display: flex;
	align-items: center;
	gap: 8px;
	color: rgba(245,230,200,0.8);
	font-size: 14px;
	cursor: pointer;
}


/**********
 CUSTOM TOOLTIPS
**********/

[data-tooltip] {
	position: relative;
}

	[data-tooltip]::after {
		content: attr(data-tooltip);
		position: absolute;
		bottom: calc(100% + 8px);
		left: 50%;
		transform: translateX(-50%);
		background: rgba(13, 27, 62, 0.95);
		color: #f5e6c8;
		font-size: 12px;
		font-weight: 100;
		white-space: nowrap;
		padding: 5px 10px;
		border-radius: 0px;
		border: 1px solid rgba(245, 230, 200, 0.3);
		pointer-events: none;
		opacity: 0;
		transition: opacity 0.1s ease;
		z-index: 100;
	}

	[data-tooltip]:hover::after {
		opacity: 1;
	}
	/* Arrow pointing down */
	[data-tooltip]::before {
		content: '';
		position: absolute;
		bottom: calc(100% + 2px);
		left: 50%;
		transform: translateX(-50%);
		border: 5px solid transparent;
		border-top-color: rgba(245, 230, 200, 0.3);
		pointer-events: none;
		opacity: 0;
		transition: opacity 0.1s ease;
		z-index: 100;
	}

	[data-tooltip]:hover::before {
		opacity: 1;
	}
/* Tooltip below for items near top of screen */
[data-tooltip-pos="down"]::after {
	bottom: auto;
	top: calc(100% + 8px);
}

[data-tooltip-pos="down"]::before {
	bottom: auto;
	top: calc(100% + 2px);
	border-top-color: transparent;
	border-bottom-color: rgba(245, 230, 200, 0.3);
}


/**********
 Credit text
**********/
#credit_text {
	position: fixed;
	bottom: 8px;
	left: 12px;
	color: rgba(245, 230, 200, 0.35);
	font-size: 18px;
	font-weight: 100;
	pointer-events: all;
	cursor: pointer;
	z-index: 5;
}

	#credit_text:hover {
		color: rgba(245, 230, 200, 0.7);
	}

/* Hide number input spinners */
#propspanel input[type="number"]::-webkit-inner-spin-button,
#propspanel input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
#propspanel input[type="number"] {
	-moz-appearance: textfield;
}


/**********
 INLINE LABEL EDITOR
**********/

#label_editor_overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 15;
	pointer-events: none;
}

#label_editor {
	position: absolute;
	background: rgba(13, 27, 62, 0.85);
	border: 1px solid rgba(245, 230, 200, 0.5);
	color: rgba(245, 230, 200, 0.85);
	font-family: 'Trebuchet MS', Verdana, Arial;
	font-weight: 100;
	text-align: center;
	padding: 6px 10px;
	outline: none;
	resize: vertical;
	overflow-y: auto;
	box-sizing: border-box;
	pointer-events: all;
	line-height: 1.0;
	z-index: 16;
	max-height: 80vh;
}

	#label_editor::-webkit-scrollbar {
		width: 6px;
	}

	#label_editor::-webkit-scrollbar-track {
		background: rgba(245, 230, 200, 0.05);
	}

	#label_editor::-webkit-scrollbar-thumb {
		background: rgba(245, 230, 200, 0.3);
		border-radius: 3px;
	}

		#label_editor::-webkit-scrollbar-thumb:hover {
			background: rgba(245, 230, 200, 0.5);
		}

/* Firefox scrollbar styling */
#label_editor {
	scrollbar-width: thin;
	scrollbar-color: rgba(245, 230, 200, 0.3) rgba(245, 230, 200, 0.05);
}