/* ── Timeline overlay ─────────────────────────── */
#timeline-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease;
}

#timeline-overlay.hidden { display: none; }

#timeline-modal {
  width: 980px;
  max-width: 95vw;
  max-height: 88vh;
  background: #111111;
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.22s ease;
}

/* ── Header ───────────────────────────────────── */
#timeline-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

#timeline-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

#timeline-header__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#timeline-fontsize-controls {
  display: flex;
  gap: 5px;
}

#timeline-fontsize-controls button {
  height: 28px;
  padding: 0 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}

#timeline-fontsize-controls button:hover {
  background: var(--accent-bg);
  color: var(--text-primary);
}

#timeline-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}

#timeline-close-btn:hover { background: var(--accent-bg); color: var(--text-primary); }

/* ── Content ──────────────────────────────────── */
#timeline-content {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.10) transparent;
}

/* ── Phase group ──────────────────────────────── */
.timeline-group__title {
  font-size: calc(11px * var(--tl-font-scale, 1));
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 18px 20px 8px;
}

.timeline-group:first-child .timeline-group__title { padding-top: 10px; }

.timeline-group__list {
  border-left: 2px solid var(--border-subtle);
  margin: 0 20px 0 26px;
}

/* ── Process item ─────────────────────────────── */
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  margin-left: -2px;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast);
}

.timeline-item:hover {
  background: rgba(255,255,255,0.05);
}

.timeline-item__id {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: calc(11px * var(--tl-font-scale, 1));
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  margin-top: 1px;
}

.timeline-item__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.timeline-item__name {
  font-size: calc(13px * var(--tl-font-scale, 1));
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.timeline-item__why {
  font-size: calc(12px * var(--tl-font-scale, 1));
  color: var(--text-secondary);
  line-height: 1.5;
}
