/* ── run layout: stepper left, active panel right ──────────────────── */
.run-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-5);
  flex-wrap: wrap; margin-bottom: var(--s-6); }
.run-head__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px;
  color: var(--text-2); font-size: 14px; }
.run-head__meta > span { display: inline-flex; gap: 6px; align-items: center; }
.run-head__meta svg { width: 15px; height: 15px; color: var(--text-3); }
.run-head__meta code { white-space: nowrap; font-size: 12.5px; color: var(--text-2); }
.run-head__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.run { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s-6); align-items: start; }

.stepper-wrap { position: sticky; top: calc(var(--bar-h) + 24px); }
.stepper-toggle { display: none; }

.stepper { list-style: none; margin: 0; padding: 0; position: relative; }
.step { position: relative; }
/* the rail: a hairline between nodes, filled up to where the run is */
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 21px; top: 38px; bottom: -6px; width: 1.5px;
  background: var(--hairline-strong); border-radius: 1px;
  transition: background var(--t-med) var(--ease);
}
.step[data-status="done"]:not(:last-child)::after { background: var(--ok); opacity: 0.55; }

.step__btn {
  width: 100%; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start;
  padding: 9px 12px 9px 8px; margin: 0 0 4px; border: 0; background: transparent; cursor: pointer;
  text-align: left; border-radius: var(--r-m); color: var(--text);
  transition: background var(--t-fast) var(--ease);
}
.step__btn:hover { background: var(--bg-hover); }
.step__btn:focus-visible { border-radius: var(--r-m); }
.step__btn[aria-current="step"] { background: var(--bg-elevated); box-shadow: var(--shadow-1); }

.step__text { min-width: 0; }
.step__label { display: block; font-size: 14px; font-weight: 500; line-height: 20px; letter-spacing: -0.01em; }
.step__sub { display: block; font-size: 12px; color: var(--text-2); line-height: 17px; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step__btn[aria-current="step"] .step__label { font-weight: 600; }

/* ── the node: one precise glyph per status ────────────────────────── */
.node {
  position: relative; z-index: 1;
  width: 28px; height: 28px; margin-top: -4px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg);
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease);
}
.step__btn[aria-current="step"] .node[data-status="pending"],
.step__btn[aria-current="step"] .node[data-status="running"] { background: var(--bg-elevated); }
.node svg { width: 14px; height: 14px; }
.node__n { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

.node[data-status="pending"] { box-shadow: inset 0 0 0 1.5px var(--hairline-strong); color: var(--text-3); }
.node[data-status="running"] { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-soft); }
.node[data-status="running"] .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent);
  animation: spin 900ms linear infinite;
}
.node[data-status="done"] { background: var(--ok); color: #fff; }
.node[data-status="needs_review"] { background: var(--review-soft); color: var(--review);
  box-shadow: inset 0 0 0 1.5px var(--review); }
.node[data-status="blocked"] { background: var(--blocked-soft); color: var(--blocked);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--blocked) 55%, transparent); }
.node[data-status="failed"] { background: var(--fail-soft); color: var(--fail);
  box-shadow: inset 0 0 0 1.5px var(--fail); }

@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.node[data-status="done"] svg { animation: pop 360ms var(--ease-out) both; }

/* status word used in panels */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.status[data-status="pending"] { color: var(--text-3); }
.status[data-status="running"] { color: var(--accent-text); }
.status[data-status="done"] { color: var(--ok); }
.status[data-status="needs_review"] { color: var(--review); }
.status[data-status="blocked"] { color: var(--blocked); }
.status[data-status="failed"] { color: var(--fail); }
.status svg { width: 14px; height: 14px; }

/* progress bar in the mobile toggle */
.progress { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin-top: 10px; }
.progress i { height: 3px; border-radius: 2px; background: var(--hairline-strong); }
.progress i[data-status="done"] { background: var(--ok); }
.progress i[data-status="running"] { background: var(--accent); }
.progress i[data-status="needs_review"] { background: var(--review); }
.progress i[data-status="blocked"] { background: var(--blocked); }
.progress i[data-status="failed"] { background: var(--fail); }

/* ── the panel ─────────────────────────────────────────────────────── */
.panel { min-width: 0; }
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4);
  margin-bottom: var(--s-5); flex-wrap: wrap; }
.panel__title { display: grid; gap: 6px; flex: 1 1 320px; min-width: 0; }
.panel__kicker { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0.04em;
  text-transform: uppercase; font-variant-numeric: tabular-nums; }
.panel__desc { color: var(--text-2); max-width: 62ch; }
.panel__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel__body--enter { animation: rise 420ms var(--ease-out) both; }
.panel__summary { margin-bottom: var(--s-4); }
.timing { font-size: 12px; color: var(--text-3); margin-top: var(--s-5); }

@media (max-width: 1180px) {
  .run { grid-template-columns: 250px minmax(0, 1fr); gap: var(--s-5); }
}

@media (max-width: 860px) {
  .run { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .stepper-wrap { position: static; }
  .panel__kicker { display: none; }
  .stepper-toggle {
    display: block; width: 100%; padding: 14px 16px; border: 0; cursor: pointer; text-align: left;
    background: var(--bg-elevated); border-radius: var(--r-l); box-shadow: var(--shadow-1);
  }
  .stepper-toggle:focus-visible { border-radius: var(--r-l); }
  .stepper-toggle__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .stepper-toggle__now { font-weight: 600; font-size: 15px; }
  .stepper-toggle__of { font-size: 12px; color: var(--text-2); }
  .stepper-toggle svg { width: 16px; height: 16px; color: var(--text-3);
    transition: transform var(--t-med) var(--ease); }
  .stepper-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .stepper { margin-top: 8px; padding: 8px; background: var(--bg-elevated); border-radius: var(--r-l);
    box-shadow: var(--shadow-1); }
  .stepper[data-collapsed="true"] { display: none; }
  .step__btn[aria-current="step"] { box-shadow: none; background: var(--bg-hover); }
  .node[data-status="pending"], .node[data-status="running"] { background: var(--bg-elevated); }
}

/* ── the one next action, at the top of the panel ────────────────── */
.nextbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  margin: 0 0 var(--s-5); padding: var(--s-4) var(--s-4) var(--s-4) var(--s-5); border-radius: var(--r-l);
  background: var(--bg-elevated); box-shadow: var(--shadow-1); }
.nextbar[data-kind="start"], .nextbar[data-kind="continue"] { box-shadow: var(--shadow-1), inset 3px 0 0 var(--accent); }
.nextbar[data-kind="decide"] { box-shadow: var(--shadow-1), inset 3px 0 0 var(--review); }
.nextbar[data-kind="finished"] { box-shadow: var(--shadow-1), inset 3px 0 0 var(--ok); }
.nextbar__text { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px;
  max-width: 64ch; margin: 0; }
.notice .btn svg { color: currentColor; }
.hist__nobody { font-style: italic; }
.accept { margin: 0 0 var(--s-5); }
.step[data-stale="true"] .step__sub { color: var(--review); }
/* compare/2 */
.pass--explained { color: var(--review); }
.diff-reason { font-size: 12.5px; color: var(--text-2); margin-top: 3px; max-width: 56ch; }
.diff-table tr[data-attention="true"] td:first-child { box-shadow: inset 3px 0 0 var(--fail); }
.path-line p { margin: 0; }
.path-line p + p { margin-top: 2px; }
.accept__note { width: 100%; margin-top: 12px; min-height: 76px; resize: vertical; font: inherit; }
.nextbar .btn { flex: none; }
.rerun { margin: 0 0 var(--s-5); }
.rerun__actions, .decision__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; }
.linkish:hover { text-decoration: underline; }

/* ── a collapsed "Details" disclosure ─────────────────────────────── */
.details { padding: 0; }
.details > summary { cursor: pointer; padding: 14px var(--s-5); font-size: 14px; color: var(--text-2);
  list-style: none; display: flex; align-items: center; gap: 8px; }
.details > summary::-webkit-details-marker { display: none; }
.details > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--t-fast) var(--ease); }
.details[open] > summary::before { transform: rotate(45deg); }
.details > .kv { padding: 0 var(--s-5) var(--s-5); }
.file-card__where { display: flex; gap: 4px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; }
.file-card__where .path { display: inline; }

/* ── history ──────────────────────────────────────────────────────── */
.hist { list-style: none; margin: 0; padding: var(--s-2) 0; background: var(--bg-elevated);
  border-radius: var(--r-l); box-shadow: var(--shadow-1); }
.hist__item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 12px var(--s-5); }
.hist__item + .hist__item { border-top: 0.5px solid var(--hairline); }
.hist__icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--fill-quiet); color: var(--text-2); }
.hist__icon svg { width: 15px; height: 15px; }
.hist__item[data-kind="done"] .hist__icon { background: var(--ok-soft); color: var(--ok); }
.hist__item[data-kind="needs_review"] .hist__icon { background: var(--review-soft); color: var(--review); }
.hist__item[data-kind="failed"] .hist__icon { background: var(--fail-soft); color: var(--fail); }
.hist__main { min-width: 0; }
.hist__title { font-weight: 600; font-size: 14.5px; margin: 3px 0 0; }
.hist__meta { font-size: 12.5px; color: var(--text-3); margin: 2px 0 0; }
.hist__line { font-size: 13.5px; color: var(--text-2); margin: 4px 0 0; overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .nextbar { padding: var(--s-4); }
  .nextbar .btn { width: 100%; justify-content: center; }
  .hist__item { padding: 12px var(--s-4); }
  .details > summary { padding: 14px var(--s-4); }
  .details > .kv { padding: 0 var(--s-4) var(--s-4); }
}
