:root {
  --bg: #f6f7f8; --panel: #ffffff; --text: #16191d; --muted: #66707a; --line: #e2e5e9;
  --accent: #0d9488; --accent-ink: #ffffff; --ok: #0f7a4a; --ok-bg: #e3f5ec; --bad: #b42318; --bad-bg: #fdecea;
  --busy: #8a5a00; --busy-bg: #fff4dc; --idle: #4b5563; --idle-bg: #eef0f2; --code: #0f1419; --code-text: #d7dde3;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1114; --panel: #161a1f; --text: #e6e9ec; --muted: #8b95a0; --line: #262c33;
    --ok: #4ade80; --ok-bg: #12301f; --bad: #f87171; --bad-bg: #3a1515; --busy: #fbbf24; --busy-bg: #33280c;
    --idle: #a3acb6; --idle-bg: #1f252b; --code: #0a0d10;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 10px; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
section { margin-top: 28px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.brand { font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.bar nav { display: flex; align-items: center; gap: 16px; }
.bar nav a { color: var(--muted); }
.bar nav form { margin: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.narrow { width: min(380px, calc(100vw - 32px)); }
.center { min-height: 100dvh; display: grid; place-items: center; }
.note { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 6px; }
.err { color: var(--bad); background: var(--bad-bg); padding: 10px 12px; border-radius: 6px; white-space: pre-wrap; word-break: break-word; }
.empty { text-align: center; padding: 48px 0; color: var(--muted); }
.form { display: grid; gap: 12px; }
.form h2 { margin: 0; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; width: 100%; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=checkbox] { width: auto; }
button, .btn { font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; padding: 8px 14px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); display: inline-block; transition: transform .1s ease-out, opacity .15s; }
button:active, .btn:active { transform: scale(0.98); }
button:disabled { opacity: .6; cursor: progress; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:hover { text-decoration: none; }
button.link { border: 0; background: none; padding: 0; color: var(--muted); font-weight: 400; }
.danger { border-color: var(--bad-bg); }
.dangerbtn { background: var(--bad); border-color: var(--bad); color: #fff; }
table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.compact td { padding: 4px 12px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; vertical-align: middle; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.busy { color: var(--busy); background: var(--busy-bg); }
.pill.idle { color: var(--idle); background: var(--idle-bg); }
.logs { background: var(--code); color: var(--code-text); border-radius: var(--radius); padding: 12px; margin: 0;
  height: 420px; overflow: auto; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.chart { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.chart-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.chart-head b { color: var(--text); font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: 60px; display: block; margin: 6px 0 2px; }
.chart polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-empty { height: 60px; display: grid; place-items: center; }
.tl { display: grid; gap: 6px; }
.tl-row { display: grid; grid-template-columns: 170px 1fr 80px; align-items: center; gap: 10px; font-size: 13px; }
.tl-track { position: relative; height: 14px; background: var(--idle-bg); border-radius: 4px; }
.tl-bar { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; min-width: 3px; }
.tl-bar.running { background: var(--busy); }
.tl-bar.failed { background: var(--bad); }
.tl-time { text-align: right; font-variant-numeric: tabular-nums; }
.stats { margin-top: 10px; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .tl-row { grid-template-columns: 110px 1fr 60px; }
  table.list th:nth-child(n+5), table.list td:nth-child(n+5) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
