body {
  font-family: monospace;
  margin: 0;
  padding: 1rem;
  background: #f8f8f8;
}

/* Toolbar */
#toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto 1rem auto;
  padding: 0 10px;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.toolbar-left { justify-content: flex-start; }
.toolbar-center { justify-content: center; }
.toolbar-right { justify-content: flex-end; }

/* Search input */
#tag-search {
  font-family: monospace;
  font-size: 10px;
  padding: 4px 6px; /* same as .mode-link */
  height: 100%; /* ensures vertical fill */
  border: 1px solid black;
  border-radius: 0;
  background: white;
  color: black;
  box-sizing: border-box;
  line-height: 1; /* tighter line height */
  display: inline-block;
}


/* Grid layout */
#grid {
  margin: 0 auto;
  position: relative;
  max-width: 100%;
}

.pbm-wrapper {
  background: white;
  padding: 10px;
  box-sizing: border-box;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.pbm-wrapper.col-1 { width: 230px; }
.pbm-wrapper.col-2 { width: 480px; }
.pbm-wrapper.col-3 { width: 900px; }

/* Glyph layout */
.glyph-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Text blocks */
.pbm-metadata,
.pbm-binary {
  white-space: pre;
  font-family: monospace;
  font-size: 10px;
}

.pbm-metadata { margin-bottom: 5px; }
.pbm-binary   { margin-bottom: 10px; }

/* Visual grid */
.pbm-visual {
  display: grid;
  gap: 0;
  margin-top: 5px;
}

.pixel {
  width: 10px;
  height: 10px;
}

.pixel.black { background: black; }
.pixel.white { background: white; }

.hidden { display: none; }

/* Mode toggle links */
/* Shared box style for all toolbar links */
.mode-link,
.toolbar-button {
  font-family: monospace;
  font-size: 10px;
  color: black;
  background: white;
  border: 1px solid black;
  text-decoration: none;
  padding: 4px 6px;
  margin: 0 4px;
  box-sizing: border-box;
  display: inline-block;
  border-radius: 0; /* square corners */
}

/* Active mode styling only for mode-link */
.mode-link.active {
  font-weight: bold;
  text-decoration: underline;
}

/* ABOUT PAGE STYLING */
.about-block {
  font-family: monospace;
  font-size: 10px;
  white-space: pre-wrap;
  line-height: 2.0;
}

/* Indent only for wide blocks */
.pbm-wrapper.col-2 .about-block {
  text-indent: 4ch;
}

/* Tag/link styles inside about blocks */
.about-block a,
.about-block .tag-link,
.about-block a.tag-link {
  font-family: monospace;
  font-size: 10px;
  line-height: 2.0;
  color: #333;
  text-decoration: none;
  background-color: #f0f0f0;
  padding: 2px 4px;
  margin: 0 4px 0 0;
  display: inline;
  transition: background 0.2s ease;
}

.about-block a:hover,
.about-block .tag-link:hover {
  background-color: #ddd;
  text-decoration: underline;
  color: black;
}

/* Standalone tag link fallback */
.tag-link {
  font-family: monospace;
  font-size: 10px;
  color: #444;
  text-decoration: none;
  margin: 0 4px 0 0;
  display: inline;
  transition: background 0.2s ease;
}

.tag-link:hover {
  background: #ccc;
  color: black;
}

/* Hide full toolbar on the About page */
.about-page #toolbar .toolbar-left {
  display: none;
}

/* Optionally center the home button */
.about-page .toolbar-right {
  justify-content: center;
}