:root {
  --bg: #0f1117; --bg2: #171a23; --bg3: #1f2330; --fg: #e6e8ef; --muted: #8b90a0; --line: #2a2f3d;
  --accent: #4cc9f0; --ok: #80ed99; --warn: #ffd166; --bad: #f72585;
  --c0: #4cc9f0; --c1: #f72585; --c2: #ffd166; --c3: #80ed99;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: var(--bg2); border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 8px; }
header .brand { font-weight: 700; font-size: 18px; color: var(--fg); letter-spacing: 0.5px; }
header nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
header nav a { color: var(--fg); }
main { max-width: 1100px; margin: 0 auto; padding: 20px; }
footer { max-width: 1100px; margin: 40px auto 20px; padding: 0 20px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
h1 { font-size: 26px; margin: 10px 0 14px; } h2 { font-size: 19px; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--bg3); color: var(--muted); vertical-align: middle; }
.status { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--bg3); vertical-align: middle; }
.status.built, .status.done { color: var(--ok); } .status.failed { color: var(--bad); } .status.pending, .status.running { color: var(--warn); }
.flash { padding: 10px 14px; border-radius: 6px; margin: 0 0 16px; } .flash.ok { background: #16321f; color: var(--ok); } .flash.err { background: #3a1024; color: #ffb3cf; }
.flash ul { margin: 0; padding-left: 18px; }
table { border-collapse: collapse; width: 100%; margin: 8px 0 12px; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr.mine td { background: #15202b; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; } @media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }
.hero { padding: 10px 0 20px; } .hero h1 { font-size: 32px; } .hero p { max-width: 720px; font-size: 16px; }
.motd { background: var(--bg3); padding: 10px 14px; border-left: 3px solid var(--warn); border-radius: 4px; }
.btn, button { display: inline-block; background: var(--accent); color: #06111a; border: 0; padding: 8px 14px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn:hover, button:hover { filter: brightness(1.1); text-decoration: none; }
.btn.alt, button.alt { background: var(--bg3); color: var(--fg); } .btn.small, button.small { padding: 4px 10px; font-size: 13px; }
button.danger { background: #5a1130; color: #ffb3cf; } button.link { background: none; color: var(--fg); padding: 0; font-weight: 400; font-size: 15px; }
form.inline { display: inline; }
.form label { display: block; margin: 10px 0; } .form input[type=text], .form input:not([type]), .form input[type=password], .form input[type=email], .form input[type=number], .form select, .form textarea {
  display: block; width: 100%; max-width: 480px; margin-top: 4px; padding: 7px 9px; background: var(--bg2); color: var(--fg); border: 1px solid var(--line); border-radius: 5px; font-size: 14px; }
.form.wide textarea { max-width: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.form .row { display: flex; gap: 16px; flex-wrap: wrap; } .form .row label { flex: 1; min-width: 160px; }
.form input[type=checkbox] { margin-right: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 20px; }
pre { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 12px; overflow: auto; font-size: 13px; line-height: 1.45; }
pre.log { max-height: 320px; } pre.code { max-height: 70vh; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--bg3); padding: 1px 4px; border-radius: 3px; }
pre code { background: none; padding: 0; }
.toc { margin: 6px 0 18px; color: var(--muted); } .toc a.on { font-weight: 700; }
.doc { max-width: 820px; } .doc h1 { margin-top: 36px; border-bottom: 1px solid var(--line); padding-bottom: 6px; } .doc table { width: auto; min-width: 60%; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.swatch.c0 { background: var(--c0); } .swatch.c1 { background: var(--c1); } .swatch.c2 { background: var(--c2); } .swatch.c3 { background: var(--c3); }
table.log td { font-size: 13px; }
/* viewer */
.viewer { margin: 16px 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.viewer canvas { display: block; width: 100%; max-width: 720px; image-rendering: pixelated; background: #05070b; border-radius: 4px; margin: 0 auto; }
.viewer .controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.viewer .controls input[type=range] { flex: 1; min-width: 160px; }
.viewer .controls select { background: var(--bg3); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 4px; }
.viewer .legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.viewer .legend .dead { text-decoration: line-through; color: var(--muted); }
.viewer .tick { font-variant-numeric: tabular-nums; min-width: 120px; }
.viewer .status { margin-left: auto; }
