:root {
  --bg: #0f1115;
  --surface: #181b22;
  --border: #262a33;
  --text: #e6e8eb;
  --muted: #9aa0a6;
  --accent: #4f8cff;
  --accent-hover: #3b78ee;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header, footer {
  text-align: center;
  padding: 2rem 1rem;
}

header h1 { margin: 0 0 .5rem; font-size: 2rem; }
.subtitle { color: var(--muted); margin: 0; }

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

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

.card h2 { margin-top: 0; }

form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

input[type="text"] {
  flex: 1 1 260px;
  padding: .65rem .8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1218;
  color: var(--text);
  font-size: 1rem;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  padding: .65rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}

button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { opacity: .6; cursor: not-allowed; }

.status {
  min-height: 1.25rem;
  color: var(--muted);
  margin: .5rem 0 0;
}
.status.error { color: var(--error); }

.image-wrap {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

#output:not([src]) { display: none; }

footer small { color: var(--muted); }
