:root {
  --bg: #0b0c0f;
  --panel: #14161b;
  --panel-2: #1b1e25;
  --line: #262a33;
  --text: #e8e9ec;
  --muted: #8a909c;
  --accent: #7cf2b8;
  --accent-ink: #06130c;
  --warn: #ffcf6b;
  --bad: #ff7a7a;
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
main { max-width: 1040px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 28px 0 10px; }
.muted { color: var(--muted); }
.error, .err { color: var(--bad); margin: 8px 0 0; font-size: 14px; }
[hidden] { display: none !important; }

.banner { padding: 10px 16px; text-align: center; font-size: 14px; background: var(--warn); color: #221a00; }
.banner.offline { background: var(--bad); color: #2a0a0a; }
.banner.online { background: var(--panel-2); color: var(--muted); }

.top { display: flex; align-items: baseline; gap: 10px; max-width: 1040px; margin: 0 auto; padding: 18px 16px 0; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.title { color: var(--muted); }
.who { margin-left: auto; font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: baseline; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.gate { max-width: 460px; margin: 48px auto; }
.gate form { display: flex; gap: 8px; margin-top: 14px; }
.gate input { flex: 1; }

input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 96px; resize: vertical; font-family: var(--font); }
button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 600; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.ghost.on { border-color: var(--accent); color: var(--accent); }

.tabs { display: flex; gap: 6px; margin: 18px 0 12px; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--muted); border: 1px solid transparent; font-weight: 500; }
.tabs button[aria-selected=true] { background: var(--panel); border-color: var(--line); color: var(--text); }

#fields { display: grid; gap: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { padding: 8px 12px; }
.range { display: flex; align-items: center; gap: 12px; }
.range input[type=range] { flex: 1; accent-color: var(--accent); }
.range output { font-family: var(--mono); min-width: 3.5em; text-align: right; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }

.drop { border: 1px dashed var(--line); border-radius: 8px; padding: 14px; display: flex; gap: 14px; align-items: center; cursor: pointer; background: var(--panel-2); }
.drop.over { border-color: var(--accent); }
.drop img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; background: #000; }
.drop input { display: none; }
.drop .dz-text { color: var(--muted); font-size: 14px; }

.actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }

.jobs { display: grid; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.job { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.jobs .job { flex-direction: row; }
.jobs .job .preview { width: 220px; flex: none; }
@media (max-width: 640px) { .jobs .job { flex-direction: column; } .jobs .job .preview { width: auto; } }
.preview { background: #000; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; position: relative; }
.preview img, .preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview button { position: absolute; }
.meta { padding: 12px 14px; display: grid; gap: 6px; flex: 1; }
.row1, .row2 { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.feature { font-weight: 600; }
.status { color: var(--muted); }
.status.done { color: var(--accent); }
.status.failed { color: var(--bad); }
.status.running { color: var(--warn); }
.prompt { margin: 0; font-size: 14px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row2 { color: var(--muted); }
.progress { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.btns { display: flex; gap: 8px; margin-top: 4px; }
.btns button { padding: 6px 10px; font-size: 13px; }
.gallery-head { display: flex; align-items: baseline; gap: 12px; }
.gallery-head h2 { margin-bottom: 10px; }
.empty { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
