.tool-page__head {
  margin-bottom: 1rem;
}

.tool-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tool-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  min-height: 320px;
}

@media (max-width: 900px) {
  .tool-split {
    grid-template-columns: 1fr;
  }
}

.tool-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tool-pane__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.tool-pane .textarea {
  flex: 1;
  min-height: 280px;
}

.tool-output {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow: auto;
  flex: 1;
  min-height: 200px;
}

.tool-error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.tool-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.tool-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.canvas-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elev);
}

.canvas-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.preview-html {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  min-height: 200px;
  max-height: 560px;
  overflow: auto;
}

.preview-html img {
  max-width: 100%;
}

.mermaid-wrap {
  padding: 1rem;
  text-align: center;
}

@media (max-width: 900px) {
  .tool-split.stack-always {
    grid-template-columns: 1fr;
  }
}
