:root {
  color-scheme: light dark;
  --accent: #2563eb;
  --border: #d1d5db;
  --error: #dc2626;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1rem;
  line-height: 1.5;
}

h1 {
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #6b7280;
  margin-top: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.field-row {
  display: flex;
  gap: 1rem;
}

.field-row .field {
  flex: 1;
}

.field.checkbox {
  flex-direction: row;
  align-items: center;
}

.field.checkbox input {
  margin-right: 0.5rem;
}

input[type="number"],
input[type="text"],
input[type="file"] {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

input[type="range"] {
  width: 100%;
}

.hint {
  margin-top: -0.5rem;
  color: #6b7280;
  font-size: 0.875rem;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

.error-banner {
  background: #fee2e2;
  color: var(--error);
  border: 1px solid var(--error);
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 1rem;
}

.result {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.result img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 0.5rem 0;
}

.download-btn {
  display: inline-block;
  background: #16a34a;
  color: white;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  margin-top: 0.5rem;
}

#new-file-btn {
  margin-left: 0.5rem;
}

.key-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}
