/*
 * Времева линия като страница от дневник на обекта: номерирани етапи с линии, една вертикална
 * мастилена линия за прогреса, акцент само за текущото. Времето на етапа е лента върху ОБЩА скала
 * (най-дългият етап = 100 %), така че разликата между етапите се вижда с един поглед.
 */
.tl { font-size: 14px; }
.tl-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: end; padding-bottom: 14px; border-bottom: 2px solid var(--rule); margin-bottom: 4px; }
.tl-pct { font: 600 40px/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tl-pct small { font-size: .45em; color: var(--muted); margin-left: 2px; }
.tl-now { font-weight: 600; font-size: 16px; line-height: 1.25; }
.tl-sub { color: var(--muted); font: 12px var(--mono); font-variant-numeric: tabular-nums; margin-top: 2px; }

.tl-body { position: relative; }
.tl-rail { position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-fill { width: 100%; background: var(--rule); transition: height .8s ease; }

.tl-stages { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-stage { position: relative; padding: 12px 0 12px 44px; border-bottom: 1px solid var(--line); }
.tl-stage:last-child { border-bottom: 0; }
.tl-dot {
  position: absolute; left: 0; top: 12px; width: 32px; height: 32px;
  display: grid; place-items: center; font: 600 12px var(--mono);
  background: var(--bg); color: var(--muted); border: 2px solid var(--line);
}
.tl-stage.ok .tl-dot { background: var(--rule); border-color: var(--rule); color: var(--bg); }
.tl-stage.failed .tl-dot { background: var(--warn); border-color: var(--warn); color: #fff; }
.tl-stage.running .tl-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.tl-stage.running .tl-dot::after { content: ""; position: absolute; inset: -6px; border: 2px solid var(--accent); animation: tl-pulse 1.6s ease-out infinite; }
@keyframes tl-pulse { from { opacity: .7; transform: scale(.85); } to { opacity: 0; transform: scale(1.25); } }

.tl-title {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; min-height: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.tl-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tl-label { font-weight: 600; font-size: 15px; line-height: 1.25; min-width: 0; }
.tl-stage.pending .tl-label { color: var(--muted); font-weight: 500; }
.tl-stage.running .tl-label { color: var(--accent); }
.tl-par { margin-left: 8px; padding: 1px 6px; border: 1px solid currentColor; color: var(--muted); font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; vertical-align: 2px; }
.tl-meta { display: flex; gap: 10px; flex: none; color: var(--muted); font: 12px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-hint { color: var(--muted); font-size: 12.5px; margin-top: 1px; }

/* Време на етапа върху обща скала */
.tl-scale { height: 4px; background: var(--sunken); margin-top: 8px; }
.tl-scale i { display: block; height: 100%; background: var(--muted); }
.tl-stage.running .tl-scale i { background: var(--accent); }
.tl-stage.ok .tl-scale i { background: var(--rule); }

.tl-steps { list-style: none; margin: 10px 0 2px; padding: 0; }
.tl-step { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: start; padding: 5px 0; border-top: 1px dashed var(--line); }
.tl-step time { color: var(--muted); font: 11.5px var(--mono); font-variant-numeric: tabular-nums; padding-top: 2px; }
.tl-ico { width: 14px; height: 14px; margin-top: 3px; display: grid; place-items: center; font-size: 10px; font-weight: 700; border: 1.5px solid var(--line); }
.tl-step.ok .tl-ico { background: var(--rule); border-color: var(--rule); color: var(--bg); }
.tl-step.failed .tl-ico { background: var(--warn); border-color: var(--warn); color: #fff; }
.tl-step.running .tl-ico { border-color: var(--accent); border-radius: 50%; border-top-color: transparent; animation: tl-spin .9s linear infinite; }
@keyframes tl-spin { to { transform: rotate(360deg); } }
.tl-step.pending, .tl-step.skipped { color: var(--muted); }
.tl-step.skipped .tl-step-label { text-decoration: line-through; text-decoration-color: var(--line); }
.tl-step-body { display: grid; gap: 2px; min-width: 0; }
.tl-step.running .tl-step-label { font-weight: 600; color: var(--accent); }
.tl-note { color: var(--muted); font: 11.5px var(--mono); overflow-wrap: anywhere; }
.tl-mini { display: block; height: 3px; background: var(--sunken); overflow: hidden; max-width: 240px; margin-top: 3px; }
.tl-mini i { display: block; height: 100%; background: var(--accent); transition: width .5s; }

@media (prefers-reduced-motion: reduce) {
  .tl-fill, .tl-mini i { transition: none; }
  .tl-stage.running .tl-dot::after, .tl-step.running .tl-ico { animation: none; }
}
