/* The audit trail, read on the record it belongs to (slice 100). The shape is the
   CEO's reference — Shopify's order timeline: a vertical rail, one sentence per
   row, day headers, and the time on the right. */

.timeline {
  margin-top: var(--space-6);
}

.timeline__heading {
  font-size: var(--text-base);
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.timeline__day {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-body);
  text-transform: uppercase;
}

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

/* The rail: a continuous line behind the dots, drawn on the row so it joins up
   without a separate element. */
.timeline__row {
  position: relative;
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  align-items: start;
  gap: var(--space-3);
  padding: 0.4rem 0;
}
.timeline__row::before {
  content: "";
  position: absolute;
  left: 0.8125rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}
.timeline__row:first-child::before { top: 1rem; }
.timeline__row:last-child::before  { bottom: calc(100% - 1rem); }

.timeline__dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-body);
}

/* An agent-authored line is marked by its ICON (sparkles), not by colour — the
   design system has no AI role and inventing one is a bigger decision than this
   slice should make. The tint here is the same border treatment, a shade up. */
.timeline__dot--agent {
  border-color: var(--color-violet-300);
  color: var(--color-violet-600);
}

.timeline__icon {
  width: 0.9375rem;
  height: 0.9375rem;
}

.timeline__body {
  min-width: 0;
  padding-top: 0.2rem;
}

.timeline__time {
  padding-top: 0.2rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-body);
  white-space: nowrap;
}

/* A row with something behind it: the sentence is the summary, the detail opens
   underneath. A row with nothing stored renders no disclosure at all. */
.timeline__detail > summary {
  cursor: pointer;
}
.timeline__detail[open] > summary {
  margin-bottom: var(--space-2);
}

.timeline__changes {
  display: grid;
  grid-template-columns: minmax(6rem, auto) 1fr;
  gap: 0.15rem var(--space-3);
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
}
.timeline__changes dt {
  color: var(--color-text-body);
}
.timeline__changes dd {
  margin: 0;
}

.timeline__was {
  color: var(--color-text-body);
  text-decoration: line-through;
}
.timeline__arrow {
  margin: 0 0.35rem;
  color: var(--color-text-body);
}

.timeline__lines {
  margin: 0 0 var(--space-2);
  padding-left: 1.1rem;
  font-size: var(--text-xs);
}

.timeline__more {
  margin: var(--space-3) 0 0;
}

/* A line inside an expanded row: which line changed, then its fields. */
.timeline__line-head {
  margin: var(--space-2) 0 0.15rem;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-body);
}
.timeline__line {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
}
