* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Menlo', 'Consolas', monospace;
  background: #0d1117;
  color: #c9d1d9;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}
.site-title { font-weight: bold; color: #e6edf3; }
.nav-links { display: flex; gap: 12px; }
.nav-link {
  color: #8b949e;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 4px;
}
.nav-link:hover { color: #e6edf3; }
.nav-link.active { color: #e6edf3; background: rgba(31, 111, 235, 0.25); }
.nav-link.disabled { color: #484f58; cursor: default; }

main { padding: 16px; }

.controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.controls label { font-size: 13px; color: #8b949e; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.controls input[type=number] { width: 64px; }
.controls select { min-width: 0; max-width: 100%; }
#wolfram-num, #bond-num { width: 120px; }
.controls input, .controls select {
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 3px 6px;
  font-family: inherit;
  font-size: 13px;
}
.controls button {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.controls button:hover { background: #30363d; }
#machine { width: 380px; max-width: 100%; }
.load-error { color: #f85149; font-size: 12px; }
.controls[hidden] { display: none; }
.entry-group { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entry-group[hidden] { display: none; }
.sep { width: 1px; height: 22px; background: #30363d; }

/* On narrow screens (phones), stack controls so nothing overflows. */
@media (max-width: 600px) {
  .controls { flex-direction: column; align-items: stretch; gap: 8px; }
  .controls label { width: 100%; justify-content: space-between; }
  .controls select, .controls input[type=number] { flex: 1 1 auto; }
  .controls input[type=number] { width: auto; }
  #machine { width: 100%; }
  .sep { display: none; }
}

.caption { color: #8b949e; font-size: 13px; margin-bottom: 10px; }
#canvas-wrap { overflow: auto; max-width: 100%; }
canvas {
  border: 1px solid #30363d;
  image-rendering: pixelated;
}
