/* attribute-color legend shown above the palette. Grid (not flex) with an
   explicit auto-width right column, so the toggle always stays on the same
   row as the legend instead of wrapping below it when the legend is long. */
.block-legend {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px 24px;
  margin: 0 8px 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
}

/* same legend, always visible in the middle of the left menu zone */
.attr-legend {
  flex: none;
  align-self: stretch;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px 28px;
  padding: 6px clamp(10px, 3vw, 20px);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

/* the left menu zone is a narrow column, not a wide bar -- stack the
   legend above the toggle instead of side-by-side, and drop the divider
   that made sense between side-by-side columns */
.menu-left .attr-legend {
  grid-template-columns: 1fr;
  gap: 8px;
  border-bottom: none;
}

.menu-left .colormode-toggle {
  border-left: none;
  padding-left: 0;
  padding-top: 6px;
}

