:root {
  --cream: #fdf8ee;
  --ink: #201a12;
  --accent: #d9781f;
  --accent-dark: #b85e12;
  --card: #ffffff;
  --border: #e6ddc9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--cream);
  color: var(--ink);
}

.site-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 2rem 1rem;
  border-bottom: 2px solid var(--border);
}

.tagline h1 {
  margin: 0 0 0.25rem;
  font-size: 1.8rem;
}

.tagline p {
  margin: 0;
  color: #55492f;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  gap: 2rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
}

.panel h2 {
  margin-top: 0;
}

.note {
  background: #fdf1e0;
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border-radius: 4px;
}

#builder-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  font-weight: bold;
  gap: 0.3rem;
}

label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
}

input[type="text"], select, textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fffdf8;
}

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

button:hover {
  background: var(--accent-dark);
}

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

.prompt-result.hidden {
  display: none;
}

#prompt-text {
  width: 100%;
  font-family: monospace;
  resize: vertical;
}

.hint {
  font-size: 0.85rem;
  color: #6b5c3a;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.button-row button {
  justify-self: unset;
}

#generate-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

#generate-status.error {
  color: #a02b2b;
}

#generate-preview img {
  max-width: 100%;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-grid img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.gallery-grid .empty {
  color: #857553;
  font-style: italic;
}

.gallery-card a {
  display: block;
  text-decoration: none;
  color: inherit;
  font-size: 0.85rem;
  text-align: center;
}

.gallery-caption {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: #6b5c3a;
  text-align: center;
}

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

.batch-result.hidden {
  display: none;
}

#batch-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.batch-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: #fffdf8;
}

.batch-item h4 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.batch-item .batch-tags {
  font-size: 0.8rem;
  color: #857553;
  margin: 0 0 0.5rem;
}

.batch-item textarea {
  width: 100%;
  font-family: monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.batch-item button {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}

footer {
  text-align: center;
  padding: 2rem;
  color: #857553;
  font-size: 0.9rem;
}
