body {
  margin: 0;
  font-family: system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #121212;
  color: #e0e0e0;
}

/* Scratchpad Section */
#scratchpad {
  display: flex;
  min-height: 25vh;        /* Don't shrink below 25% screen height */
  height: 33vh;             /* Default height */
  max-height: 40vh;         /* Optional max height */
  flex-shrink: 0;           /* Prevent shrinking */
  border-bottom: 1px solid #333;
  background: #1a1a1a;
}

#scratchpad textarea {
  flex: 1;
  padding: 1rem;
  background: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #333;
  resize: none;
  overflow: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  height: 100%;
  box-sizing: border-box;
}

/* Main Area */
#main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Sidebar */
#sidebar {
  width: 200px;
  background: #1a1a1a;
  padding: 1rem;
  border-right: 1px solid #333;
  box-sizing: border-box;
  overflow-y: auto;
  max-height: 100%;
}

.toolbox-group h2 {
  font-size: 1rem;
  margin: 0.75rem 0 0.5rem;
  cursor: pointer;
  color: #ccc;
  user-select: none;
}

.toolbox-group .tool-buttons {
  padding-left: 0.5rem;
  transition: max-height 0.2s ease;
  overflow: hidden;
}

.toolbox-group.collapsed .tool-buttons {
  display: none;
}

#sidebar button {
  display: block;
  width: 100%;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #eee;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: left;
}

#sidebar button:hover {
  background: #333;
}

/* Toolbox Area */
#toolbox {
  flex: 1;
  padding: 1rem;
  overflow: auto;
  background: #181818;
}

#toolbox textarea,
#toolbox input[type="text"] {
  width: 100%;
  background: #1f1f1f;
  color: #f0f0f0;
  border: 1px solid #444;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  font-family: monospace;
  box-sizing: border-box;
  resize: vertical;
}

#toolbox button {
  background: #2e2e2e;
  color: #fff;
  border: 1px solid #444;
  padding: 0.5rem 1rem;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: background 0.2s ease;
}

#toolbox button:hover {
  background: #444;
}

/* Headings */
h3, h4 {
  color: #fafafa;
}

/* Optional: Smooth sidebar scrollbar */
#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-thumb {
  background: #444;
}
