body {
  font-family: sans-serif;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;     /* Vertikal layout */
  align-items: center;        /* Sentrer innhold horisontalt */
}

h2 {
	font: bold 18px Arial;
	text-align: center;
}

.explanation-container {
	width: 470px;
	border: 1px solid red;
	background: #fafafa;
}

.explanation-panel {
	font: 18px Arial;
	text-align: left;
	padding: 0px 10px 0px 10px;
	width: 330px;
	height: 290px;
	position: relative;
	left: 20px;
	border: 1px solid #999999;
}

.panel-active {
	outline: 3px solid #4caf50; /* grønn ramme */
	outline-offset: -3px;
	border-radius: 8px;
}

canvas {
  border: none;
  display: block; /* Prevents extra space below canvas */
  max-width: 100%;
}

.main-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-align: center;
}

.app-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0px;
  /* Remove width: 100% to allow container to size to content */
  justify-content: center; /* Centers the columns horizontally */
  align-items: flex-start; /* Aligns columns at the top */
  max-width: 100%; /* Prevents overflow on small screens */
}

.app-container {
  width: min(100%, 1000px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.cell {
  padding: 0;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.cell-controls {
  width: 100%;
}

.main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

#explanation-container {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 400px;
  padding: 16px;
  background: #fafafa;
}

.explanation-panel {
  box-sizing: border-box;
  width: 90%;
  min-height: 310px;
  padding: 0px 16px;
  border: none;
  background: none;
  font: 18px Arial, sans-serif;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}


/* For enabling/disabling sections */
.hide {
  display: none;
}

.cell {
  /* Optional: Add some styling to the cells */
  padding: 0px;
  background-color: #f9f9f9;
}

.top-bar {
  width: min(100%, 1000px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 16px;
}

.main-title {
  grid-column: 2;
  margin: 0;
  text-align: center;
}

.language-selector {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 8px;
  align-items: center;
}

.language-button {
  border: 1px solid transparent;
  background: transparent;
  padding: 3px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.55;
}

.language-button img {
  display: block;
  width: 32px;
  height: 32px;
}

.language-button.active {
  opacity: 1;
  border-color: #999;
  background: #fff;
}