:root {
  --bg: #ffffff; --fg: #1d1d1f; --muted: #6e6e73; --line: #e0e0e3; --stripe: #f4f5f5; --bar: #f6f6f7;
  --current: #1a7f37; --blocking: #e8830c; --select: #0a60ff;
  --columns: minmax(0, 1fr) 58px 96px 170px 124px;
  --gutter: 40px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e1e; --fg: #e8e8ea; --muted: #98989d; --line: #3a3a3c; --stripe: #282829; --bar: #2a2a2c;
    --current: #3fb950; --blocking: #f59f2a; --select: #0a58d0;
  }
}
@media (max-width: 760px) {
  :root { --columns: minmax(0, 1fr) 54px 88px; }
  .labels, .updated { display: none; }
}
@media (max-width: 460px) {
  :root { --columns: minmax(0, 1fr) 50px; }
  .sub { display: none; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  display: flex; flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px; line-height: 1.3; color: var(--fg); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}

.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bar); }
.toolbar select {
  font: inherit; font-size: 15px; font-weight: 700; color: inherit; background: none;
  border: 0; margin-right: auto; min-width: 0; cursor: pointer;
}
.toolbar input[type="search"] {
  width: 220px; min-width: 0; flex-shrink: 1; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px;
}
.toolbar button, .toggle {
  font: inherit; color: inherit; background: var(--bg); white-space: nowrap;
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; cursor: pointer;
}
.toggle input { vertical-align: -2px; margin-right: 4px; }
@media (max-width: 460px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar input[type="search"] { order: 1; width: 100%; }
}

.columns, .row {
  display: grid; grid-template-columns: var(--columns); align-items: center;
  padding: 0 10px 0 var(--gutter);
}
.columns { margin: 0 8px; height: 28px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.columns span { padding-left: 10px; border-left: 1px solid var(--line); line-height: 16px; }
.columns span:first-child { padding-left: 24px; border-left: 0; }

main { flex: 1; overflow-y: auto; }
#tree-wrap { position: relative; }
#tree { list-style: none; margin: 4px 8px 12px; }
.message { padding: 24px 12px; color: var(--muted); }

#links { position: absolute; top: 0; left: 0; pointer-events: none; }
#links path { fill: none; stroke: var(--blocking); stroke-width: 1.6; }
#links path.folded { stroke-dasharray: 3 3; }
#links .end { fill: var(--blocking); }
#links .end.folded { fill: var(--bg); stroke: var(--blocking); stroke-width: 1.6; }

.row { height: 30px; border-radius: 6px; cursor: default; }
.row:nth-child(even) { background: var(--stripe); }
.row.related { background: color-mix(in srgb, var(--blocking) 24%, var(--bg)); }
.row.selected { background: var(--select); color: #ffffff; --muted: #dbe6ff; }
.row.root:not(:first-child) { margin-top: 8px; }
.row.root .title { font-weight: 700; }

.name { display: flex; align-items: center; min-width: 0; padding-left: calc(var(--depth) * 18px); }
.fold {
  flex: none; width: 22px; height: 30px; font-size: 17px; line-height: 1; color: var(--muted);
  background: none; border: 0; cursor: pointer; transition: transform 0.12s;
}
.fold[aria-expanded="true"] { transform: rotate(90deg); }
.fold:disabled { visibility: hidden; }

.step {
  flex: none; width: 19px; height: 19px; margin-right: 6px;
  border: 1.5px solid var(--muted); border-radius: 50%;
  font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.step.current { background: var(--current); border-color: var(--current); color: #ffffff; }
.step.blocking { border-color: var(--blocking); color: var(--blocking); }
.step.blocking.current { background: var(--blocking); color: #ffffff; }
.step.lone { width: 11px; height: 11px; margin: 0 10px 0 4px; }
.selected .step { border-color: #ffffff; color: #ffffff; }
.selected .step.current { background: #ffffff; color: var(--select); }

.title { color: inherit; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title:hover, .title:focus-visible { text-decoration: underline; }
.cell {
  color: var(--muted); padding-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.status {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; padding: 6px 12px;
  color: var(--muted); font-size: 11.5px; background: var(--bar); border-top: 1px solid var(--line);
}
.status span { display: flex; align-items: center; gap: 5px; }
.status .step { width: 13px; height: 13px; margin: 0; background: var(--blocking); border-color: var(--blocking); }
