:root {
  --bg: #0e1116;
  --bg-panel: #161b22;
  --border: #2a313c;
  --text: #e6e9ef;
  --text-dim: #9aa4b2;
  --accent: #5b8cff;
  --accent-hover: #4a75e0;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.wrap {
  width: 100%;
  max-width: 720px;
  padding: 48px 20px 32px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0 0 8px;
}

h1 span {
  color: var(--accent);
  font-weight: 600;
}

.subtitle {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.95rem;
}

.gen-form {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

textarea {
  width: 100%;
  resize: vertical;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  min-height: 70px;
}

textarea::placeholder {
  color: var(--text-dim);
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  margin-top: 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.status.error {
  color: var(--error);
}

.result-wrap {
  margin-top: 24px;
  text-align: center;
}

.result-wrap img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.download-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.download-link:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  margin-top: 48px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --bg-panel: #ffffff;
    --border: #e1e4e9;
    --text: #1a1d22;
    --text-dim: #666e7a;
  }
}
