/* Current runs */

section.now {
  margin-top: 1.2rem;
  padding: 0.7rem 0.9rem;
  border-left: 2px solid var(--out);
  background: var(--wash);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: var(--measure);
  font-size: var(--text-md);
}

section.now h2 {
  font-size: var(--text-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

section.now p {
  margin: 0.2rem 0 0;
}

section.now .status.running::before {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--out) 25%, transparent);
}

section.now .status.queued::before {
  background: none;
  border: 1.5px solid var(--muted);
}


.line form.stop {
  margin-left: auto;
}

.line form.stop button {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--bad);
  background: none;
  border: 1px solid var(--bad);
  border-radius: var(--radius);
  padding: 0.15rem 0.6rem;
  cursor: pointer;
}

.line form.stop button:hover {
  background: var(--bad);
  color: var(--paper);
}

/* Run trace */

.trace {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.trace .arrow {
  color: var(--line);
  font-size: 22px;
  text-align: center;
  padding-top: 1.4rem;
}

.trace h2 {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.4rem;
}

.trace h2 span:last-child {
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}

.trace ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.trace li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-md);
}

.trace li a {
  color: var(--ink);
  font-weight: 500;
}

.trace li small {
  display: block;
  color: var(--muted);
  font-size: var(--text-sm);
}

.trace li .k {
  color: var(--muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.trace li .v {
  color: var(--out);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

.trace .given li > span:first-child::before {
  content: "";
  display: inline-block;
  width: var(--marker);
  height: var(--marker);
  border-radius: 1px;
  background: var(--in);
  margin-right: 0.5rem;
  vertical-align: 1px;
}

.trace .given li.page > span:first-child::before {
  background: var(--out);
  border-radius: 50%;
}

article.run .summary {
  margin-top: 1.5rem;
  max-width: var(--measure);
  font-size: var(--text-lg);
  line-height: 1.6;
}

article.run .summary > * + * {
  margin-top: 0.8rem;
}

article.run .summary ul,
article.run .summary ol {
  padding-left: 1.2rem;
}

article.run .summary li + li {
  margin-top: 0.3rem;
}

@media (max-width: 720px) {
  .trace {
    grid-template-columns: 1fr;
  }

  .trace .arrow {
    transform: rotate(90deg);
    padding: 0;
  }
}

/* API calls */

.calls {
  margin-top: 1.8rem;
}

.calls h2 {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.4rem;
}

.calls h2 span:last-child {
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}

.calls ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.calls li {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-md);
}

.calls li .when {
  color: var(--muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.calls li b {
  font-weight: 500;
}

.calls li small {
  color: var(--muted);
  font-size: var(--text-sm);
}

.calls li .k {
  color: var(--muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.calls li.refused .k {
  color: var(--bad);
  font-weight: 600;
}

/* Sandbox transcript */

.unfold .transcript {
  display: block;
  grid-column: 1 / -1;
}

.unfold .transcript li {
  display: block;
  padding: 0.35rem 0;
}

.unfold .transcript li.words {
  color: var(--ink);
}

.unfold .transcript li.words > * + * {
  margin-top: 0.5rem;
}

.unfold .transcript summary {
  cursor: pointer;
  color: var(--ink);
  font-size: var(--text-xs);
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}

.unfold .transcript summary code {
  white-space: pre-wrap;
  word-break: break-word;
}

.unfold .transcript li.error summary .k {
  color: var(--bad);
  font-weight: 600;
}

.unfold .transcript pre {
  margin-top: 0.3rem;
  max-height: 24rem;
  overflow: auto;
  white-space: pre-wrap;
}

section.now .agent {
  color: var(--muted);
  font-size: var(--text-sm);
}
