/* assets/css/timeline.css
   Stream + Audit views of the Timeline route.
   Tokens only — no :root here (app.css owns static tokens).
   The timer/timesheet view keeps its own styles in time-tracking.css.
*/

.tl-controls {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.tl-ctl { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.tl-ctl--grow { flex: 1 1 220px; }
.tl-ctl select,
.tl-ctl input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: inherit;
  font: inherit;
}

.tl-list { min-height: 120px; }

/* ---- day grouping -------------------------------------------------------- */
.tl-day + .tl-day { margin-top: var(--space-3); }

.tl-day__heading {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 0 var(--space-2);
  padding: 6px 0;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
}

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

/* ---- one event ----------------------------------------------------------- */
.tl-row {
  display: grid;
  grid-template-columns: 56px 16px 1fr;
  align-items: start;
  gap: var(--space-2);
  padding: 8px 0;
  position: relative;
}

/* The rail: a continuous line behind the dots, trimmed at the group's ends. */
.tl-row::before {
  content: '';
  position: absolute;
  left: calc(56px + var(--space-2) + 7px);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl-row:first-child::before { top: 50%; }
.tl-row:last-child::before { bottom: 50%; }

.tl-row__time {
  font-size: .8rem;
  color: var(--text-muted);
  padding-top: 2px;
  text-align: right;
}

.tl-row__dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  justify-self: center;
}

.tl-row__body { min-width: 0; }

.tl-row__summary {
  margin: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tl-row__meta {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--text-muted);
}

.tl-row__who { font-weight: 500; }

.tl-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: .72rem;
  line-height: 1.5;
}

/* Severity reads on the dot, not the text — keeps the list calm when a run of
   warnings comes through. */
.tl-sev-warn    .tl-row__dot { border-color: #d98324; }
.tl-sev-error   .tl-row__dot { border-color: #d1495b; }
.tl-sev-success .tl-row__dot { border-color: #2e9e6b; }
.tl-chip--audit { border-style: dashed; }

/* ---- empty + paging ------------------------------------------------------ */
.tl-empty {
  padding: var(--space-3) 0;
  color: var(--text-muted);
}
.tl-empty p { margin: 0 0 4px; }

.tl-more { margin-top: var(--space-3); }

.tl-list[aria-busy='true'] { opacity: .6; }
