:root {
  --bg: #0f1419;
  --fg: #e8eef4;
  --muted: #8b9aab;
  --card: #1a222c;
  --line: #2a3542;
  --ok: #3dba84;
  --bad: #e05c5c;
  --run: #e6b84d;
  --empty: #4a5a6c;
  --accent: #5b9fd4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.45 system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
}
header {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
header nav { display: flex; gap: 0.8rem; }
header a { color: var(--muted); text-decoration: none; }
header a:hover { color: var(--fg); }
#who { margin-left: auto; color: var(--muted); font-size: 0.9rem; }
main { padding: 1.2rem 1.4rem 3rem; max-width: 1100px; }
h1 { font-size: 1.35rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 0.5rem; }
p, label { color: var(--muted); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin: 0.7rem 0;
}
input, select, button, textarea {
  font: inherit;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0d1116;
  color: var(--fg);
}
button {
  background: var(--accent);
  color: #081018;
  border: 0;
  font-weight: 600;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: end; }
.field { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.4rem 0; }
.field label { font-size: 0.8rem; }
.err { color: var(--bad); }
.ok { color: var(--ok); }
.lead { max-width: 42rem; }
.hint { font-size: 0.9rem; color: var(--muted); }
.pipeline-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem 0.7rem;
  margin: 0.7rem 0 1rem;
  overflow-x: auto;
}
.chain-caption {
  text-align: right;
  font-size: 0.8rem;
  margin: 0.4rem 0 0;
}
.spine {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  min-height: 4.5rem;
}
.spine-mid {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-width: 1.5rem;
}
.promo {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0;
  flex-wrap: nowrap;
  margin: 0.2rem 0;
  min-height: 4.5rem;
}
.node {
  min-width: 7.5rem;
  max-width: 14rem;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #121920;
  color: var(--fg);
  text-align: center;
  font-weight: 600;
  cursor: pointer;
}
button.node { display: block; }
.node small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node.ready { border-color: var(--ok); }
.node.failed { border-color: var(--bad); }
.node.running { border-color: var(--run); }
.node.empty { opacity: 0.7; }
.node.last { border-color: var(--accent); }
.node.stage-node { border-style: solid; }
.node.placeholder { border-style: dashed; opacity: 0.75; }
.node.open { box-shadow: 0 0 0 2px var(--accent); }
.hidden { display: none; }
.kinds { display: grid; gap: 0.55rem; margin: 0.6rem 0; }
.kind {
  text-align: left;
  width: 100%;
  background: #121920;
  color: var(--fg);
  border: 1px solid var(--line);
  font-weight: 400;
}
.kind strong { display: block; }
.kind span { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }
.kind.selected { border-color: var(--accent); }
.presets { margin-top: 0.2rem; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.3rem 0 0.6rem; }
.chip {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  font-weight: 500;
  font-size: 0.85rem;
}
.arrow {
  display: flex;
  align-items: center;
  color: var(--muted);
  padding: 0 0.4rem;
  font-size: 0.75rem;
}
.stages { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.stage {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
}
.stage.succeeded { border-color: var(--ok); }
.stage.failed { border-color: var(--bad); }
.stage.running { border-color: var(--run); }
.score-bar {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin: 0.4rem 0 0.6rem;
}
.score-bar > span { display: block; height: 100%; background: var(--accent); }
.list a { color: var(--accent); }
ul.plain { padding-left: 1.1rem; }
.live-pipe {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 1.1rem 1.2rem;
  margin: 0.8rem 0 0.4rem;
  background: linear-gradient(180deg, #151c24 0%, #121920 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 6.2rem;
}
.live-pipe .boxcar {
  min-width: 8.4rem;
  max-width: 16rem;
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: 12px;
  background: #0e141b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.live-pipe .boxcar.running {
  border-color: var(--run);
  box-shadow: 0 0 0 2px rgba(230, 184, 77, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: pulse-run 1.6s ease-in-out infinite;
}
.live-pipe .boxcar.ready, .live-pipe .boxcar.succeeded {
  border-color: var(--ok);
}
.live-pipe .boxcar.failed { border-color: var(--bad); }
.live-pipe .boxcar.not_ready { border-color: var(--run); }
.live-pipe .boxcar.gate {
  min-width: 6.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  background: #0c1218;
}
.live-arrow { font-size: 1rem; opacity: 0.8; }
@keyframes pulse-run {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.live-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 0.9fr) minmax(22rem, 1.3fr);
  gap: 0.8rem;
  align-items: start;
}
@media (max-width: 800px) {
  .live-grid { grid-template-columns: 1fr; }
}
.hist-list { display: flex; flex-direction: column; gap: 0.35rem; }
button.hist {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  width: 100%;
  text-align: left;
  background: #121920;
  color: var(--fg);
  font-weight: 500;
  border: 1px solid var(--line);
}
button.hist.on { border-color: var(--accent); }
button.hist code { color: var(--fg); }
.hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.hist-table th, .hist-table td {
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
.inspector code {
  font-size: 0.85rem;
  color: var(--fg);
}
