#explorer-flow {
  padding: 0;
}

#explorer-flow .run-story {
  --flow-paper: var(--panel);
  --flow-ink: var(--text);
  --flow-muted: var(--muted);
  --flow-accent: var(--text);
  --flow-line: var(--line-soft);
  --flow-guide: color-mix(in srgb, var(--muted) 27%, var(--panel));
  --flow-underline: color-mix(in srgb, var(--muted) 50%, transparent);
  --flow-gutter: clamp(16px, 2.3vw, 26px);
  --flow-sans: var(--font);
  container: run-timeline / inline-size;
  min-width: 0;
  background: var(--flow-paper);
  color: var(--flow-ink);
  color-scheme: dark;
  font: 400 1rem/1.5 var(--flow-sans);
  letter-spacing: normal;
}

#explorer-flow .run-story :is(button, a, summary, select, [tabindex]):focus-visible {
  outline: 2px solid var(--flow-accent);
  outline-offset: 3px;
}

#explorer-flow .section-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 13px;
  margin-inline: var(--flow-gutter);
  padding: 20px 0 13px;
  border-bottom: 1px solid var(--flow-line);
  color: var(--flow-muted);
  font-size: .8125rem;
}

#explorer-flow .section-bar h2 {
  color: var(--flow-ink);
  font: 500 clamp(1.375rem, 2.7cqi, 1.625rem)/1.15 var(--font-display);
  letter-spacing: -.025em;
}

#explorer-flow .flow-totals {
  padding: 3px 10px; border-radius: var(--control-radius);
  color: var(--flow-ink); background: var(--petrol);
}
#explorer-flow .flow-date {
  margin-inline-start: auto;
  color: var(--flow-muted);
  font-variant-numeric: tabular-nums;
}

#explorer-flow .trace-follow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: var(--control-radius);
  border: 1px solid var(--line);
  background: var(--elevated);
  color: var(--flow-ink);
  font: 450 .8125rem/1.4 var(--flow-sans);
}

#explorer-flow .trace-follow[aria-pressed="true"]::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
}

#explorer-flow .trace-follow:hover { border-color: var(--flow-guide); }

#explorer-flow .round-jump {
  min-width: 0;
  max-width: 100%;
}

#explorer-flow .round-jump select {
  width: 10.5em;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--elevated);
  color: var(--flow-ink);
  font: 500 .8125rem/1.5 var(--flow-sans);
  cursor: pointer;
}

#explorer-flow .timeline {
  --rail-width: 92px;
  --rail-gap: clamp(14px, 2cqi, 23px);
  --dot-size: 8px;
  --dot-top: 6px;
  margin: 0;
  padding: 19px var(--flow-gutter) 22px;
  list-style: none;
}

#explorer-flow .round {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  align-items: start;
  column-gap: var(--rail-gap);
  scroll-margin-block-start: 16px;
}

#explorer-flow .round:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-block-start: calc(var(--dot-top) + var(--dot-size) / 2);
  inset-inline-start: calc(var(--rail-width) - var(--dot-size) / 2 - .5px);
  height: 100%;
  border-inline-start: 1px solid var(--petrol);
  pointer-events: none;
}

#explorer-flow .round-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 3px;
  color: var(--flow-muted);
  font: 450 .8125rem/1.5 var(--flow-sans);
  font-variant-numeric: tabular-nums;
}

#explorer-flow .round-marker {
  position: absolute;
  inset: var(--dot-top) 0 auto auto;
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  border: 2px solid var(--teal);
  background: var(--flow-paper);
  box-shadow: 0 0 0 3px var(--flow-paper);
}

#explorer-flow .round:has(.mission-tree[open]) .round-marker {
  border-color: var(--flow-accent);
  background: var(--teal);
}

#explorer-flow .decision-time {
  display: inline-flex;
  flex-direction: column;
  align-items: start;
  padding: 0;
  background: transparent;
  color: var(--flow-muted);
  text-align: start;
}
#explorer-flow .decision-label { color: var(--flow-muted); }
#explorer-flow .decision-time time,
#explorer-flow .mission-tree time,
#explorer-flow .coordination time {
  color: inherit;
  font: 400 .8125rem/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#explorer-flow .text-detail,
#explorer-flow .tree-more,
#explorer-flow button.decision-time time {
  color: var(--flow-ink);
  text-decoration: underline;
  text-decoration-color: var(--flow-underline);
  text-underline-offset: .2em;
}

#explorer-flow .text-detail,
#explorer-flow .tree-more {
  max-width: 100%;
  padding: 0;
  background: transparent;
  font: inherit;
  font-weight: 450;
  text-align: start;
  overflow-wrap: anywhere;
}

#explorer-flow :is(.text-detail, .tree-more):hover,
#explorer-flow button.decision-time:hover time {
  color: var(--flow-accent);
  text-decoration-color: var(--teal);
}

#explorer-flow .round-copy { min-width: 0; max-width: 46rem; }
#explorer-flow .round:not(:last-child) .round-copy { padding-bottom: clamp(20px, 2.5cqi, 29px); }
#explorer-flow .round-heading { display: grid; justify-items: start; gap: 2px; }
#explorer-flow .round-kicker {
  color: var(--flow-muted);
  font: 500 .6875rem/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  letter-spacing: .085em;
}

#explorer-flow .round-title,
#explorer-flow .mission-heading {
  margin: 0;
  color: var(--flow-ink);
  font: 500 clamp(1.1875rem, 2.3cqi, 1.5rem)/1.2 var(--font-display);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

#explorer-flow .mission-heading { margin-block-start: 12px; font-size: 1.1875rem; }
#explorer-flow .round-narrative { margin: 4px 0 0; color: var(--flow-muted); font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; }
#explorer-flow .round-links { margin-top: 4px; color: var(--flow-muted); font-size: .875rem; }
#explorer-flow .run-story > .explorer-empty-copy {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 106px;
  padding: 20px var(--flow-gutter);
  color: var(--flow-muted);
  font: 400 1rem/1.5 var(--flow-sans);
}
#explorer-flow .run-story > .explorer-empty-copy::before {
  content: "";
  flex: 0 0 10px;
  height: 38px;
  background:
    radial-gradient(circle at center, var(--flow-paper) 2px, var(--faint) 2.5px 3px, transparent 3.5px),
    linear-gradient(var(--flow-guide), var(--flow-guide)) center / 1px 100% no-repeat;
}

#explorer-flow .mission-tree,
#explorer-flow .coordination {
  --tree-indent: 17px;
  --tree-joint: 16px;
}

#explorer-flow .mission-tree { max-width: 100%; margin: 8px 0 0; }
#explorer-flow .mission-tree,
#explorer-flow .coordination { font: 400 1rem/1.5 var(--flow-sans); }
#explorer-flow :is(.mission-tree, .coordination) summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding-block: 4px;
  color: var(--flow-ink);
  font: inherit;
  cursor: pointer;
  list-style: none;
}

#explorer-flow :is(.mission-tree, .coordination) summary::-webkit-details-marker { display: none; }
#explorer-flow .tree-branch > summary { width: 100%; }
#explorer-flow .mission-tree[open] > summary {
  padding-inline: 10px;
  border-radius: var(--control-radius);
  background: var(--petrol);
}
#explorer-flow :is(.mission-tree, .coordination) summary::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-inline: 2px;
  border: solid var(--flow-muted);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-1px) rotate(-45deg);
}
#explorer-flow :is(.mission-tree, .tree-branch)[open] > summary::before { transform: translateY(-3px) rotate(45deg); }
#explorer-flow .tree-fold-label,
#explorer-flow .tree-branch[open] > summary > .tree-title { color: var(--flow-ink); }
#explorer-flow .tree-fold-label,
#explorer-flow .tree-title { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
#explorer-flow .tree-inner .tree-title { font-weight: 500; }
#explorer-flow summary:hover :is(.tree-fold-label, .tree-title) { text-decoration: underline; text-underline-offset: .18em; }

#explorer-flow :is(.tree-count, .tree-meta, .tree-caption) {
  color: var(--flow-muted);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
#explorer-flow .mission-tree > summary .tree-count {
  border-inline-start: 1px solid var(--flow-guide);
  padding-inline-start: 9px;
}

#explorer-flow .tree-list { margin: 3px 0 6px; padding: 0 0 0 5px; list-style: none; }
#explorer-flow .tree-list > li {
  position: relative;
  min-width: 0;
  padding-inline-start: var(--tree-indent);
}
#explorer-flow .tree-list > li::before,
#explorer-flow .tree-list > li::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  pointer-events: none;
}
#explorer-flow .tree-list > li::before {
  inset-block: 0;
  border-inline-start: 1px solid var(--flow-guide);
}
#explorer-flow .tree-list > li:last-child::before { inset-block-end: auto; height: var(--tree-joint); }
#explorer-flow .tree-list > li::after {
  inset-block-start: var(--tree-joint);
  width: calc(var(--tree-indent) - 3px);
  border-block-start: 1px solid var(--flow-guide);
}

#explorer-flow .run-story details[open] > .tree-content { margin-top: 0; }
#explorer-flow .tree-content { min-width: 0; padding-bottom: 3px; overflow-wrap: anywhere; }
#explorer-flow .tree-leaf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; padding-block: 4px; }
#explorer-flow :is(.mission-tree, .coordination) time { color: var(--flow-muted); }
#explorer-flow .tree-relations { margin: 4px 0 6px; }
#explorer-flow .tree-branch > .tree-content > .tree-relations {
  margin-inline-start: 5px;
  padding-inline-start: var(--tree-indent);
  border-inline-start: 1px solid var(--flow-guide);
}
#explorer-flow .tree-caption { margin: 6px 0 2px; font-weight: 600; }
#explorer-flow .tree-observation { margin: 3px 0 6px; }
#explorer-flow .tree-more { margin: 1px 0; padding-block: 4px; font-size: .875rem; }

#explorer-flow .coordination {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px;
  padding: 9px var(--flow-gutter);
  border-top: 1px solid var(--flow-line);
  background: color-mix(in srgb, var(--elevated) 40%, var(--panel));
  color: var(--flow-muted);
}
#explorer-flow .coordination > details { max-width: 100%; }
#explorer-flow .coordination > details[open] { flex-basis: 100%; }
#explorer-flow .coordination > .text-detail {
  margin-inline-start: auto;
  font-size: .875rem;
}

@container run-timeline (max-width: 680px) {
  #explorer-flow .timeline { --rail-width: 85px; --rail-gap: 16px; }
}

@container run-timeline (max-width: 520px) {
  #explorer-flow .timeline { --rail-gap: 12px; --dot-top: 7px; }
  #explorer-flow .round { grid-template-columns: var(--dot-size) minmax(0, 1fr); row-gap: 3px; }
  #explorer-flow .round:not(:last-child)::before { inset-inline-start: calc(var(--dot-size) / 2 - .5px); }
  #explorer-flow .round-rail {
    grid-column: 1 / -1;
    flex-flow: row wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding-inline-start: calc(var(--dot-size) + var(--rail-gap));
  }
  #explorer-flow .round-marker { inset-inline: 0 auto; }
  #explorer-flow .decision-time { flex-direction: row; align-items: baseline; gap: 5px; }
  #explorer-flow .round-copy { grid-column: 2; }
  #explorer-flow :is(.mission-tree, .coordination) { --tree-indent: 10px; }
  #explorer-flow :is(.mission-tree, .coordination) summary,
  #explorer-flow .tree-leaf { column-gap: 5px; }
  #explorer-flow .tree-inner { padding-inline-start: 2px; }
  #explorer-flow .coordination > .text-detail { margin-inline-start: 0; }
}

@media (pointer: coarse) {
  #explorer-flow :is(.mission-tree, .coordination) { --tree-joint: 22px; }
  #explorer-flow :is(.mission-tree, .coordination) summary,
  #explorer-flow .tree-more { min-height: 44px; padding-block: 10px; }
  #explorer-flow :is(.round-jump select, .trace-follow, .coordination > .text-detail) { min-height: 44px; }
}
