:root {
  --bg: #0b1020; --panel: #141a2e; --panel2: #1b2340; --line: #263056;
  --text: #e8ecf7; --muted: #8b95b5; --accent: #3ba7ff; --accent2: #6ee7b7;
  --ok: #34d399; --fail: #f87171; --warn: #fbbf24; --info: #93a4cf;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  padding: 7px 12px; border-radius: 8px; font-size: 13px; }
button:hover { border-color: var(--accent); }
button.primary { background: linear-gradient(180deg, #2b6fd6, #1f5bc0); border-color: #2b6fd6; }
button.ghost { background: transparent; }
button.sm { padding: 3px 8px; font-size: 12px; }
button.danger { color: var(--fail); border-color: #5b2330; }
input, select { background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 8px 10px; border-radius: 8px; outline: none; }
input:focus, select:focus { border-color: var(--accent); }
code { background: #0d1430; padding: 1px 5px; border-radius: 4px; color: var(--accent2); }
.muted { color: var(--muted); }
.err { color: var(--fail); min-height: 18px; font-size: 12px; }
.wave { color: var(--accent); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login-card { display: flex; flex-direction: column; gap: 12px; width: 320px;
  background: var(--panel); padding: 28px; border-radius: 14px; border: 1px solid var(--line); }
.login-card .brand { font-size: 26px; font-weight: 700; }
.login-card .sub { color: var(--muted); margin-top: -8px; }
.login-card .hint { color: var(--muted); font-size: 11px; }

/* header */
header { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
header .brand { font-size: 18px; font-weight: 700; }
header .brand small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.who { color: var(--muted); font-size: 12px; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--panel2);
  border: 1px solid var(--line); color: var(--muted); }
.pill.on { color: var(--ok); border-color: #1d5b47; }
.pill.run { color: var(--warn); border-color: #5b4a1d; }

/* tabs */
.tabs { display: flex; gap: 4px; padding: 8px 20px 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.tabs button { background: transparent; border: none; border-bottom: 2px solid transparent;
  border-radius: 0; color: var(--muted); padding: 8px 14px; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
main { padding: 18px 20px; }
.tab { display: none; } .tab.active { display: block; }
.bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }

/* plan */
.feature-group { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.feature-head { padding: 10px 14px; background: var(--panel); font-weight: 600; display: flex;
  justify-content: space-between; align-items: center; }
.test-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 10px 14px;
  border-top: 1px solid var(--line); align-items: start; }
.test-row:hover { background: var(--panel2); }
.test-name { font-weight: 600; }
.test-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.test-meta b { color: var(--info); font-weight: 600; }
.badge { font-size: 10px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); }
.badge.auto { color: var(--ok); border-color: #1d5b47; }
.badge.plan { color: var(--warn); border-color: #5b4a1d; }
.badge.login { color: var(--accent); border-color: #244a7a; }

/* live */
.live-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; height: calc(100vh - 190px); }
.vnc-pane, .audit-pane { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; background: var(--panel); }
.pane-head { padding: 8px 12px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; gap: 10px; align-items: center; }
.pane-head .muted { margin-left: auto; font-weight: 400; }
#vnc { flex: 1; border: 0; background: #000; width: 100%; }
.audit { flex: 1; overflow: auto; padding: 8px 12px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.live-tests { max-height: 34%; overflow: auto; border-bottom: 1px solid var(--line); padding: 6px 10px; }
.audit .step { padding: 2px 0; border-bottom: 1px solid #1a2038; display: flex; gap: 8px; }
.audit .k { color: var(--muted); min-width: 74px; }
.step.ok .t { color: var(--ok); } .step.fail .t { color: var(--fail); }
.step.error .t { color: var(--fail); } .step.network .t { color: var(--accent); }
.step.screenshot .t { color: var(--accent2); }
.tchip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 8px; margin: 3px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; }
.tchip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.tchip.running .dot { background: var(--warn); } .tchip.passed .dot { background: var(--ok); }
.tchip.failed .dot, .tchip.error .dot { background: var(--fail); } .tchip.skipped .dot { background: #555; }

/* runs */
.split { display: grid; grid-template-columns: 320px 1fr; gap: 14px; }
.runs-list .run-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.runs-list .run-item:hover { border-color: var(--accent); }
.run-item .title { font-weight: 600; }
.run-item .meta { color: var(--muted); font-size: 12px; }
.status { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.status.passed { color: var(--ok); } .status.failed, .status.error { color: var(--fail); }
.status.running, .status.queued { color: var(--warn); } .status.skipped, .status.canceled { color: var(--muted); }
.run-detail { border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow: auto; max-height: calc(100vh - 210px); }
.run-detail .step { padding: 3px 0; border-bottom: 1px solid #1a2038; font-family: ui-monospace, monospace; font-size: 12px; }
.run-detail img { max-width: 320px; border: 1px solid var(--line); border-radius: 6px; margin: 6px 0; display: block; }

/* cards / schedule / build */
.card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--panel); margin-bottom: 14px; max-width: 720px; }
.card h3 { margin: 0 0 10px; }
.card .row { display: flex; gap: 10px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.card .row.inline { display: inline-flex; }
#sched-form { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; gap: 6px; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.sched-item, .build-item { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.log { background: #070b18; border: 1px solid var(--line); border-radius: 8px; padding: 10px; height: 300px;
  overflow: auto; font-family: ui-monospace, monospace; font-size: 12px; white-space: pre-wrap; margin-top: 10px; }
