html, body, #app, .n-layout {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #101014; /* Ensure dark background extends beyond viewport */
}

/* Root grid with two rows: header + panels */
.root-grid {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
}

.grid-container {
  display: grid;
  /* grid-template-columns: 1fr 1fr; */
  /* grid-template-rows: 3fr 1fr; */
  grid-template-columns: minmax(300px, 1fr) minmax(100px, 1fr);
  grid-template-rows: minmax(175px, 3fr) minmax(210px, 1fr);
  gap: 12px;
  padding: 12px;
  background-color: #101014;
  box-sizing: border-box;
  height: 100%; /* fill the minmax row */
  min-height: 0; /* Allow grid items to shrink below their content size */
}

/* Ensure all grid items have proper height constraints */
/* >* is a CSS child combinator selector. i.e. all direct children are selected */
.grid-container > * {
  min-height: 0;
  height: 100%;
}

/* Container for texture buttons inside 'Textures' tab */
.texture-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
}

/* Base button layout: sizing and appearance */
.texture-buttons .n-button {
  flex: 1 1 0;                /* Equal flex basis ensures uniform sizing */
  min-width: 80px;
  max-width: calc(25% - 6px); /* Never exceed 1/4 of container width minus gap adjustment */
  aspect-ratio: 1 / .4;       /* Makes them square */
  height: auto;               /* Let height be defined by width via aspect ratio */
  padding: 0;                 /* Removes inner padding for tighter fit */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;         /* Smaller font for labels */
}

/* Individual texture button: enables layered image + label */
.texture-button {
  position: relative;
  overflow: hidden;
}

/* Background thumbnail image (stretched to fill button) */
.texture-button .button-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* Preserves aspect ratio, fills area */
  z-index: 0;
  opacity: 0.6;               /* Faint background behind label */
}

/* Overlay label for each channel (e.g., 'iChannel0') */
.texture-button .button-label {
  position: relative;
  z-index: 1;
  color: white;
  font-weight: bold;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 1.5rem; /* spacing between Docs and GitHub */
  margin-right: 20px;
}