* { box-sizing: border-box; }
body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #14181d;
  color: #d8dee6;
}
header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: #1b2026;
  border-bottom: 1px solid #2a313a;
}
header h1 {
  font-size: 1rem;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
header label {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  flex-shrink: 0;
}
header input {
  background: #0e1114;
  border: 1px solid #343c46;
  color: #d8dee6;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}
header button {
  background: #3a7bd5;
  border: none;
  color: white;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
}
#status {
  font-size: 0.8rem;
  color: #8b95a1;
  margin-left: auto;
}
#status.error {
  color: #e5657a;
}
main {
  display: flex;
  height: calc(100vh - 54px);
}
#dag-container {
  position: relative;
  flex: 1;
  overflow: auto;
}
#edges {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.edge {
  fill: none;
  stroke: #3a4048;
  stroke-width: 2;
}
.edge.lit {
  stroke: #3fd8f0; /* mq-dag-viz's --edge-strong (dark mode) */
  stroke-width: 3;
}
/* A hover trace dims everything not on the hovered PR's lineage. `filter`, not `opacity` --
   `opacity` is already driven inline, per frame, by the enter/leave fade animation, and an
   inline style always beats a stylesheet rule on the same property. */
#dag-container.tracing .batch:not(.lit),
#dag-container.tracing .edge:not(.lit) {
  filter: opacity(0.25);
}
#nodes {
  position: relative;
  width: 100%;
  height: 100%;
}
#empty-state {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #8b95a1;
  font-size: 0.9rem;
  pointer-events: none;
}
#empty-state.visible {
  display: flex;
}
.batch {
  position: absolute;
  border: 2px solid; /* color set inline per batch, to tell simultaneously-open batches apart */
  border-radius: 6px;
  background: #1f2730;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
  overflow: hidden;
}
.batch.waiting_for_merge {
  border-style: dashed;
}
.batch-label {
  position: absolute;
  transform: translateY(calc(-100% - 2px));
  margin-left: 0.6rem; /* matches .batch's left padding, so it lines up with the avatar below it */
  font-size: 0.7rem;
  color: #9aa4b2;
  white-space: nowrap;
  pointer-events: none;
}
.batch-label:empty {
  display: none;
}
.pr {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 4px 0;
}
.pr + .pr {
  border-top: 1px solid #343c46;
}
.pr-top {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 16px;
}
.pr .avatar {
  border-radius: 50%;
  flex-shrink: 0;
}
.pr-number {
  white-space: nowrap;
}
.pr-title {
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
}
.pr-title-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  font-size: 0.72rem;
  color: #8b95a1;
}
/* While hovered and actually overflowing, app.js runs a Web Animations API scroll instead of the
   static ellipsis -- so the clamp that makes the ellipsis possible has to come off, or the
   sliding text would still be clipped to the collapsed width. */
.pr-title-text.marquee {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
#waiting-panel {
  width: 260px;
  border-left: 1px solid #2a313a;
  padding: 0.8rem;
  overflow-y: auto;
}
#waiting-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
#waiting-list li {
  font-size: 0.82rem;
  background: #1f2730;
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
}
#waiting-list .wait-duration {
  color: #8b95a1;
  font-size: 0.75rem;
}
