:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #7c4dff;
  --accent-hover: #6a3ff0;
  --error: #f85149;
  --ok: #3fb950;
}

* { box-sizing: border-box; }

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

.view { max-width: 720px; margin: 0 auto; padding: 2rem 1rem; }
.hidden { display: none !important; }

h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; color: var(--muted); margin: 1.5rem 0 0.5rem; }

header { display: flex; justify-content: space-between; align-items: center; }

#login-form {
  max-width: 320px;
  margin: 15vh auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

input, textarea, button {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 0.6rem 0.8rem;
}

textarea { width: 100%; resize: vertical; }

button {
  cursor: pointer;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
}
button:hover { background: var(--accent-hover); }
button.ghost { background: transparent; color: var(--muted); font-weight: normal; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.error { color: var(--error); min-height: 1.2em; font-size: 0.9rem; }

#gen-form { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }

#job-log {
  background: #010409;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 0.8rem;
  color: var(--muted);
}

#job-result a {
  display: inline-block;
  margin: 0.5rem 0.5rem 0 0;
  color: var(--accent);
}

#job-result video { max-width: 100%; border-radius: 8px; margin-top: 0.5rem; }

#job-list { list-style: none; padding: 0; margin: 0; }
#job-list li {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.status-done { color: var(--ok); }
.status-error, .status-interrupted { color: var(--error); }
.status-running, .status-queued { color: var(--muted); }
