body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

#controls, #toolbar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  background: white;
  padding: 6px;
}

#toolbar {
  top: 40px; /* adjust based on height of controls */
}

#toolbar button.active-mode {
  background-color: #4CAF50;
  color: white;
  border: 2px solid #2e7d32;
}

#toolbar {
  display: flex;
  padding: 1px;
  margin-left: 10px;
  background: #f0f0f0;
  border-bottom: 1px solid #ccc;
}

#toolbar button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background-color: #e0e0e0;
  color: #333;
  font-size: 16px;
  cursor: pointer;
  border-radius: 0;
  outline: none;
}

#toolbar button + button {
  margin-left: 0; /* no space between buttons */
}

#toolbar button.active {
  background-color: #b0b0b0; /* darker gray */
  font-weight: normal;
}

.submenu {
  display: flex;
  gap: 0px;
  margin-top: 2px;
}

.submenu button {
  padding: 8px 16px;
  border: none;
  background-color: #ddd;
  cursor: pointer;
  font-size: 14px;
}

.submenu button.active {
  background-color: #bbb !important;
}

.hidden {
  display: none !important;
}

#drawOptions {
  position: absolute;
  top: 80px; /* toolbar (40px) + its padding (~40px total) */
  left: 10px;
  z-index: 9;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  padding: 2px;
}


#fittingOptions {
  position: absolute;
  top: 120px;
  left: 10px;
  display: flex;
  gap: 6px;
  background: white;
  padding: 4px;
  border: 1px solid #ccc;
  z-index: 11;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#fittingOptions button.elbow-btn {
  background-color: white;
  border: 2px solid #ccc;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
}

#fittingOptions button.elbow-btn.active {
  background-color: rgba(224, 245, 255, 0.9) !important;
  border-color: #007acc;
  box-shadow: 0 0 4px #007acc;
}


#fittingOptions button.elbow-btn img {
  width: 32px;
  height: 32px;
  pointer-events: none; /* ensures full button is clickable */
  display: block;
}




#ductOptions {
  position: absolute;
  top: 120px;
  left: 10px;
  display: flex;
  gap: 6px;
  background: white;
  padding: 4px;
  border: 1px solid #ccc;
  z-index: 11;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#ductOptions button.duct-btn {
  background-color: white;
  border: 2px solid #ccc;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
}

#ductOptions button.duct-btn.active {
  background-color: rgba(224, 245, 255, 0.9) !important;
  border-color: #007acc;
  box-shadow: 0 0 4px #007acc;
}


#ductOptions button.duct-btn img {
  width: 32px;
  height: 32px;
  pointer-events: none; /* ensures full button is clickable */
  display: block;
}




#unitOptions {
  position: absolute;
  top: 120px;
  left: 10px;
  display: flex;
  gap: 6px;
  background: white;
  padding: 4px;
  border: 1px solid #ccc;
  z-index: 11;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#unitOptions button.unit-btn {
  background-color: white;
  border: 2px solid #ccc;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
}

#unitOptions button.unit-btn.active {
  background-color: rgba(224, 245, 255, 0.9) !important;
  border-color: #007acc;
  box-shadow: 0 0 4px #007acc;
}


#unitOptions button.unit-btn img {
  width: 32px;
  height: 32px;
  pointer-events: none; /* ensures full button is clickable */
  display: block;
}





#termUnitOptions {
  position: absolute;
  top: 120px;
  left: 10px;
  display: flex;
  gap: 6px;
  background: white;
  padding: 4px;
  border: 1px solid #ccc;
  z-index: 11;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#termUnitOptions button.termunit-btn {
  background-color: white;
  border: 2px solid #ccc;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
}

#termUnitOptions button.termunit-btn.active {
  background-color: rgba(224, 245, 255, 0.9) !important;
  border-color: #007acc;
  box-shadow: 0 0 4px #007acc;
}


#termUnitOptions button.termunit-btn img {
  width: 32px;
  height: 32px;
  pointer-events: none; /* ensures full button is clickable */
  display: block;
}




#fanOptions {
  position: absolute;
  top: 120px;
  left: 10px;
  display: flex;
  gap: 6px;
  background: white;
  padding: 4px;
  border: 1px solid #ccc;
  z-index: 11;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#fanOptions button.fan-btn {
  background-color: white;
  border: 2px solid #ccc;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
}

#fanOptions button.fan-btn.active {
  background-color: rgba(224, 245, 255, 0.9) !important;
  border-color: #007acc;
  box-shadow: 0 0 4px #007acc;
}


#fanOptions button.fan-btn img {
  width: 32px;
  height: 32px;
  pointer-events: none; /* ensures full button is clickable */
  display: block;
}



#distributionOptions {
  position: absolute;
  top: 120px;
  left: 10px;
  display: flex;
  gap: 6px;
  background: white;
  padding: 4px;
  border: 1px solid #ccc;
  z-index: 11;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#distributionOptions button.distribution-btn {
  background-color: white;
  border: 2px solid #ccc;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
}

#distributionOptions button.distribution-btn.active {
  background-color: rgba(224, 245, 255, 0.9) !important;
  border-color: #007acc;
  box-shadow: 0 0 4px #007acc;
}


#distributionOptions button.distribution-btn img {
  width: 32px;
  height: 32px;
  pointer-events: none; /* ensures full button is clickable */
  display: block;
}



#controlOptions {
  position: absolute;
  top: 120px;
  left: 10px;
  display: flex;
  gap: 6px;
  background: white;
  padding: 4px;
  border: 1px solid #ccc;
  z-index: 11;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#controlOptions button.control-btn {
  background-color: white;
  border: 2px solid #ccc;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
}

#controlOptions button.control-btn.active {
  background-color: rgba(224, 245, 255, 0.9) !important;
  border-color: #007acc;
  box-shadow: 0 0 4px #007acc;
}


#controlOptions button.control-btn img {
  width: 32px;
  height: 32px;
  pointer-events: none; /* ensures full button is clickable */
  display: block;
}



#rotationMenu {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  padding: 5px;
  display: inline-block; /* Change from flex to inline-block to allow stacked divs */
  z-index: 999;
}

#rotationMenu.hidden {
  display: none;
}

#rotationMenu > div {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

#rotationMenu > div:last-child {
  justify-content: center;
  margin-bottom: 0;
}




#ductMenu {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  padding: 5px;
  display: inline-block; /* Change from flex to inline-block to allow stacked divs */
  z-index: 999;
}

#ductMenu.hidden {
  display: none;
}

#ductMenu > div {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

#ductMenu > div:last-child {
  justify-content: center;
  margin-bottom: 0;
}




#sidePanel {
  position: fixed;
  top: 0;
  right: 0;
  width: 15%;
  height: 100%;
  background-color: #f4f4f4;
  border-left: 1px solid #ccc;
  transition: width 0.3s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

#sidePanel.minimized {
  width: 30px;
}

#togglePanel {
  height: 40px;
  width: 30px;
  background-color: #ccc;
  border: none;
  cursor: pointer;
  align-self: flex-start;
}

#panelContent {
  flex: 1;
  padding: 1px;
  overflow-y: auto;
}

#liveLogger {
	position:;
	bottom:0; 
	right:0; 
	width:100%; 
	height:50%; 
	overflow:auto; 
	background:#111; 
	color:#0f0;
	font-family:monospace; 
	font-size:11px; 
	padding:8px; 
	z-index:9999; 
	display:block;
}


canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

