body.tool-page { max-width: 880px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.panel h2 { margin: 0 0 0.75rem; font-size: 1rem; }

.field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem 1.25rem;
}

.field-wide { grid-column: 1 / -1; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.field textarea { resize: vertical; min-height: 3rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
#job-message { white-space: pre-wrap; flex: 1; min-width: 200px; }

#preview {
  max-width: 100%;
  width: 512px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
}

.result-actions { margin-top: 0.75rem; }

.recent-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.recent-grid li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.recent-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.recent-grid .cap {
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface);
}

.tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
}

.update-panel .update-toolbar { margin-top: 0.75rem; margin-bottom: 0; }
.update-status { margin: 0; }
.update-row { font-size: 0.85rem; margin: 0.35rem 0; }
.update-row.update-available strong { color: var(--accent); }
.update-badge { margin: 0.75rem 0 0; color: var(--success); font-size: 0.85rem; font-weight: 600; }

code { font-size: 0.85rem; color: var(--accent); }
