:root {
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #1c1c1f;
  --line: #2a2a2e;
  --text: #f2f2f4;
  --muted: #8b8b93;
  --accent: #4f8cff;
  --danger: #ff5f57;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* The gate is display:grid, which would beat the UA [hidden] rule. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

h1 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 28px 0 8px; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 20px; margin: 8px 0 0; font-size: 13px; }
.empty { text-align: center; margin: 32px 0; font-size: 14px; }

/* gate */
#gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
}
.card h1 { margin-bottom: 4px; }
.card .muted { margin: 0 0 20px; font-size: 14px; }
#pin {
  width: 100%;
  padding: 14px;
  font-size: 26px;
  letter-spacing: 0.5em;
  text-align: center;
  text-indent: 0.5em;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}
#pin:focus { border-color: var(--accent); }

button {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
button:active { transform: scale(0.99); }
.card button { width: 100%; margin-top: 14px; background: var(--accent); border-color: transparent; font-weight: 600; }
button.ghost { background: transparent; color: var(--muted); padding: 6px 10px; }
button[disabled] { opacity: 0.5; cursor: default; }

/* app */
main { max-width: 720px; margin: 0 auto; padding: 16px 16px 64px; }
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}

.row { display: flex; gap: 8px; margin-bottom: 8px; }
.row input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}
.row input:focus { border-color: var(--accent); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.slug { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.actions select {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
}
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.files a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.badge {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
}
.badge.running { color: #ffd60a; }
.badge.done { color: #30d158; }
.badge.error { color: var(--danger); }
pre.log {
  margin: 10px 0 0;
  padding: 10px;
  background: #0a0a0b;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  max-height: 132px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
