:root {
  --bg: #f1f5f9; --surface: #fff; --border: #e2e8f0; --text: #0f172a; --muted: #64748b;
  --primary: #2563eb; --danger: #dc2626; --ok: #16a34a; --warn: #d97706;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #1e293b; color: #fff; }
.top .btn.ghost { color: #cbd5e1; }
.page { max-width: 860px; margin: 0 auto; padding: 16px; }
.card { background: var(--surface); border-radius: 10px; box-shadow: 0 1px 3px rgba(15, 23, 42, .1); padding: 16px; margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.between { justify-content: space-between; margin-top: 0; }
textarea, input { width: 100%; font: inherit; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); }
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 7px 14px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; color: var(--text); font: inherit; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 6px; padding: 8px 10px; margin-top: 10px; font-size: 14px; }
.error-line { color: #991b1b; overflow-wrap: anywhere; }
.agent { font-size: 14px; margin-bottom: 12px; font-weight: 600; }
.agent.on { color: var(--ok); }
.agent.off { color: var(--warn); }
.job { border-top: 1px solid var(--border); padding: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #e2e8f0; white-space: nowrap; }
.badge-running { background: #dbeafe; color: #1d4ed8; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress div { height: 100%; background: var(--primary); transition: width .4s; }
.job-done .progress div { background: var(--ok); }
.job-failed .progress div { background: var(--danger); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 8px; max-width: calc(100vw - 32px); }
.error-toast { background: var(--danger); }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 360px; }
.login h1 { margin-bottom: 4px; }
.login .btn { width: 100%; margin-top: 4px; }
[hidden] { display: none !important; }
