:root {
  --bg: #f6f3ec;
  --panel: #ffffff;
  --ink: #1f1d1a;
  --soft: #6b645a;
  --line: #e3ddd0;
  --accent: #253a5e;
  --accent-ink: #ffffff;
  --hi: #f4d24b;
  --ok: #2c7a4b;
  --bad: #b3412c;
  --run: #8a6a12;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 24px 0 8px; }
p.lead { color: var(--soft); margin: 0 0 20px; max-width: 70ch; }
.muted { color: var(--soft); }
.small { font-size: 0.85rem; }

.top { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--accent); color: #fff; flex-wrap: wrap; }
.top[hidden] { display: none; }
.brand { font-weight: 700; white-space: nowrap; }
.logo { color: var(--hi); }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.top nav a { color: #dfe6f2; text-decoration: none; padding: 6px 12px; border-radius: 8px; }
.top nav a.on, .top nav a:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.who { font-size: 0.9rem; white-space: nowrap; }
.top .link { color: #fff; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid2 { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

button, .btn { font: inherit; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 8px 16px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary, .btn.secondary { background: #fff; color: var(--accent); }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; }
button:disabled { opacity: 0.5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label { display: block; font-weight: 600; font-size: 0.9rem; margin: 14px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; min-height: 60vh; line-height: 1.5; }

.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 20px; }
.style-pick { text-align: left; background: #fff; color: var(--ink); border: 2px solid var(--line); padding: 14px; }
.style-pick.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 58, 94, 0.15); }
.style-pick b { display: block; margin-bottom: 4px; }
.swatches { display: flex; gap: 4px; margin-top: 10px; }
.swatches span { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.15); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { background: #fff; color: var(--accent); }
.tabs button.on { background: var(--accent); color: #fff; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 40px; height: 40px; border-radius: 50%; padding: 0; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.colors button.on { box-shadow: 0 0 0 3px var(--accent); }

.stage { border-radius: var(--radius); min-height: 240px; display: flex; align-items: center; justify-content: center; padding: 16px; position: relative; overflow: hidden; }
.stage img { max-width: 100%; height: auto; display: block; }
.stage .busy { position: absolute; top: 10px; right: 12px; background: rgba(0, 0, 0, 0.6); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 0.85rem; }
.place { background: #fffbe8; border: 1px solid #efe1a0; border-radius: 8px; padding: 10px 12px; margin-top: 12px; font-size: 0.9rem; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.9rem; }
th { background: #faf8f3; font-weight: 600; }
tr:last-child td { border-bottom: none; }
.tablewrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; background: #eee; white-space: nowrap; }
.pill.done { background: #dff0e5; color: var(--ok); }
.pill.failed, .pill.cancelled { background: #f7e1dc; color: var(--bad); }
.pill.running { background: #fbf0cf; color: var(--run); }
.pill.queued { background: #e8ecf3; color: var(--accent); }
pre.log { background: #1f1d1a; color: #e9e4d8; padding: 14px; border-radius: 8px; max-height: 60vh; overflow: auto; font-size: 0.8rem; white-space: pre-wrap; word-break: break-word; }
.notice { padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.notice.err { background: #f7e1dc; color: var(--bad); }
.notice.ok { background: #dff0e5; color: var(--ok); }
.login { max-width: 400px; margin: 10vh auto; }
dialog { border: none; border-radius: var(--radius); padding: 0; max-width: min(720px, 94vw); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
dialog .card { border: none; }
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.crumbs { margin-bottom: 10px; }
.thumb { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
